Path: Home =>
AVR-overview =>
IR Remote Control => Transmitter for remote control signals
IR-transmitter with an AVR processor ATtiny45
- Properties of the remote control
- Hardware and how it works
- Building the remote control
- Software
This remote control project offers the following opportunities:
- Programmable for all desired devices, e.g. with one single button three or four different
devices can be switched on. To do that the different codes
- All devices that are in the receive area of the LED (with reflections e.g. in the same room)
can be controlled, for which their code is known and programmed.
- Selected and startet is a remote control sequence with the built-in keypad.
- Begin and end of the transmit sequence can be monitored with a LED.
- The supply comes from two batteries that can be switched on and off and so do not have
any standby consumption.
- If the devices to be controlled change, if an original remote control gets lost or is
defect, this remote control can easily be reprogrammed (assumed you still have the monitoring
data).
The schematic of the remote control:
In the center a processor of the type ATtiny45 was selected because it can be clocked with
an Xtal (here: 2.4576 MHz). The clock fuse has to be set to an external Xtal with medium
frequency. Derived from this Xtal is the modulation frequency of the IR LED LD271 at
38.4 MHz, but that frequency can be configured between 36 and 40 kHz by software.
The IR LED LD271 is not driven directly by a portpin but with a constant current source.
This is built with two diodes, the power transistor BD439 and its emitter resistor and is
set at 93 mA (= 0,7 V / 7,5 Ω). So, the operating voltage can be
between 2,7 and 5 V without current changes and destroying the LED.
Voltage supply is with two batteries or accus, the power switch is not displayed here.
The processor programming signals SCK, MISO, MOSI and RESET are tied to a standard 10-pin
ISP connector so that the whole remote control can be re-programmed. When re-programming
via the Studio and a STK500 the battery supply should be switched off, the supply should
come from the STK500 and VTG should be adjusted to 3 V. For correct function, the
ISP connection should be removed after programming, because it interferes with the AD
converter, and battery supply switched on.
Not displayed here is a red LED that displays start and end of the transmission sequence.
This should be connected to MISO and via a 220 Ω to the positive operating
voltage (output is active low).
On the input ADC1 of the processor the keypad is connected. The keypad produces an analogue
voltage, depending from the key pressed. The matrix is dimensioned for commercially
available resistors with 5% accuracy, for 8 bit resolution of the ADC and an
as-linear-as-possible response curve. The calculation of the resistors was done with
a calculation sheet in Open-Office-Format or as
Excel sheet.
To the top of page, To the IR title page
Electronics, batteries, keypad, resistor matrix and the two LEDs fit well into a small
plastic box ...
... the mounting of the single parts ...
... the processor part ...
... and the resistor matrix in detail.
To the top of page, To the IR title page
The assembler source ode is available in HTML-Format here or as
Assembler source file here.
The program works without timer, the timing of the signals is controlled with exact counter loops.
All transmit loop are 64 clock cycles long, which a cycle duration of 26,04 µs.
Only the AD conversion is interrupt controlled, and switched off during transmitting.
The tables are organised as follows:
- The transmit sequence codes for the different keys (pStar, pNmbr, p0 to p9) are starting
with the respective labels and end with one or two null bytes.
- Active signals with activated ande modulated IR LED begin with bit 6 set and the number of
repeats (example: 1+cH). If bit 7 is set additionally (example: 1+cHW) the number of active
and inactive cycles follows with two bytes each, otherwise with a single byte each. The
number of repeats is in the first byte (example: 4+cHW for four repeats). The four or two
bytes following are the number of cycles, that is the number of IR LED switched on and off
resp. the pause as long as if it would be switched on and off, with each cycle being
26.04µs long.
- Each line must have an even number of five resp. three bytes long packages because otherwise
the assembler would add a null byte and the sequence would end too early. Please take
respective warnings of the assembler for serious.
To the top of page, To the IR title page
©2011 by http://www.avr-asm-tutorial.net