There was a time, not all that long ago, when you have been paid several tens of dollars for a sensor able to guide a DIY robot. Now, the average selling price declined to just a few dollars, and the HC-SR04 ultrasonic sensor is the best example.
This ultrasonic sensor can be purchased from as low as $1.5 on Amazon if you buy a pack of two. The sensor provides pretty accurate measurements for hard obstacles at a distance of 3-4m.
Unfortunately, the sensor return erroneous results. These erroneous results can be treated in one way or another. So, below you will explore eight tutorials that treat the most common problems or improve the features of the HC-SR04 sensor.
- How to solve erratic no-readings problems with HC-SR04 Ultrasonic Sensor, Arduino and millis()
Sometimes these cheap sensors give errors in an erratic way, then work again, then stop again, and so on. In this tutorial, you’ll learn how to fix them by counting the milliseconds using millis() instead delayMicroseconds().
- Spread Spectrum Phased Array Sonar
In this tutorial, Graham Chow shows us how to hack two HC-SR04 ultrasonic sensors to build a spread spectrum phased array.
- Making a better HC-SR04 Echo Locator
When the HC-SR04 sensor doesn’t have obstacles in front or when the obstacles are soft, it returns 0 or erroneous results. You can learn from this tutorial how to correct the false echo problems and make a more accurate HC-SR04 sensor.
- Improve Ultrasonic Range Sensor Accuracy
The accuracy of an ultrasonic sensor depends on the environmental temperature. So if you need accuracy, you have to apply the principle that the sound moves through the air at different speeds depending on the temperature. This tutorial shows you how to apply this principle and calculate the distance using the environment temperature.
- Hack an HC SR04 to a 3 pin sensor
The HC-SR04 sensor uses one pin for Trigger and one for Echo. So you need to use two pins of your microcontroller to measure the distance detected by the sensor. In this tutorial, you can find how to use only one pin of the HC-SR04 to calculate the distance detected by the sensor.
- Ultrasonic sensor comparison: HC-SR04, PING, Maxbotix
The HC-SR04 sensor is not the most accurate ultrasonic sensor on the market. Well, it’s very far from that. But in this article, the author compare it with two other ultrasonic sensors and give a brief overview of the differences and how to write the program that reads values for the sensors.
- Long Range Ultrasonic Distance Sensor
The HC-SR04 sensor provides 2cm to 400cm non-contact measurement function. You have at least one option to increase the measurement range of the sensors. The method that increases the range is using a parabolic dash to reduce the ‘field of view’ (FOV) of the basic sensor. In this experiment was achieved a measured distance of 9.24 meters.
- Arduino Radar Project
You can build tons of projects using the cheap HC-SR04 sensor. This DIY radar is one of them.