blastAMP!

I’ve been learning to play piano for a while.  In January last year I bought a great starter digital piano, the Casio Privia PX-130, complete with two headphone jacks.  The included speakers were a bit underwhelming, but I found that when connecting it to my amp from a headphone jack, it sounded better than babies cooing on Christmas morning.  I also use my computer with my amp, and switching the amp from computer input to piano input leaves the volume too low for me to hear the crispness of those faux ivory keys.  So what do you do when you can’t hear something?  You crank it up!

Over time this turned out to be a tiresome process.  To play piano I had to find the amp remote, wherever it was, press the Function button on it several times, then hold the Volume Up button for a while until it maxed out.  Then I’d play a bit and go back to the computer, where I had to again find the remote, press the Function button a few more times, then hold Volume Down until the volume level hit about 23 out of 33 to hear my computer jams without blowing an ear drum.  This is the kind of thing that over the years, drives people to start hitting the sauce.

I set out to see what I could do, and decided. It was time to get nerdy with it. :)

blastAMP
She's a beaut, I'd say.

I ended up considering a box that would automate the process by throwing the remote control signals in sequence at the push of a button.  How futuristic that would be!  Well, not really.  Essentially, blastAMP is a universal remote which learns the signals of other remotes, and it can also send multiple signals out in sequence, as if you pushed one button then another.  It learns these signals using an infrared demodulator, an electric-eye that sees patterns in infrared light.  Turning the knob on the blastAMP will set the signal you want to send as indicated by the labels on either side, which light up individually when selected.  After doing this and pushing the button below the knob, that same code will be blasted out of the box through a jack and into wires hooked up to an infrared LED. Thus, by positioning this LED on the amplifier’s own infrared demodulator, you can blast signals to your amp without the remote control.

amp with LED attached
Sony amp, LED bulb attached with tape.

blastAMP can learn up to five remote control button codes and has two special settings: comp2piano and piano2comp.  I made these to blast the required sequence I mentioned at the beginning of this post to switch between easy listening of my computer and my piano.  The codes are stored directly onto the embedded AVR ATmega88PA microcontroller so that if power is lost, the codes are not erased.  This makes it easy to switch on, push a button, and start playing.

Along with Google, one particular web site was extremely valuable in teaching me how remote controls pulse their signals to other devices.  The timings are very precise for pulsing the infrared LED with microsecond-precision, and the “on” pulses are pulse-width modulated at 40 kHz on a ~30% duty cycle, meaning that while the light would appear to be on, it is actually being switched on and off at a ~1/3 on-off ratio at a rate of 40,000 times a second!

I’ve uploaded the C code to my github repository for anyone interested in taking a look or using it.  I’ve tried to put comments in the code as much as possible for clarity.  The schematic will be up once I figure out how to draw it in software, but I can scan a hasty drawing I made earlier on paper if requested.  In any case the pin settings are in the heading of the main.c file at the repository.  I’m happy to answer any questions you may have–all you have to do is comment here or reach me using my Contact page.

This was a really fun project to explore!  I love learning new things, and this experience has left me with a lot of knowledge for other nerdy moments in the future.  I’ll leave you with some pictures of the design-and-build process.  Thanks for watching!

AVR IR Capture Circuit
Step 0: Build USB capture circuit for testing and analysis.
Sony Amp VolDown signal wave
Remote Control signal for Volume Down, voltage graphed over time. Graph is inverted.
blastAMP testbed
Completed blastAMP circuit on two prototyping breadboards.
mbed UART use, blastAMP knob
Left: Potentiometer knob, Right: mbed microcontroller used for UART pass-through (debugging).
blastAMP UART output
UART output from mbed, AVR ATmega88PA pinout diagram.
AVR Studio, my programming environment.
AVR Studio, my programming environment.
cute stereo headphone jack bug lookalike.
Front: Stereo headphone jack ripped from a CD player (funny, it looks like a bug :), Back: Bluetooth headset modified to be a power source.
blastAMP raw materials.
Raw materials. Old Swiss watch box and Plexiglas.
blastAMP empty case.
Holes cut in the casing for a 9V battery, jack and reprogramming header.
blastAMP final circuit.
Wired circuit from the front.
blastAMP soldered circuit board.
Wired circuit from the back.
blastAMP SPI connector, a reprogramming interface.
Connector for reprogramming the device on my computer (for maintenance or upgrades).
blastAMP no labels printed.
Almost ready to go! Reprogram function for infrared signal capture activated. I welcome my new robot overlord.
blastAMP on piano.
A night shot. Sometimes I play in the glow of circuit light..
plexiglas drill shaving.
Finally, a weird shape that came out when drilling a hole in the Plexiglas cover. Is this one of those sea monkeys people talk about?

Comments