You are on page 1of 77

WIN O

NE
OF 10
MICRO
MPLAB CHIP
Xp
Evalua ress
tion
LOW-COST REFERENCE
Boards

Reference for voltage, current and even resistance!


Ultra compact and accurate
Cheap and easy to build
Calibrate your DMM

DRIVEWAY MONITOR PART 2


Build, test and install your very own gatekeeper

USB POWER MONITOR


Plug n measure

EPE SUMMER SALE


Check out our latest offers on page 5 in this issue

TEACH-IN 2016 INTRODUCING THE ARDUINO


Part 7: Arduino Nano

PRACTICALLY SPEAKING, NET WORK, AUGUST 2016 4.40


PIC n MIX, COOL BEANS, CIRCUIT SURGERY,
TECHNO TALK & AUDIO OUT

AUG 2016 Cover .indd 1 24/06/2016 12:36


Development Tool
of the Month!
PICkit 3 In-Circuit Debugger

Part Number
PG164130

Overview: Key Features:


Microchips PICkit 3 In-Circuit Debugger/Programmer USB (Full speed 12 Mbits/s interface to host PC)
uses in-circuit debugging logic incorporated into Real-time execution
each chip with Flash memory to provide a low-cost
Built-in over-voltage/short circuit monitor
hardware debugger and programmer, allowing
Supports low voltage to 2.0 volts
debugging and programming of PIC MCU and
(2.0v to 6.0v range)
dsPIC DSC microcontrollers using the powerful
Diagnostic LEDs (power, busy, error)
graphical user interface of the MPLAB X Integrated
Development Environment (IDE). The PICkit 3 is
Read/write program and data memory of
microcontroller
connected to the design engineers PC using a full
speed USB interface and can be connected to the
Erase of program memory space with verification
target via a Microchip debug (RJ-11) connector. Freeze-peripherals at breakpoint

Order Your PICkit 3 In-Circuit Debugger Today at:


www.microchipdirect.com

microchip
DIRECT
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.
2016 Microchip Technology Inc. All rights reserved. MEC2077Eng06/16

JULY 2016 Page IFC.indd 1 24/06/2016 12:42


ISSN 0262 3617
PROJECTS THEORY
NEWS COMMENT
POPULAR FEATURES INCORPORATING ELECTRONICS TODAY INTERNATIONAL

VOL. 45. No 8 August 2016


www.epemag.com

Projects and Circuits


LOW-COST, ACCURATE VOLTAGE/CURRENT/RESISTANCE REFERENCE 12
by Nicholas Vinen
Inexpensive and easy-to-build circuit to help you calibrate meters and circuits
CHECKING AND CALIBRATING MULTIMETERS 17
by Nicholas Vinen
How to use our Reference to check your multimeter and if necessary, precisely
calibrate it on DC voltage, current and resistance
DRIVEWAY MONITOR PART 2 20
by John Clarke
How to build, test and install your Driveway Monitor
USB POWER MONITOR 30
by Nicholas Vinen
This elegant and compact design enables you to measure the power
consumption of USB devices and peripherals

Series and Features


TECHNO TALK by Mark Nelson 11
Radio astrology is not nonsense
TEACH-IN 2016 EXPLORING THE ARDUINO 38
by Mike and Richard Tooley
Part 7: Arduino Nano
PIC n MIX by Mike OKeeffe 45
PICs and the PICkit 3: A beginners guide Part 3
NET WORK by Alan Winstanley 48
Birthday greetings... Cold War baby... Instant messages... In the Ether
Mail on the move... The rise of ISPs... EPE steps online... Spinning a web
INTERFACE by Robert Penfold 51
Capacitance Meter Mk2
CIRCUIT SURGERY by Ian Bell 54
Ammeters and voltmeters
AUDIO OUT by Jake Rothman 60
Super-simple retro amp-speaker combo Part 2
MAXS COOL BEANS by Max The Magnificent 68
Profligate with power Is that the time?... Not quite so straightforward

Regulars and Services


SUBSCRIBE TO EPE and save money 4
EPE SUMMER SALE 5
EDITORIAL 7
Happy Birthday Net Work!
NEWS Barry Fox highlights technologys leading edge 8
Plus everyday news from the world of electronics
MICROCHIP READER OFFER 29
EPE Exclusive Win one of 10 Microchip MPLAB Xpress Evaluation Boards
DIRECT BOOK SERVICE 58
A wide range of technical books available by mail order, plus more CD-ROMs
EPE CD ROMS FOR ELECTRONICS 64
A wide range of CD-ROMs for hobbyists, students and engineers
EPE BACK ISSUES CD-ROM 66
Wimborne Publishing Ltd 2016. Copyright in all EPE PCB SERVICE 70
drawings, photographs and articles published in PCBs for EPE projects
EVERYDAY PRACTICAL ELECTRONICS is fully ADVERTISERS INDEX 71
protected, and reproduction or imitations in whole or
NEXT MONTH! Highlights of next months EPE 72
in part are expressly forbidden.

Our September 2016 issue will be published on Readers Services Editorial and Advertisement Departments 7
Thursday 4 August 2016, see page 72 for details.

Everyday Practical Electronics, August 2016 1

Contents (MP 1st & SK) -AUGUST 2016.indd 1 27/06/2016 12:25


All prices INCLUDE 20.0% VAT. Free UK delivery on orders over 35
Quasar Electronics Limited Postage & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7 Day
PO Box 6935, Bishops Stortford Delivery - 3.95; UK Mainland Next Day Delivery - 8.95; Europe (EU) -
CM23 4WP, United Kingdom 12.95; Rest of World - 14.95 (up to 0.5Kg).
Tel: 01279 467799 Order online for reduced price Postage (from just 3)
Fax: 01279 267799 Payment: We accept all major credit/debit cards. Make POs payable to
Quasar Electronics Limited.
E-mail: sales@quasarelectronics.co.uk Please visit our online shop now for full details of over 1000 electronic kits,
Web: www.quasarelectronics.co.uk projects, modules and publications. Discounts for bulk quantities.

Card Sales
& Enquiries

Solutions for Home, Education & Industry Since 1993

PIC Programmer & Experimenter Board 4-Ch DTMF Telephone Relay Switcher
PIC & ATMEL Programmers PIC Programmer & Experi- Call your phone num-
menter Board with test ber using a DTMF
We have a wide range of low cost PIC and
buttons and LED indicators phone from anywhere
ATMEL Programmers. Complete range and
to carry out educational in the world and re-
documentation available from our web site.
experiments such as the motely turn on/off any
Programmer Accessories: supplied programming examples. Includes a of the 4 relays as de-
40-pin Wide ZIF socket (ZIF40W) 9.95 16F627 Flash Microcontroller that can be sired. User settable Security Password, Anti-
18Vdc Power supply (661.121UK) 19.96 reprogrammed up to 1000 times. Software to Tamper, Rings to Answer, Auto Hang-up and
Leads: Parallel (LDC136) 2.56 | Serial compile and program your source code is Lockout. Includes plastic case. 130 x 110 x
(LDC441) 2.75 | USB (LDC644) 2.14 included. Supply: 12-15Vdc. 30mm. Power: 12Vdc.
Kit Order Code: K8048 - 29.58 21.54 Kit Order Code: 3140KT - 79.95
USB & Serial Port PIC Programmer Assembled Order Code: VM111 - 38.88 Assembled Order Code: AS3140 - 94.95
USB or Serial connection.
Header cable for ICSP. 8-Ch Serial Port Isolated I/O Relay Module
Computer controlled 8
Free Windows software. Controllers & Loggers channel relay board. 5A
See website for PICs sup-
ported. ZIF Socket & USB Here are just a few of the controller and mains rated relay outputs
lead extra. 16-18Vdc. data acquisition and control units we have. and 4 opto-isolated digital
Kit Order Code: 3149EKT - 49.96 23.95 See website for full details. 12Vdc PSU for inputs (for monitoring
Assembled Order Code: AS3149E - 38.95 all units: Order Code 660.446UK 10.68 switch states, etc). Useful
Assembled with ZIF socket Order Code: in a variety of control and
AS3149EZIF - 74.96 48.95 USB Experiment Interface Board sensing applications. Programmed via serial
Updated Version! 5 digi- port (use our new Windows interface, termi-
USB PIC Programmer and Tutor Board tal inputs, 8 digital outputs nal emulator or batch files). Serial cable can
This tutorial project plus two analogue inputs be up to 35m long. Includes plastic case
board is all you need and two analogue out- 130x100x30mm. Power: 12Vdc/500mA.
to take your first steps puts. 8 bit resolution. DLL. Kit Order Code: 3108KT - 74.95
into Microchip PIC Kit Order Code: K8055N - 39.95 22.74 Assembled Order Code: AS3108 - 89.95
programming using a Assembled Order Code: VM110N - 39.95
PIC16F882 (included). Later you can use it Infrared RC 12Channel Relay Board
for more advanced programming. It programs 2-Channel High Current UHF RC Set Control 12 onboard relays
all the devices a Microchip PICKIT2 can! State-of-the-art high securi- with included infrared remote
You can use the free Microchip tools for the ty. Momentary or latching control unit. Toggle or mo-
PICKit2 and the MPLAB IDE environment. relay outputs rated to switch mentary. 15m+ range. 112 x
Order Code: EDU10 - 46.74 up to 240Vac @ 10 Amps. 122mm. Supply: 12Vdc/0.5A
Range up to 40m. 15 Txs Kit Order Code: 3142KT - 64.96 51.96
ATMEL 89xxxx Programmer can be learnt by one Rx (kit Assembled Order Code: AS3142 - 61.96
Uses serial port and any includes one Tx but more
standard terminal comms available separately). Supply 9-15Vdc. Audio DTMF Decoder and Display
program. 4 LEDs display Kit Order Code: 8157KT - 44.95 Detect DTMF tones from
the status. ZIF sockets Assembled Order Code: AS8157 - 49.96 telephone handsets, tape
not included. 16Vdc. recorders, receivers, two-
Kit Order Code: 3123KT - 32.95 21.95 Computer Temperature Data Logger way radios, etc using the
Assembled ZIF: AS3123ZIF- 48.96 37.96 Serial port 4-channel temper- built-in mic or direct from
ature logger. C or F. Con- the phone line. Charac-
Introduction to PIC Programming tinuously logs up to 4 sepa- ters are displayed on a 16 character display
Go from complete beginner rate sensors located 200m+ as they are received and up to 32 numbers
to burning a PIC and writing from board. Wide range of can be displayed by scrolling the display. All
code in no time! Includes 49 free software applications for data written to the LCD is also sent to a serial
page step-by-step PDF storing/using data. PCB just 45x45mm. Pow- output for connection to a computer. Supply:
Tutorial Manual + Program- ered by PC. Includes one DS1820 sensor. 9-12V DC. Main PCB: 55x95mm.
ming Hardware (with LED Kit Order Code: 3145KT - 19.95 16.97 Kit Order Code: 3153KT - 37.96
test section) + Windows Software (Program, Assembled Order Code: AS3145 - 22.97 Assembled Order Code: AS3153 - 49.96
Read, Verify & Erase) + a rewritable Additional DS1820 Sensors - 4.96 each
PIC16F84A. 4 detailed examples provided for 3x5Amp RGB LED Controller with RS232
you to learn from. PC parallel port. 12Vdc. 8-Channel Ethernet Relay Card Module 3 independent high power
Kit Order Code: 3081KT - 17.95 Connect to your router with channels. Preprogrammed
Assembled Order Code: AS3081 - 24.95 standard network cable. Oper- or user-editable light se-
ate the 8 relays or check the quences. Standalone op-
PICKit2 USB PIC status of input from anywhere in tion and 2-wire serial inter-
Programmer Module world. Use almost any internet face for microcontroller or
Versatile, low cost, browser, even mobile devices. PC communication with simple command set.
PICKit2 Development Email status reports, programmable timers, ... Suitable for common anode RGB LED strips,
Programmer. Programs all Assembled Order Code: VM201 - 134.40 LEDs and incandescent bulbs. 56 x 39 x
the devices a Microchip PICKIT2 programmer 20mm. 12A total max. Supply: 12Vdc.
can. Onboard sockets & ICSP header. Many items are available in kit form (KT suffix) Kit Order Code: 8191KT - 29.95 24.95
Assembled Order Code: VM203 - 39.54 or pre-assembled and ready for use (AS prefix) Assembled Order Code: AS8191 - 29.95

JULY 2016 Page 2.indd 1 27/06/2016 10:06


Hot New Products! Motor Speed Controllers
Here are a few of the most recent products
Here are just a few of our controller and
added to our range. See website or join our
driver modules for AC, DC, Unipolar/Bipolar
email Newsletter for all the latest news.
stepper motors and servo motors. See web-
site for full details.
4-Channel Serial Port Temperature
Monitor & Controller Relay Board DC Motor Speed Controller (100V/7.5A)
4 channel computer Control the speed of
serial port tempera- almost any common DC
ture monitor and motor rated up to
relay controller. 100V/7.5A. Pulse width
Four inputs for modulation output for Electronic Kit Specialists Since 1993
Dallas DS18S20 or maximum motor torque
DS18B20 digital at all speeds. Supply: 5-15Vdc. Box supplied. Electronic Project Labs
thermometer sensors (3.95 each). Four Dimensions (mm): 60Wx100Lx60H.
Great introduction to the world of electron-
5A rated relay outputs are independent of Kit Order Code: 3067KT - 19.95
ics. Ideal gift for budding electronics expert!
sensor channels allowing flexibility to setup Assembled Order Code: AS3067 - 27.95
the linkage in any way you choose. Simple
text string commands for reading tempera- Bidirectional DC Motor Speed Controller 130-in-1 Electronic Project Lab
ture and relay control via RS232 using a Control the speed of Get started on the
comms program like Windows HyperTermi- most common DC road to a great
nal or our free Windows application. motors (rated up to hobby or career in
Kit Order Code: 3190KT - 84.95 59.95 32Vdc/10A) in both the electronics. Con-
Assembled Order Code: AS3190 - 74.95 forward and reverse tains all the parts
direction. The range of and instructions to
40 Second Message Recorder control is from fully OFF to fully ON in both assemble 130 educational and fun experi-
Feature packed non- directions. The direction and speed are con- ments and circuits. Build a radio, AM broad-
volatile 40 second mul- trolled using a single potentiometer. Screw cast station, electronic organ, kitchen timer,
ti-message sound re- terminal block for connections. logic circuits and more. Built-in speaker, 7-
corder module using a Kit Order Code: 3166v2KT - 23.95 segment LED display, two integrated circuits
high quality Winbond Assembled Order Code: AS3166v2 - 33.95 and rotary controls. Manual has individual
sound recorder IC. circuit explanations, schematic and connec-
Standalone operation using just six Computer Controlled / Standalone Unipo- tion diagrams. Requires 6 x AA batteries (not
onboard buttons or use onboard SPI inter- lar Stepper Motor Driver included). Suitable for age 14+.
face. Record using built-in microphone or Drives any 5-35Vdc 5, 6 Order Code EPL130 - 55.95
external line in. 8-24Vdc powered. Change or 8-lead unipolar stepper Also available: 30-in-1 26.95 | 50-in-1
a resistor for different recording dura- motor rated up to 6 Amps. 39.95 | 75-in-1 49.95 | 200-in-1 69.95 |
tion/sound quality. Sampling frequency 4- Provides speed and direc- 300-in-1 89.95 | 500-in-1 199.95
12 kHz. (120 second version also available) tion control. Operates in stand-alone or PC-
Kit Order Code: 3188KT - 29.95 23.96 controlled mode for CNC use. Connect up to
Assembled Order Code: AS3188 - 31.97 six 3179 driver boards to a single parallel Tools & Test Equipment
port. Board supply: 9Vdc. PCB: 80x50mm. We stock an extensive range of soldering
Bipolar Stepper Motor Chopper Driver Kit Order Code: 3179KT - 17.95 tools, test equipment, power supplies,
Get better performance from your stepper Assembled Order Code: AS3179 - 24.95 inverters & much more. Please visit our
motors with this dual full website to see the full range.
bridge motor driver based Computer Controlled Bi-Polar Stepper
on SGS Thompson chips Motor Driver
L297 & L298. Motor cur- Drive any 5-50Vdc, 5 Amp Advanced Personal Scope 2 x 240MS/s
rent for each phase set bi-polar stepper motor using Features 2 input chan-
using on-board potentiom- externally supplied 5V lev- nels - high contrast LCD
eter. Rated to handle els for STEP and DIREC- with white backlight - full
motor winding currents up to 2 Amps per TION control. Opto-isolated auto set-up for volt/div
phase. Operates on 9-36Vdc supply volt- inputs make it ideal for CNC applications and time/div - recorder
age. Provides all basic motor controls in- using a PC running suitable software. Board roll mode, up to 170h per
cluding full or half stepping of bipolar step- supply: 8-30Vdc. PCB: 75x85mm. screen - trigger mode:
pers and direction control. Allows multiple Kit Order Code: 3158KT - 24.95 21.20 run - normal - once - roll ... - adjustable trig-
driver synchronisation. Perfect for desktop Assembled Order Code: AS3158 - 31.20 ger level and slope and much more.
CNC applications. Order Code: APS230 - 299.95 239.95
Kit Order Code: 3187KT - 39.95 AC Motor Speed Controller (600W)
Assembled Order Code: AS3187 - 49.96 Reliable and simple to Handheld Personal Scope with USB
install project that allows Designed by electronics enthusiasts for elec-
LCD Oscilloscope Kit you to adjust the speed of tronics enthusiasts! Powerful,
Build your own oscillo- an electric drill or 230V AC compact and USB connectivity,
scope with LCD display. single phase induction this sums up the features of this
Learn how to read signals motor rated up to 600 oscilloscope. 40 MHz sampling
with this exciting new kit. Watts. Simply turn the potentiometer to adjust rate, 12 MHz analogue band-
See the electronic signals the motors RPM. PCB: 48x65mm. Not suita- width, 0.1 mV sensitivity, 5mV to 20V/div in
you learn about displayed on your own ble for use with brushless AC motors. 12 steps, 50ns to 1 hour/div time base in 34
LCD oscilloscope. Despite the low cost, this Kit Order Code: 1074KT - 15.95 13.56 steps, ultra fast full auto set up option, adjust-
oscilloscope has many features found on Assembled Order Code: AS1074 - 21.56 able trigger level, X and Y position signal
expensive units, like signal markers, fre- shift, DVM readout and more...
quency, dB, true RMS readouts and more... Order Code: HPS50 - 239.96 199.95
Kit Order Code: EDU08 - 49.99 Visit our website for lots more
DC, AC and stepper motor drivers More special offers online!

Secure Online Ordering Facilities Full Product Listing, Descriptions & Photos Kit Documentation & Software Downloads

JULY 2016 Page 3.indd 1 27/06/2016 10:06


EPE Summer Sale!!!

Announcing our
Special Summer Sale!!
EPE Special Offers:
25% off of all PCBs up to and including those in the June 2016 issue
25% off all EPE hard copy back issues
25% off all EPE back issue 6-month CDROMs
25% off all EPE back issue 5-year CDROMs

EPE Subscription Offer:


Subscribe to EPE hard copy for 2-years and receive a free 6-month back issue
CDROM of your choice; normal back issue CDROM price 16.45. If you have an
existing subscription then you are welcome to renew early for another 2-years and
receive the offer.

New Teach-In Bundle:


New Electronics Teach-In bundle includes TI CDROMs 1, 2, 3 and 4;
Normal price 18.95: Special offer 25% discount price 14.21

Please note: The 25% will be deducted when the order is processed. This will not
show on your online order confirmation.

PAYMENT MUST BE RECEIVED BY 31ST AUGUST 2016, WHEN THE


OFFERS CLOSE DONT MISS OUT!!
JUST CALL 01202 880299 OR VISIT OUR SECURE ONLINE SHOP
AT WWW.EPEMAG.COM

Special Offer Page.indd 1 27/06/2016 08:45


Arduino Starter Kit
Genuine Arduino Starter kit which comprises of a 170 page instruction manual, 69.90
Arduino UNO Board, Breadboard, components & more. Inc Delivery* & VAT

The kit walks you through the Arduino programming and basic electronics in
a hands on way. You will be able to build 15 projects using the components
supplied. They allow you to control the physical world through different kinds
of sensors and actuators. Once you have mastered this knowledge, you will
have the ability and circuits to create something beautiful, and make someone
smile with what you invent. So build, hack and share!

The Arduino Starter kit is the ideal partner for anyone following the Teach-In 2016
Teach-In 2016
which started in the February 2016 issue of EPE Everyday Practical Electronics. Exploring the
Arduino
This Starter kit is supplied with a Wood base, USB & Interconnect leads, Electric motor, Piezo sounder, Movement
and Temperature sensors, Switches, LCD, Breadboard & Servo motor. The kit also includes over 100 electronic com-
ponents:- Diodes, Transistors, Capacitors, h-Bridge, Resistors, LED's, Switches and Trimmers. Quote: EPEARDSK

Offical Arduino Dealer HPG1 Function Generator


A complete pocket function generator.
Genuine Arduino UNO R3 Now you can take test signals on the
from 18.98+p&p move, 3 waveforms can be selected. Set
Wide range of Boards,Shields & Accessories the output voltage or frequency and se-
lect signal waveform using the on the
HPS140i Oscilloscope screen menu. A powerful sweep function
The HPS140i Oscilloscope packs al lot of power in is also included.
a tiny box. Now you can really take a powerful os-
cilloscope everywhere. These features make the * Frequency range: 1Hz to 1.000.000Hz
HPS140 indispensable to the professional user, * Frequency steps: 1Hz, 10Hz, 100Hz,
service centres and even to the hobbyist. Supplied 1kHz and 10kHz
with a probe. * Sine, square and triangle wave forms
* Runs on NiMH rechargeable battery
pack (includeed)
* 40Mhz real time sample rate
* BNC Lead and Charger Included.
101.95
69.90
87.60
* Full auto range option Inc Delivery* & VAT

* Hold & store function Quote: EPEHPG


* Operates up to 6 hours on
2.4GHz Frequency Counter
one charge
0.01Hz to 2.4GHz
* Scope Lead and Charger
8 Digit LED Display
Supplied
Gate Time: 100ms to 10s
2 Channel Operating mode
Quote: EPEHPS
Power Supply: 110-220Vac 5W
Quote: EPE24G
69.90
99.60 81.00
Inc Delivery* & VAT
Inc Delivery* & VAT

30V 5A Programmable PSU Build your own Oscilloscope


Dual LED (Voltage & Current) Displays A new self assembly kit, ideal for education and way to visualise sig-
Course & Fine Voltage /Current Adjustment nals. Features: Markers, Frequency, dB, True RMS readouts
Volatge or Current Limiting. Timebase range:
* 5 Memories 10s-500ms/division (15 steps)
* PC Link via USB Input sensitvity:
or RS232 100mV-5V/division (6 steps)
*Output: Max Input voltage: 30Vpp
0-30Vdc Max Sample Rate:
0-5A 1ms/s repetitive signal,
100ks/s real time signal
Dim: 80 x 115 x 40mm
49.99
07/

Quote: EPEPSU
11

99.90 Quote: EPESCOPE Inc Delivery* & VAT


Inc Delivery* & VAT

ESR Electronic Components Ltd Prices INCLUDE Delivery* & VAT.


10
/15 Tel: 0191 2514363 Station Road, *Delivery to any UK Mainland address,
please call for delivery options for
Fax: 0191 2522296 Cullercoats, Tyne & Highland & Island, Northern Ireland,
www.esr.co.uk sales@esr.co.uk Wear. NE30 4PQ Ireland, Isle of Man, Isle of Wight &
Channel Islands

ESR MARCH 2016.indd 1 19/01/2016 16:01


EDI T OR I AL
VOL. 45 No. 08 AUGUST 2016

