Arduino Uno .. Temperature Sensor with Led Display..

Hello !! Im new to arduino as well as programming… :slight_smile: can i please get a code for using Temperature Sensor where the temperature level is indicated by blinking / glowing LED… it may be the imbuilt LED in port 13 as well… thanks

can i please get a code for using Temperature Sensor where the temperature level is indicated by blinking / glowing LED.. it may be the imbuilt LED in port 13 as well.

This isn't the homework hotline. Even they expect more information. Which temperature sensor? Which pin is it connected to? What should a temperature of 45 degrees F cause the LED to do? How about 75 degrees? -48 degrees?

Sensor : P2N2222A1335 (3 pin temperature sensor in arduino uno) i want the led to inbuilt led in port 13 to glow when temperature is above 25 Celsius and i want it to stop glowing when below 25

So what have you tried so far?

Sensor : P2N2222A1335 (3 pin temperature sensor in arduino uno)

You google it. I'm not.

i want the led to inbuilt led in port 13 to glow when temperature is above 25 Celsius and i want it to stop glowing when below 25

So, where is your code? This is probably trivial.

//TMP36 Pin Variables int temperaturePin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to //the resolution is 10 mV / degree centigrade //(500 mV offset) to make negative temperatures an option

/* * setup() - this function runs once when you turn your Arduino on * We initialize the serial connection with the computer */ void setup() { Serial.begin(9600); //Start the serial connection with the copmuter //to view the result open the serial monitor //last button beneath the file bar (looks like a box with an antenae) }

void loop() // run over and over again { float temperature = getVoltage(temperaturePin); //getting the voltage reading from the temperature sensor temperature = (temperature - .5) * 100; //converting from 10 mv per degree wit 500 mV offset //to degrees ((volatge - 500mV) times 100) Serial.println(temperature); //printing the result delay(1000); //waiting a second }

/* * getVoltage() - returns the voltage on the analog input defined by * pin */ float getVoltage(int pin){ return (analogRead(pin) * .004882814); //converting from a 0 to 1023 digital range // to 0 to 5 volts (each 1 reading equals ~ 5 millivolts }

this is the code for normal temperature sensor for displaying temperature in screen.. instead of the Print Command i want to use the if/ else code to make the led glow in 13th port (inbuilt led in most of arduino boards) when temperature is above 25 C and stop glow when Temp is below 25..

Edit your post to surround your code with CODE tags.

how

Revise the post, select all the code then click the # button above the smileys.

As to your problem, do you know how to turn an LED on and off ? If not, you need to find out. Then, instead of printing the temperature you can write the code to say 'if the temperature is above 25 then turn on the LED, else turn it off'

how

Assuming that was a question, and not a Native American greeting, start here