0% found this document useful (0 votes)
69 views76 pages

Jul24 Int

The July 2024 issue of Practical Electronics features projects such as a Pi Pico-based thermal camera, dynamic NFC tags, and a reciprocal frequency counter. It includes articles on digital signal processing, audio equipment, and practical advice for electronics repairs. The magazine also promotes educational resources like the Teach-In 2024 series focused on the ESP32 microcontroller.

Uploaded by

navaltronica
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views76 pages

Jul24 Int

The July 2024 issue of Practical Electronics features projects such as a Pi Pico-based thermal camera, dynamic NFC tags, and a reciprocal frequency counter. It includes articles on digital signal processing, audio equipment, and practical advice for electronics repairs. The magazine also promotes educational resources like the Teach-In 2024 series focused on the ESP32 microcontroller.

Uploaded by

navaltronica
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practical

Electronics
The UK’s premier electronics and computing maker magazine
Circuit Surgery Teach-In 2024 Audio Out
Topics in digital signal processing Sensing the environment with Mechanical
– sample and hold the ESP32 SoC microcontroller switches in audio

Make your
own Dynamic
RFID tags

Reciprocal
Frequency Counter

Teach-In 2024
Learn to use
the ESP32

Pi Pico-based
Thermal Camera
PLUS!
Techno Talk – Who saw that coming? Jul 2024 £5.99
07
Cool Beans – Arduino: 7-segment display decoders
Net Work – Practical advice on electronics repairs 9 772632 573030

www.electronpublishing.com @practicalelec practicalelectronics


Sysblocks
Sysblocks
FLOWCODE
Flowcode A4 Advert EPE 25 01 24 WIP.pdf 1 31/01/2024 13:15:30

Sysblocks

Create highly functional electronic systems using PIC32 technology to


manipulate
Create analogue signals
highly functional using
electronic Flowcode
systems 10.1
using and technology
PIC32 Sysblocks. to
Fantasticsignals
manipulate analogue for digital audio
using applications.
Flowcode 10.1 and Sysblocks.
Create highly functional electronic systems using low cost hardware,
Fantastic for digital audio applications.
like ESP32 and Rpi, to create fantastic Human Machine Interfaces for
Flowcode Pro, PIC32 pack with Sysblocks board, cables and accessories bundle £610 + VAT
your projects and mobile phones.
Flowcode
Create with
highly
Flowcode PIC32 pack with Sysblocks
functional
Pro, PIC32 pack with Sysblocks board,
electronic cables and
systems
board, cables and accessories
using bundle
PIC32bundle
accessories £330 ++ VAT
technology
£610 VAT
to
manipulate
Flowcode with 10%analogue
PIC32Flowcode
packfor
off signals
withPE hobby
Sysblocks
readersusing
board,
usingFlowcode
forcables
ESP32 10.1
FREE andbundle
isPESYS10
and accessories
code: Sysblocks.
£330 + VAT
Fantastic for digital audio applications.
Flowcode Pro with ESP32 pack £340 +VAT
10% off for PE readers using code: PESYS10
Flowcode 10.1 with more than 20 microcontroller targets including
Flowcode 10%pack
Pro,Uno,
PIC32 offwith
for Sysblocks
PE readers using
board, code:
cablesis
and WEB10
accessories bundle £610 + VAT
Arduino PIC18877, RPI2B, and ESP32
Flowcode 10.1 with more than 20 microcontroller targetsnow free for hobbyists.
including
Flowcode with PIC32 pack with Sysblocks board, cables and accessories bundle £330 + VAT
Arduino Uno, PIC18877, RPI2B, and ESP32 is now free for hobbyists.
Flowcode 10.1 with more than 20 microcontroller targets including
+44 (0) 10% off 252
for PE readers using code: PESYS10
[email protected]
Arduino Uno,1422
PIC18877, 380RPI2B, and ESP32 is now free for hobbyists.
+44 (0) 1422 252 380 [email protected]
www.flowcode.co.uk
Flowcode 10.1 with more than 20 microcontroller targets including
+44 (0) 1422www.flowcode.co.uk
252 380 [email protected]
Arduino Uno, PIC18877, RPI2B, and ESP32 is now free for hobbyists.
www.flowcode.co.uk
+44 (0) 1422 252 380 [email protected]

www.flowcode.co.uk
Practical
Volume 53. No. 7
July 2024
ISSN 2632 573X

Electronics Contents
Projects and Circuits
Pi Pico-based Thermal Camera by Kenneth Horton 17
A thermal infrared camera measures hot or cold spots compared to the surrounding
area – useful for diagnosing hot spots in electronic circuits, which may indicate a failing
component. They can be pricey, but not this one, a DIY version that’s easy to build.
Dynamic NFC Tag by Tim Blythman 22
The availability of dynamic NFC tags means you can now easily create your own
custom NFC/RFID Tags. This article explains how to program NFC chips that can be
used as smart business cards and more.
Reciprocal Frequency Counter by Charles Kosina 30
A traditional frequency counter samples over a long period to get an accurate result.
This one instead measures the average period and calculates the inverse, so it only
needs to monitor a few pulses to get a precise reading. It’s useful up to about 10MHz.

Series, Features and Columns


Techno Talk by Max The Magnificent 8
Who saw that coming?
The Fox Report by Barry Fox 10
Report from the Digital Television Group Summit
Net Work by Alan Winstanley 12
Reports on useful ideas for USB charging and monitoring, plus practical advice about
hobby and craft adhesives found online, as used in precision smartphone repairs.
Circuit Surgery by Ian Bell 37
Topics in digital signal processing – the sample-and-hold circuit and ADC Inputs
Audio Out by Jake Rothman 44
Switching in audio equipment – Part 2
Max’s Cool Beans by Max The Magnificent 50
Arduino Bootcamp – Part 19

Teach-In 2024 – Learn electronics with the ESP32 by Mike Tooley 58


Part 5 – Sensing the environment

Regulars and Services


Wireless for the Warrior 2
Subscribe to Practical Electronics and save money 4
NEW! Practical Electronics back issues DOWNLOADS – 2022 now available! 6
Reader services – Editorial and Advertising Departments 7
Editorial 7
We’ve come a long way
Teach-In bundle – what a bargain! 9
PE Teach-In 9 21
PE Teach-In 8 36
Practical Electronics PCB Service 68
PCBs for Practical Electronics projects
Classified ads and Advertiser index 71
Next month! – highlights of our next issue of Practical Electronics 72
Made in the UK.
Written in Britain, Australia,
the US and Ireland.
Read everywhere.
© Electron Publishing Limited 2024
Copyright in all drawings, photographs, articles,
technical designs, software and intellectual property
published in Practical Electronics is fully protected,
and reproduction or imitation in whole or in part are
expressly forbidden.
The August 2024 issue of Practical Electronics will be
published on Thursday, 4 July 2024 – see page 72.

Practical Electronics | July | 2024 1


WIRELESS FOR
THE WARRIOR
by LOUIS MEULSTEE
THE DEFINITIVE TECHNICAL HISTORY OF RADIO
COMMUNICATION EQUIPMENT IN THE BRITISH ARMY

The Wireless for the Warrior books are a the introduction of VHF FM and
source of reference for the history and hermetically sealed equipment.
development of radio communication
equipment used by the British Army Volume 3 covers army receivers from
from the very early days of wireless up 1932 to the late 1960s. The book not
to the 1960s. only describes receivers specifically
designed for the British Army, but also
The books are very detailed and include the Royal Navy and RAF. Also covered:
circuit diagrams, technical specifications special receivers, direction finding
and alignment data, technical receivers, Canadian and Australian
development history, complete station Army receivers, commercial receivers
lists and vehicle fitting instructions. adopted by the Army, and Army Welfare
broadcast receivers.
Volume 1 and Volume 2 cover
transmitters and transceivers used Volume 4 covers clandestine, agent or ‘spy’
between 1932-1948. An era that starts radio equipment, sets which were used by
with positive steps taken to formulate special forces, partisans, resistance, ‘stay
and develop a new series of wireless sets behind’ organisations, Australian Coast
that offered great improvements over Watchers and the diplomatic service. Plus,
obsolete World War I pattern equipment. selected associated power sources, RDF and
The other end of this timeframe saw intercept receivers, bugs and radar beacons.

ORDER YOURS TODAY!


JUST CALL 01202 880299 OR VISIT www.electronpublishing.com
All prices include 20% VAT. Free UK mainland delivery on orders over £60.
Quasar Electronics Limited Postage & Packing Options (Up to 1Kg gross weight): UK Standard 2-5 Day
PO Box 6935, Bishops Stortford Delivery - £4.95 : UK Mainland Next Day Delivery - £9.95 : Please order online
CM23 4WP, United Kingdom if you reside outside the UK (our website will calculate postage for you).
Payment: We accept all major credit/debit cards. Make UK cheques/PO’s
payable to Quasar Electronics Limited and include P&P detailed above.
Tel: 01279 467799 !! Order online for reduced price postage and fast despatch !!
E-mail: [email protected] Please visit our online shop now for full details of over 1000 electronic kits,
Web: quasarelectronics.co.uk projects, modules and publications. Discounts for bulk quantities.

Solutions for Home, Education & Industry Since 1993

NEW! Mr Robot Kit Digitally Controlled FM Radio Kit


A fun, wearable electronic Build your
gadget that you can pin to your own mod-
clothes. Easy to solder begin- ern, high
ners kit. Two flashing bicolour quality FM
LEDs resemble the eyes. 65 x receiver
40 x 15 mm. CR2032 battery project with
powered (not included). excellent
Order Code: WSL108 - 6.68 sensitivity
powered
LED Electronic Dice Kit by a simple
Still popular! A must-build 9V PP3
soldering kit for all beginners. battery (not included. Auto-seeking button. 4
Dice slowly rolls to stop on a station presets. Volume control. Excellent
Great Brands - Official Main Dealer random number when the learning project for schools and colleges.
push button is released. 9V Order Code: WSAH194 - £20.39
battery (not included). Ideal
Electronic Kits & Modules for educational courses. Wide Audio Analyser Display Kit
We have a massive selection of self- selection of component types.
assembly electronic kits and pre- Order Code: MK109 - £7.08
assembled modules. Please see the full
range on our website or call for details. 3 Channel RGB LED Light Organ Kit

LED Buddy / LED Tester Kit


Hold any
type of
LED to Small, compact LCD display, ideal for panel
the con- mounting. Give your homemade audio gear
tact pads 3 outputs react to different sound frequen- a high-tech look. Upgrade existing equip-
to see it's cies. On-board microphone picks up sur- ment. Provides Peak Power, RMS Power,
polarity, rounding sound or music and drives the low, Mean dB, Peak dB, Linear Audio Spectrum
forward voltage & the recommended series mid & high frequency outputs. Connect 12- And 1/3 Octave Audio Spectrum. Auto /
resistor value. Adjustable target current & 24Vdc RGB or separate colour LED strips or Manual range selection. Peak-hold function.
forward voltage. Great design aid. LEDs (not included). Master & separate Speaker impedance selection.
Order Code: WSMI198 - £16.66 channel sensitivity adjustment. 1.25 A max. Order Code: K8098 - £38.39
per channel. Panel mountable facia 127 x
12-in-1 Solar Hydraulic Construction Kit 44mm. Terminal block or jack power supply Electronic Component Tester Kit
Solar & hydraulic connection. Control knobs included. Build your
powered robot Order Code: WSL209 - £14.10 own versa-
can be trans- tile compo-
formed into twelve Signal Generator Kit nent test-
different animals Sine wave, triangle, square er. Shows
and mechanical wave and integrator value and
robots (monkey, (selectable through jumper) pin layout
T-Rex, scorpion, with 0 - 100Vrms adjustable infor-
excavator, etc). Moves easily. Provides great output level. 1kHz (approx.) mation for
interaction with kids. Teaches the benefit of fixed signal frequency. 9V resistors
alternative energy. Aged 14+. battery (not included). (0.1 Ohm
Order Code: KSR17 - £29.95. Order Code: resolution,
WSAH105 - £6.12 max. 50M Ohm), coils (0.01mH - 20H), ca-
Stereo Ultrasonic Bat Detector Kit pacitors (28p - 100mF), diodes, BJT, JFET,
Bidirectional DC Motor Speed Controller E-IGBT, D-IGBT, E-MOS & D-MOS.
Control the Order Code: WSMI8115 - £44.15
speed of most
common DC LCD Oscilloscope Educational Kit
motors (rated Build your own
up to LCD oscillo-
28Vdc/5A) scope with this
from fully OFF exciting new
to fully ON in kit. Learn how
both direc- to read signals.
Educational & fun kit converts high frequen- tions. Single potentiometer controls speed & See the elec-
cy sounds (20 - 90kHz) normally impercepti- direction. Screw terminal block connectors. tronic signals
ble to humans like bat signals into audible PCB: 90x42mm. Not suitable for use with you learn about
noise. Can also help detect failures in ma- lead acid batteries! displayed on your own LCD oscilloscope.
chines, engines, etc. Stereo feature adds the Kit Order Code: 3166KT - £19.96 Despite the low cost, this oscilloscope kit
possibility to pinpoint the source. Frequency Assembled Order Code: AS3166 - £29.95 has a lot of features found on expensive
range 20-90kHz. 3.5mm jack output. units like signal markers, frequency, dB, true
129x60x40mm. Requires 3x AA batteries RMS readouts and more. A powerful auto-
and stereo headphones (not included). Card Sales setup function will get you going in a flash!
Order Code: WSAK8118 - £20.39 & Enquiries Order Code: WSEDU08 - £48.54
Practical
Electronics
UK readers SAVE £1 on every issue

SUBSCRIBE NOW! Practical


Electronics
The UK’s premier electronics and computing maker magazine
Practical
Electronics
The UK’s premier electronics and computing maker magazine
Practical
Electronics
The UK’s premier electronics and computing maker magazine
Practical
Electronics
The UK’s premier electronics and computing maker magazine
Practical
Electronics
The UK’s premier electronics and computing maker magazine

01202 087631
Circuit Surgery Teach-In 2024 Audio Out Circuit Surgery Teach-In 2024 Audio Out Circuit Surgery Teach-In 2024 Audio Out Circuit Surgery Teach-In 2024 Audio Out Circuit Surgery Teach-In 2024 Audio Out
LTspice 17.1 and Frequency A new series on learning electronics Designing LTspice 24 update and Digital input and output with Designing Topics in digital signal Analogue input and output with Designing Topics in digital signal Using LED displays with the ESP32 Mechanical Topics in digital signal processing Sensing the environment with Mechanical
Response Analysis with the ESP32 SoC microcontroller discrete buffers Frequency Response Analysis the ESP32 SoC microcontroller discrete buffers processing – sampling the ESP32 SoC microcontroller discrete buffers processing – ADCs SoC microcontroller switches in audio – sample and hold the ESP32 SoC microcontroller switches in audio

Digital
Volume Control WIN!
Microchip
Potentiometer Curiosity HPC
Development
Board Loudspeaker Make your
WIN!
WIN! Test Jig own Dynamic
Microchip
PIC32MK MCJ RFID tags
Curiosity Pro
Development
‘Swiss Army Knife’ Dual RF Amplifier
Building the Active Board GPS-Disciplined Heart Rate
Basic RF Automated Test Bench Oscillator Reciprocal
Mains Soft Starter Sensor Module
Signal Mastering Frequency Counter
Generator WIN!
the UVM-30A
Teach-In 2024 Microchip
Explorer 8 Wi-Fi Time Source
Learn to use the ESP32
Development
Kit
UV Sensor for GPS Clocks
WIN!
Teach-In 2024
Teach-In 2024 Learn to use
Teach-In 2024 Teach-In 2024 the ESP32
Advanced SMD Learn to use Silicon Chirp Learn to use Learn to use
Test Tweeze the ESP32 Build your own the ESP32 Songbird: an ideal the ESP32
rs Pi Pico-based
pet cricket beginner’s project
Thermal Camera
PLUS! PLUS! PLUS! PLUS! PLUS!
Mar 2024 £5.99 Techno Talk – Wait! What? Really? Apr 2024 £5.99 May 2024 £5.99 Jun 2024 £5.99 Jul 2024 £5.99
Techno Talk – The Wibbly-Wobbly World of Quantum 03 04 Techno Talk – One step closer to a dystopian abyss? 05
Techno Talk – Program that! 06
Techno Talk – Who saw that coming? 07
Cool Beans – Arduino: expanding breadboard designs Cool Beans – Arduino: expanding the 7-segment display Cool Beans – Arduino: 7-segment display delights Cool Beans – Arduino: 7-segment display delights Cool Beans – Arduino: 7-segment display decoders
Net Work – Cookies, privacy and online advertising 9 772632 573030 Net Work – Label printers, smart home devices and SMRs 9 772632 573030
Net Work – Electric cars, Moon-shot missions and more 9 772632 573030
Net Work – GaN USB chargers, solid-state EV battery 9 772632 573030
Net Work – Practical advice on electronics repairs 9 772632 573030

www.electronpublishing.com @practicalelec practicalelectronics www.electronpublishing.com @practicalelec practicalelectronics www.electronpublishing.com @practicalelec practicalelectronics www.electronpublishing.com @practicalelec practicalelectronics www.electronpublishing.com @practicalelec practicalelectronics

Take out a one-year subscription and save more than £10 over the year.
Even better – save over £1 per issue if you subscribe for two years – a total saving of £26.

Overseas rates represent exceptional value


You also: • Avoid any cover price increase for the duration of your subscription
• Get your magazine delivered to your door each month
• Guarantee a copy, even if your local newsagent sells out
Order by: • Phone or post with a cheque, postal order or credit card
• Or order online at: www.electronpublishing.com

Practical SUBSCRIPTION ORDER FORM


 6 Months:.UK £33.99, Europe £38.99 (Airmail),

Electronics
Rest of the World £46.99 (Airmail)
 1 Year: UK £59.99, Europe £69.99 (Airmail),
Rest of the World £84.99 (Airmail)

SUBSCRIPTION PRICES  2 Years: UK £114.99, Europe £129.99 (Airmail),


Rest of the World £164.99 (Airmail)
Subscriptions for delivery direct to any address in: To: Practical Electronics Subscriptions
PO Box 6337
UK: 6-months £33.99, 12-months £59.99, 24-months £114.99 Bournemouth BH1 9EH
Europe Airmail: 6-months £38.99, 12-months £69.99, United Kingdom
24-months £129.99 Tel: 01202 087631
Email: [email protected]
Rest Of The World Airmail: 6-months £46.99, 12-months
£84.99, 24-months £164.99 I enclose payment of £ ..............
(cheque/PO in £ sterling only)
Cheques (in £ sterling only) payable to Practical Electronics payable to Practical Electronics
and sent to: Practical Electronics Subscriptions, PO Box 6337,
 Please charge my Visa/Mastercard
Bournemouth BH1 9EH, United Kingdom
My card number is: .......................................................................
Tel: 01202 087631 Please print clearly, and check that you have the number correct
Email: [email protected]
Card Security Code .................. Valid From Date........................
Also via our online shop at: www.electronpublishing.com (The last 3 digits on or just under the signature strip)

Subscriptions start with the next available issue. We accept Card Ex. Date ......................................
MasterCard or Visa.
Name ............................................................................................
(For past issues see the Back Issues page.)
Address ........................................................................................

Post code .................................. Tel. ...........................................


DIGITAL SUBSCRIPTIONS
Electronic subscriptions are available from £29.99 for 12 months, Email ............................................................................................
more details at: www.electronpublishing.com Subscriptions start with the next available issue.

4 Practical Electronics | July | 2024


Subscribe to The VERY BEST DIY
Projects!
MAY 2023
ISSN 1030-2662

9 771030 266001
$1150* NZ $1290
05

INC GST
INC GST

Melbourne Exhibition Centre,


May 10-11

Australia’s
International Airsho
All the newest tech
in Avalon Airpor
w
t

Australia’s top electronics magazine


Silicon Chip is one of the best DIY electronics magazines in the Published in
world. Each month is filled with a variety of projects that you can build Silicon Chip
yourself, along with features on a wide range of topics from in-depth
electronics articles to general tech overviews.

Print Combined Online


$100 $110 $50
The History of Computer
6 months ≈₤53 ≈₤59 ≈₤27 Memory; Jan-Feb 2023
≈€62 ≈€68 ≈€31
$195 $215 $95
1 year ≈₤105 ≈₤115 ≈₤51
≈€120 ≈€132 ≈€58
Raspberry Pi Pico W
$380 $415 $185 BackPack; January 2023
2 years ≈₤205 ≈₤223 ≈₤100
≈€234 ≈€255 ≈€114

• Combined subscriptions include both the printed magazine and online access.
Wideband
• Prices are in Australian dollars (AUD) unless otherwise specified. Fuel Mixture Display;
• Prices listed are for everywhere in the world except Australia and New Zealand. April to June 2023
View siliconchip.com.au/Shop/SubRates for a full list of current prices.
• Price estimates are just that and should only be used as a guide, we primarily
take payment in the form of Australian dollars.
Silicon Chirp;
April 2023
Try our Online Subscription – now with PDF downloads!
An online issue is perfect for those who don’t want too much Advanced SMD
clutter around the house and is the same price worldwide. Test Tweezers;
Issues can be viewed online, or downloaded as a PDF. February & March 2023

To start your subscription go to


siliconchip.com.au/Shop/Subscribe
DOWNLOAD YOUR PE/EPE BACK ISSUES
COMPLETE-YEAR collections – all 12 issues for each year!
From just £5.95 each
VOL 28 – January to December 1999 – £5.95 VOL 40 – January to December 2011 – £12.95
VOL 29 – January to December 2000 – £6.95 VOL 41 – January to December 2012 – £14.95
VOL 30 – January to December 2001 – £7.95 VOL 42 – January to December 2013 – £15.95
VOL 31 – January to December 2002 – £7.95 VOL 43 – January to December 2014 – £16.95
VOL 32 – January to December 2003 – £7.95 VOL 44 – January to December 2015 – £17.95
VOL 33 – January to December 2004 – £7.95 VOL 45 – January to December 2016 – £19.95
VOL 34 – January to December 2005 – £8.95 VOL 46 – January to December 2017 – £22.95
VOL 35 – January to December 2006 – £8.95 VOL 47 – January to December 2018 – £27.95
VOL 36 – January to December 2007 – £8.95 VOL 48 – January to December 2019 – £27.95
VOL 37 – January to December 2008 – £8.95 VOL 49 – January to December 2020 – £29.95
VOL 38 – January to December 2009 – £10.95 VOL 50 – January to December 2021 – £32.95
VOL 39 – January to December 2010 – £11.95 VOL 51 – January to December 2022 – £34.95 – NEW!

FIVE-YEAR collections – 60 issues!


From just £14.95 each
PE2832: Jan 99 to Dec 03 – £14.95 PE3842: Jan 09 to Dec 13 – £33.95
PE2933: Jan 00 to Dec 04 – £14.95 PE3943: Jan 10 to Dec 14 – £33.95
PE3034: Jan 01 to Dec 05 – £14.95 PE4044: Jan 11 to Dec 15 – £33.95
PE3135: Jan 02 to Dec 06 – £14.95 PE4145: Jan 12 to Dec 16 – £35.95
PE3236: Jan 03 to Dec 07 – £14.95 PE4246: Jan 13 to Dec 17 – £37.95
PE3337: Jan 04 to Dec 08 – £14.95 PE4347: Jan 14 to Dec 18 – £38.95
PE3438: Jan 05 to Dec 09 – £19.95 PE4448: Jan 15 to Dec 19 – £39.95
PE3539: Jan 06 to Dec 10 – £25.95 PE4549: Jan 16 to Dec 20 – £42.95
PE3640: Jan 07 to Dec 11 – £25.95 PE4650: Jan 17 to Dec 21 – £44.95 – NEW!
PE3741: Jan 08 to Dec 12 – £25.95

20 YEARS OF PE! PE2832: Jan 99 to Dec 03


PLUS!
AMAZING BUNDLE OFFER PE3337: Jan 04 to Dec 08
Every issue from 1999 – 2018 PLUS!

240 magazines for just


PE3842: Jan 09 to Dec 13
PLUS!
£59.95 PE3447: Jan 14 to Dec 18

Do you have the 15-year bundle?


Upgrade to the new 20-year bundle for just £14.95 with: PE15to20

Download your collections at: www.electronpublishing.com


Practical
Volume 53. No. 7
July 2024
ISSN 2632 573X

Electronics Editorial
Editorial offices
Practical Electronics Tel 01273 777619 We’ve come a long way
Electron Publishing Limited Mob 07973 518682 Hobby electronics has come a long way since the days when,
1 Buckingham Road Fax 01202 843233
Brighton Email [email protected] nearly a century ago, constructors grappled with newly emerging
East Sussex BN1 3RA Web www.electronpublishing.com vacuum tube technology to produce home-brew radio receivers of
Advertisement offices
surprising sophistication and complexity. That was in an era when
Practical Electronics Adverts Tel 01273 777619 ‘wireless’ was one of the few practical hobbies available to budding
1 Buckingham Road Mob 07973 518682 ‘makers’. (Woodworking was another.) Interest in radio intensified
Brighton Email [email protected]
East Sussex BN1 3RA exponentially during the 1930s and magazine titles such as Hobbies
and Practical Wireless appeared weekly to meet an insatiable
Editor Matt Pulzer
General Manager Louisa Pulzer
demand for projects to challenge the hobbyist’s practical skills.
Digital subscriptions Stewart Kearn Tel 01202 880299
Online Editor Alan Winstanley
Web Systems Kris Thain
Practical Wireless would become a standalone title aimed at
Publisher Matt Pulzer the flourishing hobby radio sector while its sister magazine,
Practical Electronics, followed in the early 1960s to exploit new
Print subscriptions
Practical Electronics Subscriptions
semiconductor devices in a wider range of applications. The
PO Box 6337 wannabe electronics constructor has been kept busy ever since!
Bournemouth BH1 9EH Tel 01202 087631
United Kingdom Email [email protected]
Our hobby has of necessity mirrored global technological trends,
Technical enquiries and today’s constructors embrace a wholly different set of skills
We regret technical enquiries cannot be answered over the
telephone. We are unable to offer any advice on the use, purchase,
compared with their forebears. Wikipedia reminds us that the
repair or modification of commercial equipment or the incorporation first electric soldering iron dates back to 1889: appropriate for
or modification of designs published in the magazine. We cannot radio sets of yesteryear, perhaps, but some modern construction
provide data or answer queries on articles or projects that are
more than five years old. projects regularly use ready-made modules and tiny surface-
mounted devices that are much smaller than a match head – a fact
Questions about articles or projects should be sent to the editor
by email: [email protected]
of life dictated to us by the electronics industry. Starting 25 years
ago, boards full of discrete components were swept aside by the
Projects and circuits microcontroller, which demanded programming and coding know-
All reasonable precautions are taken to ensure that the advice and
data given to readers is reliable. We cannot, however, guarantee how, aided by the use of software design tools. Thanks to our design
it and we cannot accept legal responsibility for it. partners at Silicon Chip, the class-leading projects found inside
A number of projects and circuits published in Practical Electronics
every issue take advantage of these modern components along with
employ voltages that can be lethal. You should not build, test, high-quality printed circuit boards that help ensure constructors can
modify or renovate any item of mains-powered equipment unless accomplish their latest project successfully. One thing that hasn’t
you fully understand the safety aspects involved and you use an
RCD (GFCI) adaptor. changed over the years, though, is the inspiration and variety that
we at Practical Electronics strive to bring our readers every month,
Component supplies offering constructors interesting and absorbing challenges to keep
We do not supply electronic components or kits for building the
projects featured, these can be supplied by advertisers. We you just as busy as ever!
advise readers to check that all parts are still available before
commencing any project in a back-dated issue.
What will the future bring?
Advertisements From circuits using glass vacuum tubes housed in wooden
Although the proprietors and staff of Practical Electronics take cabinets to the latest designs based on devices with a billion or
reasonable precautions to protect the interests of readers by
ensuring as far as practicable that advertisements are bona fide, more transistors in 3D-printed enclosures, electronics has changed
the magazine and its publishers cannot give any undertakings beyond recognition. In fact, when it comes to electronics, change is
in respect of statements or claims made by advertisers, whether
these advertisements are printed as part of the magazine, or in the one constant you can rely on. So, what will the coming decades
inserts. The Publishers regret that under no circumstances will bring? AI, smarter sensors and faster devices seem certain, but I’m
the magazine accept liability for non-receipt of goods ordered, or
for late delivery, or for faults in manufacture.
sure there will be surprises too. And that’s all part of the fun!

Transmitters/bugs/telephone equipment Matt Pulzer


We advise readers that certain items of radio transmitting and
telephone equipment which may be advertised in our pages
Publisher
cannot be legally used in the UK. Readers should check the law
before buying any transmitting or telephone equipment, as a fine,
confiscation of equipment and/or imprisonment can result from
illegal use or ownership. The laws vary from country to country;
readers should check local laws.

Practical Electronics | July | 2024 7


Who saw Techno Talk
that coming? Max the Magnificent

Cast your mind back to the year 2000. How many of the devices and technologies that surround
us today did you see coming? Did you predict the advent of smartphones? Did you envisage tablet
computers? Did you forecast the widespread deployment of AI?

W
e live in an age of wonders. or take), this mass occupies a volume Alif Semiconductor (www.alifsemi.com)
Many of us don’t appreciate comparable to the Earth (give or take). recently announced a family of small,
just how lucky we are. For We know the white dwarf is suck- affordable, low-power microcontrollers
most of human existence, apart from ing hydrogen away from the red giant, (MCUs) capable of performing artificial
the top 0.1%, people lived in abject resulting in it having a ‘sea’ of hydro- intelligence (AI) tasks like voice process-
squalor. They were cold, hungry, dirty, gen a few meters deep. At some stage, ing and image recognition.
infested… and those were the lucky the hydrogen will undergo a runaway They also have something they call a
ones. Now our homes boast hot and thermonuclear reaction that will blow Vision AppKit, which is a small circuit
cold running water, electric lights and off the surface layer of the white dwarf. board the size of a large postage stamp
heating (and cooling where I live). We Known as a nova (as opposed to a su- carrying one of their processors and a
issue spoken commands to artificial pernova), we can predict (with a high camera. They are sending one of these
intelligences, our humongous high- degree of confidence) that this event bodacious beauties to me. It will be pre-
resolution colour televisions show us occurred around 3,000 years ago, with programmed to recognise human faces
what’s happening around the world in the light reaching us sometime between looking toward the camera. I’m going to
real-time, and… I could go on and on. the time of this writing and the end of mount this on my Countdown Timer.
September 2024, resulting in a magni- When someone is looking toward the
Knowledge is power tude +2 star that will be visible to the timer, the VFDs will shine in all their
There are two quotes that often spring naked eye for a couple of weeks. glory. If no one is looking, the timer will
into (what I laughingly refer to as) I don’t know about you, but the carry on counting but the displays will
my mind. The first is the expression, fact we know any of this stuff blows be powered down. Brilliant!
ipsa scientia potestas est (‘knowl- my mind.
edge itself is power’), which occurs in Who knew?
Francis Bacon’s Meditationes Sacrae I can see you! How good do you think you are with
(1597). And then there’s, ‘The simplest A few years ago, I started work on a respect to predicting the future? We
schoolboy is now familiar with facts hobby project I called my Countdown can base this on how good you were
for which Archimedes would have Timer. Its role in life was to count down in the past. As we celebrated the year
sacrificed his life,’ which comes from the years, months, days, hours, minutes, Y2K and the start of the current millen-
Ernest Renan’s Souvenirs D’enfance et and seconds to the commencement of my nium, for example, did you predict the
de Jeunesse (1887). 100th birthday celebrations, which will advent of smart phones that could take
I love to learn new things. I’m in- kick off at 11:45 a.m. British Summer pictures and videos, act as MP3 play-
credibly fortunate in that I get to chat Time (BST) on 29 May 2057 (mark your ers, and provide GPS functionality? Did
with all sorts of people who know calendar and stockpile the fireworks). you envisage tablet computers like the
things with which to boggle my mind. I put this on the back burner for a iPad? Did you forecast the widespread
Just the other day, for example, I was while (so many things to do, so little deployment of AI and the commercial
chatting with Dr Gerard Van Belle, who time to do them). Actually, I put it on availability of virtual reality (VR) and
is Director of Science at the Lowell a shelf in the closet. Unfortunately, mixed-reality (MR) headsets?
Observatory in Flagstaff, Arizona. He the shelf collapsed, crushing all the Let’s get a little closer to home –
was telling me about all the telescopes display elements. ‘Oh dear,’ I said (or say a year ago. Were you expecting a
and other technologies we now have words to that effect). little AI-enabled MCU like the one I
at our disposal to vastly increase the I’m recreating this little beauty us- described earlier to be available now?
sum of human knowledge about all ing vacuum fluorescent display (VFD) Me neither. So, who was good at pre-
sorts of things. tubes – try to visualise a steampunk dicting the future?
For example, we know that there’s a incarnation of 7-segment displays Well, I recently read A Story of the
star system that’s located about 3,000 implemented using a mix of vacuum Days to Come by HG Wells. Published in
light years from Earth. Our name for tube and cathode ray tube (CRT) tech- 1899, this tale is set in a dystopian future
this system is T Coronae Borealis, or nologies. The problem is that it’s about London of the 22nd century. People live
T CrB. This system is to be found in 33 years (290,000 hours) to the great in enclosed cities and travel around on
that portion of the night sky we call event, but VFDs have a life expectan- moving walkways. Mega-corporations
the constellation Coronae Borealis. We cy of only 10 years (87,000 hours). rule the world. The rich live in skyscrap-
know this is a binary system compris- I’m going to feel rather silly if I don’t ers while the lower classes are relegated
ing a huge red giant and a white dwarf know when it’s time to start blowing to subterranean dwellings. There are
orbiting each other. We know the white my own (party) trumpet. intelligent loudspeakers suspiciously
dwarf is composed of electron-degen- Fortunately, as I mentioned at the start the Amazon Alexa… Hmmm, maybe
erate matter, which means that, while of this column, we live in an age of won- Wells’ Time Machine was functional
having the same mass as our sun (give ders. For example, a company called rather than fictional!

8 Practical Electronics | July | 2024


ETI BUNDLE (1) Teach-In 3, 4 and 5 – all on CD-ROM – only £18.95
ELECTRONICS TEACH-IN 3 – CD-ROM ELECTRONICS TEACH-IN 5 – CD-ROM
ELECTRONICS ELECTRONICS
EE M EE M
FR -RO FR -RO £8.99

Mike & Richard Tooley CD


JUMP START CD

TEACH-IN 3 TEACH-IN 5
£7.99

Mike & Richard Tooley


The three sections of the Teach-In 3 CD-ROM cover a
FROM THE PUBLISHERS OF

FROM THE PUBLISHERS OF

huge range of subjects that will interest everyone involved 15 design and build circuit projects for newcomers or JUMP START
CIRCUIT SURGERY
in electronics – from newcomers to the hobby and i The how and why of circuit design those following courses in school and colleges. 15 design and build circuit projects
dedicated to newcomers or those

PRACTICALLY SPEAKING
students to experienced constructors and professionals.
following courses in schools and

The projects are: n Moisture Detector n Quiz


colleges
i The techniques of electronic
project construction PRACTICALLY SPEAKING
The first section (80 pages) is dedicated to Circuit INGENUITY UNLIMITED Machine n Battery Voltage Checker n Solar- The techniques of project construction

PIC ‘N MIx
Surgery, EPE/PE’s regular clinic dealing with readers’ Powered Charger n Versatile Theft Alarm n Spooky
i Over 40 different circuit ideas
Starting out with PIC microcontrollers

queries on circuit design problems – from voltage nics


Teach-
In FREE Circuits n Frost Alarm n Mini Christmas Lights n FREE M
ro TEACH-IN 1 CD-ROM bo
rne
Pu blishing Ltd 20
10 CD-RO
TEACH-IN 2
regulation to using SPICE circuit simulation software. iPod Speaker n Logic Probe n DC Motor Controller
im

t
W

1
TWO TEACH-INs FOR

Elec
©
TWO TEACH-INs FOR
THE PRICE OF ONE! THE PRICE OF ONE !
The second section – Practically Speaking – i The free CD-ROM provides
a broad-based introduction
to electronics
n Egg Timer n Signal Injector Probe n Simple Radio Provides
a practi
cal
to PIC
introduction llers
Plus:
MikroElektro
Microchip pe
L-Tek PoSco
nika,
The free CD-ROM provides a
practical introduction to PIC

Receiver n Temperature Alarm.


microcontro software

covers hands-on aspects of electronics construction.


ws
for Windo

n Program i A complete stand-alone


CD ROM
This CD
should
start
y, if not
microcontrollers
Simulatio automaticallindex.html
Circuit d version) tutorial in 11 parts plus free
8 TINA (Limite ramming double-click
In 2 Plus MikroElektronika,
CODE V3
PIC Prog n)
software nicsorne Teach-

Again, a whole range of subjects, from soldering to