Editorial Offices:
EVERYDAY PRACTICAL ELECTRONICS
EDITORIAL Wimborne Publishing Ltd., 113 Lynwood
Drive, Merley, Wimborne, Dorset, BH21 1UU
Phone: 01202 880299. Fax: 01202 843233.
Email: fay.kearn@wimborne.co.uk
Website: www.epemag.com
See notes on Readers Technical Enquiries below
we regret technical enquiries cannot be answered
Happy Birthday Net Work!
over the telephone. Doesnt time fly when youre having fun? Can it really be 20 years since Net
Advertisement Offices: Work started? Well, it is, and we have quite a treat for you this month and
Everyday Practical Electronics Advertisements next. Alan Winstanley is looking back over the history of the Internet and
113 Lynwood Drive, Merley, Wimborne, Dorset, EPEs long and fruitful relationship with the online community.
BH21 1UU
Phone: 01202 880299 Fax: 01202 843233
Email: stewart.kearn@wimborne.co.uk I distinctly remember my first contact with the Web in the very early
1990s it was in a university library, and to be honest, it was less than
Editor: MATT PULZER
Subscriptions: MARILYN GOLDBERG impressive. For no particular reason I tried to view a painting from the
General Manager: FAY KEARN Prado in Madrid. I think it took at least ten minutes to appear and even then
Graphic Design: RYAN HAWKINS it was a fairly crummy jpeg. Underwhelming was my initial reaction, but I
Editorial/Admin: 01202 880299
Advertising and
made a mental note to keep an eye on the technologys progress.
Business Manager: STEWART KEARN
01202 880299 Then, around the start of the mid-90s, along with many EPE readers I took
On-line Editor: ALAN WINSTANLEY
the plunge and bought my first dial-up 14.4kbit/s modem (I think from US
Publisher: MIKE KENWARD Robotics). If all you have ever known is modern cable speeds then slow
READERS TECHNICAL ENQUIRIES
doesnt even begin to describe the operation of early Internet technology
Email: fay.kearn@wimborne.co.uk but, it did work, and for very basic websites and email with modest
We are unable to offer any advice on the use, purchase, attachments the system delivered. I got used to the sound of the Internet
repair or modification of commercial equipment or the (https://youtu.be/p8XKhCfsTts) and a later jump to a 56k modem felt like
incorporation or modification of designs published
in the magazine. We regret that we cannot provide moving from a Ford to a Ferrari!
data or answer queries on articles or projects that are
more than five years old. Letters requiring a personal Fast forward 20 years, and like many of you, I cannot imagine working
reply must be accompanied by a stamped self-
addressed envelope or a self-addressed envelope and without the Internet. For younger readers, there has never been a time
international reply coupons. We are not able to answer when unlimited digital information, commerce and entertainment were
technical queries on the phone. not available 24/7. It has been an amazing revolution, and Alans trip down
PROJECTS AND CIRCUITS memory lane is truly fascinating.
All reasonable precautions are taken to ensure that
the advice and data given to readers is reliable. We
cannot, however, guarantee it and we cannot accept
Wed love to hear readers early online experiences good, bad, frustrating
legal responsibility for it. and funny. Drop us an email at: editorial@wimborne.co.uk
A number of projects and circuits published in
EPE employ voltages that can be lethal. You should
not build, test, modify or renovate any item of mains- This month
powered equipment unless you fully understand the
safety aspects involved and you use an RCD adaptor.
So much for the past, what do we have for you this month lots of
electronic goodies! From Teach-In 2016 and Audio Out to PIC n Mix
COMPONENT SUPPLIES
We do not supply electronic components or kits for
and Circuit Surgery well keep you busy and informed for the next four
building the projects featured, these can be supplied weeks. My top pick this month is the Low-cost, Accurate Voltage/Current/
by advertisers. Resistance Reference project. Its cheap, quick to build and really everyone
We advise readers to check that all parts are still should have one. Despite its tiny size its good enough to calibrate a digital
available before commencing any project in a back-
dated issue. multimeter, but would also be perfectly at home in a larger project; for
example, providing a dependable reference voltage for an Arduinos ADC.
ADVERTISEMENTS
Although the proprietors and staff of EVERYDAY Build one! You wont regret it.
PRACTICAL ELECTRONICS take reasonable
precautions to protect the interests of readers by
ensuring as far as practicable that advertisements are
bona fide, the magazine and its publishers cannot give
any undertakings in respect of statements or claims
made by advertisers, whether these advertisements
are printed as part of the magazine, or in inserts.
The Publishers regret that under no circumstances
will the magazine accept liability for non-receipt of
goods ordered, or for late delivery, or for faults in
manufacture.

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

EPE Editorial_100144WP.indd 7 27/06/2016 08:47


NEWS
A roundup of the latest Everyday News
from the world of
electronics

Why we need a Digital Television Group report by Barry Fox


T he annual Summit conference
held in May by the UKs Digital
Television Group was short on hot
before the upgrade, it later emerged
that the decoder chipsets used in
some TVs (notably Samsung) cannot
catering for the Netflix and Amazon
systems along with HDR10, the Open
HDR system used for 4K Blu-ray
news but neatly proved the need cope with some levels of compres- discs. Disney wants to use HDR, but
for a DTG to create order out of sion, and respond by muting. with conventional 1080p High Defi-
the chaos which would surely exist The DTG is now co-ordinating a nition video, rather than 4K.
if there were no independent body temporary rollback of the encoder The opportunity for chaos is obvi-
which the TV industry trusts to set upgrade to fix the problem until ous, with HDR video material likely
standards, test products to ensure the set makers have all developed, to look worse than non-HDR pic-
they meet the standards and steer tested and pushed out updates to the tures if displayed on screens that
rival TV stations and set-makers into decoder chipsets locked into view- cannot correctly decode the metada-
collaboration. ers sets. The rollback started in May, ta that travels with the picture signal
just before the DTG conference, and to match the display capability with
Intermittent muting is progressing across the country. the source material.
In the run-up to this years event, at Participants in the DTGs two re-
the Kings Place concert hall in Lon- cent HDR Plugfests, one in Berlin
dons Kings Cross, some TV viewers and another in London, told how
had been plagued with a mysteri- TV manufacturers at the events
ous audio fault on all the Freeview were frantically phoning their soft-
high definition channels, but not ware labs in India, Korea and Japan
the standard definition equivalents. to describe problems encountered at
On some makes of TV (notably Sam- the event. Because the events were
sung), but not on others, and not spread over two days there was no
on set-top boxes (eg, Humax), the time to get back revised software
sound intermittently and apparently down a line and try it on the spot.
randomly mutes.
The conference provided an oppor- Subtitle triumph
tunity to talk with the DTGs engi- The DTGs Summit at Kings Place
neers, who admitted that like all was notable also for proving that
intermittent, random faults the HD Unwanted audio muting has been plaguing live TV subtitling does not have to
dropout had been very difficult to Freeview high definition channels be as poor as it usually is. The cur-
isolate and make repeatable. But the rent technique is for a titler to lis-
DTG thinks it is finally nailed. The DTG is currently holding ten to the TV sound through head-
plugfests to try and pre-empt what phones and re-speak the words into
CODEC issues could be even more widespread a microphone connected to a PC
The HE-AAC (High-Efficiency Ad- problems if broadcasters press which is running voice recognition
vanced Audio Coding) audio encod- ahead with plans to use HDR (high software. This overcomes the prob-
ers on the HD multiplex are quite dynamic range) picture coding. lem that computer voice recognition
separate from the MPEG (Version 1, Both Netflix and Amazon have gone cannot (yet) cope with different dia-
Layer 2) encoders used for the SD ahead with the launch of HDR pro- lects or accents or mumbling. But
channels, and earlier this year all gramming on their 4K Internet ser- inevitably re-speaking creates a sig-
the HD encoders were upgraded to vices, without waiting for an indus- nificant delay and the software still
tweak their AAC compression with try standard, and each uses slightly injects recognition errors, which
a system called perceptual noise different systems. Sascha Prueter, can only be corrected when the pro-
substitution (PNS). This saves bits Head of Android TV at Google, con- gramme is recorded and repeated or
where wanted audio sounds like firmed that the BBC is now working replayed later from a Catchup Ser-
unwanted noise. So the coding is with YouTube on another system. vice such as iPlayer.
continually changing, depending on LG has adopted the proprietary Dol- The recognition errors are often so
the sound. Although this was tested by Vision system, while Panasonic is gross and hilarious that watching a
8 Everyday Practical Electronics, August 2016

News (MP 1st) AUGUST 2016.indd 8 27/06/2016 08:54


Why we need a Digital Television Group continued Hammond miniature
USB enclosures
speakers were talking very fast, and
using TV industry jargon.
How is this happening so extraor-
dinarily well, we asked; how can re-
voicing and software recognition be
so rapid and accurate? Up on screen,
to spontaneous applause from the
hall, came a direct reply from the
titler: I am a stenographer.
BBC Breakfast subtitle challenge: do piglets The DTG later explained that it
like farmers wellies?... probably had hired a verbatim court stenog-

muted TV screen in a club, pub or


airport waiting zone has become a
rapher with a dedicated keyboard
that captures words as shorthand
keystroke combinations which com-
T o house small PCBs using USB
as the external power and signal
interconnect, Hammond Electronics
whole new form of entertainment. puter software then outputs as plain has extended its popular 1551
The errors are also deeply frustrat- text. The DTG says it is now co-op- miniature family with three new
ing for the prime target audience, erating with the UKs telecoms regu- sizes: 35, 50 or 65mm long, 20, 25 or
the deaf and hard of hearing. lator Ofcom on a report, which asks 30mm wide respectively, all 15.5mm
At the DTG Summit, some members why TV subtitling is so bad, and high. The sizes provide prototype
of the audience gradually realised whether it has to be so bad. Hope- builders and small volume producers
that the subtitles for the on-stage talk fully, someone from Ofcom was at generous room for their PCB. All
which were continuously displayed the DTG Summit to see first hand versions feature a dedicated cut-out
live on screens alongside the stage evidence that it doesnt have to be for a standard USB Type A plug in
were remarkably accurate and only so bad. But the cost will increase be- one end.
slightly behind the speech; and this cause it takes literally years of train-
was despite the fact that many of the ing to learn to capture in real time.
Zinc grid-scale batteries

Major Bluetooth upgrade to a connectionless IoT where there


R esearchers at Stanford University
have designed a battery to help
with grid-scale energy storage.

T he Bluetooth Special Interest


Group (SIG) has announced
that its next release of the wireless
is less need to download an app or
connect the app to a device.
More than 371 million Bluetooth-
Solar and wind farms should be
able to provide around-the-clock en-
ergy for the electric grid, even when
communications standard (arriving enabled beacons are projected to theres no sunlight or wind, said
late 2016 to early 2017), will be ship by 2020, according to Patrick Stanford researcher, professor Cui.
called Bluetooth 5 and will include Connolly, Principal Analyst at ABI That will require inexpensive bat-
significantly increased range, speed, Research. With eight times the teries and other low-cost technolo-
and broadcast messaging capacity. broadcast messaging capacity, Blue- gies big enough to store surplus clean
The claimed objectives are: ex- tooth 5 will further propel the adop- energy for use on demand.
tending range to deliver ro- tion and deployment of beacons The researchers designed a novel
bust, reliable Internet of and location-based services battery with electrodes made of zinc
Things (IoT) connections that in the home automation, and nickel, inexpensive metals.
make full-home and build- enterprise, and industrial A variety of zinc-metal batteries
ing and outdoor use a reality. markets. In scenarios where are available commercially, but few
Higher speeds will send data contextual awareness like are rechargeable, because tiny fibres
faster and optimise respon- navigation and pin-point lo- called dendrites form on the zinc
siveness. Increasing broadcast cation are crucial such as electrode during charging. These
capacity will propel the next hassle-free airport naviga- dendrites can grow until they finally
generation of connection- tion, asset tracking of ware- reach the nickel electrode, causing
less services like beacons house inventory, emergency the battery to short circuit and fail.
and location-relevant information response and even smart city infra- The research team solved the den-
and navigation. These Bluetooth structure that helps the visually im- drite problem by simply redesign-
advancements open up more pos- paired be more mobile Bluetooth ing the battery. Instead of having the
sibilities and enable SIG companies 5 will send custom information zinc and nickel electrodes face one
to build an accessible, interoperable people actually find useful in that another, as in a conventional battery,
IoT. moment without connection and the researchers separated them with a
application barriers. plastic insulator and wrapped a car-
From app to IoT Mark Powell, executive director of bon insulator around the edges of the
Bluetooth 5 will quadruple range and the Bluetooth SIG said, Today, there zinc electrode. Even if zinc dendrites
double the speed of low energy con- are 8.2 billion Bluetooth products in form, they will grow away from the
nections while increasing the capac- use, and the enhancements in Blue- nickel electrode and will not short
ity of connectionless data broadcasts tooth 5 and planned future Blue- the battery.
by 800 per cent. With the major boost tooth technical advancements mean To demonstrate stability, the re-
in broadcast messaging capacity, the that Bluetooth will be in more than searchers successfully charged and
data being transferred will be richer one-third of all installed IoT devices discharged the battery more than 800
and, more intelligent. A key aim is to by 2020. The drive and innovation times without shorting.
redefine the way Bluetooth devices of Bluetooth will ensure our tech- Our design is very simple and
transmit information, moving away nology continues to be the IoT solu- could be applied to a wide range of
from the app-paired-to-device model tion of choice for all developers. metal batteries, Cui said.
Everyday Practical Electronics, August 2016 9

News (MP 1st) AUGUST 2016.indd 9 27/06/2016 08:55


microchipDIRECT offers access to the worlds largest inventory of Microchip products
and the most comprehensive online resource for pricing and support directly from
Microchip Technology. We invite you as a valued Microchip customer to experience our
service 24 hours a day, 7 days per week.

Visit www.microchipDIRECT.com and enjoy the confidence and convenience of buying


from microchipDIRECT and take advantage of the following features:

Direct stock from factory Long-term orders and scheduling


Direct customer service Programming and value add services
Secure ordering Ability to adjust open orders
Volume pricing Ship to your sites globally
Credit lines Online order status and notifications

www.microchipDIRECT.com

The Microchip name and logo, 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.
2015 Microchip Technology Inc. All rights reserved. DS40001752B. MEC2010Eng04/15

JULY 2016 Page 10.indd 1 24/06/2016 12:40


Radio astrology
is not nonsense Mark Nelson
No, thats not a misprint, as can be proven in a contrived sort of way. Radio astrology may not be a
very practical application of electronics, but this did not stop RCA from taking it seriously. Plus, is
making your own microprocessors from transistors a practical business?

O NLY A COUPLE OF LETTERS


differentiate astrology from
astronomy, so much so that both subjects
based only on purely
theoretical explanations
of why it cant be. Rather,
used to be jumbled side-by-side on the the real work would be
magazine shelves of my local branch of in an objective analysis
WH Smith. And why on earth not? Both of a well-calculated
activities involve scanning the heavens Nelson index against
in order to gain better understanding. actual propagation data.
Even so, you and I probably agree I have only scratched
theres a distinction between looking the surface and found it
to the skies for predicting the future, intriguing.
or alternatively for puzzling out the
cosmos and other worlds. Doing it the hard way
It was not always so of course. Earlier According to Miles
civilisations, notably the Babylonians, Kington, knowledge
Ancient Greeks, Egyptians and Building a microprocessor using discrete components is not a is being aware that a
Persians, carried out methodical trivial pursuit [photo courtesy of Evil Mad Scientist Laboratories] tomato is a fruit rather
observations of the night sky and than a vegetable,
performed mathematical calculations positions relative to the sun with logs whereas wisdom is knowing not to
not only for navigational purposes and of propagation conditions from RCAs put it in a fruit salad. In similar vein,
making calendars, but also to predict all receiving station at Riverhead, Long microprocessor chips contain a vast
manner of future events. They saw no Island. Astronomy was Nelsons hobby, number of individual transistors
distinction between these applications and RCA built a small observatory for but you wouldnt try making your
and showed no intellectual snobbery him to do the research. His article in own microprocessor from discrete
towards speculative fortune telling. RCA Review of March 1951 observes transistors or would you? Someone
But 65 years ago the respected Time that more storms occurred when two or who certainly would is Eric Schlaepfer,
magazine in the US reported: This more planets were in configuration and in collaboration with Evil Mad Scientist
week Radio Corporation of America, no stated that certain configurations of the Laboratories, whose motto is Making
easy prey to superstition, announced in six inner planets correlated positively the world a better place, one Evil Mad
the RCA Review that it is successfully with degraded propagation conditions. Scientist at a time.
predicting radio reception by a study of Eric calls his creation the MOnSter
planetary motions. So radio astrology Not dogmatic 6502: a transistor-scale replica of the
was not a joke after all then? Nelson was not dogmatic about his revered MOS 6502 microprocessor
theory, however, and in this and in that powered some influential early
Two kinds of radio astrology a follow-up article published in the computer systems such as the Apple
I should clarify that theres radio May 1952 issue, he encouraged further ][ and the Commodore PET. His
astrology and radio astrology. The first study. Nevertheless, he believed that monstrous replica is huge, measuring
kind uses radio astronomy techniques his theory was about 85 per cent 12 15 inches and containing more
for astrological purposes and the accurate in its predictions, although than 4,000 surface mount components.
second uses astrological techniques for these were based on a small number of Thoughtfully he has added 167
radio purposes. As far as I know, the observations. Some observers consider indicator LEDs so that you can see
first of these has not been put to the test, that there is merit in Nelsons theory, data as it flows through the device.
even though when I was a student at although RCA appears not to have The prototypes first public sighting
Kent university back in the late 1960s, taken it further. was at the San Francisco Bay Area
Prof Jennison did set up a mobile radio David Dalton (callsign K9WQ), Maker Faire in May of this year. Eric
astronomy station that we students who has researched the subject in emphasizes that the MOnSter 6502 is
dubbed a radio astrology research some detail, says that as far as he can not yet a kit or product that you can
station. But the second application, determine from searching the Internet, buy, but this might change. If you
studying the interaction of the planets few or no studies have been done to test would like to stay in the loop as Erics
to forecast radio propagation, did Nelsons theory. He concludes: If you vast project evolves, he has set up a
indeed take place in 1951 when search the Web for references to John H special mailing list. You can read more
RCA became involved in a project Nelson as I did, you will find that certain about the MOnSter 6502 on its main
to anticipate magnetic storms that astrologers and UFO enthusiasts took project page, monster6502.com (where
hampered short-wave radio reception an interest in his theory. Im not really you can discover whether Eric is nuts,
from across the Atlantic. sure why perhaps because it was seen and sign up to be on the mailing list),
Summarising the many reports on the as scientific evidence that planetary and at Erics eclectic blog, tubetime.
Internet, RCA Communications Co. in positions might affect conditions on us. The Evil Mad Scientist website is,
New York was keen to mitigate poor earth. However, I dont think that we predictably, at www.evilmadscientist.
shortwave propagation in the north should dismiss Nelsons theory based com. Maker Faires, with all kinds of
Atlantic region. One of their engineers, on its interest to astrologers. Also, weird and wonderful on display, are
by the name of John H Nelson, I personally would be sceptical of now held all over the world (see http://
developed this by comparing planetary attempts to dismiss Nelsons theory makerfaire.com).

Everyday Practical Electronics, August 2016 11

TechnoTalk (MP 1st & AE) AUGUST 2016.indd 11 27/06/2016 12:34


Constructional Project

Low-cost, Accurate
Voltage/Current/
Resistance Reference
This small module is based on a lithium coin cell, a voltage
reference IC, a precision resistor and little else. It provides a
reference voltage of 2.5V1mV (0.04%), a resistance of 1k1
(0.1%) and a current of 2.5mA3.5A (0.14%). It can be used for
checking or calibrating multimeters or anywhere that an accurate
and stable voltage is required.

By Nicholas Vinen

How accurate are your multi


meters? This accurate Voltage/
Current/Resistance Reference is
T HIS SMALL module can be kept with
your multimeter or other test instrument
and used to periodically check its calibration.
ideal for checking and calibrating With occasional use, the battery will last for its
multimeters on a regular basis. shelf life, which is normally at least 10 years
for a fresh cell.
It can sink or source up to 10mA so the ac-
curacy of the reference voltage is not affected
by bias currents and a divider can be connected
across the outputs to provide lower reference
voltages, as long as its impedance is at least
250. For example, this would allow it to be
used in combination with our Lab-standard
16-Bit Digital Potentiometer from the July 2012
issue to give an adjustable reference voltage
from 0V to 2.5V in 38V steps.
It could also be hooked up to a microcon-
troller to be used as an analogue-to-digital
converter (ADC) reference voltage, for accurate
voltage measurements by the micro.
This project effectively supersedes the Pre-
cision 10V Reference published in the May
2015 issue (and the one from June 2011 too).
While this one is not adjustable and its output
voltage is lower, its basic accuracy is better,
its much smaller and cheaper to build, uses
a much smaller (and cheaper) battery and the
previous projects did not offer the resistance
or current references.

Circuit description
The full circuit is shown in Fig.1 and there isnt
much to it. IC1 is the Maxim voltage reference

12 Everyday Practical Electronics, August 2016

Voltage Reference0815 (MP 1st & SK) August 2016.indd 12 27/06/2016 09:00
Constructional Project

IC1 MAX6071 (1.25V,1.8V,2.048V,2.5V)


4 VIN
IOUT
OUTS 5
1k
2.2k 0.1%

OUTF 6
OUT+
4.7 F BANDGAP
6.3V
VOLTAGE 4.7 F
REFERENCE
6.3V
A GNDF 1
ON OUT
LED1 3 GNDS 2
EN
K

ON SWITCH D
S1
100 Q1
IRLML6344
G
K S
D1 1N4148 LED
BATTERY1 4.7 F CATHODE
1N4148 3V 6.3V
10M BAND
A K
(OPTIONAL, A
SEE TEXT) K
A

IRLML6344 MAX6 0 71
6 5
D
VOLTAGE/CURRENT/RESISTANCE
SC VOLTAGE/CURRENT/RESISTANCE REFERENCE
4

20 1 5 REFERENCE 3V3VVERSION
VERSION G
S
1
2 3

Fig.1: the circuit is based on a MAX


6071 2.5V precision voltage regulator.

Features and specifications: 2.5V version


MOSFET Q1 switches power to the
circuit for 15-20s whenever pushbutton
switch S1 is pressed.
Reference voltage: 2.5V1mV, 0-10mA sink/source
Reference current: 2.5mA1.4A, 1k source impedance
which contains a band-gap circuit and
Reference resistance: 1k1, 1/8W
precision op amp with trimmed resis-
tive divider. The band-gap circuit meas- Power supply: 3V lithium button cell
ures the voltage across a couple of PN Operating current: ~600A
junctions and incorporates temperature Standby current: <1A
compensation so that its output is sta-
ble (typically just 1.5ppm change per Cell life: typically >10 years with intermittent use
degree Celsius). Other features: auto-off (20s), power indicator LED, compact size
The band-gap reference produces
1.25V and the internal op amp and
resistors provide a suitable gain to and connects the reference ground to an accurate 2.5mA current between
give the specified output. In this case, battery ground, thus switching it on. the IOUT and OUT terminals. The
were using a 2.5V reference, although A 10M resistor across this 4.7F separate calibration article in this is-
other values are available and can be capacitor discharges it over the course sue describes how measurement shunt
substituted. of about 15-20 seconds and once its resistance can affect this current.
Were using 4.7F input bypassing voltage drops low enough, Q1 switches Note that if all you want is a volt-
and output filtering capacitors for a off and current flow from the battery age reference, you can leave the 0.1%
stable output voltage. LED1 and its ceases. Thus, S1 is pressed before the resistor out of the circuit.
series current-limiting resistor are con- reference is used and provides power Some button cell holders (including
nected across the references supply for long enough for a measurement to the type Jaycar stocks) will not apply
so that the LED lights whenever the be taken. Total current draw is around power to the circuit if the cell is in-
reference is powered. 0.6mA when the reference is powered serted upside-down. However, some
MOSFET Q1, together with push- (150A for IC1 and 450A for LED1) do but we cant use a series diode
button S1 and the RC network, switch- and Q1s leakage current when off is for reverse polarity protection as we
es power to the reference for a limited less than 1A. normally would, since IC1 requires a
time, so that the cell wont be acciden- The output reference voltage is avail- minimum of 2.8V to operate and even
tally discharged. able between the OUT+ and OUT a Schottky diode would reduce the
When S1 is pressed, a third 4.7F pads on the PCB. A 0.1% 1k precision 3V from the cell by too much.
capacitor charges from the 3V battery resistor is connected between OUT+ Thus, an optional 1N4148 diode (D1)
supply via a 100 current-limiting re- and IOUT and so resistance calibration can be reverse-connected across the
sistor. This capacitor is connected be- can be performed between these two holder to provide protection in case
tween Q1s gate and source terminals terminals. Together, the voltage refer- the cell is accidentally inserted back-
so when it charges up, Q1 switches on ence and precision resistor provide wards. The internal resistance for a

Everyday Practical Electronics, August 2016 13

Voltage Reference0815 (MP 1st & SK) August 2016.indd 13 27/06/2016 09:00
Constructional Project

IC1 MAX6071 (3V,3.3V,4.096V,5V)


4 VIN
IOUT
OUTS 5
1k
Reproduced by arrangement 2.2k 0.1%
with SILICON CHIP OUTF 6
magazine 2016. OUT+
4.7 F BANDGAP

www.siliconchip.com.au 6.3V
VOLTAGE 4.7 F
REFERENCE
6.3V
A GNDF 1
ON OUT
LED1 3 GNDS 2
EN
K

ON SWITCH D
S1
100 Q1
IRLML6344
G
S
3
LED BAV99
BATTERY1 4.7 F D2 CATHODE
6V 6.3V
10M BAND
3
BAV99 K
2 1 1
A 2

IRLML6344 MAX6 0 71
6 5
D
VOLTAGE/CURRENT/RESISTANCE
SC VOLTAGE/CURRENT/RESISTANCEREFERENCE
4

20 1 5 REFERENCE 6V6VVERSION
VERSION G
S
1
2 3

Fig.2: this alternative circuit is used


Parts list for output voltages of 3V or more.
Its powered by a 2-cell (6V) battery
1 double-sided PCB, available * OR and diode D2 is included to reduce
from the EPE PCB Service, 1 MAX6071AAUT12+T for 1.25V the supply voltage to 5.5V.
coded 04108151, 44.5 23mm output
1 tactile pushbutton with short 1 MAX6071AAUT18+T for 1.8V
actuator output CR2032 cell is typically 10 so if your
1 50mm length 20mm-diameter 1 MAX6071AAUT21+T for 2.048V holder does allow a cell to make con-
clear heatshrink tubing output tact upside-down, D1 should survive
long enough for you to realise your
Semiconductors Additional parts for versions mistake and protect IC1 from damage.
1 IRLML6344 N-channel MOSFET, over 2.5V output
SOT-23 package (Q1) 1 dual 20mm button cell holder Different output voltages
1 1N4148 small signal diode (D1) plus 2 CR2032 3V lithium IC1 can be changed to a 1.25V, 1.8V or
cells 2.048V type with no other changes to
Capacitors (SMD 3216 [1206] OR the circuit. This is simply a matter of
or 2012 [0805]) 1 20mm button cell holder using an IC with a different part num-
3 4.7F 6.3V X5R/X7R ceramic (Jaycar PH9238, Altronics ber (see the parts list).
S5056) plus 2 x CR2016 3V We have chosen 2.5V as the default
Resistors (1% SMD 3216 [1206] lithium cells option since this is the highest refer-
or 2012 [0805]) 1 MAX6071AAUT50+T 5V output ence voltage obtainable using a single
1 10M 1 2.2k reference IC** (IC1) lithium cell. However, 1.8V is also a
1 1k 0.1% 2012/0805 1 high-brightness blue LED, good choice as many low-cost DMMs
1 100 SMD 3216 (1206) or 2012 have a 2V range and thus this will be
(0805) package (LED1) (eg, ideal for calibrating them. The 2.5V
Additional parts for versions element14 2217982) option works well for meters with a
up to 2.5V output 1 BAT54S or BAT54C dual 4V range, which is quite common for
1 20mm button cell holder (Jaycar SMD Schottky diode, SOT-23 more expensive multimeters.
PH9238, Altronics S5056) package (D2) You can also get an output of 3V,
1 CR2032 3V lithium cell 3.3V, 4.096V or 5V, but this will require
1 MAX6071AAUT25+T 2.5V ** OR a 2-cell battery to provide a sufficiently
reference IC* (IC1) 1 MAX6071AAUT30+T for 3V high input supply voltage. You have
1 high-brightness red, green or output two options: either use a standard
yellow LED, SMD 3216 (1206) 1 MAX6071AAUT33+T for 3.3V button cell holder and two slim cells
or 2012 (0805) package (LED1) output (CR2016, ~100mAh) or use a double-
(eg, element14 2290347) 1 MAX6071AAUT41+T for 4.096V stack cell holder and two of the more
1 1N4148 small signal diode (D1) output common CR2032 cells (~200mAh).
There are two advantages to using

14 Everyday Practical Electronics, August 2016

Voltage Reference0815 (MP 1st & SK) August 2016.indd 14 27/06/2016 09:00
Constructional Project

CR2016: (1) you can get the holder LED1


WIRE LINK
LED1 D2
and cells from a local store, and (2) A
10M 3V 5V
3.3V
A
10M 3V 5V
3.3V
the resulting unit is a little more com- Q1 IOUT Q1 IOUT

1k
1k
4 7 4 7
pact. Unless you will be using the unit OUT+ OUT+

100
100

2.2k
2.2k
STACKED BUTTON

+
+
BUTTON CELL HOLDER
frequently, the reduced cell capacity 4 7 OUT CELL HOLDER 4 7 OUT
probably wont matter. IC1 4.096V
2.500V
IC1 4.096V
2.500V
04108151 04108151
Regardless, when using two cells, S1 1.8V 4 7
2.048V
1.250V S1 1.8V 4 7
2.048V
1.250V
diode D2 will need to be fitted. Thats 3V VERSION (OPTIONAL DIODE D1 UNDERNEATH) 6V VERSION
because IC1s maximum recommend- Fig.3: follow this PCB parts layout Fig.4: this is the layout for the 3V
ed operating voltage is 5.5V and D2s diagram to build the versions with to 5V versions. It includes diode
forward voltage will reduce the ~6V outputs up to 2.5V. D2 and a 2-cell holder.
from two fresh cells to be very close to
5.5V. The alternative circuit is shown
in Fig.2. With D2 in circuit, theres no
need to fit D1 as D2 will block reverse
current. Otherwise, the circuit remains
the same.

Construction These two photos show an assembled 2.5V version


Most of the parts are SMDs and all but at left and a 5V version at right. The white screen-printed squares on the
one have widely-spaced connections, PCB let you mark the selected output voltage. Its a good idea to cover the
making them easy to solder. The only completed assembly in clear heatshrink tubing.
slightly tricky one is IC1 but it really
isnt that hard. Its best to solder the
SMDs first, starting with IC1, before
finishing with the through-hole parts.
Refer to the appropriate overlay dia-
gram Fig.3 for outputs of up to 2.5V
and Fig.4 for higher voltages.
First, its a good idea to clean the Diode D1 in the 3V-powered version is optional. It can either be soldered across
PCB by swabbing it with a little alco- the battery holder on the underside of the PCB as shown at in the photo at left
hol (eg, methylated spirits) and a lint- (cathode to positive) or it can be left out as shown at right (see text).
free cloth. Also, applying flux to the
SMD pads before soldering will make
the job easier. solvent and then inspect with magni- DMM to diode test mode and connect
Melt a little solder onto one of IC1s fication to ensure all leads have been the probes to either end. If it lights up,
six pads, then place the IC alongside soldered properly. the red probe will be on the anode and
and inspect it under magnification. You can then move on to Q1 and, this goes in the corner of the board. Try
There will be a small dot laser etched if you are building the 6V-powered to avoid heating it up too much as this
on top. This is the pin 1 marker and version, diode D2. These are easier to can damage the LED. If it doesnt light
it goes towards the dot in the lower- solder as their leads are much further up in either orientation, your DMM
right corner of the PCB. Orient IC1 as apart. As before, tack one lead down may not put out enough voltage in
such, then heat the solder you added first, then check that the device is flat which case youll have to use a small
earlier and slide the chip into place against the PCB and that its leads are battery with a current-limiting resistor
using angled tweezers. properly lined up with the pads before to determine the anode.
If it appears that IC1 is correctly soldering the remaining pins and re- Once LED1 has been fitted, solder
placed, gently press down on the chip freshing the first one. the tactile pushbutton and cell hold-
using the tip of the tweezers while Be careful when fitting D2 as two er in place. In both cases, push them
heating the solder pad to ensure that of the pads are quite close together down hard to make sure they are flat
it is sitting properly on the PCB. Then and easy to accidentally bridge. If on the PCB before soldering their pins.
check under magnification that all six you are not fitting D2 then these two The cell holder will have three plas-
leads are centred over their pads. pads should be shorted, either with tic posts which go through matching
Once its in place, solder the leads a solder bridge or a very short length holes in the board. You may have to
on the opposite side (dont worry about of wire (eg, made from a component push fairly hard to get these to go in.
bridging them), then go back and sol- lead off-cut).
der the three on the other side, includ- You can now fit the resistors and ca- Optional diode D1
ing the one you tacked down earlier. pacitors in a similar manner, as shown Finally, if building the 3V-powered
Add some more flux, then clean up the in Fig.3 or Fig.4. The resistors will version, you can flip the board over
joints using some solder wick. This have their values marked on top (eg, and solder the 1N4148 diode in place
will remove any bridges and should 1001 = 1k, 222 = 2.2k), while the as shown on the above photo. Alterna-
also ensure that a proper fillet has capacitors will be unmarked. tive, you can leave this out if youre
formed for each pin. Remove any flux The last SMD is LED1 and you will confident that you will always install
residue using alcohol or a proper flux have to check its orientation first. Set a the cell with the correct polarity. Were

Everyday Practical Electronics, August 2016 15

Voltage Reference0815 (MP 1st & SK) August 2016.indd 15 27/06/2016 09:00
Constructional Project

Using this board with an Arduino


If youre going to use this board with an Fig.5: heres how
WIRE LINK
3.3V/5V FROM
GND FROM 3V 5V
Arduino, you can omit some of the parts. to interface the MICRO/ 3.3V MICRO/
VOLTAGE/
You certainly wont need the cell holder or unit to an Arduino ARDUINO Q1
RESISTANCE/
ARDUINO
CURRENT
pushbutton switch as power will come from for accurate ADC TO AREF

101
REFERENCE

4 7
ENABLE
the Arduino board itself. You could also measurements. FROM
TO AGND

leave off MOSFET Q1 and short it out if you Note that you MICRO/
IC1 4.096V
2.500V
04108151

4 7
dont need the micro to be able to switch need to cut one of ARDUINO 1.8V
2.048V
1.250V
CUT TRACK
(TOP SIDE)
the reference voltage on and off. the PCB tracks. OUTPUT
AREF VERSION FOR A MICRO OR ARDUINO

For now though, were assuming this is


useful, so Fig.5 shows how you can wire it the reference could flow via the analogue voltage, rather than the 5V reading it would
up. The reference IC runs off 5V from the ground connection and cause a voltage have indicated previously. This means that
Arduino, which means you cant use the 5V drop across it, which would reduce the you may need to re-scale the results to suit
reference but any of the others should be voltage seen by the micros AREF pin. the new ADC reference voltage.
OK. The enable line can be driven from one When writing micro software, keep in mind Note that, if using the enable feature, the
of the micros outputs to turn the reference that you will probably need to tell the ADC to AREF pin will be pulled near the positive
voltage on and off if required, or tied to the use the AREF input as its voltage reference, supply input when the reference is disabled.
5V rail to leave it permanently on. rather than its AVDD supply rail voltage. If the micro is running off 3.3V, its likely it
Note the top layer track cut. This is Its full scale reading (eg, 1023 for a 10-bit will not tolerate 5V on this pin, so be sure to
important for maximum accuracy because ADC) will then indicate a voltage equal to either run the reference off the 3.3V supply
without it, some of the supply current for (or just slightly less than) the new reference or leave it permanently enabled.

not sure whether IC1 would survive a OUT+ and IOUT) and verify the ex- This also has the advantage that any
reversed cell; it might, due to the cells pected current by connecting a DMM voltage up to the supply voltage can
internal resistance limiting current set to measure milliamps between be measured using the ADC.
but we havent been game to test this. IOUT and OUT. Note that the reading However, you are then at the mercy
may be a little lower than expected; see of the accuracy of the regulator provid-
Finishing it up the article on multimeter calibration in ing this supply. It may have a stated
Before placing the unit in its protective this issue for an explanation. error of less than 1%; for example, the
heatshrink sleeve, check that its work- Now its just a matter of sliding the MCP1700 low-dropout linear voltage
ing properly. First you need to insert clear heatshrink tubing over the unit regulator has a typical tolerance of
the cell (or cells). Check the polarity and shrinking it down. Dont cover 0.4%. However it isnt uncommon
markers on the holder and cell(s) and the test terminals right at the end of for a linear regulator to have a much
then slide them into place. the board, although its a good idea to larger output voltage error such as 2%
Next, press S1 and verify that insulate everything else. You can cut or even 5%.
LED1 lights up, then goes out about off any excess after shrinking. Note You also have to consider noise
20s later. Note that if you touch the that if using the double-stack CR2032 which may be injected into this rail
back of S1, your skin resistance can cell holder, the tubing will be a tight from other devices drawing power in
be enough to cause the unit to turn fit but we managed to get it onto our bursts, which can add an extra layer
on briefly (this will be prevented prototype unit OK. of uncertainty to ADC measurements.
once the heatshrink is in place). Youre now ready to check and/or Its much better to use an accurate
If LED1 does not turn on, it may have calibrate your multimeter(s) see the voltage reference, normally fed into a
been fitted backwards or there could accompanying article for details on dedicated pin on the micro (labelled
be a soldering problem. Press S1 and doing this. something like AREF). This will be
measure the voltage across LED1; if it free of noise and has the potential to
is 2V or more, then LED1 is suspect, Other uses have a much better defined voltage.
otherwise voltage is not getting to it This voltage reference may also be Note though that if you expect to
for some reason. useful to allow very accurate voltage make accurate measurements using
Assuming LED1 lights up, measure measurements to be made by micro- an ADC fed with such a reference
the voltage between OUT+ and OUT controllers, including those on Ar- voltage, you will also need to make
and verify that its within specifica- duino boards. sure that any voltage dividers feeding
tions. If it seems low, press S1 again The ADC in a microcontroller needs ADC inputs use resistors with accurate
to ensure Q1 is fully on. Now is also some sort of reference voltage. This is values or that you have the ability to
a good time to use a marker pen to in- usually either its supply voltage (5V or trim them. You will also need to keep
dicate which output voltage has been 3.3V) or an internally generated refer- the source impedance for the ADC in-
selected by marking one of the rectan- ence. However, the internal reference puts low, ie, dont use high values in
gles provided on the PCB silkscreen. is usually pretty inaccurate (0.1V is the divider.
If youve fitted the 1k resistor you typical) so in most cases youre better If in doubt, check the microcon-
can now check its resistance (between off using the supply voltage instead. trollers data-sheet.

16 Everyday Practical Electronics, August 2016

Voltage Reference0815 (MP 1st & SK) August 2016.indd 16 27/06/2016 09:00
Constructional Project

Reproduced by arrangement
180), read this value on the same
with SILICON CHIP range as you used to check the 1k
magazine 2016. calibration resistor, then switch into
www.siliconchip.com.au the lower range and verify that the
reading is correct. Then using a smaller
value again, proceed down through the
lower ranges.
Of course, the ideal situation would
be to have a precision resistance box
or a series of individual precision re-
sistors but in practice, this cheaper
method should do the job.

