Classic 16x2 and relay/motor problem.

Hello.

I have a setup with my arduino Mega, an 16x2 LCD, an encoder and a couple of relays controlling a 220V load. Most of you (or at least some) know the common problem of the LCD going blank after the relay/motor goes off, afaik it is because of the noise and back EMF. The common solution to this problem (according to Don in another post) is to reduce interface caused by the load and keep the remaining noise from getting to LCD wires.

Im posting here asking for help because the changes I've done to my circuit have not solved the problem. My circuit is kind of a backgauge with a triphase 220V motor. A signal from the arduino goes to a TIP122 through a 1K resistor to let 12V pass to the 12V relay, the relay has a snubber next to it. The relay contacts are used to conduct 110V to a contactor that starts or stops the 220V motor. The LCD goes blank even if there is no 110V or 220V connected. The encoder measures the angle of the motor shaft and the arduino stops the signal for the motor when the encoder has reached a certain amount of steps. Right when that happens, the LCD goes blank and the only way to get it working again is resseting the circuit.

So far I've just installed a 10uF electrolitic cap between +5V and GND next to the LCD but it hasnt helped.

Im using a 12V transformer @1.2A, goes to a doide bridge, then to a 7812 that powers both the arduino and the 12V relay. before the 7812 Vin there are a 2200uF and a 0.1uF caps and after the 7812Vout there are 10uF and 0.1uF between Vout and GND.

Im no expert in electronics so I have a few ideas and I want to know if they could work or not:

  1. the circuit is not really grounded, not to physical groung nor even to the metallic box containing the circuit. Grounding the circuit will help me with the noise and with the LCD not going blank?
  2. Would adding a 10uF cap next to the 12V relay help with the decoupling? Would it interfere with the snubber diode?
  3. I read in another post that using lcd.begin(16,2) in the code would restart the LCD and I think it might work but it would not solve the REAL problem at all, but would you recommend using that "trick"?
  4. What else do you suggest so the LCD doesnt go blank?

I'm really desperate and frustrated with this problem. Hope you guys can help me.

Thanks in advance.

Jhon

Hi.

I don't have real solution for your problem , I only can tell about my own experience with lcd and electromagnetic issue.

Here: lcd 1602 scramble near halogen lamp.[ solved ] - Displays - Arduino Forum

Later I tried some new wiring config, but same result, the only new info is: if no data communication occurs from the arduino and the lcd, nothing happens: if the code of the arduino did not result of frequent data coms from arduino to lcd, the text displayed still ok. I tried the "hello world" example and the text stay clear. But with the millis counter example, all become garbage.

So... you are assuming the problem is not the back EMF itself but the electromagnetic field of the relay being too close to the LCD?

Hi.

In my case, I'm 99.99% sure about electromagnetic issue. Even battery powered arduino and lcd, I got trouble with the halogen lamp and the piezoelectric lighter.

I feel your pain.

I struggled for a long time with LCD problems in an application simply reading a contact closure on an unused half of a DPDT relay in a mechanical room filled with motors and relays. I only had two wires running back to the Arduino--one to an interrupt pin with inputpullup and the other to a ground. I put an RC low pass filter on the the interrupt pin, and wrapped both wires around ferrite chokes.

First, I would suggest you try and I2C lcd to see if it is more robust to interference than the parallel set up.

If you are sure of the condition which scrambles the display and the rest of the program continues to work as designed, I would not be against using lcd.begin(). We both know it is wrong, and you are likely to be haunted for the rest of your days. I'm sure you will continue to search for a hardware solution to the root cause.

Ok, just to update this. I tried adding lcd.begin() in the code and it WORKED so I had the chance to prove the functionality of my prototype. For the final version though, I'll replace the mechanical relays for SSR or their Triac circuit equivalent.

I've got another problem with my project but it's not LCD related so I'll post it in another thread.

Thanks for your help guys and I hope this help anybody else that finds this common problem.

Jhon