Silicon ChipMax’s Cool Beans - June 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions
  5. Publisher's Letter: How to annoy customers and lose them
  6. Feature: Positivity follows the gloom by Mark Nelson
  7. Feature: The Fox Report by Barry Fox
  8. Project: Net Work by Alan Winstanley
  9. Project: Full-wave Universal Motor Speed Controller by JOHN CLARKE
  10. Project: 8-pin 14-pin 20-pin PIC PROGRAMMING HELPER by TIM BLYTHMAN
  11. Project: Advanced GPS Computer by Tim Blythman
  12. Feature: Max’s Cool Beans by Max the Magnificent
  13. Back Issues: Max’s Cool Beans by Max the Magnificent
  14. Feature: Circuit Surgery by Ian Bell
  15. Feature: Make it with Micromite by Phil Boyce
  16. Feature: AUDIO OUT by Jake Rothman
  17. Feature: Electronic Building Blocks by Julian Edgar
  18. PCB Order Form
  19. Advertising Index

This is only a preview of the June 2022 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)
Max’s Cool Beans By Max the Magnificent Flashing LEDs and drooling engineers – Part 28 A s you may recall, in a previous column (PE, May 2022) I made mention of a modern incarnation of an analogue computer called The Analog Thing (THAT) (https://bit. ly/370WEZH). While mulling over this fascinating device, I was reminded of some nuggets of knowledge and tidbits of trivia that I wanted to share with someone, and it looks like you aren’t in any position to get away, so... When analogue ruled and digital drooled Way back in the mists of time, the first true electronic systems were created using vacuum tubes (‘valves’ in the British vernacular and ‘tubes’ in North American parlance). These little rascals could act like diodes or switches or amplifiers. Early tube-based systems, like 1920s radios, were analogue in nature. I have the greatest respect for the people who used to conceive and realise the most amazing analogue systems, often with naught more than a couple of tubes and a handful of resistors, capacitors and inductors. As I’ve mentioned on many an occasion, I’m a digital design engineer by trade and I find the wibblywobbly nature of analogue systems to be disquieting. In the case of even the simplest tube-based system, I can peruse and ponder its schematic diagram for hours without having a clue as to its purpose in life or the way in which it was intended to perform its magic. By comparison, any of my chums at the Alabama Historical Radio Society (ALHRS.org) could glance at the self-same schematic and then discourse for hours on the topic of, ‘flobulating retrograde inductive couplings titivating the phase-change modulation’ (or words to that effect). The thing about analogue signal processing (ASP) is that you can do a tremendous amount of stuff with very little stuff, if you see what I mean. For example, adding two sine waves while filtering out any high-frequency noise is ‘easy peasy lemon squeezy’ using analogue techniques. By comparison, implementing the same functionality using digital signal processing (DSP) requires you to develop an appropriate algorithm and 40 tends to require an overly enthusiastic quantity of digital logic gates and registers, thereby leaving you ‘stressed depressed lemon zest,’ as it were. On the other hand, as we’ve previously discussed, there are several issues with analogue systems, not least that – in the case of computers – you rarely get the same answer twice (there’s always some difference, no matter how small). Another aspect of analogue is the way in which it tends to degrade information. In the days of video tapes, for example, if you took a video of grandma’s birthday, and you made a copy for your aunt, and she made a copy for her friend, and... it wasn’t long before the downstream copies became unwatchable. By comparison, when performing processing using digital techniques, you always get the same answer (unless you’ve messed something up), which I find to be comforting. Even better, the use of error checking and correction (ECC) codes makes it possible to make copies of copies of copies, with the last being identical to the first (hurray!). But we digress... The rise of digital Early digital computers, circa the beginning of the 1940s, were typically electromechanical (using relays) and/or electronic (using tubes). Most of these machines worked in decimal (base-10) and operated only on integers. Interestingly, a German engineer called Konrad Zuse had a fully mechanical, binary, floating-point computer called the Z1 up and running in 1938, but that’s a story for another day. Not surprisingly, machines based on these antediluvian technologies were fulsome in size and greedy for power. As I wrote in Bebop Bytes Back (https:// amzn.to/3MdgfFh), the Harvard Mark I, which was developed in America between 1939 and 1944, was constructed out of switches, relays, rotating shafts, and clutches, and was described as sounding like ‘a roomful of ladies knitting.’ This machine contained more than 750,000 components, was 50-feet (15m) long, 8-feet (2.5m) tall, and weighed approximately five tons! Similarly, the Electronic Numerical Integrator and Computer (ENIAC), which was constructed at the University of Pennsylvania between 1943 and 1946, was 10-feet (3m) tall, occupied 1,000 square feet (90m2) of floor-space, weighed in at approximately 30 tons, and used more than 70,000 resistors, 10,000 capacitors, 6,000 switches and 18,000 vacuum tubes. The final machine required 150kW of power, which was enough to light a small town at that time. One of the greatest problems with computers built from vacuum tubes was reliability. For example, 90% of ENIAC’s down-time was attributed to locating and replacing burnt-out tubes. Records from 1952 show that approximately 19,000 vacuum tubes had to be replaced in that year alone, which averages out to about 50 tubes a day! Another consideration was that engineers who were conversant with the continuous nature of the analogue world could often handle the concept of asynchronous digital logic, but they found it difficult to comprehend the nuances of synchronous (clocked) digital systems. Things weren’t helped by the fact that digital techniques themselves were not well understood at that time. Life for computer pioneers started to get easier with the invention of semiconductor diodes and transistors, and even easier with the invention of integrated circuits. It also didn’t hurt that we gained a better understanding of digital logic and its wily ways. Once we started building semiconductor-based processors, things like DSP really started to take off. These days, we can build chips with hundreds of millions of transistors (some have billions, a few have trillions), which explains why we now do so much processing using digital techniques. Change is scary On my meandering journey through life, I’ve met engineers who had black belts in designing with vacuum tubes, but who couldn’t wrap their brains around using semiconductor devices like discrete (individually packaged) transistors. I’ve also come into contact with analogue designers who could happily create masterpieces using discrete transistors, resistors and capacitors, but who couldn’t Practical Electronics | June | 2022 grasp the concept of digital functions like the primitive logic gates (NOT, AND, OR, NAND, NOR...) and register elements (latches, flip-flops...) provided in jellybean integrated circuits (ICs) such as the Texas Instruments 7400-series chips. Even today, I know some digital engineers who are as happy as clams creating assembly language programs to run bare metal on 8-bit microcontrollers, but who would run for the hills if you asked them to write a program in C and/ or create an application to run under an operating system. (Incidentally, the term ‘bare metal’ refers to a computer system without a base operating system or any installed applications.) Reports of analogue’s death I can’t tell you how many times I’ve heard the old chestnut that a newspaper prematurely published an obituary for Samuel Clemens, who we know by his pen name of Mark Twain, and that he responded by saying, ‘The reports of my death are greatly exaggerated.’ It’s unfortunate that this story is itself something of an exaggeration, but – as I learned at my mother’s knee – one should never let facts get in the way of a good story. I think it was around the 1980s when I first started to notice industry pundits proclaiming the demise of analogue electronics. ‘Digital is destined to rule the world,’ they cried. Unfortunately, a lot of young people believed them, leading to a lack of students wishing to learn the analogue arts. Paradoxically, the resulting dearth of analogue engineers in the 1990s made these people valuable commodities, capable of demanding high wages. Even more paradoxically, engineers skilled in analogue are in ever-increasing demand today. Part of this is because – as analogue buffs delight in telling anyone who will listen – everything is analogue, including digital, which they regard as being a sub-set of analogue (the cheeky scamps). Much as it pains me to admit it, this is true as far as it goes. Although digital designers like to think of their signals as instantaneously transitioning between 0 and 1 values with razor-sharp edges, these signals take time to transition (think ‘slopes’) in the real world. Also, the faster we try to convey data through the copper wires on our circuit boards, the more their signals succumb to analogue effects, with their envelopes degrading before our very eyes. The bottom line is that, without the help of analogue engineers, we digital designers would be unable to perform our own magic. Fig.1. The purely analogue artificial neural network AML100 uses near-zero power to detect events and make inferences and conclusions (Image source: Aspinity). and machine learning (ML) tasks are realised using digital techniques. By some strange quirk of fate, however, I’ve recently been seeing an increasing number of analogue implementations. For example, the guys and gals at Aspinity.com recently launched the first member of their AnalogML family, the AML100, which they describe as: ‘The industry’s first and only tiny machine learning solution operating completely within the analog domain’ (Fig.1). The AML100, which is presented in a small 7 x 7 mm 48-pin QFN package, uses near-zero power to ito detect events and make inferences and conclusions (it actually consumes <20µA while alwayssensing). With up to three inputs from sensors like MEMS microphones or accelerometers, the ANN in the AML100 can be trained to recognise things like the sound of glass breaking or a human speaking (it doesn’t understand the words, to be clear, but it can tell the difference between a person talking and a cat meowing or a dog barking, for example). Consider a smart speaker like an Amazon Echo, Apple HomePod, or Google Home. Such a device typically boasts a hierarchy of processors. Since it isn’t doing anything for most of the time, the main application processor (AP) spends much of its time asleep, leaving a smaller, lower-power processor to keep a watchful eye (well, ear) open in the hope of hearing the system’s wake-word spoken. This wake-word is ‘Alexa’ in the case of the Echo, and I know two people called Alexa who, much like Queen Victoria, are not amused. Although the wakeword processor consumes less power than the AP, it’s still digital in nature, which means it’s probably consuming more power than we would like it to, if we were given a choice. There’s also the fact that, out of all the sounds going on in my office (air conditioner blowing, keyboard clicking, Geiger counter beeping, my head banging on the wall, the sound of a man sobbing...), a human speaking occurs only a small portion of the time because I’m alone in the Fig.2. Mantis AIS SoC next to a 19mm-diameter US one-cent ‘penny’ piece. (Image source, AIStorm). Analogue AI At the time of this writing, most of the artificial neural networks (ANNs) used to implement artificial intelligence (AI) Practical Electronics | June | 2022 41 Fig.3. Audio Weaver’s intuitive interface (Image source: DSP Concepts). office and I don’t talk to myself (or, if I do, I don’t listen to myself). In fact, any human speech is pretty much confined to me warbling on a video conference call or saying, ‘Alexa, set a reminder.’ Now, suppose we were to add an AML100 into the hierarchy. In this case, the wake-word processor can itself take a well-deserved snooze. The analogue AI in the always-on AML100 listens to everything that’s going on around it, only rousing the wake-word processor when it detects someone speaking. Pretty clever, huh? Another example of analogue AI is presented by the chaps and chapesses at AIStorm.ai. These are jolly nice people, but it has to be admitted that they are overly fond of saying ‘An AI storm is coming.’ Consider a traditional CMOS imaging sensor setup in which the output from the sensor is passed through an analogue-to-digital converter (ADC), which feeds an image signal processor (ISP), which passes the data to a digital AI running in a digital signal processor (DSP), microcontroller unit (MCU), graphics processing unit (GPU) or fieldprogrammable gate array (FPGA), none of which are lightweights on the powerguzzling front. By comparison, AIStorm’s Mantis AIin-Sensor (AIS) System-on-Chip (SoC) transforms the sensor into the input layer of an analogue AI. Discarding the 42 digitisation stage, the Mantis (Fig.2) uses the sensor charge to directly couple to the first of multiple layers of analogue neurons. The bottom line is that, using a miniscule amount of energy, the Mantis can evaluate the current situation and make an appropriate determination (‘A human just entered the room’) before a digital AI would have even laid its metaphorical eyes on the first byte of data from the sensor. Weaving audio designs What? You want more? Well, I’m just the man for the task. Let’s turn from analogue to digital. I recently spent a happy afternoon chatting with the folks at DSPConcepts.com. Not being an audio buff myself, I hadn’t really thought about this prior to our conversation, but they pointed out that there are frameworks and design environments to help us work efficiently and productively in almost every engineering discipline other than audio. It’s true! If you wish to create a website, you take advantage of a modern web development platform; if you desire to construct a touch panel, you reach for an existing graphics library and widget toolkit; if you ache to implement an AI system, you leverage an appropriate framework; and on it goes. And then there’s audio. I don’t know if you’ve noticed, but compared to the way things were just a few short years ago, awesome audio experiences and sumptuous soundscapes now feature prominently in our daily lives. The problem is that developers of audio systems have been largely obliged to design everything from the ground up, which is a painstaking and time-consuming way of going about things to say the least. To address this problem, the folks at DSP Concepts have created an awesome product called Audio Weaver (Fig.3). All I can say is that the things I heard about Audio Weaver and its intuitive, drag-and-drop graphical user interface (GUI) were music to my ears (I’m sorry, I couldn’t help myself). Suppose you wish to create something like a smart speaker that involves an array of microphones and one or more loudspeakers. This is where Audio Weaver leaps to the fore with a shemozzle of Zeusaphones. You can drag-and-drop functional blocks like noise reduction, echo cancellation, equalisation, compression, beamforming... (there are 500+ modules created by leading audio designers) and connect them together as you wish. Audio Weaver also boasts a runtime core equipped with highly optimised target-specific libraries for use on a wide range of processors from ARM, Cadence, CEVA, TI, Qualcomm… (once again, the list goes onand on). If you are interested in learning more, you might start with the Audio Practical Electronics | June | 2022 Weaver video from CES 2022 (https://bit. ly/3JOEcRI). After this, if you wish to explore further, the folks at DSP Concepts say that Audio Weaver is for everyone, from hobbyists to seasoned audio professionals. They currently offer a 30-day free trial for anyone interested in getting started (https://bit.ly/3M7V5Zf). Furthermore, with every download of Audio Weaver, they include example audio signal flows and algorithms (loudspeaker processing, SPL meters, reverb...) so that new users don’t have to build their audio processing signal chains from scratch. Are you taking notes? For more years than I care to remember, I’ve been using the Notepad editor that comes with Windows for a variety of different tasks, such as taking the contents of a Word document and stripping out all of the hidden control codes, for example. As useful as Notepad is, however, there are a lot of things it could do better. To be honest, I hadn’t really given much thought to this until a few days ago when my eyes were opened to a world of possibilities. In an earlier column (PE, December 2021), I introduced my chum Guido Bonelli (aka Dr Duino). If you visit Guido’s website (DrDuino.com) you’ll see his Dr.Duino Pioneer and Explorer kits, which are awesome when it comes to developing and debugging Arduino Uno and/or Nano-based projects. Guido has started hosting a monthly online video get together for his customers, during which he shares tips and tricks and new projects. This is followed by a member of the audience demonstrating one of his or her Arduino-based projects. For the inaugural meeting, Guido asked me if I could present one of my own projects to give them an idea of what he’s looking for on the participation front. Just for giggles and grins, I walked them through my 12x12 Pingpong Array project, which we first started discussing here in PE, March 2020. The thing is, as part of his portion of the proceedings, Guido mentioned a free editor called Notepad++ (pronounced ‘Notepad-Plus-Plus’), which you can download from Notepad-Plus-Plus.org (a word to the wise, make sure you click only the ‘Download’ button located under the image of the cardboard box with ‘Notepad++’ written on the side – don’t be distracted with any of the other ‘Download’ or ‘Start Now’ buttons that are there to tempt the unwary). All I can say is Notepad++ is the answer to my text editor dreams, not least that you can have multiple files open simultaneously, and you can switch back and forth between them by simply clicking their tabs (Fig.4). Furthermore, Notepad++ is a context-sensitive, color-coded editor that inherently understands Practical Electronics | June | 2022 Fig.4. Notepad-Plus-Plus is the answer to my text editor dreams. languages like BASIC and C/C++. Even better, it allows you to open Arduino sketch (.ino) files and library (.h and .cpp) files. Although I didn’t know it or have use for it at the time (this has changed as we will discuss), Notepad++ also understands things like PIC microcontroller assembly source code (.asm) files and machine code (.hex) files. Before we proceed, one little trick that can make your life a lot easier is that – assuming you are using Windows (there is no Notepad++ for Macs) – you can simply drag-and-drop a file from a File Explorer window into the Notepad++ working area to open that file (I just ran a quick test to discover that we can do the same thing with the classic Notepad. I tell you; I learn something new every day). The wonderful world of PICs Are you familiar with PIC (‘pronounced ‘pick’) microcontrollers from Microchip Technology? These are derived from the 8-bit PIC1650, which was originally developed by General Instruments, who introduced it to the market in 1976. Initially, PIC stood for ‘Peripheral Interface Controller,’ but it now stands for ‘Programmable Intelligent Computer’… probably… possibly… the world hasn’t quite agreed on this, so we stick with just ‘PIC’. These days, there is a baffling and bewildering assortment of 8-bit, 16-bit, and 32-bit PICs available, each offering a different collection of features and functions, such as the number of generalpurpose input/output (GPIO) pins, the number of analogue-to-digital converters (ADCs), the number of counter/timer/ PWM functions, and... the list goes on. There are many wonderful things about PICs, such as the fact they support a wide range of supply voltages (2.3V to 5.5V in the case of the 8-bit devices I’m currently working with) and they are available in both surface-mount technology (SMT) packages and lead through-hole (LTH) dual in-line packages (known as DIPs or DILs). There are also some not-no-wonderful facets to these devices, especially the earlier 8-bit ones, whose Byzantine RAM and register banking architecture can bring a strong man to tears (I’m dabbing my eyes as I write these words). As a result, the last thing you want to do if you are new to PICs is to try to program them in PIC assembly language. All of which brings us to the fact that, for reasons too tortuous to talk about here, I find myself in the position of having to maintain and enhance code whose purpose I may not disclose for a company whose name must remain unspoken … but I fear I’ve said too much. Wouldn’t you know it, this code, which dates back to the dawn of time, was captured in PIC assembly language by someone to whom programming did not come naturally. When I originally undertook this task, I was informed that the code was heavily commented. This is certainly true as far as it goes. Unfortunately, the code evolved over time, while the comments... didn’t. ‘Oh dear,’ I said to myself (or words to that effect). I now have code for multiple members of the PIC dynasty to maintain. I’ve programmed in a variety of assembly languages – I’ve even designed my own – so I downloaded the 279-page manual for the first device (if there’s one thing you can say about Microchip, it’s that they have an awesome archive of documentation). Earlier, I used the word ‘Byzantine’; I fear this was understating the complexity of the task. I must admit that I was starting to feel a tad overwhelmed. ‘Alas, alack, my end is in sight,’ I thought to myself, but then I remembered... Joe. 43 Fig.5. Hex file size comparison: original (left) vs. new (right). Are you Positron? My old friend Joe Farr in the UK has a black belt when it comes to creating PIC-based gadgets and gizmos. He can whip up a printed circuit board (PCB) design for a PIC-controlled thingamajig or thingamabob and have it programmed and ready for action while the rest of us are still rooting through the dictionary to check the spelling of ‘thingamabob.’ So, I set up a Zoom call with Joe, during which I explained my predicament. After looking at the assembly code in question, Joe suggested that we take another tack, which was to rewrite everything in BASIC. I’m sure your eyebrows just started quivering on full alert as did mine. However, Joe went on to explain that – when it comes to programming PICs – he’s a huge fan of the Positron PIC BASIC Compilers created by Les Johnson (https://bit.ly/3rtDcw8). A onetime PayPal payment of only £39.99 will gain you access to the latest and greatest compilers, along with any and all future updates and upgrades. I immediately reached out to Les and placed my order. It really is a small world because Les quickly responded, acknowledging my order and saying that he had read my book, Bebop to the Boolean Boogie (https://amzn.to/3jIt5PU). It seems that Les also reads my columns here in PE, which means he will be reading this one, which means I’d better say only nice things about him. One point that puzzled me was the use of ‘compilers’ (plural). Les explained that he supplies different compilers for 8-bit and 16-bit PICs, and that both are included. The accompanying integrated development environment (IDE) selects the appropriate compiler based on the device specified in the code, all of which is invisible to the user, which is just the way I like it. Following an email exchange, Les also told me how his dear old dad started telling him about electronics ‘from when I 44 was able to walk and talk.’ As a result, Les could name the parts in a television set when he was 3-years old, and he was making radios and amplifiers and suchlike by the time he was 7-years old. The story behind the evolution of the Positron Compilers is captivating. Sadly, we don’t have the time to go into it here. Suffice it to say that these bodacious beauties have been designed from the ground up to produce the most efficient PIC assembly code possible. As an example, I just used my spiffy Notepad++ editor to view and compare the .hex file generated from the original hand-coded assembly with the .hex file resulting from Joe’s BASIC program implementing the same underlying algorithm (I blurred the results to conceal the captivating cunningness of this code). As we see, the new version is around half the size of the original, and fewer instructions generally results in higher performance, all of which leaves my visage adorned with a gleeful grin (Fig.5). What’s that bit do? I have so much to talk about regarding my adventures with PICs but – unlike Doctor Who – I’m somewhat limited in terms of time and space. One consideration is that I need some way to program the little ragamuffins. I ended up purchasing a couple of PICkit 3 programmers. I opted for PICkit 3s (https:// amzn.to/3vm0IMR) rather than PICkit 4s (https://amzn.to/3jKKwz4) because (a) they were much cheaper (£18.79 vs. £142.99 in the UK, and a similar difference in the USA where I currently hang my hat), (b) they handle all the devices I currently need to deal with, and (c) Joe told me this was a good way to go. The reason I purchased two units is that Joe says it’s easy to brick these little rascals, in which case you can use one to flash (re-program) the other (the term ‘brick’ or ‘bricking’ refers to rendering an electronic device unusable, often as the result of a failed software or firmware update). Something else I need is a development board to program and test my PICs. This board has to be tailored to verify the cunning algorithms we’ve loaded into the devices. This includes the board having its own integrated test pattern generator, which we can implement in the form of another PIC (I tell you; my eyes have been opened wide to the wonderful world of PICs). Joe and I bounced a few ideas back and forth, then we called it a day. You can only imagine my surprise and delight when we Zoomed again the following morning to discover that Joe had gone ahead and designed the board. I will tell you more about this little beauty (the board, not Joe) in a future column. The reason I mention it here is that, as Joe was walking me through his design, I asked, ‘what’s that bit do?’ To which Joe responded, ‘I included my usual power supply circuit.’ When I enquired further, Joe explained that he rarely powers his creations using a USB interface because you can’t count on it providing you with a solid, spoton 5V supply. Instead, he implements his own little circuit that can accept a 7 to 25V input, AC or DC (the DC can be either polarity), and it will generate rock-solid 5V and 3.3V DC values to power his electronics. The fact that the DC can be any polarity struck a chord with me. Most of the little power jacks with which I come into contact have a +ve inner and 0V outer. Having said this, I once picked up a secondhand pair of tasty computer speakers, which I connected to one of my old power blocks. Unfortunately, they expected a 0V inner and a +ve outer, which I realised around the same time the smoke started to appear. While we were chatting about this, it struck me that this could be a useful circuit for a lot of people, so I asked Joe if he could whip up a standalone version for me to share here, and he promptly did so. Feel the power! The circuit diagram for Joe’s handy-dandy power supply unit (PSU) is shown in Fig.6, while the PCB layout is presented in Fig.7. Although your knee-jerk reaction may be that there’s nothing revolutionary here, experienced hands will recognise that the design and physical realisation reflect years of experience. We start with a bridge rectifier (BR1), which provides full-wave rectification from a two-wire AC input. If the input is DC, this also allows the power to be connected with the +ve on the inner or the outer of the jack. The bridge rectifier is followed by a smoothing capacitor (C1). The smoothed output from the bridge rectifier is fed to the input of the first regulator (IC1), and also as a raw value to the output connector (SK2). The output from the first regulator is fed as input to the second regulator (IC2), and also to the output connector (SK2). In my case, I need 5V and 3.3V outputs, so that’s what’s reflected in the schematic. However, by swapping out the regulators, you can generate a variety of voltage combinations, such as 12V and 5V, for example. Parts list – Joe Farr PSU SK1 This can be any PCB barrel-type connector with the correct footprint. Alternatively, you can skip the connector and just connect directly to pads ‘a’ and ‘b’ on the PCB. Practical Electronics | June | 2022 Fig.6. Schematic diagram for Joe Farr’s handy-dandy PSU. SK2 A 5-pin Molex-type connector is ideal as it allows for the board to be easily disconnected from the rest of the project. However, you could use any 5-pin connector with a standard 0.1-inch / 2.54mm pitch, or you could solder header pins, or even solder wires directly to the PCB. BR1 Any bridge rectifier with a working voltage of at least 50V and rated for a minimum of 1A (always slightly more than the combined maximum load of the board) can be used. C1 This capacitor must have a voltage rating higher than the maximum expected board input voltage (see Note 1 below). C2,3 Pretty much any 100nF capacitors with a working voltage greater than 35V can be used. C4 If IC2 is an LD1117V33 regulator, a 10µF/16V capacitor is ideal here. However, if a 78xx regulator is used for IC2, then this capacitor should be changed for another 100nF capacitor, identical to C2 and C3. R1 The resistor value used depends on what output voltage will be used to drive LED1 (see Note 2 below). This resistor should be ¼-watt rated. LED1 Any 5mm or 3mm LED with a forward voltage of around 2V can be used here. IC1 Any 78xx regulator can be used (see Note 1). IC2 The original design is specified as using an LD1117V33 LDO (Low Dropout) regulator. Make sure that the input voltage to the regulator (coming direct from the bridge rectifier or from IC1), is within an acceptable range for this regulator (see Note 1). To capture this design, Joe used the DipTrace schematic and PCB design software package (diptrace.com). Joe has kindly made all of his design files available. You can download a compressed ZIP (file CB-June22-01.zip) containing the schematic and foil files from the June Practical Electronics | June | 2022 Fig.7. PCB layout for Joe Farr’s handy-dandy PSU. 2022 page of the PE website (https://bit. ly/3oouhbl). Also, file CB-June22-02. zip contains all the Gerber and other files required to fabricate the board. If you wish, you can download a free version of DipTrace that will allow you to open, modify, and print the schematic and layout files and also generate updated Gerber files (https://bit.ly/3uQfZ9B). Joe has designed this board to be singlesided, so those with their own facilities can make the PCB. Alternatively, you can ask a PCB house to take the Gerber files and do all the hard work for you. The voltage regulators don’t really need to be bolted to the PCB unless you are attaching heatsinks, which can be homemade if required. On the other hand, bolting the regulators to the PCB does add to the mechanical stability, so it’s usually a good idea. However, be very careful to not allow the mounting bolts or heatsinks to come in contact with anything electrically connected to the circuit. Note that some regulators – the LD1117V33 being a prime example – have the metal mounting tab connected to the device’s output pin. By comparison, 78xx regulators have the mounting tab connected to the center (ground) pin. PSU design notes Joe provided the following design notes to help you get the most out of his PSU: Note 1: The regulator used for IC1 can be any 78xx-style regulator. Do not attempt to use a 79xx series regulator anywhere on this board as the pin-out is different. The regulator works by taking the input voltage and lowering it to match its specified output voltage. The difference between the input and output voltage is dissipated as heat and the regulator can get extremely (‘burn the skin off your finger’) hot. To minimise the heat being dissipated, try to match the input voltage so that it’s around 3V higher than the output of the regulator. When running the board from DC, allow for the bridge rectifier to drop your input voltage by around 1V. You should make sure that the new voltage is sufficient for the input of the regulator you have chosen. When running the board from AC, you need to be careful since the rectified and smoothed DC produced by the bridge rectifier in combination with the capacitor C1 can exceed the maximum voltage rating of the capacitor, especially when there is little or no loading on the PSU output. Always check the datasheet for the specific voltage regulator(s) you are using to make sure you comply with recommended voltage input ranges. If the input voltage to either regulator is too high, that regulator may run hot, with the temperature increasing as you increase the current draw. If the input voltage is too low, the regulator will be unstable and not supply a regulated voltage correctly. Note 2: Depending on the input voltage applied to the LED, the R1 resistor value needs to be adjusted to give a reasonable brightness. Aiming for around 10mA, which gives a nice brightness without stressing the LED, some suggested 45 Your best bet since MAPLIN Chock-a-Block with Stock Visit: www.cricklewoodelectronics.com O r p h o n e o u r f r i e n d l y kn o w l e d g e a b l e st a f f o n 020 8452 0161 Components • Audio • Video • Connectors • Cables Arduino • Test Equipment etc, etc chair in the family room using spoken commands (thank you, Alexa) to control the lights, turn on the television, and search for programs of interest. I think they would have seen this as a sign that people were turning into ‘weeds and wets’ as the celebrated English philosopher Nigel Molesworth (https:// bit.ly/3hEJnIj) might have said regarding his fellow pupils at the legendary English prep school, named ‘St Custard’s’. The reason I mention this here is the sentiment, ‘What has been will be again, what has been done will be done again; there is nothing new under the sun,’ as the Preacher writes in Ecclesiastes 1:9. In my previous column (PE, April 2022), for example, I noted that the pushbutton and toggle switches of the type with which we are familiar originally appeared on the scene circa 1880 and 1916, respectively. Well, I recently ran across an interesting article – At the Interface: The Case of the Electric Push Button, 1880-1923 – by media studies scholar Rachel Plotnick (https://bit.ly/3I3Nc4y). In Rachel’s article we discover that, in 1916, the educational reformer, social activist, and best-selling American author Dorothy Canfield Fisher warned that ‘There is a great danger of coming to rely so entirely on the electric button and its slaves that the wheels of initiative will be broken, or at least become rusty from long disuse.’ All I know is this this tidbit of trivia is going to stick in my mind for years to come because I now think of it whenever I make use of a pushbutton (goodness only knows what Dorothy would have thought about Alexa). Don’t lose your head Visit our Shop, Call or Buy online at: www.cricklewoodelectronics.com 020 8452 0161 Visit our shop at: 40-42 Cricklewood Broadway London NW2 3ET resistor values for different voltages are: 3.3V = 150Ω, 5V = 330Ω, 12V = 1kΩ, 15V = 1.2kΩ. There are two options for IC2. The original design uses an LD1117V33 3.3V regulator. These regulators should use the IC2a pads as they have a different pin-out compared with the more common 78xx series devices. If you wish to use a 78xx for the second regulator, then the pads labelled IC2b should be used. Voltage options: Regulator IC1 is always fed directly from the output of the bridge rectifier and capacitor C1. However, depending on requirements, there are two possibilities for driving regulator IC2. If you wish, it can be fed directly from the bridge rectifier (fit jumper C to E). Alternatively, it can be fed from the output of IC1 (fit jumper D to E). This latter option is useful if the voltage output of IC1 is higher than the minimum input voltage required for IC2. This will reduce heat, but it assumes that regulator IC1 has sufficient capacity to provide power to your circuit as well as power to regulator IC2. Problems with pushbuttons We didn’t have remote control for our television when I was a young whippersnapper growing up in England. In addition to the fact that there were only two TV channels, called BBC1 and ITV (at least, this was the case until 1964 when BBC2 arrived on the scene), people would have considered it to be the height of laziness to control things from the comfort of the sofa rather than getting up and ambling across the room. Similarly, we didn’t have things like a dishwasher (unless you were to count my dad) or a garage door opener (unless you were to count me), because these were tasks the fates had ordained we undertake by the sweat of our brows. I don’t know what my grandparents would have thought to see me today, ensconced in my command 46 I know, I know... I haven’t even mentioned the animatronic robot head created by my friend Steve Manley with some (hopefully) helpful suggestions from yours truly. I also remember that I promised to talk about stepper and servo motors and topics of that ilk, and I shall, but not today because I am being buffeted by a maelstrom of happenings and it’s all I can do you keep my nose above the metaphorical waterline. What? 1000001? Me? ‘Eeek Alors,’ as my dear friend Shears used to say, because this is the month – May 2022 – that I reach the ripe old age of 65 (or 1000001 in binary). Shears was my best friend at high school, and we shared many life experiences, like seeing Pink Floyd play Dark Side of the Moon at the Knebworth open air concert in 1975. When I went to university, Shears set off on an extended tour around Europe, largely living off his wits. Sometime after I completed my degree and commenced my first job in Manchester, he came to visit for a weekend and stayed for two years. Oh, the times we had. Why ‘Shears’? Well, his real name was Mark Burkinshaw, so his friends alliteratively renamed him ‘Billy Burkinshaw’, which (following the release of the Sgt. Pepper’s Lonely Hearts Club Band album by the Beatles in 1967) led to ‘Billy Shears’, which was subsequently truncated to ‘Shears’ (my dad used to call him ‘Scissors’). Shears and I would both have reached 65 within a few weeks of each other. Unfortunately, the silly sausage found himself in close vicinity to the Chernobyl nuclear power station in Ukraine when it melted down in 1986 (what are the odds?). Happily, he was able to dance at my wedding when I married my wife (Gina the Gorgeous). Sadly, he passed away a couple of years later from an unusual type of aggressive brain tumor. I miss him a lot. I will raise a glass or three to both of us on my birthday. Cool bean Max Maxfield (Hawaiian shirt, on the right) is emperor of all he surveys at CliveMaxfield.com – the go-to site for the latest and greatest in technological geekdom. Comments or questions? Email Max at: max<at>CliveMaxfield.com Practical Electronics | June | 2022