LCD goes garbage after electric pitch on the line

Hi everybody, I need some advice on how to solve this odd issue I’m having. Project is a thermostat with hi-low temperature and max-min humidity recording. It is based on a Duemilanove with connected: - 1 16x2 LCD to show actual time /temperature/humidity - 1 RTC - 1 DHT - 2 buttons to select functions/switch display - 1 Pot to set the temperature - 1 2x relay to control 2 devices Everything powered by a 12v stabilized power supply Now, the project works fine, the display shows what it has to show correctly, but if ANYTHING high voltage (a stove, in my case) connected to the same multi-plug I’ve connected the Arduino power supply to starts, the LCD starts to output garbage. This stays “in garbage mode” even if a lcd.clear() is called in the loop. This is happening even with nothing attached to the relays, or even if the relay shield is disconnected (so it’s not related to the (non) use of the Octocoupler, I’ve already faced that issue :) ). Only the LCD display is affected, project continues to work fine. Again, it is not something related or connected to the project directly, it just have to be connected to the same plug line as the Arduino power supply. Any idea of what the cause can be, and how to avoid it? OR, as an hack/workaround, is there a command to re-initialize the LCD in the loop function? All I found so far was related to miswiring and/or broken hardware and/or bad code, but again, it works fine until some electrical pitch happens on the line… :( I cannot move the stove to another line, actually, the stove will be operated BY the project when this issue is solved (and I'll hook up a 2000w capable contactor to the arduino relays :)

Use better power supply filtering, and put the Arduino in an earth grounded enclosure, with power components and relays outside of that box.

jremington: Use better power supply filtering, and put the Arduino in an earth grounded enclosure, with power components and relays outside of that box.

And/or a better power supply.

It sounds like your power supply is dropping out, and the LCD is resetting while the arduino does not. calling lcd.clear() won't help you if the screen has reset to power on state, because there's a necessary initialization step.

Hi,
Keep ALL controller wiring away from the mains wiring.
How long are your leads from sensors to controller and controller to relays?
Can you post a picture of your project, including the power outlet?
Thanks… Tom… :slight_smile:

So, as afar as I can understand, this is quite a "standard issue" related to electromagnetic disturbs.

Power supply is one of these (but older) https://www.arcadeworlduk.com/products/Black-Arcade-JAMMA-Power-Supply.html (yes, it is and arcade replacement, but it is pretty sturdy and, at least so far, it has always been very reliable :)

I'm checking if ground is properly connected, I had made a "on the fly" patch but at this point this will be my start

Presently: - all arduino stuff is inside a plastic electronic box 20x30x10cm. Relay shield is not connected nor included yet, nor is the contactor box. - power supply is some 20 cm away from arduino box - everything is 1mt from the outlet, and stove is another 80cm away from that.

So, what can be the best option might be to - check and ground power supply, if not already grounded (easy) - encase the arduino in a grouded, shielded box (less easy as this is not my "daily bread" ;)

Is there no way to "reboot" the LCD? As a Franken-hack, can I consider to use an analog pin as +5 to power the LCD only, and write a routine that when I press a button it power off->delay->power on->reinitialize the LCD->delay->back to loop? I know this would not be the optimal solution, but I'm not THAT good to be sure on how to properly shield the whole matter, and I wouldn't like to mess up more than I might already have done...

Firstly, try a 1 mF capacitor across pins 1 and 2 of the LCD. Note that I specified 1 mF, not 1µF.

You mention a 12 supply, but what are you using as a 5 V supply for the Arduino logic?

Exactly what is the relay module you are using and how is it wired? Diagrams/ photos needed.

Relay middle is presently NOT connected. I know they can cause problems, so when the issue showed up the first time, I disconnected them. I will reconnect them passing 12v on the contact to pilot 2 hi-voltage, 12v bobbin relays/contactors for the actual devices, and possibly using the optocoupler and external 5v.

5v for the hardware is taken from 5v pin on the board.

What can I use to post the diagrams? But again, I don't think the wiring can be an issue, as everything works perfectly, and the garbage thing happens unrelated to what the Arduino is doing or any function of the sketch

Hi, What format are your schematics, what CAD or do you have hand drawn circuit? Can you post a picture of your project, including the power outlet?

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html .

Tom... :)

I actually did not write or format anything. I just made connections directly, taking the single connection scheme of each component from tutorials, testing each circuit on a breadboard singularly, then all together always on the breadboard, then rewiring directly from Arduino Board to component. I'm not a professional electronic, I'm just an employee in freight forwarding with some electrician background doing some of this for fun and trying to give it a practical use. I would post it if someone helps me find a good way to do it, as I had already asked. I've checked circuito.io but I cannot modify the connections it suggests to reflect mines; I was checking fritzing but I've found people telling to stay away from it, and mostly it is pretty time consuming to redesign it all, and as told, I'm an employee doing my job all day long, so I have to find the time to do it. I will work on it on this weekend, even If I can't understand how this can help, being my issue not related to wrong connections, shorts or whatever.

Why i'm not posting my code: because it works fine, it worked fine for a LONG period before final installation of the project, and I made all the necessary tests before posting to exclude the fact that the issue is caused by the code. But it is surely an highly unoptimized code, so there is a very high risk that people would concentrate on the code losing sight of the real issue. Posting the code would only be a distraction

Why i'm not posting the photos of the project: You'd see a bundle of wires that wouldn't help. Project is partially torn down due to the disassembly of the relay part, buttons/LED resistors are bundled in tape so you can't see them, LCD is connected reversed on the box cover so you aren't seeing how it is connected, but mostly: the project has been working flawlessly for some days on my desk, while I was working on the sketch. The issue begun when I positioned the box on his final location, where I had it running fine until I attached the stove to the plug. I also made some tests before asking here, by restarting the project and checking how and when the issue happened. When the stove starts, no matter what the project is doing, the LCD gows in garbage mode. This is why I can say it not way related to functions, or miswiring, and this is why I posted on "General Electronics" and not in "Programming" or "Displays". And the fact that I was addressed to "shielding" and "grounding" or "try a capacitor here and here", and not "you have the wrong Pin 2 connected" or " Add a lcd.clear() here or here" tells me I made the correct choice.

You ask me a photo of the wall plug: It's a standard Gewiss multiplug wall box: https://www.testaelettrica.it/4107-thickbox_default/gewiss-gw27006-contenitore-per-apparecchi-system-orizzontale-protetto-8-posti-.jpg I worked as electrician, installing these in dozens. It is wired fine. It is mounted 1 mt far from the arduino box. Can you please explain me how the positioning or whatever can affect the behavior of the project (a part from the fact that, being the stove and the arduino on the same line, when the stove starts it causes a pitch leading to the problem?)

I'm trying to be as much as kind as possible, because I was admin in forums in the pasts so i know people is trying to help. So I'm replying even when I'm asked what relays I'm using even after I wrote at least twice that no relay is connected, and tried to make clear that I'm well aware of the relay issues when working with hi voltages

Call me arrogant if you want, but I made my homeworks .

This is why, frankly speaking, I'm a little frustrated by the fact you ask me to read the forum rules...

Anyway, now: - I will check the grounding of the whole circuit - I will try the capacitors on the LCD pins - failing these, I will try my franken-hack, unless someone tells me there is no way this is going to work

  • I WOULD try shielding, but as I already told, I'm not pretty sure on how this might be done to be effective

I will post the results, because as told, I used to run forums, and I've always hated people coming to ask for help, receiving some and never giving a feedback

If in the meanwhile someone have some more ideas on how this can be solved and/or suggests me the best way to write the diagram, I'd be glad to check those too.

Hi, Sorry, what is the power supply for your project? A circuit diagram will help all of us, including you.

"High pitch" do you mean electrical noise or audio noise that you can hear?

Tom... :)

