Silicon ChipSecure Remote Switch, Pt1 - December 2023 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: How our magazine is distributed
  4. Feature: The History of Electronics, Pt3 by Dr David Maddison
  5. Review: Arduino Uno R4 Minima by Jim Rowe
  6. PartShop
  7. Project: Ideal Diode Bridge Rectifiers by Phil Prosser
  8. Project: Secure Remote Switch, Pt1 by John Clarke
  9. Feature: Electronic Markets in Shenzhen by Edison Zhang
  10. Project: Multi-Channel Volume Control, Pt1 by Tim Blythman
  11. Project: Coin Cell Emulator by Tim Blythman
  12. Serviceman's Log: Mixing it up a bit by Dave Thompson
  13. Vintage Radio: Recreating Sputnik-1, Part 2 by Dr Hugo Holden
  14. Market Centre
  15. Advertising Index
  16. Notes & Errata: Breadboard PSU Display Adaptor, December 2022; 30V 2A Bench Supply Mk2, September-October 2023; 16-bit 4-input ADC, November 2023
  17. Outer Back Cover

This is only a preview of the December 2023 issue of Silicon Chip.

You can view 37 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • The History of Electronics, Pt1 (October 2023)
  • The History of Electronics, Pt1 (October 2023)
  • The History of Electronics, Pt2 (November 2023)
  • The History of Electronics, Pt2 (November 2023)
  • The History of Electronics, Pt3 (December 2023)
  • The History of Electronics, Pt3 (December 2023)
  • The History of Electronics, part one (January 2025)
  • The History of Electronics, part one (January 2025)
  • The History of Electronics, part two (February 2025)
  • The History of Electronics, part two (February 2025)
  • The History of Electronics, part three (March 2025)
  • The History of Electronics, part three (March 2025)
  • The History of Electronics, part four (April 2025)
  • The History of Electronics, part four (April 2025)
  • The History of Electronics, part five (May 2025)
  • The History of Electronics, part five (May 2025)
  • The History of Electronics, part six (June 2025)
  • The History of Electronics, part six (June 2025)
Items relevant to "Arduino Uno R4 Minima":
  • Sample software for the Arduino Uno R4 Minima (Free)
Items relevant to "Ideal Diode Bridge Rectifiers":
  • Ideal Bridge Rectifier PCB, 28mm spade version [18101241] (AUD $2.00)
  • Ideal Bridge Rectifier PCB, 21mm square PCB pin version [18101242] (AUD $2.00)
  • Ideal Bridge Rectifier PCB, 5mm pitch SIL version [18101243] (AUD $2.00)
  • Ideal Bridge Rectifier PCB, mini SOT-23 version [18101244] (AUD $1.00)
  • Ideal Bridge Rectifier PCB, standalone D2PAK SMD version [18101245] (AUD $2.50)
  • Ideal Bridge Rectifier PCB, standalone TO-220 through-hole version [18101246] (AUD $5.00)
  • Ideal Bridge Rectifier PCB, standalone TO-220 through-hole version, light copper (35um) [18101246] (AUD $2.50)
  • Ideal Bridge Rectifier kit, 28mm spade version (Component, AUD $30.00)
  • Ideal Bridge Rectifier kit, 21mm square PCB pin version (Component, AUD $30.00)
  • Ideal Bridge Rectifier kit, 5mm pitch SIL version (Component, AUD $30.00)
  • Ideal Bridge Rectifier kit, mini SOT-23 version (Component, AUD $25.00)
  • Ideal Bridge Rectifier kit, standalone D2PAK SMD version (Component, AUD $35.00)
  • Ideal Bridge Rectifier kit, standalone TO-220 through-hole version (Component, AUD $45.00)
  • Ideal Bridge Rectifier PCBs patterns (PDF download) [18101241-6] (PCB Pattern, Free)
