Introduction: Build an ArduinoBoy
The GameBoy. Most likely you owned one back in your childhood. And even if you didn't, most likely you played with your best friend's GameBoy, or maybe you owned its closest competitor, the Sega Game Gear or Nomad. Marvelous little gaming devices, but now that you are all grown up, have you given any thought to what you are going to do with it now? Keep it in the attic to dig out and show your kids what gaming was like in the 20th century? Sell it to a collector? Relive gaming memories by going back through the Legend of Zelda: Link's Awakening for the umpteenth bazillon time?
Did you ever think about turning it into a musical instrument?
Timothy "trash80" Lamb is a chiptune composer currently living in Los Angeles, California. A chiptune composer is a person who uses the sound generator ICs (integrated circuits) found inside video game consoles and handhelds to create music. Mr. Lamb is also the creator of a device known as the ArduinoBoy; a combination of open source hardware and software that can turn any member of the GameBoy family with a cartridge slot and a link cable port into a MIDI sound generator.
Now it should be noted that trash80 was not the first to create such a system. The two big homebrew GameBoy apps used by professional chiptune composers, Nanoloop and Little Sound Disk Jockey, or LSDJ, have had MIDI in capability for quite some time. The problem is that both these apps rely on Microchip PIC hardware to send and receive MIDI signals. No disrespect intended to the standard microcontroller of the electrical engineering industry, but the PIC really is a piece of professional hardware and can be kind of intimidating for those who do not muck about with electronics on a regular basis. There is also little to no support for users of less popular operating systems when it comes to programming these devices (the only official PIC development suite is for Windows, no Linux or Mac support). By using the much simpler Arduino platform, however, the ArduinoBoy gets around these limitations, making it much easier for a would-be chiptune composer to build the tools he or she needs. Plus, while the ArduinoBoy was made to work with trash80's own homebrew GameBoy sound generator program, mGB, it also gets along just fine with Nanoloop and LSDJ.
While trash80 has shared his work on a Google Code web page, he does not have any step-by-step instructions on how one can make their own (its on his to-do list). I decided to help him out in this regard. While not necessarily a step-by-step, this Instructable should give you a general idea on what to do and show you some of my pitfalls so that you can avoid them.
Step 1: Parts, Tools, and Code
- An Arduino, generic Arduino, or the parts to make your own. I personally use Modern Device Compay's Really Bare Bones Board kit, which can either be assembled as is and attached to your project using female circuit board pin sockets, or cannibalized for parts to make the Arduino a permanent part of the project.
- Two 220Ω, seven 2KΩ, and one 270Ω resistors. For this project, 1/4 or 1/8 watt resistors are ideal.
- One 6N138 opto-isolator.
- One 1N914 small signal diode. Don't be surprised if you can only buy them in quantities of 10 or more.
- One pushbutton that is on only when the button is depressed. For those who speak Engineer, that is a SPST off-(on) pushbutton.
- Two 5 pin female 180 degree DIN connectors. Make sure you get these exact connectors. There are many different designs for DIN connectors, and few, if any, are compatible with each other.
- Four two-pin terminal blocks. Although you can just solder all your wires directly to the PCB, using terminal blocks or some other form of connectors will make assembly, disassembly, and parts cannibalization much easier.
- One general-purpose PC board.
- One GameBoy link cable.
- A device that can provide MIDI out, like a keyboard or a computer with the necessary software and adapter.
- One programmable GameBoy cartridge.
- Extra wire. Solid for breadboard work and wiring the PC board, stranded for wires you expect to move often.
- A case to stuff it all in.
- Pile of Miscellanea.
- Soldering iron.
- Desodering bulb, pump, or wick. Just in case.
- Helping hands soldering tool.
- Safety goggles. Your glasses are not going to cut it.
- Fire extinguisher, or at least a glass of water. Once again, just in case.
- Wire cutters.
- Wire strippers.
- Needle-nose pliers.
- Solderless breadboard.
- Programming or USB cable(s) for both the Arduino and the programmable GameBoy cartridge, if applicable.
- Rotary tool and/or anything else you need to cut holes and slots in your case of choice.
You are going to need two different pieces of code for this project, both of which can be found on trash80's ArduinoBoy Google Code page . They are found on the right side of the page under the heading Featured Downloads . You will load the ArduinoBoy code into the Arduino, while mGB will be loaded into the programmable game cartridge.
Step 2: Let's Look at the Schematic
A schematic is, quite simply, any document that depicts how a mechanical or electrical device is put together. Those pictures of your lawn tractor with all the parts disassembled with little dotted lines showing how they all fit together? The blueprints the contractor for your home or apartment was so obsessed about? Schematics; both of them.
As far as schematics go, trash80's schematic for the ArduinoBoy is a lot more colorful and lacks straight lines, but is perfectly readable. Unless you are completely anal about engineering conventions, you should have no problems.
You might want to print this out, as we will be referring back to it often.
Step 3: Breadboard Test
Before we get to the actual construction of the finished ArduinoBoy, we first want to make sure all our parts are good. For that, we will use our solderless breadboard, which allows us to create connections between electronic parts without having to solder them together. It's easy. Just look at the schematic and connect the parts as shown.
Remember that there is a comments section on each page. If you get stuck on something, post below and I will try to help you as best as I can.
Step 4: First Test
The first test is quite easy. Simply connect your GameBoy to the device, switch on the GameBoy, and watch the ArduinoBoy's LEDs. If the pin13 LED flashes briefly, followed by the remaining LEDs lighting up in sequential order, sweeping from highest pin to lowest and back two times, ending with two flashes from the LEDs all at once, then chances are good that your ArduinoBoy is in working order. Also be sure to test the mode select button. When you press it, the currently-lit LED should turn off and the next in the sequence will turn on. If, instead, the lights refuse to light up, parts feel abnormally warm to the touch, you see or smell smoke, and/or any part of the circuit explodes or bursts into flames, then refer back to the schematic, double-check all your connections and wiring, replace the damaged components, and perform the smoke test again.
The second test is a little more nerve racking, mainly because if anything goes wrong here, it won't just be the Arduino that will be turned to toast. Load up mGB into your GameBoy, plug the ArduinoBoy into your GameBoy, and connect the MIDI out of your MIDI-compatible device to the MIDI in of the breadboarded ArduinoBoy. Turn on the GameBoy, then the MIDI device, keeping your fire extinguisher close at hand lest anything happen. Try playing a few notes on your MIDI device on channel 1, 2, 3, 4, or 5. If your GameBoy makes a noise reminiscent of an instrument or a sound effect, then proceed to jump out of your chair, staring up toward the heavens, arms outstretched, bellowing "IT'S ALIVE" while laughing manically.
A note on both testing and using your ArduinoBoy: there are web sites out there that offer free MIDI files of popular songs, and you will be temped, sorely tempted, to use them for both testing and in your composition sessions. Resist that temptation. First off, some of the MIDI tracks offered by these sites are not well made. I once found a MIDI copy of the Gorillaz's "19-2000", and one of the instruments did not cut out or fade out, so eventually, this one instrument would overwhelm the rest of the instruments until you stopped the player and started it again. Plus, using these pre-made songs encourages you to continue using pre-made songs. You won't make anything original. You are better off learning how to compose your own music right away.
Step 5: Solder It Up
"Wait! Wait!" you are yelling to yourself. "It works just fine now and I know I will be careful with it. Why potentially mess it up? Why bother soldering?"
Okay then. But think about this for a moment: you and your ArduinoBoy make great music. So great, in fact, that you end up turning chiptune into a legitimate form of music. You bring chiptune into the mainstream. You become famous. So famous, in fact, that you are invited to play at Wrigley Field just before the Cubs take the field. You are still using your breadboarded ArduinoBoy. You and the crew are getting everything set up just so, until one of you notice the most important of your musical instruments, the ArduinoBoy, has gone missing. You finally find it in the hands of a young boy who managed to sneak past security. In his curiosity, he has removed all the components from the breadboard, and unfortunately, you do not have a schematic handy. With only 5 minutes to go before the show starts, you have to cancel your performance. The crowd goes nuts, and in their fury destroy a good chunk of the stadium, causing the game to be canceled as well. The Cubs loose their make-up game and their shot at the World Series yet again, and they have you to blame.
Don't let this highly convoluted scenario happen to you: always make your projects permanent.
First, after removing all the parts from the solderless breadboard, place them on the PC board and figure out how you are going to fit them all on. There are a couple things that you should keep in mind:
- Try to get all your ICs to face the same way. That way, you can tell at a glance whether they are all mounted properly.
- Screw terminals, IC sockets, and wire connectors are your friends. If anything breaks, you want to be able to remove and replace the parts easily. Also, you may have to cannibalize your ArduinoBoy at a later time to build something else. Adding sockets and other connectors can allow you to do this easily.
- Be mindful of the space you have to work with. Keep parts well away from mounting holes so that you can get mounting hardware and tools to those locations easily. Also, if you are fitting the board in a very small space, like an Altoids tin, you need to keep in mind the space parts like buttons take up. You may have to keep parts of your board clear so that the button has clearance inside the case.
Step 6: Using Your ArduinoBoy
Your ArduinoBoy, if assembled correctly, should behave no differently than any other MIDI input device. When used with mGB, it will have 5 separate MIDI channels. Channels 1 and 2 are steady tone generators, 3 is a tone generator that seems to have a three note pattern in my limited tests (the timbre of the note will change each time you play on this channel, following a pattern), channel 4 provides bass sounds (use like a drum, bass guitar, or synth), and channel 5 is noise (most often used in GameBoy games for explosions and running water).
Plug your MIDI out device into the port connected to the opto-isolator, your ArduinoBoy into your GameBoy, and your reprogrammable cartridge into your GameBoy as well. Set your ArduinoBoy to mGB mode by pressing the button until the LED connected to digital 8 lights up. From here on out, you can use your GameBoy as a MIDI instrument. Adjustments to the sound generated can be made at the GameBoy using mGB's interface, specifically, timbre, octave, channel, and note attack. The other ArduinoBoy modes are used with other GameBoy chiptune creation programs, specifically, Nanoloop and LSDJ and are beyond the scope of this Instructable.
Step 7: Pitfalls You Can Avoid
In the course of completing this project, I made a few design and construction mistakes that, although they did not adversely affect the performance of the ArduinoBoy's core function, they did make construction more challenging and the final presentation a little sloppy. Here are my mistakes and a few common glitches, and how you can avoid or correct them.
Metal Case Work
Of all the design decisions I made, the decision to use an Altoids mint tin as a case was perhaps the most disastrous. The problem is not with the tin itself, but the tools I had available in preparing the case and the fact that I have done very little work with thin sheet metal. First off, use the right tool for the job. Tin snips, or at least the ones I used, tear up the metal rather than cut it cleanly, leaving behind hard to remove sharp edges that do not remain flat to the case. Use a nibbler instead. Also, when drilling holes, always drill from the finish side, or the side that you will see most often (outside), whenever possible. When you drill a hole you are likely to leave burrs in the metal and cause the metal to bend into the hole from the direction you drill. By drilling from the outside, you leave the burrs on the inside of the case, making the outside neater looking and safer for absent-minded people.
Cheap materials are not always the best to work with. The prototype boards I used to build my ArduinoBoy came from RadioShack and, while perfectly useable, they are hard to solder to by their very nature of being cheaply made. No plated-through holes, so solder is not sucked up into the holes, resulting in these large solder blobs on the board that do not thoroughly hold the soldered parts in place. Try your best to find boards with plated holes. If you can't, I have heard that a little solder flux smeared into the hole just before soldering will wick molten solder into the hole, just as if it were plated. On the subject of cheap proto-boards, keep in mind that because the solder will just pool up at the top, they can be prone to...
When I finished soldering together my ArduinoBoy, I noticed that the LEDs were not lighting up properly. Problem was not my wiring, that was perfect, but my soldering. Tiny, pretty much impossible to see amounts of solder and dust were bridging the gaps on the board, preventing some LEDs from lighting and tying other LEDs together. If this happens to you, run a knife blade between the solder joints and clean thoroughly using q-tips, paper towels, and rubbing alcohol.
Try as you might, you can never use super glue without getting some on your fingers. Just a general warning for everyone out there. Don't get me wrong, it is great stuff when two parts have got to stick and stick quickly, but never assume that you can use it without gluing your fingers together.
Step 8: Where Do I Go From Here?
Having trouble getting started with the whole chiptune composing thing? Need inspiration, tips, tricks, and a place to show off your latest tune? For all things chiptunes, and by extension retro gaming, there's 8bitcollective.com . They have a vibrant community of chiptune composers who would be more than willing to help you out in your career.
Want to expand the capabilities of your ArduinoBoy? Your ArduinoBoy has a built-in function that mGB doesn't actually utilize: MIDI out, specifically, MIDI synchronization. Nanoloop and LSDJ , however, are not only compatible with the ArduinoBoy hardware, but they are able to use this unutilized feature, allowing you to synchronize your GameBoy's sounds with other programmable MIDI instruments, like drums.
Okay, you are now a successful chiptune composer and performer, but now you have a bunch of gigs to go to and you want to lighten the load as much as possible. What are you going to do? Well, so long as you are only using the ArduinoBoy's MIDI in port, you can severely reduce its size. Simply use as small an Arduino clone you can find and leave out the MIDI out port. After all, it seems to work for trash80.
As for me, I'm looking to make a few improvements to my prototype while simultaneously learning more about how it works and how I can compose some real music with it. I'm thinking about designing a few PCBs in Eagle CAD for two different versions: one that uses through-hole components and DIP package ICs, like this one, and another that uses surface mount components whenever possible so I can try out the hotplate reflow solder method and make (hopefully) the smallest full-fledged ArduinoBoy ever made.
Above all, whatever you decide to do with your ArduinoBoy, have fun. If you aren't having fun, then you are obviously doing something wrong. Remember that like everything else in life, composing chiptunes is not about beating someone else. It is about beating yourself, making each tune you compose better than the last. Nobody ever got famous for doing something they didn't love.
Questions? Comments? Marriage proposals? Death threats? Post them below.