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”
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!
“It’s only software!” A sentence that strikes terror in the heart of an embedded systems software developer. That sentence is often uttered when the software person finds a bug in the hardware and others assume it’s going to be easier for fix in software rather than spin a new hardware revision. No wonder software is always late.
[Clint Stevenson] is his own hardware and software guy, as are most of us. He wanted to use the less expensive HC-SR04 ultrasonic rangefinder in a prototype. Longer term he wanted to have the choice of either a Parallax PING or MaxBotix ultrasonic sensor for their better performance outdoors. His hardware hack of the SR04 made this a software problem which he also managed to solve!
[Clint] was working with the Arduino library, based on the Parallax PING, which uses a single pin for trigger and echo. The HC-SR04 uses separate pins. Originally he modified the Arduino library to accept the two pin approach. But with his long term goal in mind, he also modified the HC-SR04 sensor by removing the on-board pull-up resistor and adding a new one on the connector side to combine the signals. That gave him an SR04 that worked with the single-pin based library.
We’ve seen Parallax PING projects for sensing water depth and to generate music. These could be hacked to use the HC-SR04 using [Clint’s] techniques.
[Arduino and HC-SR04 photo from Blax Lab]
For the last decade or so, [Jason] has wanted to build an underwater robot. Can you blame him? More recently, he’s been researching sonar sensing and experimenting with the relatively inexpensive HC-SR04 module. Since he had good luck getting it to work with a PC sound card and a Stellaris Launchpad, he figured it was time to try using it underwater.
Hydrophone research led him to the idea of submerging the sensor in mineral
water oil to both seal it and couple it with the water. Unfortunately, the HC-SR04 only sends one pulse and waits for echo. Through the air, it reliably and repeatedly returned a small value. Once inside a pill bottle filled with mineral oil, though, it does something pretty strange: it fluctuates between sending back a very small value and an enormous value. This behavior has him stumped, so he’s going to go back to the Launchpad unless you can help him figure out what’s going on. Should he use a different method to seal it?
Fail of the Week is a Hackaday column which runs every Thursday. Help keep the fun rolling by writing about your past failures and sending us a link to the story — or sending in links to fail write ups you find in your Internet travels.
If you are on the computer for a large part of the day, posture becomes a serious issue that can negatively impact your health. [Wingman] saw this problem, and created a hack to help solve it. His simple posture sensor will monitor the position of your head relative to the chair, and reminds you to sit up straight.
The posture sensor is built around the HC-SR04 ultrasonic distance sensor, an Attiny85, and a piezo speaker. We’ve seen this distance sensor used in the past for a few projects. Rather than going down the wearable route, which has its own drawbacks, [Wingman] decided to attach his sensor on the back of his chair. The best part is that the sensor is not mounted directly on the chair, but rather on a piece of fabric allowing it to be easily moved when needed.
Given how low-cost and small the sensor is, the project can be easily expanded by adding multiple sensors in different locations. This would allow the angle of the back and possibly the neck to be determined, giving a more accurate indicator of poor posture. There are very few hacks out there that address bad posture. Do you have a project that helps address bad posture? Have you used video processing or a wearable device to monitor your posture? Let us know in the comments an don’t forget to send post links about them to our tips line.