8 FLOW d versio
Ele©ctro Publishing
Ltd
dsPIC are Microchip and L-Tek PoScope
Software Quizzes to Test
(Limite PIC and rated
2013 Wimb MPLAB, logy Incorpo ogy

8 Inter
active ledge
and logo, Techno
ip name of Microchip
Technol
Microch
ip
.09 software

PLUS
The Microch arks s. © 2013
Your Know
016-02
ed tradem countrie 1. MCCD1
register and other d. Issue
in the USAAll rights reserve

avoiding problems with static electricity and identifying


Inc.
3 09:59:25
29/07/201

d 1
In 2 - JUL13.ind

components is covered. Finally, our collection of


Teach
Teach In 5 Cover.indd 1 29/07/2013 10:00:29
Teach In 3 Cover.indd 1 06/05/2010 16:22:29

PIC’n’ Mix – starting out with the popular range of PIC


Ingenuity Unlimited circuits provides over 40 circuit designs submitted by readers. microcontrollers and Practically Speaking – tips and techniques for project construction.
The CD-ROM also contains the complete Electronics Teach-In 1 book, which
provides a broad-based introduction to electronics in PDF form, plus interactive 29/04/20
10 13:21:42
The CD-ROM also contains:
quizzes to test your knowledge and TINA circuit simulation software (a limited n Complete Teach-In 2 book, a practical introduction to PIC microprocessors
n MikroElektronika, Microchip and L-Tek PoScope software.
dd 1

version – plus a specially written TINA Tutorial).


CD Cover.in

The Teach-In 1 series covers everything from electric current through to


microprocessors and microcontrollers, and each part includes demonstration circuits
to build on breadboards or to simulate on your PC.

ELECTRONICS TEACH-IN 4 – CD-ROM Three Teach-ins for the great price of


ELECTRONICS £18.95
EE M
FR -RO £8.99

A BROAD-BASED INTRODUCTION TO CD

ELECTRONICS
TEACH-IN 4
FROM THE PUBLISHERS OF

Mike & Richard Tooley FREE

PLUS you also get the contents of the


CD-RO
M
A BROAD-BASED WORT

The Teach-In 4 CD-ROM covers three of the most


H
£29.9
INTRODuCTION TO ELECTRONICS 5

important electronics units that are currently studied in


free CD-ROM from each issue...
i An eleven part tutorial
i uses inexpensive circuit

many schools and colleges. These include, Edexcel


simulation software

BTEC level 2 awards and the electronics units of the


... so that’s another TWO Teach-Ins and
FREE M
CD-RO

Diploma in Engineering, Level 2. THE MODERN ELECTRONICS MANuAL


The essential reference
The CD-ROM also contains the full Modern
The Full Modern Electronics Manual!
work for everyone
studying electronics

Electronics Manual, worth £29.95. The Manual i Over 800 PDF pages

contains over 800 pages of electronics theory,


i In-depth theory
i Extensive data tables
autorun,
should
This software in Windows

What a Bargain!!
if not, open double-click
and
Explorer f
index.pd

projects, data, assembly instructions and web links.


This CD-ROM
requires
and web links
UAL
Reader™
Adobe® from
dable Free

MAN.co.u
Downloa be.com
www.ado

BA SE .epe mag
k

A package of exceptional value that will appeal


www ne Publishi
ng Ltd.
2011

© Wimbor

to anyone interested in learning about electronics – Teach In 4 Cover.indd 1 14/11/2011 20:33:21

hobbyists, students or professionals.

ETI BUNDLE (2) Teach-In 6, 7 and 8 – all on CD-ROM – only £18.95


ELECTRONICS TEACH-IN 6 – CD-ROM ELECTRONICS TEACH-IN 7 – CD-ROM ELECTRONICS TEACH-IN 8 – CD-ROM
A COMPREHENSIVE GUIDE TO RASPBERRY Pi DISCRETE LINEAR CIRCUIT DESIGN INTRODUCING THE ARDUINO
Mike & Richard Tooley Mike & Richard Tooley Mike & Richard Tooley
Teach-In 6 contains an exciting series of articles that Teach-In 7 is a complete introduction to the design of Hardware: learn about components and circuits
provides a complete introduction to the Raspberry analogue electronic circuits. It is ideal for everyone Programming: powerful integrated development system
Pi, the low cost computer that has taken the educa- interested in electronics as a hobby and for those Microcontrollers: understand control operations
tion and computing world by storm. studying technology at schools and colleges. The Communications: connect to PCs and other Arduinos.
This latest book in our Teach-In series will appeal CD-ROM also contains all the circuit software for Teach-In 8 is an exciting series designed for
to electronics enthusiasts and computer buffs who the course, plus demo CAD software for use with the electronics enthusiasts who want to get to grips with
want to get to grips with the Raspberry Pi. Teach-In series. the inexpensive, popular Arduino microcontroller, as
n Discrete Linear Circuit Design well as coding enthusiasts who want to explore
Teach-In 6 is for anyone searching for ideas to use n Understand linear circuit design
their Pi, or who has an idea for a project but doesn’t hardware and interfacing. It will provide a one-stop
n Learn with ‘TINA’ – modern CAD software source of ideas and practical information.
know how to turn it into reality. This book will prove n Design simple, but elegant circuits
invaluable for anyone fascinated by the revolutionary nF  ive projects to build: The Arduino offers a truly effective platform for
Pi. It covers: i) Pre-amp developing a huge variety of projects; from operating
n Pi programming ii) Headphone Amp a set of Christmas tree lights to remotely controlling a
n Pi hardware iii) Tone Control robotic vehicle through wireless or the Internet.
n Pi communications iv) VU-meter Teach-In 8 is based around a series of practical
n Pi Projects v) High Performance Audio Power Amp. projects with plenty of information for customisation.
n Pi Class
n Python Quickstart This book also includes PIC n’ Mix: ‘PICs and the
PLUS PICkit 3 – A Beginners
n Pi World E
guide’ by Mike O’Keefe FCRDE-ROM
EE M

n ...and much more!


ELECTRONICS ELECTRONICS ELECTRONICS
EE OM
FR -R FR -RO £8.99

Audio Out – an
£8.99 £8.99
D CD
DV
and Circuit Surgery
The Teach-In 6 CD-
TEACH-IN 6 analogue expert’s take
TEACH-IN 7 by Ian Bell – ‘State TEACH-IN 8
FROM THE PUBLISHERS OF FROM THE PUBLISHERS OF
FREE
CD-ROM
ROM also contains all on specialist circuits
SOFTWARE
FOR

Machines part 1 and 2’.


THE TEACH-
IN 8
FROM THE PUBLISHERS OF SERIES

the necessary software RASPBERRY Pi ®


DISCRETE LINEAR CIRCUIT DESIGN
A ComPREhEnSivE GuidE to RASPBERRY Pi
Practically Speaking – • Understand linear circuit design
The CD-ROM includes
INTRODUCING THE ARDUINO
for the series, so that
• Hardware – learn about components and circuits
• Pi PRojECt – SomEthinG to Build • Design simple, but elegant circuits • Programming – powerful integrated development system

the techniques of
• Pi ClASS – SPECifiC lEARninG AimS • Learn with ‘TINA’ – modern CAD software • Microcontrollers – understand control operations
• PYthon QuiCkStARt – SPECifiC PRoGRAmminG toPiCS • Five projects to build: Pre-amp, Headphone Amp,
readers and circuit the files for:
• Communications – connect to PCs and other Arduinos
• Pi woRld – ACCESSoRiES, BookS EtC Tone Control, VU-meter, High Performance Audio Power Amp

project building.
• homE BAkinG – follow-uP ACtivitiES

designers can get FREE


DVD-R
ALL THE
OM
SOFTWA
RE
FREE M
-RO
n Teach-In 8
started quickly and
N6
TEACH-I
FOR THE RRY Pi CD CIRCUIT
RASPBE ALL THE

nM
 icrochip MPLAB
RE FOR
SERIES SOFTWA 7
CH-IN
THE TEA

easily with the projects


SERIES

IDE XC8 8-bit compiler


and ideas covered. PluS
Pi B+ uPdAtE
intERfACE – a series of
ten Pi related features
PLUS...
AUDIO OUT
An analogue expert’s take
n PICkit 3 User Guide PLUS...
n Lab-Nation
on specialist circuits
REviEwS – optically PIC n’MIX
isolated AdC and i/o PRACTICALLY SPEAKING PICs and the PICkit 3 - A beginners
The techniques of project guide. The why and how to build
interface boards

Smartscope software.
building PIC-based projects

Teach In 6 Cover.indd 1 02/03/2015 14:59:08 Teach In 7 Cover VERSION 3 FINAL.indd 1 07/04/2016 08:25 Teach In 8 Cover.indd 1 04/04/2017 12:24

ORDER YOUR BUNDLE TODAY!


JUST CALL 01202 880299 – OR VISIT www.electronpublishing.com
The Fox Report
Barry Fox’s technology column

Report from the Digital Television Group Summit

T
his year’s DTG Summit – Freeview until 2034. How this commit- Freely
organised by the Digital Televi- ment will bind any future government The UK’s public service broadcasters, BBC,
sion Group, which standardises and minister is unclear. ITV, Channel 4 and Five, are banking on
the tech needed to watch digital TV in a recently announced new service called
the UK – coincided with news that the Careful how you change Freely, which was being demonstrated
government and communications regula- Although no-one was blunt enough to in exhibition space at the DTG Summit.
tor Ofcom are looking at a timetable for mention it (or perhaps hadn’t yet seen Jonathan Thompson, Chief Executive of
switching TV viewing from traditional it with their own eyes) the Summit also Everyone TV, the new company behind
over-the-air linear broadcasts to Internet- coincided with a dramatic example of the Freely, describes himself as ‘a former di-
based IP streaming delivery. perils of transitioning from broadcast to rector of strategy for Ofcom and Channel
In October 2023, Ofcom launched a broadband delivery. 4’ with ‘extensive experience of working
‘Call for Evidence’ on how changing The struggling TV station TalkTV had in broadcasting and the regulatory envi-
audience habits, in particular, the in- just ceased normal broadcasting and ronment’. He read a speech which said
crease in Internet-based viewing, will switched to stream delivery. Anyone tun- very little about how Freely works, just
affect the future of TV distribution. ing an ordinary TV to TalkTV’s Freeview a lot about how Freely is ‘a foundation
Over 75s are four times more likely to channel 237 got a dark screen; anyone for the future’ which bundles ‘everything
rely on digital broadcasting than Gen with a smart TV is – in theory – automati- from the public service broadcasters
Z youngsters who have been brought cally redirected to Channel 294, which is – Freeview terrestrial and Freesat satel-
up with streaming. Over 50% of 16- a Freeview channel that automatically lite, along with the catchup services like
24 year-olds don’t watch TV. They logs into an IP stream. In practice, and iPlayer, in one place, for free’.
stream YouTube or Tik Tok, instead. even with fibre broadband, the viewer ‘All you need is Wi-Fi,’ Thompson said
Yih-Choung Teh, Ofcom’s Director of waits what may be minutes to see a dark (as long as the broadband speed is at least
Strategy and Research, compares the screen, then an invitation to press the 10 Mbps). ‘Freely provides multiple entry
switch to IP streaming as ‘comparable remote control’s Red Button (which ap- points. We continue to support Freeview
to Digital Switchover’ when the UK pears unnecessary), then sees a message and Freesat and Freeview Play. Freely
very successfully ditched analogue TV. that connection may take 30 seconds and just adds to the mix. We are at the start
‘The tipping point will be when it finally, after what may be minutes, gets to of a journey’.
is no longer viable for broadcasters to watch the programme. The delay probably Freely’s demonstrators outside in the
deliver digital television,’ he says. This depends on the quality of the smart TV. exhibition space were able to add a
will come when not enough people are I’ve also encountered problems with little more hard fact detail. So far, the
receiving broadcasts to justify the cost lost lip sync and stream freezing, with only way to receive via Freely is to buy
of transmitters. gaps so long that by the time the pictures a new Hisense TV set with the Freely
But he assured that Ofcom is commit- and sound are up and running again, the system built in. This takes in Freeview
ted to ‘not leaving people behind’ and topic being discussed has changed. And Digital Terrestrial broadcasts through a
Minister for Digital Infrastructure Julia for some unexplained reason the news conventional aerial socket and broadband
Lopez added the assurance that although breaks contain no news. streams by Wi-Fi (and presumably also
99% of TVs sold next year will be ‘smart’ It’s a confusing mess and unless there Ethernet). Freely numbers its channels
and Internet-enabled, the government will are major advances, mixing IP and DTV differently from Freeview and Freesat.
not pull the plug on Digital Terrestrial effectively kills channel hopping. So Sky News is on channel 303 instead

TalkTV has provided a masterclass in how not to transition from broadcast TV to IP streaming.

10 Practical Electronics | July | 2024


of 233 on Freeview, and 202 on Freesat; The eBay Money Back Guarantee repeatedly told what so many home
troublesome TalkTV is on Freely chan- scheme managed by eBay (UK) Ltd cov- computer users are so often told – ‘you
nel 305. ers purchases made via eBay’s online are the only person complaining’.
‘It’s a new platform with a new list that market place eBay (UK) Ltd at eBay. Fortunately, there are simple, effective
mixes DTT and IP that makes the Public co.uk and is not regulated by the FCA ways to challenge amorphous big bodies
Service Broadcasters more prominent’ and not answerable to the FOS. that now routinely communicate from
explains Freely. So the FOS cannot consider complaints email addresses that bounce replies. The
Freely says it has struck a deal with about the eBay Money Back Guarantee key is to go low-tech. The easy answer
Turkish company Vestel, to put Freely because it is managed by unregulated used to be to send the Chief Executive
in its Toshiba, JVC and Bush TVs and is eBay (UK) Ltd. The FOS can only con- an entertainingly worded fax, addressed
‘talking to LG and all the major TV brands’. sider complaints from sellers on eBay. to the company’s main fax number. The
I complained to the ASA that eBay has fax would then become an open letter for
Narrow, expensive option not been making this clear. anyone in the office to read on its way
Seasoned broadcast engineers who regu- The ASA acknowledged my complaint to their boss.
larly attend the DTG events were sur- with the now-standard convenient-for- Faxes are no more, but do not despair,
prised at Freely’s launch strategy – with the-ASA note that if a complainant hears there is still low-tech snail mail. Write an
the only available Freely product so far nothing further from the ASA within 15 entertainingly worded letter to whoever is
a costly TV set, and no consumer option days, they should assume that the ASA named as The Big Boss on the company’s
to buy an add-on set top box or dongle is not investigating their complaint. self-congratulatory website, and post it
that can be connected by HDMI cable to I duly heard nothing from the ASA in an envelope personally addressed to
existing TVs, like an Amazon Fire Stick so must assume that the ASA is not The Big Boss. Companies don’t now get
or Roku device. concerned about the eBay guarantee many old-fashioned letters, so it’s a safe
‘I don’t change my TV every year’ was loophole. Perish the thought that it bet yours will be read and enjoyed by
how one broadcast engineer put it. ‘It finds tricky legal issues, along with many office staff before eventually ending
seems daft not to start with an add-on de- tricky technical issues, beyond its ken up on the desk of someone senior. They
vice’. A Freely spokesperson says Freely – however clearly presented. will know it has already been widely
is ‘talking’ with all manufacturers and Judge for yourself from the ASA’s list read, so is not safe to ignore.
assures that there is no technical reason of topics recently dealt with – there’s I’ve played this ruse three times re-
why a set-top box or dongle cannot be not a single tech issue amongst them: cently, to an incompetent broadband
used to receive the new service. ‘Cart https://bit.ly/pe-mar21-asa1 provider, a hopeless press office at a
before horse’ is how one group of DTG Perhaps what we need is new body, national research lab and a devious
delegates summed up Freely’s launch TATASA, The Tricky and Tech Advertis- university department head. In each case
strategy during the coffee break. ing Standards Authority. just one suitably worded snail mail letter
to The Big Boss has triggered quite magi-
Facts, facts, facts Going postal cal near-instant action from previously
Regular readers will know that I work on Also, but with sub-zero expectations, I No-Reply employees.
the boring old principle that facts are king filed a test complaint about the way the
as a reference source, while conjecture, impressively titled Postal Redress Service

NEW!
assumption and opinion are generally (POSTRS), run by the even more impres-
worthless. So, for the sake of complete- sively titled CEDR (Centre for Effective
ness, I’ll briefly put on record a couple Dispute Resolution), had handled my com-
of fresh hard facts relevant to the pieces plaint about the way Royal Mail’s impres-
I’ve written about self-protection when sive multi-tier internal complaints system
buying on line. Also, some fresh self- had brushed aside diligently collated evi-
protection tips for the Internet Wild West.
Just for the heck of it and with zero
dence showing delivery fraud inside Royal
Mail. I complained that POSTRS/CEDR
5-year
expectations I filed a complaint with
the Advertising Standards Authority
gave no reasons for complaint rejection.
POSTRS/CEDR excused itself thus, ‘The
collection
about the convoluted way in which eBay
promises protection under the Finan-
CEDR Complaints Procedure does not
allow any investigation to be carried out
2017-2021
cial Ombudsman Services if things go into a decision made by an adjudicator
wrong with eBay’s Moneyback Guarantee or the decision process adopted by that All 60 issues from Jan 2017
scheme. In a memo nutshell, eBay in the adjudicator or the evidence they choose to Dec 2021 for just £44.95
UK comprises two quite different and to consider or give weight to.’
separate entities: 1) eBay Marketplace, You have to hand it to them all. They
PDF files ready for
which is eBay (UK) Limited, accessed are being paid good money to ensure no immediate download
via the eBay.co.uk website and 2) eBay sane person would ever bother complain-
Commerce UK Limited. ing about anything relating to Royal Mail. See page 6 for further
eBay Commerce UK Limited (ECUK) More broadly it is now a sad fact of
provides payment services for sellers on modern on-line life that most avenues
details and other great
the eBay platform and is regulated by the of official complaint now lead to a brick back-issue offers.
Financial Conduct Authority (FCA). The wall of illusory concern for consumer
Financial Ombudsman Service (FOS) well-being, with buck-passing middle Purchase and download at:
can investigate complaints for seller managers hiding behind No-Reply email www.electronpublishing.com
payment services. addresses. Just as the postmasters were

Practical Electronics | July | 2024 11


Net Work
Alan Winstanley
This month, more useful ideas for USB charging and monitoring are given, plus practical
advice about hobby and craft adhesives found online, as used in precision smartphone
repairs. There’s more space programme news as well.

I
n last month’s column I showcased certain powerbanks and mains chargers
some USB-powered products that can intelligently communicate with a
typically use a 5V USB source to device using a USB-C lead, raising the
recharge their internal batteries. Whether charging voltage to 9, 12, 15 or even 20V
it’s a camping light, earbuds, Bluetooth to deliver more power and cut charging
speaker or a powerbank, it seems that times dramatically. Last month, I suggested
almost every Chinese-made gadget or some USB add-on monitors that show
rechargeable device now arrives with a what’s actually happening when USB-
USB-C lead included for use with your powered devices are being charged. Tiny
own charger. Some USB leads might only digital meters are readily available that
cost a few pence to make and are often plug onto the end of a USB-C cable to
The KOWSi KWS-065C is a thumb-size
included just to add ‘perceived value’ to display the power being delivered, and a
inline USB-C monitor showing voltage,
the product – I have a dozen scattered ‘PD’ icon confirms when Power Delivery current, wattage, capacity and elapsed
around, ready for the recycling bin. A is operating. These gadgets are very handy time, and is rated up to 6.5A.
‘hanked’ lead is one formed by coiling it for use with an existing USB charger cable.
between two spindles or around a bar to Since last month, several more USB Another KOWSi USB-C monitor, the
produce a tidy coil, usually with a wire leads and monitors have arrived from KWS-2301C, has a 0.77-inch HD mono
tie twisted round the middle or retained China which I’ve been testing over the OLED readout that really impressed
with a fancy sleeve. Apple addressed the past few weeks. Basic monitors that use me: although more compact in size, its
thorny problem of producing hanked USB an A-type port such as the KOWSi USB comprehensive display shows five lines
leads many years ago, by shaping them Detector shown on p.11 last month display of data including time, maximum values,
around two mandrels as shown in Apple’s voltage and current, but I’ve now sourced CPU temperature and direction of flow.
patent, downloadable from the US Patent a more versatile USB-C monitor that has It’s rated up to 12A and the display
Office at: https://bit.ly/pe-jul24-pat an uncluttered multicolour display. The is crystal clear, but having the eyesight
Silicone cable ties and clips (pictured KOWSi KWS-065C is a useful thumb-size of a sparrowhawk might help! KOWSi
below) are available cheaply from Temu, inline device showing voltage, current, is a brand of Yuyao Lianke Electronics,
and are quite handy for keeping USB wattage, capacity and elapsed time. It and the products mentioned cost just
leads manageable. (While I was at it, with memorises readings until reset and the a few pounds from AliExpress, though
online security in mind, I spotted some white segments can be cycled to show remember that AliExpress doesn’t include
stick-on privacy covers for my laptop’s power, watt-hours and capacity. It supports sales tax in their on-screen prices.
webcam that work perfectly.) the major charging protocols and is rated
The latest ‘rounded-rectangle’ USB-C 4-30V at up to 6.5A. I like this general- Untangled cables
connector is now commonplace and, as purpose USB-C monitor – it’s both clear to Higher-power USB charging cables are
I showed last month, things get more read and easy to use. The similar KOWSi available that have a digital display
interesting when ‘Power Delivery’ (PD) is KWS-066C crams more data on a colour built into a USB-C plug for convenience,
involved: a PD-compatible source such as display and shows temperature as well. and I managed to source a braided

(left) A ‘hanked’ computer lead is factory-made using a wire tie, but you can buy silicone straps or rubber clips from Temu to manage
cables. (right) a stick-on privacy shutter for laptop webcams from AliExpress or Temu.

12 Practical Electronics | July | 2024


The KOWSi KWS-2301C offers a 0.77- This braided USB-C lead by Essager has UGREEN offers quality braided charger
inch OLED readout showing five lines of a built-in digital display for power and PD, cables of various lengths that are
data, including direction of charging. It is and is tangle-free. It’s rated at 100W, 7A. flexible and easy to manage. A right-
rated up to 12A and will be very useful for angle braided USB lead offers a more
monitoring high-power charging. ‘memory free’ cable sleeving helps to keep compact connection that is less prone to
them tangle-free and twin packs are sold accidental damage.
one-metre-long USB-C lead sold under by Amazon. To help avoid accidentally
the Essager brand. Just like the tiny inline causing damage to the charging port of, Electronics experimenters might be
USB-C monitors previously mentioned, say, a smartphone or tablet, it might be interested in some low-cost ‘PD trigger’
it displays the wattage and PD (when worth considering using a right-angle USB modules that are sold online. Also called
available) on a small seven-segment lead which doesn’t protrude so much. I ‘decoy boards’, they are designed to ‘trick’
display, which will be adequate enough found a short 0.5m braided type made a USB-C PD supply into outputting a
for keeping an eye on a device’s charging by UGREEN on Amazon. higher voltage, for use as a DC power
status. I liked the flexible and tangle- Powerbanks themselves are widely supply. Some use a dip switch to select
free braided sleeving, and the cable available and USB-C charging ports the voltage while others work at a fixed
is rated by the makers at up to 100W, can be bidirectional: they are able to voltage (9V through to 20V). User reviews
7A. It would be handy when charging recharge the powerbank as well as are mixed, but the low cost makes it worth
all sorts of small appliances that use a charging a device. It’s easy to overlook experimenting with them. AliExpress offer
USB-C charger. this, so it’s worth double-checking the a variety of cheap ones and Amazon has
I also sampled some UGREEN brand user manual to make sure. The KOWSi one with dip switches, code B0BGPH1675
braided cables that are 0.5m long, with KWS-2301C mentioned earlier, clearly (illustrated below left).
A-type plugs at one end that will fit in my shows the direction of current flowing
desktop USB charger. Again, the flexible in a bidirectional connection. Cracking under pressure
With high-speed charging currents now
topping several amps, one wonders what
effect that might have on the battery itself.
More than ever, I don’t leave devices on
charge without supervision, nor leave
them charging unattended overnight.
My own smartphone has ‘smart charge’
monitoring that suspends charging to
prevent abuse and extend battery lifespan,
and the phone still works admirably after
(left) For experimenters, low-cost ‘PD several years of heavy use. However, one
trigger’ modules or ‘decoy boards’ can of my nearly new powerbanks recently
trick a PD power source to create a variable developed a worrying crack in the plastic
voltage DC supply for your projects. (right) case, an unwelcome sign of a swollen
A dip-switch type is also shown. battery which was probably due to a

1455 extruded enclosures


Learn more: new
hammondmfg.com/1455 square
profiles
[email protected]
01256 812812

Practical Electronics | July | 2024 13


batteries and lithium-ion powered devices
(which includes laptops, powerbanks,
e-cigarettes and ‘smart’ luggage tags) on
aircraft. The IATA rules regarding what
should be ‘carried on’ and what cannot
be stored in ‘checked-in’ baggage can be
found on the IATA website, and a PDF is
available at: https://bit.ly/pe-jul24-iata1
It will be worth double-checking with
your airline before travel, and general
dangerous goods guidance is published
by IATA at: https://bit.ly/pe-jul24-iata2

Hello, can you speak up?


