Forum Members section DIY Ferduino controller RTC DS1307

RTC DS1307  [SOLVED]

Ask here about your controller made with pieces purchased in other shops.

Post Number:#1 Post Thu Nov 20, 2014 7:31 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
hello fernando :-c
I did upload the code to the Arduino mega and the clock does not work.

I have a DS1307 RTC

I went to this page:
viewtopic.php?f=8&t=42

I tested the code and the rtc (pins 20, 21 - SDA, SCL) and it worked.
on pins 18, 19 does not work

I changed the code to the pins ferduino 20,21 and did not work.
also tested with pins 18,19 but did not work.

with the pins 18, 19 appears:
xxxxxxxxx85 of xxxxxxx 2165

with the pins 20, 21 appears:
xxxxxx 2000 xxxxxxxxxx05

and I can not set the date

can you help me?

PS: Sorry my english

Post Number:#2 Post Thu Nov 20, 2014 7:51 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Using the code available on topic called "codes for tests" you can't use pins 18 and 19. It works only with I2C (20 and 21).

Try the example "Search for I2C devices" to see if the Arduino can find the RTC.

What's the model of your RTC?

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Thu Nov 20, 2014 8:03 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
hi Fernando,
thanks for the quick response :-c

I have a RTC DS1307

I've tried the example "Search for I2C devices" and it works, he found two:
I2C device found at address 0x50!
I2C device found at address 0x68!



in the code ferduino I replaced this:

DS1307 rtc (18, 19); // Indicates which pins are connected to the RTC. (20, 21)
Time t_temp, t;

by this:

const int I2C_address = 0x68;
DS1307 rtc (20, 21); // Indicates which pins are connected to the RTC. (20, 21)
Time t_temp, t;

can you help me? :(( :ympray:

Post Number:#4 Post Thu Nov 20, 2014 8:22 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

This module have an EEPROM on board.

Check this topic.

The address for DS1307 is 0x68.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Thu Nov 20, 2014 8:33 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
I do not understand, because RTC is equal to the 1st photo of the 3 post, should work on pins 20 and 21, right?

but it's weird because sometimes one appears:

xxxxxx85 of xxxxxxx 2165

and other displays:

xxxxxx01 xxxxxxxx 2010

what can it be? ~x(

Post Number:#6 Post Thu Nov 20, 2014 8:40 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Ferduino uses Henning's library and Henning's library isn't compatible with this module.

Buy a RTC without EEPROM on board.

This is your second problem because you bought pieces without look this topic.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Thu Nov 20, 2014 8:56 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Ferduino uses Henning's library and Henning's library isn't compatible with this module.

Buy a RTC without EEPROM on board.



OK, I did not know x_x

I did not buy the material for this project, I am using mateiral that had :D

Post Number:#8 Post Sat Nov 22, 2014 1:53 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
hello Fernando,
could you tell me if this RTC is compatible with the Ferduino?

Thank you
Norberto Pinheiro

Post Number:#9 Post Sat Nov 22, 2014 2:00 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Yes, is compatible.

And this circuit too.

Image


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#10 Post Sat Nov 22, 2014 2:08 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Great Fernando ^:)^

Thank you
Norberto Pinheiro

Post Number:#11 Post Fri Dec 05, 2014 12:49 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Hi!

Yes, is compatible.

And this circuit too.

Image: http://img339.imageshack.us/img339/2475/ds1307.jpg

Best regards.


hello fernando,
I'm trying to mount the RTC as the schema.
my connections are:

xxxxxx
pin 1 x x pin 5
pin 2 x x pin 6
pin 3 x x pin SCL
pin 4 x x pin SDA
xxxxxx


pin 4 =>GND
pin 3 => + battery
pin 2 => Cristal 32.768Khz
pin 1 => Cristal 32.768Khz
pin 5 => Diodo 1N4148 => 5V
pin 6 =>GND
pin SCL => 10K resistor => pin 21 Arduino Mega
pin SDA => 10K resistor => pin 20 Arduino Mega

but does not work, I've tested it with the code for rtc thishttp://www.ferduino.com/forum/viewtopic.php?f=8&t=42 page and not work.

I tried the same code but with another rtc I have, (with EEPROM) and gave.
You can help me?

Post Number:#12 Post Fri Dec 05, 2014 1:20 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I don't understand fine what you told but, seems wrong.

Some pictures can help.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#13 Post Fri Dec 05, 2014 5:40 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
hello Fernando,
I did many tests and I just connect the watch to the Arduino , it works , but when I turn all no longer works.
the problem is only when I connect the GND of the RTC to the Arduino.

I made the connections at is this site

You made helpme to solve this problem, please :ympray: :ympray: :ympray: ?

Post Number:#14 Post Fri Dec 05, 2014 7:25 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Maybe this battery is bad.

Do test without battery.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#15 Post Fri Dec 05, 2014 7:34 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Maybe this battery is bad.

Do test without battery.


test without baterry with code RTC in this pageand works. :-c

but with ferduino code dont work :(( :((
Last edited by Norberto Pinheiro on Fri Dec 05, 2014 7:56 pm, edited 1 time in total.

Post Number:#16 Post Fri Dec 05, 2014 7:52 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Are you using a external power supply (7-12V)?
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#17 Post Fri Dec 05, 2014 7:59 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
no, I'm powering the Arduino with usb cable

Post Number:#18 Post Fri Dec 05, 2014 8:16 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Try it! :)

Using 12V the regulator can overheat, take care.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#19 Post Fri Dec 05, 2014 8:19 pm
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Fernando,
I put the code of RTC in the ferduino code and the message in the serial print is:


I2C device found at address 0x68 !

if ferduino found RTC then it should work, right ?

Post Number:#20 Post Fri Dec 05, 2014 8:41 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Yes, but the RTC doesn't work with low voltage.

Try this code:


#include <DS1307henning.h>

// Init the DS1307
DS1307 rtc(20, 21);

void setup()
{
  // Set the clock to run-mode
  rtc.halt(false);
 
  // Setup Serial connection
  Serial.begin(9600);

  // The following lines can be commented out to use the values already stored in the DS1307
  rtc.setDOW(DOMINGO);        // Set Day-of-Week to SUNDAY
  rtc.setTime(12, 0, 0);     // Set the time to 12:00:00 (24hr format)
  rtc.setDate(3, 10, 2010);   // Set the date to October 3th, 2010
}

void loop()
{
  // Send Day-of-Week
  Serial.print(rtc.getDOWStr());
  Serial.print(" ");
 
  // Send date
  Serial.print(rtc.getDateStr());
  Serial.print(" -- ");

  // Send time
  Serial.println(rtc.getTimeStr());
 
  // Wait one second before repeating :)
  delay (1000);
}
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Next



Return to DIY Ferduino controller





Who is online

Users viewing this topic: No registered users and 1 guest