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 Hackaday.io!

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 Hackaday.io, 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 Hackaday.io!

Teach An ATTiny 85 To Swear

Let’s be honest here: one of the first things we all did when we came across speech synthesizers like the Speak-n-spell was to try swear words. [Alec Smecher] has taken this to heart, building a simple buzzer mechanism driven by an ATTiny 85 that swears repeatedly when you connect it. It is a rather simple project (or, as [Alec] himself says, it is “a satisfyingly minimalist build”), but it is quite nicely done.

The 8kHz speech sample (taken from Google Translate) is stored in the code, and written out to one of the PWM outputs of the ATTiny85 from a timing loop to directly drive the small speaker. So, all that is needed is the buzzer case, a small speaker, the ATTiny85, a power source and a few bits of wire. It’s a great example of a minimalist design: the ATTiny85 can just about drive the speaker directly, and can be run directly from batteries without requiring a power controller. Sometimes it pays to keep things simple, especially when it comes to swearing. 

Continue reading “Teach An ATTiny 85 To Swear”

Create a Buzz with the Mini Electric Ukulele

Everyone’s heard of the “World’s Smallest Violin,” but we think it’s time for something more upbeat. [Simone Giertz] of Punch Through Design has created a mini electric ukulele using a LightBlue Bean. The Bean is an Arduino-compatible microcontroller that you can wirelessly program using Bluetooth low energy (BLE).

The ukulele’s frame is made of laser-cut plywood.  Four 1M ohm resistors are soldered to individual wire strings. A different set of wire strings in the ukulele’s neck are connected to the same ground as the Bean. In order to play this tiny instrument, a finger must be kept on the “ground” strings while the other “tone” strings are touched by a different finger. [Simone] uses Arduino’s Capacitive Sensing Library to determine which string is being touched and what the tone will be (indicated in Hz). A piezo buzzer provides the sound. There is no need to fret when the battery is depleted from using this at an all-night luau: the frame can be unscrewed with easy access to the battery. [Simone] has uploaded the Bean’s code to GitHub.

There’s no shame going solo, but we’d enjoy a show of dueling mini-ukuleles. A duet with the 3D-printed ukulele is always a possibility. Or, play this little guy while running up and down some piano stairs while the kettle fife blows off some steam.  It’ll be a musical way to brighten anyone’s day. Check out the video of the mini ukelele after the break. You can also see more of [Simone’s] work at her website.

Continue reading “Create a Buzz with the Mini Electric Ukulele”

Scare off Squirrels and Tweet about It with the Jack-O’-Lantern Warning System

[Stephpalm] had carved a pumpkin for the first time in two decades. Unfortunately, the neighborhood squirrels were all too pleased with her work and devoured it. Her original goal for the jack-o’-lantern was to have its lights controlled over the internet. These hungry critters inspired another project instead – The Jack-’o’-Lantern Squirrel Early Warning System. There have been hacks that have dealt with pesky squirrels before, such as a trap and an automatic water turret, but they didn’t have the ability to post to social media like this system does.

The system consists of a Spark Core, a passive infrared (PIR) sensor, and a piezo buzzer. When the motion sensor is triggered the buzzer sounds, scaring away any peckish creatures lurking nearby. [Stephpalm] used an NPN transistor and 1k-Ohm resistor to provide enough current to drive the buzzer. All of these components were connected using jumper wires and a breadboard that sits on top of the pumpkin. As a nod to her original idea, [stephpalm] then created “Pumpkin Watch Code” and loaded it into the Core. It posts preset messages to a Twitter account every 45 minutes of inactivity or whenever a pesky squirrel is detected. The messages can be personalized for anyone who wants to make one of these themselves.

We wonder if it would be better to place the breadboard inside the jack-o’-lantern and carve out a couple of holes on top for the PIR sensor’s wires to come out of. That would offer some protection from the elements and prevent it from getting knocked over. We think this project could be adapted for many other uses. After the break, see a video of the system in action!

Continue reading “Scare off Squirrels and Tweet about It with the Jack-O’-Lantern Warning System”

Buzzed Buzzer gives you a Breathalyzer test while ringing in the new year


We’re not sure if there’s enough time to get a parts order delivered, but no geeky New Year’s party will be complete without a party buzzer that doubles as a Breathalyzer. The Buzzed Buzzer hides all of the necessary bits inside of a paper and plastic party favor. We guess it only buzzes if you’re over the limit? Actually that’s not the case at all. The accuracy of the sensor used in the project really just measures the presence of alcohol and can’t quantify BAC.

A Teensy 2.0 microcontroller board drives the project. Powered by a Lithium cell, it monitors an MQ-3 Alcohol gas sensor and drives a buzzer. The components are just small enough to be hidden by the cone of the party buzzer. You can see a demonstration of this in the short clip after the jump.

This is a fun project, but we’re still big fans of getting the crowd involved with this large LED meter which is hooked up to the same style of alcohol sensor.

Continue reading “Buzzed Buzzer gives you a Breathalyzer test while ringing in the new year”

Cat trainer will keep them off the counters

Our cats are not allowed on the kitchen counters, and [Iron Jungle] has the same rule. But he spotted some foot prints on the hood above his range and the addition of a security camera caught this picture of [Kelso] breaking the rules. Since he’s not always around to make the fur-ball behave he built an electronic cat trainer to do it for him.

The functionality needed isn’t very intricate. You need to monitor when the cat is where it shouldn’t be and then chase it away. For the latter he grabbed an infrared range finder. When the cat passes in front of the sensor it will trigger the second part of the system: a high-pitched buzzer that’s extremely loud. Any microcontroller will have no trouble driving the system. In this case it’s a PICAXE 28X1.

You can see the trainer in action after the break. It definitely works, because just playing the video chased our own sleeping kitty out of the room.

Continue reading “Cat trainer will keep them off the counters”

Simple tweak alerts you when you’ve left your headlights on


[Paul McGuinness] owns a Series III Land Rover, and as the vehicle as formerly used by the British military, it’s lacking some of the modern amenities he was accustomed to. Overlooking the lack of power steering and all-around drum brakes, the one item that [Paul] really missed was a buzzer that let him know when he left the lights running.

On more than one occasion, he’s had to have “The Sarge” jump started after leaving the lights running all day. Explaining the humiliation involved with jump-starting a Land Rover with a Nissan Micra (an unfortunate excuse for a vehicle, known here in the states as the Nissan Versa) in his blog, [Paul] decided that he’d had enough – it was time to build a headlight warning buzzer.

The circuit itself is straightforward, consisting of a normally closed relay connected to his headlights and ignition, along with a buzzer. When the key is in the ignition and the lights are on, the relay is open and the buzzer is silent. However, if the lights are on and the relay is not supplied power from the ignition, it closes and sounds the alarm.

A simple fix for a frustrating problem – we like that.