[Solved] Arduino + relay with external power source +Temp sensor: need your help

Hi there–

I am working on a simple project consisting of an temperature sensor (TMP36) and a relay. I noted that every time the relay was activated, there was a drop in the temperature reading. I discovered that the relay needs too much current and when is activated, there is a drop in the Arduino’s 5V pin.

Then, I decided to add a secondary power source for the relay and feed the TMP36 with the 3.3V pin (using the AREF and the analogReference(EXTERNAL) method). Attached is the scheme of the circuit. However, the problem persists. I would really appreciate if you could help me to figure out what’s wrong with my circuit.

Thank you very much,
Raimon

Relay_ext_power+Temp.fzz (8.02 KB)

It might be that the layout of your 0V wiring is such that the heavy relay current is passing through some of the 0V wiring to the TMP36 and the resulting [fairly small] voltage drop at the sensor 0V pin is enough to affect the temperature reading.

If you have a sensitive voltmeter you could check the voltage at the TMP36 0V pin. You could try rerouting the 0V wiring or possibly use heavier gauge wire, ideally bringing the 0V connections to a star point near the power supply.

Edit:

Try connecting the two power supply 0V connections and the Arduino + TMP36 0V connection such that the three wires are joined at a common 'star' point.

Try putting a cap (.1mf) across the sensor + and -. And try putting a 10k resistor as load on the sensors output.

From the TMP36 data sheet (p10) downloadable from:

"Note the 0.1 µF bypass capacitor on the input. This capacitor
should be a ceramic type, have very short leads (surface-mount
is preferable), and be located as close as possible in physical
proximity to the temperature sensor supply pin. Because these
temperature sensors operate on very little supply current and
may be exposed to very hostile electrical environments, it is
important to minimize the effects of radio frequency interference
(RFI) on these devices. The effect of RFI on these temperature
sensors specifically and on analog ICs in general is manifested as
abnormal dc shifts in the output voltage due to the rectification
of the high frequency ambient noise by the IC. When the
devices are operated in the presence of high frequency radiated
or conducted noise, a large value tantalum capacitor (±2.2 µF)
placed across the 0.1 µF ceramic capacitor may offer additional
noise immunity."

You're using the 3-pin packge? If not and you're using one of th SOIC packages, there is also a note about connecting the /SHUTDOWN pin to 5V.

If the above changes don't clear the problem it would be worth looking at the ground wiring as above, given the large relay coil current in close proximity to the sensitive sensor.

Thank you all for your replies!!!

The issue is solved. I placed a 1uF cap. between ground and signal of the TMP36 and that solved the problem. I'll also try other combinations but that seems to work pretty well.

By the way, do you know if it is possible to use a unique power supply for the arduino and the relay? Perhaps one able to provide higher current (now, I'm using 5V and 1A for both power supplies).

Thanks again!!!
Raimon