El Cheapo Phased-Array Sonar

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.

PB211200The 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.

phased_array_sonar_tableau

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!

How Store Anti-Theft Alarms Work: Magnetostriction

Now that’s uncanny. Two days before [Ben Krasnow] of the Applied Science YouTube blog posted this video on anti-theft tags that use magnetostriction, we wrote a blog post about a firm that’s using inverse-magnetostriction to generate electricity. Strange synchronicity!

[Ben] takes apart those rectangular plastic security tags that end up embarrassing everyone when the sales people forget to demagnetize them before you leave the store. Inside are two metal strips. One strip gets magnetized and demagnetized, and the other is magnetostrictive — meaning it changes length ever so slightly in the presence of a magnetic field.

A sender coil hits the magnetostrictive strip with a pulsed signal at the strip’s resonant frequency, around 58kHz. The strip expands and contracts along with the sender’s magnetic field. When the sender’s pulse stops, the strip keeps vibrating for a tiny bit of time, emitting an AC magnetic field that’s picked up by the detector. You’re busted.

The final wrinkle is the magnetizable metal strip inside the tag. When it’s not magnetized at all, or magnetized too strongly, the magnetostrictive strip doesn’t respond as much to the sender’s field. When the bias magnet is magnetized just right, the other strip rings like it’s supposed to. Which is why they “demagnetize” the strips at checkout.

We haven’t even spoiled [Ben]’s explanation. He does an amazing job of investigating all of this. He even measures these small strips changing their length by ten parts per million. It’s a great bit of low-tech measurement that ends up being right on the money and deserves the top spot in your “to watch” list.

And now that magenetostriction is in our collective unconscious, what’s the next place we’ll see it pop up?

Continue reading “How Store Anti-Theft Alarms Work: Magnetostriction”

Conjuring Capacitive Touch Sensors From Paper And Aluminum Foil

Stumbling around YouTube, we found what has to be the lowest-tech method of producing a touchpad to make a capacitive touch keyboard, and we just had to share it with you. If you’re afraid of spoilers, skip down to the video below the break now.

[James Eckert] got his hands on a Freescale MPR121 capacitive touch sensor. The chip in question speaks I2C and senses up to twelve simultaneous capacitive sense electrodes; break-out boards are available in all of the usual places. It’s a sweet little part.

So [James] had to make a twelve-key capacitive keyboard on the quick. He printed out a key template on paper — something that he does often in his woodwork — and spray-glued aluminum foil on the back side. The video doesn’t say how many hours he spent with the razor blade tracing it all out, but the result is a paper, foil, and packing tape keyboard that seems to work just fine.

A pin-header was affixed to the foil with conductive paint and more tape. If you’ve ever tried soldering directly to aluminum foil, you’d know why. (And if you’ve got any other good tips for connecting electrically to aluminum foil, we’d love to hear them.)

Continue reading “Conjuring Capacitive Touch Sensors From Paper And Aluminum Foil”

KiCad 4.0 Is Released

If you’re a KiCad user, as many of us here at Hackaday are, you’ll be elated to hear that KiCad 4.0 has just been released! If you’re not yet a KiCad user, or if you’ve given it a shot in the past, now’s probably a good time to give it a try. (Or maybe wait until the inevitable 4.0.1 bugfix version comes out.)

If you’ve been using the old “stable” version of KiCad (from May 2013!), you’ve got a lot of catching-up to do.

The official part footprint libraries changed their format sometime in 2014, and are all now hosted on GitHub in separate “.pretty” folders for modularity and ease of updating. Unfortunately, this means that you’ll need to be a little careful with your projects until you’ve switched all the parts over. The blow is softened by a “component rescue helper” but you’re still going to need to be careful if you’re still using old schematics with the new version.

The most interesting change, from a basic PCB-layout perspective, is the push-and-shove router. We’re looking for a new demo video online, but this one from earlier this year will have to do for now. We’ve been using various “unstable” builds of KiCad for the last two years just because of this feature, so it’s awesome to see it out in an actual release. The push-and-shove router still has some quirks, and doesn’t have all the functionality of the original routers, though, so we often find ourselves switching back and forth. But when you need the push-and-shove feature, it’s awesome.

If you’re doing a board where timing is critical, KiCad 4.0 has a bunch of differential trace and trace-length tuning options that are something far beyond the last release. The 3D board rendering has also greatly improved.

Indeed, there are so many improvements that have been made over the last two and a half years, that everybody we know has been using the nightly development builds of KiCad instead of the old stable version. If you’ve been doing the same, version 4.0 may not have all that much new for you. But if you’re new to KiCad, now’s a great time to jump in.

