converting temperature from ADC

I don’t understand how to convert voltage in temperature.
My sensor is a IR temperature sensor with 5 V DC power supply (
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’


while True:
reading =
millivolts = 2.94*(reading) #to obtain original voltage
temp_c = (millivolts) #here I’ve to obtain the correct slope to convert volts in degree

Is it correct my code?