DS1307 RTC Module with Battery for Raspberry Pi (DFR0386)

This is a placeholder topic for “DS1307 RTC Module with Battery for Raspberry Pi” comments.

This RTC module is specifically designed for the Raspberry Pi. It communicates with Raspberry Pi through I2C bus and includes a Maxim DS1307 and CR1220 button cell on the board to keep a real time clock for a long time after the Pi has powered down. Just set a serial port, and you have a convenient way of online debugging using TTL. Supports Raspberry Pi B/A+/B+/2 model B/3 model B.

Read more

How does this 5V device (with no level-shifting) not damage a 3V3 logic-level device, such as a Pi (with no 5V tolerant GPIOs)?

Hi Peter,

There are inline resistors on the I2C pullups, so it’s safe to use with Raspberry Pi. This approach makes it a lot easier to use the DS1307 (or any I2C device) with any 3.3-5V hardware.


Hi Graham,
Thank you for your prompt response!

As you stated, they are pull-ups; they pull the IIC signals to 5V when the master or slave is not pulling the level to logic-LOW (perhaps the slave uses open- collector/drain).

Hence, I would expect 5V will appear on the IIC GPIOs of the Pi. However, the 5k resistors will limit the current from the 5V rail to the 3V3 master device to ( (5-3.3)/5k ) 340 micro-Amps, which, I guess, prevents damage (the Pi must be able overcome this to maintain 3V3, risky!). This may not be the case with all 3V3 master devices!

The DS1307 can only be supplied with 4.5 to 5.5V, but the minimum logic-HIGH level is 2V2, great!

To be safe, for a 3V3 master, I would have tied these to 3V3! A jumper to select 3V3 or 5V would be ideal.

Hi Peter,

No worries, happy to help. There’s nothing risky about it; in addition to the 5k resistors are the internal 1k8 resistors wired between GPIO 2/3 (SDA/SCL) and 3V3, the RPi is going to be fine.

Hi Graham,
From my calculations, 5k in series with 1k8 gives a voltage drop of 0V45 across 1k8; add the 3V3 and there should be appox. 3V75 where they meet (SCL and SDA).

Lets give the calculations a break and measure it: Approximately 3V85: Above spec, risky!
I used Sparkfun’s “DS1307 RTC Module”, which uses 4k7 pull-ups.

DF Robot’s DFR0151 utilises 3k3 pull-ups, while Adafruit’s 264 uses 2k2 pull-ups. According to my calculations, that approx. results in 3V9 and 4V1, respectively. I’ll measure the real-world values when I get some time!

I understand this somehow works and has worked for a long time with many people, but I wouldn’t do it!
If it wasn’t for the internal 1k8 pull-ups, the master would “see” 5V!
It’s just too much for an Electrical and Electronic Engineer to assume/risk.

Hi Peter,

I hear you, the lack of datasheet for BCM2837B0 / other RPi-only Broadcom chips can leave people feeling polarised on this topic. Rest assured it’s safe given the internal hardware and ample use-cases of this nature.

To be clear though; RPi is not 5V tolerant. This situation is quite different as I2C typically uses an open drain design and there’s plenty of input impedance to accommodate a simple method, safely.

Thanks Graham,
Just for completeness, using the DFR0151 and Adafruit 264, 4V2 and 4V0, respectively, is applied to the IIC pins of a Pi3. It does work and doesn’t seem to create any issues!

I recommend the DS3231 for 3V3 logic-level master devices: ADA3013 (I have used a fair bit) and ADA3028 (Slightly cheaper, “sits” flat, larger, but I haven’t used it, yet!).

Can I install this when using a FLIRC case? i.e. can I put this on any on the pins?

Am I right to say this device blocks access to the SDA and SCL pins? I.e you can’t connect additional I2C devices once this is attached?

1 Like

Hi Tim,

Youll be good to use other sensors/devices on the I2C pins as long as they have different addresses (and are 3.3V since that is what the Pi uses)

Thanks Liam. What I mean is it physically blocks the pins. There are pass-through pins for 5V, 3V3, GND, TX and RX, but the SDA and SCL pins have none. There are small pads where they would end that I’m thinking of soldering wires onto, but it will be fiddly.

1 Like

Hi Tim,

Oooh yeah, it will be hard to solder something to it with the RTC on, you could use something like this to break out the connections to another 40-pin connector: Pimoroni Pico HAT Hacker | PIM300 | Core Electronics Australia
HAT Hacker HAT | Pimoroni PIM511 | Core Electronics Australia

Yeah, I see. I was wondering if there was such an attachment to branch the pins. Unfortunately I’m using a case which is incompatible with both of these. I guess I’ll have to test my soldering skills. Thanks, though!

Hi Tim, you could just use a couple of jumper wires and splice them together