Ammeter checking
Testing an ammeter with the current
source on our reference board is a
little more involved because it has a
high output impedance of 1k. That
means that, depending on the multi-
meters range setting, its shunt resist-
ance (and by implication, burden volt-
age) will affect the reading. However,
you can easily compensate for this.
The simplest method is to use a sec-
ond multimeter to measure the shunt
resistance of the meter being tested.
The current is nominally 2.5mA for
the 2.5V unit (5mA for the 5V unit,
If you dont have a service etc) so it should be suitable for testing
manual for your multimeter,
you will have to figure out
both milliamp and microamp ranges
which pot does what by a (if present). To measure the shunt re-
process of trial and error. sistance, set the DMM on the range
being tested, then connect the second
meter in resistance mode between its
current measurement terminals.
First, set the multimeter to be cali- connect a resistive divider or poten- On our example meter, we got a
brated into DC voltage measurement tiometer across the reference outputs, reading of 101.28 on the microamps
mode and set the range to the lowest measure the resulting voltage on the range, 2.2 on the milliamps range and
range that will read the test voltage higher range and then check that the 0.077 on the amps range.
(if its auto-ranging, it will select this lower range gives a similar reading. You can then calculate what the
automatically). Connect the probes to meter should read in each range by
the OUT+ and OUT terminals on the Resistance mode adding the calibration resistor value
reference, switch it on and check the Checking the resistance reading is a to the measured shunt resistor values
reading. If it is as close to the expect- similar process. Set the DMM on its and dividing into the reference volt-
ed value as the meter can read, you lowest mode that can read 1k (this age. In our case, our calibration resis-
know its properly calibrated. You can will usually be the 2k, 4k or 5k tor measured 999.866 (an error of just
reverse the probes and check that the range) and check that the reading is as -0.013%!) and our reference voltage
negative reading is equally accurate. close as possible to the actual value. 2.499987V. Thus the expected read-
You can also check that the reading To check higher ranges, you could ings for this meter are:
is correct on higher settings, although use the same resistor however its bet-
the number of digits shown will of ter to pick a random resistor which (a) 2.499987V (999.866 +
course be reduced so this will be a is just below the maximum you can 101.28) = 2.270mA in A mode
less accurate test. Still, its worth do- read on the current range, note its (b) 2.499987V (999.866 + 2.2) =
ing. Note that a typical DMM typically value, then switch to the next higher 2.4948mA in mA mode
only has a single adjustment for its DC range and verify that the reading is
voltage mode so if it is out in some very close. You can then pick a re- (c) 2.499987V (999.866 + 0.077)
ranges and not others, you probably sistor with 10x the value as the last = 2.5mA in A mode
wont be able to improve the situation and repeat the process up through We didnt calibrate the example
without actually replacing some of its the ranges. DMM but we did check its read-
on-board multiplier resistors. Ranges below 1k can be checked ings against these and got 2.270mA,
For checking lower voltage ranges, using the same procedure, ie, pick a 2.495mA and 2.5mA respectively. So
where the output of the reference will resistor with a value thats towards it seems it doesnt need any adjust-
give an over-range error, you could the upper limit of the lower range (eg, ments for now.

18 Everyday Practical Electronics, August 2016

Multimeter Calibration0815 (MP 1st & SK) August 2016.indd 18 27/06/2016 09:03
Constructional Project

found it at the Fluke website. It con- meter thats way out of calibration! So
firms that the single trimpot is used to calibrate the voltage, resistance and
adjust the DC voltage reading. They current pots using the previous expla-
suggest using a test voltage of 3V, which nations for how to check the operation
our reference board can provide with of each mode. All you have to do is
a suitable reference IC, however 2.5V adjust the appropriate trimpot until
should work fine too. each reading is correct (or as close as
There should be a manufacturer- you can get it). If there are any pots that
While the nominal accuracy of the Maxim provided service manual available for you cant calibrate, refer to the photo
voltage reference is 0.04%, typically it just about every modern, brand-name you took earlier to set them back into
will be much better, as demonstrated by DMM on the market. If you have a re- their original positions.
this readout on a Keysight 34470A bench badged DMM, you may have some luck Note that in some cases, the pots
multimeter.
if you do a web search to find out the themselves may not be directly acces-
Performing calibration original manufacturers model number sible without removing the PCB or un-
If any of your checks give results with for that product, then look up the ser- plugging a sub-module, however you
a noticeable deviation from the ex- vice manual for that product. may find that you can adjust them from
pected values (ie, more than 1), you If you cant find a manual for your the back through holes in the board.
will probably want to trim the meter to meter but theres only a single pot, Generally its impossible to calibrate
make it more accurate. Unfortunately, chances are that, like the Fluke 77, it a multimeter without being able to
the procedure for doing this will be adjusts the reading in the DC voltage observe the display while making ad-
different for each meter, but there are mode. In that case, its just a matter of justments so theres usually a way to
some common steps. hooking the reference up and tweaking do it with the board still in the case.
First, you need to gain access to the it until the reading is correct. It may By the way, do not be tempted to
trimpots on the PCB(s). This usually in- or may not also affect the current and use the 230VAC mains or other high-
volves removing the back of the meter. resistance readings. voltage sources to calibrate a DMM.
If it is in a rubber holder, remove that If there are multiple trimpots though, It isnt safe to connect a DMM to the
first, then look for screws on the back. its unlikely they will be labelled with mains with the case open. You could
There are usually 2-4 screws holding anything other than a code. If you cant get a lethal shock if you do.
the back on. You may also need to re- find a service manual for your DMM,
move the battery cover first. youll have to figure out what they do Digital calibration
Usually, having undone the screws, the hard way. Some modern DMMs use digital
the back will pull off quite easily. First, take a photo of the trimpots so calibration. Theres no need to open
Modern DMMs are usually built on a you can see which position each one the unit up; calibration is performed
single board but some may comprise is in, in case you cant easily re-cali- by manipulating the buttons on the
two PCBs joined with headers or some brate it later. Then, switch the meter front panel. For example, our Agilent
other form of connector. Inspect the into each mode in turn and adjust each U1252A and U1253B multimeters use
board(s) and locate any trimpots. Weve trimpot. Youll probably have to hook this procedure.
seen as few as one and as many as 12! something up to the input terminals in In this case, youll need the service
If youre lucky, a service manual each mode to make changes apparent. manual for instructions on how to enter
will be available on the internet for Once you figure out what a given trim- adjustment mode and perform the cali-
the model of multimeter you are cali- pot adjusts, write it down and move bration. Its usually a similar process
brating which details the location and onto the next mode. to adjusting trimpots, except that the
function of each trimpot. Hopefully, by the end of this pro- up/down adjustments are made using
For example, we had a look for the cess you have a full list of what each pushbuttons. Youll still need the ref-
manual for our venerable Fluke 77 and trimpot does. Youll also likely have a erence board to make the adjustments.

Enclosures
for the hobbyist
Raspberry Pi specific
Arduino specific
plastic
die-cast aluminium
many designs and sizes

+ 44 1256 812812 sales@hammondmfg.eu www.hammondmfg.com


Everyday Practical Electronics, August 2016 19

Multimeter Calibration0815 (MP 1st & SK) August 2016.indd 19 27/06/2016 10:41
Constructional Project

cut the track and fit this resistor if you CON1

+ +
TP5.5V
intend using a 12V or 9V DC plugpack + CON1 L1

TL499A
+

REG1
TO CON1 TP5.5V

+
L1
to charge the cell instead of using a Low ESR
TP5.5V

H H
SOLAR +

TL499A
+

REG1
TO+ L1

TL499A
47 47
CELL +

REG1
Low ESR
solar panel. TO
SOLAR Low ESR

47 H
SOLAR
CELL 220 F 10V
A 220 1W resistor should be fitted CELL R1* D1

+ +
220 F 10V

CELLCELL
D2
5**0SEE 220 F 10V
for a 12V DC plugpack, while a 100 1 5 1R1 1 5 1 TEXTD1

330

100k

HOLDER
* D2 1nF
151051511R1 D1

4004 4004

4004 4004
Low ESR

AA AA
1W resistor is used for a 9V DC plug- 5 1 5*0SEE 5 1 TEXT

330
11nF

AA CELL
D2

100k

HOLDER
C 2015 * SEE TEXT 1nF

Sensitivity330
1 5 1 5 0 1 5 1 Low ESR

LMC6041 100k
15105151

SINGLE AA CELL HOLDER


100nF
1nF
5.5VSET TX1

4004

4004
pack. Dont forget to cut the PCB track 15105151SENSOR1
C HMC1021
2015 B1 1nF
Low ESR
470 F 10V
VR1 VR2 1M
HMC1021 1nF

100nF
C 2015 5.5VSET GND TX1
underneath the resistor a section of SENSOR1 B1 470 F 10V

100nF

CELL
TX1

LM2936Z-5.0
AD623
HMC1021 470 F 10V VR1 5.5VSET
VR2 1M

ALERT
DATA
SENSOR1
HMC1021

IC3 IC3
IC1 IC1

VoutVout 100nF Sensitivity


B1 Ferrite GND

LMC6041
HMC1021 VR1 VR2 1M
the track has been thinned so that it

CELL
HMC1021 Vcc

LM2936Z-5.0
Sensitivity
GND

AD623

LMC6041
ALERT
DATA
Ferrite

LM2936Z-5.0
AD623

AAAA
500

DRIVEWAY SENTRY ALERT


+ DATA
is easy to break.

IC3
Vcc

IC1
Ferrite

SENTRY
B2

100nF

= 168mm
100nF
Vcc

F F
1 F 500 +
The next step is to fit the two links
SENTRY
B2 1nF

SINGLE
1 F 1 F 100nF
ANT.

= 168mm
10 10
100nF
B2 100nF 500 +
1 F 1 F 100nF

100nF

ANTENNA = 168mm
Q41nF Q3 REG2

10 F
and their ferrite beads to the right of

SINGLE
1 1FF 100nF 2.2k ANT.
DRIVEWAY Q41nF 1 F 100nF Q3 100nF 10k
REG2 ANT.
1 F 2.2k
Sensor1. Its basically just a matter of

ANTENNA
100nF
DRIVEWAY
1 F Q4 BC327 Q3BC327 2.2k 10k REG2
ID
1 F 10k

+ +

ANTENNA
inserting a length of tinned copper BC327 BC327 ID

1010 1 F

PIC16F88
BC327 BC327 ID TP1

220
wire through each bead, then bending

2.2k
1010
4.7k4.7k

2.2kVout
LED1 22k22k

PIC16F88
VR3 10k TP1
+

10k10k
Low ESR

IC2 PIC16F88
220
the leads down on either side so that Low ESR VR3 10kTP1
220

2.2k
10

10
4.7k

22k
VR3
LK1 10k ENTRY

10k
Low ESR
470 F
they go through the holes in the PCB. A K

IC2 IC2
LK2 EXIT
10V LK1 ENTRY
470 F SWAP
Follow with the two 1N4004 diodes 470 F
10V
Q1 IRF540 Q2 IRF9540 A K LK1LK3
LK2 ENTRY
EXIT
TP GND

LED1
A K LK2 EXIT
10V Q1 IRF540 Q2 IRF9540 DETECT LK3 SWAP
(D1 and D2), taking care to ensure they

LED1
Q1 IRF540 Q2 IRF9540 LK3 SWAP TP GND
DETECT TP GND
go in with the correct polarity. An IC DETECT
socket should then be fitted for PIC Fig.12: install the parts on the detector PCB as shown here, starting with
microcontroller IC2, after which you the HMC1021 magneto-resistive sensor. Note that resistor R1 is omitted if
can solder IC1, IC3 and REG1 directly you are charging the AA cell from a solar panel (see text).
to the PCB (or you can install them in
IC sockets). Be careful not to get these
three 8-pin devices mixed up.
The seven PC stakes can now be
installed on the board. Five of these
are located at the TP 5.5V, TP GND,
TP1, Vout (next to IC2) and ANT (for
the UHF antenna) positions, while
the other two are fitted between coil
L1 and REG1 to terminate L1s leads.
Now for the capacitors. Fit the ce-
ramic and MKT polyester types first,
then install the five electrolytics. Note
that the 470F and 220F values must
be low-ESR types. Make sure that all
the electros are correctly oriented.
MOSFETs Q1 and Q2 are next on the
list, along with transistors Q3 and Q4
and regulator REG2. Be careful not to
get the MOSFETs mixed up Q1 is an
IRF540 N-channel type, while Q2 is an
IRF9540 P-channel device.
There are three trimpots on the PCB
and these can now be installed. VR1 The detector units antenna consists of a
is a 500 trimpot and may be marked 168mm length of insulated hook-up wire.
as 501, while VR2 and VR3 This should be fitted with a short length of
heatshrink tubing at its far end so that it
are both 10k trimpots and
cannot short against any parts on the PCB.
may be marked as 103. Be
sure to push them all the way
down onto the PCB before soldering
their leads. LED1 can then be soldered
in place with its anode lead (the longer
of the two) going to its A PCB pad.
Follow with the 3-way DIL header. Winding the inductor and strip the wire ends of the enamel
This part is installed to the right of Inductor L1 is wound on a powdered- insulation. The leads are then soldered
IC2, with the shorter length pins going iron toroid core using 32 turns of to the coils PC stakes, after which the
into the PCB. CON1, the 2-way screw 0.5mm enamelled copper wire. Wind toroid is secured in place using two
terminal block, can then go in with the turns on neatly in a single layer cable ties that loop through adjacent
its wire entry holes towards the left. around the core (see photo), then trim holes in the PCB.

Everyday Practical Electronics, August 2016 21

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 21 27/06/2016 09:08
Constructional Project

The detector PCB assembly can now polycarbonate case measuring 115 will invariably be a low-cost (read low-
by completed by installing the cell 90 55mm. This requires no prepa- quality) unit and you will be better off
holder, the UHF transmitter module ration apart from drilling a 12.5mm- discarding it and buying a new one.
and the antenna. The battery holder diameter hole in one end to accept a One problem is that the step-up
must be oriented as shown and is 3-6.5mm cable gland to feed through voltage regulator on the detector board
secured to the PCB using two self- the wiring from the solar panel (or will not initially operate if the NiMH
tapping screws. Its leads are then cut from a plugpack). AA cell is discharged. That means that
short and soldered to their PCB pads This hole is positioned 25mm the cell must be charged before test-
at either end of the holder, with the up from the outside base of the case ing the unit.
red wire going to the + pad and the and is centred horizontally. Use a If you dont have a suitable NiMH
black wire to the 0V pad. small pilot drill initially, then carefully charger, then the solar panel can be
Take care with the orientation of enlarge the hole to size using larger used to charge the cell. Its simply a
the UHF transmitter module. Its pin drills and a tapered reamer until the matter of removing the AAA cell and
designations are marked along one gland fits. the white LED from the garden light,
edge and its just a matter of fitting it to That done, the PCB assembly can then running leads from the solar pan-
the PCB with its antenna pin towards be lowered into the case and secured el to the detector PCB and installing
the bottom edge of the PCB (ie, towards using four M3 screws that go into the the AA cell in its holder. Note that the
the negative end of the cell holder). threaded corner bushes. The Neoprene solar cell must be in sunlight in order
The antenna consists of a 168mm seal for the lid then needs to be placed for charging to take place.
length of insulated hook-up wire. Sol- inside the surround channel and cut Alternatively, you can temporarily
der it to the antenna (ANT.) PC stake, to size. Note that the join in this seal run the leads from the solar cell to an
then cover the connection with a short must be along the lower, longer edge external cell holder. The detector PCB
length of 1mm-diameter heatshrink of the lid (the detector unit is later can then be temporarily fitted with an
tubing to prevent the lead from break- installed with the longer edges of the alkaline AA cell for testing.
ing at the solder joint. box running horizontally, so that the
PCB sits vertically to ensure maximum Detector PCB set-up
Fitting it in a case sensor sensitivity). Having installed the detector PCB in
The completed detector PCB can If you only require a UHF transmis- its case, its time to make a few adjust-
now be fitted inside a standard IP65 sion range of 40m or less, then the an- ments. Just follow this step-by-step
tenna wire can be positioned inside procedure:
the case (see photo). Make sure that
the the end of the antenna cannot short 1) Adjust trimpot VR1 to mid-setting
against the PCB or any of the parts (fit and set VR2 and VR3 fully anti-
some heatshrink tubing over the end clockwise.
to insulate it). 2) Install IC2 in its socket, making
Alternatively, for longer transmis- sure that its correctly oriented. Fit
sion ranges of up to 200m, the antenna the other ICs and REG1 if youve
wire can be fed out through a small installed sockets for these as well.
hole in the bottom edge of the 3) Fit the AA cell to its holder, then
box and this hole sealed with measure the voltage between the
silicone to keep water out. TP5.5V and GND PC stakes and ad-
just VR2 for a reading of 5.5V. If you
Solar panel cannot get sufficient voltage, it may
A free-standing solar panel be due to the AA cell. Check the cell
garden light will typically cost voltage and if thats OK, try momen-
1-2, with better quality units tarily removing the cell and reinsert-
coming in at around 5. This will ing it so that REG1 starts properly.
include the required solar panel, 4) Check that there is +5V at pin 14 of
a single NiMH cell and (typically) IC2 (this could be from 4.85-5.15V,
a white 5mm LED. However, the depending on the particular regula-
NiMH cell is usually an AAA tor used for REG2).
type and so wont be usable. 5) If all is OK, the unit should now
Even if an AA cell is fitted, it be ready to detect magnetic field
variations (about 10s after the cell
is installed). Orient the unit so
Left: inside the solar that the PCB is vertical and check
garden light. Its AAA that the bicolour LED lights red or
cell and white LED green if the unit is rotated by a few
must be removed and
degrees. The LED should then go
the cable from the
detector unit soldered out again after a brief period if the
across the battery unit is kept stationary.
holder contacts. 6) Check that the unit can detect a
pair of steel pliers if they are passed

22 Everyday Practical Electronics, August 2016

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 22 27/06/2016 09:08
Constructional Project

close to the sensor. LED1 should


light red if the pliers are passed in
one direction and green in the other.

Note that, in practice, IC1s output


should not swing too close to the sup-
ply rails. Output swings close to 0V
(<0.3125V) or close to 5V (>4.6875V)
will be indicated by the bicolour LED
alternately flashing red and green at
a 1s rate.
If that happens, there is either
a high magnetic field in the vicin-
ity of the sensor (eg, a magnet) or
IC1s gain is set too high by VR1.

Diagnostic mode
Now install a jumper between LK2
and LK3, as shown on Fig.13. This sets
the unit into diagnostic mode which
is used for testing only, since other
circuit functions are disabled and the
circuit draws a relatively high current
while its in place.
By installing this link, variations
in IC1s output can be monitored us- The detector PCB is secured to integral threaded corner posts inside its IP65
ing a multimeter connected between case. Be sure to install the NiMH cell the right way around and note that the
cell must be charged before testing the unit.
Vout and TP GND. You can either ro-
tate the detector unit or swipe a pair
of steel pliers close to the sensor and
then check that the DMM shows the
resulting variations in IC1s output.
Note: this mode is not used when
adjusting IC1s gain. Thats done later
by trial and error when the detector
unit is installed in the driveway.

Setting the identity


The diagnostic mode is also used when
adjusting identity trimpot VR3. If you
have only one detector unit, simply
set VR3 fully anticlockwise for a UHF
transmission identity of 1.
If you have more than one detector
unit, they will each need a different
identity to avoid interference. Its just a
matter of installing the diagnostic link
and adjusting VR3 so that the voltage
at TP1 matches an identity setting volt-
age, as shown in Table 3.

Linking options
As mentioned last month, jumpers Our prototype had the cable gland fitted to a side
panel but fitting it to the bottom panel would be
LK1-LK3 determine the information
preferable in many installations.
thats encoded into the UHF transmis-
sion sent to the receiver see Fig.13.
As shown, LK1 is installed for arrival the relay version of the receiver and If you want to trigger the remote
(entry) notifications, while LK2 gives you want to trigger a remote-controlled for both directions, install both LK1
departure (exit) notifications. Depend- mains switch for a set period of time and LK2.
ing on your requirements, you can ei- only when a vehicle arrives. In that LK3 is installed if the arrival and
ther install both these links or leave case, you would install a jumper on departure indications are incorrect
one or the other out. LK1 to signal vehicle entry but no (it simply swaps them around), while
For example, lets say that you build jumper link for LK2 (exit). installing a jumper between LK1 and

Everyday Practical Electronics, August 2016 23

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 23 27/06/2016 09:09
Constructional Project

AA cell for a few seconds and then re-


install it. By doing this, the thresholds
will readjust within 10s. Another way
is to change LK3 (ie, either install the
jumper or remove it). Each time LK3
is changed, the detection thresholds
re-track within 10s.
Once its working, the detector unit
can be permanently mounted using
the holes provided in the box corners
(these holes are accessible when the
box lid is removed). These holes could
either be used to directly secure the
unit or you could use them first to at-
tach a bracket (preferably made from
non-magnetic material) which is then
attached to a wall or post.

Connecting the solar panel


The solar panel is connected to the
detector via a length of figure-8 cable.
The detector unit must be attached to a non-metallic post or wall adjacent to the This cable is passed through the cable
driveway. You can either mount the solar panel on top of the detector or leave it gland, either in the side or bottom edge
in the garden light housing as shown at right. Make sure that the solar panel is of the case, and terminated in screw
mounted in a sunny location. terminal block CON1. Be sure to con-
nect the cable with the correct polarity
LK2 sends a non-directional indica- Before mounting it, ensure the unit will (the red wire thats connected to the
tion to the receiver. reliably detect a passing vehicle. solar panel is positive).
Note that the link settings operate in That can be done by temporarily Be sure also to disconnect the solar
exactly the same way for both receiver placing the unit on a wooden box or panel from the LED inside the garden
versions. stool so that its about 60-80cm above light fixture. The fixture should then be
ground (ie, so that it lines up with the installed nearby in a sunny part of the
Detector unit installation metal body of a car). If you like, you garden, to ensure that the solar panel
The detector unit can be installed along- can leave the diagnostics jumper in gets full sun during the day.
side the driveway on a post or wall. place so that you can check that Vout If that arrangement isnt conveni-
varies as a vehicle passes by. ent (eg, you dont have a nearby gar-
If it does, remove the diagnostics den bed), then the solar panel can be
JUMPER SHUNTS
jumper and check that the detector removed from the light fixture and
PIC16F88

MAKE SELECTION
WHEN IN PLACE
unit lights the green LED for one di- mounted separately. It may even be
rection of the vehicle and the red LED possible to mount it on top of the de-
LK1 ENTRY TRANSMITTED TO RECEIVER
LK2 EXIT TRANSMITTED TO RECEIVER for the other direction. If the vehicle tector unit using a suitable non-me-
IC2

LK3 SWAP ENTRY & EXIT DETECTION


SENSE
isnt reliably detected, adjust sensitiv- tallic bracket, as shown in the photos.
ity trimpot VR1 clockwise to increase Finally, use neutral-cure silicone to
IC1s gain (but dont set VR1 fully seal the wire entry into the cable gland
clockwise). Conversely, wind VR1 to keep moisture out of the case. The
JUMPER SHUNT FOR
anti-clockwise to decrease the gain if
PIC16F88

NONDIRECTIONAL same goes for any other possible water-


SENSING
the red and green LEDs in the bicol- entry locations (eg, screw mounting
LK1 our LED flash alternately at a 1s rate. holes for brackets).
LK2
In practice, VR1 should be set some-
IC2

LK3
where between fully anticlockwise Receiver assembly
and about three-quarters clockwise Fig.14 shows the assembly details for
in order to achieve reliable detection. the two receiver versions. Version 1
During this test procedure, the de- has the reed relays to trigger a remote
PIC16F88

tector must be kept still, otherwise it control PCB, while Version 2 has the
will detect changes in the Earths mag- piezo buzzer and LED indicators for
LK1
LK2
netic field due to its own movement. If audio/visual warnings only.
IC2

LK3 JUMPER SHUNT FOR that happens, the tracking thresholds As mentioned earlier, if you want
DIAGNOSTIC TESTING
then need to be readjusted so that they both sets of functions, you will have
sit equally above and below the ampli- to build both versions and set them to
Fig.13: this diagram shows the fied sensor voltage and this could take the same identity as the receiver. Note
linking options for the detector PCB. some time (eg, over a minute). that the LEDs and piezo buzzer must
The diagnostic jumper between LK2 If you want the tracking thresholds be omitted if you build the relay ver-
and LK3 is for test purposes only.
to readjust faster, you can remove the sion (Version 1), while the relays and

24 Everyday Practical Electronics, August 2016

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 24 27/06/2016 09:09
Constructional Project

VERSION 1 ANTENNA = 168mm VERSION 2 ANTENNA = 168mm

D3 78L05 15105152 Rev.B D3 78L05 15105152 Rev.B


2 5C1 52015
0151 2 5C1 52015
0151

100 F

100 F
100 F
100 F

100 100
REG1 REG1
4004

4004
100nF TP 100nF TP EXIT A
GND RELAY1 RELAY2 GND
+12V 0V
12V DC IN LED1
12V DC IN D2
PIEZO TRANSDUCER
PIC12F675

PIC12F675
D1

PIEZO
4148

4148
IC1

IC1
1k

1k

1k
ON OFF
CON1 2x10k CON1 2x10k A
ID

ID
TP2 TP2
TP1 100 TP1 VR1
ANT. VR1 VR2 (DUR.) ANT. VR2 (DUR.) ENTRY LED2
RX1 RX1
DATA
GND

GND

DATA
ANT

GND

DATA
GND

GND
Vcc
Vcc

DATA
ANT

GND
Vcc
Vcc
DRIVEWAY SENTRY ALERT MONITOR DRIVEWAY SENTRY ALERT MONITOR

Fig.14: the PCB parts layouts for the two receiver versions. Build Version 1 if you want to activate the buttons on a separate
remote control PCB (eg, to control a UHF remote mains socket). Alternatively, build Version 2 if you only require an audio/
visual warning when a vehicle passes the driveway detector unit.

Reproduced by arrangement These views show the two fully-assembled receiver versions.
with SILICON CHIP Make sure that all polarised parts are correctly oriented and fit
magazine 2016. heatshrink over the lead connections to the PC stakes to prevent
www.siliconchip.com.au the wires from breaking at the solder joints.

diodes D1 and D2 are omitted from An 8-pin socket should now be fitted Piezo transducer mounting
Version 2. for IC1. Make sure that the socket sits The piezo transducer used in Version
In most cases, its just a matter of flush against the PCB before soldering 2 mounts on two M3 9mm tapped
selecting which version you want to its pins, then install REG1 (78L05). The spacers. These spacers are secured to
build and assembling the board to two relays can then be fitted if you are the PCB using M3 6mm screws. The
match its layout. Install the resistors building Version 1. Check that these piezo transducer is then secured in
first, then install diode D3 (1N4004). are oriented correctly (ie, notched ends place, again using M3 6mm screws.
D1 and D2 (1N4148) should then be aligned as shown on Fig.14). You will have to drill out the trans-
fitted if you are building Version 1. Version 1 also requires three polar- ducers mounting tab holes to 3mm
Note that D2 must be installed about ised pin headers. Install these now, diameter to accept the M3 screws.
3mm proud of the PCB, since it needs bending diode D2s leads to the right, Once the transducer is in place, trim
to be later pushed to one side to make as shown in one of the photos to clear its wires to about 25mm, slip some
room for a polarised 2-way header. the header thats fitted between the 15mm lengths of 1mm-diameter heat-
The PC stakes are next on the list two relays. shrink tubing over the wires and solder
and these are installed at TP GND, TP1, Follow with the DC socket and trim- them to the adjacent PC stakes. The
TP2 and the antenna (ANT.) terminal. pots VR1 and VR2. The two LEDs can heatshrink can then be slid over the sol-
If you are building Version 2, two extra then be installed for Version 2 (red for dered connections and shrunk down
PC stakes can be fitted to terminate the LED1 and green for LED2). These two to prevent the wires from breaking.
piezo buzzer leads (or you can elect to LEDs must be installed with 11mm
solder these leads directly to the PCB). lead lengths, so that the tops of their UHF receiver
The capacitors can be installed next. lenses are 16mm above the PCB. Thats You can now complete the PCB as-
Note that for Version 2, the electrolytic easily done by pushing each LED down sembly by installing the UHF receiver
capacitors must be no more than 14mm onto an 11mm-high cardboard spacer module and the antenna. It must be
high so that they dont foul the lid of thats slid between its leads before sol- oriented with its antenna pin to the
the case. dering it in place. left (ie, towards the DC socket). As with

Everyday Practical Electronics, August 2016 25

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 25 27/06/2016 09:09
Constructional Project

Off Contacts the transmitter, the pin designations


are printed on the module.
Once its in place, solder a 168mm-
On Contacts long insulated wire to the antenna PC
stake. The soldered connection should
then be covered with heatshrink tub-
ing to prevent the wire from breaking.

Version 1 final assembly


The Version 1 PCB receiver assembly is
housed in a UB3 plastic case (130 68
44mm) with the PCB from the mains
sockets remote. Well describe how the
two are wired together shortly, after the
PCBs have been mounted in position.
The receiver PCB mounts in the
base of the case on M3 6mm tapped
spacers. Thats done by first placing the
PCB inside the case with the DC socket
flush against one end, then marking
out the four corner mounting holes.
These holes are then drilled to 3mm
and countersunk on the outside of the
box using an oversize drill.
A 9mm hole must also be drilled in
the end of the case to provide access to
the DC socket. This hole is positioned
17mm up from the base of the case and
Fig.15: this photo shows the wiring connections between Version 1 of the receiver centred horizontally. You will also
PCB and the remote used for the Jaycar UHF mains socket. You will need to
have to drill a small hole in this end
scrape away the solder masking from some of the pads on the remote PCB before
soldering the leads. of the case for the antenna lead if you
require a range greater than about 40m.
Once thats been done, the spacers
and the receiver PCB can be secured
in position using M3 10mm coun-
A UB3 plastic case tersink screws and nuts. The antenna
is used to house lead can be either run around the in-
Version 1 of the side perimeter of the case or fed out
receiver PCB and its through its exit hole. As with the de-
companion remote tector unit, make sure that the end of
PCB. The front-panel the antenna cannot short against the
label is optional. PCB or any of the parts.
The next step is to mount the re-
mote control PCB. Suitable remote-
controlled mains sockets include the
Jaycar MS-6142 and MS-6145 units
and the Altronics A0340.
Before removing the remotes PCB
module, the remote control mains

Modified sampling rate for indentites 5-8


socket should be set to operate as de-
scribed in the instructions. This will
familiarise you with the way the unit
Recent testing on the Driveway Monitor To overcome this problem, we have
works and allow you to set the channel
has shown that a vehicle can, on rare increased the sampling rate to 150ms
number and test its operation.
occasions, slip past the sensor unit for identities 5-8 (ie, where TP1 is set
undetected. To do this, the vehicle has for over 2.5V). So, if vehicle speeds are
Once youve done that, the hand-
to be travelling at over 20km/h and it likely to exceed 20km/h, set the unit to held remote can be disassembled. The
has to pass the detector between the one of these higher identities. Jaycar remote has one screw located
300ms sampling intervals. Identities 1-4 retain the standard beneath the battery cover and when
This will not be a problem for most 300ms rate. A disadvantage of the this is removed, the two halves of the
household driveways, but it could be 150ms sampling rate is that quiescent remote case can be cracked open along
a problem on rural driveways where current from the AA cell increases from the sides with a screwdriver. Similarly,
speeds can easily exceed 20km/h. about 3mA to 6mA. the Altronics remote has two screws
under the battery compartment lid

26 Everyday Practical Electronics, August 2016

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 26 27/06/2016 12:35
Constructional Project

0V +12V
Unit pairing
A feature of the Driveway Monitor is
Off Contacts
pairing each detector and receiver
pair is given a unique identity. This
allows up to eight different pairs to
operate in the same vicinity, which
means you can have multiple Driveway
Monitors installed on your property.
On Contacts
Pairing is set by adjusting trimpots
VR3 in the detector unit and VR1 in
the receiver to give matching voltage
readings at their respective test points
Fig.16: heres how to make the connections to the Altronics UHF remote PCB. see text and Table 3.
The red and black leads shown are all part of the original wiring.

