onehorse
Well-known member
I am in the middle of designing and building an accurate I2C RTC add-on board for the Teensy 3.x and finally have something interesting to show.
The hardware building blocks are the M41T62LC6F RTC with embedded crystal and oscillator that is super small, a M24512DFC 64 kbyte EEPROM, an MS5637 pressure/temperature sensor, and a Taiyo Yuden PAS3225 14 mF super cap and 1N4148 diode to keep power on the timer when separated from power or when the battery conks out or has to be changed. These have been integrated onto an appallingly small board intended to mount directly onto the Teensy 3.x and use 3V3 and GND from digitalWrite(HIGH) and digitalWrite(LOW), respectively, in this case from pins 15 (3V3) and 10 (GND), while using the I2C port at 16/17. The interrupt signal out is on pin 9 and the programmable square-wave output is on pin 8. Here is a picture of the first board and how I hooked it up using jumpers (notice I am using digitalWrite to pins 10 and 15 to power it!):
I don't seem to be able to upload any pictures with the usual uploader, but the basic one works!
Well, my plan is to work on the software while I'm at CES to use the (512 Hz) square-wave output as a reference to measure the output frequency and use the error (deviation from 512.000 Hz) to correct the clock periodically (every 10, 100, or 1000 seconds TBD) using the internal calibration register of the M41T62. The pressure/temperature sensor is there to measure the clock error as a function of temperature, but in the end I expect that the calibration function will just keep the clock in tune no matter what the condition. To be demonstrated.
This is an intermediate version; the latest has an ST HTS221 humidity sensor squeezed onto the board so it can serve as a remote weather logger (finally have a use for the EEPROM!; it can also store the measured RTC calibration vs. temperature curve).
In addition to testing the calibration routine and seeing whether I can approach and then surpass the quoted +/- 2 ppm accuracy of the M41T62, I would like to test how long the supercap can keep the timer going without power. The specs say the cap can supply 5 microAH and the timer needs ~330 nAH at 2.6 V, so I expect to get at least 15 hours out of the super cap. But I will likely get more since the timer keeps running down to 1 V. Can this setup go 24 hours without power and still keep proper time? If so, that might be very useful.
This is close to how I envision this board will be used:
It's not here but in actual use it would just be soldered to the Teensy 3.x and keep accurate time without the external 32 kHz crystal or battery required by the native RTC embedded in the Teensy 3.x.
This was a fun board to design but tricky to assemble since I placed the caps so close. In my first attempt some of the caps slid around a bit and got just a tad askew. Well, pretty will be for later versions that I will no doubt try to sell at Tindie.com.
The hardware building blocks are the M41T62LC6F RTC with embedded crystal and oscillator that is super small, a M24512DFC 64 kbyte EEPROM, an MS5637 pressure/temperature sensor, and a Taiyo Yuden PAS3225 14 mF super cap and 1N4148 diode to keep power on the timer when separated from power or when the battery conks out or has to be changed. These have been integrated onto an appallingly small board intended to mount directly onto the Teensy 3.x and use 3V3 and GND from digitalWrite(HIGH) and digitalWrite(LOW), respectively, in this case from pins 15 (3V3) and 10 (GND), while using the I2C port at 16/17. The interrupt signal out is on pin 9 and the programmable square-wave output is on pin 8. Here is a picture of the first board and how I hooked it up using jumpers (notice I am using digitalWrite to pins 10 and 15 to power it!):
I don't seem to be able to upload any pictures with the usual uploader, but the basic one works!
Well, my plan is to work on the software while I'm at CES to use the (512 Hz) square-wave output as a reference to measure the output frequency and use the error (deviation from 512.000 Hz) to correct the clock periodically (every 10, 100, or 1000 seconds TBD) using the internal calibration register of the M41T62. The pressure/temperature sensor is there to measure the clock error as a function of temperature, but in the end I expect that the calibration function will just keep the clock in tune no matter what the condition. To be demonstrated.
This is an intermediate version; the latest has an ST HTS221 humidity sensor squeezed onto the board so it can serve as a remote weather logger (finally have a use for the EEPROM!; it can also store the measured RTC calibration vs. temperature curve).
In addition to testing the calibration routine and seeing whether I can approach and then surpass the quoted +/- 2 ppm accuracy of the M41T62, I would like to test how long the supercap can keep the timer going without power. The specs say the cap can supply 5 microAH and the timer needs ~330 nAH at 2.6 V, so I expect to get at least 15 hours out of the super cap. But I will likely get more since the timer keeps running down to 1 V. Can this setup go 24 hours without power and still keep proper time? If so, that might be very useful.
This is close to how I envision this board will be used:
It's not here but in actual use it would just be soldered to the Teensy 3.x and keep accurate time without the external 32 kHz crystal or battery required by the native RTC embedded in the Teensy 3.x.
This was a fun board to design but tricky to assemble since I placed the caps so close. In my first attempt some of the caps slid around a bit and got just a tad askew. Well, pretty will be for later versions that I will no doubt try to sell at Tindie.com.
Last edited: