LCD text corrupts after Arduino runs for length of time

.... something like a 15 minute test just pulling the probe in and out of cold water.

Maybe a silly question but are you sure the probe is water proof?

--- bill

After fixing the transistor wiring I let the Arduino run for about an hour and came up with the same issue. Then I unplugged the PowerSwitch II from the breadboard and reset the entire system. I let it run overnight and after returning home from work the screen was displaying correctly. I'm assuming that something is happening with the PowerSwitch II, either that it's backfeeding into the Arduino (is this possible?) or that my wiring is really messed up.

Adafruit claims that the PowerSwitch II is opto-isolated so there shouldn't be a need for transistors or relays to isolate the relay driving part of the circuit. However, do you think I should use a 5v relay and try to further isolate the switch? Or would that do next to nothing?

dc42: Does it make any difference if you print all the strings direct from flash memory, like this:

  lcd.print(F("Curr. Temp:"));

and similarly for the other 3 strings?

I'll go ahead and try that this evening and report back if it makes a difference.

bperrybap: Maybe a silly question but are you sure the probe is water proof?

--- bill

Not a silly question by any means. I purchased it off of Adafruit (here's the link: http://www.adafruit.com/products/381) and their website claims it is "waterproof". I'm not getting any bizarre readings from the system when immersing the probe immediately, and after disconnecting the PowerSwitch II the Arduino seems to be working well. I'm not saying that the probe isn't a part of the reason, but it doesn't seem to be the sole source at this point. Thanks for the suggestion though!

Try running the system with a non-inductive load such as a some light bulbs instead of the refrigerator. The problem seems to be interference messing up the LCD controller and the compressor is the most likely source.

If this is the case you may be able to correct things by neatening up your wiring and/or by making the six leads between the Arduino and the LCD as short as possible and as far away from the refrigerator wiring as possible.

Don

The messed up information is always different as far as I can tell, I cannot see any patterns or recurring themes. In the tests I've run so far, I have not seen it return to a normal state from the corrupted state.

This sounds like a clue. Does the temperature ever change after the corrupted state? The sketch attempts to update the display about every 5 seconds so if it isn't, It sounds like the AVR processor (or LCD controller) may be crashed.

It looks like the board is being powered from 12v. Where is that power coming from? Maybe that supply is getting a giant power surge when the frig kicks on/off that is crashing the AVR or LCD.

Maybe you could put in a small "heartbeat" in the loop to blink the LED on the Arduino after each lcd update. That or for even more information perhaps toss in a few serial prints to see where the code is "freezing". Toss in a print maybe before and after calling the temperature library functions to see if the temperature library is hanging, maybe print the temps themselves, etc.... Then leave it running with the serial monitor window up just to give an idea if things are still running or where they hang.

--- bill

I would disconnect the powerswitch tail ground from your circuit. I would only have the arduino/LCD circuit connecting to the VDC+ and VDC- on the powerswitch tail.

Your schematic shows the powerswitch VDC- tied to the powerswitch GND and the arduino GND. That would allow noise on the mains ground to enter your circuit.

floresta: If this is the case you may be able to correct things by neatening up your wiring and/or by making the six leads between the Arduino and the LCD as short as possible and as far away from the refrigerator wiring as possible.

In particular, try running the LCD ground wire directly to a ground pin on the Arduino (not to the breadboard) and keep it short.

floresta: Try running the system with a non-inductive load such as a some light bulbs instead of the refrigerator. The problem seems to be interference messing up the LCD controller and the compressor is the most likely source.

If this is the case you may be able to correct things by neatening up your wiring and/or by making the six leads between the Arduino and the LCD as short as possible and as far away from the refrigerator wiring as possible.

Don

I think you're spot on with this one. I attached a lamp and 60w incandescent bulb to the PowerSwitch system and ran the program, and the LCD remained fine. I'm thinking that the compressor for the refrigerator is creating harmonics or noise of some sorts that's somehow carrying through the PowerSwitch and back into the Arduino.

I did move the Arudino off the compressor, put the PowerTail about 5 feet away (roughly 1.5M ) from the board and arranged the wires better. The results were mostly the same, with the text corrupting within an hour.

I'm wondering what my next steps should be - do you think I should try to isolate the PowerSwitch circuit completely by using a different power supply and then running the PowerSwitch through a relay from the Arduino?

bperrybap: It looks like the board is being powered from 12v. Where is that power coming from? Maybe that supply is getting a giant power surge when the frig kicks on/off that is crashing the AVR or LCD.

The board is being powered by a 12v power supply, and I'm plugging it into the same receptacle that the refrigerator is running on. I'm starting to think that this is the source of the issue, so I will try moving the power supply to a different receptacle in the basement and see if this helps correct it.

darkdragon: I would disconnect the powerswitch tail ground from your circuit. I would only have the arduino/LCD circuit connecting to the VDC+ and VDC- on the powerswitch tail.

Your schematic shows the powerswitch VDC- tied to the powerswitch GND and the arduino GND. That would allow noise on the mains ground to enter your circuit.

Done! Thanks for the information.

dc42:

floresta: If this is the case you may be able to correct things by neatening up your wiring and/or by making the six leads between the Arduino and the LCD as short as possible and as far away from the refrigerator wiring as possible.

In particular, try running the LCD ground wire directly to a ground pin on the Arduino (not to the breadboard) and keep it short.

I'll go try that now. Is it okay if I use the breadboard to attach the LCD ground's prong to the ground wire (which will be directly wired to the Arudino)? Do you think I should avoid using the breadboard altogether? I'm sort of at a loss as how to connect it otherwise.

InsufficientFunds: I'll go try that now. Is it okay if I use the breadboard to attach the LCD ground's prong to the ground wire (which will be directly wired to the Arudino)? Do you think I should avoid using the breadboard altogether? I'm sort of at a loss as how to connect it otherwise.

Yes, it's ok to connect the lcd ground to Arduino ground via a dedicated row on the breadboard, the main thing is to keep that ground wire short and not share it with anything else that needs to be connected to Arduino ground. What I'm trying to avoid is noise induced on a ground wire (for example, on the -ve wire from the power supply) coupling to the LCD via a shared ground wire.

I corrected the issue thanks to everyone's advice, so I wanted to let you all know in case someone is searching in the future. My issue was definitely a result of the draw from the refrigerator compressor starts. It never dawned on me until reading the information about linear draws (such as with the light bulb) that motors tend to draw a large amount of current when starting. It was the on-off cycling that was causing the Arduino's LCD to corrupt the data, as I had the power supply and the refrigerator plugged into the same outlet. Simply moving the Arduino's power supply to a different outlet in the basement (about 15 feet away, using an extension cord) resulted in about 8 hours of continuous running today without an issue.

Remember kids, motors draw a ton of current when they start from a stand-still, and that can disrupt sensitive electrical equipment. :cold_sweat: I work in the electrical drives business, I really should have known this...

Anyways, thanks to everyone who replied with their excellent advice. This was definitely a great learning experience, and I hope I have some good beer as a result of this.

Sorry for being late to the party, but I wanted to let you know that I have the same problem. And I had also narrowed the cause to switching inductive loads (in my case, a small vibe pump and solenoid). Unfortunately, I cannot solve it by moving the power source like you did.

My Arduino is powered from a small isolated AC-DC switching converter (a 9VDC wall wart). The converter is supplied with mains power less than a foot (as the crow flies and along the wires) away from the devices with the coils.

I put a diode across the AC input leads at the converter to snub the high spikes on AC mains, and this has cut the instances of problems way down. But I still get a confused LCD now and again when the pump or solenoid are switched. So I would love to find a more robust solution…

Jim

And my thanks to dc42. My lcd was corrupting after 40 seconds and I was sharing breadboard ground. I moved it directly to the Arduino and she's solid as a rock.

JimG: My Arduino is powered from a small isolated AC-DC switching converter (a 9VDC wall wart). The converter is supplied with mains power less than a foot (as the crow flies and along the wires) away from the devices with the coils.

I put a diode across the AC input leads at the converter to snub the high spikes on AC mains, and this has cut the instances of problems way down. But I still get a confused LCD now and again when the pump or solenoid are switched. So I would love to find a more robust solution...

Jim

I put a diode across the AC input leads at the converter to snub the high spikes on AC mains

Sorry that is incorrect and potentially dangerous, if it is AC you should be using a Transorb, or if it is an AC switch, a resistor and an X2 capacitor in series across the contacts. You ONLY put a reversed diode across a low voltage DC feed with a 0.1uf capacitor ,and possibly an inductor in the Arduno & low voltage control feed.

hardcore: Sorry that is incorrect and potentially dangerous, if it is AC you should be using a Transorb, or if it is an AC switch, a resistor and an X2 capacitor in series across the contacts. You ONLY put a reversed diode across a low voltage DC feed with a 0.1uf capacitor ,and possibly an inductor in the Arduno & low voltage control feed.

I should have been more specific, I guess. I put a 1500W, 171V TVS diode across the AC leads (Littlefuse, 1.5KE200CA-B). Seems to have helped a little. At least there were no sparks, smoke, or flames.

I am still looking for a better solution for what I believe are transient spikes resulting from switching off either the pump (piston/spring type driven by coil) or a small solenoid operated valve. The same switch turns off both, so I can't easily isolate the bad actor.

Jim

ok, a TVS is a little different…

If it is a coil type load, you will be looking at back EMF, best way is either a diode (for DC) across the coil, or an inline inductor (for AC) in series with the coil. and if you have a relay in there, you need a resistor+capacitor (Snubber network) across the contacts.

Hello everybody, I have the same problem...... Yesterday i've just put together 10 18b20 probes connected to the same pin, a lcd display 2 x 16 and a ethernet shield all running with arduino MEGA.

with this hardware i have manage to display the temp of the ten sensors ( lcd shows in looping sequence the temperatures every 5 seconds ex : T1=21,15 ... 5 second ..... T2=21,40 ... .... T10 = 21,15 ) . After about 15 minutes i get LCD text corrupted showing random characters ..... My arduino is connected only with usb cable and ethernet cable ( the device also send temperature values over telnet ) and 10 sensors.....

Thanks

Please try not to resurrect old "closed" threads just because you think you have the same problem. If you did, you would be able to solve your problem with the answer offered in the thread. Post a new thread and post your code.

ok, thanks

In my project i am connecting the LCD 16x2 same in Inductive load and it gets corrupt some times when valve switches ON/OFF , i put TVS in DC bias ,Snubber at AC side nothing worked out for me . though it is a product i cant use seperate supply lines for motors , AC valves and AC/DC converter . Any robust solution , plz suggest . -prag

one... has anyone thought of hanging a very large capacitor, say 22000 uF @ 15Volts across the DCin connector... Great for absorbing spikes. Really Gross value and technique called by some go-rilla force but it has been known to work and Metal cases properly earthed/grounded to the Earth Ground will usually fix about 99% of the issues, the rest probably were impracticable anyway...

Doc

22000uF... Is that like a Magic ICBM?