and removing these allows you to mounting points (note the Jaycar units receiver PCB into position and either
split the case. holes will need to be enlarged to 3mm. feed the antenna wire through its hole
Its then just a matter of removing In each case, the unit is mounted on M3 or run it around inside the case.
the remote PCB and connecting leads 9mm tapped spacers and secured us- Finally, three holes have to drilled
from the polarised headers on the re- ing M3 6mm machine screws. in the lid two for the indicator LEDs
ceiver PCB. The 12V header is wired We used countersink-head screws and one directly above the piezo trans-
to the remotes supply rails, while the for the lid so that the heads sit flush ducer to let the sound out. You can ei-
other two headers are connected to the with the panel to allow a front-pan- ther copy and use Fig.17 as a drilling
remotes on and off button contacts for el label to be attached. Position the template or you can simply measure
the selected channel. That way, when mounting holes so that the remote PCB the hole locations and then mark their
the Driveway Monitor is triggered, one is centred on the lid, then mount the positions on the lid (the artwork is
reed switch closes briefly to turn the PCB in position and plug the various also available for download as a PDF
remote-controlled mains switch on. leads into their corresponding sockets file from the EPE website). Drill 3mm
The other then closes briefly a few min- on the receiver PCB. holes for the LEDs and a 6mm hole for
utes later to turn the mains switch off. the piezo transducer.
The leads from the headers can be Version 2 final assembly
run using 120mm lengths of light-duty The Version 2 receiver is housed in a Testing (both versions)
hook-up wire. At the header end, its UB5 case (83 54 31mm), making it Before applying power, make sure that
just a matter of crimping the wires into more compact than the Version 1 unit. IC1 is out of its socket and that all parts
the crimp lugs and then lightly solder- In addition, no mounting hardware is are correctly oriented. That done, ap-
ing them before pushing them into the required for Version 2 since the PCB ply power from a 12V DC plugpack
header shell until they are captured by simply clips into slots in the integral and check that there is 5V between
the tag springs. Use red and black leads side channels in the case. pin 1 of IC1s socket and the GND PC
for the 12V header and make sure you Before installing the PCB, you will stake (4.85V to 5.15V is acceptable). A
get the polarity correct. have to drill a 9mm hole for the DC reading below 4.85V could mean that
Figs.15 and 16 respectively show the socket. This should be positioned there is a short circuit somewhere or
connections to the Jaycar and Altron- 20mm up from the base and centred an electrolytic capacitor could be the
ics remote PCBs. horizontally. As with Version 1, drill a wrong way around.
On the Jaycar unit, it will be neces- small hole for the antenna lead if you If the 5V supply is correct, discon-
sary to scrape away the solder mask- require a range greater than about 40m nect power and plug IC1 into its socket
ing from the PCB before soldering the (ie, up to 200m). You can then clip the (make sure its correctly oriented). Once
connections. Once all the wires are in
place, fit cable ties around the switch
wires to prevent them from pulling Table 3: Identity voltage settings
away from the PCB. Its also a good idea Identity Minimum Setting Maximum Setting Recommended
to use neutral-cure silicone or hot-melt 1 0V 0.47V 0-0.31V
glue to hold the wires in place.
2 0.78V 1.09V 0.94V
In the case of a doorbell remote, its
simply a matter of wiring the first reed 3 1.41V 1.71V 1.56V
switch across the switch contacts. This 4 2.03V 2.34V 2.19V
reed switch could also be used to trig- 5 2.66V 2.97V 2.81V
ger a burglar alarm. 6 3.28V 3.59V 3.44V
The remote PCB is mounted on the
7 3.91V 4.21V 4.06V
underside of the case lid. Both remotes
have two holes that can be used as 8 4.53V 5V 4.69-5V

Everyday Practical Electronics, August 2016 27

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 27 27/06/2016 09:09
Constructional Project

Front panel labels


The front-panel labels are optional.
They can be made by downloading
the relevant PDF files from the EPE
website and then printing each
one as a mirror image onto clear
overhead projector film (use film
thats suitable for your printer). By
printing mirror images, the toner
or ink will be on the back of each
Version 2 of the receiver is housed film when its fitted. The labels can
in a UB5 plastic case. You will need be secured using clear silicone
to drill holes in the lid for the LEDs adhesive.
and piezo buzzer. Alternatively, you can print onto
a synthetic Data flex sticky label
if using an inkjet printer or onto
SILICON CHIP SILICON CHIP
Fig.17: this full-size a Datapol sticky label for a laser.
artwork can be used DrivewayDriveway
Monitor Monitor
Departure + Departure + (1) For Dataflex labels, go to:


Receiver


as a drilling template Receiver www.blanklabels.com.au/index.
for the Version 2 case php?main_page=product_info&
12V DC
100mA
12V DC

+
100mA

lid. You can either +


+

+ cPath=49_60&products_id=335


.

.
.

.
copy it or download it
(2) For Datapol labels go to: www.

 
as a PDF file from the
EPE website. Arrival + blanklabels.com.au/index.php?
Arrival +
main_page=product_info&cPath
=49_55&products_id=326

its installed, reapply power and adjust VR1 to set the


Arduino Electronics receivers identity by monitoring the voltage on TP1.
Typically, VR1 is set fully anticlockwise to select iden-
Upgrade your Arduino Electronics to the Next Generation with tity 1. If you require a different identity (eg, to match
TinyDuino a second detector unit), set it to match the detector as
As powerful as the Arduino Uno but smaller than a 2 pence coin. shown in Table 3.
Available from our eShop Trimpot VR2 sets the alert duration. For Version 1, this
is the time period between when relay 1 briefly turns
on and closes the remotes ON contacts to when relay
2 briefly turns on and closes the remotes OFF contacts
(ie, it determines how long the remote mains socket is
switched on). This time duration ranges from about 20s
when VR2 is fully anticlockwise to about five minutes
when VR2 is fully clockwise.
You can quickly set the duration by monitoring the
All the power of the Arduino in a fraction of the space, great voltage between TP2 (ie, VR2s wiper) and TP GND.
for building intelligence in to your projects.
Adjust VR2 for 5V on TP2 for five minutes, 2.5V on
Complete with a wide and growing range TP2 for two and a half minutes and 1V on TP2 for one
of TinyShields - where will your next minute...
project take you? Alternatively, for Version 2, VR2 adjusts the length of
Move up to the Next Generation! the entry and exit tones from 1-5s. Each indicator LED
then lights for the length of its corresponding tone and
Fantastic for schools especially D&T and stays on for about 15s after the tone ceases.
Computing, meets the new requirements All that remains now is to check that the unit is trig-
gered whenever a car passes by the detector unit. If the
As an authorised reseller with an educational and
training focus we can support all aspects of this
unit fails to trigger or is unreliable, check that the de-
outstanding piece of kit! tector unit is functioning properly as outlined in its in-
stallation procedure above. If thats OK, check that the
Get yours today via our eShop detector and receiver identities match.
Finally, if you still have problems and the antennas
are inside the cases, feed them outside and straight-
en them out to improve the range. They should also
www.eshop.icsat.co.uk be oriented the same way; ie, both vertical or both
horizontal.
28 Everyday Practical Electronics, August 2016

Driveway Sentry0815 (MP 1st & SK) August 2016.indd 28 27/06/2016 09:09
EXCLUSIVE OFFER

Win one of 10 Microchip


MPLAB Xpress
Evaluation Boards
E VERYDAY PRACTICAL ELECTRONICS is offering its readers the chance to win one of 10 Microchip MPLAB
Xpress Evaluation Boards. The new MPLAB Xpress Evaluation Board features an integrated programmer, a
PIC16F18855 MCU and a mikroBUS header for system expansion with MikroElektronikas 180+ Click boards. The
PIC16F18855 is a general-purpose 8-bit microcontroller that sports one of the largest selection of Core Independent
Peripherals to date.

The evaluation board can be used with Microchips new MPLAB Xpress Cloud-based IDE. MPLAB Xpress offers an
easy way to get started with PIC microcontrollers, with zero downloads, sign-in or setup needed to start designing.
This free cloud-based IDE brings the most popular features of the MPLAB X IDE to Internet-connected PCs, laptops or
tablets. MPLAB Xpress offers a comprehensive feature set, including a library of Microchip-validated code examples,
interface to MPLAB Code Configurator (MCC) 3.0 for GUI-based microcontroller peripheral setup and automatic code
generation, integrated MPLAB XC compilers, support for programmer/debugger hardware, and 10GB of secure online
storage with a myMicrochip account. Users can easily migrate their projects to the full, downloadable MPLAB X IDE.
Additionally, the MPLAB Xpress community enables developers to share their code, design ideas and knowledge.

The MPLAB Xpress Evaluation Board connects to a host computer (PC, Mac or Linux) as a USB mass storage device
and allows the user to simply drag and drop an application executable (.hex) file to program the target.

WORTH
$10.00
(appro
x . 7.00
)
EACH

April 2016 ISSUE WI


NNERS
Mr Ed Rees, who wo
rks at Reeset Electr
Maidenhead, UK onics,
Mr Ajith De Mel, wh
o works at HS Electr
Colombo, Sri Lanka onics,
Mr Ravi Rao, who wo
rks at Analogic Syste
And Services, Pune ms
, India
They all won aMicr
ochip Curiosity
Development Board
, valued at 13.00
HOW TO ENTER
For your chance to win a MPLAB Xpress Evaluation Board, visit:
http://www.microchip-comps.com/epe0716 and enter your details in the online entry form.

CLOSING DATE
The closing date for this offer is 31 August 2016.

Microchip offer V2 AUGUST 2016.indd 37 27/06/2016 09:11


Constructional Project

By NICHOLAS VINEN

USB Power
Monitor
Above: the unit operating in Power mode. It shows that the
flash drive is drawing 0.343W from the laptops USB port.

Curious about how much power your USB peripherals use?


Perhaps you are building a USB device and want to check
its consumption. Or maybe you want to figure out how many
devices you can plug into an un-powered hub or what impact
a USB device has on your laptop battery life. Build this USB
Power Monitor and find out.

T HIS SIMPLE, compact device con-


nects in series with one or more
USB devices and displays the current
with ports on either side of a laptop
(using the display flip feature), al-
though its optimised for use on the
ports will allow up to 1A or more to
be drawn before shutting down. This
is a low enough limit to prevent a
they are drawing at any given time. righthand side. short circuit from damaging the port
It can also show you the bus voltage but high enough that most connected
and calculate the power consumption USB power overview devices should get enough power.
in watts. Its auto-ranging, so it will The Universal Serial Bus consists of To complicate matters, multiple de-
read down to just a few microamps four lines per port: two for power (0V vices can be connected to a single USB
and up to over an amp. Similarly, it and 5V) and two differential signals port using a hub. The power drawn
will read out in milliwatts or watts. for bidirectional data (D+ and D). by an unpowered hub is its own op-
You can cycle the modes simply by The supply is nominally 5V but due erating power (usually ~50mW) plus
pressing a button. to imperfect regulation at the source that of all the devices plugged into
It uses a low value (50m) shunt and voltage drops across the wiring, a it. You can see how you can easily
to measure the current so this will device can expect to receive between exceed 500mA per port by plugging
have little effect on the voltage re- 4.4V and 5.25V. enough devices into a hub you can
ceived by the peripherals. The read- A USB device is allowed to initially even plug hubs into hubs!
ings are displayed on a 4-digit LCD draw 100mA but can negotiate for Powered hubs are another matter;
panel, similar to that used by digital more current; up to 500mA. With the these have their own power supply
multimeters. This is readable from a nominal 5V supply, that means that (typically a plugpack) and so only a
wide range of angles. Calibration is no more than 2.5W can be drawn from minimal amount of current is drawn
performed by the microcontroller the any given port. Some (but not all) USB from the upstream port.
first time it is powered up, and can be ports provide current limiting so that
repeated later to keep measurements if too many devices are connected or if Standby mode
as accurate as possible. a device tries to draw too much power, When a computer enters standby or
The whole unit measures 90 35 the supply is cut and the port reset. sleep (power saving) mode, it sends
10mm and is encased in clear heat- In practice though, certain devices a signal to the connected USB pe-
shrink tubing. When plugged in, its such as portable hard drives will draw ripherals to do the same. When in
like a wide USB flash drive with an more than 500mA when they are first standby, they are expected to draw
LCD on top. It can either go straight plugged in (eg, as the hard disk mo- no more than 0.5mA (2.5mW). When
into a USB port or be connected via tor spins up) so the USB port current the computer subsequently wakes
a USB extension cable. It can be used limit is not strictly enforced; many up, it sends another signal to the

30 Everyday Practical Electronics, August 2016

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 30 27/06/2016 12:36
Constructional Project

peripherals which can then resume


normal operation. Features and Specifications
When in standby, devices can wake
up the host and this feature is most Measurement modes: current, voltage, power
often used by USB mice and key- Current resolution: 1A (0-10mA), 1mA (10mA-1A+)
boards. Also, devices may go into Voltage resolution: 10mV (4.4-5.5V)
standby mode if they are currently
inactive; for example, a hub with no Power resolution: 10W (0-10mW), 1mW (10mW-1W), 10mW (1-5W+)
connected devices will generally drop Current accuracy: 2.5% 0.1mA (mA range), 5% 10A (A range)
into standby mode after a few sec- Voltage accuracy: 2.5% 10mV
onds but will resume normal (higher
Power precision: 5% 0.1mW
power) operation if you plug a device
into the hub. Temperature-related error: typically <1A/C
So you can see how a USB power Load voltage drop: typically less than 50mV
monitor has a number of useful ap- Power consumption: 5.3mA/26mW
plications. You can test devices to
Other features: display flip mode, mode memory, digital calibration
ensure that they do not draw more
than 0.5mA in standby or 100mA
before they have been configured. You
can check the total power draw of a means you can either measure up to on a single double-sided PCB. USB
hub and its attached devices. You can 200mA with 0.1mA resolution or up plug CON1 goes into the computer
even see how the power consump- to 2A with 1mA resolution. Really, or USB charger. Current then flows
tion changes depending on what the we want to measure to at least 500mA from its pin 1 (+5V) through the 0.05
devices are doing, in real time. and we want a minimum resolution shunt resistor to pin 1 of CON2, the
Also, devices running from a port- of 0.1mA; preferably better at lower USB socket. Return current passes
able computers USB ports will cause current readings. Our design, while a directly from pin 4 of CON2 (ground)
its battery to discharge faster and little more complex, does even better, to CON1.
you may wish to determine just how with readings beyond 1A and a resolu- The USB D+ and D data signals
much effect this has on battery life. tion of 1A for readings below 10mA. pass straight through from pins 2 and
By measuring how many watts each By using a microcontroller we can 3 of CON1 to CON2, with the tracks
device draws, you can divide this by also add some extra modes such as running right across the PCB. They are
the battery capacity in watt-hours to voltage and power reading which just close together so that any interference
determine the proportion of battery make it so much more convenient to couples into both lines by a similar
charge those devices will deplete per use. We were also able to keep the unit amount, preserving the integrity of
hour of operation. fairly slim and compact, with large, the differential signal.
For example, say you have a 3G easy-to-read digits. The 0.05 resistor is a special type
wireless Internet dongle and the USB with Kelvin connections, ie, it has
Power Monitor tells you that it draws Circuit description four terminals, each pair of which are
2.5W while active. If your laptop has Refer now to Fig.1 for the complete internally joined to the resistive ele-
a 12V, 5Ah (60Wh) battery then this circuit diagram of the USB Power ment. This prevents resistance in the
will drain 2.5W 60Wh = 4.2% of Monitor. All the parts shown mount solder joints from affecting current
the batterys capacity, per hour of use.
If your laptop normally lasts four
hours on battery then it will typically
USB power delivery enabled devices
draw 60Wh 4h = 15W, so we can
calculate that it will last 60Wh (15W Virtually all USB ports supply a nominal 5V and this project relies on that fact.
+ 2.5W) = 3 hours 30 minutes with the USB 3.0 has introduced ports able to supply up to 900mA (which this device
3G dongle connected and operating, can handle), increasing the power delivery from 2.5W per port to 4.5W. But for
ie, using the 3G dongle will reduce a lot of devices, that still isnt enough.
the battery life by 30 minutes. Hence, a new specification has been developed. Called USB Power Delivery,
it is designed to allow compatible devices to draw much more power from a
Design USB 2.0 or USB 3.0 port up to 100W. Partly this is achieved by the device
We have seen other designs for USB negotiating for a higher supply voltage of either 12V or 20V, as well as beefier
power meters and although we liked cables to carry up to 5A.
the concept, we werent so impressed We havent seen any devices which comply with this spec yet, but when they
with the execution. While you can arrive, youll have to be careful NOT to connect the USB Power Monitor between
measure the current drawn by a USB a port and device which may be operating at 12V or 20V. If you do and the bus
device with just a USB plug, socket, voltage is increased, it will almost certainly destroy the USB Power Monitor.
shunt resistor, shunt monitor and Part of the spec involves having the hardware able to check that the at-
panel meter, this approach is quite tached cable(s) are capable of carrying the higher voltages and currents, so
limited. its possible that they will refuse to deliver a higher voltage with the USB Power
A typical panel meter has a full- Monitor attached. But we wouldnt rely on it.
scale sensitivity of 200mV, which

Everyday Practical Electronics, August 2016 31

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 31 27/06/2016 09:44
Constructional Project

As well as amplifying the voltage flowing, which is the ~385mV refer-


Parts list drop, it provides an output that is ence plus IC2s output offset error.
referenced to ground or some other It can then subtract this from future
1 double-sided PCB, available low voltage, regardless of the supply readings and since the reference volt-
from the EPE PCB Service, voltage fed to the shunt which can age is higher than the largest possible
coded 04109121, 65 be in the range of 14V to 80V. It can negative offset error, this will always
36mm even measure current flow in either be able to correct for the offset. It
1 4-digit LCD direction, but we are not using that should not require frequent re-cali-
1 PCB-mount right-angle USB feature in this circuit. bration as IC2 has a very low offset
Type A plug The INA282 has an internal 1:1 drift (hence its zero-drift moniker).
1 PCB-mount right-angle USB resistive divider between the REF1
Type A socket and REF2 pins which can be used to Microamp measurements
1 5-pin header, 2.54mm pitch generate a half-supply rail, so that the Op amp IC3b amplifies the output of
(CON3) output can swing symmetrically for IC2 by 100, to allow IC1 to accurately
1 PCB-mount tactile pushbutton bidirectional current measurement. read low-current values. Unfortunate-
1 80mm length of clear As we arent using that feature, we ly, this also amplifies IC2s offset error
heatshrink tubing, 25-30mm simply tie the REF1 and REF2 pins by a factor of 100. IC3b itself contrib-
diameter together and drive them with a low- utes a further offset of up to 2.5mV,
impedance voltage source which is but this pales in comparison to the
Semiconductors then the reference (signal ground) up to 350mV error (3.5mV x 100)
1 PIC18F45K80-I/PT voltage for IC2s output. contributed by IC2. This is why we
programmed with 0410912A. With no voltage across the shunt chose a reference voltage of around
hex (IC1) resistor, the output at pin 5 sits at 385mV, to allow for the full range of
1 INA282AID shunt monitor (IC2) the same voltage with which we are offset variations to be trimmed out.
1 OPA2376AID dual op amp (IC3) driving the REF1/REF2 pins (3/7). As The 220nF capacitor across IC3bs
Capacitors (SMD 3216, X5R/X7R) the voltage across the shunt rises, the feedback resistor (10k) greatly re-
1 10F 6.3V output voltage increases proportion- duces the amount of noise from IC3bs
3 220nF 16V ally above this reference level. The output, as it dramatically reduces
INA282 has a fixed internal gain of the gain stages bandwidth to about
Resistors (SMD 3216, 1% 1/8W) 50, giving us an output of 2.5V/A. 72Hz. IC3bs effective signal ground
1 120k IC2 can have an input offset volt- is the same reference voltage that is
3 10k age of up to 70V and with a 50m fed to IC2.
1 100 shunt, that gives an equivalent error Microcontroller IC1 measures the
1 50m 0.5% 0.5W 4-terminal of 1.4mA or 3.5mV at the output. output of shunt monitor IC2 at its
shunt (element14 1462296) This offset error varies from device AN2 input (pin 21). Similarly, the
Note: kits for this project are to device but remains fairly constant amplified signal from IC3b goes to the
available from Jaycar Electronics over its life and with variations in AN3 input at pin 22. The micro can
with SMDs presoldered Cat supply voltage and temperature. The then select which voltage to measure.
KC-5516). error is usually well under 3.5mV but In practice, it does this by first meas-
can be enough to seriously affect low uring the voltage at AN3 and if this
current readings (eg, in the microamp indicates a reading of 10mA or more,
measurements; otherwise, this resist- range) so we need a way to trim it out. it measures AN2 instead for a greater
ance would effectively be in series If that error was always positive, we measurement range.
with the resistor itself and thus its could simply connect REF1 and REF2 We interpret readings from AN2 as
value would be higher than expected. to ground, have microcontroller IC1 2.5mV/mA and for AN3, 250mV/mA.
We measure the current flowing (PIC18F45K80) measure IC2s output IC1 uses an internal 4.096V reference
through the shunt by sensing the volt- with no current flow, store that value as the full-scale voltage for each con-
age drop across it. Ohms Law tells and subtract it from future readings. version, giving a maximum reading of
us that this will be 50mV/A 0.5% But the offset voltage can be negative about 1.5A for input AN2 and 15mA
(the resistor tolerance). So we will too and this scheme would fail to cor- for input AN3. With a 5V supply, the
be measuring very small voltages; the rect negative output errors. output of IC2 can go as high as 4.8V,
unit will read down to 10A or less, To solve this, we are driving the giving us a maximum possible reading
giving a voltage drop of around 0.5V. REF1 and REF2 pins with a nomi- of about 1.75A.
The voltage across the shunt is nal 385mV reference level which is As well as a very low offset voltage,
amplified by IC2, an INA282 chopper- derived from the 5V supply using a op amp IC3 (OPA2376) has a number
stabilised zero-drift current shunt resistive divider (120k/10k). This of other attributes which make it suit-
monitor. This operates in a similar voltage is buffered by op amp IC3a, able for use in this type of application.
manner to an instrumentation ampli- configured as a voltage follower. This Its designed to run from low supply
fier, but is specifically designed for ensures that REF1 and REF2 are driven voltages (2.7-5.5V) and has low noise,
measuring current. It runs directly off with a low impedance, maintaining high bandwidth (5.5MHz), low quies-
the 5V USB supply from CON1, with the accuracy of IC2s measurements. cent current (~1.5mA) and an output
a 220nF bypass capacitor to ensure The software in the micro measures that can swing to both supply rails
low supply impedance. the output of IC2 with no current (down to 0V and up to 5V).

32 Everyday Practical Electronics, August 2016

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 32 27/06/2016 09:44
Constructional Project

Vbus R1 0.05
C ON1 C ON2
Vbus
1 1
2 D 2
USB USB
PLUG 3 D+ 3 SOC KET
4 GND 4

Vin Vout

:
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21

8.8.8.8
C OM1

1a

2a

3a

4a
1g

2g

3g

4g
C OL
1b

2b

3b
1f

3f

4f
NC
NC
NC

2f
220nF C OL
IC 2
LC D1 ZD1886

6 1 2 3 4
1 IN
V+ 4
NC
5
INA282 REF2 DP1 DP2 DP3
8
+IN REF1
C OM1

GND 7
DP1

DP3
DP2
3
NC
NC
NC

2d

3d

4d

4b
2c
2e

3e

4e
3c

4c
1d
1e

1c
2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

120k IC 3: OPA2376
3
1
IC 3a
2
10k
4

220nF
5 8
100
7
IC 3b
6 7 28
8 Vdd Vdd 1
RB0 RC 7
10k 9 44
RB1 RC 6
10 43
RB2 RC 5
11 42
RB3 RC 4
14 37
220nF RB4 RC 3
15 36
RB5 RC 2
16 35
RB6 RC 1
17 32
RB7 RC 0
12 IC 1 5
NC RD7
13
NC
PIC 18F45K80 4
RD6
19 3
10k RA0/AN0 RD5
C ON3 20 2
RA1/AN1 RD4
1 27 41
RE2/AN7 RD3
2 26 40
RE1/AN6 RD2
IC SP 3 25 39
RE0/AN5 RD1
C ONN. 4 18 38
RE3/MC LR RD0
5 24 30
RA5/AN4 OSC 1/RA7
21 31
AN2/RA2 OSC 2/RA6
22 23
AN3/RA3 VDDCORE/VCAP
33 34
NC NC
S1 Vss Vss
6 29
10 F

USB POWER
SC USB
2012 POWERMONITOR
MONITOR
Fig.1: the complete circuit of the USB Power Monitor. USB current passes through a 50m shunt resistor and the voltage
drop across this is amplified by shunt monitor IC2 and then further amplified by op amp IC3b. Microcontroller IC1 uses
its internal ADC to measure the current and display it on LCD1. Op amp IC3a buffers a reference voltage, used to allow
IC1 to determine the static (offset) error in the current measurements.

Everyday Practical Electronics, August 2016 33

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 33 27/06/2016 09:44
Constructional Project

: 8.8:.8.8
GND VBUS
0.05
LCD1 ZD1886 CON2 CON2 10 F
220nF
CON1 IC2
INA282 CON1
23
34
4 4 4 4
120k
3 3 3 IC1 3
10k

2376
IC3
2 2 2 PIC18F45K80 2
1
10k
1 1 1
12
1 100
1
ICSP 220nF
220nF CON3
S1
10k

(FRONT VIEW) (BACK VIEW)

Fig.2: top and bottom views of the USB Power Monitor PCB. The LCD, connectors and pushbutton switch S1 (used to
change modes) are the only components on the top. All the active circuitry goes on the underside and this keeps the unit
compact. The VBUS and GND pads are provided so you can measure the USB voltage for calibration. The completed
PCB assembly can be housed in clear heatshrink tubing for protection.

Note that the ~385mV reference LCD has a total of 32 segments four the common pins, receive 10V peak-
voltage will vary with the USB sup- 7-segment digits plus three decimal to-and so turn on.
ply voltage as it is derived from it. points (DP1-DP3) and a colon. Each We use an AC drive signal since
This could introduce an error in the segment is connected at one end to a DC drive slowly damages the LCD by
current measurements but microcon- dedicated pin while at the other end, an electrochemical process. In this
troller IC1 can compensate for this all segments are joined together and case, its also required to provide a
by measuring the supply voltage and connect to a pair of common pins, sufficient drive voltage as this method
adjusting the value that it subtracts COM1 and COM2 at left. To turn a seg- doubles the RMS voltage across the
from each reading. This mostly elimi- ment on (dark), we drive the segment segments, ie, they receive 10V rather
nates the effect of supply variation with a 6-10V peak-to-peak square than 5V. The AC signals are generated
on readings. wave and to turn it off, we maintain using one the microcontrollers inter-
Note also that part of the reason 0V across the segment. nal timers and two of the compare
for selecting a 50m shunt is to keep This is achieved by driving all units, combined with an interrupt
its dissipation low over the expected the LCD pins (including COM1 and handler routine that updates the
current range. At 1A, it will dissipate COM2) with one of two 5V 50Hz output pins at 100Hz.
just 50mW (I2R) and even at 2A, it will square waves which are 180 out of Like the analogue chips, microcon-
be a manageable 200mW the part is phase, ie, one is an inverted version troller IC1 runs directly off the USB
rated for up to 0.5W. of the other. Any segments driven bus voltage. Note that we havent
with the same signal as the common made any additional connections
Display driving pins have no voltage across them and from the USB supply to allow it to
The 4-digit LCD (LCD1) is driven so remain off. Those driven with the sense that voltage, in order to display
directly by microcontroller IC1. The inverted square wave, compared to it. Rather, this is achieved by config-
uring its ADC to sample its internal
(nominal) 1.024V reference in relation
The USB Power Meter is shown here to its supply voltage. It can then cal-
measuring the voltage (in this case, 5.04V) culate the reciprocal of this in order to
of a laptops USB port. The b on the LCD determine what its supply voltage and
indicates that the unit is operating in bus thus what the bus voltage actually is.
voltage mode. The same 1.024V reference is mul-
tiplied by four using an internal op
Pressing the pushbutton switch at lower amp, to produce the 4.096V ADC ref-
right on the PCB cycles through the various erence voltage which allows current
operating modes. measurements to be made accurately.
In addition to a 220nF bypass ca-
pacitor across the 5V supply, IC1 has
a 10F filter capacitor connected to
its VDDCORE pin, which is required to
allow its internal 2.5V core regulator
to function properly.
A pushbutton is connected be-
tween pin 18 of IC1 (RE3/MCLR) and
ground, with a 10k pull-up resistor.
Normally, this pin is used to reset
the micro, but we have programmed
it to disable that function so that we

34 Everyday Practical Electronics, August 2016

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 34 27/06/2016 09:44
Constructional Project

the three ICs and then follow with


the passive components. These are all
fairly large for SMDs so you should
not encounter too many difficulties.
Start by applying some solder to
one of the IC pads and then, using
tweezers, slide the part into place
while heating the solder on that pad.
Remove the iron and check that the
part is correctly oriented (pin 1 dot/
divot as shown) and that it is properly
centred on its pads. If not, re-heat the
solder and gently nudge the chip into
place. Repeat until its right and then
solder the rest of the pins. Remember
to re-fresh the solder on the first pin
you soldered when youre finished.
If you accidentally bridge any of
the pins, simply use solder wick to
clean it up. A dab of no-clean flux
These views show the unit before the clear heatshrink tubing is fitted. Take
care when soldering the SMDs they must be correctly aligned with their
paste applied to the bridge beforehand
pads. You can easily remove any solder bridges using solder wick. Note: makes it disappear a lot more quickly
prototype PCB shown; some resistor values changed for final version. and easily.
The same basic technique applies
for the passive parts, although they
can use this pin as a digital input, to convenient but we also found that only have two pads so its generally
sense when the button is pressed. The plugging certain USB devices in can much easier and alignment is less criti-
button is used to change modes and cause the USB Power Meter to reset cal. The exception is the 50m shunt
also re-calibrate the unit. and since it powers back on in the resistor which has four (small) pads,
The micro can still be programmed same mode after a reset, the event is but as long as you line it up correctly
since the programmer pulls the barely noticeable (besides a brief pe- and dont use an excessive amount of
MCLR pin well above 5V to activate riod with a blank or frozen display). solder, it should all go smoothly.
programming. An in-circuit program- The software also contains calibra- Check the shunt resistor carefully
ming header (CON3) is provided tion routines which measure the offset with a magnifying glass after you
although the header does not need to voltage and store it in EEPROM to have soldered it, to ensure that the
be soldered to the PCB and can be left adjust future measurements. During closely-spaced pairs of pads at each
out altogether if a pre-programmed calibration, you can also correct for end have not been bridged. If they
chip is used. errors in the micros internal 1.024V have, use flux paste and solder wick
reference generator (specified as 7% to remove the excess solder.
Software over the full temperature range). This With all the SMDs in place, flip the
The software for IC1 is fairly simple offset is also stored in EEPROM and PCB over and fit the LCD. First you
but performs multiple tasks. It must it is recommended that you trim this must bend the pins straight; they are
constantly update all the LCD drive voltage as it also affects current read- kinked but will not fit through the
pins, sample the ADC inputs, per- ings, since the 4.096V ADC reference holes in the PCB until you straighten
form calculations to determine what is derived from it. them. This is easily done with small,
to display, monitor the pushbutton The software compensates for pow- straight pliers, one pin at a time.
state and handle calibration tasks. It er lost in the shunt when measuring When youre finished, they should
digitally averages the readings from the power drawn. This is necessary leave the LCD module at right-angles
each analogue input pin 2048 times to since the USB voltage measured is at and have no kinks.
improve resolution and reduce noise. the supply side rather than the load. You can then fit the LCD module
When reading microamps or micro- This error is only significant for fairly into place but be sure to install it the
watts, some additional time averaging high readings; eg, readings at 2.5W right way around. To do this, first hold
is performed on successive readings, would be 0.5% high. the module at an angle to the light so
if the readings are fairly steady, to that you can see where the decimal
prevent the bottom digit from jump- Construction points are these go towards the bot-
ing around due to circuit and power The components are all fitted on a tom of the PCB.
supply noise. PCB, available from the EPE PCB Ser- The straightened pins can be tricky
Input pin RE3 is monitored to vice, coded 04109121 (65 36mm). to line up with the holes in the PCB so
check if S1 is pressed and if so, the The LCD module, USB connectors you will probably have to feed them
display mode is changed. The current and pushbutton go on one side and through one at a time. Once you have
display mode is stored in EEPROM everything else on the other. them all in, push the module down
so that if you unplug and re-plug Start by installing the surface- so that it sits flat against the PCB and
the unit, it retains its mode. This is mount parts. Its best to begin with then solder all the pins.

Everyday Practical Electronics, August 2016 35

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 35 27/06/2016 09:45
Constructional Project

You can then finish up by install- low or a hairdryer) to shrink it. Trim
ing the USB plug and socket and the away any excess tubing that protrudes
pushbutton switch. In each case, these past the ends of the PCB.
should be pushed down fully onto You can still access the VBUS and
the board before being soldered. For GND terminals to re-calibrate it later,
the USB plug and socket, solder the if that becomes necessary, through
large mounting pins first and then the the ends of the tubing. It may then be
four signal pins. The plug goes on the more convenient to use the USB plug
left and the socket on the right. There shell as your ground reference point. www.poscope.com/epe
wont be much of a gap between the
LCD and the socket but it should fit. Display
During normal operation, there are
Testing and calibration three modes: current, voltage and
To test the unit, you simply plug it into power. Pressing S1 briefly cycles
a USB port. You should immediately through these modes.
see a display on the screen which In current mode, there are three
will read C5.00 or similar, with the ranges and the unit switches au-
number indicating the sensed USB tomatically. Typically, it will read
supply voltage. The decimal point either x.xxx or xxx.x where x is a
should also be flashing. This indicates digit from 0 to 9. These readings are
that the unit is in calibration mode. in milliamps and the lower range
If you dont get such a display, (with microamp resolution) is auto-
unplug it and check for faults such matically selected for readings below
as bad solder joints or bridged pads. 10mA. For 1A and above, the display
Assuming its OK, set your DMM to changes to x.xxA.
DC volts and measure the voltage be- In voltage mode, the read-out is
tween the VBUS and GND points on always in the format bx.xx where - USB - PWM
the PCB (top corners). You should get x.xx will be a number usually between - Ethernet - Encoders
- Web server - LCD
a reading pretty close to that shown 4.40 and 5.50. b is short for bus volt- - Modbus - Analog inputs
on the unit, but it may be slightly off. age (its not possible to do a V with a - CNC (Mach3/4) - Compact PLC
- IO
If its off, press pushbutton S1 7-segment display).
briefly and release it. Shortly after- In power mode, there are three pos-
wards, you should see the reading on sible ranges and again it is auto-ranging.
the display change slightly. Continue For readings of 10mW and above, you
pressing S1, with a pause after each will get a read-out in watts of either
press to check the new reading, until Px.xx or P.xxx, both in watts. Below
the unit shows the same voltage as 10mW, the display will change to Lx.
your multimeter, to within 10mV. xx, with the reading in milliwatts. The
You may need to re-check the DMM L stands for low power.
reading in case the USB voltage has To re-enter calibration, hold down - up to 256 - up to 32
microsteps microsteps
changed slightly as you approach the S1 for several seconds. You can then - 50 V / 6 A - 30 V / 2.5 A
correct reading. go through the steps above to recal- - USB conguration
Once the display is correct, press ibrate the unit. - Isolated

and hold pushbutton S1 for sev-


