LCD blinking while off with other I2C devices connected

Hi everyone,

I am relatively new to Arduino and electronics in general so I often visit the forum in search of answers and advice. This time I came across a problem for which I couldn't find the answer so I am hoping someone will be able to give some insight.

I am building a project where I am using a cheap Chinese 16x2 LCD with integrated I2C shield along with an RTC module which is also connected over I2C pins to Arduino Nano. I plan for the circuit to be turned on pretty much 24/7 while the display is needed only for a short time while changing the settings. That's why I decided to use a logic level MOSFET to completely turn off the display while it's not needed, and it worked great. The problem appeared when I connected an RTC module which uses the same I2C pins. Every time Arduino reads from the RTC, LCD backlight, and power led on the back of the LCD module blink briefly even though the module is supposed to be completely off. Except for that, both modules work as expected and there are no other problems.
If I disconnect the LCD's positive lead the blinking stops, but when I disconnect the negative lead connected to the MOSFET the blinking continues, suggesting it's not MOSFET's fault.
I assume the I2C signal somehow allows the LCD to be powered but I don't know if it is because of the faulty LCD module, or that behavior is expected.
I don't like the idea of LCD being turned on every second or so, and it kind of beats the purpose of implementing the MOSFET to keep it off.

Sorry for the long post
Thank you :slight_smile:

Dendron:
That's why I decided to use a logic level MOSFET to completely turn off the display while it's not needed, and it worked great.

And that is where you went badly wrong, particularly since you do not understand how digital logic works! :astonished:

Dendron:
The problem appeared when I connected an RTC module which uses the same I2C pins. Every time Arduino reads from the RTC, LCD backlight, and power led on the back of the LCD module blink briefly even though the module is supposed to be completely off. Except for that, both modules work as expected and there are no other problems.

Yes, that is predictable. :roll_eyes:

Dendron:
If I disconnect the LCD's positive lead the blinking stops, but when I disconnect the negative lead connected to the MOSFET the blinking continues, suggesting it's not MOSFET's fault.
I assume the I2C signal somehow allows the LCD to be powered but I don't know if it is because of the faulty LCD module, or that behaviour is expected.

Right. Well that behaviour is most certainly to be expected.

Dendron:
I don't like the idea of LCD being turned on every second or so, and it kind of beats the purpose of implementing the MOSFET to keep it off.

It will not hurt it as such, but your ham-fisted wiring ideas just might. :astonished:

The first response here is to ask you for a schematic diagram of what you have done, but my guess from your description is that you have placed a FET to switch the ground line to the LCD module itself. Nothing obvious will happen as long as you do not attempt to use the I2C bus since its SDA and SCL are pulled HIGH by default. But when you activate I2C communications, these lines are pulled down in order to transfer the data and will therefore pull down the ground of any device connected, such as the "backpack" chip on the LCD - so it flashes whenever you perform an I2C transfer. This is referred to as "phantom powering". It is unclear whether this will actually damage the backpack IC, but it theoretically could (though the brevity of the transfers may avoid such damage).

Just get rid of the ill-conceived FET. It is completely unnecessary. :sunglasses:

The backpack allows you to switch off the LED(s) which illuminates the LCD, which is the main current consumption - 25 mA or so. The LCD module itself draws about 1400 µA of which 400 µA is the actual HD44780 clone while the contrast ladder draws 500 µA and the connection of the potentiometer to Vcc draws another 500 µA . You need to cut the wrong connection of the potentiometer to Vcc - this is a rather annoying blunder passed down through many designs by people who simply were not diligent in electronics design. This will save you 500 µA and reduce the "standby" drain to 900 µA. You can turn off the LCD display itself without losing initialisation or display data, but it will not reduce the current drain by any significant amount.

Paul__B thank you for your in-depth and informative answer!
That was my guess that I2C pulling down actually allows the electricity flow, but for some reason, I was expecting it would not "leak" to the main leads. I saw elsewhere on the forum someone successfully used MOSFET to cut off the display but I didn't realise the other I2C devices would cause problems.

Paul__B:
The backpack allows you to switch off the LED(s) which illuminates the LCD, which is the main current consumption - 25 mA or so. The LCD module itself draws about 1400 µA of which 400 µA is the actual HD44780 clone while the contrast ladder draws 500 µA and the connection of the potentiometer to Vcc draws another 500 µA . You need to cut the wrong connection of the potentiometer to Vcc - this is a rather annoying blunder passed down through many designs by people who simply were not diligent in electronics design. This will save you 500 µA and reduce the "standby" drain to 900 µA. You can turn off the LCD display itself without losing initialisation or display data, but it will not reduce the current drain by any significant amount.

This is useful information, thank you for that. Actually, my concern wasn't the energy consumption but I felt like the LCD module will keep on working for longer if it was turned off most of the time. Even if it is true, it's most likely not really relevant for the intended use of the project, so it's mostly due to my tendency to overengineer wherever I can. :stuck_out_tongue:

Paul__B:
Just get rid of the ill-conceived FET. It is completely unnecessary. :sunglasses:

This is probably the best way to do it so I will just turn off the display from code.

Thanks again for your help :slight_smile:

Dendron:
This is probably the best way to do it so I will just turn off the display from code.

In terms of power, the backlight is by far the biggest consumer.
If you are really concerned about it, you could remove the power led, and SDA/SCL pullup resistors from the backpack if the RTC module has pullups as you only need 1 pullup on each signal.
Each of the two 4.7k pullups consume about 1ma.

In terms of turning off the display the LCD 1.0 API provides a few function in this area:

  • backlight()/noBacklight() turns the backlight on/off
  • display()/noDisplay() turns the pixels on/off (saves a tiny bit but not much)
  • on()/off() turns on/off both the backlight and the pixels.

One nice thing about using these s/w functions vs turning off the power in h/w, is that when doing it through the sw API the display does not have to re-initalized and the contents of the display is preserved.

Note that not all "LiquidCrystal" libraries implement all of these functions.
The LiquidCrystal_I2C library in the IDE library manager implemented all of them, however on()/off() are stubs and do nothing.
The hd44780_I2Cexp i/o class in the hd44780 library implements all of them.

--- bill

bperrybap:
Each of the two 4.7k pullups consume about 1ma.

But only transiently during data transfer. As per the original problem here!