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!)
Continue reading “Octosonar is 8X Better than Monosonar”
On paper, bicycling is an excellent form of transportation. Not only are there some obvious health benefits, the impact on the environment is much less than anything not directly powered by a human. But let’s face it: riding a bike can be quite scary in practice, especially along the same roads as cars and trucks. It’s hard to analyze the possible threats looming behind you without a pair of eyes in the back of your head.
[Claire Chen] and [Mark Zhao] have come up with the next best thing—bike sonar. It’s a two-part system that takes information from an ultrasonic rangefinder and uses it to create sound-localized pings in a rider’s ears. The rangefinder is attached to a servo mounted on the seat post. It sweeps back and forth to detect objects within 4 meters, and this information is displayed radar-sweep-style graphic on a TFT screen via a PIC32.
Though the graphic display looks awesome, it’s slow feedback and a bit dangerous to have to look down all the time — the audio feedback is by far the most useful. The bike-side circuits sends angle and distance data over 2.4GHz to another PIC mounted on a helmet. This PIC uses sound localization to create a ping noise that matches the distance and location of whatever is on your tail. The ping volume is relative to the distance of the object, and you just plug headphones into the audio jack to hear them. Bunny-hop your way past the break to check it out.
Continue reading “This Bike Sonar is Off the Chain”
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.
Continue reading “Litter Basket Automation”
If you have a good sense of balance, you can ride a unicycle or get on TV doing tricks with ladders. We don’t know if [Hanna Yatco] has a good sense of balance or not, but we do know her Arduino does. Her build uses the ubiquitous HC-SR04 SONAR sensor and a servo.
This is a great use for a servo since a standard servo motor without modifications only moves through part of a circle, and that’s all that’s needed for this project. A PID algorithm measures the distance to the ball and raises or lowers a beam to try to get the ball to the center.
Continue reading “Ball Balancing Arduino-Style”
When we wave our hands at the TV, it doesn’t do anything. You can change that, though, with an ARM processor and a handful of sensors. You can see a video of the project in action below. [Samuele Jackson], [Tue Tran], and [Carden Bagwell] used a gesture sensor, a SONAR sensor, an IR LED, and an IR receiver along with an mBed-enabled ARM processor to do the job.
The receiver allows the device to load IR commands from an existing remote so that the gesture remote will work with most setups. The mBed libraries handle communication with the sensors and the universal remote function. It also provides a simple real-time operating system. That leaves just some simple logic in main.cpp, which is under 250 lines of source code.
Continue reading “ARM-Based Gesture Remote Control”
Sonar is a great sensor to add to any small-scale robot project. And for a couple bucks, the ubiquitous HC-SR04 modules make it easy to do. If you’ve ever used these simple sonar units, though, you’ve doubtless noticed that you get back one piece of information only — the range to the closest object that the speaker is pointing at. It doesn’t have to be that way. [Graham Chow] built a simple phased-array using two SR04 modules, and it looks like he’s getting decent results.
The hack starts out by pulling off the microcontroller and driving the board directly, a hack inspired by [Emil]’s work on reverse engineering the SR04s. Once [Graham] can control the sonar pings and read the results back, the fun begins.
[Graham] uses TI’s Cortex M4F LaunchPad eval kit to generate a ping and receive the reflections. With normal sonar, the time between the ping being sent and its reception is determined by the range to the target. In a phased array, in this case just the two modules, the difference in the times it takes for the ping to return to each module is used to determine the angle to the target.
If you’re DSP-savvy, [Graham] is using a phase-shifted square wave signal so that the correlations of the sent and returned signals have better peaks. This also helps the peaks in correlation across the two SR04s in the array. We think it’s pretty awesome that [Graham] is resolving a couple of degrees in angular separation when he moved his wine bottle. With a couple more SR04 units, [Graham] could start to get height information back as well.
For not much scratch, [Graham] has himself an experimental setup that lets him play with some pretty heavy signal processing. We’re impressed, and can’t wait to see what’s next. Special thanks to [Graham] for posting up the code.
And thanks [João] for the tip!
Motion control is a Holy Grail of input technology. Who doesn’t want an interface that they can control with simple and natural movements? But making this feel intuitive to the user, and making it work robustly are huge hills to climb. Leap Motion has done an excellent job creating just such a sensor, but what about bootstrapping your own? It’s a fun hack, and it will give you much greater appreciation for the currently available hardware.
Let’s get one thing straight: This device isn’t going to perform like a Leap controller. Sure the idea is the same. Wave your hands and control your PC. However, the Leap is a pretty sophisticated device and we are going to use a SONAR (or is it really SODAR?) device that costs a couple of bucks. On the plus side, it is very customizable, requires absolutely no software on the computer side, and is a good example of using SONAR and sending keyboard commands from an Arduino Leonardo to a PC. Along the way, I had to deal with the low quality of the sensor data and figure out how to extend the Arduino to send keys it doesn’t know about by default.
The plan is to take an inexpensive SONAR module (the HC-SR04) and an Arduino Leonardo and use it to perform some simple tasks by mimicking keyboard input from the user. The Leonardo is a key element because it is one of the Arduinos that can impersonate a USB keyboard (or mouse) easily. The Due, Zero, and Micro can also do the trick using the Arduino library.
I wanted to determine how many gestures I could really determine from the HC-SR04 and then do different things depending on the gesture. My first attempt was just to have the Arduino detect a few fingers or a hand over the sensor and adjust the volume based on moving your hand up or down. What I didn’t know is that the default Arduino library doesn’t send multimedia keys! More on that later.
Continue reading “Bootstrapping Motion Input with Cheap Components”