eral seconds until the display shows Flip mode PoScope Mega1+
CALI and then release it. After a If you plug the unit into a left-side
couple of seconds, calibration will USB port, the reading will be upside- PoScope Mega50
be complete and the unit will display down. This can be fixed by holding
the measured current in milliamps, down S1 while plugging it in, which
which should be very close to zero. enables flip mode. The decimal points
Now plug in a USB device (eg, a are now at the top of the display but
hub) and check that the reading in- the digits will be shown the right way
creases. You can then press the switch up and you can read it as normal. To
to cycle through the current, voltage disable flip mode, you again hold
and power modes (see below) and down S1 while plugging the unit in.
check that each reading is approxi- Otherwise, it will stay in flip mode.
mately correct. Thats it. Now you will no longer
- up to 50MS/s
Once you are happy that the unit is be in the dark about the power your - resolution up to 12bit
working and correctly calibrated, you USB devices consume. - Lowest power consumption
can then trim the heatshrink tubing so - Smallest and lightest
Reproduced by arrangement - 7 in 1: Oscilloscope, FFT, X/Y,
that it is about 10mm longer than the with SILICON CHIP Recorder, Logic Analyzer, Protocol
PCB, slip it over the unit and apply magazine 2016. decoder, Signal generator
some gentle heat (from a heat gun on www.siliconchip.com.au

36 Everyday Practical Electronics, August 2016

USB Power Monitor1212 (MP 1st & SK) August 2016.indd 36 27/06/2016 09:48
PEAK AUG 2016.indd 1 27/06/2016 10:09
Technical specifications for the Arduino Nano 3.x

Feature Specification
Microcontroller ATmega328P

Clock speed 16MHz

Flash memory 32kB (note 1)

Static RAM (SRAM) 2kB

EEPROM 1kB

Supply voltage 5V

Recommended DC input voltage range 7V to 12V (note 2)

Digital I/O pins 14

Digital I/O pins available for PWM output 6 (note 3)

Analogue input pins 8

Max. DC current output per pin 40mA Fig.7.3. Nano pin connections are grouped on opposite sides of the PCB
Max. DC current available from 3.3V supply 50mA
treated in exactly the same
Dimensions 45mm 18mm way as the Uno by means of
Weight 5g pinMode(), digitalWrite(),
and digitalRead() functions.
Note that, as with the Uno, several
Notes of the digital I/O pins also have
1. 2KB of which is used for the bootloader special functions as listed in Table
2. Maximum DC input voltage is 20V 7.1. We will be looking at pulse-
3. See Table 7.1 width modulation (PWM), and
how this can produce an analogue
Memory output voltage, in a future Teach-In 2016.
The ATmega168 processor has 16KB of
Flash memory for storing code (of which Analogue inputs
2KB is used for the bootloader) whilst The Nano caters for up to eight analogue
the ATmega328 offers 32KB (also with inputs and each offers a resolution of
2KB occupied by the bootloader code). 10 bits (the same as the Uno). The input
The original Nano with its ATmega168 voltage range, by default, is 0V to +5V,
provides 1KB of SRAM and 512 bytes of but this can be changed by altering the
EEPROM (which can be read and written analogue reference voltage in the same
with the EEPROM library). The Nano 3.x way as this can be changed for the Uno.
with its ATmega328 has 2KB of SRAM Note also that analogue pins 6 and 7
and 1KB of EEPROM. cannot be used as digital pins. As with
the digital I/O, some pins have special
Digital I/O functions, as listed in Table 7.2.
The Nano provides 14 digital I/O pins and
each of them can be configured for use as Communication facilities
Fig.7.4. Nano pin connections (for
an input or output. The digital I/O pins The Arduino Nano has a number of
clarity we have shown the signal
operate at standard 5V logic levels and facilities for communicating with
designations in red and the pin numbers
each pin can source or sink a maximum the outside world using standard
in green)
of 40mA. An internal pull-up resistor UART TTL-level serial communication
(of 20-50k) is available. By default, available on digital I/O 0 on pin-1
the pull-up resistors are disconnected. and digital I/O 1 pin-2. An on-board serial communication over USB, and
The I/O pins are configured and FTDI FT232RL chip channels this the FTDI drivers (included with the
Arduino software) provide
Table 7.1 Special I/O functions associated with digital I/O a virtual COM port on the
host computer. The IDEs
Board pin Signal/ Serial Monitor allows basic
Digital I/O Special function
number(s) designation text to be sent to and from
Serial 0 (RX) and Used to receive (RX) and transmit (TX) TTL serial data. These pins are
the Arduino board using
D0 and D1 1 and 2 the serial interface. As a
Serial 1 (TX) connected to the corresponding pins of the FTDI USB-to-TTL serial chip
helpful indicator, the RX
These pins can be configured to trigger an interrupt on a low value, a and TX LEDs on the board
D2 and D3 5 and 6 External interrupts will flash when data is being
rising or falling edge, or a change in value
transmitted via either the
D3, D5, D6, D9, 6, 8, 9, 12, Pulse width FTDI chip or the USB port.
These pins can be used to generate 8-bit PWM outputs
D10, and D11 13 and 14 modulation (PWM) Note that these LEDs will
not operate when TTL-level
D10, D11, D12 13, 14, 15 Serial peripheral These pins provide access to the SS (D10), MOSI (D11), MISO (D12) and serial communication is
and D13 and 16 interface (SPI) SCLK (D13) SPI signals being used via digital I/O
pins 0 and 1.
Built-in LED indicator (when the pin is taken HIGH the LED will be The Nanos Software
D13 16 LED indicator (L)
illuminated, and vice versa) Serial library also permits
serial communication on
Note: it is important to avoid confusing the Digital I/O numbers with the board pin numbers they any of the Nanos digital
are not the same but they are very easily confused! I/O pins. As with the Uno,

Everyday Practical Electronics, August 2016 39

TI16 (MP 1st, MT & SK) August 2016.indd 39 27/06/2016 09:19


Table 7.2 Special I/O functions associated with analogue I/O Prototyping with the Nano
Due to its small size and the two rows
Board pin Signal/ of male pins (rather than the female
Analogue I/O Special function
number(s) designation headers connected to the Uno) it
can sometimes be a little difficult to
I2C (two-wire
A4 and A5 18 and 19 A4 is SDA and A5 is SCLK prototype circuits with a Nano. One
interface)
solution is to simply plug the Nano
Analogue into a breadboard of suitable size, but
VREF 18
reference voltage
Used to change the DAC range of analogue inputs undoubtedly the best and most reliable
solution is using a low-cost prototyping
Take LOW to reset microcontroller (often used when board like that supplied by Deek Robot,
RST 28 Reset input as shown in Fig.7.6. A handy advantage
a shield obstructs the boards own reset button)
of the Deek Robot prototyping board
is that signal connections (marked S)
the Nano supports I2C (TWI) and SPI have been grouped together with power
communication. If you intend to make (marked V) and ground (marked G)
use of these features you will need to connections (see Fig.7.7). This makes it
include the necessary library files in extremely easy to place required logic
your code, as described earlier in this levels on the I/O pins without a great
series. deal of messy wiring. Another useful
feature is that you will not need to
Programming refer to pin numbers. Or you can just
The Arduino Nano can be programmed use the signal designations printed on
in exactly the same way as described the off-board headers. By now you can
previously for the Uno. The probably guess that we are fans of this
microcontroller will be immediately particular board!
recognised when selected from the
board options within the standard

Arduino Workshop: Passive


Arduino IDE. As with the Uno, the
ATmega processors are supplied with Fig.7.6. Deek Robot prototyping board
infra-red motion sensing
a pre-loaded bootloader that allows you
to upload new code without the use
of an external hardware programmer.
with Arduino Nano mounted
_____________________
However, if the need arises, it is possible In conjunction with some form of
to bypass the bootloader code and alarm or lighting system, PIR motion
program the microcontroller through sensing is an excellent application for
in-circuit serial programming (ICSP). a microcontroller such as the Uno or
Note that you wont actually need to do Nano. To simplify matters, low-cost
this for any of our Teach-In 2016 projects PIR sensors are widely available and
they require minimal interfacing (just
LED status indicators a power supply and a digital input on
The Nano has four miniature surface- the microcontroller). Depending on
mounted LED status indicators, as positioning (see Fig.7.8) a typical PIR
shown in Fig.7.5. Two of these (marked motion sensor will be sufficient for a
TX and RX) show the status of the room size of about 14m2. This is ample
Fig.7.7. Deek Robot prototyping board
two serial communication lines, while for most domestic situations as well as
groups signal inputs together with
another provides power indication and smaller commercial properties.
individual connections to the positive
the fourth led (marked L) is driven The PIR detection range depends on
supply and ground
from digital I/O pin-13 and is available a number of factors, including the size
for general use. of the reset button before an upload, the and speed of the target object and its
Arduino Nano is designed in a way that angular position relative to the sensor. It
Reset allows it to be reset
The Nano has a reset button that is by software running
located in the centre of the board, as on a connected
shown in Fig.7.5. Pressing this button computer. One of
restarts the resident code. Note that, the hardware flow
rather than requiring a physical press control lines (DTR)
of the serial interface
chip (an FT232RL)
is connected to the
reset line of the
ATmega processor
via a 100nF
capacitor. When
this line is taken
low, the reset line
drops for just long
enough to reset the
chip. The Arduino
software uses this
capability to allow
you to upload code
by simply pressing
the upload button
Fig.7.5. The Nanos four LED status i n t h e A r d u i n o Fig.7.8. Typical commercially available PIR motion sensor
indicators environment. mounted in the corner of a room

40 Everyday Practical Electronics, August 2016

TI16 (MP 1st, MT & SK) August 2016.indd 40 27/06/2016 09:19


Listing 7.1 PIR test routine

/* PIR test routine */

// Input and output


int inputPIR = 2; // Input from PIR sensor
int outputLED = 13; // Output to LED indicator

void setup(){
pinMode(outputLED,OUTPUT);
pinMode(inputPIR,INPUT);
}

void loop(){
digitalWrite(outputLED,digitalRead(inputPIR));
} Fig.7.12. Rear of the PIR sensor showing
the trigger link (left) together with the
sensitivity (centre) and time (right)
adjustments. The three pins at the rear
are (left to right) ground, output and
positive supply

Fig.7.12. The trigger mode can be set for


either single triggering or for continuous
retriggering. In the former (single trigger)
mode the output from the PIR sensor
will turn on and off as a target moves
through its field of view. In the continuous
retriggering mode, the output from the PIR
sensor will continue to remain in the high
state for as long as motion is detected.
In this mode the output from the sensor
will remain high for as long as the target
Fig.7.9. Low-cost PIR module with lens is within range and is moving.
removed revealing the PIR sensor
Fig.7.10. Low-cost PIR module with lens
cover fitted
is therefore a little difficult to predict the
exact range of any particular installation.
A simple PIR test routine is shown
in Listing 7.1. This very simple code Coding Quickstart :
A typical low-cost PIR module is
shown (with the PIR sensor chip
examines the state of the PIR output
and then writes whatever state has been generating tones
______________________
exposed) in Fig.7.9. In use, the sensor detected to the LED connected to digital
is covered with a lens (see Fig.7.10). I/O pin-13. When the PIR output is For some applications it can be useful
This not only helps to increase the triggered into a high state the LED becomes to generate a signal in the form of an
angular response, but also divides the illuminated. This routine will provide audible tone. The Arduino is able to do
coverage into sectors through which a you with a handy way of quickly testing this easily using the tone() function.
target moves. The sensor module can a PIR sensor and assessing its coverage. This handy function generates a square
be connected to an Arduino using one wave with a 50% duty cycle at a specified
of the digital I/O pins (plus ground Adjustments frequency. The tone can be generated
and +5V) as shown in Fig.7.11. In this After a moving target has been detected, for a specified period of time or, if a
arrangement we have used a digital the output from the PIR sensor module time is not specified, it will continue
I/O pin (which is also the L LED pin) will go high for a period determined until a call to the noTone() function
which will need to be configured as an by the time adjustment (see Fig.7.12). is made. Unfortunately, only one tone
input in our code. This will hold the output high over a can be generated at any particular time,
range extending from about 1 second although several tones can be generated
(minimum) to about 20 in quick succession in order to produce
seconds (maximum). Note a musical sequence.
that when single trigger The tone can be generated on a specified
operation has been selected, digital output pin and then fed to a
there is a delay of about sounder or loudspeaker. Note that if a
one second before the tone is already playing on a different
output changes from a low pin, a subsequent call to the tone()
to a high. The remaining function on a different pin will have
potentiometer provides no effect. If the tone is playing on the
sensitivity adjustment same pin, the call will just change its
over a typical target range frequency. So, if you need to generate
extending from about 1m different frequencies on multiple pins,
to a maximum of about 6m. you will need to call noTone() on one
pin before calling tone() on the next pin.
Trigger options With the exception of the Arduino
The board may be configured Mega, the t o n e ( ) function will
for two different trigger interrupt any PWM output on digital
modes. The desired mode output pins 3 and 11. The tone()
can be selected by means of function is unavailable on the Due and
Fig.7.11. PIR sensor test circuit for use with an Arduino the link at the extreme left Gemma versions of the Arduino.
Uno or Nano corner of the board shown in The range of frequencies that can be

Everyday Practical Electronics, August 2016 41

TI16 (MP 1st, MT & SK) August 2016.indd 41 27/06/2016 09:20


generated on the Uno (and other AVR boards) can range from // Two tone siren (output on pin-5)
31Hz to 65,535Hz, more or less covering the entire audio
spectrum. Heres an example of generating a five-second int count = 4;
burst of 400Hz square wave on digital I/O pin-5: void setup() {
while (count > 0) {
tone(5, 400, 5000); // generate 5s of 400Hz tone(5, 850);
on pin-5 delay(1000);
tone(5, 820);
Note how the first parameter is the digital I/O pin number delay(1000);
and that this is followed by the frequency (in Hz), and count = count - 1;
(optionally) the duration (in ms). Heres a further example that }
will generate just one second of 1.75kHz, this time on pin-2: noTone(5);
}
tone(2, 1750, 1000); // start beep sound on pin-2
void loop() {
And heres an example where a signal is generated for an }
unspecified duration:

tone(4, 648); // start beep sound on pin-4


// now do something else for a while ... // Start high and go low (output on pin-2)
noTone(4); // stop beep sound some time later
int toneFrequency = 1000;
Now, here are a few sound effects that you might want to int holdTime = 100;
incorporate in your project's code:
void setup() {
while (toneFrequency > 100) {
// Start low and go high (output on pin-5) tone(2, toneFrequency);
delay(holdTime);
int toneFrequency = 100; toneFrequency = toneFrequency - 100;
int holdTime = 100; }
noTone(2);
void setup() { }
while (toneFrequency < 1000) {
tone(5, toneFrequency); void loop() {
delay(holdTime); }
toneFrequency = toneFrequency + 100;
}
noTone(5);
Finally, Listing 7.2 is an example of using an Arduino Uno
}
as a simple square wave signal generator that produces a
variable output from 50Hz to 5kHz in two switched ranges
void loop() {
when controlled by a potentiometer with its slider connected
}
to analogue input A0 (see Fig.7.13). Note that weve not shown
any supply connections on this circuit, but you can power the
circuit from the USB connector or via an external DC input in
the usual way.
Listing 7.2 Simple Arduino square wave signal generator Notice how this example uses
the extremely useful map()
/* Square wave signal generator (output on digital I/O pin 2) function that maps a variable
Frequency adjustable from 50Hz to 5kHz in two ranges */ from one range to another.

int rangeSwitch = 3;
int frequencyControl = A0;
int toneFrequency = 500;
int rangeSetting;

Get Real : wireless-linked


int frequencySetting;

rain alarm
void setup() {
} __________________
void loop() { In this months Get Real we will
// Get the range setting be describing another useful
rangeSetting = digitalRead(rangeSwitch); project a simple PIR motion
// Get the analogue input from the potentiometer: alarm. The unit uses a low-
frequencySetting = analogRead(frequencyControl); cost PIR sensor together with
// Map the analog input into the required range an Arduino Nano and a small
if (rangeSetting == LOW) { loudspeaker. The complete
toneFrequency = map(frequencySetting, 0, 1023, 50, 500); circuit of the simple PIR intruder
} alarm is shown in Fig.7.14. The
else { loudspeaker should ideally have
toneFrequency = map(frequencySetting, 0, 1023, 500, 5000); an impedance of around 40,
} but lower impedance units will
// Output the tone also work. The value of series
tone(2, toneFrequency, 10); resistor R1 can be varied to alter
} the output volume, but should
not be less than 150.

42 Everyday Practical Electronics, August 2016

TI16 (MP 1st, MT & SK) August 2016.indd 42 27/06/2016 09:19


You will need
Arduino Nano microcontroller
USB cable with miniature-USB
connector (for programming only)
Computer with an available powered
USB port (for programming only)
1 low-cost PIR sensor module (see text)
1 SPST switch, S1
1 miniature push-button, S2
1 small loudspeaker, LS (see text)
1 220 resistor, R1 (see text)
1 330 resistor, R2
1 4.7k resistor, R3
1 red LED, D1
1 9V battery, B1
1 small piece of stripboard
Connecting wires

Code
The complete code for the simple
PIR intruder motion alarm is shown Fig.7.13. Arduino variable square wave generator connections
in Listing 7.3. The code is
straightforward and, as usual,
Listing 7.3 Code for the Arduino PIR motion alarm
weve liberally commented it
in order to help you understand
/* Simple PIR motion alarm for the Arduino Uno or Nano */
whats going on. The code does
not require any libraries.
// Inputs and outputs
As with our previous Get Real
int inputPIR = 2; // Input from the PIR sensor
projects, the code should first
int inputReset = 4; // Input from the reset button
be entered into the IDE and
int outputLED = 13; // Output to the LED indicator
then saved before compiling
int outputSounder = 3; // Output to the alarm sounder
and uploading it to the Uno,
// Variables
as described in last months
int oldState = LOW; // Initialise PIR state (no motion yet)
Arduino Workshop. When you
int currentState = LOW; // Current PIR status
have debugged and corrected
int resetState = LOW; // Reset button state
your code dont forget to save it
by clicking on File and Save
void setup() {
or Save As. Next, click on
pinMode(inputPIR, INPUT); // PIR input
Sketch and Verify/Compile.
pinMode(inputReset, INPUT); // Reset input
Any compilation errors will then
pinMode(outputLED, OUTPUT); // LED output
be reported in the window at the
pinMode(outputSounder, OUTPUT); // Sounder output
bottom of the IDE.
tone(outputSounder, 1150); // Beep to confirm ready status
delay(1000);
Testing and adjustment
noTone(outputSounder);
When youve corrected any
}
coding errors that the compiler
reports you will be ready to
void loop(){
upload your code to the Nano.
currentState = digitalRead(inputPIR); // Check the PIR state
Just click on the upload arrow
resetState = digitalRead(inputReset);
and watch the progress report.
if (resetState == LOW) { // System currently active
After the Nano performs a reset
// Wait for a change in level and then latch the alarm on
you should find that the LED (D1)
if (currentState == HIGH) { // Has it gone high and
becomes illuminated and a tone
if (oldState == LOW) { // was it low before?
is generated by the loudspeaker
digitalWrite(outputLED, HIGH); // Turn the LED on and
when you pass your hand over
tone(outputSounder, 850); // sound the alarm
the sensor module. The LED
delay(100);
and tone should both remain
}
latched on until the reset button
}
(S2) is pressed. At this point
}
the PIR motion alarm is placed
else { // Reset has been operated
back in the active state waiting
digitalWrite(outputLED, LOW); // Turn the LED OFF and
for another target to appear and
noTone(outputSounder); // stop the alarm
move within the protected zone.
currentState = LOW; // Reset the system
Having confirmed that the PIR
tone(outputSounder, 1150); // Beep to confirm ready
motion alarm is working, the next
delay(1000);
step is to check the adjustments
noTone(outputSounder);
on the PIR sensor module (as
}
described earlier). With a little
}
experimentation it should be
possible to achieve the correct
triggering, time and sensitivity. Instead (or perhaps, as well as)
n  to vacate the protected area when the
producing a sound output a suitably alarm has first been switched on
Going further rated relay could be used to energise a n A further LED could be added to show
As always, theres a great deal of scope remotely placed bell or security light that the PIR alarm is active and waiting
for going further with this months Get n A time delay (typically 15 to 25 seconds) for a trigger event.
Real project; for example: could be incorporated to allow the user All of these additions could be very

Everyday Practical Electronics, August 2016 43

TI16 (MP 1st, MT & SK) August 2016.indd 43 27/06/2016 12:20


easily incorporated into the basic PIR
motion alarm and will provide you
with opportunities to develop your
coding skills.

Next month
In next months Teach-In 2016 Arduino
World we will continue this months
infra-red theme by looking at a simple
IR remote control based on the Arduino
Uno and Nano. Arduino Workshop will
introduce you to infra-red transmitters
and receivers, while our programming
feature, Coding Quickstart will introduces
the infra-red remote library. Finally, our
Get Real project will describe the design
and construction of an Arduino multi-
channel infra-red remote controller that
will allow you to control your lighting,
heating, doors, windows and a host of
domestic gadgets from the comfort and
security of your armchair.

Fig.7.14. Complete circuit of the simple


PIR motion alarm

Correction to software in Teach-In 2016 Part 3


___________________________________
Oooops! omitted. To run the code successfully,
Our apologies to reader; there is an the part in black below needs to be
error in one of the software listings added to the end of Listing 3.4, after
accompanying this series. In Aprils the final curly brackets (shown in red).
issue, containing Teach-In 2016 Part 3, We thank Simon Bond for alerting us
Listing 3.4 was truncated and code was to our mistake.

EPE Summer Sale!!! Listing 3.4 Code for the simple Arduino based access control system

EPE Special Offers: /* Arduino access control system */


25% off of all PCBs up to and including ...
those in the June 2016 issue
25% off all EPE hard copy back issues ...
25% off all EPE back issue }
6-month CDROMs }
25% off all EPE back issue
}
5-year CDROMs
EPE Subscription Offer: void checkPasscode(){
Subscribe to EPE hard copy for 2-years if (password.evaluate())
and receive a free 6-month back issue {
CDROM of your choice; normal back lcd.setCursor(0, 1);
issue CDROM price 16.45. If you have lcd.print("* Welcome *"); //
an existing subscription then you are digitalWrite(outRelay,HIGH); // Activate relay
welcome to renew early for another delay(1000); // and wait 1s
2-years and receive the offer. digitalWrite(outRelay,LOW); // Deactivate relay
New Teach-In Bundle: delay(1000); // afterwards
lcd.setCursor(0, 1);
New Electronics Teach-In bundle includes
lcd.print(" ");
TI CDROMs 1, 2, 3 and 4;
Normal price 18.95: Special offer 25% password.reset(); // Reset passcode after valid entry
discount price 14.21 }
else
Please note: The 25% will be deducted
{
when the order is processed. This
will not show on your online order lcd.setCursor(0, 1);
confirmation. lcd.print("* Invalid *");
delay(1000);
PAYMENT MUST BE RECEIVED BY lcd.setCursor(0, 1);
31ST AUGUST 2016, WHEN THE
lcd.print(" ");
OFFERS CLOSE DONT MISS OUT!!
password.reset(); // Reset passcode after invalid entry
JUST CALL 01202 880299 OR VISIT
OUR SECURE ONLINE SHOP
}
AT WWW.EPEMAG.COM }

44 Everyday Practical Electronics, August 2016

TI16 (MP 1st, MT & SK) August 2016.indd 44 27/06/2016 12:12


it is much more intuitive to use, it reads like English. On We should now see our project folders on the left-hand
the other hand assembly can be very powerful when youre side of the screen. Right click on Source Files and select
looking for complete control of your project with regards to New. Im going to start off with the Example 3-6 Code on
strict timing. Other advantages include reduced compiled page 45 of the user guide, so were going to select main.c
code size, faster code operation and decreased power from the New menu. Youll be asked to name the new file,
consumption. However, its not really beginner friendly. I just call it main.c. Once weve finished that, our code
You can work through the lessons using either one or both. window should be open on the right hand side.
Copy the code from the example in the user guide into your
Setup new project main file, replacing everything else. Save the project (File >
Now the lesson gives us an explanation and the code to run Save, or Ctrl-S). Quick tip, when coding SAVE OFTEN!
it, but it lacks the how. Open up MPLAB X from wherever
youve installed it on your system. You should see the Building our code
Getting Started Page now. Were going to start a project from Our code should compile straight off. We do this by
scratch. selecting Run from the menu. Then we select Build Main
1. In the File menu in the top left, select New Project. This Project. We should see in our Output window in the bottom
launches the New Project window. We could do other things left: BUILD SUCCESSFUL (total time: 102ms).
here like create our own library or import from MPLABV You may notice two red circles with an exclamation mark
8.x. Were going to stick with the default. Microchip in Fig.3. This is an error in our code, by hovering the mouse
Embedded and Standalone Project and Standalone Project over it, it gives us an abstract error message: unexpected
should already be selected so, click Next. token. There was a migration in the behaviour of the __
2. Now we select which microcontroller device were going CONFIG macro to the #pragma config directive instead in
to use. Change the device in the drop down menu to the MPLAB X. The code will still build and do what we want
PIC16F1829. This is the microcontroller well be using it to do, but in the interest of correctness, we should really
on our demo board. Click Next again. replace those two lines with the following lines of code and
3. Were not using any debug header at the moment, so build our code again.
leave this as the default None in this window and click
Next again. #pragma config FOSC=INTOSC, WDTE=OFF, PWRTE=OFF,
4. Here we choose our debugger, which is the PICkit3. If MCLRE=OFF, CP=OFF, CPD=OFF, BOREN=ON,
our PICkit 3 programmer is connected, it should be CLKOUTEN=OFF, IESO=OFF, FCMEN=OFF
highlighted in green with the serial number below it, as #pragma config WRT=OFF, PLLEN=OFF, STVREN=OFF,
shown in Fig.1. Click Next again. LVP=OFF
5. Now we need to select our toolchain. Here we can choose
between using our C compiler or our Assembly compiler. Now were ready to program the demo board. Plug the PICkit3
Were going to start with the C compiler. The XC8 into the demo board, as shown in Fig.4. Note the little white
compiler should be installed already, which should now arrows line up to indicate pin 1 of the connectors. Dont forget
be selectable here, see Fig.2. Click on the XC8 compiler to plug the PICkit3 into a free USB port on your computer.
and click Next. Since the board doesnt have its own power supply, we will
6. Here, we need to choose a project name and project need to power the demo board from the programmer.
folder. Choose the project folder you want and lets name 1. This can be achieved by opening Project Properties in the
our project lesson1. Click Finish were done creating File menu. This opens up our Project Properties window,
the project. seen in Fig.5.

Fig.3. MPLAB X IDE Lesson 1 project successfully built

46 Everyday Practical Electronics, August 2016

Pic n Mix (MP 1st) AUG 2016.indd 46 27/06/2016 10:48


earlier, this is the real beauty of LEDs,
showing us that our code works. It may
seem like a small accomplishment, but
this is where it all starts. We will build
upon this in the following issues.
If you want to work through the
assembly code, you can follow through
the same steps above with the following
changes:
1. 
Instead of using the XC8 toolchain,
Fig.4 . Microchips PICkit 3 plugged into PICkit Low Pin Count Demo Board youll need to select mpasm in our
toolchain selection (item 5 above).
2. Under the section Categories, select the PICkit3. This is the assembly compiler built
3. In the top middle of this window under Option Categories, into the MPLAB IDE.
change the drop down menu to Power. 2. When adding a new file to the project, you may need
4. Tick the Power Target circuit from PICkit3 box. Note to select AssemblyFile.asm instead of main.c. This
in the datasheet that the voltage for the PIC16F1829 opens up the new assembly file window. Enter the name
operates between 1.8V and 5.5V, so 5.0V is fine in this lesson1 and press Finish.
instance. You may get a warning about powering it with 3. Copy the code from Example 3-4 on page 43 into this
5V when programming, this can be ignored as this board new file.
is 5V tolerant. 4. From here, the steps above and the outcome are identical.
5. Click Apply to complete.
The rest of the lesson details what each line means in both
First time programming assembler and in C. It also covers the use of the PIC18F14K22.
To program the demo board for the first time, we can either This is another microcontroller, which comes with the demo
go to the Run menu and select Run Main Project or press F6 board. This means pulling out the PIC and replacing it. You
on the keyboard. The two LEDs, DS4 and DS3 on the demo can do this if you want, but Id recommend sticking with
board should flash while it is being programmed. Once the original one for the moment and come back to it later if
complete, DS1 LED should be on, see Fig.4. Like I mentioned youre feeling adventurous.

Next month
Weve made our first step into the world of PIC
with our first lesson by programming our demo
board and turning on a LED. Next month, Id
like to pick up the pace and cover the next two
lessons. Feel free to work ahead through the
lessons yourself. The lessons dont give you all
the code, but they do give you enough to do it
yourself. I have deliberately avoided discussing
the actual code this month, but next month I will
start to delve into what the code is doing.

Not all of Mikes technology tinkering


and discussion makes it to print.
You can follow the rest of it on Twitter
at @MikePOKeeffe, up on EPE Chat
Zone as mikepokeeffe and from his
blog at
mikepokeeffe.blogspot.com
Fig.5. Lesson 1 Project Properties Power Target circuit from PICkit 3)

Radio
The magazine for all vintage radio enthusiasts.


Covers:

Bygones Domestic radio and TV Amateur radio


Military, aeronautical or marine communications
Radar or radio navigation Broadcasting Radio sytems

Subscribe to Radio Bygones (available by postal subscription):


1 year (4 issues) UK 18.00; Europe 19.50; Rest of the World 23.00
OR
Download your PDF copies, only 8.00 for one year

Tel: 01202 880299 or visit: www.radiobygones.com

Everyday Practical Electronics, August 2016 47

Pic n Mix (MP 1st) AUG 2016.indd 47 27/06/2016 10:49


Birthday greetings
T
HIS months Net Work this in an era of clattering teletype multitude of dynamically-allocated
celebrates 20 years of bringing machines, punched cards and valve routes instead of hogging a dedicated
EPE readers news and (vacuum tube) computers. The scale circuit. This distributed approach to
views about Internet trends and of this early electronic technology is communications would inherently
developments. Net Work was spun out virtually unbelievable, and a really survive any likely attack.
of the July 1996 issue, which carried fascinating Cold War USAF movie Within the year, BBN and UCLA
an article, The Internet: Whats in it for describing SAGE is worth watching had firmed up the core principles
you? when the writer introduced the at: https://youtu.be/06drBN8nlWg. An of implementing a digital packet-
EPE readership to the emerging world IBM movie about the SAGE computer switching network, building on earlier
of Internet access. The first Net Work system is at: https://archive.org/details/ research at the Rand Corporation and
column in EPE August 1996 greeted OnGuard1956; the large screens made Britains National Physical Laboratory
readers triumphantly with Welcome, great Hollywood movie props when (NPL), where the term packet was
internauts everywhere, to EPEs very SAGE was finally decommissioned. first used. BBN designed an Interface
first Net Work column! The term By this time, the military was Message Processor or IMP, an almost
surfing had yet to catch on. already grappling with the problems military-grade machine containing a
Its sobering to think that theres of transmitting data securely over a Honeywell DDP/ 516 general-purpose
now a demographic group the so- network and trying to computerise computer in a cabinet larger than a
called Generation Z that has never the response from end to end. The deep freezer. In effect, the IMP was
known life without Internet access 1957 launch of Russias Sputnik I, the worlds first router. A second IMP
(nor mobile phones, MP3s, computers or more accurately the threat posed was installed at Stanford a month later
or remote controls, for that matter). by the rocket that sent it aloft, sent and engineers successfully connected
Nowadays the Internet is a near- shockwaves through the Pentagon. to the remote system over a telephone
universal utility service delivering Americas new Advanced Research line. Famously, the first example of
news, websites, movies, television, Projects Agency (ARPA) was charged a true Internet transmission was the
sport events, video communications with the task of building a resilient word login typed into their IMP by
and entertainment in a way that was communications and control network, UCLA staff as they tried connecting
unthinkable 20 or 30 years ago and a decentralised infrastructure it to Stanford. Leonard Kleinrock of
certainly not 60 years ago, when the designed to survive a nuclear UCLA describes the moment at: www.
seeds of digital communications were attack. In 1968, ARPAs new digital lk.cs.ucla.edu/personal_history.html
first being sown. So where did the communications project got under By December 1969, ARPANET
Internet come from, and who paid for way, focussing on interconnecting had four university hosts, three in
it? This months Net Work is the first and timesharing some ARPA-funded California and one at the University
of a two-part feature that delves into computer mainframes located in of Utah, interconnected by 50kbps
the Internet revolution and highlights prime US academic sites, starting with leased landlines. Press images show
some interesting milestones reached UCLA and Stanford University in how six months later, the network had
along the way. California. The Massachusetts-based traversed the US to connect BBN, MIT
advanced engineering company Bolt, and Harvard over in the east. More
Cold War baby Beranek and Newman Inc. (BBN) won nodes were added and by September
The origins of the Internet are well the contract to design and build the 1973, something else had happened:
documented, and generally lie in the network now called ARPANET satellite circuits now connected
Cold War era that was dominated from scratch. Hawaii and Norways seismic
by the Iron Curtain. To counter the monitoring network NORSAR, the
possible threat from Soviet nuclear Instant messages latter being the first such networked
bombers in the 1950s, the US military Instead of using traditional circuit- connection outside of the US. A
needed to process incoming data switching communications, where Terminal Interface Processor (TIP) in
from its radar stations, interpret the (say) a landline had to be wholly Norway meant they could access the
vectors to calculate the likely target committed to making a single call, network directly without needing a
and marshal any military assets that ARPANET would send bursts of host computer. Shortly afterwards,
were in range all in real time. The data in small packets that could be NORSAR was connected by a 9.6kbps
military built the countrys enormous sent efficiently around the network link to University College London.
Semi-Automatic Ground Environment before arriving at their destination, This aggregation of networks would
(SAGE) air defence system, which where they would be reformed to be the foundation of the Internet that
relayed computerised radar data make the message complete again. we know today.
to human operators (hence, semi- Error-correction techniques would The early protocol for data
automatic) who analysed the screens re-transmit packets if needed, and transmission, Network Control
before co-ordinating a response: all packet communications could use a Program (NCP) was replaced in the

48 Everyday Practical Electronics, August 2016

Network AUG 2016.indd 48 27/06/2016 09:29


mid 1970s by Transmission Control
Protocol/ Internet Protocol (TCP/
IP) to cope with the rising numbers
of hosts that were connecting to
the Internet, and TCP/IP became
the standard that is in widespread
use today. Put simply, TCP would
manage the business of packaging up
data ready for transmission, while
IP would put an address label (an IP
address!) on each packet, preparing
it for transportation. TCP would then
unpackage the message again once it
had been received, or it might ask for
some packets to be sent again until the
transmission was complete.

In the Ether
Some familiar tech brands of
networking hardware originated
from this same era. Ethernet was Everyday Electronics, November 1982s news of the worlds longest fibre optic link
designed at Xerox as a way of
networking their desktop computers
using coaxial cable. Out of this came themselves, and home computers such Modems could also be used for
3Com in 1979, which developed as the Commodore, Sinclair Spectrum accessing a bulletin-board (BBS) so
early Ethernet cards. Stanford also and BBC gained a foothold in many that files, updates and messages could
spawned Sun (Stanford University schools and households at the time, be downloaded by dialling into remote
Network) Microsystems after devising becoming hobbies in their own right. servers via a landline, and users could
a dedicated workstation, a computer People generally became more IT- participate in simple terminal-type
that ran on a network, on the theory aware, and graphical interfaces such chat as well. Despite early limitations
that multiple workstations would as Microsoft Windows on the PC made and the somewhat clunky operation,
be more powerful than stand-alone personal computing technology more the expansion of Internet-based
machines. (Facebook now owns Suns accessible and easier to use, helped by services proved unstoppable. During
original HQ.) The router also hailed the new computer mouse. the early 1990s, Internet access at
from Stanford academics as a way of home as far as there was any was
letting different university computer Mail on the move anything but mainstream or cheap; it
networks communicate across In an era of 1980s telexes and still relied on a modem connecting over
campus: Cisco Systems was spun out fax machines, the concept of a creaking POTS (plain old telephone
of this, originally financed by personal communicating electronically when system). Using a personal computer for
credit cards. away from the office was gaining going online was largely the province
As the network backbones ground. We reported in Everyday of technical enthusiasts, computer
continued to expand they would be Electronics & Electronics Monthly hobbyists and professionals or
utilised by military, commercial and (April 1986) how Japans Brother EP- managerial users. Access services were
academic institutions. In Everyday 44 offered a new solution containing popularised by Americas CompuServe
Electronics, May 1982 we reported on everything you need to get started in Information Service (CIS) that came to
the Highway of the Future and tests electronic mail. Brothers near-silent the UK, charging 10 for three hours of
made using the latest transmission electronic typewriters were already premium content. Subscribers could
medium: glass fibres. British biting into electric typewriter sales. It access carefully screened content using
Telecoms Lightlines research labs was claimed the EP-44 would benefit CompuServe Information Manager
had succeeded in sending pulses of anyone who needed to write and send (CIM) software for Windows 98, which
light over 100km of optical fibre, twice text quickly while on the move. offered electronic mail, messages and
as far as they achieved in 1981. In the The machine had a teleprocessor forums. Users had inscrutable addresses
November 1982 issue we reported that a letter-quality thermal printer with such as 10537,1234@compuserve.
Britain had opened the worlds longest an RS232C serial port, so it could com and the audio You have new mail
optical fibre link (204km), entering double up as an electronic typewriter waiting! message became a familiar
service on 22 July and replacing the or a computer printer. Critical for sound eagerly anticipated by expectant
London-Birmingham wire first built mobile communications was its users. CompuServe UK provided the
in 1887. The fibre allowed thousands acoustic coupler, which allowed the writer with his first photo download:
of calls to be handled simultaneously, machine to send and receive data an image of the Horsehead Nebula
and BT would licence their new fibre electronically using a telephones captured by NASAs Hubble. I pinned
manufacturing process to telecoms handset. The Brother EP-44 fitted this achievement on the noticeboard
companies around the world. Fibre into a briefcase for portability, and for months. EPE abandoned an early
also formed the core of Britains first, also included was a subscription to idea to host a CompuServe forum of its
but ill-fated, national competitor to the One-to-One electronic mailbox own, though.
British Telecom, called Mercury, which service, which by then boasted of
laid new fibres alongside railway lines. having over 6,000 users in the UK The rise of ISPs
Some readers may remember the blue alone. Special teleconferencing and Soon it seemed like every computer
Mercury button found on new phones email services such as Telecom Gold user had hooked a modem onto their
and fax machines at that time. which used slow 300 baud modems serial port, notably the popular US
Personal computers started to were also appearing, as reported by Robotics Sportster, and the twinkling
appear commercially in the late 1980s, Barry Fox in the July 1987 issue. The LEDs of these screeching bone-
along with networking software technology was far from user-friendly coloured boxes became a familiar
such as Novells Netware. The IBM and Barry described some hair-pulling sight. As the 1990s Internet market
PC and IBM-compatible machines frustrations of trying to submit his continued to evolve in Britain, an
would allow businesses, academics copy electronically to the Today alternative to the closed shop of
and individuals to harness PCs for newspaper. CompuServe emerged dial-up

Everyday Practical Electronics, August 2016 49

Network AUG 2016.indd 49 27/06/2016 09:29


EPE steps online anonymous FTP was a great way
The need for EPE to go online was of distributing the Surgerys Ni-Cad
spurred on by the advent of the PIC FAQ, a document about rechargeable
micro as we started publishing PIC- batteries, and my UK Sources FAQ a
based constructional projects in the directory of component suppliers that
1990s for the first time. These often could be downloaded via FTP. Those
involved distributing PIC source codes EPE readers who did not have Internet
and other files to readers to enable them access wrote to me asking for a hard
to burn their own chip. Instrumental copy instead, which I duly printed off
to this was the publication in February and posted to them.
1996 of a Simple PIC Programmer by
Derren Crome, and the PIC revolution Spinning a web
then got under way. Looking back, EPE The birth of the worldwide web at
had always striven to distribute files in CERN is well documented and, with
whatever format our readers needed, the nascent web barely taking shape
The Brother EP-44 was a 1980s mobile and over the decades we even offered in the 1990s, the author loaded some
email terminal and electronic printer. computer listings on tape cassettes basic HTML files onto CompuServes
The acoustic coupler allowed a phone or floppy disks, for example. Readers web servers in the US, where just a
handset to be connected for transmitting following various EPE computer few hundred kilobytes of space were
data on the go tutorials many written by our own offered to each user. Software such
Mike Tooley could purchase them as SoftQuad HoTMetaL Pro, which
Internet access was offered by a new by mail order and a tape cassette with helped users to code HTML web pages,
breed of Internet Service Provider (say) Sinclair Spectrum files would arrived on the market. In 1996, EPEs
(ISP). Londons Demon Internet was pop into their mailbox a week or two first website went online, hosted in
something of a maverick ISP that later. Apart from the cost of publishing Southampton and those very early
popularised the TAM (ten pounds a files in different formats this way, pages are archived at: www.epemag.
month) flat-rate account. The writer mail order made our material less wimborne.co.uk/legacy/oct96www.
coined epemag as a Demon Internet accessible to our overseas readers, Overseas readers could finally check
username when signing up for a who often suffered frustrating delays in at our website in real time, if only
TAM account in February 1995, one due to the postage system both ways. to get a feel for what was coming in the
of Demons first 40,000 subscribers. With the microcontroller hobby next issue. Free webspace for hobbyists
It was originally created solely for project market taking shape fast, EPE also sprang up in the UK, and some
Circuit Surgery. Demon wrote back took the lead by offering project source early adopters complained of being
on Conqueror headed notepaper with codes free of charge, and I recall holding penalised because their websites were
details of a login! various online conversations about this proving too popular and getting too
Early dial-up Internet access was with users in the mid 1990s. The idea many hits! The need for bandwidth
very much a lottery, though, due to the of dealing with a multitude of like- restrictions and traffic quotas started to
paucity of access lines and the authors minded users and communicating with form as the worldwide web took hold.
14.4k modem, churning inside a 486 them online took shape in Usenet, In next months follow-up article,
PC, often made scores of failed attempts which I will describe next month. To Ill highlight the turning point
each night before finally connecting to get source codes into the hands of our that signalled the start of the mass
the local Point of Presence (PoP). At readers quickly and cheaply, there uptake of Internet access, along with
one time, the authors phone bill was was no doubt about it EPE would developments to take us to the present
25-pages long, full of local-rate calls have to go online! Consequently, EPE day (and beyond). You can email the
to Demons nearest point of presence. set up a file area on a server located in writer at: alan@epemag.demon.co.uk
Internet access would gradually grow nearby Southampton. The File Transfer
with endless numbers of faster modem Protocol (FTP) was, and still is, one
racks being installed by ISPs and more of the founding tenets of the Internet, Download a PDF copy of the original
optical fibres spanning the country. and ftp://ftp.epemag.wimborne.co.uk July 1996 article The Internet:
Being immune to outside interference, was born in 1996 and still runs today Whats in it for you? from:
some optical fibres were also wrapped in Birmingham, hosting legacy files www.epemag.net/epe-
around catenaries of overhead power maintained for retro-compatibility network.html
cables as a clever way of traversing the with our back issues. Writing Circuit
countryside. Surgery at that time, I found that

CompuServe Information Manager for Windows offered email and EPEs first website was simple, but it brought instant
forums to subscribers engagement too!

50 Everyday Practical Electronics, August 2016

Network AUG 2016.indd 50 27/06/2016 09:30


By Robert Penfold

Capacitance Meter Mk2