We’ve covered KiCad hacks before, and have another article on KiCad add-on utilities in the pipeline as we write this. For beginners, [Chris Gammell]’s tutorial video series is still relevant, and is a must-watch.

Thanks [LC] for the newsworthy tip!

ESP8266 BASIC WiFi Thermostat Is Child’s Play

If you’ve read any of our posts in the last couple years, you’ll have noted that our community is stoked about bringing the Internet to their devices on the cheap with the ESP8266 modules. Why? This forum post that details making a WiFi thermostat really brings the point home: it’s so easy and cheap to build Internet-enabled devices that you almost can’t resist.

When the ESP8266 first came out, there very little documentation, much less code support. Since then Espressif’s SDK has improved, the NodeMCU project brought Lua support, and there’s even Arduino support. Most recently, BASIC has been added to the ESP stable, and that really lowers the barriers to creating a simple WiFi widget, like the thermostat example here that uses a Dallas DS18B20 temperature sensor and an LED as a stand-in for the heater element.

The hardware for this project, a re-build of this demo code from the ESP8266 BASIC docs, is nothing more than a few off-the-shelf parts soldered together. No schematic required.

What makes the project work behind the scenes is some clever code-reuse by [Rotohammer] on the ESP8266 forums. Essentially, he wrapped the Arduino’s one-wire library, giving it simple BASIC bindings. Then all that’s left for the BASIC coder is to read the value and print it out to a webpage.

There’s all sorts of details swept under the rug here, and those of you out there who are used to bare-metal programming will surely huff and puff. But there’s a time for building your own injection-molder to make DIY Lego bricks, and there’s a time to just put blocks together. This project, and the BASIC interpreter that made it possible, demonstrate how much joy someone can get from just putting the parts together.

Streaming Video On An Apple IIc

Some of the projects we feature solve a problem. Others just demonstrate that they can be done. We’re guessing that it’s the latter that motivated [Joshua Bell] to write a VNC client for an Apple IIc. To fully appreciate how insane this is, have a look at the video below the break.

There’s more than one thing amazing about this hack. Somehow, [Joshua]’s VNC program runs entirely in the memory of an Apple IIc, as he demonstrates at the beginning of the video by downloading all of the code into the Apple over a serial cable. After the initial bootstrap, he runs the code and you see (in full four-color splendour!) a low-res Windows XP appear on the IIc.

2440964467_decb0daf10_oWhat’s more incredible, but is unfortunately not demonstrated in the video, is that he appears to have not just mirrored the PC’s screen on the Apple, but has actually managed to get a one-frame-per-second bi-directional VNC working at 115,200 baud. In this snapshot from his flickr gallery, he appears to be playing Karateka on the IIc and watching it on his laptop.

If you’ve got a IIc kicking around, and you want to show it yet more new tricks, don’t neglect this browser written for the Apple IIc. Or if you’ve only got an Apple IIc+ and you’re totally ticked off that the beep is different from that of the IIc, you can always go on an epic reverse-engineering quest to “repair” it.

Continue reading “Streaming Video On An Apple IIc”

Physics You’ve Never Heard Of Provides Power From Waves

“In the future, we’ll be generating a significant fraction of our electricity from harnessing the waves!” People have been saying this for decades, and wave-generated electricity is not a significant fraction of an ant’s poop. It’d be fantastic if this could change.

If you believe the owners of Oscilla Power, the main failing of traditional wave-power generators is that they’ve got too many moving parts. Literally. Metal mechanical parts and their seals and so on are beaten down by sun and salt and surf over time, so it’s expensive to maintain most of the generator designs, and they’re just not worth it.

Oscilla’s generator, on the other hand, has basically no moving parts because it’s based on magnetostriction, or rather on inverse magnetostriction, the Villari effect. Which brings us to the physics.

Magnetostriction_by_ZureksMagnetostriction is the property that magnetic materials can shrink or expand just a little bit when put in a magnetic field. The Villari effect (which sounds much cooler than “inverse magnetostriction”) is the opposite: magnetic materials get more or less magnetic when they’re squeezed.

mpv-shot0001So to make a generator, you put two permanent magnets on either end, and wind coils around magnetostrictive metal bars that are inside the field of the permanent magnets. Squeeze and stretch the bars repeatedly and the net magnetic field inside the coils changes, and you’re generating electricity. Who knew?

Right now, according to The Economist Magazine’s writeup on Oscilla, the price per watt isn’t quite competitive with other renewable energy sources, but it’s looking close. With some more research, maybe we’ll be getting some of our renewable energy from squeezing ferrous bars.

And while we’re on the topic, check out this recent article on magnets, and how they work.