0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« on: January 04, 2011, 07:11:19 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #1 on: January 04, 2011, 07:24:02 pm » |
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: if(tempC > 20.0 && tempC < 25.0) digitalWrite(ledPin, HIGH); else digitalWrite(ledPin, LOW); 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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« Reply #2 on: January 04, 2011, 07:39:14 pm » |
I'm not able to do anything! Ican't even make the seervo work whit a example preogram
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« Reply #3 on: January 04, 2011, 07:41:58 pm » |
And what exackty I need to read the tempertur sensor and how to convert reading to temperatur? What elements are necessary
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #4 on: January 04, 2011, 07:51:40 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« Reply #5 on: January 04, 2011, 07:54:50 pm » |
Yes It's a simple restience (temperatur sesor of 240k) i'd buy in a electronic shop
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #6 on: January 05, 2011, 04:07:49 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« Reply #7 on: January 05, 2011, 04:19:46 am » |
NTC 270k
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #8 on: January 05, 2011, 05:24:12 am » |
You're up to 15 posts. You can post links now.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« Reply #9 on: January 05, 2011, 05:49:23 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #10 on: January 05, 2011, 05:56:27 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
Arduino rocks
|
 |
« Reply #11 on: January 05, 2011, 06:34:26 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #12 on: January 05, 2011, 06:58:24 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Vejen, Denmark
Offline
Edison Member
Karma: 7
Posts: 1176
RAWR! ^,..,^
|
 |
« Reply #13 on: January 05, 2011, 10:43:17 am » |
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. 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.
|
|
|
|
« Last Edit: January 05, 2011, 10:47:46 am by bld »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 37
Arduino rocks
|
 |
« Reply #14 on: January 05, 2011, 10:56:40 am » |
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.
|
|
|
|
« Last Edit: January 05, 2011, 11:14:29 am by GregaG87 »
|
Logged
|
|
|
|
|
|