Subversion Repositories Projects

Rev

Rev 840 | Blame | Compare with Previous | Last modification | View Log | RSS feed

Servo controlled infrared transmitter

Application examples:
- Remote control for a camera on a RC-model through normal servo channels.
- Control for a TV at home. Doorbell connected to one input - switches the TV to a surveillance cam.
- Control for a stereo at home. Motion sensor connected to one input - pump up the volume to scare a housebreaker.

The idea for this project came up, to control a HD-camcorder on a Mikrokopter with a second radio-transmitter.
Gas-Stick: Zooming Camera
3-way Switch: Stop/Picture/Movie record
Nick-Stick: Cameraholder-Nick
Roll-Stick: Cameraholder-Roll


Inputs:
2 channels for servo-signals, switches or other TTL signals
1 IR-Receiver to learn new codes (36 - 40 kHz)

Output:
Modulated infrared signal at 950 nm

Controls:
1 LED to indicate several operating modes
1 button to enter/leave the learning mode and switch between single and multi mode

Supply voltage:
5V DC @ 50 mA
(Attention when using RC-Receivers with higher voltage)


Theory of operation:

Each channel is seperated into 5 states, depending on the positive pulse width:
0,00 - 0,74 ms => 0 (switch to GND)
0,75 - 1,24 ms => 1 (stick down)
1,25 - 1,74 ms => 2 (stick middle)
1,75 - 2,24 ms => 3 (stick up)
2,25 - more ms => 4 (switch to VCC or open input)

Together with the second input, you get theoretically 25 different combinations, which all can be populated with learned IR-code.

When using servo signals only, you have 3 states per channel, so 9 combinations.
When using switch signals only, you have 2 states per channel, so 4 combinations.
When mixing both signals, you have 2 states for the switch and 3 states for the servo, so 6 combinations.
When using only one channel, you get 2 (switch) or 3 (servo) states.

After power-up, the device checks the inputs the whole time. When a combination was learned with an IR-Code before, this code is sent out through the IR-Diode. Depending on which mode this combination was learned, it is sent out only once (single-mode), or as long as the combination stays active (multi-mode).
When the device sends out IR-Code, the red LED lights up.


Theory of learning:
When you press the button on the device, it goes to learning-mode.
In this mode, the LED flashes 1 or 2 times (depending of the actual mode) every half second, indicating that the device is waiting for IR-codes.
When pressing the button again, you can choose between single- or multi-mode.

When an IR-code is sent to the device, it looks at which state-combination the inputs are, and saves the IR-code for this combination.
Saving is confirmed with fast flashing of the LED.
You can now learn multiple combinations with different (or same) IR-codes, you can even mix up different IR-protocols and use different modes on different combinations.
When you have learned enough, press the button for 2 seconds, to permanently save the data to the EEPROM. This is confirmed with fast LED-flashing.
The device goes back to normal operation and is ready for orders.


Currently supported IR-Protocols
Protocol:   Used by
===================
GRUNDIG     Grundig
JVC         JVC
KASEIKYO    Panasonic, Technics, Denon and more japanese manufacturer, which are member in "Japan's Association for Electric Home Application"
NEC         NEC, Yamaha, Canon, Tevion, Harman/Kardon, Hitachi, JVC, Pioneer, Toshiba, Xoro, Orion, NoName and much more japanese manufacturer
NIKON       Nikon
RC5         Philips and more european manufacturer
RECS80      Philips, Nokia, Thomson, Nordmende, Telefunken, Saba, Technisat
SAMSUNG     Samsung
SIRCS       Sony


The code was compiled using WinAVR-20081205. Other versions generate much bigger code which don't fit in the ATMega8 anymore. To avoid this, use another WinAVR version or disable some IR-protocols in irmpconfig.h and irsndconfig.h

This project is based on the nice IR decoder/encoder routines (IRMP/IRSND) from Frank Meyer => http://www.mikrocontroller.net/articles/IRMP