Archive for the ‘Arduino’ Category

Create polarized pictures with your iPhone and Arduino

Tuesday, July 12th, 2016


Taking great pictures means making them more vibrant enhancing saturation and contrast. Ynformatic has published some tips to help you do that by creating a DIY device to control a polarizer using an Arduino Pro Mini, an iPhone, and a screen from an auto-darkening welder’s mask.

A phototransistor located facing the iPhone’s flashlight LED is connected to both an external interrupt pin and an analog pin. Short pulses on the LED cause interrupts in the Arduino code which are used to synchronize the polarizer. Long pulses on the LED cause the Arduino to enter calibration mode. The time interval between syncrhonization pulses is continuously measured and divided into three equal parts. On receiving a synchronization pulse the voltage is set to 0V for one part, to the 45 degree voltage for one part and finally to 5V for one part. Voltage for the polarizer is supplied from an Arduino PWM output pin. To get a reasonably stable output the PWM frequency was increased to 32 kHz and smoothed with a second order RC filter. The liquid crystal display will be damaged by a constant DC voltage so a CMOS switch is used to alternate the polarity. A 2 kHz square wave generated from a free running Arduino timer is used to drive the switching.

An iPhone app written in Swift is responsible for the user interface and image processing. (more…)

Play some Super Arduino Bros. tunes with percussion

Monday, July 11th, 2016

Have you ever wished your Arduino project could play tunes, or even just note-based sound effects? Connor Nishijima has, and that’s why over the last three years he has been hard at work developing Miduino—a free web service that enables Makers to automatically convert their MIDI music into ready-made sketches.

Unlike any built-in Arduino noisemaking functions such as tone(), Miduino’s output is polyphonic–meaning you can play up to six notes at once. Most recently, he has added two major updates to the service: percussion tracking and switch to software-based timing.

Now the only thing setting your Arduino apart from an NES is a proper triangle wave! While it’s not fully featured yet for the whole MIDI percussion spectrum, your basic snares, kicks and hi-hats will be joining the music!

Originally I collaborated with Len Shustek to tie his Playtune library into the service, but his library requires a hardware timer for each active note–which has its ups and downs.

With a hardware timer you’ll get extremely crisp sound every time, but an Arduino Uno can only play up to three notes at once and the original code didn’t know what to do with MIDI percussion channels.

Instead, Nishijima is polling for new notes and their expirations at about 22,050Hz using Timer 1 and generating different types of percussion with some RNG tricks. Admittedly it hasn’t been perfected yet, as some songs need the polling frequency turned down to avoid crashes. (Cut the Arduino some slack, it’s not supposed to be good at this!)

To demonstrate his latest upgrades, Nishijima performs the Super Mario Bros. theme song with LEDs blinking to the iconic tunes. Although some would argue that this could be faked rather easily, the Maker has gone ahead and shared the code along with a couple other examples for any doubters–these include Van Halen’s “Eruption” and Mozart’s “Rondo Alla Turca.”


Check the time on a beautiful wooden word clock

Monday, July 11th, 2016

When it comes to telling time, Makers like to go beyond simply reading moving hands or looking at a digital display. In Imgur user Grahamvinyl’s case, that’s a slick word clock comprised of a walnut veneer, clear epoxy, LEDs, letters, and Arduino.

Grahamvinyl cut the clock from the back of an acoustic guitar and sides, and then strung together individually addressable RGB strips. A matrix of letters in Art Deco font spell out the time horizontally. Pieces of spraypainted 1/4-inch MDF act as dividers (so the color doesn’t bleed from one letter to the next), and a sheet of wax paper diffuses the light.

I haven’t seen another word clock designed the same way: clear epoxy holds the interior of the letters in place, so I didn’t need to use a stencil font.

The display changes every five minutes, and counts two minutes before and after the actual time (e.g. 10:13 and 10:17). Meanwhile, numbers that take longer to spell out such as “fifteen” are shown as “quarter past.”

The Arduino Uno-controlled clock also has a button on its side that allows it to show the numerical time—from far away, you’ll notice the illuminated letters actually create the shapes of numbers. The hours show up dimmer, the minutes brighter. Another push reveals the numerical date in the same fashion. You can even program it to flash a special message on your birthday.

Grahamvinyl notes that there are three buttons in total, each wired to an input on the Arduino. Right now, however, only the top one is functional. The idea is to eventually have the bottom two cycle through colors or set the time. Beyond that, the Maker hooked up a USB connection to the clock so that it would be easily programmable.

