Go Down

### Topic: Help with resistors (Read 825 times)previous topic - next topic

#### Cusso

##### May 30, 2013, 06:17 pm
Hi everybody. I'm new there and I'm a 14-years-old italian, so if I wont understand anything... you'll know why!
I need some help with a dynamic resistor-temperature sensor, doing it easy, I need to know the output in volts and Ampere, only knowing ohms and input. Is there any operation to do it?
For example, if I want to do a thermometer, with a led which turns on when the room reach a specific temperature, what should I write there?

if (>temperatura<)

What have the question marks to turn in?
volts, millivolts, ampere?

#### MarkT

#1
##### May 30, 2013, 06:23 pm
It may be good to convert the ADC reading to a temperature (you'll need to find
example code for your thermistor / temperature sensor).

Then the comparison can be in Celsius.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

#### Cusso

#2
##### May 30, 2013, 06:25 pm
thank you. What do you mean for ADC? Sorry but I'm new on microcontrollers

#### Grumpy_Mike

#3
##### May 30, 2013, 06:33 pm
ADC is Analogue to Digital converter.
Don't other turning it into voltages just use the raw numbers from the analogRead function
Code: [Select]
`Val = analogRead(0);If( Val > 100 && Val < 600) { // then do something`

#4
##### May 30, 2013, 06:34 pm
Analog to Digital Converter
Code: [Select]
`if (analogRead(A0)) >= someNumber){  // read the voltage of sensor// do something}else{// do something elso}`
The result of analogRead will be a number from 0 to 1023.
0 might represent 0C, 200 might represent 50C, 400 might represent 100C, and so on.
You will have to understand how your sensor works and what the numbers represent.
Maybe you will have to do some math to show the results as the temperature you expect.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### Cusso

#5
##### May 30, 2013, 07:11 pm
Thank you all! Now I understood! I was a bit idiot not understanding before!!!