problem with 2 devices on I2C

Hello, I have this problem: I am running a real time module and an LCD display on one I2C bus. When both the devices are turned on, there is no problem. The thing is, I have a mosfet wired to the LCD to turn it off to conserve battery. And when I turn the LCD off, I cannot read time from the real time module. If I turn the power to the LCD back on, I can read the time. Can I somehow read the time even if the LCD is off?

You should never connect a device which is unpowered to a device which is powered.
In other words don't turn it off you might damage something.

So what else should I do? I do not want to keep the LCD turned on, that would drain my battery pretty quickly.

Can you turn off just the backlight on the LCD? The LCD itself will use very little power - they use LCDs in watches, you know.

It still draws around 5mA with backlight turned off, that is too much for my application.

Does it have a sleep command?

You either need some more complex electronics to turn it off and disconnect it (a relay?) or you need a different LCD that has a sleep mode.

What exact LCD are we looking at? Part number, datasheet link?

It is this LCD with this driver.

Screpheep:
It still draws around 5mA with backlight turned off

I have the same display & i2c backpack. I can confirm those readings. 5mA with no backlight, 21mA with backlight.

Screpheep:
So what else should I do? I do not want to keep the LCD turned on, that would drain my battery pretty quickly.

Use the AdaFruit I2C bidirectional level converter connect the LV pin to your switched power for the LCD. when the LCD is powered off it will disconnect the LCD from your I2C circuit. Connect the LCD's I2C connections to the 'A' side, the Arduino's I2C connections to the 'B' side.

Chuck.

An alternative, if your soldering skills are up to it:

I have an identical display without the i2c backpack. I measured it's current at only around 0.5mA (with no backlight). So the backpack is drawing the other 4.5mA. And I bet I know why. There is a power led on the backpack. You could try un-soldering that.

I desoldered the LED, it still draws 3 mA with the backpack...

This is now all a bit vague.

  1. Is this a device to be run on batteries/portable/ i.e. not via the mains?
    1.How long does this thing need to run for?
    2.What is the time it is "active" every hour compared to "inactive"?
    3.What is the current draw while "active"?
    4.What is the current draw while "inactive"?

Where is the device going to be left?
Are there any "environmental" concerns well out the spec of parts you have? (Considering batteries)

Screpheep:
I desoldered the LED, it still draws 3 mA with the backpack...

Damn.

Do you have enough spare Arduino pins to drive a pack-pack-less 16x02 ? You would need 7 pins, i think.

Another option would be one of those 0.9" OLED displays. They come with i2c interface and don't need a backlight. You do need good eyesight, though, they are small. You can get 1.3" version which might be better.

chucktodd:
Use the AdaFruit I2C bidirectional level converter connect the LV pin to your switched power for the LCD. when the LCD is powered off it will disconnect the LCD from your I2C circuit. Connect the LCD's I2C connections to the 'A' side, the Arduino's I2C connections to the 'B' side.

Chuck.

Secconded.

You can use an Arduino pin as the power source, as it seems the LCD stays under the 20mA maximum for a bare pin.

Guys, thanks for all the help, I solved it like this: The display will turn on with the datalogger, but the backlight will not. It is a crude solution, but it is good enough for now. In the future, I will get the bidirectional controler.

But now, I have another problem, i am logging data with this datalogger, it is also connected to a transistor switch to turn it off. But when I turn it off, it still draws around 5mA (LED is desoldered). If I remove the micro SD during operation, it draws almost nothig. Also, if I remove SD.begin() from my code, it also draws almost nothing. Any ideas ?

It's taking power from the SPI lines. After calling SD.begin(), the SPI communication lines are held high because "low" means select-this-chip, send-this-data.

You could digitalWrite() those lines to LOW before shutting it down. That probably won't disrupt the SPI communication too much. But it means you can't talk to any other SPI device and still maintain the low power consumption.

That's kind of a brute-force solution however. The better way would be to power down the interface chip properly. The photo of the datalogger looks like it's using a 74HC chip to do the level translation for the 3.3V SD card. There's probably a way of powering that down cleanly.

chucktodd:
Use the AdaFruit I2C bidirectional level converter connect the LV pin to your switched power for the LCD. when the LCD is powered off it will disconnect the LCD from your I2C circuit. Connect the LCD's I2C connections to the 'A' side, the Arduino's I2C connections to the 'B' side.

Chuck.

By the way, the board looks pretty simple, I could maybe create something similar (and simpler) for my project. Is there some kind of a schematic online?

Is there some kind of a schematic online?

It tells you on that page what the schematic is. Follow that link on "how it works":-