MEM Naa UA AEH AMMA TP
=e VERYDAY PRACTICAL
‘moms ELEC. TRONICS
COTTE Tats
Pos
LIGHTNING DETECTOR
- PIC control uses sophisticated | digital] Biel processing
- Accurate to 0.1° over 3607 |
* Four-digit LED display~
US AN SS ‘VOIGE
‘EXTERMINATE!’ NEVER SOUNDED BD GOOD)
SEMTEST — PART 2
COMPLETE CIRCUIT DESCRIPTION
OF THE ULTIMATE\SILICON.CHECKER
\
Raspberry Pi
ele mia iio an lary
Jumpstart
DE = pariect ttor
diyimannicy fainOne platform for 8-, 16- and 32-bit development
- with Microchip’s MPLAB® X IDE
~/ 32-bit PIC®
v Tet Cereal oe
Palla ee Sra
eect
dsPIC® Digital Signal 1-5 DMIPS/MHz
Cea eer
Microconteolters 256K Flash »
er raaey Ona
po SLs
Oe
Rey Tel igacd cet Ela) UNL
MPLAB® X IDEis the free, integrated toolset for all of Microchip's 900+
B., 16- and 32-bit PIC’ Microcontrollers, dsPIC* Digital Signal Controllers,
and memory devices. Based on the open-source NetBeans platform,
MPLAB X runs on Windows® OS,MAC* OS and Linux, supports many
third-party tools, and is compatible with many NetBeans plug-ins.
Download a free copy of MPLAB X
and choose fram a choice of new
C compilers:
MPLAB XC compilers help increase code speed of any PIC MPLAB XCB for 8-bit MCUs
Microcontroller or dsPIC* digital signal controller by 30%, whilst ‘i ;
also cutting code size by 35%, These new compilers give METAB E16 for 16-bit MCUs
designers the choice of Free, Standard or Pro cade optimisation and DSCs
levels for bit, 16- oF 32 bit development, ora single C compiler MPLAB XC32 for 32-bit MCUs
suite to support all Microchip Microcontrollers and MPLAB XC Suite for all
digital signal controllers, 900+ PIC MCUs and dsPIC DSCs.
Microchip's tool chain of compatible compilers
and debugger/programmers operate
seamlessly within the universal cross platform
and open-source MPLAB’ X integrated
development environment, reducing both
learning curves and tool investments.
Evaluate MPLAB X today! www.microchip.com/get/eumplabx
MICROCHIP
Microcontrollers * Digital Signal Controllers * Analog * Memory + Wirelesses aa
© NEWS e COMMENT ¢
© POPULAR FEATURES
TT Tee TE)
CULE)
EVERYDAY PRACTICAL
ELECTRONICS
INCORPORATING ELECTRONICS TODAY INTERNATIONAL
www.epemag.com
(© Wimborne Pubishg Lid 2013. Copynghtn all,
Projects aud Cireults
LIGHTNING DETECTOR 10
by John Clarke
ieck and play safely inthe open wth our atmosphere megavolt dodger!
SEMTEST - PART 2 10
by Jim Rowe
Introducing the full crc of ths versatie discrete component checker
DIGITAL SPIRIT LEVEL 28
By Andrew Levido
Not just an end to wonky shelves, but a great introduction to MEMS components
INTERPLANETARY VOICE 38
by John Clarke
Extorminate! the vitmate Dalek and Darth Vader voice project
INGENUITY UNLIMITED os
Electre bianket co Lup the heat!
‘TECHNO TALK by Mark No'son a
Not what you expected”
MAX'S COOL BEANS by Max The Magniicont 48
Grains of sand.
What are the chance
18 mesh networked propeller beanve has,
JUMP START by Mike and Richard Tooley 48
DC Motor Controle
RASPBERRY PI by Nike Hisbett os
Furtner investigation
PIC N’ MIX by Mike Hibbett 87
Increasing the speed - saving power
CIRCUIT SURGERY by Ian Boll 60
Fipeiop archwecture
PRACTICALLY SPEAKING by Robert Penfols os.
Project x
NET WORK by Alan Wirstanloy 7
Pocket the best! Far sited. Herding eats
EDITORIAL 7
Lightning. Daleks ang accelerometers
MEWS ~ Barry Fox highlights technology's leading edge a
Plus everyday news fom tne worl of electronic
MICROCHIP READER OFFER. 7
EPE Exclusive -Wina iP XLP 8 Bit Development Board
SUBSCRIBE TO EPE ans cave money 36
EPE BACK ISSUES Did you miss these? 56
(CD-ROMS FOR ELECTRONICS 70
B vice range of C0 ROMs for hobbysis, students and enginec
DIRECT BOOK SERVICE 75
Boise range of 1 backs avalable by mailorder, plus more CD-ROM.
EPEPCB SERVICE 78
Pc 8
ADVERTISERS INDEX 79
‘rawings. photographs and articles pubished in _
EVENDAY PRACTICAL ELECTRONICS w fly NEXT MONTH! - Hichghts of next month's ERE 80
Protected, and reproduction or imitations in whole oF
part are expressi forbcen.
(Our Apri 2013 sue wai be pubished on Readers’ Services ° Editorial and Advertisement Departments 7
Thursday 7 March 2013, S20 page 80 or cota
Everyday Practical Electronics, March 2013QUASAR
ree UY Barrie
eter)
carer
Ne have a wide range
L Pro
enue eren
oe eee Tey
iceoe Uris
Parallel (LOC136) £3.95 Serial
Rreoryetd
'USB'Senal connection
Header cable for [CSP
Free Windows XP sof
ware, See webste for PICS
supported. ZIF Socket and
JUSB lead extra, 18Véc
Kit Order Cod: 3149EKT = £49.95
Assembled Order Code AS3149E - £64.95
Assembled with ZIF socket Order Code:
ASSMSEZIF “£74 95
USB PIC programmer for a wide
range of Fash davoos see
‘website for detais. Free Windows
Software. ZIF Socket and USB
lead not cluded. Powered via
USB port - no external power
supply required
Assembled with IF socket Order Code:
‘AS31SOZIF “£6498
Uses serial port and any
standard terminal comms
program. 4 LED's display
ne status. ZIF sockats not
included. Supply: 16Vde,
it Order Code: 9123KT = £28.98
‘Assembled Order Code: AS31253 - £39.95
Go trom complete begin
to burning a PIC and waiting
code in no time! Incuses 49
page step-by-step POF
TTutoral Marval, Program:
sing Hardware (wth LED
{est section) Win 3.11-—XP Programming
Software (Program, Read, Vey & Erase),
and trewmtable PICTGFBAA that you can use
‘with different code (4 detaled exampies pro
‘ded for you to lear from). PC parallel por,
Kit Order Code 3081KT - £16.95
Assembled Order Code: AS3081 - £24.95
Low cost PIC program.
‘mer board supporting
8 wide range of Micro
chip® PIC microcon-
tioless. Requires PC
sera port Windows
interface supplied.
Kit Order Code: KBO76KT- £34.95
‘The PIC Programmer &
Experimenter Board with
test butlons and LED ind=
calors to carry out educa.
tional experiments, suchas!
the supplied programming examples. I
cludes a 16F627 Flash Microcontvolie that
an be reprogrammed up to 1000 times for
experimenting at will Software to comple
and program your source code is cluded.
Kit Order Code: KEO48KT - £34.95
[Assembled Order Code: VMI11 - £44.95
ere ee a Reet’
ree
(Order Code
ores
5 digital input chan-
e's and 8 digital out
put channels plus two
‘analogue inputs and
‘wo analogue outputs
ith 8 bt resolution
Kit Order Code: KEQSSNKT - £29.95
Assembled Order Code: VMTi0N - £43.95
State-ol-he-Art High secunty
4 channels. Momentary of
latching relay output. Range
up to 40m, Up to 15 Tx can
be learnt by one Rx (ki in
cludes one Tx but more avai
able separately). indicator LED's. Rx PCB
T7x@Smm, 12VécI6MA (standby). Two & Ten
Channel versions also avaiable
Kit Order Code: 3180KT - £54.95
‘Assembled Order Code: AS3180 - £54.95
‘Serial por 4-channel ten-
perature logger. °C or "F
Continaousty logs up to 4
separate sensors located
200m from board. Wide
(roe of ree software applications frst
inglusing data PCB just 45x45mm. Powered
Dy PC. Includes one DS 1820 sensor
Kit Order Code: $145KT - £19.95
Assembled Ordor Code: AS3145 - £26.95
‘Adeitonal DS1620 Sensors - £4.95 each
Place nex 9 a mobile phone (not
included) Allows toggle or aulo-
timer conto of 3A mans rated
ulput relay from any location}
with GSM coverage
Kit Order Code: MK160KT - £11.95
atyourprenerun-
Sercan a or
phone fom annere
Premed oie
met um ol any
of the 4 relays as de- «
Shad, Uo uti Sct Posswod
mer ings Anewer, ao Fangs ara
{oveu nse paste case GOK Ho
sor Power taco
‘Gori, Goce Ss0KT 7095
FSsombed Ore Coos ASST - £9495
v
Computer controlled 8
channel relay board. 5A
‘main rated relay outputs
fad 4 optorsolated digital
inpus (for montoring
Switch states, ete) Useful
ina variety of control and e
‘Sensing applications. Programmed via senl
port (use our new Windows interface, tem
‘al emulate or batch fil) Sera cable can
be up 10 36m long Includes plastic ease
130x100x30mm. Power. 12VdcIS00MA,
Kit Order Code: 3108KT - £76.95
‘Assembled Order Code: AS3108 - £89.95
Sme range. 112 x 122mm
Suppy: 12VacI0 5A
Kit Order Code: 3142KT - £64.95
‘Assembled Order Code: AS3142 - £74.95
Control 12 onboard relays with
included infrared remote con
rol unit. Toggle or momentary
Detect DTMF tenes from
tape recorders, recewvers,
two-way radios, ete using
the bullin mic or erect
from the phone line. Char
acters are displayed on a
16 character display as they are received and
upto 22 numbers can be displayed by scrol
ig the display. Al data written othe LCD is
‘also sent toa serial output for connection to a
‘computer. Supply. 8-12V OC (Orcer Code
SU303) Main PCB. 55x35mm.
‘Order Code: 3153KT- £37.95
‘Assembled Order Code: AS3153 - £49.05
independent high power za
channels. Preprogrammed
or user-editable ight se-
‘quences. Standalone op-
tion and 2-wire serial inter-
face for microcontroler of
PC communication with simple command set
‘Suitable for common anode RGB LED strips,
LEDs and incandescent bubs. 56 x39 x
20mm. 128 total max. Supply: 12Vee.
Kit Order Code: 8191KT - £29.95
‘Assembled Order Code: ASB191 - £29.95Pena
Peet
eee
4 channel computer
Serial por temperature
‘montor and lay con:
troller with four pus
for Dallas 0S18S20 or
10818820 digtal thor
‘mometer sensors (£3.95 each). Four SA
‘ated relay channels provide output control
Rolays are independent of sensor channels,
alowing flenbiy to setup the inkage in any
\way you choose. Commands for reading
temperature and elay control sent via the
£5232 interface using simple text stings
Control using a simple terminal comms
program (Windows HyperTerminal) or our
{tee Windows applicaton software.
Kit Order Code: 31G0KT - £84.95
‘Assembied Order Code: AS3190 - £99.95
Feature packed nonvolatile
40 second mult-message
‘sound recorder module vs.
ng @ high qualty Winbond
sound recorder. Stanc-
‘alone operation using just six onboard but-
tons or use onboard SPI interface, Record
using buitun microphone or extemal ine
In. 8:24 Vac operation. Just change one re
Sisto fr different recording duration’sound
Quality. sampling frequency 4-12 KH.
Kit Order Code. 3188KT - £29.95
‘Assombied Order Code: AS3188 - £37.95
120 second version also avaiable
Got beter performance from
your stepper motors with this,
{va ul bridge mator driver
‘based on SGS Thompson
chips L287 & L298. Motor
Ccurtent foreach phase set
Using on-boa’d potentiometer Rated fo han-
‘le motor winding currants up to 2 Amps per
‘hase. Operates on §-36Vée supply voltage.
Provides all basic motor controls including ful
‘or half stepping of bipolar steppers and direc-
tion control. Allows multiple river synctront
sation Perfect for desktop CNC applications
‘Kt Order Code: 3187KT £39.95
Assembled Order Code: AS3187 - £49.05
Digitally cleans the video
signal and removes un-
wanted distortion in video
‘Signal ln adiion itstablises "Mit
plcture quality and luminance fuctuations
‘You wil aso benefit from improved picture
{ually on LCD mentors or projectors.
Kt Order Code: K8036KT - £29.95
‘Assembled Order Code: VMi06 - £44.95
Motor Speed Controllers
oe
Contra! the speed ot
‘imost any common DC
motor rated up to
{OOVI7 5A. Puise with
‘madu'ation cutput for
maximum motor torque
‘at all spaeds. Supply §-15Véc. Box supped
Dimensions (mm). 6OWs100Lx60H
Kit Order Coe: 3067KT - £19.95
‘Assembled Order Code: AS32067 - £27.95
Contr! the speed of
‘most eommen DC
motors (cated up to
$32Vdc/10A) n both the
Torward and reverse
7 SE TET DEPENDS ON VOTTAGENT ¥
Fig: everthing (except the batteries) mounts on a single-sided PCB.
‘The component layout is shown above and, with the same-size photo at
Tight, is self-explanatory. Fig.4 (right) is the drilling guide for the end
End Panel Drill Guide
Switeh LED LED Pot
panel, There no labelling on th
front panel
jagram; all controls are labelled on.
‘smm 3mm 3mm 7mm.
pin 3 high and diode Ds is then reverse biased. The 470nF
capacitor then begins to charge via the 470k resistor.
During this time, LED1 is lit (driven from pin 3). When
the voltage across the 470nF capacitor reaches 2/3 of the
supply voltage, pin 3 goes low and the 470nF capacitor is.
discharged via diode D3.
Thisis an unconventional monostable timer arrangement,
Normally, pin 7, the disch:;e, would be connected to pin
Gand would discharge the 470nF capacitor instead of usin:
diode D3. Using Ds to discharge the capacitor frees pin 7
to perform another task. Because it can sink (pull down) to
OV, itis suitable for use as a reset control for the following
oscillator, C3,
1C3 is connected in astable (free-running) mode, run-
ning at about 4kHz to drive the piezo transducer. Itis held
in the reset condition, with its pin 4 pulled low by pin 7
(discharge) of IC2, when IC2 is not timing.
Power supply
As already mentioned, the Lightning Detector is powered
from two AA-cells ora low volta. plupack supply. When
running from the AA cells, current flows via the closed
contact in the power connector (CON3) and through the 220
resistorto the OV supply. This resistor is included to prevent
‘excess current if the cells are inserted back-to-front. When.
the cells are correctly inserted, the 222 resistor produces
Everyday Practical Electronics, March 2013
a minimal voltage drop (normally less than 33mV and less
than 100m with the detect LED lit).
‘When running from @ DC supply, the AA cells are discon-
nected vie CONI (as noted earlier) and the incoming supply
is regulated downto 3.9V using Zener diode ZD1 and resistor
R1. The value ofthis resistor depends on the DC supply volt-
age anywhere from 6V to 12V will be suitable, with resistor
values of 1200 (6V}, 3300 (9V) or 4700 (12V). The negative
supply connects to the circuit ground via the 220 resistor.
Diode D1 reduces the 3.9V Zenor voltage supply to about
3.3V, We could have used a3.3V Zener diode on its own with-
out D1. However, we want to be able to run the cirouit from
two AA cells that provide a 3V supply. Ifa 3.3V Zener diode
were used, the cells would be discharged via the Zener diode.
So, by including diode D1, current is prevented from flowing.
through the Zenerdiode. The Zener voltage is increased from
3.3V to 3.9V to compensate for the 0.V diode drop.
D1alsoblocks reverse voltagoto the circuit should the 12V_
supply be connected with reversed polarity. With reverse
polarity, Zener diode ZD1 is forward biased and clamps
the voltae to no more than -0.6V below the OV supply.
1 stops current flowing through the circuit backwards.
Battery indication
When the power is first switched on, LED2 provides in-
dication of the battery condition. LED2 is driven via PNP
13instructional Project
Fame ema OC ma Ce
1 POB, code 888, 65mm x 86mm
1 remote control case, 135mm x 70mm x 24mm
1 panel label, 50mm x 114mm
1 miniature PC-mount SPDT toggle switch (Altronics
$1421 or equivalent) (S1)
1 knob to suit potentiometer
1 switched 2.5mm PCB mount DC socket (CON)
2 Ad alkaline cells
2.8-pin IC sockets (optional)
1 tuning coil with ferrite rod (Jaycar LF-1020 or similar)
1 low-profile piezo transducer
2.6mm spacers
2M2.5 x 12mm screws
4.6mm selftapping screws
2 100mm cable ties
6 PC stakes
150mm length of red light gauge hookup wire
1 50mm length of black light gauge hookup wire
Semiconductors
1 TA7642 single chip AM radio (IC1) (www.conrad-uk.
com or eBay)
27555 CMOS 555 timers (IOM75S5IPA, TLCSSSCP,
‘TS5SSCN, LMCSSSCN or ICM7S55CN) (IC2,IC3)
2 3mm high intensity red LEDs (LED1, LED2)
2 5mm IR LEDs (LED3,LED4)
1 BCS47 NPN transistor (Q1)
1 BC549C NPN transistor (02)
1 BGS59 PNP transistor (Q3)
1.3.9V 1W Zener diode (ZD1)
2.1N4148 signal diodes (D1,03)
1 1N4004 rectifier diode (02)
Capacitors
2 10uF 16V PC electrolytic.
1 470nF MKT polyester
4 100nF MKT polyester
2 100nF ceramic
1 22nF MKT polyester
1 10nF MKT polyester
1 InF MKT polyester
Resistors (0.25W, 1%)
ATO —-2 220K 2180kQ 5 100k
222kQ 11k2 14700-11800
1 of 1209, 3302 or 4709 0.5W (RI - see text)
1 10k®2 og potentiometer, 9mm square, PCB-mount
Reproduced by arrangement
‘with SILICON CHIP
‘magazine 2013.
wwwsiliconchip.com au
110k2
1220
transistor Q3 and its base (B) is initially tied to OV via the
10xF capacitor. With the supply at 3V, Q3's emitter is at
about 0.6V and the LED is driven at maximum brightness.
That is with about 2.4V (3V — 0.6V) across the LED and
1800 resistor. Assuming an LED forward voltage of 1.8V,
this produces @ current of about 3mA.
‘Ata lower supply voltage, the initial LED current is less
and it will be dimmer. With a 2V supply, LED2 will be berely
alight. indicating that the batteries should be replaced
Whatever the supply, LED2 only lights momentarily
and as the 10uF capacitor begins to charge via the 100k
4
Here's how the PCB fits
inside the case. The top
‘corners need to be shaped
to fit the case mounting
pillars, but otherwise it's
a simple drop-in fit,
secured by four sel
lapping screws. The
two AA batieries
which power the
unit fit under
the moulding at
the bottom.
resistor, it dims and eventually goes out. The 220k0 resistor
across the 10uF capacitor prevents the capacitor charging
to any more than 2/3rds the supply. This provides a faster
discharge of the capacitor when the supply is switched off.
‘The 2200 resistor is also used to discharge the capacitor
when the supply is off, so itis ready to flash the LED when
power is reappli
Construction
The Lightning Detector uses a PCB measuring 65mm x
‘86mm and is coded 888. This board is available from the
EPE PCB Service. The topside component layout is shown
in Fig.3. The PCB and components are housed in a plastic
‘case measuring 135mm x 70mm x 24mm.
‘The PCB is designed to mount on to the integral mount-
ing bushes within the box. Make sure the front edge of the
board is shaped to the correct outline so it fits properly. It
can be filed to shape if necessary, using the PCB outline
shape as a guide.
Begin construction by checking the PCB for breaks in
tracks or shorts between tracks or pads. Fix any defects, if
necessary. Check the hole sizes for the PCB mounting holes
and for the cable ties. These are 3mm in diameter.
‘You can then insert the resistors. Use the resistor colour
code table to select each value or, better still, check each
one witha digital multimeter. Then install the diodes; they
‘must be mounted with the orientation shown. Install the
six PC stakes.
IC2 and IC3 can be mounted on sockets or directly sol-
dered to the PCB. When installing sockets and ICs, take
care to orient them correctly ~ as indicated by the notch at
one end ~ see Fig.3
Everyday Practical Electronics, March 2013‘The capacitors can be mounted next. The electrolytic,
typos must be oriented with the shown polarity. Make sure
these capacitors are placed on the PCB so their height above
the surface is no more than 12.5mm; otherwise, the lid of
the case will not fit correctly.
Note that while provision is made for a capacitor across
coil L1, one is not used in this circuit (as mentioned earlier).
It is included so that you can experiment with the radio IC
by placing atunin: capacitor between the two PC stakes ior
coil Li and placing a fixed-value (if required) capacitor to
pad out the capacitor range. This will allow the reception
of radio broadcast stations.
‘The audio signal will be available at VR1’s wiper. A cou-
pling capacitor (say 100nF or so) is required to connect this.
signal to an external amplifier.
Now mount [C1 and the transistors, taking care to place
each in its correct place. If you happen to be using a Fer-
ranti ZN414Z,from your IC collection for IC1, note that the
GND and OUT pins are reversed compared to the specified
‘TA7642. You would also have to place the IC in the PCB
oriented 180° to that shown on the overlay.
‘An MK484 has the same pinout as the TA7642. The
‘TA7642 has a greater sensitivity in the lightning detector
;pplicat'on compared to the MK484 and so ‘ven the choice,
‘we recommend using the TA7642, We did not try aZN414Z,,
since this is no longer available.
The potentiometer (VR1) and PCB-mounted switch $1
can now be soldered in.
LED1 and LED2 arenext. These mount
horizontally, butataheight of 6mm above
the board suriace. Bend their leads 90° at
‘7mm back from the base ofthe LEDs, mak-
ing sure the anode (A) lead is to the left.
Detector coll
L1 isastandard broadcast band coil pre-
wound on to a small ferrite rod. There
are actually two coils on the rod, but
only one is used.
Using your multimeter, find the coil
that hes the greatest resistance. With our
prototype, the main winding measured
about 110, while the separate antenna
winding measured 20. Connect the coil
with the highest resistance to the PC
stakes. The ferrite rod is secured to the
PCB using a pair of small cable ties.
The piezo transducer is mounted us-
ing two 6mm-long standofis and M2.5 x
‘12mm screws. The screws are inserted
from the underside of the PCB, pass
throuch the spacers and tap into the
piezo mounting tabs. If you are using a
different piezo transducer that has larger
mounting holes in the tabs, M3 screws
could be used instead to tap into the
plastic transducer tabs. Alternatively,
two nuts can be used.
Follow the wirin: diagram tomakethe
connections from the piezo transducer
and battery terminals to the PC stakes
on the PCB.
can be
Everyday Practical Electronics, March 2013
ig 5: this samo-size panel artwork
otocopied or downloaded
and printed, then glued in place
Thisend-on view shows thetwocontrols and two LEDs which,
‘mount on the end panel
Noxt, install the battery clips into the battery compart-
ment. The two connected terminals are placed on the
right-hand side (es you look at the rear of the case with the
compartment at the bottom). The spring terminal is placed
tothe top and the raised section to the bottom. For the left
sido, insert the separate terminals with the sprins torminal
placed at the lower edge and the raised section to the top.
Tho noxt step is to bend the two individual torminals to
the outside of the compartment. You may need to stretch
the contact springs so that the AA cells are held securely
between the contacts.
‘The PCB is secured to the base of the
case using four M3 x 6mm screws that
screw into the integral mounting bushes
in the box. Before fitting them in place,
rilloutthe small front panel forthe LEDs,
potentiometer and switch. Fi:.4showsthe
drilling template and this can be copied
and attached to the panel during drilling,
‘The panel label for this project can
either be photocopied (see Fig.5) or for
best results, it can be downloaded from
the EPE website (www.epemag.com).
‘When downloaded, print it on to
paper, sticky-backed ‘photo paper or
plastic film. For protection and long
life, paper labels should be covered with
either sell-adhesive clear film or (as we
normally do) hot laminateit (laminators
and slooves are very cheap these days
and give a tough protective layer!).
If printing on clear plastic film (over-
head projector film) you can print the
label as a mirror image, so that the ink
is behind the film when placed on to
the panel. Again, this will give the label
‘maximum protection. Once the ink is
dry, cut the label to size,
‘The paper or plastic film is glued to
the panel usingaan even smear of neutral-
cure silicone. For plastic film, ifyou are
sluing it to a black-coloured panel, use
coloured silicone such as grey or white,
so the label can be seen againstthe black.
15‘onstructional Project
RESISTOR COLOUR CODES
4-Band Code (1%)
yellow purple yellow brawn.
No. Value
1 470K82
brown
220k.
180k0
100k9
10k9
2 ‘ed red yellow brown
2
5
1
2 22ko
1
1
1
BI
of
1
1
brown grey yellow brown
‘brown black yellow brown
brown black orange brown
od red red brown
‘brown black red brown
yellow purple brown brown
1802 brown grey brown brown,
220 red red black brown
the following (F1):
4700 yellow purple brown brown
3300 orange orange brown brown
1k
4700
ne
brown
Qa
Q
Q
Q
Q
Q
Q
Q
oO
a
On
Q
Qa
a
1 1208 brown red brown brown
A hole in the panel is required directly above the piezo
transducer. This can be first drilled in the plastic lid and
then once the panel label is affixed, cut the hole out using
a sharp hobby knife.
‘Assmall piece of dark labricorloudspeaker foam (scrounsed
from an old pair of headphones) can be used to cover the
piezo transducer. Also, a black bezel over the panel hole can
improve the finish ofthe unit. These are secured with asmear
ofneutral curesilicone, Ourbezel came from the plastic dress
plate that sits behind the nut ofa storeo 6.35mm jack socket.
‘S-Band Code (1%)
yellow purple black orange
red red black orange brown
brown grey black orange brown
brown black black orange brown}
brown black black red brown
red red black brown brown
brown black black brown brown
yellow purple black black brown
brown grey black black brown
red red black gold brown
yellow purple black black brown
orange orange black black
brown red black black brown,
Additionally, a cut out is r
access to the DC socket. A rat-tail file can
be used to make this hole in the lid.
Testing
Testing can be done with two AA cells or
‘a DC supply. Apply power and check that
the power LED momentarily lights when
the Lightning Detector is switched on.
Check the supply voltage by measuring
across diode D2. This should be around
3, but may differ depending on the state
of the cells or the tolerance of the 3.9V
Zener diode when a DC power supply is
used. The voltage across the 220 resistor
should be about 33mV with a 3V supply,
or less with a lower voltage supply.
Check the supply to IC1 at the emitter of
Ql. This should be 1.46V with a 3V sup-
ply, dropping to 1.287V with a 2V supply.
‘Adjust the sensitivity control fully clock-
wise or back off if any indication persists.
‘You can now test the Lightning Detector as
a fluorescent light is switched on. Conventional fluorescent
tubes will cause the Liglitning Detoctorto givean LED detect,
and tone indication as each starter attempts to light its tube.
By contrast, compact fiuorescent tubes tend to be indicated
‘witha singe fash and tone asthe tube lights rapidly
The sensitivity control is included to prevent the
ning Detector from producing an indi
no lightning, The control is adjusted clockwise for maxi-
mum sensitivity to lightning, but not so far as to give false
detection. EPE
Everyday Practical Electronics, March 2013we a
RYDAY is offering its readers the chance to win a Microchip XLP
I §-Bit Development Boarcl (DM240313). The XLP 8-bit Development Board provides a low-cost,
highly configurable, development system for Microchip's new line of extreme-low-power 8-bit
PIC18F or PIC16F enhanced core microcontrollers that allow for design of sleep currents down to
20nA. The board supports development for the PIC18F87K22 or PIC16LF1947 MCUs, which highlight
the capabilities of each product family.
The board can be powered by five different power sources, including batteries or energy harvesting
modules (sold separately), and it supports a variety of common components that can be selective ena-
bled. The board is also expandable through the on-board PICtail connector that permits the addition of
capabilities such as RF connectivity. The kit includes a USB cable, a power measurement cable, a Quick
Start guide and a PICGLF 1947 PIM.
The board is suitable for prototyping many low-power applications, including RF, temperature sensors,
electronic door locks, LCD, remote controls, security sensors, smart cards, and energy harvesting. The
PiCtail interface supports Microchip's extensive line of daughter cards for easy evaluation of your next
low-power application.
For your chance to win the XLP 8-Bit Development Board from Microchip, please
wwwanicrochip-comps.com/epe-xlp8, and enter your dotails in the online entry form.
‘The closing date for this offer is 31 March 2013Ko
SEMTEST
Caen
besa
oo fo be tested
Part 2: By JIM ROWE
Check all those semiconductors in your collection
with this easy-to-build test set!
This month, we present the full circuit of this versatile unit,
which can test all the discrete semiconductors in your collection.
It employs a PIC16F877A microcontroller to run all the different
tests, and displays the results on a 2-line LCD panel.
IHERE’S quite a lot of circuitry in
the new SemTest, despite the fact
that most of its operation is managed
bya microcontroller. For that reason,
the circuitry is accommodated on
two PCBs, which are stacked inside
the case.
To begin the circuit description we
will start with the lower or main PCB,
which carries the micro, the power
supplies and metering. This section
of the circuit is shown in Figs.
Microcontroller IC4 forms the brain
of the SemTest. We have used a
18
PICL6F877A. because it has five 1/0
ports, including three thet are eight
bits wide. Italso includes a 10-bit ADC
(analogue-to-digital converter) with a
choice of eizht input channels.
All eight bits of both ports B and D
are used to control the various relays
which provide the test configurations.
The two ports drive ICS and IC6,
which are ULN2803A octal Darling-
ton arrays, which in turn drive a total
of 16 relays.
Most of these are on the upper PCB,
but four relays are on the main board:
Relay 1, which is used to switch the
device test voltage on and off
Relay 2, which switches the test
voltage between its ‘BV’ or ‘OPV?
modes
Relay 7, which controls the value
of the current shunt resistor used to
measure device current (and hence
switch current ranges)
Relay 8, which controls the volt-
age divider ratio for device voltage
measurement (ie, to switch voltage
measurement ranges).
Everyday Practical Electronics, March 2013Connections to the relays on the upper
PCB are made via CON3 and CONS
Bit lines RCO to RC3 of port G, to:
gether with REO and REt of port E, are
used to control the LCD module, which
is again on the upper PCB. These con-
nections are made via CON2, which
links to CONS on the upper board via
8 10-way IDC ribbon cable.
‘The remaining bit lines, RC4 to RC7
of port C, plus bit line RE2 of port F
are used to monitor activity on the five
pushbutton switches $3 to $7. These
‘mount on the instrument's front panel
and are connected using a 16-way IDC
ribbon cable from CON7 on the upper
PGB to CONS on the main board.
“The same connectors and cable are
used to make the connections for relays
3 t0 6, 9, 15 and 16, plus the connec.
tion for LED1 (the ‘Test Volts Present”
indicator).
High-voltage supply
The test voltage power supply cir
cuitry at upper left on Fig.5 has been
adapted from the high-voltage power
supply in the Electrolytic Capacitor
Tester/Reformer described in August-
September 2012.
‘As before, the supply isastep-up DC-
DC converter using IC1 (an MC34063)
as tho controller, with transistors Qt
and Q2 used to drive MOSFET Q3 and
transiormer T1. The ‘flyback’ voltage
pulses developed by T1 are rectified
by fast diode D2 and fed to the output
filtering and current-limiting circuitry.
‘The MC34063 maintains the output
voltage at the selected level by means
‘of negative feedback from the four 78k
resistors in series with trimpot VR1
in the top leg, plus the 100k resistor
connected from pin 5 of IC1 to ground
as the ‘default’ bottom leg,
This basic divider determines the
converter’s nominal 10V' output level.
‘The three other operating test volt
ages (25V. 50V and 100V) are achieved
using switch S2a to bring other resist-
ances in parallel withthe 100k0 lower
relay 2{a) is used to
ve the converter's much higher
{about 600V) “BV" output voltage by
switching in a680® resistor across the
100K2 resistor instead
Trimpot VR1 is used to sot the
converter’s OPV output voltages
precisoly. Bit lines RA4 and RAS of
the micro’s port A are used to sense
the setting of switch $2, i, via poles
Sab and S2c,
Everyday Practical Electronics, March 2013
Main Features
Acompact yet flexible test set for most common discrete semiconductor de-
vices, including diodes (junction and Schottky), LEDs, Zeners, diacs, bipolar
junction transistors (BJTs), MOSFETS, SCRs and thyristors (including triacs)
Based on a PIC16F877A microcontroller, with device and test selection, plus
the test results displayed via a 16x2 alphanumeric LCD readout. Devices to be
tested are connected to the test set via an 18.way ZIF socket.
Five test voltages are available: a 600V source for avalanche breakdown (BV)
testing, plus achoice of either 10V, 25V, SOV or 100V for operating voltage (OPV)
tests, Al test voltages are appliedto the DUT viacurrent-imiting resistors - 100k®2
in the case of BV tests or 2kMin the case of OPV tests.
Maximum avalanche current which can flow during BV tests is 6mA (short
circutt current)
‘Maximum device/leakage current which can flow with OPV = 100Vis oma, with
OPV = S0Vis 25mA; with OPV = 25V is 12.5mA; and with OPV = 10V is 6mA.
Minimum leakage current which can be measured = 1A,
Diode tests
(1) Reverse avalanche current Ip (BV) Repco Lvaeenerct
(2) Reverse leakage current lz (OPV) with SILICON CHIP
(8) Forward voltage drop Vr (OPV)
(4) Zener/avalanche voltage Va (BV)
LED tests
(1) Reverse leakage current Ip (OPV = 10V)
(2) Forward voltage drop Ve (OPV)
BJT tests
(1) Breakdown voltage C-B with emitter of¢ Visryca0)
(2) Breakdown voltage C-E with base ole Vigqjceo
{@) Leakage current C-B with emitter 0/¢ logo (OPV)
(4) Leakage current C-E with base o/c Iceo (OPV)
(6) Forward current gain re with a choice of three base current levels: 201A,
100}A oF 500A
Maximum Nee which can be measured with ls = 20WA is 1500 (OPV = 100V)
Maximum hee which can be measured with Ig = 100A is 300 (OPV = 100V)
Maximum hee which can be measured with Ig = SO0uA is 60 (OPV = 100V)
MOSFET tests
(1) Breakdown voltage D-S with G-S shorted Vienjoss
(2) Leakage current D-S with G-S shorted loss (OPV)
(3) D'S current ipg versus G-S bias voltage Ves (ie, arm)
‘SCR, PUT and triac tests
(1) Breakdown voltage with G-K (SCR) or G-A (PUT) shorted Vieraxs
(2) Leakage current with G-K (SCR) or G-A (PUT) shorted laxs (OPV)
(8) Current laxs with gate current applied (20uA, 100:A or 500A) and OPV
applied
(4) Voltage drop A-K when conducting Vax (OPV)
‘magazine 2013.
sewwsiliconchip.com au
Note: the test set operates from an external power source of 12V DC, Current
drain varies from around 65mA when a test is being set up, to a maximum
of approximately 900mA during testing, It can, therefore, be powered from
either a 12V SLA battery or a 12V/1A mains power supply or regulated DC
plugpack.
19Constructional Project
bi Ag * ay stv
aa
“8 oleae I
© rear I
10k gon1% 12kix Stk Ix 2001% 39k
‘i aa ad
CONNECTS TO CONS
J “ON UPERBOD ——\_
he nav
SEMTEST DISCRETE SEMICONDUCTOR TEST SET main cincu't (Lower BOARD)
Fig.5: the main part of the Sem‘Test circuit is built on the lower PCB and includes microcontroller ICA, the power supplies
and metering. IC4 controls the relays via IC5 and IC5; performs A-D conversion of the measurements applied to its inputs
and drives the LCD on the upper board via CON2. The test voltages (up to 600V) are generated by a DC-DC converter circuit
based on ICi, transformer Tl and MOSFET Q3 at upper left
2»
Everyday Practical Electronics, March 2013240k
1k 1%
sey
00k
%
200k
”
200k
1%
Rewv7cot
cs wn2803A.
ls
he mscou
fa ava con,
ls niscou
hz aviscou
hi nye cou,
cons
5
rea ase
5]
OF
1
4
ami
30k | sa! 205
EW 11 COW
EU 10 CON
HEWVI2c
HEU 14 CON
HEU 13.€O1
\ connects 10 con7 on enon
29 2008
ReAY CON
304,09. INAIUB
a ——
1,202 4004, uF4007
—
Everydlay Practical Electronics, March 2013 2instructional Project
zn
va we
16 X2LCD MODULE cownas}
oh as
IT
\ conn 0 cos on a son
Fig.6: the upper board circuit
SEMTEST DISCRETE SEMICONDUCTOR TEST SET upper Board ciRcuIT
ities the LCD module, an 18-pin ZIF (ero insertion force) socket to connect the device
under test (DUT), the control pushbuttons and various relays to switch the device connections to CONG
While we're looking at the DC-DC
converter circuitry, note thet the second
pole of relay 2 (2b) is used to adjust the
value of the current-limiting resistance
in series with the converter’s output, to
suit the various output voltage levels.
So, for the four output voltage settings
selected by S22, the total curent-liraiting
2
resistance is (1.5K + (5000//99k0)), or
just under 2k0. This limits the device
‘current toabout 30enA on the 100V range,
On the ‘BY’ setting (relay 2 off, the
current-limiting resistance jumps up
to 100.5k0 - limiting the maximum
current to less than 6mA, even if the
device under test is shorted.
Crystal X1 and its two associated
27pF capacitors are used to run the
micro at MHz, which gives an instruc
tion cycle time of 500ns.
Analogue-to-digital conversion
Now let’sturn to the micro’s ADCmod-
ule and how it’s used to perform the
Everyday Practical Electronics, March 2013TOW 10k iW
vRi00
0k
| erour uncion
TRANSISTORS
hopopabapr | fehs Fp yas fol yo ye
\— connects 10 CON On man BAO
ito Con ScoU rc wwa062-2 5
sess
oon nas m.20 2 2D
oy, ' Gs ‘
ae a
The DC-DCsstep-up converter usedin this project can generate high vltages (up to 6O0V DC) and can also supply significant current. AS
a result, i's capable of delivering a nasty electric shock and there are some situations where such a shock could be potentially lethal
For this reason, 00 NOT touch any part of the circuit while itis operating, particularly around transformer T1, diode D1 and the
10 47jF 450V electrolytic capacitors on the main (lower) PCB. In addition, high voltages can also be applied to the display board
‘a CONG) during operation, so it’s not safe to touch certain parts on this board either. Exercise extreme caution if testing the unit
with the lid opened and always allow time for the 47yF capacitors to discharge before working onthe circuit
Everyday Practical
Electronics, March 2013 23This
inside the completed prototype shows how it all goes together. The two PCB assemblies are mou
respective case halves on spacers and joined together via three IDC header cables,
‘Sen Test’s various metering, functions.
Starting with the ADC's input channel
ANO (IC4 pin 2), this is used to meas-
ure the voltage Vpgv being applied to
the device under test. Relay 8 is used
to switch the upper leg of the voltage
divider feeding ANO to give the Vpgv
voltmeter two ranges: Oto 1028V inthe
case ofthe hivher ‘breakdown voltace’
or BV range; and 0 to 102.8V for the
lower ‘OPV" voltage ran;
The second ADC input channel
AN1 (IC4 pin 3) is used to measure
the current Ipev passing through
the device under test (DUT). It does
this by measuring the voltage drop
across @ shunt resistance connected
between the negative end of the DUT
4
and ground. Here, relay 7 is used to
switch the value of the shunt resistor,
to provide two current ranges.
When relay 7 is activated, it shorts
the bottom end of the 398 ‘upper’
shunt resistor (o ground, which gives
an effective shunt resistance of 39%
this provides a 0-50mA current range.
However, if the micro turns off relay
7, this removes the short across the
paralleled 2.7MQ and 10k0 resistors,
which bumps up the effective shunt
resistance to almost exactly 10k,
and thus provides a 0 to 200A cur
rent range.
On both ranges, the voltage drop
developed across the shunt resist-
ance is fed to the micro's AN1 input
via buffer amplifier IC3b, which
provides a gain of 1.205. This is used
for scaling,
‘The third ADC input channel, AN2
(C4 pin 4), is used to measure Vos.
the gate-source voltage ior MOSFE_
Itdoes this by using another input volt-
age divider, with the top leg formed by
the series 4700 and 20k0 resistors,
and the bottom legby the 10k.resistor
from pin 3 of IC3a to ground.
This gives a 50:1 input division,
which to ether with the vain of buffer
amplifier IC3e (again 1.205) gives a
voltage range of OV to 103.3V. Thismay
seem too high for measuring voltages
lower than 20V, but it was only pos-
sible to give the AN2 voltmeter a si
Everyday Practical Electronics, March 20131 ABS enclosure, 222mm x
446mm x 55mm
2 control knobs, 19mm diameter
'5 SPST pushbutton switches,
panel mount
1 18:pin ZIF socket
1 18:pin machined IC socket
1 18:pin IC socket, wire-wrap type
4M x 15mm tapped metal spacers
2M3 x 6mm M3 tapped nylon
spacers
4M x 25mm machine screws
2M x 15mm machine screws
10 M3 x 6mm machine screws
10 M3 hex nuts
2.MB flat washers, nyion
4 16way (8x2) IDC header sockets
2 10-way (5x2) IDC header sockets,
4 16-way (8x2) pin headers,
vertical PCB-mount
2 10-way (5x2) pin headers,
vertical PCB-mount
1.300mm length of 16-way IDC
ribbon cable
118mm length of 10-way IDC
ribbon cable
1 16-way length of SIL pin header
strip
Main board
1 PCB, code 890, available from the
EPE PCB Senvice, size 210mm x
Ya4mm
2 19mm square heatsinks
1 6V SPDT mini relay (Jaycar
‘SY-40858 or simitar)
412V DPOT mini relay
2.SPST mini DIL relay
1 Ferrite pot core, 25mm da x 16mm.
high (Altronies L5300 or sitar)
1 moulded bobbin to suit (L $305)
1 B.0MH2 crystal, HC-49S (X1)
11MB x 25mm nylon machine
screw plus nut and washer
1 -pole é-position rotary switch
1 SPDT sub mini toggle switch,
PCB-mount
2 8-pin DIL IC sockets, PCB-mount
1 40-pin DIL IC socket, PCB-mount
1.2.1mm concentric DC connector,
nylon cable ties
4.1mm PCB terminal pins
1 Imlength of 0.8mm-diameter
enamelled copper wire
110m length of 0.26mm-diameter
‘enamelled copper wire
Semiconductors
1 MC34063 switchmode controller
(ct)
1 LM35B dual op amp (IC3)
4 PIC16F877A microcontroller
‘programmed with 04103128.hex
(ca)
2 ULN2803A octal driver (IC5,1C8)
1 LM3367-2.5 voltage reference
(cr)
1 7805 SV reguiator (REG1)
4 80397 NPN transistor (Q1)
4BC327 PNP transistor (22)
1 IRFS40N channel MOSFET (23)
4.47V 1W Zener diode (2D1)
46.2V 1W Zener diode (2D2)
1 1N4004 1A diode (01)
4 UF4007 fast 1A diode (02)
3.1N4148 100mA diode (D3,04,09)
Capacitors
2 1000uF 25V radial electrolytic
4 100uF 10V radial electrolytic
2. 47uF 450V radial electrolytic
1 47yF 16V radial electrolytic
2.470nF 630V MKT capacitor
4 100nF MET capacitor
2 10nF MKT capacitor
1 nF MKT or polyester capacitor
227pF NPO ceramic
Resistors (0.25, 1%)
127™MQ — 22.4k0
1470k2 —1.2.2k0
4390kK2 11.602
3.300kK2 ~—1'1.5kN SW
1 240K 11k.
1 160K = 21k. 1W
5 100K 26800
475kQ 2 5600
333k 1W 1 10002
120k2 «168
112k 2560
910k = 1390
16.1kQ 1300
1392 1220
230K2 —-102725W
1 S0KS-multturn vertical timpot (VR1)
1 10k2 muititurn horizontal trimpot
(re)
Upper (display) board
1 PCB, code 891, available trom the
EPE PCB Service, size 200mm x
124mm
1 162 LCD module
2.6V SPOT mini relays (Jaycar
$¥-4058 or similar)
8 12V DPDT mini relays (Atronics
$4150 or similar)
2SPST mini DIL relay
18-pin DILIC socket
41mm PCB terminal pins
‘Semiconductors
1 L358 dual op amp (IC2)
2.LM336Z.2.5 (IC8,1C9)
1 BC559 PNP transistor (24)
1 BCS49 NPN transistor (QS)
2 12V 1W Zener diodes (203,204)
15mm red LED (LED1)
4 1N4148 100mA diode (05-D8)
Capacitors
1 220uF 10V radial electrolytic:
1100nF MKT capacitor
Resistors (0.25W, 1%)
11Ma 222k
2120k2 «3 1k
2682 «26200
258kQ 2 1000
410KQIW 2680
168kD = 1220
447K.
1 10kG2 mini horizontal trimpot
2 10k0 multturn horizontal trimpot
1 10kG2 linear 16mm dual-gang pot
4.5k0 multtun horizontal trimpot
Arey
ee gate
gle range, and this needs to measure
voltages up to around 100V to cope
‘with Vos measurements on P-channel
dovices (where the effective Ves must
be found by subtracting the actual Ves
from the device voltage Vpzv).
ADC reference voltage
‘The ADG reference voltage for all
three of these measuring ranges is
provided at pin 5 of ICA, by the volt-
age reference circuit based on IC7,
trimpot VR2 and diodes D3 and D4.
Everyday Practical Electronics, March 2013
together with a 2.4k0 load resistor.
During set-up, VR2 is adjusted to
bring the reference voltage across IC7
as close as possible to 2.490V, where
it hasa temperature coelticient that's
very close to zero,
25ynstructional Project
All three ADG input circuits have
been designed to give the most ac
curate readings with this reference
voltage, so this one adjustment per-
forms the instrument's basic metering
calibration.
‘That's just about it forthe main PCB
circuitry. However, belore moving on,
we should point out that the complete
instrument runs from an external
12V DC supply which comes in via
CONi, polarity protection diode D1
and power switch $1. The resulting
+11.4V rail then feeds regulator REG1
(a7805), which provides +5V to power
IC3, ICA, the LCD module and their
associated circuitry.
The +11.4V rail itself is also used
to supply the various relays and the
DC-DC converter based on IC1—when
the micro tums on relay 1 to begin a
test. It’s also used to power the Ipras
circuitry on the upper PCB, as weshall
see ina moment.
Incidentally, the overall current
drain of the Sem‘est from the external
12V supply ranges from around 65mA,
when atest isbeing set up, to between
150mA and 900mA during testing
(depending on the test concerned). A
regulated 12V/1A plugpack supply or
a 12V SLA lead/acid battery would be
suitable.
‘The upper (display) PCB
Now we can (urn our attention to the
circuitry on the upper display PCB —
see Fig6. This has the LCD module
and control pushbutton switch area
at upper left. Trimpot VR11 is used to
set the LCD's contrast for maximum
readability. The four data lines (D4-
D7)and two control lines (EN and RS)
are fed from various pins on CONS
and linked back to CON2 on the main
board. Similarly, the five pushbutton
switches 83 to S7 are simply wired to
CON?, which is linked to CON4 on the
main board and then to pins 23 to 26
and pin 10 of microcontroller IC4, s0
the micro can monitor them.
‘Atlower left in Fi 6 are two program:
mable current sources, used to provide
the bese current Ipras for testing BITS,
as well as the gate current for testing
SCRs and PUTS. IC8, a 2490V refer:
ence, together with op amp IC2a and
PNP transistor Q4, is the positive Inias
source. Similarly, voltscereference C9,
IC2band NPN transistor Q5 isthe nega-
tive Ipias source (or'sink’,ifyou prefer)
‘The 2.490V voltage references (ICB
26
or IC3) are connected to the non-
inverting (+) input of their respective
op amps, ie, IC2a or IC2b. The output
of each op amp drives the base of the
current pass transistor (4 or Q5),
while feedback to the inverting input
of each op amp is taken from the
emitter of its pass transistor. Then
the emitter of each transistor is taken
either to tho +11.4V rail (in the case
of Q4) orto ground (in the case of Q5),
vvia a series resistance whose value is
carefully chosen tohave. voltage drop
of 2.490V when the transistor’s emitter
current is at the desired level.
For example, when relay 3 and
relay 4 are both off, the emitter resist-
ances for (4 and QS are both equal at
124,7KQ (120k + 4.70). Asa result,
the current passed by either transistor
will tend to stabilise at 20uA, ie, the
level which results in a voltae drop
of 2.490V across its emitter resistance.
Rolays 3 and 4 are used to switch in
Alifferent values of emitter resistance
tor transistors Q4 and Q5, to change the
‘operating currents. For example, when
relay 3 is energised by the micro, the
680 and S6KA resistors, plus trimpot
‘VR6 (or VR7), are switched in parallel
with the fixed emitter resistors, chang-
{ng the current level of each source to
00,4.
Similarly, when relay 4 is energised,
the combinations of 4.7k9 and 6200
resistors, plus trimpot VRS (or VR8),
are switched in parallel with the fixed
emitter resistors, changing the current
level ofeach source to S00jA. So that’s
how we program the Ipias current
sources for currents of either 20uA,
1OOUA or 500A.
Relay Sandrelay 6areusedtoswitch
the output of either the upper +Isias
source or the lower —Igias source, to
the device test circuitry. By the way,
when eitherrelay 5 orrelay 6 (or both)
are off, the current sources obvi-
ously can't provide any of the three
preset current levels. The op amp
‘comparators simply bias their pass
transistors ‘hard on’, ready to pass
the appropriate current when current
is able to flow.
‘That covers pretty well all of the
circuitry on the left-hand side of Fig.6,
apart from LEDi, the “Test Volts On’
indicator. This is connected between
pin9 of CON? and :round, viaaseries
1k0 resistor. Ifyou reler back to Fig.5,
you'll see that the LED is connected
to the +11.4V rail whenever relay
1 switches on the DC-DC converter
circuitry, to perform a test.
ZIF socket
In the centre of the right-hand side of
Fig6 you'll see the 18-pin ZI socket,
that’s used to connect the various
types of discrete semiconductor de-
vice to the Sem Test. The socket’s pin
clips are divided into four groups:
four for BJs at lower left, five for
‘MOSFE‘s at upper left, five for SCRs
‘and PUTs at upper right, and the re-
‘maining four for diodes and LEDs at
lower right.
You'll also note that within each
device group there are some clips
connected together; this has been
done to provide for as many pinout
configurations as possible, lor each
type of device.
the various relays used to set up the
connections for each device type:
relay 9 for diodes and LEDs, relay
10 and relay 11 for BJ's, relays 12,
13 and 14 for MOSFETs, and relays
15 and 16 for SCRs and PUT. If you
‘want to trace out the four separate
relay circuits you will find this easier
by referring back to the simplified
circuits given in Fig.1 to Fig4 in the
first article (February 2013).
‘The only other part of the circuitry
‘on the right-hand side of Fig. is that
at top centre, associated with Zener
diodes 2D3 and ZD4, and dual-gan;
Pots VRi0a and VRiOb. These are used
toadjust the gate bias voltage, Ves, for
MOSFETs, which was also shown in
Fig.3 of the first article
‘VR10a is used to adjust the positive
Vos for N-channel MOSFETS, while
‘VR10b is used to adjust the ‘ne: ative’
Vs for P-channel MOSFETs.
In operation, the microcontroller
works out the effective Vos for the
lattor devices by subtracting theactual
voltage at VR10b's wiper from the de-
vice voltage Voey (which in this case
corresponds to the source voltage).
That completes the circuit descrip-
tion, Next month, we will present the
construction details. We will also
describe an add-on circuit to quickly
Kill the high voltace applied to the ZIF
sockot at the conclusion of a break-
down voltage test, or ifthe SemTest is
inadvertently switched offbefore the
test has properly concluded.
Everyday Practical Electronics, March 2013Not what you
expected?
Not all surprises are welcome; some cause problems and a few can be positively mai
chnotalk
Mark Nelson
Fortunately, forewarned is forearmed, which is why Mark has some words for the wise.
ANUFACTURERS have an
‘amusing saying about unified
norms. ‘Of course we're in
favour of industry standards; that's
precisely why we support so many
Aerent ones, Unortunately, snot
a joke, particularly when a standard is
not a standard.
‘Such was the experience of one of
our readers, who writes: “I bought a
pair of Philips headphones very cheap
from Amazon in their special daily
sales, and plugged them into my MP3
player. But garoled sound came out!
All my other headphones work fine
with the player."
‘What was causing this? Heanswers his
own question: ‘Well, it seems to bo that
Philips are making their headphones
with a now type of 3.5mm jack pl
desipved for Apple products (iPhone
ete). This has an extra contact segment
designed to alter the volume and pause
playback, via a small control on the
actual cablin:, Unfortunately, that extra
contact band (making four in total) on
the jack plus plays havoc (assume)
with conventional stereo equipment, os
ound out to my cost. So they have to
so back to Amazon. If you consider that
the 3.5mm plug is @ universal standard,
its going to cause a lot of trouble in an
already confused electronic world.
Buyers beware
‘Amazon's web pase for the product is
hardly crystal clear, describing them
as Philips O'Neill SHO9567GB/10
Stretch Scratch Headphones “with
iPhone Control’ without any messaze
that the ‘phones are suitable only ior
Whones. Indeed, it mentions ‘Extra
3.5mm plus for Nokia, Sony Ericsson,
and Samsung’, which implies they can
beused with other makes of equipment.
‘The cardboard box ior the
headphones. states ‘tor iPhone/Pad
ete, “but no other plug or adapter is
supplied with the product, nor is there
any warning that this special ack
lays havoc on other equipment. Our
reader continves “OF course I di test
the headphones on an iPhone and they
rectly then. But the point
1 that Pipe were sulin thos with
‘no warning and no adapte:. No wonder
‘Amazon was selling them off cheap!
Unified/proprietary ‘standards’
Is there a standard for 3.5mm ‘mini-
stereo’ connectors? Well, yes and
no. There is a very good page on
‘Wikipedia covering the subject with
good text and plenty of photos ot
Ittp://en.wikipedia.org/wiki/Phone
connector (audio). The two and
ithree-pole versions of the plugs and
sockets are certainly established
standards, but this has not stopped
number of manufacturers from
developins non-standard four and
five-pole versions of the 3.5mm plu:
for certain applications.
Wikipedia explains that a four-
conductor version is often used in
compact camcorders and portable
‘media players, and sometimes also in
laptop computers and smartphones,
providing stereo sound plus a
video signal. Proprietary interfaces
using both four and five-conductor
versions exist, where the extra
conductors are used to supply power
for accessories. The ‘ourconductor
3.5mm plug is also used as a speaker-
microphone connector on handh
amateur radio transceivers by Yaesu
and on some mobile phones.
The author of the Wiki page
acknowledges that problems. exist,
‘edmitting that the possibility of
three rings in the plug versus four
Hos inthe aocke, an dering pin
‘assignment on the rings makes many
physically compatible connections
not elecirically compatible. For
‘example, plus. ing headphones or
headsets from one manufacturer intoa
socket from another may not function.
3.5mm tip-tinging-sleeve (ster
plus-mic) sockets are particularly
common on recent smartpho
‘and have been used by Nokia since
2006; these are often compatible with
standard 3.5mm stereo headphones.
‘Two difierent formats are frequently
found, both of which place left audio
‘on the tip and right audio on the first
ing (mirroring the configuration
found on stereo connectors). Where
they differ is in the placoment of
the microphone and return contacts.
The first, which places the return
signal on the second ring and the
microphone on the sleeve, is used by
Apple's iPhones as well as by HTC,
‘Samsung, Nokia and Sony phones,
‘among others. The second, which
reverses these contacts, is used by
older Samsung smartphones and
‘some Sony Ericsson phones. One such
pin assignment, with ground on the
Everyday Practical Electronics, March 2013
‘Terminal Platform and
been accepted as a national Chinese
standard, Confused? You will be!
More misery?
Well, potentially and specifically
for smartphone users. These days,
nobody would think of running @
computer without antivirus protection
(hope) but the time is not far off
‘when smartphone users will have to
ird up their loins too, Cambridge-
Based data security frm Trend Mico,
which claims to be the third Larcest
in this field after McA‘ee and Norton,
has released its security predictions
for 2013 and beyond. The chellene
in the UK is raising user awareness,
says Rik Ferguson, director of security
research with Trend Micro.
Mobile users. are still unwilling
to accopt thet their phones are
under threat. ‘Black hole’ exploit
kits, currently the
‘computer security, are already
by criminals, he says, and we
soon see the first exploit kits capable
fof targeting mobile devices, where
me can be infected simpy
ing a web page. Currently you
need to download dodgy app to
become infected, but toxic websites
will be the game changer.
Nobody can state tor certain what
the most serious threat during, 2013,
will be, but Trend is convinced it may
be malicious and high-risk Android
apps. Trend predicts these will reach
fone million in 2013, up from 350,000at
the end of 2012. And while traditional
PC malware may recede @ bit during
2013, threats to devices running the
‘Android operating system will more
than replace it. Worse, the emen;ence
of more digital lifestyle devices means
that threats could appear in new and
‘unexpected places, such as television
sets and home appliances.
Feeling uncasy now? Be careful then,
because fraudsters are also cashing in
‘on user fear by circulating fake mobile
antivirus applications purporting
to be legitimate security. software.
Avoid the risk by buying direct from a
genuine developer. A couple of dozen
products are available, several_ gratis,
and you can find a review of all of
them at http:/www.peadvisor:co.uk/
features/security/s355021/group-test-
whats-best-android-antivirus/.
27Constructional Project
Digital
9
‘OST of us have a spirit level
somewhere in our shed or ga-
rage. These handy devices have been
around since the mid 1600s, although
the modern form of the device dates
from the 1920s. A simpleairbubble in
slightly curved tube of coloured alco-
hol can indicate horizontal or plumb
(vertical) with surprising accuracy.
Often a quick check for plumb or
level is all that is needed, but if you
want to measure the actual an. le, then
you need an inclinometer. You can
buy a digital one for up to a couple of
hundred pounds or build one for less
than £30, thanks to the plummeting
cost of MEMS accelerometers.
28
This project is really on the... errr.
an electronic version of the old spirit level, except this one gives
a digital readout of the angle of any flat surface in 0.1 degree
increments from 0 to 360°. A MEMS accelerometer chip, as found
in tablets and smartphones, is at the heart of the project.
MEMS (micro electromechanical
systems) technology is finding its way
into all sorts of consumer electron-
ics these days. Your tablet or smart
phone has a MEMS accelerometer, so
it knows whether you are holding it
in portrait or landscape orientation.
Handheld game controllers use both
accelerometers and gyroscopes to
detect how they are waved, shaken,
pointed or flicked. Even my universal
remote controller tses one to turn on
its LCD when I pick it up.
‘The Digital Spirit Level described
in this article uses a typical MEMS
chip; the Freescale Semiconduc
tor MMA#451Q. This tiny 16-pin
. level. It’s an ‘inclinometer’,
surface-mount device includes a14-bit
3-axis accelerometer, together with
‘2 sophisticated DSP (digital signal
processor) and an °C interface, all
for less than a couple of pounds. Add
a low-cost PIC microcontroller, four
7-segment LED displays and a handful
of common components and you have
all that is necessary fora preity useful
little instrument.
Form factor
Our Digital Spirt Level has a form fac-
torthat's similar toasmall spirit level,
and can measure angle of tilt with an
accuracy of 0.1° over the full 360°
of rotation. Operation could not be
Everyday Practical Electronics, March 2013simpler. Just pick up the device and
sive it a shake to bring it to life, then
place it on the surface you want to
measure. It will stay awake while it
senses movement, and it will auto-
matically turn off after 30 seconds of
inactivity,
How it works
The inclinometer measures its orienta-
tion with reierence to the acceleration
due togravity, which, conveniently for
usall, always points straight down. We
nominate the side-to-side horizontal
axis of the accelerometer as ‘x’, the
top-to-bottom axis as y’ and the front-
to-back axis as ‘z’
If the accelerometer is level. s-avity
will be peréectly aligned with the y
axis. However, when tilted as shown
in Fig.1, there will be components of
gravitational acceleration i
and G x cos®) along both the ‘x’ and
‘y’ axes, doponding on the tilt angle.
Using trigonometry, we could calcu-
late the angle oftilt from the measured
acceleration along the x or y axis, as
Jong as we knew the gravitational ac-
celeration. Unfortunately, this varies
from the nominal 9.8ms? depending
on location, since the Earth is neither
periectly spherical nor uniformly
dense.
Fortunately, we can use the trigo-
nometric identity tan = sin0/cos9,
to solve our problem. If we take the
inverse tangent (arctangent) oftheratio
of accelerations along thexand y axes,
the gravity terms cancel out end we
arriveat the angle of inclination using
only the acceleration values.
So the angle can then be determined
by using the formula @ = atan(x/y)
where x and y are the measured ac-
celerations along the two axes.
However, there is another complica-
tion. If the inclinometer tilts around
the x-axis (io, the x-y plano is no
longer vertical), a component of the
acceleration due to gravity appears on
the z-axis, and the components along
the x and y-axes reduce. Ultimately,
with the inclinometer lying flat on its
back, the x and y components reduce
to zero, as all of the acceleration now
acts in the z-direction. The falling
amplitude of the xand y accelerations
as the x-y plane tilts about the x-axis
progressively reduces the accuracy of
the measurement.
The Digital Spirit Level (inclinom-
eter) described here can maintain 0.1°
Fig. the accelerometer measures the comy
sravity acting on each of the three axes.
ically related to the angle of inclination (see text). Note that the z-axis has
been omitted from this diagram for clarity
accuracy, up to the point where the
tiltabout the x-axis reaches 245°. The
microcontroller (IC2) therefore keeps
track of all three angles, and displays
four dashes in place of the measured
angle if this level of accuracy cannot
be :uaranteed.
Wake and modes
As described above, the main ICs in
the Spirit Leval are in a low-power
deep-sleep mode when it is not being
‘used and ‘wake up’ when movement
is sensed. The circuit remains awake
‘until it senses that it has not moved
for about 30 seconds.
‘The MMA8451Q's built-in DSP
‘and the consequent transition between
‘wake and sloop modes. This is ust ono
ofthe many features ofthe chip; see the
panel titled ‘Inside the MMA8451Q°
for further information on this device.
‘The DSP algorithm considers mo-
tion tobe an acceleration that exceeds
programmable threshold for a pro-
the acceleration signals can be hig!
pass filtered first, to eliminate static
etiects (such as gravity). In addition,
motion detection can be enabled on
each axis independently.
‘We set the motion sensitivity thresh-
old fairly low while the unit is awake,
sothat relatively small movenents sui-
fice to keep it that way. Conversely, in
sleep mode, the sensitivity is reduced
sothata solid ‘air swing’ istequired to
Everyday Practical Electronics, March 2013
onstructior
Of the acceleration due to
jese components are trigonomet=
wake the level up. This prevents the
device from being woken up by every
small knock or vibration, as might be
experionced in a moving vehicle for
example.
Circuit description
‘The full circuit diagram in Fig.2 shows
that the Disital Spirit Level uses just
two chips - the MEMS accelerometer
(IC1) and a PICISLF14K22. micro-
controller (1C2). The latter drives the
anodes of the four 7-segment LED
displays directly and the common
cathodes indirectly via four MOSFETs
(Qrto.Q4).
‘The circuit is powered directly by
pair of AA batteries, with 10uF and
4100nF capacitors providing bulk fil-
toring and high-frequency bypassing
respectively. The accelerometer (IC1)
supply is then further filtered by
108 resistor and a 10:F and 100nF
capacitor, which prevent any ripple
generated by driving the display from
affecting the measurements of the
accelerometer.
‘The PIC micro communicates with
the accelerometer using an PC bus (pin
6 (SDA) end pin 4 {SCL} of IC1) and
two interrupt lines (pin 9 and pin 11,
of IC1), Two 4.7k0 resistors are used
as the usual ‘pull-ups’ for the °C bus.
The accelerometer is configured to
generate a negetive-going interrupt
pulse on pin 11 (INT1) each time @
new acceleration sample is available.
Similarly, a negetive-going interrupt
29(1C2) over just
DIGITAL SPIRIT LEVEL (INCLINOMETER)
ig. the fll circu diagram fr the Digta Spt Level The acosterometer
ines ~two for interrupt signals (pin 9 and pin 13) and two forthe FC bus (pin and pin 6. The
ICSP connector is not necessary if your microcontroller
is
2) interfaces with the microcontroller
supplied pre-programmed
pulse appears on pin 9 (INT2) of the
accelerometer whenever it detect
movement, or changes between sleep
and its wake states.
Pin 18 (RA1) on the PIC microcon-
troller serves double-duty, functioning
both as an interrupt input and as the
clock input for in-circuit programming,
‘The 1k@ resistor is required to ensure
that the in-circuit serial programmer
(ICSP) interface can drive pin 18
without interference from the accel-
erometer, for programming the micro.
‘The ICSP data input is shared with pin
19, one of the digit driver outputs. No
similarresistorisrequired here because
the MOSFET gate is high impedance
and hence won't affect p i
‘The display is aclessic multiplexed
common-cathode 7-segment arrange-
ment. The eight 4.70 resistors on pins
RCO to RC provide current limiting
for the segment LEDs, although in
reality the microcontroller outputs
themselves limit the drive current to
about 20mA per segment. MOSFETs
Qt to Qs are used to drive the digits’
common cathodes, rather than the
usual bipolar transistors, because they
can provide a very low ‘on’ resistance,
30
even when driven at a low voltage.
With only 3V to play with (less if the
battery is discharged), we can't afford
the few hundred millivolts drop that
bipolar transistors would exhibit.
The firmwar
‘The firmware is fairly straiphtiorward.
‘The main program sets up the micro-
controller peripherals, configures the
accelerometer and then enters an end-
less loop. From there on, everything
occurs in one of four interrupt service
routines. One interrupt, triggered by an
{internal timer, multiplexes the display.
The interrupt occurs every Sms, which
defines the on-time for each digit. It
there‘ore takes 20msto display all tour
digits, for a 50Hz refresh rate.
‘The second interrupt service rou-
tine is triggered by a talling edge on
pin 18 of the micro, indicating that
new accelerometer data is available.
When the accelerometer is awake, this
‘occurs every 640ms. The firmware
reads the new data via the °C bus,
calculates the angle, subtracts the
offset value stored in EEPROM and
updates the display (more on the
offset value later).
‘The third interrupt service routine
is triggered by a falling edge on pin 17.
This indicates either that the accele
‘ometer has switched between its wake
and sleep states, or that movement has
occurred. We are only interested in
the wake-to-sleep transition, so when
the interrupt occurs, the micro inter-
rogates the accelerometer to find the
source of the interrupt.
If the accelerometer has gone to
sloep, the firmware turns off the dis-
play and puts the microcontroller to
sleep too, configuring it to woke up
only when a new interrupt occurs on
pin 17. This happens only when there
is further movement that re-awakens
the accelerometer.
‘The final interrupt service routine
is invoked when the user presses and
releases the calibration switch button
(61). This routine zeroes the display
and stores the current angle as the
olfset value in the micro's internal
EEPROM memory.
This allows you to compensate for
‘any imperfection in the alignment of
the mechanical axes of the accelerom-
eter relative to the case. It’s unlikely
that the accelerometer IC is perfectly
Everyday Practical Electronics, March 2013Constructional Project
aligned with the metal case (due to
both misalignment between the IC and
PCB, and the PCB and tho caso) but this
can be compensated for to give a zero
reading on a perfectly level surtace.
Power consumption
In sleep mode, the micro draws less
than 100nA and the accelerometer
only 141A ~ amazing considering it
fs still measuring acceleration and
checkin: for movement. In use, the
inclinometer draws around 50mA,
most of which is consumed by the dis-
play. With moderate usage therefore,
the two 1.5V AA batteries should last
many months.
The Digital Spirit Level monitors
the battery voltage and when it falls
to around 2.88V, lights one decimal
point on the display to indicate that
the battery is low. Since every pin on
the micro is used, we had to resort to
«a clever trick to monitor the battery.
‘The ADC of the microcontroller is
configured to measure a fixed internal
1.024V band gap voltage using the sup-
ply voltage as the reference, This is the
opposite of the way we would normally
do things and means that asthe battery
voltage falls, this measurement actully
increases. It's nota linear relationship,
Fig.3. install the parts on the PCB as shown on thi
the two 10pF capacitors must be mounted on their sides
/out diagram. Note that
This prototype differs slightly from the final version shown in Fig.% (eg, Qt
is oriented differently and the hole for the battery leads has been moved
but itis more than adequate for detect-
ing a low battery level
Construction
The Digital Spirit Level is built on a
small, single-sided PCB measuring
just 100mm x 44mm. This board is
available from the EPE PCB Service,
code 889.
The topside component layout is
shown in Fig3. Surface mount IC1 is
soldered to the underside — see Fi
All components are through-hole
types with the exception of the acceler-
‘ometer (C1), which is ina tiny 16-pin
QEN (surface-mount) package. This is
the first thing you should fit. It takes
‘some patience and a steady hand, but
it can be soldered in manually.
First, carefully tin the pads. You
want a'thin, even layer of solder, so
‘use solder wick to clean up any bumps
or shorts between pads. Check very
carefully for solder shorts between
pads at this point, and fix them now.
Once the chip is down, you will not
be able to see the joints.
‘Now carefully place the accelerom-
‘eteron the pads, lining up the tiny pin
1 dot on its body with the correspond-
ing dot on the PCB layout. In addition,
make sure that the chip is properly
Everyday Practical Electronics, March 2013
{UNDERSIDE OF FOND)
Fig: the MMA84510 is mounted
on the copper side of the PCB, as
shown here
Left: a close-up
view of the MMA-
'8451Q in position.
Be sure to or
lined up with the pads on all four
sides. The small marks on the sides
cof the chip indicate the pin positions,
and these must be per‘ectly lined up
with their corresponding pads.
Once it’s fully lined up, you need
to melt the solder under each pad,
without moving anything.
Ifyou havea hot-air rework station,
you.can use this to gently heat the chip
until the solder reflows. If you don’t,
you need to use a soldering iron to
“apply heat to each pad in turn, all the
while holding the chip in place. The
{dea is to melt that thin layer of solder
you applied to the pads and to heat the
corresponding contact on the chip so
that the two bond. Take your time, but
try not to overheat the accelerometer.
Now use a multimeter to check for
any unintentional shorts between ad-
jacent pads. If there is a solder short
between two adjacent pins, you will
beable to remove it using solder wick
Topside board
Once the accelerometer (IC1) isin posi-
tion, the remaining topside parts can
be installed in order of height, ie, from
lowest to highest. Note that the MOS-
FETs (Q1 to Qé) have to be pushed
down so that they do not stand proud
of the 7-segment displays. Likewise,
the two electrolytic capacitors are
mounted on their sides (ie, with their
leads bent down at right angles), so that
they are lower than the display faces.
‘The7-segment displays are soldered
directly to the PCB. Make sure that
313
—© 9
‘5025 IMM ALUMINIUM CHANNE:, 2008 LONG:
Figs: the base is made from a 200mm length of 50mm x 25mm x 3mm aluminium channel, while the two end pieces
(right) are made from 44mm lengths of 20mm x 12mm x 1.4mm aluminium angle extrusion
ls
AIL DIMENSIONS NV AMETEES, ALL HOMES MM DUA COUNTERSUNI
END PECES. 20.12 1.44
IONG; TWO HEGURED
pl
“F
©
FRONT PANEL 197 44x MM RED PRSPEK
Fig.6, the front panel is made from 3mm red perspex.
easily. The back of the panel is sprayed matte black, except for the display window shown dotted
‘AL DIMENSIONS IN MLIVETRES
‘AL HOLES 34M DIA COUNTERSUNK.
and countersink carefully because the material fractures
Left: this is the
inside the case
before the PCB and
battery are installed.
‘The end pieces are
secured using M3 x
6mm countersink-
head screws and
M3 x 16mm tapped
metal spacers. The
Perspex front panel
(below) is spray-
painted matte black
‘on the inside, with
the display window
masked out
Everyday Practical Electronics, March 2013Constructional Project
‘The PCB is mounted inside the case on four M3 x 6mm spacers and secured
using machine screws (pan head on top, countersink head through the case)
thoy sit flush with the board surface
id that they are oriented correctly
(ie, each decimal point at lower right).
Board check
Having completed the board assembly,
attach the battery holder and insert @
pair of fresh AA cells. If everything
is working correctly, the display will
show four dashes while the PCB is
face up.
‘Nov slowly tilt theboard up toverti-
cal with its long edge on the bench and
check that it displays an angle within
1 few degrees of horizontal (ie, just
‘above 0.0 or just below 360.0). If that
checks out, hold it perfectly still for
about 30 seconds. At the ond of this
period, the display should go blank as
the device falls asleep. When it does,
siveita firm shake to wake it up again,
Finally, check the calibration button
by positioning the board at an angle of
2 few degrees and briefly pressing the
calibration button. When the button is
released, the display should read zero,
‘Troubleshooting
If there is no display, check that the
‘component values and orientations are
Mo x MM CK SCREW
Jf
correct. That done, visually inspect
the solder side for bad joints or sold
shorts. If that looks OK, use a mul
meter to check for 3V on the micro’s
supply pins (ie, between pin 2 and pin
20), and check thet the MCLR pin is
pulled high.
If you have access to a scope or fre-
quency counter, check for sms pulses
repeated every 20ms at the gates of
the MOSFETs. If these are present,
you can be confident the micro is
operating.
Ifthe micro is working but no angle
measurement takes place, the prob-
Jem probably lies with the soldering
of the accelerometer. In that case,
romove the battories and inspoct your
work with the aid of e magnifying
glass. Since you checked for shorts
earlier, the most likely problem is an
open-circuit pin, so carefully resol-
der each one using a fine-tipped iron
and applying very small amounts of,
solder.
Basically, you want the solder to
melt and wick up under the chip. If
you inadvertently apply too much
solder, use solderbraid to remove
the excess.
MO x MM MACHINE Sc
Housing
‘We made the housing from
of 50mm x 25mm x 3mm aluminium
channel (a standard extrusion that
should be available from your local
aluminium centre). The end pieces
are also aluminium extrusions, this
time 20mm x 12mm x 1.4mm angle
extrusion.
You will have to cut and drill the
aluminium as shown in Fig.5, takin:
care to do-burr all the holes. If you
wanta form factor more skin toaspirit
level, you can cut the 50mm channel
Joncer than shown, so that it extends
out either side of the end-pieces.
‘The front panel is a piece of trans-
lucent red perspex, cut and drilled
according to Fig.6. Keep the protec-
tive film in place as long as possible
to avoid scratches. The inside of the
perspex is spray-painted matte black,
after masking off the rectangular sec-
tion that will be directly in front of the
LED displays (see above photo)
‘The best way to make this mask is
to first peel off the protective film on
the inside surface and then cover the
central section (ie, where the display
window goes) with masking tape.
= cr
larcaces,
AWM “fg
: if
aes.
ssembled int
0 EMM SPACER
Fig this crossscton disgran shows how the Digital Spirit Level its case. The battery holder is
in place with foam-core double-sided tape
Everyday Practical Electronics, March 2013 Bnstructional
Project
The Freescale Semiconductor
MMA8451Q is a 14-bit 3-ayis acceler.
meter witha builtin DSP ( to 0 ): CRGPLLEND in
the config register CONFIGIL to 0 to
seat he EL od PLLDIV ate in
config register CONFIGIL to 110
to divide the @MHz signal down to the
required 4MHz. Finally, PLLSEL, in the
Coli ester CONFIGSH must be Oto
use the 96MHz PLL output.
‘OSCOON no loser controls the speed
of the clock, so this register no longer
needs tobe explicitly st in our software,
Config changes
Al of these changes consist of values
set in the CONFIG registers this should
come as no surprise, because until the
clock is running we cannot execute
30 how eould we set
oblem is
solved, of course, by specify the con-
fic ister values usin: the CONFIG
command in our source file, which the
amor wil pick up and write
Sirectiy into the Flash-memory-based
CONFIG registers. To find the appropsi-
ate CONFIG commands to use, we had
to took back in the ‘PICL® Confs Set-
tings’file within MPLAB's help system,
Re config setting changes Sook like
CONFIG OSC = INTOSCPLL
CONFIG CFGPLLEN = ON
CONFIG PLLDIV = 2
CONFIG PLLSEL = PLL96
When these wore made and
the code was built-and loaded to our
cll the LED flashed sixes iste
= batalla we hadnt
“inerslos vu inour ter configure
tion code. Good, Weare now runnin ata
clock rate of 48MHz rather than 8MHz!
‘How has this affected our current con-
sumption’ With the LED oft, the current
Gonsumplion hes sent mA even
though the CPU is not running (is in
IDLE mode mos ofthe time), the higher
clock spood has increased our ‘standby
current by a iactor of three. But what
would the current consumption have
‘been if we were just runnin’ around in.
an idle loop rather than puttin the CPU
to sleep? A cuick code chan e to tem-
ly remove the SLEEP instruction
reveals all 12.7mA. So now, the use of
IDLE mode when we run a fill speed is
saving us 6.1mA.
5.5mA is, however, a fairly poor cur-
rent to be drawing if you are running off
batteries. Bven if you were to use expen:
sive 2000mAh AA cells, they are only
going to last 363 hours ~ 15 days. For
tunately, we can do better, much better!
Low:powor oscillator
‘The key to reducing the current con-
umption i to uso secondary oscil
connected, rather strangely, to
the Timer! module This oscillator has
been designed specially to work with
tuning fork’ styl crystals, and
operates at a very low power.
!
Notmal. microprocessor crystals are
thin rectangular slabs of quartz with
58
Fig 2. Micropsoces:
Sor crystals
é
g conductive costing on either side
iternating voltage to the
Conductive plates causes tho crystal
to vibrato, which in tum genoratos a
voltage. As the crystal oscillates at its
wena feguanc, the oslator
fctively ‘latches on to" this frequency
rather riba ing around
Watch style crystals are cut diffe
ently, as miniature tuning forks. These
tiny forks resonate at a much lower
frequency — the most commonly used
froquency be! 32.768kHiz - bat more
sigilicantly, they require a much lower
clrive level to et them to work, (infact,
i you over «ve thom they will beak,
ich has happened to uson more then
fone occasion!) Watch crystals are typi-
cally supplied ina distinctive tube case,
fas seen on the let in Fig2, and in Fig.3,
‘where the outer tube has been removed.
eo gts Tach on, fa
resonant ffequency and. develop
2 strong enough signal 10 feed the
Fig.3, Inside a watch crystal
rmicooaaiollr~ it can be i the or
diode of tilioocands, Uclos you i>
tend totum the osclator of rtuent,
this is not scnous tues The tbat
sroblem tobe aware ofis that the circuit
{rout raporant~ wires betwoon the
CPU an tne two series capacitor rst
seed
ede latogs choad and ad ewatch crys-
ene eT
fo he eure a be
faba atid ote intl RC ee
tarts ttwatoap and inthe
oo tea
but ne eal ‘shut down ts is. oc
eens
Justrun the ner trom the 22k crystal
‘updated cea taper choin
Purana rel aga
Software changes
‘The watch crystal oscilletor is tied d=
rectly to the Timer1 module, so we will
chance the software from’ usin: the
‘main sysiem clock with Timerd as the
‘source for periodic interrupts to Timert.
Fig 4, Revised circuit win watch crystal
Everyday Practical Electronics, March 2013Fig.5. New breadboard layaut
‘The first ‘gotcha!” that comes with
hanging to Timer! is that its interru
flog and enable bits are in the periph-
eral interrupt section, resisters PIRI
and PIE1. The technique required to
enable interrupts is the same ~ clear
the IF ag, the et the ag bt you
‘must also en ‘pheral interrupts
by setting the PELE bit in the INTCON
rogister. Next, we need to configure the
‘Timeri control register TICON. It’s a
single 8-bit register and the required
settings can be guessod at (we got it
ton the second attempt).
e main question was what to set
the pre-scaler to. As Timert is a 16-bit
timer we can leave it as 1:1 ~ then the
timer will overflow once every two
seconds. Instead, wo will pre-load the
timer with a value of 32767, which
will cause the timer to overflow and
ur interrupt to trigger once a second.
Sou can se the fil source listing in
Figs
funning this code on our board gave
tho same functionality, but as expected,
signiticantly lower current consump-
tion — down from 5.5mA to approxi-
mately 60uA, Qne hundred mes lower,
meaning, our battery lite
fom 18 days to over yesrs al or
addition of ‘three oe
Dons costing. les
than
‘is significant
reduction in ‘sloop’
power — consumy
fon is due to the
eiience in design
ew
{al oscillator exim-
ae te So
clock oscillator, as
8 watch crystal re
ites significant
{tas power to make
it oscillate “Sloep’
‘current, of courso,
is not the only factor to consider when
ddotorminine battery life, but as the ap-
to desi. i» low-power projects
fs about maximising the time spent in
‘sleep’ mode, the less power the device
consumes in sleep moxie the beter.
‘This circuit can now do something
the Arduino or Raspberry Pi can only
‘dream of - run off batteries for months
at a time, Although it doesn’t do any:
thins, use/ul yet, we have the basic
foundations with which to build on.
Fig.6. Source code isting
Next month, we expand the low-
power sleep mode to turn the function
ality into something really useful ~ a
real-time clock.
‘The software for this month's article
‘can be downloaded, as usual, from the
magazine's website at www.epemag3.
Suitable watch crystals suppliers are
Farnell part number 1652575, and Me-
plins part number Ujo2C.
Coase
basen AB cceo 2
www.cbus-shop.com
certs rei
ee)
Eeupens
nts ater Te
Everyday Practical Electronics, March 2013
‘Sorting out your bits and pieces? Check out our E-shop...
«Wie offer components. modules its. Led lighting. musical
stuf, Industral, Contract design, device programming,
short-range radio, slentiic tems. and some rely weird tng!
And if we don't have what you need..et us know.
wa ust might add it,
[COAST ELECTRONICS
'B HOLWORTH CLOSE
‘BOURNEMOUTH
HIT GPF
“Yet01202 244309
www coastelect co.ukmonth we have a question
about flip-flop tri verim’ posted
on EPE Chat Zone by james
‘There are to man types of IK li fo
1) Kdge Teiggoned (eve or-ve ed0)
2) Pulse Triggored (Master Slave)
With edge-triggered flip-fops, the
data is transferred tothe Qand Q-bar
outputs on ave ori clock ee
With pulke-triggered flipslops, the
data is transjecred from the J and K
npuis into the flip-flop on the ve
clock edge and then appears at the
Gand Q-bar outputs on the following
eos ad, 7a
1 see that edge-triggered fip-lops
are readily available in more modern
families, ag, 441C78, 741879 and In
addition the 4027, whoreas the 7473
{pulse triggered. I also see that
the 7476 is pulsectrlscered but the
741876 and P4HC76 ar both edge-
triggered,
Nf question ~ is it tue that the
pulsetrisecced flip lop imastesstave
fas phased out afer the standard 72
sores, and If 80, wh?
7 sead that for pulsetravered fip-
flops the J and K inputs must be hed
Stable during the full time of the sve
Clock pulse, ethervie it willafoct the
outputeae nols on the and K inputs.
FF pulsestrggered fipyfiovs wore
Phased out in newer technologies,
ould this be the reason?
We will look at the issue of ip-flop
triggering by strting with the baste
idea of « logic gate-based momory
circuit, and working towards the
circuitry used in the pulse-triggered
circuit james mentions. We will
mainly consider set-roset, rather than
JK circuits, because they are slightly
simpler, but the basic trizqerin
principles are the same.
In this discussion, it is useful to
make a clear distinction between
latches and flip-flops. A latch is a
memory circuit with outputs which
‘may update (chance) as a direct result
of changes on inputs other than the
clock (indeed, it may not even have
a clock). The outputs of a flip-flop
always update under the control of the
clock. The precise manner in. which
this clock-control happens gives us
the difference between pulse and
edge-triggered flip-flops, as mentioned
by James.
60
/GIRCUIT
Flip-flop architecture
Latches or Flip-flops
This distinction between latches and
ilip-lops is widely accepted as a useful
concept, but it is far from universally
adhered to, and probebly does not date
from earliest development of bistable/
‘memory circuits. Under this convention,
tho well known set-reset circuits
Shown ltr in Fig and Fig must be
called latches; although they are quite
commonly referred to as flip-flops (we
will describe their operation in. more
detail soon). If you are interested in
the controversy/confusion surrounding
flip-flop terminology, then have a look
at the talk page of the flip-flop entry in
Wikipedia at: en.wikipedia.ony/wikt!
‘TalleFlip-lop (electronics).
Having got past these preliminaries,
we ean et to the basics of how alateh
or flip-flop memory works, Think of
two inverters in series (se0 Fig.1). A
in vives @ 1 out and 0 in ives @
0 out. Now consider what happens
when we connect the output back to
the input, wo create a feedback loop
circuit with no input (see Fig.2)
‘There is no conflict in the loop since
the logic determines that both points
Aand C from the original circuit are
at tho samo logic level.
Fig. . Two inverters
If point ‘A’ is somehow made 1, it
will stay at that level indefinitely (as
on: as power is applied). Similarly
if we set ‘A’ to 0, it will stay at
This ability to indefinitely hold one,
of two possible states is the basis of
the memory used in latches and fl
flops.
memory function provided by
the circuit in Fig2 is not particularly
useful as there is no input by
which it can be given a stete to
remember. There are a couple of
j¢ approaches to achieving thi
t, we can break the loop using
switch and employ another switch to
connect the input; this epprosch is
‘commonly used in CMOS technolocy,
where the switches are implemented
using transmission gates. Second,
logic gates can be used to modify the
1o-icof the loop in order to enable the
state to be set, this approach is used
in TTL technology and is therefore
‘most relevant to james’ question.
Fig 2.An inverter loop. the basis of latch
‘and tip Nop memory”
The circuit in Fig.3 replaces the loop
inverters of Fig3 with two NAND gates.
If nt = In2 = 1 the circuit is equivalent
to the two-inverter loop and hence will
exhibit the same memory capebility
However, if one of the inputs is 0, then
the output is forced to either 1 or 0
imespective of the previously. stored
value. fini = 0 and in2 = 1,an output of
Oisgiven. Thisis retained (remembered)
‘even after Int returns to 1. Int =1 and
In2 = 0, an output of 1 is given. This
rejainned when In2 retums to 1.
“D=pL
Fig.3. Set-reset aich
Set-reset latch
‘This type of circuit is called a sot-ros0t
latch (SR or RS latch) and its circult
{s often drawn in the form shown in
Fig. A 0 input is used to change the
latch’s state ~ the sot and reset inputs
are ‘active low’ ~ hence the bars drawn
‘over them in the diagram.
“The output of either gate in Fig-4 may
be used: they are complementary and
we eer cere
if we set both inputs to zero then both
outputs will -0 to 2, which will break
the definition that’ the outputs are
complementary. We are not relly using
the latch correctly in this case and this
condition is commonly referrod to as an
{llogal input. Taings goteven worse ifwe
retum both inputs (0 1 simultaneously,
because although the outputs will
return to a complementary state, their
factual values are unprodiciable,
Fig.4. NAND set-reset latch circuit and
symbo!
Everyday Practical Electronics, March 2013If we connect two NOR gates in the
same conficuration, we set an SR latch
with ective-high inputs (see Fir.5).
Fig.5. NOR set-reset fetch circuit and
symbol
Digital circuits often have a clock
signal to coordinate activity (more on
this later); however, the SR latch does
not use a clock to tell it when to store
the data. We can modify the circuit in
Fig.$ to add a control (or clock) input,
C, es shown in Fig. When C=1 in
Fi.,6, the circuit operates as an SR
latch (with set and reset active high).
When G=O, both of the inputs to the
cross-coupled NOR gates are at 0 and
thoroiore inactive. ‘The latch will
rotain the state ithad when C was last
at 1. The latch is enabled when C=1
and disabled wh
Fig. Setreset latch with control input
and symbo!
The SR latch (controlled or not)
uses separate sizuals to store 1 or 0.
This is often very useful, but it is not
convenient if wo want to store the logic
level ofa particular signal (data line). To
overcome this we can make data latch
from an RS letch with the addition of,
extra gates, as shown in Fig7.
‘Transparent data latch
With the circuit in Fig7, whan we want
to store the state of the D input we make
Chigh. When Dis 1 the input ofthe SR
latch is sotto 1 and the Ris sotto 0. This
results in a 1 being stored and output at
Q. Similarly, ifD is Othe SR ltch is reset.
When Cis is the Q output follows the
value of D, ie, if D changos while C is
high, s0 does Q. When we take C low
both inputs of the SR latch are forced
low and D has no influence on Q. The
latch eraernuars the ast value applied to
DwleCwasat a
‘A memory circuit whose output is
either the sored value, or follows the
input, is called a transparent latch. The
SR latch in Fig 6 could also be deserived
as transparent because, like the circuit
in Fig7, the inputs directly influence
the outputs when the clock is 1.
Fg.7. Transparent data latch and symbol
Larger, digital circuits typically
comprise seis of memory elements
intetoomnosted via locks of
combinational lozic, as illustrated
in Fig8. Tho purposo of the clock is
to control and coordinate changes in
the circuit by determining when new
values are loaded into the memori
Thus, the next value stored in
memory will depend on the cu
values of other memories, the main
inputs of the circuit and its own
current value (if there is feedback in
the circuit)
If we @ circuit using the
latches just described, then when
the clock changes to 1, all the latches
become transparent and may change
their outputs. These outputs are
connecte sates to other
latches, which may therefore receive
new values at their inputs before they
have responded to the original ones.
In fact, multiple changes could ripple
throuch the transparent latches,
leadin: to an unpredictable outcome.
Clocked ciroults
The latches we have described are
therefore very «lficult to us» when
building larger clocked circuits. What
wwe need is situation where the clock
causes all memories to update only
based on their currently prevailing,
inputs and then locks out any further
‘updates until the circuit has settled in
response to just this change. To do this,
‘wo neod to prevent the memories from
fever becoming transparent. The clock
needs to be the sole moans by which
the output change can be triggered. We
can achieve this by using two latches
in series with opposite clock polarities.
plinsider the circuit
is transparent and 12 is holding dat.
When C=0, Lt isholding data and 12 is
transparent. Thus, the circuit asa whole
is never transparent; one latch is always
hholding when the othoris transparent.
‘When C in the circuit in Fig.9 is 1, La
will spond to the current state ofthe R
‘and $ inputs, but this will not affect the
‘outputs because L2 will be holding the
‘current stored value. When C changos
from 1 t00, La will hold whatever state
it is in at thet point end this will pess
‘through to the outputs as L2 becomes
transparent. During this time, Li is
holding, so it does not respond to R
‘and S. Thus we see that R and $ never
directiy change the outputs and we
‘can, in accordance with the convention
‘stated earlier, call this circuit a flip-flop
(rather than ¢ latch).
‘The circuit in Fig is referred to
as a master-slave flip-flop because
the value held and output by L2
(the slave) is controlled by L1 (the
master). The circuit is described as
pals triccoed because the update
rocess requires a pulse to lovic 1 on
the clock, On the 0 to 1 change of ©
1¢ current values of R and S set the
ate of Lt. If we assume R and $ do
not change when C is high this value
will be transferred to the output when
C changes from 1 to 0. The fact that
the value captured at the start of the
clock pulso does not appoar until
tha end of hn ala sara to a8
‘8 postponed output. The ] symbols
hint (othe fip-lop’s outputs on the
schematic symbol indicate that it has
¢ circuit in Fiy.9, when C is
2, 1 regponds to every chance on K
ifR pulses
1 (sot) and
condition
will be forgotten, even though it
occurred within the current clock
pulse on G. This behaviour is termed
‘ones catching and is potentially
problemetical when building lerger
Circuits with this flip-flop.
Consider Fip.8 ovain, assuming the
‘memories are the circuit in Fig.9. The
inputtoM4comes froma combinational
logic circuit (CL2) ~ assume this input
is Mé’s reset and that the set is not
shown, The memories connected to
CL2’s inputs will all change at more
or less the same time when the clock
updates all the memories (on its 1 to
Vand Cof L2 is 0, so L1
Fig8. Simiied, goner-
‘ised -soquential. loge
it comprising clocked
‘memories (M) and com-
bination logic (CL). Every
‘memory is coniroied by
the clock, but or simply
iris isnot shown
Everyday Practical Electronics, March 2013
61Fig.9. Pulse-triggered master-slave set
reset tip-lop and symbol. Note the post-
een ermeens oo Fel ee
5
© transition). Unfortunately, when
‘multiple inputs to a combination logic,
circuit chense simultaneously the
cireuit’s outputs may produce glitches.
Glitches
Glitches are caused by unequal
delay paths from input to output.
For exemple, assume CL2’s output
is currently 0, with in input of, say,
0011. Then assume the input changes
to, say. 0000, so two inputs have
chanced. Also assume that CL2’s
truth table gives an output of 0 for
both these input combinations (0011,
and 0000). The change on one of the
inputs may, vie a short path through
the lozic cause the output to change
191 alter a short delay: however, the
other input change may take longer
ropagate through the circuit
resulting in the final output of ©. Thus
the output pulses to 1 temporarily
before setlins to the correct value.
ult the scenario ust described, the
ip‘lop in Fig. may ‘catch” the
glitch and reset, despite the fact the
tuo input value is 0 and no rosot
should have occurred. This leads
to the requirement, stated in james?
‘question that ‘inputs must be held
stable during the full time of the
+ve clock pulse.’ This condition
is hard to achieve and is indeed a
sood reason for pulse-trigered fip-
ops becoming obsolete. The term
‘glitch’ (the situation just described)
Fig.10. Negative edge-tniggered master-
siave D-type flip-flop and symbol
is generally more ay propriate ‘than
see tae conteee but fame?
description is basically correct.
The old 7476's circuit is lar
to tne one in Figo. Tt hes come
shane at fo inloment he
behar nut Fi:.9 is adequate to
under: ‘its basic operation and
shortcomings. Incidentally the JK flip-
flop overcomes tho probloms with all
the SR circuits we have shown in this
article — the illegal condition when
bot and rast are both active and the
tnprodigible behaviour if they both
from this state together — the
JK adds a useful toggle action instead
of the illegal stat
(Gonlder the cic in Fig, where
the latches ae both ofthe Spe shoes
in Fig7. As with the circuit in Fig.9, fC
‘L1 is transparent and L2 is holding
dle end when Ce 0 Li balding
sine Le nepentgin t
cir ae whale lo ever tanapaent
‘and similarly the D input never directly
causes the outputs to change.
When €in ig 10 change om 10,
La stores ihe veus const on. of
Lill be Relea hi san ee C=
0. is tangparnt
erciore the valio just stored by
ii atthe circuit's Q output.
This val wil nt change FD changes
because 1 is holding, When C chances
back to 1 the value of Q of Lt will be
stored by L2. As the output was already
equal to Q of L1, Q will not change. The
110n G also makes Latch 1 transparent,
allowing any change on D through to Q
Fig. 11. Positive edge-tiggered TTL D-
{ype fp -fop which does not have a mas
ter-siave structure
‘of L1. This brings us back to our starting
point: a further change from 1 to 0 on G
‘ill load a new D value into La.
Edge triggered
‘The stored value and hence output of
the circuit in Fip.10 is only influenced
by D when the clock changes from 1
0.0. For this reason, it is described as
being negative-edge’ triggered. On @
{lip-fop circuit symbol a small triangle
{is placed at the clock input to indicate
1s on are Negnv (1 0)
edketrssored flip.
“theron ce at he Geek inp a
in Fiy.10.
‘This circuit in Fig.10 has the same
tasersavestnucturasthatin Fig, bt
is edve rather than This
other potenti confusion sn fp
flop terminology where ‘mastersiave’
‘and ‘pulse triggered’ are sometimes
assumed to mean the same thing. The
traditional TTL edgestriggered flip-lop
has a different structure (60° Fig.11), but
circuits like that in Fig10 are widely
‘wed in CMOS echnoogy,
Bdge-tzsered flip-flops, however
structured, donot sue fromthe
‘catching’’ problem of ‘pulse-iggered
circuits. Therefore the consis on
when their inputs have to be stable
fare_much less. stringent. In
their inputs must be stable for @ shor
tig (etered to as the stp end eld
to as the setup
times respectively). Edge. trigsored
{lp-fops are immune to jitches from
combinational logic blocks as long as
these are finished by the setup time (ie,
just bolore next clocked)
EVERYDAY PRACTICAL ELECTRONICS
Stewart Kearn on 01202 880299
Crea
[email protected]
6
Everyday Practice! Electronics, March 2013Get the
MAX |
with the
MINI
Replace your DIP40 MCU
with a pin-compatible
MINI board and get up to
40x better performance!
Keep everything you love about 8-bit MCUs
in DIP4O packaging and get up to 40x better
performance. Our powerful MINI boards are
pin compatible with PICL8F45K2x making
them a perfect excuse to smoothly switch to
32-bit. Get used to having plenty of available
memory and lots of processing power. Each
MINI comes preloaded with a fast USB HID
bootloader, so programming is as easy as it
gets. Try it out for $29 only.
[[] MikroElektronika
DEVELOPMENT TOOLS I COMPILERS FBOOKS
fast
slow
www.libstock.com
bootloader
{ Insive
40x
MINI-M4 for STM32
contains STM32F415RG (ARM Cortex” M4)
bootloader
CO insive
MINF-32
contains PIC32MXS34F064H
bootloader
INSIDE
25x .
MINI-M4 for Stellaris
7. 1x
PICL8F4SK22
GET IT NOW
www.mikroe.comee ey EVERYDAY PRACTICAL
EXFESELECTRGMICS
EPE Magazine
can now be downloaded at
PocketMags.com
or download the app for
your iPad, iPhone, iPod
Touch or Android phone
ics Technology &
Electron 2 worldwide
ine for
UK magazine meiata downlo
now avail
The No | i
Computer projects !s
* Each individual issue costs only £1.99
TEN * 6 Month Subscription £9.99
. * 12 Month Subscription £19.99
& (just £1.67 an issue)
=
Download Now
and have EPE at your
fingertipsSUPPOSE it varies from one project
to another, but once you have
‘mastered the basics of solderin
and have become familiar with the
main electronic compon
construction methods, the
side of project construction is often the
relatively easy bit. Obviously. there
are exceptions, which are mainly the
very large projects and the tiny ones
that pack ‘a quart into a pint pot.
‘The very large projects are relatively
pn doves:
‘ 16.5tanthmete stings and sting manipulaton
1 Puss cl modclaton
sec
Features include pane! creator, cveut debug
etal networks. © code customieston.ftng
pom and new corporents. The HoboysvStudent
‘estan llega 8K o code (8 on TBF devcss)
£58.80 ine Var
‘8150 plus VAT
TINS ea9 plus var
DANII 2999 plus VAT
£199 plus VAT
$599, plus VAT
eg9a plus VATCIRCUIT WIZARD
Circuit Wizard is a revolutionary new software system that Vorsion2inclvaes
combines circuit design, PCB design, simulation and CAD/ ey
‘CAM manufacture in one complete package ‘Supplements
Two versions are available, Standad or Professional (GE Ar tan,
By integrating the entre design process, Creut Wizard provides you with all the focks necessary to
produce an elecvoncs projec rom star © nih - even ineuding an sereentestng of he PCE prior
to constructon!
(© CPE PIC Tonia V2 compete series ot
+ Grout cagram design with component trary (500 components ‘ries amonaralo sore.
Standard 1500 components Protessona) ‘loncos apr hay eo
+ vital nsruments (4 Standaro, 7 Protessiona) © eo nas Ka Nana
ee i z ‘construction detads), John Becker,
* Onsereen animation
cao
© PIC Took TH for Windows
{cota Stal) Jon Becker
Now ot
Plus 18 usetu! texts to help YOU get
thermos! auto your PIC programming
Paice 14.75 ne VIC
+ imeractve orcut iagram smulaton
+ True analogue digital simulation
+ Simulation of component destruction
* PCB Layout
* Interactive PCB layout simulation
Automatic PCB routing
+ cerver export ee toy
+ Mut lve! z00m (25% fo 1000%)
* Mute undo and reso Aah, gut
* Copy ana paste totner sofware 20 pg imeoes,
+ Muito document support eae
The wectonl
This software can be used with the Jump Start and Teach-In 2011 series "2 sscuton WE
(and the Teach-In 4 book). aCe ———
Standard £61.25 ino. VAT Voning and edvatonal atonal Thay
Protessiona £91.90 inc. VAT Se oyaty tov iv use n commetcal ot
Berm pete poe can 0
‘mapas nites tr wel a2 wordude
‘Reo pages subject torestichone see
“ener wi ets)
‘Nom conias fan View mage solware
toh Windows ih gocksta nots
luge
Please send me: CD-ROM ORDER FORM
GS ferte'Serea Plemero va
5 Floweede tor Picmero V3 (DOWNLOAD + COROM) —, “4
5 Foweode fr Plemcra v5 (DOWNLOAD ONDH) econ eicedd
Flowcode for AVA V5 (DOWNLOAD + CORON) Eigebayavountent
Flowcode for AVR V5 (DOWNLOAD ONLY) Econ
Flowcode for ARM V5 (QOWNLOAO + COROM) d Erolesslonal 10leser
OD Flowcode for ARM V5 (DOWNLOAD ONLY) Bate
5 Floweede for dsPIC'¥s (BOWNLOAD + COROM)
5 Floweede fo dsPlC V5 (DOWNLOAD ONC)
1 Floweede fr PiC2s V5 (DOWNLOAD » CDROM)
S Fottads fer leas (@oWNLORD ONLY)
low
Pca £18.95 nc VAT
lai iey
rem eat ag
Porat
Username:
ee: tester on cach voor ete see. ee
5 Picmicro Development Board V4 (hardware) ~ currently unavailable. Professional, Mutiplo User and Sito License
Versions overseas readers gd oe base
prea ofeach rr for arma postage (do not
96 VAT unless you two in a9 EU [Evep0a9
Une) counry thon aaa VAT at 20% r prove
your tea VAT registration ramen
A Chreuit Wizard - Standard
5 Circuit Wizard - Professional
SEPE PIC Resources V2
Electronic Components Photos
trae eae
raven : Sreteastes
suring a
bee ren aos Tt 113 Lynwood Drive, Mere Wimbo
1 Signature; Dorset BH21 1UU
; pica
| otererecene Fin soy pate WHORE PUBLISHING Dm mater ete ae
1 Please charge my Visa Mastercard’ Maestro; ©
Card expry date
‘Soca re nora Set wn seven dys
Maestro lssue No.
(Prete 9.29 on jt rae we gree
‘www.epemag.com
n Everyday Practical Electronics , March 2013fel worn
by Alan Winstanley
Pocket the best! wl
EGULAR readers will know that some mejor
civanges to our online presence were underteken in
Jecember of lest year. A number of key factors gave
rise o the decision to retire the US-based website, which has
operated for about a decade, providing a PDF version of our,
‘magazine to subscribers. In addition to copyright concerns,
the server was hacked @ number of times during the second
half of last year, perhaps through a server backdoo
The team in the USA behind £PE Online, Alvin Brown
and his colleague Clivo (‘call me Max’) Maxfiold, wore
introduced to £/°S Magazine in the 1990s when we stumbled
upon each other while I was surfing the sci.electronics
Usenet newscroups. on a DOS-based newsreader in my.
case, in the days before the world-wide web. (The Usenet
database was ultimately absorbed into Google Groups.)
We met up in England and jointly went on to produce the
PhizzyB computer simulator or Beboputer, based on Max's
brilliantly-written book ‘Bebop Bytes Back’ and it featured
on £PE's first-ever cover CDROM. We have worked closely
together as a team and remained cood friends ever since.
'EPE Online was built from the cround up without any
precedent to refer to, at time when not even a suitable
online payiment platform was available in the UK, so EPE
Online was pioneerin: work in a number of ways. Many.
readers have sung Alvin's praise for customer service, and it
is thanks to Alvin's endeavours at the helm, with web guru
Dean Hudson pulling the levers on the servers, that FP
Online has been delivered to its readers around the world all
this time. Everyone at ££ wishes to thank Alvin, Dean and
Max for their tireless work in providing what we proudly
believe was the world’s first magazine that you could also
download from the web (from November 1988).
‘At the same time, we have introduced #5 to a new digital
newsstand pletiorm that enables us to share our enthusiastic
hobby with new readers on the
web. With the drive towards
realtime online access and
the trend towards mobile and
tablet computins as well, our
new online issue is being
handled through the PocketMags
platiorm, an internationally.
Connected service that offre
many magazine titles conv-
eniently under one location. By
logging into your PocketMags
account, magazine issues under
your subscription can be viewed
onscreen, ebook sy, but, you
can also ‘search and purchase
many other e titles as
well: Readers for PC, Mac, Kindle
Fire, Android, Apple iPed and
Phone, Blackberry Playbook and
Windows 8 are all available free Work on our new website is well under way, log on at www,
from PocketMags.
Everyday Practical Electronics, March 2013
‘epemag.com
‘A new Beta PocketMags reader allows the proprietary
file to be downloaded for accessing: when not online. You
ccan bookmark pages, select and print them, delete files off
your PC to save space and simply download them again
your PockotMs account when needed. I is pointed
out thet this beta program is still under development, and
tht Festa wecanes oa odback, Mora dt re
available at: www.epem vay-epe-online!
Many new subscribers have not come across our title
boiore and the addition to our readership numbers has been.
very encouraging, Welcome aboard! Many existing readers,
have also told us directly that they are enjoying accessin
PE this way for the first time, end they can check out other
tis onthe digital newsstand to, However, we know that
not everyone likes ‘when it happens.
chances were implemented in a i-ht timetame and there
{sno doubtis: that a number of EPE Online users were
vociferous in expressing their views. In today’s economy,
though, it’s just a fact of life thatthe best businesses have to
make tough decison fart, but we wil aay sive to ‘do
the richt thing’ by rea ing individually and offer
plous or ensne PE Online subocoar as area possible
Although we cannot pretend that we will resurrect the 1990s,
‘way of doing things, EPE Online subscribers are welcome
to contact [email protected] for personal
attention to their queries.
Far sited
In tandem with this transition, £PE launched the framework
of its now website. It is accessible at www.epemag.com or
(Same thins) ww.eperm co.uk. The static website
i sone int sla cf clan to oe ead re a
contents will be jed to support legacy issues of HE
magazine, It is being updated monthly by the writer, just
‘as it has been every month
without interruption since
1996, the year that Net Work
first appeaied,
‘A new Library is also boing
Duiltto host our source codesand
PCB files from the past 12
or 00, These les ere aed
available online, but until work
‘on the front-end of the website
is completed, readers wishing
to locate older files can send
f blank email to downloads@
‘epemag.cora. Our autoresponder
will send details of how to
download them directly from
the web. OF cours, if there are
‘any questions then we are just
fan email sway: contact details
‘are on the new website. Don't
forgot that the author's own site
at www.epemagnet hosts files
Bfiom the earliest days of EPE's PIC projects. While we ae fully
committed to the new platform, we know how readers value
zed collection of back issues, so we wil also be making
available EP Back Issue discs of PDFs for readers wanting to
‘maintain their own digital Library. Theso will bo available by
‘ail order and elso via the online shop as a matter of course,
accessible from our website.
E continues to make good progress in what are
challensins times ‘or the publishing: industry and the retail
sector as a whole. We have come a long way since our frst
small, home-spun website of 1996, and we hope that most,
readers will approve of our wish to continually evolve in
turbulent times and atract new reeders throush a dial
newsstand,
Herding cats
In December 2012's issue of Net Work, compared running
a home wireless network to the frustrations of trying to,
herd cats. In my experience, a home Wi-Fi network seems
to settle down for @ while until @ conflict of some kind
knocks one device or another off the network, which
gives rise to some re-configuring, setting up, re-booting,
frustration and general cursing at times. Previously, I've
recommended InSIDDER software from the heroes st
Motagesk (woonametagok.net) end thie essntial piece
of free software lets you observe any Wi-Fi channels
that are in use in your vicinity, so that you can at least
try to choose a wireless channel in the hope of reducing,
interference from neighbours. In my case, I'm presently
running on channel 13 (not suzzested ‘or the US), but
the page on Metageok (ww w.metageek.net/su -
channels-1-6-and-11) explang why they, hind channels
41, 6 or 11 are optimum fo ‘users. You can change
channel by logeing into your browser's IP address usi
8 web browser, and then aiming forthe router’ contro
panel to change the settin
Teseems that for many BT broadband 5, channel 6
{is confi: red by default, and sure enough a
WL-Fi network was using that channel, with another
neighbour using channel 9 instead. A useful whit
Optimising Wicless Networks is published by M
see: htp:/tinyurl.com further
IRtormation on WAT charset topelory cam be food at
hitp:/en.wikipedia.org/wiki/List of WLAN channels
oe.
wifi, “
ee
you BT ot Foncanone? Lagatew Fine
os
Nox BT Btn Foctone Byte
hour day Sdays 30days
850 6 as
= = =
Thevoréstgenwfnewert
BT wil offer to sell local WF! hotspot access to non-BT-FON
customers
T've noticed how those surprisingly powerful BT
Home Hubs oom to be everywhere. Sniff arovnd on
the local networks I thought it unimaginable that BT
would ofier a Wi-Fi hotspot in my location, but when I
tested an unsecure open network thet seemed 10 hi
from a BT Home Hub, I was surprised to be greeted by
a BT webpace offering to sell me BT hotspot access.
Where did the Wi-Fi access come from? BT Fon is BT's
“4
Wi-Fi hotspot network, consisting of BT broadband
customers whom BT states ‘share @ small portion of
their home broadband with other BT FON members. In
return, users get free access to millions of other member's,
Wi-Fi Hotspots around the world’. An interactive map of
BT Wi-Fi hotspots is at: http:/www.bt.com/static/wa/wifiy
pagesiiindhotspots.html with BT FON access highlighted
in light blue. It appears not to zoom down to street level.
“To see what networks are available to you on a wireless
PC, in Microsoft Windows try right-clicking on the
network icon in the system tray, then :o View Available
Wireless Networks and see if an unsecured BT network is,
‘broadcasting nearby. You can then try to connect directly
to it, but if you try to open a web page a BT Wi-Fi hotspot
sign-up page will be seen instead. At this stage, BT Wi-Fi
aocess is granted sufficient for a sign-up to be made by BT
and for you to download the TAC: In order fo purchase, 2
MoPay page pops up and a text message must be sent from
your mobile phone to confirm, and an email from "FON.
‘Community’ is used to confirm an account, I cancelled
the sign-up and my laptops web browser got stuck in @
loop in protest.
‘A BT broadband customer's ‘home Wi-Fi hotspot’ is
automatically enabled and BT FON hives off @ portion of
then draw from other BT Wi-Fi hotspots wherever they.
may be, In my example, the hotspot access could only hav
come from a residential neighbour's broadband because
recoznised the SSID. It makes a lot of sense to distribut.
Wi-Fi access for the benefit of everybody this way, but it
‘would appear that @ portion of a BT user's broadband can
bbe resold to non-BT FON users at anything from £3.50 per
hour up to £39 for 4,000 minutes worth of access. ‘The re-
salo of Wi-Fi this way goes beyond the ‘mutually benoficial
club’ of BT FON users suggested by BT. Tim not sure BT
are aware of that.
es | a
mono OC CHOB
Hotspot access is shown in the light blue areas: its derived
from BT FON broadband wireless hubs
hope you found something of interest in this month's Net
Work, Readers can email me st elanGepemag.demon.co.uk
‘or write to the editor at [email protected]. Don't
forget to keep checking for the latest developments on our
new website at: www.epemag.com.
Everyday Practical Electronics, March 2013[aaa Ly
TEACH-IN 4
agree COM
ro gira oerancs ox te cen ete
Fy Sons anf cola Thee aur Pane TES
(rims acti evonest the sew Bosra
re oe meted 2 ROM cna he Me
Seibopgececronc hey pose
"Kouoane stescoptenl ve tw
fepsenggnovesormasconmorronn
sored
Seana hee eet
ee
Bo toenr aoe he
Secon cee ees
Seieteiceitena at eit
Heeoee neem ears
Sakis bere
Sear
2eaee sera CEEEEEB <5
‘Shows he eae! how wend capa oe tant
iene ereee perenne
Zoeeeroecesnes
Bowes revere
SS aeeens
aoe eee
pedicles Sime rs
Ronrecnestoote te
Serene
Speco cansmins
Srareoen ances
Sees.
‘pages EE
amonoes, gover cto maton
eo rae maa a ows Comets
Specenecenemenra
Seatemernremnernes
evecare neces
Somedeeeorermes
ioe ears ee ee,
oeerreacieneans
Peaster tere
‘eon mt nengec) Maly asthe act
[Sompaw Conte Foie tres Pogarmes n BASE:
iSite porimnntrarecaey
oucersomasace
hia phones A ce sats mean are
‘owng needle enpont sae
SienSetsta
Ter et Sete re Tate
Be ree earn
srt a eet meer
Sars ween cc's seve sors
“Asc cused are 29. PIC_N ix arch
Speraeg ee nd eee ae
imegeanlers Ants ut Spree sue
BeEseounrs et Pe mca oe
co nom ao cases le strat be
pe one FE att
Seer Es
ne crete WPLAD negated
oertipned Ene vida, Matte kts
feces rare Mente As
Mecho eat ete ty nt
Sean Sane Sa Coote
fae) emo Oe
SPECIAL BUNDLE PRICE £14 FOR PARTS 1,2 & 3
‘Sows proses ne a0 pg Tea 8
‘Shimon quran eas oes oyna ar
Fase sepa etn mn oe SOE
“hese vion = Pacey Soutig ome th
rate spec of erence etiam Ags 3
‘as et toe rae ro sh
Fai erent renoy Croniegecos pos
‘rar to cod ge usd yo ears OF
“tatoo coeercmnaCO OMe cm Corson
cles POF pu varan guse ey
‘Eve ater emacs a ender
ps ssa wen Tk era eter we se
Sion cea me leamir ten ph Pow
Si teins prt pare orb BE
neu ikon sconces neat
Teaming nyu st awh he eto
‘ip ots ra petomane ape! your compe
Sat not ype of mucove ats
‘aan he ay pes coved me U9 Widows
2 opemanion mats BCPietp or sce om mponeg
patomnantn reap sstupimar ac Feces
‘ne an he oes esa bag sta oy
Stack yourP re prapnm soe at Coane Rey
hos and PCa) pean sahara Spend
{ety sts and como maraars Oveoscg See,
‘Sper wih marnnge abot ag ie ets Sa
cloner Ga of dt ers and ig eb
‘ot erape
Grignponons guy Inewarefaray chasis
cera peta he mow common progamsicg
une tn vg aoe, nk
“Gestoe test ae eae 2 reno
‘co Noes an Pesan. Caprese
Everyday Practical Electronics, March 2013
oe 161 PIC tamay he CRE
gus fea’ ep bye enh
coo con EET css
‘rcomputng to pow yu nth wet
fewany cine soon Gora ove fa ooh
‘ile. We tng recenty wae ein you eat
retin Una Ss eres etd
‘geo Sad consi
DIRECT BOOK
SERVICE
© All prices include UK postage
‘The books listed have been selected by
Everyday Practical Electronics editorial
staff as being of special interest to
everyone involved in electronics and
‘computing. They are supplied by mail
‘order direct to your door. Full ordering
details are given on the last book page.