Problem with LCD and Motor

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.

What about driving the relays without the solenoids connected? Still junks?

In the photo, I can see a brown wire and a black wire from the LCD, and these wires appear to go under the table. Which connections are they, and where do they go? I also see some wires from the top end of the LCD going to the breadboard, and there appears to be a +5V connection to the breadboard which is shared with other devices. See my previous advice about using dedicated Vcc and ground wires between the Arduino and the LED. Sharing the Vcc and ground to the backlight with other connection should be OK though, provided the backlight cathode connection on the LCD is isolated from the LCD signal ground connection.

Try to keep all the LCD signal, Vcc and ground wires (not counting the backlight wires) close together, with no big loops. I can see 4 wires (red, yellow, orange, green) like this, but the rest are all over the place.

To add on dc42's suggestion, you want a capacitor between 5V and gnd on the breadboard. Try 0.1 uF to 10uF cap.

Hi dc42 and liudr,

Thank you for your advice. Attached is a closeup of the Arduino with labels. It should clear up some confusion regarding the wiring.

@liudr, I will add the cap between Vcc and GND.

@dc42, just to confirm, the Arduino, LCD and backlight should be powered as follows:

Arduino <- dedicated 12V power supply
LCD <- dedicated 5V power supply
backlight <- same power supply as the LCD

Many thanks!

No, the LCD (other than the backlight) must be powered from the Arduino 5V pin. The backlight can also be powered from the 5V pin (but that will increase the dissipation in the regulator), or from a separate 5V supply, or (if it is a standard LED backlight and has no low-voltage caps across it) from the 12V supply if you use a larger series resistor.

Does the relay control have a ground that goes from arduino to breadboard then to relay control? Just checking.

liudr:
Does the relay control have a ground that goes from arduino to breadboard then to relay control? Just checking.

The 5V relay control is currently powered by the same 5V/GND from the Arduino to the LCD & backlight. Is this correct?

About half an hour ago, the garbage character problem showed up again. It happened when I tried to turn on and off 17 solenoids (one by one in consecutive order with one second in between). But it did not happen again when I repeated the same steps. So the problem is evasive. BTW, I do not have the 10uF cap between Vcc and GND yet as I still need to get the part from the local store.

This is the LAST time I am asking you: what happens if you just switch the relays without solenoids connected to the relays.

liudr:
This is the LAST time I am asking you: what happens if you just switch the relays without solenoids connected to the relays.

I would like to give you a definitive answer, but I can't. It took entire day to reproduce this problem once (with the solenoid connected). A few days ago I did disconnect the solenoid, and the problem did not occur for the entire day. However, it does not mean the problem would not occur without the solenoid connected. Until I find a consistent way of producing the problem, there is just no way to be sure.

daytrader152:

liudr:
This is the LAST time I am asking you: what happens if you just switch the relays without solenoids connected to the relays.

I would like to give you a definitive answer, but I can't. It took entire day to reproduce this problem once (with the solenoid connected). A few days ago I did disconnect the solenoid, and the problem did not occur for the entire day. However, it does not mean the problem would not occur without the solenoid connected. Until I find a consistent way of producing the problem, there is just no way to be sure.

En, understand. Try the capacitor then, just leave your system for a day or so and check back on the LCD. You don't need 10 uF something less than that will also work.

This may seem like a noob point, but I noticed your PCB doesn't have a ground flood? You should try adding one in to aid in heat-sinking!

...apologies if you already know this :stuck_out_tongue:

nanohex:
This may seem like a noob point, but I noticed your PCB doesn't have a ground flood? You should try adding one in to aid in heat-sinking!

...apologies if you already know this :stuck_out_tongue:

@liudr, I added the cap at LCD Vdd and Vss. Unfortunately the problem still exists. :frowning: I will try cleaning up all the wiring and solder joints.

@nanohex, would you mind clarifying the ground flood for me? I am not too familiar with it. Thanks.

I think nanohex was talking about your relay circuit board having no ground plane. But it may have some on the bottom side.