0% found this document useful (0 votes)
1K views86 pages

Practical Electronics September 2019 Avxhm - Se

Uploaded by

llonllon
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)
1K views86 pages

Practical Electronics September 2019 Avxhm - Se

Uploaded by

llonllon
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
  • Projects and Circuits
  • Series, Features and Columns
  • Regulars and Reviews
  • Advertising and Services

D NA –

IG E
!
E
ES M
N
Practical
EW W P
N NE E

Electronics
The UK’s premier electronics and computing maker magazine
Micromite Electronic Circuit Surgery Cool Beans
Build a dice Building Blocks Transistor theory Fixing
prediction game LED Clocks and practice Metastability

Arduino WIN!
Microchip
NFC dsPIC33CH
Shield Curiosity
Development
Board

Digital Sound
Effects Module

Micromite
Clock
NEW SERIES
Build your own
LS3/5A speakers!

White Noise Source


See our Super
PLUS!
Summer Sale!
Sophisticated lathe speed controller Sep 2019 £4.65
09
Practically Speaking returns!
Net Work and Techno Talk 9 772632 573009

[Link] @practicalelec practicalelectronics


With Over 250 Million Units in
Stock, We’ve Got You Covered
Delivering You the World’s Largest
Inventory of Microchip Products

[Link]/learn-more

The Microchip name and logo and the Microchip logo are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
All other trademarks are the property of their registered owners.
© 2018 Microchip Technology Inc. All rights reserved. DS00002552A. MEC2226Eng10/18
Practical
Volume 48. No. 9
September 2019
ISSN 2632 573X

Electronics Contents
Projects and Circuits
Intelligent Touchscreen Lathe Speed Controller 14
by Peter Bennett (design) and Nicholas Vinen (words)
Automatically adjust your lathe’s speed to suit materials, manually select speed
and direction; plus constant display of the lathe’s status.
Super-portable Twin Dipole Guitar/PA Speaker by Allan-Linton Smith 22
This easy-to-build, portable guitar/PA speaker is LOUD and sounds great!
Using Cheap Asian Electronic Modules – Part 19 by Jim Rowe 28
Learn to use a low-cost NFC (Near-Field Communication) shield for Arduino.
Super Digital Sound Effects Module – Part 2 by Tim Blythman and Nicholas Vinen 32
Assembly of this powerful sound effects module with advanced controls.
White Noise Generator by John Clarke 40
A very simple and cheap-to-build PIC-based white noise source that does not
repeat over any short time frame and has a wide variety of uses.

Series, Features and Columns


Techno Talk by Mark Nelson 10
Just my cup of tea! Yours too?
Net Work by Alan Winstanley 12
The rapid transformation of electricity generation in the UK and the rise of
automotive smart systems. Plus, updates on SpaceX, Huawei and Internet radio.
Circuit Surgery by Ian Bell 42
Understanding bipolar junction transistors – Part 3
Audio Out by Jake Rothman 46
Designing Hi-Fi mini-monitor loudspeakers – Part 1
Practically Speaking by Max Maxfield 55
Three indispensable low-cost, low-tech tools
Make it with Micromite by Phil Boyce 58
Part 8: Dice Prediction game and Mini MKC Clock
Max’s Cool Beans by Max The Magnificent 66
Flipping and flopping – metastability
Electronic Building Blocks by Julian Edgar 76
Three clocks

Regulars and Services


PE Teach-In 8 3
Subscribe to Practical Electronics and save money 4
PE Summer Sale – a page full of great deals 6
Reader services – Editorial and Advertising Departments 7
Editorial 7
Inspirational speakers!
Practical Electronics back issues CD-ROM – great 15-year deal! 11
Exclusive Microchip reader offer 21
Win a Microchip dsPIC33CH Curiosity Development Board
Practical Electronics – get your back issues here! 39
PE Teach-In 9 56
Teach-In bundle – what a bargain! 65
Practical Electronics CD-ROMS for electronics 70
© Electron Publishing Limited 2019
A superb range of CD-ROMs for hobbyists, students and engineers
Copyright in all drawings, photographs, articles,
Direct Book Service 73
technical designs, software and intellectual property
Build your library of carefully chosen technical books
published in Practical Electronics is fully protected,
and reproduction or imitation in whole or in part are Practical Electronics PCB Service 78
expressly forbidden. PCBs for Practical Electronic projects
The October 2019 issue of Practical Electronics will be Advertiser index 79
published on Thursday, 5 September 2019 – see page 80. Next month! – highlights of our next issue of Practical Electronics 80

Practical Electronics | September | 2019 1


All prices INCLUDE 20.0% VAT. Free UK delivery on orders over £48
Quasar Electronics Limited Postage & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7
PO Box 6935, Bishops Stortford Day Delivery - £4.95; UK Mainland Next Day Delivery - £9.95; Europe
CM23 4WP, United Kingdom (EU) - £12.95; Rest of World - £14.95 (up to 0.5Kg).
!! Order online for reduced price postage and fast despatch !!
Tel: 01279 467799 Payment: We accept all major credit/debit cards. Make cheques/PO’s
E-mail: sales@[Link] payable to Quasar Electronics Limited.
Please visit our online shop now for full details of over 1000 electronic
Web: [Link] kits, projects, modules and publications. Discounts for bulk quantities.

Solutions for Home, Education & Industry Since 1993

Bidirectional DC Motor Speed Controller


Controllers & Loggers Control the speed of
Here are just a few of the controller and data most common DC
acquisition and control units we have. See motors (rated up to
website for full details. 12Vdc PSU for all 32Vdc/5A) in both the
units: Order Code 660.446UK £10.68 forward and reverse
directions. The range
of control is from fully
OFF to fully ON in both directions. The direc-
USB Experiment Interface Board
tion and speed are controlled using a single
Updated Version! 5
potentiometer. Screw terminal block for con-
digital inputs, 8 digital
Official Main Dealer stocking the outputs plus two ana-
nections. PCB: 90x42mm.
full range of Kits, Modules, Ro- Kit Order Code: 3166KT - £19.99
logue inputs and two
Assembled Order Code: AS3166 - £29.99
bots, Instruments, tools and analogue outputs. 8 bit
much, much more... resolution. DLL.
8-Ch Serial Port Isolated I/O Relay Module
Kit Order Code: K8055N - £39.95 £22.20
Computer controlled 8
Assembled Order Code: VM110N - £35.94
channel relay board.
PIC & ATMEL Programmers 2-Channel High Current UHF RC Set 5A mains rated relay
State-of-the-art high outputs and 4 opto-
We have a wide range of PIC, ATMEL Ar- isolated digital inputs
duino and Raspberry Pi projects. security. Momentary or
latching relay outputs (for monitoring switch
rated to switch up to states, etc). Useful in a variety of control and
PIC Programmer & 240Vac @ 12 Amps. sensing applications. Programmed via serial
Experimenter Board Range up to 40m. 15 port (use our free Windows interface, termi-
Great learning tool. Tx’s can be learnt by one Rx. Kit includes nal emulator or batch files). Serial cable can
Includes programming one Tx (more available separately). 9-15Vdc. be up to 35m long. Includes plastic case
examples and a repro- Kit Order Code: 8157KT - £44.95 130x100x30mm. Power: 12Vdc, 500mA.
grammable 16F627 Assembled Order Code: AS8157 - £49.96 Kit Order Code: 3108KT - £74.95
Flash Microcontroller. Test buttons & LED Assembled Order Code: AS3108 - £89.95
indicators. Software to compile & program Computer Temperature Data Logger
your source code is included. Supply: 12- Serial port 4-ch temperature 8-Channel RF Remote Control Set
15Vdc. Pre-assembled and ready to use. logger. °C/°F. Continuously Control 8 onboard relays
Order Code: VM111 - £38.88 £35.94 log up to 4 sensors located with included RF remote
200m+ from board. Choice control unit. Toggle or
USB PIC Programmer and Tutor Board of free software applications momentary mode for
The only tutorial downloads for storing/using each output. Up to 50m
project board you data. PCB just 45x45mm. Powered by PC. range. Board Supply:
need to take your Includes one DS18S20 sensor. 12Vac, 500mA
first steps into Kit Order Code: 3145KT - £19.95 £16.97 Assembled Order Code: VM118 - £71.94
Microchip PIC Assembled Order Code: AS3145 - £19.96
programming us- Additional DS18S20 Sensors - £4.96 each Temperature Monitor & Relay Controller
ing a PIC16F882 (included). Later you can Computer serial port
use it for more advanced programming. 8-Channel Ethernet Relay Card Module temperature monitor &
Programs all the devices a Microchip Connect to your router relay controller. Ac-
PICKIT2® can! Use the free Microchip tools with standard network cepts up to four Dallas
for PICKit2™ & MPLAB® IDE environment. cable. Operate the 8 DS18S20 / DS18B20
Order Code: EDU10 - £46.74 relays or check the digital thermometer sensors (1 included).
status of input from Four relay outputs are independent of the
USB /Serial Port PIC Programmer anywhere in world. sensors giving flexibility to setup the linkage
Fast programming. Use almost any internet browser, even mo- any way you choose. Commands for reading
Wide range of PICs bile devices. Email status reports, program- temperature / controlling relays are simple
supported (see website mable timers... Test software & DLL online. text strings sent using a simple terminal or
for details). Free Win- Assembled Order Code: VM201 - £130.80 coms program (e.g. HyperTerminal) or our
dows software & ICSP free Windows application. Supply: 12Vdc.
header cable. USB or Computer Controlled / Standalone Kit Order Code: 3190KT - £79.96 £47.95
Serial connection. ZIF Unipolar Stepper Motor Driver Assembled Order Code: AS3190 - £59.95
Socket, leads, PSU not included. Drives any 5-35Vdc 5, 6
Kit Order Code: 3149EKT - £49.96 £29.95 or 8-lead unipolar step- 3x5Amp RGB LED Controller with RS232
Assembled Order Code: AS3149E - £44.95 per motor rated up to 6 3 independent high
Assembled with ZIF socket Order Code: Amps. Provides speed power channels.
AS3149EZIF - £74.96 £49.95 and direction control. Preprogrammed or
Operates in stand-alone user-editable light
PICKit™2 USB PIC Programmer Module or PC-controlled mode for CNC use. Con- sequences.
Versatile, low cost, nect up to six boards to a single parallel port. Standalone or 2-wire
PICKit™2 Development Board supply: 9Vdc. PCB: 80x50mm. serial interface for
Programmer. Programs Kit Order Code: 3179KT - £15.26 microcontroller or PC communication with
all the devices a Micro- Assembled Order Code: AS3179 - £22.26 simple command set. Suits common anode
chip PICKIT2 program- RGB LED strips, LEDs, incandescent bulbs.
mer can. Onboard sockets & ICSP header. 12A total max. Supply: 12Vdc. 69x56x18mm
USB powered. Card Sales Kit Order Code: 8191KT - £24.95
Assembled Order Code: VM203 - £35.94 & Enquiries Assembled Order Code: AS8191 - £27.95
Teach-In 8 CD-ROM CD
EE M
FR RO
-

ELECTRONI CS
£8.99

Exploring the Arduino TEACH-I N 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
• Programming – powerful integrated development system
has been designed for electronics enthusiasts who want to get to • Microcontrollers – understand control operations
• Communications – connect to PCs and other Arduinos

grips with the inexpensive, immensely popular Arduino microcontroller,


as well as coding enthusiasts who want to explore hardware and
interfacing. Teach-In 8 provides a one-stop source of ideas and
practical information.
The Arduino offers a remarkably effective platform for developing a
huge variety of projects; from operating a set of Christmas tree lights PLUS...
to remotely controlling a robotic vehicle wirelessly or via the Internet. PIC n’MIX
PICs and the PICkit 3 - A beginners
guide. The why and how to build
Teach-In 8 is based around a series of practical projects with plenty of 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
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 [Link]

Practical Electronics | September | 2019 3


D NA –
IG E
Practical
!
E
ES M
N
EW W P
N NE E

Electronics
UK readers SAVE 73p on every issue
Why not pay £3.92 instead of £4.65 for your copy of Practical Electronics?

D NA –
D NA –

D NA –

IG E
IG E

IG E

D NA –
D NA –
Practical Practical Practical

!
E

ES M
ES M

ES M

IG E
N
N

IG E
Practical Practical

!
E

EW W P
EW W P

EW W P

ES M
ES M

N
N

EW W P
EW W P

N NE E
N NE E

N NE E

N NE E
N NE E




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
Audio Out Circuit Surgery Net Work PIC n’ Mix Micromite Circuit Surgery Cool Beans PIC n’ Mix Micromite Circuit Surgery Cool Beans PIC n’ Mix Micromite Circuit Surgery Cool Beans PIC n’ Mix Micromite Dynamometer Circuit Surgery Cool Beans
Backing MOSFET power Back-ups and Designing PCBs Digital inputs Comparator Max’s amazing Small, cheap and Subroutines Circuit simulation ‘Micing’ an Small, cheap and Building smart Understanding Fixing a dynamic Small, cheap and Using sound Power electronics Transistor theory Nixie tubes
Baxandall switches smart speakers with EagleCAD and outputs circuit design 4-bit computer powerful PICs and interrupts with LTspice Arduino powerful PICs Electronic dice bipolar transistors range problem powerful PICs Mac operation for a rolling road and practice Metastability

WIN! WIN! Wide-range


WIN! Powerful Digital WIN!
Infrared-sensing SAM R34 2× 12V Battery AVR-IoT WG
LAN7430
PCIe 3.1 Sound Effects Microchip
Heater Controller Xplained Pro
Balancer Development Arduino-based Ethernet Bridge WIN! SAM L11
LoRaWAN
Evaluation Board
LC Meter Evaluation Microchip Module Xplained Pro
Board SAM L21 Evaluation Kit
Kit WIN! Xplained Pro WIN!
Evaluation Kit
WIN!

Deluxe Amazing Arduino


Frequency Switch 10A Universal Motor brainwave monitor
Speed Controller
MIDI Ultimate Complete the Control your
Synthesiser – Part 5 PE Theremin PC with an
Internet-based Putting MIDI in the MIDI Ultimate IR remote
‘GPS’ Time Source Event
USB Port Protector Reminder
USB
Flexitimer
MIDI Ultimate
MIDI Ultimate
Synthesiser – Part 3
Synthesiser – Part 4 Build your
Build the superb See our Super
PE Theremin!
PLUS!
VCA, echo, noise and headphone
amplifier sections PLUS!
Modulation sources
PLUS! own Theremin! PLUS!
PLUS!
Summer Sale!
4GHz Digital Attenuator 500MHz frequency counter
Make it with Micromite Apr 2019 £4.65 Net Work, Techno Talk and The Fox Report May 2019 £4.65 June 2019 £4.65
July 2019 £4.65 Watchdog Alarm August 2019 £4.65
MIDI Ultimate Synthesiser 08
TEACH-IN 2019 – Powering Electronics TEACH-IN 2019 – Powering Electronics Net Work, Techno Talk and Electronic Building Blocks 07 World’s best DIY car immobiliser
Net Work, Techno Talk and Electronic Building Blocks
Wi-Fi transceiver module 35MHz-4.4GHz digitally controlled oscillator TEACH-IN 2019 – Powering Electronics 9 770262 361195 Barry Fox, Net Work and Techno Talk 9 772632 573009
TEACH-IN 2019 – Powering Electronics
[Link] @practicalelec practicalelectronics [Link] @practicalelec practicalelectronics
[Link] @practicalelec practicalelectronics [Link] @practicalelec practicalelectronics [Link] @practicalelec practicalelectronics

Just take out a one-year subscription and save 73p on every issue, or £8.80 over the year.
Even better – save 94p per issue if you subscribe for two years – a total saving of £22.60

Overseas rates also 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 the newsagents sell out
Order by: • Phone or post with a cheque, postal order or credit card
• Or order online at: [Link] (go to our secure server-backed online shop)

SUBSCRIPTION ORDER FORM


Practical  6 Months: UK £25.00, Europe £30.00 (Airmail),

Electronics
Rest of the World £37.00 (Airmail)
 1 Year: UK £47.00, Europe £56.00 (Airmail),
Rest of the World £70.00 (Airmail)
 2 Years: UK £89.00, Europe £107.00 (Airmail),
SUBSCRIPTION PRICES Rest of the World £135.00 (Airmail)
Subscriptions for delivery direct to any address in: To: Practical Electronics
Wimborne Publishing Ltd
UK: 6-months £25.00, 12-months £47.00, 24-months £89.00 113 Lynwood Drive, Wimborne, Dorset BH21 1UU
Europe Airmail: 6-months £30.00, 12-months £56.00, Tel: 01202 880299 Fax: 01202 843233
24-months £107.00 Email: [Link]@[Link]
Rest Of The World Airmail: 6-months £37.00, 12-months I enclose payment of £ ..............
£70.00, 24-months £135.00 (cheque/PO in £ sterling only)
payable to Practical Electronics
Cheques (in £ sterling only) payable to Practical Electronics
and sent to: Wimborne Publishing Ltd, 113 Lynwood Drive,  Please charge my Visa/Mastercard
Merley, Wimborne, Dorset BH21 1UU. My card number is: .......................................................................
Please print clearly, and check that you have the number correct
Tel: 01202 880299. Fax: 01202 843233.
Email: [Link]@[Link]. Card Security Code .................. Valid From Date........................
(The last 3 digits on or just under the signature strip)
Also via our secure online shop at: [Link].
Card Ex. Date ......................................
Subscriptions start with the next available issue. We accept
MasterCard or Visa. Name ............................................................................................
(For past issues see the Back Issues page.)
Address ........................................................................................

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


ONLINE SUBSCRIPTIONS Email ............................................................................................
Electronic subscriptions (PDF download or online) are available,
£22.00 for 12 months, visit [Link] for more details. Subscriptions start with the next available issue.

4 Practical Electronics | September | 2019


Smart Solutions to Accelerate Design
Building Blocks to Optimize Your Design’s Intelligence

As technology has evolved, more and more devices demand intelligent systems.
Microchip has been on the forefront of this evolution, bringing you a broad portfolio of
solutions that helps you:

• Easily ind the right level of intelligence for your design with our broad portfolio of
8-, 16- and 32-bit MCUs, DSCs and MPUs
• Eiciently create diferentiated designs with lexible peripherals and functions
• Accelerate design time with our intuitive development environments, complete
reference designs, free software libraries and automatic code generation tools.

Learn how Microchip can get you to production faster by providing solutions that
are not only smart, but also connected and secure.

Get smart at [Link]/Smart

The Microchip name and logo and the Microchip logo are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All
other trademarks are the property of their registered owners.
© 2019 Microchip Technology Inc. All rights reserved. DS00002769A. MEC2237A-Eng-06-19
Super
Summer
Sale!
Practical Electronics special offers
40% off all PCBs up to and including those in the February 2019 issue
25% off all PE/EPE hard-copy (print) back issues
25% off all PE/EPE back-issue 6-month CD-ROMs – see page 11
25% off all PE/EPE back-issue 5-year CD-ROMs – see page 11

Practical Electronics subscription offer


Subscribe to PE hard copy for 12-months and receive a free 6-month back-issue
CD-ROM of your choice from Volume 1-40 (see page 11), normal price £16.45.

Subscribe to PE hard copy for 24-months and receive three free 6-month back-issue
CD-ROMs of your choice from Volume 1-40 (see page 11), normal price £16.45 each.

Existing subscribers are welcome to renew early for another 12 or 24 months and
still receive the offer – your new subscription will simply be added to the end of your
existing subscription – no issues lost by renewing early!

Teach-In bundle
Electronics Teach-In bundle includes
TI CD-ROMs 3, 4 and 5 – normal price £18.95
Special offer 25% discount price £14.21 – see page 65

PAYMENT MUST BE RECEIVED BY CLOSE


OF OFFER: 30 SEPTEMBER 2019

Don’t miss out!


Just call 01202 880299 or visit our secure online shop at:
[Link]
Practical
Volume 48. No. 9
September 2019
ISSN 2632 573X

Electronics Editorial
Editorial offices
Practical Electronics Tel 01273 777619 Inspirational speakers
Electron Publishing Limited Mob 07973 518682 We don’t cover loudspeakers very often in PE,
1 Buckingham Road Fax 01202 843233
Brighton Email pe@[Link]
certainly much less than amplifiers. Yet they play
East Sussex BN1 3RA Web [Link] just as critical a role in audio and are fascinating
engineering systems that combine everything
Advertisement offices from woodwork to advanced filter design – and
Practical Electronics Adverts
1 Buckingham Road
yes, electronics if you go the active route. Still,
Brighton if you wait long enough, just like buses, a pair of
East Sussex BN1 3RA speaker articles will arrive together!
Phone 01273 777619
Mob 07973 518682 This month, we take two very different routes to
Email pe@[Link] designing and building loudspeakers. We have
a remarkably simply electric guitar / PA dipole
Editor Matt Pulzer
General Manager Louisa Pulzer speaker, which despite its basic construction
Subscriptions Stewart Kearn really delivers the goods. Plus, we have the start of a series from Jake
Online Editor Alan Winstanley Rothman in his Audio Out column that looks at the venerable BBC
Web Systems Kris Thain
Publisher Matt Pulzer mini-monitor, the LS3/5A. This won’t just be an academic analysis
of what makes this speaker so good; we’ll be producing designs
Technical enquiries that enable you to build a pair yourself. This promises to be a really
We regret technical enquiries cannot be answered over the exciting project and I hope you consider making your own LS3/5As.
telephone. We are unable to offer any advice on the use, purchase,
repair or modification of commercial equipment or the incorporation (We’ll even make sure the woodwork is rock solid, easy to assemble
or modification of designs published in the magazine. We cannot and inexpensive.)
provide data or answer queries on articles or projects that are
more than five years old.
Practically Speaking
Questions about articles or projects should be sent to the editor It’s over three years since Robert Penfold retired and his popular
by email: pe@[Link] hands-on column, Practically Speaking, came to an end. It was
a great mix of advice, tips and tricks that explained in simple
Projects and circuits
All reasonable precautions are taken to ensure that the advice and language how to actually build circuits and projects. I have wanted
data given to readers is reliable. We cannot, however, guarantee to resurrect it for some time, but I couldn’t decide which of our
it and we cannot accept legal responsibility for it. many talented writers would be the best fit. Then it struck me…
A number of projects and circuits published in Practical Electronics
most of them would make a great job of writing the column, so
employ voltages that can be lethal. You should not build, test, I am going to commission several authors to write the new-look
modify or renovate any item of mains-powered equipment unless Practically Speaking. This month kicks off with Cool Beans Max,
you fully understand the safety aspects involved and you use an
RCD (GFCI) adaptor.
who declares his love for some decidedly low-tech hardware!

Component supplies What would you like to see covered in Practically Speaking? All
We do not supply electronic components or kits for building the construction techniques and technologies are up for grabs – drop
projects featured, these can be supplied by advertisers. We
advise readers to check that all parts are still available before
me a line and let me know.
commencing any project in a back-dated issue.
Super summer sale!
Advertisements Here’s a short reminder that we’re still running our annual
Although the proprietors and staff of Practical Electronics take
reasonable precautions to protect the interests of readers by
summer sale (see opposite). Many PCBs, all back issues and all
ensuring as far as practicable that advertisements are bona fide, back issue CD-ROMs are discounted, and don’t forget that if you
the magazine and its publishers cannot give any undertakings renew your subscription between now and the end of September
in respect of statements or claims made by advertisers, whether
these advertisements are printed as part of the magazine, or in
we’re giving away your choice of a six-month back-issue CD-ROM
inserts. The Publishers regret that under no circumstances will with every 12-month subscription, and three CD-ROMs if you
the magazine accept liability for non-receipt of goods ordered, or renew for 24 months.
for late delivery, or for faults in manufacture.

Transmitters/bugs/telephone equipment
Even if you’ve renewed recently you won’t lose out, your additional
We advise readers that certain items of radio transmitting and subscription will simply start after the current one ends and you’re
telephone equipment which may be advertised in our pages guaranteed to avoid any price rises. In fact, if you’ve just renewed,
cannot be legally used in the UK. Readers should check the law but decide to take up this offer you won’t see any price rises for the
before buying any transmitting or telephone equipment, as a fine,
confiscation of equipment and/or imprisonment can result from best part of three years. What are you waiting for? Grab a bargain!
illegal use or ownership. The laws vary from country to country;
readers should check local laws.
Matt Pulzer
Publisher

Practical Electronics | September | 2019 7


NEWS
A roundup of the latest news from the world of electronics and technology
• 4GB Raspberry Pi 4
Raspberry Pi 4 • Official case
he Raspberry Pi Foundation has • Official PSU
T announced the latest iteration of
its hugely successful single-card com-


Official mouse and keyboard
Pair of HDMI cables
puter – the Raspberry Pi 4. • Copy of updated Beginner’s Guide
Starting at $35, the new Pi is offered • Pre-installed 16GB microSD card
as: ‘a comprehensive upgrade, touching
almost every element of the platform. New features
For the first time we provide a PC-like Pi 4 has moved from USB micro-B to
level of performance for most users, USB-C power connector, supporting
while retaining the interfacing capa- an extra 500mA of current, ensuring
bilities and hackability of the classic a full 1.2A for downstream USB de- Power supply
Raspberry Pi line.’ Highlights of the vices, even under heavy CPU load. Last, bit not least, the Foundation
Raspberry Pi 4 Model B include: To accommodate dual display output has noted that good, low-cost USB-C
• A 1.5GHz quad-core 64-bit ARM within the existing board footprint, the power supplies (and USB-C cables)
Cortex-A72 CPU (~3× performance) type-A (full-size) HDMI connector has are surprisingly hard to find – some-
• 1GB, 2GB, or 4GB of LPDDR4 SDRAM been replaced with a pair of type-D thing they claim to have noticed when
• Full-throughput Gigabit Ethernet (micro) HDMI connectors. they sent out prototype units to alpha
• Dual-band 802.11ac wireless net- The Gigabit Ethernet magjack has testers. They have worked with Ktec
working moved to the top right of the board, to develop a suitable 5V/3A power
• Bluetooth 5.0 from the bottom right, greatly simpli- supply, which is priced at $8, and is
• Two USB 3.0 and two USB 2.0 ports fying PCB routing. The 4-pin Power- available in UK (type G), European
• Dual monitor support, at resolutions over-Ethernet (PoE) connector remains (type C), North American (type A) and
up to 4K in the same location, so Raspberry Pi Australian (type I) plug formats.
• VideoCore VI graphics, supporting 4 remains compatible
OpenGL ES 3.x with the PoE HAT.
• 4Kp60 hardware decode of HEVC To support Raspberry
video Pi 4, a radically over-
• Complete compatibility with earlier hauled operating system
Raspberry Pi products is being shipped, based
on the forthcoming
For the first time there is a choice of Debian 10 Buster release.
memory capacities: This brings numerous
behind-the-scenes tech-
RAM Price nical improvements,
1GB £35 along with an exten-
2GB £45 sively modernised user
4GB £55 interface, and updated
applications including
A Raspberry Pi 4 desktop kit is also the Chromium 74 web
available for $120, and comprises: browser. The all-new Raspberry Pi 4, with up to 4GB of RAM.

Ventilated enclosures
[Link]/electronics/small-case/
plastic/1551v
Hammond
More than 5000 diferent enclosure styles:
[Link]/electronics/small-case
01256 812812
sales@[Link]

8 Practical Electronics | September | 2019


The Fox Report
Barry Fox’s technology column

Oil error message Journalists grow weary of press releases ‘But instead of the anticipated minor
that gloss over company problems and teething issues, there were major dif-
computer catastrophes. So full marks ficulties that are still ongoing,’ says the
to German lubricant specialist LIQUI CEO. ‘Customers are becoming frustrated
MOLY for what must surely rank as and angry. In my entire professional
the world’s frankest-ever press missive. career, I have not had to apologise so
‘The introduction of new company often to customers, as I have had to in
software in January has turned LIQUI the last six months. In addition to the
MOLY into a permanent building site,’ huge cost of having the software in-
it reads. ‘The system that was supposed stalled, every day produces new things
to simplify processes and reduce costs to trouble shoot and problems to solve.’
for the oil and additive specialist, has ‘Earnings for the half-year fell by
had precisely the opposite effect’. around 30% to €11m. I never would
‘If we were listed on the stock ex- have thought that in 2019 a change of
change, I would have to issue a profit software could send a whole company
warning,’ says CEO Ernst Prost, who skidding off the road.”
sent a photo showing how he feels. ‘The storm that we are currently
‘Among other things, the company going through is a lot stronger than
software manages purchases, controls predicted. Big waves are breaking over
production, handles shipping and is- our ship, some of the crew are getting
sues invoices…The previous software wet and some of the passengers are a
LIQUI MOLY CEO Ernst Prost is infuriated had been in use for decades and was bit nauseous. But our ship is seawor-
by computer problems – we all know increasingly reaching its limits. So, after thy and not at risk. And the storm will
how he feels, but it’s rare to go so public. years of preparation, it was replaced.’ soon be over.’

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 [Link]
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 | September | 2019 9


Just my cup of Techno Talk
tea! Yours too? Mark Nelson

Forget corner cafés – Internet cafés too! That’s because the Repair Café is the new ‘in’ place to be. They
are part of a movement that aims to reduce waste, pollution and greenhouse emissions by helping people
give their electronic and electrical gizmos a second life. Practical electronicists like you can volunteer to
do hands-on mending or contribute by sharing data and solutions for familiar consumer durables.