T
HE PREVIOUS Interface article
considered the uses of a binary
counter in conjunction with a
Raspberry Pi computer, and featured a
random number generator. The Inter-
face article prior to that one described
an ultra-simple capacitance meter
based on a monostable circuit and the
timing facilities provided by the Py-
thon programming language. As ex-
plained in that article, timing accuracy
was limited by factors such as the use of
interrupts in the normal running of the
Raspberry Pi and the operating system.
This made it difficult to obtain a high
degree of accuracy using this method.
It was proposed that an external
clock oscillator and a counter circuit, Fig.1. The general scheme of things used in the capacitance meter add-on. The
together with a monostable timer, binary counter is a 12-bit type, but one bit is required to provide an overflow warning
would give better results while still
offering a reasonably simple and cost- and the duration of the output pulse is value in the counter would be 2000. In
effective approach. This alternative proportional to its value. other words, the reading obtained from
method is used in the capacitance The output pulse from the the counter is proportional to the value
meter add-on featured in this Interface monostable turns on an electronic of the test component. Furthermore,
article. It is effectively the counter switch, and this in turn supplies power it is just a matter of shifting the
from the random number generator, to the clock oscillator. Its output feeds decimal point two places to the left
the monostable from the original the clock input of the counter, and the in order to get a reading directly in
capacitance meter adapter, plus a count therefore increases from zero nanofarads. One slight complication
simple clock oscillator, all configured for the duration of the output pulse. is that the output pulse duration of the
to act as a capacitance meter. If output Q11 goes high, it operates a monostable is actually 1.1 CR seconds
second electronic switch that blocks rather than 1 CR seconds. This does
Counting up the first one, and deactivates the clock not really matter too much in practice,
The block diagram of Fig.1 shows the oscillator. This halts the count at zero. since it can be allowed for by reducing
overall scheme of things. Although An input of the computer is used to the clock frequency accordingly.
the binary counter is a 12-bit type, it read the logic level on Q11 and, where
is only used to provide 11 digits of appropriate, an overflow warning is Circuit details
data to the computer. This is due to displayed. Fig.2 shows the circuit diagram for
the fact that an out-of-range capacitor the capacitance meter add-on. IC3 is
would cause the count to cycle back Doing the math the 12-bit binary counter, and outputs
to zero and continue counting from The mathematics of the unit is reas- Q0 to Q10 are read by inputs on the
there. The unit would then appear to onably straightforward. Simplifying GPIO port, as in the random number
give a valid reading, even though the things slightly for the moment, the generator circuit. I used a 74HC4040
count could have to cycle through zero monostable produces an output pulse for IC3, but with a clock frequency
several times, giving a purely arbitrary duration of one CR seconds, and the of just under 100kHz, the ordinary
value. To avoid this, the twelfth bit is clock oscillator operates at 100kHz. 4040BE CMOS version should work
used to provide an overflow warning On range 2 the timing resistor is 1M, just as well. Pin 7 of the GPIO port
and halt the count if it cycles through and 10nF would therefore give a pulse (GPIO 4) is used to control the MR
to zero. In decimal terms, the number duration of 10ms (0.01s). Since the (master reset) input of the counter,
returned by the 11-bit counter is from capacitance in farads is an extremely which must be pulsed high in order to
0 to 2047, making it fractionally better low number, and the resistance in reset the counter.
than a 3-digit display, which is more ohms is a very high figure, with this The monostable uses a low-power
than adequate for this application. type of calculation it is generally better 555 timer (IC1) in the normal mon-
In order to take a reading, the to work in megohms and microfarads. ostable configuration. S1 is the Range
computer must first pulse the Reset This comes out as 1 x 0.01 = 0.01s. switch, and resistors R1 to R5 give the
line high so that the counter starts at (Remember, mega means 106 and unit its five measuring ranges, as de-
zero. The Trigger line is then pulsed micro means 106, hence mega tailed below:
low in order to trigger the monostable. micro = 106 106 = 1066 = 100 = 1).
There are five resistors available for With a 100kHz clock signal, this one Range Resistor Max value
use in the CR timing network of the hundredth of a second burst of the 1 R1 2047pF
monostable, and these give the unit its clock signal equates to one thousand 2 R2 20.47nF
five measuring ranges. The capacitive pulses. If the test capacitance was 3 R3 204.7nF
section of the timing network is twice as large at 20nF, the output pulse 4 R4 2047nF
formed by the capacitor being tested, would be twice as long, and the final 5 R5 20.47F

Everyday Practical Electronics, August 2016 51

Interface (MP 1st) AUGUST 2016.indd 51 27/06/2016 09:32


Fig.2. The circuit diagram for the capacitance meter add-on. Resistors R1 to R5 provide the unit with its five measuring ranges,
with values of up to 20.47F accommodated

Triggering of the monostable is better performance than the original in section of the program does some
provided by a low pulse generated on several respects, such as lower current basic setting up and imports any
the GPIO 22 line at pin 15 of the GPIO consumption and faster switching modules that are required, and the
port. The output voltage from pin 3 speeds. The crucial difference in the next section sets up various GPIO
of IC1 was found to be inadequate to current context is that it will operate lines as inputs or outputs, as required.
power the clock oscillator directly, at supply potentials down to 2V. This In the next section, pins 7 and 15 of
and it is therefore controlled via enables the circuit to be powered from the GPIO port are set at the appropriate
common emitter switch Tr1, which in the 3.3V supply that is available on the starting states. Then a reset pulse
turn drives a second common-emitter GPIO port, which in turn enables it to for the counter is generated on pin
switching transistor (Tr3). This makes interface directly to the input/output 7, followed by a trigger pulse for the
it easy to block the clock oscillator lines of the port. An ordinary NE555 monostable on pin 15. Next, a delay of
when a counter overflow occurs. When has a minimum supply voltage rating 0.1s is provided, which is more than
Q11 of IC1 goes high, Tr2 is turned on, of 4.5V, which means that it will not adequate for a reading to be taken.
and it cuts off the base current to Tr1. work in this circuit. Other improved The maximum time taken for a valid
This switches off Tr1, and therefore versions of the 555 should be fine if reading to be clocked into the counter
Tr3 and the clock oscillator as well. they can operate at the low supply is about 0.02s.
The GPIO 17 line at pin 11 of the GPIO voltage used here. The improved 555 A variable called byte is used to
port is used to monitor the Q11 output chips often use some form of MOS store the value read from the counter
of IC3. technology, as does the 74HC4040 as it is built up bit-by-bit. This is set
A hold-off is required between used for IC3. Consequently, normal at an initial value of zero. The next
triggering the monostable and reading anti-static handling precautions section of the program reads each bit of
the counter, so that the count is should be observed when dealing the counter, one bit at a time. If a logic
allowed to finish before a reading is with all three integrated circuits. 1 level is detected, the value in byte
taken. This could be accomplished Consistent accuracy across the five is incremented by the appropriate
by using an input of the GPIO port to ranges is dependent on resistors R1 to amount for that output of the counter.
monitor the output of the monostable, R5 having a suitably tight tolerance The value in byte is otherwise left
and prevent a reading from being rating, which in practice means a unchanged. When all eleven outputs
taken before the output returns to the rating of one per cent or better. A low- of the counter have been read, the
low state. The simpler alternative, and cost preset resistor can be used for value in byte is the raw capacitance
the one used here, is to use a software VR1, but ideally it should be a good value. The rest of the program does
delay to prevent premature readings of quality multi-turn type. This should the math, adding a decimal point
the counter. make precise calibration a little easier, at the appropriate position where
The clock oscillator uses another low- and should also give better long-term appropriate, and printing the values
power 555 timer (IC2) in the standard stability. A 5-way switch for S1 might for all five ranges. It is therefore just
oscillator configuration. Variable be difficult to obtain, but a 6- or
resistor VR1 enables the frequency of 12-way type with an adjustable
the oscillator to be adjusted so that the end-stop set for 5-way operation
unit can be calibrated. The output from is perfectly suitable. Tr1 and Tr2
this type of oscillator is rectangular, can be any silicon NPN transistors
but is not a 1:1 square wave. However, that have reasonably high current
practically any form of pulse waveform gains. Similarly, practically any
is adequate for a clock oscillator in an silicon PNP transistor is suitable
application such as this. for Tr3.

Components Program
The TS555CN specified for IC1 and The basic Python program for
IC2 is an improved version of the taking capacitance readings is Fig.3. This is the reading obtained when
original NE555 timer chip. It provides provided in Listing 1. The initial testing a 10nF capacitor on range 2

52 Everyday Practical Electronics, August 2016

Interface (MP 1st) AUGUST 2016.indd 52 27/06/2016 09:32


Listing 1
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)

GPIO.setup(11, GPIO.IN)
GPIO.setup(8, GPIO.IN)
GPIO.setup(10, GPIO.IN)
Fig.4. Measuring a 330nF capacitor on range GPIO.setup(12, GPIO.IN)
3 has caused the counter to overflow, and a GPIO.setup(16, GPIO.IN)
warning message has been displayed on the GPIO.setup(18, GPIO.IN)
screen GPIO.setup(22, GPIO.IN)
GPIO.setup(24, GPIO.IN)
a matter of selecting the one for the range GPIO.setup(26, GPIO.IN)
in use (Fig.3). A warning is printed on the GPIO.setup(23, GPIO.IN)
screen (Fig.4) if pin 11 of the GPIO port is GPIO.setup(21, GPIO.IN)
found to be at logic 1, indicating that the GPIO.setup(19, GPIO.IN)
counter has cycled back to zero and a valid GPIO.setup(7, GPIO.OUT)
reading has not been obtained. GPIO.setup(15, GPIO.OUT)
In use, a reading of 1 seems to be
obtained on ranges 3, 4, and 5 when there is GPIO.output(15, True)
no test capacitor connected to the unit. On GPIO.output(7, False)
range 2 with no test capacitor the reading GPIO.output(7, True)
is usually 2, and this slight increase is GPIO.output(7, False)
probably higher due to stray capacitance GPIO.output(15, False)
and the built-in capacitance of the circuit. GPIO.output(15, True)
Things could be tidied up by reducing time.sleep(0.1)
the displayed value by the appropriate byte = 0
amount, but this will not really make much
difference to the accuracy of the unit. if GPIO.input(8):
The situation is different on range 1 byte = byte + 1
where a value of about 15 to 18 is displayed if GPIO.input(10):
when there is zero test capacitance. The byte = byte + 2
exact figure will vary from one example of if GPIO.input(12):
the circuit to another. It is definitely worth byte = byte + 4
adjusting the displayed value on range 1 to if GPIO.input(16):
account for the built-in offset of the circuit. byte = byte + 8
In Listing 1 a value of 18 is deducted from if GPIO.input(18):
the value in byte before it is displayed, byte = byte + 16
but the amount deducted must be chosen if GPIO.input(22):
to match the particular circuit in use. byte = byte + 32
Doing so will greatly improve the accuracy if GPIO.input(24):
of the unit when reading very-low-value byte = byte + 64
capacitors, but readings will still only be if GPIO.input(26):
approximations with very-low-value test byte = byte + 128
components. if GPIO.input(23):
With a unit of this type you might byte = byte + 256
occasionally find that an overflow warning if GPIO.input(21):
is obtained, even though the capacitor has byte = byte + 512
a marked value that is comfortably within if GPIO.input(19):
the upper limit of the range in use. It could byte = byte + 1024
simply be that you have misread the value,
and that it is actually much higher than you print ("Range 1", byte-18, " picofarads")
thought. Alternatively, the test component print ("Range 2", byte/100, " nanofarads")
might be damaged and providing a short print ("Range 3", byte/10, " nanofarads")
circuit. This will prevent the output of the print ("Range 4", byte, " nanofarads")
monostable from returning to the low state, print ("Range 5", byte/100, " microfarads")
causing the counter to overflow. if GPIO.input(11):
print ("Overflow!!!!!")
Calibration
A close-tolerance capacitor is needed in GPIO.cleanup()
order to calibrate the unit, and it should print ("Finished")
have a value of at least 30 per cent of the
full-scale value of the range in use. High-
value capacitors having a tolerance of It should be possible to develop the system a bit further. Using the extra
one per cent or better are very expensive. lines available on the 40-pin version of the GPIO port it would be possible
Probably the best approach is to use a 10 to control the range from the computer. Any form of electronic switching
or 15nF capacitor to calibrate the unit on would almost certainly impair the accuracy of the unit, and the old fash-
range 2. Calibrating the unit is just a matter ioned method of using relays or reed relays would be better. It would then
of using a bit of trial and error to adjust VR1 be possible to implement auto-ranging. A reading would be taken on range
for good accuracy. Readings are very stable, 1, and if it was in-range it would be displayed. If not, a reading would be
and this design is certainly better in this taken on range 2, and it would be displayed if it was in-range. Otherwise
respect than the ultra-simple one featured a reading would be taken on range 3, and so on, until a valid reading was
previously. obtained and displayed.

Everyday Practical Electronics, August 2016 53

Interface (MP 1st) AUGUST 2016.indd 53 27/06/2016 09:33


Circuit Surgery
Regular Clinic by Ian Bell

Ammeters and voltmeters


F REQUENT EPE Chat Zone
contributor grahamrounce posted a
question about meters: I have a 30,000
to make use of it rather than buying
something new. Another possibility is
aesthetics analogue meters provide
so you have to make sure you read the
right one a potential source of error
and confusion, particularly on small,
ohms/volt moving coil meter, and a retro or vintage look, if that is what cheap multimeters where the scales
seem to have forgotten how to work you are after. may not be very easy to read.
out its resistance on say the 100A In terms of multimeters (see Fig.1 and Analogue meters have an advantage
range, or come to that, any current or Fig.2 for examples) we can make some over digital meters in that they can
voltage range. Could someone please specific comparisons. Low-cost analogue provide a more intuitive view of
remind me? And a digital meter? multimeters are readily available at fluctuating measurements the
there doesnt seem to be any equivalent similar costs to lost-cost digital meters. needle moves in sympathy with the
parameter quoted. Thank you. Higher up the quality scale there is less measured voltage or current. Events
As is often the case, fellow Chat choice in analogue meters, but a few such as peaks in the measured value
Zone users provided some answers are available. Digital multimeters are show up when the needle moves
(particularly bruce in this case). We generally more accurate than analogue sharply, but might be missed when
will look at the topic in some depth ones, they are more versatile, have more reading a digital multimeter, which is
and take the opportunity to review features and functions, and commonly averaging and updating more slowly.
some of the circuit theory (and provide measurement of a wider range The changing lower order numbers on
resulting practicalities) associated of quantities. Some have advanced a digital display will usually be much
with using meters and designing capabilities, such as data logging or harder to interpret in particular, its
related measurement circuits. Since trend graphing and transfer of data to behaviour is dominated by the update
the question mentions digital meters computers. rate of the display. Naturally, electro-
we will start with a general comparison The numerical value of the mechanical analogue meters, such as
between analogue and digital meters, measurement is usually easier to read moving coil meters, are not infinitely
and then look at the moving coil meters from a digital meter and the display fast, so will not respond to very short
and more generally at the effect using may well tell you directly if the reading peaks. The dynamics of analogue
a meter has on the circuit under test. is in, for example, mV or V, having meters may be (or would have been)
Finally, we will address the specific automatically selected the range. Of an important part of a specification in
points in the post. course, digital multimeters may also some applications.
provide manual range setting for This drawback of digital readouts
Analogue vs digital when that is more convenient, further can be overcome by also providing an
In an age of cheap digital technology, one highlighting their versatility. On analogue representation of the signal
thought which may occur immediately analogue multimeters you will have to on the display (see Fig.3). Typically
after reading grahamrounces post is, set the range manually and interpret this is a bar graph, which updates more
why bother with an analogue meter? the reading accordingly. Furthermore, rapidly than the numerical reading, but
Of course, the answer may be that you there will typically be several scales full graphical on-screen representations
already own a moving meter and want on an analogue multimeter (see Fig.1), of analogue meters are of course
possible. Digital multimeters may also
provide min/max/average reading over
a period, which means you do not need
to watch for the needle to jump to
detect a peak. Such a digital meter will
also measure the peak rather than just
telling you something happened, and
may be able to capture events too fast to
kick a needle. Despite this, an analogue
meter may still have the advantage in

Fig.3. Digital multimeter with analogue


Fig.1. Analogue Multimeter Fig.2. Digital Multimeter bar graph

54 Everyday Practical Electronics, August 2016

Circuit Surgery AUGUST 2016.indd 54 27/06/2016 09:37


The meters
needle (pointer) Scale

is mounted on
the coil so that
it rotates with it. Pointer
A long needle
means that only
a small amount
of coil movement Moving coil Restoring spring
produces a large Permanent magnet
pointer deflection.
There is usually a
small screw head
on the needle
Fig.4. Moving coil panel meter mounting so that
the needle can
N S
some situations for example, where be rotated with
the users wants to keep an eye on a respect to the coil.
meter using their peripheral vision, This is in order to
where a moving meter needle will be set the position of Fig.5. Structure of a moving coil meter
easier to monitor than, say, an LCD the needle with no
screen with possible viewing angle current flowing to accurately match and between currents in a circuit
limitations. the zero point on the meters scale. (irrespective of voltage values). Here we
The coil responds to direct current have Kirchhoffs two laws (the voltage
Moving coil in either direction with the rotation law and the current law).
The moving coil meter is an important occurring in opposite directions for
part of the history of our understanding opposite current flow. This means Kirchhoffs voltage law (KVL) can be
of electricity. Its operation is based that centre-zero meters can be made, stated as:
on the fundaments of interaction although when moving coil meters are
between electricity and magnetism, used in analogue multimeters the zero Taking direction into account, the sum
which were developed in the early is on the left hand side. of voltages around a loop in a circuit is
19th century by scientists such as Although fuses and other techniques equal to zero.
CS5-Aug16
Hans Christian rsted, Andr-Marie should protect all multimeters from
65mm x 1.5 COL
Ampre and Michael Faraday. In damage by excessive current flow, The direction of the voltage of a voltage
1882, Jacques-Arsne dArsonval and analogue multimeters based on source, or the voltage dropped across a
Marcel Deprez developed a basic form moving coil meters are more fragile component is taken as being from the
of moving coil meter, which provided than digital meters due to their more negative end towards the positive end.
better linearity and lower sensitivity to delicate mechanical structure. In forming the KVL sum an individual
magnetic materials in its environment voltage is positive if its direction is
than earlier moving magnet meters. Back to basics the same as the loop direction and
The design of moving coil meters was Before discussing meter properties and negative otherwise. We can loop the
further improved by Edward Weston circuits we will quickly review some other way round, the law still works;
in 1888, who created the design which basic circuit theory which we will just reverse all the signs in the sum.
still forms the basis of modern moving need to fully appreciate their operation An example of KVL is shown
coil meters. As metering technology and limitations. First, the well-known in Fig.7. The voltage source has a
improved it led to further advances circuit theorem called Ohms law (see positive direction and voltage drops
in our understanding of electricity Fig.6), which states the relationship across the resistor are opposite to the
and magnetism, and these improved between the resistance of a resistor, R loop direction. Here, the voltages sum
measurements led to new discoveries (measured in ohms), the voltage across to zero alternatively, we can say
or proof of theories. the resistor, V (measured in volts), and that the sum of the voltages across
A typical moving coil panel meter is the current through it, I (measured in the resistors equals the voltage of the
shown in Fig.4. A moving coil meter amps). This can be written in three source. We have:
comprises a coil of wire round an forms, so that if you know two of these
iron core placed between the poles quantities you can find the other. VS1 VR1 VR1 = 0
of a permanent magnet (see Fig.5).
When direct current flows through V = IR I = V/R R = V/I VS1 = VR1 + VR1
the coil a force is produced on the
coil this is same effect as used in By resistor, we can mean anything that Kirchhoffs current law (KCL) can be
electric motors. The current in the behaves like a resistor, which includes stated as:
coil creates a magnetic field it acts the coil of a moving coil meter with a
as an electromagnet with the iron core direct current flowing through it. Taking direction into account, the sum
concentrating the magnetic field. The Ohms law provides the relationship of currents at a junction in a circuit is
magnetic field from the coil repels between current and voltage for a given zero.
or attracts the magnetic field of the resistor. Other important laws describe Currents flowing into the junction
permanent magnet and produces a the relationships between voltages in a
force that causes the coil to rotate. circuit (irrespective of current values)
This force is opposed by spiral springs
attached to the coil, which can also V
R1 VR1
act as the conductors to supply the I
+
current to the coil. The coil is often VS VS

mounted (via spindles) on bearings, R
R2 VR2
which allow easy movement. With V = IR I=
V
R=
V
correctly shaped magnet poles and R I

good mechanical design the rotation of


the coil has a good linear relationship Fig.6. Ohms law: the relationship
with the applied current. between resistance, voltage and current Fig.7. Kirchhoffs voltage law

Everyday Practical Electronics, August 2016 55

Circuit Surgery AUGUST 2016.indd 55 27/06/2016 09:37


are positive and currents flowing out voltage source has I I I
are negative (again, if we swap this not changed, KVL
the law holds but all the signs in the tells us that the R L LV L R L V
sum change). An example is shown voltage across the
in Fig.8. The sum of the currents is load must now be + + +
zero alternatively, we can say the smaller. V

S R VL VL

S SV

M R

two currents flowing out add up to the For the example V


Burden

current flowing in. in Fig.9, if VS is 10V A A


and RL is 100k
IR1 IR2 IR3 = 0 then the current in
the original circuit a) Original circuit b) Circuit with ideal
ammeter inserted
c) Circuit with real
ammeter inserted
IR1 = IR2 + IR3 will be 100A
Current meter (= 10V/100k). Fig.9. Effect of an ammeter on a circuit
This is the current
that will be measured by an ideal with the meter. Fig.10 shows an
ammeter. If we insert an ammeter ammeter with a shunt in which the
with resistance 1k (this could be a total current (IT) is the current we want
R1
moving coil meter with 100A FSD) to measure. IT splits between the meter
+
IR1 then the total resistance is 101k current (IM) and the shunt current (IS)
VS

and the current will reduce to 99A. in accordance with KCL. KVL tells us
IR2 IR3
The voltage burden will be 100mV (= that the voltage across the meter and
R2 R3
100A 1k). Inserting the ammeter the shunt are the same (labelled VM
has caused the current to change by in Fig.10). Using Ohms law we can
about 1%, which in many cases would write:
be acceptable, particularly as the
accuracy of typical moving coil panel VM = IMRM
Fig.8. Kirchhoffs current law meters is of this order.
For the example in Fig.9, if VS = And
As indicated by the earlier discussion 0.1V and RL = 1k then the current
a moving coil meter fundamentally in the original circuit will be 100A VM = ISRS
responds to the current flowing in (= 0.1V/1k) as in the previous
the coil that is, it is naturally acts
CS9-Aug16 example. Again, this is the current Combining these we get:
41mm an ammeter. A particular moving
x 1.5 COL that will be measured by an ideal
coil meter will have a certain current ammeter. If we insert the same ISRS = IMRM
corresponding to the maximum ammeter, with resistance 1k, then
amount of movement when the the total resistance equals 2k and Which can rearrange to give the
pointer is at the end of the scale. This the current will reduce to 50A. The required value of the shunt resistance:
is known as the full-scale deflection voltage burden will be 50mV (= 100A
(FSD) current. Typical FSD currents 1k). Inserting the ammeter has RS = IMRM / IS
range from around 20A to several caused the current to change by 50%,
milliamps. The minimum current which is unlikely to acceptable as a We use the FSD case, so IM is the
which can be measured is set by the measurement of the load current. meter FSD. We know RM, the meter
FSD and to some extend the length of The preceding examples illustrate resistance, but not IS, the shunt
the needle and size of the scale, which that making a current measurement current. However KCL tells us:
taken together determine the smallest by inserting an ammeter may result
change in current which can be readily in significant errors. In particular, it IS = IT IM
observed. is situations where the source voltage
An ideal ammeter has zero is low which are likely to cause In which IT is the full-scale current of
resistance, but real meters have some problems when using ammeters with thewhich
In meterITwith is thethe shunt.current
full-scale Substituting
of the meter with the sh
resistance. For moving coil meters this relatively high resistance. In such this intoequation
previous the previouswe get: equation we get:
can be quite significant and typically situations, moving coil meters may As an example,
In which considercurrent
IT is the full-scale an ammeter
of the meter with the sh
ranges from a few hundred ohms not be appropriate, although this issue previous equation we get:
to a few kilohms This means that affects all ammeters (analogue and I R
RS = M M
inserting an ammeter into a circuit to digital) inserted into a circuit to some (IIT RI M )
make a measurement will disrupt the extent. In more demanding cases, RS = M M
voltages and currents in the circuit measurements can be made by active with (an I T FSDI M ) current of 100A and
being measured to some extent. In electronic circuits which can amplify
As an example,
resistance consider
of 1k. If we anwould
ammeterlikewith
to an FSD current o
particular, an ideal ammeter would the voltage across a much smaller we would
measure like to
currents measure
up tocurrents
10mA, up to
then 10mA, then the shu
As an example, consider an ammeter with an FSD current o
have zero voltage across it, but a real resistance, or provide a virtual earth the shunt we require is:
we would like to measure currents up to 10mA, then the sh
ammeter will have a voltage across it with very low voltage. In multimeters,
100 1k a switch is used to
when making a measurement, this is RS = = 10.1
called the voltage burden. Shunts
(10m
100 1k )
100
RS = = 10.1
Fig.9 illustrates the impact of We can use an ammeter to measure (10m 100 )
inserting an ammeter into a circuit. currents higher than the FSD by using In multimeters, a switch is used to change the shunt resistan
Here we have an ideal voltage source, a resistor, called a shunt, in parallel changeCare
ranges. the shunt
must be resistance
taken withtothe provide
switch design to preven
VS, connected to a load resistance RL In multimeters,
different current a switch is used tomust
change the shunt resistan
meter during rangeranges.
changes.Care For example, be imagine a curren
(see Fig.9(a)). We want to measure the ranges.
taken Care
with must
the and be
switch taken with the switch design to preven
VM
on a 10A range the design to prevent
user switched to the 1A range. If the
current in the load, I, so we insert an large currents
meter during rangedamaging
changes. For theexample,
meter imagine a curren
ammeter. If the ammeter is ideal (as was moved (disconnecting
during all theexample,
shunts), then the full 900m
IM RM A
on a 10Arangerange andchanges.
the userForswitched to the 1A range. If th
in Fig.9(b)) nothing will change and If this was,
imagine say, a 100A
a current of 900mA FSD moving
was coil meter it would p
being
was moved (disconnecting all the shunts), then the full 900
the ammeter will read the original IT IT measured
this on
range selectiona 10A range
switches and
mustthe be user
make-before-break. A
If this was, say, a 100A FSD moving coil meter it would p
value of load current. If we insert a RS
switched individual
switching to the 1A shuntrange.resistors
If the switch
in parallel is to have a c
real ammeter with resistance RM then
IS this range
went open selection switches
circuittap aspoints.must moved
it was be make-before-break. A
and select different This is called an Ayrton shun
switching individual
(disconnecting shunt resistors in the
parallel is to have a c
there will be a voltage across that rob_guyer in theall the
discussionshunts), then
on grahamrounces post.
ammeter, the voltage burden VBurden, full 900mA
and select would
different tappass through
points. the an Ayrton shun
This is called
given by Ohms law as IRM. Since the Fig.10. Ammeter with shunt meter.
rob_guyer If this
in thewas, say, a on
discussion 100A FSD
grahamrounces post.
Voltmeter
56 Everyday
As we Practical
have already
Voltmeter Electronics,
discussed, August
a moving2016coil meter has a fix
certain voltage across it at FSD current. If we apply a voltag
As we have already discussed, a moving coil meter has a fi
meter the deflection will be proportional to the voltage. Thu
certain voltage across it at FSD current. If we apply a volta
used as a voltmeter as well as an ammeter.
meter the deflection will be proportional to the voltage. Thu
Circuit Surgery AUGUST 2016.indd 56 27/06/2016 09:37
used as a voltmeter as well as an ammeter.
will limit the smallest voltage which can be measured. Just
using a shunt we can also add resistors to increase the volta
put resistors in series with the meter and they are referred to

Fig.12 shows a meter with a multiplier resistor, RU. The me


moving coil meter it would probably current IM and resistance
I RM. We want a full scale voltage o
M
be damaged. To prevent this, range VR = IMRS will be equal to the sum of the voltages across the two resis
selection switches must be make- Ohms law in terms of the meter current and resistance value
R
before-break. An alternative approach The voltage measured will be VR lower U

to switching individual shunt resistors than the actual voltage, that is:
in parallel is to have a chain of resistors VM = IMRM + IMRU
VM RM
across the meter and select different tap VM = VO IMRS
points. This is called an Ayrton shunt So
and was mentioned by rob_guyer in This problem is referred to as the A

the discussion on grahamrounces voltmeter loading effect. As with IMRU = VM IMRM


post. errors caused by ammeters, voltmeter
loading may be minimal or so severe
Voltmeter that the measurement is useless. It all Giving the required multiplier as:
Fig.12. Multiplier resistor to use an
As we have already discussed, a depends on the relative value of RS and ammeter to measure voltage
moving coil meter has a fixed resistance RM. The meter resistance must be much (V I M RM )
RU = anM FSD
and therefore a certain voltage across higher than the source resistance to with I M current of 100A and
it at FSD current. If we apply a voltage get a valid measurement. Circuits with resistance of 1k. If we would like to
at, or lower than this, to the meter the (I
very ) to flow from the source.
high resistances are therefore the This in turn will cause a voltage drop across the source
M
measure voltages up to 10V, then the
deflection will be proportional to the resistance given by Ohms
most difficult to deal with and again law as: multiplier
For example, we requireanis:ammeter with an FSD current of 1
consider
voltage. Thus, a moving coil meter can moving coil meters will not be usable In awould
we multimeter a switch
like to measure can beupused
voltages to 10V, then the mult
be used as a voltmeter as well as an in
VR =moreIMRS challenging cases. Active
ammeter. circuits can be used to build higher
We saw that inserting an ammeter in performance voltmeters, forV example
(10 100 1k ) = 99 k
RS = voltage, that is:
The voltage measured will be R lower than the actual
a circuit to measure current changed using a high input impedance op amp 100
the currents and voltages in the to buffer the voltage being measured.
circuit, leading to errors. Likewise, VM = VO IMRS to select various multiplier resistors
if we connect a voltmeter across a Multipliers to set different voltage ranges. If very
component to measure the voltage We
This noted
problemthat a moving
is referred to as coil meter loading
the voltmeter high effect.
voltages Asarewithbeing
errorsmeasured
caused bythen
some current will be diverted into the will have a natural full-scale voltage it
ammeters, voltmeter loading may be minimal or so severe that the measurementis usual to implement the multiplier
is useless. It
meter, again changing the situation in related toonthe FSD value current resistor as a set of resistors in series,
all depends the relative of RSand
and RM. The meter resistance must be much higher
the circuit resulting in an imperfect meter resistance. As with current whose value adds up to the required
measurement. Whereas ammeters
than the source resistance to get a valid measurement. multiplierCircuitsvalue.with very
Thishigh resistances
reduces the are
measurement this, together with the
CS12-Aug16
ideally have zero41mm resistance voltmeters therefore the most difficult
scale size, will limit the smallest to deal with and voltage across each individualin
again moving coil meters will not be usable
x 1 COL
ideally have infinite resistance. voltage which can be measured. Just as
more challenging cases. Active circuits can be resistor and higher
used to build reduces the possibility
performance of
voltmeters,
Fig.11 illustrates the impact of we can measure
for example using highera high inputcurrents using op amp
impedance breakdown
to buffer due to the high
the voltage beingvoltage.
measured.
attaching a voltmeter to a circuit. a shunt we can also add resistors to
Here we want to measure the open- increase the voltage range of a meter. Sensitivity
Multipliers
circuit output voltage of a device or This time we put resistors in series Whatever multiplier is used a moving
We noted that a moving coil meter will have a coil natural full-scalewill
voltmeter voltage relatedthe
require to the
sameFSD
circuit. As with any such situation we with the meter and they are referred to
can represent this as an ideal voltage current and
a multipliers. meter resistance. As with current measurement
current at this,
full-scale together
voltage with
the
this scale
will besize,
source (VS) in series with a source Fig.12
will limit the showssmallesta voltage meterwhich the FSDJust
withcan abe measured. current
as weofcan themeasure
meter. The lower
higher currents
resistance (eg, the output resistance multiplier
using a shuntresistor, we can also RU. add Theresistors
meter to thisthe
isincrease is the
voltageless range
loadingof awill occur.
meter. ThisThis
time we
of an amplifier, or internal resistance an
putammeter
resistors inwith series fullwith scale current
the meter brings
andIMthey are us to
referred to agrahamrounces
multipliers original
of a battery) see Fig.11(a). The same and resistance RM. We want a full scale question. The ohm/volt specification
representation can be applied to a voltage of VM and KVL tells us that this of a moving coil meter is called its
Fig.12 shows a meter with a multiplier resistor,sensitivity. RU. The meter If weis anlook
ammeter with fulllaw
at Ohms scale
voltage measurement anywhere in will be equal to the sum of the voltages
a circuit (it does not have to be at a current I and resistance
across the two resistors, these in turn
M R M . We want a full scale voltage of V and KVL
we see ohm/volt corresponds to R/V,
M tells us that this
designated output). are given by Ohms law in terms of the
will be equal to the sum of the voltages across which
the two is 1/I
resistors,(the reciprocal
these in turn of
arecurrent).
given by
If we attach an ideal voltmeter to meter
Ohms law current
in terms andof resistance
the meter current values. Thus, the
and resistance values. sensitivity
So we have: of a meter is
the circuit in Fig.11(a), as shown So we have: simply one divided by the FSD current.
in Fig.11(b), nothing will change. VM = IMRM + IMRU For the 100A FSD example we have
The ideal voltmeter has infinite VM = IMRM + IMRU been using, the sensitivity is 1/100A
resistance and will therefore not cause = 10k/V.
any current to flow. The meter will So
So The sensitivity does not tell you the
measure VO correctly. However, if we meters coil resistance; that is a separate
attach a real voltmeter the situation IIMMR
RUU = VM M IIM MR RMM specification. For a multimeter made
will be as shown in Fig.11(c). The using a moving coil ammeter, the
finite meter resistance (RM) will cause Giving
Giving the therequired
requiredmultipliermultiplier as: as: sensitivity will tell you the resistance
a current (IM) to flow from the source. For example, consider an ammeter of the meter on each range. Multiply
This in turn will cause a voltage drop the full-scale voltage by the sensitivity
across the source resistance given by RU =
(VM I M RM ) to find the resistance, which will
Ohms law as: IM tell you the conditions under which
the meter can be used without
causing too much loading (the source
For example, consider an ammeter with an FSDresistance current of must
100Abeand muchresistance of 1k.
higher). For If
S R RS
we would like toV measure voltages up to 10V, then
S
the multiplier
example 10k/Vwe onrequire
a 10V is: range is
100k (corresponding exactly with
R
V (10 I 100 1k )
I=0 V =V I=0 O V =V
S M
S
V
the example above where we have a
O S
RS = = 99 k 99k multiplier plus a 1k meter
+ + 100
+ V R
VS V S S V
M M
resistance). Digital voltmeters (and the

volt ranges of digital multimeters) are
not specified in the same way because
they usually have the same resistance
a) Original circuit b) Circuit with ideal voltmeter attached c) Circuit with real voltmeter attached
across all voltage ranges and, which is
often 10M.
Fig.11. Effect of a voltmeter on a circuit

Everyday Practical Electronics, August 2016 57

Circuit Surgery AUGUST 2016.indd 57 27/06/2016 09:37


DIRECT BOOK SERVICE

Teach-In 2016 The books listed have been


selected by Everyday Practical
Electronics editorial staff as
Exploring the Arduino being of special interest to
everyone involved in electronics
and computing. They are
ARDUINO FOR DUMMIES
John Nussey
supplied by mail order direct to
Arduino is no ordinary circuit board. Whether youre an artist, a designer, a programmer, or a your door. Full ordering details
hobbyist, Arduino lets you learn about and play with electronics. Youll discover how to build
a variety of circuits that can sense or control real-world objects, prototype your own product,
are given on the last page.
and even create interactive artwork. This handy guide is exactly what you need to build your
own Arduino project what you make is up to you!
FOR A FULL
Learn by doing start building circuits and programming your Arduino with a few easy
examples right away! DESCRIPTION OF THESE
Easy does it work through Arduino sketches line by line, and learn how they work and BOOKS AND
how to write your own.
Solder on! dont know a soldering iron from a curling iron? No problem! Youll learn the CD-ROMS SEE THE SHOP
basics and be prototyping in no time.
Kitted out discover new and interesting hardware to turn your Arduino into anything from
ON OUR WEBSITE
a mobile phone to a Geiger counter.
Become an Arduino savant find out about functions, arrays, libraries, shields and other www.epemag.com
tools that let you take your Arduino project to the next level
Get social teach your Arduino to communicate with software running on a computer to link
the physical world with the virtual world All prices include
438 Pages Order code ARDDUM01 19.99
UK postage
EXPLORING ARDUINO
Jeremy Blum
Arduino can take you anywhere. This book is the roadmap.
Exploring Arduino shows how to use the worlds most popular microcontroller to MICROPROCESSORS
create cool, practical, artistic and educational projects. Through lessons in electrical
engineering, programming and human-computer interaction this book walks you
through specific, increasingly complex projects, all the while providing best practices
that you can apply to your own projects once youve mastered these. Youll acquire INTERFACING PIC MICROCONTROLLERS
valuable skills and have a whole lot of fun. SECOND EDITION Martin Bates
Explore the features of several commonly used Arduino boards Use the Arduino to 298 pages Order code NE48 34.99
control very simple tasks or complex electronics Learn principles of system design,
programming and electrical engineering Discover code snippet, best practices and
PROGRAMMING 16-BIT PIC MICROCONTROLLERS
IN C
system schematics you can apply to your original projects Master skills you can use for LEARNING TO FLY THE PIC24 Lucio Di Jasio
engineering endeavours in other fields and with different platforms (Application Segments Manager, Microchip, USA)
496 pages +CD-ROM Order code NE45 38.00
357 Pages Order code EXPARD01 26.99
INTRODUCTION TO MICROPROCESSORS AND
MICROCONTROLLERS SECOND EDITION
John Crisp

