I have a NodeMCU and two LCD devices and an ADS1115 on one I2C bus. The LCD devices have I2C backpacks. The NodeMCU is on 5V USB power and internally operating at 3.3V. The other devices are on the second shared 5V power. Ground is shared.
The NodeMCU is using a logic level converter on SDA/SCL to talk to the rest of the I2C bus.
I have 10K Ohm resistors on SCL / SDA to pull up to VCC (the non-USB 5V supply).
Now I have set up a 2N2222 NPN transistor to interrupt or bridge the ground line of one of the LCD screens (LCD1). That turns on or off the LCD and that works.
What I noticed
Now what I noticed is that when I have LCD1 turned OFF using NPN, the backlight of the LCD1 sometimes flickers (once per second).
After some fiddling I found the flicker is related to I2C bus communication between NodeMCU and LCD2 or ADS1115. I just happened to have some I2C bus traffic to LCD2 once per second (to write the time) and some occasional traffic to the ADS1115, once every nine seconds. All those make the backlight of LCD1 flicker when it is turned off using NPN transistor.
I thought maybe this was due to current leaking through NPN transistor, but if I completely disconnect GND line on LCD1 the backlight still flickers. To state this clearly: LCD1 has VCC and SCL and SDA connected but not GND and the backlight is flickering.
So somehow the SCL / SDA cables going into LCD1 function as brief GND lines flickering the LCD backlight. I understand that SCL / SDA communication requires a device to pull the clock line down to GND so I assume at that point it is grounding the 5V power going into LCD1 causing a brief flicker on LCD1.
- Is it expected that backlight of LCD (with I2C backpack) would leak current from VCC towards the SCL/SDA lines?
- How do I work around this?
I have seen mention of 33 ohm resistor on SCL/SDA bus (in-line), but I doubt that would help except to slow down the flicker leak.
I have partial drawings, but nothing fully drawn out to show the above situation. I am still bread-boarding it out.
Attaching a very basic drawing done with Falstad, hopefully it helps to illustrate the basics: diagram