Pages: [1]   Go Down
Author Topic: temperature sensor + relay = electrical noise (?)  (Read 1443 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

First of all, I'm a junior programmer, so no electrical skills at all. Maybe I'll use some wrong therms but hope someone will understand the problem I'm facing smiley
What I'm trying to do, is a web server where the client controls a home heater (simulated by an LED).
I'm using: - arduino uno R3
              - temperature sensor ( http://www.robofun.ro/senzori/vreme/senzor-temperatura-brick )
              - relay (similar to this:  http://www.dhgate.com/2-channel-relay-module-for-arduino-arm-pic/p-ff80808137e9dbf3013826966df333e8.html )
I've programmed arduino to turn on the relay if the temperature drops under 22C ( the LED simulating the heater will light up)
Problem: each time the relay turns on, the temperature jumps ~2 degrees up  - so from 22 C temp gets 24. Lets suppose the real temperature is 22C: now the temperature value in arduino is 24. In order to turn the relay off, temp should drop under 22. So from 24 to 22 temp decreases with 2C, but when it reaches value 22, the real value of temperature is 20. At this point, the temperature from ardiono drops to 20 - correct value;

I've tried many software solutions, but the temperature error is not stable at all - sometimes I get 1 degree error, somethimes 3 degrees;
What i've tried: - Chebyshev filter (http://en.wikipedia.org/wiki/Chebyshev_filter) - worked somehow, but still not accurate.
                      - Connected Arduino 3V3 pin to Arduino AREF pin like in the second image  http://learn.adafruit.com/tmp36-temperature-sensor/using-a-temp-sensor  but didn't used any of those resistors because I don't know what type is the one from left, connected to 3v3 pin and analog pin0. If someone knows, I'll appreciate his help.

I'd be very happy to find a solution to this..
Thanks
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 224
Posts: 13915
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1) How is the system powered? If the relay draws too much the reference voltage of the analogRead() may be not 5.0V (check with voltmeter?)

2) can you post your code?
« Last Edit: December 16, 2012, 02:37:39 pm by robtillaart » Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Problem: each time the relay turns on, the temperature jumps ~2 degrees up  - so from 22 C temp gets 24.

Quote
I've tried many software solutions,
It sounds to me like it is a hardware problem. It sounds like the current being drawn from the relay is causing a small dip in the supply voltage. This in turn affects the reference voltage and hence the reading.
Alternatively depending on how the grounds are connected you could be getting what is called ground lift by the current from the relay.
Try connecting the sensor and relay to a physically different ground on the arduino.

What is powering the unit? How much current is being supplied?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1) How is the system powered? If the relay draws too much the reference voltage of the analogRead() may be not 5.0V (check with voltmeter?)
That was a great question!  I used only the USB as a power source. I changed it to arduino's orignial power supply and seems that the problem is solved! I don't now how come I didn't thought at this before.

before connecting power supply (temp to change the relay = 30):
28.42
28.56
29.30
29.83
30.47
33.01
32.76
32.71

after connecting power supply
28.81
29.00
28.96
29.79
30.18
30.57
31.30
31.05
30.57

Thank you !

LE:

Try connecting the sensor and relay to a physically different ground on the arduino.


this is also good to know smiley I'll try that, just out of curiosity..
Thanks
« Last Edit: December 16, 2012, 03:05:44 pm by rotsloth » Logged

Pages: [1]   Go Up
Jump to: