Silicon ChipProgrammable Hybrid Lab Supply with WiFi – Part 1 - May 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Farewell to Gary Johnston A Remarkable Australian
  4. Feature: Digital Radio Modes – Part 2 by Dr David Maddison
  5. Project: Programmable Hybrid Lab Supply with WiFi – Part 1 by Richard Palmer
  6. PartShop
  7. Project: Digital FX (Effects) Pedal – Part 2 by John Clarke
  8. Project: Arduino-based MIDI Soundboard – Part 2 by Tim Blythman
  9. Review: EVOR04 Audio Analyser by Allan Linton-Smith
  10. Project: Variac-based Mains Voltage Regulation by Dr Hugo Holden
  11. Feature: The History of Videotape – Cassette Systems by Ian Batty, Andre Switzer & Rod Humphris
  12. Serviceman's Log: Some jobs are much harder than they should be by Dave Thompson
  13. Product Showcase
  14. Vintage Radio: 1972 BWD 141 Audio Generator by Ian Batty
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: ESR Meter with LCD readout, Circuit Notebook, May 2016; Barking Dog Blaster, September 2012
  18. Outer Back Cover

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

You can view 41 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.

Articles in this series:
  • Digital Radio Modes - Part 1 (April 2021)
  • Digital Radio Modes - Part 1 (April 2021)
  • Digital Radio Modes – Part 2 (May 2021)
  • Digital Radio Modes – Part 2 (May 2021)
Items relevant to "Programmable Hybrid Lab Supply with WiFi – Part 1":
  • WiFi-Controlled DC Electronic Load control PCB [18104212] (AUD $10.00)
  • Programmable Hybrid Lab Supply Control Panel PCB [18104211] (AUD $10.00)
  • Programmable Hybrid Lab Supply Regulator Module PCB [18104212] (AUD $7.50)
  • 2.8-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $25.00)
  • ESP32 DevKitC microcontroller module with WiFi and Bluetooth (Component, AUD $25.00)
  • Software, manuals and laser templates for the Programmable Hybrid Lab Supply (Free)
  • Programmable Hybrid Lab Supply Control Panel PCB pattern (PDF download) [18104211] (Free)
  • Programmable Hybrid Lab Supply Regulator PCB pattern (PDF download) [18104212] (Free)
  • Drilling/cutting diagrams and front panel artwork for the Programmable Hybrid Lab Supply (Free)
Articles in this series:
  • Programmable Hybrid Lab Supply with WiFi – Part 1 (May 2021)
  • Programmable Hybrid Lab Supply with WiFi – Part 1 (May 2021)
  • Programmable Hybrid Lab Supply with WiFi – Part 2 (June 2021)
  • Programmable Hybrid Lab Supply with WiFi – Part 2 (June 2021)
Items relevant to "Digital FX (Effects) Pedal – Part 2":
  • Digital FX Unit PCB (potentiometer-based version) [01102211] (AUD $7.50)
  • Digital FX Unit PCB (switch-based version) [01102212] (AUD $7.50)
  • 24LC32A-I/SN EEPROM programmed for the Digital FX Unit [0110221A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC12F1571-I/SN programmed for the Digital FX Unit with potentiometer [0110221B.HEX] (Programmed Microcontroller, AUD $10.00)
  • Spin FV-1 digital effects IC (SOIC-28) (Component, AUD $40.00)
  • Firmware for the Digital FX Unit [0110221A.HEX] (Software, Free)
  • Digital FX Unit PCB patterns (PDF download) [01102211-2] (Free)
Articles in this series:
  • Digital FX (Effects) Pedal - Part 1 (April 2021)
  • Digital FX (Effects) Pedal - Part 1 (April 2021)
  • Digital FX (Effects) Pedal – Part 2 (May 2021)
  • Digital FX (Effects) Pedal – Part 2 (May 2021)
Items relevant to "Arduino-based MIDI Soundboard – Part 2":
  • 64-Key Arduino MIDI Shield PCB [23101211] (AUD $5.00)
  • 8x8 Tactile Pushbutton Switch Matrix PCB [23101212] (AUD $10.00)
  • Simple Linear MIDI Keyboard PCB [23101213] (AUD $5.00)
  • Firmware for the 64-Key Arduino MIDI Matrix (Software, Free)
  • Software for the Arduino MIDI Shield & 8x8 Key Matrix plus 3D keycap model (Free)
  • 64-Key Arduino MIDI Shield PCB pattern (PDF download) [23101211] (Free)
  • 8x8 Tactile Pushbutton Switch Matrix PCB pattern (PDF download) [23101212] (Free)
  • Simple Linear MIDI Keyboard PCB pattern (PDF download) [23101213] (Free)
Articles in this series:
  • Arduino-based MIDI Soundboard - Part 1 (April 2021)
  • Arduino-based MIDI Soundboard - Part 1 (April 2021)
  • Arduino-based MIDI Soundboard – Part 2 (May 2021)
  • Arduino-based MIDI Soundboard – Part 2 (May 2021)
  • Simple Linear MIDI Keyboard (August 2021)
  • Simple Linear MIDI Keyboard (August 2021)
Items relevant to "Variac-based Mains Voltage Regulation":
  • Variac-based Regulation Control Module PCB [10103211] (AUD $7.50)
  • Variac-based Regulation Control Module PCB pattern (PDF download) [10103211] (Free)
Articles in this series:
  • The History of Videotape – Quadruplex (March 2021)
  • The History of Videotape – Quadruplex (March 2021)
  • The History of Videotape - Helical Scan (April 2021)
  • The History of Videotape - Helical Scan (April 2021)
  • The History of Videotape – Cassette Systems (May 2021)
  • The History of Videotape – Cassette Systems (May 2021)
  • The History of Videotape – Camcorders and Digital Video (June 2021)
  • The History of Videotape – Camcorders and Digital Video (June 2021)

Purchase a printed copy of this issue for $10.00.

Programmable Hybrid Lab Power Supply with by Richard Palmer This Lab Supply has inbuilt wireless control over WiFi or via a colour touchscreen and rotary encoder, with the ability for several supplies to be synchronised wirelessly. It is compact and inexpensive for its performance, delivering 0-27V, with 0-5A up to 18V and slightly lower currents above that. It has current limiting and voltage/current monitoring, soft-starting, and its final regulation stage is linear for a well-controlled and smooth DC output. T his design avoids bulky power transformers and substantial heat generation by using a switchmode AC/DC converter and switchmode pre-regulator. The final regulation stage is linear for improved line and load regulation, plus lower ripple and noise. With its modest heat generation, the Supply fits into a compact plastic 24 Silicon Chip instrument case, and the whole unit weighs just 1.5kg – less than the power transformer in a conventional design. The Supply is programmable, making it very useful as part of a suite of lab instruments. For example, you could use it for automated testing. Its WiFi interface enables remote monitoring via a web interface, and remote control using the industry-standard SCPI Australia’s electronics magazine (Standard Commands for Programmable Instruments) protocol. Voltage and current are set in increments of 10mV and 10mA, and voltage is controlled to millivolt accuracy. Settings are stored in the unit’s onboard flash memory for retention between sessions. Current limiting, short-circuit and thermal protection are software-controlled. siliconchip.com.au Safe operating area constraints for the output devices are enforced by software, providing an extra layer of protection against overtaxing the Supply, in addition to the inbuilt protections of the three regulators. Fig.1 provides an overview of how the Lab Supply works. It is based on three modules: the control module at top, the regulator module at bottom, and a commercially-made switching AC-to-DC converter which provides the DC supply to run all the circuitry. The control module is powered from lower voltage supply rails that are derived within the regulator module. More features Traditionally, lab supplies ‘crash start’ when the output is connected via a switch or relay, unlike the behaviour of most inbuilt power supplies, where the voltage builds over tens of milliseconds. This lab supply has a soft start feature which raises the voltage from zero to the set value at a rate of 100V per second when the output is switched on. The remote control includes adjusting output voltage and maximum current via WiFi (TCP) and isolated USB. It can readily execute scripted sequences such as step voltage changes and ramps. For example, you can write SCPI scripts in EEZ Studio (a free download from https://github.com/eez-open/ studio) to set the output voltage alternately to two different values, to test a device’s load regulation or response to a step-change in its input voltage. Direct-connected USB serial communication is not recommended once the instrument is commissioned. The local USB ground is directly connected to the power supply’s negative terminal, which is usually floating. Therefore, connecting the output negative terminal to a voltage source could damage your computer. It’s much safer to use WiFi control or a USB isolator. Rather than connecting the instrument to an existing WiFi LAN, you can also configure it to provide its own password-protected network with the SSID ESPINST. When powered on, the Supply first tries to connect to an existing WiFi network if credentials have been previously provided via the on-screen menu. If this does not succeed, it tries to connect to an existing ESPINST WiFi network. If this fails, it sets up siliconchip.com.au Features & specifications • • • • • • • • • • • • • • Hybrid bench supply with SMPS pre-regulation and final linear regulator Remote monitoring and control via WiFi Compact, lightweight and low heat dissipation Multiple units can coordinate for flexible stacking and tracking options High-efficiency design with low ripple and noise at the output Delivers up to 24V <at> 0-3.5A, 0-18V <at> 0-5A. Setting resolution: 10mV and 10mA Coarse and fine adjustment of output voltage and current Control resolution better than 1mV and 1mA Current limiting, over-voltage and over-current protection Excellent line and load regulation and good transient response with no overshoot Soft-start when output is switched on, avoiding ‘crash’ starts HTTP, telnet (TCP) and isolated USB serial control supported using universal SCPI commands Universal AC input (100-240V AC, 50-60Hz) the ESPINST WiFi network itself. Where an existing WiFi network is used, the Supply can be accessed by its IP address or by instrument_name. local (defaulting to MYPSU.local) using the mDNS protocol. The instrument provides a web page which displays the settings and measured values, along with a ‘big red button’ to turn off the output remotely. No other controls are provided on the web page, as it not secured. Several programmable supplies may be set up as a group, communicating over WiFi, making it possible to provide the normal functions of tracking supplies, ie, linked voltage settings and synchronised current limiting without needing a host computer. As each Supply is fully floating, they may also be stacked in series to provide higher output voltages, or paralleled for higher current. While limited space precludes a full run-down on all the instrument’s features and how to use them, full Fig.1: the Lab Supply is built from three modules: an AC-DC mains supply, a hybrid switchmode/linear regulator and measurement module, and a WiFi control board based on a prebuilt ESP-32 microcontroller module and a colour touchscreen. Australia’s electronics magazine May 2021  25 Scope1: there is no detectable mains ripple in the output. A small amount (35mV RMS) of switching noise is present, predominantly synchronised with the pre-regulator’s switching. descriptions are contained in the manual provided as part of the downloads for this project at siliconchip.com.au/ link/ab72 Operational overview The output voltage and maximum current can be set via the touchscreen, using a combination of right-hand touch screen buttons (V & A) that select the setting to be altered, two momentary switches selecting which digit is being changed, and a rotary encoder to change the actual value. This provides a smooth transition from coarse to fine control. Current-limiting can be enabled with an on-screen button (L), as can tracking functions (T) when more than one lab supply is available. The actual output voltage, current and power are displayed on the left side of the main screen. Along the top edge of the screen, the input voltage, heatsink temperature, fan and WiFi status are also shown along with an [E] (for EEPROM) indicator that shows when a flash memory parameter save is pending. There is a 30-40 second delay on saving to flash memory after the last setting was changed, as the memory has a guaranteed lifetime of fewer than 100,000 erase/write cycles. Sub-menus for setting communication parameters (COM) calibration functions (CAL) and tracking (TRA) are accessed via the buttons arranged across the bottom of the screen. Once the Supply is commissioned, the submenus will rarely need to be accessed. 26 Silicon Chip Scope2: under a full 5A load, the ripple at the 260kHz switching frequency is more pronounced, but still less than 100mV peak-to-peak (orange trace). The yellow trace is before the output toroidal inductor, to indicate the effectiveness of even a few turns in reducing spikes. Two dedicated momentary switches at the panel’s left-hand side turn the output relay on and off. These control panel switches are hard-wired to the power supply board, to ensure that the output can be disconnected even in the unlikely event of the CPU going on vacation. The supply output is floating, so a third GND terminal is provided for situations where mains Earthing is required. Performance The AC-to-DC conversion is handled by a commercial switchmode unit rated at 24V, 4.5A (nominally 108W). But as long as we don’t exceed the overall power envelope, we can sneak a little more current at lower voltages and a little more voltage at the top end. With the trimmer on the converter at full rotation, the prototype’s AC-DC supply provides just under 30V. At light to moderate loads, the pre-regulator and final regulator each have dropout voltages of under 2V, bringing the theoretical maximum output voltage to 27V from the 30V Supply. As the load increases and current booster transistor pair Q1/Q2 begins to conduct (described in more detail below), the voltage drop rises to limit the maximum output voltage to just under 24V at full power. This characteristic compares favourably with the voltage sag experienced under heavy load with transformer-based designs. Several factors constrain the Supply’s maximum output current: the total power envelope of the AC-DC Australia’s electronics magazine converter, its 4.5A rating at full power, and the 5A current rating of the pre-regulator stage. The red line in Fig.2, the safe operating area (SOA) curve of the Supply, shows its limits. The pre-regulator can handle 5A, defining the top line. The cut-off corner corresponds to an output power of 90W, as 18W of the ACDC converter’s 108W capacity is converted to heat by the linear stage at full current. The right-hand line is the 27V maximum output voltage. The power stage can deliver slightly less than the absolute maximum power at higher voltages, and the red line indicates its measured performance. The SOA current limits are enforced by software: even if you set 5A as a current limit point at 20V, limiting will begin at around 4.5A, to ensure that the maximum power of the converter is not exceeded. Ripple and noise Output ripple is small, and the most significant components are at the pre-regulator’s switching frequency of 260kHz (see Scope1). Scope2’s output (orange) trace indicates that the 37mV RMS (150mV peak-to-peak) of unwanted output components comprises 100mV peak-to-peak ripple, superimposed with 50mV switching transients. The yellow trace, showing the linear regulator output, is almost identical to that at its input, confirming that its ripple rejection ability is not strong at high frequencies. The improvement in RF noise is due to a choke between the siliconchip.com.au Scope3: the output behaviour (yellow trace) when a 2A load is rapidly switching in and out (orange trace) using Mosfets driven by a square wave. PCB and output terminal. Increasing its inductance would further reduce the unwanted signal, though possibly making the output unstable with some capacitive loads. Load control Scope3 shows that a step-change in load from 0 to 2A causes almost no measurable change in the output voltage. The brief spikes are caused by very short rise and fall times of the current, as the load was controlled by a square wave driving switching Mosfets. After the spike, there is a small positive bump at the drop to zero current (about 100mV), caused by the software’s response to the transient. This Scope4: the transients in Scope 3 are eliminated when the load change has a slower rise time, due to the Mosfets being driven by a triangle wave instead. has settled within 10ms. As the load comes back on, the voltage overshoots by a similar amount, and stabilises in less than 5ms. In Scope4, the load Mosfets are driven by a triangle wave producing a current pulse (green trace) with a 1ms rise time. There is no discernable switching spike or voltage variation in the yellow output voltage waveform. Voltage control While the Supply is capable of finer voltage regulation, a hysteresis of 1mV has been introduced into the voltage control algorithm to prevent hunting. In almost all practical situations, the Supply’s output stability is far more Fig.2: the Safe Operating Area (SOA) for the Lab Supply. It can provide 5A up to 18V. Above that, the 108W limit of the AC-DC converter and the 18W dissipation in the linear stage causes the maximum current to taper until reaching the maximum voltage that can be produced, taking into account the dropout voltage of the linear regulator. siliconchip.com.au Australia’s electronics magazine critical than the actual voltage value. After all, this is a lab supply rather than a voltage reference instrument. With a knob-driven design, the main criterion is that it can vary the voltage as quickly as you can turn the knob. But with digital control, particularly remote digital control, it becomes practical to use the Supply to provide step-changes in voltage, and even generate ramps or square waves. The settling time is more crucial under these conditions. The ability of the Supply to handle changes in output voltage under load is quite substantial. Scope5 shows the response of the bare regulator to a short rise-time voltage step of 1V to 10V into a 20Ω load. It shows overshoot after a 35ms rise time, with the voltage settling in less than 100ms. As it is undesirable to have voltage overshoot, rising voltages are intentionally rate-limited in software to 100V/s (Scope6), with no significant remaining overshoot. With a falling voltage (Scope7), the output has settled within 25ms with minimal undershoot. The rate of voltage fall is not rate-limited by software, and mostly depends on the time constant of the load resistance and the 10µF output capacitor. Rate limiting of rising voltages, when coupled with the output voltage rising from 0V when the output is turned on, forms the core of the softstart feature. Hardware design The basic design of the Lab Supply is shown in the simplified circuit May 2021  27 Scope5: with a substantial 9V step with a 20Ω Ω load, the untreated output shows undesirable overshoot, despite a short settling time of around 75ms. diagram, Fig.3. AC power is converted to 28-30V DC using a commercial 100W switch-mode module. This has been chosen to reduce the size, cost, and weight. Next, an LM2679-based DC-DC buck regulator reduces the DC voltage to 3.6V more than the required output. Finally, a boosted linear regulator, based on an LM317, brings the voltage down to the correct output value. The output current is converted to a voltage using an INA282 high-side current-to-voltage converter measuring the voltage drop across a 0.01Ω shunt resistor. The output voltage and current are then measured using a 16bit analog-to-digital converter (ADC). Scope6: limiting the voltage rise time to 100V/second almost eliminates the overshoot. The LM317’s output voltage is controlled by a digital pot, IC3, and trimmed using the digital-to-analog converter’s output (DAC). All digital control functions use an I2C serial bus, and two modules can share a single controller, by altering one bit of each device’s I2C address via a jumper. While a three-stage approach to voltage regulation may seem complicated, it provides the best balance of performance and simplicity of several configurations tested. One of the key design challenges in any switch-mode design is controlling switching noise at the output. Careful attention has been paid at each regu- lator stage to minimise its generation and transmission. The Supply is built using two PCBs: one which carries all the regulation componentry, and a second control board which has the microcontroller module with WiFi, a touchscreen, buttons and a rotary knob. They are joined together by a ribbon cable. As several vital chips on the power supply board are only available as SMD parts, we have opted for fully SMD layouts. We’ve kept the part sizes to 2.0 x 1.2mm (0805 imperial) or larger, to aid with manual assembly. For those who have not ventured into SMD construction yet, you could consider building our DIY SMD Reflow Fig.3: a simplified circuit diagram demonstrating the Lab Supply’s operation. The AC-DC converter is followed by a preregulator based on the LM2679 5A switching regulator, then a linear stage comprising an LM317 with a pair of currentboosting transistors. The micro monitors the output voltage and current and drives the ADJ terminal on the LM317 with a mixture of varying resistance (via the digital pot) and a small voltage, provided by the DAC for fine control. 28 Silicon Chip Australia’s electronics magazine siliconchip.com.au It’s a versatile design . . . Scope7: there is almost no overshoot with falling output (10V, 20Ω Ω), so fall-time limiting is not required. Oven (April & May 2020; siliconchip. com.au/Series/343) to build this project. However, you can also assemble it by hand if you want to; in that case, a syringe of flux paste, some braided solder wick and fine-tipped tweezers are all you need in addition to a temperature-controlled iron. Heat management Most of the waste heat is generated by one transistor, Q2. The preregulator maintains it at a steady 3.6V higher at its collector than its emitter, so its heat output is directly proportional to the load current. At full current, Q2 will generate 18W of waste heat. The LM317 regulator is operating at low current and with a lower voltage differential. The pre-regulator is specified with a minimum 84% efficiency across its voltage and current range. At full load and rated efficiency, 18W could be generated, shared between the regulator IC, schottky diode and inductor. In practice, the heat generated in this section of the prototype is substantially less than that of Q2. With a potential maximum of 36W heat to be dissipated, this hybrid design is a substantial improvement on the 108W that would be generated by a fully linear design delivering full current near zero volts. The modest heat output allows a moderately-sized heatsink to be fitted into a compact plastic instrument, with a small fan to keep air moving when the heatsink temperature rises. If the heatsink temperature rises too far, the load will be switched off by the control software. In extreme cirsiliconchip.com.au While the control board described in these articles was designed primarily to control this Supply, it it is essentially a style of Arduinocompatible ‘BackPack’ with two powerful 32-bit microcontrollers, lots of flash plus RAM and WiFi and Bluetooth support. So it could be used for a wide range of different projects and tasks, and it has been designed with that in mind. The sections at either side where the pushbuttons and rotary encoder mount can be cut off if they aren’t required for a given design. They can also be wired back to the main portion of the control board if their functions are desired, but placement needs to be changed. Alternatively, headers can be fitted at those locations to provide for more I/O pins than are available at 20-pin box header CON2. Its power supply arrangement is flexible, too. It can be powered from around 7-15V DC applied to the barrel socket, via the USB socket on the ESP-32 module or via the pins of CON2. And we must not forget about the optional onboard micro SD card socket. In summary, it is a very powerful and flexible control module and deserves to be used in other applications! cumstances, the LM317 and LM2679 will trigger their internal thermal shutdown circuits, providing a final layer of protection. There are two heatsink options for this project: a commercial heatsink can be used (Cincon M-B012), or one can be folded up from two pieces of 1.6mm-thick aluminium. As the power dissipation is not that high, either will perform adequately. Plans for the DIY heatsink will be given later. Control board The controller features a powerful ESP32 WiFi system-on-a-chip (SoC), the big brother to the ESP8266 module featured in our D1 Mini BackPack (October 2020; siliconchip.com.au/ Article/14599). It has two CPUs onboard, allowing one to be dedicated to communication functions. While this might seem unimportant, as a 180MHz 32-bit processor has far more capacity than is needed for any but the most ambitious projects, WiFi functions preempt user code in a single-processor design, sometimes creating unacceptable processing delays for real-time applications like this. The ESP32 has 520kB RAM, compared with 80kB in the ESP8266. This is particularly important when overthe-air (OTA) reprogramming is employed, as both the original and the new program need to fit in memory simultaneously. The controller communicates via WiFi, either connecting to a local LAN or setting up its own. Bluetooth communication, both traditional and low-energy (BLE), is also supported, as is serial over USB. Australia’s electronics magazine The ESP32 module plugs into a socket on the control PCB. The DevKit C module we have selected has substantial expansion capabilities (32 pins compared with 16 on the D1). It is an Espressif reference design that has been implemented by multiple board manufacturers, ensuring wide availability and competitive pricing. A 2.8in or 3.5in LCD touchscreen is mounted on the front of the control PCB, along with two momentary switches and a rotary encoder. In this project, they are used (along with an on-screen touch menu) to set the instrument’s configuration and control values. On the left are two more switches and one LED, used as on/off buttons and indicator for the output. The controller’s expansion capabilities are provided on a 20-pin header and include I2C, SPI, serial, GPIO, ADC, DAC and power (3.3V and 5V) pins. It can be powered via a USB cable, an external 5-12V plugpack or via the pin header. The PSU board will power the controller in the finished project, while USB power is used for commissioning. The full range of the control board features are included in a PDF manual which you can get via the following link: siliconchip.com.au/link/ab72 Regulator circuit The full circuit of the regulator board is shown in Fig.4. The incoming DC from the AC-DC switchmode Supply is fed in at upper left, and the output terminals are at upper right. This feeds into the LM2679 preregulator stage (based around REG1), which is controlled by op amp IC3b. May 2021  29 Fig.4: the regulator board includes the switchmode pre-regulator, based around REG1, the final linear regulator stage (REG2, Q1 & Q2) plus control and monitoring circuitry. Digital pot IC2, DAC IC4 and op amp IC3a are used to control the output voltage, while the pre-regulator tracks 3.6V higher due to the operation of the differential 30 Silicon Chip Australia’s electronics magazine siliconchip.com.au amplifier built around IC3b, which drives REG1’s feedback pin. Shunt monitor IC5 feeds a voltage proportional to the output current to the ADC, IC1, which also monitors the input and output voltages and heatsink temperature via 10kΩ Ω NTC thermistor TH1. siliconchip.com.au Australia’s electronics magazine May 2021  31 The final output and the pre-regulator voltages are divided by a factor of 15 (68k/4.7kΩ for VO_SENSE and 6.8kΩ/470Ω for VPRE_SENSE) before being subtracted by IC3b, acting as a differential amplifier. The difference is fed into the feedback (FDBK) terminal of the LM2979. The pre-regulator’s voltage must be 3.6V higher than the output voltage, to allow for the maximum dropout of the final linear regulation stage. So zener diode ZD1 is inserted at the top of the VPRE_SENSE divider. The op amp has moderate DC gain, to ensure accurate tracking despite the FDBK input of REG1 having a 1.2V operating point. The op amp is heavily damped by the 100nF capacitor across its feedback resistor, so its AC gain is close to unity, ensuring that the configuration is stable. Schottky diode (D2) at the FDBK input ensures that the voltage doesn’t swing too far negative at start-up, potentially damaging the regulator. The LM2679’s soft-start and current limiting functions are both enabled, with the 5.6kΩ resistor from its CL_ADJ pin to GND chosen to limit the switching Mosfet’s maximum current to 6.3A. The selection of 3.6V for zener diode ZD1 was a key design decision. Raising the voltage drop across the linear stage increases the waste heat. But if the voltage differential across the LM317 becomes too small, it ceases to regulate and could oscillate in conjunction with the current-boost transistors. Setting the pre-regulator to 3.6V above the output voltage provides a few hundred millivolts headroom for the LM317 at full load, ensuring stability while limiting heat. As the switching frequency is 260kHz, small value output capacitors for the pre-regulator stage adequately control ripple; however, the 47µF electrolytic capacitor must a low-ESR type. RF noise is reduced by adding a 10µF multilayer ceramic capacitor in parallel, which needs to be an X7R or X5R type to ensure a good high-frequency response. The ground plane for the switching pre-regulator is divided off from the rest of the circuit, only meeting at the common ground point. L2 is a toroidal choke, to minimise radiation, as their magnetic field is mostly contained within the device. Eagle-eyed readers will notice that the linear output stage bears a strik32 Silicon Chip ing resemblance to Tim Blythman’s 45V/8A Linear Bench Supply design (October-December 2019; siliconchip. com.au/Series/339). The main difference is that the output voltage is computer-controlled via a 5kΩ digital pot (IC2) and DAC (IC4), using values measured by a 4-channel, 16 bit ADC (IC1). This allows significant software flexibility for current-limiting, circuit protection, remote control and even allows several separate units to operate as a single entity via WiFi connections. The LM317’s coarse output voltage is set by the ratio of the 220Ω resistor between its out and ADJ pins, and the digital pot, IC2. The output voltage will stabilise when the voltage between the LM317’s output (OUT) and adjust (ADJ) pins is 1.25V. The digital pot’s maximum resistance is 5kΩ, providing a maximum output voltage of 30V. The digital pot’s resolution is eight bits, providing control steps of approximately 120mV. This is not sufficiently fine control for our purposes, so the 12-bit DAC and op amp IC3a provide the dual function of fine control and providing a negative offset for the bottom of the digital pot, so the LM317’s output can go down to 0V. The inverting input of IC3a is at 0.7V, set by diode D4. With the op amp gain set to -3.9, this translates to around -2.8V at its output. The DAC delivers an output voltage of 0-3.3V which is divided by the 68kΩ and 1kΩ resistors to give around 47.8mV full-scale, and 186.5mV when amplified. With the DAC set at its midpoint, op amp IC2a delivers around -2.35V, which is the voltage required to bring the LM317’s output voltage down to zero. A negative voltage larger than -1.25V is needed because the digital pot has a finite minimum (wiper) resistance of around 200Ω. Each of the DAC’s 4096 steps corresponds to a 45.5µV change in the output – more than sufficient resolution. When a new output voltage is set, the software calculates the most likely setting for the pot and DAC in one of two ways. If the change is small, only the DAC’s value needs to be changed to accommodate the difference. The initial jump is slightly conservative to avoid overshoot, and a final setting is reached within 4-5 cycles by repeating the process. Australia’s electronics magazine If the change is large, the correct setting for the digital pot is calculated and set, the DAC is set to mid-value, and the fine control algorithm is invoked. As each control iteration takes only 4ms, the settling time is of the order of 20ms. The 100nF capacitor from REG2’s ADJ pin to ground improves regulation by stabilising the voltage on that pin, without increasing the response time. The DAC’s control range is intentionally set at around four digital pot increments, to avoid invoking the coarse adjustment mechanism for small voltage changes, and the consequent disturbance to the output voltage. Current limiting is accomplished in a similar manner, using the ratio of the desired and actual output currents to control the digital pot and DAC settings. While current limiting can be disengaged on the control panel, the software still monitors the output current to provide over-current and short-circuit protection, and keeps the Supply operating within its safe operating area (SOA). The output current of REG2 is boosted by transistors Q1/Q2 acting as a Sziklai pair. When the current through the LM317 exceeds 100mA, the voltage across the 68Ω resistor rises above 0.7V, causing Q1 to conduct and switch on Q2, which passes most of the output current. The combination of Q1 and Q2 has a potential current gain of more than 10,000, so careful attention is needed to ensure stability. A 1µF capacitor provides AC feedback to the base of Q1, and Q1’s 1.5kΩ base resistor is chosen so that the maximum current through Q2 is just above 5A. The 22Ω base resistor for Q2 ensures the current through Q1 is limited to a few hundred milliamps. The 10µF output capacitor is a type chosen for effectiveness at high frequencies, reducing RF noise. An offboard toroidal choke, L3 (not shown in Fig.4), further reduces HF noise. The input and output voltages, output current and the heatsink temperature are monitored by an ADS1115 16-bit analog-to-digital convert (ADC). Each input signal is conditioned to be in the range it can handle, which is 0-2.048V. Simple voltage dividers are adequate for bringing the voltage and temperature values within the ADC’s range. However, the current readings proved unreliable at no load, so siliconchip.com.au the INA282 current sensor’s output is offset by schottky diode D5 to bias its pin 7 REF1 input (a schottky diode has about half the voltage drop of a silicon diode), before being divided by the 4.7kΩ/3.3kΩ resistor pair. With a current shunt of 0.01Ω (10mΩ) and 50V/V gain, this corresponds to 2.5V deflection at the output of the INA282 at 5A output current, and 0.35 – 1.38V to the ADC. This equates to a resolution of 150µA. Q2’s temperature is measured by a thermistor voltage divider, and linearisation is taken care of in software. Q4 turns the fan on when Q2 reaches 35°C. The fan is small and quiet, so simple on/off control is adequate. The output is relay-switched, controlled by a latch built from logic gates (IC6a & IC6b) and NPN transistor Q3. Q3 also drives the LED1 indicator. IC6 ensures that the output is always off at start-up, no matter the state of the microcontroller. The 74C02 dual NOR gate is configured as an SR latch, with the 100nF capacitor providing a brief positive pulse when power is applied, resetting it. IC6 is directly controlled by the on/ off switches on the control board, as well as the microcontroller, ensuring that pressing the off button will always turn off the output immediately, even if the microcontroller is busy with other tasks. Auxiliary ±5V supplies provide power for the logic and op amp, as well as the controller board. Both of these rails are supplied by 3-terminal DC/DC converter modules which have the same pinout as standard linear regulators. We published similar designs in our August 2020 issue (siliconchip.com.au/ Article/14533), but their maximum input voltage of 30V is (just) insufficient here. So we have specified commercial modules which have higher ratings. The 500mA component chosen for the -5V regulator (VR4) has a 31V maximum input voltage for negative output configurations. It cannot be substituted with the 1A version used for the +5V regulator (VR3) which can only handle 27V in this mode. The regulator board connects to the control/display board via CON1, a 20pin box header and a matching ribbon cable with IDC plugs at either end. The 3.3V rail powering IC1, IC2 and IC4 comes from a regulator on the control board via CON1. Power for the control board is fed from the 5V rail on this board, via pins 18 & 20 of CON1. Control circuit The control board circuit is shown in Fig.5, with the ribbon cable from CON1 on the regulator board terminating at matching header CON2. The two main components on this board are the ESP-32 microcontroller and WiFi module and the 2.8in or 3.5in touchscreen. They are connected via an SPI bus and a few digital control lines in the usual manner, allowing the micro to update the screen’s contents and sense touch events. There’s also an optional onboard SD card socket sharing the same SPI bus, although it’s unnecessary for this project. It’s mainly provided as the control board could be used for other purposes, where having onboard storage could be useful. The connections between the ESP-32 and CON2 include the shared SPI bus, two I2C buses, serial, plus several digital I/O pins. Note that many of these are not connected at the other end, and are provided for future expansion. The functions that are used are the first I2C bus (SDA/SCL), to control the Radio, Television & Hobbies: the COMPLETE archive on DVD YES! NA MORE THA URY T N E C QUARTER ICS N O R OF ELECT ! Y R HISTO This remarkable collection of PDFs covers every issue of R & H, as it was known from the beginning (April 1939 – price sixpence!) right through to the final edition of R, TV & H in March 1965, before it disappeared forever with the change of name to EA. For the first time ever, complete and in one handy DVD, every article and every issue is covered. If you’re an old timer (or even young timer!) into vintage radio, it doesn’t get much more vintage than this. If you’re a student of history, this archive gives an extraordinary insight into the amazing breakthroughs made in radio and electronics technology following the war years. And speaking of the war years, R & H had some of the best propaganda imaginable! Even if you’re just an electronics dabbler, there’s something here to interest you. • Every issue individually archived, by month and year • Complete with index for each year • A must-have for everyone interested in electronics Exclusive to: SILICON CHIP siliconchip.com.au ONLY 62 $ 00 +$10.00 P&P Order now from www.siliconchip.com.au/Shop/3 or call (02) 9939 3295 and quote your credit card number. Australia’s electronics magazine May 2021  33 Fig.5: as mentioned earlier, the control panel is designed to be flexible enough that it could be used for other purposes, but it is well-suited to the task of controlling this supply. The main part of this circuit is the ESP-32 module and its connections to the touchscreen and CON2, which connects it to the regulator board. It also carries four pushbuttons switches, a rotary encoder and an LED for enhanced user control. The onboard regulator is not required for this project. USB provides power for setting up; after that, it’s powered from the other board. 34 Silicon Chip Australia’s electronics magazine siliconchip.com.au ADC (IC1), digital pot (IC2) and DAC (IC4) plus four digital I/O lines. These are pin 9, which is the DRDY interrupt signal from the ADC which indicates that a conversion is complete, the on & off switch sense lines at pins 12 & 16, and the fan control line at pin 14. The module can be powered by USB for tethered applications and commissioning. A barrel jack and 5V regulator have been included for projects where external power is required. 5V power can also be supplied via the 20-pin expansion header (CON2), which is the approach used in this project. The ESP module consumes 225mA when delivering its full WiFi output power. The module can provide up to 50mA of 3.3V power for additional logic from the ESP-32’s onboard regulator, and as mentioned earlier, this is taken advantage of by the regulator board. Switches S1 & S2 have pull-down resistors, debounce capacitors and are configured as active-high. While the debounce and pull-down functions can be provided by port configuration and software, adding them in hardware adds little complexity or cost. SW_ON and SW_OFF switch the power supply output in this project. As well as leading to GPIO pins, they are also hard-wired to the expansion connector. The arrangement is slightly unusual in that SW_ON is an input when the power supply’s output is off, but becomes an output (high) after being clicked. It is re-configured to become an input by SW_OFF being depressed. This ensures that LED1 remains lit after SW_ON is released. SW_L and SW_R work with the rotary encoder to allow easy setting of numeric values. The rotary encoder changes the value by one ‘unit’ up (clockwise) or down (anticlockwise) per click. SW_L and SW_R select the magnitude of this unit, which is also highlighted on the screen. SW_L moves the digit being controlled by the rotary encoder to the next digit to the left. This increases the magnitude of the amount added or subtracted for each encoder click by a factor of ten. SW_R has the opposite effect. This arrangement is common on digital instruments, as it allows quick and accurate value adjustments, and is readily mastered. The rotary encoder and its switch are active-low. The microcontroller provides pull-ups for the encoder. The encoder’s push-switch is not used in this project. If required, it can be connected to IO26 on the ESP-32 module via JP3. The current software does not use the touch screen interrupt; however, it can be jumpered to IO2 via JP1. Care should be taken when using IO2 for other purposes, as its state at power-on (along with IO0) determines how the ESP-32 boots up. Next month In our June issue, we will have the full construction details for the Programmable Hybrid Lab Supply plus more information on how to set it up and use it. To whet your appetites, here’s a sneak peak of the completed Programmable Power Supply. We’ll cover complete construction details and setup next month. siliconchip.com.au Australia’s electronics magazine May 2021  35 Parts list – Programmable Hybrid Lab Power Supply 1 ABS instrument case, 260mm x 190 x 80mm [Altronics H0482, Jaycar HB5910, Pro’skit 203-115B] 1 front panel label 1 MeanWell LRS-100-24 switchmode AC-DC converter [Mouser, RS] 1 regulator module (see below) 1 control panel module (see below) 1 IEC mains power socket [Jaycar PP4005] 1 red binding post 1 black binding post 1 green binding post 1 40-60mm 5V DC low-current fan [eg, Altronics F1110] 16 M3 x 15mm panhead screws & hex nuts (for fan, heatsink and front panel) 2 M3 x 15mm countersunk head screws & hex nuts (for IEC connector) 3 M3 x 25mm countersunk head screws (for MeanWell supply and heatsink) 3 4G x 8mm self-tapping screws (for PCB and AC-DC converter) 1 6mm M3 spacer (for MeanWell supply mounting) 1 IEC mains cord with 3-pin moulded plug 1 10cm+ 20-way ribbon cable fitted with IDC plugs 1 1m length of mains-rated hookup wire 1 1m length of 5A DC rated hookup wire 1 50mm length of 6mm diameter heatshrink tubing (for mains connections) 3 3mm ID crimp eyelet lugs for binding posts (optional) 3 TO-220 insulation kits (mica or silicone rubber) 1 TO-3P insulation kit (mica or silicone rubber) 1 small tube of thermal paste (only required if using mica insulating washers) 1 15mm diameter (or larger) ferrite toroid [Jaycar LO1242] 1 2-pin plug & matching socket (for fan) 1 mains socket shroud Parts list – regulator module 1 double-sided PCB coded 18104212, 136 x 44.5mm 1 20-pin IDC box header (CON1) 1 2-pin polarised header & matching plug (CON3) 1 10µH 1A SMD inductor, 4x4mm (L1) [eg, Taiyo Yuden NRS4012T100MDGJ] 1 47µH 5A toroidal inductor (L2) [Altronics L6617] 1 5V DC coil 10A SPDT G5LE relay [eg, Omron G5LE-1-DC5] 1 small heatsink [CINCON M-B012 or cut & bent from 1.6mm aluminium sheet] 1 10k NTC thermistor, eyelet mounting with flying leads [Altronics R4112] Semiconductors 1 ADS1115DGSR ADC, MSOP-10 (IC1) 1 MCP45HV51-502 5k 8-bit I2C digital potentiometer, TSSOP-14 (IC2) 1 LM358D dual single-supply op amp, SOIC-8 (IC3) 1 MCP4725A0T-E/CH 12-bit DAC, SOT-23-6 (IC4) 1 INA282AIDR bidirectional current sensor, SOIC-8 (IC5) 1 SN74LVC2G02DCTR dual 2-input NOR gate, SSOP-8 (IC6; 0.65mm pin spacing) 1 LM2679T-ADJ switchmode regulator, TO-220-7 (REG1) 1 LM317 linear regulator, TO-220-3 (REG2) 1 CUI VXO7805-1000 5V 1A switching regulator module, TO-220-3 (REG3) 36 Silicon Chip 1 CUI VXO7805-500 5V 500mA switching regulator module, TO-220-3 (REG4) 1 BD140 80V 1.5A PNP transistor, TO-126 (Q1) 1 FJA4313 250V 17A NPN power transistor, TO-3P (Q2) 2 BC817 or equivalent 45V, 500mA NPN transistors, SOT-23 (Q3,Q4) 1 SMD LED, M2012/0805 size (LED1) 3 V2F22HM3_H 1A 20V schottky diodes, DO219-AB-2 (D1,D2,D5) 1 STPS1045SF 15A 60V schottky diode, TO-227A (D3) 3 BAS21 or equivalent small signal diodes, SOD-123 (D4,D6,D7) 1 BZV55 3.6V zener diode, SOD-323/mini-MELF (ZD1) Capacitors (all SMD M3226/1210 size unless otherwise stated) 1 270µF 50V low-ESR electrolytic (3.5mm lead pitch, maximum 8mm diameter) 1 47µF 50V low-ESR electrolytic (3.5mm lead pitch, maximum 8mm diameter) 2 10µF 50V X7R SMD M3226/1210 size 3 10µF 35V X7R SMD M3216/1206 size 2 1µF 50V X7R SMD M2012/0805 size 13 100nF 50V X7R SMD M2012/0805 size 1 10nF 50V X7R SMD M2012/0805 size 1 1nF 50V NP0/C0G SMD M2012/0805 size Resistors (all 1% SMD M2012/0805 size unless otherwise specified) 1 820k 2 100k 3 68k 1 39k 3 10k 1 6.8k 1 5.6k 3 4.7k 1 3.3kΩ 1 1.5k 4 1k 4 470 1 220 1 150 1 68 1/2W 1% through-hole axial 1 22 1/2W 1% SMD M3216/1206 size 1 10m 1W 1% wirewound through-hole axial Parts list – control panel module 1 double-sided PCB coded 18104211, 167.5mm x 56mm 1 Espressif ESP32-DEVKITC-compatible WROOM-32 WiFi MCU module [Altronics Z6385A, Jaycar XC3800, NodeMCU-32S] 1 2.8in SPI LCD touchscreen with ILI9341 controller [eg, SILICON CHIP Cat SC3410] 1 2.1mm PCB-mount DC barrel socket (CON1; optional) [Altronics P0620, Jaycar PS0519] 1 20-pin box header (CON2) [WURTH 61202021621 or similar] 1 40-pin female header (cut into two strips of 19) 1 SMD micro SD card socket (optional) [Hirose DM3D-SF] 1 rotary encoder (RE1) [Alps EC12E, eg, Jaycar Cat SR1230] 1 knob for rotary encoder [eg, Altronics H6514 (23mm) or Adafruit 2055 (35mm)] 4 12mm SPST PCB-mount tactile switches with square actuators (S1-S4) [Altronics S1135, Jaycar SP0608] 2 black, white or grey switch caps [Altronics S1138] 1 red switch cap 1 green switch cap Semiconductors 1 7805T 5V 1A linear regulator (REG1; optional) 1 5mm red or green LED (LED1) Capacitors 1 47µF 10V X5R/X7R SMD (M3226/1210 size) 1 10µF 25V X5R/X7R SMD (M3226/1210 size) 9 100nF 50V X7R SD (M2012/0805 size) Resistors (all SMD 1% 1/10W M2012/0805 size) 3 10k 2 1.8k 1 1k Australia’s electronics magazine SC siliconchip.com.au