Answer the question
In order to leave comments, you need to log in
Why does the LM35 temperature sensor show wavy values?
The LM35 sensor gives strange values that go up and down, like this:
int temp; // освобождаем память для переменной "temp"
float grad; // освобождаем память для переменной "grad"
void setup() // процедура setup
{
pinMode(A0, INPUT); // сенсор LM35 подключим к аналоговому входу A0
Serial.begin(9600); // подключаем монитор порта
}
void loop() // процедура loop
{
temp = analogRead(A0); // переменная находится в интервале 0 - 1023
//Serial.println(temp);
grad = ( temp/1023.0 )*5.0*1000/10; // формулу можно изменять
Serial.println(grad); // выводим значение температуры на монитор
delay(100); // ставим небольшую задержку
}
Answer the question
In order to leave comments, you need to log in
First, try lowering the polling rate to reduce the error from sensor heating.
Well, you need to order several at once in order to reduce the serviceability error from Chinese sensors. :-)
Maybe the wire is long and pickups go? It would be possible to pull it through a resistor to the ground.
What is strange about them? sort of like a simple heating from 0 to 34 and then cooling.
If you mean drift by tenths of a degree, this is also normal for arduinos and such sensors.
This is not 50 Hz interference, by any chance? Schedule to build to check, too lazy. :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question