Problem with LCD and Motor

A little tight and messy for a picture. I'm sure the pot is wired correctly, as a voltage divider. Wiper (center) to Pin 2 of LCD, one side to ground, other side to +5V. I even swapped out the pot, and same thing occurs. I even checked to make sure it was a linear pot and not log taper.

I am positive the pins 2 and 3 are swapped, and there are no solder bridges. I also had read in another forum that someone else had a JHD204A with swapped pins 2 and 3.

Oh silly me, silly me. I thought contrast was supposed to fade the lcd (characters) and not the backlight. I swapped the pot to pin 3, and all is well in silly land.

So the pins aren't switched, but my brain synapses are!

Oops, yet another brainfart. When I swapped the pins back to Pin2 5V and Pin3 Pot, I forgot I had the anode of the display (pin 15) linked to pin 3 (as I originally thought Pin 3 was Vcc. So in actuality, I was placing a voltage divider in the LED (backlight) circuit.

I am confident now that Pin 2 is Vcc as all HD44780's are. However, now I find that contrast does nothing at all if I wire everything up as correct. This is the main reason I swapped pin 2 and pin 3 originally. I prefer the way it's set up now anyway. I would much rather control the backlight anyway. Here's my hookup with contrast NOT working.

Pin 1 - Ground
Pin 2 - Vcc (+5V)
Pin 3 - Vo (wiper of potentiometer to pin 3 with one side to 5V and other side to ground).
Pin 15 - +5V through 330 ohm resistor
Pin 16 - Ground

now I find that contrast does nothing at all if I wire everything up as correct.

You probably burned out the potentiometer when it was wired incorrectly. I mentioned this in reply #23: "You may have the potentiometer miswired so that it is shorting the power supply (and overloading the potentiometer) when you turn it to one end."

Don

You probably burned out the potentiometer when it was wired incorrectly.

Nope. Potentiometer is OK. I even swapped it out. This problem was present "out of the box" when I recieved the LCD. Plus, the potentiometer was never wired incorrectly, I just accidentally wired it to the backlight circuit (as voltage divider, so safe), but long after I first tested the LCD upon receiving it.

Nope. Potentiometer is OK. I even swapped it out.

OK - Can you verify that the voltage at pin 3 is varying when you turn the potentiometer knob?

Don

Can you verify that the voltage at pin 3 is varying when you turn the potentiometer knob?

That's the first thing I checked. Yes. 0V to 5V. Meter connected Pin 3 to ground. Fluke 175 meter.

I'm having the same symptoms when using a 5v relay to switch current from a 12v supply to a solenoid. I put a 2n4004 diode across the coils of the relay and the solenoid to short the back EMF, but no joy. It works OK with just the relay clicking on and off, but one or two cycles of the 12v solenoid takes out the LCD. Should I try the capacitor across either or both DC supplies?

I'm confused. Is it working already or do you still have problems?! BTW, if you intend to use a pot to adjust back light, use a 100 ohm pot and have a 47 ohm resistor in series. You don't use 10Kohm pot for back light, which only gives you like, on (burn the back light) and off.

liudr,

Read the past posts. I hooked up wrong to the backlite, and the pot worked to dim the backlight. I hooked up as it should have been, and the LCD contrast does not work.

Now I have a 330 ohm in series with the backlight and control the brightness with a 10k pot. It works. Still, pin 3 does not adjust contrast.

DRBArduino,

yes, It worked for me. Filtering is your friend and caps seem to work.

wbegg:
liudr,

Read the past posts. I hooked up wrong to the backlite, and the pot worked to dim the backlight. I hooked up as it should have been, and the LCD contrast does not work.

Now I have a 330 ohm in series with the backlight and control the brightness with a 10k pot. It works. Still, pin 3 does not adjust contrast.

That's good summary. I still don't recommend using 10K pot for backlight though but I get how overconfident you are so do what you want. So now you can't make the contrast to change. Please disconnect all data, RS, EN wires from the LCD if you want to try the contrast. I didn't get whether you are running some LCD code or not. Just don't run LCD code and get the contrast step to work first. Bear in mind, you did connect up wrong wires so the LCD may have already been damaged beyond operation. Things happen rather quickly when wires are connected up wrong. Again, where are those pictures? You apparently were overconfident and under-organized but a few pictures will redeem yourself here. You were "connecting everything correctly" and that made several helpers think hard what other things could have gone wrong, all wasting their time, only if you showed a pic or two.

Tried another LCD and it works. Guess the contrast circuit on the one in question is Fubared.

That's good news. So in this case, there is no need for a picture unless you want to show a working LCD. Electronics just don't like to be connected up wrong. I fried a $30 accelerometer once. It only took seconds.

I am having similar issue. My LCD connected to the UNO displays strange characters after turning on/off the 5V relay for a dozen times. The relay controls a 12V solenoid (an electric strike for a door). I know it has to do with the EMF because if I disconnect the solenoid, the problem does not happen. My relay setup is similar to this: http://www.instructables.com/id/Connecting-a-12V-Relay-to-Arduino, except my relay is 5V, and I am powering the relay with 5V from the UNO. Here are the things I have tried so far:

  • used an external power adaptor to power the 5V relay
  • placed 6.8uF cap across the coil of the relay
  • placed 90uF cap across the 12V rail
  • used a separate 12V power supply for the solenoid

Does anyone have any suggestion for me to how suppress the EMF? Thanks.

Assuming the solenoid is powered from DC, connect a diode (1N400x or similar, x = 1 to 7) in parallel with the solenoid, wired so that when the solenoid is engaged it does not conduct (otherwise it would short out the power supply).

Also, don't run the solenoid wires close to the LCD or its wiring, and do run the solenoid wires close to each other so that the area enclosed by the 12V supply - relay contacts - solenoid circuit is kept to a minimum.

Also, make sure that the +5v and ground wires from the LCD go directly to the Arduino, not to some common connection that then has a shared wire connecting it to the Arduino.

Thanks a lot, mate! Placing the diode across the solenoid did the trick! It's much more stable now. I think I just need to place the diode even closer to the solenoid to completely get rid off the problem. Right now the diode is about 30cm away from the solenoid.

I have another similar circuit with a LCD and 256 relays (to control 256 electronic solenoids). This setup also experiences the same rubbish character problem on the LCD, so I will need to place the diode across all the solenoids as shown in the attachment. Is there an easier way to place the diodes? It's quite a bit of work to cut the wires and solder the diodes on all 256 solenoids. Thanks again!

From the photo, it looks as if those solenoids are held together by 4 screws with hex or Torx heads. It might be worth disassembling one, to see whether there is room to fit a diode inside (although that will probably invalidate the warranty). If space is limited, then depending on the current taken by the solenoid, you may be able to use a smaller diode. You can also get 1N400x diodes in SMD packages.

I am also having similar issue. My LCD connected to the UNO displays strange characters after turning on/off the 5V relay for a 10-15 times. The relay controls a 220v AC solenoid and another relay controls a Contactor (220V AC). Both relay has diode contected (IN4007).
I tryed putting cap 100uF around display but LCD still displays strange characters.
Does anyone have any suggestion for me. Thanks

You tried a 1n4004 diode yet?