Items relevant to "Secure Remote Switch, Pt1":
  • Secure Remote Switch receiver PCB [10109231] (AUD $5.00)
  • Secure Remote Switch transmitter PCB [10109232] (AUD $2.50)
  • Secure Remote Switch transmitter PCB [10109233] (AUD $2.50)
  • PIC16F1459-I/P programmed for the Secure Remote Switch receiver (1010923R.HEX) (Programmed Microcontroller, AUD $10.00)
  • PIC16LF15323-I/SL programmed for the Secure Remote Switch transmitter (1010923A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Secure Remote Switch receiver short-form kit (Component, AUD $35.00)
  • Secure Remote Switch transmitter short-form kit (module version) (Component, AUD $15.00)
  • Secure Remote Switch transmitter complete kit (discrete version) (Component, AUD $20.00)
  • Firmware (ASM and HEX) files for the Secure Remote Switch (Software, Free)
  • Secure Remote Switch PCB patterns (PDF download) [10109231-3] (Free)
  • Panel labels for the Secure Remote Switch (Panel Artwork, Free)
Articles in this series:
  • Secure Remote Switch, Pt1 (December 2023)
  • Secure Remote Switch, Pt1 (December 2023)
  • Secure Remote Switch, Pt2 (January 2024)
  • Secure Remote Switch, Pt2 (January 2024)
Items relevant to "Multi-Channel Volume Control, Pt1":
  • Multi-channel Volume Control volume PCB [01111221] (AUD $5.00)
  • Multi-channel Volume Control control PCB [01111222] (AUD $5.00)
  • Multi-channel Volume Control OLED PCB [01111223] (AUD $3.00)
  • PIC16F18146-I/SO programmed for the Multi-Channel Volume Control [0111122B.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F15224-I/SL programmed for the Multi-Channel Volume Control [0111122C.HEX] (Programmed Microcontroller, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 0.96in cyan OLED with SSD1306 controller (Component, AUD $10.00)
  • 2.8-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $25.00)
  • Multi-channel Volume Control control module kit (Component, AUD $50.00)
  • Multi-channel Volume Control volume module kit (Component, AUD $55.00)
  • Multi-channel Volume Control OLED module kit (Component, AUD $25.00)
  • Firmware (C and HEX) files for the Multi-Channel Volume Control (Software, Free)
  • Multi-channel Volume Control PCB patterns (PDF download) [01111221-3] (Free)
Articles in this series:
  • Multi-Channel Volume Control, Pt1 (December 2023)
  • Multi-Channel Volume Control, Pt1 (December 2023)
  • Multi-Channel Volume Control Part 2 (January 2024)
  • Multi-Channel Volume Control Part 2 (January 2024)
  • Multi-Channel Volume Control, part one (November 2024)
  • Multi-Channel Volume Control, part one (November 2024)
  • Multi-Channel Volume Control, Part 2 (December 2024)
  • Multi-Channel Volume Control, Part 2 (December 2024)
Items relevant to "Coin Cell Emulator":
  • Coin Cell Emulator PCB [18101231] (AUD $5.00)
  • PIC16F18146-I/SO‎ programmed for the Coin Cell Emulator [1810123A.HEX] (Programmed Microcontroller, AUD $10.00)
  • 1.3-inch blue OLED with 4-pin I²C interface (Component, AUD $15.00)
  • 1.3-inch white OLED with 4-pin I²C interface (Component, AUD $15.00)
  • Coin Cell Emulator kit (Component, AUD $30.00)
  • Firmware (C and HEX) files for the Coin Cell Emulator [1810123A.HEX] (Software, Free)
  • Coin Cell Emulator PCB pattern (PDF download) [18101231] (Free)
Items relevant to "Recreating Sputnik-1, Part 2":
  • Sputnik design documents and Manipulator sound recording (Software, Free)
Articles in this series:
  • Recreating Sputnik-1, Part 1 (November 2023)
  • Recreating Sputnik-1, Part 1 (November 2023)
  • Recreating Sputnik-1, Part 2 (December 2023)
  • Recreating Sputnik-1, Part 2 (December 2023)

Purchase a printed copy of this issue for $12.50.

Part 1 of John Clarke’s Secure Remote Switch This UHF remote switch uses a secure rolling code system. The receiver uses all through-hole parts, fits in a compact plastic case and can be powered from 12V or 24V DC. Up to 16 transmitters can be used per receiver; they fit into handy keyfob cases, and you can use a prebuilt transmitter module or discrete components. T his project is an update to the Secure Remote Mains Switch described in the July & August 2022 issues. It uses the same rolling code system but the receiver is smaller and simpler; it is designed with a DC power supply and low-voltage switching in mind. That makes it ideal for applications like a garage door controller. Finding new remotes compatible with many garage door controllers can be challenging. However, most controllers have terminals for the external triggering of the garage door, and many also have 12V or 24V power outputs. That means you can build the Secure Remote Switch, wire it to your garage door controller and add up to 16 more remotes! Other potential applications include gate control, remote operation of door strikes or switching DC-powered Transmitter » » » » » » » » » » » Professional keyfob enclosure Secure rolling code communication Up to 16 transmitters per receiver Powered by a 12V 55mAh A23 battery, giving more than two years of life with typical use Range: 22m line-of-sight Standby current: typically 3μA (26mAh/year) Transmitting current: 10mA average over 1s (2.77μAh per transmission) Registration current: 10mA average over 2.75s (7.6μAh per registration) Transmission rate: 976.5 bits/s (1.024ms per bit) Data encoding: Manchester code with a transmission time of 82ms Unique code generation: secure UHF rolling code control with 48-bit seed, 24-bit multiplier and 8-bit increment value Receiver » » » » 42 12V or 24V DC operation Supply current: 15mA with relay off, 45mA with relay on Relay contact rating: 10A (can handle up to 60V DC/42V AC) Relay-on timer range: 250ms to 4.5h (see Tables 1 & 4) Silicon Chip Australia's electronics magazine appliances on and off, such as water pumps, fans, LED lights etc. It is compatible with most 12V or 24V solar power systems or can run from mains power via a suitable supply. The transmitters have also been redesigned compared to the 2022 project. There are now two versions: one that uses a prebuilt 433.9MHz transmitter module and another which is slightly cheaper to build and uses all discrete parts for those who like to ‘roll their own’. Also, the transmitter fits into a nice little keyfob case that we will supply in kits for the transmitters. We’ll have kits for the discrete and module-based versions; the discrete kits are complete, while the module-based kits come with everything but the transmitter module, for compliance reasons (you can get it from Jaycar or Altronics). The new transmitters also use small A23 alkaline batteries rather than lithium coin cells; this is mainly due to the design of the cases, but it has the advantage that the quality of A23 alkaline batteries is more consistent than lithium coin cells. This also avoids the serious ingestion hazard that coin cells pose for small children. The discrete transmitter circuit is based on the Remote Control Range siliconchip.com.au The receiver switches an onboard SPDT relay when triggered, either for a fixed time or toggled with each button press. Extender (January 2022; siliconchip. au/Article/15182). However, in that design, tiny components were used (some as small as 0.6 × 0.3mm!), which made it a real challenge to assemble, even for us. This time, we have used much larger components that are easier to solder, so only modest soldering skills are required. Low-voltage switching This design can only directly switch low voltages. You have two options if you require a remote switch that controls mains voltage. The simplest is to build the Secure Mains Switch described in the July and August 2022 issues (siliconchip.com.au/ Series/383). That project is still perfectly valid, and you can use the transmitters described here with the Mains Switch receiver if you want to. Alternatively, you can use the onboard relay in this design to switch 12V or 24V DC to an external mainsrated relay. It will need to be in its own box with suitable mains connectors, wiring and insulation. We have decided also to offer a short-form kit for the receiver. You’ll need to get a handful of parts yourself, like the case and a few switches, but the kit will save you time and effort siliconchip.com.au gathering the parts to build the Secure Remote Switch. Security The Secure Remote Switch uses rolling code wireless transmission to ensure security. That makes it very difficult for someone to trigger the relay on the receiver without having one of your registered remotes. So if it is used to trigger remote-controlled doors, gates and door strikes, the security of your home or premises is maintained. While secure codes are required for security applications, they also ensure that a similar remote control does not inadvertently switch your appliance on or off. This could happen due to someone close by controlling their own equipment. We’ve experienced spurious operation of security shutters that we think must have been due to someone using a different remote nearby. That’s almost impossible with a rolling code system! Other controls will not operate the Switch because the transmitter and receiver must be paired before they will work together. Additionally, the code sent between the transmitter and receiver changes each time it is used. That thwarts anyone who might try to capture the code and subsequently Australia's electronics magazine resend it in an attempt to control the Switch. Since the captured code immediately becomes obsolete after use, the Switch will not respond if it is repeated. You can also build more than one Switch without being concerned about interference between them. The unique transmission code ensures that the Switch receiver will not be activated by anything other than one of the paired handheld remote controls. The remote control code sent by the handheld remote units can be considered an electronic lock similar to a physical key, except that the key and lock combination changes each time it is used. For the Switch, this key is a specific code the transmitter sends to the receiver. It comprises a long digital data sequence sent in a particular order over a set period. The code must be correct for the receiver to respond. With a fixed remote control code, an intending thief can receive and store the code sent by the remote control and re-transmit it in an attempt to operate the receiver. However, with a rolling code, the reused code will not trigger the receiver because it requires a different code each time. Each code that’s transmitted differs markedly from one transmission to the next. The codes sent are based on an algorithm (calculation) the transmitter and receiver have in common. An initial seed value is based on a Microchip Unique Identifier (MUI) value in the transmitter IC. This IC produces a unique set of values that is synchronised with the receiver during registration. These values change each time the Switch is used. Since the handheld remote will have a unique identifier different from any other handheld remote, the uniqueness of the code is ensured. The odds of picking a correct code at random for our rolling code Receiver short-form kit (SC6835, $35): comes with the PCB and most onboard components, including a 12V or 24V relay (specify), except receiver module RX1, switches S1 & S5 and the case. Discrete transmitter complete kit (SC6836, $20.00): comes with all parts including the case. Module-based transmitter short-form kit (SC6837, $15.00): comes with all parts except the transmitter module but including the case. December 2023  43 Parts List – Secure Remote Switch (Transmitter) 1 Supertronic PP43 keyfob enclosure 1 A23 12V battery 1 PIC16LF15323-I/SL programmed with 1010923A.HEX, SOIC-14 (IC1) 1 MCP1703-3302E/DB 3.3V low-dropout regulator, SOT-223 (REG1) [element14 2113888] 1 1N5819 40V 1A schottky diode (D1) 3 SPST two-pin momentary PCB-mount tactile switches (S1-S3) [Jaycar SP0611, Altronics S1127] 1 3mm high-brightness red or green LED (LED1) 2 1μF 25V SMD X7R ceramic capacitors, M3216/1206 size 2 100nF 50V SMD X7R ceramic capacitors, M3216/1206 size 1 220W 1% SMD resistor, M3216/1206 size – up to 16 transmitters can be used per receiver Extra parts for the module-based version 1 double-sided PCB coded 10109232, 29.8 × 39.4mm 1 433.9MHz UHF ASK transmitter module (TX1) [Jaycar ZW3100, Altronics Z6900] 1 147mm length of 0.8mm enamelled copper wire Extra parts for the discrete version 1 double-sided PCB coded 10109233, 29.8 × 39.4mm 1 MICRF113YM6 UHF ASK transmitter, SOT-23-6 (IC2) [element14 2810141] 1 13.56MHz 5 x 3.2mm SMD crystal (X1) [element14 1611805] 1 470nH SMD inductor, 610MHz SRF, M2012/0805 size (L1) [Coilcraft 0805HT-R47TJLB; element14 2286517] 1 68nH SMD inductor, 1.7GHz SRF, M1608/0603 size (L2) [Coilcraft 0603CS-68NXJLU; element14 2286005] 1 1μF 25V SMD X7R ceramic capacitor, M3216/1206 size 2 18pF 50V SMD C0G/NP0 ceramic capacitors, M3216/1206 size 1 12pF 50V SMD C0G/NP0 ceramic capacitor, M3216/1206 size 1 5pF 50V SMD C0G/NP0 ceramic capacitor, M3216/1206 size 1 167mm length of 0.8mm diameter enamelled copper wire transmitter is one in 2.8 trillion, making any attempt to break the code by sending out guessed codes unrealistic. The code must also be sent at the correct data rate, with the correct start and stop bit codes and other transmission requirements, including data scrambling that changes for each transmission. Other features Our Switch system has two parts: a professional keyfob-style transmitter and a separate receiver. The keyfob has three pushbutton switches and an acknowledge LED that briefly lights each time one of the switches is pressed. Up to 16 different keyfob transmitters can be used with one receiver. The receiver has a 10A-rated relay, making it suitable for switching many items. Relays with even higher ratings (eg, 16A) are available if needed. The relay can be controlled by a remote control or a switch on the receiver, and either way, it can be toggled on and off, or switched on for a fixed time. The on-period can be adjusted from 250ms to 4.5 hours in two ranges. Security and registration Each keyfob transmitter is allocated an Identity number from 0 to 15, set by coding links on the PCB. Each transmitter is registered to the receiver by sending a synchronising code to the receiver when the receiver is in registration or learning mode. A facility is included to lock out a particular transmitter after registration. This is useful if a transmitter has been lost. If the lost transmitter is found, it can be easily re-registered. If the identity of the lost transmitter is not known, all transmitters can be locked out, and the ones still in use can be re-registered. Circuit details Fig.1: in the module-based transmitter circuit, microcontroller IC1 monitors buttons S1-S3. When one is pressed, it lights LED1, powers up the transmitter module by bringing its pins 8 and 9 high, then produces the ASK data to transmit at its pin 3. When finished, it brings pins 5, 8 and 9 low again and returns to sleep mode. 44 Silicon Chip Australia's electronics magazine The transmitter circuits are shown in Figs.1 & 2. They have many common parts; each mainly comprises a microcontroller, IC1, and a 433.9MHz UHF transmitter. The UHF transmitter can be either a prebuilt module (Fig.1) or a discrete circuit using a Micrel UHF transmitter IC and associated inductors and capacitors (Fig.2). Both versions have the same transmission range and fit into the same keyfob enclosure. So which version you wish to build depends on whether siliconchip.com.au you prefer to source the module or solder the discrete parts onto the PCB. The discrete version does have the advantage of potentially being less costly. Both versions utilise a similar wire coil antenna. The PIC16LF15323 was chosen for IC1 due to its very low standby current and the inclusion of a unique identifier called the Microchip Unique Identifier (MUI). We use the MUI to generate a unique rolling code sequence for each IC; no two transmitters will have the same sequence. IC1 is usually kept in sleep mode with its internal oscillator stopped and most of its internal circuitry switched off. Switches S1, S2 and S3 connect to the RA5, RC4 and RC3 digital inputs of IC1, which have internal pullup currents enabled, so those pins are usually high but are pulled low when a button is pressed. The Identity links (1, 2, 4 & 8) connect to the RA0, RA1, RA2 and RC0 digital inputs, respectively. These are used to differentiate between multiple transmitters used with a given receiver. If only one transmitter is used, it can be set to Identity 0, so none of the Identity pins need to be connected to ground. At power-up, each Identity input is held high by pullup currents/resistors (within IC1) to the 3.3V rail, similar to the pushbutton inputs. The software then switches off the pullup current for any identity input that is found to The module-based (left) and discrete (right) versions of the transmitter PCB shown enlarged. We have used an A23 12V battery, which fits snugly with the recommended battery clips. be at a low level. That prevents the IC from continuously sourcing current from those pins, which would otherwise add some 25-200μA battery draw per Identity input that’s tied low. The pullups for pushbutton switches S1-S3 are left on permanently since they are only pressed momentarily. IC1 is programmed to wake up from its sleep condition when any one of switches S1-S3 is pressed and the corresponding input goes low. It then runs the program to send the rolling code for the function associated with the pressed switch. When a button is pressed, the micro drives its RC2 and RC1 digital outputs high, to 3.3V. These are connected in parallel to power the UHF transmitter (module or discrete components). This way, UHF transmit circuitry only draws current from the battery when it is in use. With the transmitter powered up, IC1 sends the rolling code and registration codes on the data line from its digital output RA4 (pin 3). This feeds the data input of the UHF circuitry. UHF code transmission switches between two different carrier wave amplitudes, a technique known as amplitude shift keying (ASK). In this case, there is no UHF transmission when the digital signal is low, but the 433.92MHz carrier is transmitted when the digital signal is high. After sending the code, IC1 powers down the UHF transmitter and returns to sleep mode. Discrete UHF circuitry Referring to the additional UHF transmission circuitry in Fig.2, the MICRF113 is a single-chip ASK UHF transmitter IC. Its transmission frequency is set using a crystal oscillator multiplied by 32 within IC2 to produce the UHF carrier. So the 13.56MHz crystal results in a 433.92MHz carrier. This matches the carrier frequency used by most UHF ASK transmitter/receiver modules available for Fig.2: the left side of the discrete version of the transmitter circuit is identical to Fig.1. This time, the MICRF113 ASK IC generates a 433.9MHz carrier from the 13.56MHz crystal and switches it on and off based on the digital signal at its ASK input (pin 6). Inductor L1 is its output load, while L2 and the 12pF & 5pF capacitors filter out unwanted harmonics. siliconchip.com.au Australia's electronics magazine December 2023  45 Parts List – Secure Remote Switch (Receiver) 1 double-sided plated-through PCB coded 10109231, 70 × 96.5mm 1 set of front and rear panel labels 1 Ritec 105 × 80 × 33mm plastic enclosure [Altronics H0191] 1 433.9MHz UHF ASK receiver (RX1) [Jaycar ZW3102, Altronics Z6905A] 1 10A SPDT relay (12V or 24V coil) (RLY1) [Jaycar SY4066 (12V) / SY4067 (24V), Altronics S4160C (12V) / S4162C (24V)] 1 subminiature SPDT PCB-mount momentary horizontal pushbutton switch (S1) [Altronics S1498] 1 button cap for S1 [Altronics S1481] 2 SPST PCB-mount tactile micro switches (S2, S3) [Jaycar SP0600, Altronics S1120] 1 4-bit (0-9 & A-F) 6-pin BCD PCB-mount rotary switch (S4) [Jaycar SR1220, Altronics S3000A] 1 subminiature SPDT PCB-mount horizontal toggle switch (S5) [Altronics S1421] 1 PCB-mount barrel socket, 2.1mm or 2.5mm inner diameter (CON1) 1 2-way screw terminal, 5/5.08mm pitch (CON2) 1 3-way screw terminal, 5/5.08mm pitch (CON3) 1 10kW miniature single-turn top-adjust trimpot (code 103) (VR1) 3 2-way pin headers, 2.54mm pitch (JP1-JP3) 3 jumper shunts (JP1-JP3) 1 20-pin DIL IC socket (for IC1) 1 PG7 (3-6.5mm cable) or PG9 (4-8mm cable) cable gland for rear panel 1 169mm length of 0.8mm diameter enamelled copper wire 1 169mm length of 1mm diameter heatshrink tubing (optional) Semiconductors 1 PIC16F1459-I/P programmed with 1010923R.HEX, DIP-20 (IC1) 1 7805 5V 1A linear regulator, TO-220 (REG1) 1 BC337 500mA NPN transistor, TO-92 (Q1) 2 1N4004 400V 1A diodes, DO-41 (D1, D2) 1 3mm high-brightness red LED (LED1) 2 5mm high-brightness LEDs (eg, red & green) (LED2, LED3) Capacitors 1 100μF 25V PC electrolytic ● 1 100μF 16V PC electrolytic 1 10μF 35V PC electrolytic ● 2 100nF MKT polyester or ceramic (code 104 or 100n) ● can be 16V rated for 12V supply Resistors (all 1/4W, 1% metal film unless noted) 5 10kW 3 560W 1 330W 470W 1W for 24V supply, 100W 1/2W for 12V supply (R1) low-power UHF data transmission. IC2’s power rail at pin 3 is bypassed with 100nF & 1μF ceramic capacitors while the supply current for IC2’s RF output stage is via a 470nH inductor acting as a driver load. The following 12pF series capacitor and 68nH inductor plus the 5pF capacitor to ground act as a filter to remove second and third harmonics from the UHF signal before it passes to the antenna. Any inductor used for the output stage and filter circuit must have a self-resonance (SR) frequency above 433.92MHz; otherwise, it will not function as an inductor at that frequency. This is a critical requirement for any substitute components to those specified in the parts list. Power supply In both cases, IC1 is powered using an A23 12V battery and a 3.3V low-­ quiescent-current low-dropout voltage regulator (REG1). This supplies the UHF transmitter section as well as the microcontroller. REG1 typically draws a 2μA quiescent current at 25°C, although that could be as high as 5μA over the range of -40°C to +125°C. With IC1 in sleep mode, it draws a typical standby current of 60nA from its 3.3V supply and so can essentially be ignored compared to the regulator’s quiescent current. We measured the quiescent current draw from the 12V battery on our two prototypes at 2.7μA and 3μA, respectively. When a switch is pressed on the transmitter, that increases but only briefly, so that does not affect the longterm battery life much. During transmission, the current draw from the battery briefly rises to about 10mA. If you keep holding one of the buttons down after the transmission is complete, the current will drop to about 220μA until the button is released. This is due to the pushbutton switch pullup current. Considering the low quiescent current and intermittent bursts of higher current when transmitting, battery life should be more than two years with typical use. Receiver circuit The rear of the receiver case includes the power socket and cable glands for wiring to the relay terminals. 46 Silicon Chip Australia's electronics magazine The receiver circuit (Fig.3) uses a PIC16F1459-I/P microcontroller (IC1) and UHF receiver module with an onboard wire antenna to provide a good reception range. When no signal is present, the siliconchip.com.au receiver’s output produces random noise since the module’s automatic gain control (AGC) is at its maximum. Upon reception of a 433.92MHz signal, the receiver gain is reduced for best reception without overload, and the coded signal from the data output of the module is delivered to the RC7 digital input of IC1 (pin 9). IC1 flashes the Acknowledge LED (LED2) whenever a valid signal is received. This also doubles as a relay-on indicator. It is lit when the relay is on and off when the relay is off. The RC5 digital output of IC1 (pin 5) drives NPN transistor Q1, which switches the relay coil. When RC5 goes high, it delivers current to transistor Q1’s base, and Q1 powers RLY1. Diode D2 clamps the back-EMF that causes a voltage spike at the collector of Q1 as the relay switches off. The relay contacts are rated at 10A for AC or DC. The unit can be set up to power the relay for a fixed period when a transmitter button is pressed (or S1 on the receiver) or toggle it on or off for each button press. This on/off functionality can be set differently for the transmitter buttons and the onboard pushbutton, S1. Since the transmitters have three buttons, they can provide different functions (more on that shortly). When jumper JP3 is closed, the relay switches on with one press of onboard button S1 and off with the next. When JP3 is open, the relay is switched on for a fixed time with a press of S1 and switches off automatically at the end of this period – see Table 3. The remote control has three buttons; usually, S1 on the remote switches the relay on, and it is then switched off with the timer. S2 switches it on continuously (or for a much longer time if JP2 is inserted), and S3 switches it off – see Table 2. The timer period is set using trimpot VR1. The trimpot wiper can be Table 1 – JP1 timer settings JP1 Timer range Out 0.25-60s (1x) In 1m-4.5h (255x) Table 2 – JP2 settings TX Function with Function button JP2 out with JP2 in S1 Relay on with Relay on a timer, range with a timer, per JP1 0.25-60s S2 Relay on continuously Relay on with a timer, 1m-4.5h S3 Relay off Relay off adjusted from 0V through to 5V; this voltage is monitored at the AN6 analog input of IC1, which converts the voltage into setting a period from 0.25 seconds to 60 seconds or one minute to four hours and 30 minutes, depending on the settings of JP1 & JP2 (see Tables 1 & 2). Fig.3: the receiver circuit is based on a prebuilt 433.9MHz receiver module, shown at left, and a 20-pin 8-bit PIC microcontroller, IC1. When IC1 receives a valid rolling code, it brings its pin 5 high to power NPN transistor Q1 which switches the relay coil. The relay is a 12V or 24V DC coil type to match the supply voltage. siliconchip.com.au Australia's electronics magazine December 2023  47 Table 3 – JP3 settings JP3 Onboard S1 function Rolling code transmission format The rolling code is transmitted using UHF ASK in Manchester code. A zerobit is sent as a 512μs period of no transmission followed by a 512μs burst of 433.9MHz carrier. In contrast, a one-bit is transmitted as a 512μs burst of 433.9MHz carrier followed by a 512μs period of no signal. Each transmission consists of four start bits, an eight-bit identifier, a 48-bit code and four stop bits, for a total of 64 bits. The start bits include a 16.4ms gap between the second and third start bit, while the code scramble value is altered on each transmission with 32 variations. Unique codes are generated with a 48-bit seed, 24-bit multiplier & 8-bit increment value. That is initially set by a unique identifier within IC1 on the transmitter. The registration code is sent as two blocks. Block 1 sends four start bits, the eight-bit identifier, a 32-bit seed code and four stop bits. Block 2 sends four start bits, the 24-bit multiplier, the eight-bit increment and eight-bit scramble values and four stop bits. Again, the start bits include a 16.4ms gap between the second and third start bit. IC1’s digital input RC0 for JP1 has an external 10kW pullup resistor. If JP1 is inserted, this pin is held low. IC1 senses that and, in that case, changes the maximum timer setting from one minute to 4 hours and 30 minutes. You can monitor the timer setting voltage between test points TP1 and GND. Table 4 shows the typical periods for five different voltages in each range. Transmitter Identity The receiver Identity selection is made using a BCD rotary switch (S4) with 16 positions, labelled 0-9 and then A-F. Those hexadecimal values correspond to 0-15 in decimal, with A-F representing 10-15. This switch is only monitored by IC1 for lockout Out Off if already on, otherwise on for a time set by JP1 and VR1 (see Table 1) In Toggle on/off Table 4 – period vs TP1 voltage TP1 Time with JP1 out 0V 0.25s Time with JP1 in 1m 1.25V 15s 1h 7.5m 2.5V 30s 2h 15m 3.75V 45s 5V 60s 3h 22.5m 4h 30m selections; it plays no part in the keyfob transmitter registration. S4’s four contacts connect to the RB7, RB6, RB5 and RB4 digital inputs of IC1. These all have internal pullups, so the inputs are at 5V when the corresponding switch is not closed. All four inputs are high when the BCD switch is set at 0. Position 1 on the switch has the ‘1’ output at RB7 pulled low, while position 15 (or F) sets all four pins to 0V. be acknowledged by the Learn/Clear LED (LED1) lighting. Table 5 shows the identity selection coding for both the transmitter and receiver. The Learn switch (S2) tells the program within IC1 to be ready to accept the synchronising signal from a handheld remote. The Learn/Clear LED (LED1) stays lit while waiting for a signal from the remote unit. It extinguishes once the synchronising signal has been correctly received. Deregistration & registration Power supply S3 is used for deregistering a transmitter. Pressing S3 for more than one second will deregister the transmitter specified by the BCD switch, preventing it from operating the receiver again. Successful deregistration will Receiver Transmitter Transmitter Transmitter Transmitter S4 ‘1’ ‘2’ ‘4’ ‘8’ 0 open open open open 1 shorted open open open 2 open shorted open open 3 shorted shorted open open 4 open open shorted open 5 shorted open shorted open 6 open shorted shorted open 7 shorted shorted shorted open 8 open open open closed 9 shorted open open closed A (10) open shorted open shorted B (11) shorted shorted open shorted C (12) open open shorted shorted D (13) shorted open shorted shorted E (14) open shorted shorted shorted The receiver can be powered from 12V or 24V DC, from a DC plugpack or similar DC supply; some garage door controllers have DC supply terminals that could also be used. Regardless of the source, power can be connected via CON1 (a barrel socket) or two-way screw terminal CON2. Reverse polarity protection is via diode D1, which only allows current to flow into the circuit if the supply polarity is correct. The relay has a 12V or 24V DC coil, matching supply voltage. For 24V, a 470W 1W resistor (R1) reduces the voltage applied to 5V regulator REG1. For a 12V DC input, a 100W ½W resistor is used instead. The 470W resistor reduces the dissipation in REG1 when the supply is at 24V. This resistor also filters the DC supply to REG1 in conjunction with the 100μF input capacitor, removing most of the noise from a switchmode supply that could otherwise affect the UHF receiver sensitivity. Note that for a 24V DC supply, the 100μF capacitor is rated at 25V, and the 10μF capacitor bypassing the relay supply is 35V. For a 12V supply, the capacitors can all be rated at 16V. SC F (15) shorted shorted shorted shorted siliconchip.com.au Table 5 – Transmitter Identity selection