Go Down

Topic: [SOLVED] DS3231 drawing 200+µA through SDA/SCL (Read 5583 times) previous topic - next topic

coastline

Jan 29, 2015, 08:54 pm Last Edit: Feb 01, 2015, 05:21 pm by coastline
Solved - See post #7 below

-------------------------------------------------------------------
Original Post:


Have a project with a Pro Mini 5V, 1602 LCD I2c, and DS3231 I2c.

I am trying to get a low power sleep following Nick's and others power saving suggestions.

I have removed power led and regulator from pro mini.

I have removed power led and charge circuit on DS3231 and replaced rechargeable battery with CR2032

I am powering both LCD and DS3231 through a digital output pin.

sleep_mode = SLEEP_MODE_PWR_DOWN
ADC disabled
BOD disabled

wake through pin interupt


Everything is working well but I cannot get below 228µA when in sleep mode.

I have narrowed the culprit down to the DS3231 seeming to draw 200+µA through the SDA/SCL lines.  When I disconnect the SDA/SCL from the DS3231 (but not the 1602 LCD) the power use drops below the 1µA level  ;D .  I can see power use drop 100+µA per line as I disconnect each one.

I just need to know what is happening and how to fix it.  I assume it is something to do with the DS3231 and not the I2c on the pro Mini as the 1602 LCD does not affect it in the same way.

Thanks for looking.

My first post and I am a noob to Arduino so apologies if I have not included enough info or posted in wrong section.

Tony

coastline

Could this be because of internal pull-ups on the SDA and SCL lines?

Not sure why the power is not drawn when just the 1602 LCD is connected to I2c!

I don't have any external pullup resistors on the SDA SCL lines if that makes any difference.

SurferTim

Which DS3231 breakout board are you using? Some have pullup resistors on the SDA and SCL lines.
If it is one like the board on this link, then it does. Here is a link to the schematic

coastline

Thanks.  Yes that's the one!

So.....

should I remove them?

its the top set of the two groups of four resisters (to the right of SDA and VCC pins) on the picture you linked to - I think!

Also can you explain to an idiot...... how they are causing this issue when the power line they are pulling against (digital output pin from pro mini) is low.

it is almost as if the power is being drawn along the SDA/SCL from the pro mini - is that possible?

You may guess my electronics knowledge is very limited - I'm in a project way above my knowledge base putting stuff together from other peoples projects - and not always understanding why it works!  So thanks for the input.

SurferTim

#4
Jan 30, 2015, 12:20 am Last Edit: Jan 30, 2015, 12:33 am by SurferTim
If the pro mini SDA and SCL lines are low, then they will be drawing current through the pullup resistors. The pullup resistors are connected to the power supply (Vcc pin).

edit: Are you powering this device with a digital pin? If so, and you have the SDA and SCL lines low, then that explains the current drain. This is from the Atmel datasheet referring to the I2C data and clock lines on page 210.
Quote
As depicted in Figure 22-1 on page 209, both bus lines are connected to the positive supply voltage through pull-up resistors.
So if there are pullup resistors on the Atmel processor, and now the pullup resistors on the breakout board are now pulldown resistors, there is your current draw.
http://www.atmel.com/Images/doc2545.pdf

coastline

OK - that makes sense regarding the drain.


Yes - I am powering the DS3231 via digital pin.


So when  I send the pro mini to sleep I also set the digital pin powering the DS3231 to low cutting the power.


How do I prevent the power drain?


Can I turn off the internal pull-up resistors on the I2C of the atmel - they are set automatically I think?  Or is there something else I need to do?

SurferTim

You could remove the pullups on the breakout board. Insure you remove the correct quad resistor pack. One is the pullups for the I2C (remove) and the other is for the address jumpers (don't remove).

coastline

Thanks for your help SurferTim.

SOLVED!

I removed the resistors (top set of four) from the DS3231 and added 4k7 resistors to the SDA and SCL lines to the Digital pin I was using to power the DS3231.

This still didn't reduce the draw.

Next I disabled the internal (Atmel) pullup resistors that the Wire library sets automatically.  There is code to do this here http://www.varesano.net/blog/fabio/how-disable-internal-arduino-atmega-pullups-sda-and-scl-i2c-bus or you can just edit the wire library itself which I did.

Just edit libraries/wire/utility/twi.c and comment out the following:

Code: [Select]
// activate internal pullups for twi.
  digitalWrite(SDA, 1);
  digitalWrite(SCL, 1);


Hey presto - 0.1 to 0.2µA draw whilst sleeping  ;D (Now that's more like it -  very happy)!

I tested again with another DS3231 which still had the on-board resistors and it still sleeps at 0.1 to 0.2µA draw - so no need to remove the on-board resistors just disable the Atmel internal pullups and the drain is gone. 

Not sure if there is any other effect of having two sets of resistors in play but it is not affecting my current draw (or communications) so I guess it's one less mod to do - and they were a pain in the .... to remove - tip for anyone trying to remove SMD parts with a normal soldering iron - add more solder to get a heat bridge across all pads don't do what I did and try and de-solder each one separately  :-[ Learned a lot in the last few days.

Thanks again


Tony

Go Up