LCD works for a while, then shows random characters and stops updating correctly

Hey guys - I may not post all the information needed (I'm new-ish to this), let me know if you need anything more.

I am using an Uno as a thermostat, I have 6 TMP36 temperature sensors reading the temp, and 7 relays reacting to keep the temperature in range. One of the sensors controls two relays.

The LCD and relays work fine, but at some point (haven't noticed a pattern) the LCD has some numbers freeze and stay the same, while others that shouldn't be changed turn into numbers/letters/characters. The LCD is a 20x4.

While it works it should say something along the lines of:

Python Temperatures
1 95.14 2 96.36
3 92.45 4&5 98.00
6 95.14 7 96.30

When it starts being weird it'll add characters and move thing around. I can post pictures, my code, or anything else that would be useful.

Any help would be greatly appreciated.

Ive seen this as well, and I found my connections to the lcd flaky.

I don't believe that's the problem, but it's possible and I will recheck all my wiring when I get home tonight. The reason I don't think it's a connection is if I disconnect the relays, and just power the temperature sensors and LCD, the LCD does exactly what it's supposed to without any errors.
The errors usually start after 20-30 mins, once the temperatures are within range and the relays are turning on and off to keep them correct. I ran the system without the relays for 3 hours without any errors.

You are obviously experiencing some sort of interference due to the operation of the relays. You could try a filter capacitor directly across the power terminals (pins 1 and 2) of the LCD display. Try 10 uF or so and make sure you get the polarity correct.

Don

I checked all the connections again, some of the soldering doesn't look the prettiest but the multimeter reads connectivity through all points.

I added a 10 uF capacitor between pins 1 and 2 as suggested an am testing that now. It did make the numbers go dimmer? They are bright enough to barely be readable.
I will post an update as to if the capacity fixes it.

Hey Don, your suggestion worked well. The screen hasn't had any characters out of place since my last post.
It did, however, make the LCD contrast really dim. Even with the pot turned all the way up it's barely readable. Occasionally it'll get a bit brighter (still pretty dim) for a second and then go back to dimmer. I didn't change anything else on the set-up.

Any ideas on what could cause the contrast control to be so low?

Are you sure that you connect the capacitor round the right way?
Is it warm?
Is it hot?

David.

Has it exploded yet?

It could be a really leaky (poor) capacitor. Possibly try a different one.

Don

I'm sure it's the right way, it didn't have a noticeable temperature difference last I checked it, and it hasn't exploded. I can attach a different one a bit later today, and I'll update when I do. Thanks

I switched the capacitor for another 10 µF capacitor, still the same issue. Really dim contrast. Any other ideas?

The random characters is still present apparently. I am wondering if it is a power issue? The relays (I'm powering 7, one pin is powering 2 of them) draw a max of 20 mA each. The TMP36's draw .05 mA, and then the LCD + Backlighting.
I am currently using an iPhone USB wall charger, output is 5V - 1A. I also have a barrel power supply that is 9V - 650mA, but if I use that the temperature sensors fluctuate and jump ~20°F sporadically. Do you have any suggestions on power supplies, or if that could be the cause?

Thanks for the ideas so far, it feels like it's getting closer to working.

The relays (I'm powering 7, one pin is powering 2 of them) draw a max of 20 mA each.

You really should read the Notes that follow Table 28-1 in the ATmega 328 datasheet.

Not only is there an absolute maximum rating for each pin (which you are drawing on the one powering two relays) but there is a maximum for certain combinations of pins.

Don

I found the absolute max for each pin on table 29-1; I can make changes so each pin only controls one relay.
Where are the combination of pin ratings found at? I'm not seeing those.

Thanks again Don

It looks like some genius decided to renumber the sections in the newer datasheets.

The datasheet I just downloaded has a blue band on the top of each page and is dated 11/2015. In this version the information is right after section 30-1.

Don

Awesome, I found the notes and started adding everything up. I am at / slightly above a couple of those numbers. I moved my wiring around and minimized what I could so I should be under on all of them. I will do some more testing to see if it works.

I have also played with using a second arduino; one to power the LCD and temperatures sensors, and the other to take care of the relays. That worked well, but I don't know how to transmit a signal from one arduino to the other properly. I guess if this newest attempt doesn't work I'll be asking for some help on that if I can't figure it out by then.

Thanks for pointing out those data tables Don. I will recheck my numbers, do some testing, and let you know the results.

I've been testing and experimenting with everything I can think of. I found the LCD is drawing a total of ~90mA, pin 4 seems to pull 85 mA and the rest seemed to be under 1mA each. If I only power the LCD and the temp sensors everything seems to work fine. If I connect the relay board and one relay switch onto a different pin grouping (ensuring that everything stays under their limits) the LCD begins to have errors.

I still have the 10uF capacitor on the LCD power-ground, and am keeping the board within its power ratings, but still have errors. Any next step to attempt, or other ideas to try?