Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] 8052-at89s52 ,HC SR-04 ULTRASONIC SENSOR ,1 cm error in every 30 cm

Status
Not open for further replies.

RAHUL_KUMAR

Member level 5
Joined
Jun 5, 2017
Messages
90
Helped
4
Reputation
8
Reaction score
4
Trophy points
8
Location
Bhubaneswar,Odisha,India
Activity points
786
HC SR-04 ULTRASONIC SENSOR

On 15 CM ,error is 0.5 cm
on 30 cm ,error becomes 1 cm (short)

is there any way to compensate this error by any means like any hardware connection? ,or we have only way left with option of compensating by programming logic ??
 

They don't give any specification on accuracy, which may indicate that you are stuck with what you have. But why NOT use software to compensate it? Software is free, hardware is not.
 
sir,
is it common to have such big difference?
what is the error percentage of HC SR-04 ??

If the manufacturer can't (or won't) tell you what the accuracy is, I cerstainly can't.

You're seeing about 3% error. Why do you think that is 'big'?
 

sir , its application part is Digital to Analog convertor ,.on every 10 cm ,1 volt increament
11cm = 1.1 v,
12cm= 1.2volt ....
it will certainly give significant error in this case ,i think so
 

Your posts seem to omit important information. HC-SR04 has pulse output, delay between start and echo signal gives the distance information. It's basically determined by sound speed, but receiver circuit level dependency may add an error. Temperature dependency of sound speed must be also considered.

You have apparently a time-to-voltage circuit involved, how can we know what's causing the error?
 

hello,

HS SR-04 response follow Y=Ax +b
x is time
b= offset to adjust by software (minimum range of measure)
and A coefficient (Air velocity) to corrected by delta Air Temperature

at least, use filtered values to reduce the shifts of measure..
to compare values measured you musthave a large target in front of sensor.

**broken link removed**..
 
hello,

HS SR-04 response follow Y=Ax +b
x is time
b= offset to adjust by software (minimum range of measure)
and A coefficient (Air velocity) to corrected by delta Air Temperature

at least, use filtered values to reduce the shifts of measure..
to compare values measured you musthave a large target in front of sensor.

**broken link removed**..


I used transistor as a not gate for echo pin for using hardware interrupt(which service ISR on being 0) . Will the transistor switching speed matters in this case,would it also or may add error ??
 

Hi,

for sure the transistor will cause some delay.
If the circuit is properly designed, then the delay will be vary short and thus it will not matter. ... but we don´t know about your circuit and the part values.

Klaus
 

_20181002_184804 (1).JPG

transister- BC547
the image having hardware connection details for reference
 

Hi,

no voltages?
I have to guess.
* From rising_echo to uC_falling I expect less than 1us
* From falling_echo to uC_rising I expect more than 1us (mainly depends on echo_LOW_voltage (real value) and stray capacitance on bjt_collector)

Klaus
 

I used transistor as a not gate for echo pin for using hardware interrupt(which service ISR on being 0) . Will the transistor switching speed matters in this case,would it also or may add error ??

commuation time is a value in nanosecondes !
you have air speed velocity of U.S.
5.88 µS/mm
so , not a problem with any nS even with 1µS .!
if you have not inserted RC filter .
 

so overall 2 micro second is the difference ..though it will not add much difference at all.


second thing is that - the sound speed varies at different temperature and humidity
at 0 degree- 331m/s
i was taking the value 347 m/s which is at 30 degree.

real temperature is 35 degree , so i also taken it into consideration 331m/s + 0.6*temp ==> 352m/s at 35 degree
that has reduced the error ..significantly
should i take humidity factor also into consideration ?

https://sciencing.com/humidity-affect-speed-sound-22777.html
as per the above link - sound travels about 0.35 percent faster in 100 percent humidity.

current humidity is 81 percent ,...(considering close to 100 percent) should i add 0.35 percent of 347m/s(velocity at room temp) ?? // as per the above link information.

final sound speed will be = 352+ 0.35% of 347
= 352+ 1.21
= 353m/s

is there anything else which i should take into consideration??

- - - Updated - - -

- - - Updated - - -

commuation time is a value in nanosecondes !
you have air speed velocity of U.S.
5.88 µS/mm
so , not a problem with any nS even with 1µS .!
if you have not inserted RC filter .

no ,i am not using any RC filter,
yes, even `1 uSec will not add any significant error .

- - - Updated - - -

Hi,

no voltages?
I have to guess.
* From rising_echo to uC_falling I expect less than 1us
* From falling_echo to uC_rising I expect more than 1us (mainly depends on echo_LOW_voltage (real value) and stray capacitance on bjt_collector)

Klaus

vcc is 5 volt.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top