THEORY AND PROJECT 222 pages Order code NE31 29.99


CONSTRUCTION
REFERENCE THE PIC MICROCONTROLLER
YOUR PERSONAL INTRODUCTORY COURSE
THIRD EDITION. John Morton
IC 555 PROJECTS
E. A. Parr 270 pages Order code NE36 25.00
PRACTICAL ELECTRONICS HANDBOOK 167 pages Order code BP44 5.49
6th Edition. Ian Sinclair PIC IN PRACTICE (2nd Edition)
ELECTRONIC PROJECT BUILDING David W. Smith
440 pages Order code NE21 33.99
FOR BEGINNERS R. A. Penfold
308 pages Order code NE39 24.99
135 pages Order code BP392 5.99
PRACTICAL FIBRE-OPTIC PROJECTS MICROCONTROLLER COOKBOOK
R. A. Penfold Mike James
132 pages Order code BP374 5.45 240 pages Order code NE26 36.99

STARTING ELECTRONICS 4th Edition


BOOK ORDERING DETAILS
Keith Brindley
296 pages Order code NE100 18.99 All prices include UK postage. For postage to Europe (air) and the rest of the world (surface) please
add 3 per book. Surface mail can take up to 10 weeks to some countries. For the rest of the world
ELECTRONIC CIRCUITS FUNDAMENTALS &
APPLICATIONS Third Edition Mike Tooley airmail add 4 per book. CD-ROM prices include VAT and/or postage to anywhere in the world. Send
400 pages Order code TF43 25.99
a PO, cheque, international money order ( sterling only) made payable to Direct Book Service or
card details, Visa, Mastercard or Maestro to: DIRECT BOOK SERVICE, WIMBORNE PUBLISHING
FUNDAMENTAL ELECTRICAL AND ELECTRONIC
PRINCIPLES Third Edition C.R. Robertson LIMITED, 113 LYNWOOD DRIVE, MERLEY, WIMBORNE, DORSET BH21 1UU.
368 pages Order code TF47 21.99 Books are normally sent within seven days of receipt of order, but please allow 28 days for delivery more for overseas orders.
Please check price and availability (see latest issue of Everyday Practical Electronics) before ordering from old lists.
A BEGINNERS GUIDE TO TTL DIGITAL ICs
R.A. 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 Fax 01202 843233. E-mail: dbs@wimborne.co.uk
UNDERSTANDING
SYSTEMS
ELECTRONIC CONTROL
Order from our online shop at: www.epemag.com
Owen Bishop
228 pages Order code NE35 36.99

58 Everyday Practical Electronics, August 2016

Books1 2 PAGES.indd 60 27/06/2016 10:13


FULL COLOUR COMPUTING BOOKS

WINDOWS 8.1 EXPLAINED KINDLE FIRE HDX EXPLAINED AN INTRODUCTION TO THE NEXUS 7
Windows 8.1 is the latest version of Microsofts operating This book is written to help users get to grips, quickly and This book is intended for the new user of the Nexus 7, al-
system. It is installed on all new Windows Desktop. Laptop easily, with the amazing Kindle Fire HDX tablet. You will be though much of it will also apply to the Nexus 10. It is easy to
and X86 tablet computers and is also available as a free guided through the configuration and use of the Kindle Fire understand being written in plain English and avoiding tech-
upgrade. Whether you choose to use the touch screen Tile HDXs facilities and functions. This book was written using the nical jargon wherever possible.
interface or the mouse operated Desktop interface, a good 7 HDX but it is also applicable to the 8.9 model. Among the many useful topics covered are: An overview of the
working knowledge of the operating system is essential to Among the many topics covered are: An overview of the Kin- main features of the Nexus 7; setting up the Nexus 7; charg-
get the most from your computer and this book will help you dle Fire HDX. Charging and setting up, connecting to a Wi-Fi ing the battery; connecting to the Internet and signing up for
to do just that. network, registering the device and connecting to Social Net- Gmail; touch-screen operation and navigating around the vari-
The book applies to Windows 8.1, Windows 8.1 Pro and the works; setting up and using the 1-Click Amazon account for ous screens; installing Apps from the Google Play Store; set-
vast majority of Windows 8.1 Enterprise. Also parts of the buying and downloading books, music and other content that ting a password and other precautions to keep your files safe;
book should be applicable to windows RT 8.1 which is built you have searched for. Explaining the use of the Carousel. connecting accessories such as a USB Drive, mouse and key-
on the same foundation as Windows 8.1 but is a restricted Starting screen Apps. Web and Device settings and the May- board; enjoying entertainment such as eBooks, games, mu-
version designed specifically for ARM tablets. day facility; browsing the web with Silk Internet explorer, us- sic and videos; searching the Internet, including speaking in
ing Bookmarks and History, printing web pages, documents keywords; using e-mail, Skype and social networking; install-
Among the many topic covered are: An overview of the Tile
and messages; connecting to a server to send and receive e- ing the free Google Drive app to save your documents in the
Interface, Desktop, Taskbar, Tray Notification Area, Charms
mail messages, using and saving attachments. Creating and cloud; using Google Docs free word processing and spread-
bar and running Apps; managing Windows settings, per-
organising your Contacts and Calendar appointements; us- sheet software; printing a document using Google Cloud Print,
sonalising your PC and creating User Accounts; using the
ing the Kindle Fire camera to take photos and videos. Watch- Exporting Nexus 7 files to laptop and desktop computers; and
Desktop File Explorer, SkyDive, Internet Explorer and the
ing TV, listening to music you bought, imported and from the much more besides.
E-mail App; working with and organising digital photo-
radio. Using the X-ray feature with books and other media; Even if you are a complete beginner, this book will help you
graphs, using Media Player to play and store music and to
Using the OfficeSuite to view your documents, upgrading to to easily acquire the skills needed to understand and make
burn CDs and installing Media Center to play DVDs; con-
OfficeSuite Professional 7 to allow both viewing and creation the most of the Nexus 7.
necting to wireless networks, setting up a HomeGroup,
of Word documents. Excel spreadsheets and PowerPoint
sharing a printer and networked PCs; using mobility tools to
presentations. And more besides...
keep your laptop running while away from home; accessibil- 118 Pages Order code BP744 8.99
ity features should you have dexterity or eyesight problems; This book will help you acquire the skills needed to under-
keeping your computer healthy and backing up important stand and make the most of your Kindle Fire HDX.
files; And much more besides..
118 Pages Order code BP743 8.99
180 Pages Order code BP747 10.99

HOW TO FIX YOUR PC PROBLEMS COMPUTING WITH A LAPTOP FOR THE OLDER
R.A. Penfold GENERATION
R.A. Penfold
128 pages Order code BP705 8.49 120 pages Order code BP702 8.49

AN INTRODUCTION TO WINDOWS VISTA AN INTRODUCTION TO EXCEL SPREADSHEETS


P.R.M. Oliver and N. Kantarris Jim Gatenby

120 pages Order code BP703 8.49 18 pages Order code BP701 8.49

BOOK ORDER FORM THE BASIC SOLDERING GUIDE


Full name: ....................................................................................................................................... HANDBOOK
LEARN TO SOLDER SUCCESSFULLY!
Address: .......................................................................................................................................... ALAN WINSTANLEY
The No.1 resource to learn all the basic aspects
......................................................................................................................................................... of electronics soldering by hand.
With more than 80 high quality colour photo-
......................................................................................................................................................... graphs, this book explains the correct choice
of soldering irons, solder, fluxes and tools. The
techniques of how to solder and desolder elec-
.............................................. Post code: ........................... Telephone No: .................................... tronic components are then explained in a clear,
friendly and non-technical fashion so youll be
Signature: ........................................................................................................................................ soldering successfully in next to no time! The
book also includes sections on Reflow Soldering
and Desoldering Techniques, Potential Hazards
I enclose cheque/PO payable to DIRECT BOOK SERVICE for .............................................. and Useful Resources. Plus a Troubleshooting
Guide.
Please charge my card ....................................... Card expiry date......................................... Also ideal for those approaching electronics
from other industries, the Basic Soldering Guide
Card Number ....................................................................... Maestro Issue No.............................. Handbook is the best resource of its type, and
thanks to its excellent colour photography and
Valid From Date ................ Card Security Code ................ (The last three digits on or just below the signature strip) crystal clear text, the art of soldering can now be
learned by everyone!
Please send book order codes: .......................................................................................................
86 Pages Order code AW1 9.99
..........................................................................................................................................................
Please continue on separate sheet of paper if necessary

Everyday Practical Electronics, August 2016 59

Books1 2 PAGES.indd 61 27/06/2016 10:13


AUDIO AUDIO OUT

OUT
L R

By Jake Rothman
Super-simple retro amp-speaker combo Part 2
strapped, removing one electrolytic
capacitor and one resistor. It also im-
+48V
Bootstrap VREF
Rsense proves the power-supply rejection
capacitor
10k
10F
2 x 1N4148
100 8mA
ratio (PSRR) since the power to the
whole circuit is now fed by the current
+

RC
To output
VREF TR3
25C3071
source. Rescaling the low-current cir-
12k
(High gain
Hfc>500
cuit to a small power amplifier results
in the circuit in Fig.15.
To bootstrap 100 22F
capacitor Diode dodges

+
10pF
Common-emitter
stage for voltage gain 1mA
Output
Note the reference voltage for the com-
TR4
TR1
22k 220
BC337 mon-base transistor TR2 is derived
BC182 BC369
220nF 12k from a reverse-operated Zener diode
(D2). This useful technique gives a
82k 4.7k forward voltage of 0.75V rather than a
normal diodes 0.6V. The small voltage
difference ensures a full output swing
1.5M 0V
because the transistor remains on
throughout the whole cycle. The orig-
inal circuit used 1.2V, which subtracts
Fig.13. Taylor buffer from Aprils Audio Out, with added common-emitter amplifier to give 0.6V from the available swing. Another
inverting gain block. This can be used in the Baxandall volume control if needed. diode (D1) is connected in reverse
Discrete design employed using the powerful circuit parallel with the base-emitter junction
The discrete version of this circuit is design trick I call the polarity flip, of TR1. This prevents bias shift when
based on a simple common-emitter where the circuit is turned upside overdriven by ensuring equal positive
amplifier combined with the Taylor/ down and the transistors are changed and negative current paths.
ring-of-three buffer (see the Active from NPN to PNP and vice versa, as This topology isnt symmetrical like
volume article in EPE, April 2016) shown in Fig.14. This enables the a standard push-pull amplifier, so
shown in Fig.13. A simplification is common-emitter stage to be DC boot- consequently it has mainly even-order
(second) harmonic distortion. Howev-
er, this is not very noticeable and pos-
470nF
+48V
sibly enhancing to some sources, such
0V
4.7k
BC640
simple music (not orchestras). This
22k
(Modulated
current
is minimised by replacing the emit-
source) ter-follower transistor (TR4/5) with a
220
Sziklai pair (see inset) to equalise the
10pF
+24.5V
100 22F gain on both cycles. The difference is
clearly seen in the oscillogram of the
+

DC bootstrap

Output amplifier running open loop in Fig.16


BC337
BC557
1k where just a single low-gain transistor
220nF
BC182 has been used. This only mattered
12k
BC640 when driving high currents in a power
amplifier. For the original buffer it was
82k
100 8mA not a problem. Using a monolithic Dar-
VREF
2 x 1N4148 Rsense lington was harder to stabilise, because
you cant put a capacitor inside it! Ive
yet to try a MOSFET.
1.5M 0V
This little circuit can be built on a
bit of Veroboard, as shown in Fig.17
(construction details for this and a
Fig.14. Polarity-flipping the circuit in Fig.13. This enables the collector load resistor to be DC
bootstrapped and the whole circuit to be powered by the current source, therby improving hum PCB version to follow next month).
rejection. The circuit works in class A up to

60 Everyday Practical Electronics, August 2016

Audio Out (MP 1st) AUGUST 2016.indd 60 27/06/2016 10:02


Emitter V+ 21V rectified
C6 Iq = 50mA 15V transformer
TR4 470nF R9 TR3
BC327 2.7k BC143 140mA max
Emitter 0V
Base With heatsink
800mW max
dissipation
C11 Base
=
330pF C7
220pF

Sziklai pair
Collector Set output to 11V
symmetric clipping
C8
VR1 330F
R15 TR5 With heatsink 25V
270 2.2M
2N1711, BFY51

+
High-gain
PNP
R6 R7 R8 compound Output 1.85W
680 10k 470 transistor*
R4 +
*High-gain PNP Collector 680k
compound transistor R11
C3 22 Special elliptical
100nF C4
100pF loudspeaker
C5 C9 EMI 30 impedance
470pF 22nF (Actually 27)
R1 R2 C2 R3
1.8k 1.5k 1nF 330k
+0.75V
+0.12V
TR2
TR1 BC182
Input 3.3k C1 R5 BC182 Zener R10 R12
eg, CD player 1nF 680k (Any 3.3 1
D1 voltage)
1N4148 Set Iq
0V
C10 Lower R10
470nF higher Iq
R13
1.6k
R14
1.2k

Fig.15. Scaling the circuit in Fig 14 to give higher current to drive the 30 EMI speaker, running on 24V rails. The current sensing and equalisation
shown in Fig.12 have been added. This circuits parts cost around 2.00, the valve equivalent about 40.00.

about half a watt, whereupon it moves mount. There is a general sprinkling


to a form of class-AB operation. This of small ceramic base-collector capac-
is indicated by the current drawn, itors to ensure stability. This is one of
which increases from 60mA quiescent the liberties afforded to designers of
to 140mA at clipping. The distortion discrete circuitry. Chip designers have
residual is low, at around 0.02% un- to minimise the use of capacitors be-
til it is driven above 0.5W, where it cause they use a large die area, which
becomes more spiky, like a class AB is why high-frequency instability and
amp. At least there is no distortion a high minimum gain can be an issue
rise at low levels like many IC-based with chips.
amplifiers. The current consumption
range in this amplifier design is a Higher power
good compromise, since it is possible The 2W amplifier circuit needed an
Fig.16. Output of the amplifier in open-loop
showing the difference in gain if two iden- to use TO5 output transistors with unusual 30 speaker (Im happy to
tical output transistors are used. Using a clip-on heatsinks. For higher power, supply them at low cost just email
compound transistor for the emitter follower TO126/220-packaged devices will be me at: jacob.rothman@homecall.
equalised both halves of the cycle. needed, which are less convenient to co.uk). For those needing more power

Fig.17. Finished amplifier circuit built on stripboard.

Everyday Practical Electronics, August 2016 61

Audio Out (MP 1st) AUGUST 2016.indd 61 27/06/2016 10:02


V+ 24V
C10 + Iq = 72mA
IMAX = 460mA
100F R10 TR5
25V 2.7k BD436*

0.4mA

C7
220pF
0.1V
R9 *TR5/6 on small
270 21/C heatskinks

0.12mA C9
R7 R8 TR4 1000F
150 6.8k BC327 25V
+12.5V

+
R6 C6
10k 330pF
0.12V Output 1.85W
+
C1 R1 4.3mA R13
220nF 1k C4 10 8
47pF R11 7.5W RMS
Input C5 270 C8 22Vpk-pk
1nF TR6 100nF
3.5mA BD437*
R2 R4 TR1
22k 150k BC559C
+0.75V
+0.19V
ZIN = 50k TR3
+11V TR2 BC337
R3 C2 + R5 BC337
0.75V R12 R14
22F C11 5.6k 0.22
18k 1nF 3.3
16V D1 D2
5.6V UF4002
0V
C3
22F
16V

+
Fig.18. Higher power Taylor amplifier circuit with non-inverting topology

(7.5W RMS) into a normal 8 speaker as a UF4001 has to be used to avoid a dont want to use chips, such as the
and a higher input impedance, the switching glitch at high frequencies. TDA2030 or LM384, and dont want
modified circuit is shown in Fig.18. Schottky diodes, although very fast, the hassle of the Iq adjustment that
This has an extra transistor on the have insufficient voltage drop. The bedevils normal discrete class-AB
input (TR1) to allow a non-inverting amplifier is shown built on a piece of designs. Is that the dulcet tones of the
configuration to be used. By bypass- 2.75 1.75-inch perf-board in Fig.19. Shipping Forecast I hear?
ing the quiescent current (Iq) sense This method of construction is very
resistor (R12) with a diode (D2) the effective for working out 0.1-inch grid Next month
circuit can be made to operate in class PCB layouts with traditional leaded My apologies for those of you expect-
A up until the conduction threshold analogue parts and heatsinks. Fig.20 ing the promised construction details
of the diode is reached, at around shows the hardwiring underneath. in this article. However, patience will
1W, whereupon it begins to operate I guess all this is reinventing the wheel, be rewarded next month when we will
in class B. An ultra-fast diode such but I offer this circuit for those who finally get to build the amplifier!

Fig.19. The higher power amplifier built on perfboard. Note the TO126 Fig.20. Underside of the perfboard such constructions are often the
output transistors and heatsinks required start of a PCB design

Check out our website


for our Summer Sale:
www.epemag.com

62 Everyday Practical Electronics, August 2016

Audio Out (MP 1st) AUGUST 2016.indd 62 27/06/2016 10:02


NEW
PC OSCILLOSCOPES
LIKE A BENCHTOP OSCILLOSCOPE,
JTAG Connector Plugs Directly into PCB!! ONLY SMALLER AND BETTER
No Header! No Brainer!

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


into a tiny footprint of pads and locating holes in your PCB, eliminating
the need for a mating header. Save Cost & Space on Every PCB!!
Solutions for: PIC . dsPIC . ARM . MSP430 . Atmel . Generic JTAG . Altera
Xilinx . BDM . C2000 . SPY-BI-WIRE . SPI / IIC . Altium Mini-HDMI . & More

www.PlugOfNails.com 2 channel, 4 channel and MSO models


Tag-Connector footprints as small as 0.02 sq. inch (0.13 sq cm) Up to 100 MHz bandwidth
Up to 128 MS buffer memory
Function generator and AWG
CRICKLEWOOD Decode 15* serial protocols
ELECTRONICS Established 1981
USB-connected and powered
Windows, Linux and Mac software
Frustrated with your supplier?
suppier?
Visit our component packed Prices from 79 to 749
website for a vast range of
parts - old and new,
many unavailable elsewhere!
www.cricklewoodelectronics.com
1000s OF PRICES REDUCED!
1000
Alternatively phone us on
020 8452 0161 with your
requirements.

All models include full software and 5 *Serial decoding (15 protocols
year warranty. Software includes including 1-Wire, CAN, Ethernet, IC,
measurements, spectrum analyzer, IS, LIN, RS-232, SENT, SPI, USB 1.1)
advanced triggers, color persistence, , with FREE updates.
masks, math channels, all as standard. Free Software Development Kit.
Visit our Shop, Call or Buy online at:
25 years of PC Oscilloscopes
www.cricklewoodelectronics.com
020 8452 0161 www.picotech.com/PS461
Visit our shop at:
40-42 Cricklewood Broadway
London NW2 3ET

Everyday Practical Electronics, August 2016 63

Page 63.indd 63 27/06/2016 10:35


EPE IS PLEASED TO BE ABLE TO OFFER YOU THESE

ELECTRONICS CD-ROMS
From TINA Design Suite V10 OU
FE
ATU
RE
49.00 Analogue, Digital, Symbolic, RF, MCU and Mixed-Mode Circuit 201
RT
EA CH
D IN
5S -IN
Simulation and PCB Design with TINA ER
IES
TINA Design Suite V10 is a powerful yet affordable software package for analysing, designing
and 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 TINAs 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 TINAs sophisticated diagram windows, on virtual instruments, or in
the live interactive mode where you can even edit your circuit during operation.
Customise presentations using TINAs 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 Basic V10 (Hobbyist) for 129 or Student V10 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: www.epemag.com

ELECTRONICS ELECTRONICS ELECTRONICS


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

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


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

NEW ELECTRONICS TEACH-IN BUNDLE


SPECIAL BUNDLE PRICE 18.95 FOR PARTS 1, 2, 3 & 4

CD-ROMs Order
Ordercode
code NEW Teach-InETI BUN
Bundle Bundle Price 18.95

64 Everyday Practical Electronics, August 2016

CD-ROMs Pages 2 PAGES.indd 64 27/06/2016 15:52


CIRCUIT WIZARD GCSE ELECTRONICS
Circuit Wizard is a revolutionary software system that
combines circuit design, PCB design, simulation and Suitable for any student who is serious about studying and
CAD/CAM manufacture in one complete package. who wants to achieve the best grade possible. Each programs
Two versions are available, Standard or Professional. clear, patient and structured delivery will aid understanding of
electronics and assist in developing a confident approach to
By integrating the entire design process, Circuit Wizard provides answering GCSE questions. The CD-ROM will be invaluable to
you with all the tools necessary to produce an electronics project anyone studying electronics, not just GCSE students.
from start to finish even including on-screen testing of the PCB
prior to construction! *the Contains comprehensive teaching material to cover

*
National Curriculum syllabus
*
Regular exercises
Circuit diagram design with component library (500 components
*
reinforce the teaching points
*
Retains student interest
*
Standard,1500 components Professional) Virtual instruments with high quality animation and graphics Stimulates
*
(4 Standard, 7 professional) On-screen animation Interactive
* learning through interactive exercises
*
Provides sample
circuit diagram simulation
*
True analogue/digital simulation
examination ques-tions with model solutions Authored
*
* *
Simulation of component destruction PCB Layout Interactive
* *
*
PCB layout simulation Automatic PCB routing Gerber export
* by practising teachers Covers all UK examination board
* *
* Multi-level zoom (25% to 1000%)
*
Multiple undo and redo syllabuses Caters for all levels of ability Useful for self-
* *
Copy and paste to other software Multiple document support tuition and revision
SUBJECTS COVERED
Electric Circuits Logic Gates Capacitors & Inductors Relays
Transistors Electric Transducers Operational Amplifiers
Radio Circuits Test Instruments
Over 100 different sections under the above headings

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. 12.50 inc. VAT and P&P

Minimum system requirements for these CD-


Please send me: CD-ROM ORDER FORM ROMs: Pentium PC, CD-ROM drive, 32MB
RAM, 10MB hard disk space. Windows 2000/
Version required: ME/XP, mouse, sound card, web browser.
Assembly for PICmicro V5 Hobbyist/Student
C for 16 Series PICmicro V5 Professional
Professional 10 user
Site licence ORDERING
Note: The software on each version is the same, only the licence for use varies.
ALL PRICES INCLUDE UK
POSTAGE
Flowcode for PICmicro V6 (DOWNLOAD ONLY)
Flowcode for AVR V6 (DOWNLOAD ONLY) Standard/Student/Basic (Hobbyist)
Flowcode for ARM V6 (DOWNLOAD ONLY) Version price includes postage to most
Flowcode for dsPIC V6 (DOWNLOAD ONLY) countries in the world
Flowcode for PIC24 V6 (DOWNLOAD ONLY) EU residents outside the UK add 5 for
airmail postage per order
Email: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Username: . . . . . . . . . . . . . . . . . . . . . . . . . .

PICmicro Multiprogrammer Board and Development Board V4 (hardware)


Professional, Multiple User and Site
License Versions overseas readers add
Circuit Wizard Standard 5 to the basic price of each order for airmail
Circuit Wizard Professional Teach-In 2
GCSE Electronics Teach-In 3 postage (do not add VAT unless you live in an
Teach-In 4 EU (European Union) country, then add VAT
NEW TINA Design Suite V10 Basic (Hobbyist) Teach-In Bundle at 20% or provide your official VAT registration
TINA Design Suite V10 (Student) number).

Full name: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Send your order to:


.. Direct Book Service
Wimborne Publishing Ltd
Address: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Lynwood Drive, Merley,
. . . . . . . . . . . . . . . . . . . . . . Post code: . . . . . . . . . . . . . . . . . Tel. No: . . . . . . . . . . . . . . . . . . . Wimborne, Dorset BH21 1UU
To order by phone ring
Signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
01202 880299. Fax: 01202 843233
I enclose cheque/PO in sterling payable to WIMBORNE PUBLISHING LTD for . . . . . . . . . Goods are normally sent within seven days
Please charge my Visa/Mastercard/Maestro: . . . . . . . . . . E-mail: orders@wimborne.co.uk
Valid From: . . . . . . . . . . Card expiry date: . . . . . . . . . . . . . Online shop:
Card No: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maestro Issue No. . . . . . . . . .
Card Security Code . . . . . . . . . . (The last 3 digits on or just under the signature strip) www.epemag.com

Everyday Practical Electronics, August 2016 65

CD-ROMs Pages 2 PAGES.indd 65 27/06/2016 15:52


STORE YOUR BACK ISSUES ON CD-ROMS
Order on-line from
low-cost Precision
10V Dc reference TouCh-
Perfect for checking DMMs auDio SCReen Dig
10.000V without adjustment ReCoRD iTal
Compact and battery powered CD sound eR PaR
Accurate and affordable SD card quality T1

www.epemag.com (go to the UK store)


Powe memo
ry
red by
Colou a single
r touch AA-size
-screen lithium-ion
with no cell
external
controls

WIN Burp Cha


MICR
A rge Your Bat

or by phone, fax, email or post


dsPIC OC Rapid
CA 33EV
HIP alternate
process charge/disc teri es!
STARN-LIN 5V
TE
temperatureduces press harge
ure and
KIT R and increa re build-up
in cells,
Deluxe fan speed controller ses effici
ency
Precise control without noise or interference

rGB leD striP DriVer


Decoration and illumination half a
with a rainbow of colours The first CenTuR
2N3055 50 years of
Y of Pow
powe the
r trans
eR
iconic
TeACh-In 2015 PArT 4 TeaCh- istor
understand discrete linear circuit design in 201 MIC WIN
Learn about noise and distortion
unde
learn
rstand
discrete
5
PaRT 5
RO A
BL PI CH
about linear UE C3
filters circuit ST TO 2 IP
and tone desig AR OT
PluS MAY 2015 4.40 PluS controls n KI TER H
T
CirCuit Surgery, Net work, audio out, readout, CirCuit
Surgery,
PiC N MiX, teChNo talk & PraCtiCally SPeakiNg teChNo Net work
talk &
iNterFaCe , audio out, JUNE 2015
MAY 2015 Cover.indd 1 JUNE 2015
20/03/2015 10:39:48 Cover
PiC N MiX, 4.40
V2.indd
1

ONLY
01/04/2015
13:08:17

VOL 1: BACK ISSUES January 1999 to June 1999

219.965.F4OR55 YEAR)
Plus some bonus material from Nov and Dec 1998
VOL 2: BACK ISSUES July 1999 to December 1999
VOL 3: BACK ISSUES January 2000 to June 2000 ( ing VAT an
d p&p
each includ
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 16: BACK ISSUES July 2006 to December 2006
VOL 17: BACK ISSUES January 2007 to June 2007 NEW VOL 33: BACK ISSUES

Vol.33
VOL 18: BACK ISSUES July 2007 to December 2007 January 2015 to June 2015
VOL 19: BACK ISSUES January 2008 to June 2008
VOL 20: BACK ISSUES July 2008 to December 2008
VOL 21: BACK ISSUES January 2009 to June 2009 BACK ISSUES DVD/CD-ROM ORDER FORM
VOL 22: BACK ISSUES July 2009 to December 2009 Please send me the following Back Issue DVD/CD-ROMs.
Volume Numbers:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FIVE YEARMs ....................................................

DVD/CD-ROLE ...............

NOW AVAILAB
Price 16.45 each, 29.95 for Five Year DVD/CD-ROMs
includes postage to anywhere in the world.
Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FIVE YEAR CD/DVD-ROMs
.......
No.1 Jan 03 to Dec 07 Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
No.2 Jan 04 to Dec 08 ...................................................
No.3 Jan 05 to Dec 09 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
No.4 Jan 06 to Dec 10 Post Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
No.5 Jan 07 to Dec 11 I enclose cheque/P.O./bank draft to the value of . . . . . . . . .
No.6 Jan 08 to Dec 12 please charge my Visa/Mastercard/Maestro . . . . . . . . . . . .
NEW No.7 Jan 09 to Dec 13 Card No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

No.8 No.8 Jan 10 to Dec 14 Card Security Code . . . . . . . . . . (The last 3 digits on or just under the signature strip)
Valid From . . . . . . . . . . . . . . . . Expiry Date . . . . . . . . . . . . . . . .

NOTE: These DVD/CD-ROMs are suitable for use on any PC with a Maestro Issue No. . . . . . . . . . .
DVD/CD-ROM drive. They require Adobe Acrobat Reader (available
free from the Internet www.adobe.com/acrobat) SEND TO: Everyday Practical Electronics,
Wimborne Publishing Ltd., 113 Lynwood Drive, Merley,
Wimborne, Dorset BH21 1UU.
WHAT IS INCLUDED Tel: 01202 880299. Fax: 01202 843233.
All volumes include the EPE Online content of every listed issue. Please E-mail: orders@epemag.wimborne.co.uk
note that we are unable to answer technical queries or provide data
on articles that are more than five years old. Please also ensure that Payments must be by card or in Sterling cheque or bank
all components are still available before commencing construction draft drawn on a UK bank.
of a project from a back issue. Normally posted within seven days of receipt of order.

Back Issues CDs - New copy.indd 5 27/06/2016 10:37


end of the series.
School of Architecture among others. based in London. He teaches interaction
We have a couple of copies of this design and prototyping at the
book to give away. To enter please REGULAR REGULARCOLUMN: COLUMN:ARDUINO ARDUINO
Goldsmiths PROJECTS
College l 37 l 37
PROJECTS
and the Bartlett
if (brightness == 0 || brightness == 255) supply REGULAR
{ your name, address REGULAR
l Make
and COLUMN:
COLUMN:
sure ARDUINO
the correct ARDUINO PROJECTS
pin numbers PROJECTS
are l
being 37
used.
l 37
School of Architecture among others.
fadeAmount = -fadeAmount ; email to the Editor at svetlanaj@
l Check the LEDWINisTHE
correctly
ARDUINO
WIN THEpositioned,
FORWe
ARDUINO with
FOR aits
DUMMIES long
BOOKleg
DUMMIES BOOKl
REGULAR COLUMN: ARDUINO have PROJECTS
couple of copies of 37
this
} sjpbusinessmedia.com.
Figure 2: Figure
Layout 2: WINdiagram
diagram
Layout THE
WINARDUINO
connected byFOR
BY
THE ARDUINO DUMMIES
JOHN
a wireFORNUSSEY
BY
to 9BOOK
DUMMIES
JOHN
pin NUSSEY
and BOOK
the short leg connected via please
book to give away. To enter
Thefor the project BY JOHN NUSSEY
Get the answer youve been
Figure 2: Layout diagram BY
theJOHN NUSSEY
Figure 2: Layout winner
diagram for be
will thedrawn
project
at
// wait for 30 milliseconds to see the dimming effect resistor and a wire to GND. supply your name, address and Figure 2: Layout diagram
for the project
for the project
random and announced at the WIN THE
John ARDUINO
Nussey FOR
JohnisNussey is DUMMIES
a creativeatechnologist BOOK
creative technologist
delay(30); l Check the connections on the breadboard.
email to Ifthe
the jumper wires for the project
Figure 2: Layout diagram is aBY JOHN NUSSEY
Editor at svetlanaj@
looking for rows in the
end of the series. John Nussey creative
John Nussey is technologist
abased in London.
creative inHe teaches
technologist
based London. Heinteraction
teaches interaction
} for the project or components
based inbased
London. He teachesare
design
in London. not connected
interaction
and prototyping
He teaches using
at the
interaction the correct
sjpbusinessmedia.com.
design and prototyping at the REGU
andbreadboard,
Upload this sketch to the board, and if everything has uploadeddesign design
prototyping
and atthey
Johnprototyping
Nussey will
the isat
Goldsmiths not work.
aGoldsmiths
creative
College
the l Bartlett
technologist
and the The
and winner will be drawn at
College the Bartlett REGULAR COLUMN:R
successfully,
ightness == 0 || brightness the
== LED
255) fades
{ from off to full brightness
l Make sureand
thethen
correct Goldsmiths College
based
Goldsmiths
pin numbers are and the
inSchool
College
being Bartlett
London.
and
used. ofthe He teaches
Architecture
Bartlett
School interaction
among
of Architecture others.
amongand
random others.
announced at the REGULAR COLUM
back off again.
REGULAR
If you dont see any fading, double-check
COLUMN:
School of ARDUINO
Architecture
theis correctly positioned, among PROJECTS
others. l 37 WI
Amount = -fadeAmount ; l Check the LED design
Schoolon
More this We
and
of Architecture
withand have
its long aWe
legcouple
prototyping
among
other Arduino
have atof copies
a the
others. ofend
projects
couple of this
can
copies Can
bethis
of
of the foundFigure
series. in the WIN THE ARDUINO FO
2: Layout diagram BY
wiring: connected by a wire toWe pinhave We a couple
9Arduino
and have of copies
aFor
couple
theGoldsmiths
short book
leg of of
tothis
giveof
copies
connected
College away.
this
via
and theToaway.
enter
Bartlett please anyone help
WIN THE ARDUINO FOR DUMMIES
Dummies
P s? book
ICToBOOK
book to give
by John
Figure To 2:enter
Nussey. Layout please
diagram
me?
project2: LayoutBY
for the Figure JOHN
WIN THE
diagram NUSSEYARDUINO
it for 30 milliseconds to see the dimming effect the resistor and a wirebook to GND.tobook
give away.
to give To enter
away.supply please
your
enter name,
School of Architecture among others.please
supply your address for
name, and
the project
address and
Figure 2: Layout diagramfor the project BY JOHN NUSSEY John
Figure 2: Layout diagram BY JOHN NUSSEY your
y(30);
for the project
l Check the connectionssupply on thesupply name,
your
breadboard.
We have
address
name,Ifemail
the andto the
a address
jumper
couple ofEditor
and
email wires
to the
copies at svetlanaj@
of thisatforsvetlanaj@
Editor the project John Nussey is a creative base te
if (brightness == 0 || brightness ==Editor
255)Editor{svetlanaj@ l Make sure the correct pin numbers are being used.
or components are notemail toemail
connected the to theat
using the sjpbusinessmedia.com.
at svetlanaj@
correct rows in the
sjpbusinessmedia.com.
book to give away. To enter please based John
in Nussey
London. is
He a creati
teache
desig
fadeAmount = John Nussey is a creative
-fadeAmount technologist
; sjpbusinessmedia.com.
sjpbusinessmedia.com. at Check the LED is correctly
l positioned, with its long He leg
oad this sketch to the board, and if everything has uploaded breadboard, they will not work. l supply your
based in London. He teaches interaction
The winner
name, Thewill be drawn
winner
address will
andbe drawn at Proble m design basedand in London.
prototyping te
at th
Golds
} The winner
The will
winner be drawn
will be at
randomdrawn and at announced at the connected by a wire to
s o pin
u rc 9 and the short leg connected
sfully, the LED fades from off to full brightness and then
design and prototyping at the email to the Editor at svetlanaj@
random and announced at the in g design and prototyping
Goldsmiths College andScho the
ff again. If you dont see any fading, double-check the // waitMore for on 30thismilliseconds to see
random andthe
random dimming
announced
and of effect
atfound
end
announced the the
atin of the series. the resistor and a wire
series.
the soft towGND.
are? School Goldsmiths College
and other Arduino projects
Goldsmiths College and the Bartlett
can be
sjpbusinessmedia.com.
endthe of Architecture Weand
amon h
: delay(30); Arduino For Dummies book byend end of the series.
of the series. l Check the connections on the breadboard. School If Architecture
of theofjumper
School of Architecture among The
John Nussey.
others.
We have a couple booka
copies
winner will be drawn at
} We have a couple of copies ofrandom this or components are not connectedbook using
We theaway.
have
to give correct
a couple rows
of co
To enter
supp
if (brightness == 0 || brightness == 255) { l Makeand announced
sure at the
the correct
if (brightness Upload== 0this || brightness
sketch to ==board,
the 255) {and if everything has l Make
uploaded sure thepin numbers
correct
breadboard, are being
pin numbers they used.
are being
will not used.
work. lsupplybookyourtoname,
give away.
address To e
emai
book to give away. To enter please
if (brightness == 0fadeAmount
if (brightness ||==
brightness ===
0 ||fadeAmount
brightness 255) = {-fadeAmount
-fadeAmount
== 255) {; l Make
;fades from l sureMake theend
sure oflthe
correct
the pin
Checkseries.
correct numbers
lthepin LED are
numbers
Check beingareused.
is correctly
the LED positioned,
being
is correctly with its long
used.positioned, withleg its long legemailsupply to theyour
Editorname, addr
at svetlan
successfully, the LEDsupply your name, off to full
address andbrightness and then sjpbu
fadeAmount
fadeAmount = -fadeAmount } ;
}= -fadeAmount ; l Check l the Check LED theisLED
correctly
connected positioned,
is correctly connected with
bypositioned,
a wire bytoits
apin long
with
wire 9 and
its
to leg
pinthe9short
long leg
and the legshort
connected via sjpbusinessmedia.com.
leg connected via
email to the Editor at sv
}
back off again. If you emaildont
to thesee anyatfading,
Editor svetlanaj@
connected by
double-check
a wire
the the short legMore on this and other Arduino projects can be found The in th w
} // wait for 30 milliseconds
// wait for 30 milliseconds to see the to dimming
see the dimmingeffect connected
effect by to athe pinresistor
wire 9toand theand
pin a wire
9resistor
and theand toconnected
short aGND.
if leg
wire to
(brightness
via
connected
GND. via== 0 || brightness The sjpbusinessmedia.com
winner
== will be
255) { drawn at
rando
// wait for 30formilliseconds
30delay(30);
wiring:
tobrightness
seeto the dimming effect
sjpbusinessmedia.com.
the resistor and a wire G an
eto el
GND. ato
rthe l Arduino For Dummies book by John Nussey.
if//(brightness
wait milliseconds
== 0 || delay(30); see the==dimming
255) { effect the l resistor
Make and
l Check
sure wire
the connections
GND.the
correct
s pinconnections
Check on the breadboard.
numbers are
on the being If the jumper
used.
breadboard. If thewires
jumper wires
Theand winner will beend draw
The winner will be drawn at c tr onon ic fadeAmount = -fadeAmount ;random announced at tho
delay(30);
delay(30); }
fadeAmount = -fadeAmount } ; l Checkl the
Check connections
l the
Check E leor
connections
the on the
components
LED breadboard.
is
or the are not
breadboard.
correctly
components If the jumper
connected
positioned, If the
are not connected wires
using
jumper
with the correct
wires
its long
using leg
the rows in the
correct rowsendinof the
random and announced
random and announced at the ch a t } rows in the
the series.
} }} Upload this sketch
Upload tosketch
this the board,to theand if everything
board, or
hascomponents
and if everything uploaded
orhas
componentsare notbreadboard,
uploaded
connected connected
are notaconnected
by using
they
breadboard,
wire to pin the
will
usingcorrect
not
they
9 and work.
the
will correct
the lshort
not rows
work. linconnected
leg the via end of the series.
end of the series. // wait for 30 milliseconds to see the dimming eff
UploadUpload
this sketch
this to the
sketch board,
successfully,
to the and
the
board, if
LED
successfully, everything
fades
and
theif
// wait for 30 milliseconds to see the dimming effect from has
everything
LED fades uploaded
off to full
has
from brightness
uploaded
off to full breadboard,
and
brightness then they
breadboard,
and then will
theynot work.
will
the resistor and aifwire not lwork. lto GND. == 0 || brightness == 255) {
(brightness
I Can l Mak
successfully, the LED
successfully, thefades
back
LED from
offfades off
again. to
from full
off brightness
If again.
you dont
to If
full see and
any then
fading,
brightness anydouble-check
and then the delay(30); help!
delay(30); back off you dont see fading, double-check lifthe
(brightness
More on More
Check the connections ==
this0and || brightness
on other
this
fadeAmount ifon Arduino
(brightness
and theother === 255)
Arduino == {0can
projects
-fadeAmount
breadboard. || be found
If brightness
projects can be
the; jumper
in found
the
==
wires lin Make
255) {
the sure the correct l Chec pinl
back off again.
back off If you dont
again. If yousee
wiring: anysee
dont fading,
wiring: double-check
any fading, the
double-check the More on Morethison and other
ifand
fadeAmount
this Arduino
(brightness
other=Arduino
Arduino projects
==
-fadeAmount
For
Arduino DummiesForcan
0projects
|| be
brightness
fadeAmount ;can
book
Dummies } by
found in
beJohn ==the
found
=
book 255)
Nussey.
inJohn{ Nussey.
the
-fadeAmount
by ; l l
Check Make sure the
the LED correc
is correctl l
if (brightness ==}0 || brightness == 255) { l Make sure Arduinothe correct pin numbers or components are beingare }
used. not connected using the correct rows in the conn
wiring:wiring: For Dummies
Arduino } ForfadeAmount book by
Dummies bookJohn
= // Nussey.
-fadeAmount
bywait
John
} for Nussey. ;Upload this sketch to the board,connected
and
l if everything
Check theaLED
by wire ishascor
tothepinur
fadeAmount = -fadeAmount ;
Upload this sketch to the board, and if everything has uploaded l Check the LED is correctly breadboard, they will not work. l
positioned, with its long leg 30 milliseconds to see the dimming effect
// wait } for 30 milliseconds delay(30); // to
wait successfully,
seefor the30 dimming the
milliseconds LED
effecttofades
see from
the offthe
dimming to full
resistor brightness
connected and
effect by
a a
wire and
l Chect
wireto
} successfully, the LED fades from off to full brightness connected by a wire to pin 9 and the short leg connected
and then via
// wait for 30 milliseconds
delay(30);
back off again. to see the dont
If you dimming see any effect
fading, double-check the resistor
www.ledlabs.co.uk
theand a wire toMore
l Check the connections onArduino }
delay(30);
Vist the EPE Chat Zone
// wait for 30 milliseconds } delay(30);
GND.on this and other Arduino projects can be found in the
delay(30);
the breadboard. }
Upload
If the jumper this
to see
back
wiring:
sketch
off
to
the
the
dimming
again. If
board,
you
and
effect
dont
if
see
everything
any
l Check
has
thethe
fading, resistor and aorwir
connections
double-check
Check the connection
orlcomponents
uploaded are not
on
co
brea
l
cot

