Multifunctional IR/wireless universal switch
Infrared and 433MHz radio relay module with numerous switch, flash and timer functions (AATiS e.V. AS325)
The infrared/wireless universal switch AS325 is a receiver with a potential-free switching output. It is suitable for controlling loads such as 12V halogen lamps, small motors or pumps, doorbells or door openers via infrared or radio remote control. Operated from a low-voltage source between 9 and 15 volts DC or AC, the output relay (1x SPDT) can be used to switch loads with a current consumption of up to 10 amps. The circuit was published in the Praxisheft 25 of the Arbeitskreis Amateurfunk und Telekommunikation in der Schule e.V. (AATiS).
There are 8 buttons that can be programmed for each communication channel. Suitable infrared remote controls (NEC protocol) are supplied with LED strips, DVB-T sticks or other consumer electronics. Compatible 433MHz radio remote controls (PT2262 chipset) can be purchased inexpensively as accessories for radio-controlled sockets from DIY stores. Various switching, timer and flashing functions can easily be programmed using DIP switches.
Electronic design
The bridge rectifier BR1 and the filter capacitor C1 ensure a clean DC voltage at the input of the voltage regulator IC4. This is stabilized to 5V and is used to supply the circuit. An ATTiny4313 microcontroller serves as the core of the AS325 universal switch. It runs with an internal clock, processes the signals from infrared receiver IC5, radio receiver IC3 and button input EXT as well as button S1 and DIP switch S2 and controls the relay via resistor R1 and transistor T1. The LED D6 indicates the operating status. R6 and C8 form a low-pass filter and filter the operating voltage of the infrared receiver. The open collector output of the infrared receiver is pulled to 5 volts via the pull-up resistor R4. The output of the 433.92 MHz radio receiver is connected directly to the microcontroller. A 17.3cm (λ/4) long wire at the ANT connection point serves as the antenna. A power-free button can be connected to the EXT input. R2 serves as a pull-up resistor, R3 and the Zener diode D2 protect against overvoltage.
Assembly instructions
When designing the circuit board layout, only wired components were used on purpose to allow beginners to build a PCB successfully. Start with the small components first, i.e. resistors and diodes. A bending jig is an advantage for particularly clean work. Next, bridge rectifiers, IC sockets, film and electrolytic capacitors as well as sockets, switches, relays and antenna are assembled. The microcontroller, radio receiver and infrared receiver remain unassembled for the time being. The operating voltage can now be applied for an initial test. A current-limited laboratory power supply or a small plug-in power supply with 9 to 12 volts is suitable for this. The quiescent current consumption should be low. If not, the bridge rectifier may be reversed or the polarity of one of the electrolytic capacitors may be reversed. A DC voltage of 5 volts should be measurable between pins 20 and 10 of the IC socket. If you wish, you can connect this to pin 2 (relay switches through) or pin 19 (LED lights up) with a wire from pin 20 as a test. Now the infrared receiver and radio receiver can finally be fitted. Finally, the microcontroller is plugged into the socket. To ensure correct polarity, the notch on the IC and socket must match the marking on the component print. The system is now ready for operation.
Selecting the input
The table shows the different positions of the DIP switches. The first two switches activate the various receivers. The EXT input is always active. In mode 0 (switch position 00), the infrared and radio receivers are deactivated. In mode 1 (switch position 01) only the radio receiver is active, in mode 2 (switch position 10) only the infrared receiver is active. Remote control codes can be learned with the LEARN button. If mode 3 (switch position 11) is activated, both receivers are active. However, the learning function is disabled. Only buttons that have already been programmed can be used.
Selecting operating mode and time interval
Switch positions 3 and 4 of the DIP switch select the mode. If both switches are switched off (switch position 00), each press of a button toggles the relay. In switch position 01, one button switches the relay on and a second switches the relay off again. Please note that two buttons must always be programmed in sequence. Technically, the program distinguishes between „even“ and „odd“ for each of the 8 memories. 1, 3, 5 and 7 therefore trigger a switch-on; 2, 4, 6 and 8 trigger a switch-off. In the third operating mode (switch position 10), the last four DIP switches (5-7) can be used to program various timer functions. An exception in „Timer functions I“ is the position 0000, where the output only remains active as long as a valid signal is received. Otherwise, a valid code sets the set time, after which the relay is switched off again. A new signal restarts the interval. Manual switch-off is not possible. If the „Timer functions II“ mode (switch position 11) is selected using DIP switches 3 and 4, various blinking functions at three speed levels with four different time intervals can be selected using DIP switches 5-7. An indicator light function can also be selected, in which the output first flashes for 10 seconds and then remains switched on for the remaining time. As in „Timer functions 1“, the interval restarts when the button is pressed again.
Testing the operating mode
If no learn function is activated (DIP switches 1 and 2 are set to 00 or 11), the output can be tested in all operating modes by briefly pressing the LEARN button. In the first two operating modes (DIP switches 3 and 4 set to 00 or 01), pressing the button switches the relay; in timer modes I and II (DIP switches 3 and 4 set to 10 or 11), the interval is started (again if necessary).
Programming remote controls
If the learning function for radio or infrared receivers is active (DIP switches 1 and 2 in position 01 or 10), the microcontroller switches to learning mode after briefly pressing the LEARN button. The LED flashes slowly. The button on the remote control is then pressed. Correct reception is acknowledged by one second of rapid flashing. The remote control code is now stored in the EEPROM and is retained even if the operating voltage is removed. To program another code, you must switch to programming mode again by briefly pressing the button. If no valid code is received within one minute during learning, the learning function is aborted. This can also be triggered manually by briefly pressing the LEARN button again. If more buttons are learned than there is memory space available, the oldest codes are overwritten. To delete all codes, press and hold the LEARN button for two seconds and release it. The LED now flashes quickly. It can be canceled by briefly pressing the button. Otherwise the LED goes out after a moment. This always deletes all codes, both infrared and radio.
The EXT input
A push-button, reed contact or similar can be connected to the EXT input. It is important that it is potential-free, i.e. that it is only connected to the control unit and not to any other voltage source. Regardless of whether the programming mode is active or inactive, pressing the button on the EXT connection triggers a toggle of the relay or, in timer operating mode, a start of the interval.
Notes and additions
The QAM-RX3 receiver module originally used has been discontinued by the manufacturer. Unfortunately, it was not possible to find a replacement with the same pin assignment and number of pins. However, a radio module of type RXB12 can be used if it is mounted as shown in the picture. The antenna is connected directly to the radio module.
Suitable radio remote controls are also no longer commonly available. However, there are universal 433MHz remote controls that can be coded accordingly. This can be done using an old remote control, an Arduino or a Flipper Zero, for example, to generate the signal for the first time. The new remote control retains the learned code even after a battery change.
The IR/wireless universal switch can be combined especially well with the doorbell extension in order to cover a gap between two wired doorbells or to implement visual signaling using the flashing function. The USB Funk interface also transmits the appropriate code. The ring signal of an analog telephone line can be used at the EXT input with the TAE Connect board.