This is my first post so I hope it is at the right place.
I'm working on a project whose objective is to control two ac loads (one ac fan, controlled by phase angle control and one ac motor controlled by a 5V relay) and output to an LCD the room temperature and the % of fan speed.
The code I wrote seem to work fine without the AC loads connected. I tested it for long periods of time (+12 hours) and everything is ok.
The problem is when I connect both (or just one) AC loads, I always end up with my LCD info corrupted like this:
Sometimes past 2 minutes, sometimes past 10 minutes... It's random but it always end up like this.
I'm guessing it's noise problems due to the loads switching TRIAC/Relay. The TRIAC its connected trough a optocoupler but the relay it's directly connected to the arduino.
First, I put the lcd.clear() function in my code to "rebuild" the info from time to time but it doesen't work 100% and it's not a "clean" solution for the pourpose.
The AC loads are connected to the grid but the arduino is powered from my computer's usb port. Already put an EMI filter into AC main input of my loads but no solution.
Is there a solution to this problem? Any help?
Sorry for my poor english but I'm a little bit rusty.