Silicon ChipMax’s Cool Beans - February 2025 SILICON CHIP
  1. Contents
  2. Publisher's Letter: AI is incredible but still in its infancy
  3. Feature: Net Work by Alan Winstanley
  4. Project: Laser Communicator by Phil Prosser & Zak Wallingford
  5. Feature: Circuit Surgery by Ian Bell
  6. Feature: The Fox Report by Barry Fox
  7. Feature: Practically Speaking by Jake Rothman
  8. Feature: Techno Talk by Max the Magnificent
  9. Subscriptions
  10. Feature: Max’s Cool Beans by Max the Magnificent
  11. Project: Points Controller for Model Railways by Les Kerr
  12. Feature: Precision Electronics, part two by Andrew Levido
  13. Feature: The History of Electronics, part two by Dr David Maddison
  14. Project: Mains Power-Up Sequencer, part one by John Clarke
  15. Back Issues
  16. Feature: Using Electronic Modules: 1-24V Adjustable USB Power Supply by Jim Rowe
  17. PartShop
  18. Market Centre
  19. Advertising Index
  20. Back Issues

This is only a preview of the February 2025 issue of Practical Electronics.

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

Articles in this series:
  • Win a Microchip Explorer 8 Development Kit (April 2024)
  • Net Work (May 2024)
  • Net Work (June 2024)
  • Net Work (July 2024)
  • Net Work (August 2024)
  • Net Work (September 2024)
  • Net Work (October 2024)
  • Net Work (November 2024)
  • Net Work (December 2024)
  • Net Work (January 2025)
  • Net Work (February 2025)
  • Net Work (March 2025)
  • Net Work (April 2025)
Articles in this series:
  • Circuit Surgery (April 2024)
  • STEWART OF READING (April 2024)
  • Circuit Surgery (May 2024)
  • Circuit Surgery (June 2024)
  • Circuit Surgery (July 2024)
  • Circuit Surgery (August 2024)
  • Circuit Surgery (September 2024)
  • Circuit Surgery (October 2024)
  • Circuit Surgery (November 2024)
  • Circuit Surgery (December 2024)
  • Circuit Surgery (January 2025)
  • Circuit Surgery (February 2025)
  • Circuit Surgery (March 2025)
  • Circuit Surgery (April 2025)
  • Circuit Surgery (May 2025)
  • Circuit Surgery (June 2025)
Articles in this series:
  • The Fox Report (July 2024)
  • The Fox Report (September 2024)
  • The Fox Report (October 2024)
  • The Fox Report (November 2024)
  • The Fox Report (December 2024)
  • The Fox Report (January 2025)
  • The Fox Report (February 2025)
  • The Fox Report (March 2025)
  • The Fox Report (April 2025)
  • The Fox Report (May 2025)
Articles in this series:
  • Practically Speaking (November 2024)
  • Practically Speaking (February 2025)
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)
Articles in this series:
  • Max’s Cool Beans (January 2025)
  • Max’s Cool Beans (February 2025)
  • Max’s Cool Beans (March 2025)
  • Max’s Cool Beans (April 2025)
  • Max’s Cool Beans (May 2025)
  • Max’s Cool Beans (June 2025)
Articles in this series:
  • Precision Electronics, Part 1 (November 2024)
  • Precision Electronics, Part 2 (December 2024)
  • Precision Electronics, part one (January 2025)
  • Precision Electronics, Part 3 (January 2025)
  • Precision Electronics, part two (February 2025)
  • Precision Electronics, Part 4 (February 2025)
  • Precision Electronics, Part 5 (March 2025)
  • Precision Electronics, part three (March 2025)
  • Precision Electronics, part four (April 2025)
  • Precision Electronics, Part 6 (April 2025)
  • Precision Electronics, Part 7: ADCs (May 2025)
  • Precision Electronics, part five (May 2025)
  • Precision Electronics, part six (June 2025)
Articles in this series:
  • The History of Electronics, Pt1 (October 2023)
  • The History of Electronics, Pt2 (November 2023)
  • The History of Electronics, Pt3 (December 2023)
  • The History of Electronics, part one (January 2025)
  • The History of Electronics, part two (February 2025)
  • The History of Electronics, part three (March 2025)
  • The History of Electronics, part four (April 2025)
  • The History of Electronics, part five (May 2025)
  • The History of Electronics, part six (June 2025)
