first value of ultrasonic hc-602 are wrong

Thread Starter

dashhossein

Joined Jul 30, 2020
42
hello everyone .
i have a hc-602 ultrasonic sensor and use esp 8266 as microcontroller . i connect the sensor to 5v 1a electricity and the gnd of sensor and microcontroller are common .

when i monitor that i receive some value , the first values always are wrong, but after some wrong value the data will be correct without doing anything .
my question is why first values of the sensor are wrong ?
any idea ?
 

Alec_t

Joined Sep 17, 2013
11,984
why first values of the sensor are wrong ?
I'm not familiar with that sensor, but many circuits take a little while from switch-on to stabilise. For analogue circuits this may be due to capacitors charging. For digital circuits it may be due to boot-up/initialisation routines.
 

djsfantasi

Joined Apr 11, 2010
7,563
I’m not familiar with the ESP MCU, but the ADC in ATMega MCUs are recommended to throw away the first value whenever switching channels. And I understand that it has to do with the capacitance of the ADC.
 

upand_at_them

Joined May 15, 2010
762
I’m not familiar with the ESP MCU, but the ADC in ATMega MCUs are recommended to throw away the first value whenever switching channels. And I understand that it has to do with the capacitance of the ADC.
An erroneous first value could indicate an acquisition time that is too short.
 
Top