Which RTC and lib to use with Teesy 3.2? (or 3.5)

Status
Not open for further replies.
Hello,
I have a pressure logger with the UNO R3 and Arduino datalogging shield.
I want to port it over to the Teensy LC or 3.2. The 3.5 has an SD card so it may be a no-brainer.
I'm also using a Teesy LC for another pressure reading device and it is amazing! It does not need an RTC.

I've been using the RTClib.h with the R3.
I saw a reference to the DS1307RTC library.

How accurate is the RTC in the Teensy? Is there a better choice that is more accurate?

What rtc libraries do you suggest for the Teensy?

Or is there a card with these on it? I have an OSEPP RTC&MicroSD card but it is kind of big. Much bigger than the teensy!

Thanks,
Bill
 
The Teensy's RTC does not have an integrated temp. sensor, which means it will drift a little bit over time.

As you mentioned, the Teensy LC does not support a built-in RTC. The Teensy 3.2 provides a RTC, but you will need to solder a 32.768 kHz, 12.5 pF crystal to the Teensy to the two holes provided on the chip. On the Teensy 3.5 and 3.6, the crystal is incorporated into the chip. In addition, you will need to attach a 3v coin cell battery to ground and the VBAT pins to power the RTC when the Teensy is not powered on.

The DS3231 based real time clocks claim to be more accurate because it incorporates a temp. sensor that varies the pulses so that it is more accurate. You can get DS3231's on ebay for around $4US from US based shippers. External RTC's generally use I2C to communicate. On the Teensy, you will need a pull-up resistor for each of the two I2C pins (18/19 for the main i2c bus). Typically on a Teensy you would want a 2.2K or 2.4K resistor for pull-ups. If any of your devices provide pull-up resistors on the board, you don't need it on the Teensy. You want to look for a RTC that supports 3.3v.

If you are in an area that can receive outdoor radio waves, the most accurate method of time keeping is to add a GPS receiver, since GPS sends out the accurate time stamps in order to triangulate your location. I see that you can get GPS units in the range of $14-20US.

If you are in an area that has an open wifi setup, you could use an ESP8266 chip to connect to the network time protocols (NTP) and sync your time.

If you want a system to mount external boards together with the Teensy like the Arduino shield system, Adafruit sells a Teensy 3.2/LC adapter to its feather system, and you can attach any of the feather boards:

You can mount a Teensy 3.5 or 3.6 on the feather adapter, providing you mount the Teensy underneath the feather board. You would need to use stacking headers or tall male headers so the USB connector has enough room, and you can push the program button if needed:
 
Last edited:
Teesny 3.5 is probably the best choice, since it has the SD card and RTC built in. You'll only need to add the 3V coin cell. Its performance is similar to DS1307.

Look at File > Examples > Time > TimeTeensy3 to get started with the RTC.

To use the SD card, put SD.begin(BUILTIN_SDCARD); in your code.
 
Hi Michael, thanks for the links! Paul, I'll stop by Microcenter - we are blessed to have 2 in the Atlanta metro! - and pick up a 3.5.
Those adapter boards from Adafruit do look very useful.
Thank you both for your replies!

Bill
 
I like the idea of using GPS time a lot. It will be accurate regardless (as long as there is signal, and this is an outside application) plus the location can be saved along with the time (regardless of the source of the time - GPS or RTC). That will be a bonus.

The 3.5 also has plenty of I/O - probably can assign a set of pins just for the GPS.

Microcenter in Duluth (GA) didn't have the 3.5 so I bought a 3.6. Getting ready to power it up. Don't have a GPS RX yet. Will start with the RTC. Will be looking at the examples. Thanks!
 
Note, most GPSes that I've seen use serial UART for communication. The 3.6 has 6 UARTs, though only two of the UARTS have FIFOs for high speed communication.

Do remember, the 3.6 is not 5v tolerant. You have to make sure that all I/O are 3.3v. I released the magic smoke on my first 3.6 due to 5v intolerance.
 
Status
Not open for further replies.
Back
Top