One of the first frustrating situations a beginning microcontroller programmer will come across is the issue of debouncing switches. Microcontrollers are faster than switches, and the switch has yet to be built that can change state in zero time like they can on paper. This hurdle is easily overcome, but soon we are all faced with another issue: filtering noise from an analog signal. Luckily [Paul Martinsen] has put together a primer of three different ways to use an Arduino to filter signals.
The first (and fastest, simplest, etc.) way to filter an analog signal is to sample a bunch of times and then average all of the samples together. This will eliminate most outliers and chatter without losing much of the information. From there, the tutorial moves on to programming a running average to help increase the sample time (but consume much more memory). Finally, [Paul] takes a look at exponential filters, which are recursive, use less memory, and can be tweaked to respond to changes in different ways.
[Paul] discusses all of the perks and downsides of each method and provides examples for each as well. It’s worth checking out, whether you’re a seasoned veteran who might glean some nuance or you’re a beginner who hasn’t even encountered this problem yet. And if you’re still working on debouncing a digital input, we have you covered there, too.
Sequencers allow you to compose a melody just by drawing the notes onto a 2D grid, virtually turning anyone with a moderate feel for pitch and rhythm into an electronic music producer. For [Yuvi Gerstein’s] large-scale grid MIDI sequencer GRIDI makes music making even more accessible.
Instead of buttons, GRIDI uses balls to set the notes. Once they’re placed in one of the dents in the large board, they will play a note the next time the cursor bar passes by. 256 RGB LEDs in the 16 x 16 ball grid array illuminate the balls in a certain color depending on the instrument assigned to them: Drum sounds are blue, bass is orange and melodies are purple.
Underneath the 2.80 x 1.65 meters (9.2 x 4.5 foot) CNC machined, sanded and color coated surface of the GRIDI, an Arduino Uno controls all the WS2812 LEDs and reads back the switches that are used to detect the balls. A host computer running Max/MSP synthesizes the ensemble. The result is the impressive, interactive, musical art installation you’re about to see in the following video. What better tune to try out first than that of Billie Jean whose lighted sidewalk made such an impression on the original music video.
Continue reading “Orbs Light to Billie Jean on this Huge Sequencer”
The language C++ is big. There is no doubting that. One reason C++ is big is to allow flexibility in the technique used to solve a problem. If you have a really small system you can stick to procedural code encapsulated by classes. A project with a number of similar but slightly different entities might be best addressed through inheritance and polymorphism.
A third technique is using generics, which are implemented in C++ using templates. Templates have some similarities with #define macros but they are a great deal safer. The compiler does not see the code inserted by a macro until after it has been inserted into the source. If the code is bad the error messages can be very confusing since all the developer sees is the macro name. A template is checked for basic syntax errors by the compiler when it is first seen, and again later when the code is instantiated. That first step eliminates a lot of confusion since error messages appear at the location of the problem.
Continue reading “Code Craft – Embedding C++: Templates”
When [Doug] moved into his new house, he found an old alarm panel set up — but it had no monitoring service any more. Not wanting to pay a monthly fee to have it setup, he decided to try interfacing an Arduino with the system in order to push events to the net!
The cool thing is he was actually inspired by another similar project we shared on Hackaday a few years ago entitled Bending a Home Security Control Panel to Your Will. But that project only showed you how to interface the Arduino with the keypad — [Doug] went the extra mile and interfaced directly with the control board for more features.
He’s using an Arduino Uno and an Ethernet breakout board to hook it up to the network. This allows him to send text messages to himself when the alarm system is armed, disarmed, or triggered. All the code is available on GitHub in case you also have a DSC 1550 alarm system.
It’s a pretty slick hack, so don’t forget to check out the video after the break.
Continue reading “Upgrading Your Alarm System With an Arduino”
Here’s another example of how today’s rapid-prototyping technologies are allowing Artists and Craftsmen to create interactive works of art rapidly and easily. [Kati Hyypa] and [Niklas Roy] teamed up to transform a classic painting in to an interactive exhibit. It’s a painting of Adam, Eve and the apple with a joystick attached. Spectators can control the destiny of the apple with the joystick and thus explore the painting.
The “Forbidden Fruit Machine” is based on a painting called “The Fall of Man” created by [Cornelis Cornelisz van Haarlem] in 1592. The painting depicts Eve and Adam in the Garden of Eden, being tempted by the serpent to eat the forbidden fruit. A public domain, high-resolution scan of the painting is available for download from the Rijksmuseum Amsterdam. Starting with that, the arms were edited out, and replaced with articulated versions (mounted on acrylic) driven by servos. The apple was mounted on a X-Y gantry driven by two stepper motors. These are driven by a motor shield, which is controlled by an Arduino Uno. The Uno also controls a Music Maker shield to play the various audio tracks and sound effects. Finally, an additional Arduino Pro-Mini is used to control the LED lighting effects via a Darlington driver and also connect to the end stops for the X-Y gantry. The joystick is connected to the analog ports of the Uno.
The LED’s give clues on where to move the apple using the joystick, and pressing the red button plays an appropriate audio or sound effect. For example, pressing the button over the cat at Eve and Adam’s feet elicits a heart-breaking meow, while letting Eve eat the apple results in an even more dramatic effect including a thunder storm.
The machine is open source with code posted on Github and 3d files on Youmagine. Watch a video after the break. The artist’s names may be familiar to some some readers – that’s because both have had their earlier work featured on our blog, for example this awesome ball sucking machine and another one too.
Continue reading “Forbidden Fruit Machine”
[James] sent us a video of his latest creation: a robotic glockenspiel that’s currently set up to play “Popcorn”. It uses eight servos to drive mallets that strike the tone bars with fast, crisp movements. The servos are driven with a 16-channel I²C servo driver and MIDI shield, which are in turn controlled with an Arduino Uno. The previous incarnation of his autoglockenspiel employed solenoids, dowels, and elastic bands.
[Gershon Kingsley]’s 1969 composition for synthesizer “Popcorn” has been covered by many artists over the years, though perhaps the most popular cut was [Hot Butter]’s 1972 release. Check it out after the break, and dig that lovely cable management. We’d love to see [James]’s autoglockenspiel play “Flight of the Bumblebee” next.
If you’re hungry for more electro-acoustic creations, have a gander at [Aaron Sherwood]’s Magnetophone.
Continue reading “Robotic Glockenspiel Crunches “Popcorn””
We have a pretty good guess where [Krizbleen] hides away any seasonal presents for his family: behind his shiny new secret library door. An experienced woodworker, [Krizbleen] was in the process of finishing the attic in his home when he decided to take advantage of the chimney’s otherwise annoying placement in front of his soon-to-be office. He built a false wall in front of the central chimney obstacle and placed a TV in the middle of the wall (directly in front of the chimney) flanked on either side by a bookcase.
If you touch the secret book or knock out the secret sequence, however, the right-side bookcase slides gently out of the way to reveal [Krizbleen’s] home office. Behind the scenes, a heavy duty linear actuator pushes or pulls the door as necessary, onto which [Krizbleen] expertly mounted the bookcase with some 2″ caster wheels. The actuator expects +24V or -24V to send it moving in one of its two directions, so the Arduino Uno needed a couple of relays to handle the voltage difference.
The effort spent here was immense, but the result is seamless. After borrowing a knock-detection script and hooking up a secondary access button concealed in a book, [Krizbleen] had the secret door he’d always wanted: albeit maybe a bit slow to open and close. You can see a video of its operation below.
Continue reading “Secret Attic Library Door”