int ledPin=13; int sensorPin=A0; int temp=0; void setup() { // put your setup code here, to run once: pinMode (ledPin, OUTPUT); } void loop() { // read the value on sensorPin int sensorPin = analogRead(A0); temp = (5.0 * sensorPin * 100.0) / 1024; //formula to convert voltage into Celsius degrees if(temp>=18)//if temperature is equal or bigger than 18 degrees { digitalWrite(ledPin,HIGH);//Turn ON LED (as my serial monitor doesn't work I turn on/of the LED) } else//if temperature is under 19 degrees { digitalWrite(ledPin,LOW);//Turn OFF LED } }