Arduino Forum

Using Arduino => Project Guidance => Topic started by: Trickyrick on Jun 22, 2018, 11:07 pm

Title: 1602 LCD Display Power
Post by: Trickyrick on Jun 22, 2018, 11:07 pm
With the above display I want to power it with a motion sensor.  Could be weeks between viewing the lcd screen so tring to extend the life.  Is it best to switch the 5 volts or the contrast for the lcd
Thanks
Title: Re: 1602 LCD Display Power
Post by: lastchancename on Jun 23, 2018, 03:38 am
If you turn off the 5V, you need to init() the LCD when it is woken up.

Generally I use PWM to dim the backlight, but if you want to shutdown the whole LCD - remember to reinitialise and repopulate the content when you bring it back on.

With 5V removed the LCD is a brick, and doesn't remember anything.
Title: Re: 1602 LCD Display Power
Post by: sterretje on Jun 23, 2018, 08:15 am
There is something called parasitic power; if you don't power a device (IC, LCD) but the controller sets pins high (e.g. 328 continuously writing to display) on that device, your device might still be powered (through protection diodes) drawing current from the controller.

Be aware of that. It's not my area of expertise but setting all pins connected to the LCD to input might prevent that from happening; other's might climb in correcting me if necessary or advising further.
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 23, 2018, 05:29 pm
An I2C version is also susceptible to parasitic powering over the I2C lines - maybe even through the pull-up resistors. The powered-down device may also pull low your I2C bus at all times, breaking communications to other devices.

1602 LCD displays may use a few mA even with the backlight off, sucking dry small batteries in weeks.
Title: Re: 1602 LCD Display Power
Post by: bperrybap on Jun 23, 2018, 06:05 pm
Before we can answer, we need more information as:
Quote
tring to extend the life
is vague.
What are you trying to preserve?
i.e. what is the main purpose?
Is it to reduce power if using batteries, or is it to simply try to extend the life of the LCD and backlight?

Once we know that, we can propose solutions.

--- bill
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 25, 2018, 03:44 pm
I'm using the display in a rental home to display the outside temp and pool temp.  There are times when no one is in the home so yes I'm trying to extend the life of the LCD.  I thought by using a motion sensor cutting pwr would work I didn't realize that the LCD would have to initialized every time it was powered up
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 25, 2018, 05:12 pm
I expect an LCD to have a lifetime in the order of many years, possibly decades. A quick Google search gives me numbers of 50-100k hours on full contrast, so up to 11 years.

The LED for the back light will typically last for about 50k hours (almost 6 years) on full brightness (20 mA). Lower that current (4-5 mA is usually enough) and lifetime should go up a lot, and you should easily get 10 years out of your back light.

So that shouldn't be a real issue.
Title: Re: 1602 LCD Display Power
Post by: bperrybap on Jun 25, 2018, 05:33 pm
I'm using the display in a rental home to display the outside temp and pool temp.  There are times when no one is in the home so yes I'm trying to extend the life of the LCD.  I thought by using a motion sensor cutting pwr would work I didn't realize that the LCD would have to initialized every time it was powered up
With that goal, then just turn off the display and backlight.

Depending on which library you are using, some come with functions to do that.
display(), noDisplay() - turns on/off lcd pixels
backlight(), noBacklight() - turns on/off backlight
on(), off() -  turn on/off the both display and the backlight.

These do not require the LCD to be re-initaized and when the LCD and backlight are turned back on, the previous contents will show back up on the display.

what type of interface are you using to control the LCD?
What library are you using?

--- bill



Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 25, 2018, 08:41 pm
 The LCD is a 1602 16 by 2
Im using Arduino Mega
and
I have downloaded a Liquid Crystal Library
Im not sure how to tell you what one im using its LiquidCrystal 1.0.7
I ordered it from China its being 40 days got everything else should be any day

Thanks I will look into using noDisplay() and noBacklight()
Title: Re: 1602 LCD Display Power
Post by: bperrybap on Jun 25, 2018, 08:53 pm
The question was how are you controlling the LCD.
- directly using Arduino pins
- using an i2c LCD backpack
or something else.

And then which LCD library.
You said LiquidCrystal 1.0.7, which comes bundled with the Arduino IDE but then you said you downloaded a LiquidCrystal library.
I'm not sure what you meant by that but the IDE bundled LiquidCrystal library controls the LCD with Arduino pins and doesn't not provide support for backlight circuit control.

If you are using Arduino pins and the IDE bundled LiquidCrystal library then you will not be able to control the backlight as that library does not have support for controlling a backlight circuit.
That library does have display() and noDisplay() but does not have backlight(), noBacklight(), on(), off() functions.

