Displaying the LM35 reading value in degree celsius in python


What changes in the program do i need to make to display the values in degree celsius.

in d section of try:
sensor_value = int(data[‘value’])
Temperature = (100*sensor_value)/1024
print(Temperature)

make these changes and u will get value in celsius

1 Like

To display the values in degree celsius make the following changes to your try block.
Changes specified in bold.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
try:
sensor_value = int(data[‘value’])
if sensor_value > maximum_limit or sensor_value < minimum_limit:
print(“Making request to Twilio to send a SMS”)
temperature = (100*sensor_value)/1024
response = sms.send_sms(“The Current temperature sensor value is” +str(temperature))
print("Response received from Twilio is: " + str(response))
print(“Status of SMS at Twilio is :” + str(response.status))
:::::::::::::::::::::::::::::::::::::::::::::::::