Go Down

### Topic: LM35and relay (Read 1 time)previous topic - next topic

#### Wawa

#15
##### Feb 08, 2016, 11:12 pm
@68tjs
I don't want to quote all your calculations. They seem correct. Some things I do want to add.
Voltage regulators CAN also be +/- 5%, so Aref with external supply CAN be 4.75 to 5.25volt (see voltage regulator datasheet). Practically, they are <1% off. That also goes for the 3.3volt regulator.
Another problem is load regulation. A flashing onboard LED, or PWM-ed LCD backlight dips the supply, and so Aref. That shows up in the A/D values.
I use the 1.1volt Aref with the LM35, because it gives me more A/D values to work with.
I use oversampling because it hides the random dips/peaks, and it gives me more values to calculate with (you need 10.000+ for displaying 100 degrees C with two decimal places).
Leo..

#### 68tjs

#16
##### Feb 09, 2016, 01:12 amLast Edit: Feb 09, 2016, 01:13 am by 68tjs
When you are in internal reference mode you can measure exact value of Internal Vref.
Datasheet says that this value is available on Aref. So it can be measured with a highZ digital voltmeter.

But I always think that a true 1,25V voltage reference ,not a voltage regulator, is the best solution.

FYI I also managed to use an LM35 after 50 m of cable cat5 ethernet.

Schematic:
- LM35 side: 100 Ohm resistor between the output of LM35 and the beginning of the cable.
- Arduino side: 100ohms + 100nF (serial of course)  between analog input and ground.
Like all  CMOS IC, LM35 not like to see too much capacity. The fact of adapting the cable cat5 like for high frequency drastically reduces the capacitive effect.

#### Wawa

#17
##### Feb 09, 2016, 01:25 amLast Edit: Feb 09, 2016, 01:36 am by Wawa
1) You can use a factory adjusted reference voltage, and hope the reference voltage and the sensor are calibrated to the accuracy you want.
2) Or you can use a random (but stable) reference voltage, and calibrate yourself.
The final result will be the same.
For mass production, the first option will be best.
But this is a hobby forum, so why not calibrate yourself and learn from it.
The number in the maths line in the sketch of post#8 was first calculated, and then finetuned with a big cap (470u) connected to A0/ground, with a DMM across, and charged to 1volt.
Untill 1.000volt on the cap resulted in 100,00 degrees C.
Leo..

#### paulo_ferreiraa

#18
##### Feb 09, 2016, 11:20 am
I changed the gnd of both LM35 and the relay but now instead of growing 10ºC it goes down about 3ºC.

#### 68tjs

#19
##### Feb 09, 2016, 09:01 pm
In which condition ?
Which voltage reférence :
Default ?
External ?
Internal ?
Pic of the wiring ?

If you don't give all informations it is impossible to help you.

#### paulo_ferreiraa

#20
##### Feb 09, 2016, 10:38 pm
When the relay is on the temperature goes down.
Here is a pic of the wiring, i am using the other arduino just to provide power to the breadboard.
http://imgur.com/N7sjQ1o

#### Wawa

#21
##### Feb 10, 2016, 02:14 amLast Edit: Feb 10, 2016, 02:18 am by Wawa
Why use 5volt from a different Arduino.
LM35 ground is now not connected to the Mega at all, or maybe via the computer/supply ground. Worse than before.

Problem with a shield like that is that most ground/power pins are covered.
There are still two ground left. The ground next to pin 52, and the ground next to pin 53.
Use one for the relay, and the other one for the LM35.

No exposed power pins left, but you can configurate an unused pin as output, and set it "high".
And use that to power the LM35.
A 10n bypass cap might be needed across power/ground of the LM35.
Leo..

#### TomGeorge

#22
##### Feb 10, 2016, 02:24 am
Hi,
Your protoboard has a break in the red and blue side conductors in the middle, if you follow the red and blue lines they are not continuous all the way down the edge of the board.
You will need to jumper them if you need continuity down the entire length.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom....
Everything runs on smoke, let the smoke out, it stops running....

#### Wawa

#23
##### Feb 10, 2016, 02:31 am
Hi,
Your protoboard has a break in the red and blue side conductors in the middle, if you follow the red and blue lines they are not continuous all the way down the edge of the board.
You will need to jumper them if you need continuity down the entire length.
Hi Tom.
I assumed OP knew this, as he was told to separate relay ground from sensor ground.
Leo..

#### paulo_ferreiraa

#24
##### Feb 10, 2016, 10:56 amLast Edit: Feb 10, 2016, 07:01 pm by paulo_ferreiraa
Ok i connected the gnd to the gnd pins on the mega and it is working now. I programmed two unused pins to provide power to the LM35 and relay, LM35 seems to work fine but the relay power seems to low even though it is working.
Can someone explain why it was not working with other gnd source?

#### Wawa

#25
##### Feb 10, 2016, 08:02 pm
I programmed two unused pins to provide power to the LM35 and relay, LM35 seems to work fine but the relay power seems to low even though it is working.
You can provide power to the LM35 that way, because it uses almost nothing (<60uA).
But you can't provide power to the relay with an output pin, because it uses ~75mA.
Way over the 40mA absolute max.

I assumed you powered the relay from an external power source.
Time to solder a wire to the 5volt pin of the board.
Or use some intermediate screw shield.
Leo..

Go Up