|
||||||||
|
||||||||
|
AAN148 How to Transmit IR Codes By Michael Simpson The Athena has a command called irout. It can send IR commands in a Sony protocol format or raw. This application note will concentrate on the Sony protocol. The protocol is strait forward, transmit the first 7 bits of the command code then the 5 bits for the device code. Start it all with a 2500us start bit then use a 600us interval for low and a 1200us interval for high for each bit transmitted. There is a 600us high pause between each bit. I use the Hardware PWM (hpwm) to generate a 40Khz carrier and just turn it on and off as needed. Hookup There are two ways to hookup an IR Emitter. The first is to just connect it directly to the Athena. Schematic 1 You must use IO port 6 because that it the port that the hardware PWM is connected to. A 39 ohm resister will keep the IR LED from overloading the port. This will get you up to an 8 foot range.
The second approach is to use small NPN transistor such as the 2N2222 to allow us to send more current to the IR LED. Schematic 2 The circuit used in schematic 2 will allow you to bounce the signal off all the walls.
Lets Have Some Fun In the following example I created a gag circuit. Once turned on and placed near a Sony TV it will lower the volume every time some tries to increase it. It will raise the volume each time someone tries to lower it. My wife threatened to divorce me if I ever used it again so use at your own risk. Note that by making changes to the program you could also use this circuit as a IR range extender. !!! This is for demonstration purposes only !!! Schematic 3 In schematic 3 we add a Vishay IR module. It is powered by the IO port leads 1 and 2 set to low and high. This will allow us to plug it directly into the IO port holes. The same can be done with the 2N2222 transistor but I dont show it in the schematic. If you wish to power the circuit from a 9v battery you will need to add a voltage regulator like the 7805.
The Program (download it here) dim
cmd,device
You can use these commands with any application. You can create your own remote or use them to add some wireless communications between projects. Parts
|
Copyright © 2001 - 2007 Kronos Robotics