Recent Posts

Pages: [1] 2 3 ... 10
Hardware / Re: Encender Luces infrarrojo
Last post by tauro0221 - Today at 04:00 am
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.
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

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:
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.
Here's a feature request for this in the issue tracker:
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.
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() {

void loop() {

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.

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.

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

RTC_DS1307 rtc;

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

void setup () {

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

  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 =;
    Serial.print(now.year(), DEC);
    Serial.print(now.month(), DEC);
    Serial.print(, DEC);
    Serial.print(" (");
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(now.minute(), DEC);
    Serial.print(now.second(), DEC);
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    // 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(future.month(), DEC);
    Serial.print(, DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(future.minute(), DEC);
    Serial.print(future.second(), DEC);

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 forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
// 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()

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

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


  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.
    error = Wire.endTransmission();

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

    else if (error==4)
      Serial.print("Unknown error at address 0x");
      if (address<16)
  if (nDevices == 0)
    Serial.println("No I2C devices found\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?
Hardware / Re: Proyecto control de acceso...
Last post by tauro0221 - Today at 03:39 am
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.
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)


UPDATE, the answer is here and it works great
thanks Ps991
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