Fortunately ultrasonic sensors are invulnerable to other conditions such as hard water grease and corrosive chemicals because they don t actually touch the water.
How to use an ultrasonic sensor.
You can connect the ultrasonic sensor directly to the arduino with wires or use a breadboard.
Ultrasonic sensors work by emitting sound waves at a frequency too high for humans to hear.
Breadboard a thin plastic board used to hold electronic components transistors resistors chips etc that are wired together.
340 meters per second.
If an object is outside this range the sensor will return a.
Once you understand how an ultrasonic sensor works getting the installation right can be a bit tricky considering all the factors involved.
Lastly complete the circuit by connecting the ultrasonic sensor s ground pin to the arduino s ground pin.
Attaching a 90 degree header to the ultrasonic sensor makes it very easy to attach it to a breadboard.
The transmitter transmits the sound waves whereas the receiver receives these transmitted sound waves reflected back from the object.
Install arduino sketch coding software onto your pc.
One of the eyes transmits a sound and the other waits for the echo of the sound to return.
Using your ultrasonic sensor in your project 1.
From the time this process takes the distance of the object from the sensor can be calculated.
So an ultrasonic sensor also known as ping sensor is commonly used to measure the distance of an object from its surface by emitting and receiving sound waves.
Connect the ultrasonic sensor s 5v pin to the 5v pin on the arduino.
Connect echo to digital pin 6 on your arduino board.
This is similar to how radar measures the time it takes a radio wave to return after hitting an object.
It kinda works like a radar about which you must have read in your high school books.
Connect trigger to digital pin 7 on your arduino board.
Ultrasonic sensor help from tracom.
The ultrasonic sensor has four terminals plus 5v trigger echo and gnd connected as follows connect the plus 5v pin to plus 5v on your arduino board.
The ultrasonic sensor has a range of 3 400cm.
Connect gnd with gnd on arduino.
Connect the pin labeled echo to pin 9 on the arduino.
Speed of the ultrasounds.
The ultrasonic pulses collide an object and leaves in the other direction.
The ultrasonic sensor sends 8 pulses of 40khz via the trig terminals inaudible to humans it s ultrasounds.
We used an arduino in this example but you can use another controller and program of your choice.
They then wait for the sound to be reflected back calculating distance based on the time required.
The echo terminals receives the ultrasound pulses and the sensor calculates the distance based on the time of the pulses.