Silicon ChipConnecting two pushbuttons to an input-only pin - December 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Making kits is not easy!
  4. Mailbag
  5. Feature: Big Brother is Tracking You! – Part 2 by Dr David Maddison
  6. Project: Hummingbird Audio Amplifier by Phil Prosser
  7. Feature: SMD Soldering – tips and tricks by Tim Blythman
  8. Project: SMD Trainer Board by Tim Blythman
  9. Feature: El Cheapo Modules: 35MHz-4.4GHz Signal Generator by Jim Rowe
  10. Review: Raspberry Pi Pico by Tim Blythman
  11. Project: Digital Lighting Controller Translator by Tim Blythman
  12. Serviceman's Log: A mixed bag of odds, sods, ends and bobs by Dave Thompson
  13. Product Showcase
  14. Circuit Notebook: Orrery (planetarium) using a Micromite LCD BackPack by Kenneth Horton
  15. Circuit Notebook: Non-contact cloud-based temperature sensor with speech by Bera Somnath
  16. Circuit Notebook: Switching cells between parallel and series by Benabadji Mohammed Salim
  17. Circuit Notebook: Connecting two pushbuttons to an input-only pin by Amine Houari
  18. Project: USB Cable Tester – Part 2 by Tim Blythman
  19. Vintage Radio: Restoring a Sony 5-303E Micro-TV by Dr Hugo Holden
  20. Subscriptions
  21. PartShop
  22. Ask Silicon Chip
  23. Market Centre
  24. Advertising Index
  25. Notes & Errata: Tele-com Intercom, October 2021; Hybrid Lab Supply with WiFi, May & June 2021
  26. Outer Back Cover

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

You can view 0 of the 112 pages in the full issue.

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

Articles in this series:
  • Big Brother is Tracking You! – Part 1 (November 2021)
  • Big Brother is Tracking You! – Part 2 (December 2021)
Items relevant to "Hummingbird Audio Amplifier":
  • 6-way Loudspeaker Protector PCB [01101221] (AUD $7.50)
  • 4-way Loudspeaker Protector PCB [01101222] (AUD $5.00)
  • The Hummingbird Audio Amplifier PCB [01111211] (AUD $5.00)
  • Hard-to-get parts for the Hummingbird Amplifier (Component, AUD $15.00)
  • Multi-Channel Speaker Protector PCB patterns (PDF download) [01101221-2] (Free)
  • The Hummingbird Audio Amplifier PCB pattern (PDF download) [01111211] (Free)
Items relevant to "SMD Trainer Board":
  • SMD Trainer PCB [29106211] (AUD $5.00)
  • Kit for the SMD trainer (Component, AUD $20.00)
  • SMD Trainer PCB pattern (PDF download) [29106211] (Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 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 4 (February 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 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 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 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 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: 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, Part 2 (June 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: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
Items relevant to "Digital Lighting Controller Translator":
  • Flexible Digital Lighting Controller main PCB [16110202] (AUD $20.00)
  • Flexible Digital Lighting Controller Micromite Master PCB [16110201] (AUD $5.00)
  • Flexible Digital Lighting Controller CP2102 Adaptor PCB [16110204] (AUD $2.50)
  • Flexible Digital Lighting Controller LED slave PCB [16110205] (AUD $5.00)
  • PIC16F1705-I/P programmed for the Flexible Digital Lighting Controller [1611020A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC32MX170F256B-50I/SP programmed for the Flexible Digital Lighting Controller Micromite master [1611020B.hex] (Programmed Microcontroller, AUD $15.00)
  • PIC16F1455-I/P programmed for the Flexible Digital Lighting Controller WS2812 Slave [16110205.HEX] (Programmed Microcontroller, AUD $10.00)
  • Micromite LCD BackPack V3 complete kit (Component, AUD $75.00)
  • Flexible Digital Lighting Controller front panel PCB [16110203] (AUD $20.00)
  • Firmware and software for the Fiexible Digital Lighting Controller (Free)
  • Firmware and PC software for the Digital Lighting Controller [1611010A.HEX] (Free)
  • Flexible Digital Lighting Controller mains slave PCB patterns (PDF download) [16110202-3] (Free)
  • Flexible Digital Lighting Controller Master PCB patterns (PDF download) [16110201, 16110204] (Free)
  • Flexible Digital Lighting Controller LED slave PCB pattern (PDF download) [16110205] (Free)
  • Drilling and cutting diagrams for the Flexible Digital Lighting Controller Micromite master (PDF download) (Panel Artwork, Free)
  • Cutting diagram for the Flexible Digital Lighting Controller mains slave rear panel (PDF download) (Panel Artwork, Free)
  • Cutting diagrams and front panel artwork for the Flexible Digital Lighting Controller LED slave (PDF download) (Free)
  • Digital Lighting Controller Translator PCB [16110206] (AUD $5.00)
  • PIC16F1705-I/P programmed for the Digital Lighting Controller Translator [1611020F.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware for the Digital Lighting Controller Translator [1611020F.HEX] (Software, Free)
  • Digital Lighting Controller Translator PCB pattern (PDF download) [16110206] (Free)
  • Drilling/cutting diagrams and lid panel artwork for the Digital Lighting Controller Translator (Free)
Articles in this series:
  • Flexible Digital Lighting Controller, part 1 (October 2020)
  • Flexible Digital Lighting Controller, part 2 (November 2020)
  • Flexible Digital Lighting Controller, part 3 (December 2020)
  • Digital Lighting Controller Translator (December 2021)
Items relevant to "Orrery (planetarium) using a Micromite LCD BackPack":
  • Firmware for the Orrery using a Micromite LCD BackPack (Software, Free)
Items relevant to "Non-contact cloud-based temperature sensor with speech":
  • Firmware for the Contactless temperature sensor with speech (Software, Free)
Items relevant to "USB Cable Tester – Part 2":
  • USB Cable Tester main PCB [04108211] (AUD $7.50)
  • PIC16F18877-I/P programmed for the USB Cable Tester [0410821C.HEX] (Programmed Microcontroller, AUD $15.00)
  • Relay - EA2-5NU (Component, AUD $3.00)
  • IPP80P03P4L-07 high-current P-channel Mosfet (Component, AUD $2.50)
  • Short form kit for the USB Cable Tester (Component, AUD $110.00)
  • USB Cable Tester front panel PCB [04108212] (AUD $5.00)
  • Laser-cut acrylic bezel for USB Cable Tester (PCB, AUD $2.50)
  • Firmware and bezel laser cutting files for the USB Cable Tester [0410821A.HEX] (Software, Free)
  • USB Cable Tester PCB patterns (PDF download) [04108211/2] (Free)
Articles in this series:
  • USB Cable Tester – Part 1 (November 2021)
  • USB Cable Tester – Part 2 (December 2021)

Purchase a printed copy of this issue for $11.50.

Switching cells between parallel and series Many Li-ion/LiPo charging modules are designed to handle either a single cell or multiple cells in parallel. That’s because they often run off 5V (eg, from a USB port or charger), and that’s ideal for linear charging of a single cell which ranges from about 3.3V when flat to 4.2V when fully charged. In many cases, you need two or three cells in series to get a high enough voltage to power a device. While it’s possible to generate higher voltages for charging multiple cells in series from 5V, that requires a more complex switch-mode boost converter, and they can generate EMI. When charging cells in series, you also need to consider how to keep their voltages balanced (equal). This circuit shows a much simpler solution. A single DPDT or 4PDT switch can be used to switch two or three cells between series and parallel connections, for powering a circuit and charging, respectively. When connected in parallel for charging, the cells are automatically balanced. To avoid the need to manually switch between charging mode and usage mode, a DPDT or 4PDT relay can be substituted for the switch, with the coil powered from the charging socket. A diode or similar can be used to ensure the coil cannot be energised by voltage back-fed from the battery. This way, the cells are automatically switched between the two modes. Use the relay’s NC contacts for the parallel connections (marked P) and NO contacts for the series connections (marked S). Benabadji Mohammed Salim, Oran, Algeria ($80) Editor’s note: while this should work in theory, we do not recommend this approach. That’s because any voltage imbalance which builds up in the cells as they discharge (due to differing cell capacities etc) will cause very high currents to flow as soon as the cells are switched into the parallel configuration. These currents could easily destroy or weld the switch/relay contacts. If you decide to use this configuration, we strongly recommend inserting PTC thermistors (or similar currentlimiting devices) into the connections between cells in the parallel configuration, switched out when the cells are connected in series. These can be connected inline where the red asterisks are shown. While adding such PTC thermistors will affect the rate at which the different cells charge, they should not affect the end-of-charge detection very much, so all cells should still charge fully (given enough time). The PTC thermistors should be chosen to have a ‘hold’ current rating that’s somewhat above the maximum charge current and a ‘trip’ current below the switch/ relay current rating for DC. Connecting two pushbuttons to an input-only pin Some PICs have a pin that can only be used as an input, eg, GP3/RA3 on the PIC10F200. In many cases, this is because that pin has other functions like MCLR. Sometimes you need to connect more devices to a micro than it has pins; many common techniques for making a pin dual-purpose require it to be switchable between being a digital input and output, which is not the case here. Other tricks use an internal ADC (analog-to-digital) converter with several external resistors connected as a divider to measure a different voltage generated by each pushbutton being pressed. For more on these techniques, see Microchip application note AN234 and Tips ‘n Tricks DS40040C. This simple circuit shows how the input-only GP3/RA3 can be used to 80 Silicon Chip sense two different pushbuttons being pressed, despite not being able to act as an output or an analog input. This relies on the pin having a selectable internal pull-up current, as is the case in both this chip and most of Microchip’s midrange family (the new XLP generation). According to their datasheets, the internal pull-up resistor has a typical value of about 23kW when Vdd = 5V. As GP3 is a TTL type input, we must choose a value for the external resistor so that when the internal pull-up is enabled, we have more than 2.4V as the idle voltage at GP3, giving an idle high-level state. This allows us to sense when S1 is pressed, as the pin will idle high but will go low when S1 is pressed. To sense a press of S2, the internal pull-up is periodically disabled. When we Australia’s electronics magazine disable the pull-up, the input will be pulled low by the 27-47kW resistor if S2 is not pressed or will be held high if it is pressed. The 1kW resistor avoids a short circuit between Vdd and Vss if both buttons are pressed simultaneously. Amine Houari, Oran, Algeria. ($70) siliconchip.com.au