Interested in building your own word clock? Check out more images on Imgur, and find the code on GitHub.

Massive mechanical music box plays ever-changing melodies

Friday, July 8th, 2016

When you think of a music box, chances are that tiny trinket sitting atop your dresser or nightstand comes to mind. Well, that’s not the case with Niklas Roy. The artist has developed what he calls the Music Construction Machine–a super-sized music box that uses a giant hand crank to move various mechanisms inside, producing melodies and rhythmic patterns with an electric guitar, a keyboard, and a drum set.

The installation is housed inside a large transparent glass case, which enables visitors at the Goethe-Institut Pop Up Pavillion in Wroclaw, Poland to observe its inner mechanical workings as it performs. Although the hardware–consisting of ropes, pulleys, springs, levers, and weights—uses an algorithm to determine what’s being played, visitors still have a strong influence on the interpretation and expression of the sounds as they can decide how fast they crank and where they interrupt the flow of music.

Unlike more conventional music boxes that repeat the same melody over and over, this machine has been designed to constantly create ever-changing beats and tones. In an interview with Deutsche Welle, Roy says that he was going for a sound that was somewhere between a “drunk punk band and an avant-garde trio.”

Although the mechanisms follow a simple inherent logic, which determines the sequence of tones that will be played, the overall behavior of the system is so complex that the sequence appears to be unpredictable for a listener. The result is a melody which is sometimes harmonic, sometimes not, but it definitely has a lot of variation.

In order to refrain from annoying the neighbors during the night, Roy is also using an Arduino Uno with a RTC to control the volume on the mixer via a servo.

Pretty cool, right? For those not in Wroclaw, you can see it in action below and read more about how it works here.

Listen to a computer hardware orchestra rock out to Nirvana

Friday, July 8th, 2016

What do you get when you combine 64 floppy drives, eight hard disks, and two scanners? An incredible computer hardware orchestra that can rock out like Kurt Cobain. Created by Pawel Zadrozniak, the Floppotron is not only capable of covering ‘90s hits like Nirvana’s “Smells Like Teen Spirt,” but can play other tunes ranging from Darth Vader’s Imperial March to the theme song of the TV series “Hawaii Five-O.”

As for how the old-school tech synthesizes such tunes, Zadrozniak explains:

Every device with an electric motor is able to generate a sound. Scanners and floppy drives use stepper motors to move the head with sensors which scans the image or performs read/write operations on a magnetic disk. The sound generated by a motor depends on driving speed. The higher the frequency, the greater the pitch. Hard disks use a magnet and a coil to tilt the head. When voltage is supplied for long enough, the head speeds up and hits the bound making the “drum hit” sound. The disk head coil can also be used as a speaker to play tones or even music, but… that would be too easy and too obvious.

Every column of eight floppy drives is connected to one 8-channel controller built on ATmega16 microcontroller. One controller acts as one voice with envelope simulation – the higher the volume, the more drives are playing. This allows to make ADSR-like shape and simulate a musical instrument, like a piano (exponential decay) or string instrument (sine, “vibrato”). The boards which were made a few years ago, were designed as a standalone “players” with optional USB-to-UART bridge and was not intended to be chained. My goal was to re-use old stuff and get the job done as fast as possible, so I used the on-board ISP (which in fact is a SPI interface) connector to link 8 drivers in a SPI chain. Long SPI chain with unidirectional communication is not an example good and reliable design, but it did not require any hardware modification and took a minute to build a controller network, so let’s call it… good enough for this kind of project.

Scanner and disk head controllers share the same base with floppy controllers, but have a different “instrument interface.” For driving the coils, I used two push-pull outputs (H-bridge) built with discrete SMD MOSFETs. Scanner head controllers were built using of-the-shelf boards – an Arduino Uno (firmware also builds for ATmega328) and L298 breakout to save time needed to draw and etch the boards. PC interface (another Arduino board) receives the data over UART (USB-UART), buffers the messages and keeps the timings while passing packets to “musical instruments” over SPI interface, so a Windows hiccup will not affect the playback. It can also be driven by anything else like Raspberry Pi, Android smartphone (with USB-UART or UART-over-Bluetooth adapter) or another microcontroller.

You can read all about the Floppotron here, or check out its latest jam session below!

This handheld gadget will scan and identify fonts

Thursday, July 7th, 2016

