Go Down

Topic: Anyone could hel me? (Read 2161 times) previous topic - next topic

Arduin02

anyone has a program to turn on the ligt when the temperature is 20ºC and turn off the light when is 25ºC  (i have an Arduino UNO sensor temperature rele...)
At the same time i want to activate the servo when the light turn off and discativate the servo when the light is on

PaulS

Are you able to read the temperature sensor? Are you able to convert the analog reading to a temperature?

If so, then turning an LED on when the temperature is between 20 and 25 degrees is simple:
Code: [Select]
if(tempC > 20.0 && tempC < 25.0)
 digitalWrite(ledPin, HIGH);
else
 digitalWrite(ledPin, LOW);


Quote
At the same time i want to activate the servo when the light turn off and discativate the servo when the light is on

Doing this is more complicated. What kind of servo is it? If it is a normal servo with a 0 to 180 degree sweep, then you need to define what you mean by "activate it".

If it is a modified servo that has been turned into a continuous rotation servo, then it isn't a servo. You need to define how you want the servo to move when the temperature is below 20.0 or above 25.0.

Arduin02

I'm not able to do anything!  Ican't even make the seervo work whit a example preogram

Arduin02

And what exackty I need to read the tempertur sensor and how to convert reading to temperatur?
What elements are necessary

PaulS

Quote
And what exackty I need to read the tempertur sensor and how to convert reading to temperatur?
What elements are necessary

Well, first you need a temperature sensor. Have you got one? Which one?

Arduin02

Yes
It's a simple restience (temperatur sesor of 240k) i'd buy in a electronic shop

PaulS

Quote
t's a simple restience (temperatur sesor of 240k) i'd buy in a electronic shop

They are all simple, but they are all different. If you can't be more specific, I can't help you.

Arduin02


PaulS

You're up to 15 posts. You can post links now.

Arduin02

any help with the sensor
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?action=post;num=1294186279;title=PostReply

PaulS

Quote
You're up to 15 posts. You can post links now.

Useful links, that is. Like to the sensor you have. You are really trying my patience, you know.

Arduin02

http://es.wikipedia.org/wiki/NTC

sorry

PaulS

I don't read spanish, and I doubt that you bought the sensor from wikipedia.

Connect one end of the thermistor to +5V. Connect the other end to an analog pin. Connect a resistor from the analog pin to ground.

Measure the resistance of the thermistor to get an approximate value for the other resistor.

Use analogRead to read the value of the pin. Since the NTC is approximately linear, you need to determine the value that analogRead returns when the thermistor is in ice water (0 C) and in boiling water (100 C). Those two values will allow you to determine the temperature corresponding to any other reading.

bld

#13
Jan 05, 2011, 04:43 pm Last Edit: Jan 05, 2011, 04:47 pm by bld Reason: 1
Ah, I see... you are asking about the same here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294188664 just with way less information...

And you really should try to make some better subjects, either "HEEEELP!!!!" or "Anyone could hel me?" says anything at all about your actual problem.

Quote
I'm not able to do anything!  Ican't even make the seervo work whit a example preogram

Start by making that work, if your hardware is already failing at at known working code, it will also fail with your experimental code.
captain-slow.dk | non contagious!

GregaG

#14
Jan 05, 2011, 04:56 pm Last Edit: Jan 05, 2011, 05:14 pm by GregaG87 Reason: 1
First of all dude ull have to do a bit more explanation, especialy about servo.

Now as i understand u want to measure temperature with an NTK resistor, so ur best bet is to do a voltage splitter with NTK and another resistor, measure analog reading or voltage at 20 degrees and at 25 degrees. Now if the value is below or above (depending how u connected NTK) those analog values, u turn the light off.
Also the resistor has to have enought high resistance for good resolution.

Go Up