Hi Tom,
as told above, my power supply is one of these, older model but working pretty fine:

I’m using the 12v output, not the 5.

high pitch is very probably a wrong term, sorry but english is not my mother tongue. I mean a high, sudden absorption of electricity that happens when the 2kW stove stars

This is the overall scheme of the project, unless pins are not the same I used, I’m using a 2 channel relay module instead of two single, and RTC is haked on the Analog out

You need a regulated 5 V supply to power your system. Not 12 V.

Paul__B: You need a regulated 5 V supply to power your system. Not 12 V.

No 5v is if you power it from USB, if you use the jack it works with 7/12

s_bastian: 5v is if you power it from USB, if you use the jack it works with 7/12

Yes, the UNO will work with 7 to 12 V.

Here's the problem however: You have connected something else to the UNO. :astonished: Different ball game!

The on-board regulator - which has no heatsink to speak of - can power the microprocessor. And perhaps a few LEDs requiring no more than 20 mA each. But I see in your diagram, connecting various other things. Even without the relays, you will need a proper 5 V supply to run it - connected to the 5 V pin.

So, based on your above information, can you please explain to me why my project works perfectly, even with the relay module, for hours, even triggering the relays without fail, but I have garbage on the LCD when the stove connected to the same power line as the arduino power supply starts?

