Introduction: HC-SR04 VS VL53L0X - Test 1 - Usage for Robot Car Applications
This instructable proposes a simple (though as scientific as possible) experimenting process for comparing roughly the effectivity of two most common distance sensors, which are of a completely different physical functioning. The HC-SR04 uses ultrasound, means sound (mechanical) waves and the VL53L0X uses infrared radio waves, that is electromagnetic very near (in frequency) to optical spectrum.
What is the practical impact of such a ground difference?
How can we conclude which sensor fits best to our needs?
Experiments to be done:
- Distance measurements accuracy comparison. Same target, plane of target vertical to distance.
- Target material sensitivity comparison. Same distance,plane of target vertical to distance.
- Angle of the target plane to the line of distance comparison. Same target and distance.
Of course there is much more to be done, but with these experiments can somebody take an interesting insight to sensors evaluation.
At the last step is given the code for the arduino circuit that makes the evaluation possible.
Step 1: Materials and Equipment
- wooden stick 2cmX2cmX30cm, which serves as a base
- peg 60cm long 3mm thick cut in two equal piece
- the pegs must be put firmly and vertically in the stick 27cm apart (this distance is not really important but is related to our circuit dimensions !)
- four different types of obstacles the size of a typical photo 15cmX10cm
- hard paper
- hard paper - reddish
- hard paper covered with aluminum foil
- for the holders of the obstacles, I made two tubes out of old pencils which can rotate around the pegs
for the arduino circuit:
- arduino UNO
- jumper cables
- one HC-SR04 ultrasonic sensor
- one VL53L0X infrared LASER sensor
Step 2: Some Information About the Sensors...
Ultrasound distance sensor HC-SR04
Old time classics of economy robotics, very cheap although deadly sensitive in case of a wrong connection. I would say (although irrelevant to the aim of this instructables) not ecoomic for the energy factor!
Infrared Laser distance sensor VLX53L0X
Uses electromagnetic waves instead of mechanical sound waves. In the plan I supply there a wrong connection that means according to the datasheet (and my experience!) should be connected to 3.3V instead of 5V in the diagramm.
For both sensors I supply datasheets.
Step 3: Apparatus Affect on the Experiment
Before beginning the experiments, we have to check the influence of our "appliance" on our results. To do this, we try some measurements with out our experimental targets.
So after leaving the pegs alone, we try to "see" them with our sensors.
According to our measurements at 18cm and at 30cm distance to the pegs, the sensors give irrelevant results. So they don't seem to play some role to the our coming experiments.
Step 4: Distance Accuracy Comparison
We notice that in case of distances smaller than 40cm or so, the accuracy of the infrared is better, instead of the longer distances where the ultrasound seems to work better.
Step 5: Material Dependent Accuracy
For that experiment I used differently colored hard paper targets with no difference in the results (for both sensors).
The big difference, as expected, was with the plexiglass transparent target and the classic hard paper target. The plexiglass seemed to be invisible to infrared, instead of the ultrasound to which were no difference. To show this, I present the photos of the experiment along with the related measurements.
Where the accuracy of the infrared sensor dominates the competition is in the case of strongly reflective surface. That is the hard paper covered with aluminum foil.
Step 6: Angle Related Distance Accuracy Comparison
According to my measurements there is a much more stronger dependence of the accuracy on the angle in case of the ultrasound sensor, instead of the infrared sensor. The inaccuracy of the ultrasound sensor increases much more with the increase of the angle.
Step 7: Arduino Code for Evaluation
The code is as simple as possible. The aim is to show at computer screen simultaneously the measurements from both sensor so to easy to compare.