Items relevant to "Mains Power-Up Sequencer, part one":
  • Mains Power-Up Sequencer PCB [10108231] (AUD $15.00)
  • Firmware (ASM and HEX) files for the Mains Power-Up Sequencer (Software, Free)
  • Mains Power-Up Sequencer PCB pattern (PDF download) [10108231] (Free)
  • Panel labels and cutting diagrams for the Mains Power-Up Sequencer (Panel Artwork, Free)
Articles in this series:
  • Mains Power-Up Sequencer, Pt1 (February 2024)
  • Mains Power-Up Sequencer, Pt2 (March 2024)
  • New use for Mains Sequencer (July 2024)
  • Mains Power-Up Sequencer, part one (February 2025)
  • Mains Power-Up Sequencer, part two (March 2025)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Max’s Cool Beans By Max the Magnificent Weird & Wonderful Arduino Projects Part 2: Power for our retro games console J ust to set the scene, in this column we are going to take the first tentative steps toward constructing the retro games console we briefly introduced last month. In our next issue, as well as continuing its construction, just when you least expect it, we will perform some more thought-provoking breadboardbased experiments with the 8-segment light-emitting diode (LED) bar graph display we presented in our inaugural Weird & Wonderful column. The main point here is that, even if you aren’t quite ready to dip your toes into the games console waters, you can still follow along with the rest of us, learning lots of interesting and thought-provoking stuff along the way. Enclosed or deconstructed? As a reminder, my chum Joe Farr has already built a version of our games console using a PIC microcontroller as its ‘brain’ (see Photo 1). In our case, however, we will be using an Arduino. The microcontroller is mounted on the small green circuit board that can be seen on the left of Photo 1. The circuit board is attached to the console using a 25-way D-sub connector. The idea is to eventually have a collection of these boards acting as plugin games cartridges. Each ‘cartridge’ will be programmed to implement a different game. This is probably a good time to note that building multiple game cartridges is an option, not a mandate. The alternative is to build just one cartridge and then simply reprogram it whenever we wish to swap games. Joe used a laser cutter to make a front panel for his console, but he could have used his 3D printer had he wished to do so. Similarly, Joe says the main console container can be created using a 3D printer, although any appropriately sized box will do. I currently hang my hat in Huntsville, Alabama, USA. There is a TV cooking game show called “Chopped” I like to watch. It’s not unknown for the competitors to run short of time or ingredients. When presenting their offerings to the judges, they often describe these ‘interesting’ interpretations as being “deconstructed”. The reason I mention this here is that, if you don’t have access to a laser cutter or a 3D printer (or a wellequipped friend), we will discuss alternative strategies involving readily available craft items and hot-melt glue (a hot glue gun was once described to me as the “tool of champions”!). In this case, you will be able to proudly proclaim to your family and friends that you’ve built a “deconstructed retro games console.” Trust me; they will be in no position to refute your assertion. A minimalist implementation A bird’s-eye view of the key elements forming the main console, excluding any microcontroller-based game cartridges, is presented in Fig.1. If you are strapped for cash and already have an Arduino Uno or Nano, implementing the minimalist, stripped-down console will require only the LEDs forming the main 14 × 10 array, along with the eight momentary pushbuttons used for the four direction controls and the four action controls. In this case, you could mount everything—including the Arduino—on a flat sheet of something (card, hardboard, thin plywood…). Our gracious host. Photo 1: an early version of our retro games console (Photograph by Joe Farr). 30 Practical Electronics | February | 2025 25-way D-sub connector Game cartridge plugs in here 7-Segment Displays Reset Button Power Jack 14 x 10 Tricolor LED Array Direction Controls 15-way D-sub connector Action Controls Additional controls plug in here Fig.1: an overview showing the layout of the main part of our new games console. Let’s start with the 14 × 10 array of tricolour LEDs. By “tricolour” we mean that each package contains red, green, and blue (RGB) LED junctions (sub-LEDs). The easiest way to make this is to purchase a 1m (3.3ft) strip of WS2812B 5050 LEDs (https://pemag. au/link/ac2s). These are known to many as “NeoPixels”. The type we want has 144 LEDs/m (see Photo 2). Since we are going to use only 10 × 14 = 140 of these LEDs in our array, this means we will have four of the little scamps left over to play with (and we will; oh yes, we will). Having said that, if you have any spare cash to splash, it never hurts to have spares. In my case, I opted to buy two of these strips (‘just in case’). When it comes to our pushbuttons, almost anything will do. The main thing is to make sure they are of the momentary type (on only when pressed) and not the latching kind (push to turn on and push again to turn off) because the latter will not facilitate game-playing activities. A good option would be to purchase a 24-piece assortment (https:// pemag.au/link/ac2t). This contains sets of four in six colours: red, green, blue, yellow, white, and black. We can use the four white buttons for our direction controls, plus one each of the red, yellow, green, and blue buttons for our action controls. One of the black buttons would work for our reset button. This will leave us with spares for future projects. Keeping score Once we have our LEDs and pushbuttons, apart from some wires and a power supply, everything else is pretty much optional. Having said that, including a few 7-segment displays will certainly make our lives a lot easier when it comes to presenting game scores and keeping track of what’s going on. As we know from the clock we built in our Arduino Bootcamp series, if we employ shift registers to drive our displays, we can use as many displays as we wish while consuming only a few of our Arduino’s digital pins. We could opt to use the displays and 74HC595 shift registers from our clock. However, it’s much easier to work with pre-built modules that have the displays, shift registers and current-limiting resistors all mounted on a small circuit board. Such modules are available from multiple suppliers, but we would be hard pushed to beat the prices on AliExpress (https://pemag.au/link/ ac2u). These modules are available with two, three or four digits. I opted to use three two-digit modules to match Joe’s console (this will make it easier to port his games Photo 2: a 1m (3.3ft) strip of RGB LEDs. Practical Electronics | February | 2025 31 to my console), but you can choose to use as few or as many of whichever types of these displays as you wish. As we shall see, driving these displays, which can be daisy-chained together, will require only three of our Arduino’s pins. A Full Monty The slang phrase “the full Monty” is polysemous, meaning it can have multiple interpretations depending on the context. One usage means “everything that is wanted or needed”. I was born and bred in Sheffield, Yorkshire, which was a big steel town until the steel industry faded away in the late 1970s. If you haven’t already seen it, the 1997 bitter-sweet comedy film The Full Monty tells the story of that sad time from a humorous perspective, but I digress… If you intend to implement a full Monty and replicate our full-up console, you will need a few more bits and bobs as follows. Let’s start with the 2.1mm panel-mount DC power socket (https://pemag.au/link/ac2v) and matching plug (https://pemag. au/link/ac2w). We also need some way to plug the game cartridges into the top of the console. Joe and I opted to use a common type of connector known as D-subminiature (D-sub) connectors. These are so-named for their characteristic D-shaped metal shield. Although they may seem large by today’s standards (think of the 24 pins in a modern teeny-tiny USB Type-C connector, for example), D-subs were among the smallest connectors used on computer systems when they were introduced, hence the “subminiature” moniker. Anyhoo, we need a 25-way D-sub panel-mount socket for the console’s case (https://pemag.au/link/ac2x), along with one 25-way D-sub boardmount plug for each plug-in cartridge we end up building (https://pemag. au/link/ac2y). Fig.3: this shows how a strip of WS2812 tricolour LEDs works and is controlled by the microcontroller (labelled “MCU” here). The 15-way connector on the bottom 3 4 1 Top view of the console is another optional extra. The idea is to provide Side view an alternative way to activate our eight 1 = Red anode pushbutton switch2 es, thereby allowing 4 2 = Common cathode 1 3 us to add things like 3 = Green anode 2 switch-based joy4 = Blue anode sticks. Also, we could Fig.2: the configuration of a common-cathode tricolour LED. use this to support multi-player games (and other stuff This is why we’ve opted to use a we’ll discuss later). strip of WS2812B 5050 LEDs. The If you decide to add this, then you’ll 5050 portion of this moniker reflects need a 15-way D-sub panel-mount the fact that each device is presented socket for the console’s case (https:// in a 5 × 5mm package (see Photo 3). pemag.au/link/ac2z), along with one There’s a lot going on inside this 15-way D-sub board-mount plug for compact package. First, we have the each add-on control board you decide RGB sub-LEDs, the three small eleto create (https://pemag.au/link/ac30). ments in the lower-left of the package. We also have a small controlA rapid review ler silicon chip, which is the larger Before we proceed, let’s briefly set black item in the upper-right corner the scene regarding the LED strip we of the package. are going to use as the basis for our This controller essentially implemain array. We’ll begin by reminding ments a 24-bit shift register, with 8 ourselves that it’s possible to purchase bits associated with each of the subtricolour LEDs that look like regular LEDs. Each set of eight bits is used LEDs in 8mm, 5mm, or 3mm diameter to control a pulse-width modulator packages, the main difference being (PWM) function. We introduced this that they contain RGB sub-LEDs, and concept in PE, March 2023. they have four terminals instead of The idea is that we can use these two (see Fig.2). 8-bit values to control the brightness This is a common-cathode com- of their associated sub-LEDs, where ponent (common-anode versions do 28 = 2×2×2×2×2×2×2×2 = 256 differexist, although they are less common, ent combinations of 0s and 1s. These no pun intended). As such, we could patterns can represent integer numconnect the cathodes from all the de- bers in the range 0 (the LED is fully vices to ground, thereby leaving three off) to 255 (the LED is fully on). Since we can control each subpins for each LED that need to be controlled. This means that if we were to LED independently, this means we use these to implement our 14 × 10 can potentially generate 28 × 28 × 28 = 140 array, we would need 140 × 3 = 224 = 16,777,216 different colours. We don’t need this many, but it’s nice = 420 pins to drive them! There are many cunning tricks we to know we have that many options! Rather than waffle on about could employ, including multiplexing. Alternatively, suppose we were WS2812s, a term that doesn’t exactto use our trusty 8-bit shift registers. ly roll off the tongue, we will instead In this case, we would need 420 ÷ 8 refer to them as “pixels”. Each pixel has four terminals: power, ground = 53 devices. Eeek! Pixel 0 Pixel 1 Pixel 2 5V Data in From MCU Data out Data in Data out To next pixel 390Ω Data in Data out 0V Strip of daisy-chained pixels 32 Practical Electronics | February | 2025 (0V), data in, and data out (see Fig.3). The power voltage range is 3.5–5.5V; we will use 5V to match our Arduino. As far as our software is concerned, our 140 pixels will be numbered from 0 to 139. Just like the 74HC595 shift registers we’ve been using in our clock, the shift registers in our pixels can be daisy-chained together, with the output from one pixel feeding the input to the next. With the WS2812s, the shift register’s clock signal is embedded in the data signal. As a result, we can control all 140 of the pixels forming our array using a single pin from the Arduino. Pretty sweet, eh? Now, observe the 390Ω resistor associated with the first pixel in the chain. This should be positioned as close to the strip as possible. The reason for this resistor is that the signals from the Arduino transition from 0 to 1 (0V to 5V) and 1 to 0 (5V to 0V) very enthusiastically. When I first started working with these devices deep in the mists of time, I repeatedly zapped the first pixel in the chain. Eventually, probing things with an oscilloscope revealed that the signal from the Arduino to the input of the first pixel was overshooting (to more than 5.5V) and undershooting (to less than 0V) due to the inductance of the longish track between the Arduino and the first pixel. A little experimentation revealed that the addition of a 390Ω resistor solved all my problems. I should note that the folks at Adafruit recommend a 470Ω resistor, but anything between 390Ω and 470Ω will do the job. Izzy wizzy, hardware! As I’ve mentioned before, I used to love The Sooty Show on TV when I was a kid. When he wanted something to happen, the protagonist of the show, a yellow teddy bear called Sooty, would wield his magic wand accompanied by the magic words, “Izzy wizzy, let’s get busy!” He could do real magic! It’s true; I saw it with my own eyes! Photo 4: a real-world Neopixel addressable LED strip. Now we need to get busy working our magic, starting with preparing our hardware. We don’t have the time to go through an exhaustive set of tools here, but some that will always come in handy are a set of small screwdrivers (https://pemag. au/link/ac31), a set of small pliers (https://pemag.au/link/ac32), and some wire strippers (https://pemag. au/link/ac33). In an ideal world, you should invest in the best tools you can find. In the real world, you can make do with lower-cost options. One good thing about cheap tools is that once you have them, you can find out which ones you use the most, then get higher quality versions of them later. Before you do anything else, unplug the USB cable from your Arduino to power everything down. Also, remembering that LEDs can be damaged by electrostatic discharge (ESD), make sure you are doing everything on your anti-static mat and that you are wearing your anti-static wristband (all this was discussed in PE, January 2023). Many WS2812 strips come with wires and connectors attached to one or both ends. Our interest is in the input end to the strip (see Photo 4). The way we know this is the input end is by observing that the white arrows at the top of the strip are pointing from left (the input) to right (the output). In this case, the suppliers have done us proud. In addition to the white (0V), red (5V), and green (data in) wires attached to the 3-pin connector, they’ve provided us with additional red and white wires ‘just in case’. Observe the point where these wires attach to the strip. The black band is formed from a piece of heat-shrink tubing. This protective plastic sleeve shrinks when heated. It can be used to insulate wires, protect things against abrasion and provide strain relief (ie, reduce stress on connections caused by pulling, bending, or twisting), which is what it’s doing here. You can leave this black band on your strip for the moment, but I removed mine so you can better see what’s going on (Photo 5). I also removed the additional red and white wires, then I cut the wires feeding into the connector. Next, I took three of my jumper wires—one each of red, white, and green—with male connectors and pins on each end, and chopped them in half (reserving the unused halves for future use). I stripped the insulation off the ends of all the wires, then twisted and soldered the red and white wires. I did the same with the green wires, except I added a 390Ω resistor in the middle. One way to protect the soldered joints and prevent them from shorting is to wrap them in insulating tape (https://pemag.au/link/ac34). Personally, I prefer to employ heat-shrink tubing, as shown in Photo 5. In this case, I used a transparent piece to cover the resistor for your viewing pleasure. You can purchase a cheapand-cheerful kit of this tubing along with a mini heat gun for around £16 (https://pemag.au/link/ac35). Warning: do not plug your strip into the Arduino just yet! Izzy wizzy, software! We need an appropriate software library to control our strip. We have several options. One easy-to-use, Arduino-friendly option recommended by many people is the FastLED Animation Library (http://fastled.io/). Still, I find that I almost invariably use the library from the folks at Adafruit. The Adafruit NeoPixel Überguide (https://pemag.au/link/ac36) will tell you all you need to know about downloading and installing this library. The engines canna take it, captain! I grew up watching Star Trek: The Original Series. In my memory, it Photo 5: the strip following our modifications. Photo 3: a WS2812 addressable RGB LED in a 5×5mm surface-mounting package. Practical Electronics | February | 2025 33 problem. First, we could use a larger power supply (this is something we are going to look into next month). Second, since all the sub-LEDs have associated PWM functions, we can control the amount of power they use, anywhere between 0% and 100% of this maximum. Third, and this is the big one for what we are about to do here, we can decide to have only one (or just a few) of our pixels on at any time. For example, even if each pixel does have a worst-case current consumption of 60mA, then if we activate only one pixel at a time, and if we run that pixel at 25% of its full brightness, our strip will only be consuming 60 × 0.25 = 15mA, which is about 3% of the power we currently have available. Pinning things down Listing 1: the code for testing our LED strip. seems like every episode involved Captain James Tiberius Kirk calling the engine room to ask for more power. The chief engineer, Montgomery “Scotty” Scott, invariably replied, “I’m givin’ her all she’s got, captain” (or words to that effect). I always thought James Montgomery Doohan, the actor who played Scotty, had a real Scottish accent. However, I later discovered he was Canadian. There are doubts over the authenticity of his accent, but James himself once said that Scotty’s accent was what a Scottish accent would sound like 200 years in the future. It’s hard to argue with logic like that, but we digress… My point here is that before we plug our strip into our Arduino, we need to take a moment to ponder how much power it will require. LEDs are very efficient and that they consume very little power compared to earlier alternatives, like incandescent bulbs. The problem is that a lot 34 of ‘littles’ can add up to a ‘big’, if you see what I mean. We are currently powering our Arduino Uno from a USB source, most of which are rated to supply 500 milliamps (mA) or half an amp. The Arduino itself consumes 50mA, thereby leaving us with 450mA to play with. Our LED strip currently has 144 pixels, each containing three RGB sub-LEDs. If we look at the data sheet, we see that each of these sub-LEDs is specified as having a maximum current of 20mA. So, if all three sub-LEDs in a pixel are fully on, that equates to 3 × 20 = 60mA per pixel. In the real world, I’ve only ever measured a maximum of 45mA per pixel, but let’s stick with the official worst-case scenario, just to be sure. This means if all the pixels in our strip were fully on, it would require 144 × 60 = 8,640mA or approximately 8.6 amps. Eeek! There are three solutions to this Before we do anything else, we must decide which of the Arduino’s input/output (I/O) pins we are going to use to drive our pixel strip. Using any of the Arduino’s six analog pins, A0 through A5, is not recommended. Even though these pins can be configured to act as digital I/Os, they are not optimised for generating the precise timing required by our strip. Happily, we can use any of the 14 digital I/Os. Having said this, we always reserve pins 0 and 1 for communications with our host computer. Also, I’m assuming that you, like me, are already using pins 2 through 9 to drive the 8-segment display on our breadboard. We will leave these as-is because we will continue to experiment with this device in our next column. This leaves us with digital pins 10 to 13. I made the executive decision to use pin 12. Why? Well, 12 is 2 × 6 and 6 is my lucky number (ask a silly question…). The next step is to create a test program. Let’s start with the one shown in Listing 1. You can download a copy of this code (named CB-Feb25-Code-01. txt). As usual, all the files mentioned in this column are available from the February 2025 page of the PE website: https://pemag.au/link/ac37 The first thing we do on Line 1 is to include the Adafruit NeoPixel library. On Line 4, we define PIN_NEOS as being 12 (“NEOS” being short for “NeoPixels”). On Line 5, we define NUM_NEOS as 144. I know we are eventually going to use only 140 pixels in our console’s array, but we are currently working with the string’s original complement of 144 pixels. Practical Electronics | February | 2025 Observe Line 12. This is where we instantiate our string, giving it the name Neos, which is how we will access it in the remainder of the program. The first two arguments inform the instantiation function with the pin we are using to drive the string and the number of pixels in the string. We could have simply entered these numbers as 12 and 144 directly, but using our PIN_NEOS and NUM_NEOS definitions makes our program easier to read and understand (and we may need to use those definitions elsewhere later). We won’t concern ourselves with the remaining arguments for the moment. In the Arduino world, the setup() function is called by the system only one time, while the loop() function is automatically called over and over again. On Line 16, we call the Neos.begin() function to initialise our string. This part is important, so pay attention. When we run this function, the first thing it does is reserve three bytes in memory for each of our pixels (in our case, that’s 3 × 144 = 432 bytes). These are used to store the three 8-bit RGB values associated with each pixel. The Neos.begin() function will also initialise all these bytes to zero (0) values. The easiest way to think of this is that the Neos.begin() function creates a ‘virtual LED string’ in the Arduino’s memory. On Line 17, we use the Neos.show() function to stream the values stored in the virtual string (currently all zeros) out to the physical string in the real world, thereby ensuring that all our real-world pixels are switched off. By declaring our string as comprising 144 pixels, as far as our software is concerned, they will be numbered 0 to 143. Thus, on Line 23 we set up a loop with a value i that cycles from 0 to 143. On Line 25, we make a call to the Neos.setPixelColor() function, which accepts two arguments. The first is the number of the pixel we wish to address in our virtual string. The second is a 24-bit value containing our three 8-bit RGB fields. Also on Line 25 we see the use of the Neos.Color() function. I realise that the naming convention used by this library is somewhat arbitrary when it comes to its use of uppercase and lowercase letters, but I didn’t create it, so it is not my fault, I swear! This function takes three 8-bit RGB values and returns the single 24-bit value that will need to supply to the Neos.setPixelColor() function. Practical Electronics | February | 2025 The Neos.Color() function expects its arguments in the order R, G, B. Since these arguments are 8-bit values, they can be used to represent unsigned numbers in the range 0 to 255. On Line 25, we are using values of 64, 0, 0. This means that we are driving our red pixel with a value of 64 and our green and blue pixels with values of 0. Why 64? Why not? You can try 255 if you like, but it will be very bright and will hurt your eyes. I decided to start at 25% (quarter) brightness, and 255 ÷ 4 = 63.75, which rounds to 64. Let’s assume we are on our very first iteration through the loop. Even though we’ve only set the R component of pixel 0 to have a red value of 64, when we call the Neos.show() function on Line 26, it will stream the entire contents of the virtual string out to the real-world string, which means that the first LED in our string will glow red. The call to the delay() function on Line 27 means that this value will persist long enough for us to see it before we move on. We use Lines 28, 29, and 30 to change this pixel to display green, after which we use Lines 31, 32, and 33 to change it to blue. Line 34 is crucial. This is where we turn all the sub-pixels associated with this pixel off before proceeding to the next pixel in the string. If we omitted this line, we would end up activating all the pixels in the string, thereby boosting our power consumption from only 5mA (we are currently running only one subpixel at 25% of its full capacity) to 5 × 144 = 720mA, which would blow our maximum budget of 450mA out of the water. Let’s light some LEDs! You won’t need to be powering your breadboard as part of these experiments. So, before you do anything else, first disconnect the 0V (ground) and 5V wires linking your Arduino to your breadboard. Do not plug your strip into your Arduino just yet! First, connect the USB cable to your Arduino and download the program we just created into it. Why? You can call this an excess of caution on my part. We are ensuring that our Arduino doesn’t already contain a program with the potential to damage anything, like activating all the pixels at the same time before we have a sufficiently capable power source connected, for example. Useful Bits and Pieces from Our Arduino Bootcamp series Arduino Uno R3 microcontroller module Solderless breadboard 8-inch (20cm) jumper wires (male-to-male) Long-tailed 0.1-inch (2.54mm) pitch header pins LEDs (assorted colours) Resistors (assorted values) Ceramic capacitors (assorted values) 16V 100µF electrolytic capacitors Momentary pushbutton switches Kit of popular SN74LS00 chips 74HC595 8-bit shift registers https://pemag.au/link/ac2g https://amzn.to/3O2L3e8 https://amzn.to/3O4hnxk https://pemag.au/link/ac2h https://amzn.to/3E7VAQE https://amzn.to/3O4RvBt https://pemag.au/link/ac2i https://pemag.au/link/ac2j https://amzn.to/3Tk7Q87 https://pemag.au/link/ac2k https://pemag.au/link/ac1n Other stuff Soldering guide Basic multimeter https://pemag.au/link/ac2d https://pemag.au/link/ac2f Components for Weird & Wonderful Projects, part 1 4-inch (10cm) jumper wires (optional) 8-segment DIP red LED bar graph displays https://pemag.au/link/ac2l https://pemag.au/link/ac2c Components for Weird & Wonderful Projects, part 2 144 tricolour LED strip (required) Pushbuttons (assorted colours) (required) 7-Segment display modules (recommended) 2.1mm panel-mount barrel socket (optional) 2.1mm inline barrel plug (optional) 25-way D-sub panel-mount socket (optional) 25-way D-sub PCB-mount plug* (optional) 15-way D-sub panel-mount socket (optional) 15-way D-sub PCB-mount plug^ (optional) https://pemag.au/link/ac2s https://pemag.au/link/ac2t https://pemag.au/link/ac2u https://pemag.au/link/ac2v https://pemag.au/link/ac2w https://pemag.au/link/ac2x https://pemag.au/link/ac2y https://pemag.au/link/ac2z https://pemag.au/link/ac30 * one required for each game cartridge you build ^ one required for each auxiliary control panel you build 35 Listing 2: changes to the code that result in more speed! Now, unplug the USB cable from your Arduino to power everything down. Next, plug the white (ground) wire from your strip into the GND pin on the Arduino, then plug the red (power) wire from your strip into the 5V pin on the Arduino, and the green (data) wire from your strip into digital pin 12 on the Arduino. Finally, reconnect the USB cable to your Arduino and observe each pixel flashing red, green, and blue in turn. Full speed ahead! Personally, I could sit here watching our previous program perform- ing for a long, long time. Having said that, I understand that the attraction might start to wane after a couple of hours. Shall we make it go brighter and faster? I just tweaked our program and generated a new version (available in the file named CB-Feb25-Code-012.txt). In addition to modifying our ON_TIME and GAP_TIME definitions to be 10 and 0 milliseconds, respectively, I also modified our main loop to display only a single colour value (see Listing 2). I started with RGB values of 255, 255, 255, which will display white at full brightness. There’s no need to power everything down this time, just enter and download our new program, and then feast your orbs on the brilliant white light racing down the strip. Try experimenting with RGB values of 255, 0, 255, which will give purple, or 255, 255, 0, which will give yellow. How about 255, 64, 0, which will offer orange? Here’s something you may find interesting. Try 16, 16, 16. This results in white running at only 16 ÷ 255 = ~0.06 = ~6% of full brightness, but it still seems reasonably bright to me. I’m just planting a seed for the future… Feel free to experiment furiously while waiting for our next exciting instalment. Let the games begin We are still a long way from having our console in a state where we can use it to play games, but that doesn’t stop us thinking about the types of games we might wish to play. I know my head is buzzing with ideas. What about you? If you have any thoughts you’d care to share, drop me an email at max<at>clivemaxfield. com and I’ll add them to the list. Until next time, don’t do anything I wouldn’t do (it’s not a long list) and PE have a good one! STEWART OF READING Fluke/Philips PM3092 Oscilloscope 2+2 Channel 200MHz Delay TB, Autoset etc – £250 LAMBDA GENESYS LAMBDA GENESYS IFR 2025 IFR 2948B IFR 6843 R&S APN62 Agilent 8712ET HP8903A/B HP8757D HP3325A HP3561A HP6032A HP6622A HP6624A HP6632B HP6644A HP6654A HP8341A HP83630A HP83624A HP8484A HP8560E HP8563A HP8566B HP8662A Marconi 2022E Marconi 2024 Marconi 2030 Marconi 2023A HP 54600B Oscilloscope Analogue/Digital Dual Trace 100MHz Only £75, with accessories £125 (ALL PRICES PLUS CARRIAGE & VAT) Please check availability before ordering or calling in PSU GEN100-15 100V 15A Boxed As New £400 PSU GEN50-30 50V 30A £400 Signal Generator 9kHz – 2.51GHz Opt 04/11 £900 Communication Service Monitor Opts 03/25 Avionics POA Microwave Systems Analyser 10MHz – 20GHz POA Syn Function Generator 1Hz – 260kHz £295 RF Network Analyser 300kHz – 1300MHz POA Audio Analyser £750 – £950 Scaler Network Analyser POA Synthesised Function Generator £195 Dynamic Signal Analyser £650 PSU 0-60V 0-50A 1000W £750 PSU 0-20V 4A Twice or 0-50V 2A Twice £350 PSU 4 Outputs £400 PSU 0-20V 0-5A £195 PSU 0-60V 3.5A £400 PSU 0-60V 0-9A £500 Synthesised Sweep Generator 10MHz – 20GHz £2,000 Synthesised Sweeper 10MHz – 26.5 GHz POA Synthesised Sweeper 2 – 20GHz POA Power Sensor 0.01-18GHz 3nW-10µW £75 Spectrum Analyser Synthesised 30Hz – 2.9GHz £1,750 Spectrum Analyser Synthesised 9kHz – 22GHz £2,250 Spectrum Analsyer 100Hz – 22GHz £1,200 RF Generator 10kHz – 1280MHz £750 Synthesised AM/FM Signal Generator 10kHz – 1.01GHz £325 Synthesised Signal Generator 9kHz – 2.4GHz £800 Synthesised Signal Generator 10kHz – 1.35GHz £750 Signal Generator 9kHz – 1.2GHz £700 HP/Agilent HP 34401A Digital Multimeter 6½ Digit £325 – £375 36 17A King Street, Mortimer, near Reading, RG7 3RS Telephone: 0118 933 1111 Fax: 0118 933 2375 USED ELECTRONIC TEST EQUIPMENT Check website www.stewart-of-reading.co.uk HP33120A HP53131A HP53131A Audio Precision Datron 4708 Druck DPI 515 Datron 1081 ENI 325LA Keithley 228 Time 9818 Marconi 2305 Modulation Meter £250 Marconi 2440 Counter 20GHz £295 Marconi 2945/A/B Communications Test Set Various Options POA Marconi 2955 Radio Communications Test Set £595 Marconi 2955A Radio Communications Test Set £725 Marconi 2955B Radio Communications Test Set £800 Marconi 6200 Microwave Test Set £1,500 Marconi 6200A Microwave Test Set 10MHz – 20GHz £1,950 Marconi 6200B Microwave Test Set £2,300 Marconi 6960B Power Meter with 6910 sensor £295 Tektronix TDS3052B Oscilloscope 500MHz 2.5GS/s £1,250 Tektronix TDS3032 Oscilloscope 300MHz 2.5GS/s £995 Tektronix TDS3012 Oscilloscope 2 Channel 100MHz 1.25GS/s £450 Tektronix 2430A Oscilloscope Dual Trace 150MHz 100MS/s £350 Tektronix 2465B Oscilloscope 4 Channel 400MHz £600 Farnell AP60/50 PSU 0-60V 0-50A 1kW Switch Mode £300 Farnell XA35/2T PSU 0-35V 0-2A Twice Digital £75 Farnell AP100-90 Power Supply 100V 90A £900 Farnell LF1 Sine/Sq Oscillator 10Hz – 1MHz £45 Racal 1991 Counter/Timer 160MHz 9 Digit £150 Racal 2101 Counter 20GHz LED £295 Racal 9300 True RMS Millivoltmeter 5Hz – 20MHz etc £45 Racal 9300B As 9300 £75 Solartron 7150/PLUS 6½ Digit DMM True RMS IEEE £65/£75 Solatron 1253 Gain Phase Analyser 1mHz – 20kHz £600 Solartron SI 1255 HF Frequency Response Analyser POA Tasakago TM035-2 PSU 0-35V 0-2A 2 Meters £30 Thurlby PL320QMD PSU 0-30V 0-2A Twice £160 – £200 Thurlby TG210 Function Generator 0.002-2MHz TTL etc Kenwood Badged £65 Function Generator 100 microHz – 15MHz Universal Counter 3GHz Boxed unused Universal Counter 225MHz SYS2712 Audio Analyser – in original box Autocal Multifunction Standard Pressure Calibrator/Controller Autocal Standards Multimeter RF Power Amplifier 250kHz – 150MHz 25W 50dB Voltage/Current Source DC Current & Voltage Calibrator £350 £600 £350 POA POA £400 POA POA POA POA Marconi 2955B Radio Communications Test Set – £800 Practical Electronics | February | 2025