Sunspot Home

Arduino speaking variometer
- adding a Tiny RTC DS1307 clock board - working at last!

These are my backup project notes - please email me if interested

Add a real time clock (RTC) to the speaking variometer
- use it to time-stamp stored data of flights

Another board from China that presents many problems - but it is very cheap!

I bought this one on eBay for just £1.21 delivered - less than UK local postage?
Tiny RTC I2C DS1307 AT24C32 Real Time Clock Module For Arduino AVR PIC 51 ARM

They can be bought from many suppliers.

In company with many others I could not get it to keep time on battery when the main Vcc supply was off.


I fixed it by removing the components R4 R5 R6 and D1 (these charge the LIR2032 rechargeable lithium cell).
(Use copper wick de-soldering tape to suck off the solder from the surface mount components - then push them off).

I shorted R6 and fitted a standard Duracell 2032 non-rechargeable coin cell - it should last for years.

I also removed the i2c pull up resistors R2 and R3 (I am not sure if that was necessary as I did it before removing R4 etc).

The Tiny RTC needs 5 Volts i2c logic so I connected it to my 3.3v Arduino via a small FET level changer board.

This sketch was used to set the clock and prove that the power could be removed.
Load it first with this line active to set the clock then again with it commented out (//)- I will try a more advanced sketch soon that lets you adjust the date/time and test the 24C32 memory chip.
RTC.adjust(DateTime(__DATE__, __TIME__));

//Arduino with Tiny RTC I2C
#include <Wire.h>
#include "RTClib.h"

void setup () {
//Initialize the serial port, wire library and RTC module
//If we remove the comment from the following line, we will set up the module time and date with the computer one
// RTC.adjust(DateTime(__DATE__, __TIME__));

void loop () {
DateTime now =;
//We print the day
Serial.print(, DEC);
//We print the month
Serial.print(now.month(), DEC);
//We print the year
Serial.print(now.year(), DEC);
Serial.print(' ');
//We print the hour
Serial.print(now.hour(), DEC);
//We print the minutes
Serial.print(now.minute(), DEC);
//We print the seconds
Serial.print(now.second(), DEC);
//We check the time and sent through the serial port every 3s


Comments? email me