Hello! Today, as part of our charitable efforts here at Techjango, we're giving you a tutorial! Involving electric guitars, at that!
This is going to be a fun little project where you, by your own hands and tools, will make your guitar go WIRELESS. Now, I'll lay out the cons right away for you - we use an FM band in this tutorial, which requires antennas that, while not too long, aren't the shortest either. The second con being that we here at Techjango, being the bare-wallet'ed engineers that we are, have to keep our costs low, and so the FM transmitter and receiver modules we used weren't exactly the most precise, audiophile-happy ones.
Now, why do this? Maybe you're room is incredibly messy and you want to avoid an additional cable. Maybe you want to have a 'ghost' (guitar) amplifier just to spook your friends. Maybe you're a newbie to wireless transmission and want to sink your teeth in just a little bit. Even if its none of these, there's always one never-ending reason - to learn and to have fun, simultaneously.
Step 1: Parts
-Wireless FM audio-centric transmitter & receivers: We utilized these two modules, both sourced from the nice folks at Seeed Studio. They cost around $8 each, which isn't too bad.
-Two Arduino-bootloaded atmel microcontrollers. An fresh atmega8 costs, what, ~$5? You can use one of the many means available on the Great Goog in the Sky to write the Arduino bootloader onto the microcontroller. We happened to have two spare Arduinos so we just used the Atmega chips right off them.
-Two 16 Mhz oscillators, each costing around the same as a speck of dirt.
-Two 7805 regulators, or similar - cost $1 or less.
-A TL071 opamp or similar - also costs $1 or less.
-A 1/4" female TRS plug. Costs $2 or less.
-Several Rs and Cs- You should have lots of these with you already (or at the very least, know where to get them from in the handfulls) if you're even a beginner in electronics. Also dirt-cheap.
(pssst - a good directory of distributors)
Step 2: Digging in
Attached is an over-arching workflow of this little project. We use a regulated 5V supplies, from 9V batteries, to power our microcontrollers, preamp and transmitter/receiver. The microcontrollers send an initial stream of data to configure the transmitter/receiver for their individual roles. We'll be using the 104.5Mhz frequency, though you can easily adjust this in the code given.
The Preamplifier will be constructed using a TL071 opamp. We'll bias it at 2.5V from the 5V supply, and set a gain of around 5 - this is enough to increase the guitar volume enough to improve SNR in the transmission, yet small enough to not to cause the audio input at the transmitter to clip. You can try to omit the preamplifier but you'll have significantly more noise in your received signal.
Also, if you haven't figured out already, we'll be using capacitive coupling to link together all the audio in/out signals - The Preamplifier has a DC output voltage of 2.5V which we can't afford to feed into the FM transmitter. On the FM transmitter/receiver ends, their audio input/outputs also have a DC bias so we're forced to use capacitive coupling there too.
Download our Eagle schematic/layouts first. We made a bit of a mistake and ended up with 3 boards on the transmission side - 1 single-side home-made PCB, and 2 tiny perfboards. They are guitar.sch, preamp.sch, and txboard.sch/brd. Guitar.sch is the perfboard schematic we use to couple the guitar signal into the preamplifier. Preamp.sch is the perfboard schematic for the TL071 Preamp circuit. Txboard.sch/brd is the transmitter PCB board. Have a looksee at the the transmission-side setup in the attached pictures.
Step 3: Going further
Since this isn't a soldering article, I won't be going over it! Check out the "soldering is easy" comic at mightyohm for that: http://mightyohm.com/blog/2011/04/soldering-is-easy-comic-book/
Some points of note:
. You need to connect a piece of jumper wire, vertically, on the antenna pin on the PCB.
. Since the guitar is a monaural instrument, only 1 of the two transmission channels is needed. So connect the Left channel Input of the transmitter to ground, otherwise you'll have more noise in your final signal (The transmitter sums both channels when working in mono mode)
. Yes, the R/C values aren't godsend. : ) You can change them around if you need/have to, as long as you don't waver too drastically. As I said this isn't an audiophile-level project so incremental improvements (or degradation) in noise won't really be very noticeable in the end.
. As for the medium-sized red 'dot' in the Eagle schematics, thats just a part I myself made up to improve the board layout process. Don't mind it. : ) In fact, I suggest you make on yourself for use in your projects! Its very handy for home-made single-side boards where you have to cross some jumpers yourselves. Sparkfun has a set of very handy tutorials on Eagle in their "Beginning Embedded Electronics" tutorial category.
RX-board.sch/brd is the receiver-side PCB board. We soldered the TRS plug to the FM receiver output for easy connection to the guitar amplifier. Connect a 9V battery, and its ready - see the attached pictures.
Step 4: Wrapping up
The code for the microcontrollers still remains, though. Here's the (arduino) code that you need to burn into BOTH microcontrollers. Both because it contains non-interfering instructions both for the transmitter and receiver modules. The transmitter module works on a custom, SPI-based 3-wire protocol, documented (though problematically) in the manual on the item's page on Seeed Studio. The function 'sendBit' implements a single-bit transfer which we simply, though admittedly far-off from elegance & brevity, used again and again manually to transfer each bit. The most important bits are D10-D00, and MONO. To tune the transmission to a particular frequency, we multiply the frequency, eg. 104.5 (Mhz) by 10 to get 1045. We then convert that decimal value to its binary form to get the binary code D10-D00. MONO is simply set for mono transmission, 1 for stereo.
We had a fair bit of trouble figuring out the protocol for the receiver, mostly because of the patheticly legible, incomplete manual on the item's Seeed Studio page. Thankfully, mr electronicsblog.net had figured it out. We used a segment of the code there to create our own, particularly the global variables declared at the start of the code. Just assign the double var 'frequency' the band needing tuning-to, and you're set to go! Wireless FMagic-super-guitar locked and loaded!
Do let us know of any errors or misconceptions! And ESPECIALLY let us know if you've made any improvements on the project. For instance, 1 very cool yet obvious thing would be to 3d-print a small-sized enclosure for the transmission circuitry, and attach it directly to the guitar on its side! You can connect the guitar wires directly through the guitar to the transmission-circuitry and now you don't need a guitar cable at all on the transmission side, plus everything's placed & attached neatly onto the side of your axe!