How to switch off an LCD screen

Hello everybody I connected an LCD screen to my arduino and i search on how to switch it on on demand only to save power. I can switch off the luminosity with a button, but if i want ro switch it off totaly (with contrat) it doesn't work. The screen display a lot of block.

Thanks you very much.

The vast majority of the power will be consumed by the backlight which can be controlled like any other LED.

The LCD controller itself uses very little power but if you want to blank the display, without disturbing it's contents, you can use the 'display() and noDisplay() methods'.

Don

Libs I use has these methods (this is for a 20 x 4 LCD)

lcd.setBacklight(BACKLIGHT_OFF);

lcd.setBacklight(BACKLIGHT_ON);

Libs I use has these methods . . .

The backlight is completely separate from and has nothing at all to do with the LCD controller.

This is why the Hitachi LCD controller datasheet and all of the other datasheets that are derived from that datasheet have no instructions to deal with the backlight.

The LiquidCrystal library is written to deal with the LCD controller and since the controller doesn't deal with the backlight neither does the library.

The instructions that you mention most likely refer to an library that is geared to a specific I2C adapter either by means of its inherent code or perhaps by means of a constructor. In any case, although it works with your hardware, it is not likely to be applicable in this case.

Don

floresta:
The instructions that you mention most likely refer to an library that is geared to a specific I2C adapter either by means of its inherent code or perhaps by means of a constructor. In any case, although it works with your hardware, it is not likely to be applicable in this case.

Don

Don, many of the 3rd party hd44780 lcd libraries include these backlight API functions.
Those API calls are in LCD 1.0 API specification as optional functions.
http://playground.arduino.cc/Code/LCDAPI
Unfortunately, the adafruit LiquidCrystal library that ships with the IDE lacks these calls.
But many, of the 3rd party hd44780 lcd do have backlight control API functions, not just the i2c based ones.

These are the backlight API calls that many libraries implement:

backlight(); // turn on backlight
noBacklight(); // turn off backlight
setBacklight(dimvalue); // set backlight intensity
on(); // turn on pixels and backlight
off(); turn off pixels and backlight

— bill

Bill: I don't dispute anything you have said here (or anywhere else for that matter) and if you look closely I think you will see that the statement of mine that you quoted is correct.

Don

floresta: Bill: I don't dispute anything you have said here (or anywhere else for that matter) and if you look closely I think you will see that the statement of mine that you quoted is correct.

Don

For me there are many unknowns as we don't know what h/w or libraries are being used by either Nicobou or KrisKasprzak. I was not wanting to make any assumptions about the interface (like direct arduino pin or i2c) or h/w involved, or the capabilities of the library involved as we simply don't know. So from my perspective, it seemed just as likely as not to have backlight support.

The main thing I wanted to clarify was that the backlight functions are not specific to any h/w or interface as they can work on any h/w as long as the library and underlying h/w supports it.

--- bill

We need 'Carnac the Magnificent' to participate in this forum. He can provide the answers without even knowing the questions.

Don

floresta: We need 'Carnac the Magnificent' to participate in this forum. He can provide the answers without even knowing the questions.

:grinning: