I have a basic setup, with a Ardunino Uno Connected to a 3 pin Temperature sensor and a 4 relay board. I simply have the Ardunio reading the Temp in a loop and I am using the 4 relays on TimeAlarm.h turning things on and off.
The relays turn on and off fine.
The Temp sensor reads corectally (21c in my office), unless a relay come on and it goes up to 25c and more as more as more relays come on.
The relays and temp sensor (+ an LED to show power ) are powered off the Arduino +5 pin. My multimeter shows 5v with the LEd and Temp sesor on, but it does drop to about 4.5v witht the relays on.
I'm assuming the 4 Relay board is sucking to much electricity and making the Temp Sensor read wrong ? I should powwer it via its own supply ?
Serial.print(tempc, DEC); // Test Print to serial port
Serial.print(' '); // Test Print to serial port
Serial.print('\n');
if (tempc > 40) // Check and drop temp if its over the max of 40
{
tempc = 20;
}
analogWrite(dialone, (tempc - 15) * 10); // Calculate and display on Analogue one temp
tempc = 0;
Relay board was an eBay job, no markings except for "4 Relay Module"
void Relay1ON(){
Serial.println("Relay 1 On - White Light");
digitalWrite(RELAY1,LOW); // Turns ON Relays 1 (White Lights)
}
void Relay1OFF(){
Serial.println("Relay 1 Off - White Light");
digitalWrite(RELAY1,HIGH); // Turns OFF Relays 1 (White Lights)
}
Using the above code to turn on and off the relays. They turn on and off fine with this code, but just make the Temp read higher, and higher the more you turn on. The volts from the 5v Pin Also drops a little each time.
The relays and temp sensor (+ an LED to show power ) are powered off the Arduino +5 pin. My multimeter shows 5v with the LEd and Temp sesor on, but it does drop to about 4.5v witht the relays on.
There is your problem, the load of the relay coils is lowering the arduino's +5vdc supply. The LM35 output voltage will be effected by a change in the +5vdc voltage. What relays are you using, how much current does each relay coil require? You may have to use an external regulated +5vdc power source for the relays.
retrolefty:
The LM35 output voltage will be effected by a change in the +5vdc voltage.
I think what is actually happening is that the LM35 output is staying the same, but the Arduino ADC is using the default 5V reference. So, when the 5V supply drops, the apparent input voltage increases.
A simple solution would be to use the 3.3V pin as the analog reference. See the documentation for the analogReference function.
Having said that, if the 5V supply is dropping to 4.5V with all the relays on, then either the relays are taking too much current, or the power supply that is powering the Arduino is not up to the job.
retrolefty:
The LM35 output voltage will be effected by a change in the +5vdc voltage.
I think what is actually happening is that the LM35 output is staying the same, but the Arduino ADC is using the default 5V reference. So, when the 5V supply drops, the apparent input voltage increases.
A simple solution would be to use the 3.3V pin as the analog reference. See the documentation for the analogReference function.
Having said that, if the 5V supply is dropping to 4.5V with all the relays on, then either the relays are taking too much current, or the power supply that is powering the Arduino is not up to the job.
Well the LM35 shows that the output resistor is sized based on the chips supplied voltage (Vs) so if it changes it's output will indeed change.
retrolefty:
Well the LM35 shows that the output resistor is sized based on the chips supplied voltage (Vs) so if it changes it's output will indeed change.
R1 (resistor from the output to a negative supply) is only used if negative output voltages are required (i.e. to read temperatures below 0degC), and I doubt that the OP is using it. The figure that matters on the datasheet is the line regulation, which is given as 0.05mV/V tested limit. So when the supply voltage drops by 0.5V, the output for a given temperature may change by up to 25 microvolts, which is hardly significant.
retrolefty:
The LM35 output voltage will be effected by a change in the +5vdc voltage.
I think what is actually happening is that the LM35 output is staying the same, but the Arduino ADC is using the default 5V reference. So, when the 5V supply drops, the apparent input voltage increases.
A simple solution would be to use the 3.3V pin as the analog reference. See the documentation for the analogReference function.
Having said that, if the 5V supply is dropping to 4.5V with all the relays on, then either the relays are taking too much current, or the power supply that is powering the Arduino is not up to the job.
retrolefty:
Well the LM35 shows that the output resistor is sized based on the chips supplied voltage (Vs) so if it changes it's output will indeed change.
R1 (resistor from the output to a negative supply) is only used if negative output voltages are required (i.e. to read temperatures below 0degC), and I doubt that the OP is using it. The figure that matters on the datasheet is the line regulation, which is given as 0.05mV/V tested limit. So when the supply voltage drops by 0.5V, the output for a given temperature may change by up to 25 microvolts, which is hardly significant.
I think what is actually happening is that the LM35 output is staying the same, but the Arduino ADC is using the default 5V reference. So, when the 5V supply drops, the apparent input voltage increases.
A simple solution would be to use the 3.3V pin as the analog reference. See the documentation for the analogReference function.
Having said that, if the 5V supply is dropping to 4.5V with all the relays on, then either the relays are taking too much current, or the power supply that is powering the Arduino is not up to the job.
[/quote]
Well, I have just tried powering the Relay board via its own 5v supply on the JD-VCC pin, and thats works fine. So looks like the relay board does just suck so much jiuce it effects the 5v supply to the Temp sensor.