I build a device in which I check data on LCD display 1 or 2 times a day. So when I tried to turn off my 16*2 display and re-plugin in the middle of running the machine it gives some garbage value. How can I turn on or off my LCD with the I2C module on my running device? Is it possible??

  • 1
    \$\begingroup\$ How are you turning it off now? If the LCD has an I2C interface, what commands do you have available? The display itself probably only draws about 1mA so turning off the backlight (and possibly blanking the display if necessary) would seem like a good way. \$\endgroup\$ Feb 13 at 4:50

When you disconnect to turn off and then reconnect to turn on your LCD without restarting your device (if you unplug and re-plug it for instance) the initialization procedure is not executed and your LCD will not be correctly configured.

If you want to turn off the LCD and then on in the middle of operations use the instruction register allowing to turn it on or off by software:

enter image description here

Your LCD may have different configuration but it must be similar check its datasheet.

If you are using LiquidCrystal_I2C library on Arduino use noDisplay() and display() functions. These functions use the flag LCD_DISPLAYON that has the value 0x04 to point to the bit D shown on my figure (LCD_DISPLAYOFF set to zero to turn it OFF).

If you want to reduce consumption (which I think is your goal) read @SpehroPefhany comment that insists on turning off the backlight.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.