16x2 LCD backlight relay problem

Hi everyone.

I have put a normal 16x2 blue LCD in my car to read some values including temps, boost etc.

For the backlight, I have decided to connect the pin 15 to a relay, so when I put the parking lights on the LCD's backlight comes on. It comes on etc, however as soon as the backlight comes on I see garbage on the LCD!

With the parking lights off, therefore the relay being off and the backlight the LCD shows everything absolutely fine.

Any ideas?

Thanks.

Any ideas?

Try connecting the backlight directly to the power source (without the relay) to determine if the problem derives from the backlight or from the relay.

Don

Yes, when I connect the backlight directly to power source, it still happens.

I have to also add that, the positive leg of the LED is connected directly to my power source. I haven't gone via the pin 15.

BUMP

BUMP

I'll give you my response to reply #2 in a few hours.

Maybe some interference. You need to show some details instead of just posting bits of info in text. Get some diagram and pictures and tell us how you hooked up the relay. There are plenty of wrong ways to do it. Also how you hooked up the back light w/o relay.

Ok,

Everything is connected like it should for an LCD. As mentioned it works when backlight is disconnected, but garbage when connected.

Not too worried about the relay at this point, since when I directly connect the +ve leg of the LCD to the 5v on Arduino still garbage characters. I am not connecting the 5v to pin 15 though. Should there be a resistor in series with the power and the +ve leg of the LED at all? Should this cause it?

Thanks.

Should there be a resistor in series with the power and the +ve leg of the LED at all? Should this cause it?

This is what is most likely causing your problem. A current limiting resistor is always required with an LED and some LCD modules have the resistor on the pc board. I would suspect that most, including yours, do not. If you have a datasheet for your module it may contain enough information to determine if you need a resistor and what size to use. Otherwise I would start with 100 ohms and see what happens.

Don

One of these days, I'm gonna make a video on how to hook up a character LCD. The adafruit tutorial is good but missing that important resistor :slight_smile:

http://www.ladyada.net/learn/lcd/charlcd.html

Ok,

There is a resistor on the board, but I just connected the 5v direct to the LED rather than through the resistor. I didn't think it would have made a difference? :~

I will try a resistor and report back.

Thanks.

Tried a 150 ohm resistor and the problem is solved now. I will connect the relay tomorrow and post here again.

Thanks again for all the help.

liudr:
One of these days, I'm gonna make a video on how to hook up a character LCD. The adafruit tutorial is good but missing that important resistor :slight_smile:

Arduino Tutorial - connecting a parallel LCD

It is interesting that the current version of that tutorial has a whole paragraph (see below) on how to determine the size of the required resistor but then they do not use it or explain why they didn't use it. I seem to remember that the previous version of this tutorial at least mentioned that the LCD module that they sell on their site has an on-board current limiting resistor.

Next we'll connect up the backlight for the LCD. Connect pin 16 to ground and pin 15 to +5V through a series resistor. To calculate the value of the series resistor, look up the maximum backlight current and the typical backlight voltage drop from the data sheet. Subtract the voltage drop from 5 volts, then divide by the maximum current, then round up to the next standard resistor value. For example, if the backlight voltage drop is 3.5v typical and the rated current is 16mA, then the resistor should be (5 - 3.5)/0.016 = 93.75 ohms, or 100 ohms when rounded up to a standard value. If you can't find the data sheet, then it should be safe to use a 220 ohm resistor, although a value this high may make the backlight rather dim.

Don

OP, I am glad that was an easy fix for you.

Floresta, very often newbies purchase LCDs from other places and they don't always have any resistors on the LCD then used the adafruit tutorial and not even following it all the way through. I think this generation is better at listening and watching than reading. I start to feel the same way. So once my cold is gone I will put together a video and hope it will help explaining things a bit better than a written tutorial.

I also hope to address a few common mistakes and reproduce their symptoms in the video so will dig deep here for some good common mistakes.

The resistor certainly fixed my problem. Also connected the relay as normal and it worked absolutely fine!

Thanks for all the help guys. Much appreciated :slight_smile:

Hi everyone, me again :slight_smile:

I have a similar problem again. This time it's a 20x4 red LCD.

The resistor on the board for the LEDs is 260 ohms.

At first when the LCD starts, everything is shown properly, give it around 2 minutes and all the characters get mingled!

Also if I play with the potentiometer connected to the pin 3, it happens quicker. Especially when it goes full contrast!

Any ideas/experiences?

Thanks.

Need some pictures of what are showing up on the LCD.

Here is a photo attached.

We have to know what should be showing up on the display as well as what is actually showing up on the display.

Are the results consistent. In other words if you use the same initial (correct) message each time do you get the same (incorrect) message after the problem manifests itself?

Don

Yes mate, what you're saying is what's happening.

I believe the LCD has some kins of problem! Reason being is that, I tested the same sketch with a blue 4x20 LCD and everything works as expected, left it for 2 hours, and everything shows perfectly.

Could it be the dreaded resistor for the LED?

Thanks.

I might shoot my foot by answering with pure speculation but it's easy to prove if I'm right or not: Disconnect the back light and see what happens (I know it's gonna be dark but you have desk lamps:))