Sonar Measuring Device

For my Maker Faire project, I wanted to make a cool electronic device. I heard about laser and sonar measuring devices, but the laser is very complex so I went with a sonar distance measuring device. This is a device that sends a very high pitched sound (higher than humans can hear) to a target and when the sound bounces back the device receives the sound and based on how long it took for the sound to come back it sends a certain pulse (a burst of electricity that lasts a certain time).

I coded my Microbit to convert that pulse into the distance based on an algorithm. The Microbit displays the distance to the nearest foot on the LED display. The Microbit was being powered by a battery pack and the Microbit was powering the sonar sensor and the sonar sensor was sending back out that electricity as a pulse, but there was a problem. Computers are made of 1s and 0s, which are represented by a voltage. X voltage and below would count as 0 and Y voltage to Z voltage would count as 1 (any above and the computer might fry) (X, Y, Z are random volts where X<Y<Z), but there is a gap between X and Y because any voltage in that gap might just be a vibration so . The pulse that the sonar sensor was sending was in that gap, so the Microbit couldn’t receive it. The sonar sensor was lowering down the voltage by 2 volts to the Microbit’s gap. So I got a mobile phone charger, which emitted more volts than the Microbit which is powered by batteries, connected it to a board and had two wires, one going to the Microbit and one going to the sonar. This phone charger gave the sonar a larger input than the batteries + Microbit, so the output (pulse) would be in the Microbit’s voltage range. But the pulse was above the Microbit’s range (an area where it would get fried), so I added three diodes which decreased the voltage to the 1 area so the Microbit would pick it up.

I had a really fun time making this. I learned from my dad about the range of 1 and 0 and the gap between which is really cool and I have a newfound respect for DIYers who use spare electronics to make things. In the future, I would like to make it more precise and accurate in its distance readings. I should say I want to make it all less messy or at least 3d print a case for it, but I know I don’t care enough about neatness to do so. If someone wants to do this I would recommend using an oscilloscope or something of that sort before plugging it into the Microbit because it is easy and not fun to fry it.

Estimated total cost: $45 (though the sonar sensor I already had from my dad’s old DIY drone, I had the Microbit, which I have used in previous projects, and the rest was stuff my dad had).
Links: https://www.maxbotix.com/Ultrasonic_Sensors/MB1000.htm,    https://microbit.org/code/,   https://www.maxbotix.com/documents/LV-MaxSonar-EZ_Datasheet.pdf


No comments:

Post a Comment