Problem with LCD and Motor

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.

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.

All of the 1N4000 series devices are essentially the same except for their reverse voltage rating. The higher the number the higher the voltage rating. Therefore a 1N4007 can replace a 1N4004 with no problems.

Don

If you get problem when you disengage the solenoid, then it is the diode's problem or how it is connected. If you have it correctly connected then the diode will bypass the back EMF. Let us see the connection diagram and the actual photo.

liudr:
If you get problem when you disengage the solenoid, then it is the diode's problem or how it is connected. If you have it correctly connected then the diode will bypass the back EMF. Let us see the connection diagram and the actual photo.

Attached is a photo of the relay and solenoid. I was trying out different length of the wires, and it seems that a long wire between NO of the relay to the cathode of the diode yields the best result (even though it still does not completely suppress the back EMF). The power supply is a dedicated 12V with 10A rating, and has no connection to the Arduino UNO. The 12V solenoid draws about 1A when active. Please let me know if you have any suggestion or need more information. Thanks.

Help me here, is this what you want to do?

Turn on a relay that powers a solenoid? The diode needs to be at the relay coil side. The solenoid? separate the 12V supply ground from arduino's. They don't have to and should not share grounds.

I only see the box (you held it in your hand in the other picture). Is the relay inside the box or is it outside your picture?

liudr:
Help me here, is this what you want to do?

Turn on a relay that powers a solenoid? The diode needs to be at the relay coil side. The solenoid? separate the 12V supply ground from arduino's. They don't have to and should not share grounds.

I only see the box (you held it in your hand in the other picture). Is the relay inside the box or is it outside your picture?

Yes, there is also a diode on the relay coil side. Attached are the schematics of the customized 8-unit relay board and a photo of the relay PCB. I am using the Arduino to control the two input pins of each relay (a matrix configuration), so I can control 256 relays with one Arduino. The box in my hand is the solenoid. The relay is shown in this attachment.

Regarding the ground, Arduino is powered by its own 12V power supply, which is separate from the 12V power supply for the solenoid. The relay is 5V and is powered from Arduino. Thanks.

Protel Schematic.pdf (23.8 KB)

OK got it. If you only switch relays without solenoids attached, will you see garbage on LCD? Can you give a large picture of the arduino and LCD included?

liudr:
OK got it. If you only switch relays without solenoids attached, will you see garbage on LCD? Can you give a large picture of the arduino and LCD included?

Sorry for the delay. This past week I have been trying to find a consistent way to reproduce the problem. I cleaned up the wiring, so I can take a better picture to show you guys. After that, I have not been able to reproduce the problems consistently (the problem still exists). Attached are the photos of the Arduino side with two closeup photos. The wiring of the LCD is the same as the Arduino tutorial, except I have added a 150 ohm resistor to the LCD backlight supply voltage as suggested by another post. I will add more labels to the wiring later tonight or tomorrow, so you guys can better understand my setup. Thanks.