Problem with LCD and Motor

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?

Whenever you see the term 'motor' or 'relay' in the same sentence as 'LCD problem' the answer is almost always the same.

Don

Do you have dedicated +5V and ground wires from the Arduino to the LCD? Shared grounds can cause a lot of problems.

dc42:
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.

@DC42, I opened up the solenoid, and inside is one complete unit, so there is no way to place the diode inside. What I did was to place the diode as shown in my previous photo (where the scissors symbol is pointing at) to see if I can completely suppress the EMF. To my surprise, this new setup actually made it worse. Now I see garbage on the LCD all the time. Attached is a drawing of my old and new setup. The diode on the left-hand side is the old setup where I place the diode about half way between the solenoid and the 12V power supply. This setup works sometimes. The diode on the right-hand side is the new setup, which always fails, i.e. garbage on LCD. This is completely opposite to what I expect to happen. Any suggestion? Thanks.

Protel Schematic.pdf (9.41 KB)

Yes, it does seem strange. I suggest you test the diode that you fitted in the new position. Does the garbage appear when the solenoid turns on, or when it turns off? Also see my previous reply about +5v and ground wires to the LCD. A photo of your wiring would help.

dc42:
Yes, it does seem strange. I suggest you test the diode that you fitted in the new position. Does the garbage appear when the solenoid turns on, or when it turns off? Also see my previous reply about +5v and ground wires to the LCD. A photo of your wiring would help.

I will do more testing here, and take a photo after I clean up the wiring. The garbage characters appear always when the solenoid is turned off. I am powering the LCD using the 5V and GND pins directly from the Arduino UNO's power rail. Thanks.

liudr:
You tried a 1n4004 diode yet?

Thanks liudr for your reply, Today i tried to buy 1n4004 diode but all verdors are saying that the replacement/upgrade is 1n4007 and 1n4004 is outdated and not avalable. Do you have any other solution for this problme? Thanks in advance.