In the previous Instructable, "Hacking the Spy Video Trakr" (http://www.instructables.com/id/Hacking-the-Spy-Video-Trakr/), you learned how to open up the Trakr and install male headers in the GPIO connections on the circuit board. You also learned how to write, compile, and install a short program on the Trakr to flash LEDs by pressing the A and B buttons on the Trakr remote. Of course, getting the Trakr to flash LEDs isn’t very interesting, but now that you’ve completed your first Trakr hack, you can try more sophisticated hacks.
The voltage output directly from the GPIO pins is only 3.3 volts so, there aren’t many devices other than LEDs that you can drive with such low voltage. If you wanted to control, say, a Lego motor that runs on nine volts, you would need a nine volt voltage source yet prevent accidently sending nine volts through the Trakr’s processor and frying it.
When deciding what kind of circuit to connect to the GPIO pins, always apply the maxim, “Keep It Simple, Stupid” (KISS). If, for example, you wanted to drive a single motor in only one direction, the simplest device to keep a higher voltage source–the one used to drive a motor–from accidently passing through the Trakr’s processor is an electronic relay. This Instructable will demonstrate how to use a relay to control an external device with the Spy Video Trakr. You'll learn how an electronic relay works, what the electronic scematic diagram for a relay looks like, and what an actual electronic circuit diagram in which the relay is used looks like. You'll learn how to make conversion cables to connect the Trakr to external devices. You'll learn how to make a larger cargo deck for the Trakr and see some examples of how some devices can be mounted on the Trakr. You'll learn how to tap into the Trakr's 9 volt and five volt power supplies. Finally you'll learn how to use the electronic relay to control an foam dart missile launcher.
What’s a relay? You’ve probably seen a relay race where one runner hands off a baton to another runner. Similarly, an electronic relay hands off control from one circuit to another. A relay is a very simple device consisting of an electromagnet, an armature (a switch that closes when attracted by the electromagnet), and a spring that is connected to the armature. You can see in the diagrams (Source: How Stuff Works) how the relay works.
In Figure 1 of the diagram, there are two circuits. The first circuit is a battery (3 volts), a switch and an electromagnet. The second circuit is a battery (6 volts), a light bulb and the relay’s armature. While the switch to the electromagnet is off, no current can flow from the 3 volt battery through the electromagnet. So, the armature-switch is off and no current can flow from the 6 volt battery to power the lamp in the second circuit.
In Figure 2 the switch to the electromagnet circuit is switched on. When current from the 3 volt battery flows through the electromagnet, the electromagnet creates a magnetic field that attracts the armature to close the circuit to the lamp. Now current can flow from the 6 volt battery to the lamp, and the lamp lights up.
If you look closely at Figure 2, you’ll notice that while the armature-switch is closed allowing the current in the lamp circuit to flow from the 6 volt battery to the lamp, it does not come into contact with the electromagnet so, the 6 volts from the lamp circuit cannot flow into the electromagnet circuit. Thus, the 3 volts in the electromagnet circuit and the 6 volts in the lamp circuit remain separate.