Fiona O’Leary, a design student at the Royal College of Art, has developed a handheld device that enables her to capture any font and color she sees in the real world, and magically imports them into Adobe’s InDesign. The gadget, called Spector, was born out of her own frustrations with designing for print on-screen and never actually knowing how the fonts and colors would appear in their physical form.

The tool, which was prototyped using an Arduino Pro Mini, works essentially like a “physical eyedropper” or a “Shazam for fonts.” Simply place Spector on a certain typeface and watch it change to that exact typeface right on your computer screen, all with the press of a button.

A built-in camera captures the media you’re looking at–whether that’s a billboard, a subway map, or text in a book–and an algorithm converts the image into data that detects the shape and color in CMYK/RGB values. That data is then sent to a font and color database, where the sample is further identified.

Additionally, Spector can store up to 20 fonts and colors so you can collect your favorite typography on the go and upload it later. The device is currently capable of recognizing seven different typefaces and IDs type size, kerning, and leading, although O’Leary says she is working to integrate it with a much larger database.

Creating an automatic targeting frisbee launcher with Arduino

Thursday, July 7th, 2016

A few years ago, Jordan Réjaud and a team of his fellow Carnegie Mellon classmates built a robotic frisbee launcher. Based on an Arduino, the machine used a camera to detect colored targets, and a powerful DC motor to induce linear and rotational motion of the discs before propelling them at the selected bullseye several feet away.

A servo motor was tasked with pushing the frisbees out of a hopper made from a tin coffee can and towards the DC motor, while a planetary gear and linear actuator positioned the launcher horizontally and vertically, respectively. (more…)

Building a water collection vessel with an Arduino Mega

Thursday, July 7th, 2016


As part of an electrical and electronic engineering course at Singapore Polytechnic, a group of students were challenged to build an aquatic vehicle that could collect samples from one and two meters underwater. After three months of hard work, the Imp Bot was brought to life!

Imp Bot is controlled by a mobile application made using the MIT App Inventor. Communication is achieved via a Bluetooth module hooked up to an Arduino Mega, while an onboard GPS sensor is used to log sampling locations in the app. Power is provided by a LiPo battery, which supplies high current to the two DC motors responsible for moving the 11-pound vessel around. (more…)

Get your DDR on with an Arduino dance pad

Wednesday, July 6th, 2016

Alex of the YouTube channel “Super Make Something” is a huge fan of Dance Dance Revolution (DDR), and still has to play the game whenever he steps foot into an arcade. However, with the number of arcades slowly declining, the Maker has decided to bring that experience into his living room with a USB DDR dance pad.

And yes, you could always buy a metal dance pad but rather than spend $300, why not build your own? That is exactly what Alex has done using some easy-to-find materials: a 35″ x 35” slab of plywood for the base, four 1” x 35” pieces of wood for the border, five 11” x 11” pieces of MDF for the stationary panels, four 9″ x 9” pieces of cardboard for the riser panels, 12 metal button contacts out of aluminum, four 11” x 11” MDF button pads, acrylic sheets for the dance surface, and plenty of paint and graphics for the finishing touch. (more…)

Hacking a rotary phone with an Arduino and a GSM shield

Thursday, June 30th, 2016

While cleaning out his closet, Instructables user “Acmecorporation” discovered an old rotary telephone. Instead of tossing it away, the Maker decided to give the old-school device some modern-day technology using an Arduino Pro Mini and a SIM900 GSM shield.

Acmecorporation is able to use the aptly named TOWA Phone (There Once Was A Telephone) to make and receive calls, send single DMTF tones, and even program numbers on speed dial. Aside from its classic bell ringer, there’s an RGB LED that indicates GSM status: red for offline, green for online, and blue for an incoming call.

The Maker briefly explains how it works:

To make a phone call you have to pick up the handset and dial the number, that’s all. Terminate call hanging up the handset.

When phone is ringing, pick up the handset to answer. Terminate it hanging up.

If you call to a support center or an office, usually you have to dial numbers to connect a specific department. You can do this because TOWA sends single DMTF tones.

Inside the Arduino script, you can add your favorite telephone numbers and combine it with a specific integer number. For example, I’ve stored my favorites combined with numbers from 1 to 8. So when I pick up the handset and dial 1, it starts a call to my wife. When I dial 2 or 3, it calls one of my sons, and so on.

Although Acmecorporation didn’t design TOWA for everyday use, it has become a permanent fixture on his desk. Do you have a rotary phone lying around? Time to brush off the dust and rig your own!