O
ne of the frustrating factors other places. A decade later, there are (with a small ‘r’ and ‘c’) that concen-
of modern life is that many gad- 1,700 Repair Cafés offering their ser- trates on mending electronic goods. It
gets are cheaper to replace than vices across 35 countries. started in London in 2013, and since
repair. Modern economics may well rely then has helped 11,942 people, by way
on disposable durables (now there’s a Legal action of 18,978 hours of volunteered time
contradiction!) and high levels of con- The grassroots movement to bring repair- working on 9,648 devices. A survey
sumption, but in our heart of hearts we ing back into our economy is growing of participants attending ‘restart par-
know that the constant replacement and making political demands too, ties’ in 2016 found that close to half
of gadgets and burying the evidence taking on the world’s biggest compa- of people were ‘slightly’ or ‘not at all’
of this profligacy in landfill cannot nies through legislation that will force confident undertaking repairs of their
be good for the environment. Regular them to make products that are repair- goods at home, and that 45% were un-
junking of products that ought to last able and live longer. According to the able to find a commercial repairer they
five years or more is often ascribed to Rapid Transition Movement (www. could trust. Without the help of Restart
intentional ‘planned obsolescence’, [Link]), from the EU to the volunteers, many of the goods repaired
in which products are designed not US, new laws are being developed to would have been discarded.
to endure but be replaced on a fre- support the ‘right to repair’ to radically
quent basis to feed economic demand. reduce waste, make things last longer Wishful thinking?
This all-too-familiar scenario has got and make them easier to repair. The gi- Volunteering has enormous practical
be wrong, and a global movement is ant economy of California is now the power – each month more than 20,000
growing to put this right. 18th US state to make such a proposal. talented ‘fixers’ now offer their time and
their hands to help over 50,000 people
People power Practical matters mend their broken belongings, all for
Big business will not help avert this We’ve already dealt with the who and free other than the cost of parts used.
nonsense unless forced to, so it’s down why, so now let’s deal with the what This is practical support that helps save
to consumers like us to act. Individuals and where – in that order. Repair Cafés money, reduces waste and raw material
can kickstart the movement – and they are free meeting places and they’re all consumption and builds communities.
have. In 2009, Dutch journalist Martine about repairing things, communally. At Even better, in 2017 the efforts of all
Postma ran an experiment in her home Repair Cafés you’ll find tools and mate- these volunteers saved around 300,000kg
town of Amsterdam. She brought to- rials to help you make any repairs you of CO2 emissions that buying replace-
gether a group of handy friends and ran need. On clothing, furniture, electrical ment gadgets would have cost. There is
what she called a Repair Café — a free goods, bicycles, crockery, appliances, something immensely satisfying about
facility where people could bring their toys and other consumer items. You’ll resurrecting a dead device, especially
broken belongings and motivated vol- also find expert volunteers, with repair for someone who may not be able to af-
unteers would help to try and fix them. skills in all kinds of fields. ford a new one. Why not put your PE
Following the huge popularity of the Visitors (clients) bring their broken talents to good use and get involved!
events in Amsterdam, Martine set up the items from home. Together with the
Repair Café Foundation ([Link] specialists on site, they start making Letters, we get letters
[Link]/en/) and published guidance their repairs. It’s an ongoing learning Not really, but we do get emails. Here’s
to assist volunteers to do the same in process. If you have nothing to repair, one from loyal reader Sam Finklea
you can just enjoy a cup of tea or coffee. across the Pond. Commenting on my
Repair culture: the numbers Or you can lend a hand with someone tirade against scam telephone calls, he
(February 2019) else’s repair job. You can also get in- says: ‘Mark, we on this side of the pond
• A decade on since the first Repair spired to do some reading – by leafing share your frustration with robocallers,
Café was held in Amsterdam in through books on repairs and DIY. You but unfortunately your announcement
2009, there are 1,700 Repair Cafés can visit a Repair Café in your own area on our behalf of their demise, as Mark
in 35 countries. ([Link] or start Twain said under similar circumstances,
• According to data contributed to one yourself ([Link] “is premature”. Regrettably, Congress
Restart’s ‘Fixometer’, 54% of all start/). The house rules are not onerous has not yet acted, nor has the FCC im-
products brought to a Restart Party ([Link] posed effective rule changes.’
are repaired on the spot; a further Thanks for your clarification, Sam.
27% are ‘repairable’ once a spare And there’s more… Let’s hope that the scammers waste
part or relevant tool is procured. As well as Repair Cafés there is also the time of sufficient Congresspeople
the Restart Project. This is a repair café to stimulate some action soon!

10 Practical Electronics | September | 2019


STORE YOUR BACK ISSUES ON CD-ROMS
VOL 1 BACK ISSUES – January 1999 to June 1999
Plus bonus material from Nov and Dec 1998 ONLY £16.45 each
VOL 2 BACK ISSUES – July 1999 to December 1999
Five years just £29.95
VOL 3 BACK ISSUES – January 2000 to June 2000
including VAT and p&p
VOL 4 BACK ISSUES – July 2000 to December 2000
VOL 5 BACK ISSUES – January 2001 to June 2001 VOL 23 BACK ISSUES – January 2010 to June 2010
VOL 6 BACK ISSUES – July 2001 to December 2001 VOL 24 BACK ISSUES – July 2010 to December 2010
VOL 7 BACK ISSUES – January 2002 to June 2002 VOL 25 BACK ISSUES – January 2011 to June 2011
VOL 8 BACK ISSUES – July 2002 to December 2002 VOL 26 BACK ISSUES – July 2011 to December 2011
VOL 9 BACK ISSUES – January 2003 to June 2003 VOL 27 BACK ISSUES – January 2012 to June 2012
VOL 10 BACK ISSUES – July 2003 to December 2003 VOL 28 BACK ISSUES – July 2012 to December 2012
VOL 11 BACK ISSUES – January 2004 to June 2004 VOL 29 BACK ISSUES – January 2013 to June 2013
VOL 12 BACK ISSUES – July 2004 to December 2004 VOL 30 BACK ISSUES – July 2013 to December 2013
VOL 13 BACK ISSUES – January 2005 to June 2005 VOL 31 BACK ISSUES – January 2014 to June 2014
VOL 14 BACK ISSUES – July 2005 to December 2005 VOL 32 BACK ISSUES – July 2014 to December 2014
VOL 15 BACK ISSUES – January 2006 to June 2006 VOL 33 BACK ISSUES – January 2015 to June 2015
VOL 16 BACK ISSUES – July 2006 to December 2006 VOL 34 BACK ISSUES – July 2015 to December 2015
VOL 17 BACK ISSUES – January 2007 to June 2007 VOL 35 BACK ISSUES – January 2016 to June 2016
VOL 18 BACK ISSUES – July 2007 to December 2007 VOL 36 BACK ISSUES – July 2016 to December 2016
VOL 19 BACK ISSUES – January 2008 to June 2008 VOL 37 BACK ISSUES – January 2017 to June 2017
VOL 20 BACK ISSUES – July 2008 to December 2008 VOL 38 BACK ISSUES – July 2017 to December 2017
VOL 21 BACK ISSUES – January 2009 to June 2009 VOL 39 BACK ISSUES – January 2018 to June 2018
VOL 22 BACK ISSUES – July 2009 to December 2009 VOL 40 BACK ISSUES – July 2018 to December 2018

FIVE-YEAR DVD/CD-ROMs 15 YEARS OF EPE!


No.1 – Jan 03 to Dec 07 AMAZING
No.2 – Jan 04 to Dec 08 BUNDLE OFFER
No.3 – Jan 05 to Dec 09 No.1 – Jan 03 to Dec 07
No.4 – Jan 06 to Dec 10
PLUS
No.5 – Jan 07 to Dec 11
No.6 – Jan 08 to Dec 12
No.6 – Jan 08 to Dec 12
PLUS
No.7 – Jan 09 to Dec 13
No.8 – Jan 10 to Dec 14
No.11 – Jan 13 to Dec 17
No.9 – Jan 11 to Dec 15
ALL FOR JUST
No.10 – Jan 12 to Dec 16
No.11 – Jan 13 to Dec 17 £39.95
No.12 – Jan 14 to Dec 18 – NEW! All DVD/CD-ROMs are suitable for any PC with a DVD/CD-ROM drive.
They require Adobe Acrobat Reader (free from: [Link]/acrobat)

ORDER YOUR CD-ROMs TODAY!


JUST CALL 01202 880299 – OR VISIT [Link]
Net Work
Alan Winstanley
This month, we examine the rapid transformation of electricity generation in the UK and the rise
of automotive smart systems. Plus, ‘Newsbeat’ updates on SpaceX, Huawei and Internet radio.

E
xactly 20 years ago I was be/gEAN5WFZ6eI). It was hoped that of this operation includes the construc-
researching a mini-series on elec- new CCS (carbon-capture and storage) tion of ‘Hornsea One’, Ørsted’s wind
tricity generation called From power plants would replace these power farm being built in the North Sea 120km
Pipelines to Pylons for Everyday Practi- stations, but government funding for the from the seaside resort of Hornsea. Gen-
cal Electronics. The UK power generation unproven technology was withdrawn. erating 1.2GW of electricity (equal to
company National Power, as it was then For anyone interested, the writer’s origi- two Killingholme ‘A’ power plants),
called, allowed me to clamber all over nal mini-series can be downloaded from: the 400km2 wind farm will become the
a relatively new combined cycle gas [Link] largest offshore wind farm in the world.
turbine (CCGT) 650MW power station More details are at [Link]
– Killingholme ‘A’ – during its main- The winds of charge are blowing... [Link]
tenance shutdown period. Everything In 1999, I wrote how nuclear, gas and Since the Industrial Revolution, Brit-
was laid bare, and over several weeks the ‘interconnectors’ (power cabled into ain’s ‘evergreen’ credentials have been a
I plotted the story of electricity gener- Britain from overseas) formed the core long time in the making, but there can
ation, starting from the natural gas that of Britain’s power generation landscape be no doubt that the country now has
supplied the power station, through the at that time, with coal, oil and hydroe- some highly ambitious green energy
turbines and 400kV pylons and all the lectricity topping up the supply at peak plans, having also developed huge ca-
way to the mains outlets found in Brit- periods. 20 years later, the UK has set pacity to manufacture and ship wind
ain’s homes and factories. The power an ambitious target of cutting net carbon turbines to meet future demands for this
station had been built in the 1990s emissions from its energy sources to zero much cleaner form of energy.
in a period dubbed ‘the dash for gas’, by the year 2050. In May this year, Brit-
when a newly privatised British energy ain went for two whole weeks without Technology in motion
market erected a whole crop of these drawing power from its coal-fired power With climate change and green energy
‘off-the-shelf’ power stations, fuelled stations, and for two days an astonishing still in mind, the move away from petrol
by plentiful supplies of North Sea gas. quarter of electricity was solar powered. and diesel cars to electric vehicles is
As things turned out, the power sta- The UK National Grid ([Link]- inexorable. In 2019, Volvo switched
tion would change hands several times, [Link]) aims to produce more of our to producing ‘electrified’ hybrid and
but the increasingly unwanted site failed electricity from zero-carbon resources electric vehicles (EVs) and eventually
to attract new owners and ultimately it than from fossil fuels such as coal and they will phase out pure ICE (internal
was closed down. In 2017, it was de- gas. This year, they hope that wind power combustion engine) cars altogether.
molished, as seen in a YouTube video will account for nearly 19% of the total Adverts for the latest electric cars from
at: [Link] energy generated, fifteen times more than manufacturers including Hyundai, Kia
A neighbouring 1GW power station a decade ago. The country also imports and Renault show the way that indus-
(Killingholme ‘B’) owned by [Link] also clean hydroelectricity from Norway try and society are moving, at the same
closed: in a promo video, the manufac- through the North Sea Link intercon- time mixing together new technology
turer Micronics Flowmeters hailed it as nector (see: [Link] with some old ideas.
a ‘great example of a sustainable and Although the author’s adopted gas Just as the new millennium arrived,
efficient energy provider’, but today power station is now a distant memory, on 4 January 2000 the Daily Telegraph
there’s nothing left. (See: [Link] the local region is seeing massive in- newspaper printed a headline: Satellite
vestment by several puts the brakes on speeding drivers. The
major wind turbine paper posited the theory of pairing GPS
factories, including satellite navigation with some form of
Denmark’s Ørsted ‘digital road map’ to track a vehicle’s lo-
([Link] cation and, if necessary, force it to slow
en) and Siemens down, perhaps when it broke the pre-
([Link] vailing speed limit. It might even force
QZTsl) situated in a speed reduction at peak rush hours
nearby Grimsby and when passing by schools or other sen-
Hull. Their Humber sitive areas. Fast forward to today and
estuary location, cou- inevitably the idea of technology nag-
pled with a highly ging drivers about their speed has gained
skilled workforce is traction: the latest cars boast a multi-
ideal for building and tude of electronic driver aids, including
Britain’s RAC breakdown service offers ‘EV Boost’ to help shipping wind tur- road-sign speed limit recognition, which
jump-start stranded electric vehicles. bines out to sea. Part works surprisingly well: a windscreen

12 Practical Electronics | September | 2019


camera recognises a traffic speed sign
and displays it on the dashboard as a
timely reminder. Some in-car sat-nav
systems reinforce this by also display-
ing the speed limits on a map.
Under new EU laws, cars built after
May 2022 must employ Intelligent Speed
Assistance (ISA) systems like those float-
ed in the Telegraph at the turn of the
century: legislators propose combining
GPS tracking with an in-car GPS-linked
speed limit database to determine wheth-
er a vehicle is speeding. Hearing of this,
the mainstream news media busied itself
broadcasting clips showing cars slow-
ing down automatically in response to
speed limits, as though the driver had
no control over events. In practice,
A Tesla electric car being driven totally hands-free. Its console has a 17-inch LCD and
when a speeding infringement is de-
on-board cameras analyse the surrounding traffic.
tected the system will merely throttle
the engine back to reduce speed with- and is about 107 million miles away. of current Huawei smartphones hope to
out applying the brakes. Some modern See [Link] for the learn whether or not Google can contin-
cars with ‘economy’ mode settings work latest news. All-electric Tesla cars bris- ue releasing apps, patches and updates
in a similar way, electronically limiting tle with electronic technology and are for Huawei’s current Android phones.
acceleration to save fuel. fitted with hardware to enable self-driv- They have enjoyed a temporary reprieve
New EU cars are also mandated to in- ing in almost all circumstances, they say. from America’s technology export ban
corporate eCall, the pan-European ‘112’ Electric vehicle charging points are and indeed the author’s Huawei phone
emergency service, which uses GPS to starting to appear even in provincial out- suddenly updated itself overnight from
summon help automatically in the event of-town retail parks, but when things go Oreo (8.0) to Pie (9.0), possibly a sign of
of a collision (US readers, think of GM’s wrong can early EV adopters suffering Huawei rushing out OS updates before
OnStar.) Cars equipped with eCall will from ‘range anxiety’ rely on a traditional the shutters come down.
use a GSM connection to provide a voice breakdown recovery service to help? In The UK’s Department for Digital, Cul-
service and download digital map up- April, the RAC (Royal Automobile Club) ture, Media and Sport (DCMS) is working
dates. Traffic sign recognition cameras breakdown service launched EV Boost, with Britain’s National Cyber Security
may also supplement ISA systems. Most which enables its service trucks to give centre and others to consult on regu-
of the electronics needed to implement stranded EVs a quick charge. latory proposals regarding consumer
ISA is therefore already available off Internet of Things (IoT) security, with a
the shelf and simply needs integrating. Newsbeat view to shifting onto manufacturers the
Manufacturers are already introducing The US Department-of-Defence-con- responsibility for securing IoT devices
automatic and manual ISA in their ve- trolled SpaceX mission STP-2 (Space Test and away from consumers. Under the
hicles: a list of current EU cars fitted Program-2), launched on 25 June, was a proposals, certain security requirements
with ISA can be found at: [Link] Falcon Heavy’s first night-time launch. would become mandatory.
pe-sep19-nw3 Its ‘ride sharing’ mission deployed pay- Car dashcam maker Nextbase has in-
Looking ahead, to help win over a loads from several sources, including troduced a trio of Alexa-friendly models.
motoring public faced with the ‘threat’ 24 experimental USAF military satel- Claiming to include the world’s first
of compulsory ISA systems, early ex- lites and a private load comprising the 1440p dashcam with Alexa, the Next-
amples are expected to have full on-off cremated remains of 152 people. STP-2 base 322GW, 422GW and 522GW have
control and motorists will be able to was the first mission to use ‘recycled’ Bluetooth and Emergency SOS and
override the system, for now anyway. It side boosters recovered from previous Alexa-powered navigation coupled to
will doubtless only be a matter of time missions, but SpaceX has yet to recov- your smartphone. Rear-window camer-
before such choices are taken away from er a Falcon Heavy centre core rocket as are optional extras and an Alexa skill
drivers. Future compatibility with the successfully. Meanwhile, SpaceX has is promised that offers voice control of
EU’s own Galileo satnav system is an- lost contact with three of the 60 Star- the dashcam. More details at: www.
other consideration; although it still link satellites launched in May (see last [Link]
has kinks to iron out since Galileo went month’s column). They are expected If you enjoy listening to streaming
down altogether for several days in July. to burn up in re-entry sometime in the radio, try [Link] from the
The entrepreneur behind the SpaceX future, hopefully without generating Netherlands. It offers a global view of
rocket programme featured last month, snowballing clouds of space junk that Internet-based radio stations. After pop-
Elon Musk, took satellite navigation to risk damaging other orbiting satellites ulating the globe with ‘seeds’ (radio
a whole new dimension 18 months ago – a scenario similar to one envisioned stations), simply drag it around and
when he launched one of his Tesla cars in the disaster movie Gravity. click on a location to tune in. You can
into space on board a Falcon Heavy. The US chip maker Micron has been li- add to favourites, visit a station’s web-
orbiting car has been ‘steered’ ever since censed to re-commence exports of site and mobile apps are available as
by a mannequin named ‘Starman’ to the memory chips to Huawei, the embattled well. That’s all for now – see you next
sound of David Bowie’s Space Oddity Chinese telecoms giant that was prohibit- month for more Net Work!
and it holds the record for being the ed from trading with the US in May (see
farthest-travelled car in the universe. Net Work, August 2019) for reasons of The author can be reached at:
It is currently travelling at 11,000 mph national security. In mid-August, owners alan@[Link]

Practical Electronics | September | 2019 13


This design combines
two very popular
projects, the Induction
Motor Speed Controller
and Micromite Plus

LATH-E-BOY Explore 100 with 5-inch


Touchscreen, then adds
some other circuitry, to
provide an easy way to
control a lathe.
It automatically adjusts
its speed to suit the
material which is being
turned, provides a
constant display of
the lathe’s status and
allows its speed and
direction to be selected.

Intelligent Touchscreen Lathe Speed Controller


Design by Peter Bennett – Words by Nicholas Vinen

M
ost lathes, apart from small fine-tune the speed, while monitoring width modulation (PWM). It has been
wood-turning machines, are the actual RPM. designed this way to allow for relatively
powered by an induction mo- This article gives all the details on long cable runs (of up to 50m). In most
tor. The problem with using an induc- adding the extra circuitry required for cases though, those cables will be a few
tion motor is that until quite recently, the IMSC / Explore 100, how to hook metres at most.
the most common ways to control them up together, and to the lathe, and With CON2, all eight connections
lathe chuck speeds involved belts and how to achieve control. between the two main modules (the
stepped pulleys or a gear box. IMSC Interface and the Explore 100)
While they are still useful, it is now Circuit description are optoisolated so that ground loops
possible to control chuck speed and The circuit for this project is shown are not an issue, despite the possibility
direction using our 1.5kW Induction in Fig.1, overleaf. It is broken up into of a large distance between the units.
Motor Speed Controller (IMSC), which several blocks, to reflect the physical This also prevents ground shifts due to
was originally published in the January layout of the system. the long wiring affecting the accuracy
and February 2019 issues of PE. The large block at centre right repre- of the control signals.
In addition to providing speed/ sents the Micromite Plus Explore 100 CON3 connects the Explore 100
direction functions, why not provide unit, with LCD touchscreen. This is control box to the relay box, which is
extra features such as a speed read-out, housed in a large Jiffy box, along with wired between the outputs of the IMSC
touch-screen control interface and so a few passive components, an opto- (shown at left) and the induction mo-
on? That’s all doable by building an Ex- coupler and four transistors. tor itself (at bottom right). The relay
plore 100 with the 5-inch touchscreen These components interface the box switches the two windings of the
and then programming it to control Explore 100 to the rest of the circuitry motor to control start-up and direction
the IMSC. required to control the induction motor. of rotation.
You can see from the screen grabs Those connections are made via two The three high-current mains relays
in this article that the Lathe Controller Cat5 cables, which are plugged into 8-pin are driven by NPN transistors Q1-Q3
interface is quite simple to use and saves RJ-45 sockets CON2 and CON3 (note that within the control box, via the 6-wire
you quite a bit of time and effort since CON3 only uses six of the eight available cable, and each relay has a coil back-
all you need to do is specify the material wires). Pins 1-2, 3-4, 5-6 and 7-8 are con- EMF quenching diode.
type and diameter and it will automati- nected to the twisted pairs within the When RLY2 switches on, it energises
cally select a suitable motor RPM. You cable (but note that not all Cat5/6 cables the motor start winding. When RLY1
can then adjust this further if necessary. are wired like this). is switched on, it reverses the polarity
Once you have selected the material The connections made over Cat5 use of this winding, so the motor will start
type and/or spindle speed, you can current loops and, in the case of the spinning in the opposite direction. As
then control the motor direction and motor speed control signal, 4kHz pulse- its name suggests, the start winding is

14 Practical Electronics | September | 2019


only energised when the motor is first phase. This means the optocoupler
started, hence the relay. After that, output is switched on to produce one
the start winding is disconnected so pulse for each AC cycle fed to the motor.
it doesn’t burn out. The motor keeps The two extra 5.1kΩ resistors
spinning in the direction that it started. limit the LED current to ~17mA, well
RLY3 is used to energise the Run within the 80mA rating of the device:
winding. You may wonder why this 350VDCpeak ÷ (4 × 5.1kΩ).
is necessary since the IMSC can be The output pulses from the frequen-
switched on and off. When the IMSC cy sense circuit are fed right through
is switched off, it will slowly spin the the IMSC Interface box and back to the
motor down at the programmed ramp Explore 100 unit via pins 1 and 2 of
rate. By disconnecting the run winding the Cat5 cable. One end of this signal
from the IMSC, the lathe motor will is terminated to the Explore 100’s local
spin down more rapidly and naturally, ground, while the other has a 1.2kΩ
improving safety. pull-up resistor to the 3.3V rail, giving
Three LEDs are also fitted into the a 3.3V square-wave signal.
box housing the Explore 100, labelled This square wave is filtered using a
Reverse (yellow), Start (red) and Run 120kΩ/1µF low-pass filter, before be-
(green). These are effectively wired in ing fed to pin 11 on the Explore 100
parallel with the three relay coils (via I/O header (‘read RPM’). The PIC32
CON4), with 560Ω current-limiting (Micromite Plus) in the Explore 100
resistors in series with each LED. These can then count the number of pulses
The IMSC, interface circuitry, relay
provide feedback on what the motor on this pin each second to determine box and plugpacks were mounted on
is doing. the spindle speed. This RC filter has the rear of the lathe stand, with the
a time constant of 120ms, which may touchscreen controller box up on top.
Speed controller interface seem quite long with respect to the
Now turning our attention back to the 50Hz waveform when the motor is ground of the IMSC, resulting in a 3.3V
control circuitry around the Explore running at full nominal speed, with a square wave at pin 5 of OPTO2.
100 and the second Cat5 cable, this is 50Hz output. However, the filter has This passes through an RC low-pass
wired to a small box attached to the side to cope with a pulse rate from 50Hz filter of 4.7kΩ and 10µF, having a –3dB
of the IMSC which provides an isolated all the way down to about 5Hz, so the point of 3.4Hz. This smoothes the
interface to it. A small, separate circuit 120ms time constant seems to be a PWM waveform to produce a variable
board labelled ‘output frequency sense’ reasonable compromise. voltage that depends on the PWM duty
is fitted inside the IMSC enclosure. Let’s As well as measuring motor speed, cycle. The variable voltage is then fed
take a look at this first. the Micromite also needs to be able to the control input (Vin) of the IMSC.
This is connected across the U and W to control the speed. This is done us- The 3.3V and GND rails for this part of
motor outputs which power the main ing the PWM output on pin 22 of the the circuit are connected only to CON4
‘run’ winding. The differential voltage I/O header (CON1), which drives the on the IMSC so that digital noise on
between these outputs passes through base of NPN transistor Q4 via a 1kΩ other pins does not unduly affect the
an RC low-pass filter comprising two current-limiting resistor. When Q4 is analogue control signal.
5.1kΩ 1W (mains-rated) resistors and a on, it pulls current through the upper There is a second, Darlington output
220nF X2 mains capacitor. This has a LED in the HCPL2531 dual high-speed optocoupler within the IMSC Interface
–3dB point of around 71Hz so it filters optocoupler within the IMSC Interface (OPTO3) which drives the RUN input
out the IGBT switching edges. module (OPTO2). at CON5 of the IMSC, enabling or disa-
The resulting sinewave signal is Because the emitters of the two bling the motor output. A 1kΩ pull-up
then applied to the infrared LED output transmitters are joined together, resistor to 3.3V sets the default state to
within a PS2501 Darlington output we’re only using half of this device. have the motor switched off.
optoisolator. D4, a 1N4007 diode The collector of the output transistor at It only switches on when pin 7 on
connected in inverse parallel with pin 7 is connected to a 3.3V rail output the Explore 100 I/O header goes high,
this LED prevents it going into reverse from the IMSC, while the emitter at pin allowing current to flow through the
breakdown for one half of the output 5 has a 1kΩ pull-down to the analogue emitter LED within OPTO3. The LED

Screen1: the setup screen appears when the Lathe Screen2: once setup is complete, it switches to this screen
Controller is first powered on and allows you to set either where you can start, stop and reverse the motor, monitor
the material type and diameter, or the chuck RPM. chuck speed and tweak it if necessary.

Practical Electronics | September | 2019 15


L

Lath-E-Boy Induction Motor Controller


Fig.1: circuit diagram of the Lathe Controller, with the ISMC (Induction Motor Speed Controller, at left) and Explore
100 (centre right) circuits shown as ‘black boxes’. See the relevant articles (referred to in text) for internal details. The
additional circuitry ties these two modules together as well as providing motor speed feedback, safe motor starting and
reversing, feedback-based speed control and status indication.

current is set by a 470Ω resistor between normally held high by a 270Ω resistor So these LEDs light up to indicate
this LED cathode and ground. When and this signal is fed to pin 13 of the whether the motor start or run winding
pin 7 goes high, OPTO3 switches on, Explore 100 I/O (‘Up To Speed’) so that is energised, and to show which direc-
pulling RUN low. it can be sensed by the Micromite. tion the motor is running.
The OUT terminal on CON6 of the The rest of the circuitry comprises the
IMSC is pulled low by the speed con- Remaining circuitry mains power supply and motor wiring.
troller when the motor is up to speed. Earlier, we described how RLY1-RLY3 The 230VAC input plug earth connects
This is fed through the IMSC Interface are used to start the motor spinning in to the earth terminals on the IMSC and
to arrive at pin 2 of OPTO1, the cathode either direction and then to allow it to the motor housing. Live and neutral pass
of its internal emitter LED. The LED continue to run. The coils of the three through a double-pole power switch
anode is connected to the 3.3V supply relays are driven by NPN transistors Q1- and then onto the input terminals of
rail of the IMSC via a pi filter consisting Q3, which are in turn controlled from the IMSC and two plugpacks. The 12V
of a 100nF capacitor, a 10nF capacitor I/O pins 21, 23 and 25 on the Explore plugpack powers the relays, while the
and a 110Ω resistor, which also acts as 100. Each has a 1kΩ base current limit- 5V plugpack powers the Explore 100.
a current limiter. ing resistor and a back-EMF quenching The rest of the circuitry draws power
Thus, when the motor is up to speed diode connected across the relay coil. either from the regulated supply rails
and OUT is low, 30mA will flow through Indicator LEDs1-3 are connected in within the Explore 100 or the IMSC.
this circuit, switching on OPTO1 and parallel with the relay coils, each with The three IMSC outputs are wired up
pulling its output pin 4 low. This is their own 560Ω current-limiting resistor. to the terminals of relays RLY1-RLY3

16 Practical Electronics | September | 2019


Reproduced by arrangement with
SILICON CHIP magazine 2019.
[Link]

and in some cases, directly to the mo- The set-up screen is shown in This is an excellent proxy for the
tor terminals. Screen1. It provides auto and manual spindle RPM, as verified with a tempo-
See the panel elsewhere in this article RPM control modes. In auto mode, the rary Hall Effect pickup on the tool post
describing how the motor connections user selects material and diameter and and a magnet on the chuck. The material
are made. As mentioned earlier, two of the controller does the rest. If manual and diameter selections are repeated on
the three motor drive outputs (U and mode is selected, the user sets the speed the Operation page.
W) are also connected to the Output regardless of material and diameter. The three square ‘radio’ buttons in the
Frequency Sense circuitry. Once the selection has been made, the lower right corner tell the software which
operation page is displayed, as shown of the three motor belt pulley positions
Software operation in Screen2. is in use, as this affects the maximum
The main goal of this project was to have FORWARD, REVERSE and OFF are and minimum RPM values. The lower
a supervisory control for the lathe, into self-explanatory. The spinbox ‘Tweak speed pulleys are used only if additional
which could be entered the material type RPM on-the-fly’ allows the user to torque is required at low speed. (A ‘radio
and diameter to be turned. The software switch to manual mode and adjust button’ is like a checkbox,– except only
would then set the required speed and the motor speed. Target RPM is the one in a group can be selected at any
would control the lathe to maintain that speed we want, while Actual RPM is given time.)
speed, making the turning process much the inferred motor speed, based on To ensure the software is responsive,
simpler. The Explore 100 with 5-inch the frequency measured at the motor almost all events are handled in inter-
touchscreen provides the ideal platform. controller output. rupt routines, including the touchscreen

Practical Electronics | September | 2019 17


interface, which uses the TOUCH (REF) After that, it’s pretty much
function. The motor speed is sensed just a matter of soldering
by measuring the intervals between an the components in place
interrupt triggered by the level change where indicated on the
on the READ RPM input. PCB silkscreen.
Motor speed control is achieved The prototype Speed
using a simple proportional feedback Controller interface was
strategy. A closed loop continually built into a small Jiffy box
measures the error and reduces it. Ef- which was mounted to the
fective gain of this loop is controlled by outside of the IMSC, while
selecting the time between corrections the Explore 100 interface
and the proportion of error applied to plugged directly into the Fig.2: here’s how the designer’s lathe motor was
wired up to the Speed Controller, ignoring the
each correction. Explore 100. As you can relays which control start-up and reversing, for the
These numbers are determined by see from the photo, the moment. The start capacitor is shorted out since
experiment and are quite flexible. Set- ‘output frequency sense’ it’s no longer required. Note the two possible ways
tling time and stability are completely section of the circuit was to wire up the one end of the start winding.
adequate for the purpose. Since the mounted inside the IMSC
source code is available, the software box itself. holes for the status indicator LEDs and
can be modified by those who would The Explore 100 Interface, IMSC some holes for wires/sockets for the DC
like to adapt it for their own projects. Interface and Output Frequency Sense power input and RJ-45 (or DB9, as in
The only niggle is the loading time sections of circuitry were built on the prototype) interface sockets.
of the title or ‘splash’ screen. This takes solder-type prototyping boards using
nearly 12 seconds to load from the point-to-point wiring, so there are no Loading and using the software
micro SD card. PCBs or overlay diagrams. The relays If you’ve built the Explore 100 kit it
Perhaps it should be called the ‘drip were mounted in a separate box with should come with a pre-programmed
screen’! This is due to the way that an earthed aluminium backplate, as microcontroller, but you still need to
MMBasic loads data off the SD card. shown in the photo opposite. set up the LCD panel and then load the
Since each section of the circuit is Lathe Controller BASIC code into the
Construction relatively simple, after soldering the Explore 100.
You will need to build and test the IMSC required components to a piece of You should do this with the IMSC
and Explore 100 modules separately protoboard, you should be able to use and related circuitry powered down –
before you can build the extra circuitry the circuit diagram as a guide to wir- however, the circuit has been designed
which ties them together. ing it up. You can use wire-wrap wire so that nothing bad should happen if
If you’re building the IMSC from (Kynar), bell wire or light-duty hookup the unit is powered up without any
a kit, it should come with assembly wire to make the connections between code running on the Explore 100.
instructions. Otherwise, refer to our component pins. In other words, the default state of
articles in the January and February The Explore 100 and its associated each output is set up to be safe and not
2019 issues of PE. interface components, shown in the drive anything, including the motor.
For the Explore 100, assembly in- shaded box in Fig.1, were housed in a Instructions for setting up the LCD
structions are in the September and single large jiffy box. You will need to panel and touchscreen were given in
October 2017 issue; the only tricky make a rectangular cut-out in the lid the September and October 2017 is-
aspects are soldering the few SMDs. for the Explore 100’s LCD, plus three sue; however, if you don’t have that
handy, you can simply enter the fol-
lowing commands over the serial or
USB console:
OPTION LCDPANEL SSD1963_5,LANDSCAPE,48
OPTION TOUCH 1, 40, 39
GUI CALIBRATE
After typing the final command and
pressing enter, you will be presented
with a cross-hair target in the corner
of the LCD screen.
Press on its centre with a stylus-
type object (eg, a toothpick) and then
repeat for the targets which appear in
the other three corners. With any luck,
you will get a message on the console
which reads ‘Done. No errors’ and that
indicates that the touchscreen has been
set up correctly.
You can then download the Lathe
Controller BASIC code from the PE
website and upload it using MMEdit
or similar software (MMEdit is a free
download for Windows or Linux; see
[Link]/[Link]).
This shows the wiring between the IMSC and interface box. The speed feedback Once the code has been uploaded,
board is just visible below the main PCB. Note the improved ventilation. MMChat should automatically launch

18 Practical Electronics | September | 2019


(Left) The
pre-existing
direction Parts list – Lath-e-Boy Lathe Controller
control 1 Induction Motor Speed Controller kit [Altronics Cat K6032]
switch box,
1 Micromite Plus Explore 100 kit from [Link]
which was
wired to 1 5-inch diagonal colour LCD to suit Explore 100
both motor [eg, [Link] item 32665326615 or 32659478023
windings. 3 10A 250VAC DPDT relays, 12V DC coil (RLY1-RLY3; [Jaycar SY4065])
3 DPDT relay cradles (optional, for RLY1-RLY3; [Jaycar SY4064])
2 10A mains cables, cut in half (for mains input and to connect plugpacks)
1 12V DC 500mA regulated plugpack
(Below) This 1 5V DC 1A regulated plugpack
junction box 1 10A 250VAC DPDT toggle switch (S1)
connects the 1 10-way connector with matching plug and cable (to connect IMSC Interface to
Controller Speed Controller)
outputs to 4 RJ-45 modular connectors
the motor. 2 Cat5(e)/Cat6 cables with twisted pairs 1–2, 3–4, 5–6, 7–8
1 large solder type protoboard (cut up as required)
1 large jiffy box (for Explore 100 and associated components)
1 medium-sized jiffy box (for IMSC Interface)
1 diecast aluminium box (to house RLY1-RLY3; must be earthed)
various lengths and colours mains-rated and light-duty hookup wire
Semiconductors
3 PS2502-1 Darlington optocouplers (OPTO1,OPTO3,OPTO4)
1 HCPL2531 dual high-speed optocoupler (OPTO2)
4 BC337 NPN transistors (Q1-Q4)
1 yellow 5mm LED (LED1) 1 red 5mm LED (LED2) 1 green 5mm LED (LED3)
3 1N4004 1A 400V diodes (D1-D3) 1 1N4007 1A 1000V diode (D4)
Capacitors
1 10µF 10V electrolytic 1 1µF multi-layer ceramic
1 100nF MKT or ceramic 1 10nF MKT or ceramic
1 220nF X2 MKP
Resistors (all 0.25W 1% unless otherwise stated)
1 120kΩ 4 5.1kΩ (1W 5%) 1 4.7kΩ 7 1kΩ 3 560Ω 1 470Ω 1 270Ω
1 240Ω 1 110Ω

and you can then issue the ‘OPTION It’s best do this initially with nothing The operation of the software was
AUTORUN ON’ command, followed by in the lathe so you can verify it’s working explained earlier, although it’s pretty
‘RUN’ and the graphical user interface correctly without risking any damage. much self-explanatory anyway.
(GUI) should appear on the LCD screen.
You can verify that this appears to
be working before disconnecting your
PC and you are then ready to power the
whole rig up and test it out properly.

Using a 3-phase motor


While this project was designed to be
used with a lathe driven by a single-phase
induction motor, the IMSC is capable of
driving 3-phase delta-wound motors.
Since a 3-phase motor lacks a start
winding, start capacitor and centrifugal
switch, you don’t need RLY1 or RLY2 and
their associated wiring. RLY3 will need to
be a four-pole type to allow it to switch
all three phases.
However, the design as presented here
does not drive the REV terminal on the
IMSC so it has no way of commanding
motor reversal for a 3-phase motor.
Therefore, you would need to run a
connection between the collector of Q1
and the REV terminal on the IMSC so that
the Explore 100 can reverse the motor
direction. The software should not need
any modifications. The relay box, which connects the IMSC to the motor, has an earthed aluminium
backplate. If using a 3-phase motor, only two relays are required.

Practical Electronics | September | 2019 19


Modifying the motor to allow the speed controller to be connected
It is worth reading the January and Febru- Although the Controller permits a slow This is set by trimpot VR2 (RAMP) in the
ary 2019 articles on the Induction Motor ramp-up from a low voltage, at slow speeds Controller. As the voltage is applied and
Speed Controller to get a background on the winding reactance drops proportionately the armature begins to rotate, it generates
induction motors and a description of the to the frequency, so the current does not a back-EMF that reduces the current and
Controller. While its main purpose was to necessarily drop as expected. This motor gives room for more voltage to be applied,
vary the speed of pool pumps, it was also simply drew too much current for the Con- accelerating the armature further. The
suitable for the control of machine tools, troller to start it. ramp voltage must not increase too fast
such as lathes. There is also a possibility, as yet un- for the armature to accelerate and generate
Most basic lathes vary the speed of the verified, that with a capacitor in circuit, the current limiting EMF.
chuck by changing belts, an inconvenient the Controller interprets a leading power
and inefficient method of approximating factor as a short circuit, since in both cases Other motor configurations
the desired speed. As a result, it is likely it would see current increasing without a What if both ends of the windings are not
that many hobbyist lathes remain on the corresponding voltage increase. brought out, as is typical of a huge number
one speed for most of their lives, a far Fortunately, the Controller itself provides of small, non-reversible capacitor start in-
from optimum situation for quality and the solution. It has a three-phase output. We duction motors? Can such a motor still be
speed of operation. Variable-speed con- can split the windings across two phases to controlled in the manner described above?
trol is an attractive modification. keep each phase current within the maximum The answer in many cases is yes!
Any reasonably sized lathe will use a of the Controller, at least up to a certain size of Not only can such a motor be speed
capacitor-start motor. This has a high motor. One phase is selected for the main wind- controlled, it can also be reversed. Fig.3
starting torque to overcome the load ing. Of the other two phase voltages, one leads shows the two most likely motor con-
presented by the belts, pulleys, close-fit the main by 120° and the other lags by 120°. figurations at left. In both cases, the start
bearings and back gears, with a centrifu- Either of these should give sufficient capacitor is removed and the wire that
gal switch to take the start winding out of quadrature current to the start winding to connects directly to one of the existing
circuit as the motor comes up to speed. create a rotating field, but it is necessary terminals is taped off and secured. The
Unfortunately, the Induction Motor Speed to remove the start capacitor and short its remaining wire is the new connection
Controller is specified as being unsuitable connecting leads together. If the output point for the start winding.
to drive such a motor. But is it? terminals of the Controller are labelled A, This wire, adequately insulated, is
The main reason given for the unsuit- B and C, the main winding is connected brought out of the capacitor chamber.
ability is that at a low selected speed, the between A and C and one end of the start This lead and the previously assigned
centrifugal switch will cut back in, and winding is connected to B. phase and neutral leads connect to the
the current drawn by the start winding The other end of the start winding can three-phase output of the Speed Con-
may burn the winding out. Almost as an be experimentally connected to A, then to troller, as shown at right. Reversal of
afterthought, a sidebar advises that ‘there C. The better of these options is typically the direction of rotation is achieved by
is also a risk that the over-current protec- the one that starts to turn the motor at the swapping any two phases.
tion in the Speed Controller will simply lower voltage. It does not matter whether Changing a faulty start capacitor is
prevent normal operation’. Amen to that! the motor starts in the forward or reverse routine maintenance on induction motors
The subject of this project is a 1970s- direction. The direction of rotation can be – hence, removing the start capacitor and
era Taiwanese lathe with a 250mm swing. controlled with the forward/reverse relay or installing the two-phase wiring should be
Its motor is a ¾ horsepower (560W) four- a winding polarity reversal. well within the capability of any builder
pole capacitor-start induction motor. It is Fig.2 shows the connection of the motor with the knowledge and skill to build the
also reversible. to the Controller in this case. I found that Controller. Doing so opens up a greatly
At first glance, it appears well within the this ¾ HP motor had to be accelerated with increased number of applications for
1500W capacity of the Speed Controller. about a four-second ramp from 0-50Hz. variable speed operation.
The main and start windings are brought
out to the on-off switch, which reverses one
winding to reverse the rotation of the chuck.
Having access to both ends of the
start winding overcomes the problem of
the centrifugal switch re-engaging at low
revs. It is easy to provide a relay to isolate
the start winding as the motor speed is
reduced. It is also easy to provide a relay
to reverse the polarity of the start winding
so the motor will start forward or reversed
as required.
Even with the start winding isolation and
direction taken care of, the subject motor
would not start, as the Speed Controller
tripped out with a fault indication. Over
current was a prime suspect. Certainly,
the instantaneous current on starting is
enormous – at 230VAC 50Hz, it is about Fig.3: for motors where separate connections are not provided for
50A. Starting at low speed, which means the start winding, the start capacitor can be removed and one of its
low voltage as well, should alleviate this. connections brought out to provide the connection to the start winding.

20 Practical Electronics | September | 2019


Exclusive offer

Win a Microchip dsPIC33CH


Curiosity Development Board
Practical Electronics is offering its readers the chance The board is designed to take full advantage of Microchip’s
to win one of two Microchip dsPIC33CH Curiosity MPLAB X IDE and includes an integrated programmer/
Development Boards (DM330028). debugger. The board requires no additional hardware,
The dsPIC33CH Curiosity Development Board is a making it a perfect starting point to explore the
cost-effective development and demonstration dsPIC33CH dual-core family.
platform for the dsPIC33CH128MP508 family Supported by Microchip’s MPLAB devel-
of dual-core high-performance digital signal Worth opment ecosystem, including Microchip’s
controllers. The dsPIC33CH has one core MPLAB Integrated Development Environ-
designed to function as a master, while the $35.00 ment and MPLAB Code Configurator, the
other is designed as a slave. The slave core is (approx £27.50) dsPIC33CH Curiosity Development Board
useful for executing dedicated, time-critical is a cost-effective and flexible platform
control code, while the master is busy running each enabling customers to rapidly create a fea-
the user interface, system monitoring and com- ture-rich prototype.
munications functions, customised for the end The board supports the dsPIC33CH Plug-
application. The dsPIC33CH is specifically designed in Module for motor-control platforms, available
to facilitate independent code development for each core by for Microchip’s MCLV-2 and MCHV 2/3 systems. The
separate design teams and allows seamless integration when dsPIC33CH PIM for general-purpose platforms is now
they are brought together in one chip. also available for the Explorer 16/32 development board.

Free-to-enter competition

Microchip dsPIC33CH Curiosity Development Board

How to enter May 2019 winner


For your chance to win a Microchip dsPIC33CH Charles Sparey and
Curiosity Development Board, enter your details in Jens Peter Nielsen
the online entry form at:
They each won a
[Link] Microchip AVR-IoT WG
Development Board
Closing date worth £22.30
The closing date for this offer is 30 September 2019.

Practical Electronics | September | 2019 21


Super-portable
Twin Dipole
Guitar/PA
Speaker
This guitar/PA speaker is
easy to build and really
portable. It’s also LOUD
and sounds great. When on
stage, you can project plenty
of sound to the crowd while
still being able to hear your
own playing (no foldbacks
needed). If you build it using
our recommended drivers (as
used by Hendrix and Slash),
by it has a mellow, old-fashioned
Allan-Linton Smith tone. But you can also use
different drivers for a more
modern, harder sound.

B
ecause of the way this speaker is designed, While you can use just about any two 12-inch (30cm)
it can be folded flat for easy transport and can be drivers, we are recommending Celestion units in this project
built by anyone with only rudimentary carpentry for several reasons.
skills and tools. One, they are good quality. Two, they are designed to pro-
You can easily build it in a day, with a perfect finish vide a tone to suit an electric guitar. And three, there are 22
and a professional appearance. You can even choose from different drivers in the series to choose from, each with their
a range of colours to suit your style or band! own unique sound profiles, power levels and efficiencies.
This includes four from Celestion’s Heritage series, three
Choice of drivers from the Alnico series, one from the Signature series (the
One of the great things about this design, besides the ad- Eddie Van Halen), 14 from the Classic Series and two from
vantages laid out above, is that you can choose from a range the Originals series. You can see a list of suitable drivers
of drivers which have their own unique sound. at: [Link]
And because it’s a twin-driver rig, you can use two dif- For many of the drivers, audio samples of guitar play-
ferent ones (as we have done), giving you the option of ing are provided, allowing you to get an idea of what it
three different tones: upper driver only, lower driver only sounds like before purchase. Note that this list includes
or both together. some drivers which are not suitable; ie, those which are
The drivers we are recommending come from a series not 12 inches (305mm) in diameter or those which are not
with a long history. They have been used by some people available with a 15Ω or 16Ω nominal impedance.
you may have heard of, including Angus Young, Jimi Hen- The maximum power level of the suitable Celestion drivers
drix, Slash, Eric May, Brian Gibbons and Eddie Van Halen. ranges from 15W to 100W. Our unit uses the G12M Greenback

22 Practical Electronics | September | 2019


and Vintage 30 drivers, which are rated at 96dB @ 1W, 20W Testing it out
maximum and 100dB @ 1W, 60W maximum respectively. We had our resi- Features and specifications
Since these are from the Heritage and Classic series, they dent guitar player, Drivers: Two 12-inch Celestion
give a laid-back sound with plenty of mid bass and high- Bao Smith, test the loudspeakers
end. If that isn’t your bag, see below for some other options. speaker and he con-
(recommended)
The G12M was a favourite of Jimi Hendrix; he used a firms that it has
whole raft of them to handle his powerful riffs and it was the most impor- Weight: about 17kg
also used extensively by Eddie Van Halen. On the other tant property that
Efficiency: 100dB/1W@1m
hand, the Vintage 30 has been used by Slash, Steve Stevens any guitar speaker
and Peter Frampton. needs: it can defi- Total cost: ~£200 with the
These drivers are designed to be rugged and use paper nitely make a lot of recommended drivers
cones with a small amount of doping. They are also very noise and sounds
Drive options: top only, bottom only
sensitive and are generally rated at 96-100dB/watt at one good doing so!
or both
metre because the lead guitar has to be loud! Allan also had
his guitar-crazy Simple construction
Not your grandpa’s guitar speaker mate Marcus test it
Easy to fold up and transport
Traditionally, guitar speakers consist of a small wedge- out in an extended
shaped box with one to four drivers arranged along the jam session, using
front. These generally have no acoustic filling, bracing or a Gibson guitar and 30W valve amplifier. Afterwards, he
damping and often have a resonant or ‘boxy’ sound that commented: ‘It’s great for a lead guitar and has plenty of
accentuates notes played at the resonant frequency of the volume which will rise above the other instruments in
box. This gets boring pretty quickly. my band.’ (We had to wear hearing protection while he
Our aim for this project was to provide the guitarist with was playing.)
a sound which specifically suits their instrument. That’s I made an efficiency measurement with both speakers
quite a personal thing, but since the enclosure is customis- connected in parallel and got a result of 105dB/watt at one
able, that’s not a problem. metre – that’s pretty amazing.
We settled on a ‘dipole’ arrangement of two 12-inch driv- We have made some performance measurements, but
ers which can be used individually or together, depending remember that this speaker is not intended for Hi-Fi use,
on whether you’re practising or performing. If you have so we aren’t looking for ultra-low distortion. In fact, many
multiple electric guitars, you may find that some work guitar players like having plenty of distortion!
better with one driver while others sound best with the A plot of distortion against frequency for the two driv-
second driver. ers in parallel is shown in Fig.1 and you will notice that
The speaker’s ‘angle of attack’ can also be easily adjusted distortion is very high below 80Hz and above 7.5kHz.
to suit different venues. The dipole completely removes That’s because these frequencies are outside the response
cabinet colouration so that the resulting sound is quite of the drivers and so the sound level is dropping off quite
neutral across the entire audio spectrum. Basically, you’re significantly. Anything below about 60Hz has too great a
just hearing the characteristics of the driver, which is de- drop-off to be audible. There are some spikes at interme-
termined by the manufacturers. diate frequencies (eg, around 320Hz) but these could be
And since the drivers we’re using are specifically in- measurement artefacts as they do not seem to be audible.
tended for lead or rhythm guitars, that’s the ideal situation. Fig.2 shows the frequency response of the two individual
The sound from the dipole setup is not terribly direc- drivers plus the combined drivers. These are very ‘noisy’
tional; that is to say, it doesn’t much matter where you measurements due to the fact that the microphone has been
point it because the sound is much the same at the back, placed some distance away from the speaker in order to
front or sides. provide a realistic result. But room resonances and interfer-
So not only is it its own foldback speaker, the crowd will ence then affect the readings.
enjoy your gig regardless of whether they are right in front The ‘near-field’ responses, taken with the microphone
of the speaker or off to the side. right in front of the two drivers, do not suffer from this. In

Fig.1: the distortion level is not particularly low, but Fig.2: the usable frequency response is from 80Hz to about
sometimes that’s what a guitar player actually wants! 8kHz – more than enough for guitar and even PA use.

Practical Electronics | September | 2019 23


So any amplifier should be able
to easily drive them both. The reso-
nance peaks (clipped off) are 127Ω
at 80Hz for the G12M and 159Ω at
63Hz for the Vintage 30.
You could use 8Ω drivers instead
– indeed, there are 8Ω versions
of both drivers specified; the Al-
tronics driver mentioned below
is 8Ω only. In this case, make sure
that your amplifier will handle a
4Ω load; most will and they will
typically deliver more power into
a 4Ω load than an 8Ω load. So if
you’re building the speaker with
high-power drivers, that will be
your best option.
Note that if you do this and then
you add more speakers in paral-
Fig.3: the combined impedance from both drivers barely dips below 8Ω, so lel (eg, monitors), the combined
should not be a problem for the vast majority of amplifiers (even ‘Hi-Fi’ amps). impedance may fall below 4Ω and
We even succeeded in driving it from the headphone output of a guitar amp. overload your amplifier. Many gui-
tar amps are valve-based and since
any case, you can see that all of the responses start to fall they require output transformers, they usually have several
off below about 100Hz and above 6-7kHz. output impedance taps, which may influence your selection.
That’s a pretty wide range for a single driver. The low-
est string on a six-string guitar is normally tuned to 82Hz Choosing an amplifier
(E) while the highest fret on the highest string is normally The reason guitarists tend to prefer valve amplifiers is for
tuned to 1047Hz (see fret table). the way they sound when they’re overdriven, as a valve
The speaker response covers this entire range of frequen- amplifier will typically sound better than a solid-state one
cies with plenty of room on top for harmonics. Of course when driven to its limit. This speaker works really well
some of the more popular alternative tunings (drop-D) have with valve amplifiers because of the fact that it has a rela-
lower frequencies (73Hz). tively high impedance and because of its high efficiency,
which suits the relatively low power output of a typical
Speaker impedance valve amplifier.
We’re using the 16Ω version for both speakers, so when But you certainly can use it with a solid-state amplifier
driven in parallel, they present a modest 8Ω load to the and it doesn’t necessarily have to be a guitar amp. As long
amplifier. The impedance of each combination of drivers as you have appropriate signal conditioning (ie, some form
is shown in Fig.3 and this shows that when driving both of guitar preamp), you could use a Hi-Fi or PA amplifier
in parallel, it barely dips below 8Ω. too. You don’t even need to use it with a guitar! You could

Fig.4: cutting diagram for both the front and rear of the dipole speaker panels, which are joined at the top with butt
hinges to form an A-frame. We used kitchen door panels, but chipboard or MDF would be fine.

24 Practical Electronics | September | 2019


sleeves of all four sockets are joined
together to form a common ground
connection, which is wired directly
to the negative end of both drivers.
All the signal routing is done to the
positive side of the drivers.
Each socket consists of the three
usual contacts for a stereo socket
– tip, ring and sleeve – plus two
insulated double-throw switches
which are actuated when a plug is
pushed past the tip and ring contacts
respectively. These switches are used
to route the connections to provide
the required functions.
CON2 is an output socket to go to a
The two 12-inch drivers we’re recommending, both from Celestion. At left is the
monitor amp (eg, driving headphones
G12 M Greenback; at right is the Vintage 30. You can substitute other drivers,
but we can’t guarantee that they will perform as well as these do. worn by the player) and the switch
at pins 5, 6 and 7 of the other three
sockets are connected such that when
use it with a different type of electric You could also use plywood, MDF you insert a plug in any of those other
instrument like a synthesiser, bass or or any other material as long as it is at sockets, its tip connection (at pin 4) is
harpejji, or you could connect a micro- least 18mm thick. The rear support is routed to the tip of the monitor socket,
phone and a suitable preamp/amplifier not critical and 16mm thick material via the normally open contacts of the
and use it as a portable PA system. (eg, melamine-coated fibreboard) is switches (pin 5). This means it receives
suitable. The two halves are attached the input signal regardless of which
Sourcing the timber frame at the top with two 85mm stainless driver(s) are being driven.
The two halves of the ‘sandwich board’ steel hinges. By the way, never plug your head-
are made from kitchen cabinet doors phones directly into CON2 if you value
which measure 720x450x18mm. We Junction box operation either your headphones or your hearing!
purchased these in gloss white but The circuit for the junction box is The normally closed half of the three
there are many other colour options quite simple, as shown in Fig.5. It double-throw switches is used to apply
and finishes. Why not try piano black, uses just four DPDT switched stereo the signal to the correct loudspeaker,
or be daring and go for a ‘seductive red’ jack sockets and some wiring to per- based on which socket you have
in full gloss! form all the necessary functions. The inserted the plug into.

Reproduced by arrangement with


SILICON CHIP magazine 2019.
[Link]

Guitar Speaker Circuit


Fig.5: the circuit is very simple, basically it is Fig.6: and here’s a pictorial view of that wiring. The
just the four 6.35mm sockets and some wiring between labelling of the four input sockets coincides with the
them and to the speakers. panel artwork shown in Fig. 7.

Practical Electronics | September | 2019 25


Similarly, if you plug into CON4, the tip connection feeds
the signal to SPEAKER2 but the switch is disconnected from
anything but the monitor socket and so the signal does not
go to SPEAKER1.
But if you plug into CON3, the signal from the tip is in-
stead fed to the NC terminals of the switches in both CON1
and CON4 and since nothing is plugged into those sockets,
the signal then flows to the positive end of both SPEAKER1
and SPEAKER2 via pin 6 on those sockets.

Construction
The assembly process is straightforward and assuming you
have the right tools on hand, you should be able to go from
an assortment of parts to a finished speaker in a few hours.
You need to make two circular cut-outs in the front panel
and one large rounded-rectangle shape cut-out in the rear
panel. The details are shown in Fig.4. Start by marking the
283mm driver cut-outs in the front panel using a compass,
then carefully cut out the circles using a jigsaw.
Note that if you are using kitchen cabinets or similar
coated timber then you should cut them from the reverse
side using a good quality, fine tooth jigsaw blade (prefer-
ably a new one!).
Use a similar process to cut the large hole on the rear
panel. You can mark the two circles in the same manner,
then join them using a long straight edge before making
the cutout.
Lay the two panels end-to-end and mark out the drill-
ing locations for the hinge attachment screws. Drill small
pilot holes (again using masking tape to protect the front
finish), then attach the hinges to both panels using 15mm
countersunk wood screws and check that the two boards
fold correctly. They should fold flat against each other.
The next step is to attach the drivers. This is easiest to
do if you fold the assembly together and support it hori-
zontally between two stable benches or other supports.
Drop the drivers into the holes and rotate them so that the
View through the rear panel, showing the two speaker labels on the back will be right-side-up, then mark out the
drivers and input box secured to the front panel. (Its mounting holes.
position is not important – just make sure the rear panel Remove the drivers and drill these with a pilot drill bit,
cutout is large enough to accommodate it when closed). You then reinstate the drivers and attach them with 10mm coun-
can also just see the cord which stops the front and back
tersunk wood screws through the front of each surround
panels opening too far. (Yeah, we know – we could have
made the rear panel cutout a bit straighter...) and into the front panel timber.
Now place the grilles on top of the driver surrounds,
arrange the supplied mounting brackets around the edge
If you plug into CON1, the tip connection is wired directly (equally spaced), as shown in our photos, and mark the
to the positive terminal of SPEAKER1 so signal flows to that required hole positions for these brackets. Then remove
driver. The NC terminal of that socket’s switch at pin 7 is the brackets and drill pilot holes in those locations. Fix
no longer connected to pin 6 so the signal does not flow to the brackets to the front panel using 20mm wood screws,
the other driver. ensuring that the grilles are held firmly in place.
You can now attach the handle
to the top edge of the front panel,
again by drilling pilot holes and
then attach it with 40mm wood
screws. Now is also a good time
to stick the adhesive felt strips on
the bottom of both panels, one at
each end and one in the middle.
Next, drill a couple of pilot holes
at corresponding points on the in-
side of the front and rear panels, so
that you can screw in the cup hooks
and then tie the cloth strap or cord
between them, to limit how far the
assembly will open. This prevents
it from falling over when in use.
Fig. 8: we show this more for interest sake than anything else – it’s the frequencies of Adjust the length of the strap until
each note when either a rhythm or bass guitar is tuned correctly, The dipole speaker you are happy with the angle that
as described here will handle notes down to about 80Hz. the panels sit at when opened up.

26 Practical Electronics | September | 2019


Junction box
assembly Parts list – A-frame Guitar/
The first step is to
drill four holes down PA Loudspeaker
the centre of the Jiffy
box lid and then 1 16Ω Celestion Classic Series G12M Greenback 12-inch driver
enlarge them (using and
a stepped drill bit or 1 16Ω Celestion Classic Series Vintage 30 12-inch driver
tapered reamer) until or
the sockets are a good 2 8Ω 12-inch 100W polypropylene woofers [Altronics
fit – not too loose. C3070] (see text)
The panel label
2 12-inch metal speaker protection grilles with mounting
(Fig.7) can be used
brackets [Altronics C3712]
as a template to space
2 720x450x18mm kitchen cabinet doors or plywood/MDF
these holes.
sheets (see text)
Stick on the panel
2 85mm stainless steel butt hinges
label and cut out the
1 slim carry handle [Altronics C3660, Jaycar HS8022]
socket holes with a
8 No.3 x 10mm countersunk head wood screws (for
sharp hobby knife.
mounting drivers)
You can print it and
4 No.3 x 20mm pan head wood screws (for grilles)
laminate it, then at-
12 No.4 x 15mm countersunk head wood screws (for hinges)
tach it using contact
2 No.3 x 40mm pan head or countersunk head wood screws
adhesive or silicone
(to suit handle)
sealant. Or you could
2 No.4 x 10mm pan head wood screws (to mounting Jiffy box)
print it mirrored on
2 19mm cup hooks
transparent film and
1 350mm long cloth or rubber strap with loops at each end
glue it on with the Fig.7: front panel artwork for the Jiffy
or
ink towards the lid, box mounted alongside the speaker
1 400mm length of small diameter rope/blind cord
using a thin smear of drivers. You can download it from
clear silicone sealant. the PE website to use as a drilling 4 DPDT mono or stereo 6.35mm jack sockets, chassis-
You can also get template for the four input sockets. mounting [Jaycar PS0182, Altronics P0072]
adhesive-backed pa- 6 heavy-duty adhesive 20 x 50mm felt strips (or larger strips
per for inkjet and laser printers which you can simply cut out cut to size)
and stick on to the lid. 1 UB3 bulkhead Jiffy box (130 x 67 x 44mm [not including
flanges])
1 adhesive panel label for Jiffy box lid
1 1m length of speaker cable (or two 1m lengths of red and
black heavy duty hookup wire)
Various lengths of heavy-duty hookup wire (see Fig.6 for
suggested colours)

With the label in place, attach the sockets using the sup-
plied nuts and solder short lengths of heavy-duty hookup wire
between the sockets – see Fig.6. This makes the connections
as shown in the circuit diagram, Fig.5. Note that several amps
can flow through this wiring if you’re driving the speaker
hard, hence our recommendation to use heavy-duty wire.
You can use the same wire, twisted together, to connect to
the drivers. That’s how the prototype was built. Or you could
use figure-8 speaker wire, which would be a little neater. Sol-
der the four speaker wires to the socket terminals as shown
in Fig.6, then drill a small hole in the side of the Jiffy box and
feed the speaker wires out through this hole, then solder them
to the tabs on the drivers.
Make sure that the wires for SPEAKER1 go to the top driver
and the wires for SPEAKER2 go to the bottom driver and don’t
get the positive and negative wires mixed up or you will get
sound cancellation when using both speakers at the same time.
Next, drill a couple of holes in the Jiffy box base and two
corresponding pilot holes in the back side of the front panel.
You can then feed a couple of short wood screws through the
inside of the Jiffy box and into the holes on the panel, then
screw the lid onto the box and the whole assembly should be
firmly attached to the speaker. Refer to the photo opposite to
figure out the best location for mounting this box.
When you’ve finished your gig, simply unplug the amplifer, That’s it – your speaker is finished. Now all you have to do
fold the two halves together and carry the speaker away. is connect a lead from your guitar amplifier’s external output
This photo shows why a large cutout is required on the rear socket to one of the three input sockets on the Jiffy box and
panel (to enable you to fold the front and back flat). you’re ready to jam!

Practical Electronics | September | 2019 27


Using Cheap Asian Electronic Modules Part 19: by Jim Rowe

Arduino FC Shield

This low-cost NFC (Near-Field


Communication) shield for Arduino
uses the same technology as RFID
and contactless payments. It allows
just about any Arduino board to read data from NFC/RFID tags or cards,
or write data to certain devices. You can also exchange data with other
NFC devices, including many smartphones.

T
his shield, plus an Arduino the carrier, with the modulated signal Three different data exchange rates
module, could be used as the picked up by the active device. are in current use by NFC devices:
basis for a number of useful de- RFID technology was developed 106kb/s, 212kb/s and 424kb/s. If an
vices – for example, to unlock a door in 1983 by Charles Walton. Sony and active device transfers data at 106kb/s,
using an access card, to monitor the Philips agreed to establish a compat- it uses modified Miller coding with
passage of stock or other items on a ible specification and this was ap- 100% modulation. Miller coding is a
conveyor belt, to transmit business proved as an ISO/IEC standard in 2000 type of Modified Frequency Modula-
card information to customers’ smart- (ISO/IEC 14443). The passive tags and tion known as ‘delay encoding’. This
phones, and so on. But before we ex- cards used for RFID typically store be- is similar to NRZ (non-return-to-zero)
plain how it works, we’ll explain how tween 96 and 8192 bytes of data, which encoding, but with less power radiated
RFID and NFC work. can be read (and in some cases, writ- at lower frequencies.
NFC, or Near-Field Communication, ten) using the RFID protocol. For the higher data rates, Manches-
is a set of protocols that enable two Nokia, Philips and Sony estab- ter coding is used, with a modulation
electronic devices to exchange data lished the NFC Forum in 2004. It is a ratio of 10%. Manchester encoding is
by bringing them within about 40mm non-profit industry association which another method of turning a bitstream
of each other. promotes the implementation and into a symmetrical AC signal and is
Communication is by electromag- standardisation of NFC technology also used for transmitting digital audio
netic induction; ie, coupling signals to ensure interoperability between data (S/PDIF).
between loop antennas in each device. devices and services.
In effect, when the two antennas are NFC provides the same functions as Elecrow’s NFC shield
brought within 40mm of each other RFID but also allows for communica- The Elecrow ACS53201S NFC shield
they form an air-cored RF transformer. tions when both devices are powered. measures 69 x 53mm (including the
NFC involves low-power RF signals In this case, power is not transferred loop antenna) and it plugs directly
with a carrier frequency of 13.56MHz, using the carrier and the two devices into an Arduino Uno or Mega 2560,
in one of the globally available and can exchange data in an ad-hoc peer- or one of the many compatible mod-
unlicensed ISM (industrial, scientific to-peer fashion. ules. It derives its power from the
and medical) bands. The standard defining NFC is ISO/ Arduino and even comes with a pas-
One of the devices involved in IEC 18092. This technology is now sive keyring NFC tag for testing (see
NFC communication can be passive, found in all manner of smartphones lead photo).
ie, with no onboard power source. and other portable devices. At the heart of the shield is the
This is typically the case with RFID Sony’s FeliCa RFID system includes NXP/Philips PN532 NFC controller
(radio-frequency identification) tags dynamic encryption for increased se- IC. The internals of this IC are sum-
and smart cards. curity. It was considered as part of the marised in the simplified block dia-
In this situation, the device that is ISO/IEC 14443 RFID standard, but in gram (Fig.1). It’s based around an NXP
powered powers the circuitry in the the end was not included. However, 80C51 microcontroller (upper right),
passive device via the energy of the some of the principles used by FeliCa which includes 1KB of RAM (work-
13.56MHz RF carrier. The passive ended up being used as part of the later ing memory) and 40KB of ROM (for
device then ‘replies’ by modulating NFC standard. storing the firmware).

28 Practical Electronics | September | 2019


capacitors for IC1, IC2 and REG1, a
pull-up resistor on pin 38 of IC1 to
enable it, and a capacitor and resistor
connected to the VMID pin of IC1 (pin
9), which is used to DC bias its RX pin
(pin 10) to half supply.
Note that Jaycar sell a similar NFC
Shield, made by ‘linksprite’ (Cat
XC4542). While not identical to the
Elecrow shield, it is compatible and
we have tested it successfully with the
same software.

Arduino software
Luckily, Elecrow has made the soft-
ware side of things quite easy by
making available an Arduino library
written specifically for communicat-
ing with the PN532 via the SPI port.
The library can be downloaded from
the Elecrow website in a zip file called
PN532_SPI.zip (see Links panel).
This can be made available for
use in the Arduino IDE by clicking
on the Sketch menu and then on the
Include Library → Add .ZIP Library
menu option. Select the ZIP file that
Fig.1: simplified block diagram for the PN532 controller IC. The chip is based you have downloaded and it will
around four sections: an NXP 80C51 micro (an old design!), NFC communications be added to the IDE’s library list.
block, serial block and power/clock/reset controller.
The library comes with six example
sketches, named:
The other main sections are the con- Arduino’s 5V supply via REG1, an
writeMifareMemory
tactless interface unit or CIU (at lower MIC5205-3.3 LDO (low dropout) reg-
readMifareTargetID
right) which handles the actual NFC ulator. This is separate from the 3.3V
readMifareMemory
communication, and the host interface rail from the Arduino because IC1 can
readAllMemoryBlocks
section at lower left, which handles draw up to 200mA when transmitting,
PtoPTarget
communication with the host com- which could overload the regulator on
PtoPInitiator
puter or controller (in this case, the the Arduino.
Atmel micro on the Arduino board). This means that level translation ‘Mifare’ is another way of referring
The host interface section can be is necessary on the SPI signal lines to passive NFC tags and cards. The
configured to communicate via SPI (se- between IC1 and the Arduino. That’s ‘PtoP’ part of the last two sketch ti-
rial peripheral interface), I2C (inter-IC provided by IC2, a 74LV4T125 quad tles is short for ‘peer to peer’ and in-
serial communication) or a high-speed buffer translator. Three of IC2’s buffers dicates that these sketches are used
UART (HSU; ie, serial) connection. But are used to translate the logic levels of for NFC communication between two
note that the PN532 chip used in the the MOSI, SCK and MISO signal lines, active devices.
Elecrow NFC shield has been config- with the fourth buffer unused. IC2 is I tried opening and running the first
ured for SPI only. also powered from the +3.3V supply four of these example sketches with
Fig.2 shows the full circuit of the from REG1. the Elecrow NFC shield connected
Elecrow NFC shield, plus a block dia- The only other components on the to both an Arduino Uno and a Mega
gram of an Arduino host at upper left. board are a number of bypass and filter 2560. In each case, I tested it with both
The PN532 device (IC1) connects to the keyring tag that came with the
the NFC loop antenna at top right via shield and also with an
the TX1, TX2 and RX pins and a net- NFC card that came
work of passive components. These with another NFC/
include inductors L1, L2, various RFID reader.
capacitors and a few resistors. These
are used for impedance matching,
to make the antenna resonant at the
required frequency and to filter out
unwanted signals.
IC1 uses a 27.12MHz crystal (X1)
to generate its internal master clock
and divides this by a factor of two to
produce the NFC carrier frequency of
13.56MHz.
Although IC1 can operate from sup-
ply voltages of 2.7-5.5V, in the Elecrow
shield it is powered from a 3.3V regu- Fig.2: The NFC shield easily
lated supply. This is derived from the slots into an Arduino Mega or Uno.

Practical Electronics | September | 2019 29


Reproduced by arrangement with
SILICON CHIP magazine 2019.
[Link]

Elecrow ACS53201S NFC Shield


Fig.2: complete circuit diagram for the Elecrow ACS53201S
near-field communication (NFC) shield, and wiring
diagram for the shield with an Arduino (or similar) board.

Each time it worked exactly as ex- You can get an idea of how the Serial Monitor. Screen 1 shows the
pected and I was able to read data from example sketches work from the output when reading the card first
and write data to both passive devices screen grabs shown above. Both and then the keyring tab, using the
with no problems. grabs are of the Arduino IDE’s readMifareMemory sketch.

30 Practical Electronics | September | 2019


Fig.3: wiring diagram
for a Micromite to the
Elecrow NFC shield. We’ve
converted the Arduino NFC
library into a BASIC library
so that you can use it with
the Micromite. The library
can be downloaded from
the PE website.

from the September page


of the PE website. We have
also translated some of the
example programs. The
download package includes
several BASIC files which all
start with an identical set of
library functions, but which
have different sample code
snippets at the bottom.
Having wired up the shield
as in Fig.3, it’s simply neces-
sary to upload one of these
programs to the Micromite
and run it. You should see
similar output on the Micro-
mite serial console, as shown
in the screen grabs above.

Extra links
NFC Forum: [Link]
PN532 data sheet: [Link]
PN532 user manual: [Link]
How to use the PN532: [Link]
Elecrow shield library: [Link]

Screen 2 shows the readAllMemoryBlocks sketch re-


sults when it is used to interrogate the card after using the
writeMifareMemory sketch to write 16 bytes into the card’s
memory (to block 8). JTAG Connector Plugs Directly into PCB!!
The easiest way to build your own application using No Header! No Brainer!
the Elecrow ACS53201S NFC shield would be to modify
one of the example sketches. Or if you’re doing something
fairly complex (eg, which involves both reading and writ-
ing data), you may need to incorporate bits and pieces of
the example sketches into your own sketch.
If you want to fully understand how to use the PN532_
SPI library functions, it is simply a matter of studying the
example sketches to see how they operate.
Our patented range of Plug-of-Nails™ spring-pin cables plug directly
Using it with a Micromite into a tiny footprint of pads and locating holes in your PCB, eliminating
What if you want to use the shield with another MCU, like the need for a mating header. Save Cost & Space on Every PCB!!
a Micromite? Since it has a standard SPI port, it’s quite Solutions for: PIC . dsPIC . ARM . MSP430 . Atmel . Generic JTAG . Altera
easy to make the required connections, as shown in Fig.3. Xilinx . BDM . C2000 . SPY-BI-WIRE . SPI / IIC . Altium Mini-HDMI . & More
The software is a bit more tricky though since there was no
Micromite library available to interface with the PN532 IC.
[Link]
So, we have translated the Arduino library into a Micromite Tag-Connector footprints as small as 0.02 sq. inch (0.13 sq cm)
BASIC file and have made this available for download

Practical Electronics | September | 2019 31


SFX Part 2: construction and set-up
Super Digital Sound
Effects Module
You will be amazed by what this tiny powerhouse can do. Whatever
sound effect you need, of whatever length, for whatever purpose, this
little beauty will do it. And it’s even got an audio amplifier on board!
Now it’s time to put it together and get it to do some real work.

By Tim Blythman and Nicholas Vinen

T
his new Super Digital Sound We highly recommend that you have temperature of your soldering iron a
Effects Module (SDSEM) is tiny a magnifying lamp on hand, some little lower than you would for solder-
and not particularly complex. precision tweezers and a temperature- ing larger, through-hole components.
But, it is very flexible and capable, controlled soldering iron (ideally with Fig.3 shows the position of all the
thanks to its smart software. at least one fine and one medium tip). components on the top of the board,
We described the circuit and some of You will also want some good quality but note that you should fit only one
the software features last month. How- flux paste and desoldering braid in of LK1 or LK2, not both. There are a
ever, even since then, we’ve made some addition to your usual tools. few components on the bottom side
refinements – see the panel opposite. As shown in the parts list pub- and their locations are shown in Fig.4.
Now let’s get into assembling the lished last month, most of the passive You should fit these last, otherwise the
module. We’ll also describe how components are in 2012 (metric) or board will not sit flat on your bench.
to test it, configure the software 0805 (imperial) packages which have If you are planning to use a 5.5-18V
and put it to use. a 2.0 x 1.2mm footprint. These are DC supply, you can leave off some
slightly smaller than components in components, as shown in Fig.5. For a
Board design 3216/1206 packages, which are also 3V DC supply only, fit the components
We’ve made the SDSEM very compact quite common. shown in Fig.6.
so that it can fit just about anywhere. We find they are not really any more Note though that if you need to be
We’ve also given it flexible supply difficult to solder, while saving quite able to change the supply arrange-
options. And while it is tiny, we’ve a bit of space on the board. So they ment later, it will be easier to fit all
avoided using any parts which make are the obvious choice for this project. the components now, except for one
assembly too difficult. Because many of the components of LK1/LK2 (as shown in Fig.3). The
The most difficult compromise (especially the capacitors) don’t have kit of parts that we supply comes with
we’ve had to make is with the micro. any visible markings, it pays to work all these parts; the only real advantage
We needed one with more than 20 pins with one value at a time. of leaving some off is that you save a
to provide all the required functions, bit of time – see below.
as well as enough computing power Construction
for all the input/output tasks while While today’s PCBs are of a very high Fine-pitch ICs first
mixing digital audio data in real time. standard, it is always a good idea to Start by soldering IC1 first since it has
Since we also wanted a very low check for shorted or broken tracks the closest pin spacings. It comes in
standby power consumption, that left before fitting any components. Check an SSOP-28 package, which has pin 1
us with few options. carefully where IC1 will sit, as this is marked by a small circular dot on the
That meant the only suitable pack- where the finest pitch pins are located. top surface. With the microSD card
age for microcontroller IC1 was the 28- Having said that, the chances of find- slot to the left, pin 1 goes to the bottom
pin Small Shrink Outline SMD pack- ing a problem on the boards we supply right and this is indicated by a white
age (SSOP). But don’t let the closely is very low. dot on the PCB.
spaced pins put you off, because with As we go through the assembly, Apply some flux to the pads on the
the right tools it is not difficult to we’ll mention component orientations PCB and place IC1 in position as closely
solder. Most of the other components with respect to the board having the as possible. Hold it in place by gently
have much larger pins, so once you’ve microSD card socket on the left, as
fitted IC1 to the board you should find shown in the main overlay diagram, Components – a kit of parts is available
the rest of the construction process Fig.3. Since most of the components for this project. For full details, just visit:
quite straightforward. are small, we suggest that you set the [Link]/Shop/20/4658

32 Practical Electronics | September | 2019


pushing down on it and carefully tack
one of the corner pins in place. Some revisions since last month
Some constructors like to use a Inevitably, we’ve made some tweaks to the software since writing the article last month, in
wooden (spring) clothes peg to hold the order to simplify it. That’s what happens with software; it is always capable of being refined.
IC in position while soldering – as well The first change is to the pin used for varying the playback speed (pitch). Rather than
as giving you back a hand, it precludes using separate pins depending on whether you are using an analogue voltage or pulse
that awful smell of burning fingers. rate to control playback speed, we found a way to combine both of those functions into
At this stage, it doesn’t matter too pin 10 of IC1, which is connected to pin 5 of CON4 (the SW4 input). So now there is a
much if you bridge some of the pins single configuration setting for the playback speed control function.
together, as it’s possible to remove the This was achieved by using the audio output interrupt service routine (ISR) to count
bridges with solder braid later. pulses, rather than using the hardware pulse counter (TIMER3). Since this ISR runs
If IC1 is sitting flat and all the pins 46875 times per second to feed the DAC, by checking the pin 5 state in this routine,
line up correctly with their pads, tack pulse rates up to 23kHz can be measured, assuming a 50% duty cycle (or 4.7kHz with
down the pins on the other corners a 10% duty cycle).
to lock it in place. If it is not correct, We’ve also made it possible for this pin to control playback volume as well as speed.
apply the iron to the first solder joint Any input can have its speed or volume (or both) controlled by the signal at the SW4 input.
and nudge IC into the correct location. For example, with a model train, you could use read the locomotive’s motor voltage
It may take a few tries before it’s per- (via a suitable divider) as a proxy for speed and use that to control the engine sound.
fectly aligned. Try to avoid spreading At low motor voltages, the volume and pitch will be low and will steadily increase from
the solder too much to adjacent pins a low rumble to a loud roar, giving the impression of having higher RPM and working
during this process. harder as the motor speeds up.
Once you are happy with the loca- Alternatively, a potentiometer or variable resistor can be connected to this pin and
tion, solder all the pins to their pads. used as a simple hardware volume control.
If you have applied flux, then all you The SW4 input can also be set up so that an increasing analogue voltage can be mapped
should need to do is load some solder to a decreasing volume or speed. This is set for each input individually, so effects like
onto the tip of the iron and touch it to cross-fades, where one sound increases in volume as another decreases are possible.
the ends of the pins where they contact The configuration section explains all these settings and how the input signal controls
the board. the output sound.
This will draw a small amount of
solder from the iron, using the mini-
mum necessary to make the joint. Keep REG1. Their pins are not as closely pins to the shell, as this is connected
the tip of the iron clean, and add a spaced as those of IC1, but other nearby to ground.
small amount of solder directly to the components will make it more difficult If you are using REG1 then it is fitted
iron each time it runs low. to solder them later. next. It also has a dot to indicate pin
Now use a magnifying lamp to The microSD card socket should be 1, but since it is so small it is difficult
check thoroughly for any bridges. a bit easier to align than IC1 as it has to see. You will probably need to use
These can be removed by applying plastic pins which go into holes on the a magnifying lamp to see it.
some flux to the top of the affected PCB to help locate it. Place REG1 in its spot towards the
pins and then pressing some clean Apply some flux to each pad before bottom right of the PCB with pin 1 to
solder braid to the pins with the iron. dropping it into position. Holding it in the top right, near the REG1 marking on
Repeat until all the pins are soldered place, tack down one of the larger tabs the PCB, with the small dot under the R.
and not bridged. on the shell to ensure it stays there. As before, tack one pin in place,
We also found it helpful to use a Once it is flat and you are sure that it confirm the other pins are correct,
smartphone (a digital camera will is correctly aligned and located, solder then solder them all and remove any
do a similar job) to take a close-up all the larger tabs to hold it in place. bridges as necessary.
photograph. If you do this, you may Now, in a similar fashion to IC1, apply
not have to strain your eyes as much, a small amount of solder to the iron, Remaining components
especially if you look at the photos on then carefully touch the iron to each Now we can mount the passives,
a large screen. pin to solder them to the PCB. which are larger and easier to solder. A
When you are happy with the sol- You can use the same technique pair of fine tweezers will be handy here
dering job you’ve done for IC1, move as for IC1 to remove any accidental and a small amount of flux on the pads
on to the microSD card socket and bridges. Be careful not to bridge any can even help in this case, too. There

Fig.3 (left): component overlay


diagram for the top side of the board,
shown at twice actual size for clarity,
with a matching 1:1 scale photo above
(CON2, 3 and 4 not yet fitted). Do not
fit both LK1 and LK2 ; LK1 is for a 3V
DC supply, while LK2 (as shown above)
is fitted for the 5.5-18V DC option.

Practical Electronics | September | 2019 33


Fig.4 (right): underside overlay,
shown twice actual size, with 1:1
photo above. Seven 1kΩ resistors
are located on this side of the board,
along with optional tactile switches
S1 and S2, which can be used to
trigger the first two sound channels.
are seven resistors and one 0Ω link to good contact with it or your multime- Additional components
mount on the top side of the board. ter is not supplying enough voltage to If you want to solder headers for CON2
Refer to the relevant overlay dia- light it up. Once you have identified (the speaker output), CON3 (in-circuit
gram to see which resistors go where. its cathode, solder it in place with the programming for IC1) and CON4 (trig-
Table.1 shows the codes likely to be cathode facing to the left. ger inputs) then do so now. These can
printed on the top of each value of The last components to fit on the be vertical or right-angle headers and
each resistor. The 0Ω resistor is for top side of the board are regulators can be soldered on whichever side
LK1 or LK2, depending on your power REG2 and (if fitted) REG3 and chips of the board you prefer. Or you may
supply; fit LK1 if you installed REG1 IC2 and IC3. Solder them in that order, simply prefer to solder wires directly
earlier, otherwise fit LK2. by tack-soldering one pin first and then to the pads on the board instead.
While it’s a bit tricky, it is possible checking the placement of the other The staggered pins on the ICSP
to solder a 2-pin header onto each set pins before soldering the rest. header (CON3) allow you to ‘plug in’ a
of pads for LK1/LK2 so that you can REG2 and REG3 can only be fitted header to the board without soldering
use a jumper shunt to select between one way but you will need to be care- it. This is useful if you want to program
the two supply options. But that would ful with the orientations for IC2 and IC1 but don’t want a header sticking
only be necessary if you are not sure IC3. If fitting REG3, smear some flux out of the board when you’ve finished.
which one to use in your application. paste on its pads first and note that you You will need to attach a speaker
There are up to thirteen capacitors will need to heat its tab for longer than or piezo transducer to get sound from
on the PCB. Be careful not to get these the other pins to ensure the solder has the module. An 8Ω speaker is recom-
mixed up after you remove them from formed a good joint. mended if you are using the 5.5-18V
their packaging as they will not be IC2 should have the number 4334 input, but is too much of a load on
marked with any values. The only visible on top, while IC3 will be marked its own for the 3V battery input, as its
way to identify them if you get them 4991. There will be a small depression amplifier output power is very close
mixed up is with a capacitance meter. on the top of IC2 adjacent to its pin 1, to the maximum output of the boost
Fit these in a similar manner as you which should be oriented so that it is regulator. For the 3V battery input,
did for the resistors, again using the closest to the ICSP header (CON3). the piezo transducer is the simplest
overlay diagram and PCB silkscreen as IC3 is soldered near the top of the option but an 8Ω speaker in series with
a guide as to which goes where. board, with its pin 1 towards micro- a small value resistor (say 100Ω) will
If you fitted REG1 earlier, then sol- controller IC1, ie, facing the same way reduce the load on the circuit and as
der inductor L1 in place now. Like the as IC2. Now flip the board over and a result, it will likely sound better too.
resistors and capacitors, it is a 2-lead solder the seven 1kΩ resistors onto
device, but it is a bit larger. You can the pads as marked. Programming the microcontroller
solder it in much the same manner but The two tactile pushbuttons, S1 and If you purchase the microcontroller
it will probably take a little more heat S2, can now be fitted if you want them. from the SILICON CHIP Online Shop,
to form good solder joints.
If you did not fit REG1 then you
will need to fit diode D1. This is also
a 2-pin device, but it is polarised and
must be oriented with the cathode
stripe to the left.
LED1 is next; and it goes in the
top-left corner of the PCB. It too is
polarised and normally it will have a
green dot or other marking to indicate
its cathode. However, we have seen
SMD LEDs with a dot to indicate the
anode (ie, the opposite end) so you
should use the diode test function
of a multimeter to check which end
is which.
It will light up with the red multi-
meter probe to the anode, so the black
probe will indicate the cathode. Fig.5: this diagram shows which parts you can omit if you only want the 5.5-
If it doesn’t light up either way 18V DC supply option. In this case, power is applied via pin header CON5 or
around, either you are not making supply wires soldered directly to its pads.

34 Practical Electronics | September | 2019


SMD Resistor codes
Qty Value 4-digit code 3-digit
code
1 1MΩ 1004 105
1 330kΩ 3303 334
1 270kΩ 2703 274
1 47kΩ 4702 473
2 22kΩ 2202 223
8* 1kΩ 1001 102
1 0Ω 0 0
* 7 are mounted on the underside of the PCB

SMD resistors are marked with a


3-digit or 4-digit code to indicate
their value; however, the numbers
Fig.6: this diagram shows which parts you can omit if you only want the are pretty small and you may need
3V DC battery supply option. In this case, power is applied via wires a magnifying glass or loupe to read
soldered to the large pads marked ‘+’ and ‘–’ (or pins 2 and 3 on CON3). them accurately.

either by itself or as part of a kit, it You will need the HEX file which supply that you intend using to run
will have already been programmed can be downloaded from the August the board later, or you can set up the
so you can skip to the Testing section 2019 page on the PE website as part of PICkit to supply power to the chip.
below. If we do release an updated the software package for this project. To do this, switch the IPE software
version of the firmware later, you You will also need a recent version into Advanced Mode via the Settings
could use these instructions to load of Microchip MPLAB X installed on menu, ‘log on’ using the default pass-
it into your PIC to take advantage of your system. It is a free download; you word, click the Power button at left,
any improvements. can get it from [Link]/ enable the ‘Power Target Circuit From
It’s easiest to program the micro mplab/mplab-x-ide Tool’ checkbox (see Screen2). Having
once it has already been soldered to the It includes an integrated develop- done that, click the ‘Operate’ button
board. You will need an in-circuit se- ment environment (IDE) and an in- at left to return to the original screen.
rial programmer (ICSP) like the PICkit tegrated programming environment You can now program the chip by
3 or new PICkit 4 (see the review in (IPE). For this task, it is easiest to pressing the ‘Program’ button. Check
this issue). use the IPE, so when installation is the output window below to make
Take a standard 5-pin header and complete, launch that and select your sure that programming is successful
push the short end into the staggered programmer and set the IC type to (see Screen3 below).
holes for CON3. It should be a rela- PIC32MM0256GPM028 (see Screen1). If you get an error message, check
tively tight fit and the header won’t Next, click the Browse button to the that there is a good electrical connec-
immediately fall off the board. You right of the Source: field and select the tion between the programmer, header
don’t need to solder the header as fric- HEX file that you downloaded earlier. and board, and that pin 1 is in the
tion will make good enough electrical Plug your programmer into CON3 on correct position. Check also that the
contact to enable programming. How- the board, ensuring that its pin 1 lines board is receiving power as expected.
ever, try to avoid wiggling the header up with the pin 1 marker on the board. Once the chip has been programmed,
or applying force as it will eventually You need to apply power to the PIC the board is ready for testing.
become loose and will no longer have so that you can program it. You can
good electrical contact. either do this by connecting the power Testing
You will need a power supply that can
deliver up to 250mA in short bursts.
Refer to Fig.5 and Fig.6 for an over-
view of where power can be supplied
to the PCB.
If you have built the board for the 3V
supply option (by fitting REG1) then a
battery holder with two AAA cells is
a good option. During development,
we tested using the 3.3V supply from
an Arduino board, two AAA cells and
both a PICkit 3 and PICkit 4 to sup-
ply power. All four options provided
sufficient current for the SDSEM to
operate adequately.
You may have noticed the footprint
for a button cell holder on the back of
the PCB. We originally intended this
unit to be able to be powered from a
Fig.7: this is one way to drive the SDSEM from an Arduino Uno. The red wire lithium button cell, but the cells we
provides 3V power from the Uno (the black wire is the ground connection). tested could not provide enough cur-
The seven schottky diodes protect the 3V inputs on the SDSEM from the 5V rent. Hence, our recommendation that
outputs of the Arduino. you use AA or AAA cells.

Practical Electronics | September | 2019 35


assuming the supply has not timed out
as noted above), carefully check the
soldering on REG3, and also on L1,
the nearby 1MΩ and 330kΩ resistors
and the two 10µF capacitors.
A problem with any of these could
prevent REG3 from operating.
Assuming the 5V rail is OK, check
the 3.3V rail next. This can be meas-
ured on the bottom pad of LK2 (closest
to the edge of the board), regardless of
whether LK2 has been fitted.
For a negative reference, the tip of
the black multimeter probe can be
pressed into the tab of REG3 (or the
pad for the tab, if it has not been fitted).
You should get a reading between
these two pads in the range of 3.25-
3.35V. If it’s outside this range then
something is amiss.
Since you’ve verified the 5V rail
Screen1: the MPLAB X IPE programming software is a free download and can be voltage, it’s likely to be a problem with
used with a PICkit to load the firmware (HEX) file into the PIC microcontroller. REG2 or a short circuit elsewhere.
Remember to check this soon after
When the unit is powered up with- solder joints or swapped or incorrectly applying power if running from a bat-
out a microSD card present, it starts oriented components. tery, as this rail will also be shut down
in a mode which allows you to trigger eventually to save power.
the built-in samples. So the simplest Voltage checks
test is to connect up a speaker or piezo If using the 3V supply option, you have Testing with a microSD card
transducer, apply power and then about two minutes between applying We supply some example WAV files
short pins 1 and 8 of CON4, pulling power to the unit and REG1 being shut and a configuration file ([Link])
the SW7 input low. Note that these down when IC1 goes into sleep mode. in the software download package for
pins are at opposite ends of the header. So make sure to do your checks within this project.
You should hear the word ‘zero’ being this time-frame. Copy those files into the root direc-
played back on the speaker. First, check the 5V rail voltage. You tory of a microSD card, plug it in and
If you do hear ‘zero’ then that sug- can measure this between pins 4 and 8 power the unit up.
gests it’s all working normally and you of IC3 (which are in opposite corners) If LED1 is flashing then you may
can proceed to test with a microSD and you should get a reading in the have a problem with the soldering on
card, as explained below. But if you range of 4.9-5.1V. If you don’t, then the SD card socket or there may be a
don’t hear that word then you will either REG1 or REG3 is not operating compatibility problem with the card.
need to check that the supply voltages properly (whichever is fitted). We’ve tested the unit with a range
on the board are correct and that there If you have fitted REG3 and are of cards and it works well with all of
are no construction errors such as bad not getting a steady 5V reading (and them, but it’s possible that some cards
are not supported. So if you can’t get it
to work, we suggest you try a different
brand/model of card just to eliminate
that possibility.
If LED1 is not flashing then you can
short pins 1 and 2 of CON4 (or press
pushbutton S1 if you’ve fitted it) and
you should hear the first sample being
played back. That will confirm that the
unit is fully operational.

Configuration file format


The configuration file ([Link]) is
simply a text file consisting of several
lines which set the various parameters
for the device.
It does not matter what order the set-
tings are listed unless a parameter is re-
peated, in which case the last instance
will override any previous settings
given for that particular parameter.
The line starts with the name of
the parameter to set, followed by an
Screen2: this advanced options screen in the IPE software allows you to control equals sign (=) and then the value(s).
whether the PICkit will supply power to the micro being programmed via the If there is more than one value for a
checkbox near the bottom. given parameter, they are separated by

36 Practical Electronics | September | 2019


Interfacing with the Super Digital Sound Effects Module
You might be satisfied experimenting with the SDSEM on a bread- alternative is to connect a schottky diode in series with each
board with jumper leads, but if you are looking to incorporate input, with the anode toward the input. It will be forward biased
it into another project, you will need to come up with a way to when the output is low, pulling the input down, but reverse biased
interface to it. with the output high, preventing current from feeding back into
In some cases, you may want to trigger sound effects us- the SDSEM (see Fig.7).
ing something like an Arduino. Keep in mind though that most You may also want to generate a square wave with a variable
Arduinos run from a 5V supply while microcontroller IC1 in the frequency to apply to the SW4 input of the SDSEM, to vary the
SDSEM runs from 3 – 3.3V. volume or playback rate of certain sounds.
The 1kΩ series resistors on the trigger inputs do allow you to If you are using an Arduino Uno for control, you can easily do
connect them directly without risking damage, but there are some this by connecting the SW4 trigger input to digital pin 5 on the
techniques that you can use to make the interfacing a bit smoother. Uno. You can then use this line of code to control the frequency:
Since the trigger inputs on the SDSEM have on-board pull-ups,
tone(5,300);
you only need to actively pull those pins low. To set those pins
to a high state, the driving device can simply set its output pin to In this case, it will generate a 300Hz square wave. It would be
a high impedance and they automatically return to a high level. a good idea to use the schottky diode in this case because the
So in the case of the Arduino, we can switch the corresponding output pin will be actively driven high half the time.
output pin to a logic low output to activate the trigger and then
set it to input mode (instead of driving it to logic high) to release Interfacing with a DCC decoder
the trigger. Using pin D2 as an example, the Arduino code to set We’ve said that the module is ideal for model railways, and if
the pin as an active-low output is: you are running a DCC system you are probably interested in
connecting the SDSEM to a DCC decoder for installation in a
digitalWrite(2, LOW);
locomotive (or even simply connected to the track and hidden
pinMode(2, OUTPUT);
in an item of scenery).
and the code to set it to a high impedance and allow it to return If you aren’t running DCC, the options are more limited, espe-
to a high level is: cially as the track is not powered when the locomotive is stationary.
Since DCC decoders may provide a 12V (or higher) swing from
pinMode(2, INPUT);
their digital outputs, you should connect schottky diodes in series
If for some reason you are using a control device which cannot with each output that goes to the SDSEM, unless you know for
emulate this type of open-collector/open-drain output, the sure that those outputs are open-collector types.

commas (,). For example, one line may Example of a typical configuration file
look like this:
MASTERVOLUME=128
switch1=loop,256,[Link] LOGIC=LOW
STANDBY=120
Note that file names cannot contain an SWITCH1=ASR,64,256,112,384,[Link],[Link],DIESEL3.
equals sign or a comma as this would WAV
cause problems parsing the configura- SWITCH2=ASR,256,256,256,256,[Link],[Link],[Link]
tion file. Note also that there cannot be SWITCH3=LOOP,256,256,256,256,[Link]
spaces before or after the equals sign SWITCH5=SINGLE,256,256,256,256,[Link]
or commas. SWITCH6=ASR,256,256,256,256,[Link],WHISTLE2
The configuration file is parsed in WAV,[Link]
SW4MODE,ANALOG,1000,3000
a non-case-sensitive manner, ie, it
SPEAKBACK=NONE
doesn’t matter whether names are writ-
ten using lower case letters, upper case
or a mixture.
This is also true of how file names
are handled; like Windows, they are
matched in a case-insensitive manner.
So a file called Train [Link] can be
referred to as train [Link] or TRAIN
[Link] and it will still work.
Refer to the panel listing the con-
figuration parameters overleaf for an
understanding of what each line does.
If you are familiar with programming
or shell scripts, you might be accus-
tomed to placing a hash (#), a double
slash (//) or single quote (’) at the start
of a line to ‘comment it out’ so that it
is ignored.
Any of these characters can be used
in the [Link] file to achieve
that effect.

Reproduced by arrangement with Screen3: once the PICkit is plugged in, the HEX file loaded and power applied,
SILICON CHIP magazine 2019. click Program and if the operation is successful, you will get a similar output to
[Link] that shown here.

Practical Electronics | September | 2019 37


SWITCH1 to SWITCH7 If the mode is set to FREQUENCY then the
Configuration parameters The number following ‘SWITCH’ refers to a trigger pulse rate/frequency applied to this pin is used
MAINMODE input. The parameters dictate what sounds are to control the volume and/or playback rate of
Currently, the software only has one mode triggered when that input is activated. There are audio samples triggered by other inputs. Two
which is called ‘mixed’ and this refers to the fact five control values, followed by between one and additional parameters must be provided and
that if multiple sounds are triggered, then they ten file names. these are the lowest and highest expected
will be mixed together before being played back. The first control value is the playback mode for frequencies (in Hz) on this pin. These corre-
We suggest that you include the following line in this input, which also dictates how many sound spond to the minimum and maximum volumes
your configuration files to ensure compatibility files can be referenced. This is either LOOP, SIN- and playback rates specified for the affected
with future software versions which may add GLE, CROPLOOP, CROPSINGLE, ASR, ALTLOOP, trigger inputs.
other modes: ROUNDROBIN or RANDOM. The first four modes If the voltage/frequency at SW4 is outside
require just one file, while ASR takes up to three of the specified range then the volume or play-
“MAINMODE=MIXED”
and ALTLOOP takes two. The last two modes, back rate will be ‘pegged’ at the minimum or
ROUNDROBIN and RANDOM can use between maximum value; ie, if the voltage/frequency is
MASTERVOLUME
two and ten files. below the minimum voltage then you will get
This sets the volume for all channels. Its sole
If more files are listed than necessary for a the minimum volume or playback speed and if
parameter is a whole number between 0 and
given mode then they are ignored. If a file name it’s above the maximum then you will get the
256. 256 means maximum volume, however,
is left blank then no sound is played in that case. maximum volume or playback speed.
this can lead to clipping and distortion if multiple
The second and third control values set the Within the specified range, the effect is a
loud sounds are played simultaneously.
volume for files triggered by this input. The first smooth transition between the limits.
You may need to experiment with this value.
volume is what we call the low volume and the Note that if you are using the ANALOG mode,
A good value to start with is 128 (ie, half maxi-
second one is the high volume. They only need the software enables an approximately 350µA
mum volume).
to differ if you are using the variable playback pull-up current on the SW4 pin. If this pin is
LOGIC volume feature which requires a control signal driven from a low-impedance voltage source
The LOGIC parameter can be set LOW or HIGH, to be applied to the SW4 trigger input. then the pull-up current will be overwhelmed
which dictates whether sounds are triggered The SW4MODE parameter is used to enable by that source. But this allows you to connect
when an input is pulled low (the default) or high. this (see below). If enabled and the low and high a variable resistor between SW4 and 0V and
The pins have internal pull-ups in either volumes are different, then the playback volume then control the voltage on this pin by varying
mode, so sounds can be triggered using exter- for sounds triggered on this input will vary be- the resistance.
nal switches, relays, transistor collectors or FET tween those two values, based on the signal at For example, a 5kΩ variable resistor will
drains to pull these pins to ground. the SW4 input. give a voltage of between 0.35V and 2.1V (note
The fourth and fifth control values are used that there is already a 1kΩ series protection
STANDBY to vary the playback speed/pitch, with the values resistor in the circuit). But the pull-up current
This sets how long the SDSEM will wait after being the low sampling rate (#4) and the high value is nominal and the actual voltage range
playing the last sound before it goes into low- sampling rate (#5). may vary slightly.
power sleep. If set to zero, the SDSEM will These work in a similar fashion to the volume In FREQUENCY mode, the maximum fre-
never go into sleep mode. Use this setting if parameters, and also have a nominal value of quency is around 23kHz (assuming a 50% duty
the power supply cuts out when the module is 256. So with a value of 256, the playback rate will cycle) and the resolution is about 5Hz.
not in use. The SPEAKBACK function will say equal the file’s sampling rate, while higher values Again, the pin’s internal pull-up is enabled,
‘power standby off’ in this case. will play it back faster and lower values slower. allowing a transistor collector or MOSFET drain
The value given is in seconds, up to a The minimum possible playback rate is 1kHz to pull this pin low to control the frequency.
maximum of 357 (which is just under six min- and the maximum is 65kHz. Generally, you would
utes). When it goes into sleep mode, current SPEAKBACK
use files with sampling rates around 8-22kHz, so
consumption is around 20µA if running from a The SPEAKBACK debugging parameter can be
this gives plenty of scope for adjustment.
3V battery. If a sound is triggered in this mode, set to ALL, SUMMARY or NONE, and defaults
It is possible for the low volume to be higher
playback will take up to half a second to resume to ALL to make troubleshooting easier.
than the high volume, in which case the volume
(but typically around 250ms). This is because When set to ALL, the values provided for all
will decrease with an increasing control signal on
the SD card needs to be re-initialised each time the above parameters are ‘read out’ via the audio
the SW4 pin. And the same comment applies for
it is powered up. output when the SDSEM starts up.
the playback rates.
So the standby timer provides a compromise This is done by playing back audio samples
Any subsequent values after these five param-
– there will be a slight delay between the first stored in its internal Flash memory (these
eters are interpreted as file names. Files must be
trigger event in sleep mode and the sound being samples take up about 95% of the Flash space).
stored in the SD card’s root directory. They must
played back, but the unit will then remain in idle It is not possible to read out the individual
be in PCM (uncompressed) WAV format, with
mode for the specified time so that subsequent file names, so in each case where a file name is
8-bit or 16-bit samples and in mono or stereo.
trigger events will not incur any delay. encountered, you will either hear ‘OK’ if the file
So if you are running the unit off the battery, SW4MODE is present or ‘NOT OK’ if it has not been found
you will want to have a non-zero sleep mode to The first value for this parameter is either TRIG- or is too small to be a WAV file.
avoid draining it too quickly. GER, FREQUENCY or ANALOG. If the mode is set Note that at this point, the unit has not ac-
On the other hand, if you’re running from to TRIGGER then the SW4 input can be used to tually checked the contents of the file, so you
mains-derived power or if you are cutting the trigger sounds like any of the other trigger inputs. may hear ‘OK’ even if a file is corrupt or is not
power externally when the unit is not being If the mode is set to ANALOG then the volt- in the correct format
used (eg, using a physical switch) then you age on that pin instead controls the volume and/ When SPEAKBACK is set to SUMMARY,
can set the idle period to zero to disable sleep or playback rate of audio samples triggered by the result is the same as above except that
and avoid the delay upon wakeup. other inputs. it skips over the settings of the SWITCH1-7
In the case of a non-zero timeout, the speak- Two additional parameters must be provided, parameters to save time. If set to NONE, no
back will read back as ‘power standby’ followed and these are the lowest and highest expected reading out occurs and the unit starts normal
by the number of seconds. In the low-power voltages (in a whole number of millivolts) on operation immediately upon power being ap-
mode, the amplifier and boost regulator are this pin. These correspond to the minimum and plied. So you would normally have a line reading
shut down, which also means that the microSD maximum volumes and playback rates specified ‘SPEAKBACK=NONE’ in your configuration file
card will shut down. for the affected trigger inputs. once you are sure the settings are correct.

38 Practical Electronics | September | 2019


WHITE NOISE
GENERATOR
This white noise generator is very simple and cheap to build. It produces
white noise which does not repeat over any short time frame and has a
variety of uses, as explained below.
by John Clarke

A
white noise signal has equal and typically needs to be amplified by An improved white noise source
intensity at all frequencies in a factor of several hundred times to Our design uses a low-cost 8-bit PIC12
the band of interest; for exam- make it usable. microcontroller to produce a 31-bit
ple, 20Hz-20kHz for audio. It’s the Alternatively, white noise can be pseudo-random sequence, which only
hissing sound that you hear if you tune generated digitally with a pseudo- repeats after 231 or approximately
an analogue FM radio to a frequency random number generator. two billion cycles. That works out to
on which there is no transmission. This has the advantage that the nearly eight hours, so the repetition is
There are many reasons why you signal level is already high, it is con- definitely not discernible.
may want a white noise signal. For sistent and it is not dependent on a The basic ‘circuit’ for our white
example, you can use white noise to particular transistor or zener diode’s noise generator is shown in Fig.1. IC1
drown out external noises that may in- characteristics. is a PIC12F617-I/P, which has a 2-5V
terfere with your sleep. If that dripping National Semiconductor used to sell supply fed into pins 1 and 8. A 100nF
tap is keeping you awake, don’t count a digital noise source IC, the MM5837 bypass capacitor is connected directly
sheep; try a low-volume white noise (designed in the 1970s) that used an in- between pins 1 and 8 to ensure that
source with a speaker close to your bed. ternal 17-bit pseudo-random sequence it has a stable operating voltage. The
generator to produce white noise for noise output appears at its GP0 digital
We can attest: it works wonders! audio applications. Supplied in an output (pin 7).
It’s especially effective at helping ba- 8-pin DIL package, it was designed for Pin 4 is the master clear/reset
bies get to sleep since they are used musical instruments, synthesisers and (MCLR) pin. This is held at VDD during
to hearing somewhat similar sounds for room acoustics testing. normal operation by an internal pull-
in the womb. It can also be used to Its main disadvantage was a notice- up current. If it is externally pulled
help treat (or at least mask) tinnitus (a able cyclic repetition. The repetition low, this will hold the microcontroller
persistent ringing sound heard in the was due to the full random sequence in a reset state and so the noise output
ears when there is no sound present). being produced in less than one sec- at pin 7 will cease. When released,
White noise sources can be used to ond and being continuously cycled. the internal pull-up will bring it high
measure the bandwidth or impulse This IC is not available any more, but again, allowing the processor to run
response of a circuit and to check room with modern components, we can make and resuming noise generation.
acoustics or optimise a PA system. an even better digital noise source. You just need the two components,
They are also used in analogue au- the programmed IC and a 100nF by-
dio synthesisers to help produce the pass capacitor, as shown in Fig.1.
‘ssshhhh’ sound of various percussion And it’s dead easy to wire up since
instruments, such as hi-hats, snare only four pins are normally used – the
drums and cymbals. bypass capacitor can be soldered right
next to the IC (even right across pins
Generating white noise 1 and 8 if you wish!). The other four
There are several ways to generate pins (pins 2, 3, 5 and 6) are not used
white noise. For example, if you and should be left disconnected.
reverse-bias a zener diode or transistor
emitter-base junction (ie, the base- Fig.1: the ‘circuit’ could hardly be simpler Pseudo-random
emitter reversed) with a low DC cur- – everything is done in software in the sequence generation
rent level, an AC voltage will appear PIC12F617-I/P. Noise output is taken from Fig.2 shows how the software generates
across it and this will have a white pin 7, while a 100nF capacitor bypasses a pseudo-random sequence generator
noise characteristic. However, the the supply (pins 1 and 8) – pins 2, 3, 5 using three 8-bit shift registers and
resulting AC voltage level is quite low and 6 are not connected. a 7-bit shift register. The bits within

40 Practical Electronics | September | 2019


the four shift registers are labelled Q1
to Q31. The software is available for
download from the September 2019
page on the PE website.
These bits are pre-loaded with a spe- Reproduced by arrangement with
cific value when the micro comes out of SILICON CHIP magazine 2019.
reset, to provide a starting point for the [Link]
random sequence; as explained below,
this can be any state but all zeros.
Each time a clock pulse occurs,
Fig.2: here’s what happens inside the PIC – the 28th and 31st bits are XOR-ed
the value of Q1 is moved into Q2, Q2 and fed back into the first bit, while the other 31 are shifted to the right by one.
into Q3 and so on, up to Q30 which
is moved into Q31. This means that
all the bit values are updated from and this results in a sampling rate of it is something that we will cover in a
their neighbour, except for Q1. It gets 153.846kHz (2MHz÷13). When divided future article.
its value instead from the output of a into the cycle length, this gives us the Pink noise has its own uses, such as
two-input exclusive-OR (XOR) gate, approximately eight-hour repeat rate for calibrating audio equipment, simu-
with its inputs being the values of bits mentioned earlier. The noise frequency lating background noise and it can also
Q28 and Q31. distribution is therefore even up to about help with sleeping.

Ensuring a long repetition time


You may be wondering how we know
that the sequence generated by this ar-
rangement won’t repeat for 231 cycles.
That is guaranteed by using the cor-
rect ‘taps’ (in this case, bits 28 and 31)
to be combined to generate the new
value of Q1 for each cycle.
The list of taps required for various
length shift registers to ensure a maxi-
mum length repeat cycle is given on
page 5 of the following application note:
[Link]
Note that this document refers to the
use of an XNOR (exclusive NOR) gate
rather than XOR gate. The only differ-
ence is with the lock-up state. That is
the initial state of the shift registers
Fig.3: the spectrum of the white noise generated by the PIC. The power level is where the generator stops producing a
consistent across all frequencies up to about 20kHz. The drop in level discontinuity varying output.
at 20kHz is due to sound card and computer software limitations. The XNOR version has a lock-up
state when all values in the shift reg-
Once this shifting is complete, the 76.923kHz, which is the Nyquist limit isters are ones (high output), whereas
value of Q31 is effectively lost, al- for this signal; ie, half the sampling rate. the XOR has a lock-up state of all zeroes
though it does control the value loaded Because the output is a square wave, (all low).
into Q1, so you can think of this as a it will have components at higher fre- The lock-up situation is prevented
modified type of ‘bit rotate’ operation. quencies than this, but they will have a from happening when using either
The Q31 bit value also determines decreased amplitude and power level. XOR or XNOR gates by starting the
the level on pin 7 and thus becomes The measured spectrum from noise sequence with a number other
the noise output; hence we do not want our prototype is shown in Fig.3. It than all zeroes or all ones.
to retain its value in one of the other extends over the
bits; if we did, this would quickly lead entire audio spec-
to repetition. trum (20Hz-20kHz)
This approach has two advantages. and well beyond at
One, the 31-bit length leads to a very both the low-fre-
long time until the sequence repeats quency and high-
and two, the simple XOR gate used to frequency ends
provide the pseudo-random effect is (the measurement
very easy to implement in software and bandwidth is only
takes very little time to process, allow- 20kHz).
ing for a high clock rate and thus giving While the IC gen-
the noise signal a wide bandwidth. erates white noise,
The entire process to update the it could potentially
contents of the four registers, including be used to generate
the XOR operation, takes 13 software pink noise with an
instructions. appropriate filter
The PIC12’s internal 8MHz oscillator at its output. But
gives a 2MHz instruction rate (it takes such a filter is not
four cycles to execute one instruction) simple to design;

Practical Electronics | September | 2019 41


Circuit Surgery
Regular clinic by Ian Bell

Understanding bipolar junction transistors – Part 3

T
his month, we continue with
our look at the different bipolar Common emitter Common collector Common base
transistor circuit configurations In B C Out In B E Out In E C Out
– common emitter, common base and E C B
common collector – inspired by a question
on this topic on the EEWeb forum. In July’s
first article in this series we introduced
the concept of transistor configurations, Fig.1. Concept of transistor configurations. These apply to both NPN and PNP. Actual
the basic operation of the transistor and circuits require additional components.
the equivalent circuit models that are
used to analyse circuits. Then, last month the common-base circuit. In both cases we in a similar way to the common-emitter
(August) we looked in detail at the most need to set the operating point of the tran- amplifier. Choose the operating collector
widely used configuration – the common- sistor by forward biasing the base-emitter current (IC) and voltage at the emitter (VE)
emitter amplifier, also going into more junction with a DC voltage that will cause with no signal; typically, this is in range
depth on bias and the use of models to the no-signal collector current to be set of a tenth to a third of the supply. This
analyse the circuits that are relevant to to the level we require. As with the com- voltage and current set the value for R4
working with all the configurations. This mon-emitter circuit, the base-emitter bias (= VE/IC). The operating current and R3
month, we will look at the common-base voltage for common base can be set using set the no-signal voltage at the collector;
amplifier and also, because it relevant to a potential divider connected across the this is VCC – R3IC. Often, this voltage will
understanding the differences between supplies. Fig.3 shows the biasing circuit be in the range of half to two thirds of
the configurations, we will discuss input for the common-base amplifier, in which the supply. The voltage drop across R3 (=
impedance and the operation of the cir- R1 and R2 form a potential divider set- R3IC) sets the maximum amplitude of the
cuits at high frequency. ting the voltage on the base. output signal (larger output signals will
clip at the supply voltage). The operating
Common base Bias current sets the required value of base-
Looking at the different configurations in Last month, we discussed bias stability emitter bias voltage (VBE) and the values
Fig.1 we see that in both common-emit- and the use of feedback to deal with the of the potential divider resistors R1 and
ter and common-base configurations the high sensitivity of the bias to variations R2 are chosen to provide a voltage of VE
output is from the collector. As with the in transistor characteristics – variations + VBE. The total resistance value should
common-emitter circuit discussed last both between individual devices and be such that the current through the resis-
month, to use this configuration we add with changes in temperature for a given tors is at least ten times the base current.
a resistor between the collector and the transistor. This was achieved by putting
power supply. This provides a route for a resistor between emitter and ground. R4 Capacitors
power to get to the transistor so that it plays the same role in the circuit in Fig.3. For the common-emitter amplifier we
can act as an amplifier, and it converts In fact, the configuration of resistors in bypassed the emitter resistor with a
the varying collector current (transistor this circuit is exactly the same as for the capacitor so that the feedback only
output current signal) into a varying col- common-emitter amplifier, but the circuit
lector voltage. Thus, we get the circuit is drawn with a different layout to empha- VCC
in Fig.2, but exactly as we discussed for sise the use of the emitter as the input.
the common-emitter circuit, this circuit The bias resistors values can be set R1 R3
is not practical because we also need to Out
provide bias. In
VCC
Following on from the discussion on Q1

bias and operating point last month, we can R1


apply much of what we looked at then to
Out
In R2 R4

Simulation files Q1

Most, but not every month, LTSpice


is used to support descriptions and
analysis in Circuit Surgery.
The examples and files are available Fig.2. Basic common-base amplifier Fig.3. Common-base amplifier DC bias
for download from the PE website.
without bias circuitry. circuitry.

42 Practical Electronics | September | 2019


VCC
C C C
IC ic ic
R1 R3
C2
B ib
C1 Out ic = gmvbe ic = gmvbe
IC = βIB
In rbe
Q1 IB ib
B B
vbe
VBE E
vbe re

C3 R2 R4
IE ie
a) E b) E c)

Fig.6. Transistors models: (a) simplified Ebers-Moll (b) small-signal model with re (c)
Fig.4. Common-base amplifier. small-signal model with rbe.

influenced the bias. For the common- Models model for the whole amplifier we need to
base circuit we need to bypass the bias In the previous articles we introduced the include the other component too – as we
resistor connecting the base to ground small-signal models that are often used showed for the common-emitter ampli-
(R2 in Fig.3). Note that in both cases, to analyse transistor circuits. These are fier last month. The bypass resistors can
if you think of the capacitor as a short based on linearising a model that covers be assumed to be effectively short circuits
circuit at relatively high frequencies, the full range of transistor operation at at signal frequencies, so the transistors’
then the bypass capacitor ensures that the operating point set by the bias. Fig.6 common connection is grounded in the
the common terminal of the transis- shows three transistor model circuits models for the circuits in Fig.4 and Fig.5.
tor is connected to ground as far as AC (which were shown in the first article).
signals are concerned – as it is in the The full-range (or large-signal model) is Input resistance
configuration concepts shown in Fig.1. shown in Fig.6a. At a particular operat- From Fig.7, we see that a key difference
The bypass capacitor value should be ing point the diode has a certain effective between the common-base and com-
selected to have low ‘resistance’ (imped- resistance and, as long as the signal does mon-emitter configurations is the input
ance) at the lowest signal frequency the not cause a large change in voltage or resistance (across which the input signal
circuit will be used to amplify. current, we can assume this value is con- vbe is applied), which is re and rbe respec-
As with the common-emitter circuit, stant. Replacing the diode with a resistor tively. In the first article we noted that
the input signal to the common-base am- leads to the small-signal model shown in the relationship between these values
plifier is applied via a coupling capacitor Fig.6b. Fig.6c shows an alternative ver- was rbe = (1 + β)re. Thus, given that β is
so that any DC component of the input sion of the small-signal model, in which typically 100 or more for transistors used
signal does not disrupt the bias. Simi- the resistance between base and emitter in small-signal amplifiers, we conclude
larly, the output is commonly connected is arranged differently. that the input resistance of the transistor
via another coupling capacitor. Using The models in Fig.6b and Fig.6c are in common base is much smaller (by a
the bypass capacitor discussed in the electrically the same from outside of the factor of β) than that for common emitter.
previous paragraph, and the coupling transistor, but each is suited to differ- The value or re is approximately 25/
capacitors added to the circuit in Fig.3, ent contexts. Fig.6c, which we used last IE at room temperature, with IE in mA. In
we arrive at a practical implementation month, fits naturally with common-emitter the circuit in Fig.4, R4 is in parallel with
of the common-base amplifier, as shown circuits – the input is across the base-emit- re, but since re is likely to be smaller than
in Fig.4. C1 and C2 are the coupling ca- ter resistor (rbe) and the output current R4, re it will dominate the input resistance.
pacitors and C3 is the bypass capacitor. source is from collector to emitter. Thus, With an operating current of 1mA the input
Fig.5 shows the common-emitter ampli- the emitter is the common connection in resistance of the circuit in Fig.4 is around
fier (with which people are generally the model. Similarly, the model in Fig.6b 25Ω. This situation sounds bad – often we
more familiar) for comparison. fits with the common-base configuration want a large input resistance for a voltage
– the input is across the emitter resistor amplifier, but, as we will see later, one ad-
(re) and the output current source is from vantage of the common-base circuit is its
VCC collector to base. potential for providing wide bandwidth.
Fig.7 shows the two small-signal models High-frequency signals are often connect-
R1 R3 from Fig.6 redrawn in the conventional ed via cables with impedances in the tens
C2
layout, which more clearly shows the of ohms (eg, 50Ω and 75Ω) which need to
C1 Out
In base and emitter as the common connec- be matched to a circuit’s input impedance
Q1 tions. Note that if we draw a small-signal to prevent reflections. The common-base

ie ic ib ic
R2 C3 R4 E C B C

gmvbe gmvbe
vbe re or vcb vbe rbe or vce
αie βib

B B E E
Fig.5. Common-emitter amplifier for a) b)
comparison with the circuit in Fig.4. The
differences are the input connection and Fig.7. Small-signal models drawn with conventional layout (a) common-base
the location of the bypass capacitor C3. configuration (b) common-emitter configuration.

Practical Electronics | September | 2019 43


the phase shift) in Ohm’s law and similar β of approximately 300 from the LTSpice
R
Vin Vout
calculations. For a capacitor with capaci- model to give rbe (≈βre) at about 7.5kΩ. The
tance C, the effective resistance (magnitude) resistances in parallel are about 2.1kΩ,
at frequency f is equal to 1/2πfC. giving a cut-off of around 7.6Hz. If our
C
Combinations of resistors and capaci- specification was for a minimum frequen-
tors, as we see in Fig.4 and Fig.5, result cy of 100Hz, this would be fine, but if we
in circuits with a frequency-dependent had used C1 = 0.1µF then the input cou-
response – that is, the input/output rela- pling cut-off would have been too high
tionship (gain) will vary with frequency. at around 760Hz.
Fig.8. RC low-pass circuit. A simpler circuit is shown in Fig.8 – this
is well known as an RC low-pass filter. Transistor capacitance
circuit’s input impedance is of the same At very low frequencies, the impedance The low-frequency behaviour of the
order of magnitude as this, so the low re- of C is very large – it is more or less an circuits we are discussing depends on
sistance may not be as problematic as it open circuit, so all of Vin passes to Vout. components we have specifically includ-
seems in some applications. At very high frequencies, the impedance ed in the design. For high frequencies we
The output current of the common-base of C is very low – it is more or less a short need to look at what are known as parasitic
amplifier can be represented as gmvbe when circuit, so Vout will be close to zero. What components – the unwanted resistance,
considering voltage amplification. This is constitutes ‘low’ and ‘high’ frequencies capacitance and inductance inherent in
the same as the common-emitter amplifier, depends on the values of R and C. A fre- all components and wiring. In this case
and given the output circuit at the collector quency of particular interest is the defined we are particularly interested in the inter-
is effectively the same, the common-base cut-off frequency (fc), which is given by, fc nal capacitances of the transistor, which
amplifier can provide high voltage gain = 1/2πRC. At this point, the output power are shown in Fig.10. The base-emitter and
like the common-emitter amplifier. is half that at very low frequencies. The base collector capacitances (Cbe and Cbc)
circuit in Fig.9 is similar to Fig.8, but it are the most significant, being much larger
Frequency response is a high-pass filter – blocking DC and than the collector-emitter capacitance. In
So far, in our discussion of transistor cir- low frequencies but letting high frequen- typical amplifier circuits, Cbe depends on
cuits we have not discussed the effect of cies through. The same cut-off frequency the capacitance of the forward biased base-
frequency in depth. In general, we need formula applies for the cut-off frequency emitter junction and the charge held in
to consider both the high-frequency and We can form a small-signal model with the transistor’s base region during conduc-
low-frequency response of an amplifi- all the circuit components present (eg, tion. Cbc is the capacitance of the reverse
er to see if meets our requirements. We for Fig.4 or Fig.5) and perform the cir- biased base-collector junction. Like many
will look at both these in the rest of this cuit theory algebra to work out formulæ other transistor parameters these values
article with reference to both the com- for the complete frequency response – vary with operating point.
mon-emitter and common-base circuits. with a lot of components this may get
At low frequencies the situation is similar complex or messy. Alternatively, we can The Miller effect
for both circuits, but there is a significant consider just one part of the circuit and Before discussing the effect of these capac-
difference at high frequencies. look at the model structure to get at least itances on the amplifier circuits we need
Capacitors and inductors are compo- an approximate idea of the influence of to look a piece of circuit theory called the
nents whose effective resistance vary with particular components. Miller theorem. This relates to removing
frequency and we refer to the effective resis- an impedance (Z), which is bridging two
tance of frequency-dependent components Low-frequency cut-off parts of a linear circuit network (N1 and
as ‘impedance’. For a resistor, Ohm’s law We have used coupling capacitors to make N2) and replacing it with two impedances
provides a simple relationship between sure that only the AC part of the signal is (Z1 and Z2) which are each connected to
voltage across and current through a re- input to our amplifiers, preventing pos- only one side of the ‘bridge’ (see Fig.11).
sistor (V = IR) and a similar relationship sible disruption to the bias. These will The circuit is linear, so the two voltages
applies to impedances. However, a resis- form high-pass filters with resistances are related by V2 = KV1 (we can think of
tor does not change the relative timing of present in the circuit or system. Consider K as being the gain or attenuation that the
the current and current voltage, but in- the input coupling capacitor for the com- circuit has between these two points). The
ductors and capacitors (and impedances mon-emitter amplifier in Fig.5 (C1) – the new circuit is equivalent to the original
in general) do – causing a shift in time of bias resistors R1 and R2 will be in parallel in that the voltages and currents in N1
the AC current signal with respect to the with the transistor’s rbe, (remember that and N2 remain the same. The theorem
voltage signal (phase shift). This makes a the power supply is a short circuit in the provides the values of Z1 and Z2 in rela-
full analysis of a circuit containing imped- small-signal model). The parallel resis- tion to Z and K, specifically:
ances more complex than one with just tance value will form a high-pass filter like
resistances; however, in some cases we can Fig.9 with the coupling capacitor. From Z1 = Z(1 – K)
keep things simple and only use the mag- this, we estimate the low-frequency cut- Z2 = Z(1 – 1/K)
nitude of the impedance (not considering off point due to the coupling (or select a
capacitor to give us the desired cut-off).
C
This result will not necessarily tell us the Cbc
C
Vin Vout
low-frequency cut-off for the whole cir-
cuit, as other components such as C3 will
also influence this; however, it will pro- B Cce
R
vide some idea of the right value for C1.
For example, using the values for Fig.5
from last month, we have C1 = 10µF, Cbe
R1=16.2kΩ and R2 = 3.5kΩ. To estimate E
rbe, we use the previously mentioned re
Fig.9. RC high-pass circuit. = 25/IE with 1mA operating point and a Fig.10. Bipolar transistor capacitances.

44 Practical Electronics | September | 2019


to have lower higher-frequency cut-off
V1 V2 V1 V2
(lower bandwidth) than similar ampli-
N1 Z N2 N1 N2 fiers without this effect present.
From Fig.13 it appears that if the
Z1 Z2 source impedance is very low then the
capacitor may cause minimal attenua-
tion. However, transistors have another
parasitic component – the base resis-
tance, which is located between the
Fig.11. The Miller theorem. external terminal and the base-emitter
resistance and capacitance. In the con-
C text of the Fig.13 model, it is in series
with the source resistance, so it will act
in that capacity, even if the source itself
V1 V2 has very low resistance.
–A –A Fig.14 shows a small-signal model for
a common-emitter amplifier with the sig-
(1 + A)C (1 + 1/A)C nificant transistor capacitances added. RL
is the collector load resistor, R3 in Fig.5.
a) b) Cbe is in parallel with rbe and bypasses
the input to the base at high frequencies,
Fig.12. The Miller effect. reducing the effective current gain of the
transistor as frequency increases (the cur-
The Miller theorem has a number of ap- capacitor of value (1 + 1/A)C. This leads rent in Cbe does not control the collector
plications, but here we are interested to the Miller equivalent circuit shown current, unlike the normal base current).
in the effect of a feedback capacitance in Figure.12b. The capacitance at the The cut-off frequency related to this RC
on the effective input capacitance of input is multiplied by the gain, which combination occurs when the magni-
amplifiers. Consider an amplifier (with for a large gain results in a large effec- tude of impedance of Cbe equals rbe and
gain –A) with a capacitance (C) between tive input capacitance that may have a is given the symbol fβ. Further increases
input and output, as shown in Fig.12a. significant impact on the circuit. This in frequency reduce the current gain fur-
We consider a negative gain to cover the is known as the ‘Miller effect’. The ef- ther, with it eventually reaching unity at
case of an inverting amplifier (or situa- fective input capacitance is called the a frequency referred to as the transistor’s
tion where the capacitance appears as a ‘Miller capacitance’. transition frequency, fT – this value gives
negative feedback path). From a Miller an indication of the highest frequencies
theorem perspective, N1 is the ampli- High-frequency cut-off at which a transistor can be used.
fier’s input circuitry and N2 is its output Fig.13 shows the generic situation for Fig.14 shows that the base-collector
circuitry – these being parts of a ‘linear a signal source connected to an ampli- capacitance is between input (base) and
circuit network’, which in this case is the fier. Without any input capacitance, the output (collector) for the common-emit-
whole amplifier. We have a relationship source and input resistance act as a po- ter amplifier. It therefore acts as a Miller
between the two voltages, V1 and V2 set tential divider, reducing the effective capacitance and has a significant effect
by the amplifier’s gain, that is V2 = –AV1, input voltage for small rin and/or large on bandwidth, as discussed for generic
so the Miller K parameter is equal to the rs at all frequencies – this is why the low case earlier. Fig.15 shows a small-signal
amplifier gain (ie, K = –A) in this case. input resistance of the common-base am- model for a common-base amplifier with
In Fig.12a the Miller impedance (Z) is plifier is potentially problematic. If we the significant transistor capacitances
the feedback capacitor (C) so we can write also consider input capacitance, we see added. Here we see that there is no sig-
Z = 1⁄2πfC. Applying this to the Miller that because it is in parallel with rin it nificant Miller/feedback capacitance – Cbc
theorem equation Z1 = Z(1 – K), also with reduces the input impedance and hence is across the load. This provides the com-
K = –A, as just discussed, we get: the overall gain at high frequencies. It mon-base amplifier with the potential to
acts as a low-pass filter with the source provide high gain at very high frequen-
Z1 = (1⁄2πfC) ⁄ (1– –K) resistance – the larger the capacitance cies, ultimately limited by the transistor’s
= 1⁄2πf(1+K)C the lower this cut-off. As we have just fT. There is still possible attenuation due
seen, the Miller effect causes a small to Cbc and RL, but RF circuits will often
This is equivalent to a capacitor with feedback capacitance to act as a large use an inductor and capacitor in the col-
value (1 + A) times the original capaci- input capacitance, so amplifiers with lector, providing a tuned load that can
tance. Similarly Z2 is equivalent to a significant Miller capacitance will tend take Cbc into account.

Cbc
rs
E C
B C

vs vin rin Cin vbe Cbe re gmvbe Cbc RL vout


vbe Cbe rbe gmvbe RL vout

B B
E E
Signal source Amplifier

Fig.13. Generic connection of a signal Fig.14. High-frequency small-signal Fig.15. High-frequency small-signal
source to an amplifier input. model for a common-emitter amplifier. model for a common-base amplifier.

Practical Electronics | September | 2019 45


AUDIO AUDIO OUT

L R

OUT By Jake Rothman


Designing Hi-Fi mini-monitor loudspeakers – Part 1
radio studios, known only bought by elite Hi-Fi enthusiasts
as the ‘LS3/5A’. A tried and professional recording circles. The
and tested speaker, it solid wooden speakers gracing most
will be the inspiration living rooms in the 1980s have been
for this series of arti- replaced by plastic tat. However, over
cles. We’ll start this the next few months, I’ll show how to
month with a little make your own and put back some of
background and his- the lower colouration exhibited by old-
tory of the LS3/5A, as er BBC and KEF designs. There will be
well as looking at some six options to build, most of which pay
of the technical con- homage to the BBC LS3/5A – see the
siderations in speaker box opposite.
design. (Surprisingly, The unusual LS3/5A name is based
the papers originating on the BBC convention. ‘LS3’ indicted
from this licence-payer it was a loudspeaker (primarily) intend-
funded effort are avail- ed for outside broadcasting vans, while
able for download from the ‘LS5’ was used for studio monitor-
the BBC website. It’s an ing. The number after the stroke is the
essential read for any model number (5), and the final letter
Fig.1. A current production LS3/5A by Rogers. aspiring loudspeaker denotes alterations to the original spec-
designer. Nowadays, ification, of which there was only one

I
t has long been a British au- the BBC does less technical research – hence the ‘A’.
dio tradition to design small but and is content to use consumer tech- An unusual aspect of the LS3/5A is
accurate Hi-Fi speakers, known as nology such as Skype and commer- that since the BBC was not interested in
‘mini-monitors’. The concept originat- cial speakers.) manufacturing speakers, from 1975 they
ed in the BBC, where they undertook Unlike most consumer electronics, licensed production to a small number
world-leading research and develop- loudspeakers have remained rather of British companies. A modern incarna-
ment in speaker systems in the 1960 expensive and may even have gone back- tion of the original LS3/5As from Rogers
and 1970s. This led to the develop- wards in some areas of sound quality. is shown in Fig.1, while Fig.2a and
ment of a two-way small speaker to I don’t know what has happened, but Fig.2b show 1960s adverts for older mi-
be used in outside broadcast vans and it’s almost as if good speakers are now ni-monitors, the Maxim from Goodmans

Fig.2. 1960s adverts showing the first successful British mini-monitor speakers: (left) Goodmans Maxim, (right) the Celestion’s Ditton 10.

46 Practical Electronics | September | 2019


PE Mini-monitor build options
1. Authentic BBC LS3/5A – all components from Falcon Acoustics (FA)
Cabinet – kit cabinet, BBC spec from FA online shop
Driver – BBC spec from FA online shop (KEF B110A)
Tweeter – BBC spec from FA online shop (KEF T27)
Crossover – BBC spec from FA online shop
Total cost approx. £850: equiv to £2300 speakers
2. Vifa (Danish ) driver design – good, small mini-monitor – not an ‘LS3/5A’
Cabinet – pre-assembled unpainted MDF cabinets from Earworm Records
Driver – Vifa drive units (BC14SG49-08), from Earworm Records
Tweeter – Vifa tweeter (TC26SF05-06), from Earworm Records
Crossover – assembled X-over built on wood from Earworm Records
This design is essentially assembled, including driver, tweeter and crossover,
but I will offer tips for improvements. Approx £200 per pair for assembled
units + p&p: equiv to £600 speakers
3. DIY Vifa design – option 2, but with PE design for cabinet and crossover
Cabinet – PE plywood design – 9-inches deep with baffle for Vifa units
Driver – Vifa drive units (BC14SG49-08)
Tweeter – Vifa tweeter (TC26SF05-06)
Crossover – built on PE crossover PCB
4. PE Mini-monitor, LS3/5A style (FA version)
Cabinet – PE plywood design (9-inches deep) with baffle for FA driver
Driver – same driver as LS3/5A kit (No.1) (KEF B110A)
Fig.3. A derivative of the LS3/5A, the Tweeter – different tweeter from No.1 kit – this will use an SEAS design
round Jim Rogers JR149. A very low- Crossover – built on PE crossover PCB
colouration cabinet.
5. PE Mini-monitor, LS3/5A style (Wavecor version)
and the Ditton 10 from Celestion. The Cabinet – PE plywood design (9-inches deep) with baffle for Wavecor units
uniquely round JR 149s (Fig.3) as well Driver – Wavecor
as LS3/5A-inspired Proacs, Spendors Tweeter – Wavecor
and Harbeth HL-P3s now command Crossover – built on PE crossover PCB
high prices on eBay.
6. Active PE Mini-monitor, LS3/5A style (circuit works with all of the above)
The LS3/5As produced by Rogers
The active option will be designed on a single PCB and will incorporate
were generally considered the best, and
much of the special detail on wiring layout, power amplifiers and power
recently these have just been reintro-
supplies I’ve previously described in Audio Out. This circuit will not only
duced using Chinese-made versions of
drive the PE Mini-monitor but also pretty much any small two-way speak-
the venerable KEF drivers. The cost is
er system. The design of the PE plywood cabinet ensures activisation only
around £2800.00, moving them out of
requires replacing the rear panel, which will include a cutout for the heat-
the engineering sphere into the realms
sink, IEC mains connector and XLR socket.
of Rolex watches.

System synergy whole. As well as the drivers, there is If you want to make your own de-
The principles of mini-monitor design the cabinet and a special circuit called sign using alternative drive units, you
are embodied in the options listed in a crossover, which directs the right fre- will need to invest in some frequency
the PE Mini-monitor box above, which quency ranges to each driver. Just as in response measuring software or use an
are inspired by the original LS3/5A. a well-tuned car, all these parts need to old analogue plotter, such as the Neu-
A passive speaker system is a col- be optimised to work together. There is trix Audiograph (Fig.4) in an anechoic
lection of parts and subsystems that no point mounting a £100 bass driver room (in my case, a loft lined with mat-
interact and combine to create a coherent in a shoe box. tresses) shown in Fig.5.

Fig.4. To plot the frequency response of a speaker you need at least a signal generator and dB-reading multimeter. (Left) I use a Neutrik
Audiograph 3300 from 1981; (right) the Neutrik and a constant-current generator used to measure an impedance curve.

Practical Electronics | September | 2019 47


since the vibration is coupled more ef-
ficiently to the air at high frequencies,
which can be considered to be a form
of acoustic impedance matching.
These two very different design re-
quirements are the reason why all Hi-Fi
speaker systems are composed of at
least two drive units, one optimised for
bass, and the other optimised for treble.
These drive units are called the ‘woofer’
and ‘tweeter’ respectively, and such a
system is described as ‘two-way’. Typi-
cally, the woofer will be fed frequencies
from 20Hz to 3kHz and the tweeter from
3kHz to 20kHz.

Crossovers
Fig.5. To minimise room reflections when taking frequency response measurements it’s To make a two-way system work effec-
necessary to line the walls with acoustic absorbent material. Shown here in my attic, tively electrical filters are required to
mattresses help provide almost anechoic conditions above a few hundred hertz. The steer signal frequencies to the correct
photo shows a Meridian M2 active system being tested. speaker. The simplest system is a capac-
First, we need to cover some speaker corresponding wavelengths from 17m itor in series with the tweeter, typically
basics and terminology. Loudspeaker to 17mm. Compare this with the spec- 2.2µF to produce a 5kHz high-pass fil-
design and construction is multidisci- trum of visible light, which has a ratio ter when used with an 8Ω tweeter. This
plinary; covering acoustics, mechanics, of just 1.8 to 1. prevents low-frequency currents from
materials science, adhesives technology, This complicates the physical require- destroying the tweeter’s small low-mass
magnetics and even woodwork. For pas- ments for optimum sound propagation voice-coil and diaphragm. (Note that in
sive designs, electronics is a small part because very different considerations music there is much more low-frequency
of what is essentially an electro-acoustic need to be observed at opposite ends energy than high. This is why the tweet-
system. It is still very much craft based of the audio spectrum. For adequate er voice coil can have a thermal rating
and can offer real hands-on building sat- low-frequency reproduction a speak- of only a few watts, even if it is used in
isfaction. (I’ve found speaker building is er needs to have a large surface area of a system powered by a 50W amplifier.)
an excellent way of teaching technology at least 70cm² (10 square inches) and For the bass, the low-pass filter can
to disaffected young men!) be able to move back and forth about simply be the mechanical roll-off of
12.5mm (half an inch). If it has a larger the woofer – in other words, for a very
Frequency range, woofers area, it doesn’t have to move so much – it simple crossover the woofer has no
and tweeters is the total air displacement that matters. electrical components. This system can
Audio is unusual among physics-based For high frequencies, it is the moving work surprisingly well, such as in the
technologies in that it covers three mass that is important, since the dia- Acoustic Research AR7. However, for
decades of frequency range, a 1000 phragm has to move fast with no inertia. good quality crossovers, a tweeter ca-
to 1 ratio – from 20Hz to 20kHz, with A small area of about 2cm² is adequate, pacitor is not enough, and the bass unit
benefits from a filter. This is because
the woofer’s mechanical high frequen-
cy roll-off is poorly defined. It can vary
widely between individual drive units
and may often increase with level. For
effective filtering, at the minimum, a
series inductor is needed. Additional
reactive components are also needed
to achieve steeper slope filtering and
for tuned circuits to remove peaks. In-
ductors have to be used because an RC
low-pass filter would have unacceptable
losses due to the series resistance. An
inductor has a low impedance at bass fre-
quencies allowing them through, while
its rising reactance at high frequencies
blocks high-frequency signals without
any power/heat losses.
Unfortunately, the inductor is the least
‘perfect’ passive component; having sig-
Fig.6. The raw frequency response of the B110A bass unit used in the LS3/5A in its nificant DC resistance, distortion (due to
cabinet. This needs considerable correction by the crossover filter before it can be used. hysteresis and vibration), cost and large
This old BBC curve from Malcolm Jones shows the acceptable frequency response physical size. These deficiencies are
variation between units. Note that loudspeaker frequency response curves always have typically an order of magnitude worse
log axes, with the vertical axis expressing level in decibels (dB) and frequency along than capacitors. However, in a passive
the horizontal X axis. Unfortunately the BBC based their design on a particularly good crossover we have no choice but to use
sample, giving KEF mass-production problems when orders arrived. inductors. (Active filters avoid the need

48 Practical Electronics | September | 2019


for inductors and can use cheap, accurate used (>200mm) to achieve higher sound invent the plastic cone loudspeaker by
and compact resistors and capacitors, levels, it becomes necessary to subdivide a plastic cup in the BBC canteen. I’ve
but of course a power supply is need- the frequency band further by adding a noticed speaker designers are always
ed, which is not available in a passive mid-range unit (called a ‘squawker’ in tapping and listening to things. It raises
system. For active speakers, however, US audio circles). This mid-frequency eyebrows when my wife and I are se-
this is the preferred design route and crossover point is typically from 200 to lecting furniture or properties!
inductors are avoided.) 700Hz. Note that in two-way systems it
is more technically correct to describe Break-up modes
Crossover frequency the woofer as a ‘bass-mid’ unit. In theory, loudspeaker diaphragms
A sensible dividing point between the One other crossover design point is should vibrate like a piston to give
two drivers has to be chosen depending important – since a crossover is basically predictable results. Since no material is
on the frequency range of the drivers and two filters; a low-pass and a high-pass, infinitely rigid, this is impossible above
this is the ‘crossover frequency’. Ideal- it makes sense to modify these filters to a certain frequency. Making the mate-
ly, the response of the drivers should flatten out, or ‘equalise’, any bad trends rial into a cone/triangle shape greatly
extend by an octave either side of the or peaks in the frequency response of increases the rigidity before it deforms.
crossover frequency. However, this is the speakers they are designed for. Typically, bending and unpredictable
rarely the case, especially with bass vibration modes occur around a few
drivers, where there will typically be a Colouration hundred hertz for a 200mm (eight inch)
peak followed by sudden roll-off above. A loudspeaker that exhibits a particular cones and about 700kHz for a 110mm.
The KEF B110A bass unit used in the tonal aberration, usually as a result of Fig.7 to Fig.13 show a series of these
LS3/5A is no exception, as shown in unwanted resonances, is described as modes as the frequency increases. Each
Fig.6. (The corresponding tweeter curve ‘coloured’. Subjective terms are often mode is usually associated with a glitch
for the Kef T27 is given later in Fig.31.) used to describe these effects, depend- in the response curve of the driver. These
The crossover frequency is usual- ing on the frequency area affected. All ‘break-up modes’ as they are common-
ly placed between 2kHz and 4kHz for cone and cabinet materials have charac- ly called, give rise to the characteristic
standard-sized drive units. Such woofers teristic colourations. A typical speaker sound of loudspeakers. It can be ex-
are typically 80-200mm (4-8 inches) in colouration can be emulated by talking ploited in an artistic way, such as in
diameter and tweeters sized 18-30mm into a plastic cup. Tapping a polypropyl- guitar speakers. For Hi-Fi speakers it
(0.75-1.25 inches). If bigger woofers are ene packaging container will produce a is a serious problem. In the US, audio
sound characteristic of a polypropylene engineers have a very descriptive term;
cone. A foil cake container will sound they describe the sound as ‘cone cry’.
like an aluminium cone. Legend has it Like turbulence, the mathematics is com-
that Dudley Harwood was inspired to plex and chaotic. Models exist but I’m

Break-up modes revealed on an 8-inch lightweight, straight-sided Audax paper cone


speaker. The cone was brushed with talcum powder (Fig.7) then driven with a 5Wrms
sinewave, gradually increasing in frequency, but stopping when resonant modes were
encountered. The powder remains on areas of the cone that are stationary, revealing the
vibration pattern.
Fig.8. First radial break-up mode at 820Hz Fig.9. 1.3kHz Fig.10. 2.1kHz

Fig.7 Fig.11. 2.75kHz Fig.12. 4.25kHz circular break-up mode Fig.13. 6.6kHz

Fig.8 Fig.10 Fig.12

Fig.9 Fig.11 Fig.13

Practical Electronics | September | 2019 49


Fig.14. A ‘waterfall’ frequency response time graph. KEF
pioneered the use of 3D waterfall graphs to show delayed
resonance, with a third Z axis for time. This experimental mid- Fig.16. Flush mounting drivers helps minimise comb filtering
range unit shows a resonance at 7.4kHz that does not appear effects in the upper frequency response due to stepped
in the initial frequency response sweep, but then becomes quite diffraction effects. These cabinets for Wavecor drivers had fronts
obvious on the subsequent decay spectra. made from two pieces of plywood sandwiched together.

not convinced they are successful yet. the EQ has to take stored energy into ac- frequency, bass reproduction falls away
I have a piece of software which sim- count. Many speaker designs just put a rapidly. A good demo of this effect is to
ulates the response of a Celestion G12 bigger dip than theoretically necessary place a plastic container, such as a Tup-
guitar speaker, but it is oversimplified. in the frequency response around the perware bowl, upside down in water and
It’s akin to basic vibration patterns on area of mid-range break-up modes until tap it. It will resonate a bit like a bass
violin bodies, and explains why there it ‘sounds’ realistic. Being able to quickly drum. The frequency will go higher the
is no Stradivarius app for the iPhone. record and playback snippets of sounds less air is trapped underneath. Try this
The cone shape is also important. A on a computer is very useful for this ‘live next time you are doing the washing up.
curved cone is used in most Hi-Fi bass- vs reproduced’ testing technique.
mid units because although the cone Sealed box
breaks up at a lower frequency, the Cabinet A speaker in a closed box exhibits a
modes are less severe. Also, the radiat- The loudspeaker cabinet is a vital part high-pass filter response with a roll-
ing area of the cone gets smaller as the of the design (and probably the part that off of 12db/octave, as shown in Fig.15.
frequency increases, extending the high is least understood and most feared by Ideally there should be no peak at the
frequency response and widening the electronics enthusiasts). It is not just a roll-off point, causing boom, nor should
dispersion. Straight-sided cones are bet- box to hold the drivers, it also has a vi- it start to roll off too early, giving bass
ter for bass-only units as they are stiffer tal acoustic function of providing bass loss. These effects are determined by the
and can handle more force at the apex. loading. A speaker cannot radiate bass total damping, or ‘Q’ of the system. Q,
When compensating for these effects, or long wavelengths unless some means or ‘quality’ is a measure of how tightly
equalisation (EQ) can only reduce the ex- is provided to prevent the out-of-phase defined the system resonates. A high Q
citation of the resonant modes. Once they sound from the rear of the diaphragm means resonance falls off very sharply
have been kicked off, they can continue cancelling the sound at the front. In either side of the resonant frequency. A
to ring for a while after the signal has most small speakers this is achieved low Q means the opposite, and resonant
ceased. This is called ‘delayed resonance’ by mounting the bass unit in a sealed effects are apparent for a much wider
and can be displayed on a ‘waterfall box. This prevents phase cancellation, range of frequencies. The speaker’s over-
graph’, as shown in Fig.14. They can but it has a defect: the air cushion of the all Q is determined by several factors,
sometimes be heard 30dB down. There trapped air makes the cone suspension the electromagnetic Q of the driver, the
is not much point in just equalising the stiffer. This has the effect of raising the mechanical Q of the drivers suspension
speaker to be flat. To make it sound flat, resonant frequency. Below the resonant and the amount the ‘air spring’ push-
es up the resonance. If the system is
slightly over damped with say a Q of
0.5, bass boost from a normal Baxan-
dall bass control will fix it. Such bass
boost can’t be applied if the Q is high
(much over 0.5). The optimum value
giving the flattest response is the same
as a Butterworth filter, with a Q of 0.7.

Reflections
Another aspect of cabinet design is the
reflections and standing waves that oc-
Fig.15. Ideal second-order roll-off obtained using closed-box loading. For a Q of 0.707, cur within the box. Just as in rooms, the
the –3dB point is at 70Hz. The dotted lines show the effect of overdamping (bass loss) worst shape is a cube, since all the res-
and underdamping, giving peaking. onant peaks from each dimension will

50 Practical Electronics | September | 2019


to the wavelength Reflex enclosures are good for selling
of the reproduced speakers because they go louder and can
sound. Where the use higher resonance units. However, I
width of the box think they are less accurate than sealed
approaches the boxes because they continue radiating
wavelength of the bass after the note has finished. Also,
sound, the out- they have a fourth-order, much sharper
Tweeter
put of the system roll-off rate and a twice as high rate-of-
changes from om- change of phase (sometimes called group
Air volume
ni-directional to delay). Recent evidence has emerged
directional, boost- that the ear can hear high group delay
ing the output at low frequencies. Film and anima-
when measured tion dubbing mixers have complained
in front of the it is difficult to cut sound accurately to
driver, on its ra- bangs and explosions with reflex speak-
Woofer diating axis. This ers. Another problem is the coloured
boost in output is mid-range sound that can come through
often called the the reflex tube. For this reason I usually
‘baffle step’, and put the vents at the back of the cabinet.
typically occurs Another advantage of a sealed cabinet
at around 300Hz. speaker is it is easier to integrate it with
It is undesirable sub-woofers. A sixth-order crossover
in a good Hi-Fi would be needed with a reflex design,
Bass
reflex Adds extra resonance at speaker and it which has massive group delay just
around 50Hz to boost the bass
port can be corrected where it isn’t wanted.
with a shallow
low-pass filter, a Why modern speakers aren’t as
technique called good as old ones
Fig.17. Reflex cabinets offer more bass but of poorer quality. ‘step response An effective technique to damp cone
They do allow higher resonance (>45Hz), lower Q (< 0.3) bass equalisation’. resonances is to paint the cone with
units to be used, which would be unsuitable for a closed box. a soft /plasticised PVA resin, such as
Plastiflex P1200 (a bookbinding adhe-
coincide. A more even distribution of Tweeter diffraction sive). This is called ‘doping’; it gives a
peaks is obtained if each cabinet dimen- When the signal wavelength for high glossy ‘wet’ look to the cone. However,
sion (height, width, depth) is different. frequencies rises above (say) 1.5kHz the it is difficult to get this resin to stick to
It’s better still if dimensions correspond- sound begins to diffract off the protrud- plastic cones. KEF used to put an in-
ing to the golden ratio (1:1.618…). Plus, ing edges of the front of the cabinet. This termediate coating of Bostik 4141 on
the cabinet should be deeper than it is produces an interference pattern, which the back to help the Plastiflex stick and
width to minimise reflections from the results in irregularities in the frequency then applied a second coat of Plastiflex.
rear. However the residual reflections response if the edges are sharp (to re- The front of the cone had only one coat
still have to be attenuated, which is duce this, see Fig.20). If the edges are of Plastiflex, and this sometimes comes
why most speaker boxes are lined with rounded the diffraction is smooth. For off around the dust cap region.
foam. This foam has to be of the open- the same reason it is necessary to flush Doping is not done much today be-
cell soft type that absorbs water. In fact, mount tweeters into the speaker front cause the speaker becomes subjectively
specially optimised foams are available panel – the baffle board. The sharp cir- much quieter, which is not allowed in
for acoustic applications. cular edge of the tweeter front plate will today’s decibel-oriented commercial
I live in Wales, so I support the local often give –6dB dips like a comb filter world. It is also labour intensive, gen-
economy by loosely filling my cabinets from 4kHz upwards if this is not done. erally being brushed on by hand, which
with sheep’s wool, which has well-doc- Flush mounting tweeters into recesses in turn causes variations between driv-
umented superior acoustic properties. on the baffle board is usually done with ers. When I worked at Castle Acoustics
Another benefit is that the wool makes a router and template. For one-off builds in 1990, we automated the process ap-
the cabinet volume appear slightly big- I usually use two pieces of plywood, as plying a measured amount and spinning
ger, lowering the resonant frequency shown in Fig.16. the cone. It seems only Falcon, Spen-
by a few hertz. It does this by slowing dor and ATC are still doping drivers,
down the sound velocity due to it’s high Boom boxes which is a pity because it removes most
mass relative to air. The fibres also move The sealed box speaker used to be com- of that ‘cupped-hands, shouty’ quality
about, adding to the moving mass of the mon, but most modern designs are reflex that tells you that you are listening to
system. KEF recently found that filling systems, which means they have a hole a loudspeaker.
the cabinet with bags of activated char- in the box, normally with a tube attached, The same loss-of-craft trend applies
coal enhanced these effects, making the see Fig.17. This gives more bass at greater to cabinets. In good quality 1970s and
cabinet appear a third bigger. You can efficiency because it adds a Helmholtz 80s designs it was normal to apply half-
overdo these techniques – it is possi- resonance. This can be easily demon- inch-thick bituminous damping pads
ble to over-damp the cabinet resulting strated by tapping a plastic soft drink to insides of the panels, a horrid job
in inefficiency and bass loss. bottle and holding the open top to the involving tacky Aquaseal No.5 roofing
ear and a ‘boom’ will be heard. By re- glue. This reduced the coloured sound
Baffle boost effect ducing the size of the vent and extending coming from the cabinet (the enclosure
The frontal dimensions of the box are its length with the hand it is possible to walls have resonant modes as well).
important because of their relationship reduce the frequency of the resonance. The LS3/5A design specifies damping

Practical Electronics | September | 2019 51


Fig.18. Doping bass-mid units with a
high hysteresis visco-elastic damping
layer reduces the magnitude of break-up
modes. The coating can be seen on the
rear of this B110A cone.

pads on a box made from 12mm birch


Fig.19. Damping speaker panels with car body damping pads reduces ringing. This
plywood with hardwood beech battens
is the inside of a KEF 104ab cabinet. (In my lecture room demos, stolen from Lauri
along each internal edge. The panel siz-
Fincham’s lectures, are two bits of plywood – one with damping, one without. When hit
es were selected so that the resonances
with a beater stick one rings, the other emits a dull thud.)
didn’t coincide. Modern loudspeaker
enclosures are made from MDF because is done later when we assemble our own have even brought the production of
it is easy to machine and looks good LS3/5A-style cabinet. the original KEF drive units in-house.
for sales. It does not sound as good be- The founder of Falcon Acoustics, Mal-
cause it rings badly and is difficult to The original and best colm Jones is still involved. I have met
damp because it is stiff and heavy. The After a halt in production of over a him a few times over the years and I
home constructor is not constrained by decade, manufacture of the venerable, can vouch for his engineering honesty.
such modern commercial pressures, so 40-year-old LS3/5A recommenced in He does not hold with Hi-Fi snake-oil
go ahead and damp your cabinets and 2015 at Falcon Acoustics, and they sales tactics. Unfortunately, a new pair
dope your cones. I will show how this

Fig.20. LS3/5A baffle board. The felt strips


around the tweeter reduce diffraction
glitches from the edge of the grill frame.
Unlike most speakers, the LS3/5A works
better with the grille in place. A 6.5kHz
notch appears when it is removed.

Fig.21. Rear of an LS3/5A baffle board


showing crossover. This was mounted on
top of the tweeter magnet using a 3/8-inch
thick felt pad to stop rattles. I was worried Fig.22. Comparison of front (top curve) vs rear (middle curve) mounting of bass unit in
about the magnet affecting the coils, but I an LS3/5A. The curve is rougher for rear mount but it improves the phase alignment at
couldn’t measure any difference. crossover. Both curves are shown for comparison on the lower trace.

52 Practical Electronics | September | 2019


price of analogue drum machines and A little history
synthesisers. On the other hand, it is In the 1960s there were only a couple
this new enthusiasm for good old ana- of successful commercial mini-mon-
logue equipment that has now made it itors, the Goodmans Maxim and the
profitable to reintroduce these classic Celestion Ditton 10 (Fig.2). The Maxim
designs. Falcon sell the drive units, was designed by veteran speaker de-
crossovers and most parts, so it is signers Ted Jordan and Lauri Fincham.
possible to build your own LS3/5As Goodmans had pioneered woofers for
for around £850.00. To be clear, the sealed-box bass cabinets and had ad-
licencing terms from the BBC pre- vertised ‘infinite baffle’ speakers in
clude them from offering ‘complete the April 1940 issue of Wireless World
kits’, but they will sell you all the (Fig.23). The Maxim four-inch woof-
parts you need, separately. er used the Alnico magnet Ted Jordan
At one time, technicians at the BBC had designed for the 8-inch full-range
used to be able to buy kits. An uncle of Axiette drive unit in 1962. The Maxim
mine built a pair, called the ‘Chartwell unit defined the design requirements
Symphony’. They were quickly rescued of the first proper mini-woofer to
from the charity shop when he died. work successfully in a small sealed-
Fig.23. Driver for Goodmans ‘infinite I’ve also built quite a few myself over box. This is illustrated in Fig.24. An
baffle’ speaker – the first commercial the last 30 years. It can be seen that by original Maxim bass unit is shown in
closed-box speaker, launched in 1940. speaker standards, the internal con- [Link] BBC initially evaluated the
struction of a typical LS3/5A is quite Maxim and found it to be the best, but
of LS3/5As cost around £2300 today, up complex, as shown in Fig.21. Unusu- not quite good enough. It was possi-
from around £150 when they first came ally, the bass unit is mounted behind bly let down by it’s cone tweeter (see
out in 1975 – speaker inflation is nearly the baffle board. Usually it is recom- Fig.26). The 1965 report, ([Link]
double that of the rest of the economy! mended to mount the drivers from the in/2Ghzn5s) provides objective relief
This looks even more expensive be- front to avoid cavity resonance effects, from the new-age subjectivism of to-
cause the relative price of silicon-based although it is still possible to get rear day’s Hi-Fi press.
electronic items has fallen greatly in cavity effects with thick front baffles. From this, the BBC R&D department’s
real-terms. The cost of electro-me- Fig.22 shows there is a measurable work led to the creation of the famous
chanical parts, which form the basis deterioration in frequency response, BBC LS3/5A mini-monitor in 1975.
of hand-built loudspeakers, has fol- but this is dealt with in the crosso- This is covered in the RD 1976/29
lowed general commodity inflation so ver. I suspect this was done to get the report ([Link] The
Moore’s Law doesn’t apply. There is tweeter and woofer as close together BBC selected the B110 woofer and
also the ‘eBay retro-fashion inflation as possible. Otherwise their frames T27 tweeter designed by Malcom Jones
effect’ of the type that has boosted the would have overlapped. at KEF. These were state-of-the-art

* These components often the Soft neoprene rubber surround


same diameter as the cone (normally convex – sticking out)
Large compliant nylon
heat-treated spider*
Front
plate
6mm
Back
plate

Pole piece
(may be vented Vent
through holes
back plate)
Dust cap
(sealed)
Axis
Cone
apex

12mm long
‘overhung’
voice coil on
Nomex former
Flared cone
coated front
and back
with dope

Large magnet*
(ferrite ring ≥ 58,000 maxwell

Chassis/frame/basket

Compliant cone assembly with a resonance ≤ 38Hz


Mass typically = 11g
Compliance = 2mm/N Fig.25. The first proper mini-monitor bass-mid unit used in the
1965 Goodmans Maxim. This had a latex-impregnated fabric roll
Fig.24. Generic bass-mid unit construction suitable for a mini- surround to get flexibility. Later production changed to rubber. I
monitor. Note relatively large spider and magnet. Also note the once made my own similar surround for a woofer with lint and
long over-hung voice coil. Copydex latex glue.

Practical Electronics | September | 2019 53


Fig.26. (Left) Front view of the Goodmans Maxim (courtesy Bernard Patterson, a loyal
PE reader); (right) the 1960s pattern grill cloth.

plastic diaphragm units in 1966. The Fig31. The T27 had a cigarette filter
B110 used Bextrene, a mixture of pol- placed in a cavity in the pole piece
ystyrene and neoprene developed for to absorb the rear radiation. KEF had
car interiors, a material first used by made their own speaker system using
Fig.29. Front/rear view of KEF T27 tweeter.
the BBC. A B110A unit is shown in these drive units called the Coda Mk1
Fig.27. A B110A diaphragm assembly to compete with the Ditton 10. This
is shown in Fig.28. The tweeter used a did not fully realise the potential of
polyester film from ICI called Melinex. the drive units, having a simple four
A photo of the T27 is shown in Fig.29. element second-order crossover and
On the LS3/5A this was covered with chipboard cabinet.
a dome protector grille from a Celes-
tion HF2000 tweeter, shown in Fig.30 Nest month
and its beneficial effect is shown in In Part 2 next month, we will have a
thorough look at LS3/5A crossovers
and start to consider activisation and
driver choices.
Fig.30. T27 diaphragm protection grille.

Fig.27. A B110A bass unit from KEF.

Fig.28. B110A diaphragm assembly. Note


holes in the Nomex voice-coil to prevent Fig.31. Effect of grille on the T27 frequency response (connected with no crossover
pressure build-up under the dustcap (a filter). (Top) without grille and (bottom) with grille, lifting the response over 9 to 13kHz
common cause of distortion). and providing a useful smoothing effect.

54 Practical Electronics | September | 2019


Practically Speaking
Hands-on techniques for turning ideas into projects by Max Maxfield

Three indispensable low-cost, low-tech tools

T
here are certain topics that
electronic engineers like to talk
about obsessively. If you really
want to initiate a conversation, for ex-
ample, a great opening gambit is to ask,
‘What tools do you recommend for a be-
ginner?’ If you are feeling reckless, you
might also ask, ‘What is the minimum
set of tools you need to get by?’ At this
point, you can step back and leave the
sprocket (the collective noun for a group
of engineers) to fight it out.

Strippers and screwdrivers


A good set of wire-strippers is a won-
derful tool to have, for example, but an
experienced engineer can use wire cut-
ters to great effect (let’s not get started on
the relative merits of semi-flush, flush,
and full-flush cutting edges). And, of
course, we can debate the myriad aspects
of screwdrivers, pliers, and similar tools
until the cows come home.

Soldering irons
It probably goes without saying that one
‘must have’ is a soldering iron. You can
spend a fortune here, if you’re not care-
ful, but you also have to make sure you
don’t opt for a ‘bargain’ that fails to cut
the mustard (I never metaphor I didn’t
like). Some time ago, I dropped my ex-
isting soldering station and damaged it
beyond repair. I purchased a new one
from somewhere, but – even though it There are many good soldering irons out there, and I’m certainly not claiming to have
wasn’t cheap – it turned out to be a pain used them all, but my friend Rick Curl has looked at plenty and we both recommend
in the nether regions to use. the inexpensive Atten SA-50. Make sure you get the right version for your region – the
Fortunately, my chum Rick Curl, who above is for US 110V, but UK/Europe-friendly 230V versions are also available.
spends much of each day soldering, un-
dertook a survey for his company. As Europe, Somerset Solders are offering a tablet using Bluetooth or Wi-Fi. However,
part of this, Rick evaluated a bunch of 230V version of the SA-50 for £24.95, before you go decide to take the plunge,
irons, eventually determining that the see: [Link] one indispensable tool for checking volt-
best all-rounder in terms of quality, cost, age current, and resistance is a multimeter.
and capabilities, was the Atten 50-watt Multimeters These come in all shapes, sizes, and price
Soldering Iron (SA-50). I ordered one If you start to become serious about elec- points, but you really don’t have to spend
from Adafruit for $29.95 ([Link] tronics, then at some stage you need to much to get something useful. For exam-
ly/2DWkVPR) and I have to say that consider splashing the cash for an oscil- ple, the cheap-and-cheerful multimeter I
I’ve been delighted with the result. loscope and/or logic analyser. I personally keep in my backpack cost only about $3
This is so much better than my previ- prefer to have these as standalone units, Australian Dollars. I’ve had it for a couple
ous soldering station… but, of course but you can get some tasty and afford- of years now and it works like a charm.
I’m based in the US, so that is a 110V able devices that display data on your PC Budget meters are now so cheap that if
tool. For those of you over in the UK and screen using USB or on your smartphone/ you find one you like, get two or three.

Practical Electronics | September | 2019 55


Construction is not just about the latest hi-tech digital gizmos – craft (‘ice lolly’) sticks,
masking tape and good school (safe and washable) glue are truly indispensible aids!

Component testers asking if anyone wanted to join me in


When I was first introduced to these little building an Arduino-based equivalent
rascals about three years ago ([Link] ([Link]
io/2UEttF0), I couldn’t believe my eyes.
Costing only $15 to $20 on eBay, these Hot glue is your friend
comprise a small circuit board carrying Although I was aware of their existence,
a microcontroller, ancillary components, I never actually used a hot glue gun until
a zero-insertion force (ZIF socket), and a couple of years ago. Now I’m kicking
a little LCD display. myself for all the time I wasted doing
All you have to do is connect a 9V bat- things that took ages that could have
tery, pop your component into the ZIF, been handled in seconds with a dab
and press the start button. The tester of hot glue.
then evaluates your component (resistor, One thing you have to be careful about
capacitor, inductor, diode, transistor), is to not use hot glue on circuits that are I came to the conclusion that the hot
identifies what it is and which pins under power. I did so once with very un- glue had driven my active tri-colored
are which, and describes any relevant fortunate results ([Link] LED into thermal overload.
information (resistance, capacitance, At first, I thought that the hot glue in its
inductance...). liquid state had caused a short circuit, Three indispensable tools
I tell you, I’m so enamored of these but I measured it with my multimeter In reality, I use all of the tools mentioned
little scamps that I wrote an article and that wasn’t the issue. Eventually above, but where are those ‘indispensable

EE M
GET T
ON SALE in WHSmith and other
FR RO £8.99
-

LATES HE
CD
ELECTRONICS
T COP
TEACH-IN 9
FROM THE PUBLISHERS OF

Y
OF
TEACH OUR
-IN SE
independent newsagents GET TESTING!
Electronic test equipment and measuring
techniques, plus eight projects to build
FREE
CD-ROM
TWO TEACH
-INs
FOR THE PRICE

RIES OF ONE

AVAIL
• Multimeters and a multimeter checker
• Oscilloscopes plus a scope calibrator

AB
• AC Millivoltmeters with a range extender

NOW! LE PRICE £8.99


• Digital measurements plus a logic probe
• Frequency measurements and a signal generator
• Component measurements plus a semiconductor
junction tester

(includes P&P to UK if ordered direct from us) I n c l u d i n g Pr ac t i c al Di g i t al Si g n al Pr o c e s s i n g

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

Teach-In 9
Get Testing

Teach-In 9 – Get Testing!


Files for:
PIC n’ Mix
Three Microchip
PICkit 4 Debugger PLUS
Guides Teach-In 2 -Using
PIC Microcontrollers.
In PDF format

This series of articles provides a broad-based introduction to choosing and using a wide range © 2018 Wimborne Publishing Ltd.
[Link]

of test gear, how to get the best out of each item and the pitfalls to avoid. It provides hints
and tips on using, and – just as importantly – interpreting the results that you get. The series
deals with familiar test gear as well as equipment designed for more specialised applications.
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).

FREE COVER-MOUNTED CD-ROM


On the free cover-mounted CD-ROM you will find the software for the PIC n’ Mix series of articles. Plus 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 Debugger User’s Guide; MPLAB PICkit 4 In-Circuit Debugger Quick Start Guide; and MPLAB
PICkit4 Debugger User’s Guide.

ORDER YOUR COPY TODAY JUST CALL


01202 880299 OR VISIT [Link]

56 Practical Electronics | September | 2019


www. poscope. com/ epe

Using masking tape to hold LEDs on a carboard wiring harness template.


low-cost tools’ I promised at the start?
Well, here are three low-tech offerings
that I never want to be without: Elmer’s
School Glue (available from [Link],
but other brands are good), decorator’s
masking tape and wooden ‘ice lolly’/craft - USB - PWM
sticks. Honestly, when I’m setting things - Ethernet - Encoders
- Web server
up at the start of a new project, these three - LCD
- Modbus - Analog inputs
items are ‘front and center’ on the table. - CNC (Mach3/ 4) - Compact PLC
I use the masking tape for all sorts of - IO
things, but especially holding compo-
nents in place while I’m soldering them
to a circuit board. Another example was
assembling my Awesome Audio Reactive
Artifact; I used it to hold all of my tri-
colored LEDs in position on a cardboard
mockup while I arranged the wiring har-
ness ([Link]

- up to 256 - up to 32
microsteps microsteps
- 50 V / 6 A - 30 V / 2. 5 A
- USB configuration
- Isolated

Using school glue and lolly sticks to


make mini-clamps (front). PoScope Mega1+
Meanwhile, the Elmer’s Glue and craft PoScope Mega50
sticks find myriad uses. In the case of my
Inamorata Prognostication Engine, for
example, I used them to fashion mini-
clamps to hold my tri-colored LEDs in
place during alignment and attachment
([Link]
So, what are your favorite tools, includ-
ing any unconventional low-tech offerings?
I’m always interested in this sort of stuff,
and you can email me as shown below.

Max Maxfield is editor-in-chief at - up to 50MS/ s


[Link] – the go-to site for users - resolution up to 12bit
of electronic design tools and all - Lowest power consumption
askers of electronic questions. - Smallest and lightest
- 7 in 1: Oscilloscope, FFT, X/ Y,
Comments or questions? Email Max Recorder, Logic Analyzer, Protocol
Using school glue and lolly sticks to at: max@[Link] decoder, Signal generator
make mini-clamps (back).

Practical Electronics | September | 2019 57


Make it with Micromite

Phil Boyce – hands on with the mighty PIC-powered, BASIC microcontroller

Part 8: Dice Prediction game and Mini MKC Clock


continually updated your own customised game(s). Over the
while simultaneously coming months we will expand the game
playing sound effects. as we learn new topics; it will evolve
Many projects and change over time. The game’s code
(such as the Mini ([Link]) is available
MKC Clock) need from the September 2019 page of the PE
a dedicated output website. You could download it straight
display; so we will away, load it into your Micromite (using
be showing you how AUTOSAVE, Paste, and Ctrl-z) and
easy it is to connect immediately start playing the game;
up a mini colour LCD however, I recommend you work through
display module. The the topics in the articles first, as that is
one we’ll be using the best way to learn about the many
this month has an IPS features of MMBASIC.
(in-plane switching) The DPG uses the Electronic Dice
screen, which gives hardware that was covered in Part 6,
it a wider viewing but with the addition of a piezo sounder,
angle, and a brighter allowing it to make some sounds (as
and clearer image discussed in Part 7). Do note that the
than regular LCDs. Electronic Dice software needs to be
It is a nice, compact changed to accommodate displaying
module with a pixel dice patterns on the LEDs while

T
his month, we will discuss resolution of 160 × 80; more than enough simultaneously playing sounds, which
two projects. The first is a simple for displaying the time and date. leads us neatly to a new command.
Dice Prediction Game, (DPG) which The obvious question for this clock is
is based on the Electronic Dice hardware how does the MKC know what the time SETTICK command
covered in Part 6 (see Fig.1). The second is? The answer is it doesn’t; we will need The SETTICK command enables us to
project is a small, yet highly-accurate to connect it to a real-time clock (RTC) set up a periodic interrupt (or ‘tick’),
Mini MKC Clock (see Fig.2) that uses a module. The good news is that MMBASIC which effectively means that an interrupt
very nice little display. makes the whole process of building the subroutine is automatically called at
We’ll learn how to use VT100 escape Mini MKC Clock really simple. regular intervals. The command syntax is:
codes, which date back over 40 years to As always with these projects,
the VT100 video terminal produced by components such as the IPS screen SETTICK period, target, nbr
DEC (Digital Equipment Corporation). and RTC module are inexpensive; both
They were initially designed to allow are individually available online at Here, period is the time (in ms) between
on-screen formatting of text and [Link], or as a kit of parts. calls to the interrupt SUB, and target
information, and later included colour is the name of the interrupt SUB that is
effects, some of which are incorporated Project 1: Dice Prediction called. Four separate ‘ticks’ are available,
into the DPG to display the score and Game each being referenced by a number (nbr
some basic game instructions (see Fig.3). The purpose of creating the DPG is to (1, 2, 3, or 4)). By the way, the SETTICK
The SETTICK command will also be demonstrate how to incorporate many interrupt is disabled (switched off) by
discussed; this allows the dice LEDs to be of the topics covered in the Make it with setting the period to a value of 0 (zero).
Micromite series. It uses hardware and
software to show how ideas and concepts
work in practice to create a total solution. Micromite code
Questions? Please email Phil at: It is not meant to be the next big thing
contactus@[Link] The code in this article is available
in gaming – however, there is nothing
for download from the PE website.
stopping you from using it as a basis for

58 Practical Electronics | September | 2019


Fig.1. The Dice Prediction Game (DPG) is based on the Fig.2. The Mini MKC Clock is based on a versatile plug-in
Electronic Dice module (Part 6). It has a piezo sounder for audible module that incorporates a mini IPS display, RTC module,
notifications, uses the console screen to display the score and infrared receiver and a piezo sounder.
instructions, and the console keyboard for entering your guess.
This process can be likened to MMBASIC allowing things SETPIN 4,DOUT:SETPIN 5,DOUT:SETPIN 6,DOUT
to be done ‘in the background’ (not quite multi-tasking, but ‘SETTICK 1,LEDdisp,3
similar). In the game, we will use SETTICK to continually s1=&b100 : s2=&b010 : s3=&b011
update the dot pairs that ultimately form the displayed dice
pattern (see Fig.3 and 4 in Part 6). ‘ main-program
To demonstrate SETTICK, and also prepare for the game, DO
simply plug the Electronic Dice module into your DM/MKC PRINT Time$
and connect this to your computer. Also connect a piezo PAUSE 1000
sounder to J12 (the 20-way connector) on the DM between Pin LOOP
22 and Pin 26 (see Fig.4). Then launch TeraTerm (or Terminal/
Screen for MacOS) and start a new program by typing NEW at ‘ subroutines
the command prompt. SUB LEDdisp
SELECT CASE LEDctr
SETTICK example CASE 0: PORT(4,3) = s1
First, we will use the SETTICK command to display dice CASE 1: PORT(4,3) = s2
pattern ‘6’ on the LEDs, totally independently of the flow of CASE 2: PORT(4,3) = s3
the main-program. This is best demonstrated by example, so END SELECT
enter the following code into the EDITor. Code comments aren’t LEDctr = LEDctr + 1
included because we will discuss the code below. However, IF LEDctr > 2 THEN LEDctr = 0
do note that the second line needs to be commented out for END SUB
now (ie, the SETTICK command will not run due to the single
apostrophe preceding it, which tells MMBASIC the line is a
comment and not code).

Fig.4. For the DPG, the Electronic Dice module is inserted as normal.
A piezo sounder is connected via the 20-way connector between pin
Fig.3. How the DPG looks on the console screen. 22 and pin 26 (use a breadboard and jumper wires if required).

Practical Electronics | September | 2019 59


If you RUN the above program, not much higher), then RUN the program once again Please note that the Micromite can
will appear to be happening. All you (F2). The main-program flow has not connect to many different types of colour
should see is a timer-looking counter on been changed in any way, but you will LCD modules (as we shall soon see with
the console screen counting up at one now see the three dot-pairs displayed the IPS screen); and these allow the
second intervals (and there should be (slowly), in turn. Set the period back Micromite to perform some very powerful
nothing displayed on any of the dice LEDs). to the original value of 1 and the dice graphical features without needing to use
Not very exciting, but it will demonstrate pattern ‘6’ will once again be seen. By the escape codes. However, before we look at
SETTICK nicely as we will soon see. way, this exercise also demonstrates the MMBASICs ability to drive LCD modules,
The program may look complex, but all usefulness of being able to quickly run/ it is worth understanding how to do some
it is doing is initially setting up the three test/edit/re-run code on the Micromite – simple formatting on the console screen
LED pins (as outputs), then loading the something that is unique to Micromite, using VT100 escape codes.
three ‘dot-pair’ variables (s1, s2, and s3) and will always prove to be extremely It’s important to understand that VT100
with the binary values that represent the useful during code development. escape codes are a feature of the VT100
dice-pattern ‘6’ (when they are rapidly and I hope this has demonstrated how Terminal standard, and are not a feature
sequentially outputted to the Electronic SETTICK can be used to effectively of the Micromite. We are simply showing
Dice module). Then the code enters a perform ‘background’ tasks. We now here how you can send them to affect
DO/LOOP, which continually displays have the ability for the main-program what is displayed by the subsequent
Time$ at one second intervals. This is to play tunes (and to perform other tasks), PRINT command. Also note that different
all that the main-program is doing (and while simultaneously displaying a dice- console applications (ie, TeraTerm for
nothing else) – it repeats over and over. pattern on the LEDs. If we were to change Windows, or Terminal/Screen for MacOS)
The important point to note here is that the values of s1, s2, and s3 in main- vary in their ability to recognise some of
main-program has nothing to do with program, then this would automatically the formatting escape codes. That said,
driving any of the LEDs. result in a different dice pattern being most are capable of correctly interpreting
Now stop the program (Ctrl-c) and displayed. This is the technique that is the escape codes used here.
use the EDITor to remove the single used in the DPG. If you search online for ‘VT100 escape
apostrophe from the start of the second codes’ you will see many lists of what
line so that the SETTICK command will Using VT100 escape codes we are about to discuss. Personally, I like
be executed. Re-run the code again (F2) Previously, we have used MMBASIC’s to use the list at the following website:
and this time observe what happens on PRINT command to display alphanumerics [Link]/[Link]
the LEDs. If the code above was entered on the console screen. For example, and I will refer to it in the discussion
correctly then you will see the LEDs PRINT “Hello” will display Hello on below. Do read the notes at the top of
displaying the dice pattern ‘6’ (if not, the console. Note that within the PRINT the webpage (immediately above Device
check your code is correct, and also command, we are not defining the location Status heading).
ensure the dice hardware module is of where it is displayed on the console Scrolling through the list from the above
inserted correctly). since the output is displayed at the current website, you’ll see lots of things containing
What the SETTICK command does in cursor position. After using the above <ESC> followed by a few more characters
the above program, is set up an interrupt PRINT example, the current cursor position such as [{COUNT}A (scroll down to the
tick (number 3) at 1ms intervals, diverting moves to the start of the next line (this is second item in the Cursor Control section).
to run the code in the interrupt SUB because MMBASIC also sends ‘line feed’ To the left you’ll see a very brief description
LEDdisp. The interrupt SUB code simply and ‘carriage return’ instructions after of the action it performs; in this example,
sends a 3-digit binary value (s1, or s2, displaying the word Hello). However, if Cursor Up. Underneath each <ESC> is a
or s3) onto pins 4, 5, and 6 with the we were to use PRINT “Hello”; instead slightly longer description.
PORT command (as covered in Part 6); (note the semicolon at the end), then the So if we were to send the escape Code:
the choice being dependant upon by the current cursor position would be located <Esc>[{COUNT}A to the console, then the
value of variable LEDctr. The counter immediately after the word Hello, and not cursor will move up the relevant number
variable (LEDctr) is used to count up at the start of the next line (this is because of lines (defined by the value in {COUNT}).
(initially from 0) each time this interrupt the semicolon suppresses the line feed and But how to send the escape code? Well,
SUB is called, and when it reaches a count carriage return). This rudimentary cursor as with most things in MMBASIC, this
of 3 (ie, >2), then it is reset back to 0. In position control is limiting, especially if is really easy. All we do is use PRINT
other words, LEDctr can only ever have we have several things we wish to lay out CHR$(27)+”....”; replacing ‘....’
a value of 0, or 1, or 2 – and nothing nicely on the console screen. And what if with the characters shown in the list (and
else. This allows us to use its value to we wanted to update something located with any required values). So, sticking
sequentially and rapidly cycle through in a fixed position (such as a score for a with the above example to move the
the three LED dot-pairs s1, s2, and s3 (by game)? This is where VT100 escape codes cursor position up one line, we would
using SELECT CASE), which then forms come into play; they allow total control simply use: PRINT CHR$(27)+”[1A”;
the overall LED dice pattern. Remember, of the cursor position, as well as control
we use persistence of vision to fool our over other types of formatting, including Breaking this down:
brain into seeing a ‘solid’ dice pattern font colours. n P
RINT simply sends the escape code
on the LEDs, and that is why we need The ‘console screen’ we are using to the console
to call the interrupt SUB quickly – every (ie, TeraTerm), is a VT100-compatible n C
HR$(27) is the <ESC> element
1ms – otherwise we would see flicker. application, so by sending VT100 escape n +
adds on whatever follows in double
Let’s now examine what happens if the codes, we are able to format the display quotes
interrupt SUB is called too slowly for the prior to using the PRINT command. n [
1A is the specific code to move up
persistence of vision effect to work. We The formatting we will discuss below {COUNT} lines for which we have
can do this by increasing the period will include cursor position, and font supplied the value 1
parameter in the SETTICK command. colour, but the same technique applies n ;
ensures the cursor remains in the
Stop the program (Ctrl-c), and change to implementing other types of VT100 correct position (rather than move
the SETTICK period value to 100 (or formatting. down to the start of the next line).

60 Practical Electronics | September | 2019


 Important note: escape codes are case
sensitive!

Now we know the concept of escape


codes, and how to send them, let’s start
using some examples and see how they
affect the PRINT command.

Cursor position
Start by entering the following new Fig.5. Cursor position escape code: a) (left) observed console output when using only
program (be sure to enter all semicolons, PRINT commands, b) (right) exactly same PRINT commands, but with the inclusion of
commas and single apostrophe as shown): a single Cursor Up escape code.

PRINT “Hello1”; Home – ie, <ESC>[{ROW};{COLUMN}H background. Next, use the EDITor to
PRINT “Hello2”, to move the cursor anywhere on screen remove the single apostrophe (which
PRINT “Hello3” (ie, use PRINT CHR$(27)+”[10;20H”;) will then activate the last Reset all
PRINT “Hello4” attributes escape code). Now RUN
‘PRINT CHR$(27)+”[1A”; Font colour the code again and you will see that the
PRINT “Now Here!”; Now that we have seen how to send screen background has remained black,
escape codes, setting font colours should however, this time the command prompt
With the fifth line commented out, RUN be relatively straightforward. At the is no longer green on black because Reset
the code and carefully look at the result on escape code website, scroll down to Set all attributes is now sent at the end of
the console screen (see Fig.5a). The first Display Attributes to see what colours the program. Run the program one last
PRINT line ends with a semicolon and this are available. Foreground Colour refers time and now the screen background
tells the console program (eg, TeraTerm) to the font colour. will be back to ‘normal’.
to leave the cursor at the current position Modify your existing code to become The above examples have demonstrated
(immediately after Hello1). This is why the following (add the highlighted lines just how easy it is to use VT100 escape
Hello2 is positioned immediately after and remove the previous Cursor Up codes. When used creatively, they can
Hello1 (remember that the PRINT uses escape code): give some very impressive results. The
the current cursor position). However, the lay out of the DPG screen (Fig.3) was
second PRINT line ends with a comma PRINT CHR$(27)+”[2J”; created by using just a handful of these
and this informs the console program to PRINT CHR$(27)+”[H”; escape codes. Do take a look at how
position the cursor further along the same PRINT CHR$(27)+”[33;41m”; they are implemented in the code for
line at the next tab position. This is why PRINT “Hello1”; the game; and feel free to modify them
Hello3 is spaced away from Hello2 PRINT CHR$(27)+”[32;45m”; to suit your tastes.
(but all three are on the same line). The PRINT “Hello2”, Finally, it is well worth scrolling
third PRINT line has neither a comma PRINT CHR$(27)+”[46;31;4m”; through the complete list of all the escape
or semicolon at the end, so this instructs PRINT “Hello3” codes listed at the above website. If
the console program to move the cursor PRINT CHR$(27)+”[1;33;1;44m”; something interests you then why not
to the start of the next line and hence PRINT “Hello4” try it out and see what happens – this
Hello4 is on the next line down. The PRINT CHR$(27)+”[1;32;2;40m”; is the best way to learn.
forth PRINT line also moves the cursor PRINT “Now Here!”;
down hence Now Here! is on a new line ‘PRINT CHR$(27)+”[0m” Running the Dice Prediction game
too. I hope this all makes sense so far! If you haven’t already done so, download
Now remove the single apostrophe In the above program, the first line [Link] from the
from the start of the fifth line of code sends the escape code to clear the screen September page of the PE website and load
(which currently comments out the (found in the website’s Erasing Text it into your Micromite using AUTOSAVE,
‘Cursor Up’ escape code). Before you section). The second line positions the Paste, and Ctrl-z (as discussed in Part
run it, think about what you expect to cursor at the top-left of the screen (the 6). Then RUN the program (F2) and you
happen with the escape code we are Home position). The other escape codes should see the game appear on your
using here (ie, move up 1 line). RUN it then control the Foreground Colour console screen as shown in Fig.3. Don’t
again and see if it results in what you and Background Colour along with forget to add a piezo sounder between
expected (see Fig.5b). other attributes, such as Bright, Dim, Pin 26 and Pin 22 so that you hear the
In case it was different to what you and Underscore. Note that attributes sound effects – you can do this via the
thought, understand that H e l l o 1 , remain in place until they are changed, 20-way connector (J12) on the DM, using
Hello2, and Hello3 all appear on the or until they are reset (with <ESC>[0m). a breadboard if necessary.
first line as before, and also that Hello4 Indeed, the last line demonstrates Reset
is on the second line with the cursor then all attributes but for now, leave it
moved down to the third line (again, as commented out.
before). However, the escape code will Once you have entered the above
move the cursor back up one line to code, RUN it and observe the colours
effectively where Hello4 is. Finally, Now (see Fig.6). Refer to the website for
Here! is printed at the current cursor confirmation of all Foreground Colour
position; ie, it overwrites Hello4. and Background Colour options.
To explore cursor positioning further, Now, at the command prompt, type
experiment with some of the other escape something (such as PRINT TIME$) and
codes shown in the list under the Cursor you will see the colours remain as bright Fig.6. Result of using some simple font
Control section. In particular, try Cursor green underscored characters on a black colour escape codes.

Practical Electronics | September | 2019 61


n C
hange the colours and layout of the game (ie, change escape
J1 J2
3.3V 3 22 26 3.3V 17 code parameters)
0V 25 23 21 18 0V
n A
dd a ‘spinning’ sound effect – use the PWM command to
enable and then stop the piezo from within SUB Spin
n C
alculate the number of correct guesses as a percentage
0V SCL RES CS + D C NC –
VCC SDA DC BLK of the total attempts and display it on the console after
IPS RTC each roll of dice – use escape codes followed by PRINT
IPS screen
INT((correct/attempts)*100) + “%”
n A
dd your own musical tune and play it at power-up – add
tune info as Tune_PowerUp DATA line(s), then use RESTORE
24
Tune_PowerUp and PlayTune in the relevant place within
the program
IR receiver n C
onvert the DPG into a Memory Game – comment out
TSOP 48 (38/40) Piezo
sounder RANDOMIZE Timer, and then press the reset button every
time you want to play it. See how high you can score correctly
16 5V
– the higher the number, the better your memory!
0V 15
J3
If you wish to share your creations, or have any comments or
ideas, then do drop me an email – it is always great to hear
from you: contactus@[Link]

Project 2: Mini MKC Clock


We are now going to briefly describe how to construct a very
versatile plug-in IPS Display Module (IDM) that incorporates
a mini IPS screen, RTC module, infrared receiver and a
piezo sounder. Incidentally, these four hardware elements
can be used as the basis for many different projects – so by
using exactly the same hardware, but altering the program
code, the IDM can be made to perform a wide variety of
different tasks.
Fig.7. (Top) Circuit diagram for the IPS Display Module (IDM);
We will load a program on to the IDM which will create a
(below) the IPS display and RTC module.
simple, yet highly accurate Mini MKC Clock. The code will
Due to the size of the program, we will not take up valuable be explained in next months article – we are just using it
space by listing it here. However, do take a look at the code as initially to confirm that the IPS Display module has been
you should recognise how all the commands are being used. assembled correctly.
The program contains comments throughout, so you should The circuit elements to be added to the IDM are shown
also be able to follow the flow of the game. in Fig.7. As with most Micromite-based projects, it is just
a matter of connecting component ‘legs’ (and/or pins on a
How to play module) to the appropriate Micromite pins. Note that the IPS
The game is simple to play. All you need to do is predict the screen comes with header pins already soldered, and the RTC
next number that will be ‘rolled’ on the dice by pressing a module comes with a socket. Therefore these two parts, along
number key (from 1 to 6) on the computer’s keyboard. (Use the with the IR receiver, will have appropriately placed sockets/
number keys above the QWERTY keys, not the numeric keypad.) headers on the strip board allowing each item to be inserted,
Upon pressing a valid number, the dice will automatically or removed, as required (see Fig.8). The piezo is the only
be ‘rolled’ (and the ‘spin’ effect will appear on the LEDs). component soldered directly onto the strip board.
The dice will end up on a number, and if it matches your The IPS screen has a total of eight pins (and is inserted into
prediction, then a ‘success’ tune will play along with your socket J1). From left to right:
score for ‘CORRECT’ guesses being incremented. Incorrect n G
ND and Vcc supply the 3.3V.
guesses will play a different tune. Every guess will increment n S
CL and SDA are two SPI protocol pins and have to be
the ‘ATTEMPTS’ counter to show you how many times you connected to Micromite pin 25 (SPI Clock) and pin 3 (SPI
have played. Pressing the ‘R’ key will reset the game (set both Out) respectively.
scores to zero), and also play another tune. n R
ES, DC, and CS are control signals and can be connected
This version of the game uses the console’s screen and to any available I/O pin; for ease of strip board layout we
keyboard, so you cannot play it without having the DM will use pins 23, 22, and 21.
connected. In addition, neither the Spin button, nor the IR n B
LK is the backlight control. Taking this low will ‘switch off’
remote transmitter functionality, are implemented. However, the backlight; and left floating (or high) leaves the backlight
IR will be implemented in a future version of the code, with switched on. By connecting BLK to a PWM pin we will be
the IR remote transmitter replacing the console keyboard. If able to control the brightness of the backlight via software,
we were to add a dedicated LCD screen (to display the score), therefore we will use Micromite pin 26 which is PWM
we could disconnect the DM and simply plug the DPG module channel 2A.
directly into the MKC to create a standalone project.
The purpose of the game is to demonstrate many of the The RTC module has five connections (and is mounted onto
techniques that we are learning in these articles, and that is pin header J2). From left to right:
why it is worth looking through the program code line-by- n +
is the 3.3V supply
line. It is not meant to be the latest in addictive masterpieces; n D
and C are the two I2C protocol pins and have to be connected
however, I hope you have some fun with it! And please do to Micromite pin 18 (I2C Data) and pin 17 (I2C Clock).
experiment with the code – here are a few ideas to try out (and n N
C is no connection
do at least try the last one!): n 0
V is the supply.

62 Practical Electronics | September | 2019


to enable the sound (as it will then be a 0V), and use SETPIN
Blue indicates header pins projecting through board to underside 15,OFF to disable the sound (as pin 15 will then be floating).
Red indicates header pins pointing up
Black indicates socket (see accompanying text and photos)
Assembly of the IDM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 The IDM is assembled onto a piece of stripboard 24 tracks
A J2 A
B B wide, with 20 holes in each strip (see Fig.8). It is relatively
C C straightforward to construct since all that is required to create
D D
E E the plug-in module is just ten wire links, twelve track-cuts,
F F seven header/sockets, plus the piezo. We recommend following
G G
H J1 J3 H the usual sequence of construction:
I I n C ut required size stripboard
J J4 J5 J
K K n M ark out the 12 track cuts
L L n M ake the track cuts
M M
N N n I nsert the 10 wire links
O O n I
P P
nsert the seven header pins/sockets
Q Q n S older in piezo
R R n M ount the IPS screen, RTC module and IR receiver.
S J6 J7 S
T T
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Along the way, carefully check each step. The only real point
T T we need to emphasise is that the four connectors, J4, J5 (both
S S 6-way), J6 (3-way), and J7 (2way) are all pin strips modified
R R
Q Q in the same manner as we did for the DM, and also for the
P P Electronic Dice module. So, their pins are pushed to fully
O O
N N extend out of one side of the plastic housing, and the end
M M result is inserted into the stripboard on the component side
L L
K K so that the pins extend downwards creating the plug-in ability
J J (it may help to refer to Fig.9, where you can see J6 and J7 at
I I
H H the front of the board).
G G
F F
E E Running the test code for the MKC Clock
D D
C C
First, note that this month we are only going to load a program
B B that will check the IDM has been assembled correctly. If all is
A A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
well, it will show a simple clock display on the IPS screen.
We are not going to go through the detail of the code until next
month; so please don’t worry if you see things in the program
that you do not understand yet.
Now download the file IDM_TestCode.txt from the September
page of the PE website and install it on your MKC (with the
now familiar AUTOSAVE, Paste, and Ctrl-z sequence).
Before running the code, take a quick look at it in the EDITor.
The first few lines should be familiar (apart from the BOX and
TEXT commands). Note that main-program is just four lines
long: a DO/LOOP that continually displays Time$ and Date$.
There is also an infrared interrupt SUB that briefly activates
the piezo sounder whenever an IR signal is received. The long
list of what looks like random characters is actually the driver
required to operate the IPS screen – put another way, it allows
us to use MMBASICs graphical commands (such as BOX and
TEXT) so that it correctly draws items on the IPS screen.
RUN the program and you will see the IPS screen show
something similar to that shown in Fig.2 – however, the time
and date will be incorrect. If you get an error message warning
that the RTC is not responding, then check over the four
connections to the RTC header (J2). With the IDM powered
up, carefully remove the RTC module. The two outer pins
Fig.8. (Top) Stripboard layout for the IDM on which the Mini should be at 3.3V (use a multimeter if you have access to one;
MKC Clock is based; (Below) assembled IDM. otherwise, use a simple LED with a 470Ω series resistor and
build a test probe – refer to Fig.7, Part 2). If this checks out
There is a small button battery on the underside of the RTC, then power down so that you can check continuity between J2
so take care when handling this module. The battery keeps second and third pins to Micromite pins 18 and 17 respectively.
the RTC ticking over whenever main power is removed from An RTC error message will only be caused by an error on any
the supply pins. these four connections.
The IR receiver needs a 5V supply, and its output has to Assuming you get no RTC error message, next press a
be connected to Micromite pin 16 (as we saw in Part 6). It is button on an available remote control IR transmitter. Pressing
inserted into J3. The piezo sounder will be connected to PWM any button should result in the piezo giving a brief ‘beep’. If
channel 2B which is on pin 24. However, the other piezo not, then first try another remote, then check the IR receiver
pin will not be connected to 0V; instead, it is connected to is inserted correctly into J3 (the small rounded bump should
Micromite pin 15. This allows us to use SETPIN 15,DOUT be facing away from the RTC module – see Fig.9), and also

Practical Electronics | September | 2019 63


check the piezo connections. Ensure you get this working
before moving on.
Now back to the IPS screen – if you don’t see anything
displayed then you will need to carefully check the eight
connections between it and the Micromite. There is little
guidance that can be provided here other than to say to check
the track cuts and wire links are in the correct position, and
the screen is inserted properly into J1.
By now, you should see a time and date (albeit incorrect) on
the IPS screen. So the last thing we are going to do this month
is to set the RTC with the correct time and date information.
To do this, go to the command prompt (Ctrl-c) and use the
command RTC SETTIME year,month,day,hour,minute
,second to insert appropriate values. Note that this requires
the hour parameter to be in 24-hour format. For example, to
set the date/time for 16 August 2019, [Link]pm, use: RTC
SETTIME 2019,8,16,22,54,30. When you press the enter
key, and assuming you typed everything correctly, the date and
time will be instantly loaded into the RTC with the parameter
values you entered.
Now reset the MKC (press top-left button on DM) to synchronise Fig.9. The assembled strip board for the IDM (the IPS screen not
the Micromite with the RTC time. The OPTION AUTORUN ON yet inserted).
has been set in the code so it will automatically run on power-
up. Confirm that you can indeed now see the correct date and Next month
time on the IPS screen. If it is incorrect, then simply press Having assembled the IDM, next month we will begin to
Ctrl-C and re-enter the correct parameters with RTC SETTIME. explore some of MMBASIC’s graphical features; and also step
The very last thing to demonstrate is a standalone setup. through the code of the Mini MKC Clock program to understand
Remove power, unplug the IDM from the DM, and remove the how it works in its current form. Several new topics will be
DM from the MKC. Now plug the IDM directly into the MKC, and covered, including: RTC usage, Date$ and Time$, how to use
power it up. You should immediately see the IPS screen kick a special subroutine called [Link], and understanding
back into life. Congratulations, you have successfully assembled what the Library is (and how it can be useful to ‘hide away’
the Mini MKC Clock hardware. Leave it running for a few days our complex-looking screen driver code). Bringing all these
and confirm there is minimal (if any) drift from the true time elements together, we will end up adding several new features
(use time from the internet or a mobile phone as a reference). into the Mini MKC Clock program. Until next month, have fun!

COMPETITION!
Micromite
SIMPLE•INTERACTIVE•FUN
GOOD LUCK!

This month, Practical Electronics and [Link] are giving you the
chance to win a Micromite LCD BackPack kit. Think of the BackPack Terms and conditions
as a Micromite Keyring Computer (MKC) and Development Module
1. You may enter as many times as you wish
(DM) on a single PCB, along with the ability to directly plug in a 2.8-
inch LCD touchscreen. 2. All entries must be received by the closing date
Three winners will be selected at random, each winning a BackPack 3. Winners will be notified by email within one week after the closing date
kit (complete with a 2.8-inch LCD touchscreen). 4. Winners will need to confirm a valid shipping address to which their
To enter, simply email us a photo of you or a friend using your Dice prize will be shipped
Prediction Game. 5. 5. UK winners – prizes sent via Royal Mail 1st Class Signed-For service
Entries (with subject, ‘DPG Raffle’) should be emailed to: pe@[Link] 6. Overseas winners – prizes sent by Royal Mail’s International Tracked
Please ensure your email reaches us by the closing date of 31 August 2019. & Insured service.

64 Practical Electronics | September | 2019


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
EE M EE M
FR -RO FR -RO £8.99

Mike & Richard Tooley CD


JUMP START ELECTRONICS
CD

TEACH-IN 3
£7.99

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

FROM THE PUBLISHERS OF


TEACH-IN 5
huge range of subjects that will interest everyone involved 15 design and build circuit projects for newcomers or
CIRCUIT SURGERY JUMP START
in electronics – from newcomers to the hobby and i The how and why of circuit design those following courses in school and colleges. 15 desi gn and bui l d ci rcui t proj ects
dedi cated to newcomers or those

PRACTICALLY SPEAKING
fol l owi ng courses i n school s and

students to experienced constructors and professionals. The projects are:  Moisture Detector  Quiz
col l eges
i The techniques of electronic
project construction PRACTICALLY SPEAKING
The first section (80 pages) is dedicated to Circuit INGENUITY UNLIMITED
i Over 40 different circuit ideas
Machine  Battery Voltage Checker  Solar- The techni ques of proj ect constructi on

Surgery, EPE/PE’s regular clinic dealing with readers’ Powered Charger  Versatile Theft Alarm  Spooky
PIC ‘N MIX
Star ti ng out wi th PIC mi crocontrol l ers

nics
Teach-
In FREE Circuits  Frost Alarm  Mini Christmas Lights 
queries on circuit design problems – from voltage ro
FREE M
TEACH-IN 1 CD-ROM bo
rn e Pu
blishing Ltd 20
10 CD-RO

iPod Speaker  Logic Probe  DC Motor Controller


im

regulation to using SPICE circuit simulation software.

t
W

1
TWO TEACH-INs FOR TEACH-I N 2

Elec
©
THE PRICE OF ONE!
TWO TEACH-I Ns FOR

The second section – Practically Speaking –  Egg Timer  Signal Injector Probe  Simple Radio
THE PRI CE OF ONE!
i The free CD-ROM provides cal
Plus:
MikroElektro
nika,

a broad-based introduction
a practi The fr ee CD-ROM pr ovi des a
Provides to PIC Microchip pe
introduction llers L-Tek PoSco
to electronics microcontro
for Windo
ws software pr ac t i c al i nt r oduc t i on t o PIC

Receiver  Temperature Alarm.


CD ROM
i A complete stand-alone
start
n Program
should m i c r oc ont r ol l er s

covers hands-on aspects of electronics construction.


This CD
Simulatio
y, if not
Circuit d version)
[Link]
8 TINA (Limite ramming tutorial in 11 parts plus free double-click
In 2 Pl us Mi kroEl ektroni ka,
PIC Prog n) Teach-
8 FLOW
CODE V3 d versio software nicsorne Publishing
Ltd

Software Quizzes to Test


(Limite Ele©ctro
2013 Wimb
PIC and
dsPIC are
rated
MPLAB, logy Incorpo ogy
Mi crochi p and L-Tek PoScope
active
Again, a whole range of subjects, from soldering to
and logo, Techno Technol
ledge
ip name of Microchip ip
8 Inter The Microch
Microch .09 software
Your Know
arks s. © 2013 016-02
ed tradem countrie 1. MCCD1
register and other d. Issue
in the USAAll rights reserve
Inc.

avoiding problems with static electricity and identifying PLUS 29/07/201


3 [Link]

components is covered. Finally, our collection of 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 The CD-ROM also contains:
quizzes to test your knowledge and TINA circuit simulation software (a limited  Complete Teach-In 2 book, a practical introduction to PIC microprocessors
version – plus a specially written TINA Tutorial).  MikroElektronika, Microchip and L-Tek PoScope software.
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 EE M


Three Teach-ins for the great price of
FR -RO £8.99

A BROAD-BASED INTRODUCTION TO ELECTRONICS


CD

£18.95
ELECTRONICS FROM THE PUBLISHERS OF

Mike & Richard Tooley


TEACH-IN 4 FREE
CD-RO

PLUS you also get the contents of the


M
WORT
A BROAD-BASED
The Teach-In 4 CD-ROM covers three of the most
H
£2 9.9
5
INTRODUCTION TO ELECTRONICS
i An el even par t t u t or i al
important electronics units that are currently studied in
many schools and colleges. These include, Edexcel
i Uses i n expen si ve c i r c u i t
si m u l at i on sof t w ar e free CD-ROM from each issue...
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 ELECTRONI CS MANUAL


Th e e s s e n t i al r e f e r e n c e

The CD-ROM also contains the full Modern w o r k f o r e ve r yo n e

The Full Modern Electronics Manual!


s t u d yi n g e l e c t r o n i c s

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

contains over 800 pages of electronics theory,


i I n -dept h t h eor y
autorun,
should
This software in Windows
i Ext en si ve dat a t abl es

What a Bargain!!
if not, open double-click
and
Explorer f
[Link]

This CD-ROM
Adobe®
requires
Reader™
from
an d w eb l i n k s
UAL
projects, data, assembly instructions and web links.
dable Free
Downloa [Link]

[Link].u
[Link]

BA SE .epe mag
k
2011
www ne Publishi
ng Ltd.

A package of exceptional value that will appeal


© Wimbor

to anyone interested in learning about electronics –


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
 Discrete Linear Circuit Design well as coding enthusiasts who want to explore
Teach-In 6 is for anyone searching for ideas to use  Understand linear circuit design
their Pi, or who has an idea for a project but doesn’t  Learn with ‘TINA’ – modern CAD software
hardware and interfacing. It will provide a one-stop
know how to turn it into reality. This book will prove source of ideas and practical information.
 Design simple, but elegant circuits
invaluable for anyone fascinated by the revolutionary  Five 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
 Pi programming ii) Headphone Amp a set of Christmas tree lights to remotely controlling a
 Pi hardware iii) Tone Control robotic vehicle through wireless or the Internet.
 Pi communications iv) VU-meter Teach-In 8 is based around a series of practical
 Pi Projects v) High Performance Audio Power Amp. projects with plenty of information for customisation.
 Pi Class
 Python Quickstart This book also includes PIC n’ Mix: ‘PICs and the
PLUS PICkit 3 – A Beginners
 Pi World
guide’ by Mike O’Keefe
EE OM EE M EE M
FR -RO
 ...and much more! FR -R
DV
D
£8.99

Audio Out – an
CD
£8.99 FR RO
- £8.99

ELECTRONI CS ELECTRONI CS and Circuit Surgery


CD
ELECTRONI CS
The Teach-In 6 CD- FROM THE PUBLISHERS OF

analogue expert’s take FROM THE PUBLISHERS OF

by Ian Bell – ‘State


FREE

ROM also contains all TEACH-I N 6 on specialist circuits


TEACH-I N 7 TEACH-I N 8 CD-ROM SOFTWARE

Machines part 1 and 2’.


FOR
THE TEACH-
IN 8
FROM THE PUBLISHERS OF SERIES

RASPBERRY Pi ®
DISCRETE LINEAR CIRCUIT DESIGN
the necessary software A COMPREHENSIVE GUIDE TO RASPBERRY Pi
Practically Speaking – • Understand linear circuit design INTRODUCING THE ARDUINO
• Pi PROJECT – SOMETHING TO BUILD • Design simple, but elegant circuits
The CD-ROM includes
• Hardware – learn about components and circuits
• Pi CLASS – SPECIFIC LEARNING AIMS
for the series, so that • PYTHON QUICKSTART – SPECIFIC PROGRAMMING TOPICS
the techniques of
• Learn with ‘TINA’ – modern CAD software
• Five projects to build: Pre-amp, Headphone Amp,
• Programming – powerful integrated development system
• Microcontrollers – understand control operations
• Pi WORLD – ACCESSORIES, BOOKS ETC
the files for:
Tone Control, VU-meter, High Performance Audio Power Amp • Communications – connect to PCs and other Arduinos
• HOME BAKING – FOLLOW-UP ACTIVITIES
readers and circuit project building.
FREE
designers can get DVD-R
OM
ALL THE
SOFTWA
TEACH-I
RE
N6
FREE M
-RO
CD CIRCUIT
 Teach-In 8
FOR THE RRY Pi

started quickly and RASPBE ALL THE

 Microchip MPLAB
RE FOR
SERIES SOFTWA 7
CH-IN
THE TEA
SERIES

easily with the projects


IDE XC8 8-bit compiler
and ideas covered. PLUS
PLUS...
 PICkit 3 User Guide
Pi B+ UPDATE
INTERFACE – a series of AUDIO OUT
ten Pi related features An analogue expert’s take
on specialist circuits
PLUS...
 Lab-Nation
REVIEWS – Optically PIC n’MIX
isolated ADC and I/O PRACTICALLY SPEAKING PICs and the PICkit 3 - A beginners
interface boards The techniques of project guide. The why and how to build

Smartscope software.
building PIC-based projects

ORDER YOUR BUNDLE TODAY!


JUST CALL 01202 880299 – OR VISIT [Link]
Max’s Cool Beans
By Max the Magnificent

Flipping and flopping – metastability


you missed last month’s piece, but find
this topic interesting, then I do recommend
you read the August Cool Beans first –
it will make the following much easier
to understand.)

D-type flip-flop
A very common type of register is called
a D-type flip-flop, where ‘D’ stands for
data. Unlike the SR latch, which is asyn-
chronous, the D-type flip-flop is a syn-
chronous function that’s controlled by
a clock signal. The symbol, truth table,
and example waveform for a positive-
edge-triggered D-type flip-flop are shown
in Fig.9.
From the truth table, we see that a posi-
tive, or rising edge (0-to-1 transition) on
the CLK (clock) input will cause what-
ever 0 or 1 value is currently present on
the D (data) input to be loaded into the
register. This value will appear on the
Q output after the register’s propagation
delay tp. (These registers often have QB
outputs, but we’ve omitted such an output
in this case to keep things as simple as
possible). A negative, or falling edge (1-
to-0 transition) on the CLK signal will
have no effect. Similarly, if the CLK is a
steady 0 or 1, we don’t care what’s hap-
pening on the D signal, which we’ve
indicated using ‘X’ characters, meaning
‘don’t care,’ in the truth table.
By some strange quirk of fate, the heart
of the D-type flip-flop is composed from
two SR latches (or similar functions) ac-
companied by a few other primitive logic
gates. We’ve already seen that SR latches
can enter an unstable condition if we’re
not careful. The way the creators of the
Virtual version of the 4-bit HRRG Computer. D-type flip-flop avoid this is to specify
two parameters called ‘setup’ and ‘hold’.

I
f you recall, last month we My partner in Boolean crime is Joe Basically, we are creating a ‘window’
discussed a project I’m working on Farr, who is initially creating a virtual surrounding the active edge of the clock.
called the 4-bit HRRG Computer version of the 4-bit HRRG Computer, So long as the data signal has stopped
– AKA, the Heath Robinson, Rube while I focus on the ‘real’ (physical) side. changing before the start of the window
Goldberg Computer. This little gem I started to explain that one challenge (as specified by the setup time ts), and
of computational awesomeness will when building a computer from the ground so long as it remains steady until after
boast a wide variety of implementation up is that you have to face the problem the end of the window (as defined by
technologies, from relays, vacuum of metastability, caused by reading the hold time th) then everything will
tubes, transistors and jelly-bean ICs, asynchronous signals from the outside be tickety-boo.
to mechanical, magnetic, pneumatic, world. We took the simplest example – an Consider the waveform diagram in
and fluidic logic… plus anything else asynchronous SR latch – and now it’s time Fig.9. When power is first applied to
I fancy. Intel can sleep easy (for now), to move on to more substantial examples the system at time t0, the D-type flip-
a regular Pentium this is not. via the D-type flip-flop. (Incidentally, if flop can randomly power up containing

66 Practical Electronics | September | 2019


It’s only after the clock edge at time t5
that a known good value is once again
CLK D Q(new)
D-type flip-flop
0 0
loaded into our flip-flop.
D Q
1 1
So, what do we mean by ‘metastable
0 X Q(old)
condition’? Well, one way to think about
CLK this is illustrated in Fig.11. Suppose we
1 X Q(old)
X Q(old)
have two guys called ‘Zero’ and ‘One’
kicking a football back and forth over
t0 t1 t2 t3 t4 t5 a grassy knoll. First, Zero kicks the ball
ts th ts th ts th to One (a), then One kicks the ball back
to Zero (b).
CLK
The problem arises if someone doesn’t
kick the ball hard enough, such that it
D
ends up perched on top of the knoll. We
can think of this as a system being in an
Q ?
unstable equilibrium, in which it will
tP tP tP remain until a gust of wind or vibrations
from a passing truck cause it to roll one
Fig.9. Symbol, truth table, and example waveform for D-type flip-flop. way or the other.
Something similar may happen inside
a 0 or a 1; we’ve indicated this using the indicated this new value in light green). our D-type flip-flop when we violate a
light pink color and the ‘?’ character in Since this occurs when the CLK is a setup or hold time. In this case, one or
the waveform. From the waveform dia- steady 1, and since it occurs after the more of the flip-flop’s internal signals
gram we see that the CLK signal starts hold time associated with the clock edge may end up at some intermediate volt-
at 0. Now, observe the waveform asso- at time t3, it has no effect on the contents age – our metastable state – where they
ciated with the D signal. We’ve shown of the flip-flop. will remain for some period of time (not
this as a light green ‘box,’ thereby indi- Last but not least, the D signal is stable to exceed the recovery time) before set-
cating that the data can be a 0 or a 1; we throughout the setup-hold window tling into good 0 or 1 values.
don’t care which, so long as it’s a good around the positive clock edge at time
steady signal. t5, so the value on D is loaded into the Mastering Metastability
The D signal is stable throughout the flip-flop, appearing on the Q output after Now, you may be saying to yourself,
setup-hold window around the positive the propagation delay tp. ‘This is very interesting (or not, as the
clock edge at time t1, so the value on D is case might be), but I never do anything
loaded into the flip-flop, appearing on the Monstrous metastability that might cause metastability, so what
Q output after the propagation delay tp. Now let’s consider what might happen has it got to do with me?’ The thing is,
At time t2 the value on D transitions if we happen to violate a setup or hold since you regularly interact with micro-
from a 0 to a 1, or vice versa (we’ve indi- time, as illustrated in Fig.10. Things start controllers (MCUs) in such things as home
cated this new value in light blue). Since off the same as in Fig.9. The problem appliances, automobiles, and smart de-
this occurs when the CLK is a steady occurs when the data transitions at time vices, you are quite possibly the instiga-
0, and since it occurs before the setup t2, thereby violating the setup time ts as- tor of numerous metastable events each
time associated with the clock edge at sociated with the rising edge on the clock and every day. The reason you remain
time t3, it has no effect on the contents at time t3. This may cause the register, blissfully unaware of this fact is that the
of the flip-flop. and the Q output, to enter a metastable designers of the MCUs have taken steps
The D signal is stable throughout the condition, the meaning of which we will to protect you from yourself.
setup-hold window around the positive discuss in a moment (alternatively, the
clock edge at time t3, so the value on D is register and its output could potentially
loaded into the flip-flop, appearing on the start oscillating between 0 and 1). After a
Zero One
Q output after the propagation delay tp. delay known as the ‘recovery time’, the
At time t4 the value on D transitions register will randomly settle into a 0 or
from a 1 to a 0, or vice versa (we have 1 value, but we don’t know which one.

(a) Zero kicks the ball to One


t0 t1 t2 t3 t4 t5

ts th Setup violation ts th Metastable ts th Zero One

CLK

D
(b) One kicks the ball to Zero
Q ? ?
Zero One
tP tP Recovery time tP

The output enters a metastable condition


(or possibly starts oscillating between 0 and 1) ? ?

Following the recovery time, the output


settles into an unknown state (i.e., 0 or 1). (c) The ball ends up in a metastable state

Fig.10. A setup violation on a D-type flip-flop. Fig.11. Visualisation of metastability.

Practical Electronics | September | 2019 67


causes the new value on ASYNC to be
loaded into the first flip-flop, appearing
on its META output after the register’s
Inside the MCU propagation delay tp. At the same time,
(part of the synchronous domain
inside the microcontroller) the original value on META is loaded
into the second flip-flop, appearing on
Input pin Two-Stage Synchronizer its CLEAN output after that register’s
DFF1 DFF2 To the propagation delay tp.
ASYNC META CLEAN CPU Now consider the rising edge on the
Asynchronous
d q d q
signal from the
CLK signal at time t2. This reloads the
outside world new value on ASYNC into the first flip-
flop. At the same time, the new value
Derived from
the main on the META signal is loaded into the
CLK system clock second flip-flop. Thus, not surprisingly,
it now takes two clock cycles for the new
value on the ASYNC signal to wend its
way through the two registers to become
available to the MCU.
Fig.12. A two-stage synchroniser Next, let’s consider what might happen
if the transition on the ASYNC signal
The realm inside a microcontroller is mess things up inside the MCU and give were to trigger a setup or hold violation
regular and structured, with every action you a ‘bad hair’ day – even if you have on the first flip-flop. Let’s assume a setup
being synchronised to the system clock. as little hair as the editor and me. violation, as illustrated in Fig.14.
But what about the real world outside the In this case, the rising edge on CLK at
MCU? Here, actions can take place willy- Two-stage synchroniser time t1 causes the first flip-flop to enter
nilly whenever they please, which means One solution is to attach what’s called a a metastable condition, which appears
they are asynchronous (not synchronised) two-stage synchroniser to the input pin on its META output after the register’s
with respect to the MCU’s clock. inside the MCU (Fig.12). As we see, in propagation delay tp. At the same time,
As an example, suppose you are cre- addition to our CLK (clock) signal, we the original value on META is loaded
ating a hobby project using an Arduino. have three data signals: ASYNC (the asyn- into the second flip-flop, appearing on
Let’s say you connect a toggle switch to chronous input from the outside world), its CLEAN output after that register’s
one of the Arduino’s digital input pins META (the output from the first D-type propagation delay tp.
that you’ve decide to call myInputPin flip-flop that may enter a metastable Following its recovery time, the first
in your code, and you also declare a vari- state), and CLEAN (the output from the flip-flop will settle in a random 0 or 1
able called mySwitchValue. At some second flip-flop that has been scrubbed state. Suppose it were to end up with the
stage in your program, you’re going to clean of any metastability). value we were actually hoping for. In this
have a statement that says something like: Let’s start by considering the case case, following the rising edge on CLK at
where the transition on the asynchronous time t2, the two flip-flops and the ASYNC,
mySwitchValue = input doesn’t cause any problems by trig- META, and CLEAN signals end up just
digitalRead(myInputPin); gering any violations (Fig.13). We start the same as if there had been no violation.
with the asynchronous signal (ASYNC) Of course, there’s always the possi-
Did you ever pause to ponder what actu- coming from our toggle switch and the bility that, following the recovery time,
ally happens when such a statement is outputs from the two registers (META the first flip-flop ends up containing the
executed? Well, there are several steps, and CLEAN) all containing the same 0 wrong 0 or 1 value (the one we weren’t
the first of which is to access the value or 1 value (we don’t care which), which hoping for) as depicted in Fig.15.
on the pin and store it in a register. If it we’ve indicated in light green. In this case, the rising edge on CLK at
happens that this statement is executed Eventually, we activate our toggle time t2 finally loads the good value on
at the same time as you are toggling your switch, thereby causing the ASYNC ASYNC into the first flip-flop, but – at the
switch, you could violate the register’s signal to change to a new 0 or 1 value, same time – it loads the bad value into
setup or hold time, thereby triggering a which we’ve indicated in light blue. The the second flip-flop, and this unwanted
metastable condition, which could really rising edge on the CLK signal at time t1 value appears on the CLEAN output after

t1 t2 t1 t2
ts th ts th ts th ts th

CLK CLK
Setup Violation
ASYNC ASYNC
Good
META META

CLEAN CLEAN

tP tP tP Recovery time tP

Fig.13. No problems (hurray!) Fig.14. A setup violation that ends up the way we want.

68 Practical Electronics | September | 2019


conditions, the switch could be activat-
t1 t2 t3 ed and deactivated once every 200ms,
ts th ts th ts th which equates to 3,200,000 clock cycles
on a 16MHz Arduino. This means that
CLK it really doesn’t impact the speed of our
Setup Violation program if the MCU devotes three of
ASYNC these clock cycles to driving our two-
stage synchroniser.
Bad
META
Happy HRRGs
As we previously noted, most end users
CLEAN don’t even think about the problems as-
sociated with metastability because the
tP Recovery time tP tP
folks who design microcontrollers miti-
gate against these effects for us. However,
Fig.15. A setup violation that ends up the way we don’t want. when one is building an electronic system
from the ground up – like our 4-Bit HRRG
the second register’s propagation delay. it’s important to realise that events in Computer, for example – then we have
Thus, it’s not until the rising edge on the the real world take place at a vastly dif- to cover all of the bases. For example,
CLK at time t3 that the second flip-flop ferent time scale than do the operations we have to make decisions about things
and the CLEAN signal end up with the inside the MCU. In the case of our hand- like the CPU’s internal registers and its
value we were looking for. activated toggle switch, for example, the instruction set (the instructions it will
fastest most people could flick this back support and how they will behave). By
Three steps to (stability) heaven and forth would be about five times a some strange quirk of fate, these topics
What does all this really mean? Well, in second (and that would be really push- will be the focus of a future Cool Beans
a nutshell, our two-step synchroniser re- ing things). So, even under worse-case column. Until then, have a good one!
quires three active clock edges to perform
its magic. It’s only after the third clock Cool bean Max Maxfield (Hawaiian shirt, on the right) is editor-
that we can guarantee our CLEAN signal in-chief at [Link] – the go-to site for users of electronic
contains the value we want. design tools and askers of electronic questions.
Although using three clock cycles
Comments or questions? Email Max at: max@[Link]
may seem like a wasteful extravagance,

ESR Electronic Components Ltd

All of our stock is RoHS compliant and CE


approved. Visit our well stocked shop for
Your best bet since MAPLIN all of your requirements or order on-line.
Chock-a-Block with Stock
Visit: [Link]
We can help and advise with your enquiry,
from design to construction.
Or phone our friendly knowledgeable staff on 020 8452 0161
Components • Audio • Video • Connectors • Cables
Arduino • Test Equipment etc, etc
3D Printing • Cable • CCTV • Connectors • Components •
Enclosures • Fans • Fuses • Hardware • Lamps • LED’s •
Leads • Loudspeakers • Panel Meters • PCB Production •
Power Supplies • Relays • Resistors • Semiconductors •
Soldering Irons • Switches • Test Equipment • Transformers
and so much more…
Monday to Friday 08:30 - 17.00, Saturday 08:30 - 15:30

Station Road
Cullercoats
North Shields
Tyne & Wear
NE30 4PQ
Tel: 0191 2514363 sales@[Link] [Link]

Practical Electronics | September | 2019 69


PRACTICAL ELECTRONICS IS PLEASED TO OFFER YOU THESE

ELECTRONICS CD-ROMS
GCSE ELECTRONICS
Suitable for any student who is serious about studying and who wants to achieve
the best grade possible. Each program’s clear, patient and structured delivery will
aid understanding of electronics and assist in developing a confident approach to
answering GCSE questions. The CD-ROM will be invaluable to anyone studying
electronics, not just GCSE students.

*Curriculum
Contains comprehensive teaching material to cover the National
*
syllabus Regular exercises reinforce the teaching points
*
*
Retains student interest with high quality animation and graphics Stimulates learning through interactive
*
exercises Provides sample examination ques-tions with model solutions
* Authored by practising teachers
* * *
Covers all UK examination board syllabuses Caters for all levels of ability Useful for self-tuition and revision

SUBJECTS COVERED
£12.50 Electric Circuits – Logic Gates – Capacitors & Inductors – Relays – Transistors – Electric Transducers – Operational
inc. VAT and P&P Amplifiers – Radio Circuits – Test Instruments
Over 100 different sections under the above headings

CIRCUIT WIZARD
Circuit Wizard is a revolutionary software system that combines circuit design, PCB design, simulation and CAD/CAM
manufacture in one complete package. Two versions are available – Standard or Professional.
By integrating the entire design process, Circuit Wizard provides you with all the tools necessary to produce an electronics project from start to
finish – even including on-screen testing of the PCB prior to construction!

* *
Circuit diagram design with component library (500 components Standard,1500 components Professional) Virtual instruments
(4 Standard, 7 professional) On-screen animation Interactive circuit diagram simulation True analogue/digital simulation
* * *
* * *
Simulation of component destruction PCB Layout Interactive PCB layout simulation
* *
Automatic PCB routing Gerber export
Multi-level zoom (25% to 1000%) Multiple undo and redo Copy and paste to other software Multiple document support
* * * *
This software can be used with the Jump Start and Teach-In 2011 series (and the Teach-In 4 book).
Standard £61.25 inc. VAT. Professional £75 plus VAT.

From TINA Design Suite V12 FE


£49.00
ATU
Analogue, Digital, Symbolic, RF, MCU and Mixed-Mode OU RE
RT D IN
Circuit Simulation and PCB Design with TINA 201 EA CH
5S -IN
TINA Design Suite V12 is a powerful yet affordable software package for analysing, designing and ER
IES
real time testing analogue, digital, MCU, and mixed electronic circuits and their PCB layouts. You can
also analyse RF, communication, optoelectronic circuits, test and debug microcontroller applications.
Enter and analyse any circuit up to 100 nodes (student), or 200 with the Basic (Hobbyist) version
within minutes with TINA’s easy-to-use schematic editor. Enhance your schematics by adding text
and graphics. Choose components from the large library containing more than 10,000 manufacturer
models. Analyse your circuit through more than 20 different analysis modes or with 10 high tech
virtual instruments.
Present your results in TINA’s sophisticated diagram windows, on virtual instruments, or in the live
interactive mode where you can even edit your circuit during operation.
Customise presentations using TINA’s advanced drawing tools to control text, fonts, axes, line
width, colour and layout. You can create and print documents directly inside TINA or cut and paste
your results into your favourite word procesing or DTP package.
TINA includes the following Virtual Instruments: Oscilloscope, Function Generator, Multimeter,
Signal Analyser/Bode Plotter, Network Analyser, Spectrum Analyser, Logic Analyser, Digital Signal
Generator, XY Recorder.
This offer gives you a CD-ROM – the software will need registering (FREE) with Designsoft (TINA),
details are given within the package.
Get TINA 12 Design Suite (Hobbyist) for £129 or Student V12 version for £49
Prices include VAT and UK postage
+ get a 1 year free subscription for TINACloud the breakthrough cloud version of TINA which you can run on
most operating systems and computers, including PCs, Macs, thin clients iPads and other tablets – even on many
smart phones, smart TVs and e-book readers.
To order please either fill out and return the order form, or call us on 01202 880299
Alternatively you can order via our secure online shop at: [Link]

70 Practical Electronics | September | 2019


PICmicro TUTORIALS AND PROGRAMMING
HARDWARE
PICmicro Multiprogrammer Board
and Development Board
Suitable for use with the three software packages
listed below
This flexible PICmicro microcontroller programmer board and
combination board allows students and professional engineers
to learn how to program PICmicro microcontrollers as well
as program a range of 8, 18, 28 and 40 pin devices from the
12, 16 and 18 series PICmicro ranges. For those who want to
learn, choose one or all of the packages below to use with the
hardware.

• Makes it easier to develop PICmicro projects


• Supports low cost Flash-programmable PICmicro devices
• Fully featured integrated displays – 16 individual LEDs, quad
7-segment display and alphanumeric LCD display
• Supports PICmicro microcontrollers with A/D converters
• Fully protected expansion bus for project work
• USB programmable
• Compatible with the E-blocks range of accessories £159.99 including VAT and postage (worldwide)

SOFTWARE
ASSEMBLY FOR PICmicro V7 FLOWCODE FOR
(Formerly PICtutor) PICmicro V8
Assembly for PICmicro microcontrollers V7.0 (previously known as PICtutor) by Flowcode is a very high level language programming system based on flowcharts.
John Becker contains a complete course in programming the PIC16F84, 16F88 Flowcode allows you to design and simulate complex systems in a matter of
and 16F877a PICmicro microcontroller from Arizona Microchip. It starts with minutes. A powerful language that uses macros to facilitate the control of devices
fundamental concepts and extends up to complex programs including watchdog like 7-segment displays, motor controllers and LCDs. The use of macros allows
timers, interrupts and sleep modes. you to control these devices without getting bogged down in understanding the
The CD makes use of the latest simulation techniques which provide a superb tool programming. When used in conjunction with the development board this provides
for learning: the Virtual PICmicro microcontroller, this is a simulation tool that allows a seamless solution that allows you to program chips in minutes.
users to write and execute MPASM assembler code for the PIC16F84 microcontroller • Requires no programming experience
on-screen. Using this you can actually see what happens inside the PICmicro MCU • Allows complex PICmicro applications to be designed quickly
as each instruction is executed, which enhances understanding. • Uses international standard flow chart symbols
• Comprehensive instruction through 45 tutorial sections • Full on-screen simulation allows debugging and speeds up the development
process.
• Includes Vlab, a Virtual PICmicro microcontroller: a fully functioning
simulator • Facilitates learning via a full suite of demonstration tutorials
• Tests, exercises and projects covering a wide range of PICmicro MCU • Produces code for a wide range of devices
applications • 16-bit arithmetic strings and string manipulation
• Includes MPLAB assembler • Pulse width modulation
• Visual representation of a PICmicro showing architecture and functions • I2C.
• Expert system for code entry helps first time users Please note: Due to popular demand, Flowcode is now available as a download.
• Shows data flow and fetch execute cycle and has challenges (washing Please include your email address and a username (of your choice) on your order.
machine, lift, crossroads etc.)
A unique download code will then be emailed to you.
• Imports MPASM files.

Single License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . £99 plus VAT


PRICES
Prices for each of the CD-ROMs above are: Site Licence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . £499 plus VAT
(Order form on next page)
Flowcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contact us for pricing
(UK and EU customers add VAT to ‘plus VAT’ prices) (choose PIC-8b, PIC-16b, PIC-32b, AVR/Arduino,ARM)

Practical Electronics | September | 2019 71


ELECTRONICS TEACH-IN 2 ELECTRONICS TEACH-IN 3 ELECTRONICS TEACH-IN 4

ELECTRONICS TEACH-IN 2 CD-ROM ELECTRONICS TEACH-IN 3 CD-ROM ELECTRONICS TEACH-IN 4 CD-ROM


USING PIC MICROCONTROLLERS A PRACTICAL
The three sections of this CD-ROM cover a very wide range of A BROAD-BASED INTRODUCTION TO ELECTRONICS.
INTRODUCTION
subjects that will interest everyone involved in electronics, from
hobbyists and students to professionals. The first 80-odd pages The Teach-In 4 CD-ROM covers three of the most important
This Teach-In series of articles was originally published electronics units that are currently studied in many schools and
in EPE in 2008 and, following demand from readers, has of Teach-In 3 are dedicated to Circuit Surgery, the regular EPE
colleges. These include, Edexcel BTEC level 2 awards and the
been collected together in the Electronics Teach-In 2 clinic dealing with readers’ queries on circuit design problems –
from voltage regulation to using SPICE circuit simulation software. electronics units of the Diploma in Engineering, Level 2.
CD-ROM.
The series is aimed at those using PIC microcontrollers The second section – Practically Speaking – covers the The CD-ROM also contains the full Modern Electronics
for the first time. Each part of the series includes breadboard practical aspects of electronics construction. Again, a whole Manual, worth £29.95. The Manual contains over 800 pages
layouts to aid understanding and a simple programmer range of subjects, from soldering to avoiding problems with of electronics theory, projects, data, assembly instructions
project is provided. static electricity and indentifying components, are covered. and web links.
Also included are 29 PIC N’ Mix articles, also republished Finally, our collection of Ingenuity Unlimited circuits provides A package of exceptional value that will appeal to all those
from EPE. These provide a host of practical programming over 40 circuit designs submitted by the readers of EPE. interested in learning about electronics or brushing up on
and interfacing information, mainly for those that have The CD-ROM also contains the complete Electronics Teach-In their theory, be they hobbyists, students or professionals.
already got to grips with using PIC microcontrollers. An extra
1 book, which provides a broad-based introduction to electronics
four part beginners guide to using the C programing language
for PIC microcontrollers is also included. in PDF form, plus interactive quizzes to test your knowledge, TINA CD-ROM Order code ETI4 CD-ROM £8.99
The CD-ROM also contains all of the software for the circuit simulation software (a limited version – plus a specially
Teach-In 2 series and PIC N’ Mix articles, plus a range written TINA Tutorial).
of items from Microchip – the manufacturers of the PIC The Teach-In 1 series covers everything from Electric Current
microcontrollers. The material has been compiled by through to Microprocessors and Microcontrollers and each part
Wimborne Publishing Ltd. with the assistance of Microchip includes demonstration circuits to build on breadboards or to ELECTRONICS TEACH-IN 5
Technology Inc. simulate on your PC.

CD-ROM Order code ETI2 CD-ROM £9.50 CD-ROM Order code ETI3 CD-ROM £8.50 EE M
FR -RO £8.99

ELECTRONICS
CD

FROM THE PUBLISHERS OF

TEACH-IN 5
JUMP START

ELECTRONICS TEACH-IN
ORDERING 15 desi gn and bui l d ci rcui t proj ects
dedi cated to newcomers or those
fol l owi ng courses i n school s and

ALL PRICES INCLUDE UK col l eges

PRACTICALLY SPEAKING
BUNDLE – FOR PARTS 3, 4 & 5 POSTAGE The techni ques of proj ect constructi on

PIC ‘N MIX

Standard/Student/Basic (Hobbyist)
Star ti ng out wi th PIC mi crocontrol l ers

FREE
Version price includes postage to most countries CD-R
OM

TEACH-I N 2
in the world EU residents outside the UK add £5 for TWO TEACH-I Ns FOR
THE PRI CE OF ONE!
airmail postage per order Plus: onika,

Order code ETIB3 CD-ROM £18.95


a pract
ical MikroElektr
Provides Microchip pe The fr ee CD-ROM pr ovi des a
CD-ROM
to PIC
introduction ollers L-Tek PoSco
microcontr ows software pr ac t i c al i nt r oduc t i on t o PIC
for Wind
CD ROM start
This CD
should m i c r oc ont r ol l er s
ly, if not
automaticalk index
.html
double-clic
In 2 Pl us Mi kroEl ektroni ka,
onicsorne Teach- Ltd
Publishing
Ele©ctr
2013 Wimb
and logo,
MPLAB
Techno
logy
dsPIC are
, PIC andIncorporated
Techno
logy
Mi crochi p and L-Tek PoScope
hip name of Microchip Microc
hip
software
The Microctrademarks © 2013 1016-02.09
red countries. 1. MCCD
registe and other d. Issue
in the USAAll rights reserve
Inc.

13 [Link]
29/07/20

ELECTRONICS TEACH-IN 5
JUMP START FREE
CD-ROM
15 design and build circuit projects
Please send me: CD-ROM ORDER FORM dedicated to newcomers or those
following courses in school and
Version required: colleges. The projects are: Moisture Detector, Quiz Machine,
 Assembly for PICmicro V6  Single Licence Battery Voltage Checker, Solar-Powered Charger, Versatile
 ‘C’ for 16 Series PICmicro V6  Site licence Theft Alarm, Spooky Circuits, Frost Alarm, Mini Christmas
Lights, iPod Speaker, Logic Probe, DC Motor Controller, Egg
Timer, Signal Injector Probe, Simple Radio Receiver, Tempera-
ture Alarm.
Note: The software on each version is the same, only the licence for use varies. PLUS:
PIC’ N MIX – starting out with PIC Microcontrollers and PRAC-
TICALLY SPEAKING – the techniques of project construction.
 PICmicro Multiprogrammer Board and Development Board (hardware) FREE CD-ROM – The free CD-ROM is the complete
Teach-In 2 book providing a practical introduction to PIC
Microprocessors plus MikroElektronika, Microchip and
 Circuit Wizard – Standard  Teach-In 2 L-Tek PoScope software.
 Circuit Wizard – Professional  Teach-In 3
 Teach-In 4 £8.99
 GCSE Electronics
160 Pages Order code ETI5
 Teach-In Bundle
 TINA Design Suite V11 Basic (Hobbyist) (3, 4 and 5)
 TINA Design Suite V11 (Student) Single License and Site License Versions
– overseas readers add £5 to the basic price
Full name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . of each order for airmail postage (do not add
Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VAT unless you live in an EU (European Union)
country, then add VAT at 20% or provide your
. . . . . . . . . . . . . . . . . . . . . . Post code . . . . . . . . . . . . . . . . . Tel . . . . . . . . . . . . . . . official VAT registration number).

Email: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Send your order to:


Wimborne Publishing Ltd
113 Lynwood Drive
 I enclose cheque/PO in £ sterling payable to Practical Electronics for £ . . . . . . . . .
Wimborne
 Please charge my Visa/Mastercard: £ . . . . . . . . . . Dorset BH21 1UU
To order by phone call:
Valid From: . . . . . . . . . . Card expiry date: . . . . . . . . . . . . .
01202 880299. Fax: 01202 843233
Goods are normally sent within seven days
Card No: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E-mail: [Link]@[Link]
Card Security Code . . . . . . . . . . Online shop:
(The last 3 digits on or just under the signature strip)
[Link]

72 Practical Electronics | September | 2019


DIRECT BOOK SERVICE
The books listed here

Teach-In 2017
have been selected by
the Practical Electronics
editorial staff as being
of special interest to
everyone involved
in electronics and
Introducing the computing. They are
supplied by mail order
direct to your door.
BBC micro:bit 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 [Link]
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
GETTING STARTED WITH THE BBC MICRO:BIT IN 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
B O O K O R D E R I N G D E TA I L S
STARTING ELECTRONICS – 4th Ed
Keith Brindley All prices include UK postage.
296 pages Order code ELSEV100 £18.99 For airmail, 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 WIMBORNE 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 – E-mail: [Link]@[Link]

UNDERSTANDING ELECTRONIC CONTROL SYSTEMS Order from our online shop at: [Link]
Owen Bishop
228 pages Order code NE35 £36.99

Practical Electronics | September | 2019 73


ARDUINO COMPUTING AND ROBOTICS

NEWNES INTERFACING COMPANION COMPUTING FOR THE OLDER GENERATION


Tony Fischer-Cripps Jim Gatenby

Teach-In 2016 295 pages Order code NE38

HOW TO BUILD A COMPUTER MADE EASY


Robert Penfold
£41.00 308 pages

Second Edition – John Iovine


Order code BP601

ANDROIDS, ROBOTS AND ANIMATRONS


£8.99

See opposite for our popular 224 pages Order code MGH1 £16.99
120 pages Order code BP707 £8.49
introduction to the Arduino
EASY PC CASE MODDING ROBOT BUILDERS COOKBOOK
Robert Penfold Owen Bishop
192 pages + CD-ROM Order code BP542 £8.99 366 pages Order code NE46 £26.00

FREE DOWNLOADS TO PEP-UP AND PROTECT INTRODUCING ROBOTICS WITH LEGO


YOUR PC MINDSTORMS
Robert Penfold Robert Penfold
128 pages Order code BP722 £7.99 288 pages + Order code BP901 £14.99

WINDOWS XP EXPLAINED MORE ADVANCED ROBOTICS WITH LEGO MINDSTORMS


N. Kantaris and P.R.M. Oliver Robert Penfold
264 pages Order code BP514 £7.99 298 pages Order code BP902 £14.99

THE INTERNET – TWEAKS, TIPS AND TRICKS HOW TO FIX YOUR PC PROBLEMS
Robert Penfold Robert Penfold

128 pages Order code BP721 £7.99 128 pages Order code BP705 £8.49

ARDUINO FOR DUMMIES WINDOWS 7 – TWEAKS, TIPS AND TRICKS


eBAY – TWEAKS, TIPS AND TRICKS
John Nussey Robert Penfold
Andrew Edney
Arduino is no ordinary circuit board. Whether you’re an artist, 120 pages Order code BP708 £8.49
a designer, a programmer, or a hobbyist, Arduino lets you 128 pages Order code BP716 £7.50
learn about and play with electronics. You’ll discover how to GETTING STARTED IN COMPUTING FOR
build a variety of circuits that can sense or control real-world AN INTRODUCTION TO eBAY FOR THE OLDER
GENERATION THE OLDER GENERATION
objects, prototype your own product, and even create inter- Jim Gatenby
active artwork. This handy guide is exactly what you need to Cherry Nixon
build your own Arduino project – what you make is up to you! 120 pages Order code BP709 £8.49 120 pages Order code BP704 £8.49
 Learn by doing – start building circuits and programming
your Arduino with a few easy examples – right away! HOW TO FIX YOUR PC PROBLEMS WINDOWS 8.1 EXPLAINED
Robert Penfold Noel Kantaris
 Easy does it – work through Arduino sketches line by
line, and learn how they work and how to write your own. 128 pages Order code BP705 £8.49 180 Pages Order code BP747 £10.99

 Solder on! – don’t know a soldering iron from a curling COMPUTING WITH A LAPTOP FOR THE OLDER
AN INTRODUCTION TO WINDOWS VISTA
iron? No problem! You’ll learn the basics and be prototyp- P.R.M. Oliver and N. Kantarris GENERATION
ing in no time. Robert Penfold
 Kitted out – discover new and interesting hardware to 120 pages Order code BP703 £8.49
120 pages Order code BP702 £8.49
turn your Arduino into anything from a mobile phone to a
Geiger counter. WINDOWS 8.1 EXPLAINED AN INTRODUCTION TO EXCEL SPREADSHEETS
 Become an Arduino savant – find out about functions, Jim Gatenby
arrays, libraries, shields and other tools that let you take 180 Pages Order code BP747 £10.99
your Arduino project to the next level 18 pages Order code BP701 £8.49
AN INTRODUCTION TO THE NEXUS 7
 Get social – teach your Arduino to communicate with KINDLE FIRE HDX EXPLAINED
software running on a computer to link the physical world 118 Pages Order code BP744 £8.99
with the virtual world
118 Pages Order code BP743 £8.99
438 Pages Order code ARDDUM01 £19.99

AUDIO & VIDEO


VALVE AMPLIFIERS – 4th Ed BUILDING VALVE AMPLIFIERS
Morgan Jones Morgan Jones

288 pages Order code ELSEV33 £46.99 368 pages Order code NE40 £29.00

RASPBERRY PI
EXPLORING ARDUINO RASPBERRY Pi FOR DUMMIES
Jeremy Blum Sean McManus and Mike Cook
Arduino can take you anywhere. This book is the roadmap. Write games, compose and play music, even explore electronics – it’s easy as Pi! The Rasp-
Exploring Arduino shows how to use the world’s most berry Pi offers a plateful of opportunities, and this great resource guides you step-by-step, from
popular microcontroller to create cool, practical, artistic downloading, copying, and installing the software to learning about Linux and finding cool new
and educational projects. Through lessons in electrical programs for work, photo editing, and music. You’ll discover how to write your own Raspberry
engineering, programming and human-computer interaction, Pi programs, create fun games, and much more!
this book walks you through specific, increasingly complex Open this book and find:
projects, all the while providing best practices that you can What you can do with Python; Ways to use the Raspberry Pi as a productivity tool; How to
apply to your own projects once you’ve mastered these. surf the web and manage files; Secrets of Sonic Pi music programming; A guide to creating
You’ll acquire valuable skills – and have a whole lot of fun. animations and arcade games; Fun electronic games you can build; How to build a 3D maze in
 Explore the features of commonly used Arduino boards Minecraft; How to play music and videos on your Raspberry Pi.

 Use Arduino to control simple tasks or complex electronics


400 Pages Order code RPiDUM01 £17.99
 Learn principles of system design, programming and
electrical engineering
RASPBERRY Pi MANUAL: A practical guide to the PROGRAMMING THE RASPBERRY Pi
 Discover code snippets, best practices and system
revolutionary small computer
schematics you can apply to your original projects 192 pages Order code MGH4 £10.99
 Master skills you can use for engineering endeavours
176 pages Order code H001 £17.99
in other fields and with different platforms
RASPBERRY Pi USER-GUIDE – 4th Ed GETTING STARTED WITH RASPBERRY Pi
357 Pages Order code EXPARD01 £26.99 262 pages Order code JW001 £20.90 164 pages Order code OR01 £11.50

74 Practical Electronics | September | 2019


TEACH-IN BOOKS
ELECTRONICS TEACH-IN 7
ELECTRONICS TEACH-IN 6 ELECTRONICS TEACH-IN 8
(Includes free CD-ROM)

EE OM EE M
FR -R FR -RO EE M
D
£8.99
CD
£8.99 FR RO £8.99
DV -
ELECTRONI CS FROM THE PUBLISHERS OF
ELECTRONI CS FROM THE PUBLISHERS OF
CD
ELECTRONI CS
TEACH-I N 6 TEACH-I N 7 TEACH-I N 8
FREE
CD-ROM
SOFTWARE
FOR
THE TEACH-IN
8
FROM THE PUBLISHERS OF SERIES
RASPBERRY Pi ® DISCRETE LINEAR CIRCUIT DESIGN
A COMPREHENSIVE GUIDE TO RASPBERRY Pi • Understand linear circuit design INTRODUCING THE ARDUINO
• Pi PROJECT – SOMETHING TO BUILD • Design simple, but elegant circuits • Hardware – learn about components and circuits
• Pi CLASS – SPECIFIC LEARNING AIMS • Learn with ‘TINA’ – modern CAD software • Programming – powerful integrated development system
• PYTHON QUICKSTART – SPECIFIC PROGRAMMING TOPICS • Five projects to build: Pre-amp, Headphone Amp, • Microcontrollers – understand control operations
• Pi WORLD – ACCESSORIES, BOOKS ETC Tone Control, VU-meter, High Performance Audio Power Amp • Communications – connect to PCs and other Arduinos
• HOME BAKING – FOLLOW-UP ACTIVITIES
FREE
OM
DVD-R
ALL THE
RE
SOFTWA
IN 6
FREE M
TEACH- -RO
CD CIRCUIT
FOR THE RRY Pi
RASPBE ALL THE
RE FOR
SERIES SOFTWA 7
CH-IN
THE TEA
SERIES

PLUS
Pi B+ UPDATE PLUS...
INTERFACE – a series of AUDIO OUT
ten Pi related features An analogue expert’s take
on specialist circuits PLUS...
REVIEWS – Optically PIC n’MIX
isolated ADC and I/O PRACTICALLY SPEAKING PICs and the PICkit 3 - A beginners
The techniques of project
interface boards guide. The why and how to build
building
PIC-based projects

ONLY AVAILABLE ON CD-ROM RUNNING LOW – ORDER NOW! ONLY AVAILABLE ON CD-ROM
ELECTRONICS TEACH-IN 6 ELECTRONICS TEACH-IN 7 ELECTRONICS TEACH-IN 8
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; Programming
provides a complete introduction to the Raspberry Pi, analogue electronic circuits. Ideal for everyone interested in – powerful integrated development system; Microcontrollers –
the low-cost computer that has taken the education and electronics as a hobby and for those studying technology at understand control operations; Communications – connect to
computing world by storm. schools and colleges. Supplied with a free cover-mounted PCs and other Arduinos
This latest book in our Teach-In series will appeal to CD-ROM containing all the circuit software for the course, This exciting series has been designed for electronics
electronic enthusiasts and computer buffs wanting to get to plus demo CAD software for use with the Teach-In series enthusiasts who want to get to grips with the inexpensive,
grips with the Raspberry Pi. Discrete Linear Circuit Design* Understand linear circuit immensely popular Arduino microcontroller, as well as coding
Anyone considering what to do with their Pi, or maybe design* Learn with ‘TINA’ – modern CAD software* Design enthusiasts who want to explore hardware and interfacing.
they have an idea for a project but don’t know how to simple, but elegant circuits* Five projects to build: Pre- Teach-In 8 will provide a one-stop source of ideas and prac-
turn it into reality, will find Teach-In 6 invaluable. It covers: amp, Headphone Amp, Tone Control, VU-meter, High tical information.
Programming, Hardware, Communications, Pi Projects, Pi Performance Audio Power Amp. The Arduino offers a remarkably effective platform for
Class, Python Quickstart, Pi World, and Home Baking. PLUS developing a huge variety of projects; from operating a set
of Christmas tree lights to remotely controlling a robotic
The CD-ROM also contains all the necessary software for Audio Out – an analogue expert’s take on specialist circuits
vehicle through wireless or the Internet. Teach-In 8 is based
the series so that readers can get started quickly and easily Practically Speaking – the techniques of project building
with the projects and ideas covered. around a series of practical projects with plenty of informa-
tion to customise each project.
160 Pages Order code ETI6 £8.99 160 Pages Order code ETI7 £8.99 This book also includes PIC n’ Mix: PICs and the PICkit 3 -
A Beginners guide by Mike O’Keefe and Circuit Surgery by
Ian Bell - State Machines part 1 and 2.
The CD-ROM includes files for Teach-In 8 plus Microchip

VISIT OUR WEBSITE FOR MORE BOOKS MPLAB IDE XC8 8-bit Compiler and PICkit 3 User Guide.
Also included is Lab-Nation Smartscope software.

AND FAST, EASY ONLINE ORDERING 160 Pages Order code ETI8 £8.99

[Link]

THE BASIC
BOOK ORDER FORM SOLDERING
Full name: ....................................................................................................................................... GUIDE
Address: .......................................................................................................................................... LEARN TO SOLDER
SUCCESSFULLY!
ALAN WINSTANLEY
.........................................................................................................................................................
The No.1 resource for
learning all the basic
.............................................. Post code: ........................... Telephone No: .................................... aspects of electronics
soldering by hand.
Email: .............................................................................................................................................. With more than 80 high quality colour photographs,
this book explains the correct choice of soldering
 I enclose cheque/PO payable to Practical Electronics for £ ......................................................... irons, solder, fluxes and tools. The techniques of
how to solder and desolder electronic components
are then explained in a clear, friendly and non-
 Please charge my card £ ....................................... Card expiry date......................................... technical fashion so you’ll be soldering successfully
in next to no time! The book also includes sections
Card Number ..................................................................................... on reflow soldering and desoldering techniques,
potential hazards, useful resources and a very
Valid From Date ................ Card Security Code ............... (The last three digits on or just below the signature strip) useful troubleshooting guide.
Also ideal for those approaching electronics
Please send book order codes: ....................................................................................................... from other industries, the Basic Soldering Guide
Handbook is the best resource of its type, and
thanks to its excellent colour photography and
......................................................................................................................................................... crystal clear text, the art of soldering can now be
learned by everyone!
..........................................................................................................................................................
Please continue on separate sheet of paper if necessary 86 Pages Order code AW1 £9.99

Practical Electronics | September | 2019 75


Electronic Building Blocks
By Julian Edgar

Quick and easy construction Great results on a low budget

Three clocks
T
hroughout the ages, people On the back is a large Atmel micro-
have always had a fascination with controller, a piezo buzzer, a crystal
time – and mechanisms that dis- and three buttons. A holder is also
play it. This month, let’s take a look at provided for the CR2032 battery (not
three different clocks. supplied) that’s required to maintain
the time if power is lost. A USB pow-
Rotating LED Clock er supply cable is provided – ie, the
This clock module is available prebuilt clock requires a 5V supply.
or in kit form and costs about £5 (and To put it mildly, the provided instruc-
up), delivered. To find it, search on tions are terrible. However, if you play
eBay under ‘Rotating DIY DS1302 LED around long enough with the buttons,
Electronic Digital Clock Kit 51 SCM you’ll find you can set the year, month
Learning Board 5V’. Note that there and day (US style – with month first
seem to be two varieties – one with then day), hours and minutes. You can
surface-mount LEDs (Fig.1) and an- apparently also set an alarm, but I nev-
other with through-hole LEDs. Which er figured out how to do that. Fig.2. The Rotating Clock LEDs are bright
you choose is up to you, but the SMD The real fun with the clock is that and easily read from a distance. The mod-
version is generally pricier. you can make the outer ring of LEDs ule comes as a kit or prebuilt and costs
The clock comprises a PCB that’s work in all sorts of ways. By pressing from £5, delivered.
81mm square. Around the outside are the ‘plus’ key (not the ‘mode’ key as
located 60 LEDs, indicating seconds. you might assume) you can have an- sits upright on these spacers, making
Every fifth increment is red; the oth- ything from ‘mild’ (seconds counted it easy to place on a flat surface. The
er LEDs are green. Also sited on the by a green LED that moves around the LEDs are bright and can be easily read
front face is a 4-digit, red LED display circle) to ‘wild’ (all the LEDs pulsing from across a room.
that’s 14mm high, plus assorted sur- at high frequency). I went for the LED As I say, playing longer with the con-
face-mount components. mode that’s closest to a second hand trols may yield further functions that I
moving around the display.
The main LED numerical display
shows hours and minutes (hours in
24-hour time), and then periodical-
ly shows year, day of the month and
month. Room temperature is then
shown, before the display reverts back
to time.
On the hour, the buzzer sounds (quiet-
ly, if you leave the protective sticker on)
and the outside LEDs do a fancy dance.
You could mount the PCB in a box
with a translucent front panel, but I
think the style and approach of the
Fig.1. The rotating LED clock in its night
glory. The 60 LEDs around the periphery can module best lends itself to a desk or
be programmed with different functions. workshop clock for a tech person (ie, Fig.3. The rear of the Rotating LED Clock
Here, a red LED is showing every 5-second you!), where all the electronics are left shows the optional CR2032 battery back-
increment, and a green LED moves around on display. The PCB is provided with up. The clock is normally powered via a
like a second hand. long spacers and the clock module 5V USB supply.

76 Practical Electronics | September | 2019


n ne of the individual LEDs is re-
O
versed in polarity over its three
brothers. The PCB overlay is cor-
rect, but it initially looks odd
n T
he 7805 regulator looks just the
same at a glance as the six 8550 tran-
sistors, so don’t get them mixed up
n T
he battery holder mounts so its lug
is placed closest to the LED displays.

After the clock has been constructed


and powered-up, pressing the sin-
gle button for a long period puts the
clock into ‘setting’ mode, and then it’s
straightforward to set the hours and
minutes. The seconds doesn’t appear
to be able to be set, so if you want this
accurate, power up the clock just as
the minute ticks over (it starts count-
ing from zero).
I wouldn’t give this kit to someone
who has never built one before, but as
a second or third kit, it would be ideal.

Fig.4. This clock comes as a kit. It has only one function – showing the time – but the kit Universal Timer Module
is easily constructed and uses battery back-up. It’s a great choice for a beginner. To round off this month, Fig.5 shows
an interesting universal timer mod-
didn’t find, but just limiting it to those The PCB is 90 × 70mm and uses three ule – but why is it in a column about
that I did find, I thought it a fun bit of two-digit LED displays, each 10mm clocks? Well, the LED display can be
gear. Perched on my desk, it attracted high. Between the numerical displays, set to show real time, and this is main-
a lot of comment! non-flashing colons are formed by in- tained via battery back-up even when
dividual LEDs. (All LEDs are red.) The power is lost. Therefore, rather than
LED Kit Clock supply voltage is 6V to 12V; and, as just being a timer module, it’s a ‘re-
The next clock module is sold as a kit with the previous module, back-up al-time’ timer.
– and a very cheap one too (see Fig.4). of the user-programmed time is via a The module works off any supply
It will cost you under £3, delivered. CR2032 battery (not supplied). voltage from 5-60V and has a relay
To find it, search eBay under ‘DIY Kit The time display is in 24-hour time, output. You will need to provide the
Module 9V-12V AT89C2051 6 Digital but no other functions (eg, date, year, CR1220 battery for time back-up.
LED Electronic Clock Parts 9UK’ (eg, temperature, alarm) are provided. Space doesn’t allow a full description
eBay item 141971072785, £2.41 deliv- The board overlay is clear and the of all the functions, but the module can
ered at the time of writing). Compared solder pads of a decent size, and not operate the relay for a defined period
with the previous clock, it’s a bit ‘plain placed too close together. When as- daily, on a specific day of the week, or
Jane’, but it’s also a quite straightfor- sembling the kit, do note these points: on a specific day of the month.
ward kit to construct, and that makes n Install the three wire links first, The time can be continuously dis-
it potentially a good fit for beginners as one is placed under one of the played or can be switched off in a
or schools. two-digit displays battery-saving mode, and the on-board
buzzer can sound when the relay op-
erates, or it can be deactivated.
Find the module on Banggood (ID:
1314176) for just under £5, delivered.

Next month
In the October issue, I’ll look at a varie-
ty of items that are suitable for use with
your car. However, even if you’re not
interested in automotive electronics,
all the products also have non-auto-
motive uses.

Fig.5. This module integrates a real-time clock with a programmable relay output. Timed
periods can be set for activation on a daily, weekly or monthly basis.

Practical Electronics | September | 2019 77


Practical Electronics PCB SERVICE
PROJECT CODE PRICE PROJECT CODE PRICE
NOVEM BER 2 0 17 APRIL 2019
50A Battery Charger Controller ......................................... 11111161 £12.88 Heater Controller ............................................................... 10104181 £14.00
Micropower LED Flasher (45 × 47mm) ......................... 16109161 £8.00
(36 × 13mm) ......................... 16109162 £5.60 MAY 2019
2× 12V Battery Balancer ................................................... 14106181 £5.60
Phono Input Converter ...................................................... 01111161 £8.00
Deluxe Frequency Switch .................................................. 05104181 £10.45
DECEMBER 2017 USB Port Protector ............................................................ 07105181 £5.60
Precision Voltage and Current Reference – Part 2............ 04110161 £15.35
JUNE 2019
JANUARY 2018 Arduino-based LC Meter ................................................... 04106181 £8.00
High-Power DC Motor Speed Controller – Part 1 .............. 11112161 £12.88
USB Flexitimer................................................................... 19106181 £10.45
Build the SC200 Ampliier Module ..................................... 01108161 £12.88
JULY 2019
FEBRUARY 2018
GPS-Syncronised Analogue Clock Driver ......................... 04202171 £12.88 Full-wave 10A Universal Motor Speed Controller .............. 10102181 £12.90
High-Power DC Motor Speed Controller – Part 2 Recurring Event Reminder ................................................ 19107181 £8.00
+ Control Board ................................................... 11112161 £12.88 Temperature Switch Mk2 ................................................... 05105181 £10.45
+ Power Board .................................................... 11112162 £15.30
AUGUST 2019
MARCH 2018 Brainwave Monitor ............................................................. 25108181 £12.90
Stationmaster Main Board ................................................. 09103171 £17.75 Super Digital Sound Effects Module .................................. 01107181 £5.60
+ Controller Board .............................................. 09103172
Build the SC200 Ampliier Module – Power Supply 01109111 £16.45 Watchdog Alarm ................................................................ 03107181 £8.00
PE Theremin (three boards: pitch, volume, VCA) ............. PETX0819 £19.50
APRIL 2018 PE Theremin component pack (see p.56, August 2019) ... PETY0819 £15.00
Spring Reverberation Unit ................................................. 01104171 £15.30
DDS Sig Gen Lid ............................................................... Black £8.05
DDS Sig Gen Lid ............................................................... Blue £7.05
DDS Sig Gen Lid ............................................................... Clear £8.05

MAY 2018 PE/EPE PCB SERVICE


High Performance RF Prescaler........................................ 04112162 £10.45
Micromite BackPack V2..................................................... 07104171 £10.45 Order Code Project Quantity Price
Microbridge ........................................................................ 24104171 £5.60
.........................................................
JUNE 2018
High Performance 10-Octave Stereo Graphic Equaliser ... 01105171 £15.30 .........................................................

JULY 2018 .........................................................


Touchscreen Appliance Energy Meter – Part 1 ................. 04116061 £17.75
Automotive Sensor Modiier .............................................. 05111161 £12.88 .........................................................

AUGUST 2018 .........................................................


Universal Temperature Alarm ............................................ 03105161 £7.05
Power Supply For Battery-Operated Valve Radios ........... 18108171 Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18108172
£27.50
18108173 Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18108174
.........................................................
SEPTEMBER 2018
3-Way Active Crossover .................................................... 01108171 £22.60 Tel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ultra-low-voltage Mini LED Flasher ................................... 16110161 £5.60
Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCTOBER 2018 I enclose payment of £ . . . . . . . . . . . . . . (cheque/PO in £ sterling only)
6GHz+ Touchscreen Frequency Counter .......................... 04110171 £12.88
Two 230VAC MainsTimers ................................................ 10108161 payable to: Practical Electronics
£12.88
10108162
NOVEMBER 2018 Card No . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Super-7 AM Radio Receiver .............................................. 06111171 £27.50

FEBRUARY 2019
Valid From . . . . . . . . . . . . . . . . . Expiry Date . . . . . . . . . . . . . . . .
1.5kW Induction Motor Speed Controller........................... 10105122 £35.00 Card Security No . . . . . . . . . .
MARCH 2019
10-LED Bargraph Main Board ........................................... 04101181 £11.25 You can also order PCBs by phone, Fax, Email or via the
+Processing Board ............................................. 04101182 £8.60 shop on our website on a secure server: [Link]

PCBs for most recent PE/EPE constructional projects are available. All prices include VAT and UK p&p. Add £2 per board for airmail outside
From the July 2013 issue onwards, PCBs with eight-digit codes have silk of Europe. Orders and payment should be sent to:
screen overlays and, where applicable, are double-sided, plated-through Practical Electronics, Wimborne Publishing Ltd
hole, with solder mask. They are similar to photos in the project articles. 113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU
Earlier PCBs are likely to be more basic and may not include silk screen Tel 01202 880299 Fax 01202 843233
overlay, be single-sided, lack plated-through holes and solder mask. Email: [Link]@[Link]
Always check price and availability in the latest issue or online. A large On-line Shop: [Link]
number of older boards are listed for ordering on our website. Cheques should be made payable to Practical Electronics (Payment
We do not supply kits or components for our projects. For older in £ sterling only).
projects it is important to check the availability of all components NOTE: While 95% of our boards are held in stock and are dispatched
before purchasing PCBs. within seven days of receipt of order, please allow a maximum of 28 days
Back issues of articles are available – see Back Issues page for details. for delivery if we need to restock.

78 Practical Electronics | September | 2019


CLASSIFIED ADVERTISING

Practical
Electronics
If you want your advertisements to be seen by the largest readership at
the most economical price our classified page offers excellent value. Practical Electronics
The rate for semi-display space is £10 (+VAT) per centimetre high, with reaches more UK
a minimum height of 2·5cm. All semi-display adverts have a width of readers than any other
5.5cm. The prepaid rate for classified adverts is 40p (+VAT) per word UK monthly hobby
(minimum 12 words).
electronics magazine.
Cheques are made payable to Practical Electronics. VAT must be added.
Our sales figures prove it.
Advertisements with remittance should be sent to: Practical Electronics,
113 Lynwood Drive, Wimborne, Dorset, BH21 1UU. We have been the leading
Tel 01202 880299 Email: [Link]@[Link] monthly magazine in
For rates and further information on display and classified advertising this market for the last
please contact our Advertisement Manager, Stewart Kearn – see below. twenty-seven years.
Unit 10, Boythorpe Business Park, Dock Walk, Chesterield,

Send large letter stamp for Catalogue

BOWOOD ELECTRONICS LTD The British Amateur Electronic Club at:


Suppliers of Electronic Components [Link] COAST ELECTRONICS
[Link] Has many interesting articles on BREAKOUTS-COMPONENTS-
Unit 10, Boythorpe Business Park, Dock Walk, Chesterield, computers; digital electronics CONTRACT DESIGN-3D PRINTER PARTS-
Derbyshire S40 2QR. Sales: 01246 200 222 and analogue electronics. MUSICAL-MICROCONTROLLERS
Send large letter stamp for Catalogue [Link]

MISCELLANEOUS Andrew Kenny – Qualified Patent Agent


EPO UKIPO USPTO
Circuits Electric Machinery Mechatronics
PIC DEVELOPMENT KITS, DTMF kits VALVES AND ALLIED COMPONENTS
and modules, CTCSS Encoder and IN STOCK. Phone for free list. Valves, Web: [Link]
Decoder/Display kits. books and magazines wanted. Geoff Email: Enquiries@[Link]
Tel: 0789 606 9725
Visit [Link] Davies (Radio), tel. 01788 574774.

ADVERTISING INDEX
CRICKLEWOOD ELECTRONICS . . . . . . . . . . . . . . . . . . . .69 Advertisement offices
ESR ELECTRONIC COMPONENTS . . . . . . . . . . . . . . . . . .69 Wimborne Publishing Ltd
HAMMOND ELECTRONICS Ltd . . . . . . . . . . . . . . . . . . . . . .8 113 Lynwood Drive
JPG ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 Merley
LASER BUSINESS SYSTEMS . . . . . . . . . . . . . . . . . . . . . .41 Wimborne,
MICROCHIP . . . . . . . . . . . . . . . . . . . .Cover (ii), Cover (iii) & 5 Dorset BH21 1UU
PEAK ELECTRONIC DESIGN. . . . . . . . . . . . . . . . . Cover (iv) Tel 01202 880299
POLABS D.O.O.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 Fax 01202 843233
QUASAR ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Email [Link]@[Link]
SOUNDTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Web [Link]
STEWART OF READING. . . . . . . . . . . . . . . . . . . . . . . . . . . .9
TAG-CONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 For editorial contact details see page 7.

Practical Electronics | September | 2019 79


Next Month – in the October issue
Opto-Isolated Mains Relay
Keep the bitey bits out of harm’s way! If you need to switch mains voltages, say
from a micro’s output or any other low-voltage source, you need to isolate them,
which is precisely what this project does.

GPS-synced Frequency Reference


This lab-quality programmable design is perfect for critical tasks when a really
accurate and stable frequency reference is needed. Chances are, whatever frequency
you require, this Micromite-BackPack-based project can provide it. Exactly!

Digital Command Control Programmer for Decoders


DCC – Digital Command Control – is a widely used method for controlling
model railways, especially when running multiple locos/trains on the same
track(s). This USB DCC programmer is simple, cheap and easy to build.

Audio Out
Next month, more essential loudspeaker groundwork, with a focus on
crossover options for our superb LS3/5A mini-monitor project.

Make it with Micromite


Explore some of MMBASIC’s graphical features, and step through the code of
the Mini MKC Clock program to understand exactly how it works.

PLUS!
All your favourite regular columns from Cool Beans, Circuit Surgery
and Electronic Building Blocks to Techno Talk and Net Work. On sale 5 September 2019
Content may be subject to change

Welcome to JPG Electronics Calling all subscribers!


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 If you are one of our valued subscribers then
• DJ Equipment, Lighting & Supplies
• Extensive Electronic Components
please note that we have changed the way
- ICs, Project Boxes, Relays & Resistors we send subscription renewal reminders.
• Raspberry Pi & Arduino Products Instead of sending you a renewal card, we
• Replacement Laptop Power Supplies
• Batteries, Fuses, Glue, Tools & Lots more...
now print a box on the address sheet that
comes with your copy of Practical Electronics.
T: 01246 211 202 This box will advise you of the last issue of
E: sales@[Link] your current subscription.
JPG Electronics, Shaw’s Row,
Old Road, Chesterfield, S40 2RB To renew, you have three easy choices:
W: [Link] 1. Call us on: 01202 880299
2. Visit our website at: [Link]
Shaw’s Row

JPG Electronics
Britannia Maison Mes Amis
Inn
Old Road
3. Send a cheque with your details to:
ad

Rose & Crown


Johnsons
all Ro

Roa
d Electron Publishing Limited
Old H

orth
Cha
tsw
Morrisons 113 Lynwood Drive
Sparks Wimborne
Retail & Trade Welcome • Free Parking • Google St View Tour: S40 2RB Dorset BH21 1UU
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: £25.00 (6 months); £47.00 (12 months); £89.00 (2 years). EUROPE: airmail service, £30.00 (6 months); £56.00 (12 months);
£107.00 (2 years). REST OF THE WORLD: airmail service, £37.00 (6 months); £70.00 (12 months); £135.00 (2 years). Payments payable to ‘Practical Electronics’, Electron Publishing Limited, 113 Lynwood Drive,
Wimborne, Dorset BH21 1UU. Email: [Link]@[Link]. 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.

80 Practical Electronics | September | 2019


Development Tool
of the Month!
MPLAB® ICD 4 In-circuit Debugger

Part Number
DV164045

Overview: Key Features:


The new MPLAB® ICD 4 introduces a faster processor Supports many PIC® MCUs and dsPIC® DSCs
and increased RAM to deliver up to twice the speed x2 faster than MPLAB® ICD 3
of ICD 3 for the in-circuit debugging of PIC® MCUs
Reduced wait time improves debugging
(microcontrollers) and dsPIC® digital signal controllers. productivity
ICD 4 also introduces a wider target voltage range Simplifies migration between PIC® MCUs
and an optional 1 A of power via an external power High-performance 32-bit MCU core
supply. For maximum flexibility, MPLAB® ICD 4 Increased RAM provides 2 MB of buffer memory
features a selectable pull-up/pull-down option to the Wider target supply voltage: 1.20 to 5.5 V
target interface and programmable adjustment of Optional external power supply for 1A of power
debugging speed for greater productivity.
Programmable adjustment of debugging speed

Order Your MPLAB® ICD 4 In-circuit Debugger Today!

The Microchip name and logo, PIC and MPLAB are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
All other trademarks mentioned herein are the property of their respective companies.
© 2019 Microchip Technology Inc. All rights reserved. MEC2298-ENG-07-19

You might also like