Two Pins for the Price of One

One of the most common problems in the world of microcontrollers is running out of resources. Sometimes it’s memory, where the code must be pared down to fit into the flash on the microcontroller. Other times, as [Fabien] found out when he ran out of pins, the limitations are entirely physical. Not one to give up, he managed to solve the problem by using one pin for two tasks. (Google Translate from French)
During a recent project, [Fabien] realized he had forgotten to add a piezo buzzer to his project. All of the other pins were in use, though, so his goal was to use one of the input pins to handle button presses but to occasionally switch to output mode when the piezo buzzer was needed. After all, the button is only used at certain times, and the microcontroller pin sits unused otherwise. After a few trials, he has a working solution that manages to neither burn out itself nor the components in the circuit, and none of the components interfere with the other’s normal operation.
While it isn’t the most technically advanced thing we’ve ever seen here, it is a great example of using the tools at your disposal to elegantly solve a problem. More than that, though, it’s a thorough look into the details of pull-up and pull-down resistors, how microcontrollers see voltage as logic levels, and how other pieces of hardware interact with microcontrollers of all different types. This is definitely worth a read, especially if you are a beginner in this world.

Sonic 3D Printer Auto Bed Leveling Makes a Swoosh

3D Printering: the final frontier. These are the voyages of another 3D printer hack. Its mission: to explore strange new ways of leveling a print bed.

So far, we’ve had servo probes, Allen key probes, Z-sled probes, inductive and capacitive contactless switches, just to name a few. All of them allow a 3D printer to probe its print bed, calculate a correction plane or mesh, and compensate for its own inherent, time variant, inaccuracies.

Continue reading “Sonic 3D Printer Auto Bed Leveling Makes a Swoosh”

Custom Media Player Helps Hacker’s Autistic Son

Getting to play with technology is often the only justification a hacker needs to work on a build. But when your build helps someone, especially your own special-needs kid, hacking becomes a lot more that playing. That’s what’s behind this media player customized for the builder’s autistic son.

People generally know that the symptoms of autism cover a broad range of behaviors and characteristics that center around socialization and communication. But a big component of autism spectrum disorders is that kids often show very restricted interests. While [Alain Mauer] doesn’t go into his son [Scott]’s symptoms, our guess is that this media player is a way to engage his interests. The build came about when [Alain] was unable to find a commercially available media player that was simple enough for his son to operate and sturdy enough to put up with some abuse. A Raspberry Pi came to the rescue, along with the help of some custom piezo control buttons, a colorful case, and Shin Chan. The interface allows [Scott] to scroll through a menu of cartoons and get a preview before the big show. [Scott] is all smiles in the video below, and we’ll bet [Alain] is too.

Pi-based media player builds are a dime a dozen on Hackaday, but one that helps kids with autism is pretty special. The fact that we’ve only featured a few projects aimed at autistics, like this 2015 Hackaday Prize entry, is surprising. Maybe you can come up with something like [Alain]’s build for the 2016 Hackaday Prize.

Continue reading “Custom Media Player Helps Hacker’s Autistic Son”

What’s a Piezo Optomechanical Circuit?

Ever hear of a piezo-optomechanical circuit? We hadn’t either. Let’s break it down. Piezo implies some transducer that converts motion to and from energy. Opto implies light. Mechanical implies…well, mechanics. The device, from National Institute of Standards and Technology (NIST),  converts signals among optical, acoustic and radio waves. They claim a system based on this design could move and store information in future computers.

At the heart of this circuit is an optomechanical cavity, in the form of a suspended nanoscale beam. Within the beam are a series of holes that act as mirrors for very specific photons. The photons bounce back and forth thousands of times before escaping the cavity. Simultaneously, the nanoscale beam confines phonons, that is, mechanical vibrations. The photons and phonons exchange energy. Vibrations of the beam influence the buildup of photons and the photons influence the mechanical vibrations. The strength of this mutual interaction, or coupling, is one of the largest reported for an optomechanical system.

In addition to the cavities, the device includes acoustic waveguides. By channeling phonons into the optomechanical device, the device can manipulate the motion of the nanoscale beam directly and, thus, change the properties of the light trapped in the device.  An “interdigitated transducer” (IDT), which is a type of piezoelectric transducer like the ones used in surface wave devices, allows linking radio frequency electromagnetic waves, light, and acoustic waves.

The work appeared in Nature Photonics and was also the subject of a presentation at the March 2016 meeting of the American Physical Society. We’ve covered piezo transducers before, and while we’ve seen some unusual uses, we’ve never covered anything this exotic.

Hacklet 103 – Piezo Projects

The piezoelectric effect is simple in its rules: Apply mechanical stress to a material and you generate an electric charge. The inverse is also true: Apply a voltage to a material, and it changes shape. This doesn’t work for everything, though. Only certain materials like crystals, some ceramics, and bone have piezoelectric properties. The piezoelectric effect is used quite a bit in electronics, so it’s no surprise that plenty of hacker projects explore this physical phenomena. This week’s Hacklet is all about some of the best projects utilizing the piezoelectric effect on!