One of the joys of working with
microelectronics is that it gives you
confidence to handle tricky technical tasks
such as smartphone or even quartz watch
repairs. My Huwei smartphone suddenly
went on the blink recently when I realised
that callers could hear me, but I couldn’t
This powerbank cracked after having some PD-level charging, which hints at a swollen hear them, nor could I listen to any media
and failing battery. It’s not worth risking a fire or explosion, and will be discarded safely. soundtracks unless I used the phone’s
hands-free speaker. A built-in diagnostic
manufacturing defect or over-charging. It LED, see p.10 last month). This model program proved that the earpiece was
might be a co-incidence, but this defect BI-B61 is a PD 22.5W powerbank with a faulty, so my first job was to search YouTube
only arose after I’d started using a high- large digital display showing the remaining looking for ideas. Sure enough, a video
power PD charger with it. charge. It carries two USB A-type ports showed that replacing the earpiece looked
For the sake of writing off a few pounds, and a bidirectional USB-C port (5, 9 and straightforward enough for a technical
it’s not worth risking a fire or potential 12V on PD) which are all clearly labelled. user, needing a few tools together with a
explosion, especially when batteries are Its compact form factor is designed with particular adhesive to glue the phone back
stored indoors, so it will be scrapped and portability in mind. Weighing in at just together again (more on that shortly).
disposed of safely in a proper recycling under 200g, a carry bag is included and Some ‘pry tools’ costing a pound or
facility. It’s highly dangerous to throw them there’s a small pop-out phone stand as two were sourced from Temu. These
away in general waste as they can rupture well. The INUI BI-B61 powerbank is flexible slivers of steel enabled me to
and cause a major fire, either in the garbage guaranteed for three years and is available carefully prise off the rear of my phone,
truck or back at the recycling site itself. from Amazon (B08VD632WJ) along with but having quite sharp edges they need
It seems that once their capacity reaches higher capacity models. handling with care. The main challenge
20,000mAh, powerbanks can become Finally on this topic, with the was probing around the case looking for a
heavy and unwieldy and certainly too forthcoming holiday season and air travel starting point, but after carefully gaining
inconvenient to carry, so I was attracted to in mind, it’s worth remembering that entry by a few millimetres the tools were
a 10,000mAh sold by INIU (the same brand there are strict regulations regarding used to slice through the glue seal around
that sells a USB charging lead with built-in the carrying of lithium batteries, spare the perimeter of the case. The rear was
then successfully removed, being careful
not to damage the rear fingerprint sensor
ribbon cable. (I ignored some incorrect
guidance given in the YouTube video!)
Some spare earpieces had arrived
from eBay costing just £5 for two, so
after removing some tiny screws the
new earpiece was carefully dropped
into place with pointed tweezers. Many
online sources alluded to a mystery
adhesive dubbed ‘B-7000’, which piqued
my interest because my former career had
involved working for the country’s largest
contract filler of small containers, and at
one time I witnessed the London factory
in full swing, churning out thousands
of tubes at a time (the superglue filling
machine was especially temperamental).

Behind B-7000
I’d never heard of ‘B-7000’ until now,
and a 15ml tube of this mystery glue
duly arrived via eBay. It turned out to
A 10,000mAh powerbank by INIU offers a digital display and PD. It is designed with be a clear, self-levelling acrylic adhesive,
portability in mind. dispensed via a needle-point nozzle

14 Practical Electronics | July | 2024


new battery, only to find that the watch
stopped working altogether a few days
later. Trying another battery made no
difference, so it looked like a new Miyota
movement (which are owned by Japan’s
Citizen Watch) would be needed. It’s
potentially do-able but needs a very steady
hand and good eyesight, but then I found
replacement circuit boards for certain
quartz movements were sold online. I
thought it was worth a gamble at £10
each and one arrived from Singapore.
Sourcing some watch opening tools and
a magnetic screwdriver, I successfully
replaced the quartz controller circuitry,
leaving the rest of the movement in
situ. The screws measured just 0.3mm
diameter, not much bigger than two
full stops, and they will challenge any
electronics constructor, but happily it
Handy tools designed for prying open and disassembling electronic products are all fitted back together perfectly and the
widely available online. A small tube of B-7000 adhesive is also shown. watch sprang back into life. Faced with
scrapping something or tackling a DIY
with a low viscosity that allowed an dispensing needle tip designed for precise repair, it’s often worth browsing around
accurate bead of glue to be drawn around applications (though replacing the cap the likes of AliExpress, YouTube and
the edge of the phone – you do need a again is like threading the eye of a needle). eBay as you never know what prizes and
steady hand. The phone rear could then I found B-7000 has the lowest viscosity surprises you might turn up.
be replaced and clamped together with in their range, which allows for accurate Readers interested in maintaining
some spring clamps while the adhesive dispensing through a fine needle. I’m quartz watches, batteries and straps
cured. Excess glue is simply rubbed off, reminded of my chemical industry days, might find the author’s Watch Battery
and after allowing some time for it to dry where lab technicians measured viscosity DIY Handbook useful. It’s A4 size and
I’m happy to say my phone repair was using a special apparatus (a viscometer) contains many worked examples and
successful, a satisfying result that cost to test how ‘thick’ or resistant to a stirrer close-up colour photos of actual tasks,
me just a few pounds. the fluid was. Viscosity is measured in coin cell data and more, and is available
Inspecting the enigmatic tube of glue, milliPascal-seconds (mPas), or you may on Amazon (B0CPBVG3K6).
I found it was an unbranded Chinese see the (obsolete) unit centipoise instead –
import with no hazard or handling data every day’s a school day! The makers state Other news
at all, nor even a manufacturer or MSDS that B-7000 has a viscosity of 2800mPas. China’s space programme continues
(data sheet) was available, which rules out Other glues have different viscosities at pace. At the end of April, China’s
commercial or industrial use in Britain. I and hardness, and some are also offered Shenzhou-17 spaceship parachuted
eventually found a likely-looking Chinese in black (eg, T-7000). After trying the safely to Earth, bringing home three
manufacturer called Zhanlida Adhesives glue, I’ll keep a tube or two of B-7000 in taikonauts after a six-month mission
who produce adhesives for DIY, craft, the workshop for delicate repairs. The on board China’s Tiangong (‘Heavenly
industry and hobby use. It’s unclear if a product is on the usual websites and it Palace’) space station. There was also
similar-looking product found online, will pay to shop around. A comparison the successful launch in May of the 8.35
branded ‘Bu Lai En’, is connected with of glue properties is published at: tonne Chang’e 6 on board a Long March
them: some dodgy English was apparent https://bit.ly/pe-jul24-zhan heavy lifter. This mission will follow the
on the labelling. Still on the subject of saving money earlier Chang’e 5 which landed in 2020,
Some readers might be interested in with DIY repairs, I recently fitted a but it aims to land on the far (dark) side
these glues and especially the ultra-fine cherished Bulova quartz watch with a of the moon and, as a world first, bring

Terrington
Components
• Project boxes designed and manufactured in the UK.
• Many of our enclosures used on former Maplin projects.
• Unique designs and sizes, including square, long and deep
variaaons of our screwed lid enclosures.
• Sub-miniature sizes down to 23mm x 16mm, ideal for
IoT devices.
MADE IN BRITAIN

www.terrington-components.co.uk | [email protected] | Tel: 01553 636999

Practical Electronics | July | 2024 15


and also the 16-year timescale has been ruled excessive, so a
re-design is now on the cards and less elaborate solutions are
sought. For its part, Airbus UK in Britain had developed a new
‘Sample Fetch’ rover destined to land on Mars in 2028 and gather
the sample tubes for transfer to a Mars Ascent Vehicle, ready to
be returned to Earth. The £20m Sample Fetch rover was scrapped
in 2022 but may be revived for future lunar missions instead.
Chinese online vendor Temu continues to forge ahead and in
the author’s experiences so far, every order has been faultlessly
delivered within seven days and the website is probably the
slickest that he has ever used. It is sometimes hard to believe that
it was not designed in Britain or America; a Chinese-language
email received from Temu explains that their cross-border
E-commerce platform is now second only to Amazon. In the
A sample of Martian soil deposited into a small titanium tube by UK, delivery is free but the minimum order is £15. You can
NASA’s Perseverance rover, awaiting collection and return to sign up and ‘shop like a billionnaire’ at: www.temu.com
Earth some time into the future. Two years ago I brought news that a new ‘gigafactory’ for making
EV batteries was being built by BritishVolt in north-east England
two kilos of moon samples back to earth for analysis. Photos to supply an emerging EV manufacturing industry (Net Work, May
also showed that the lander carries a small, wheeled buggy, 2022). Sadly, the fledgling project collapsed into administration
the purpose of which is unknown. due to lack of funding. A year later the site was acquired by
At the time of writing, we awaited news of Boeing’s new crewed Australia’s Recharge Industries, hoping to produce batteries for
Starliner being launched by an Atlas rocket. The launch was EVs and the military, but that proposal also hit financial problems
postponed due to an oxygen relief valve problem. In Net Work, and fell through. According to local press reports, the 235-acre
August 2023 I reported on NASA’s grand plan for the Mars former power station site, called Northumberland Energy Park
Sample Return (MSR) project, an extremely ambitious project 3, has been acquired by the US asset managers Blackstone and
to bring back to Earth soil samples that have been drilled by is destined to become a large-scale data centre, maybe operated
NASA’s Perseverance Rover. Some two dozen samples from by QTS Data Centers, to serve the needs of Google or Microsoft.
various locations have been collected (all methodically logged Google is building a 33-acre AI data centre in Waltham Cross,
at: https://bit.ly/pe-jul24-nasa) and sealed in tubes ready for 12 miles north of London. Nearby residents complain bitterly
future collection. You can see the principle being tested at: about the construction work and loss of amenities. That’s
https://youtu.be/WLFyuRswVYA nothing: in North Lincolnshire, plans have been submitted to
The MSR mission has now hit the Martian rocks, at least build a data centre five times larger, on a 185-acre greenfield
temporarily, having been deemed far too expensive at $10bn arable site known as Humber Tech Park. The developers tease
that it would be a hub for the AI industry and one of the largest
in Europe. Construction plans include a 10m-high greenhouse
ESR Electronic Components Ltd that would utilise excess heat from the data centre, and possibly
the local authority’s swimming pool would benefit from heating
being piped to it as well.
On the electric vehicle front, Storedot, proponents of ‘XFC’
All of our stock is RoHS compliant and CE extreme fast-charging EV battery technology, have demonstrated
approved. Visit our well stocked shop for a Polestar 5 EV charging from 10% to 80% capacity within ten
all of your requirements or order on-line. minutes. The demo consisted of a 77kWh battery pack with
a consistent charge rate of over 310kW, peaking in excess of
We can help and advise with your enquiry, 370kW, with no overheating effects experienced throughout,
from design to construction. they say. The technology aims to eliminate ‘range anxiety’
woes in EV owners.
Another acronym is destined to enter the EV lexicon in
due course – the ASSB or All Solid-State Battery. Car maker
3D Printing • Cable • CCTV • Connectors • Components • Nissan explained its own ambitions for using solid electrolyte
Enclosures • Fans • Fuses • Hardware • Lamps • LED’s • ASSBs, and the advantages over lithium-ion batteries, in an
Leads • Loudspeakers • Panel Meters • PCB Production •
article that hints at the way that the EV industry is gradually
Power Supplies • Relays • Resistors • Semiconductors •
moving: https://bit.ly/pe-jul24-nissan
Soldering Irons • Switches • Test Equipment • Transformers
and so much more… Steep tariffs placed on Chinese EVs in America have kept
them off the US market, so shiploads of them are apparently
Monday to Friday 08:30 - 17.00, Saturday 08:30 - 15:30
destined for Europe instead. Sources claim that more Chinese
EVs cars are being produced than can possibly be sold, and new,
unsold ones are stacking up and disrupting European ports. An
interesting analysis is in a blog entry at: https://bit.ly/pe-jul24-ev1
As for the problem of scrapping old EVs, I’ll close this month
with a link to a Bloomberg news item which shows unwanted,
obsolete EVs piling up and rotting away in China – you can
see more at: https://bit.ly/pe-jul24-ev2
Station Road
Cullercoats
Don’t forget the above web links are ready-made for you to click
North Shields on in the Net Work blog at electronpublishing.com
Tyne & Wear See you next
month for the latest The author can be reached at:
NE30 4PQ
Tel: 0191 2514363 [email protected] www.esr.co.uk from Net Work!
[email protected]

16 Practical Electronics | July | 2024


A thermal infrared camera measures hot
or cold spots compared to the surrounding
area. This is extremely useful in diagnosing
hot spots in electronic circuits, which may
indicate a failing component or the need for
a heatsink. They can be pricey, but not this
one, a DIY version that’s easy to build.

Pi Pico-based

Thermal
Camera by Kenneth Horton

I
R thermal cameras have many If the raw output of the Array Sen- this case, their advantages are minor;
uses beyond those listed above, sor is displayed directly on an LCD bilinear gets us most of the improve-
such as checking for overheating screen, it appears very ‘blocky’. Still, ment compared to no filtering with
mechanical bearings or identifying it can easily be upscaled using a tech- very little processing.
areas of heat loss in a building. nique called bilinear interpolation to
Panasonic produces the AMG8833 give the appearance of many more Object emissivity
Infrared Array Sensor (‘Grid-EYE’) data points. The PicoMite Thermal The ‘fly in the ointment’ for a ther-
that detects IR emissions on a Camera can upscale by factors of two, mal camera is that objects vary in
64-pixel 8 × 8 array. It uses the I2C four or nine. These factors were cho- emissivity. An ideal IR emitter is
serial protocol, so it can easily inter- sen as they make the best use of the called a ‘black body’ with 100% elec-
face with a Raspberry Pi Pico run- screen width. tromagnetic emission/absorption.
ning the Pico­Mite operating system. Below the thermal image display Shiny objects like mirrors have
Objects emit infrared energy in is a text read-out showing the maxi- an emissivity closer to 0%. If you
proportion to their temperature; the mum, minimum and average tempera- point an IR thermometer or camera
higher the temperature, the more IR tures and the current operating mode. at them, you will measure the tem-
energy is emitted and the higher its fre- As mentioned above, the Array Sen- perature of an object that the mirror
quency. For really hot objects, the fre- sor can sample at 10 FPS (frames per is reflecting, not the mirror itself.
quency extends into the visible wave- second) or 1 FPS. The former is most Luckily for us, many electronic
lengths, which is why hot objects are suited to fast-changing subjects, while components are dark colours and will
seen to glow. By measuring this energy, the latter better smooths out random have an emissivity of at least 90%, so
we can get a pretty good idea of the noise in the sensor, giving a more sta- a thermal camera will measure their
temperature. However, there are some ble and accurate output. temperature accurately. Human skin
pitfalls, which we will mention later. has an emissivity of 97-99.9%, so IR
With the Grid-EYE sensor, each Bilinear interpolation thermometers also work well for mea-
pixel has a viewing angle of approxi- This involves drawing an imagi- suring our temperature.
mately 7.5°, so the overall sensor has nary straight line between two data This isn’t a fatal flaw but be aware
a viewing angle of 60° (7.5° × 8). Each points, then generating new data that the temperature measurements
pixel has a tolerance of ±2.5°C when points in between that lie on that of metallic objects using this IR cam-
operated within specification. We line. It’s a simple technique that era could be inaccurate. It isn’t just
can minimise this error by calibrat- produces a much smoother-looking well-polished metal surfaces either;
ing the sensor, as described below. result than the more basic ‘nearest even rough, oxidised aluminium
Also, there can be random operat- neighbour’ technique that gives a only has an emissivity of about 20%,
ing ‘noise’ of up to ±2.5°C per pixel. blocky image. with polished metal surfaces usually
To reduce this, the sensor is used in More complicated interpolation below 5%.
moving-­average mode, which aver- schemes like trilinear, bicubic, A known work-around to measur-
ages two readings when the sensor Lanczos or anisotropic interpola- ing the temperature of shiny surfaces
is set up for a 10Hz frame rate or 20 tion involve considerably more pro- (eg stainless steel pipes) is to apply
readings when for a 1Hz frame rate. cessing (arithmetic) than bilinear. In some matte painters tape, which has

Practical Electronics | July | 2024 17


Raspberry Pi-based
Thermal Camera
Fig.1: the Thermal Camera circuit is straightforward, with the IR sensor array (MOD1) communicating with the
Raspberry Pi Pico over an I2C bus (SDA/SCL) and the LCD screen being driven over an SPI bus (CS, SCK and MOSI). The
only other components are the pushbutton for changing modes (S1) and a 39W resistor to set the LCD backlight current.

a better emissivity. For more infor- find the display on the same sites. 2 Restore the calibration data and last
mation, see: https://w.wiki/6R6E There are some suggested links in pushbutton settings
the parts list. 3 Load the colour spectrum from the
Circuit details The prototype was powered via the table
Refer now to Fig.1, which shows that USB port on the Pi Pico, but there are 4 Enter the main loop
the hardware for the project is rel- also pads on the PCB for an external 5V a. Read 64 pixels from the sensor and
atively straightforward. It consists power supply. This way, the Thermal adjust with the calibration data
of just three modules: the Infrared Camera can be powered by a battery. b. Calculate the maximum, minimum
Array Sensor, a Raspberry Pi Pico The pushbutton is connected so and average temperatures
running the PicoMite operating sys- that it pulls the GP18 pin to GND c. Convert the absolute temperatures
tem (MMBasic) and a 1.8-inch SPI when it is pressed. The Pico has an to points on the colour spectrum
TFT LCD screen with a display res- internal pull-up current enabled on d. Interpolate the intermediate colour
olution of 128 × 160 pixels and an that pin, so its voltage is high when values for each row using bilinear
ST7735 controller. the button is not pressed and goes interpolation
The sensor array is connected to low when it’s pressed, allowing the e. Interpolate the intermediate colour
the Pico via an I2C interface, while digital input to sense the change. values for each column using bilin-
communications with the LCD ear interpolation
screen are over an SPI interface. The Software operation f. Update the display
only passive components are a push- The basic flow of the program is: g. Check the pushbutton state
button to change modes and a 39W 1 Initialise the PicoMite, LCD screen h. Delay if necessary
resistor to set the current at which and IR sensor array Repeat items a-h above indefinitely
the display backlight operates. The
following Pico GPIO pins are used:
GP08 LCD data/control (D/C) The rear of the enclosure (86 × 33.4
GP09 LCD chip select (CS) × 57.3mm) has a cutout for the
GP10 LCD SPI clock (SCK) AMG8833 IR sensor; you can
GP11 LCD SPI data (MOSI) also see a small cutout
for the Pi Pico’s USB
GP15 LCD reset (RST) connector on the
GP18 pushbutton sensing lip.
GP20 AMG8833 I2C data (SDA)
GP21 AMG8833 I2C clock (SCL)

The double-sided PCB is a carrier for


the three modules, the pushbutton
and the resistor. The display runs
from a 5V DC supply from the Pico.
On the Pico board, this is stepped
down by a regulator to 3.3V. That
3.3V runs the RP2040 microcontrol-
ler on the Pico and is also available
off-board, where it is used to power
the AMG8833 IR sensor array.
The array sensor is available from
the usual auction sites pre-mounted
on a breakout board, and you can

18 Practical Electronics | July | 2024


while the Pi Pico and IR sensor are
mounted on the top.
For convenience, the three mod-
ules can be mounted via socket strips
rather than soldering them directly
to the PCB. You can cut the sockets
from longer strips if you don’t have
6-pin and 8-pin sockets. The resis-
tor can be mounted on either side
of the board.
The switch is a two-pin or three-pin
SIL-type vertical pushbutton that sol-
ders directly to the PCB. Alternatively,
there is a provision in the 3D-printed
enclosure to mount other types of
pushbutton below the LCD screen and
wire them up to the pads on the board
using short connecting wires.
Once plugged into its socket, the
IR sensor is secured to the board
by two 20mm-long M2.5 machine
screws and nuts with 3D-printed
The Raspberry Pi is mounted on pin headers in sockets to make it easy to replace. spacers (Fig.4) between the PCB and
sensor. One of the spacers for the IR
LCD screen limitations Also, the display is extremely sensi- sensor has a cut-out to fit around an
Although the LCD screen is, in tive to the viewing angle and must be SMD component next to the module's
theory, a standard item, displays viewed head-on to get the full spec- mounting hole.
from different suppliers have dif- trum of colours. Otherwise, adjacent With the IR sensor array and LCD
ferent characteristics. One display colours blend into each other. attached to the PCB, now is also a good
tested had the red and blue colours time to plug the Raspberry Pi Pico into
reversed, while another batch had Construction its sockets.
random pixels at the bottom and The Thermal Camera is built on a dou- You can print the custom-made
right-hand side of the display. As a ble-sided PCB coded 04105231, measur- enclosure in two parts (body and lid),
result, three constants are defined ing 60 × 52.5mm and available from the shown in Fig.5. The STL 3D printer
to allow the program to be tailored PE PCB Service. The components are files are optimised for 0.2mm layer
to the attached display: mounted as shown in Fig.2 and Fig.3. height, 0.4mm wall thickness and
There are nine vias on this board. 100% fill; they can be downloaded
' Set to false for RGB displays
If you are using a commercially-­ from the July 2024 page of the PE website:
and true for BGR displays
produced board (such as the one sold https://bit.ly/pe-downloads
Const BGR_display = False
by Practical Electeonics), they will be Note that the first layer of the
' Some ST7735 displays have a
plated, and nothing else needs to be screw holes is filled as it gives a more
pixel alignment problem! Try
done. If you etch the board yourself, pleasing appearance to the front and
= 2
those nine vias need to be drilled and back of the case – just drill them out
Const HRES_offset = 0
short wire links soldered between the after printing. The holes in the lid
' Some ST7735 displays have a
top and bottom layers in each location. are countersunk under the top layer
pixel alignment problem! Try
The LCD screen and switch and are best cleared with an 8-10mm
= 1
mount on the underside of the PCB, drill by hand.
Const VRES_offset = 0
Despite the display supposedly
having 65,536 colours, they can’t
actually show that many. First,
RGB(247,251,247) is one step down
from white but looks significantly
dimmer. The difference between
this and the next step down,
RGB(239,247,239), is less noticeable,
as is each subsequent step.
For dimmer values, the less effect
each step has. RGB(127,127,127)
is very dim, and RGB(63,63,63) is
almost black! Another, more techni-
cal way of saying this is that the dis-
play has a very high gamma value.
As a result, it is difficult to get
more than about 38 distinct colours
across the spectrum (even with a Fig.2 and Fig.3: components are mounted on both sides of the board. On one
good imagination), and the span side are the Raspberry Pi Pico and IR sensor, both plugged in via header
from yellow through green to cyan strips. The LCD screen, pushbutton and resistor are mounted on the other side,
seems particularly compressed! although the resistor can go on either side.

Practical Electronics | July | 2024 19


The PCB assembly is held in the
case by four 25mm-long M3 machine
screws and nuts, with 3D-printed
spacers between the display and the
PCB at the opposite end to the con-
nector. It is necessary to insert the
display into the case first, insert the
machine screws from the front of
the case, place the spacers over the
screw shafts and then plug the PCB
onto the display. Finally, secure it
with the nuts.

Loading the software


Many readers will be familiar with
loading PicoMite software, which
was described in the article on the
PicoMite in the July 2022 issue The pushbutton is visible on the
(Make it with Micromite – Part 37); back of the PCB at upper left. A few
briefly, an overview is: different compatible types can be
nDownload the PicoMite operating obtained.
system and unzip the file from:
http://geoffg.net/picomite.html
nTo load the operating system onto loading the BASIC code. The only Note that the frame rates are sen-
the PI Pico, plug the USB cable difference between the two files is sor refresh times, not screen refresh
into a PC while holding down the the expected LCD screen configu- times. At 10 frames per second, the
white button. ration, so if the displayed colours screen update time is longer than
nThe Pi Pico will appear as a USB are wrong, load the other file. 1/10th of a second for scale factors 4
drive. To that drive, copy/drag the 1. and 9. At scale factor 4, the display
file PicoMitexx.xx.xx.uf2 Operation will be updated approximately every
nConnect to the PicoMite’s USB The pushbutton has the following 220ms and, at scale factor 9, every
serial port using your preferred functions: 700ms. This is because the bilinear
serial terminal emulator (eg, Ter- nShort press (less than 1.5 seconds): calculations take some time to com-
aTerm or PuTTY). cycles the display scaling factor plete for higher scaling factors.
nOnce connected, enter each of through 1, 2, 4 and 9 In calibration mode, the sensor
these commands in turn, but note nLong press (more than 1.5 seconds): is set to 1 FPS, and 10 readings are
that many of them reset the Pi Pico, toggles between 1 FPS and 10 FPS taken over a 10-second period. These
so the USB connection is lost and nVery long press (more than 10 sec- are then averaged, and the correction
will need to be restored before onds): enters calibration mode factors for each pixel are stored in
entering the next:
OPTION RESET
OPTION CPUSPEED 252000
OPTION SYSTEM SPI Fig.4: 3D-printed spacers are used rather than off-the-shelf types since we
can make them exactly the right dimensions, and you can print them at the
GP10,GP11,GP12
same time as the case. Note the cut-out in one to clear an SMD component
OPTION LCDPANEL near the mounting hole on the IR sensor module.
ST7735,RP,GP8,GP15,GP9
OPTION SYSTEM I2C GP20,GP21
nT
he following two commands are
optional; the first shows you what
you have configured, while the
second lets you verify that the LCD
screen is working:
OPTION LIST
GUI TEST LCDPANEL
nF inally, load Thermal camera.bas
into the PicoMite, again using your
preferred serial terminal emulator
or MMEdit. Use the ‘Autosave’ or
‘XMODEM receive’ commands,
depending upon your preference.
n If you’d prefer to skip most of the
above sequence, you can down- Fig.5: the 3D printed enclosure
load the Thermal camera (RGB). base and lid. The holes do not
uf2 or Thermal camera (BGR). go all the way through because
it gives a neater result to drill
uf2 file from the PE website and
the thin panels after printing the
upload it in the third step above. case than print the case with the holes.
That’s equivalent to running all
the configuration commands and

20 Practical Electronics | July | 2024


temperatures in Fahrenheit rather
Parts List – Raspberry Pi Thermal Camera than centigrade/Celsius.
The constant ‘Minimum_span’
1 double-sided PCB coded 04105231, 60 × 52.5mm from the PE PCB Service sets the minimum temperature
1 Raspberry Pi Pico span for the display when there is
1 3D-printed enclosure (body and lid) little temperature variation across
4 3D-printed spacers the whole display. This prevents
1 AMG8833 Grid-EYE IR sensor array breakout board module with pin order wildly varying colours for minimal
VIN, GND, SCL, SDA, INT and ADO temperature changes. Lower values
[AliExpress www.aliexpress.com/item/33012193094.html] make the display more sensitive
1 1.8-inch 128×160 pixel SPI LCD TFT screen with ST7735 controller when there is an almost uniform
[Tempero Systems TS-S006; eBay; AliExpress www.aliexpress.com/ temperature gradient.
item/1005003797803015.html {1.8 inch option}]
1 SPDT momentary PCB-mounting subminiature pushbutton switch (S1) Speeding up the refresh rate
[Altronics S1493 or APEM TP32P0] The latest version of the Pico­Mite
1 39W 5% ¼W axial resistor firmware PicoMiteV5.07.06.uf2)
2 20-pin headers, 2.54mm pitch allows the CPU speed to be increased
2 20-pin header sockets, 2.54mm pitch from the old maximum speed of
1 8-pin header socket, 2.54mm pitch 252000 to 378000 with the command:
1 6-pin header socket, 2.54mm pitch
2 M2.5 × 20mm panhead machine screws and hex nuts Option CPUspeed 378000
4 M3 × 25mm panhead machine screws and hex nuts This means that, with a scale factor
4 No.2 × 6mm countersunk head self-tapping screws of 4, the display will be updated
approximately every 165ms rather
non-volatile memory. Good results than 220ms and, at scale factor 9,
are obtained by holding the sensor every 520ms rather than 700ms.
perfectly still 2-3cm from a white However, note that this is ‘overclock-
sheet of paper. ing’ the RP2040 processor and it’s
If the button is pressed during possible that it won’t work on every
calibration, calibration is aban- board or under all conditions. Still,
doned, and the correction factors most Pico boards should be capable
are cleared. We recommend letting of running at this speed.
the sensor stabilise for at least one
minute with power on before per-
forming calibration.

It’s critical you purchase a Software tweaks Reproduced by arrangement with


module with the same output pin In the software, the constant ‘Fahr- SILICON CHIP magazine 2024.
layout as the one shown above. enheit’ can be set to ‘true’ to display www.siliconchip.com.au

GET T Order direct from EE


FR -ROM
CD
ELECTRONICS
£8.99

LATES HE
T CO
OF OU PY Electron Publishing TEACH-IN 9
FROM THE PUBLISHERS OF

TEACH R GET TESTING! FREE


CD-ROM
-IN SE Electronic test equipment and measuring TWO TEACH
-INs

RIES
techniques, plus eight projects to build FOR THE PRICE
OF ONE

AVAILA
PRICE £8.99
• Multimeters and a multimeter checker
• Oscilloscopes plus a scope calibrator

BL
• AC Millivoltmeters with a range extender

NOW! E
• Digital measurements plus a logic probe
• Frequency measurements and a signal generator
• Component measurements plus a semiconductor

(includes P&P to UK if ordered direct from us) junction tester

PIC n’ Mix
Including Practical Digital Signal Processing

PLUS...

Teach-In 9 – Get Testing!


YOUR GUIDE TO THE BBC MICROBIT
A LOW-COST ARM-BASED SINGLE-BOARD
COMPUTER

Teach-In 9
Get Testing

This series of articles provides a broad-based introduction to choosing and using a wide range
Files for:
PIC n’ Mix
Three Microchip
PICkit 4 Debugger PLUS
Guides Teach-In 2 -Using

of test gear, how to get the best out of each item and the pitfalls to avoid. It provides hints and
PIC Microcontrollers.
In PDF format

© 2018 Wimborne Publishing Ltd.

tips on using, and – just as importantly – interpreting the results that you get. The series deals
www.epemag.com

with familiar test gear as well as equipment designed for more specialised applications. Teach In 9 Cover.indd 1 01/08/2018 19:56

The articles have been designed to have the broadest possible appeal and are applicable to all branches of electronics. The
series crosses the boundaries of analogue and digital electronics with applications that span the full range of electronics – from
a single-stage transistor amplifier to the most sophisticated microcontroller system. There really is something for everyone!
Each part includes a simple but useful practical test gear project that will build into a handy gadget that will either
extend the features, ranges and usability of an existing item of test equipment or that will serve as a stand-alone
instrument. We’ve kept the cost of these projects as low as possible, and most of them can be built for less than £10
(including components, enclosure and circuit board).

PLUS! You will receive the software for the PIC n’ Mix series of articles and the full Teach-In 2 book – Using PIC
Microcontrollers – A practical introduction – in PDF format. Also included are Microchip’s MPLAB ICD 4 In-Circuit Debug-
ger User’s Guide; MPLAB PICkit 4 In-Circuit Debugger Quick Start Guide; and MPLAB PICkit4 Debugger User’s Guide.

ORDER YOUR COPY TODAY: www.electronpublishing.com

Practical Electronics | July | 2024 21


Y NA MI C
Dynamic NFC Tag Features
− Compact tag (22 × 31mm)

D
− Thin credit card/business card
size tag (86 × 54mm)
− Arduino sketch and jig
allows custom tags to be
easily created
− Tags can also be written
from apps

Supported NDEF Tag Types


− Text
− URI/URL (http:, https:, tel:,
mailto: and many more)
− Wi-Fi network handover
− vCard
− MIME file types

Supported Chips
− ST25DV04K

F
N

G
− ST25DV04KC
− ST25DV16K

C A
− ST25DV16KC

T
− ST25DV64K
− ST25DV64KC

Project by Tim Blythman

Near-field communication (NFC) devices have become widespread,


especially for ‘contactless’ payments. The availability of dynamic NFC
tags means you can now easily create your own custom NFC/RFID
Tags. This article explains how to program NFC chips that can be used
as smart business cards and more.

Y
ou likely have several NFC Writing custom data to tags using a briefly explained the history and tech-
tags in your possession. Most Raspberry Pi Pico microcontroller and nology behind NFC.
bank cards and stored credit the Arduino IDE is quite easy. Such Despite being based on NFC tech-
public transport cards use NFC technol- tags can also be read back using the nology, the shield from the 2019 arti-
ogy. You might also hear them referred microcontroller too. cle (which uses a PN532 NFC control-
to as RFID or contactless cards. These custom tags can contain, for ler IC) will not work with these tags
NFC protocols allow communi- example, a vCard file. That format as they use different versions of the
cation over distances up to around encapsulates the sort of information NFC standard. The PN532 can work
5cm using antennas transmitting typically found on a business card. A with tags that comply with ISO14443A
and receiving at 13.56MHz. The NFC programmed tag thus behaves like a (type 2, 3 or 4 tags), while the tags
Forum is responsible for standardising virtual business card and can be ‘taken’ we are using comply with ISO15693
NFC technology. by simply reading it with an appro- (type 5 tags).
RFID is a broader term technol- priate NFC reader, such as a mobile One of the great advantages of NFC
ogy that includes NFC, also having phone. The phone can import those is that the tag does not need its own
systems that operate at 125kHz and contact details into an address book. power source. The reader creates an
around 900MHz. URIs (uniform resource identifi- RF field at 13.56MHz that is picked
It’s now possible to create your own ers) such as web addresses can also up by the tag; it harvests energy from
‘dynamic’ NFC tags using a handful of be written to a tag (a URI is a more that to power its internal circuitry.
components. ‘Dynamic’ means the tag’s general form of a URL, also known Since the tag does not need a battery,
contents can be easily reprogrammed. as a link). Customers can be directed it can be tiny. Tags the size of coins
While you might be familiar with to a website by tapping their mobile are commonplace, and smaller tags
how easily NFC allows money to phone instead of manually entering a are possible.
leave your bank account, NFC tags web address, similar to how QR codes As shown in Fig.1, the coils in the
can also allow small amounts of data are often used. reader and tag effectively form an air-
to be stored and transferred. With cored transformer, which limits the
many mobile smartphones having NFC NFC technology practical communications range.
chips, we’ll look at some apps that can Jim Rowe covered an Arduino shield Data is transferred when either the
work with NFC tags, including read- that uses NFC technology in an arti- reader or the tag modulates the RF
ing and writing. cle from September 2019. That article field. The reader can do this easily,

22 Practical Electronics | July | 2024


as it generates the field, while the tag This timetable
can do this by changing its RF imped- pole at a bus stop
ance. The reader senses this through in Queensland
changes in the load it sees as it drives includes an NFC tag
the RF field. with an NDEF URI
record. It directs
For this project, we’re using a spe- users to a web page
cific type of chip that provides the displaying live bus
dynamic tag feature. Unfortunately departure times for
(!), this means that you won’t be able the bus stop.
to hack into your bank card and trick
it into thinking you have more money
than you do!

Terminology
A reader is a device that generates an
RF field and can use this to commu-
nicate. You might also hear the term
emitter used, since this device emits more NDEF records. An NDEF record The specific chips we are using are
the RF field. is roughly analogous to the contents of the ST25DV04K, and they have 512
‘Tags’ are simply devices that can a single file, although the NDEF mes- bytes of EEPROM space (with maybe
communicate with an NFC reader. sage doesn’t have a file system as such. a dozen bytes taken up by the NDEF
They are typically implemented by While NDEF does allow multiple headers). Data such as that found in
combining a tag-capable chip (which messages and records on a tag, for brief text files is an excellent candidate
contains some non-volatile memory) simplicity, our software only writes for being passed around, including the
with an appropriate antenna and per- one message containing one record vCards mentioned earlier.
haps a few passive components. at a time, although it can read mul- Similar chips from the same family
The antenna is often little more than tiple records. can hold up to 8kB, which will also
a printed foil loop, similar to a PCB work with all the software we will dis-
trace antenna, but on a thinner sub- The ST25DV IC cuss, but we haven’t concentrated on
strate. We tried a few variations on cus- Dynamic tags are those tags that them mainly because of how long it
tom antennas that we’ll describe later. can be easily reprogrammed. In this takes to transfer that much data over
Some tags have an internal EEPROM, project, we will use members of the an NFC link.
including the chips we are using, in ST25DV family from ST Microelec-
which case the reader might be able to tronics. These parts include the RF Possible uses
write to the tag and change its contents. interface needed to implement NFC, Some people will find it convenient to
Portable tags are commonly found in an EEPROM and an I2C interface that program tags once and then use them
the form of a card or a keyfob that can allows their internal EEPROM to be as smart business cards or to pass other
be easily carried around. You might modified and thus present changing information around.
also see fixed tags, often in a more data to an NFC reader. For example, you might provide a
robust enclosure to prevent damage. Many tags, including those from the tag to allow guests to connect to your
The NDEF (NFC Data Exchange For- ST25DV family, can also be written Wi-Fi network when they visit. You
mat) specifies headers and other data over the RF interface, provided that could attach a tag to an object contain-
that indicate what sort of data the tag the ‘reader’ also has write capabilities, ing text information about that object.
carries; these are the sort of tags this as many do. One of the apps we tried You might have heard of ‘smart post-
project allows. NDEF tags are only a (from ST Microelectronics) can write ers’ being used in advertising. These
subset of NFC, and other types of NFC to these chips. are nothing more than printed posters
tags exist. You don’t necessarily need to use accompanied by a tag that provides
The software we have written the I2C interface to work with these information beyond what is printed
allows you to explore NDEF data at a chips, but it is an easy way to do so. on the poster.
low level. Briefly, there is a Capabil- In fact, many readers (especially One use we have seen ‘in the wild’ is
ity Container (CC), which indicates those on mobile phones) can also a tag at a bus stop. The tag is enclosed
that the tag contains NDEF data and emulate tags; this is the basis of how in a sturdy plastic shell and attached to
the amount of available storage space. ‘pay by phone’ technology works. The the post that holds up a printed time-
This, in turn, points to an NDEF phone emulates a virtual contactless table (see photo). This is a simple but
message, which can contain one or credit card. practical application.
This tag contains a URI NDEF mes-
sage that points to a web page provid-
ing live bus departure times for that
specific stop, supplementing the fixed
information on the printed timetable.
Screen 1 shows a scan of this tag by
one of the apps we will discuss later.
It also uses a chip from ST Microelec-
tronics (but a different one).
We have written an Arduino pro-
gram that can add several types of
records to these cards. As well as the
Fig.1: with NFC, an unpowered device (the tag) is powered by the received RF vCards and URIs mentioned earlier, it
field and can transmit data back to a reader or emitter by modulating that field. can also create simple text file records

Practical Electronics | July | 2024 23


and Wi-Fi ‘handover’ records. Such
a record simply contains sufficient
information (SSID name, password
and security type) to allow a device
such as a mobile phone to connect to
a Wi-Fi network.
Another NDEF record type is the
so-called MIME (Multipurpose Inter-
net Mail Extension) type. The MIME
standard was developed for email file
attachments and carries information
about a file’s type.
The vCard and Wi-Fi hando-
ver record types are simply MIME Fig.2: the circuit is very simple and, as you can see from our photos, it’s possible
records of a specific type (‘text/ to create it on a small breakout board. Other variants of tag chip IC1 have other
vcard’ and ‘application/vnd.wfa. functions broken out on more pins, but they are in packages that are difficult to
hand-solder, such as WLCSP (wafer-level chip scale package).
wsc’, respectively).
Thus, a MIME type record could be We’ll also show how to create Tags In one simple test, we hooked a
used to describe anything that could using various antennas, followed by light-emitting diode (LED) directly
be considered a file, although it would using several apps to interact directly between the VEH and GND pins. After
have to fit in the available space on with the Tags over the RF interface, changing the appropriate registers to
the tag. The receiving device would including reading and writing to them. allow energy harvesting to operate,
also need to know what to do with it; we got it to light up (when in a read-
we found this was often not the case, PCB tags er’s RF field).
even for common file types. Fig.2 shows the schematic of our small A simple tag (accessible by RF only)
Also, when we uploaded some PCB-based tags; IC1 is the chip that could consist of little more than the IC
‘large’ files to the 8kB ST25DV64K implements the dynamic tag function. and an appropriate antenna. The pas-
chips, they took many seconds to be It could be one of several chips from sives are only needed if the I2C inter-
downloaded by a reader and often the ST25DV family, but we used the face is required.
appeared not to be working due to ST25DV04K variant for most of our
this delay. testing, and that is what we specify Other tags
On the other hand, vCards, Wi-Fi in the parts list. Since the tag chips can be programmed
handover records or URIs (in the form We have developed two different by RF as well as I2C, it’s possible to
of web addresses or email addresses) PCBs that implement this same basic create a tag with nothing more than a
are widely recognised and will be the circuit (see Fig.3 and Fig.4). chip and an antenna. You also could
most useful types for custom tags. CON1 provides a breakout for all the set up a rig using an SOIC socket of
With that out of the way, we’ll show pins of IC1 except those that connect to the correct width to program the chips
you how to construct a Tag using these the antenna. The two resistors are the before soldering them to an antenna.
dynamic tag chips, then use our Ardu- pullups needed for the I2C SDA and We even used one of our smaller
ino software to program them for a SCL lines, while the 100nF capacitor PCBs (populated with everything
specific use. provides supply bypassing when the except the chip) as a programming
chip is powered from CON1. rig with the trick of holding the chip
Pins 2 and 3 (AC0 and AC1) con- in place using a clothes peg. That was
nect to a PCB trace antenna. IC1 has an sufficient to allow testing of the tag via
internal tuning capacitance of 28.5pF, its RF interface, too.
meaning that an inductance of 4.7μH The photos show a few of the pro-
is needed for resonance at 13.56MHz. totypes we created to see whether
The larger PCB has five turns for the it was possible to make a workable
antenna, while the smaller PCB has antenna without a PCB. As you can
fourteen turns, seven on each side. see, the answer is just about anything,
In practice, we found that the circuit within reason.
wasn’t too fussy about the exact coil The photo opposite shows our first
dimensions. Later, we’ll discuss some prototype, based on a small SOIC-8 to
of the alternative coils that we tried. DIP-8 IC adaptor PCB. The antenna is
The remaining pins on IC1 are VEH actually a 6mm SMD inductor that is
and GPO. The GPO pin is an open- designed for this application. This
drain output that can be programmed prototype was great for testing how
to drive its output low under certain things should work, including the
conditions, such as while an RF signal I2C interface.
is being received, or a write is being The photos to its right shows some
performed to the internal EEPROM. antenna-only designs, including the
The VEH pin (also when appro- design that inspired our first PCB. It
priately programmed) can deliver an is simply fourteen loops of enamelled
unregulated voltage harvested from the wire soldered to the AC0 and AC1 pins
Screen 1: an ST25 NFC Tap app scan external RF field, when available. In of a tag chip. The diameter of the coils
of the bus stop tags shown in the photo. practice, we found this could be up to is just over 2cm, using a little over a
It has a much smaller capacity than about 4V at up to 10mA. Naturally, this metre of wire.
the tags we are using, but still enough will depend on the reader and other This set also shows a circuit with
for a URI pointing to a web page. factors, such as the antenna efficiency. an axial leaded inductor with a

24 Practical Electronics | July | 2024


◀ Our prototype Tag is constructed on
a SOIC-8 breakout board and uses
a 4.7μH wirewound inductor as the
antenna. The passive components
are on the back of the PCB, and the
circuit is practically identical to our
final designs.

Connecting an antenna to pins 2 and ◀


3 of the IC is sufficient to create a
functional Tag. The antenna can be as
simple as a 4.7μH inductor or many
turns of enamelled copper wire. The
wire antenna shown here uses just
over 1m of wire. Be sure to strip the
enamel from the ends of the wire
before attempting to solder it.

nominal 4.7μH inductance, as well as Tack one lead of each component should be initially secured by one
the wirewound inductor seen in the and ensure the remaining leads are lead. Use tweezers to locate the part
previous photo. We also tried a tiny within their respective pads. Then before tacking, after which the remain-
(M2012/0805) SMD inductor, shown solder the remaining leads and ing leads can be soldered.
in the upper right corner, but the reader refresh the first leads. Check for sol- You might need to build up a small
did not pick it up. der bridges and use solder-wicking fillet of solder to ensure a mechanically
This correlation between size and braid to remove them. sound connection. Inspect the joints
sensitivity also extended to the larger The larger PCB (coded 06101232) is and use flux and solder-wicking braid
tags, with the larger PCB design designed to have the components sit as necessary to tweak the location and
being the most sensitive. We judged inside slots so that they are no thicker amount of solder.
this simply on the distance from than the PCB itself. We used a sili- For IC1, first tack the leads along
which the tag could be detected by cone soldering mat to align the com- one edge. Then flip the PCB over and
the reader, being nearly 5cm for the ponents vertically within the slots. gently bend out the IC leads along
larger PCB design. Rather than resting on surface pads, the other edge to be closer to the PCB
Another reason the smaller SMD the parts are soldered to exposed edges pads. Solder these leads to their cor-
inductor didn’t work, besides its size, of the plated-­through holes. The pho- responding pads.
might be that it has a shielded con- tos above show the final result. We found that the best results came
struction. Larger shielded inductors IC1 is very close to the same thick- from using a generous amount of sol-
are also available; avoid using them, ness as the PCB (1.6mm), while the der and flux. We then applied solder
as they will not work well as antennas. passives are much thinner. This is an braid to the PCB pads only to draw off
If you build a Tag without the I2C experimental technique, so it is best excess solder, relying on surface ten-
interface, you won’t be able to use the suited to constructors with some SMD sion to keep a suitable amount of sol-
Arduino Programming Rig that we soldering experience. der connecting the lead.
will describe later. You will only be Before soldering the components, If you like, a pin header can be sol-
able to program the Tags using apps check the pads for copper swarf or dered to CON1 on either PCB, but if
installed on a mobile phone or a sim- burrs, as some may be left from the you only intend to program the tag
ilar reader. milling process during PCB manufac- once, simply holding the header in
ture. We found it wasn’t necessary to place should be sufficient. We’ve off-
PCB designs remove any burrs unless they could set the holes slightly to give a firm
The two Tag PCBs are shown in Fig.3 cause a short circuit or interfere with friction fit.
and Fig.4 and the photos overleaf. The component placement. If you wish to add some polish to
smaller PCB is coded 06101231 and The technique is similar to regular your Tag PCBs, you could glue paper
measures 22 × 31mm, while the larger SMD work in that each component or cardboard (such as your own paper
PCB is coded 06101232 and measures
85.5 × 54mm – both are available from
the PE PCB Service.
The usual SMD tools and supplies
will be adequate for building the PCB-
based tags. This includes solder, flux
paste, tweezers, good lighting and a
fine-tipped iron. Fume extraction is
recommended when working with
flux paste due to the amount of smoke
it generates.
For the smaller PCB (06101231),
assembly is straightforward. Apply
flux to the pads of the four SMD com-
ponents and rest each in place. IC1 is
the only polarised part, so check that
the chamfer along one edge (best seen Fig.3 and Fig.4: assembling the smaller PCB is pretty straightforward. The larger
from the end of the chip) aligns with PCB is a little trickier as the components are nestled into cutouts. Still, if you’ve
the marking on the PCB. done any SMD soldering, you should be able to use similar techniques to do that.

Practical Electronics | July | 2024 25


The larger card Tag PCB has cutouts so that the components
are internal and don’t increase the overall thickness; the SOIC IC is
nearly exactly the same thickness as the PCB! You’ll need careful use of flux
and solder wick to fit the components. You can create a more polished look by gluing
paper or cardboard (or sticking a sticker) to the front and back of the PCB.

business card) to the front and back of If you want to program tags beyond Fig.5 shows the connections needed.
the PCB. You could even get custom what our sketch can do or tweak the The simplest way to achieve this is to
stickers of the right size made. sketch, you will need the SparkFun solder a four-way pin header to the
ST25DV64KC library in addition to Pico, allowing the Tag to be friction
The programming jig the Arduino IDE. This will also work fitted. However, you could use a bread-
Our programming jig is simple and just with other chips, including the -04K, board or even solder wires if you like.
requires a Raspberry Pi Pico (or Pico -16K, -64K, -04KC and -16KC variants. The RF and I2C interfaces can coex-
W) with four connections to CON1 on We’ve included a copy of the version ist, but note that communication can-
the Tag PCB. We used the Arduino IDE we used in the software download. not occur on both simultaneously.
to write the program, as a good Ardu- It can also be found by searching for So you can leave the Tag connected
ino library is available to work with ‘st25dv’ in the Arduino Library Man- to the programming jig while testing
these chips. ager. As well as the SparkFun library, the Tag with a reader, as long as you
If you want to modify or work with this will show a library from ST Micro- don’t attempt to read or write at the
our code and don’t have the Arduino electronics, but that one appears to be same time.
IDE installed, download and install designed to work with Arduino boards To control the programming jig
it from: www.arduino.cc/en/software based on their (STM) microcontrollers from your computer, you will also
Still, you don’t need the Arduino IDE and not the Pico. need a serial terminal program, such
to try our sketch out. Simply hold down We’ve designed the interface to as Tera­Term on Windows or minicom
the white BOOTSEL button on the Rasp- use four adjacent pins on the Pico. on Linux. The Arduino IDE’s serial
berry Pi Pico while plugging it into a com- These correspond to the four I2C pins monitor has limited functionality and
puter. Then copy the 0610123A.UF2 file on CON1 of either PCB. Pin GP28 is will work for some commands, but
to the drive that appears; it’s typically driven high as an output to provide not all. Verify that your serial termi-
named ‘RPI-RP2’. The file is available 3.3V. Next to it is a ground pin fol- nal program uses CR or CR/LF as the
from the July 2024 page of the PE website: lowed by pins GP27 and GP26 to pro- line ending. The program checks for
https://bit.ly/pe-downloads vide I2C SDA and SCL, respectively. CR and ignores LF.

Fig.5: the wiring from the Pico to ◀


the Tag is simple; you can solder a
four-pin header to the Pico and plug
the Tag onto that. You can also use a
breadboard if you have soldered full-
length headers to your Pico.

The smaller Tag is a straightforward


SMD design. The staggered holes
on CON1 allow a header to be
temporarily friction-fitted for
programming. That avoids the need to
fit the bulky headers permanently.

26 Practical Electronics | July | 2024


Programming Tags TAG Programming Interface.
After connecting to the Pico’s virtual ST25 found on I2C.
serial port with the terminal pro- ~ Reboot microcontroller.
r Read NDEF entries (1,2,3,4 for specific entry or blank for all).
gram, you should see the main menu a Decode NDEF entries (1,2,3,4 for specific entry or blank for all).
(see Screen 2). Check that the mes- c Decode CC and NDEF headers
sage ‘ST25 found on I2C’ is shown i Read UID data.
e Erase EEPROM and write blank NDEF.
before proceeding.
w Write NDEF entries:
If you don’t see it, check your con- wt Write text NDEF.
nections and use the ‘~’ command to ww Write WiFi NDEF.
reboot the Pico if necessary, forcing it wu Write URI NDEF.
wv Write vCard NDEF.
to test for communication again. wm Write text MIME type.
Each of the commands consists of wb Write binary (hex) MIME type.
one or two letters (followed by Enter), d Dump raw EEPROM.
after which you may be prompted h Write raw hex (haaaadd) to EEPROM.
o Open I2C session.
for additional parameters depending s Dump system memory.
on the specific command. Screen 3 l Set RF write lock bits (0=allowed 3=never).
shows the output of the basic ‘i’ and
‘c’ commands, while Table 1 details Screen 2: the main menu of our programming jig software has the options
the available commands. shown here. While there are quite a few commands, many are to explore the
structure of the data on the Tags and are not needed to create your own Tags.
The ‘i’ command provides informa-
tion about the tag chip’s serial number,
which can be used to deduce the part i
number. The part number includes UID value:
E0:02:24:67:09:12:1E:EA
the EEPROM size in kilobits; the ST25DV04K-IE found.
ST25DV04K part shown has 4 kilobits EEPROM is 512 bytes.
(512 bytes) of EEPROM. c
The ‘c’ command interprets any Capability Container:
Short (4 byte) CC version 1.0, 512 bytes available for NDEF.
NDEF data that is present. What is TLV record at 0x0004:
shown in Screen 3 is typical for a tag NDEF message 23 bytes starting at 0x0006:
with a single URI entry, in this case, a NDEF record found at 0x0006.
link to the Silicon Chip website. MB ME CF SR IL TNF
1 1 0 1 0 NFC type
Screen 4 shows a raw dump of the URI type.
EEPROM contents in both ASCII (at 1 bytes of type, 19 bytes of payload, 0 bytes of ID.
left) and hexadecimal (at right). The URI Prefix code: 4:https://
link text is visible, preceded by some siliconchip.com.au
ME flag ends message.
header data. You don’t need to know TLV record at 0x001d:
the header formats, as the library can NDEF terminator.
generate them.
Scan complete.
The minimal steps for creating a
custom tag start with the ‘e’ com- Screen 3: the ‘i’ command checks what type of tag chip you have and its
mand to erase the tag contents if it is capacity, while the ‘c’ command allows you to verify that the NDEF headers are
not blank. While the chips start out present and correct.
empty, the library depends on the
appropriate capability container entry d
existing, which is also added by the Area 1 RF access lock bits are set to 3;read always, write never allowed.
‘e’ command. Memory is 512 bytes.
Follow that with one of the ‘w’ com- 0 1 2 3 4 5 6 7 8 9 A B C D E F
0000 .@@......U.silic E1 40 40 00 03 17 D1 01 13 55 04 73 69 6C 69 63
mands to write an appropriate NDEF 0010 onchip.com.au... 6F 6E 63 68 69 70 2E 63 6F 6D 2E 61 75 FE FF FF
entry. The ‘wt’ (text) and ‘wu’ (URI) 0020 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
options prompt for a single entry to .
.
be written to the tag. The ‘ww’ com- .
mand asks for the Wi-Fi name (SSID), 0130 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
password, authentication and encryp-
tion types. Screen 4: a raw dump of the tag chip’s EEPROM can be handy for exploring the
The two MIME commands, ‘wm’ layout of the NDEF card structure. You can make out the URI content as raw text.
and ‘wb’, allow a MIME type to be
specified, with the file contents fol- Parts List – Dynamic NFC Tag
lowing. The ‘wm’ option can handle
text input, including control codes like 1 22 × 31mm double-sided PCB coded 06101231 OR
CR (carriage return) and TAB. Press 1 86 × 54mm double-sided PCB coded 06101232 from the PE PCB Service
Ctrl-D or Ctrl-Z (end-of-file) to com- 1 ST25DV04K dynamic NFC tag chip, SOIC-8 (IC1) ●
plete these entries; Ctrl-C or Escape 2 4.7kW ⅛W M3216/1206 SMD resistor
can be used to cancel. 1 100nF 50V X7R M3216/1206 ceramic ‘chip’ capacitor
The ‘wb’ command expects bytes Programming jig parts
to be entered as pairs of hexadecimal 1 Raspberry Pi Pico (or Pico W) microcontroller board programmed with
digits. Single hexadecimal digits can 0610123A.UF2
be entered if a space separates them. 1 4-way male pin header, 2.54mm pitch
The same Ctrl-D or Ctrl-Z sequence ● there are other options, listed in the introduction of the article
completes the file.

Practical Electronics | July | 2024 27


Table 1 – commands for the programming jig
CMD Function Notes
Reprint menu Simply press Enter on a blank line.
~ Reboot Pico Use to refresh after connecting a Tag.
r Read NDEF messages Uses the SparkFun library to decode NDEF data.
from EEPROM; use 1-4
for a specific record (eg,
‘r1’)
a Decode NDEF Uses custom code to perform a more detailed
messages from analysis than the ‘r’ command.
Screen 5: the tabs on the ST25 NFC EEPROM. Use 1-4 for a
Tap app allow you to view and edit the specific record (eg, ‘a1’)
tags and their NDEF contents. This app c Decode capability Uses custom code and provides more detail of the
might be all you need to program tags. container and NDEF structure of the NDEF data rather than contents.
messages
We often use the HxD hex editor on i Read UID data and The part number is printed if a known chip type is
Windows to view files in hexadecimal check memory capacity identified (including the supported chips).
format. This program also allows the
hexadecimal data to be copied and e Erase EEPROM (to Use this on a new chip to format it and allow NDEF
pasted directly into the ‘wb’ command. zeroes) and write records to be written. You can also use this to
However, you should be careful only to a blank capability remove any previous data when reusing a Tag.
paste small amounts of data at a time container
so that the terminal and Pico can keep wt Write an NDEF text Prompts for text that can include line endings.
up with processing the data. record to the Tag Use Ctrl-D or Ctrl-Z to finish or Ctrl-C or Escape
After entering the data, confirm the to cancel.
write and see that the data is written
ww Write a Wi-Fi handover Prompts for SSID (name), password and security
correctly. At this stage, the Tag should
record to the Tag and encryption types.
register if held near an NFC reader
such as a smartphone. Most phones wu Write a URI NDEF record Prompts for URI type (eg, ‘http:’, ‘mailto:’) and URI
should process URIs, Wi-Fi handover to the Tag text. The URI type simply allows common types to
records and vCard files without need- be easily abbreviated and can be omitted by using
ing extra apps. URI type zero (blank).
If you have trouble, ensure your wv Write a vCard NDEF Creates a version 2.0 vCard file and prompts for all
mobile phone has NFC (not all do!), record to the Tag mandatory fields for that format. Also prompts for
and it is turned on in the settings. custom fields.
Most newer phones should allow
you to search your settings; typing wm Write text MIME type to Uses the same scheme as ‘wt’ but allows the
‘nfc’ should be sufficient to find the the Tag MIME type to be specified. Most mobile phones
right one. will treat ‘text/plain’ types the same as an NDEF
If you wish to lock the Tag so text type record, if they have an app that supports
that it cannot be edited by someone that type.
accessing it via its RF interface, use wb Write binary MIME type Prompts for MIME type and accepts hex bytes (or
the ‘o’ command to open a secu- to the Tag single nibbles if separated by white space). Use
rity session. There is a default pass- Ctrl-D or Ctrl-Z to finish or Ctrl-C or Escape
word consisting of eight zero bytes, to cancel.
which is assumed to be unchanged. d Dump ASCII and text This is handy for viewing the raw EEPROM
Finally, use the ‘l3’ command to set contents of the Tag’s contents if you want to see how the NDEF entries
the write permissions to ‘never allow EEPROM are encoded and decoded.
RF to write’.
This won’t change the I2C permis- h Write a single byte to The format is ‘haaaadd’ where aaaa is a
sions, so you can continue to edit the EEPROM 16-bit address and dd is 8-bit data in
Tag content without unlocking the Tag hexadecimal format.
for RF writes. Unlocking for RF writes o Opens a security This is needed to permit command ‘l’ to work.
is done with the ‘l0’ command. session using the
default ‘00000000’
Apps password
We’ll look at a couple of Android apps
s Dump system memory You would only use this if you were interested in
to read and write to these Tags. At the
and dynamic registers the advanced features of the chip.
time of writing, it appears that there
are iOS versions of these apps, which l Modify the RF lock bits ‘l0’ clears the lock bits and allows RF writes to
we expect to be fairly similar, although EEPROM. ‘l3’ forbids RF writes to EEPROM, so the
we haven’t tried them. contents can only be modified via I2C.
The first is ST Microelectronics’
‘ST25 NFC Tap’ app, which is clearly This app allows you to do many of Screen 1 shows a typical overview.
targeted to work with this range of the things that the Arduino Program- The NDEF and CC FILE tabs allow
chips. You should, of course, ensure ming Rig can do, although we found the NDEF data to be viewed and
that your mobile phone supports NFC it occasionally crashed if the card was edited, while the MEMORY tab allows
and that it is turned on. moved while reading or writing. the EEPROM to be directly viewed

28 Practical Electronics | July | 2024


(similar to using the ‘d’ command in An SMS record has the for-
the Programming Rig). mat ‘sms:(phone number)?body=
Screen 5 shows the NDEF tab. You (message text)’, with the bracketed
can use the button at bottom right (cut items replaced by the phone number
off in the screen grab shown) to cre- and message text (without brackets),
ate a new NDEF record, while one of respectively. You could also use the
the buttons at top right allows NDEF Arduino Programming Rig to create
records to be cloned. If you haven’t such a record as a URI type.
built the Arduino programming rig, An email record has a similar for-
cloning is probably the easiest way to mat, using the ‘mailto:’ URI type (type
create multiple identical Tags. 6) followed by an email address. It can
This app can add multiple NDEF optionally have a ‘?subject=...’ field as
records to a single Tag; Screen 6 shows well as body text (‘&body=...’).
some of the record types that can be Most mobile phones that we tested
added. SMS and email records are spe- were able to handle all those records.
cific types of URI records. We’re familiar with the NXP Tag-
Info app, as this can also
read ISO14443A cards,
such as those that can
be read by PN532-based
modules. Screen 7 shows
a scan of a Tag containing
a URI NDEF record using
the TagInfo app.
Since it can read and
interpret NDEF mes-
sages, this can be used
to validate that Tags have
been written correctly
by either the Arduino
Programming Rig or the
ST25 app.

Conclusion
NFC tags are common
these days, and we think
many readers will relish
the opportunity to create
their own smart business
cards and custom Tags.
We are investigating
other ways to use these Screen 6: the ST25 NFC Tap app can
Tags. One idea is to use create various NDEF record types, as
them to configure proj- shown here. There is also a tab allowing
ects wirelessly without the EEPROM to be directly edited.
needing screens, displays In such a project, the Tag circuit
or buttons to be built into described here becomes part of the proj-
the project. That could ect, with IC1 accessed over an I2C bus.
save quite a bit of time The project can read (or write) its con-
and money. figuration to a text NDEF record on the
Tag, which a suitably equipped smart-
phone or tablet can then view or edit.
There are undoubtedly other excel-
lent applications for these Dynamic
Tags, and we look forward to thinking of
new ways to use them in future projects.
Screen 7: the NXP TagInfo app can read tags and
also decode NDEF messages and records. There is Reproduced by arrangement with
also an NXP TagWriter app that we have not tried. It SILICON CHIP magazine 2024.
could possibly be used to customise Tags too. www.siliconchip.com.au

We soldered a four-way header to


the GP26, GP27, AGND and GP28
pins of the Pico. The holes in the
Tag PCBs are staggered slightly
to make good enough contact for
programming without soldering.
Check that the orientation and pin
connections are correct, so you
don’t destroy the chip or the Pico.
Practical Electronics | July | 2024 29
Project by Charles Kosina
This design measures low-frequency signals
accurately and quickly. A traditional frequency
counter must sample over a long period to get an
accurate result. This one instead measures the
average period and calculates the inverse, so it
only needs to monitor a few pulses to get a precise
reading. It’s useful up to about 10MHz.

Reciprocal
Frequency Counter
I
bought a frequency counter over precisely one cycle. Also, as the sig- accurately and quickly using a micro-
30 years ago, but its accuracy is very nal frequency increases, the resolution phone amplifier and this device.
poor by today’s standards, being and accuracy decrease.
out by as much as 50Hz at 10MHz. I One good thing about this scheme Functional description
replaced its not-very-­ accurate clock is that the exact measurement time is Refer to the timing diagram, Fig.1,
module with a 10MHz TCXO, and I not critical, as the frequency calcula- which is not to scale. The input signal
can now rely on it to be within 1Hz tion is ratiometric. This means that we is fed into the clock input of a D-type
at 10MHz. By adjusting the TCXO fre- should get reasonably accurate results flip flop (74HC74). While the D input
quency to match that of my GPS-dis- as long as we have a clock source with (GATE TIME) remains low, the Q out-
ciplined 10MHz frequency standard, I an accurate frequency and synchronise put remains low, and the counters
can be assured of such accuracy. the measurement period to the rising are inhibited. We start the counting
But what happens when I want to edges of the input signal pulse train. period by applying a logic one (high
measure low frequencies? For exam- What do we need to measure with level) to the D input. On the next ris-
ple, a 50Hz signal. With a gate time of such precision? Mains frequency was ing edge of the input signal, the Q out-
one second, it will most likely show a the first thing I tried. I connected the put (COUNTEN) will go high after the
reading of 50, even if it is not exactly output of a 6V AC mains transformer short propagation delay.
that. It might flip to 49 or 51, but the to an RC network to reduce the volt- Two NAND gates are turned on as
resolution is only 1Hz. age and filter out noise. a result. The reference clock (REF
To improve that, we could have a The frequency did vary slightly COUNT) is then applied to 32-bit
gate time of 10 seconds and a reso- from reading to reading, and the larg- counter IC5, and the input signal,
lution of 0.1Hz. For a 10mHz resolu- est variation was about 30mHz. This is INPUT COUNT, is applied to the other
tion, a 100-second gate time would be within the required Australian Energy 32-bit counter, IC8.
required, which is quite ridiculous. Market Operator (AEMO) specification After one second, the D input of the
A better way to measure low fre- of 49.85-50.15Hz. The frequency vari- 74HC74 is taken low. The Q output
quencies is to measure the period. ation is caused by constantly changing remains high until the next positive
With the same example of 50Hz, using load conditions on the network. edge of the input signal, when it will
a 10MHz clock, it would accumulate Also, musical instruments need to go low. This stops the accumulation
200,000 pulses in one 20ms period. If be tuned to very precise frequencies. In of counts in both the 32-bit counters.
the number of pulses measured were the equal-tempered scale, C4 (middle Importantly, we have an exact input
actually 199,900, that would mean that C) should be 261.63Hz. Concert pitch count as the period is synchronised
the frequency is 10,000,000 ÷ 199,900 A4 must be 440.00Hz. All other notes with the rising edges of the input signal.
= 50.025Hz. require the same precision, to two The reference counter is not syn-
That’s a great improvement in res- decimal places, and a trained ear can chronised the same way, so the count
olution, but highly dependent on the pick the slightest differences in pitch. could be out by one. With a 10MHz
accuracy of the hardware in measuring Such frequencies could be measured reference oscillator, this results in an
error of one part in 107. But, with a
30MHz reference, it reduces to 0.33
Features and Specifications parts in 107, which is insignificant.
We now have three parameters. The
► Operating frequency range: 10mHz-10MHz (maximum ~13.5MHz)
reference clock is a TCXO and so it is
► Input sensitivity: 100mV peak-to-peak (~35mV RMS for a sinewave) very accurate. IC5 will contain a num-
► Accuracy: typical error <0.001Hz up to 9.999MHz after calibration ber accumulated over the (approxi-
► Sampling time: 0.1s, 1s or 5s mate) one-second period, and this
► Reference oscillator: temperature-compensated crystal oscillator (TCXO) is the Reference Count, which will
► Power: three AA cells for about 24 hours of battery life be near the Reference Oscillator fre-
quency. The other counter, IC8, has

30 Practical Electronics | July | 2024


onboard ATmega328 microcontroller.
These are available from many sources
and are cheaper than buying the separate
individual components, plus it removes
some of the hard work in assembly.
The display is the same 0.96-inch
monochrome graphical OLED I have
used in several previous designs. The
Nano updates its display over a two-
wire I2C serial interface with two
4.7kW pull-up resistors as required by
the I2C standard.
Switch S2 provides three sample
time options: 0.1s, 1s or 5s. One sec-
ond is adequate for most measure-
ments. The five-second option may
Fig.1: when counting starts and stops is synchronised to the input signal. give marginally better resolution and
GATE TIME indicates roughly when counting should occur. However, the accuracy. The 0.1 second gives a fast
synchronised COUNTEN signal actually starts and stops counting (of INPUT approximate reading.
COUNT and REF COUNT). The two count values are then divided to get a The microcontroller reads the posi-
ratio and thus determine the actual input signal period. tion of centre-off switch S2 using its
analogue-to-digital converter to mea-
sure the voltage at pin 11 (ADC7). The
the Input Count. The frequency is then The microcontroller can clear both switch either presents 0V, half-supply
calculated from the equation: counters using the CCLR signal before (2.5V) or close to full supply (5V).
initiating a count. That same signal The power supply for basically all
f = Input Count × Ref Osc ÷ Ref Count also resets flip-flop IC2a, de-asserting the chips in the design is a regulated
the COUNTEN signal. Once counting 5V from boost regulator REG6. It pro-
Circuit description is finished, the microcontroller can duces this 5V from the 3-4.5V gener-
Fig.2 shows the full circuit of the read the values from both 32-bit count- ated by three series AA cells, and its
Counter. The input signal from CON2, ers using an 8-bit data bus (CNTR0- input is switched on/off by switch S1.
a BNC or SMA connector, is amplified 7), selecting one byte from one 32-bit CON3 and three more of the invert-
by the Analog Devices ADA4891-2 dual counter at a time (for a total of eight). ers in IC3 provide a serial debug inter-
op amp, IC7. With the values shown, Which byte is read out depends on the face. Unless you plan to modify the
the gain is about 32, but that could states of the SIG COUNT and 30MHZ_ code, it isn't that useful, so CON3 and
be increased by changing a couple of COUNT lines, which select one counter, D4 can usually be left off the board.
resistors. A minimum input signal of and the SEL0/SEL1 bits, which select
50-100mV peak to peak is needed. which byte of that counter is on the 8-bit Software calculations
I chose that op amp as it has a high bus, controlled by both halves of the The formula above certainly is simple,
input impedance, a gain bandwidth 74HC139 dual 2-to-4 line decoder, IC4. with just one multiplication and one
(GBW) of 220MHz and a respectable The processor used is an Arduino division, but the numbers involved
slew rate of 170V/µs. It is also read- Nano microcontroller module with an are large. We need to multiply before
ily available from multiple suppliers
at a modest price. The gain is applied
in two stages of about five times each,
to keep the overall bandwidth high.
Inverse parallel diodes D2 and D3
limit the input level to the first op amp
and prevent overload. The output of
the second op amp (IC7b) is squared up
by a 74HC14 schmitt trigger inverter
(IC3a). Its output feeds into the clock
input of 74HC74 flip-flop IC2a that
produces the COUNTEN flag at its Q1
output, as well as a 74HC10 NAND gate
(IC1c) producing the COUNT signal.
I am using two 74HC10 three-input
NAND gates with two of their inputs
tied together instead of the two-input
74HC00 purely because of what I had
in stock. I only need two of these gates,
so using a 74HC00 with four gates
wouldn’t be more helpful.
The COUNT signal goes to both clock
inputs of a 74LV8154 32-bit counter,
IC8. A second such counter, IC5, is The Counter is battery-
driven by the TCXO output, also gated powered, making it
by the COUNTEN signal, thanks to convenient to use.
NAND gate IC1a, as described earlier.

Practical Electronics | July | 2024 31


dividing so that we don’t lose accuracy, That is way beyond 32-bit integer numbers that large without any accu-
meaning we need to calculate an inter- arithmetic. I use the BASCOM com- racy loss. For an 8-bit processor run-
mediate value that can be as high as piler, which can perform double-­ ning at 16MHz, the above calculation
3,000,000,000,000 (three trillion; with precision floating-point calculations takes 0.4ms, which is quite impressive
a 10MHz input and 30MHz oscillator). using 64 bits. That’s enough to store for such an inexpensive chip.

Reproduced by arrangement with


Reciprocal Frequency Counter SILICON CHIP magazine 2024.
www.siliconchip.com.au

32 Practical Electronics | July | 2024


The oscillator needed in the BASCOM source code that can be used with the 74LV8154
TCXOs are readily available from Ali­ was the substitution of one number. counters, but it appears to be pushing
Express for about £8-10. I tried four The higher frequencies give the the limit, as the accuracy seemed to
different frequencies: 10MHz, 25MHz, advantage of slightly better resolution drop off. So 30MHz is the best option.
30MHz and 40MHz. The only change and accuracy. 40MHz is the maximum It would be nice to have the fre-
quency readout in one row of large
digits. But in keeping with the style of
my previous designs, I have used the
same small OLED to show four lines
of eight characters per line. That is not
enough to display the frequency on
one line, so it is split into two lines.
The top line shows ‘FREQ’ while the
second line display up to 9,999,999
(Hz). The third line shows the remain-
der in mHz, from 0 to 999, while the
final line displays the battery voltage.

Accuracy
The primary factor that affects accu-
racy is how close the TCXO is to its
stated frequency. The second factor is
the precision of the mathematical cal-
culations, but with the use of 64-bit
floating point arithmetic, any errors
are minimal.
I used my 10MHz GPS-disciplined
oscillator as an input to a 14-bit
counter (74HC4060) and fed ten dif-
ferent divided frequencies into the
Reciprocal Frequency Counter. Table
1 shows the results with the 30MHz
TCXO straight out of the box with
no adjustment.
I then tuned the 25MHz TCXO to
within less than 1Hz, and the errors
were 1mHz or less for all of the fre-
quencies shown in Table 1.
The TCXOs I bought from Ali­
Express suppliers have been very close
to the stated frequency, but it is possi-
ble to adjust them by peeling the label
off the TCXO, which gives access to a
trim capacitor. However, this is not for
the faint-hearted, as it is an extremely
fine adjustment, and unless you have
the equipment and patience, I don’t
recommend it.
You need a dual-trace oscilloscope
with one channel connected and
locked to a GPS-disciplined 10MHz
oscillator and the other to the TCXO
output. The latter will drift left or right,
and the trimmer should be adjusted
for minimum drift. If it takes five sec-
onds to drift one cycle, that’s an error
of 0.2Hz (1Hz ÷ 5).

Frequency limits
The maximum frequency of this
counter is partially limited by the op
amp used in the input amplifier. The
Fig.2: the entire Frequency Counter circuit. Signal conditioning is at ADA4891 has a gain bandwidth (GBW)
upper left; the counters are left of centre, the power supply is at lower left of 220MHz and a slew rate of 170V/µs
and the microcontroller and display are on the right. The micro decides (it was also chosen for its high input
when to start and stop counting and when to reset the counters. It is impedance and GBW). This limits the
responsible for reading the counter values, computing the frequency and maximum usable frequency to about
displaying it on the OLED screen. 15MHz; however, readings above
10MHz tend to become rather erratic.

Practical Electronics | July | 2024 33


Table 1 – readings from high-precision source without calibration Table 2 – high-frequency measurements
Division ratio Input signal Measurement Error Input frequency Measurement Error
÷16384 610.3515625Hz 610.352Hz 1mHz 1MHz 999,999.990Hz 10mHz
÷8192 1,220.703125Hz 1220.703Hz <1mHz 2MHz 1,999,999.870Hz 130mHz
÷4096 2,441.40625Hz 2441.406Hz <1mHz 5MHz 4,999,999.670Hz 330mHz
÷1024 9,765.625Hz 9765.625Hz <1mHz 8MHz 7,999,999.530Hz 470mHz
÷512 19,531.25Hz 19,531.249Hz 1mHz 10MHz 9,999,999.330Hz 670mHz
÷256 39,062.5Hz 39,062.500Hz <1mHz
÷128 78,125.0Hz 78,124.998Hz 2mHz positioned correctly; you don’t want
to finish soldering an IC to realise it’s
÷64 156,250.0Hz 156,249.995Hz 2mHz the wrong way round! There should
÷32 312,500.0Hz 312,499.990Hz 10mHz be a dot, or similar marking, in the pin
1 corner but you might need a magni-
÷16 625,000.0Hz 624,999.980Hz 20mHz
fier to see it.
Working one at a time, carefully
I used my calibrated AD9851 signal sticky tape and drill the four corner position the chip on the pads and sol-
generator to check frequencies above mounting holes with a 3mm drill. Use der opposite corners without worry-
1MHz; the results are shown in Table 2. a 1.5-2.0mm drill for the two switch ing about shorting pins. You need to
The higher error rates above 1MHz centre holes. ensure the pins are accurately aligned
appeared to be due to the TCXO Remove the PCB, drill out the switch over the pads on both sides, though,
being slightly off from its nominal holes to 6mm and countersink the so tack one corner first and only sol-
30MHz frequency. mounting holes for M3 countersunk der the other once the alignment looks
The lower end of the frequency head screws (in this case, 6mm long). good under a magnifier.
limit is determined by the input com- The triple AA battery holder should Next, spread flux down both sides
ponents (10μF/1MW) which gives a be attached to holes in the bottom of and slowly drag the soldering iron tip
-3dB point of 16mHz. Therefore, the the enclosure using self-tapping coun- along the pins. You might finish up
practical lower limit is about 10mHz. tersunk head screws of around 3mm with a blob of solder on the last cou-
Measuring a 0.1Hz signal would take in diameter (4G in the old scheme). ple of pins, so use a bit of extra flux
around 10-20 seconds, but that is the Next, move on to building up the paste and some solder braid (wick) to
nature of low-frequency signals. PCB, which is coded CSE230101C, remove it. Use a loupe or similar to
measures 76 × 63.5mm, and is avail- check that all the pins have been sol-
Construction able from the PE PCB Service. During dered properly and that there are no
The assembled PCB is designed to construction, refer to the PCB overlay shorts between them. If there are, break
fit into the Altronics H0324 plastic diagram, Fig.3. Most of the components out the flux and wick again.
enclosure with a clear lid, so we don't on it are surface-mount devices (SMDs). It helps to clean off the flux residue
need to cut a hole for the display. The two 32-bit counters, IC5 and IC8, using an appropriate solvent and then
Before mounting any components on come in relatively fine-pitch 20-pin do a final inspection before moving on
the PCB, use it as a template to drill TSSOP packages, so solder them first. because the residue can hide mistakes.
holes into the clear lid. The PCB just The first and most important job With those nicely soldered, use a sim-
fits in the front detent. Attach it with is to identify pin 1 and ensure it is ilar technique to solder the remaining

Fig.3: most parts are SMDs that mount on the top side of the board, but there are a handful of through-hole parts plus
a few components on the back, notably the TCXO and Arduino Nano module. L1 can be either a through-hole type on
the front or a 4 × 4mm SMD inductor on the back. Watch the polarity of all the ICs, the regulator and the diodes.

34 Practical Electronics | July | 2024


SMD ICs, which have larger lead
pitches, so they should be easier. Don’t
Parts List – Reciprocal Frequency Counter
get IC1, IC2 and IC3 mixed up; they all 1 125 × 85 × 55mm IP65 sealed ABS enclosure [Altronics H0324]
come in 14-pin SOIC/SOP packages. 1 3 × AA battery holder (BAT1)
Regulator REG6 has three pins on 3 AA cells
one side and two on the other, so its 1 double-sided PCB coded CSE230101C, 76 × 63.5mm
correct orientation should be obvious. 1 double-sided PCB coded CSE230102, 1mm thick with black solder mask,
Start by tacking one of the two pins 76.5 × 63.5mm (front panel) both from the PE PCB Service
on one side as they have better sepa- 1 Arduino Nano module (MOD1)
ration. Use a similar technique as for 2 15-pin headers (for MOD1)
the ICs, noting that a single pass with 2 15-pin low-profile female header strips (to plug MOD1 into)
solder wick should clear any bridges 1 0.96-inch 128×64 pixel I2C OLED screen module (MOD2) [SC6176]
from the three-pin side. 1 10μH axial RF inductor OR 4 × 4mm SMD inductor (L1)
Move onto the four diodes, noting [eg, NRS4018T100MDGJ]
that the different types come in dif- 1 SPDT miniature solder-lug on/on (latching) toggle switch (S1)
ferent style packages, all rectangular 1 SPDT miniature solder-lug on/off/on (latching centre-off) toggle switch (S2)
prisms but with D2-D4 being smaller 1 2-pin polarised header and matching plug (CON1)
(there are various compatible types). 1 SMA edge connector socket (CON2)
In each case, ensure the cathode stripe 1 3-pin polarised header (CON3 for debugging; optional)
is facing towards the nearest ‘K’ mark- 1 4-pin female header (for MOD2)
ing on the PCB (cathode is ‘Kathode’ 4 M3 × 6mm panhead machine screws
in German). 4 M3 × 6mm countersunk head machine screws
After that, solder the SMD passives 4 M3-tapped 12mm spacers
(capacitors and resistors) similarly. 4 M3 flat washers
The resistors will be marked with 2 8mm-long untapped spacers (minimum 2mm inner diameter)
codes indicating their values, while 2 M2 × 16mm machine screws and nuts
the capacitors will likely be unmarked, 2 3mm/4G x 6mm countersunk head self-tapping screws (for battery holder)
so don’t mix them up once they are
Semiconductors
out of their packages. Still, the 10µF
1 74HC10 triple 3-input NAND gate, SOIC-14 (IC1)
caps will probably be thicker than the
1 74HC74 dual D-type flip-flop, SOIC-14 (IC2)
100nF types.
1 74HC14 hex schmitt trigger inverter, SOIC-14 (IC3)
Moving onto inductor L1, there are
1 74HC139 dual 2-to-4 line decoder, SOIC-16 (IC4)
two options. A moulded 10µH axial
2 SN74LV8154PW 32-bit counters, TSSOP-20 (IC5, IC8)
inductor may be used on the front side
1 ADA4891-2ARZ dual high-bandwidth op amp, SOIC-8 (IC7)
of the board, but a better choice is a
1 MCP1661T-E/OT or MP1542DK-LF boost regulator, SOT-23-5 (REG6)
4 × 4mm SMD inductor on the other
1 4-pin through-hole 30MHz TCXO, 20×13mm (OSC1)
side of the board. The SMD option
[eg, www.aliexpress.com/item/32789207591.html]
gives slightly higher boost converter
1 MBR0540 40V 500mA schottky diode, SOD-123 (D1)
efficiency and thus marginally longer
3 MMDL770T1G 75V 200mA signal diodes, SOD-323 (D2-D4)
battery life.
With most of the SMDs in place, Capacitors (all SMD M2012/0805 size)
mount the through-hole parts. The 7 10μF 16V X7R 7 100nF 50V X7R
OLED plugs into a 4-pin socket strip Resistors (all SMD M2012/0805 size, 1%)
and is attached by two M2 × 15mm 4 1MW 1 390kW 2 220kW 1 150kW
screws and untapped spacers. Care- 2 22kW 3 12kW 4 4.7kW 1 1kW
fully slide off the plastic spreader on
the pins of the OLED header to reduce
its height, then cut 3mm off the pins
using side cutters. The 3-pin header is only needed if you HEX file. You can load that HEX file
The OLEDs come in two slightly want to use the debugging interface. with an AVR ISP programmer, if you
different sizes, and some are slightly While the switches have solder have one, via the 6-pin header on the
shorter. If necessary, attach it using the lugs, they are mounted on the PCB Nano, but there is another method that
holes on either side of the connector like through-hole components. Ensure doesn’t require the programmer.
rather than the bottom pair. they are perpendicular to the board If you use the six-pin header for pro-
The Arduino Nano mounts on the surface and fully pushed down before gramming, there is a conflict with the
back of the board and plugs into socket soldering them. S2, the centre-off type, I/O pins on the board, so it is necessary
strips. Don’t solder it in directly, as you goes on the right side (from the front). to unplug the Nano and connect it via
then can’t get at the OLED screw holes! After you’ve cleaned the board, the USB cable for power before flashing
It’s important to use low-profile pin inspect it for missing or badly-formed the chip. No fuses need to be changed;
sockets; otherwise, there is not enough joins and shorts between pins. You the defaults are fine, so it's ready once
room for the battery underneath. can then move on to programming you’ve uploaded the HEX file.
Fit the other components on the the microcontroller. Alternatively, plug the Nano into
reverse side next, ie, the connectors, your computer using a USB cable.
TCXO and additional 100nF capaci- Microcontroller programming Then install and load a program like
tor. The input connector is an edge- While we are using an Arduino Nano AVRDUDESS for Windows. You can
mounted SMA type. Ensure the TCXO module with an onboard ATmega328 use the AVRDUDE command-line pro-
is mounted with the correct orienta- chip, we are not programming it with gram in Linux or macOS.
tion, having its pointy corner (indicat- the Arduino IDE. The software is writ- Set the programmer to Arduino,
ing pin 1) towards the top of the board. ten in BASCOM and compiled into a select the Nano’s USB serial port, the

Practical Electronics | July | 2024 35


baud rate to 115,200 or 57,600 (depend-
ing on your Nano) and click ‘Detect’. The Nano is
If it doesn’t find the chip, adjust the mounted via
settings and try again. Once it does, sockets, so the
screw holes under
go to the Flash window, open the HEX
it can be accessed,
file for this project and click the pro- although in this case
gram button. The file is available from they are not used.
the July 2024 page of the PE website: A yellow sticker
https://bit.ly/pe-downloads covers the TCXO
calibration hole.
Final assembly
Plug the Nano back into the PCB, and
it can then be attached to the front
panel (coded CSE230102) using 12mm
spacers and M3 screws. Add a washer
between the spacer and the front panel
to increase the distance slightly. The
front panel is another PCB, 1mm thick,
with a black solder mask and white
printing. It is held in place by the two
switch nuts. Using a PCB here saves
the trouble of printing out a label and Wire the battery up to the plug that to about 0.8V each. With fresh alkaline
making the cutouts. matches CON2, being very careful that cells, it draws 75mA. With each cell
Power is from three AA cells; this the battery’s negative output goes to at 1.2V (3.6V total), the current drain
is stepped up to a nominal 5V by the ground pin closest to the corner is 100mA, increasing as the battery
REG6, although, with the resistor val- of the PCB. There is no reverse polar- voltage decreases further. Recharge-
ues shown, it is more like 4.4V. That’s ity protection on the board, so if you able cells could also be used.
intentional, as it reduces the current get this wrong, you could smoke it! If you’d prefer to use an external
drain slightly. Once you’re sure that’s right, plug it power supply, use a 5V phone char-
As mentioned earlier, attach the bat- in, switch on S1 and check that the ger and leave out REG6, D1, L1 and the
tery holder to the case using screws, display comes up as expected. 150kW and 390kW resistors, plus short
as the battery can be pretty heavy, and The circuit will continue operating out D1 and L1. That will apply the 5V
we don’t want it coming loose. even when the cells have discharged from CON1 directly to the circuit.

Teach-In 8 CD-ROM EE
FR -ROM
CD
ELECTRONICS
£8.99

Exploring the Arduino TEACH-IN 8


FROM THE PUBLISHERS OF
FREE
CD-ROM
SOFTWARE

SERIES
FOR
THE TEACH-IN
8

This CD-ROM version of the exciting and popular Teach-In 8 series INTRODUCING THE ARDUINO
• Hardware – learn about components and circuits

has been designed for electronics enthusiasts who want to get to • Programming – powerful integrated development system
• Microcontrollers – understand control operations

grips with the inexpensive, immensely popular Arduino microcontroller,


• Communications – connect to PCs and other Arduinos

as well as coding enthusiasts who want to explore hardware and


interfacing. Teach-In 8 provides a one-stop source of ideas and
practical information.
The Arduino offers a remarkably effective platform for developing a
huge variety of projects; from operating a set of Christmas tree lights
PLUS...
to remotely controlling a robotic vehicle wirelessly or via the Internet. PIC n’MIX

Teach-In 8 is based around a series of practical projects with plenty of


PICs and the PICkit 3 - A beginners
guide. The why and how to build
PIC-based projects

information for customisation. The projects can be combined together


in many different ways in order to build more complex systems that can Teach In 8 Cover.indd 1 04/04/2017 12:24

be used to solve a wide variety of home automation and environmental


monitoring problems. The series includes topics such as RF technology,
wireless networking and remote web access.
PRICE
£8.99
PLUS: PICs and the PICkit 3 – A beginners guide Includes P&P to UK if
ordered direct from us
The CD-ROM also includes a bonus – an extra 12-part series based around the popular
PIC microcontroller, explaining how to build PIC-based systems.

SOFTWARE
The CD-ROM contains the software for both the Teach-In 8 and PICkit 3 series.

ORDER YOUR COPY TODAY!


JUST CALL 01202 880299 OR VISIT www.epemag.com

36 Practical Electronics | July | 2024


Circuit Surgery
Regular clinic by Ian Bell

Topics in digital signal processing – the sample-and-hold


circuit and ADC Inputs

W
e are looking at various signal is commonly captured at
Sampling
topics related to digital signal the required sample times by a switch
processing (DSP). DSP covers sample-and-hold circuit (as shown Vin A1 A2 Vout
a wide range of electronics applications in Fig.1). The basic principle here Sampling
CS
where signals are manipulated, anal- is that for an ADC to perform a capacitor

ysed, generated, stored or displayed as conversion it needs the analogue


digital data, but originate from, and/or input voltage to be constant for a
are output as, real-world signals for in- certain amount of time, which will
Fig.2. Basic sample-and-hold circuit.
teraction with humans or other parts of depend on the implementation of
the physical world. Fig.1 shows the key the ADC. If the input voltage changes representation of the signal. Problems
elements of a generic DSP system with significantly during this time then errors can occur due to both inaccuracies in
a signal path from an analogue input may occur in the conversion. The sample- the sample timing and value (voltage)
via digital processing to an analogue and-hold block, which is usually part of the sampled signal.
output. This does not necessarily rep- of the ADCs input circuit, performs A basic sample-and-hold circuit is
resent every DSP system (not all have this task. shown in Fig.2. As noted, this will often
all the parts shown) but it serves as a If the input signal changes very slowly be included on the ADC chip (or as part
useful reference for the various subsys- with respect to the ADC’s operating of a microcontroller’s ADC subsystem).
tems we will examine. speed, the voltage change may not be However, separate sample-and-hold
In the previous two articles we looked significant, and the sample-and-hold chips are available. The performance
at the fundamentals of sampling and circuit may not be needed. However, of a typical ADC will depend on the
the properties of ADCs. We covered in many ADC applications expected characteristics of the built-in sampling
the properties of sampled signals changes in the input voltage will result circuit and its interaction with external
and discussed the Nyquist-Shannon in errors if there is no sample-and- circuitry; therefore, it helps to be aware
theorem and aliasing. The theorem states hold circuit. For example, a successive of the process when using ADCs. The
that if the input does not contain any approximation converter (a common characteristics of the sampling circuit
frequency components at or beyond half type of ADC) uses an internal digital- are usually covered in ADC datasheets.
the sampling frequency (the Nyquist to-analogue converter (DAC) to compare The sampling circuit is essentially
rate) then it is possible to perfectly an analogue version of the digital output a switch and a capacitor, as seen in
reproduce the original signal from the code with the input voltage. As the name Fig.2. The switch is electronic (eg, a
sample data. The antialiasing filter suggests, it improves the accuracy of the MOSFET). In Fig.2, A1 is typically the
shown in Fig.1 is used to remove the digital code in successive steps using external circuitry driving the ADC. It
unwanted frequencies which may cause the comparison to decide on each output may be an amplifier, but does not have
errors. ADCs can also introduce errors bit in turn from most to least significant. to be, for example it could be a potential
or noise in the sampled representation If the input voltage changes during the divider connected to the ADC’s input.
of the signal. Quantisation noise is conversion the partially complete digital Typically, A2 represents the input part
caused by the finite number of values code will not be compared to the same of the ADC’s conversion circuitry. In
the ADC’s output codes can take (2N input value on each step, causing errors a separate sample-and-hold device,
values for N bits) and occurs even with in the final result. A1 and A2 could be buffer amplifiers
an ideal ADC. Real ADCs have a number designed to provide high-performance
of non-ideal characteristics, which we Sample-and-hold operation. When the sampling switch
discussed last month, which can add circuit characteristics is closed A1 directly drives CS, so the
additional errors. As with any circuity, the sampling voltage on CS will follow vin – that is,
The discussion so far has not covered process may be subject to non-ideal it will track changes in v in. For this
all aspects of the process of getting an characteristics, which in this case reason, this circuit is also referred to
analogue signal into digital form. The can introduce errors into digitised as a ‘track and hold’. When the switch
is closed the capacitor will retain
Analogue Digital Analogue (hold) whatever voltage was on it
Antialiasing Sample and Digital Reconstruction
at the instant the switch opened.
In ADC DAC Out
filter hold processing filter The circuit in Fig.2 is idealised
(assuming the components are ideal).
Fig.1. Generic DSP system structure. In reality, we need to consider

Practical Electronics | July | 2024 37


Sampling Leakage
switch RS currents
Vin A1 A2 Vout

Sampling CS
capacitor

Fig.3. Sample-and-hold circuit with some non-ideal characteristics.

additional parameters. There will be resistance (RS) between


the source of the signal being sampled and the sample
capacitor (see Fig.3). This, together with the sample capacitor,
will influence how long it will take after the sample switch
is closed for the capacitor to charge to the input voltage in
order to obtain an accurate sample value. There will also be
leakage currents which will change the voltage on the sample
capacitor over time, limiting the time which the sample
can be accurately held for. There may be other mechanisms
causing potential errors in sampling circuits. For example,
a MOSFET sampling switch can couple the control signal
to, or inject charge into, the sampling capacitor. Fig.4. LTspice schematic to illustrate sampling onto a capacitor.

Sampling and holding simulation Fig.6 shows a zoom in from Fig.5 on the first hold to
Fig.4 shows an LTspice circuit based on Fig.3. The sampling track transition. This shows that the output voltage does
capacitor is C1 and the input series resistance is R1. The not immediately equal the input voltage when the circuit
leakage current is modelled with the I1 current source, which enters track mode. The sampling capacitor has to charge (or
is configured for the ideal case (zero current) in Fig.4. The discharge) from the previous hold voltage to the current input
switch is close to ideal (on resistances much smaller than R1, voltage. The time taken depends on the RC time constant
off resistance very large at 10MΩ). The switch is controlled and the amount of voltage change, and is referred to as the
by the 1V SamplePulse waveform from V3 (the switch sample-and-hold’s ‘acquisition time’. After acquisition the
threshold is 0.5V). This is simply a square wave which will output will follow the input unless the input changes too
put the circuit alternately into track and hold modes. The fast for the voltage on the capacitor to follow (again related
circuit values, signals and timing in the circuit in Fig.4 are to the time constant).
to illustrate the principle of operation and are not related to Fig.7 shows the effect of leakage current. This uses the
any particular ADC or sampling system. circuit in Fig.4 with the leakage current source I1 set to
The results from the simulation in Fig.4 are shown in Fig.5. 1µA. Leakage current can flow via the sampling switch (non-
The sampling waveform (cyan trace) has been scaled and infinite off resistance), into the next circuit stage (A2 in Fig.3)
shifted with a formula for convenience of showing alongside or via the capacitor’s imperfect dielectric insulation. Leakage
the signals and labelled with the track and hold conditions. results in a progressive change (droop) in the held voltage,
The input waveform (green trace) is the sum of the two as can be seen by comparing the waveforms in Fig.5 and
sinewaves from V1 and V2. The output waveform (red trace) Fig.7. Droop rate is the rate at which voltage on the sample
can be seen to follow the input when the circuity is in track capacitor changes during the hold interval. It is determined
mode. The output is constant during the hold periods, with by IL/CS where IL is the leakage current, and CS is the sampling
a value equal to the input at the start of the hold period. In capacitance. Note that a constant leakage current results in a
a DSP system the ADC would perform conversions on the linear voltage change on the capacitor unlike the nonlinear
held signal. change when charging through a resistor.

Fig.5.
Waveforms
from the
LTspice
circuit in
Fig.4 (I1 is
zero).

38 Practical Electronics | July | 2024


Relating ADC and sam-
ple-and-hold circuit
characteristics
The performance of the sampling
process depends on both the
sample-and-hold circuit and
the ADC. If the sampling is of
insufficient capability compared
with the ADC then it may
undermine the quality of the
digitised signal. Two key ADC
parameters, which we discussed
last month, are the conversion
time and the LSB. We will briefly
recap these.
The ‘conversion time’ (tC) is how
long it takes from a conversion
being initiated and the data
becoming available. If conversions
Digital Signal Processing Topics – Sample-and-hold Circuit and ADC Inputs are performed continuously the
Fig.6. Zoom in on waveforms in Fig.5 to show signal acquisition on the sampling capacitor. conversions time indicates the
%)
maximum number of conversions
Sample-and-hold circuit timing 𝑡𝑡!"#N=is𝑅𝑅$the
Here, 𝐶𝐶$ ln(2
number of ADC bits. This per second that can be performed (sample
Fig.8 shows characteristics of the is an application of the standard RC rate). In the simplest case, sample rate
sampling process. The sampling switch is charge/discharge equation: will be 1/tC, but it is not always that
controlled by the sampling clock, which simple. Some converters (eg, pipelined
instructs the sample-and-hold circuit to 𝑉𝑉&'()* ADCs) have a faster sample rate than 1/tC
𝑡𝑡 = 𝑅𝑅𝑅𝑅 ln * ,
change between the sample (track) and 𝑉𝑉'('+')* because processing of multiple step-by-
hold modes. When the switch is closed, step conversions occurs simultaneously.
sampling begins and the capacitor will where the ratio of final to initial voltage is In such cases there is a latency of several
charge to the input voltage, this takes the worst case – the entire
a finite time – the time required by the ADC𝐿𝐿𝐿𝐿𝐿𝐿 input 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 (2N).
= range
sample-and-hold circuit to acquire the Once the input 2% voltage tACQ td
sample value. The more accurately you has been acquired, the
need the capacitor voltage to match the sample-and-hold circuit
Input
input voltage the longer you have to wait can enter the hold state tJ
(all other things being equal). to allow 𝑑𝑑𝑣𝑣 '(conversion to Sample
𝑡𝑡, ≤ 𝐿𝐿𝐿𝐿𝐿𝐿
We can define the ‘acquisition time’ take place. 𝑑𝑑𝑑𝑑 Again, this is State
Hold Track sample Hold
(tACQ) as the duration from the end of controlled by the sampling
the hold state (sampling begins) and the clock. The relevant clock Clock
point at which the voltage on the edge represents the time at
sampling capacitor settles to within 1 which𝑣𝑣'( = the 𝐴𝐴 command
𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋)to hold Sample Hold
acquired achieved
LSB of the input voltage. With reference is given. The circuit will take
ing Topics to
– Sample-and-hold
Fig.3 and Fig.8,Circuit and ADC
acquisition Inputs
time is a finite time to actually enter Sampling Hold
started Requested
then given by: the hold state (and hence
𝑑𝑑𝑣𝑣
take '( the sample). This is
= 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋)
𝑡𝑡!"# = 𝑅𝑅$ 𝐶𝐶$ ln(2% ) 𝑑𝑑𝑑𝑑
called ‘aperture delay’ (tAD). Fig.8. Sample-and-hold circuit timing characteristics.

Fig.7.
Waveforms
from the 𝑉𝑉&'()* 𝑑𝑑𝑉𝑉'( 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝑡𝑡 = 𝑅𝑅𝑅𝑅 ln * , 𝑡𝑡 <
LTspice 𝑉𝑉'('+')* 𝑑𝑑𝑑𝑑 - 2%
circuit in
Fig.4 (I1 is
1µA).
𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 2𝐴𝐴
𝐿𝐿𝐿𝐿𝐿𝐿 = 2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡- <
2% 2%

𝑑𝑑𝑣𝑣'( 1
𝑡𝑡, ≤ 𝐿𝐿𝐿𝐿𝐿𝐿 𝑡𝑡- <
𝑑𝑑𝑑𝑑 2% 𝜋𝜋𝜋𝜋

𝑣𝑣'( = 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋)

𝑑𝑑𝑣𝑣
Practical
'( Electronics | July | 2024 39
= 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋)
𝑑𝑑𝑑𝑑
ADC input ADC input
voltage voltage

ΔV ΔV

Δt Δt
V2 V2
Sample
held Input level
reacquired
V1 V1

tC tC
Conversion Conversion
time time

g Topics – Sample-and-hold Circuit and ADC Inputs


Conversion Conversion Time Conversion Conversion Time
starts finishes starts finishes

𝑡𝑡!"# = 𝑅𝑅$ 𝐶𝐶$ ln(2% )


Fig.9. Changing input signal to an ADC without a sample-and- Fig.10. ADC input with sample-and-hold circuit for comparison
hold circuit. with Fig.9.
conversion cycles before the result of a particular conversion
𝑉𝑉&'()*
𝑡𝑡is=available.
𝑅𝑅𝑅𝑅 ln * , Sample and hold
𝑉𝑉'('+')*
The least-significant bit (LSB) is the input change that the input voltage
ADC can resolve, that is the smallest input change required
for a change in code output. Last month, we saw that: ΔV
Δt
𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝐿𝐿𝐿𝐿𝐿𝐿 = V2
2%
where the ADC’s input range is defined as VRefH – VRefL, the
difference between the upper and lower
Digital reference
Signal voltages.
Processing N – Sample-and-hold
Topics V1 Circuit and ADC Inputs
is the𝑑𝑑𝑣𝑣number of bits. LSB and conversion time can be related
'( tJ
to𝑡𝑡,sample-and-hold
≤ 𝐿𝐿𝐿𝐿𝐿𝐿 circuit parameters – faster conversion and Aperture
𝑑𝑑𝑑𝑑 jitter time
more bits (smaller LSB) generally require higher performance 𝑡𝑡 %)
!"# = 𝑅𝑅$ 𝐶𝐶$ ln(2
sampling circuits.

