Recent Posts

Pages: [1] 2 3 ... 10
1
Hardware / Re: Encender Luces infrarrojo
Last post by tauro0221 - Today at 04:00 am
Hi,
De que distancia estas hablando. Podrias usar un esp8266 que es wifi y ya este viene con el relay.El problema es la distancia pero puedes usar un wfi extended y posiblemante te puede llegar a todas las luces. Estos extended se usan cuando tienes por ejemplo una casa de dos o tres pisos y no llega al tercer piso.Adjunto una  foto del esp8266 con el relay.
2
That chip as drawn appears to have two interfaces - SPI to a microcontroller, and the SD DAT/CLK/CMD lines out to an SD card.
See 3.3 here https://www.cactus-tech.com/files/cactus-tech.com/documents/whitepapers/An%20Introduction%20To%20SD%20Card%20Interface.pdf

I can't find a datasheet for the XY5200. It looks like chip talks to the CD card in SD Mode. Arduino libraries (SDfat) use SPI mode.  You'd have to work out some buffering scheme to let the XY5200 or the uC control the card, while controlling reset and such:
Quote
There are two bus protocols defined for SD Cards. The default mode is native SD mode but the card can be configured to use a slower SPI mode. Protocol selection is done during the first reset command after power up. The SD Card powers up in SD mode. To switch the card to SPI mode, the CS signal must be asserted while the host issues a reset command to the card. Once a particular protocol is configured, it cannot be changed while power is applied. The only way to switch between protocol modes is to do a power cycle.
3
Here's a feature request for this in the issue tracker:
https://github.com/arduino/Arduino/issues/7528
I'm sure I've seen it in previous feature requests with discussion but this is the only one I found after a short search.
4
Project Guidance / Re: Noob here: Mosfet question...
Last post by bigdonk - Today at 03:46 am
Just thought I would post an update.

I was able to get it working from all the advise above. I only have it on the breadboard with short wires. I will test out again with long wires when I get a chance. I was also able to find an old copy of Gobetwino and trigger a batch file on a windows pc for data logging as well as SMS and Email notifications. I don't know Python to make my own program, so I went with good ole batch file  :) Please don't laugh!

My code below if anyone wants to use or tell me a better way to do it. I only wanted a single notification for each up and down, so I got as creative as a novice can get...

Code: [Select]
int NorthSump = 7;
int SouthSump = 6;
int HotWaterTank = 5;


void setup() {
pinMode(NorthSump,INPUT_PULLUP);
pinMode(SouthSump,INPUT_PULLUP);
pinMode(HotWaterTank,INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
 WaterSensors();
}

void WaterSensors() {
 static int ns1 = 0;
 static int ss1 = 0;
 static int hwt1 = 0;
 char buffer[3];
 int ns = digitalRead(NorthSump);
 int ss = digitalRead(SouthSump);
 int hwt = digitalRead(HotWaterTank);
 if ((ns == 1) && (ns1 == 0)) { Serial.println("#S|NSUP|[]#"); ns1 = 1; } // Float is up
 if ((ns == 0) && (ns1 == 1)) { Serial.println("#S|NSDWN|[]#"); ns1 = 0; } // Float is down
 if ((ss == 1) && (ss1 == 0)) { Serial.println("#S|SSUP|[]#"); ss1 = 1; } // Float is up
 if ((ss == 0) && (ss1 == 1)) { Serial.println("#S|SSDWN|[]#"); ss1 = 0; } // Float is down
 if ((hwt == 1) && (hwt1 == 0)) { Serial.println("#S|HWTWET|[]#"); hwt1 = 1; } // Sensor is wet
 if ((hwt == 0) && (hwt1 == 1)) { Serial.println("#S|HWTDRY|[]#"); hwt1 = 0; } // Sensor is dry
}


Since the package of float sensors contained (6) sensors I am going to put 2 floats in each sump. (1) will monitor the on/off cycles of the sump pumps and (1) will be the alarm for High water in the sump. I won't add those until the single float setup is installed and tested.

Thx,
Don
5
Project Hub / Re: Wrong links to Project Hub...
Last post by ballscrewbob - Today at 03:45 am
Yes there is but Project hub is a COLLABORATION between Arduino and Hackster.

Your question would probably be better served over there.

Not that you have anything to show for 7 months work.



6
Project Guidance / Using RTCLib with Arduino Due
Last post by Pyrodron - Today at 03:44 am
Hello everyone,

I am attempting to use the RTCLib with a TinyRTC module that has a DS1307 RTC chip with a backup battery on it. With the following code, using it on an Arduino with the SDA and SLC pins connected, it is able to read and set the time on the module.

Code: [Select]
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"

#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
   #define Serial SerialUSB
#endif

RTC_DS1307 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif

  Serial.begin(9600);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }
}

void loop () {
    DateTime now = rtc.now();
    
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
    
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));
    
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
    
    Serial.println();
    delay(3000);
}


However, when I use the same code on the Arduino Due with SDA connected to pin 20 and SLA connected to pin 21, it doesn't work. I knew that the Due has different hardware for I2C communications, so I ran the program below to verify that the Due can pick up the module, and it was able to read the address of the RTC module.

Code: [Select]
// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//

#include <Wire.h>


void setup()
{
  Wire.begin();

  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}


What I'm not understanding is that if the Due can register that the device is there, why can't the RTC library communicate with it?
7
Hardware / Re: Proyecto control de acceso...
Last post by tauro0221 - Today at 03:39 am
Hi,
Si es debido a la distancia puedes anadirrle un pullup resistors a los pines del RFiD. Otra cosa que puedes hacer es la de comprar cables que sean trensados.
9
i know this is an old thread but i don't see a definitive answer to the question. did anyone work out yet how to get angles on 0-360? (or +/- 180)

i'm seeing the same problem as everyone else, when i pitch or roll past vertical the numbers start to decrease so, for example,  there is no way to tell between as 45 degree and 135 degree pitch or roll (don't care about yaw)

thanks

UPDATE, the answer is here and it works great
https://forum.arduino.cc/index.php?topic=331084.msg2287736#msg2287736
thanks Ps991
10
Software / Re: Como ejecutar el codigo de...
Last post by surbyte - Today at 03:32 am
Lo que quieres hacer se llama debuggear o debugging.

Puedes debuggear usando PlatformIO mas VSCode (PIO Unified Debugger) ver Primeros pasos de PIO Unified Debugger  y luego usar gratis x 1 mes la plataforma que te  lo permite y pasado dicho tiempo tendras que pagar una mensualidad que no recuerdo cuanto es pero no es cara.

Otras opciones son el Visual Atmel Studio que permite ejecutar paso a paso.

Para aprovechar todas esas herramientas deberías conocer lenguaje ensamblador del Arduino que quieras analizar, aunque no es excluyente.
Pages: [1] 2 3 ... 10