Hello,
What accuracy do you need 1Meter +- xx mm ? xx cm ?
What is the global range of measurement ... example: 4meters maxi ?
Maybe you wil have to add , temperature compensation for Speed velocity in the air
What is your FOSC ? 12MHZ ? 1 cycle=1µS ?
time duration for ultrason travel (x 2 ) by timer1 ?
Minimum distance = low limit for measurement = xx cm ? example 8cm
i think with your 8051, you will get a poor resolution
but maybe enough for you .
Ultrasonic velocity in the air : 5.88 µS/mm parcouru à 20°C (340M/sec)
1 meter => 5.88mS
Threshold value to detect this limite
i tested a HCSR04 with PIC18F26K22 at 16MHz ( 1 cycle=0,25µS)
Drift of measure observed within 60 samples
Delta maximal de 0,35% sur 1,7M (observé sur 1 minute de mesure ) 60 mesures
with air temp compensation via LM35DZ sensor