Sample should be Sample actually Time


𝑣𝑣The need for sample-and-hold circuits
'( = 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋) held at this time held at this time
Fig.9 shows a graph of input voltage against time for an ADC 𝑉𝑉&'()*
for which there is no sample-and-hold circuit. We assume 𝑡𝑡 = 𝑅𝑅𝑅𝑅 ln * ,
𝑉𝑉'('+')*
the conversion takes time tC, during which the input changes Fig.11. Aperture Jitter timing.
𝑑𝑑𝑣𝑣'( from V1 to V2. If this change (V2 – V1) is larger than one LSB
= 2𝜋𝜋𝜋𝜋𝜋𝜋
then the 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋) may be disrupted. Fig.10 shows the
conversion given by: rate = dV/dt, which simply implies measurement
𝑑𝑑𝑑𝑑
same situation with a sample-and-hold circuit (similar to of the rate over an infinitely short time interval.
𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
Fig.6) for comparison. 𝐿𝐿𝐿𝐿𝐿𝐿
If we=multiply the maximum rate of change of a signal by
2%
For a changing input voltage, the possibility of error depends the conversion time we can find the largest amount the input
on the relationship
𝑑𝑑𝑉𝑉'( 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 between the rate of change of voltage and signal changes during this time, which must be less than the
𝑡𝑡- <
the conversion time. The rate of change of input voltage is LSB to prevent errors. We can write this mathematically as:
𝑑𝑑𝑑𝑑 2%
the voltage difference ΔV divided by the time taken for that 𝑑𝑑𝑣𝑣'(
change Δt (ie, rate = ΔV/Δt), as shown in Fig.9. The symbol 𝑡𝑡, ≤ 𝐿𝐿𝐿𝐿𝐿𝐿
𝑑𝑑𝑑𝑑
Δ (delta) means ‘change of’. Measuring the rate as shown on
Fig.9 is fine2𝐴𝐴 for a constant rate of change, but for real signals, An obvious question at this point is how we know what rate
2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡the
where - <rate changes constantly, we use the calculus form of change value to use. We should probably look at the most
2%
𝑣𝑣'( = 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋) Fig.12. Circuit
for AD4000
ADC simulation
1 in LTspice.
𝑡𝑡- <
2% 𝜋𝜋𝜋𝜋 𝑑𝑑𝑣𝑣'(
= 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋)
𝑑𝑑𝑑𝑑