You could switch to my hd44780 library which would provide support for the other functions.
But  you would also need to create a backlight circuit and would need to use an additional Arduino pin to be able to control it.
If  you used a PWM pin you could even dim the backlight.


--- bill


Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 25, 2018, 09:22 pm
Ok sorry
Yes Arduino Pins
I will use your library on Github
If I look up a wiring diagram for the LCD I see

GND - VCC -  Display contrast - register select - read/write - enable - 8 data pins - anode - cathode

is the back light the same as the contrast you say to connect this to a different pin
If I connected the contrast to a PWM then could I in the sketch dim the display until motion is sensed then turn in up for say 5 min
Title: Re: 1602 LCD Display Power
Post by: bperrybap on Jun 25, 2018, 09:28 pm
Ok sorry
Yes Arduino Pins
I will use your library on Github
If I look up a wiring diagram for the LCD I see

GND - VCC -  Display contrast - register select - read/write - enable - 8 data pins - anode - cathode

is the back light the same as the contrast you say to connect this to a different pin
If I connected the contrast to a PWM then could I in the sketch dim the display until motion is sensed then turn in up for say 5 min

You will need a transistor to control the backlight power.
The Arduino pin controls the transistor and transistor controls the power for the backlight.

It might be easier to use a i2c LCD backpack. The backpack has a potentiometer for contrast control and a backlight circuit to control the backlight.
You can control the LCD and the backlight over i2c using only the 2 i2c pins.


--- bill
Title: Re: 1602 LCD Display Power
Post by: JohnLincoln on Jun 25, 2018, 09:42 pm
Ok sorry
Yes Arduino Pins
I will use your library on Github
If I look up a wiring diagram for the LCD I see

GND - VCC -  Display contrast - register select - read/write - enable - 8 data pins - anode - cathode

is the back light the same as the contrast you say to connect this to a different pin
If I connected the contrast to a PWM then could I in the sketch dim the display until motion is sensed then turn in up for say 5 min

is the back light the same as the contrast you say to connect this to a different pin? -  No, the backlight is connected between the 2 pins labeled anode and cathode (it may, or may not include a series resistor to run it off 5V).


If I connected the contrast to a PWM then could I in the sketch dim the display until motion is sensed then turn in up for say 5 min?  -  The contrast pin normally connects to the wiper of a variable resistor connected between GND and +5V.
You can use PWM to dim the backlight, but you would most likely need to use a transistor to switch it.
I don't think that connecting PWM to the contrast pin would be beneficial - you need a steady voltage on that pin.
Normally you set the contrast once, and leave it at that setting.
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 25, 2018, 10:34 pm
Thanks guys for all the info
bperrybap
To me it sounds easier to use your library and then in the sketch use the nodisplay()  display() and same with backlight
I could have a motion sensor on say pin 1 then when the sensor puts out 3v to the pin I could have the backlight and the display come on
Does that sound reasonable
I should ask
I was planning on having the LCD fed using about 25 feet of Cat5 from the Arduino
Title: Re: 1602 LCD Display Power
Post by: bperrybap on Jun 25, 2018, 11:17 pm
Cat5 has 4 pairs or 8 wires. Normally they are used in pairs with differential signals.
Is 8 wires even enough for what you are trying to do?

Ignoring that, using 25ft of cable for power and 5v logic level signals will likely have issues.

--- bill

Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 25, 2018, 11:32 pm
OK i was going to use a cat4 2pr wire just for power.  Would i be better to use the i2C packpack
Title: Re: 1602 LCD Display Power
Post by: Due_unto on Jun 26, 2018, 12:09 am
I2C will not work over 25 feet, it was meant for comms between chips on the same board. 
You may want to consider a serial LCD interface like this one at
https://moderndevice.com/product/surface-mount-lcd117/
It needs only 3 wires to run, +5, Gnd, and Rx.  It also self initializes the display, does not need a LCD  library, and controls backlight intensity by commands.
The board attaches to the back of your LCD and accommodates single in-line or dual in line connectors.
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 26, 2018, 01:47 am
Why is the Arduino so far away from the display?

And reading back in this thread... How are you going to get the signals from the motion sensor, pool temperature and outdoor temperature to the Arduino? What is the motion sensor even got to do with it?

