Thermostat Relay Feedback Problem

Description

I’m working on my first arduino project. It’s a web-based thermostat. I’m using the ethernet shield to serve a website that I can use to adjust the temperature. I also have physical buttons to operate the unit locally.

For temperature sensing i’m using the DS18B20.

The relay has a 5v coil voltage and is rated for 120AC @ 1A. Radioshack 04P09 275-0240 SPDT Micromini

The assembly went well, and I have just about everything working. There is one problem I can’t seem to solve. When the propane heater ignites and sparks the propane some kind of feedback is messing with the display. Interference seems to show up on the LCD screen. At that point I unplug it.

I suspect the relay isn’t wired properly for the 24ac the heater thermostat uses. Currently I have the relay coil driven from the +5v arduino through a transistor. There are diodes connected in both directions one with a 1K resistor in one direction and the other across the coil in the opposing direction.

I’ve tried powering my arduino with a 9v battery instead of the wall wart, the issue remained. Also, once the igniters fire and mess up the lcd display, the arduino continues working. I can access the website it serves, and use the hard wired buttons. However, the LCD never recovers to draw text correctly. I have to power cycle the arduino to get the display working again.

I’ve got this far and I’m not sure what to do next, any ideas would be appreciated.

Photos:

http://imgur.com/a/xljhl

Videos:

Description of project

Video of the problem

Code:

Current arduino code

Other:

Website I used for relay wiring

If the relay is doing what you expect, then it’s not malfunctioning.

How are you powering the LCD? Shared power with everything else? I’m guessing that it’s getting reset due to Vcc dropout and not being reinitialized. It could be due to EMI (electromagnetic interference), though. The dropout cause is more likely, though.

You could bandaid the problem by reinitializing the LCD each time you use it (or some time after using the relay) but let’s figure out the real problem.

First thing to do is ensure you have great ground connections with all of the various blocks. A flaky ground can cause a lot of mysterious problems. Assuming your ground is good we move on…

So, either your relay kicking in causes a power drop or the furnace kicking in causes the power drop (or EMI). Having a relay coil on the same power bus as your electronics WILL cause problems. I would try a separate power supply for the coil (your “Voltage” line) to see if that’s the problem. A 6V battery would be ok - won’t hurt the electronics. Keep a common ground and drive the transistor (“Signal”) the same. If that solves the problem you can protect the rest of your system with a rectifier and a large capacitor.