𝑑𝑑𝑉𝑉'( 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝑡𝑡 <
𝑑𝑑𝑑𝑑 - 2%

2𝐴𝐴
2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡- <
2%

40 Practical Electronics | July | 2024


1
𝑡𝑡- < %
𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝐿𝐿𝐿𝐿𝐿𝐿 =
2%
𝑑𝑑𝑣𝑣'(
𝑡𝑡, ≤ 𝐿𝐿𝐿𝐿𝐿𝐿
𝑑𝑑𝑑𝑑
demanding case and one way to do this to consider a sinewave
at the highest 𝑑𝑑𝑣𝑣'( frequency present in the input signal. Our input
Simulation files
can be 𝑡𝑡written:
,
𝑑𝑑𝑑𝑑
≤ 𝐿𝐿𝐿𝐿𝐿𝐿 Most, but not every month, LTSpice is used to support
descriptions and analysis in Circuit Surgery.
𝑣𝑣'( = 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋) The examples and files are available for download from
where f is the frequency in hertz and A is the amplitude the PE website: https://bit.ly/pe-downloads
(peak).
𝑣𝑣'(To
= find the2𝜋𝜋𝜋𝜋𝜋𝜋)
𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( rate of change we use calculus to differentiate
the signal function (find dv in/dt). Readers familiar with approach can also be used with other converter timing issues
𝑑𝑑𝑣𝑣'(
calculus will
= 2𝜋𝜋𝜋𝜋𝜋𝜋 know
𝑐𝑐𝑐𝑐𝑐𝑐( that differentiating a sine function gives
2𝜋𝜋𝜋𝜋𝜋𝜋) as we shall see shortly. Furthermore, an understanding of the
𝑑𝑑𝑑𝑑
a cosine function; so we get: behaviour of the sampling process is useful when working
𝑑𝑑𝑣𝑣'( with ADCs, for example it helps to know that if you drive an
= 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋) ADC’s input from a source (eg, a sensor) with a high internal
𝑑𝑑𝑑𝑑
resistance then that resistance will increase the acquisition
𝑑𝑑𝑉𝑉'( 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
The maximum
𝑡𝑡- < %
value of a cosine function is 1, so the maximum time, which may cause errors.
rate of change2is 2πfA. We can use this figure in the calculation
𝑑𝑑𝑑𝑑
given𝑑𝑑𝑉𝑉 above
'(
to𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
determine if a sample-and-hold circuit is Jitter
required. 𝑡𝑡- < may
This
𝑑𝑑𝑑𝑑 2% not seem like a major issue as most ADCs DSP systems typically have a constant frequency sample
will have the sampling system anyway; however, the same clock, rather than taking samples at arbitrary times (eg, one-off
2𝐴𝐴
2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡- < %
Fig.13. 2
Results
from circuit 2𝐴𝐴
2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡- < %
in Fig.12. 2
1
𝑡𝑡- < %
2 𝜋𝜋𝜋𝜋
1
𝑡𝑡- <
2% 𝜋𝜋𝜋𝜋

Fig.14.
Results
from circuit
in Fig.12
with R1
changed to
10kΩ.

Practical Electronics | July | 2024 41


Digital Signal Processing Topics – Sample-and-hold Circuit and ADC Inputs

measurements controlled by a user). In be at lower frequencies and any higher


such
𝑡𝑡!"# cases = 𝑅𝑅$ 𝐶𝐶$variations
ln(2 %) in the aperture frequencies present will generally not
Digital Signal Processing Topics – Sample-and-hold Circuit and ADC Inputs
delay between Circuit
Digital Signal Processing Topics – Sample-and-hold clock cycles,
and ADC or Inputs
in the be near maximum amplitude.
clock edge timing itself, will cause a
change in effective %)
sample time in each ADC simulation
𝑡𝑡!"#cycle. = 𝑅𝑅$This𝐶𝐶$ ln(2 is referred
% to as ‘aperture So far we have not looked at an LTspice
𝑡𝑡!"# = 𝑅𝑅$ 𝐶𝐶$ ln(2 𝑉𝑉&'()*)
𝑡𝑡 = 𝑅𝑅𝑅𝑅
jitter’ (tJ)lnThe* term, ‘clock jitter’ is used simulation of an ADC, however, there are
𝑉𝑉'('+')*
to refer to timing variations specifically models of several ADCs included in the
in clock signals. downloaded library. These models have
www.poscope.com/epe Sampling 𝑉𝑉&'()*at the wrong time point analogue outputs which represent the
𝑡𝑡 = 𝑅𝑅𝑅𝑅 ln * 𝑉𝑉&'()* ,
means
𝑡𝑡 = 𝑅𝑅𝑅𝑅 ln *'('+')*𝑉𝑉
that the , wrong voltage will quantised signal – they do not provide
𝑉𝑉𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝐿𝐿𝐿𝐿𝐿𝐿 = '('+')*
be converted. The voltage deviation the digital bits. This is because LTspice is
2%
resulting from aperture jitter will show not aimed at modelling digital (or mixed
up as noise in the sampled signal. The analogue and digital) systems, so providing
problem 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
gets worse for higher input many digital outputs for the code would
𝐿𝐿𝐿𝐿𝐿𝐿 = 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝐿𝐿𝐿𝐿𝐿𝐿 𝑑𝑑𝑣𝑣
signal 2%
=frequencies because the signal not be particularly useful. Some digital
'( 2%
voltage 𝑡𝑡, will ≤ 𝐿𝐿𝐿𝐿𝐿𝐿
change more in the jitter signals are modelled, for example the start
𝑑𝑑𝑑𝑑
time. Thus, aperture jitter is a critical convert control input. The models focus on
characteristic in ADCs used for high- the input section and allow aspects such
𝑑𝑑𝑣𝑣'(
frequency signals. as the impact of the input circuit on the
𝑡𝑡, 𝑑𝑑𝑣𝑣'(≤ 𝐿𝐿𝐿𝐿𝐿𝐿
𝑡𝑡𝑣𝑣In 𝑑𝑑𝑑𝑑order
, = ≤ 𝐿𝐿𝐿𝐿𝐿𝐿
for the aperture jitter of the acquisition to be investigated. Noise and
'( 𝑑𝑑𝑑𝑑 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋)
sample-and-hold circuit not to cause FFT simulations can also be performed.
conversion errors the change in signal Fig.12 is similar to the example circuit
voltage (Vin) during the jitter time (tJ) must for the AD4000 provided by Analogue
𝑣𝑣'(be=less 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠(
than 2𝜋𝜋𝜋𝜋𝜋𝜋)
the LSB. This is similar to Devices. The AD4000 is a 16-bit 2
𝑑𝑑𝑣𝑣
𝑣𝑣'('( = 𝐴𝐴 𝑠𝑠𝑠𝑠𝑠𝑠( 2𝜋𝜋𝜋𝜋𝜋𝜋)
the = 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐(
problem 2𝜋𝜋𝜋𝜋𝜋𝜋) earlier about the
discussed MSPS, Precision, Pseudo Differential,
𝑑𝑑𝑑𝑑
need for a sample-and-hold circuit (see successive approximation register ADC.
Fig.11), except now we use aperture jitter The simulation circuit includes the device
- USB 𝑑𝑑𝑣𝑣'( rather than conversion time, so we need: power supply (1.8V) and reference voltage
- PWM 𝑑𝑑𝑣𝑣 = 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋)
- Ethernet - Encoders 𝑑𝑑𝑑𝑑 '( = 2𝜋𝜋𝜋𝜋𝜋𝜋 𝑐𝑐𝑐𝑐𝑐𝑐( 2𝜋𝜋𝜋𝜋𝜋𝜋) (5V). Conversion is started by a rising
- Web server - LCD 𝑑𝑑𝑑𝑑 𝑑𝑑𝑉𝑉'( 𝑡𝑡 < 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
edge on the CNV input, which is driven
- Modbus - Analog inputs 𝑑𝑑𝑑𝑑 - 2%
- CNC (Mach3/4) - Compact PLC
by a pulse waveform in the simulation.
- IO For a sinewave with a peak value A The input is a sinewave configured to
𝑑𝑑𝑉𝑉
equal
'( to 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
half the ADC range (the peak- exceed the reference voltage. The AD4000
𝑑𝑑𝑉𝑉 𝑡𝑡 < 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝑑𝑑𝑑𝑑 '(-𝑡𝑡- <
to-peak 2%
sinewave has input overvoltage protection – not
𝑑𝑑𝑑𝑑 2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡 2 % 2𝐴𝐴 covers the entire input
range, < % = 2A) we have, using
ie, -range all ADCs do, so make sure that you are
2
the maximum rate of change of sinewave aware of the maximum ratings of any
calculated above, the following: device you are using.
2𝐴𝐴 The results from Fig.12 are shown in
2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡- < 2𝐴𝐴
2𝐴𝐴𝐴𝐴𝐴𝐴𝑡𝑡- <2% 1% Fig.13. We see the output update after
𝑡𝑡- < %2 each conversion start pulse and we can
2 𝜋𝜋𝜋𝜋
So see the quantisation of the output (red
- up to 256 - up to 32 trace is stepped). When the input (green
microsteps microsteps 1
- 50 V / 6 A 𝑡𝑡- < % 1 trace) exceeds the reference voltage the
- 30 V / 2.5 A
- USB configuration 2
𝑡𝑡- < % 𝜋𝜋𝜋𝜋 output remains at the maximum output
- Isolated
2 𝜋𝜋𝜋𝜋
value. The drive and ADC input voltages
For example, CD audio uses 16 bits at a are equal, which indicates there is no
PoScope Mega1+ sample rate of 44.1kHz. This means the significant interaction between the ADC
highest input frequency must be limited input and external circuitry. Fig.14 shows
PoScope Mega50 to below 22.05kHz (if we a have perfect the results with the input resistor changed
anti-aliasing filter). This is a requirement to 10kΩ. Here we see the ADC input is not
of sampling theory discussed previously the same as the drive voltage from the V1
– the highest frequency present in the source – the input voltage changes as the
input must be less than half the sampling ADC’s sampling switches change state.
frequency otherwise aliasing will occur This is a simple example but illustrates
in the sampled data. how the ADC model can help evaluate the
The above formula indicates a driver circuit providing input to the ADC.
maximum aperture jitter of 220ps
(picoseconds) and illustrates that
aperture jitter requirements can be quite Introduction to LTspice
demanding. A sample rate of 44.1kHz is Want to learn the basics of LTspice?
around one sample every 23μs – about Ian Bell wrote an excellent series of
- up to 50MS/s one hundred thousand times longer than Circuit Surgery articles to get you up
- resolution up to 12bit
the indicated maximum aperture jitter and running, see PE October 2018
- Lowest power consumption
- Smallest and lightest time. However, the above calculation is to January 2019, and July/August
- 7 in 1: Oscilloscope, FFT, X/Y, probably somewhat pessimistic about 2020. All issues are available in
Recorder, Logic Analyzer, Protocol print and PDF from the PE website:
the aperture jitter requirements as most
decoder, Signal generator https://bit.ly/pe-backissues
of the content of a real audio signal will

42 Practical Electronics | July | 2024


AOShop
The home for specialist audio, analogue and historic
components – provided by Jake Rothman, PE’s
Audio Out columnist. The AOShop is your best bet for
classic analogue ‘NOS’ (new old stock) components,
including all parts for Audio Out projects and designs.

Ge semiconductors 5534H metal-cased op amp £3.00 Radiation resistant Special resistors


LM384, TDA2030A, Siemens cellulose acetate MKL
Small-signal PNP transistors TDA2050V £1.50 2.2/25 £0.80 Bourns wire-wound trimmer
NKT214F, OC57, OC59, TAA435 (Mullard power 5kΩ 3059 JM panel-mount £2.00
2N1377, 2N525 £1.00 Electrolytic – Mullard blue 017 series Thermistor RA53, R13 £4.00
amp driver) £1.20
10/25, 22/25, 100/10 £0.50 A13 £2.00
Low-noise PNP transistors 150/40, 470/40, 1000/40 £1.00
GET106 £2.50 Synthesiser ICs Thermistor CZ1, CZ6 £1.50
Tantalum – axial metal cased Holco H2 2.2MΩ 1W, 1% £1.00
Small power PNP transistors That/dbx 2180 VCA/VCF £6.00 Welwyn 1GΩ 2W £1.00
22/50, 47/35, 68/25, 100/20, 120/10,
AC153, AC153K, AC188, AC188K £1.50 CA3080 VCA/VCF (vocoder) £2.80 5k Bourns 3321H cermet trimmer £0.50
150/16, 220/10, 330/6 £2.00
CA3280 VCA/VCF £4.00
Small power NPN transistors 22/35, 33/35, 47/20, 68/15, 100/10,
LM13600/ LM13700 VCA/VCF £2.00 Potentiometers
AC176, AC176K, AC187K, 150/6 £1.25
CA3086 transistor array £1.00
AC141K £2.00 4.7/50, 6.8/35, 10/25, 10/35, 22/15 £1.00 Bourns 81
PT2399 echo/delay £1.50
High-voltage PNP transistors Axial moulded-case tantalum 25kΩ lin cermet £2.00
OC77, CV7001 £1.50 Dual transistors Kemet axial 6.8/10 £0.30 25kΩ lin, 5kΩ lin conductive
Kemet radial 33/10 £0.40 plastic £3.00
TO3 PNP power transistors 2N2639, 2N2223, 2N2910 (NPN) £4.00 STC radial 100/20 £1.50
OC22, CV7054 (OC23), OC25, Bourns 91
E401 (JFET Moog) £4.00 Tantalum bead 10k dual-gang lin or log £10.00
OC35, OC36, AD143, AD149, 2SK2145-Y dual JFET £0.80
AD161, AD162 £2.00 22/50 £1.00 Plessey moulded-track
2N5564 JFET £8.00 470/3 £2.00
AD140 £3.50 HN3C51F, HN3A51F £1.00 5kΩ log with switch £3.00
AD149, AD161/2 matched pair £5.00 680/6.3 £3.00 50kΩ A/log £3.00
DMMT3904/6, HN1A01F,
RF PNP transistors HN1C01F £0.50 Wet tantalum Mil 250kΩ lin dual £5.00
OC41, OC42, 2SA12, 2SA53,AF124, 220/25 axial £3.20 Alpha
AF178, GET872A £1.50 Loudspeakers Castanet button 140/30, 470/3 £3.20 16mm 4.7kΩ A/log £0.80
Hughes 540/10 £3.20 220kΩ A/log £0.80
NPN transistors PE Mini-Monitor
OC139, OC140, ASY73 £2.00 Volt PE165 6.5-inch woofer (each) £85 Bipolar 10kΩ lin centre-detent dual-gang £1.50
Morel MDT29 tweeter (each) £25 Hermetic bipolar tantalum 16/35 £3.20 Allen Bradley J series/Honeywell
Diodes Kit pair of PE165/MDT29 plus Elcap axial 10/50 £0.50
CV7049 (OA10), CG92 (OA91) £0.50 10kΩ lin 1 million cycles £5.00
Volt crossover parts and PCBs £299 Generic radial 100/16, 470/35, Blore Edwards AB 45 dual 5kΩ
Monacor DT-28N tweeter (each) £35 100/ 63, 22/35, 4.7/35, 220/16 £0.50 A/log with switch £3.50
Si semiconductors Vifa 19mm BC20SC15-04 Philips solid-aluminium (axial) 121/123 Alps RK9 dual-gang 5kΩ RD law £4.00
Diodes tweeter (each) £15 47/16 £1.00 Alps 50k log tapped motorised
ZC5800 RF Schottky £0.20 Volt crossover inductors 330/6.3 £2.00 stereo £5.00
Low-noise silicon transistors 1.2mH, 1.5mH, 2mH, 2.7mH, 0.5mH 100/35 £4.00 BI P260 500kΩ log conductive
BFW16A, 2SC3071, 2SC3068, (tapped at 0.3mH) (each) £5.85 plastic 1 million cycles £2.00
Philips Pearl 122 series (radial)
2SA1016K, 2SC2362K, Colvern wire-wound 100kΩ or
Fully assembled and tested high-quality 10/16 £0.30
2SA970BL £1.50 50kΩ dual-gang 3W £5.00
speaker prototypes – ask for details Silvered mica (radial) Mil Spec hermetic 10Ω £8.00
2SC2204, 2SD655, BC550C £0.50 LS3/5As and other similar speaker
ZTX651 £0.30 1nF/500 1% £1.00
systems (pair) £200-£350 Miscellaneous
ZTX751 £0.50 Trimmer capacitors
Fully tested reclaimed speakers Vishay plastic-film 4-40pF £0.80 Theremin Clearance Sale!
RF transistors (suitable for Theremin) Vifa BC14 5-inch woofer (each) £10
BF199 £0.50 Vishay plastic-film 5.5-45pF £1.00 Elysian Theremin MIDI box £300
Vifa TC26 1-inch tweeter (each) £10 Vishay plastic-film 5-80pF £1.20
Audio power MOSFETs PCBs
Low-price speakers Vishay plastic-film 10-250pF £2.00
Exicon 10N20, 10P20 £6.50 Pocket Theremin (EPE, 1996) £2.00
Philips 4-inch 4070 £2.00 Mica 1-12pF, 2-40pF £1.00
Hitachi 2SJ99, 2SK343 £3.50 Elysian Theremin (EPE, 1996) £6
EMI 10x6-inch, 30Ω Alnico £7 Synth VCF, VCO (EPE, 2017) £3.00
Hitachi 2SJ56, 2SK176 £8.50 64mm 64Ω neodymium £1.20 Audio transformers and 48V PSU (EPE, 2019) £3.00
JFETs 5x3-inch elliptical 50Ω or 80Ω inductors SMT dual transistor adapter £0.40
BFW11, BFW10, TIS73L, J177, Alnico £3.50 Eagle transformers
J113, U1994, U1898, 2SJ176, 1.65x2.75-inch 8Ω £1.50 LT44, LT722 driver, LT700, LT723 Contact
J201 £1.00 500Ω output £2.50 Jake Rothman
J175, J176, J112, J111, 2N3820, LT30 500mW output £3.50 The Old Rectory, Arlais Road,
2N5467, BF244, 2N5460, J230 £0.60 Capacitors 5:1 interstage £1.50 Llandrindod Wells, Powys
Note ‘10/63’ denotes ‘10µF 63V’. LD1 5HE (visit by appointment)
Small power output/driver transistors Repanco
2SB649A, D669A, 2SA1208, Polyester T/T3 splitter transformer £4.00 +44 (0)1597 829102
2SC2910, MJE253G, MJE243G, 3.3/100, 4.7/250, 4.7/63 £1.00 CH2 5mH RFC £2.00 [email protected]
2SA1725, 2SC4511 £1.20 5.6/63, 8.2/63, 10/63 £2.00
BD139,BD140, BD135, BD156, BD435, Balanced output transformer Minimum order £5.00 inc post
Mullard ‘Mustard’ C296 0.22/400 £2.00
BD436, MPSA63, BCV46 £0.50 Vigortronix 600Ω VTX-101-007 £10 Quantity discounts negotiable
Polycarbonate Vigortronix 600Ω VTX-101-3001 £10
MOSFETs Axial 2.2/63 1%, 4.7/160, 6.8/63 £1.00 Vigortronix 600Ω VTX-101-3002 £15
ZVP2106A £0.30 Payment
Gardners 150Ω £10 PayPal, cards (via phone), bank
Dual-gate 3SK45, BFS28 £1.50 Radial
Reclaimed BBC LL74/MPC transfer, cheques (payable to ‘J
6.8/160V, 10/63 £2.00
Metal-cased transistors nickel core 600Ω £12 Rothman’, UK pounds only)
Reclaimed 22/63 £2.00
BC143 £0.35 No VAT payable
2N1711 £0.50 Polystyrene Reclaimed mic input transformer £15
£0.30 Philips 1% 4.7nF/160, 6.2nF/500,
BCY71 Inductors Postage
BC109C £0.60 12nF/63, 22nF/63, 110nF/63,
82µH, 4.7mH, 100µH, 270µH, Small Jiffy bag £2.99
24nF, 2nF £1.00
Amplifiers 10µH, 14µH (low Z) £0.50 Small package £4.99
RIFA 1% 100nF/100, Suflex
LM318 high-speed op amp £0.35 7-inch ferrite rod with MW Big boxes and overseas at cost
90.9nF 0.5% £2.00
µA709 metal-cased op amp £2.00 and LW windings £3.00 – ask for a quote
Suflex 2.5% 10nF/63 (rad. or ax.) £0.50

Practical Electronics | July | 2024 43


AUDIO AUDIO OUT

OUT
L R

By Jake Rothman
Switching in audio equipment – Part 2

T
his month, we carry on from The Rotary Club Phono socket
where we left off in June and finish Rotary switches, sometimes
our look at the many varied types called wafer switches (Fig.21), Aux
of mechanical audio switches. are the most versatile, but
often require a lot of costly
hand-wiring; although this is FM tuner
not really a problem for home
constructors and prototypes.
The old Paxolin wafer types
have an open construction CD player
Volume
which means they easily get
dirty but are also very easy 10kΩ Left
output
to clean. It is even possible Cassette deck log
to power
0V amplifier
to buy kits, such as the RS
Maka-Switch to assemble
your own specialised multi-
wafer switches. (These
Fig.21. Rotary wafer switches have been are popular among older
around since the swinging 1920s. They engineers who played with
have very long life, are easy to service Meccano as kids!) 0V

but are labour intensive to wire. Most PCB-mounting types


10nF
are expensive and have Aux
unique overlays and pinouts.
I use the Lorlin pattern types 1kΩ
(Fig.22) which are also dual 10nF
FM tuner
sourced by Alpha and have
a standard pin-out. These
1kΩ
have a washer under the nut 10nF Right
output
to set the number of ways. CD player
to power
The military and aviation amplifier

sectors seem to favour rotary 1kΩ


10kΩ Volume
10nF
switches for their ruggedness Cassette deck log
(>100,000 cycles) compared 0V

to lightweight slide switches 1kΩ


Fig.22. Lorlin/Alpha standard pattern for example. Those made by
rotary switch, 6-way 2-pole. These are Plessey, Painton, Diamond Fig.24. Circuit for rotary Hi-Fi selector switch. On some
available in both BBM and MBB versions H, Elma and Greyhill are more complex designs, the earth connections are also
and are well sealed. the best and come in up to switched as well to minimise earth loops.
29-way and eight-wafer (or
‘bank’) options. They are often used as of poles. A typical amplifier selector
switched attenuators in audio and can switch circuit will have four ways and
cost between £20 and £100 each. A fine two poles (one section for each left and
example is shown in Fig.23. right channel) as shown in Fig.24. A
The selector switch on Hi-Fi amplifiers useful dedicated (standalone) audio
is traditionally a multi-position rotary source selector box is shown in Fig.25.
switch. In switch parlance the number
of positions is the number of ‘ways’. Crosstalk
The number of sections is the number A common problem with selector
switches is crosstalk. This is where a
Fig.23. Some rotary switches are beautiful signal from an unwanted source bleeds
pieces of mechanical engineering. Such as into the selected source. An example
this Plessey 72 series military switch. of this happening is when listening

44 Practical Electronics | July | 2024


Fig.25. A dedicated three-position source selector switch Fig.27. An extension spindle enables a switch to be placed in an
with earth switching using an expensive 02 series Elma electrically quiet area. In this case a flexible coupling has been used
rotary switch. to decouple vibrations.

to a quiet radio signal (say, classical a high frequency, say 20kHz, and can T Giesberts Mini-preamplifier (Elektor,
music on BBC Radio 3), and having be in the order of −70dB, improving to February 1994).
inadvertently left the CD player going, −120dB in the best cases. To prevent crosstalk there are several
one can hear a faint frequency from By screening the cables and using other effective techniques. Rotary
the CD player in the background. (Hi buffers with a low output impedance switches sometimes include a metal
hat cymbals seem to bleed through the crosstalk can be greatly reduced, as screen between the two sections, as
especially well.) This inadvertent shown in Fig.26. Another popular dodge shown in Fig.28. On PCBs it is always
coupling is due to the capacitance is to put a rotary switch on the back panel worth putting earthed guard tracks
between the contacts and cables. It gets next to the input sockets. This switch is between the input lines going to the
worse if the source impedance of the then mechanically coupled to the knob at switch, along with a ground plane to
selected source is high – in the case of the front using an extension spindle and mimic screened cables. Another trick is
some FM tuners and valve pre-amps brackets – see Fig. 27. This approach also to ground the unused sources. Care has to
this may be up to 10kΩ. The capacitance minimises hum and noise and is popular be taken to ensure this does not cause any
effectively makes a high-pass filter in expensive integrated (combined damage to the source though. Normally
with this resistance, so if it is high pre- and power) amplifiers. It requires a series resistor of around 600Ω prevents
the coupling frequency is lower hence care with mounting to the front panel excessive current. However, there
the hi hat being especially noticeable. bushing to prevent play and a floppy can still be the problem of preventing
Crosstalk is specified in the same way as feel. I use a viscous damping grease such current going to ground which can
signal-to-noise ratio, in decibels (−dB) as Kilopoise and a felt washer under the cause resistive crosstalk. This can be
below the signal. This figure is given at knob. Shaft extensions were used in alleviated by connecting the ground to a
low impedance point, such as the power
Zero output
impedance amplifier
supply. In the days of the Maka-Switch
Input 2 one could buy a ‘rotating open-circuit’
*Reduces distortion wafer, as shown in Fig.29. By linking
from output capacitors across to an adjacent normal wafer, all
10kΩ* 0V
the unused sources were automatically
grounded. It’s also possible to do the
220kΩ

47pF Zero output Selector


impedance switch
minimises
crosstalk
– 22µF 22µF Output
68Ω
+
+

Input 3
+
NE5534 Parasitic
220nF 0V capacitance
2x back-to-back 3.3kΩ
220kΩ tantalum capacitors
creates a bipolar device

Zero output
impedance amplifier
Input 4

Screened cable
shield connected
Fig.28. An earthed metal screening
0V at only one end plate can be placed between two switch
sections to reduce coupling. Useful for
Fig.26. Feeding switches from low impedance sources, such as zero-output preventing crosstalk between left and
impedance buffers, reduces crosstalk between switching elements and cables. right channels.

Practical Electronics | July | 2024 45


Fig.29. A ‘rotating open-circuit’ wafer. Fig.31. Interlocking is accomplished by a
This can be used to ground all contacts Fig.30. Mechanically interlocked push spring-tensioned sliding bar with latching
except the position selected. buttons. Notice the spring. tabs underneath all switches.

same thing with interlocking push Post Office/BBC switches medium-scale production I outsource
buttons, as in Douglas Self’s preamplifier I mention these because they often the front panels and then the rectangular
(Wireless World, September 1996). turn up in old BBC equipment, and switches just clip in. (Getting them out
are sometimes called ‘lever switches’. again for replacement/maintenance
Multiple push buttons They are very reliable, achieving a though is another matter!)
An alternative to the rotary switch is million operations. They have an open
an interlocking push button, where construction with easy-to-clean multi- Soldering meltdown
only one button can be on (in) while contacts, as shown in Fig.33. They Some cheap switches use thermoplastic
the others are always off (sticking also make no mechanical noise, but on cases rather than the old Bakelite
out) as illustrated in Fig.30. These the downside they are expensive, and thermosetting material. Take care with
are often easier to operate and offer mounting them is awkward. They need these when soldering. If the wire is
the possibility of clearer labelling. a rectangular hole and two screw holes pulled while it is still hot, the tag/contact
They were popularised by German with precise relative dimensions.
industrial designers such as Dieter
Rams of Braun with his 1959 SK4 Funny shapes, odd holes
radiogram. Indeed, they are replicated For small-scale constructors, switches
on computers screens today in graphical that are fastened with a nut in a round
user interface (GUI) software as ‘radio hole are the most convenient, such
buttons’. Mechanical interlocking has a as toggle and rotary types. They also
sliding bar interlinking all the switches allow the front panel to be completely
(see Fig.31). Such assemblies are prone sealed, unlike rows of interlocking
to go wrong and it’s often impossible push buttons. In general, I try to avoid
to get a replacement. There was one switches that require rectangular holes
design of button that incorporated a which either need an expensive cut-
black ‘eyelid’ which opened to reveal out punch or fiddly, time-consuming
a florescent orange disc when pressed – sawing and filing. This precludes a lot
see Fig.32. Most designers today would of rocker and some push switches – the
go for an electronic interlocking system kind shown in Fig.34. I have even had Fig.34. These lovely LED illuminated
with LEDs which, unlike the ‘eyelid’, 3D-printed adaptor plates made for some Japanese push buttons require a difficult-
requires power. push buttons – see Fig.35. Of course, for to-cut hole.

Fig.32. An interesting push button by Fig.33. Old-fashioned Post Office Fig.35. A square switch in a round hole.
Schadow that uses internal ‘eyelids’ to switches used by the BBC were very An adaptor plate for the switch type
reveal a fluorescent ‘on’ indicator when reliable and you could get them in almost shown in Fig.34. A 3D print designed by
the actuator is pressed. any combination. my friend, Jeremy Paine.

46 Practical Electronics | July | 2024


switch tags, the solvent
can wash the flux into
the switch contacts
where it dries like a
varnish causing an
open circuit. The black
silver tarnish that often
occurs with switches
(Fig.37) can often make
the tags impossible to
solder, even though the
switch often works fine
with enough current.
The solution is to use
a glass fibre brush to
clean them – the type
Fig.36. Once you get the front panel
shown in Fig.38.
rectangular hole right, the switch just
clips in with the plastic tabs. This is a
PCB mounting
typical rocker mains switch. A pig to
I used to avoid PCB-
get out though, since all the tabs have
mounted switches
to be squeezed in together. Note these
since the high
switches melt and can fail when soldered. Fig.39. Here’s some multi-gang PCB mount rotary switches
mechanical forces
They are designed for push-on insulated on an equaliser module. Last time I bought one of these
imparted on the board
spade connectors. Greyhill switches it cost £35.
gave rise to dry joints.
This is much less of a problem today
because of plated-through holes. For
maintenance work there is still the
problem of finding switches to fit a
PCB layout since an exact physical
replacement is always required. Fig.39
shows an API-inspired audio equaliser
with rotary Greyhill switches connected
to resistor ladders giving precise dB
control steps. It is possible to get a
complex multi-pushbutton assembly
made up (see Fig.40) which is soldered
into the PCB as one unit. The goal is to
eliminate a stack of wiring and possible
errors – assuming you get the PCB layout Fig.40. A custom-made push-button
right! These set-ups are common in Hi-Fi assembly ready to solder into a PCB.
Fig.37. Black sulphide tarnish on switch This has two high-current switches for
pre-amps and audio test sets such as the
tags can be impossible to solder. speakers and a small-signal DPDT switch.
Wayne Kerr AMS1 audio analyser shown
However, in this situation the switch
in Fig.41 and 42.
surprisingly usually still works.
the 1kHz test signal switch. It took a year
Switch odyssey for me to find a replacement for these
One of the switches failed in my Wayne white switches – they turned up quite
Kerr AMS1, by shooting out of the front by chance at a radio rally. Then it took
panel across the room. It’s contacts and half a day of microsurgery to fix it. All
other small parts were scattered in the that hassle because of a plastic-tab failure
process, most of which were never found. on the end of the internal plastic slider
Unfortunately, it was the most important (Fig.43). I inserted a cropped Veropin in
button on the front panel; in this case, a 1mm hole drilled where the missing