It seems there may be many more issues with your project idea.
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 27, 2018, 03:20 am
Ok
I want to print out a 3d box to put the display in by the thermostat in the house.  The box would have to be to big for the LCD and the arduino.  I was going to put the arduino in the attic right by the access there is an outlet there and its about 25 ft from there to the thermostat. The motion sensor was to turn on the LCD screen when I walked up to it.  In regards to the temp sensors I have one working now on about 30 feet of cat5 works good.  So its about 35 feet from where the arduino is to the pool where the sensor will be the other sensor is only about 10 feet away.
If anyone has a better solution
Thanks
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 27, 2018, 04:39 am
A Pro Mini is much smaller than a 1602 display.
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 27, 2018, 05:30 am
Sorry what is a pro mini
OK I found it
I would still have to use something like the i2c backback
Never mind I see you don't use all 16 connections on the LCD. I would have to use the i2c backpack
Thats a good suggestion I will order one on Ebay now
Thanks
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 27, 2018, 05:39 am
An I2C backpack for the LCD is not mandatory but makes life a lot easier. Less wiring mostly.
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 27, 2018, 05:52 am
Thanks
I was looking as a couple web sites I think the mini is 3.3v and does the 1602 lcd not require 5v
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 27, 2018, 05:53 am
OK that was dumb I can still power the mini with 5v and the LCD as well
Thanks for your help
Title: Re: 1602 LCD Display Power
Post by: sterretje on Jun 27, 2018, 06:02 am
A pro mini can be bought in both 5V and 3.3V.

It's not a dumb question.
1)
You can not drive the inputs of a 3.3V device from a 5V device unless the inputs of the 3.3V device are 5V compliant.
2)
Driving the inputs of a 5V device from a 3.3V device usually works but you need to consult the datasheet of the 5V device to check Vih and Vil against the Voh and Vol of the 3.3V device to be sure.

With (1), you can damage the 3.3V device. With (2), there is no risk for that.
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 27, 2018, 06:40 am
There are 5V and 3.3V versions of the Pro Mini. Main difference is that the first runs at 16 MHz, the second at 8 MHz (because the ATmega can't do 16MHz at 3.3V).
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 27, 2018, 10:03 pm
OK thanks but from what I gather the LCD takes 5v from the 5v pin on say a Arduino Mega.  If if feed that Mega board with 5v then why cant I just feet the LCD from the 5v power supply instead from the pin on the Mega board.  If this is so then It wouldnt no mater if I had a mini at 3v or 5v because I think I can feed the mini with between 3v and 12v so I could feed it with 5v and feed the LCD as well.
Hope this is right.  I ordered the 5v anyway
Now just to make sure
Im going to use the mini with the iC2 backpack then find a library that has the commands noDisplay() Display() noBacklight() Backlight().  This will be turned on and off by the input from the motion sensor
Hope Im on the right track
The only thing is that the cable between the Pro Mini is going to be about 70 feet
Title: Re: 1602 LCD Display Power
Post by: bperrybap on Jun 27, 2018, 10:55 pm
OK thanks but from what I gather the LCD takes 5v from the 5v pin on say a Arduino Mega.  If if feed that Mega board with 5v then why cant I just feet the LCD from the 5v power supply instead from the pin on the Mega board.
You can.

Quote
If this is so then It wouldnt no mater if I had a mini at 3v or 5v because I think I can feed the mini with between 3v and 12v so I could feed it with 5v and feed the LCD as well.
Hope this is right.
No. This is where you are not thinking about the two devices talking.
The LCD and backpack are 5v, if you run the mini at 3v you now have 3v device trying to communicate with a 5v device.
This is what causes issues.

Quote
I ordered the 5v anyway
That will make things simpler as you won't have to worry about 3v to 5v logic level shifting.

Quote
The only thing is that the cable between the Pro Mini is going to be about 70 feet
Uh..... This is MUCH further than the 25 feet you said previously that we pointed out will likely have issues.

--- bill
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 28, 2018, 06:56 am
OK Bill thanks for all your help.  It was going to be 25ft when I was going to put the arduino between the LCD and the temp sensor so about 25 ft each way now with the mini Im going to put the LCD and mini at the same location. Ill see how much wire I can use when I get the mini.
One last question since im going to use a lot of wire for the 2 sensors would I be better off using separate pins for each temp sensor.  I was going to use them on the same pin
Have a good night
Rick
Title: Re: 1602 LCD Display Power
Post by: wvmarle on Jun 28, 2018, 07:20 am
With 75 ft / 25 meters of wiring you have to keep other things in mind, such as EMI. That's a great antenna picking up all kinds of signals ranging from AM radio to the buzz of your 50/60Hz mains wiring.

What temperature sensor(s) are you using?

For this distance it may be easier and even cheaper to use a second Arduino at the sensors, then a wireless link (NRF24L01 or so) between the two. Those modules aren't big. You can consider putting it in a separate box, if you make the I2C/power wire between Arduino and display <1 meter it should go fine (maybe a bit stronger pull-ups, speed no more than 100 kHz).
Title: Re: 1602 LCD Display Power
Post by: Trickyrick on Jun 28, 2018, 07:42 am
Thanks Ill look into the wireless link
Rick