HC-SR04

Those with small garages might be familiar with the method of hanging a tennis ball from a ceiling to make sure they don’t hit the back wall with their car. If the car isn’t in the garage, though, the tennis ball dangling from a string tends to get in the way. To alleviate this problem, [asaucet] created a distance sensor that can tell him when his car is the perfect distance from the garage wall.

At the heart of the distance sensor is an HC-SR04 ultrasonic rangefinder and a PIC16F88 microcontroller. [asaucet] uses a set of four LEDs to alert the driver how close they are to the garage wall. [asaucet] also goes into great detail about how to use an LCD with this microcontroller for setting up the project, and the amount of detail should be enough to get anyone started on a similar project.

While this isn’t a new idea, the details that [asaucet] goes into in setting up the microcontroller, using the distance sensor, and using an LCD are definitely worth looking into. Even without this exact application in mind, you’re sure to find some helpful information on the project page.

Measuring air flow in an HVAC duct can be a tricky business. Paddle wheel and turbine flow meters introduce not only resistance but maintenance issue due to accumulated dust and debris. Being able to measure ducted airflow cheaply and non-intrusively, like with this ultrasonic flow meter, could be a big deal for DIY projects and the trades in general.

The principle behind the sensor [ItMightBeWorse] is working on is nothing new. He discovered a paper from 2015 that describes the method that measures the change in time-of-flight of an ultrasonic pulse across a moving stream of air in a duct. It’s another one of those “Why didn’t I think of that?” things that makes perfect sense in theory, but takes some engineering to turn into a functional sensor. [ItMightBeWorse] is using readily available HC-SR04 sensor boards and has already done a proof-of-concept build. He’s getting real numbers back and getting close to a sensor that will go into an HVAC automation project. The video below shows his progress to date and hints at a follow-up video with more results soon.

Cheap stuff gets our creative juices flowing. Case in point? [Andy Grove] built an eight-sensor HC-SR04 breakout board, because the ultrasonic distance sensors in question are so affordable that a hacker can hardly avoid ordering them by the dozen. He originally built it for robotics, but then it’s just a few lines of code to turn it into a gesture-controllable musical instrument. Check out the video, embedded below, for an overview of the features.

His Octasonic breakout board is just an AVR in disguise — it reads from eight ultrasonic sensors and delivers a single SPI result to whatever other controller is serving as the brains. In the “piano” demo, that’s a Raspberry Pi, so he needed the usual 5 V to 3.3 V level shifting in between.

The rest is code on the Pi that enables gestures to play notes, change musical instruments, and even shut the Pi down. The Pi code is written in Rust, and up on GitHub. An Instructable has more detail on the hookups.

The HC-SR04 sonar modules are available for a mere pittance and, with some coaxing, can do a pretty decent job of helping your robot measure the distance to the nearest wall. But when sellers on eBay are shipping these things in ten-packs, why would you stop at mounting just one or two on your ‘bot? Octosonar is a hardware and Arduino software library that’ll get you up and running with up to eight sonar sensors in short order.

Octosonar uses an I2C multiplexer to send the “start” trigger pulses, and an eight-way OR gate to return the “echo” signal back to the host microcontroller. The software library then sends the I2C command to select and trigger a sonar module, and a couple of interrupt routines watch the “echo” line to figure out the time of flight, and thus the distance.

Having two sonars on each side of a rectangular robot allows it move parallel to a wall in a straightforward fashion: steer toward or away from the wall until they match. Watch the video below for a demo of this very simple setup. (But also note where the robot’s 45-degree blind spot is: bump-bump-bump!)

Sometimes the technology part of a project isn’t the hard part. It is having an idea for something both useful and doable. Sure, a robot butler that would do your cleaning and laundry would be useful, but might be out of reach for most of us. On the other hand, there’s only so many use cases for another blinking LED.

[Martinhui] knows how to use an ultrasonic sensor with an Arduino. Driving a motor isn’t that hard, either. The question is: what do you do with that? [Martin’s] answer: Automate a trash can. You can see a video of the result, below.

It seems like every few months we cover another garage door opener, and the concept is quickly becoming the “Hello World” of DIY home automation. In this installment, reader [ray] made his own garage door opener and chose the ESP8266 as the wireless interface of choice, but spiced the application up with an ultrasonic sensor that detects whether the car is in the garage and a web app that shows history, plus integration with Blynk for remote access. For posterity, he made the project open source as well.

The video is well produced with lots of details and instructions, and the circuit board and assembly are refined and clean. It may be a “Hello World”, but it’s done right.

This was gonna happen – sooner or later. [matthewhallberg] built a “Smart” trash can that is connected to the Internet and can be controlled by its own Android App. We’re not sure if the world needs it, but he wanted one and so built it. He started it out on a serious note, but quickly realized the fun part of this build – check out his funny Infomercial style video after the break.

The build itself is uncomplicated and can be replicated with ease. A servo motor helps flip the lid open and close. This is triggered by an ultrasonic ping sensor, which responds when someone waves a hand in front of the trash can. A second ping sensor helps inform the user when it is full and needs to be emptied. A Leonardo with the Idunio Yun shield helps connect the trash can to the internet. An mp3 shield connected to a set of powered computer speakers adds voice capability to the trash can, allowing it to play back pre-recorded sound clips. Finally, a Bluetooth module lets him connect it to an Android phone and the companion app controls the trash can remotely.