Anyway I had already faced the power supply issue on another thread in this same forum, and I was told 12v is OK
Further to this Arduino Duemilanove specs says I can power it up to 20v, but advise not to go over 12 to avoid overheating
https://www.arduino.cc/en/Main/arduinoBoardDuemilanove
Finally, Duemilanove specs states that the 5v IS the pin I have to use to power the components:

Well, as we have no evidence of your "lead dress", I cannot say, so I suppose it ends here. :grinning:

So I finally had the time to do some tests with power supplies: - 12v, different Power supply, same power line: still garbage - 12v, any power supply, different power line: no garbage - 5v on the USB, same line: no garbage - 5v on the USB, different line: no garbage

So, the issue is definitely related to the 12v AND what happens to the power line. At this point I think I'll work around the issue by powering the project from the 5v USB

I don't have the capacitors at home to do that test too, and the electronics shop I go to for small matters is pretty unhandy for the too little spare time I have, so I cannot say if that could have been a definitive solution.

s_bastian: At this point I think I'll work around the issue by powering the project from the 5v USB

Very smart move! :grinning:

Yes but it is quite annoying… I have a pretty fat, stabilized power supply with 12v/16A output, that I dug from my recycled stuff box precisely for this purpose, and that should be able to keep everything running no matter how much stuff I attach to the board, and instead I have to use a crappy mobile phone charger. And what annoys me mostly, the problem is NOT solved, it is just a cheap workaround, and that’s not the way I like to work.

Also because, from this guide, that helped me chose the power supply after some pretty bad failure in the past, what I did should be the best way to do it... :(

s_bastian: Yes but it is quite annoying… I have a pretty fat, stabilized power supply with 12v/16A output, that I dug from my recycled stuff box precisely for this purpose, and that should be able to keep everything running no matter how much stuff I attach to the board,

It certainly shouild - if you use its 5 V output which according to your link, it has. |500x500 Your 12 V supply is just fine for whatever you have that requires 12 V. The Arduino does not, it runs on 5 V.

s_bastian: and instead I have to use a crappy mobile phone charger. And what annoys me mostly, the problem is NOT solved, it is just a cheap workaround, and that’s not the way I like to work.

What "cheap workaround"? The Arduino runs on 5 V, simple as that, so you have to provide 5 V for it and all its 5 V peripherals. You have cited a power supply which provides the correct 5 V for an Arduino, what is the problem? :astonished:

s_bastian: Also because, from this guide, that helped me chose the power supply after some pretty bad failure in the past, what I did should be the best way to do it... :(

That - like many of the "instructables" genre - is not really helpful. It fails to explain that the on-board regulator on the older Arduinox can power the microprocessor itself, but not much else. Supposedly a helpful article, but actually, terribly misleading. :roll_eyes: