Silicon ChipDual Battery Lifesaver - November 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Back Issues: PICOLOG
  6. Publisher's Letter
  7. Feature: The Fox Report by Barry Fox
  8. Feature: Techno Talk by Mark Nelson
  9. Feature: Net Work by Alan Winstanley
  10. Project: Dual Battery Lifesaver by Nicholas Vinen
  11. Project: USB Supercodec by Phil Prosser
  12. Project: Thermometer Calibrator by Allan Linton-Smith
  13. Feature: I/O Expander Modules by Tim Blythman
  14. Feature: Radio Controlled House Lights by Peter Brunning
  15. Project: Colour Maximite 2 (Generation 2) by Phil Boyce, Geoff Graham, Peter Mather
  16. Feature: AUDIO OUT by Jake Rothman
  17. Feature: Circuit Surgery by Ian Bell
  18. Feature: Max’s Cool Beans by Max the Magnificent
  19. Feature: PICn’Mix by Mike Hibbett
  20. PCB Order Form
  21. Advertising Index

This is only a preview of the November 2021 issue of Practical Electronics.

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

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Dual Battery Lifesaver by Nicholas Vinen This small board provides an easy way to protect rechargeable batteries from being completely drained if a device is accidentally left switched on. It can work with devices that run from a single battery, or two separate batteries. Both thresholds are fully adjustable, and it can handle several amps per battery, drawing just a few microamps when off. E arly next year we will be publishing a Battery Vintage Radio Power Supply project. One of the authors suggested that the low-battery cut-out section of the circuit could be useful on its own, and we had to agree with him. So, ahead of the full project we have produced a separate PCB which contains just that portion of the circuitry. It can be used with just about any device powered by 3.6-15V DC at up to 5A per output. Typically, it is configured so that both outputs are cut off if either falls below its individual voltage threshold. However, it can also be reconfigured only to cut the outputs off if both fall below the threshold, or you can build a slightly simpler version for use with a single battery. No heatsinking is necessary as the MOSFETs used for switching have minimal dissipation, around 100mW at 5A. It has provision for an optional onboard power indicator LED, and also provides for an SPST (or similar) switch to disable the outputs, so that you can use a small, low-current switch as a power switch. We previously published a very small single-battery Lifesaver in the September 2014 issue, which has been quite popular. Besides being small, its other advantage is that it can handle quite a bit of current; 20A or more. However, it used quite a few SMDs and was a bit tricky to build, tricky to set up and had a limited adjustment range once built. This version uses all through-hole parts and so is nice and easy to build, and not all that much bigger despite being able to handle two batteries. 16 This one is also straightforward to set up, with a single trimpot allowing the cut-out voltage to be adjusted over a wide range for each channel. Circuit description MOSFETs Q1 (and Q2, if fitted) connect the supplies at CON1 and CON2 to the outputs at CON3 and CON4 when switched on. They are switched off, disconnecting the outputs, if either (or both) supply voltages are below defined thresholds. When switched off, either via the switch S1 or due to a low battery voltage, the circuit only draws about 10µA from the higher voltage battery and about 2µA from the other. Presumably, you would notice the device has switched off and either recharge the cells or swap them for fresh ones. But if for some reason you forget and leave the device switched on, it would be several months before this minimal current drain could damage the cells. That’s why this circuit was designed with a low quiescent current in mind. When the power switch (S1) is Shown here mounted on four insulating pillars, the Dual Battery Lifesaver uses all through-hole components so is very easy to build. closed, current can flow from whichever battery has a higher voltage, through small signal diodes D1 and D2 and then switch S1, into the input of REG1. This is an ultra-low-quiescentcurrent, low-dropout 3.3V linear regulator. It powers micropower dual comparator IC1 and also serves as a voltage reference. A fraction of this 3.3V reference is fed to the two inverting inputs of the comparators, at pins 2 and 6 of IC1. The fraction that is applied to those pins depends on the rotation of trimpots VR1 and VR2. These set the low-battery cut-out voltages, and they can vary the voltage at those inputs over the full range of 0-3.3V. The actual battery voltages are applied to the non-inverting inputs, pins 3 and 5, after passing through fixed resistive dividers. While these two dividers use the same resistor values, they are in different orders. So around 1/3 of the CON1 voltage is applied to pin 3 of IC1a, while about 2/3 of the CON2 voltage is applied to pin 5 of IC1b. In combination with the nominally 3.3V reference and trimpots VR1 and VR2, you can set the switch-on voltage thresholds to anywhere from 0-10V for the CON1 battery, and 0-4.5V for the CON2 battery. Those ranges suit Li-ion, LiPo or LiFePO 4 batteries with one or two cells in series, respectively. You can easily change these ranges by changing the dividing resistor values. We suggest that you try to keep the total resistance around 3.3M ; lower values will increase the quiescent current, and significantly different values will alter Practical Electronics | November | 2021                SC DUAL Dual Battery Lifesaver BATTERY LIFESAVER  Fig.1: the Dual Battery Lifesaver is built around micropower comparator IC1 and micropower regulator REG1, which supplies IC1 and also acts as the voltage reference. IC1 compares fixed fractions of the battery voltage(s) with the voltages at the pot wipers, and if the battery voltages are high enough, it switches on transistors Q3 and Q4, which in turn switch on MOSFETs Q1 and Q2. the hystersis percentage (as described below). Table 1 shows some possible combinations for other voltage ranges. Hysteresis is provided by 10M feedback resistors between the comparator outputs and non-inverting inputs. This has been arranged so that the hysteresis is a fixed percentage of the voltage. The source impedance for the noninverting inputs is 687.5k in both cases (1M ||2.2M ). This forms a divider with the 10M feedback resistor, giving a hysteresis percentage of 687.5k ÷ 10M = 6.875%. So for low-battery cut-out voltages of, say, 3.3V and 6.6V, that would give you switch-on voltages 6.875% higher, or 3.525V and 7.05V respectively. The resulting hysteresis voltages are around 0.23V and 0.45V. When both batteries are above their switch-on voltages, output pins 1 and 7 of IC1 are high, at 3.3V. Therefore, the base-emitter junctions of NPN transistors are forward-biased and so both conduct, pulling the gates of MOSFETs Q1 and/or Q2 low and lighting LED1 (as long as LK1 is in the position shown). If either battery falls below its switch-off voltage, the corresponding transistor switches off and thus Q1 and Q2 switch off. The high base resistors for Q3 and Q4 (2.2M ) are chosen because if one battery voltage is low but the other is high, current will still flow from the corresponding comparator output and this will increase the current drawn from the higher voltage battery (usually the one connected to CON1). The 2.2M base resistors are the highest practical values to minimise this, and determine the minimum value for LED’s current-limiting resistor as 12k . That means that LED1 has to be a high-brightness type. If LK1 is moved to the alternative position and LK2 is fitted, rather than being connected collector-to-emitter, Q3 and Q4 are in parallel, collector-tocollector. In that case, if either battery voltage is above the defined threshold, the associated NPN transistor will pull the MOSFET gates low, and so both outputs will be connected to the inputs. On/off switch If you don’t need a power switch on the supply, you can simply place a shorting block on CON5. CON5 is provided as a convenient way to switch power on and off, and you only need an SPST switch that hardly has to handle any current. But with S1 off, there will still be a small quiescent current drawn from the two batteries due to the resistive dividers which remain connected. This is around 1µA for every 3.3V. That should mean the batteries last for around a year with the device switched off via S1. If you need to reduce the battery drain further when off, you will instead need to use a DPST or DPDT Features & specifications • Two input/output pairs • Individual low-battery cut-out voltage settings • Passes through 3.6-15V at up to 5A per output • Both outputs switch off if either (or optionally both) voltage falls below its threshold • Fixed 6.875% hysteresis • Quiescent current when off: around 10µA from the higher voltage battery and 2µA from the other Practical Electronics | November | 2021 17 Parts list – Dual Battery Lifesaver 1 double-sided PCB coded 11111202, 70 x 32mm, available from the PE PCB Service 4 2-way terminal blocks, 5.08mm pitch (CON1-CON4) 1 2-pin header or polarised header (CON5) 1 4-pin header (LK1,LK2) 3 shorting blocks/jumper shunts (CON5,LK1,LK2) 1 SPST panel-mount switch (S1; optional) 4 tapped spacers (for mounting the board) 8 M3 x 6mm panhead machine screws (for mounting the board) Semiconductors 1 MCP6542-E/P dual micropower comparator, DIP-8 (IC1) [element14, RS, Digi-Key, Mouser] 1 S-812C33AY-B2-U micropower low-dropout regulator, TO-92 (REG1) [Digi-Key, Mouser] 2 IPP80P03P4L04 P-channel logic-level MOSFETs, TO-220 (Q1,Q2) [SILICON CHIP Online Shop Cat SC4318 or element14, RS, Digi-Key, Mouser] 2 BC547 100mA NPN transistors, TO-92 (Q3,Q4) 1 high-brightness LED (LED1) 2 1N4148 small signal diodes (D1,D2) Capacitors 2 1µF 50V multi-layer ceramic Resistors (all 1/4W 1% metal film, unless otherwise indicated) 2 10MΩ 4 2.2MΩ 2 1MΩ 1 100kΩ 1 12kΩ 2 1MΩ mini horizontal trimpots (VR1,VR2) [eg, element14 108244] switch to cut the battery connections to CON1 and CON2. That switch will need to handle the full load current for each battery. Note that the batteries may still suffer from a small amount of selfdischarge, so it’s still a good idea to check and charge them every six months or so. Construction The Dual Battery Lifesaver is built on a double-sided PCB coded 11111202 . It measures 70 × 32mm and is available from the PE PCB Service. Refer now to Fig.2, the PCB overlay diagram, which shows where all the parts go. As you read the following instructions, keep in mind that if you are using the device with a single battery, you can omit D1, D2, Q2, CON2, CON4, VR2 and some of the resistors – see Fig.3. You will need to add a couple of wire links, shown in red, which you might be able to make from component lead off-cuts. Start by fitting all the resistors. While you can determine the value of a resistor by reading its colour bands, it’s best to use a DMM set to measure ohms to verify this, as some colours can look like other colours under certain types of light. If you are happy with the 0-10V adjustment range for the battery connected to CON1 and 0-4.5V for CON2, use 2.2M resistors for RU1 and RL2, and 1M resistors for RL1 and RU2, as shown in Fig.1. Otherwise, refer to Table 1 to determine the best resistor values to use. With all the resistors in place, follow with the two small diodes, D1 and D2. These must be oriented with their cathode stripes facing as shown in Fig.2. Then fit comparator IC1. Make sure its pin 1 notch and dot go towards the top of the board, as shown. We don’t recommend that you use a socket for reliability reasons, although you could if you wanted to. Next, fit switch header CON5. You can use a regular or polarised header, or just solder a couple of wires to the PCB. If you want the supply always to be on, you can either place a shorting block on CON5 or solder a small wire link in its place. The next step is to fit small signal transistors Q3 and Q4. They are the same type; ensure their flat faces lie as shown in the overlay diagram, and bend their leads out gently to fit the pad patterns. Follow with regulator REG1, which is in a similar package to those transistors, then install the two ceramic capacitors where shown. Now mount the two trimpots, which are the same value. Follow with the four terminal blocks. Make sure that their wire entry holes face towards the outside of the module, and note that the side-by-side blocks are spaced apart and so should not be dovetailed; mount them individually. Next, fit the two TO-220 devices, which mount vertically. Ensure that their metal tabs are oriented as shown. You could crank their leads so that their tabs are flush with the PCB edges, allowing heatsinks to be fitted later, but their dissipation should be low enough that heatsinks are not necessary. All that’s left is to solder the four-pin header shared by links LK1 and LK2 in place, followed by LED1. How you do this depends on what your plans are. If you don’t need an external poweron LED indicator, you can simply push it right down (with its longer lead on the side marked ‘A’, opposite the flat on the lens) and solder it in place. If you want it to be externally visible, depending on how you will be mounting the board, you may be able to mount it on long leads and have it project out the lid of the device. Or you could chassis-mount the LED using a bezel. You could then either solder flying leads from its leads to the PCB pads, or solder a 2-pin header (regular or polarised) onto the PCB and then solder leads to the LED with a plug or plugs at the other end. Fig.2: the PCB has been kept as small as possible while still being easy to build, handling a decent amount of current and providing for easy wire attachment and mounting. Assembly is straightforward but make sure that the IC, terminal blocks, MOSFETs, diodes and LED are correctly orientated. Use the component overlay above in conjunction with the same-size photo at right to assist you in component placement. Note that the values of RL1, RL2, RU1 and RU2 need to be chosen from the table overleaf. 18 Practical Electronics | November | 2021 Fig.3: the same PCB can be fitted with fewer components if you only have one battery to protect, as above. Again, the two resistors shown in red need to be selected from Table 1. You will also need to add two wire links, shown in red. Testing and adjustment It’s best to test and adjust the Dual Battery Lifesaver using a variable DC bench supply; ideally one with current limiting. The following instructions assume that you used the resistor values shown in Fig.1. If you changed them, you might need to alter the suggested voltages. Place one shorting block on CON5 and another across the middle two pins of LK1/LK2. Start by setting VR1 and VR2 at their maximum settings. If you’ve built the two-battery version, bridge the positive inputs together (you don’t need to bridge the negative terminals as they are connected on the PCB). Now set your bench supply to around 4V and the current limit to a low value, then switch it off and wire up either input (CON1 or CON2) to the supply. Switch the supply on and watch LED1. It should not light yet, and the current drawn from the supply should be low (under 1mA). If it’s significantly higher than that, you could have a board fault, so switch off and check for short circuits and incorrectly located or oriented components. If all is well, wind the voltage up to about 8V, then rotate VR1 anticlockwise until LED1 lights up. Then reduce the supply voltage slightly and check that LED1 switches off. Now rotate VR1 and VR2 fully anti-clockwise, set the supply voltage to your desired cut-out voltage for whichever of the two is lower, then rotate either VR1 or VR2 clockwise slowly until LED1 switches off. Then Voltage range Upper resistor Lower resistor 0-4.5V 1.0M 2.2M 0-5.25V 1.2M 1.8M 0-6.3V 1.5M 1.5M 0-7.8V 1.8M 1.2M 0-10V 2.2M 1.0M 0-12.3V 2.4M 820k 0-15V 2.7M 680k Table 1 – suggested resistor pairs for various cut-out voltage ranges. increase the supply voltage to your other desired cut-out voltage; LED1 should switch back on. Rotate the other trimpot slowly clockwise until the unit switches off. You have now set both battery cutout thresholds. If you want both outputs to switch off whenever either battery voltage drops below the threshold you’ve set, the unit is now complete. If you only want it to switch off when both batteries fall below their respective limits, remove the jumper from LK1/LK2 and insert two jumpers on the 4-pin header side-by-side. Teach-In 8 CD-ROM Exploring the Arduino This CD-ROM version of the exciting and popular Teach-In 8 series has been designed for electronics enthusiasts who want to get to grips with the inexpensive, immensely popular Arduino microcontroller, as well as coding enthusiasts who want to explore hardware and interfacing. Teach-In 8 provides a one-stop source of ideas and practical information. The Arduino offers a remarkably effective platform for developing a huge variety of projects; from operating a set of Christmas tree lights to remotely controlling a robotic vehicle wirelessly or via the Internet. Teach-In 8 is based around a series of practical projects with plenty of information for customisation. The projects can be combined together in many different ways in order to build more complex systems that can be used to solve a wide variety of home automation and environmental monitoring problems. The series includes topics such as RF technology, wireless networking and remote web access. PLUS: PICs and the PICkit 3 – A beginners guide The CD-ROM also includes a bonus – an extra 12-part series based around the popular PIC microcontroller, explaining how to build PIC-based systems. Reproduced by arrangement with SILICON CHIP magazine 2021. www.siliconchip.com.au EE FR -ROM CD ELECTRONICS TEACH-IN 8 £8.99 FREE CD-ROM SOFTWARE FOR THE TEACH-IN 8 SERIES FROM THE PUBLISHERS OF INTRODUCING THE ARDUINO • Hardware – learn about components and circuits • Programming – powerful integrated development system • Microcontrollers – understand control operations • Communications – connect to PCs and other Arduinos PLUS... PIC n’MIX PICs and the PICkit 3 - A beginners guide. The why and how to build PIC-based projects Teach In 8 Cover.indd 1 04/04/2017 12:24 PRICE £8.99 Includes P&P to UK if ordered direct from us SOFTWARE The CD-ROM contains the software for both the Teach-In 8 and PICkit 3 series. ORDER YOUR COPY TODAY at: www.electronpublishing.com Practical Electronics | November | 2021 19