Hi
does anyone created a temperature-compensation for the HC-SR04? How it realised?
Greets
Thomas
HC-SR04 and the temperature
Moderators: grovkillen, Stuntteam, TD-er
- dynamicdave
- Normal user
- Posts: 257
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: HC-SR04 and the temperature
I thought the HC-SR04 was an ultrasonic distance measuring device.
Are we talking about the same device?
The SR04 and SR05 work on the speed of sound that varies slightly with changes in altitude (and with temperature as others have pointed out).
Are we talking about the same device?
The SR04 and SR05 work on the speed of sound that varies slightly with changes in altitude (and with temperature as others have pointed out).
Last edited by dynamicdave on 15 Jan 2019, 20:58, edited 1 time in total.
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: HC-SR04 and the temperature
Speed of Sound:
But ... useful?
Don't think so.
1 degree difference is less than 0.2% speed difference.
@20C:c = 331.3 + 0.606 × Temperature_in_C
You can measure the temperature and compensate for the difference to 20C in a rule.c = 331.3 + 0.606 × 20 = 343.42 m/s
But ... useful?
Don't think so.
1 degree difference is less than 0.2% speed difference.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: HC-SR04 and the temperature
Belgium and land of ESP ... counting
Re: HC-SR04 and the temperature
Check this: https://www.instructables.com/id/Improv ... -Accuracy/
I was wondering if you would get better results on a ESP32 as the timer is in µs instead of ms?
I was wondering if you would get better results on a ESP32 as the timer is in µs instead of ms?
Re: HC-SR04 and the temperature
I think this is a bit questionable.
It could be usefull in a car ("distance radar") where you definitely find a span from -20°C to +70°C easily.
But for a sensor like the HC_SR04? Honestly this is a cheap sensor, and it has tolerances of some percent.
Within the temperature range inhouse the factor from the formula is below 1% - for a sensor that has
some percent tolerance this just pretends an exactness that does not exist.
The more: If you have an item not exactly in front of the sensor but some degrees right, left, up or down
you get even more tolerance in readings.
First step would be to calibrate this sensor. This would give better results then temperature compensation.
Anyways, even this would only be exact if an item is exactly in front of the sensor with zero degrees deviation.
It could be usefull in a car ("distance radar") where you definitely find a span from -20°C to +70°C easily.
But for a sensor like the HC_SR04? Honestly this is a cheap sensor, and it has tolerances of some percent.
Within the temperature range inhouse the factor from the formula is below 1% - for a sensor that has
some percent tolerance this just pretends an exactness that does not exist.
The more: If you have an item not exactly in front of the sensor but some degrees right, left, up or down
you get even more tolerance in readings.
First step would be to calibrate this sensor. This would give better results then temperature compensation.
Anyways, even this would only be exact if an item is exactly in front of the sensor with zero degrees deviation.
Regards
Shardan
Shardan
Who is online
Users browsing this forum: No registered users and 161 guests