Fig.38. A glass fibre brush is the best way


to clean contacts.
can move as the plastic softens, resulting
in an open circuit. This also happens
with mains rocker switches (Fig.36).
They are designed for push-on tags, not Fig.41. A complex PCB-mounted interlocked push button assembly on the AMS1 audio
soldering. Don’t clean solder flux off analyser front panel. Switch problems in systems built like this are a nightmare to fix.

Practical Electronics | July | 2024 47


Fig.43. The bane of my life, the plastic tab
failure. This little bit of plastic breaking off
the (upper) internal switch slider resulted
in half a day’s work.
Fig.42. Interior of my AMS1. The Centralab switches are white and mounted on the lower
PCB. The latching spring and contacts went missing, and they weren’t in the Hoover bag.

Fig.44. The plastic tab was replaced by


inserting a truncated Veropin in its place.

end of a pot’s rotation – clockwise or anti-


clockwise – or the shaft can be pulled/
pushed to actuate the switch. Old audio
gear often combined the mains power
Fig.45 (left) The small parts of the AMS1 switch ejected. Note the spring and specially switch with the volume control: a classic
bent contact strips. The originals was never found. These are the internals of a case of design trumping function and a sure
replacement; (right) switch with the top prised off to show the sliding contacts of the way to induce hum and bangs. It’s fine for
DPDT switch. This is in the on (pushed in) position. signal and control switching though, and
adds to the designer’s ergonomic arsenal.
tab was (Fig.44). Even then I couldn’t but definitely better than desoldering For example, the AMS1 is full of switched
get the slider back in until I realised I the whole switch with the possibility of pots, as shown in Fig.47.
had to raise the Vero pin for clearance. damaging the PCB, which really would Allan Bradley series 70 ModPots were
It then had to be pushed down when the have been difficult to fix. among the most popular types in good
slider was inserted with new springy quality audio equipment, offering a
contacts from a sacrificed switch (Fig.45) Multi-function mayhem lifetime of 100,000 cycles. However, they
and precariously held in place. I had to Audio switches are often combined with were very expensive.
drill a 1.2mm hole to do this (Fig.46). It potentiometers to give dual functions Finally, it’s possible to add a mains
was a real pain to troubleshoot and fix, with one knob. Switching can be at either switch to a rotary switch – see Fig.48.

Fig.46. I had to drill another hole at the back (switch sixth from Fig.47. The Allan Bradley (now Clarostat/Honeywell) Mod
left) to access the Veropin to push it down after inserting the Pot series enabled complex potentiometer and switch
slider into the switch casing. No way was I going to unsolder 78 combinations to be made up for custom designs. (These are
pins to get this switch assembly out. the black square devices).

48 Practical Electronics | July | 2024


noise pick up that may result in a pop
when the effect is engaged, as shown in
Fig.51. I now use this method in all my
Colorsound guitar effects pedals.

Next month
My overview of audio mechanical
switches went on longer than expected,
but next month we really will move on
to the topic of audio electronic switching.

Fig.50. A Chinese Daier foot switch used


Fig.48. Here’s a 5-way rotary switch with on a Colorsound Powerboost preamplifier
an integral mains switch on the first click. pedal. Guitar pedal builders call these Input Bypass
Gnd
It’s possible to get almost anything made ‘stomp’ switches. (Do not adjust your option Output
up. This one was from Blore Edwards. monitor, I’ve always built 1970s-style FX
0V
Input Output
electronics in orange cases. Matt black is
In
only for heatsinks).
Input In

Unused contacts Output


FX output
There are often spare sections on multi-
pole switches. Don’t waste them, wire
them in parallel as shown in Fig.49 to
Input
improve reliability and reduce contact
resistance. The switch here is a 3PDT
guitar pedal bypass switch from Daier
FX input
Electron in China – see Fig.50. This
switch also has an improvement to the
classic bypass circuit shown originally Fig.51. Superior hard bypass. Avoids one
Fig.49. The spare section on this 3PDT in Fig.9 last month. Here the input extra contact in bypass mode compared
hard bypass footswitch on this Macaris circuitry can be a single switch contact. to a traditional circuit. If a DPDT switch is
Colorsound wah-wah pedal is wired in If a changeover contact is used, the used, the unused contact can be used
parallel to improve reliability. unused contact can be grounded to stop to earth the processors input.

Practical
Electronics BACK ISSUES
Practical Practical Practical Practical Practical Practical Practical
Electronics Electronics Electronics Electronics Electronics Electronics Electronics
The UK’s premier electronics and computing maker magazine
The UK’s premier electronics and computing maker magazine
The UK’s premier electronics and computing maker magazine
The UK’s premier electronics and computing maker magazine
The UK’s premier electronics and computing maker magazine
The UK’s premier electronics and computing maker magazine
The UK’s premier electronics and computing maker magazine
Circuit Surgery Audio Out Make it with Micromite
Circuit Surgery Audio Out KickStart Make it with Micromite
Circuit Surgery Audio Out Cool Beans Make it with Micromite
Circuit Surgery Audio Out Wind turbine Electronic Building Blocks
Circuit Surgery Audio Out Make it with Micromite
Circuit Surgery Audio Out Make it with Micromite
Circuit Surgery KickStart Make it with Micromite
Exploring op amp PE Analogue Vocoder: Using and interfacing the
Exploring op amp Vocoder: Driver Using the Using and interfacing
Exploring
the the Vocoder: Mastering switch Build an iButton-based
Exploring the Vocoder final Small-scale Building a budget Distortion and Designing a practical Code for an iButton-based
Simulating distortion Using transformers in Installing MMBASIC on
Using
a distortion and Exploring DACs and MMBASIC + RPi Pico + display
exponential amplifiers Driver Amplifier design versatile iButton input offsets Amplifier build I2C bus versatile iButton LM35 temp sensor Audio PSU debounce Electronic Door Lock
Royer oscillator assembly garden set-up electronic stethoscope
distortion circuits de-thump circuit Electronic Door Lockand distortion circuits audio electronics Raspberry Pi Pico distortion circuits microcontrollers = PicoMite Backpack!

64-key MIDI WIN!


Microchip Microchip
WIN!
WIN!
Microchip
Matrix SAM C21
Xplained Pro
SAM V71
Xplained Ultra
MPLAB
Starter Kit for
Evaluation Kit
WIN!
Multi-purpose Battery Evaluation Kit
WIN!
Digital Power
WIN Manager
Completing Retro gaming
PIC18F Development MiniHeart Mastering our impressive 8/14/20-pin PIC
Introducing the Introduction to
Board: using displays AC meters Programming Helper with Nano Pong!
Heartbeat Analogue Vocoder Raspberry Pi Pico linear actuators
SimulatorBuild this handy WIN! Single-Chip Silicon
WIN!
Soothing Labs FM/AM/SW
Flowcode
WIN!High-current Microchip
C
Arduino-based Microchip
Digital FX Digital FX Explorer 8 SAM E54
void interrupt(void)

