Silicon ChipSteering Wheel Audio Button to Infrared Adaptor - June 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Will 5G mobile networks live up to the hype?
  4. Feature: From a knotted rope to side-scanning SONAR by Dr David Maddison
  5. Project: An AM/FM/CW Scanning HF/VHF RF Signal Generator by Andrew Woodfield, ZL2PD
  6. Feature: e-Paper displays: no paper involved! by Tim Blythman
  7. Project: Steering Wheel Audio Button to Infrared Adaptor by John Clarke
  8. Product Showcase
  9. Serviceman's Log: Fixing a “Cheap as” set of cans by Dave Thompson
  10. Project: Very accurate speedo, car clock & auto volume change by Tim Blythman
  11. Project: DSP Active Crossover and 8-channel Parametric Equaliser, part two by Phil Prosser & Nicholas Vinen
  12. Feature: El Cheapo Modules: Long Range (LoRa) Transceivers by Jim Rowe
  13. Subscriptions
  14. Vintage Radio: AWA Radiola Model 137 by Rob Leplaw
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: DSP Active Crossover/Parametric Equaliser, May 2019
  19. Outer Back Cover: Hare & Forbes

This is only a preview of the June 2019 issue of Silicon Chip.

You can view 39 of the 112 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.

Items relevant to "An AM/FM/CW Scanning HF/VHF RF Signal Generator":
  • AM/FM/CW Scanning HF/VHF RF Signal Generator PCB [04106191] (AUD $15.00)
  • ATmega328P programmed with the firmware for the RF Signal Generator [0410619A.HEX] (V14) (Programmed Microcontroller, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • Firmware for the RF Signal Generator [0410619A.HEX] (Software, Free)
  • AM/FM/CW Scanning HF/VHF RF Signal Generator PCB pattern (PDF download) [05105191] (Free)
  • AM/FM/CW Scanning HF/VHF RF Signal Generator panel artwork, cutting diagrams and STL files (downloads) (Free)
Articles in this series:
  • An AM/FM/CW Scanning HF/VHF RF Signal Generator (June 2019)
  • An AM/FM/CW Scanning HF/VHF RF Signal Generator (June 2019)
  • Building the RF Signal Generator (Part 2) (July 2019)
  • Building the RF Signal Generator (Part 2) (July 2019)
Items relevant to "e-Paper displays: no paper involved!":
  • Demonstration software for the e-Paper/e-Ink article (Free)
Items relevant to "Steering Wheel Audio Button to Infrared Adaptor":
  • Steering Wheel Controller to IR PCB [05105191] (AUD $5.00)
  • PIC12F617-I/P programmed for the Steering Wheel Controller to IR project [1510519A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Steering Wheel Controller to IR adaptor [1510519A.HEX] (Software, Free)
  • Steering Wheel Controller to IR PCB pattern (PDF download) [05105191] (Free)
  • Steering Wheel Controller to IR lid panel artwork (PDF download) (Free)
Items relevant to "Very accurate speedo, car clock & auto volume change":
  • GPS "Finesaver Plus" Speedo/Clock/Volume Control PCB [01104191] (AUD $7.50)
  • PIC16F1455-I/P programmed for the GPS "Finesaver Plus" Speedo/Clock/Volume Control [0110419A.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)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • MCP4251-502E/P dual 5kΩ digital potentiometer (Component, AUD $3.00)
  • Spare cable for VK2828U7G5LF GPS module (Component, AUD $1.00)
  • Laser-cut acrylic case pieces for the GPS "Finesaver Plus" Speedo/Clock/Volume Control (PCB, AUD $10.00)
  • Firmware (C and HEX) files for the GPS "Finesaver Plus" Speedo/Clock/Volume Control [0110419A.HEX] (Software, Free)
  • GPS "Finesaver Plus" Speedo/Clock/Volume Control PCB pattern (PDF download) [01104191] (Free)
Items relevant to "DSP Active Crossover and 8-channel Parametric Equaliser, part two":
  • DSP Crossover CPU PCB [01106193] (AUD $5.00)
  • DSP Crossover LCD Adaptor PCB [01106196] (AUD $2.50)
  • DSP Crossover front panel control PCB [01106195] (AUD $5.00)
  • DSP Crossover DAC PCB [01106192] (AUD $7.50)
  • DSP Crossover power supply PCB [01106194] (AUD $7.50)
  • DSP Crossover ADC PCB [01106191] (AUD $7.50)
  • DSP Active Crossover complete PCB set (7 boards) [01106191-6] (AUD $40.00)
  • PIC32MZ2048EFH064-250I/PT programmed for the DSP Active Crossover/Equaliser (V8) (Programmed Microcontroller, AUD $30.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • Firmware and source code for the DSP Active Crossover/Equaliser project [0610619A.HEX] (Software, Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (Free)
Articles in this series:
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
Items relevant to "El Cheapo Modules: Long Range (LoRa) Transceivers":
  • Sample code for El Cheapo Modules - 434MHz LoRa Transceivers (Software, Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)

Purchase a printed copy of this issue for $10.00.

Updating your car entertainment system? You will probably need this Steering Wheel audio BUTTON TO INFRARED Adaptor by John Clarke If you upgrade the radio or ‘infotainment’ head unit in a car with push-button steering wheel controls, those controls may stop working. That’s because many aftermarket head units do not support steering wheel controls, the implementation of which often varies between manufacturers and even between models. This adaptor lets you use most of those very handy controls with a wide range of aftermarket head units. O nce upon a time (would you believe way back in 1930?) car manufacturers started fitting car radios. Nothing fancy, mind you – just a basic AM receiver. Over the years, buyers demanded more: push-button tuning, FM tuners, 8-track players, cassette players, CD/DVD players and so on. In more recent times, we’ve seen that expand to include auxiliary inputs, USB and SD-card readers, Bluetooth and even inbuilt navigation systems. To control all this technology, “head units” were created – essentially a dedicated computer in its own right – with not just the source but such things as volume, radio station, track selection and more selected via push- buttons and, becoming more popular, an infrared remote control. And then someone got the bright siliconchip.com.au idea to incorporate those push-buttons into the steering wheel – and the Steering Wheel Controller (SWC) was born, offering remote control without taking your eyes off the road for very long (if at all). Some head units incorporate a remote control input wire at the rear of the unit and are operated via a voltage or digital signal. Fortunately, with our adaptor it doesn’t matter which system the head unit supports (if any) – just so long as it also offers infrared remote control. Almost all modern head units do. These handheld remotes are small and fiddly to use, and we don’t recommend that they’re used by the driver because they are too distracting. That’s if the driver can find it in the first place: they have the annoying habit of falling down between the seats! Australia’s electronics magazine Our SWC Adaptor can operate the head unit using infrared control and it is, in turn, controlled by the steering wheel buttons. So you don’t even need to open up your head unit to use it. You can feed the IR control signals in through the faceplate. Note that some SWCs are digital; they may be connected via a Controller Area Network (CAN) bus or a proprietary system. These are not suitable for use with this adaptor. It works with controls where each switch connects a different resistance between a particular wire and chassis (0V) when pressed. Before embarking on this project, it would be wise to check that your steering wheel controls are suitable for use with the SWC Adaptor. See the panel entitled “Are your steering wheel controls suitable?” June 2019  45 Features • Compact unit, can be hidden away under or behind the dash or even inside the head unit • Works with up to 10 resistancebased steering wheel buttons • Controls head unit via infrared signals (requires remote control capability) • Works with most head units (using NEC, Sony or RC5 infrared codes) • Infrared receiver included for programming the function of each button • Easy set-up by learning remote control codes for each steering wheel button • Optional unmodulated infrared output for direct wire connection We housed the adaptor in one of Jaycar’s flanged UB5 Jiffy boxes (Cat HB6016) because it makes mounting that much easier. • Two non-repeat buttons for special functions (see text) The only other requirement is that head unit uses one of these three infrared remote control protocols: NEC, Sony or Philips RC5. Virtually all head units with remote control use one of those three. By far the most common is the NEC format. This is used by most head units manufactured in Asia including Pioneer, Akai, Hitachi, Kenwood, Teac, and Yamaha plus Germany-based Blaupunkt. The Sony protocol is the next most common. The RC5 format is used by Philips and some other European brands, although we have seen some Philips products which use the Sony format Presentation The SWC Adaptor comprises a small PCB which can fit into a small Jiffy box. It’s connected to an ignition-switched 12V supply and the steering wheel control wire. It provides two outputs: one to drive an infrared LED to operate the head unit, and a second for an optional direct wire connection which can control the head unit directly, without the need for an infrared trans- mitter. More on that later. In use, the SWC Adaptor can be programmed to map up to ten steering wheel buttons to separate infrared codes to send to the head unit. Once programmed, it can be hidden away (eg, under or behind the dash) and the steering wheel buttons can be used to control the head unit while the vehicle ignition is on. Circuit description Fig.1 shows the circuit of the SWC Adaptor. It is based around microcontroller IC1, a PIC12F617-I/P. This mon- Are your steering wheel controls suitable? Before deciding to build the SWC Adaptor, you will need to check that the steering wheel control switches are the type that switch in a resistance rather than digital types that produce a series of digital (on and off) signals when the switch is pressed. We also assume that the head unit you intend to use has infrared remote control and uses one of the standard protocols as mentioned in the article. To check the SWC switches, your original equipment head unit will offer clues as to which wire this is. There should be a connection diagram on the head unit. Or you can find the wire using a vehicle wiring diagram. With the ignition off and the SWC wire not connected to the head unit, connect your multimeter leads between that wire and vehicle chassis. Set the multimeter to read resistance. The resistance may read very high ohms when the SWC switches are all open or 46 Silicon Chip it may be a few thousand ohms. Pressing each SWC switch in turn should show a different resistance reading. For example, our test vehicle showed a resistance of 3.5kwith all switches open. Then the switch readings were 160, 79, 280, 450, 778and 1.46kfor each of the six switches. So these readings prove that the steering wheel controls are the analog type that switch in resistance and so is suitable for use with the SWC Adaptor. If you do not get resistance changes, check that you are monitoring the correct wire and that the chassis connection is good. If the switches still do not show resistance, they might be producing a digital signal when the vehicle ignition is on. The steering wheel controls on your vehicle are therefore not suitable for use with the SWC Adaptor. Australia’s electronics magazine siliconchip.com.au INSIDE STEERING WHEEL/ COLUMN Fig.1: IC1 monitors the steering wheel controls via analog input AN3, while also sensing tolerance adjustment trimpot (VR1) at analog input AN1. The state of switch S1 is monitored at digital input GP5 and the signal from infrared receiver IRD1is monitored at digital input GP3. To control the vehicle head unit, IC1 produces remote control code pulses at its pin 5 PWM output. These codes are transmitted in 36-40kHz bursts, to drive infrared LED3. An identical, non-modulated signal is also sent to the GP0 digital output (pin 7). This has the advantage that you can wire it in place of the infrared receiver, for a direct wired connection to the head unit. itors the steering wheel controls via analog input AN3, while also sensing tolerance adjustment trimpot (VR1) at analog input AN1, the state of switch S1 at digital input GP5 and the signal from infrared receiver IRD1 at digital input GP3. To control the vehicle head unit, IC1 produces remote control code pulses at its pin 5 PWM output. These codes are transmitted in 36-40kHz bursts, to drive infrared LED3. An identical, nonmodulated signal is also sent to the GP0 digital output (pin 7). This has the advantage that you can wire it in place of the infrared receiver, for a direct wired connection to the head unit. The exact modulation frequency depends on the infrared protocol that the unit is set up for. It is 36kHz for the Philips RC5 protocol, 38kHz for the NEC protocol and 40kHz for the Sony protocol. In more detail, the SWC input at CON1 has a 1kpull-up resistor to the 5V supply. This forms a voltage divider across the 5V supply, in combination with the steering wheel switch siliconchip.com.au resistances, giving a different voltage at analog input AN3 (pin 3) of IC1 for each switch that is pressed. This voltage is applied to the AN3 input via a low pass filter comprising a 2.2kresistor and 100nF capacitor. IC1 converts the 0-5V voltage to a digital value between 0 and 255. So for example, a 2.5V signal would be converted to a value of 127 or 128, around half of the maximum value of 255. As for the AN1 input, the 0-5V from trimpot VR1’s wiper is converted to a digital value. The 0-5V range of VR1 is mapped in software to a 0-500mV range of tolerance. So If VR1 is set midway at 2.5V, the tolerance setting is 250mV (1/10th of the wiper voltage, measured at TP1). So the SWC input voltage can differ from its stored value by up to ±250mV and still be recognised as that particular switch. Tolerance is essential since the SWC voltage may vary with temperature due to resistance variation in the switch resistor, and switch contact resistance Australia’s electronics magazine can also cause voltage variation. Having detected a valid SWC button press, IC1 activates its pin 5 and 7 outputs to produce the appropriate remote control code to send to the vehicle head unit. The modulated output at pin 5 has a 50% duty cycle. It can drive an infrared LED via a 1k resistor and CON2. LED2 is also driven by the PWM output during transmissions, as a visible indication. The unmodulated output from pin 7 drives the base of NPN transistor Q1 via a 10kresistor and also LED1, via a 1kresistor. The collector of Q1 is open so that it can connect directly to the IR receiver in the head unit. The emitter is isolated from ground via a 100resistor to reduce current flow due to the possibly differing ground potentials in this unit and the head unit. Fig.2 shows the output signals at pins 5 (yellow) and the collector of Q1 (cyan), demonstrating the 36-40kHz modulation applied to pin 5 but not Q1’s collector. In this case, the NEC protocol is being used so the modulaJune 2019  47 Infrared Coding Most infrared controllers switch their LED on and off at a modulation frequency of 36-40kHz in bursts (pulses), with the length of and space between each (pauses) indicating which button was pressed. The series of bursts and pauses is in a specific format Philips RC5 (Manchester-encoded) (36kHz) (or protocol) and there are several commonly used. This includes the Manchester-encoded RC5 protocol originated by Philips. There is also the Pulse Width Protocol used by Sony and Pulse Distance Protocol, originating from NEC. For more details, see application note AN3053 by Freescale Semiconductors (formerly Motorola): siliconchip.com.au/link/aapv icant bits first. The address can be 5-bits, 8-bits or 13-bits long to make up a total of 12, 15 or 20 bits of data. Repeat frames are the entire above sequence sent at 45ms intervals. NEC Pulse Distance Protocol (PDP) (38kHz) For this protocol, the 0s and 1s are transmitted using 889µs bursts and pauses at 36kHz. A ‘1’ is an 889µs pause then an 889µs burst, while a ‘0’ is an 889µs burst followed by an 889µs pause. The entire data frame has start bits comprising two 1s followed by a toggle bit that could be a 1 or 0. More about the toggle bit later. The data comprises a 5-bit address followed by a 6-bit command. The most significant command bits come first. When a button is held down, the entire sequence is repeated at 114ms intervals. Each repeat frame is identical to the first. However, if transmission stops, then the same button is pressed again, the toggle bit changes. This informs the receiver as to how long the button has been held down. That’s so it can, for example, know when to increase volume at a faster rate after the button has been held down for some time. Sony Pulse Width Protocol (40kHz) This is also known also as SIRC, which is presumably an acronym for Sony Infra Red Code. For this protocol, the 0s and 1s are transmitted with a differing overall length. The pause period is the same at 600µs, but a ‘1’ is sent as a 1200µs burst at 40kHz, followed by a 600µs pause, while a ‘0’ is sent as a 600µs burst at 40kHz followed by a 600µs pause. The entire data frame starts with a 2.4ms burst followed by a 600µs pause. The 7-bit command is then sent with the least significant bits first. The address bits follow, again with least signif48 Silicon Chip For the NEC infrared remote control protocol, binary bits zero and one both start with a 560µs burst modulated at 38kHz. A logic 1 is followed by a 1690µs pause while a logic 0 has a shorter 560µs pause. The entire signal starts with a 9ms burst and a 4.5ms pause. The data comprises the address bits and command bits. The address identifies the equipment type that the code works with, while the command identifies the button on the remote control which was pressed. The second panel shows the structure of a single transmission. It starts with a 9ms burst and a 4.5ms pause. This is then followed by eight address bits and another eight bits which are the “one’s complement” of those same eight address bits (ie the 0s become 1s and the 1s become 0s). An alternative version of this protocol uses the second series of eight bits for extra address bits. The address signal is followed by eight command bits, plus their 1’s complement, indicating which function (eg volume, source etc) should be activated. Then finally comes a 560µs “tail” burst to end the transmission. Note that the address and command data is sent with the least significant bit first. The complementary command bytes are for detecting errors. If the complement data value received is not the complement of the data received then one or the other has been incorrectly detected or decoded. A lack of complementary data could also suggest that the transmitter is not using the PDP protocol. After a button is pressed, if it continues to be held down, it will produce repeat frames. These consist of a 9ms burst, a 2.25ms pause and a 560µs burst. These are repeated at 110ms intervals. The repeat frame informs the receiver that it may repeat that particular function, depending on what it is. For example, volume up and volume down actions are repeated while the repeat frame signal is received but power off or mute would be processed once and not repeated with the repeat frame. Australia’s electronics magazine siliconchip.com.au Fig.2 shows the output signals at pin 5 of IC1 (yellow) and the collector of Q1 (cyan), demonstrating the 36-40kHz modulation applied to pin 5 but not on Q1’s collector. Note that the collector has a 10kpullup resistor to 5V in order to be able to show the voltage swing from Q1. In this case, the NEC protocol is being used so the modulation is at 38kHz. tion is at 38kHz. The unit is set up using infrared receiver IRD1. This three-pin device incorporates an infrared photodiode, amplifier and automatic gain control plus a 38kHz bandpass filter to accept only remote control signals, within a few kHz of the carrier frequency. The filter is not narrow enough to reject the 36-40kHz frequencies that could be produced by various different remote control units. IRD1 removes the carrier, and the resulting digital signal is fed to the GP3 digital input of IC1 (pin 4), ready for code detection. IRD1 runs from a 5V supply filtered by a 100resistor and 100µF capacitor, to prevent supply noise causing false IR code detection. Pushbutton switch S1 is bypassed with a 100nF capacitor to filter transients and for switch debouncing. The voltage at digital input GP5 is held at 5V via a weak pull-up current, internal to IC1. When S1 is pressed, GP5 is pulled low to 0V and IC1 detects this. S1 is used during programming and to set a new tolerance adjustment. The circuit is powered from the vehicle’s 12V ignition-switched supply, fed in via CON1. This supply goes through an RC low-pass filter (100/470nF) and then to automotive 5V linear regulator REG1, to power IC1 and the rest of the circuitry. The LM2940CT-5.0 regulator will not be damaged with a reverse supply connection or transient input voltage up to 55V, for less than 1ms. These situations can occur with some regularity in vehicle supplies, eg, with an accidentally reversed battery or when windscreen wiper motors switch off etc. Construction The SWC Adaptor is built on a PCB coded 05105191, measuring 77 x 47mm. It fits into a UB5 Jiffy box. The overlay diagram, Fig.3, shows how the components are fitted. Start with the resistors. These are colour coded as shown in the parts list. It’s a good idea to use a multimeter to check the value of each set of resistors before fitting them, as the colour codes can be confused. We recommend using a socket for IC1. Take care with the orientation when installing the socket and IC1. The capacitors can be fitted next. The electrolytic types must be installed with the polarity shown, with the longer positive lead towards the top of the PCB. The polyester capacitors (MKT) can be mounted with either orientation on the PCB. REG1 can be then installed. It’s mounted horizontally on the PCB. Bend the leads so they fit the PCB holes with the tab mounting holes lining up. Secure the regulator to the PCB with the screw and nut before soldering the leads. The infrared receiver (IRD1) also mounts horizontally, with the lens facing up and with the leads bent through 90° to fit into the holes. Trimpot VR1 is next. It has a value of 10kand may be marked as either 10k or 103. Follow that with the LEDs (LED1 and LED2). The anode (longer lead) goes into the hole marked “A” on the PCB. The LEDs should be installed with the base of their lenses about 5mm above the PCB. Switch S1 can also be fitted now. Next, solder transistor Q1 to the PCB, with its flat side facing as shown. You may need to bend its leads out (eg, using small pliers) to fit the pad pattern on the board. Now install the two screw terminal blocks. CON1 is mounted with the wire entry holes towards the left-hand edge of the PCB while CON2 should be fitted with the wire entries toward the right-hand edge. You can make up a 4-way terminal by dovetailing two 2-way terminals. If you are using a socket for IC1 as suggested, plug in the chip now, ensuring that its pin 1 dot is orientated as shown in Fig.3. Housing it The SWC Adaptor may fit inside the head unit if there is room, or you can mount it outside the head unit in a UB5 box. We used a flanged box that has an extended length lid with extra mounting holes. This makes it easier to Fig.3: the overlay diagram at left shows component placement while the matching fully component installed PCB is shown at right. Make sure the two electrolytic capacitors and IC1 are correctly oriented with the shown polarity. siliconchip.com.au Australia’s electronics magazine June 2019  49 mount in the car, under the dashboard is the logical location. Alternatively, a standard UB5 box can be used instead, or the unit can be wrapped in insulation and cable tied in position. If fitting it into a box, drill holes at either end to fit the cable glands which allow the power supply and infrared LED wiring to pass through. There are cut-outs in the PCB to accommodate the gland nuts which go inside the box. But note that these nuts must be oriented correctly, with two of the sides vertical, so they will fit into the recesses in the board. The PCB is mounted in the box on four 12mm-long M3 tapped spacers, using eight machine screws. Mark out and drill the 3mm holes for PCB mounting while you are making the holes for the cable glands. Installation The SWC Adaptor is wired into the vehicle so that it gets +12V power when the ignition is switched on. Virtually all head units have connecting wires carrying 0V (GND) and ignitionswitched +12V, so you can tap into the supply there. Just make sure the +12V wire has power with the ignition on and not with the ignition off. The SWC input on the SWC Adaptor connects to the steering wheel control wire. You should already know where to tap into it from the previous test where you determined that your steering wheel controls are suitable for use with this unit. The SWC Adaptor has two pairs of output wires: one pair to drive an external infrared LED (LED3) and another connecting to the collector and emitter of the transistor which provides the unmodulated output. You can use either to control the head unit. Each option has advantages and disadvantages. The infrared LED approach has the advantage that the head unit does not need to be opened up; the infrared LED is simply placed over the infrared receiver on the head unit. The disadvantage is that the wiring to this LED, and the LED itself, will be visible. The easiest way to do this is to use a premade IR Remote Control Extension Cable. These are available from Jaycar (see parts list). This has an infrared LED already mounted in a small neat housing, with a long lead. You will need to figure out how to 50 Silicon Chip Fig.4: holes are drilled at both ends of the box for the cable glands. Cut-outs in the PCB accommodate the gland nuts which must be oriented correctly, with two of the sides vertical, so they will fit into the recesses in the board. The PCB is mounted in the box on four 12mm-long M3 tapped spacers and attached using M3 screws route that cable from the SWC Adaptor mounting location to the IR receiver on the head unit. Adhesive wire saddles are useful for keeping this wiring neat. The Jaycar IR extender has a 3.5mm jack plug which you can cut off, as it isn’t needed. The LED anode wire is the one which was connected to the jack plug tip. You can also get similar extenders from eBay, AliExpress, Kogan etc, most of which have bare wire ends. Whichever one you use, wire it to the A and K terminals of CON2. It’s then just a matter of sticking the LED emitter package to the front of your head unit, directly in front of the infrared receiver, using its own selfadhesive pad. If you do not know where the infrared receiver is, it will be in an area free from switches and knobs. The front panel may have a purplelooking area over the infrared receiver, different in appearance from the rest of the panel. If you still can’t figure it out, you will need to test the unit while moving the transmitter around the panel until you find a location where it works reliably. You can then stick it in place. Tweaking the button sensing Once you have the unit wired up to power and the steering wheel controls, it is a good idea to perform some checks to make sure it is sensing the steering wheel buttons accurately. The Adaptor button sensing input includes a 1kpull-up resistor to 5V. This is shown with an asterisk both on the circuit and PCB. This resistor may need to be changed in some vehicles to give reliable button detection and discrimination. Australia’s electronics magazine To check it, monitor the voltage between TP GND and TP2 when the unit is powered up, pressing each steering wheel button in turn. On our test vehicle, we measured 3.93V with switches open, then 0.383V, 0.708V, 1.11V, 1.59V, 2.2V and 2.98V when each of six switches was pressed individually. So we had reasonable steps of more than 300mV between each voltage. The unit’s tolerance should then be set to half that value; in this case, 150mV or less. So we adjusted VR1 for 1.5V at TP1. But we could have improved the voltage range if the 1k resistor was changed to 510. That would give 4.37V with switches open and 0.67V, 1.19V, 1.77V, 2.34V, 3.02V and 3.7V with each pressed individually. That would give us a minimum step of at least 500mV and so the tolerance value could be set to 250mV (2.5V at TP1). But as long as the tolerance can be set to at least 100mV (ie, at least 200mV between the two closest voltage readings), we would consider that acceptable. If your steering wheel control switches provide a voltage range that differs significantly from ours, you may benefit from adjusting the 1k resistor value. If your voltage readings are mostly low, try using a lower value, while if your readings are all on the high side, try using a higher value. But don’t go below 200 as you then risk damaging the resistors in your steering wheel. Using the unmodulated output The advantage of using the unmodulated output from the SWC Adaptor is that it can be wired internally to the head unit, so the wiring may be able to siliconchip.com.au Fig.5 (above) shows the multi-way connector which is used to connect the front panel to the head unit. Fig.6 (at right) shows the opened up the front panel of the head unit and the location of the infrared receiver (arrowed). But this is not the best location to connect the wire. be hidden. Usually, only a single wire needs to be connected to the infrared receiver on the head unit. This wire can pass out the back of the head unit and routed to the SWC Adaptor. The disadvantage of this approach is that you need to open up the head unit, find the infrared sensor output and solder the wire to it. How this is done is best shown in the accompanying photos. In Fig.6, we’ve opened up the front panel of the head unit and located the infrared receiver (arrowed). But this is not the best location to connect the wire. Fig.5 shows the multi-way connector which is used to connect the front panel to the head unit. To figure out which pin carried the infrared receiver signal, we plugged the front panel back into the head unit and opened its case, then located where the front panel connector is terminated (see Fig.7). We then powered it up using a 12V DC source and connected a DMM set to measure volts between 0V and each pin at the rear of the front panel in turn. Look for a pin which measures around 5V, then measure its voltage while an infrared transmitter is placed in front of the unit and a button held down, so it is transmitting. If you have the correct pin, that voltage reading should drop slightly while the infrared remote control transmitter is active. In our case, we found that it dropped from 5V to 4.75V during infrared reception. The arrowed pin in Fig.7 is the one that we determined carries the infrared signal, and this is where we soldered the wire. You could use an oscilloscope to look siliconchip.com.au for the pulses from the infrared receiver; however, the multimeter method is easier and generally works well. The SWC Adaptor output includes a 0V connection for the unmodulated output. This can be wired to a ground connection on the same multi-pin connector. However, this should not be necessary as the infrared receiver on the head unit should have its ground pin connected to the head unit chassis and would be at the same potential as the 0V connection on CON1. If you have problems with the unmodulated connection working, try connecting a wire between these two points to see if that solves it. Setting up the unit Now you need to decide what functions you want from each switch on the steering wheel. Typically, this would include volume up and down, source selection, next and previous file/track/ frequency/station and power on/off. You are not restricted to the original purposes of each switch, although it would be less confusing to do so. You can use each switch to perform any of the functions available on the hand- held remote control supplied with your head unit. For some buttons, you may want the function to repeat if held down (eg, volume up/down) but with others, you may not (eg, source selection or on/off). We found that with some head units, holding down the source selection button would result in nothing happening. You would have to press the button only for a short period to switch to the next source. That’s not ideal when using steering wheel buttons. So we have included a feature in the SWC Adaptor where two out of the 10 possible buttons will not generate repeat codes even if held down. So it’s just a matter of assigning functions which may have this shortcoming on your head unit to those two button positions. This would generally include source selection, power on/off, radio band change or mute. None of these need the repeat function. You can test whether this is necessary by holding those buttons down on your infrared remote control and seeing whether the unit behaves as desired, or not. Fig.7: the arrowed pin in is the one that we determined carries the infrared signal, and this is where we soldered the wire. Australia’s electronics magazine June 2019  51 Programming the button functions You can now match up the voltages produced by each steering wheel button to the desired infrared function. You can program up to 10 switches. It does not matter what order you program each switch, and you don’t have to use all 10. The non-repeat feature mentioned above applies to switches nine and 10, so you can skip some positions if you don’t have 10 buttons but need this feature. All of the programmed infrared codes must use the same infrared protocol (NEC, Sony and RC5 are supported – see overleaf). That should not be a problem given that your head unit remote control will be using one protocol for all of its buttons – and most likely, one of those supported by this unit. To enter the programming mode, hold down S1 while switching on the vehicle ignition. Entering programming mode clears any previous programming. So you must program the functions of all switches each time this mode is invoked. Upon the release of S1, LED1 will flash once, indicating that the SWC Adaptor is ready to programming the first switch function. Point the handheld remote toward the infrared receiver on the SWC Adaptor and press the required function button. LED2 should light up. If it does not, it is possible that your handheld remote does not use one of the three supported protocols. LED2 will light up continuously for codes received in the NEC protocol. It will flash off once and then on for the Sony protocol and flashes off twice for RC5. Now press and hold the steering wheel switch that you want to assign to that function, then press S1 on the SWC Adaptor. The input voltage for that switch and the infrared code will then be stored in permanent flash memory for that switch position. LED1 will then flash twice, to indicate that the Adaptor is ready to accept the infrared code for the second switch function. Continue programming each switch for the function required. Each time you press S1, LED2 will flash a certain number of times, indicating the next switch number that is ready to be programmed. You can press S1 again to skip a position that you don’t want to assign (eg, if you have less than ten steering wheel 52 Silicon Chip Parts List – Steering Wheel Control Adaptor 1 PCB coded 05105191, measuring 77 x 47mm 1 UB5 Jiffy box (optionally with flange) 1 3-way PCB mount screw terminal with 5.08mm spacing (CON1) 2 2-way PCB mount screw terminals with 5.08mm spacing (CON2) 1 DIL-8 IC socket 1 momentary SPST pushbutton switch [Altronics S1120, Jaycar SP-0600] (S1) 9 M3 x 6mm pan head machine screws 1 M3 hex nut 4 M3 tapped x 12mm spacers 2 IP65 cable glands for 3-6.5mm wire Semiconductors 1 PIC12F617-I/P microcontroller programmed with 1510519A (IC1) 1 LM2940CT-5.0 5V automotive regulator (REG1) 1 Infrared receiver [Jaycar ZD1952 or ZD1953, Altronics Z1611A] (IRD1) 1 BC547 NPN transistor (Q1) 2 3mm high brightness red LEDs (LED1,LED2) 1 Infrared Remote Control Receiver Adaptor Extender Extension Cable [Jaycar AR1811 or similar] with adhesive backing for direct mount over IR sensor (LED3) Capacitors 1 100µF 16V PC electrolytic 1 22µF 16V PC electrolytic 1 470nF 63V MKT polyester 4 100nF 63V MKT polyester (code 474, 0.47 or 470n) (code 104, 0.1 or 100n) Resistors (0.25W, 1%) 1 10k (code: brown black orange brown or brown black black red brown) 1 2.2k (code: red red red brown or red red black brown brown) 4 1k (code: brown black red brown or brown black black brown brown) 3 100 (code: brown black brown brown or brown black black black brown) 1 10kminiature horizontal mount trim pot (VR1) (may have code 103) Miscellaneous Automotive wire, solder, connectors, self tapping screws etc. buttons). Once the tenth position is programmed, the SWC Adaptor will stop and not respond. Switch off power and when you then switch it back on again, without pressing S1 on the unit, the SWC Adaptor will begin normal operation, reproducing the stored infrared code each time one of the selected steering wheel buttons is pressed. This also applies if you don’t program all ten positions; merely switch off the ignition when you have finished programming all the functions that are required. To use the special non-repeat feature at positions nine and ten, you can skip over the earlier positions using extra presses of S1 to reach them if you are not programming all 10 functions. SC Fig.8: the front panel for the SWC Adaptor can be downloaded as a .pdf from our website and printed onto paper, transparent film or adhesivebacked vinyl. See www.siliconchip. com.au/Help/ FrontPanels for details. Australia’s electronics magazine siliconchip.com.au