strumWe start with [miro2424] and StrumPad. Strumpad lets you play a MIDI instrument by strumming, just like a guitar. A music keyboard acts as the guitar fretboard here – keys can be pressed to choose notes, but no sound is generated. When the strumpad is strummed, six copper strips act as capacitive sensors. Touching the strips determines which notes will be played. A piezo disc hiding below the circuit board detects how hard the notes have been strummed or tapped. The ATmega328 running the strumpad then passes the velocity and note-on MIDI messages on to a synth.

stmNext up is [Dan Berard] with Scanning Tunneling Microscope. Inspired by a project from [John Alexander], [Dan] created his own Scanning Tunneling Microscope (STM). The key to an instrument like this is precise movement. [Dan] achieves that by using a normal piezo disk. These disks are used as speakers and buzzers in everything from smoke detectors to greeting cards, so they’re common and cheap. [Dan] cut his piezo disk electrode into quadrants. Carefully controlling the voltage applied to the quadrants allows [Dan] to move his STM tip in X, Y, and Z. Incredibly, this microscope is able to create images at the atomic scale.

touchboard[Thatcher Chamberlin] is next with Low-Cost Touchscreen Anywhere. [Thatcher] used a trio of Piezo disks to make any flat surface touch sensitive. The three sensors are placed at 3 corners of a rectangle. Touches with the rectangle will create vibrations in the surface that are transmitted to the piezo sensors. By measuring the vibration time of arrival, it should be possible to determine where the surface was touched. This kind of measurement requires a decent processor, so [Thatcher] is using the ARM Cortex-M0 in NXP’s LPC1114FN28. Initial tests were promising, but we haven’t heard much from [Thatcher] on this project. If you see him online, tell him to hurry up! We’re hoping to turn our parking lot into a giant electronic chess board!

contFinally, we have [Jose Ignacio Romero] with Low Power Continuity Tester. [Jose] used a Piezo element in a slightly more mundane way – as a buzzer. Who needs a whole multimeter when you’re just trying to check continuity on a few circuits? This continuity tester uses a PIC12LF1571 processor to find open and short circuits. The 5 10 bit ADC in the PIC is plenty of resolution for this sort of tester. In fact, [Jose] even included a diode test, which emits a short beep if the leads are placed across a working diode. The PIC processor uses so little power that this tester should run for around 800 hours on a CR2032 watch battery.


If you want to see more piezo projects check out our brand new piezo projects list! If I missed your project, don’t get buzzed! Drop me a message on, and I’ll add it to the list. That’s it for this week’s Hacklet. As always, see you next week. Same hack time, same hack channel, bringing you the best of!

Analog Clocks Play Their Own Beat

Play the demo video below and try not to let the rhythm worm its way into your brain. What you’re hearing is the sound of a bunch of clocks, amplified. None of them are keeping wall time, but all of them are playing together.

[Gijs] makes crazy musical instruments. He doesn’t give us much more than a video and a couple schematics for this project, so this one’s still a bit of an enigma, but here’s what we’ve put together.

Klok slave unit schematic
Klok slave unit schematic

The video looks like eight identical version of the same module. The input takes a voltage and converts the rising and falling edges into pulses to drive the coil of an el-cheapo clock. The LEDs pulse as the poles of the clock switch to the incoming beats. The output comes from an amplified piezo sensor stuck on the back of each clock. That is, what you’re hearing is each clock ticking, but amplified. And if you watch the dials spin, it doesn’t look like any of them are telling time.

So far so good, and it matches up with the schematic. But what’s up with that switch on the front? It doesn’t show up anywhere.

And what’s driving the show? [Gijs] tantalizes us with a master clock module (on the same page) that looks like it does keep time, and outputs subdivisions thereof. But that would be too slow to be what’s used in the video. Has he swapped the crystal to make it run faster? It’s a mystery.

Of course, we’d expect no less from the man who mics up a kitchen timer or a gear motor and adds them to his synthesizer rack. We’ve covered a bunch more of [Gijs]’s work in the past, from his video mixers to this hard-drive turned synth oscillator, but this time he’s got us scratching our heads a bit, as well as tapping our feet.

Continue reading “Analog Clocks Play Their Own Beat”

RaspiDrums Uses Expensive Sensors

Piezoelectric sensors are great for monitoring mechanical impacts with a microcontroller. Whether you’re monitoring knocks on a door or watching a heartbeat, they are a cheap way to get the job done. They do have their downsides, though, so when [Jeremy] wanted to build an electronic drum set, he decided to use more expensive accelerometers to measure the percussive impacts instead.

Even though piezo sensors are cheap, they require a lot of work to get them working properly. The ADXL377 3-axis accelerometer that [Jeremy] found requires much less work, plus provides more reliable data due to a 1kHz low-pass filter at the output. In his setup, a Raspberry Pi handles all of the heavy lifting. An ADC on each drum sends data about each impact of the drum, and the Raspberry Pi outputs sound via the native Alsa driver and a USB sound card.

This project goes a long way to show how much simpler a project like this is once you find the right hardware for the job. [Jeremy]’s new electronic drums are very well documented as well if you are curious about using accelerometers on your newest project rather than piezo sensors. And, if you’re into drums be sure to see how you can have drums anywhere, or how you can build your own logic drums.

Continue reading “RaspiDrums Uses Expensive Sensors”