I recently bought a Grove 16x2 Blue Backlight LCD and the only annoying thing about it, is that the Backlight is directly connected to the power supply of the module, meaning it can't be turned off as easily as it would be on it's RGB Version. And so I wanted to ask, Is there any way to really power off an I2C Bus by using a certain library or module?
If you take the time to read the I2C specification it draws no power when idle. It uses open drain/collector outputs to drive the bus. The bus has a pull up resistor. So when idle the bus is at 5V consuming only leakage current which is extremely small.
I do know that, but the problem less about power consumption then the actual backlight staying on all the time. It simply doesn't look clean enough when the sleep function is called.
I am using the official Grove RGB LCD Library (Works for unicolor backlights too), but I don't think that the noBacklight() function will work, even with your library, since the LCD's Backlight is directly connected to the power supply of the module, meaning its pretty much impossible to switch it off without switching off the module aka. disconnecting it from it's port.
Yeah, although I'm not so sure when it comes to this particular board.
The area of interest is this here, IMO:
Note how the middle LED is populated. I bet RA1 is used for the red and green channels and RA2 is a smaller value for the blue channel. They apparently accept a brightness difference if R+G are on simultaneously.
The interesting bit is how the cathodes of the LEDs are connected. It looks like the middle and the lower LED share a cathode connection, suggesting they cannot be driven separately on this particular board. Yet, the cathode connection does not look to be the same net as the ground plane, which suggests it is switchable in some way. Then again, this would be inconsistent with the wiring diagram on page 12 of the datasheet, which suggests the backlight is indeed always ON and not switchable.
I'd poke around with a continuity tester to verify the LED cathode is connected directly to GND. If so, it may still be possible to modify the board. It'll take some creativity with a utility knife, soldering iron and some rummaging in the parts box.
Ah, no, checking the schematic for the RGB version I can see it has a whole extra i2c RGB LED driver chip, which is not included on the single colour displays, to reduce costs.
With hindsight, the RGB display would have been a wiser choice for this project. @kronbros suggest you upgrade and keep the single colour display for another project where saving power is not so important.
You can put the Uno to sleep to save even more power.
The ZTX718 is available from Dig-Key, Mouser and others.
If you can't buy the ZTX718, let me know.
If you turn power off to the display, it will need to be initialized again after powering back on, so make sure the library you are using is capable of that.
In the LiquidCrystal_I2C library the noBacklight() function turns off the display. Black.
Edit: Here is my test code:
Edit2: Enable, the backlight, print something.
Wait a few, then noBacklight.
Wait a few, then backlight.
Anything you did is still there, just no display.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set for 1 display with 4 rows of 20 columns
LiquidCrystal_I2C lcd1(0x27,20,4);
void setup() {
lcd1.init();
lcd1.backlight();
lcd1.clear();
lcd1.setCursor(0,0);
lcd1.print("LCD 1");
delay(3000);
lcd1.noBacklight();
lcd1.clear();
lcd1.setCursor(0,0);
lcd1.print("LCD 1 no backlight");
delay(3000);
lcd1.setCursor(0,1);
lcd1.print("LCD 1 backlight");
lcd1.backlight();
}
void loop() {
}
I found the data sheet and I see what you are saying now.
No backlight control and can't change the i2c address. Not my type.
This is the type I use. You can get them cheaper from China.