Electronic WLR089
Battery Balancer WIN! Unit Development Kit High-current
Curiosity Ultra
Digital Radio Receiver Controlling a
Unit
Development
Flowcode
{ if (intcon & 4)

Xplained Pro
power supply
{
Assembly
Board
Wind Chimes Microchip
clear_bit(intcon, 2);

Learn Evaluation Kit from Microchip


Battery Balancer linear actuator
FCM_INTERRUPT_TMR movlw D′7
D′7′
o();

MPLAB ICD 4
Digital Clock
bsf STATUS, RP0

WIN! WIN!
bcf STATUS, RP1
movwf _adcon1
Hex
In-Circuit
Flowcode
movlw D′192′ :040000008A01122837
movwf _option_reg :08000800F000F00S030

Debugger
Design
EF10000 Flowcode
:10001000040EF2000A0

Simple
EF300BA110A122928352

WIN
Programming
86C Flowcode
:2000200D928FE28073 Flowcode C
void interrupt(void)

Toot toot! MIDI


{ if (intcon & 4) C
{
C clear_bit(intcon, 2);
Assembly void interrupt(void)

Learn
FCM_INTERRUPT_TMR movlw D′7′ { if (intcon & 4)
void interrupt(void) o(); {
bsf STATUS, RP0 Assembly

Music
{ if (intcon & 4)

Model Railway Level


bcf STATUS, RP1 clear_bit(intcon, 2);
{ Hex

192kHz, 24-bit
clear_bit(intcon, 2);
Assembly movwf _adcon1 FCM_INTERRUPT_TMR movlw D′7′
movlw D′192′ o(); bsf STATUS, RP0
FCM_INTERRUPT_TMR :040000008A01122837

Flowcode
movlw D′7′ movwf _option_reg bcf STATUS, RP1
o(); bsf STATUS, RP0
:08000800F000F00S030
movwf _adcon1
Hex
EF10000

Keyboard
bcf STATUS, RP1

Full-wave Crossing with moving


movwf _adcon1
Hex :10001000040EF2000A0 movlw D′192′ :040000008A01122837
movwf _option_reg

Learn
EF300BA110A122928352 :08000800F000F00S030
movlw D′192′ :040000008A01122837 86C EF10000

Vintage Battery
movwf _option_reg

Programming:
:08000800F000F00S030 :2000200D928FE28073 :10001000040EF2000A0
EF10000 EF300BA110A122928352

SuperCodec:
:10001000040EF2000A0

Universal Motor barriers, flashing


86C
EF300BA110A122928352 :2000200D928FE28073

Flowcode
86C

Radio Li-ion
:2000200D928FE28073

Balanced Input PIC, Arduino and 16x2 LCD Speed Controller lights and bell! Advanced GPS Computer:
Power Supply Programming
and Attenuator Battery Monitor Logger Advanced GPS Computer construction and use
PLUS! PLUS! PLUS! PLUS! PLUS! PLUS!
Jan 2022 £5.49 Feb 2022 £5.49 Apr 2022 £5.49 May 2022 £5.49 Jun 2022 £5.49 Jul 2022 £5.49 Aug 2022 £5.49
Techno Talk – Communing with nature PLUS!
01
Techno Talk – Go eco, get ethical!
02 Techno
04 Talk – From nano to bio Techno
05 Talk – Positivity follows gloom Techno
06 Talk – Mixed Menu Techno
07 Talk – Time for a total rethink? 08
Fox Report – Power as free as the wind Techno Talk – Should we be worried? Fox Report – Another fine mess: moving to Windows 11 Cool Beans – Simple filtering with software Cool Beans – Amazing Analogue AI and a handy PSU Cool Beans – Choosing servos and a little competition Cool Beans – Touch-sensitive robots and using servos
Net Work –EVs, upgrading to Windows 11 and space tech 9 772632 573023
Net Work – Electricity generation and streaming radio Net Work – Scanners, eVTOLs and the latest from space
9 772632 573023
Net Work – UK gigafactories, Rolls-Royce electric planes
9 772632 573023
Net Work – Google Lens plus energy and space news
9 772632 573023
Net Work – NFC and the rise of mobile payments
9 772632 573023
Net Work – The irresistible rise of automotive electronics
9 772632 573023 9 772632 573023

www.electronpublishing.com @practicalelec practicalelectronics


www.electronpublishing.com @practicalelec practicalelectronics
www.electronpublishing.com @practicalelec practicalelectronics
www.electronpublishing.com @practicalelec practicalelectronics
www.electronpublishing.com @practicalelec practicalelectronics
www.electronpublishing.com @practicalelec practicalelectronics
www.electronpublishing.com @practicalelec practicalelectronics

BACK ISSUES – ONLY £5.95 ORDER FORM – BACK ISSUES


£5.95 per issue for UK incl p&p n £8.95 Europe Air Mail n £9.95 ROW Air Mail  Back issues required (month / year) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
We can supply back issues of PE/EPE by post. Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
We stock magazines back to 2006, except for the following: Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2006 Jan, Feb, Mar, Apr, May, Jul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tel: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2007 Jun, Jul, Aug
2008 Aug, Nov, Dec Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2009 Jan, Mar, Apr  I enclose cheque/PO to the value of £ . . . . . . . . . . . .
2010 May, Jun, Jul, Aug, Oct, Nov
2011 Jan  Please charge my Visa/Mastercard £ . . . . . . . . . . . . . . .
2014 Jan Card No . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2018 Jan, Nov, Dec Valid From . . . . . . . . . . . . . Card Expiry Date . . . . . . . . . . . . .
2019 Jan, Feb, Apr, May, Jun
Card Security Code . . . . . . . . . . (Last three digits on or under the signature strip)
Issues from Jan 1999 are available on CD-ROM / DVD-ROM
SEND TO: Practical Electronics, Electron Publishing Limited
If we do not have a a paper version of a particular
113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU
issue, then a PDF can be supplied for the same price.
Your email address must be included on your order. Tel: 01202 880299 Email: [email protected] On-line Shop: www.electronpublishing.com
Please make sure all components are still available before Payments must be in £ sterling – cheque must be drawn on a UK bank and made payable to ‘Practical Electronics’.
Practical
commencing anyElectronics
project from |a July | 2024
back-dated issue. 49
All items normally posted within seven days of receipt of order. Copy this form if you do not wish to cut your issue.
Max’s Cool Beans
By Max the Magnificent

Arduino Bootcamp – Part 19

D
o you know what you were
doing at 5:16:20 pm on Satur-
day, 23 November 1963? I do. (a) Flat cut (b) Bevel cut
I was six years old, and I was stand-
Fig.2. A cut above the rest.
ing bravely (cowering) behind the sofa
with my teddy bear captivated by the As I’ve mentioned before, whenever I
(a) Without insulating tape
sound of the electronic opening music return to England to visit my dear old mom,
accompanying the very first episode of on the Friday before I return to America,
the British science fiction television a gaggle of my techno-geek friends flock
series, Doctor Who. I’ve been a devoted from across the country. We all meet at the
fan ever since. Why did this just pop house of my brother, Andrew, where we
into (what I laughingly refer to as) my spend a happy day and evening showing
(b) With insulating tape
mind? Well… off our latest and greatest creations and
telling tall tales of derring-do. Why do I
Fig.3. The old insulating tape trick.
A gaggle of techno-geeks mention this here? Well…
There is no official collective noun for because (a) they slide in more easily and
a group of engineers, but two terms I Electronic component art (b) square ends have the potential to
favour are ‘a sprocket of engineers’ and One of the guys who attends our geeky damage the breadboard’s sockets. I tell
‘a rube of engineers,’ where the latter gatherings is Paul Parry, who is the you; I learn something new every day!
derives from the American cartoonist, founder and owner of Bad Dog Designs
sculptor, author, engineer and inventor, (https://bit.ly/3QsB8kw). Over the Seeing red
Reuben Garrett Lucius Goldberg (a.k.a. past decade, Paul has captivated and Joe also taught me another tidbit of
Rube Goldberg). Rube is best known for cultivated a worldwide following for trivia. He says he usually covers the
his cartoon depictions of complicated his Nixie-tube-based timepieces. front of his red light-emitting diode
gadgets performing simple tasks in More recently, Paul has started a new (LED) 7-segment displays with a piece
indirect and convoluted ways. line in electronic component-based of red insulating tape.
artworks (https://bit.ly/4dryK7t). I love I must admit to being surprised. ‘I’m
all these creations, but the one that really surprised,’ I said (so it must be true).
caught my eye was that of Doctor Who’s I told Joe I’d assumed insulating tape
TARDIS (Fig.1). I have one on order for was opaque. He replied that although
when I visit the UK this summer. the tape does dim the displays a little,
Meanwhile, back in America, I meet it also makes the active segments ‘pop.’
up with a group of friends on Tuesday I just tried this myself and I see what Joe
evenings. We have a light supper and means. I’ve tried to replicate this effect in
then watch two episodes of Doctor Who Fig.3 (only partially successfully, I fear).
(we started with the 2005 reboot starring The situation without insulating tape is
Christopher Eccleston). These guys are shown in Fig.3a. In this case, the active
going to be blown away when I flaunt segments are a little brighter, but the
my new acquisition. inactive segments still manage to stand
out. By comparison, when the insulating
A handy-dandy tip tape is applied as depicted in Fig.3b,
In my previous column (PE, June even though the active segments are a tad
2024), I remarked on how my friend dimmer, the inactive segments become
Joe Farr has a vast amount of practical almost invisible, thereby making their
knowledge. I also commented on the kits active counterparts more prominent. Once
of pre-stripped, pre-formed, solid core again, I learn something new every day!
jumper wires you can find on Amazon
(https://bit.ly/3vDs2KK). Resistance is futile!
While we were chatting about ‘this Toward the end of my previous column, I
and that,’ Joe dropped a little nugget showed a picture of my own breadboard
of knowledge into the conversation. He setup with four multiplexed 7-segment
noted that he always cuts his solid core displays presenting the hours and
Fig.1. Electronic component artwork for the jumper wires at a 45° angle if he’s using minutes in HH:MM format. At that time,
Doctor Who TARDIS (Source: Paul Parry). them with breadboards (Fig.2). This is I directed your attention to a rinky-dinky

50 Practical Electronics | July | 2024


talking to my wife (Gina the
Gorgeous), I need to qualify
which Bob is the topic of
discussion, so I call them
Bible Bob, Carpenter Bob,
Sparkly Bob... I recently ran
across a science fiction book (a) Saw between holes (b) Score and snap through holes

called We Are Legion (We Are


Bob). I had to buy this book Fig.5. Preparing the BOB board.
just for the title. It was only board to the header pins at the same time.
after it had arrived that I discovered it’s Fight this temptation with all your might.
an awesome story. And I’m not the only If you do solder them simultaneously,
one who thinks so because this tome there’s more than a batting chance the
has 4.5 stars with 24,000+ ratings on solder won’t wick (get sucked through)
Amazon (https://bit.ly/3wsnoiQ). the via all the way to the other side. In
But we digress. To build our BOB, turn, when you eventually plug your
we will need to start with a piece of BOB into your project’s breadboard,
board. One contender is stripboard the header pins may separate from the
(https://bit.ly/3JLtbTJ), but this would BOB (sad face).
require us to cut tracks using a knife or Thus, our first task is to solder the
a special stripboard track cutting tool board to the header pins (Fig.6a). Use
Fig.4. Replacing free-standing resistors
(https://bit.ly/3UprIYh). In this case, a hot soldering iron and hold it on each
with a BOB.
however, I opted for a piece of prototyping joint long enough for the solder to wick
little board in the upper right-hand board (https://bit.ly/3UMkcZ1). all the way through the via (remember
corner of my breadboards. Now we have another choice. We can we talked about soldering, along with
As you may recall, at one stage in our either use a fine-toothed hacksaw to cut Alan Winstanley’s handy-dandy Basic
experiments we had two groups of eight our board between the holes (Fig.5a), Soldering Handbook, in PE, March 2024).
150Ω current-limiting resistors (this was or we can use a utility knife to score When it comes to attaching the
before we realised that we needed only lines through the holes and then snap resistors, you have another decision to
one such group). We started off using the board along these lines (Fig.5b). In make because there are various ways to
free-standing resistors, as shown in the my case, I opted for the latter solution do this. Joe comes from a prototyping
upper portion of Fig.4. because I happened to have a utility background where things often need to
In addition to looking untidy, one knife in my pocket whilst my hacksaw be reworked. Based on this, he favours
problem with having a bunch of resistors was hiding in the tool chest in the garage simply bending the resistor leads at 45°
in proximity like this is that it’s easy for (thus are our decisions made). angles, soldering them to the pins, and
the leads of adjacent resistors to make We’re also going to need cut two cutting off any excess lead (Fig.6b). The
unwanted connections with each other. This 8-pin pieces of the same long-tailed advantage of this approach is that it’s
can result in annoying issues, especially if (0.1-inch pitch) header pins we used easy to desolder things if required later.
the connections are intermittent. to create the breadboard power LED By comparison, I tend to come from
One solution is to replace the free- assemblies in our previous column a more mission-critical and safety-
standing resistors with dual in-line (https://bit.ly/3U1Vp2z). Stick these 8-pin critical background where ‘Failure is
(DIL) resistor packages. An example is header pin strips into an old breadboard not an option.’ Based on this, I tend to
provided by the Bourns 4100R Series mounted four holes apart. The reason overengineer things, such as twisting the
(https://bit.ly/4biAmPH). These are for using an old breadboard is that we leads through a full 360° circle (Fig.6c).
available in different-sized packages with are about to do some soldering. Bits of The downsides to this approach are
different numbers and configurations solder and fragments of wire can fall that it’s easier to create solder bridges
of resistors. For our purposes here, we into the breadboard’s holes, so we will between adjacent pins (because the joints
would like a 16-pin package containing want to reserve this board for soldering are bigger) and it’s harder to rework the
eight isolated 150Ω resistors. and similar non-active activities in the BOB later. The upside is that these solder
The main problem with this approach future. This means it would be a good joints are not going to fail anytime soon.
is that the range of resistance values idea to mark ‘Do Not Use’ on this board Just to make sure we’re all up to date,
supported by the Bourns 4100R Series for future reference. I’ve added this BOB to the drawing
(and similar offerings from other Now, this next part is important, so of the latest and greatest incarnation
manufacturers) is limited. sit up and pay attention. You may be of our prototyping platform (file
A cheap-and-cheerful alternative is tempted to solder the resistors and the CB-Jul24-01.pdf). As usual, all the files
to build our own breakout board (BOB)
carrying eight discrete 150Ω resistors, as
shown in the middle of Fig.4. In addition
to preventing any leads shorting, using
BOBs like this makes it easy to replace
one group of resistors with another,
which is something we may well be
doing a lot of in the not-so-distant future
(I feel like an oracle… but where are we
going to find one at this time of the day?).
(a) Solder (b) Bend legs (c) Twist legs through 360°
header pins at 45° (a step too far? )
Building a BOB
As an aside, I have more than my fair
share of friends called Bob. When I’m Fig.6. Adding the resistors to the BOB board..

Practical Electronics | July | 2024 51


Set New Segment Value → Turn Transistor T0 On → Wait 2ms → Turn Transistor T0 Off
Display segments Set New Segment Value → Turn Transistor T1 On → Wait 2ms → Turn Transistor T1 Off
C onnection No connection G round (0V ) (a)
and pin numbers Set New Segment Value → Turn Transistor T2 On → Wait 2ms → Turn Transistor T2 Off
Set New Segment Value → Turn Transistor T3 On → Wait 2ms → Turn Transistor T3 Off
:

Set New Segment Value → Set 2:4 Inputs to 00 → Wait 2ms


Set New Segment Value → Set 2:4 Inputs to 01 → Wait 2ms May result in
(b) Set New Segment Value → Set 2:4 Inputs to 10 → Wait 2ms “Ghosting” on
Set New Segment Value → Set 2:4 Inputs to 11 → Wait 2ms old display
D3 D2 D1 D0 5 10 9 1 2 4 6 7
:
DP G F E D C B A
Set 2:4 Inputs to 00 → Set New Segment Value → Wait 2ms
Set 2:4 Inputs to 01 → Set New Segment Value → Wait 2ms May result in
(c) Set 2:4 Inputs to 10 → Set New Segment Value → Wait 2ms “Ghosting” on
Set 2:4 Inputs to 11 → Set New Segment Value → Wait 2ms new display
3 3 3 3 :

C C C C en = 0 → Set 2:4 Inputs to 00 → Set New Segment Value → en = 1 → Wait 2ms


B B B B en = 0 → Set 2:4 Inputs to 01 → Set New Segment Value → en = 1 → Wait 2ms
(d) en = 0 → Set 2:4 Inputs to 10 → Set New Segment Value → en = 1 → Wait 2ms
E E E E en = 0 → Set 2:4 Inputs to 11 → Set New Segment Value → en = 1 → Wait 2ms
:

13 12 11 10 9 8 7 6 5 4 3 2 Turn All Segments Off → Set 2:4 Inputs to 00 → Set New Segment Value → Wait 2ms
Turn All Segments Off → Set 2:4 Inputs to 01 → Set New Segment Value → Wait 2ms
(e)
Arduino pin numbers Turn All Segments Off → Set 2:4 Inputs to 10 → Set New Segment Value → Wait 2ms
Turn All Segments Off → Set 2:4 Inputs to 11 → Set New Segment Value → Wait 2ms
:

Fig.7. Current circuit with four 7-segment displays. Fig.9. Alternative control scenarios.

mentioned in this column are available In a crunchy nutshell, the question code in that only one of the four outputs
from the July 2024 page of the PE website: posed by James the inquisitor can be is ‘hot’ (active) at any time.
https://bit.ly/pe-downloads summarised as follows: ‘Why don’t we Based on the functional specification
use a 2:4 decoder to drive the transistors, we just established for our 2:4 decoder,
Why don’t we… thereby freeing up two of the Arduino’s we can create a truth table (Fig.8a),
I received an interesting email from digital I/Os?’ a symbol (Fig.8b), and a gate-level
a reader we will call James (because That’s a good question. Remembering implementation (Fig.8c), where s stands
that’s his name). James had a question that I’m only ever an email away, I’m for ‘select’ and y stands for ‘output.’
regarding our current circuit (Fig.7). As surprised you haven’t presented this In this case, we are using two NOT
you will recall, in the present incarnation poser yourself. Using a 2:4 decoder (we (inverter) gates and four 2-input AND
of our clock, we are using eight of our read this as ‘two-to-four decoder’) is gates. You can find a quick refresher
Arduino’s digital input/output (I/O) pins certainly a possibility, although there are on the truth tables and functioning of
to drive the display segments, with all some considerations to… well, consider. NOT, AND, NAND and XOR gates in my
four displays connected in parallel (side- On the off chance this function is new to Cool Beans Blog on the C/C++ bitwise
by-side). Also, we are using four digital you, let’s start by considering what we operators (https://bit.ly/3UqT9B6). A
I/O pins to control the transistors we use mean by a 2:4 decoder in the first place. more in-depth discussion is provided in
to activate the displays. This means we The idea is to create a logic function my book Bebop to the Boolean Boogie
are using 12 digital I/Os in all. that has two inputs and four outputs. (https://bit.ly/4a6wDDm).
As we’ve previously noted, the The inputs, which we will drive using So, in the case of our current four-
Arduino Uno has only 14 digital I/O pins our Arduino, have 2 2 = 4 possible display clock, we now have a choice
(remember that we aren’t considering combinations: 00, 01, 10, and 11. between not using a 2:4 decoder and
the 6 analogue pins, which can also We want to use each of these input having no free digital I/Os or using a 2:4
be used as digital I/Os, because we combinations to select one of our four decoder and having two free digital I/Os.
are holding them in reserve for a later possible outputs, which we will use to As a slight aside, if we ever decide
date). Also, we aren’t using digital I/Os control the transistors that control our we want to drive anywhere from five to
0 and 1 because these are reserved for displays. Furthermore, in the case of our eight displays, the way we are currently
communications between the Arduino current circuit, we require ‘active high’ implementing things would leave us with
and the host computer. outputs, which means their active state no choice but to use a 3:8 decoder (three
So, the situation we find ourselves in is 1 and their inactive state is 0. This is inputs and eight outputs), which would
is (a) the Arduino Uno has 12 digital I/Os due to the way we have things wired, still leave us with one free digital I/O.
available to us and (b) we are using all whereby a 1 will turn the corresponding
of them to drive our four displays. This transistor on. Remember, we want only Seeing ghosts
means we don’t have any digital I/Os one transistor (and thus one display) to Remember that we are just spitballing
free to implement other functions, like be active at a time. ideas here. We aren’t really going to
driving our piezoelectric buzzer, for It may (or may not) be worth noting deploy a 2:4 decoder, but it’s well worth
example (we introduced this component that our hypothetical 2:4 decoder can be taking the time to cogitate and ruminate
in PE, December 2023). thought of as implementing a ‘one hot’ over the implications if we were to do so.
Your knee-jerk reaction might be that
using a 2:4 decoder as discussed above
s1 s0 y3 y2 y1 y0 s1
& y3 would be easy peasy lemon squeezy.
y3 s1
0 0 0 0 0 1
& y2 Hold hard! Not so fast! Remember
0 1 0 0 1 0 F rom s1 y2
that I said there were considerations
2:1 T o transistors s0
Arduino s0 y1 & y1
1 0 0 1 0 0
s0 to consider. Take a moment to think
y0
1 1 1 0 0 0 & y0 about (a) our gate-level implementation
(a) Truth table (b) Symbol (c) G ate-level implementation and (b) how we might use the Arduino
to drive the inputs to the decoder. Can
Fig.8. 2:4 decoder with active-high outputs (driving 4 displays). you envisage any potential problems?

52 Practical Electronics | July | 2024


What are the implications of this? consider the signals associated with a
s y1 y0 y1 Well, suppose that s1 = 0 and s0 = 1:2 decoder implemented using two
s 1:2
0 0 1 y0 1, which means display D1 is active. NOT gates (Fig.10).
1 1 0 (b) Symbol Now suppose we wish to deactivate As we see, due to the delays associated
(a) Truth table display D1 and activate display D2. with the NOT gates, there’s a period
s This means we want s1 = 1 and s0 = when both the output signals are 1,
0. To put this another way, we want which means both the displays will be
y0
d0 d1
the s1-s0 inputs to our 2:4 decoder activated at the same time. The same
y1
y1 to transition from 01 to 10. One way thing will apply to our 2:4 decoder
s y0
d0 to achieve this would be to use the (and a 3:8 decoder if we decided to
d1
following statements: use one); that is, there will be short
(c) Gates (d) Waveforms
periods where multiple displays are
digitalWrite(S0, 0); active simultaneously.
Fig.10. 1:2 decoder with active-high outputs digitalWrite(S1, 1); With respect to our earlier ghosting
(driving 2 displays). examples (both ‘single ghosting’ and
Unfortunately, this means the inputs to ‘double ghosting’), only one display was
Hold onto your hat because I’m about our 2:4 decoder would now follow the active at any time. In this case, however,
to make your head spin and your brain sequence 01, 00, 10, which means we we really do have multiple displays
wobble on its gimbals. Let’s start by would be driving our displays in the active simultaneously. This means that,
reminding ourselves that the way order D1, D0, D2. in addition to a new form of ghosting,
our program is driving our existing Alternatively, we could swap the order our Arduino’s pins will have to drive
circuit can be summarised as shown in of our statements to read as follows: twice the expected current.
Fig.9a (observe we are using the two- Since we are talking about multiple
millisecond (2ms) on/active time for digitalWrite(S1, 1); outputs being simultaneously active for a
our displays that we settled on in our digitalWrite(S0, 0); duration of only a few nanoseconds due
previous column). to this gate delay scenario, would either
The key point with respect to our In this case, the inputs to our 2:4 decoder of the associated ghosting and current
existing implementation is that it’s would follow the sequence 01, 11, 10, issues really be a problem? Probably not.
possible for us to turn all the transistors which means we would be driving our On the other hand, I think it behooves us
off at the same time. Now consider our displays in the order D1, D3, D2. to engineer things in such a way that such
2:4 decoder-based solution. In this case, Either way, we may now experience a situation never occurs in the first place.
there will always be one of our displays ghosting on two displays (let’s call this
that’s active. ‘double ghosting’) rather than one (our Adding an enable
In the context of this column, the term original ‘single ghosting’ scenario), There are two relatively simple solutions
‘ghosting’ refers to our trying to display which means things are going from that will address both our sequencing
two values too closely together on the bad to worse. and our gate-delay-induced problems.
same display, one for a longer time Happily, there are two ways around First, we could add an en (‘enable’) input
(the desired value) and one for shorter this problem that immediately spring to to our 2:4 decoder. This signal would be
duration (the fainter, ‘ghost’ value). mind. The first relies on the fact that it controlled by our Arduino. In this case,
For the moment, let’s assume that we doesn’t really matter in which order we let’s say that if en is 0, all our outputs
are always driving our segments with activate our displays, just so long as we will be forced to their 0 (inactive) states.
on/off values associated with one of the follow the same sequence repeatedly. So, It’s only when en is 1 that the selected
digits 0 through 9. In this case, we have rather than feeding the inputs of our 2:1 output will be 1. The truth table, symbol,
two options. We could set the segments decoder with the binary sequence 00, and gate-level implementation of this
to their new values and then set the 2:4 01, 10, 11, 00… (D0, D1, D2, D3, D0…), new incarnation of our 2:4 decoder
decoder’s inputs to their new values in which multiple bits change on the 01 function are shown in Fig.11.
(Fig.9b), but this may result in ghosting to 10 and 11 to 00 transitions, we could In the case of the truth table (Fig.11a), X
on the old display. Alternatively, we instead use a Gray code sequence (named represents a ‘Don’t Care’ state. Thus, we
could set the 2:4 decoder’s inputs to their after Frank Gray), such as 00, 01, 11, 10, read the first row of this table as: ‘When
new values before setting the segments 00… (D0, D1, D3, D2, D0…), in which en = 0, we don’t care what values are
to their new values (Fig.9c), but this may only one bit changes at a time. presented to s1 and s0 because we are
result in ghosting on the new display. An alternative solution relies on the going to force all the outputs to 0.’ We
Could things get worse? You betcha! fact that there is a way by which we read the remaining rows as: ‘It’s only
can change multiple Arduino outputs when en = 1 that we use the values on
One at a time simultaneously (although we don’t want s1 and s0 to activate one of our outputs.’
The way we’ve been thinking about to get into that here). However, we would Having this enable signal allows us
things based on the truth table in Fig.8a still have our original ‘single ghosting’ to use the control sequence presented
and the sequences discussed in Fig.9b problem, and neither of these techniques in Fig.9d. This solution addresses all
and Fig.9c is that the inputs to our 2:4 would protect us from another potential the ghosting and over-current issues
decoder will transition as follows: 00, ‘gotcha’ resulting from gate-level delays. we introduced earlier. However, there’s
01, 10, 11, 00… In turn, this means we a fly in the soup and an elephant in the
are activating our displays in the order Don’t delay room (I never metaphor I didn’t like).
D0, D1, D2, D3, D0… We often fall into another trap – that Remember that we started off using 4
Unfortunately, this leads us to fall of thinking our primitive logic gates of the Arduino’s pins to directly drive
into the trap of thinking that both switch instantaneously. In the real world, our transistors. Then we moved to using
inputs to our 2:4 decoder will change however, there’s always some element of only 2 of the Arduino’s pins to drive
simultaneously. Thus far, however, we’ve delay. Just to make things a little simpler, our 2:4 decoder, which freed up 2 pins,
learned how to change only one of our let’s perform a thought experiment. Let’s but caused us to run into ghosting and
Arduino’s digital outputs at a time. imagine we have only two displays and other issues. By adding the enable to

Practical Electronics | July | 2024 53


implementation shown in Fig.8c. To
en s 1 s 0 y3 y2 y1 y0 s1
& y3 do this, we will need a hex inverter
0 X X 0 0 0 0 y3 s1 in the form of an SN7404 (Fig.13a)
& y2
1 0 0 0 0 0 1 F rom s 1 y2 To and a quadruple 2-input AND in
2:1 s0
1 0 1 0 0 1 0 Arduino s 0 y1 T ransisto rs & y1 the form of a SN7408 (Fig.13b).
s0
1 1 0 0 1 0 0 y0 & y0 Both these devices are available in
1 1 1 1 0 0 0 14-pin breadboard-mountable dual
en en
in-line (DIL) packages. You can also
(a) T ruth Table (b) S ymbol (c) G ate-level implementation
access downloadable data sheets:
7404 (https://bit.ly/44Rs3bb) and
Fig.11. 2:4 decoder with active-high enable and active-high outputs.
7408 (https://bit.ly/3UwuCKV) on
the interweb.
the 2:4 decoder, we are now using 3 of means we can turn them all off before You can order these chips individually
the Arduino’s pins, leaving only 1 pin we modify the values on the inputs to if you wish, or you could opt for a
free, which prompts us to ask, ‘Is all our 2:4 decoder. When all the segments small kit containing two each of the
this worth the effort?’ are off, it doesn’t matter if we transition ten most popular 74LS devices, such as
The answer to this question is, ‘It through intermediate input values or if the Bridgold set on Amazon (https://bit.
all depends.’ If having a free pin is the decoder’s gate delays cause multiple ly/3wqgzyv). Note that the ‘LS’ portion
mission-critical and this is the only transistors to be activated, because all we of their monikers stands for ‘low-power
way to get it, then the answer would are displaying is… a blank. This means Schottky,’ but that’s not something we
be ‘Yes.’ Otherwise, we might have to that if we were to add a 2:4 decoder to need to concern ourselves with here.
think about living without the decoder. our current circuit, we would employ The plastic packages typically have
the sequence depicted in Fig.9e. a small semicircular notch at one end
Drawing a blank Now, you may be thinking that our between pins 1 and 14 as shown in
Are you drawing a blank with respect rambling 2:4 decoder discussions serve Fig.13. Alternatively, they may have a
to the second solution that will address no purpose, to which I would respond: dimple next to pin 1. Either way makes it
both our sequencing and our gate-delay- (a) it’s all curious James’s fault for asking easy to determine which pins are which.
induced problems? If so, that would the question in the first place and (b) N e x t , l e t ’s u s e t h e g a t e - l e v e l
be ironic, because ‘drawing a blank’ you may be surprised how the problems implementation from Fig.8c and our
is the solution. and solutions we’ve talked about here knowledge of the chip pins from Fig.13
Let us now return to our current pop up again in the future. to create a schematic (Fig.14).
implementation, but we’ll assume it’s It’s common to use the character ‘U’
been augmented with a simple 2:4 What the heck! to indicate an integrated circuit in a
decoder (without an enable) as illustrated I fear that I can no longer be trusted. schematic (we are saying that U1 is our
in Fig.12 (observe that we now enjoy Why? Well, earlier I said that we were SN7404 and U2 is our 7408). In the case
two free pins). just spitballing ideas and we weren’t of this sort of logic, sometimes we might
Do you remember earlier when we said: really going to deploy a 2:4 decoder. show the entire package as a single
‘For the moment, let’s assume that we are However, looking at Fig.12 has given me symbol. Other times we may show the
always driving the segments associated an uncontrollable urge to do just that. individual gates, in which case we add a
with one of the digits 0 through 9.’ I’m I just glanced at my trusty Texas number or letter to indicate which gate
afraid this was a bit of a hareng rouge Instruments TTL Data Book (Second in the package we are talking about (eg,
(‘red herring’). Edition) from 1981 – a classic, do yourself U2.1 is the gate in the 7408 with signals
As we know, we currently have a favour and get one. The SN74139 1A, 1B, and 1Y; U2.2 is the gate with
total control of all the segments. This is a 16-pin device containing two 2:4 signals 2A, 2B, and 2Y; etc.). The pin
decoders, and they numbers provide a further clue.
even have enables Now, let’s add these devices to our
Displ ay segments
C onnection No connection G round (0V )
and pin numbers if we wanted to use breadboard-based clock (Fig.15) and wire
them, but they have them up as per our schematic (Fig.14).
active low outputs, I’ve updated our master drawing to reflect
which is opposite to these changes (file CB-Jul24-02.pdf).
what we want. We will talk about the four unexpected
D3 D2 D1 D0 5 10 9 1 2 4 6 7 Also, it will be resistors in a moment, but first…
DP G F E D C B A more fun to replicate Sometimes when you look at a gate-
the gate-level level schematic of a circuit board like

3 3 3 3
(+5V ) (+5V ) (+5V ) (+5V )
C C C C
V CC V6ACC 6A
6Y 6Y
5A 5A
5Y 5Y
4A 4A
4Y 4Y V CC V4BCC 4B
4A 4A
4Y 4Y
3B 3B
3A 3A
3Y 3Y
B B B B
14 14
13 13
12 12
11 11
10 10
9 98 8 14 14
13 13
12 12
11 11
10 10
9 98 8
E E E E

& & & &

y3 y2 y1 y0
& & & &
2:1
s1 s0
F ree 1 12 23 34 45 56 67 7 1 12 23 34 45 56 67 7
1A 1A
1Y 1Y
2A 2A
2Y 2Y
3A 3A
3Y G3Y
ND G ND 1A 1A
1B 1B
1Y 1Y
2A 2A
2B 2B
2Y G2Y
ND G ND
13 12 11 10 9 8 7 6 5 4 3 2
(0V ) (0V ) (0V ) (0V )
Arduino pin numbers
(a) SN7404
(a) SN7404 (b) SN7408
(b) SN7408

Fig.12. Current circuit augmented by 2:4 decoder. Fig.13. Chip packages.

54 Practical Electronics | July | 2024


4
Connection 6
5 & y3
No connection
U2.2
1 2 1
3
U1.1 2 & y2
s1
Pin 11 U2.1 To transistors
12
From 5 6 11
Arduino 13 & y1
U1.3
s0 U2.4
P in 10
10
8
U1 = 7404 9 & y0
U2 = 7408
U2.3

Fig.14. Gate-level schematic for 2:4 decoder.

D3 D2 D1 D0 To displays

7408 7404

From Arduino 11 (s1) 10 (s0)

Listing 3a. Modifications to use 2:4 decoder. Fig.15. Wiring up the chips on the breadboard.

Fig.14, you wonder as to the rationale the outputs on our unused gates aren’t In some situations, we may be using
behind the way in which the designer connected to anything via wires, such a gate or a more complex function, but
selected which gates in which chips oscillations may result in noise in the not employing all its inputs. In such
were to be connected to which wires. form of electromagnetic interference cases (unless stated otherwise in the
Why did I use U2.3, U2.4, U2.1, and (EMI) that can affect other signals nearby. data sheet), it’s imperative that we apply
U2.2 to drive signals y0, y1, y2, and Happily, the chances of this being appropriate resistors to place these pins
y3, respectively, for example? a problem are extremely slight in our in appropriate states. If we are using
Oftentimes, the answer is more case, not least because of the SN74LSxx only two inputs to a 3-input AND gate,
pragmatic than you might expect – it technology we are using. On the other for example, we would use a pull-up
facilitates the physical layout in some hand, I’m trying to teach you good resistor on the unused input (a pull-
way. In this case, I wanted to be able practices, and it’s a good idea to get down would force the AND’s output to
to draw the wires associated with our into the habit of tying off unconnected
chips in such a way that they didn’t inputs, so that’s what we are going to do.
cross over, which would have made In a scenario where gates are totally
things harder for you to comprehend. unused, as in our example, it’s often up to
the designer to decide between attaching (+5V )

Feeling unconnected? pull-up or pull-down resistors to their V CC 6Y 5Y 4Y


14 13 12 11 10 9 8
One final point worth noting before we inputs (remember that they are the same
fire up our new implementation is that resistors; the ‘up’ and ‘down’ qualifiers
we are using only two of the six inverters are used to remind ourselves what we are
(NOT gates) in our SN74LS04 package. doing with them). In this case, I favour
In a real-world design intended for using pull-down resistors to ground.
production, we would typically use pull- Also, it’s usually the designer’s
up or pull-down resisters to connect any choice as to the value of resistors to 1 2 3 4 5 6 7
unused input pins to power or ground, use. Anything 1kΩ or higher is typically 1A 1Y 2Y 3A 3Y G ND
(0V )
respectively (Fig.16). good. I personally favour 10kΩ resistors
Why? Well, there’s a faint possibility (brown-black-orange). I have friends s1 s1 s0 s0
that an unconnected input, which may (seriously) who opt for 2.2kΩ (red-red-
‘float’ up and down, could result in red) or 4.7kΩ (yellow-purple-red). In the
that NOT gate undergoing uncontrolled case of a cheap-and-cheerful prototype,
oscillations, and an oscillating gate you may end up using whatever you Fig.16. Unconnected inputs connected to
consumes power. Also, even though have to hand. ground via pull-down resistors.

Practical Electronics | July | 2024 55


0). Alternatively, if we are using only two inputs to a 3-input
OR gate, we would use a pull-down resistor on the unused Components from Part 1
input (a pull-up would force the OR’s output to 1). LEDs (assorted colours) https://amzn.to/3E7VAQE
Resistors (assorted values) https://amzn.to/3O4RvBt
Let’s rock and roll! Solderless breadboard https://amzn.to/3O2L3e8
I just forked the latest and greatest program from our previous Multicore jumper wires (male-male) https://amzn.to/3O4hnxk
column (PE, June 2024), edited it, and made it available for
your perusing pleasure (file CB-Jul24-03.txt). Components from Part 2
Let’s skim through the minor changes before we look at 7-segment display(s) https://amzn.to/3Afm8yu
the tasty part. We’ve removed our TRAN_ON and TRAN_OFF Components from Part 5
definitions because we are no longer driving the transistors Momentary pushbutton switches https://amzn.to/3Tk7Q87
directly. Similarly, we’ve replaced our PinsTrans[]
array in which we specified the four pins used to drive Components from Part 6
our transistors with two independent definitions for our Passive piezoelectric buzzer https://amzn.to/3KmxjcX
decoder select controls: Components for Part 9
SW-18010P vibration switch https://bit.ly/46SfDA4
int PinS0 = 10;
int PinS1 = 11; Components for Part 10
Breadboard mounting trimpots https://bit.ly/3QAuz04
There are a few more minor tweaks of this ilk, but the big Components for Part 12
change takes place in our loop() function, as illustrated in Light-Dependent Resistor https://bit.ly/3S2430m
Listing 3a.
To be honest, apart from the line numbers themselves, Components for Part 13
the statements associated with Lines 71 through 89 remain BC337 NPN Transistor https://bit.ly/40xAgyS
unchanged. The only new part takes place when we come to Components for Part 14
output our HH:MM data to the displays in Lines 92 through 99. HC-SR04 Ultrasonic Sensor https://bit.ly/49AMBq4
What we are doing is implementing the sequence shown
in Fig.9e: Turn all segments off (Line 94) → Set 2:4 inputs Components for Part 15
(Lines 95 and 96) → Set new segment values (Line 97) → Real-Time Clock (RTC) https://bit.ly/3S9OjHl
Delay 2ms (Line 98). Components for Part 18
Most of this is achieved by reusing and reordering statements Long tailed (0.1-inch pitch) https://bit.ly/3U1Vp2z
we’ve seen before. The only new part occurs on Lines 95 header pins
and 96 when we set the 2:4 input signals. To understand
this, we first need to remind ourselves that we previously Components for Part 19
made the decision to activate our displays in the sequence Prototyping boards https://bit.ly/3UMkcZ1
D0, D1, D2, D3 (we could have done it the other way round, Kit of popular SN74LS00 chips https://bit.ly/3wqgzyv
but this was easier).
To achieve this with our new circuit, we want the s1-s0
signals driving the inputs to our 2:4 decoder to follow the What this means is that this operation will return 00000000
sequence 00, 01, 10, 11 (Fig.8a, Fig.14, and Fig.15). (0) when iDisp is 0 or 2, and 00000001 (1) when iDisp is
As part of our for() loop declaration on Line 92, our integer 1 or 3. Remembering that 0 and 1 are equivalent to LOW and
iDisp variable cycles through the values 0, 1, 2 and 3. In the HIGH, respectively, these are the values we are writing to our
case of the Arduino Uno, variables of type int (integer) are 2:4 decoder’s s0 input.
16 bits wide. Let’s consider the binary values of the least- Now consider the following portion of Line 96:
significant eight bits in the context of our counting sequence
(the most-significant eight bits will all be 0s). (iDisp >> 1) & B0000001

iDisp Binary This starts by using the >> bitwise shift right operator to shift
0 ≡ 00000000 the value from iDisp one bit to the right (again, this doesn’t
1 ≡ 00000001 modify the value stored in iDisp because we aren’t assigning
2 ≡ 00000010 anything to iDisp). The original least-significant bit ‘falls
3 ≡ 00000011 off the end’ and a 0 is shifted into the new most-significant
bit. What this means is that, following the >> operation, we
The math symbol ≡ means ‘equivalent to’ or ‘identical to.’ have the following intermediate value to play with:
We discussed how to use the bitwise operators as masks in a
previous Cool Beans (PE, March 2021). These are the techniques iDisp Binary after >> 1
we are using here. Consider the following portion of Line 95: 0 ≡ 00000000
1 ≡ 00000000
iDisp & B0000001 2 ≡ 00000001
3 ≡ 00000001
Since we are using a bitwise & (AND) operator, any 0s in our
Bxxxxxxxx value will return 0s in the corresponding positions When we subsequently perform the bitwise & (AND) operation,
in the result. By comparison, any 1s in our Bxxxxxxxx value we will see 00000000 (0) when iDisp is 0 or 1, and 00000001 (1)
will return whatever 0 or 1 value
is in the corresponding bit of Cool bean Max Maxfield (Hawaiian shirt, on the right) is emperor of all he
iDisp (note that this doesn’t surveys at CliveMaxfield.com – the go-to site for the latest and greatest
modify the contents of iDisp in technological geekdom.
because we aren’t assigning
Comments or questions? Email Max at: [email protected]
anything to iDisp).

56 Practical Electronics | July | 2024


when iDisp is 2 or 3, and these are the values we are writing
to our 2:4 decoder’s s1 input. Online resources
There are a couple of things to note here. The first is that For the purposes of this series, I’m going to assume
the following two statement return identical results: that you are already familiar with fundamental con-
cepts like voltage, current and resistance. If not, you
(iDisp >> 1) & B0000001 might want to start by perusing and pondering a short
iDisp >> 1 & B0000001 series of articles I penned on these very topics – see:
https://bit.ly/3EguiJh
This is because the >> (bitwise shift) operator has a higher Similarly, I’ll assume you are no stranger to solder-
precedence than the & (bitwise AND) operator (for further less breadboards. Having said this, even if you’ve used
details on this, I recommend C/C++ Operator Precedence these little scamps before, there are some aspects to
at: https://bit.ly/3wH8w06). Personally, I prefer to use ( ) them that can trap the unwary, so may I suggest you
parentheses to (a) force the precedence I want and (b) to make feast your orbs on a column I wrote just for you – see:
it clear what I expect to occur to anyone reading my code https://bit.ly/3NZ70uF
(including me) in the future. Last, but not least, you will find a treasure trove of
The second point is that we don’t really need to perform the resources at the Arduino.cc website, including exam-
shift at all. For example, although the following statements ple programs and reference documentation.
return different results, these values will result in the same
action in the context of our program: Next time…
I’m afraid I’ve told two untruths (my mother won’t be happy).
(iDisp >> 1) & B0000001 As you may recall, at the end of our previous column, I
iDisp & B0000010 said: ‘In our next column, we really and truly are going to
refresh our minds as to the concept of binary-coded decimal
This is because the digitalWrite() function will set the (BCD) and then investigate various deployments of BCD-to-
output to 0 (off, LOW) if it is presented with a value of 0 (zero), 7-segment decoders in our clock (otherwise my name’s not
and it will set the output to 1 (on, HIGH) if it is presented Max the Magnificent).
with any other (non-zero) value of 1 or more. The first untruth is that I failed in my BCD quest (we’ll
I just ran our new program, and… ran into a WTW (‘what cover that next time). The second untruth is that my name is
the what?’) problem with one of my breadboards. I’ll tell you indeed Max the Magnificent, because that’s what appears as
about this in my next column. Suffice it to say that, once I’d my moniker on Zoom calls and name badges when I attend
sorted my wayward breadboard, our 2:4 decoder-based clock technical conferences, and you can’t argue with logic like
performed like a dream (happy dance). that! Until next time, have a good one!

STEWART OF READING
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
Fluke/Philips PM3092 Oscilloscope HP 54600B Oscilloscope
(ALL PRICES PLUS CARRIAGE & VAT)
2+2 Channel 200MHz Delay TB, Analogue/Digital Dual Trace 100MHz
Autoset etc – £250 Please check availability before ordering or calling in
Only £75, with accessories £125
LAMBDA GENESYS PSU GEN100-15 100V 15A Boxed As New £400 Marconi 2305 Modulation Meter £250
LAMBDA GENESYS PSU GEN50-30 50V 30A £400 Marconi 2440 Counter 20GHz £295
IFR 2025 Signal Generator 9kHz – 2.51GHz Opt 04/11 £900 Marconi 2945/A/B Communications Test Set Various Options POA
IFR 2948B Communication Service Monitor Opts 03/25 Avionics POA Marconi 2955 Radio Communications Test Set £595
IFR 6843 Microwave Systems Analyser 10MHz – 20GHz POA Marconi 2955A Radio Communications Test Set £725
R&S APN62 Syn Function Generator 1Hz – 260kHz £295 Marconi 2955B Radio Communications Test Set £800
Agilent 8712ET RF Network Analyser 300kHz – 1300MHz POA Marconi 6200 Microwave Test Set £1,500
HP8903A/B Audio Analyser £750 – £950 Marconi 6200A Microwave Test Set 10MHz – 20GHz £1,950
HP8757D Scaler Network Analyser POA Marconi 6200B Microwave Test Set £2,300
HP3325A Synthesised Function Generator £195 Marconi 6960B Power Meter with 6910 sensor £295
HP3561A Dynamic Signal Analyser £650 Tektronix TDS3052B Oscilloscope 500MHz 2.5GS/s £1,250
HP6032A PSU 0-60V 0-50A 1000W £750 Tektronix TDS3032 Oscilloscope 300MHz 2.5GS/s £995
HP6622A PSU 0-20V 4A Twice or 0-50V 2A Twice £350 Tektronix TDS3012 Oscilloscope 2 Channel 100MHz 1.25GS/s £450
HP6624A PSU 4 Outputs £400 Tektronix 2430A Oscilloscope Dual Trace 150MHz 100MS/s £350
HP6632B PSU 0-20V 0-5A £195 Tektronix 2465B Oscilloscope 4 Channel 400MHz £600
HP6644A PSU 0-60V 3.5A £400 Farnell AP60/50 PSU 0-60V 0-50A 1kW Switch Mode £300
HP6654A PSU 0-60V 0-9A £500 Farnell XA35/2T PSU 0-35V 0-2A Twice Digital £75
HP8341A Synthesised Sweep Generator 10MHz – 20GHz £2,000 Farnell AP100-90 Power Supply 100V 90A £900
HP83630A Synthesised Sweeper 10MHz – 26.5 GHz POA Farnell LF1 Sine/Sq Oscillator 10Hz – 1MHz £45
HP83624A Synthesised Sweeper 2 – 20GHz POA Racal 1991 Counter/Timer 160MHz 9 Digit £150
HP8484A Power Sensor 0.01-18GHz 3nW-10µW £75 Racal 2101 Counter 20GHz LED £295
HP8560E Spectrum Analyser Synthesised 30Hz – 2.9GHz £1,750 Racal 9300 True RMS Millivoltmeter 5Hz – 20MHz etc £45
HP8563A Spectrum Analyser Synthesised 9kHz – 22GHz £2,250 Racal 9300B As 9300 £75
HP8566B Spectrum Analsyer 100Hz – 22GHz £1,200 Solartron 7150/PLUS 6½ Digit DMM True RMS IEEE £65/£75
HP8662A RF Generator 10kHz – 1280MHz £750 Solatron 1253 Gain Phase Analyser 1mHz – 20kHz £600
Marconi 2022E Synthesised AM/FM Signal Generator 10kHz – 1.01GHz £325 Solartron SI 1255 HF Frequency Response Analyser POA
Marconi 2024 Synthesised Signal Generator 9kHz – 2.4GHz £800 Tasakago TM035-2 PSU 0-35V 0-2A 2 Meters £30
Marconi 2030 Synthesised Signal Generator 10kHz – 1.35GHz £750 Thurlby PL320QMD PSU 0-30V 0-2A Twice £160 – £200
Marconi 2023A Signal Generator 9kHz – 1.2GHz £700 Thurlby TG210 Function Generator 0.002-2MHz TTL etc Kenwood Badged £65

HP33120A Function Generator 100 microHz – 15MHz £350


HP53131A Universal Counter 3GHz Boxed unused £600
HP53131A Universal Counter 225MHz £350
Audio Precision SYS2712 Audio Analyser – in original box POA
Datron 4708 Autocal Multifunction Standard POA
Druck DPI 515 Pressure Calibrator/Controller £400
Datron 1081 Autocal Standards Multimeter POA
ENI 325LA RF Power Amplifier 250kHz – 150MHz 25W 50dB POA
HP/Agilent HP 34401A Digital Keithley 228 Voltage/Current Source POA Marconi 2955B Radio
Multimeter 6½ Digit £325 – £375 Time 9818 DC Current & Voltage Calibrator POA Communications Test Set – £800

Practical Electronics | July | 2024 57


Teach-In 2024
Learn electronics with
the ESP32 by Mike Tooley
Part 5 – Sensing the environment

I
n the previous part of our Teach-In series, we
introduced seven-segment and matrix LED displays. We About Teach-In
also introduced the SPI interface as a means of interfacing a Our latest Teach-In series is about using the popular ESP32
wide variety of peripheral devices. Coding Workshop showed module as a basis for learning electronics and coding. We
you how to generate and use random numbers and our Teach- will be making no assumptions about your coding ability
in Project featured the design, construction and coding of a or your previous experience of electronics. If you know one
but not the other, you have come to the right place. On
simple dice roller using a low-cost motion sensor as a trigger.
the other hand, if you happen to be a complete newbie
This month, we will introduce two more interface standards there’s no need to worry because the series will take a
that simplify communication between the ESP32 and external progressive hands-on approach. There will be plenty of
hardware. We begin by introducing a range of low-cost temperature time to build up your knowledge and plenty of opportunity
and humidity sensors that can be used in projects that need to sense to test things out along the way.
conditions in the surrounding environment. Coding Workshop We’ve not included too much basic theory because this
looks at maths operators and functions and our Practical Project can be easily found elsewhere, including several of our
shows how easy it is to add an LCD display to your designs. previous Teach-In series, see:
The learning objectives for the fifth part of our series are https://bit.ly/pe-ti
know how to use: https://bit.ly/pe-ti-bundle
n 1-wire and I2C interfaces to connect external hardware Earch month, there’ll be projects and challenges to help you
n Temperature, humidity and other environmental sensors check and develop your understanding of the topics covered.
n Low-cost I2C LCD displays.
Unmounted DHT22 (and DHT11) sensors) are supplied
The DHT22 temperature and humidity sensor in a 4-pin package. They are also available as small,
A variety of temperature and humidity sensors have become printed circuit modules with a few additional components
available for use in a wide range of situations where there is a that enable them to be used in stand-alone applications
need to sense, monitor and control the environment. Typical where only three connections are required to a host
applications include heating, ventilation and air-conditioning microcontroller: positive supply, data and ground (negative
(HVAC), dehumidifiers and humidity regulators, weather supply).
stations and data loggers, and vehicle environmental control. The DHT devices use the 1-wire bus for communication
We will start this part of Teach-In by introducing some between the sensor and a microcontroller. Sensed values
popular temperature and humidity sensors, namely: the DHT11 of temperature and humidity are sent as serial data using
(RHT01) and DHT22 (RHT02 or AM2302). the single wire connection. The sensor remains in a
standby (low-power) mode until the
host controller generates a start signal
comprising a logic 0 (LOW) for at least
0.5ms, followed by a logic 1 (HIGH).
When this signal is received, the sensor
enters operational mode and responds
with a serial stream comprising five
bytes (40 bits) of data. This data
consists of two bytes of RH data (high
byte followed by low byte), two bytes of
temperature data (high byte followed
by low byte), and a checksum used to
verify the data. A typical example of
the serial data for a DHT22 sensor is
Fig.5.1. A wide variety of low-cost sensors are available for use with the ESP32. They shown in Table 5.1.
include sensors for temperature, humidity, barometric pressure, and UV as well as the The checksum is found by adding
popular DHT11 and DHT22 types (centre). the preceding four bytes of data. So, in

58 Practical Electronics | July | 2024


Table 5.1 Data format for a DHT22 sensor Check it out!
The 1-wire interface to
Item RH data (16 bits) Temperature data (16 bits) Checksum (8 bits) HSPI pin no. a DHT22 (or similar)
sensor is delightfully
Binary data 00000010 11101000 00000001 01101111 01011010 14
simple and requires
Decimal equiv 744 367 13 just three connections,
Value indicated 74.4% 36.7°C 12 as shown in Fig.5.2.
Asynchronous data
Table 5.2 Data format for a DHT11 sensor is transferred via
the ESP32’s in-built universal
Item RH data (16 bits) Temperature data (16 bits) Checksum (8 bits) asynchronous receiver transmitter
(UART). This is often labelled ‘RX2’
Binary data 00000000 01011001 00000000 00011001 01110010 on ESP32 development boards.
Decimal (×1) 89 25 Representative breadboard and
wiring layouts are shown in Fig.5.3
Value indicated 89% 25°C and Fig.5.4.

this case, the checksum is determined


as follows:
0000 0010 (RH data high byte)
+ 1110 1000 (RH data low byte)
+ 0000 0001 (temp data high byte)
+ 0110 1111 (temp data low byte)
______________
0101 1010 (checksum)
______________

Note that when the leading bit of the


temperature data is set (ie, 1) this signifies
a temperature below zero (ie, a negative
temperature value). Note also that the
data format used for the less accurate
DHT11 sensor uses only the two low
data bytes (the high bytes are all zero). Fig.5.3. Breadboard layout for testing a DHT22 temperature and humidity sensor.
The value of the low byte is decoded
directly to produce integer values – see
Table 5.2 for an example.
DHT11 and DHT22 (and equivalent)
temperature and humidity sensors are
laboratory calibrated and calibration
data is stored in one-time programmable
(OTP) memory. These sensors can be
reliably used at distances of up to 20m
from the host microcontroller.
For an overview of DHT11 and DHT22
specifications see Table 5.3.

Gotcha!
Take care when RH measurements
are made in environments where Fig.5.4. Breadboard wiring for the DHT22.
airborne contaminants and gases
are present. Table 5.3 DHT11 and DHT22 specifications

Characteristic DHT11 DHT22


Characteristic DHT11 DHT22
Temperature range 0 to +50°C -40 to +80°C
Humidity range 20 to 90% RH 0 to 100% RH
Accuracy (temperature) Better than ±2°C Better than ±0.5°C
Accuracy (humidity) Better than ±5% RH Better than ±1% RH
Fig.5.2. The minimal interconnection Sensing period 1s (minimum) 2s (average)
required to interface a DHT22
temperature and humidity sensor to an Supply voltage 3 to 5.5V DC 3.3 to 6V DC
ESP32 development board (serial data is
Supply current 2.5mA max. (150µA standby) 1.5mA max. (50µA standby)
transferred using the ESP32’s UART).

Practical Electronics | July | 2024 59


Listing 5.1 Testing the DHT22 temperature and Listing 5.2 Sample code for the thermostatic controller
humidity sensor with an ESP32 /* ESP32 environmental controller
/* ESP32 test with DHT22 sensor */ using a DHT11 temperature and humidity
sensor */
// Include the library file
#include <dhtnew.h> #include <dhtnew.h> // Library file

DHTNEW mySensor(16); // RX2 input // Define GPIO pins


const int HeaterRelay = 22;
void setup() const int FanRelay = 23;
{ int LowThreshold = 15;
Serial.begin(115200); int HighThreshold = 25;
// Print headings
Serial.print(“Temp.(C)”); DHTNEW mySensor(16); // UART RXD input
Serial.println(“Humidity(%)”);
} void setup() {
Serial.begin(115200);
void loop() // Set relay pins as outputs
{ pinMode(HeaterRelay, OUTPUT);
// Read the sensor and then display the data pinMode(FanRelay, OUTPUT);
mySensor.read(); // Initialise relays in off condition
Serial.print(mySensor.getTemperature(), 1); digitalWrite(HeaterRelay, HIGH);
Serial.print(“\t”); digitalWrite(FanRelay, HIGH);
Serial.println(mySensor.getHumidity(), 1); }
delay(5000); // Wait two seconds
} void loop() {
// First read the sensor
mySensor.read();
Serial.print(“Temperature: “);
Gotcha! Serial.print(mySensor.getTemperature(), 1);
There’s some variation in pin connections and marking Serial.print(“ deg.C\t”);
on temperature and humidity modules. Some boards Serial.print(“Humidity: “);
seem to have no pin markings at all. An inadvertent Serial.print(mySensor.getHumidity(), 1);
reverse supply connection can quickly destroy the Serial.print(“ %\t”);
sensor’s 8-bit processor so it’s important to check // Then display the returned data
pin connections and wiring before applying power! if (mySensor.getTemperature() < LowThreshold) {
digitalWrite(HeaterRelay, LOW);
Serial.print(“Heat ON “);
The code for testing the DHT22 is shown in Listing } else {
5.1. Before executing the code you will need to use digitalWrite(HeaterRelay, HIGH);
the IDE’s Library Manager to locate and download the Serial.print(“Heat OFF “);
required library, dhtnew.h. We’ve included this library }
in our code using the following line: if (mySensor.getTemperature() > HighThreshold) {
digitalWrite(FanRelay, LOW);
#include <dhtnew.h> Serial.println(“Fan ON “);
} else {
digitalWrite(FanRelay, HIGH);
The code in Listing 5.1 reads temperature and humidity Serial.println(“Fan OFF “);
data from the DHT22 module every four seconds. The }
data is then sent and displayed via the Serial Monitor.
Fig.5.5 shows some typical data from the Serial Monitor. delay(1000); // Wait for 1 second
}
A thermostatic controller
Now let’s look at a practical application for a DHT
sensor in the form of a simple greenhouse controller.

Since we don’t need a high


order of accuracy and wide
temperature range, we will
make use of a cheaper
DHT11 sensor (see Table 5.3
for a comparison of these
two sensors).
We will use the ESP32 to
control two relays; one will
operate a heater when the
ambient temperature falls
below a pre-determined
level (the low threshold)
and the other will operate
a fan when the temperature
Fig.5.5. Typical Serial Monitor data values exceeds a second pre-
obtained from Listing 5.1. Fig.5.6. Circuit for the ESP32 thermostatic controller. determined level (the high

60 Practical Electronics | July | 2024


that we’ve defined the low threshold as
15°C and the high threshold as 25°C (a
target temperature range of 10°C). These
values can of course be changed to suit
individual requirements.

The I2C bus


In Teach-In Part 4 we showed how the
serial peripheral interface bus (SPI)
allows you to connect a wide variety of
external devices to an ESP32. In addition
to SPI, the ESP32 supports another
useful method of connecting to the
outside world using the ‘Inter-Integrated
Circuit’ interface (abbreviated variously
to IIC, I2C, I2C (spoken ‘I-squared-C’).
This is a good point to introduce I2C
as we will shortly be using it to attach
a low-cost LCD panel to display your
temperature and humidity data.
I2C is a simple bus system in which
bidirectional data appears on a single
Fig.5.7. Breadboard layout for the ESP32 thermostatic controller. line (SDA) and a clock signal is sent on a
second bus line (SCL). Contrast this with
threshold). The aim of the thermostatic controller is to SPI, which offers a point-to-point connection where data is
maintain the environment’s ambient temperature within a passed in and out on separate lines (MOSI and MISO). SPI
range bounded by the two thresholds. is faster and generally easier to use than I2C but there are
The circuit of the ESP32 thermostatic controller is shown many situations in which I2C is preferred simply because
in Fig.5.6. The relay modules are interfaced to the ESP32 the interface is built into the chip that you need to use.
using GPIO pins initialised for digital operation (see Teach- I2C was the brainchild of Philips, but several of its
In Part 2 for further information). The DHT11 sensor module competitors (including Motorola/Freescale, NEC, Siemens,
is connected, as before, using the 1-wire interface. STM and Texas Instruments) have developed their own
A representative breadboard layout is shown in Fig.5.7 I2C compatible products. In addition, Intel’s SMBus
and a practical wiring arrangement in Fig.5.8. Note that, to provides a stricter definition of I2C intended to improve the
simplify interconnection and aid prototype manufacture, interoperability of I2C devices from different manufacturers.
we’ve used a popular low-cost ESP32 expansion board in this A representative SPI bus arrangement is illustrated in
arrangement. Expansion boards are relatively inexpensive Fig.5.9. Note that this system comprises two bus masters
and can be particularly useful as an interim stage between and three bus slaves. A microcontroller (eg, an ESP32)
breadboard and final PCB layout. takes the role of master, while devices such as sensors and
Sample code for the thermostatic controller is shown in displays assume the role of slave.
Listing 5.2. You should have already located and installed Since the data line (SDA) is shared between multiple
the required library file (see earlier). For test purposes, we’ve devices, I2C needs a system of addressing to identify the
included status messages for the Serial Monitor. These, device that it needs to communicate with. Communication
together with the LED indicators on the two relay modules, is initiated by means of a unique start sequence which
will allow you to confirm operation of the controller. Notice involves pulling the data line (SDA) low while the clock
line (SCL) is high. This can be achieved by using very
simple bus interface logic where each of the bus lines are
normally pulled high and driven low when activated by a
device connected to the bus (see Fig.5.10).
Following the start sequence, transmitted data is only allowed
to change when the clock is in its low state. In its basic form,
and by virtue of the seven bits available for addressing, the
I2C protocol caters for a total of 127 devices. In addition to
the seven bits used for addressing, the first byte of an I2C
transfer generated by a ‘master’ includes a bit that indicates the

Fig.5.8. Wiring for the thermostatic controller based on a Fig.5.9. A representative I2C bus with two bus masters and
popular ESP32 expansion board. three slaves present.

Practical Electronics | July | 2024 61


Table 5.4 A selection of common I2C devices

Device Application Manufacturer I2C address


ADS1015 4-channel 12-bit ADC Texas Instruments 0x2c to 0x2f
ADS1115 4-channel 16-bit ADC Texas Instruments 0x48 to 0x4b
ADXL345 3-axis accelerometer Analog Devices 0x1d, 0x53
AHT10 Temperature and humidity sensor Asair 0x38
AHT20 Temperature and humidity sensor Asair 0x38
BMA180 Accelerometer Bosch 0x77
BME280 Temperature, pressure and humidity sensor Bosch 0x76, 0x77
BMP085 Barometric pressure sensor Bosch 0x77
BMP180 Temperature/barometric pressure sensor Bosch 0x76, 0x77
BMP280 Temperature/barometric pressure sensor Bosch 0x77
CCS811 Gas and air quality sensor ScioSense 0x5a, 0x5b
D7S Vibration sensor Omron 0x55
DS1307 Real-time clock Maxim 0x68
FS3000 Air velocity sensor Renesas 0x28
HT16K33 LED matrix driver Holtek 0x70 to 0x77
ITG3200 3-axis gyro InvenSense 0x68, 0x69
LTC4151 Voltage and current monitor ST Microelectronics 0x66 to 0x6f
MAX44009 Ambient light sensor Maxim 0x4a, 0x4b
MCP23017 I2C GPIO expander Microchip 0x20 to 0x27
MCP4728 4-channel 13-bit DAC Microchip 0x60 to 0x67
MPR121 12-point capacitive touch sensor NXP 0x5a to 0x5d
SAA1064 4-digit LED driver NXP 0x38 to 0x3b
TDA8421 Audio processor NXP 0x40, 0x41
TEA5767 Radio receiver NXP 0x60
TSL2561 Light sensor Texas Instruments 0x39, 0x49
VML6075 UV sensor Vishay 0x10

direction of the data transfer. The address is transferred with from the I2C scanner.) Note that I2C applications require
the most-significant bit first (see Fig.5.11). Table 5.4 lists just a the Wire.h (or equivalent) library and so we’ve included
small selection of currently available devices that support I2C. it (using #include) at the start of the code.

What’s connected? Practical Project


It’s useful to have a means of determining how many Now let’s move on with an I2C application that will send
I2C devices are present in a system as well as which I2C temperature and humidity data from a DHT22 sensor to a
addresses have been allocated. This is achieved using an low-cost LCD panel. With only two GPIO pins needed for
application known as an ‘I2C scanner’ along the lines of data transfer this leaves plenty of I/O available for use with
that shown in Listing 5.3. (Fig.5.12 shows some typical data other items of external hardware.

Fig.5.10. I2C bus interface logic.

62 Practical Electronics | July | 2024


Listing 5.3 A simple I2C scanner

/* Simple I2C scanner */

#include <Wire.h>

void setup() {
Serial.begin (115200);
Serial.println (); Fig.5.11. I2C bus transaction showing how first an address and
Serial.println (“Performing I2C scan ...”); then data is placed on the bus.
byte count = 0;

Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print (“I2C device found at: “);
Serial.print (“ 0x”); Fig.5.12. Typical Serial Monitor output when using the I2C
Serial.println (i, HEX); scanner in Listing 5.3.
count++;
} The circuit arrangement for the LCD and DHT22
} application is shown in Fig.5.13. This arrangement is based
// Scan complete so print total found
on a low-cost 16 × 2 LCD panel fitted with an I2C interface
Serial.print (“Scan completed. Found “);
Serial.print (count, DEC); (see Fig.5.14). Note that the interface is mounted on the
Serial.println (“ device(s).”); back of the LCD panel and has four connections: GND,
} VCC, SDA and SCL. SDA is used for data and SCL is used
for the clock signal.
void loop() { With the code in Listing 5.4 running, the breadboard
// Main code (if any) goes here wiring for the LCD and DHT22 application is shown in
} Fig.5.15. If required, the display backlight can be adjusted
using the small preset resistor (the square blue component
shown in Fig.5.14).
Listing 5.4 Sample code for the LCD temperature and You should notice that we’ve included two libraries at
humidity monitor the beginning of the code in Listing 5.4 using these lines:
* ESP32 with DHT22 and 16 x 2 LCD
#include <dhtnew.h> // To use the DHTxx sensor
to display temperature and humidity */
#include <LiquidCrystal_I2C.h> // To use the LCD
// Include the library files
#include <dhtnew.h>
#include <LiquidCrystal_I2C.h>
// Define the LCD parameters
int lcdColumns = 16;
int lcdRows = 2;
// Setup the LCD
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);
DHTNEW mySensor(16); // UART RXD input

void setup() {
Serial.begin(115200);
// Initialize LCD
lcd.init();
// Turn the backlight ‘on’
lcd.backlight();
}
Fig.5.13. Circuit arrangement for the LCD and DHT22 application.
void loop() {
// First read the sensor
mySensor.read();
// Now display on the LCD
lcd.setCursor(0, 0); // First row
lcd.print(“Temp: “);
lcd.print(mySensor.getTemperature(), 1);
lcd.print(“ deg.C”);
lcd.setCursor(0, 1); // Second row
lcd.print(“Humidity: “);
lcd.print(mySensor.getHumidity(), 1);
lcd.print(“%”);
delay(5000); // Wait for 5 seconds
lcd.clear();
}
Fig.5.14. I2C interface mounted on back of a 16 × 2 LCD display.

Practical Electronics | July | 2024 63


Fig.5.16. Output from the maths
operator code.

You should have already located and


installed the first of these two library
files. The other file can be downloaded
using the IDE’s Library Manager.

Coding Workshop
It’s time to do some maths! You’ve
already made use of some of the
operators that the C++ language
Fig.5.15. Breadboard wiring for the DHT22 and 16 × 2 LCD display. provides. They are + (addition), –
(subtraction), * (multiplication), and
/ (division). You will doubtless already be familiar with
Listing 5.5 Testing the math operators them – but if not, Listing 5.5 shows some code that might
act as a reminder.
// Checking math operators +, -, *, and / The Serial Monitor output of Listing 5.5 is shown in
Fig.5.16. The code in the main loop executes only once
void setup() {
and halts at while(1) (where it waits forever). Since we
// Start the Serial Monitor
Serial.begin(9600); don’t actually need a loop that’s repeated we could have
} simply placed all of the code in setup() which is only
ever executed once. In this case we would simply have
void loop() { an empty main loop. Notice also that we’ve used the tab
float x = 12.3; character (\t) to neatly space the Serial Monitor’s output.
float y = 45.6; As an example of using maths operators let’s consider
Serial.println(“Maths operators!”); temperature conversion from Celsius to Fahrenheit. This
Serial.print(“Added: \t\t”); can be easily achieved using these lines of code:
Serial.println(x + y);
Serial.print(“Subtracted: \t”);
degF = (degC * 1.8) + 32; // Convert deg.C to deg.F
Serial.println(x - y);
Serial.print(“Mulitiplied: \t”); degC = (degF - 32) / 1.8; // Convert deg.F to deg.C
Serial.println(x * y);
Serial.print(“Divided: \t”); The variables (degF and degC) are both declared as floats,
Serial.println(x / y); using these lines:
while(1); // Wait forever
} float degC; // Temperature in deg.C
float degF; // Temperature in deg.C

There’s something vrucial to be aware of


Table 5.5 Some useful maths functions from the Arduino Math library here. The order in which maths operators
are applied is vitally important. The
Result (when correct order of operations is brackets,
Function Returned value Notation
x = 2 and y = 2) orders (powers and roots), division,
multiplication, addition and subtraction.
sqrt(x) square root of x √x 1.41
You might recall this from your
sq(x) square of x x2 4.00 secondary school education as BODMA
pow(x, y) x raised to the power y xy 4.00 (or BOMDAS). Failing to use the correct
order can produce some very odd results!
log(x) natural logarithm of x (base e) ln(x) 0.69 The Arduino Math library (math.h)
log10(x) logarithm of x (base 10) log10(x) 0.30 includes some useful function for
manipulating numbers. Note that this
exp(x) e raised to the power x ex 7.39 library is part of the language core and
sin(x) sine of x sin(x) 0.91 it does not have to be installed (unlike
other library files that we’ve been using).
cos(x) cosine of x cos(x) -0.42
Some of the most useful functions are
tan(x) tangent of x tan(x) -2.19 summarised in Table 5.5.
fabs(x) absolute value of floating point x |x| 2 Now let’s suppose we need to
determine the power present in a load
fmod(x,y) floating point modulo of x divided by y x mod y 0 resistor from a measurement of the peak

64 Practical Electronics | July | 2024


Listing 5.6 Initial code for this month’s Teach-In challenge

/* ESP32 with AHT20, BMP280, and 20 x 4 LCD


displaying temperature, humidity, and pressure */

// Include the library files


#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <AHT20.h>
Fig.5.17. Required display format for this month’s Teach-In Challenge. #include <BMP280.h>
AHT20 aht20;
BMP280 bmp280;
voltage developed across it. The relationship between RMS
power, peak voltage and resistance is given by: // Define the LCD parameters
int lcdColumns = 20;
P = 0.5V2/R int lcdRows = 4;

Where P is the power in the load (in watts), V is the peak // Setup the LCD
voltage developed across the load (in volts), and R is the value LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);
of load resistance (in ohms). We will use floating point variable
(floats) for the three variables using the following declarations: void setup() {
Serial.begin(115200);
Wire.begin(); // Use the I2C bus
float loadR, peakV, loadP; // Declare the variables bmp280.begin();

We can then use the next line of code to perform the calculation: //Check if the AHT20 will acknowledge
if (aht20.begin() == false) {
loadP = (0.5 * sq(peakV)) / loadR; // Calculate the power Serial.println(“AHT20 not present!”);
while (1)
If, on the other hand, we just want to print the value returned ;
via the Serial Monitor then we could use this line: }
Serial.println(“AHT20 detected!”);
// Initialize LCD
Serial.println((0.5 * sq(peakV)) / loadR); // Print
lcd.init();
the power // Turn the backlight ‘on’
lcd.backlight();
}

void loop() {

// If a new measurement is available


if (aht20.available() == true) {
//Get the new temperature and humidity value
float temperature = aht20.getTemperature();
float humidity = aht20.getHumidity();
// Get the barometric pressure
uint32_t pressure = bmp280.getPressure();
// Now display on the LCD
// Your code must continue here!

Teach-In challenge
This month’s Teach-In challenge involves developing a device
that monitors temperature, humidity and barometric pressure,
and displays the current values on a 20 × 4 LCD display

Fig.5.18. Using I2C to interconnect the sensors, 20 × 4 LCD


display and ESP32.

Gotcha!
When performing calculations the order in which maths
operators are applied is vitally important. It’s always
worth checking carefully or splitting your calculations
into smaller chunks spread over several lines of code. Fig.5.19. Modified AHT20/BMP280 module cable (a 4-pin
header replaces one of the two connectors).

Practical Electronics | July | 2024 65


along the lines shown in Fig.5.17. We
suggest that you use three I2C devices
in the application: an AHT20 I2C
temperature and humidity sensor, a
BMP280 barometric pressure sensor,
and a 20 × 4 I2C LCD display.
Using I2C, it’s easy to interconnect
the sensor modules, display and ESP32.
In the layout shown in Fig.5.18 we’ve
used a combined AHT20/BMP280
module. This module is available from
various online suppliers and is often
supplied with a 4-way cable. A simple
way of attaching this to a breadboard
is by removing one of the connectors
and soldering a 4-pin male header
mounted on a small piece of stripboard
in its place (see Fig.5.19). The header
can then simply be plugged into the
breadboard in a suitable location (see
Fig.5.20). Note that the colours used for
the combined sensor module are not the
same as those shown for the breadboard
wiring in Fig.5.19. Additional wiring
will be needed is you are using separate Fig.5.20. Wiring diagram for this month’s Teach-In Challenge. Note that the combined
sensor module cable is not shown in this diagram.
AHT20 and BMP280 sensors.
In this challenge we’re going to leave get stuck, you can always download a and string manipulation and our Practical
you to develop the code, but we’ve solution from the PE website. Good luck! Project will feature a network-connected
provided you with some initial lines in temperature and humidity monitor.
Listing 5.6. The next task is completing Next month Finally, as we will have reached the half-
the code in the main loop. This should In Part 6, we will be showing you how to way point in our series, Checkpoint will
send the temperature, humidity and connect your ESP32 to a Wi-Fi network. provide you with a means of testing your
pressure data to the LCD panel. If you Coding Workshop will deal with strings ESP32 knowledge!

Your best bet since MAPLIN


Chock-a-Block with Stock
Visit: www.cricklewoodelectronics.com
Or phone our friendly knowledgeable staff on 020 8452 0161
Components • Audio • Video • Connectors • Cables
Arduino • Test Equipment etc, etc
JTAG Connector Plugs Directly into PCB!!
No Header! No Brainer!

Our patented range of Plug-of-Nails™ spring-pin cables plug directly


into a tiny footprint of pads and locating holes in your PCB, eliminating
the need for a mating header. Save Cost & Space on Every PCB!!
Solutions for: PIC . dsPIC . ARM . MSP430 . Atmel . Generic JTAG . Altera
Xilinx . BDM . C2000 . SPY-BI-WIRE . SPI / IIC . Altium Mini-HDMI . & More
Visit our Shop, Call or Buy online at:
www.cricklewoodelectronics.com
Visit our shop at:
www.PlugOfNails.com
020 8452 0161 40-42 Cricklewood Broadway
London NW2 3ET
Tag-Connector footprints as small as 0.02 sq. inch (0.13 sq cm)

66 Practical Electronics | July | 2024


DIRECT BOOK SERVICE

Teach-In 2017
The books listed here
have been selected by
the Practical Electronics
editorial staff as being
of special interest to
everyone involved

Introducing the in electronics and


computing. They are
supplied by mail order

BBC micro:bit
direct to your door.
FOR A FULL DESCRIPTION
OF THESE BOOKS AND
CD-ROMS SEE THE SHOP ON
OUR WEBSITE
PYTHON CODING ON THE BBC MICRO:BIT
Jim Gatenby www.electronpublishing.com
Python is the leading programming language, easy to learn and widely used by
professional programmers. This book uses MicroPython, a version of Python adapted
for the BBC Micro:bit. All prices include
Among the many topics covered are: main features of the BBC micro:bit including a
simulation in a web browser screen; various levels of programming languages; Mu Editor
UK postage
for writing, saving and retrieving programs, with sample programs and practice exercises;
REPL, an interactive program for quickly testing lines of code; scrolling messages, creating
and animating images on the micro:bit’s LEDs; playing and creating music, sounds
and synthesized speech; using the on-board accelerometer to detect movement of the
micro:bit on three axes; glossary of computing terms. MICROPROCESSORS
This book is written using plain English, avoids technical jargon wherever possible and
covers many of the coding instructions and methods which are common to most program-
INTERFACING PIC MICROCONTROLLERS – 2nd Ed
ming languages. It should be helpful to beginners of any age, whether planning a career in
Martin Bates
computing or writing code as an enjoyable hobby.
298 pages Order code NE48 £34.99
118 Pages Order code PYTH MBIT £7.99
PROGRAMMING 16-BIT PIC MICROCONTROLLERS IN
GETTING STARTED WITH THE BBC MICRO:BIT C – LEARNING TO FLY THE PIC24
Lucio Di Jasio (Application Segments Manager,
Mike Tooley Microchip, USA)
Not just an educational resource for teaching youngsters coding, the BBC micro:bit is a tiny 496 pages + CD-ROM Order code NE45 £38.00
low cost, low-profile ARM-based single-board computer. The board measures 43mm × 52mm
but despite its diminutive footprint it has all the features of a fully fledged microcontroller to-
INTRODUCTION TO MICROPROCESSORS AND
gether with a simple LED matrix display, two buttons, an accelerometer and a magnetometer.
MICROCONTROLLERS – 2nd Ed
Mike Tooley’s book will show you how the micro:bit can be used in a wide range of applications John Crisp
from simple domestic gadgets to more complex control systems such as those used for light- 222 pages Order code NE31 £29.99
ing, central heating and security applications. Using Microsoft Code Blocks, the book provides
a progressive introduction to coding as well as interfacing with sensors and transducers. THE PIC MICROCONTROLLER YOUR PERSONAL
INTRODUCTORY COURSE – 3rd Ed
Each chapter concludes with a simple practical project that puts into practice what the reader John Morton
has learned. The featured projects include an electronic direction finder, frost alarm, reaction
tester, battery checker, thermostatic controller and a passive infrared (PIR) security alarm. 270 pages Order code NE36 £25.00

No previous coding experience is assumed, making this book ideal for complete beginners
PIC IN PRACTICE – 2nd Ed
as well as those with some previous knowledge. Self-test questions are provided at the
David W. Smith
end of each chapter, together with answers at the end of the
book. So whatever your starting point, this book will take 308 pages Order code NE39 £24.99
THEORY AND you further along the road to developing and coding your
own real-world applications.
MICROCONTROLLER COOKBOOK
REFERENCE 108 Pages Order code BBC MBIT £7.99
Mike James
240 pages Order code NE26 £36.99

PRACTICAL ELECTRONICS HANDBOOK – 6th Ed


Ian Sinclair
440 pages Order code NE21 £33.99
BOOK ORDERING DETAILS
STARTING ELECTRONICS – 4th Ed
Keith Brindley All prices include UK postage.
296 pages Order code ELSEV100 £18.99 For postage, add £3 per book to Europe, £4 for rest of the world per book.
ELECTRONIC CIRCUITS – FUNDAMENTALS & CD-ROM prices include VAT and/or postage to anywhere in the world.
APPLICATIONS – Updated version
Mike Tooley Send a cheque, (£ sterling only) made payable to: Practical Electronics or credit card details
400 pages Order code TF43 £32.99 (Visa or Mastercard) to:
FUNDAMENTAL ELECTRICAL AND ELECTRONIC Electron Publishing Limited,
PRINCIPLES – 3rd Ed 113 Lynwood Drive, Wimborne, Dorset BH21 1UU
C.R. Robertson
368 pages Order code TF47 £21.99
Books are normally sent within seven days of receipt of order.
Please check price (see latest issue of Practical Electronics or website) before ordering from old lists.
A BEGINNER’S GUIDE TO TTL DIGITAL ICs
Robert Penfold For a full description of these books please see the shop on our website.
142 pages OUT OF PRINT BP332 £5.45 Tel: 01202 880299 – Email: [email protected]

UNDERSTANDING ELECTRONIC CONTROL SYSTEMS Order from our online shop at: www.electronpublishing.com
Owen Bishop
228 pages Order code NE35 £36.99

Practical Electronics | Ju;y | 2024 67


Practical Electronics PCB SERVICE
PROJECT CODE PRICE PROJECT CODE PRICE
JULY 2024 JUNE 2023
Dynamic NFC Tag (22 × 31mm)...............................................06101231 5.95 Arduino Programmable Load....................................................04105221 8.95
Dynamic NFC Tag (86 × 54mm)...............................................06101232 7.95 Buck-Boost LED Driver.............................................................16103221 8.95
Reciprocal Frequency Counter.................................................CSE230101C 8.95
Reciprocal Frequency Counter, lid 1mm thick black................CSE230102 7.95 MAY 2023
Pi Pico-based Thermal Camera................................................04105231 6.95 Precision AM-FM DDS Signal Generator.................................CSE211002 14.95
Improved SMD Test Tweezers programmed PIC....................0410621PIC 12.95
JUNE 2024 AO 2x-dual-to-quad through-hole (pack of five).......................AO1-MAY23 6.95
Loudspeaker Test Jig................................................................04106231 12.95 AO 2x-dual-to-quad SMD (pack of five)...................................AO2-MAY23 6.95
AO 2x-single-to-dual through-hole (pack of five)......................AO3-MAY23 6.95
MAY 2024 AO 2x-single-to-dual SMD (pack of five)..................................AO4-MAY23 6.95
GPS-Disciplined Oscillator........................................................04103231 12.95
Dual RF Amplifier.......................................................................CSE220602A 5.95 APRIL 2023
Songbird ....................................................................................08103231 7.95 500W Amplifier Module.............................................................see p.22, April 2023
Clipping Indicator (per channel)................................................01112211 7.95
APRIL 2024 CD Welder Power Supply (one needed)..................................29103221 9.95
Basic RF Signal Generator.......................................................CSE221001 8.99 CD Welder Controller (one needed).........................................29103222 9.95
Basic RF Signal Generator (black front panel).........................CSE220902B 9.99 CD Welder Energy Storage module (several needed)............29103223 7.95
Silicon Chirp Cricket..................................................................08101231 7.99 AO Universal Dual Op Amp Board........................................AO1-APR23 9.95
Test Bench ‘Swiss Army Knife’..................................................04110221 9.99 AO Stereo RIAA precision passives kit for dual op amp.......AO2-APR23 8.95

MARCH 2024 MARCH 2023


Digital Volume Control Potentiometer SMD version................01101231 8.95 Pico BackPack...........................................................................07101221 9.95
Digital Volume Control Potentiometer through-hole version....01101232 9.95 Semaphore Signal (controller)..................................................09103221 7.95
Advanced SMD Test Tweezers body........................................04106221 6.95 Semaphore Signal (blade)........................................................09103222 5.95
Advanced SMD Test Tweezers legs (pair)...............................04106212 7.95
FEBRUARY 2023
FEBRUARY 2024 Tesla Coil driver board...............................................................26102221 9.95
Active Mains Soft Starter...........................................................10110221 10.95 Tesla Coil potentiometer board.................................................26102222 5.95
Cooling Fan Controller & Loudspeaker Protector....................01102221 8.95
JANUARY 2024 Remote Gate Controller............................................................11009121 12.95
Q Meter ....................................................................................CSE220701 8.95
Q Meter (black solder mask).....................................................CSE220704 7.95 JANUARY 2023
Raspberry Pi Pico W BackPack................................................07101221 8.95 Classic LED Metronome – 8-LED.............................................23111211 7.95
Classic LED Metronome – 10-LED...........................................23111212 8.95
DECEMBER 2023 Multi-Channel Speaker Protector – 6 channel.........................01101221 9.95
Digital Boost Regulator..............................................................24110224 8.95 Multi-Channel Speaker Protector – 4 channel.........................01101222 7.95
Dual-Channel Power Supply for Breadboards.........................04112221 11.95 Remote Control Range Extender – IR-to-UHF........................15109212 5.95
Display Adaptor for the Breadboard PSU.................................04112222 9.95 Remote Control Range Extender – UHF-to-IR........................15109211 7.95
AO Universal Single Op Amp Board......................................AO1-JAN23 7.95
NOVEMBER 2023
LC Meter Mk3............................................................................CSE220503C 9.95 DECEMBER 2022
DC Supply Filter for vehicles.....................................................08108221 8.95 Hummingbird Amplifier..............................................................01111211 9.95
Discrete Audio Op Amp PCB....................................................AO1-JUL23 9.95 SMD Trainer PCB......................................................................29106211A 8.95
Discrete Audio Op Amp PCB + essential components............AO2-JUL23 17.95 SMD Trainer PCB + parts.........................................................29106211B 13.95

OCTOBER 2023 NOVEMBER 2022


Buck/Boost Charger Adaptor....................................................14108221 9.95 USB Cable tester – main PCB..................................................04108211 12.95
PIC Breakout Board for SOIC parts..........................................24110225 5.95 USB Cable tester – front panel.................................................04108212 5.95
PIC Breakout Board for DIP parts.............................................24110222 5.95 USB Cable tester – optional panel............................................SC5970 5.95
AVR64DD32 Breakout board....................................................24110223 5.95 Model Railway Carriage Lights – PCB.....................................09109211 6.95
Automatic Train Controller.........................................................09109221 6.95 AO transfmr PCB – standard VTX-A range........................ VTX-101-007 6.95
Chuff Sound module..................................................................09109222 6.95 AO transfmr PCB – dual-outline VTX102-3001/101-3002....VTX-Dual 6.95

SEPTEMBER 2023 OCTOBER 2022


Mini LED Driver..........................................................................16106221 7.95 SMD Test Tweezers – PCB and pair of tweezer arms.............04106211-2 11.95
New GPS-Synchronised Clock.................................................19109221 9.95 SMD Test Tweezers – programmed PIC12F1572-I/SN...........0410621A 7.95
Wide-Range Ohmmeter............................................................04109221 14.95 Tele-com............................................................................. 12110211 12.95

AUGUST 2023 SEPTEMBER 2022


110dB RF Attenuator.................................................................CSE211003 9.95 Touchscreen Digital Preamp – main board........................ 01103191 12.95
Universal Battery Charge Controller (2023 update).................14107192 9.95 Touchscreen Digital Preamp – adaptor board pair............. 01103192 5.95
Wide-Range OhmMeter............................................................04109221 12.95 20A DC Motor Speed Controller......................................... 11006211 9.95

JULY 2023
Multimeter Checker/Calibrator..................................................04107221 10.95
MIDI Spectral Sound Synthesiser (full kit – see p.25)..............N/A N/A

PCBs for most recent PE/EPE constructional projects are available. From the July 2013 issue onwards, PCBs with eight-digit codes
have silk screen overlays and, where applicable, are double-sided, have plated-through holes, and solder mask. They are similar to
photos in the project articles. Earlier PCBs are likely to be more basic and may not include silk screen overlay, be single-sided, lack
plated-through holes and solder mask.
Always check price and availability in the latest issue or online. A large number of older boards are listed for ordering on our website.
In most cases we do not supply kits or components for our projects. For older projects it is important to check the availability
of all components before purchasing PCBs.
Back issues of articles are available – see Back Issues page for details.

68 Practical Electronics | July | 2024


Double-sided | plated-through holes | solder mask

PROJECT CODE PRICE PROJECT CODE PRICE


AUGUST 2022 AUGUST 2021
Multi-purpose Battery Manager – I/O Expander module.... 11104212 5.95 Ol’ Timer PCB..................................................................... 19104201 £11.95
Multi-purpose Battery Manager – Switch Module............... 11104211 8.95 Ol’ Timer 8x8 RGB LED module using WS2812B.............. 19104201-88 £8.95
Simple MIDI Music Keyboard (for 8 switches).................... 23101213 6.95 Ol’ Timer set of acrylic case pieces and spacer................. 19104201-ACR £8.75
Nano Pong......................................................................... 08105212 7.95 Ol’ Timer DS3231 RTC IC wide SOIC-16.................................19104201-RTC £5.95
Wideband Digital RF Power Meter..................................... 04106201 £9.75
JULY 2022 Switchmode 78xx regulators (PACK of 5!)........................ 18105201 £7.95
Silicon Labs AM/FM/SW Radio.......................................... CSE210301C 10.95 Cool Beans SMAD display................................................. CB-AUG21 £11.95
Level Crossing Controller................................................... 09108211 6.95
JULY 2021
JUNE 2022 ATtiny816 Breakout / Dev Board with Capacitive Touch.... 24110181 £9.75
Full-wave Motor Speed Controller...................................... 1010221 8.95 IR Remote Control Assistant (Jaycar version).................... 15005201 £8.95
PIC Programming Helper for 8-pin PICs only..................... 24106211 7.95 IR Remote Control Assistant (Altronics version)................ 15005202 £8.95
PIC Programming Helper for 8, 14 or 20-pin PICs ............ 24106212 10.95 PIC18F Development Board.............................................. PNM-JUL21 £12.95
Advanced GPS Computer.................................................. 05102211 9.95 Microphone Preamplifier........................................................AO-JUL21 £11.95

MAY 2022 JUNE 2021


Bus board PCB for Analogue Vocoder............................... AO1-MAY22 10.95 Roadies’ Test Signal Generator (surface-mount version)... 01005201 £8.95
Complete set of 14 PCBs for Analogue Vocoder................ AO2-MAY22 97.95 Roadies’ Test Signal Generator (through-hole version)...... 01005202 £9.95
Programmed EEPROM for Digital FX Unit......................... FX1-MAY22 10.95 Touchscreen Wide-range RCL Box (Resistor module)....... 04104201
£18.95
Programmed PIC for Digital FX Unit using potentiometer.....FX2-MAY22 8.95 Touchscreen Wide-range RCL Box (Ind/Cap module)....... 04104202
KickStart Part 3 – Gyrator-based Audio Filter.................... KS3-2021 £7.95
APRIL 2022
64-key MIDI Matrix shield................................................... 23101211 8.95
64-key MIDI Matrix switch board........................................ 23101212 11.95
High-current Battery Balancer ........................................... 14102211 10.95 For the many pre-2016 PCBs that we stock please see the
Digital FX Unit – using potentiometer................................. 01102211 9.95
Digital FX Unit – using BCD switch.................................... 01102212 9.95
PE website: www.electronpublishing.com
Universal Audio PSU.......................................................... AO1-APR22 11.95

MARCH 2022
PE/EPE PCB SERVICE
Mini Isolated Serial Link..................................................... 24102211 £5.95 Order Code Project Quantity Price
Busy Loo Indicator.............................................................. 16112201 £5.95
Analogue Vocoder – Band-pass filter board....................... AO1-MAR22 9.95 .........................................................
Analogue Vocoder – HP/LP filter board.............................. AO2-MAR22 9.95
.........................................................
FEBRUARY 2022
Arduino-based Power Supply............................................. 18106201 9.95 .........................................................
Battery Monitor Logger....................................................... 11106201 10.95
Electronic Wind Chimes..................................................... 23011201 10.95 .........................................................
Analogue Vocoder – Driver Amplifier.................................. AO-FEB22 8.95
.........................................................
JANUARY 2022
Vintage battery Radio Li-ion Power Supply........................ 11111201 9.95
MiniHeart: A Miniature Heartbeat Simulator....................... 01109201 8.95
Name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DECEMBER 2021
AM/FM/SW Digital Receiver............................................... CSE200902A 13.95 .........................................................
Balanced Input and Attenuator for USB CODEC............... 01106202 11.95
Tel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NOVEMBER 2021 Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dual Battery Lifesaver........................................................ 11111202 £6.95
I enclose payment of £ . . . . . . . . . . . . . . (cheque/PO in £ sterling only)
OCTOBER 2021
Mini Wi-Fi LCD BackPack.................................................. 24106201 £8.95 payable to: Practical Electronics

SEPTEMBER 2021 Card No . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


USB SuperCodec PCB....................................................... 01106201 £14.95
Audio DDS Oscillator PCB................................................. 01110201 £5.95 Valid From . . . . . . . . . . . . . . . . . Expiry Date . . . . . . . . . . . . . . .
Audio DDS Oscillator rotary encoder................................. 01110201-ENC 6.95
Programming Adaptor Board for Audio DDS Oscillator...... 01110202 £5.95 Card Security No . . . . . . . . . .
High-power Ultrasonic Cleaner main PCB......................... 04105201
£14.95
High-power Ultrasonic Cleaner front-panel PCB................ 04105202 You can also order PCBs by phone, email or via the shop
Night Keeper Lighthouse PCB........................................... 08110201 £5.95 on our website: www.electronpublishing.com

No need to cut your issue – a copy of this form is just as good!

All prices include VAT and UK p&p. Add £4 per project for post to Europe; £5 per project outside Europe.
Orders and payment should be sent to:
Practical Electronics, Electron Publishing Ltd
113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU
Tel 01202 880299 Email: [email protected]
On-line Shop: www.epemag.com
Cheques should be made payable to ‘Practical Electronics’ (Payment in £ sterling only).
NOTE: Most boards are in stock and sent within seven days of receipt of order, please allow up to 28 days delivery if we need to restock.

Practical Electronics | July | 2024 69


Practical Electronics PCB SERVICE
PROJECT CODE PRICE PROJECT CODE PRICE
MAY 2021 MAY 2020
7-Band Equaliser (Mono)................................................... 01104201 £8.95 Ultra-low-distortion Preamplifier Input Selector.......................... 01111112
£11.25
7-Band Equaliser (Stereo).................................................. 01104202 £10.95 Ultra-low-distortion Preamplifier pushbutton Input Selector...... 01111113
Car Altimeter....................................................................... 05105201 £7.95 Universal Regulator..................................................................... 18103111 £7.95
433MHz Wireless Data Repeater............................................... 15004191 £8.50
APRIL 2021 Bridge-mode Adaptor for Amplifier.............................................. 01105191 £7.95
Reflow Oven – DSP Active Crossover (CPU)..................... 01106193 iCEstick VGA Terminal................................................................. 02103191 £5.95
Reflow Oven – DSP Active Crossover (Front panel).......... 01106195 £19.95 Analogue noise with tilt control.................................................... AO-0520-01 £7.95
Reflow Oven – DSP Active Crossover (LCD)..................... 01106196 Audio Spectrum Analyser............................................................ PM-0520-01 £8.95
Frequency Reference Signal Distributor.................................... CSE200103 £8.95
APRIL 2020
MARCH 2021 Flip-dot Display black coil board.................................................. 19111181
Nutube Guitar Effects Pedal............................................... 01102201 £12.95 Flip-dot Display black pixels........................................................ 19111182
£14.95
Programmable Thermal Regulator (Peltier Interface)......... 21109181 Flip-dot Display black frame........................................................ 19111183
£18.95
Programmable Thermal Regulator (Peltier Driver)............. 21109182 Flip-dot Display green driver board............................................. 19111184
Tunable HF Preamp........................................................... CSE190502 £8.95
MARCH 2020
FEBRUARY 2021 Diode Curve Plotter............................................................ 04112181 £10.95
4G Remote Monitoring....................................................... 27111191 £9.95 Steam Train Whistle / Diesel Horn Sound Generator................ 09106181 £8.50
Universal Passive Crossover (one off)....................................... UPC0320 £12.50
JANUARY 2021
Nutube Valve Preamplifier.................................................. 01112191 £12.95 FEBRUARY 2020
Arduino DCC Controller...................................................... 09207181 £10.95 Motion-Sensing 12V Power Switch.................................... 05102191 £5.95
USB Keyboard / Mouse Adaptor........................................ 24311181 £8.50
DECEMBER 2020 DSP Active Crossover (ADC)............................................. 01106191
Pseudo-Random Sequence Generator.............................. 16106191 £7.95 DSP Active Crossover (DAC) ×2 ....................................... 01106192
Clever Charger................................................................... 14107191 £11.95 DSP Active Crossover (CPU)............................................. 01106193 £29.95
PE Theremin Amplifier........................................................ AO-1220-01 £8.95 DSP Active Crossover (Power/routing)............................... 01106194
DSP Active Crossover (Front panel)................................... 01106195
NOVEMBER 2020 DSP Active Crossover (LCD).............................................. 01106196
LED Christmas Tree (1 off)................................................. 16107181-1 £6.95
LED Christmas Tree (4 off)................................................. 16107181-2 £14.95 JANUARY 2020
LED Christmas Tree (12 off)............................................... 16107181-3 £24.95 Isolated Serial Link............................................................. 24107181 £8.50
LED Christmas Tree (20 off)............................................... 16107181-4 £34.95
USB/SPI Interface Board.................................................... 16107182 £5.95 DECEMBER 2019
45V/8A Power Supply PCB plus acrylic spacer.................. 18111181 £14.95 Extremely Sensitive Magnetometer.................................... 04101011 £16.75
45V/8A Power Supply front panel five-way display bezel... 18111181-BZ £3.95 Four-channel High-current DC Fan and Pump Controller.... 05108181 £8.75
Five-way LCD Panel Meter/Display.................................... 18111182 £7.95 Useless Box........................................................................ 08111181 £11.50

OCTOBER 2020 NOVEMBER 2019


Digital Audio Millivoltmeter................................................. 04108191 £9.95 Tinnitus & Insomnia Killer (Jaycar case – see text)............ 01110181 £9.95
Precision Signal Amplifier................................................... 04107191 £7.95 Tinnitus & Insomnia Killer (Altronics case – see text)......... 01110182 £9.95

SEPTEMBER 2020 OCTOBER 2019


PE Theremin PSU.............................................................. AO-0920-01 £5.95 Programmable GPS-synced Frequency Reference........... 04107181 £11.50
PE Theremin PSU transformer........................................... AO-0920-02 £7.95 Digital Command Control Programmer for Decoders......... 09107181 £9.95
Micromite Explore-28......................................................... 07108191 £6.95 Opto-isolated Mains Relay (main board)............................ 10107181 £11.50
Ultrabrite LED Driver.......................................................... 16109191 £6.95 Opto-isolated Mains Relay (2 × terminal extension board)....10107182

AUGUST 2020 AUGUST 2019


Micromite LCD BackPack V3............................................. 07106191 £9.95 Brainwave Monitor.............................................................. 25108181 £12.90
Steering Wheel Audio Button to Infrared Adaptor............... 05105191 £7.95 Super Digital Sound Effects Module................................... 01107181 £6.95
Watchdog Alarm................................................................. 03107181 £8.00
JULY 2020 PE Theremin (three boards: pitch, volume, VCA).............. PETX0819 £19.50
AM/FM/CW Scanning HF/VHF RF Signal Generator......... 04106191 £13.95 PE Theremin component pack (see p.56, August 2019).... PETY0819 £15.00
Speech Synthesiser with the Raspberry Pi Zero................ 01106191 £5.95
PE Mini-organ PCB............................................................ AO-0720-01 £14.95 JULY 2019
PE Mini-organ selected parts............................................. AO-0720-02 £8.95 Full-wave 10A Universal Motor Speed Controller............... 10102181 £12.90
High-current Solid-state 12V Battery Isolator – control...... 05106191 £6.95 Recurring Event Reminder................................................. 19107181 £8.00
High-current Solid-state 12V Battery Isolator FET (2oz).... 05106192 £9.95 Temperature Switch Mk2.................................................... 05105181 £10.45

JUNE 2020 JUNE 2019


Arduino breakout board – 3.5-inch LCD Display................ 24111181 £6.95 Arduino-based LC Meter.................................................... 04106181 £8.00
Six-input Audio Selector main board.................................. 01110191 USB Flexitimer.................................................................... 19106181 £10.45
£10.95
Six-input Audio Selector switch panel board...................... 01110192

70 Practical Electronics | July | 2024


CLASSIFIED ADVERTISING

Practical
Electronics
If you want your advertisements to be seen by the largest readership
at the most economical price then our classified page offers excellent Practical Electronics
value. The rate for semi-display space is £10 (+VAT) per centimetre reaches more UK
high, with a minimum height of 2·5cm. All semi-display adverts have a readers than any other
width of 5.5cm. The prepaid rate for classified adverts is 40p (+VAT) per UK monthly hobby
word (minimum 12 words).
electronics magazine.
Cheques are made payable to ‘Practical Electronics’. VAT must be
Our sales figures prove it.
added. Advertisements with remittance should be sent to: Practical
Electronics, 113 Lynwood Drive, Wimborne, Dorset, BH21 1UU. We have been the leading
Tel 07973518682 Email: [email protected] monthly magazine in
BOWOOD ELECTRONICS LTD
For ratesofand
Suppliers further
Electronic information on display and classified advertising
Components this market for the last
please contact our Advertisement
www.bowood-electronics.co.uk Manager, Matt Pulzer – see below. twenty-seven years.
Unit 10, Boythorpe Business Park, Dock Walk, Chesterfield,
Derbyshire S40 2QR. Sales: 01246 200 222
Send large letter stamp for Catalogue

BOWOOD ELECTRONICS LTD Electrical Industries Charity (EIC)


Suppliers of Electronic Components We help people working in the
electrical, electronics and energy COAST ELECTRONICS
www.bowood-electronics.co.uk community as well as their family BREAKOUTS-COMPONENTS-
Unit 10, Boythorpe Business Park, Dock Walk, Chesterfield, members and retirees. CONTRACT DESIGN-3D PRINTER PARTS-
Derbyshire S40 2QR. Sales: 01246 200 222 We use workplace programmes that MUSICAL-MICROCONTROLLERS
Send large letter stamp for Catalogue WWW.COASTELECTRONICS.CO.UK
give the industry access to financial
grants and a comprehensive
range of free and
MISCELLANEOUS confidential services. Andrew Kenny – Qualified Patent Agent
EPO UKIPO USPTO
VALVES AND ALLIED COMPONENTS? www.electricalcharity.org
Circuits Electric Machinery Mechatronics
For free stock list and/or advice, please Web: www.akennypatentm.com
contact me: [email protected] COMPONENTS AS JOB LOT
Email: [email protected]
Telephone: 01788 574774 Large stock. Transistors, Diodes,
Tel: 0789 606 9725
Logic, Memory and Analogue parts.
PIC DEVELOPMENT KITS, DTMF kits 1000s of passive items. Catalogued
and modules, CTCSS Encoder and and sorted. ‘New Old Stock’ in racks.
Decoder/Display kits. Email: [email protected]
Visit www.cstech.co.uk

ADVERTISING INDEX
CRICKLEWOOD ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Advertisement offices
ESR ELECTRONIC COMPONENTS . . . . . . . . . . . . . . . . . . . . . . . 16 Matt Pulzer
HAMMOND ELECTRONICS Ltd . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
JPG ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Electron Publishing Ltd
FLOWCODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cover (ii)
1 Buckingham Road
PEAK ELECTRONIC DESIGN . . . . . . . . . . . . . . . . . . . . . . Cover (iv)
Brighton
POLABS D.O.O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 East Sussex BN1 3RA
QUASAR ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Tel 07973 518682
SILICON CHIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Email [email protected]
STEWART OF READING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
TAG-CONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Web www.electronpublishing.com
TERRINGTON COMPONENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
For editorial contact details see page 7.

Practical Electronics | July | 2024 71


Next Month – in the August issue
Arduino-Based LC and ESR Meter
This enhancement to our Wide-Range Digital LC Meter
(June 2019) allows it also to measure capacitor ESR. That is
extremely useful for diagnosing faulty equipment because
increasing ESR over time is one of the most common ways
electrolytic capacitors fail.

Watering System Controller


This advanced Watering System Controller does it all. It can
change the watering schedule depending on the seasons,
check the weather forecast before watering and even alert
you to a burst pipe or blocked sprinkler. Best of all, it is very
easy to set up and use.

WebMite
The PicoMite is a Raspberry Pi Pico programmed in the MMBasic
language – a very capable microcontroller. Our new WebMite
is a PicoMite with firmware support for the wireless capability of
the Pico W (a Pico with the addition of a Wi-Fi module) and the
protocols (802.11n, DHCP, WPA-PSK, TCP, IP, TLS, HTML) that are
necessary to access the internet.

PLUS!
All your favourite regular columns from Cool Beans
and Circuit Surgery, to Audio Out, Teach-In, Techno
Talk and Net Work. On sale 4 July 2024
Content may be subject to change

Welcome to JPG Electronics NEW subscriptions hotline!


Selling Electronics in Chesterfield for 29 Years
Open Monday to Friday 9am to 5:30pm
And Saturday 9:30am to 5pm Practical
• Aerials, Satellite Dishes & LCD Brackets
• Audio Adaptors, Connectors & Leads
• BT, Broadband, Network & USB Leads
Electronics
• Computer Memory, Hard Drives & Parts We have changed the way we sell and renew
• DJ Equipment, Lighting & Supplies subscriptions. We now use ‘Select Publisher
• Extensive Electronic Components
Services’ for all print subscriptions – to start a
- ICs, Project Boxes, Relays & Resistors
• Raspberry Pi & Arduino Products new subscription or renew an existing one you
• Replacement Laptop Power Supplies have three choices:
• Batteries, Fuses, Glue, Tools & Lots more...
1. Call our NEW print subscription hotline:
01202 087631, or email: [email protected]
T: 01246 211 202
E: [email protected] 2. Visit our shop at: www.electronpublishing.com
JPG Electronics, Shaw’s Row,
Old Road, Chesterfield, S40 2RB
3. Send a cheque (payable to: ‘Practical
W: www.jpgelectronics.com Electronics’) with your details to:
Practical Electronics Subscriptions, PO Box 6337,
Shaw’s Row

JPG Electronics
Britannia Maison Mes Amis
Bournemouth BH1 9EH, United Kingdom
Inn
Old Road Remember, we print the date of the last issue
of your current subscription in a box on the
ad

Rose & Crown


Johnsons
all Ro

d
Roa
address sheet that comes with your copy.
Old H

orth
tsw
Cha
Morrisons

Sparks
Digital subscribers, please call 01202 880299
Retail & Trade Welcome • Free Parking • Google St View Tour: S40 2RB or visit: www.electronpublishing.com

Published on approximately the first Thursday of each month by Electron Publishing Limited, 1 Buckingham Road, Brighton, East Sussex BN1 3RA. Printed in England by Acorn Web Offset Ltd., Normanton WF6
1TW. Distributed by Seymour, 86 Newman St., London W1T 3EX. Subscriptions UK: £33.99 (6 months); £59.99 (12 months); £114.99 (2 years). EUROPE: airmail service, £38.99 (6 months); £69.99 (12 months);
£129.99 (2 years). REST OF THE WORLD: airmail service, £46.99 (6 months); £84.99 (12 months); £164.99 (2 years). Payments payable to ‘Practical Electronics’, Practical Electronics Subscriptions, PO Box
6337, Bournemouth BH1 9EH, United Kingdom. Email: [email protected]. PRACTICAL ELECTRONICS is sold subject to the following conditions, namely that it shall not, without the written consent of the
Publishers first having been given, be lent, resold, hired out or otherwise disposed of by way of Trade at more than the recommended selling price shown on the cover, and that it shall not be lent, resold,
hired out or otherwise disposed of in a mutilated condition or in any unauthorised cover by way of Trade or affixed to or as part of any publication or advertising, literary or pictorial matter whatsoever.

72 Practical Electronics | July | 2024


Did you know our online shop
now sells the current issue of
PE for £5.99 inc. p&p?
Practical
Electronics Prac
Electro tical
The UK’s premier electronics and computing maker magazine

nics
The UK
Circuit Surgery Teach-In 2024 ’s pAudio
remieOut
r electr
Topics in digital signal processing Sensing the environment
Circuit with Mechanical o
in audio nics and
– sample and hold Topics Surgerswitches
the ESP32 SoC microcontroller
y compu
proce
in digit
ssing – al signal Teach ting ma
-In 20 ker ma
ADCs Using
SoC m
LED dis 24
plays w
gazine
ic rocontr it h the E
oller SP32 Audio
O
Mecha ut
n
switch ical
Make your WIN!
es in a
udio
own Dynamic Micro
Curios chip
Develoity HPC
RFID tags pm
Board ent
WIN! Louds
p
Test Ji eaker
Heart
Reciprocal g
Senso RCounter
Frequency ate
r Modu
le

Teach-In 2024 Wi-Fi


T
Learn to use for GP ime Source
the ESP32 S Cloc
ks
Teach
-In 20
Learn 24
the ES to use
Pi Pico-based
Thermal Camera P32
PLUS!
P
LUS! Jul 2024 £5.99
Techno Talk – Who saw that coming?
Techn 07
o Tadecoders
Cool Beans – Arduino: 7-segment display lk
Cool B – Prog
ra
– Ardu m that!
eans repairs
Net Work – Practical advice on electronics 9 772632 573030
Net W ino: 7-s
ork – G egme
aN USB practicalelectronics
www.electronpublishing.com
www.e
@practicalelec charge nt display d Jun 20
lectro rs, solid elights 24
npubli -state £5.99
shing
.com
EV battery 06
@prac 9 772
ticale
632 5
73030
lec
practi
calele
ctronic
s

You read that right! We now sell the current issue of your favourite electronics
magazine for exactly the same price as in the High Street, but we deliver it
straight to your door – and for UK addresses we pay the postage. No need to
journey into town to queue outside the newsagent. Just go to our website, set
up an account in 30 seconds, order your magazine and we’ll do the rest.

www.electronpublishing.com

You might also like