LM335 Temperature Sensor with Arduino
In this article, we will perform an Arduino project to print the ambient temperature on the screen with the LM335.
You can access the datasheet of the LM335 temperature sensor at the following address;
https://www.st.com/resource/en/datasheet/lm335.pdf
After making the simple connection in the image below on the arduino board, we can start the measurement by uploading the given code to our board.

int outputPin= 0; //analogread A0
void setup()
{
Serial.begin(9600);
}
void loop()
{
int raw_voltage= analogRead(outputPin);
float millivolts= (raw_voltage/1024.0) * 5000;
float kelvin= (millivolts/10);
Serial.print(kelvin);
Serial.println(" degrees Kelvin");
float celsius= kelvin - 273.15;
Serial.print(celsius);
Serial.println(" degrees Celsius");
float fahrenheit= ((celsius * 9)/5 +32);
Serial.print(fahrenheit);
Serial.println(" degrees Fahrenheit\n");
delay(3000);
}

