I don't understand how to convert voltage in temperature.
My sensor is a IR temperature sensor with 5 V DC power supply 
(http://it.tinypic.com/r/dqfx37/9). 
My beaglebone cannot support an output (0-5V) so I've used this voltage 
divider.
I've calculated the resistor R1=634 Ohm (5% so it's not so good but it's 
what I have now) and R2=324 Ohm (5%), considering an output max of 5.3V to 
scale to 1.8V.
So the conversion factor is (R2/(R1+R2))=0.34. So 1/0.34=2.94.
All it seems working. I can read with multimeter a voltage of 49/50mV in my 
room.
My running instead produces fluctuanting values between 20 to 65.
I read in python analog in this way:

import Adafruit_BBIO.ADC as ADC
import time

sensor_pin = 'P9_40'

ADC.setup()

while True:
reading = ADC.read(sensor_pin)
millivolts = 2.94*(reading) #to obtain original voltage
temp_c = (millivolts) #here I've to obtain the correct slope to convert 
volts in degree
time.sleep(1)

Is it correct my code?

Thanks.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to