Hello,
I'm testing one temperature sensor LM335 with my Arduino Nano 33 Iot. The problem is that I have it connected to the analog pin A0, 5V and GND and it shows me through the Serial monitor always a 1023. I tested the sensor with a multimeter and it shows correct values of the Voltage. I don't know what's the problem. I post here my conection and also the code. I also connected the analog pin to GND and it give me 0, so help please.
void setup() {
Serial.begin(9600);
}
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(100);
}
You probably need to use a voltage divider (2 resistors) to drop the LM35 output voltage down to the Nano's analog input voltage range, which is ?
An R1 of 10k and R2 of 15k would drop 5V to 3V.
Okey, so I modified the circuit and now is giving me those values. I tested all the analog pins with a simple program of a potentiometer and all of the 8 pins work great. So now the program I used is the following one:
long value;
void setup() {
Serial.begin(9600);
}
void loop() {
value = analogRead(A0);
Serial.print("Value is = ");
Serial.println(value);
delay(100);
}
This program keeps giving me values around 800, but applying heat to the sensor LM335, the values are the same. Now I have the correct conection of the sensor that is the one in the image. So I don't know why this sensor isn't reading anything. Pins are 3.3 V, GND and A0.