This is a simple yet great and super easy project. In this project, we are using one ultrasonic sensor to track one object in one dimension, and finding it's distance.
Through this project, we can tell whether the object is going further, or coming closer, or it is at same point- it is not moving.
In this project we are using only2mainhardware that are :
- any type of Arduino board can be used (uno, nano, mega, etc.), but it should have 5v output. I have used Arduino nano.
- Ultrasonic sensor (HC-SRO-4)
Herearesomepicsoftheproject:
To startup
1)How Does an Ultrasonic Sensor Work?
It works by sending a sound wave, an receiving reflected wave by the object. and if there will be no object there will be no reflected wave.
Ultrasonic sensors work by emitting sound waves at a frequency too high for humans to hear(ultrasonic waves). They then wait for the sound to be reflected back, calculating distance based on the time required. This is similar to how radar measures the time it takes a radio wave to return after hitting an object.
If you need to measure the specific distance from your sensor, this can be calculated based on this formula:
Distance = ½ T x C
(T = Time and C = the speed of sound)
At 20°C (68°F), the speed of sound is 343 meters/second (1125 feet/second), but this varies depending on temperature and humidity.
Specially adapted ultrasonic sensors can also be used underwater. The speed of sound, however, is 4.3 times as fast in water as in air, so this calculation must be adjusted significantly.
It works by sending a sound wave, an receiving reflected wave by the object. and if there will be no object there will be no reflected wave.
if you licked, please support me on my you-tube, click here
--------------------------------------------------------------------------------------
connections ----
ifyouareusingmycode,maketheseconnections..............
----------------------------------------------------------------------------------
troubleshooting
- check the com port while uploading.
- make sure wright board is selected.
- make sure wright bootloader is selected.
-------------------------------------------------------------------------------------
this program is tested and works great!!!!!
Comments