Introduction: Arduino-powered A-10 Stick Grip Remote W/Emergency Party Button!
I came across Plama2002's "Emergency Party Button" build a while back and wanted something similar for my bar. I also had an old USAF B-8 stick grip from an A-10A that I picked up in my previous life. I figured instead of just being a conversation piece, I could put it to good use as a remote control for my AV system. What I came up with is a master control box that:
- Controls my SAT TV, music server and iPod dock via my Audio Visual Receiver (AVR)
- Controls the overhead lighting in the bar and the components of the Emergency Party System.
- Looks really cool sitting on the bar!
It uses two Arduinos: one for switching and IR transmission, and one to wirelessly control the X10 devices.
This build is not really that difficult as both the Arduino and X10 applications in this project are really pretty simple. You just need to figure out exactly what you want yours to do and adapt it. Since I'm writing this ex post facto I'll try to make up for the lack of step-by-step photos with thorough explanations. Sorry I don't have the circuitry sketched out but there's not much to it - we're mostly just hooking up buttons with pulldown resistors, just like in the Arduino tutorials. There are a few slightly more complicated things going on but I'll be sure to explain them as we proceed!
Step 1: Gathering Stuff
This build is really a few builds within a build, and uses mostly optional components which you can choose to incorporate or not.
- Soldering iron, flux, solder and plenty of small gauge hookup wire. I think I used mosty 24g or 26g
- Hot glue gun, epoxy, wire shrink wrap and wire ties as desired
- A project box, cigar box or something big enough to fit all the components into. I used a cheap, old cigar humidor.
- B-8 stick grip or similar control interface. It's up to you what you use - the interface could be as simple as a cheap array of switches or buttons
- 2 Arduinos (I used Uno's), one to run the IR remote control stuff and one to run the X10 stuff. You may be able to use just one if you know what you're doing. This was my first real Arduino project and I didn't :-).I also used protoshields to make these circuits permanent, but breadboarding will do!
-Switches. I used two DC toggle switches with 'missile guards' and a cheap Chinese key switch for effect. Since this is a custom build to your own preferences, use whatever you like!
For the Arduino remote control:
-IR remote control circuit to capture IR signals from your remote and decode them. See here
- 38kHz Infrared (IR) Receiver Module
- An IR LED or two to transmit the codes to your device(s)
For the Party Button
X-10 CM-17A Firecracker dongle
X-10 transceiver such as TM751 Mini Transceiver Module
X-10 lamp and appliance (3-prong) modules, receptacles and light switches as required
- Arduino with BroHogan's X10 Firecracker remote library installed.
- Old female serial plug that you can tear apart
Light effects for the box:
- LED's. I used a couple of LED arrays I found online that run off 12v DC and an LED 'cyclon' kit I had lying around that will run off 3v from the arduino. You'll need IR LEDs too, and couple of regular ones.
- A couple of transistors to provide switching from the Arduino to any external devices that run on their own power supply. I used a Tip120 connected to the Red Alert siren and amp, a Tip120 connected to the 12v Police Flashers, and a 2N4401 to connect the IR LED's to the Arduino. I'll explain all this as we go on.
Sound FX for the box:
-A simple siren kit or something similar. I used a cheap 'Red Alert' circuit using 555 timers
- An LM386 amplifier circuit or similar, if desired. I wanted the alarm to be load so I used the amp.
A 12v li-po pack powers the LED "police flashers" on the outside of the box, a 9v pack powers the X10 Arduino, a set of two 3.7v li-ions powers the IR remote Arduino, another set of 2 li-ions powers the IR LED''s themselves, and a regular 9v powers the siren. The LED cyclon on the top of the box is powered directly with 3v from the Arduino board.
I know there is a more efficient way to power the whole thing, but I built it in stages and as I got each part of it running, I didn't feel like taking the time to re-engineer the power system. I could probably run the whole thing off of the 12v li-po pack but I'm too lazy to figure out how to do it. Plus I had a bunch of rechargeable 14500 and 10440's (AA and AAA size li-ions batteries) in stock and there's plenty of room inside the box, so space was not a problem.
Step 2: The Box and the Grip
I won't go into too much detail on the box as you'll undoubtedly use something different. Anyway, here's what I did with mine. I took an old cigar humidor, sanded it down to bare wood, hit it with primer, and sprayed it with several coats of black satin paint. I used a hole saw to cut out an opening for the amphenol adaptor and the speaker and drilled holes for the switches, top cyclon LEDS, and side LED array wires. You'll also need holes for the IR LED's.
The B-8 stick grip was used on several military aircraft in the past and this specific one came from an A-10A Warthog, c. early 1990's. They can be found from time to time on eBay and from military aircraft surplus suppliers online. They are relatively expensive for a build like this so I recommend using whatever type of controller you want that uses simple switching. I'll proceed as if you're using a B-8 - the principles are the same for whatever you end up using.
When you take the jet and the armament away, the B-8 is really just a cool looking array of switches. There are 17 pins, of which three are unused, and it takes one pin connected to it's pair pin to close the circuit and make the switch do something. Basically, there are 8 different switches on the B-8 each used for different functions on the aircraft. From bottom to top they are familiarly known as: the Pinky Switch, the A/R Missile switch, the trigger, the Pickle button and the 4-way China Hat trim button. Pinout is discussed in the next step.
Before I could make this work I needed an amphenol adapter from Mouser so the pins on the bottom of the stick would have something to plug into. I suppose I could have hooked up the wires directly to the pins on the stick, but the adapter is easily solderable and provides support for the stick as it is fastened to the lid with screws.
I still needed a solid base for the stick grip as it will sit on the lid of the box and I didn't want it falling off or disturbing everything every time I opened the box. The B-8 is way heavier than the lid, and you know how physics works. Fortunately I had some 3" 6061 aluminum stock laying around so I lathed a fitting and threaded it so the bottom of the stick would screw into it. I fastened it to the lid with some epoxy because I was too lazy to drill and tap screw holes on the bottom.
Step 3: Stick Grip Pinout
Here it the B-8 pinout based on the letters on the connector at the base:
A to E = China Hat Left
B to E = China Hat Down
C to E = China Hat Right
D is unused
E = common for all Thumb Hat switches
F to K = Pinky switch
G to R = AR/Missile switch
H to N = Trigger (pulled all the way in to the 2nd stage switch)
J is unused
L is unused
M is unused
P to E = China Hat Up
S to T = Pickle Button (top switch next to thumb hat)
Once connected to the amphenol adapter, I soldered wires from each of the operable pins and tied them together on a distribution bus which will connect to the Arduino.
Step 4: Getting Arduino to Decode IR
It's beyond the scope of this instructable but there is plenty of information on Ken Shirriff's blog about how to make the Arduino control IR devices. He has an awesome Arduino library for this which makes it pretty easy. Here are the basic steps involved:
- Follow the instructions in Ken's article "A Multi-Protocol IR Remote Library for Arduino " You'll put together a simple IR decoder circuit using a 38KHz IR receiver module to record and playback IR signals using the Arduino. Most remotes use this frequency to transmit and receive. There are several different IR protocols that must be considered too, but Ken did a bang up job of explaining them here .
I'll throw in a plug for Ladyada's Arduino tutorial site too. Her IR sensor tutorial is excellent!
Anyway, using Ken's circuit, you'll use the serial monitor of the Arduino software interface to see the actual IR codes the remote sends out to your components to control the various functions. It's as simple as taking your existing remote and shooting each button at the receiver module. The codes will show up on the serial monitor and all you have to do is cut and paste them into Notepad or similar for later use in the sketch! Although I just breadboaded this circuit, I keep it handy for any future IR projects I might undertake down the road.
Modern remotes have tons of buttons and control dozens of functions. Because my B-8 stick grip has only 8 buttons, I had to make some compromises which took some planning. In my system, all my components (TV, DVD, music server, iPod dock, satellite TV box) are hooked up through HDMI to my AVR receiver. Normally my AV system is controlled by a Harmony One remote, which uses macros to control each "activity" programmed into it. For example, if you press "watch TV", it turns on the AVR receiver, TV,and SAT box in sequence, selects the proper TV output and AVR mode, then defaults to the SAT box for changing channels and the AVR for controlling volume. Unfortunately I couldn't just clone Harmony IR signals with Ken's circuit and assign an activity to each button, because for some reason it didn't work. So to make this thing useful I needed to find the 8 most important functions of the remote which were:
AVR On/Off, TV On/Off, AVR mode select (so I could switch between TV and music), Volume Up/Down, Arrow buttons up/down and right (to select channels or navigate the music server) and the Return or Back button. Since this device is designed for my bar, I don't really need to control my DVD player because besides drinking, I'm either watching sports or listening to music in there. (This is probably 99% of what I use the Harmony for, but imho the Harmony is still worth the $$ because it passes the "babysitter" test.)
With the help of the Arduino Button Library I assigned a function to each of the 8 buttons and added the IR codes to the sketch.
Most of my components use what's called the NEC protocol, but for my Samsung plasma, I had to use IR Raw.
A note about the IR LEDs. I used three of them to try to maximize coverage when sitting at the bar. The IR signals need to reach both the plasma TV and the AV system rack which sit perpendicular to each other in my bar's layout. Since IR signals are line of sight, I put one each on the upper corners of the back of the control box, and one in the center. They are wired up in parallel so that when the Arduino sends the IR codes, all of them fire at once with plenty of amperage. I also setup a regular blue LED to mimic the IR so I can see if it's working. These are all wired in parallel (with their own resistor) and powered by 2 x 3.7v Li-ions. I wired them in parallel so that if one fails, the others will continue to march on.
Also, since these IR diodes are powered by an external source instead of directly from the Arduino, they needed a 2N4401 transistor to provide switching. I found an easy to follow explanation on how to do this here.
A red guarded "Missile" switch is connected to the Arduino power supply to switch the system On and Off. I didn't want the Arduino to be continuously powered as the bats would quickly run down. I put an LED power on indicator so I could tell if the system was left on.
Step 5: The IR Remote Arduino Sketch
I am a novice coder and will be the first to admit my C skills are limited. What I came up with is not the most elegant bit of Arduino code ever written, and I'm sure some of you guys will laugh at it. But for this project, it works. I consider this sketch to be in beta until I figure out how to make better use of the eight buttons and make it more robust.
Because I was limited on the number of buttons, I programmed the Arduino to send out IR signals for two devices at once. For example, the Master Power On/Off (Pinky switch) needs to turn on both the Samsung Plasma TV and the Onkyo AVR. Since each of these components uses a different IR protocol, two signals are sent when you press the switch, with a slight delay between them. The China Hat switch is similarly programmed to send signals to both the SAT box and the Music Server so I can change channels when in SAT mode and navigate up/down and right when in Music Server mode. At some point I will re-address this and try to make the Arduino sense what mode it is and have button functions specific to the mode programmed in.
The AVR controls volume for the system, but I needed to make the button "2-way" - i.e. when you pull the trigger the first time, Volume goes Up until you release it, and on the second pull Volume will go Down. For this I used the "button.ispressed" function from the Arduino Button Library.
Again, this code is not the most elegant solution but it works. To people just starting out with this stuff, showing the world your code is like showing the world your junk, but at this point in my life I don't care. You can download the *.pde or the code directly in a text file below.
Step 6: Emergency Party System
While an A-10 stick controlling your AV system is pretty frickin' cool, the Emergency Party Button (EPB) is the pièce de résistance of the system. With the IR remote Arduino we can switch from watching TV to listening to music, but with the X10 Arduino we can have an EPB! This adds a pretty cool light show to the bar that I can guarantee few of your buddies have. This part is easier than the remote and makes the wow factor of the project go ballistic.
First you must decide on what kinds of components you want to add to the room. In my bar, there is:
1. Ceiling can light circuit already installed but made dimmable with X10 wall switch
2. Second ceiling can light circuit
3. Venue Ultra Mini-Fogger machine
4. Shinp DL 55C RGV Laser scanner
5. Chauvet LX-5 Moonflower LED Light
6. Chauvet Techno Strobe/BetaBright RGB LED sign above back bar
7. LED strip under bar
8. LED strip under railing
9. LED chaser strip over AV rack
10.Chauvet LX-10 Moonflower LED Light
11. Black light tube
12. Eliminator Roto Saucer UFO light in corner of bar
13. LED light bar
That's an awful lot of stuff in a small home bar, but it is pretty awesome. In my world, the degree of awesomeness is directly proportional to the amount of eye roll from my wife when I turn this stuff on,
and this stuff gets her eyes spinning like uncaged gyros. Seems only Dads and kids can appreciate stuff like this...
The laser scanner and all the Chauvet lights can be set to run continuously or to music. The RGB LED strips double as mood lighting under the bar and can be activated with a separate X10 remote. I didn't give too much thought to exactly what kind of lights to buy, I just tried to pick up one of each kind when I saw them on sale. The BetaBright Prism LED sign I picked up used on eBay, and you can program to do a lot of cool stuff.
All of the devices are hooked up to either X10 outlets and lamp/appliance modules - YMMV depending on what you want in your room. There are many X10 tutorials out there, but the bottom line is that for this application X10 setup is ridiculously easy. Just plug everything into its own outlet/module (make sure to set a unique address for each one), plug in the x10 transceiver and the CM17A dongle hooked up to the Arduino takes care of the rest!
The trick to an awesome light show with all these cheap Chinese lights (esp. the lasers), is to have to the fog machine running while they're on. Unfortunately it takes about 4 mins for the fog machine to get hot enough to start cranking out fog. This is something I will address in the future, probably by adding another switch to the box that will send an x10 signal 4 mins before the rest of the stuff goes on. But maybe not. In some ways the fog delay adds to the wow factor, and acts like a Saturn V booster -- just while your guests are getting used to the light show environment, the fog starts running and makes everything look WAY cooler!
Step 7: Getting Arduino to Run X10 Devices
Fortunately there's another brilliant mind out there like Ken Shirriff, the guy who made Arduino IR remote control available to the masses. His name is BroHogan and here is all you need to know on how to get X10 to work wirelessly with the Arduino:
BroHogan Blog article on X10 and Arduino
BroHogan Blog article on CM17A and Arduino
He built an Arduino library for the CM17A Firecracker which you can download here .
Besides the CM17A, also connected to this Arduino are:
- The 10mm LED cyclon circuit on the top of the box, wired to pin 12 and powered directly by the Arduino
- The 12v LED police flashers on the sides of the box powered by its own supply
- The Red Alert Siren and LM386 amp circuit powered by its own supply
The 12v LED's and the Siren connect to the Arduino via Tip120 transistors as they are powered by their own power supply. Here is that awesome schematic on how to do this again:
Controlling DC motors and lamps from the Arduino
A quick note on what's going on here. The Arduino itself works great for powering little stuff like simple LED's and small servos with regulated 5v or 3.v power output. But it's pins are limited to around 50mA or so and usually that's not enough to power up external devices. That's where transistors come in!
I used Tip120's because I had them in stock. You could probably use a whole bunch of different NPN transistors to do the same thing but all I had on hand were these and the 2N4401 I used for the IR remote LED's in a previous step. For more on powering external devices with the Arduino see:
Relays with Arduino
Transistors with Arduino
Step 8: The X10 Code
You can download my code below. The system runs like this:
1. The key switch turns on the red alert alarm, cyclon LED sequencer on top of box, the "police flashers" on the side of the box, and the Arduino itself. (I did it this way to save power and prevent the Arduino from being powered up all the time.) The flashers and cyclon are will continuously run while the key switch is on. The red alert alarm will continue to run until:
2. The Red guarded switch is turned to the On position.
3. Once the Red guarded switch is closed, Party Mode On is activated. This dims the overhead can lights in the bar and turns on all the cool stuff.
4. Red switch "Off" deactivates Party Mode, turning all the X10 devices off sequentially and returning the overhead can lights to normal. There is a bit of a delay that is do to the way the X10 system works. It really is old technology.
5. Key switch Off shuts the system down.
Well, hope you enjoyed this tutorial and please message me if you have any questions. I'll try to answer them but be forewarned that I am not an Arduino guru by any stretch, so you might be better off going to the Arduino forum for anything more complicated!