bookwires
www.epemag.com
wiring: } For Dummies byand John Nussey. has uploaded
} or components
01723
Upload
353900 are not connected using the correct
this sketch successfully,
to the board,
rows Upload thethis
in the LEDif everything
sketch
fades to fromtheoffboard,
to full and if everything
brightness andorthen
breadboard,components
has they will
uploaded arenotno
Upload
successfully, thethisLED sketch
fades
back off to the
from board,
off
successfully, to
again. If you and
full if everything
brightness
thedont
LEDsee fades and
anyfromhas
thenuploaded
off to
fading, full brightness
double-check breadboard,
the and then More othey will
Upload this sketch to the board, and if everything has uploaded Kitsbreadboard,
from 99.95 they will not work. l
backsuccessfully,
off again. If you the LED dontfades
wiring: see
backany from
offfading,off toIf
again. full
youbrightness
double-check
dont see theand fading,
any then double-check
More on this the and other Ardu
Arduin M
successfully, the LED fades from off to full brightness and then
wiring: back off again. If you dont wiring: see any fading, double-check the MoreFor
Arduino on this and other
Dummies book A
back off again. If you dont see any fading, double-check the More on this and other Arduino projects can be found in the
wiring: Arduino For Dummies
wiring: Arduino For Dummies book by John Nussey.

LAMBDA GENESYS PSU GEN100-15 100V 15A Boxed As New 325 Tektronix TDS3012 Oscilloscope 2 Channel 100MHZ 1.25GS/S
www.electronicsworld.co.uk 450
LAMBDA GENESYS PSU GEN50-30 50V 30A 325 Tektronix 2430A Oscilloscope Dual Trace 150MHZ 100MS/S 350
HP34401A Digital Multimeter 6.5 digit 275-325 Tektronix 2465B Oscilloscope 4 Channel 400MHZ 600
HP33120A Function Generator 100 microHZ-15MHZ 260-300 Cirrus CL254 Sound Level Meter with Calibrator 40
HP53131A Universal Counter 3GHZ Boxed unused 500 Farnell AP60/50 PSU 0-60V 0-50A 1KW Switch Mode 195
HP53131A Universal Counter 225MHZ 350 Farnell H60/50 PSU 0-60V 0-50A 500
www.electronicsworld.co.uk
Farnell B30/10 PSU 30V 10A Variable No Meters 45
HP54600B Digital Oscilloscope 100MHZ 20MS/S from 75
IFR 2025 Signal Generator 9kHz - 2.51GHZ Opt 04/11 900 Farnell B30/20 PSU 30V 20A Variable No Meters 75
Marconi 2955B Radio Communications Test Set 800 Farnell XA35/2T PSU 0-35V 0-2A Twice Digital 75
R&S APN62 Syn Function Generator 1HZ-260KHZ 195 Farnell LF1 Sine/sq Oscillator 10HZ-1MHZ 45
Fluke/Philips PM3092 Oscilloscope 2+2 Channel 200MHZ Delay etc 250 Racal 1991 Counter/Timer 160MHZ 9 Digit 150
HP3325A Synthesised Function Generator 195 Racal 2101 Counter 20GHZ LED 295
HP3561A Dynamic Signal Analyser 650 Racal 9300 True RMS Millivoltmeter 5HZ-20MHZ etc 45
HP6032A PSU 0-60V 0-50A 1000W 750 Racal 9300B As 9300 75
HP6622A PSU 0-20V 4A Twice or 0-50V 2A Twice 350 Black Star Orion Colour Bar Generator RGB & Video 30
HP6624A PSU 4 Outputs 350 Black Star 1325 Counter Timer 1.3GHZ 60
HP6632B PSU 0-20V 0-5A 195 Ferrograph RTS2 Test Set 50
HP6644A PSU 0-60V 3.5A 400 Fluke 97 Scopemeter 2 Channel 50MHZ 25MS/S 75
HP6654A PSU 0-60V 0-9A 500 Fluke 99B Scopemeter 2 Channel 100MHZ 5GS/S 125
HP8341A Synthesised Sweep Generator 10MHZ-20GHZ 2,000 Gigatronics 7100 Synthesised Signal Generator 10MHZ-20GHZ 1,950
HP83731A Synthesised Signal Generator 1-20GHZ 1,800 Panasonic VP7705A Wow & Flutter Meter 60 www.electronicsworl
HP8484A Power Sensor 0.01-18GHZ 3nW-10uW 75 Panasonic VP8401B TV Signal Generator Multi Outputs 75
HP8560A Spectrum Analyser Synthesised 50HZ - 2.9GHZ 1,250 Pendulum CNT90 Timer Counter Analyser 20GHZ 750
HP8560E Spectrum Analyser Synthesised 30HZ - 2.9GHZ 1,750 Seaward Nova PAT Tester www.electronicsworld.co.uk
95
www.electronicsworld.co.uk
HP8563A Spectrum Analyser Synthesised Solartron 7150 6 1/2www.electronicsworld.co.uk
Digit DMM True RMS IEEE 65
Chat Zone9KHZ-22GHZ
filler advert.indd 1 2,250 www.electronicsworld.co.uk
HP8566B Spectrum Analsyer 100HZ-22GHZ 1,200 Solartron 7150 Plus as 7150 plus Temp Measurement 75
HP8662A RF Generator 10KHZ - 1280MHZ 750 Solatron 7075 DMM 7 1/2 Digit 60
Marconi 2022E Synthesised AM/FM Signal Generator 10KHZ-1.01GHZ 325 Solatron 1253 Gain Phase Analyser 1mHZ-20KHZ 600
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 2305 Modulation Meter 250 Thurlby TG210 Function Generator 0.002-2MHZ TTL etc Kenwood Badged 65
Marconi 2440 Counter 20GHZ 295
Marconi 2945
Marconi 2955
Communications Test Set Various Options
Radio Communications Test Set
2,500
595
STEWART OF READING
Marconi 2955A Radio Communications Test Set 725 17A King Street, Mortimer, near Reading, RG7 3RS
www.electronicsworld.co.uk
Marconi 6200 Microwave Test Set 1,500
Marconi 6200A Microwave Test Set 10MHZ-20GHZ 1,950
Telephone: 0118 933 1111 Fax: 0118 9331275
Marconi 6200B Microwave Test Set 2,300 USED ELECTRONIC TEST EQUIPMENT
Marconi 6960B with 6910 Power Meter 295 www.electronicsworld.co.uk
Check website www.stewart-of-reading.co.uk

Everyday Practical Electronics, August 2016 67

Page 67.indd 63 27/06/2016 11:29


Maxs
Beans
By Max The Magnificent

Profligate with power The Nanos are pre-


Its a funny old world when you come to think about it. sented in a stag-
The first commercial 8-bit microprocessor was the 8008, gered configuration
which Intel priced at US$120 when it appeared in their so as to allow me to
catalog in April 1972 (this is close to US$700 in todays easily access their
money based on the consumer price index provided by USB-Mini ports for
the US Bureau of Labor Statistics). The 8008 boasted programming pur-
approximately 3,500 transistors, had a 14-bit external poses. Also, every-
address bus that could address 16KB of memory, and thing is socketed (not
initial versions could only work with clock frequencies doing this has caused
up to 0.5MHz. me pain before). The
How times have changed. In the case of my Caveman two LEDs attached to
Diorama project (see EPE, June 2016) there are going each Nano are used
to be a number of lighting effects. We have 14 tri-color for testing purposes;
NeoPixel LEDs at the back of the tunnel, 19 forming the they will be removed
fire, a yet-to-be-determined number in the bottom of the prior to the final de-
pool, two NeoPixel-based floodlights (these will illumi- ployment.
nate the cave painting were going to have on the wall), The top-level Sim-
and weve also embedded 155 in the cave roof (just in blee menu, as seen on
case). The thing is that each of these LED groups is go- my iPad is shown in
ing to be controlled by its own 8-bit Arduino Nano mi- Fig.2. As we see, the Fig.2. Top level Simblee menu
crocontroller running at 16MHz. This would seem out- menu system current- displayed on an iPad.
rageously profligate to someone from the early 1970s, ly accommodates six
until they became aware that you can purchase a five- defined effects with room for two more. Clicking the Op-
pack of these little beauties for only $15 from Amazon. tion switch will take you to the options associated with
The current state of play for the master control board the currently selected effect (you can see the current state
is illustrated in Fig.1. In the bottom left corner we see a of this menu code here: http://bit.ly/1szS7nd).
Simblee 29-pin breakout board (we discussed the Sim- The way Ive set this up, each of the Nanos on the con-
blee in EPE, February 2016), which allows me to con- troller board is controlled by three of the Simblees pins,
trol everything via Bluetooth using my iPad. In turn, the which means we can have eight options for each effect (or
Simblee controls the six Arduino Nanos on the board, seven if we assume that the first option is for that effect to
plus a seventh that will be used to control the Time be turned off). The way I set this up was to create a com-
Portal, as discussed later in this column. mon skeleton program that can be used as the base for
each of the Nanos. Im currently working on the Tunnel
code and, at this time, Ive created three effects: a low red
glow, a breathing effect based on a sine function, and a
pretty effective arc welder effect (you can see the current
state of this Tunnel code here: http://bit.ly/1WTfu8F). But
thats not what I wanted to talk to you about...

Is that the time?


As Ive mentioned in previous columns, one of the ele-
ments were going to have in the cave will be a Time
Portal, which will explain my presence in the scene,
along with any other anachronisms, such as the flood-
lights illuminating the cave paintings.
As an aside, we were originally thinking of having
power cables from the floodlights (and other items like
a boom box) snaking back to a plug panel mounted on
the frame of the Time Portal, but then we decided this
would look silly. Our latest plan is to have these items
connected to a number of truck batteries. In turn, these
batteries will be connected to a generator attached to a
bicycle being peddled by a very hot and sweaty cave-
man, but I digress...
As usual, we started out by creating card/paper mock-
ups. Since we are working at 1/32 scale, a 6-foot man
Fig.1. Caveman Diorama master control board will be 2-inches tall in the diorama, so we decided

68
68 Everyday
Everyday
Practical
Practical
Electronics,
Electronics,
August
June 2016

Cool Beans (MP 1st & Max) AUGUST 2016.indd 68 27/06/2016 09:50
takes around four seconds to wipe each
new image over the existing one (the vid-
eo shows the display being driven by an
Arduino Uno, but this will be replaced by
a Nano in the final deployment).
There are several aspects to this delay.
First of all, we are using the Arduino li-
braries supplied by Adafruit. These re-
quire us to use 24-bit BMP images (8 bits
each for the red, blue, and green elements
of each pixel). Next, we are using the SPI
interface to read the images from the Mi-
cro-SD card on the back of the displays
breakout board and also to write the im
ages back to the display itself.
Before you ask, the display isnt double-
buffered (we already thought of that).
Two solutions that do present themselves
are: a) reduce the images to 16-bit BMPs,
thereby reducing the amount of data be-
ing read from the card and written to the
display by 33%, and b) continue to read
the images from the Micro-SD card using
the SPI interface, but to then write them
Fig.3. An early conception of the time Portal back to the display using the significantly
faster 8-bit parallel interface.
that the height of the Time Portal should be around There are also a variety of transition effects we can
2-inches. The portal itself will be a small LCD screen play with. Of course, we also have a bunch of limita-
surrounded by a 3D printed stone doorframe. Initially, tions to battle our way around, such as the fact that each
we considered two versions a free-standing doorframe 24-bit 240x320 pixel image occupies ~0.25MB on the
mounted on the floor versus a portal floating in the air Micro-SD card, while the Arduino Nano has only 2KB of
(this latter option is illustrated in Fig.3). on-chip SRAM, but overcoming these obstacles is what
As it turned out, this decision was eventually taken makes this stuff so much fun.
away from us. After searching far and wide, we opted to What makes it even more fun is that Im not the one
use a 2.8-inch diagonal TFT LCD from Adafruit (http:// doing the work; my chum Daniel Whiteley has a degree
bit.ly/1N1Ha1R). This little rascal comes with a break- in Electrical Engineering, he works on FPGAs for a liv-
out board that also carries the necessary controller chip ing, and in his spare time he dabbles with projects
along with a Micro-SD cardholder. The idea is to have like driving LCD displays with small microcontrollers.
the display alternating between a default time portal rip- Daniel is currently spending his weekends working fu-
pling mirror type image and a large random selection of riously on the Time Portal and I expect to have great
other interesting images, all of which will be stored on a things to report in a future column. Until then, have a
Micro-SD card attached to the back of the display. good one!
In Fig.4 you can see one such image a man sitting on
a chair looking out at a post-apocalyptic landscape. Ob-
serve the black band around the edge of the image. In
particular, observe that this black area is really large at
the bottom of the display. On the bright side, the 2.8-inch
quoted by Adafruit really does refer to the actual image
area. The problem is that, if we make the doorframe wide
enough to cover the black area at the bottom of the dis-
play along with the breakout connections below then
the frame will be totally out of scale to the rest of the dis-
play. The solution is to return to having a floor-mounted
time portal, but to actually present it standing on a small
platform faced by a couple of flagstone steps, thereby cov-
ering the unwanted areas of the display.
Im currently having a lot of fun rooting out all sorts of
interesting images. I started out with alien landscapes,
post-apocalyptic scenes, jungles, beaches, pyramids,
and weird, wonderful, and beautiful visions of the past,
present, and future (I dont like to limit myself unduly).
Furthermore, I subsequently decided that it would be
nice to give a nod to classic science fiction films (eg,
Forbidden Planet, The Day the Earth Stood Still, 2001:
A Space Odyssey, Planet of the Apes) and television
programs (Lost in Space, Land of the Giants, Quantum
Leap, The Twilight Zone).

Not quite so straightforward


There is, however, a small fly in the soup. As you can
see in this video (http://bit.ly/1TyScnl), it currently Fig.4. The display showing a test image.

Everyday Practical Electronics, August 2016 69

Cool Beans (MP 1st & Max) AUGUST 2016.indd 69 27/06/2016 09:50
PCB SERVICE CHECK US OUT ON THE WEB
PROJECT TITLE ORDER CODE COST

FEB 16
Spark Energy Meter Main Board 05101151 20.75
Zener Diode Board 05101152
7.50
Calibrator Board 05101153
Basic printed circuit boards for most recent EPE constructional projects are
available from the PCB Service, see list. These are fabricated in glass fibre, and APRIL 16
are drilled and roller tinned, but all holes are a standard size. They are not silk- Appliance Insulation Tester 04103151 11.80
screened, nor do they have solder resist. Double-sided boards are NOT plated Front Panel 04103152 11.80
through hole and will require vias and some components soldering to both Low Frequency Distortion Analyser 04104151 7.50
sides. NOTE: PCBs from the July 2013 issue with eight digit codes have silk
screen overlays and, where applicable, are double-sided, plated through-hole, MAY 16
with solder masks, they are similar to the photos in the relevent project articles. 2-Channel Balanced Input Attenuator for Audio
All prices include VAT and postage and packing. Add 2 per board Analysers and Digital Scopes
for airmail outside of Europe. Remittances should be sent to The PCB Main Board 04105151 16.40
Service, Everyday Practical Electronics, Wimborne Publishing Front Panel 04105152
Ltd., 113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU. 20.75
Rear Panel 04105153
Tel: 01202 880299; Fax 01202 843233; Email: orders@epemag.wimborne.co.uk. Appliance Earth Leakage Tester
On-line Shop: www.epemag.com. Cheques should be crossed and made payable Main Board 04203151
16.40
to Everyday Practical Electronics (Payment in sterling only). Insulation Board 04203152
NOTE: While 95% of our boards are held in stock and are dispatched within Front Panel 04203153 16.40
seven days of receipt of order, please allow a maximum of 28 days for 4-Output Universal Voltage Regulator 18105151 7.50
delivery overseas readers allow extra if ordered by surface mail.
JUNE 16
Back numbers or photocopies of articles are available if required see the Infrasound Snooper 04104151 7.48
Back Issues page for details. WE DO NOT SUPPLY KITS OR COMPONENTS Audio Signal Injector and Tracer 04106151 9.64
FOR OUR PROJECTS. Sheild Board 04106153 7.48
Demodulator Board 04106152 5.36

PROJECT TITLE ORDER CODE COST Champion Preamp 01109121/22 8.29

APRIL 15 JULY 16
A Rubidium Frequency Standard For A Song 04105141 8.02 Driveway Monitor Detector Unit 15105151 11.80
USB/RS-232C Interface 07103141 7.48 Receiver Unit 15105152 7.50
Teach-In 2015 Part 3 906 8.75 USB Charging Points 18107151 5.00
MAY 15 AUG 16
Deluxe Fan Speed Controller 10104141 10.72
16105141 8.56 Low-cost Resistance Reference 04108151 5.36
RGB LED Strip Driver
USB Power Monitor 04109121 12.00
Low-cost Precision 10V DC Reference For
Checking DMMs 04104141 7.48

JUNE 15 14103141 13.40 * See NOTE left regarding PCBs with eight digit codes *
Burp Charge Your Batteries
907 8.55 Please check price and availability in the latest issue.
Teach-In 2015 Part 5
A large number of older boards are listed on, and can be ordered from, our website.
JULY 15 Boards can only be supplied on a payment with order basis.
L-o-o-o-n-g Gating Times For The 12-Digit 04106141 11.55
High-Resolution Counter 99106141 10.15
Threshold Voltage Switch
Touch-Screen Digital Audio Recorder Part 2
01105141 13.70 EPE SOFTWARE
Where available, software programs for EPE Projects can be downloaded free
from the Library on our website, accessible via our home page at:
AUG 15 01106141 15.05
Nirvana Valve Simulator Main PCB www.epemag.com
01106142 8.30
Front Panel 21108141 12.00
TempMasterMK3
Teach-In 2015 Part 7
908 8.75 PCB MASTERS
PCB masters for boards published from the March 06 issue onwards are
SEPT 15 available in PDF format free to subscribers email fay.kearn@wimborne.
Opto-Theremin Part 1 23108141 14.25 co.uk stating which masters you would like.
Main Theremin 23108142 6.95
Volume Control Board

Mini-D Stereo 10W/Channel Class-D


Audio Amplifier
01110141 7.45 EPE PRINTED CIRCUIT BOARD SERVICE
Wideband, Active Differential Oscilloscope Probe 04107141
11.80 Order Code Project Quantity Price
Main PCB 04107142
Screening PCB ..............................................
OCT 15 Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Digital Effects Processor For Guitars 01110131 16.40
And Musical Instruments 05109141 8.55 Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Courtesy LED Lights Delay For Cars 909 10.70
Teach-In 2015 Part 9 ..............................................
NOV 15 Tel. No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Currawong Part 1 01111141 47.20
Main Board 01111142 I enclose payment of . . . . . . . . . . . . . . (cheque/PO in sterling only)
Front Panel 24.75
01111143
Rear Panel 18112141 9.37 to: Everyday Practical
48V Dual Phantom Power Supply
Programmable Mains Timer With Remote Switching 19112141 11.80 Electronics
Main Board 19112142 16.40
Front Panel
DEC 15 04112141 7.20
TDR Dongle For Oscilloscopes Card No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
High-Energy Multi-Spark CDI For 11.80
Performance Cars
05112141 Valid From . . . . . . . . . . . . . . Expiry Date . . . . . . . . . . . .
JAN 16 Card Security No. . . . . . . . . Maestro Issue No. . . . . . . .
Isolating High Voltage Probe For Oscilloscopes 04108141 11.80
The Currawong Part 3 Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Remote Control Board 01111144 6.95
Note: You can also order PCBs by phone, Fax or Email or via the
Shop on our website on a secure server:
70 http://www.epemag.com

PCB Service.indd 70 27/06/2016 09:51


If you want your advertisements to be seen by the largest readership at the most economical price our
classified page offers excellent value. The rate for semi-display space is 10 (+VAT) per centimetre high,
with a minimum height of 25cm. All semi-display adverts have a width of 5.5cm. The prepaid rate for
More Spring Bargains !!For the DIY BuilderVisit Section
classified
26Buy One & Get adverts
2nd OneisFREEWWW.partridgeelectronics.
40p (+VAT) per word (minimum 12 words).
co.uk
All cheques, postal orders, etc., to be made payable to Everyday Practical Electronics. VAT must be added.
Advertisements, together with remittance, should be sent to Everyday Practical Electronics Advertisements,
113 Lynwood Drive, Merley, Wimborne, Dorset, BH21 1UU. Phone: 01202BOWOOD 880299. Fax: 01202 843233.
ELECTRONICS LTD
Email: stewart.kearn@wimborne.co.uk. For rates and information on display and classified
Suppliers of Electronicadvertising
Components
please contact our Advertisement Manager, Stewart Kearn as above. www.bowood-electronics.co.uk
Unit 10, Boythorpe Business Park, Dock Walk, Chesterfield,
Derbyshire S40 2QR. Sales: 01246 200 222
Send large letter stamp for Catalogue

Everyday Practical Electronics reaches more UK readers than BOWOOD ELECTRONICS LTD
any other UK monthly hobby electronics magazine, Suppliers of Electronic Components
our sales figures prove it.
www.bowood-electronics.co.uk
We have been the leading monthly magazine in Unit 10, Boythorpe Business Park, Dock Walk, Chesterfield,
this market for the last Derbyshire S40 2QR. Sales: 01246 200 222
twenty-six years. Send large letter stamp for Catalogue

ELECTRONICS: Home Study Software,


CANTERBURY WINDINGS
UK manufacturer of toroidal transformers
ADVERTISE HERE FOR
Apps & eBooks 1.95 (10VA to 3kVA) JUST 25 +VAT CALL
All transformers made to order. No design fees.
No minimum order. STEWART KEARN
www.eptsoft.com/HomeStudy www.canterburywindings.co.uk
01227 450810
ON 01202 880299
STEWART.KEARN@WIMBORNE.CO.UK

SUMMER BARGINS!! MISCELLANEOUS


FOR THE DIY BUILDER
BUY ONE & GET ONE FREE - VALVES AND ALLIED COMPONENTS IN PIC DEVELOPMENT KITS, DTMF kits and
VISIT SECTION 26 STOCK. Phone for free list. Valves, books modules, CTCSS Encoder and Decoder/
www.partridgeelectronics.co.uk and magazines wanted. Geoff Davies Display kits. Visit www.cstech.co.uk
(Radio), tel. 01788 574774.

BETA LAYOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 POLABS D.O.O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36


CRICKLEWOOD ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . 63 QUASAR ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2/3
ESR ELECTRONIC COMPONENTS . . . . . . . . . . . . . . . . . . . . . . 6 STEWART OF READING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
HAMMOND ELECTRONICS Ltd . . . . . . . . . . . . . . . . . . . . . . . 19 TAG-CONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
iCSAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
ADVERTISEMENT OFFICES:
JPG ELECTRONICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 113 LYNWOOD DRIVE, MERLEY, WIMBORNE,
LABCENTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cover (iv) DORSET BH21 1UU
LASER BUSINESS SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 PHONE: 01202 880299
LedLabs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 FAX: 01202 843233
MICROCHIP . . . . . . . . . . . . . . . . . . . . Cover (ii), Cover (iii) & 10 EMAIL: stewart.kearn@wimborne.co.uk
PEAK ELECTRONIC DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . 37 WEB: www.epemag.com
PICO TECHNOLOGY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 For editorial address and phone numbers see page 7

Everyday Practical Electronics, August 2016 27/06/2016 13:06


71

EPE Classifieds_100144WP.indd 71 27/06/2016 13:20


Next Month Content may be subject to change

Compact Hybrid Switchmode 100W Bench Supply Part 1


Heres a winner! This Compact Bench Supply delivers 0-40V at up to 5A with accurate and fast
current limiting and has 3.5-digit 7-segment LED readouts for simultaneous voltage and current
display. You can power it from any 12-24V DC supply such as a PC or laptop power supply or lead-
acid/lithium battery. The combination of switchmode and linear circuitry provides good regulation
and low residual noise.
Speedo Corrector
If you have swapped your cars instrument panel, gearbox or differential with one from a different
vehicle, your speedometer and odometer may no longer be correct. The same applies if youve fitted
wheels or tyres with a different diameter. The solution is to use our Speedo Corrector. It can increase
or decrease the indicated speedometer reading.
LED Party Strobe
Heres a fun, simple and cheap project turn a standard 230VAC 30W LED floodlight into a
powerful party strobe light.
Teach-In 2016 Part 8
Next month, Teach-In 2016 Arduino World will look at a simple IR remote control based on the
Arduino Uno and Nano. Arduino Workshop will introduce you to infra-red transmitters and receivers,
while our programming feature, Coding Quickstart will introduces the infra-red remote library. Our
Get Real project will describe the design and construction of an Arduino multichannel infra-red
remote controller that will allow you to control effortlessly a host of domestic gadgets.
PLUS!
All your favourite regular columns from Audio Out and Circuit Surgery to Electronic Building Blocks,
PIC n Mix and Net Work.
SEPTEMBER 16 ISSUE ON SALE 4 AUGUST 2016

Welcome to JPG Electronics


Selling Electronics in Chesterfield for 29 Years
Open Monday to Friday 9am to 5:30pm
And Saturday 9:30am to 5pm
Custom Front Panels
Aerials, Satellite Dishes & LCD Brackets
Audio Adaptors, Connectors & Leads
BT, Broadband, Network & USB Leads
Computer Memory, Hard Drives & Parts
DJ Equipment, Lighting & Supplies
Extensive Electronic Components
- ICs, Project Boxes, Relays & Resistors
Raspberry Pi & Arduino Products
PANEL-POOL is a registered trademark of Beta LAYOUT GmbH

Replacement Laptop Power Supplies


Batteries, Fuses, Glue, Tools & Lots more...
Digital printing
T: 01246 211 202
E: sales@jpgelectronics.com
JPG Electronics, Shaws Row,
Old Road, Chesterfield, S40 2RB
W: www.jpgelectronics.com
Shaws Row

Free Design Software


JPG Electronics
Britannia Maison Mes Amis
Inn
Old Road
ad

Rose & Crown


Johnsons
all Ro

d
Roa
Old H

orth
Chatsw
Morrisons

Sparks www.panel-pool.com
Retail & Trade Welcome Free Parking Google St View Tour: S40 2RB

Published on approximately the first Thursday of each month by Wimborne Publishing Ltd., 113 Lynwood Drive, Merley, Wimborne, Dorset BH21 1UU. Printed in England by Acorn Web Offset Ltd., Normanton,
WF6 1TW. Distributed by Seymour, 86 Newman St., London W1T 3EX. Subscriptions INLAND: 23.50 (6 months); 43.00 (12 months); 79.50 (2 years). EUROPE: airmail service, 28.00 (6 months); 52.00
(12 months); 99.00 (2 years). REST OF THE WORLD: airmail service, 37.00 (6 months); 70.00 (12 months); 135.00 (2 years). Payments payable to Everyday Practical Electronics, Subs Dept, Wimborne
Publishing Ltd. Email: subs@epemag.wimborne.co.uk. EVERYDAY 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.

CarryOver AUG 2016.indd 72 27/06/2016 09:49


Cloud-based development for PIC MCUs
No sign-up, no downloads and no fees

Microchips MPLAB Xpress Cloud-based Integrated Development Environment (IDE) is


the easiest way to start your design with PIC microcontrollers. Using the industrys most
comprehensive feature set you can build your design in minutes and automatically
generate code online with the MPLAB Code Configurator 3.0.

Browser-based access to the most popular tools from the award-winning MPLAB X IDE
also includes code simulation, as well as programming and debugging of your target
MCU. Plus a rich online community provides a forum for sharing ideas and knowledge.

www.microchip.com/eumplabxpress

The Microchip name and logo, MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. PICkit is a trademark of Microchip Technology Inc. in the U.S.A. and other
countries. All other trademarks mentioned herein are the property of their respective companies. 2016 Microchip Technology Inc. All rights reserved. DS40001832A. MEC2056Eng02/16

JULY 2016 Page IBC.indd 1 24/06/2016 12:41


Labcenter AUGUST 2015.indd 1 15/06/2015 12:59:19

You might also like