0% found this document useful (0 votes)
677 views152 pages

2006 07 PDF

Uploaded by

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

2006 07 PDF

Uploaded by

robert arhire
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 152

JULY/AUGUST 2006

£5.65

www.elektor-electronics.co.uk

™xHRKCQIy451 28zv+:=
Get your teeth into our 410+ page catalogue
jam-packed with over 780 new and exciting
products for 2006. Claw your way on line to
www.jaycarelectronics.co.uk/elektor and
request your new 2006 catalogue - it’s FREE!
You can purchase from us 24/7/365 through
POST AND PACKING CHARGES:
our secure encrypted system. Post and Order Value Cost Order Value Cost
£20 - £49.99 £5 £200 - £499.99 £30
packing charges are modest so you can have £50 - £99.99 £10 £500+ £40
any of 8,000 unique products delivered to £100 - £199.99 £20
Max weight 12lb (5kg). Heavier
your door within 7-10days of your order. parcels POA. Minimum order £20.

Three Stage FM Transmitter Starship Enterprise


Smart Fuel Mixture KJ-8750 £6.50 + post & packing Door Sound Simulator
Display Kit The circuit board may measure just 70(L) x 17(W)mm, KC-5423 £11.75 + post & packing
KC-5374 £8.95 + post & packing but it can transmit signals over a kilometre in the Emulate the unique sound made when the cabin
Features auto dimming for night driving, open. It has flexible power requirements, with 6 to doors on the Starship Enterprise open and close. It
emergency lean-out alarm, and a 'dancing' 12VDC input voltage (a 9V battery would be can be triggered by switch contacts, which means
display which operates when the ECU is suitable). It is quick to build, and fun to use. Kit you can use a reed magnet switch, IR beam or PIR
operating in closed loop. supplied with circuit board, electronic components, detector. Kit includes PCB with overlay, case, all
Kit supplied with PCB and all electronic and clear English instructions. electronic components and clear English instructions.
components with clear English instructions. • Recommended box UB5 HB-6015 £0.83 • Requires 9-12VDC
• Car must be fitted with air flow and power
EGO sensors (standard on all
EFI systems) for full
functionality.
• Recommended For all
box UB3 HB-6014 you Trekkie
£1.40 Tempmaster Kit fans
KC-5413 £11.75 + post and packing
Need accurate temperature
for a wine cooler or beer
Universal High Energy brewing heater?
Ignition Kit This project turns Battery Zapper MkII
KC-5419 £27.75 + post & packing a regular fridge or KC-5427 £29.00 + post & packing
A high energy 0.9ms spark burns fuel faster freezer into a wine cooler The circuit produces short bursts of high level
and more efficiently to give you more by accurately energy to reverse the damaging sulphation effect in
power! This versatile kit can be connected controlling the wet lead acid cell batteries. This improved unit
to conventional points twin points or temperature to features a battery health checker with LED indicator,
reluctor ignition systems. Kit includes PCB, make it suitable for circuit protection against badly sulphated batteries,
case and all electronic wine storage. A much test points for a DMM and connection for a battery
components with clear cheaper option than commercial units. Kit supplied with charger. Kit includes machined case with screenprinted
English instructions. PCB, case, mains plug & all electronic components. lid, PCB with overlay and all electronic components
Australian to UK mains adaptor required. with clear English instructions.
Use PP-4020 £2.95 • Suitable for 6, 12, and 24V batteries.
We stock an
extensive range of • Requires 9-12VDC
quality automotive power
kits Theremin Synthesiser Kit
KC-5295 £14.75 + post & packing
The Theremin is a strange musical instrument that was
Voltage Monitor Kit invented early last century but is still used today. The Beach
KC-5424 £6.00 + post & packing Boys' classic hit "Good Vibrations" featured a Theremin. By
This versatile kit will allow you to monitor moving you hand between the antenna and the metal
the battery voltage, airflow meter or plate, you can create unusual sound effects. Kit includes a
oxygen sensor in your car. It features a 10 machined, silkscreened, and pre-drilled case, circuit board,
LED bargraph that lights the LEDs in all electronic components with clear English instructions.
response to the measured voltage, preset • This product is also
9-16V, 0-5V or 0-1V ranges complete with available built and fully
a fast response time, high input impedance tested AM-4025 £29.95
and auto dimming for night driving. Kit
includes PCB with overlay, LEDs, all
electronic components and clear Battery Zapper Add-On Kit
English instructions. KC-5428 £17.50 + post & packing
• Requires 12VDC power If you are one of our customers who purchased
• Recommended box the original Battery Zapper Kit, buy
UB5 HB-6015 Requires 9VDC this add-on and upgrade your Zapper
£0.83 wall adaptor (Maplin to the full functionality of the
#GS74R £9.99). Battery Zapper MKII

Log on to
www.jaycarelectronics.co.uk/elektor
for your FREE catalogue!
410+ page
0800 032 7241 Catalogue
(Monday - Friday 09.00 to 17.30 GMT + 10 hours only).
For those who want to write: 100 Silverwater Rd
Silverwater NSW 2128 Sydney AUSTRALIA All prices
in PDS
Helping You Succeed
24/7
Technical
Support
Local Online
Seminars Programming

Authorised
Consultants/ Regional Training
Design Houses Centres

Expanded Local
Free Samples Technical
Support
Volume Pricing

Does your business need more support


and resources?
Successful organizations recognize the value of a committed to helping you succeed. In addition to our
strategic supplier relationship to help them deliver high-performance silicon solutions, Microchip provides
innovative products to their markets in a timely and a long list of support functions that reduce time to
cost-effective manner. Microchip Technology supports market and lower your total system cost. And we have
more than 45,000 customers worldwide, and we’re significantly expanded our local technical resources.

Use microchipDIRECT to:


• Order directly from Microchip, 24 hours • Place and maintain your order securely
a day, 7 days a week with a credit card from any network connection
Register or credit line • Assign a PO number to your order
today! • Receive competitive, direct volume • Create a unique part number for any
pricing on all devices item ordered
• Check our product inventory • Receive e-mail notification of orders,
• Order broken reels at steep discounts deliveries, quote status and more
• Use fast and inexpensive production
programming (now available)

www.microchip.com
The Microchip name and logo, PIC, and dsPIC are registered trademarks of Microchip Technology Incorporated in the USA and other countries. All other trademarks and registered trademarks are the property of their respective owners.
© Microchip Technology 2006. All rights reserved. ME156Eng/05.06
US!
e lektor
lectronics
leading the way

PL S UMMER
12 Hands-on Plus!
Colophon 6
The circuits and circuit ideas in this Summer Circuits issue are bound to inspire many electronics Hands-on 12
enthusiasts to pick up a soldering iron and build something nice for themselves. Here we provide
Looking for a Needle 14
several basic tips for assembling circuits.
GBPLC — Gameboy PLC 16
GBPLC I2C I/O Box 24
ElectroShack 28

16 Gameboy PLC
Alphadoku 140
Elektor SHOP 145
Sneak Preview 148
Here we present GBPLC, a PLC based on the
Nintendo GameBoy. Ready-assembled and
tested boards are available through a reverse Audio, Video & Photography
auction on our website! BBC Radio-MP3 for Seniors 30
DC-coupled Audio Amplifier 47
Hybrid Headphone Amp 54
Multimedia RIAA Preamplifier 126
Paraphase Tone Control 39
Phono Splitter 48
Simple Hybrid Amp 56
Slave Flash Trigger 50

24 I2C I/O Box Computers & Internet


Computer Off Switch
Expansion for Universal Interface
133
124
This add-on for the GBPLC offers suf- Hard Disk Switch 122
ficient I/O capacity to control roller
Multicolour HD LED 127
shutters, outside lighting,
SCSI Adapter 90
curtains, an alarm system,
the central heating system Serial to Bluetooth 108
and even more, possibly even Simulation Applets 119
remotely via TXT (SMS) messages. Speed Pulse Generator for PC Fans 134
USB Switch for Printers 37
Zigbee Switching for Remote Control 99

Hobby & Modelling


Bicycle Speedometer with Hub Dynamo 117
Binary Clock 68

28 ElectroShack Design for Märklin Light Signals


Intelligent Interface for 1 to 8 Servos
Model Railway Turnout Control
36
116
51
Photoshoot showing how to totally clutter a bed-sitter with electronics New KW1281 Interface 125
Preset Circuit for Servos 44
RC Servo Tester/Exerciser 32
RC Switch 128
Simple Slave Flash 53
Stepper Motor Controller 38
Tiny RGB 62
Tiny Simon 103
Volume 32
CONTENTS July/August 2006
no. 356

C IRCUITS 2006
Home & Garden Step-Down Converter Controller 34
Alternative Halogen Supply 111 USB Fuse 84
Automatic Range Hood 79
Call Acknowledged! 82
RF (radio)
Active Antenna 110
Direction Sensitive Light Barrier 45
Antenna Height and Range 55
Easy Home Remote Control 72
DRM Receiver Upgrade 131
Gentle Breeze 63
Harmonic Generator with Single Opamp 105
Hard-Wired Code Lock 97
Opamp VHF FM Transmitter 65
Laser Alarm 31
LED Phototherapy Unit 58
Test & Measurement
Mains Slave Switcher I 107
1-Wire Thermometer with LCD 70
Mains Slave Switcher II 134
Eight-channel Scope Input 80
Modulated Light Barrier 41
Electronic Torricelli Barometer 85
On/off Infrared Remote Control 76 Geiger Counter 130
Pipe Descaler 51 Increased Range for DVM 129
Presence Simulator 66 IR Remote Control Tester 33
Protection for Telephone Line 86 LED Thermometer 104
Slug Repellent 92 LM35 to ADC 98
Telephone Ringer 91 Multimeter as Lightning Detector 43
Temperature Sensitive Switch for Solar Collector 118 Optical Pulse Generator 95
Thunderstorm Predictor 109
Toothbrush Timer 64 Miscellaneous Electronics & Design Ideas
10,000x with One Transistor 113
Microcontrollers Audible Flasher Warning 89
84x48-pixel Graphics LCD 81 Automatic Windshield Washer Control 94
89PLC9xx USB Programming 46 Charlieplexing 77
Contrast Control for LCDs 86 Electronic Touch Switch 88
E-blocks = cheaper PLC design 59 Miller Capacitor 93
How to! Connect your project to the PC 123 Multi-Colour Flashing LED 83
Programmer Board for the R8C/13 114 Rear Fog Lamp for Vintage Cars 60
Programming the Propeller IC 58 Recycling Flasher Lights 74
R8CKey 78 SMD Crystal Adapter 87
Universal LCD Module 120 Thrifty LED Protector 67
Transcutaneous Electrical Nerve Stimulator (TENS) 49
Power Supplies & Batteries
Adjustable Current Limit for Dual Power Supply 61 Bold article title = PCB design included
Battery Saver 88
Driver for 20 LEDs 102
Earth Fault Indicator 75
Fuse Saver 35
102er Articles
High-voltage Regulator with Short Circuit Protection 101
k
Crac
Hyper-Simple Battery Capacity Tester 36
ha s more
e
no on
Low Loss Step Down Converter 112
Mains Indicator 52
ing le issue
Measuring Battery Charge 100
in a s volum
e)
Power MOSFET Bridge Rectifier 42
or a year
Quad Power Supply for Hybrid Amp 106 (
Subscriptions: Elektor Electronics (Publishing),
Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England.
Tel. (+44) (0) 208 261 4509, fax: (+44) (0) 208 261 4447
Internet: www.elektor-electronics.co.uk
Email: [email protected]
Rates and terms are given on the Subscription Order Form

Volume 32, Number 356, July/August 2006 ISSN 0268/4519 Head Office: Segment b.v. P.O. Box 75 NL-6190-AB Beek The Netherlands
Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161
Elektor Electronics aims at inspiring people to master electronics at Distribution: Seymour, 2 East Poultry Street, London EC1A, England
any personal level by presenting construction projects and spotting Telephone:+44 (0)207 429 4073
developments in electronics and information technology. UK Advertising: Huson International Media, Cambridge House, Gogmore Lane,
Chertsey, Surrey KT16 9AP, England.
Publishers: Elektor Electronics (Publishing), Regus Brentford, 1000 Great West Telephone: +44 (0)1932 564999, Fax: +44 (0)1932 564998
Road, Brentford TW8 9HH, England. Tel. (+44) (0) 208 261 4509, fax: (+44) (0) Email: [email protected]
208 261 4447 www.elektor-electronics.co.uk. Internet: www.husonmedia.com
Advertising rates and terms available on request.
The magazine is available from newsagents, bookshops and electronics retail outlets,
or on subscription. Elektor Electronics is published 11 times a year with a double issue International Advertising: Klaas Caldenhoven, address as Head Office
for July & August. Email: [email protected]
Advertising rates and terms available on request.
Under the name Elektor and Elektuur, the magazine is also published in French, German
Copyright Notice
and Dutch. Together with franchised editions the magazine is on circulation in more
The circuits described in this magazine are for domestic use only. All drawings, photographs, printed
than 50 countries.
circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article
International Editor: Mat Heffels ([email protected]) texts published in our books and magazines (other than third-party advertisements) are copyright
Segment. b.v. and may not be reproduced or transmitted in any form or by any means, including pho-
Editor: Jan Buiting ([email protected])
tocopying, scanning an recording, in whole or in part without prior written permission from the
International editorial staff: Harry Baggen, Thijs Beckers, Ernst Krempelsauer, Publishers. Such written permission must also be obtained before any part of this publication is stored
Jens Nickel, Guy Raedersdorf. in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, compo-
nents etc. described in this magazine. The Publisher does not accept responsibility for failing to identi-
Design staff: Ton Giesberts, Paul Goossens, Luc Lemmens, Karel Walraven
fy such patent(s) or other protection. The submission of designs or articles implies permission to the
Editorial secretariat: Hedwig Hennekens ([email protected]) Publishers to alter the text and design, and to use the contents in other Segment publications and activ-
ities. The Publishers cannot guarantee to return any material submitted to them.
Graphic design / DTP: Ton Gulikers, Giel Dols
Disclaimer
Managing Director / Publisher: Paul Snakkers Prices and descriptions of publication-related items subject to change. Errors and omissions excluded.

Marketing: Carlo van Nistelrooy

Customer Services: Margriet Debeij ([email protected]) © Segment b.v. 2006 Printed in the Netherlands

SRROLQJIRUVWDQGDUGERDUGV
<RXUSULFHFRQVFLRXV3&%VXSSOLHU 9HULILHG XSWROD\HUV
IURPWRSLHFHV
IURPZRUNLQJGD\VRQZDUGV

2QOLQHSULFHFDOFXODWLRQ
2QOLQHRUGHULQJ WHFKQRORJ\DWWKHULJKWSULFH
2QOLQHRUGHUWUDFNLQJ jODFDUWH XSWROD\HUV
2QOLQH+DQG' IURPWRSLHFHV
IURPZRUNLQJGD\VRQZDUGV

,QWHUHVWHG"&RQWDFWXV
\RXUERDUGRXUFKDOOHQJH
(PDLOHXUR#HXURFLUFXLWVFRP XSWROD\HUV
2QGHPDQG IURPSLHFHRQZDUGV
ZZZHXURFLUFXLWVFRP IURPZRUNLQJGD\VRQZDUGV


6 elektor electronics - 7-8/2006


8 elektor electronics - 7-8/2006
PC Oscilloscopes & Analyzers
See the big picture with BitScope
Multichannel Mixed Signal Oscilloscopes
100MHz Digital Oscilloscope


4 Channel Digital Scope using industry
standard BNC probes or analog inputs on
the POD connector.

40MS/s Logic Analyzer


8 logic, External Trigger and special
purpose inputs to capture digital
signals down to 25nS.

Mixed Signal Oscilloscope


True MSO to capture 4 analog waveforms
time-aligned with 8 logic using sophisticated
cross-triggering on any input.

Real-Time Spectrum Analyzer Turn your PC into an expandable multichannel scope solution.


See spectra and waveforms of all analog Never run out of channels again. Whether debugging an embedded 3 phase motor
channels in real-time displayed simultaneously. controller or monitoring a full scale synchrotron, BitScope is the right solution.

Advanced Networking Operation With 4 independent analog and 8 synchronized logic channels, BitScope is ideal in


Flexible network connectivity supporting situations where a dual channel scope is simply not enough. Consider many modern
multi-scope operation, remote monitoring embedded systems, component video, 3D robotics, DSP process control and automotive
and data acquistion. systems. All frequently require more than 2 analog channels and several synchronized
timing channels to really see the big picture.
Integrates with third-party software Perhaps 4 + 8 channels is not enough? No problem, build a scope array accessible from


Use supplied drivers and interfaces to build the PC via your network and synchronized via BitScope's trigger bus or logic inputs.
custom test and measurement and data "Smart POD" connected active probes and multiple software options complete the picture
acquisition solutions. for the perfect low cost high performance multichannel test and debug solution!

Standard 1M/20pF BNC Inputs BitScope Smart POD probe connector Ethernet Connectivity Expandable and Programmable
200µV-200V/div vertical scale 8 logic channels, cross-triggering High speed binary data transmission Simple ASCII Protocol
Software select AC/DC coupling 4 additional analog inputs on POD Standard network protocols (UDP/IP) BitScope Scripting Language
Switchable 50 ohm termination Async serial I/O for external control Internet addressable device Add active probes and devices
x1 to x100 or differential probes Trigger bus for multi-scope sync

BitScope and your PC provide an array of Virtual Instruments

BitScope's integrated design uses standard oscilloscope probes and


a growing range of custom probes to provide functionality equal to
instruments many times the price.
BitScope plugs into third party software tools and has an open API
for user programming and custom data acquisition.

BitScope DSO software for Windows and Linux www.bitscope.com


TECHNOLOGY ASSEMBLING CIRCUITS

The circuits and circuit ideas in this


Summer Circuits issue are bound to inspire
many electronics enthusiasts to pick up a
soldering iron and build something nice for
themselves. Here we provide several basic
tips for assembling circuits.

Hands-on
Assembling Circuits
The minimum requirement for putting together a circuit is a available – with continuous copper strips, with independ-
soldering iron. A stand to hold the hot soldering iron is ent islands, and with various other copper patterns. You
also very convenient. If you do a lot of soldering, it’s a can use thin, insulated copper wire to make connections
good idea to buy a temperature-regulated soldering station between the various components.
that always provides the correct soldering temperature. A wide variety of adapter boards are available for
experimenting with SMDs. Different types of SMD pack-
ages can be mounted on a small printed circuit board fit-
Soldering tips ted with a standard 2.54-mm grid for headers and other
A soldering iron with a narrow bent tip is highly practical components.
for soldering small components located between other
large components. In that case, the entire iron must be
relatively thin, and not just the tip. Various types of sol- Making PCBs (or having them made)
dering tips, as well as special miniature soldering irons, Circuit board layouts are shown with some of the circuits
are available for soldering SMD components (see inset), in Elektor Electronics. Most of these circuit boards are
A good pair of tweezers is nearly indispensable for work- available from Elektor Electronics or our business partner,
ing with SMDs. A magnifying glass or loupe can also The PCB Shop (Eurocircuits).
come in handy for checking soldering points on circuit If you have designed a printed circuit board using a PCB
boards. layout program on your PC, you can make it yourself or
If you select a type of solder with a flux core, you won’t have it made for you. There are several PCB firms these
need any additional flux for soldering. Desoldering braid days (such as Eurocircuits and PCB-Pool) that make proto-
is very handy for removing excess solder. The braided types at acceptable prices, even for one-offs. Of course,
wick of thin copper wires ‘sucks up’ liquid solder. A sol- you can also roll your own.
der sucker is more convenient for removing relatively The first step is to use an inkjet or laser printer to make a
large amounts of solder. good, opaque overlay film. Films specially designed for
Always keep the tip of your soldering iron clean. You can this purpose are commercially available. Use a hair
use a damp sponge, special metal shavings, or a tip acti- dryer to dry the print after printing, and if necessary print
vator for that purpose. Adjust the iron to the proper tem- the layout on top again to obtain good opacity.
perature (approximately 370 °C) and ensure that your After that you can use the film to expose the photosensi-
workplace has good lighting. tive circuit-board material (using a second-hand UV lamp,
Most electronics enthusiasts will still use ‘ordinary’ for instance).
lead/tin solder at home. However, make sure you also
have lead-free solder on hand in case you need to make You can use granulated iron chloride to etch the circuit
repairs on boards assembled using lead-free solder. board. It does not have to be heated, so it generates less
vapour. That also means you can etch the board right
away, because it works at room temperature. This chemi-
Assembling circuits cal can be regenerated so it can be used several times,
A piece of prototyping board is an excellent choice for and it is less aggressive than other etchants.
assembling a small circuit. Several types of boards are (060182-1)

12 elektor electronics - 7-8/2006


Standard tools
• Soldering iron or soldering station, including stand
• Solder (lead/tin and lead-free)
• Desoldering braid
• Solder sucker
• Soldering flux for good solder flow
(also for use with desoldering braid
for solder removal)

• PCB holder or ‘third hand’


• Tweezers
• Cutters
(side cutters)
for cutting off
protruding pins

• Loupe or
magnifying glass

Soldering SMDs
It’s perfectly possible to handle SMD components using the
conventional method (a normal soldering iron with a fine
point, solder, and extra flux for very small components).
First use tweezers to place the small components (such as
resistors, capacitors and transistors) in the proper locations,
and then secure one pin or solder pad using a drop of solder
on the tip of the soldering iron.
Check whether the component is still properly positioned, and
correct the position if necessary. After that, continue with the
other solder pad(s) by heating the component and the solder
pad. Feed solder under the rounded surface of the tip. The
flux in the solder and the capillary action between the compo-
nent and the solder pad will cause a tight solder joint to be
formed. Finally, return to the first solder point, heat the solder
already there, and add a bit more solder to create a sound
solder joint here as well.
With a multi-pin IC, first align the IC properly and then solder
one of the corner pins in place. Check the positioning again,
and then solder a pin in place on the other side. If the IC is
still properly positioned, you can now solder the other pins,
taking care to allow enough time for IC to cool down in
between. It’s good practice to inspect your soldering afterward
with a loupe. If there are shorts between the pins, you can use
copper braid and liquid flux to remove the extra solder.
A different method can be used with ICs that have very nar-
row pins. After carefully aligning the IC and securing it at two
corners, you can solder all the pins using a generous amount
of solder. It doesn’t matter if that causes shorts between the
pins. Next, use desoldering braid to remove the excess sol-
der, which will also eliminate the shorts between the pins.

7-8/2006 - elektor electronics 13


HANDS-ON BUYING COMPONENTS

Looking for a Nee


Searching for components can
be difficult, particularly in
case of newly announced
types and types made by
unknown manufacturers. A
few tips and several good
Internet addresses can make
your search a lot easier.

Electronic component sales have usually have to look up the IC on the and construction kits. If you can’t find
increasingly shifted to the Internet manufacturer’s site, and then you can what you’re looking for there, try the
during recent years, particularly in order samples. The conditions vary large international mail-order firms
English-speaking countries. That’s widely, but you often have to order such as Farnell and Digi-Key. The
hardly surprising. It’s nearly impossi- using the name of a firm. However, order charges are often relatively high
ble for a local electronics shop to keep it’s certainly worthwhile to have a with such firms, but you can keep
up with the enormous range of compo- good look at this option. them under control by waiting until
nents and continuous stream of new • If you can’t obtain free samples, you have accumulated a sufficiently
components, so a larger-scale there’s another option. More and large number of components or plac-
approach is necessary. more manufacturers now have their ing a large order with several col-
own webshops where you can place leagues or friends.
There’s an especially good chance of small parts orders using a credit card. • Your search for a specific compo-
encountering components in the Sum- The advantage here is that the man- nent may take you to a wholesaler or
mer Circuits issue that are not so easy ufacturer knows exactly which of its distributor. If you want to use the
to obtain. If you at least know who the own products it can supply. We have component for a personal project, you
manufacturer is, you’re already halfway had good results with this method. can take the address in question to
there. Here we provide a few tips. •Next, have a look at the adverts in your electronics dealer and ask
our magazine. Start your search with whether he orders from there. For
•Start with the manufacturer’s web- a specialised mail-order company. commercial use, you can simply place
site. Many manufacturers offer free Almost all such companies have web- an order from your firm.
samples. To obtain such parts, you sites where they sell special parts • There are also many firms on the

14 elektor electronics - 7-8/2006


Buying components
dle. . . via the Internet
Firm Internet address

BEC http://www.bec.co.uk/

Combined Precision Components


http://cpc.farnell.com
(CPC)

Conrad Electronics www1.uk.conrad.com

Cricklewood Electronics www.cricklewoodelectronics.com

Digi-Key www.digikey.com

Farnell www.farnell.co.uk

Futurlec www.futurlec.com

Grandata www.grandata.co.uk/

Jaycar Electronics www.jaycarelectronics.co.uk

JLB Electronics www.jlbelectronics.com

Maplin www.maplin.co.uk/

Microchip www.microchipdirect.com

Milhill Supplies www.millhillsupplies.co.uk

Mode Components www.modecomponents.co.uk /

RS Components http://rswww.com/
Internet that specialise in supplying
spare parts for electronic equipment. SK Pang Electronics www.skpang.co.uk
They may also have special parts in
their product lines. A common diffi-
Sycom http://www.sycomcomp.co.uk/
culty in such cases is that it’s difficult
to find a specific component because
they use manufacturers’ internal Specialised in supplying Elektor parts and selected kits
codes and part numbers. However, it
can be worth the trouble. Barend Hendriksen www.barendh.com
•Finally, look beyond the border. For
instance, there are a few specialised DIL Electronics www.dil.nl/
firms in Germany and the Nether-
lands where Elektor has a strong Geist Electronic-Versand www.geist-electronic.de
presence hence you can find compo-
nents that are scarcely available any-
where else. Ordering is usually not a Reichelt Elektronik www.reichelt.de
problem.
Segor Electronics www.segor.de
If your German or Dutch isn’t that
good, you can always try it in English! Viewcom www.viewcom.force9.co.uk/
(060183-1)

7-8/2006 - elektor electronics 15


HANDS-ON HOME AUTOMATION

GBPLC – GameB
use a Nintendo GameBoy as a
programmable logic controller
for home automation
Sascha Koths & Stephan Ruloff,
in collaboration with Christian Müller

Home automation tasks – ranging from controlling


roller shutters and awnings to alarm systems – can be
handled nicely by small programmable logic controllers
(PLCs). Here we present a very attractive approach
that is convenient and inexpensive: the GBPLC, a PLC
based on the Nintendo GameBoy. Ready-assembled and
tested boards are available!

The key to this GameBoy transforma- Overview


tion, like that of the legendary Elektor Among mass-produced game comput-
Electronics GameBoy oscilloscope ers, the various models of the Nin-
(GBDSO), consists of a plug-in card tendo GameBoy are not only the least
with memory ICs for the application expensive to acquire (via eBay, for
software and an I2C interface for com- example), but also the best docu-
munication with the outside world, but mented. The standard model, with
without its own processor. That allows hardware built around a Z80-deriva-
the PLC to be programmed directly tive microprocessor, can be pro-
with the GameBoy (via a menu-driven grammed directly in C. A development
interface) or indirectly using a program environment tailored to this hardware
running under Windows on a PC con- is available free of charge on the Inter-
nected to the module. net. With its microprocessor system,
graphic LC display, serial interface
Here we describe the hardware of the and handy packaging, the GameBoy is
GameBoy module and briefly sketch a quite suitable for use as a platform
the structure and features of the soft- for a programmable controller.
ware, which also includes ready-made
sample applications. The associated All GameBoy models based on the
I/O switching module (‘I2C I/O box’) original (‘classic’) version (GameBoy,
is described in a separate article in GameBoy Pocket, GameBoy Light,
this issue. GameBoy Color, GameBoy Advance,

16 elektor electronics - 7-8/2006


Table 1.

Boy PLC GBPLC Module Features


• Available as a ready-assembled and tested PCB
• Load, delete and store up to 8 ‘logic programs’
• Disable under password control
• Program simulation
• Programming and simulation also possible in battery-powered mode
• Standard logic functions (AND, OR, NOT, XOR, SR)
• Two timers
• Two timing functions
• 64 flags
• Analogue comparator (less than, equal, greater than)
• Rising and falling ramps on analogue output
• PLC cycle time less than 500 ms
• Input and output names can be assigned freely in the software
• Names can be assigned to logic programs
• Run and Stop modes
• Log file can be viewed on the display
• Battery-backed real-time clock
• EEPROM for data storage
• Most recently loaded (active) logic program starts automatically after switch-on

Table 2.
GBPLC I2C I/O Box Features
• Available as a ready-assembled and tested PCB
• 8 digital inputs (for potential-free contacts)
• 8 digital outputs (relay or transistor)
• 4 analogue inputs (8-bit resolution)
• 1 analogue output (8-bit resolution)
• Inputs can be simulated by connecting pushbutton switches to the I/O box
• Socket for optional I2C SMS chip (with connector for Siemens S25 or C35i
mobile phone)
• Port for linking to a Siemens S25 or C35i mobile phone
• All switch states can be indicated by connecting LEDs

Figure 1. Suitable GameBoy models. The unit in the centre is the GBPLC I2C I/O Box,
which drives the GameBoy fitted with a GBPLC module.

7-8/2006 - elektor electronics 17


HANDS-ON HOME AUTOMATION

+5V

+5V

R1 R2 R3 R4
IC3 8

330 Ω

330 Ω
4k7

4k7
C2 +5V
3 K2
SCL 3 SX LX 2
100n 2
28 1
+5V SDA 6 SY LY 7
2 T1
CLK/I0 R5 4
3 27
I1 I/O9 10k USB-mini
4 26 SCL 4
I2 IC2 I/O8
K1 5 25 SDA P82B715BN
I3 I/O7 T2
R6
1 6 24 WR
+5V I4 I/O6 10k
2 7 23 RD
ECLK I5 I/O5
3 WR A14 9 PAL 21 A15
WR I6 I/O4
4 RD 10 CE22V10 20 2x BC850
RD I7 I/O3
5 11 19 D3
RAMCS I8 I/O2
6 A0 12 18 D2
A0 I9 I/O1
7 A1 13 17 D1
A1 I10 I/O0
8 A2 16
A2 I11
9 A3 +5V
A3
10 A4
A4 14 22
11 A5
A5
12 A6 C4
A6
13 A7 A15
A7
100n
14 A8
A8 C1 +5V
15 A9 8 3
A9
16 A10 VCC VBAT
A10 100n BT1
17 A11 7 IC4 1 X1
A11 SQW X1
18 A12
A12 32
19 A13 SCL 6 DS1307 3V
A13 SCL
20 A14 A0 12 31 SDA 5 2
A14 A0 WE SDA X2
21 A15 A1 11 22 CE 32kHz
A15 A1 CE GND
22 D0 A2 10 24 RD
D0 A2 OE 4
23 D1 A3 9
D1 A3
24 D2 A4 8
D2 A4
25 D3 A5 7
D3 A5
26 D4 A6 6
D4 A6 IC1
27 D5 A7 5 13 D0
D5 A7 D0 +5V
28 D6 A8 27 14 D1
D6 A8 AM29F D1
29 D7 A9 26 040B 15 D2
D7 A9 D2
30 A10 23 17 D3
RESET A10 D3 C3
31 A11 25 18 D4
AUDIOIN A11 D4
32 A12 4 EPROM 19 D5 100n
GND A12 D5
A13 28 20 D6
A13 D6 8
A14 29 21 D7
Game Boy A14 D7
3
A15 7 IC5 1
2 WP A0
A16 SCL 6 2
+5V 30 SCL A1
A17 SDA 5 3
1 SDA A2
A18 24C256
S1

16 4

050190 - 11

Figure 2. Schematic diagram of the GBPLC module, which transforms the Nintendo GameBoy into an easily programmed PLC.

and GameBoy Advance SP) are suit- data, which constitutes the PLC appli- ient Windows-based program. The PC
able for this project. Figure 1 shows a cation programs (also referred to as the software can also run real-time simu-
few examples. The Nintendo DS and ‘logic programs’ in the rest of this arti- lations and exchange program code
DS Lite (which actually do not belong cle). The I2C EEPROM allows data to and data with the GameBoy. If neces-
to the GameBoy family) and the Game- be exchanged between the GameBoy sary, PLC programs can also be gener-
Boy Micro are not suitable. and a PC application running under ated, modified and simulated directly
The core of the system consists of the Windows. The GBPLC module has an on the GameBoy. Up to eight PLC pro-
GBPLC module, which is inserted into I2C interface that can be connected to gram sequences (‘logic programs’) can
the bay on the back of the GameBoy all types of commonly used PC ports be stored in the GBPLC module, from
instead of the usual game cassette (serial, parallel or USB) using suitable which they can be individually
(ROM cartridge). This module consists adapters. retrieved and run. The data read in by
primarily of memory: a flash EEPROM Table 1 lists the key features of the the application can be shown on the
for the firmware and an I2C EEPROM GBPLC module. The PLC program can GameBoy display as a log file and read
for the display messages and the PLC be generated on a PC using a conven- out from the GBPLC module to the PC.

18 elektor electronics - 7-8/2006


For program execution, the GameBoy GameBoy uses only 15 of the 19
is connected to the circuit board of the address lines of the flash EEPROM,
I2C I/O Box, which is described in a which means that all programs in the
X1 K2
separate article in this issue. The prin- flash memory are restricted to 32 KB.
J1
IC4
C4
cipal features of the I2C I/O Box are However, the 16th address line (A15 of
listed in Table 2. In addition to eight IC1) can be addressed via switch S1,
050190-1

digital inputs and eight digital outputs, which can thus be used to select one

R3
IC3

R4
IC5
BT1 the I/O module has four analogue of two programs stored in the flash
C3

R5 R1
R2
inputs and one analogue output. One memory. One of them is the actual
050190-1

T2
T1
R6 C1
of its special features is a socket for a application program (the PLC
C2
IC1 small daughterboard fitted with an I2C firmware), while the other is an editor
IC2
SMS chip. This optional extension also that can be used to program or modify
has an I2C interface and allows the PLC application software directly on
unit to be controlled and queried the GameBoy. As S1 should only be
remotely by using SMS messages (‘tex- operated with power off, the circuit
ting’) and a mobile phone. board layout (Figure 3) is arranged
K1
such that S1 is only accessible when
the module is not fitted in the Game-
GBPLC module Boy. The assembled prototype board is
As you can see in Figure 2, the circuit shown in Figure 4.
of the GBPLC plug-in module essen- IC2 (PALCE22V10) provides address
tially consists of only five ICs. IC1 is a decoding, and it generates the I2C bus
flash EEPROM that stores the applica- signals SDA (data) and SCL (clock)
(C) ELEKTOR
tion software (firmware), IC2 is a PAL with the assistance of transistors T1
050190-1

that provides address decoding and and T2 and pull-up resistors R1 and R2.
generates the I2C signals, IC3 is an I2C The programs held in the flash mem-
bus extender, IC4 is an I2C real-time ory (IC1) are stored ‘permanently’ and
clock, and IC5 is an I2C EEPROM. From can only be overwritten by a software
a functional perspective, the GBPLC update (which requires a flash pro-
module adds program and data mem- grammer), but the content of the EEP-
ory, an I2C interface, and a battery- ROM (IC5), which is addressed via the
backed real-time clock to the basic I2C bus, is always accessible. It is
GameBoy platform. used primarily to store the PLC appli-
cation programs (eight maximum). The
The GameBoy microprocessor, which messages for the display are also
resembles the Z80, has a direct stored in the I2C EEPROM. That
address range of 64 K. However, the means the firmware in the flash mem-
upper 32 K are used for the LCD, RAM, ory does not contain any messages, so
sound and so on, leaving the range it does not have to be re-assembled for
0000–7FFF available for external ROM every minor change to a message.
and the range A000–BFFF available for That also has the advantage that it is
external RAM. Consequently, the easy to load different language ver-

COMPONENTS Miscellaneous
S1 = slide switch, sub miniature, angled
050190-1

pins, PCB mount (APEM type 236W)


LIST Bt1 = 3V Lithium button cell, PCB mount,
CR2032H
GBPLC Module K2 = Miniature USB-B socket, PCB mount
(Lumberg type 2486 01, Farnell #
Resistors (SMD 0805) 4739826)
R1,R2 = 4kΩ7 X1 = 32.768kHz quartz crystal
R3, R4 = 330Ω
PCB, bare, order code 050190-1
R5,R6 = 10kΩ
(supplied together with 050190-2)
Set of ready-assembled and tested
Capacitors (SMD 0805)
C1-C4 = 100nF boards of 1 pc. GBPLC Module and 1
pc. GBPLC I2C I/O Box; order code
Semiconductors 050190-91
T1,T2 = BC850
IC1 = AM29F040B with socket, * set of programmed Flash (IC1), PAL
programmed * (IC2) and EEPROM (IC5); order code
IC2 = PALCE22V10, programmed * 050190-51.
IC3 = P82B715TD
Figure 3. The double-sided, through-hole plated printed circuit board IC4 = DS1307Z For all items 050190-xx:
IC5 = 24C256, programmed * see SHOP pages and/or
of the GBPLC module, which is assembled using SMDs. Board also
www.elektor-electronics.co.uk
available ready-assembled and tested.

7-8/2006 - elektor electronics 19


HANDS-ON HOME AUTOMATION

About the authors


Sascha Koths and Stephan Ruloff devel-
oped this design as a graduation project
at Bertolt-Brecht-Berufskolleg in Duisburg,
Germany. During their studies for the
Certified Electronics Technician diploma,
the idea of using a GameBoy as a con-
troller led to their graduation project.
After receiving their technician diplomas
in the field of data processing technology,
they are now both enrolled in the
Niederrhein University of Applied
Sciences in Duisberg. Naturally, the only
conceivable course of study for them was
Engineering Informatics.
A word of thanks is also due to Christian
Müller, who assisted in the project work.

sions. Display messages in German and switch-off times to be pro- The 32-way card-edge connector of the
and English are included in the ready- grammed using the PLC and events to module board (shown at the left in the
made software. be logged. Thanks to the back-up bat- schematic diagram) automatically con-
tery, the clock is specified to operate nects the module to the GameBoy
The I2C real-time clock (DS1037) pro- for up to 10 years without losing track when the module is inserted. The only
vides the time of day in 12-hour and of the time. The internal 56-byte RAM connection to the outside world is the
24-hour format along with the date and of the DS1307 is not used in the GBPLC I2C port, which is located on the edge
day of the week, to allow switch-on application. of the board that remains accessible
when the module is inserted. The
board is fitted with a miniature USB-B
socket (K2) for the I2C bus. In contrast
to the GBDSO, the serial interface port
of the GameBoy is not used in the
GBPLC application.

GBPLC programming adapter


As the GBPLC module can only be
accessed via the I2C bus, an interface
adapter that can be connected to a PC
is necessary for linking the module to
a PC. The circuit shown in Figure 5
can be used for connection to a serial
port or a USB port with a USB to serial
interface adapter. However, using a
‘virtual COM port’ with a USB adapter
is only a makeshift solution due to the
very low data transmission rate.
A circuit board with a USB-A connec-
tor for the I2C bus (Figure 6) has also
been designed for the programming
adapter corresponding to the circuit
shown in Figure 3. If you use this
adapter, you will need a cable with a
USB mini plug at one end and a USB-A
plug at the other end for the link to the
GBPLC module. The same cable can be
used to connect the GBPLC module to
the I2C I/O box. As the I2C I/O Box has
two I2C connectors (a USB-A socket
Figure 4. Fully assembled prototype board of the GBPLC module. and a USB-B socket), the programming

20 elektor electronics - 7-8/2006


adapter and the GBPLC module can
both be connected to the I2C I/O Box +5V
C2
at the same time. That requires using
the following cables, which are avail- R2 R3 1µ
able as standard items: C6
2 25V

4k7

4k7
+5V +5V K1
Mini USB to USB-A for connecting the 100n C1
1
C1+
V+ 16

GBPLC module to the I2C I/O box. IC1


1
IC2 8 3 6
USB-A to USB-B for connecting the pro- 1µ
25V 12
C1–
13 RTS 2
K2
gramming adapter to the I2C I/O box. 3
2 LX SX 3 SCL 9
R1OUT R1IN
8 DTR 7
2 R2OUT R2IN
The supply voltage (+5 V) for the pro- 1
11
T1IN T1OUT
14 3

gramming adapter is tapped off from 7 LY SY 6 SDA 10


T2IN T2OUT
7 CTS 8

the I2C I/O box via the USB cable. An USB-A


4 C4
4
C2+
C3 4
1µ 9
advantage of this arrangement (with MAX232
4 5 15 25V 5
1µ C2–
the programming adapter connected to P82B715PN 25V V-

the I2C I/O box) is that the GBPLC 6


C5 SUB D9
module in the GameBoy remains per-
manently connected to the I2C I/O box. T1
R1

25V
That eliminates unplugging and 10k
replugging cables to connect the
BC547
GameBoy to the PC, since the ‘spare’ 050190 - 12

USB connector of the I2C I/O box can


be used for that purpose as necessary.
Figure 5. Schematic diagram of the programming adapter for connection to a serial PC port.
The USB-A connecter is used here for the I2C bus signals.
Construction and assembly
Given the available space, the circuitry
of the GBPLC module can only be
assembled using a double-sided,

050190-2
through-hole plated PCB with SMD
components. Due to the difficulties of
R3

K2
assembling such a board, the GBPLC
R2

module is optionally available as a fully T1


ROTKELE )C(

IC2
assembled and tested PCB, which only
C6

has to be fitted into an empty Game-


C3

Boy cartridge housing. As such hous-


C5 C4 C1
ings are not commercially available,
you will have to remove the innards of IC1
050190-2

(C) ELEKTOR

a second-hand (cheap) GameBoy game


C2

cartridge and use its housing. As you R1


can see from the photo of the GBPLC
K1 2-091050

module (Figure 7), four openings must


be made in the housing to accommo-
date the flash memory (IC1 with
socket), the back-up battery, the exter-
nal connector, and the slide switch on
the edge of the board (S1).
Figure 6. Circuit board track layout and component layout for the serial interface programming adapter.
GBPLC software Board also available ready-assembled and tested.
The firmware for the GameBoy (PLC
application software and editor) has
already been mentioned. These two COMPONENTS LIST
programs, which can be selected using GBPLC Programming Adapter Miscellaneous
S1, are pre-installed in the flash mem- K1 = 9-way sub-D socket, angled pins,
ory of the assembled and tested Resistors PCB mount
R1 = 10kΩ K2 = type-A USB socket, PCB mount
GBPLC module. The I2C EEPROM is PCB, bare, order code 050190-2
R2,R3 = 4kΩ7
also already loaded with the display (supplied together with 050190-1)
messages in one language (English). If Capacitors Set of ready-assembled and tested
you assemble the board yourself, you C1-C5 = 1µF 25V radial boards of 1 pc. GBPLC Module and 1
can order IC1, IC2 and IC5 pre-pro- C6 = 100nF pc. GBPLC I2C I/O Box; order code
050190-91
grammed (refer to the components
Semiconductors
list). All files necessary for program- T1 = BC547 For all items 050190-xx:
ming these ICs are also available on IC1 = MAX232 see SHOP pages and/or www.elektor-
the Internet for downloading (refer to IC2 = P82B715PN electronics.co.uk
the links at the end of this article). A

7-8/2006 - elektor electronics 21


HANDS-ON HOME AUTOMATION

Table 3. GBPLC
Windows Software • Print system logic and labels
• Buttons for running other program modules
System requirements
• Configure interface
• PC with Pentium-class processor
• Windows 95 with 32 MB RAM; Windows 98/ME with GBPLC Simulator
64 MB RAM; Windows NT 4.x with Service Pack 4 or • Load logic programs
higher; Windows 2000 or Windows XP with 128 MB • Start and stop programs
RAM (minimum requirement in each case) • Real-time simulation of inputs
• Administrator rights if Windows NT, Windows 2000 or • Generate outputs
Windows XP is used
• Microsoft Internet Explorer 5.0 or later GBPLC Log Viewer
• Serial or parallel interface (USB can be used with a USB
to RS232 converter but is very slow) • Read log data from GBPLC module
• Display characteristic curves (plotted versus time)
Ready-to-use PLC programs • Freely selectable colours for characteristic curves
• Aquarium/terrarium controller • Export to Excel or other programs
• Alarm system
• Roller shutter controller SMS Configuration (for optional I2C SMS chip)
• Configure short message service carrier (SMSC) number
GBPLC Manager • Configure recipient number
• Generate and edit logic programs • Write SMS (‘text’) messages

suitable programming device must be


used to program IC1 and IC2. The I2C
EEPROM can be programmed using a
simple programming circuit and soft-
ware, such as PonyProg. You can also
start up the GBPLC with IC5 empty
(unprogrammed) and use the GBPLC
PC software and GBPLC programming
adapter to load display messages in
the language of your choice into IC5.
Even with a pre-programmed EEP-
ROM, the selected language for the
displayed messages can be changed
at any time via the PC. The details of
configuring the module for initial use
are described in the ‘Step by Step’
guide (included in the download for
the project).

After all the above-mentioned ICs have


been programmed, you can also use
the editor stored in the flash memory
to generate an application program
(PLC sequence program) directly on
the GameBoy or modify a program that
has already been loaded. However, it
is more convenient to use the GBPLC
PC software for that purpose and then
use the programming adapter to
download the program into the EEP-
ROM of the GBPLC.
The documentation of the internal
structure of the controller and the
Figure 7. The finished GBPLC module fitted in the housing of a salvaged GameBoy game cartridge. menus of the GBPLC is also contained
On the prototype pictured here, an IC socket was used for IC2, and a jack socket for K2. in the download files for this article.
The ready-assembled module on sale through Readers Services has IC2 soldered on the board, However, you do not need to bother
and a mini USB socket for K2 (see Figure 4) about the internal structure and byte

22 elektor electronics - 7-8/2006


REVERSE AUCTION
for ready-built
organisation if you use the Windows software.
The structure of a sequence program is the same, regardless GBPLC & GBPLC I2C I/O units
of whether it is generated using the PC software or directly
on the GameBoy. Up to eight PLC program sequences (‘logic see www.elektor-electronics.co.uk
programs’) can be developed in a single ‘project’. The project
programs (up to eight) can be stored in the 24C256 of the
GBPLC module. They can be individually retrieved and run
via the menu interface on the GameBoy LCD or from the PC.
Each of these programs consists of a maximum of 64 blocks.
Each block corresponds to a 4-byte line of program code that
defines a function (also known as a ‘logic gate’). The avail-
able functions are listed in Table 1. Each logic gate has a
maximum of two inputs and a single output. The terminals
of the I2C I/O Box listed in Table 2 can be selected as the
inputs or outputs. It is also possible to define ‘block flags’
(‘flags’ for short) for the inputs and outputs. These block flags
interconnect the inputs and outputs of different blocks.

Windows software
A package consisting of three programs that run under Win-
dows is provided to simplify using the controller. Like the
firmware, it is available for downloading free of charge. Bor-
land C++ Builder was used to develop the Windows software.
Figure 8. Screenshot of GBPLC Manager, the main program for operating and
Each of the three programs (GBPLC Manager, Simulator, and
programming the GameBoy PLC under Windows.
LogView) performs a specific task. A fourth program (SMS
Configuration) can be used to configure the optional I2C SMS
chip. All the other programs can be run from GBPLC Man-
ager, so all the Windows software can be used in the GBPLC
Manager environment.

Table 3 summarises the major features of the Windows pro-


grams. Typical screen shots are shown in Figures 8, 9 &
10. The extensive help files for the Windows programs form an
excellent tutorial with detailed explanations and examples.
Three complete example projects that you can also use for
your own applications are also available: a controller for
aquariums and terrariums, a roller shutter controller, and an
alarm system. For demonstration purposes, the authors
installed these applications in a model display home that is
also shown in the photos.

If you want to get an exact idea of the functions and capabili-


ties of the GBPLC, you can download the Windows software Figure 9. GBPLC Logic Simulator, which can be run from GBPLC Manager,
free of charge and at no obligation and familiarise yourself with can be used to test application programs without the GameBoy.
the display of the GameBoy PLC. After that, it’s only a small The GameBoy functions are integrated into the simulator.
step from a simulation to the real thing (see the ‘Step by Step’
guide included in the download file), with the added benefit
that you know in advance that it will be worth the effort.
(050190-1)

Links for downloads


www.elektor-electronics.co.uk
(Elektor Electronics articles, software and documents)
www.rk-tech.org
(authors’ website, software and documents)
http://gbdk.sourceforge.net
(GBDK – GameBoy Developers Kit)
www.work.de/nocash/gmb.htm
(NO$GMB – GameBoy emulator for Windows)
www.lancos.com/prog.html Figure 10. GBPLC LogView can be used to display and export control data
(PonyProg) collected by the PLC.

7-8/2006 - elektor electronics 23


HANDS-ON I/O-BOARD

GBPLC 2
IC I/O Box
analogue, digital I/O plus TXT (SMS)!
Sascha Koths & Stephan Ruloff

To use the Nintendo GameBoy as a system control centre, you need an I2C interface in addition
to the special plug-in card. The circuit presented here is cut out for the job. It has a total of 24
inputs and outputs, including 4 analogue inputs and 8 digital inputs. That’s sufficient to control
roller shutters, outside lighting, curtains, an alarm system, the central heating system and even
more, possibly even remotely via TXT (SMS) messages.

The feature project of this year’s Sum-


mer Circuits issue, the GameBoy home
automation controller (GBPLC), natu-
rally needs information from various
switches and sensors. An interface is
necessary for reading in these signals
and sending commands to the out-
side world. This I/O box has
been designed to provide
that interface.
The circuit commu-
nicates via the
well-estab-
lished,

mobile phone.
That means you
could ‘text’ a mes-
sage to close the cur-
industr y tains or operate some other
standard I2C system.
bus. It has four ana-
logue inputs and eight digi-
tal inputs, a single analogue out- The circuit
put, and eight digital outputs that can The active part of the circuit consists of
source 5 V at 5 A. It also has an inter- IC3–IC5, each of which has an I2C bus
face for connecting a special SMS mod- interface. IC6 and IC7 are I2C bus
ule to allow messages to be ‘texted’ to extenders that act as boosters. They
a mobile phone. In short, it has lots of reduce the link’s susceptibility to inter-
capabilities. The SMS module also ference by increasing the current on the
allows the circuit to be controlled by a I2C bus and reducing its capacitance.

24 elektor electronics - 7-8/2006


+5V +5V
K10

C5 1 3 5 7 9 11 13 15 17 19

K25 K11

R19
R18
100n
+5V IC1
16 2 4 6 8 10 12 14 16 18 20

4k7
4k7
D2
1N4001 7805 +5V
K12
13 4 +5V
INT P0
R20
R21

C18
IC5 5 K24
P1 3
330 Ω
330 Ω

100n 14 6
SCL P2 K13 1
15 7 C17 C6 C7
IC6 8 SDA P3 2
+5V 9
P4
1 PCF8574T 10 10µ 100n 100n
A0 P5 K14 25V
K27 7 LY SY 6 SDA 2 11
1 A1 P6
3 12
2 A2 P7

C15

C13

C11
2 LX SX 3 SCL

C9
3 K15
4
8
USB -B 4
K16
P82B715BN

C14

C12

C10

C8
+5V
8x 100n
SDA
SCL

C4 K17
+5V
100n
C2 R1
K19

R10
R11
R12
R13
R14
R15
R16
R17
4k7
16
100n
K2

4k7
4k7
4k7
4k7
4k7
4k7
4k7
4k7
12 5
EXT A0
K20 6 T9
A1
1 IC4 7
AIN0 A2 8
2 2 7
AIN1 K23 K3
K21 3 6
AIN2 IC2
4 15 3 5
AIN3 AOUT
4 T10
PCF8591 1
K22 10 14
SCL VREF D1
9 11 CA3130
SDA OSC C1 K4
AGND
8 13 100n
+5V
SDA
SCL

T11
LM336
K5
+5V
R22
R23

C19
330 Ω
330 Ω

100n C3
T12
IC7 8
16 100n
K6
K28 7 LY SY 6 SDA 13 4 R2
1 INT P0 4k7
IC3 5 R3
2 P1 4k7
T13
2 LX SX 3 SCL 14 6 R4
3 SCL P2 4k7
15 7 R5
4 SDA P3 4k7
9 R6 K7
P4 4k7
USB -A 4 1 PCF8574T 10 R7
A0 P5 4k7
P82B715BN 2 11 R8
A1 P6 4k7 T14
+5V 3 12 R9
A2 P7 4k7
C16
SDA
SCL

T1 K8
8 T2
100n
1 3 5 7 9 11 13 15 17 19
T3 T15
K26
T4
K18 K9
1 32 VCC 2 4 6 8 10 12 14 16 18 20
T5
RTS 2 31 DTR
T6
3 30 TXD V24 T16
4 29 RXD V24 T7
+5V
5 28 TXD Max
T8
6 27 TXD TTL K1
7 26
1
8 25 GND 6 8x
2
9 24 7 IRFZ34
3
10 23 8
4
11 22 9 8x BC850 060098 - 11
5
AVCC 12 21
13 20 SCL
14 19 SDA SUB-D9
15 18
GND 16 17

Figure 1. The main components of the circuit are the I2C drivers and the bus extender.

IC4 converts analogue signals into 8-bit IC4. The PCF8574 contains an 8-bit internal base address, which explains
digital data suitable for the I2C bus. The quasi-bidirectional port with internal why IC4 and IC5 can apparently be
reference voltage on pin 14 is set to 2.5 latches. The latch retains the most assigned the same address. If you want
V, which yields a resolution of approxi- recently configured output state. IC5 to couple several of these modules to a
mately 10 mV. TTL signals can access obviously does not use this data, single bus for a different application,
the I2C bus via IC5. Capacitors C8–C15 since none of its outputs are used in you will have to modify address portion
decouple noise on the inputs. That’s the circuit. of the PCB track layout.
hardly an unnecessary luxury for signal
lines that doubtless run over a consid- The addresses of IC3, Ic4 and IC5 are Standard USB connectors are used for
erable distance through your house. hardwired in the circuit by tying the connection to the I2C bus. They are
Digital and analogue signals are out- address pins A0, A1 and A2 to fixed thus not real USB ports. K28 is a USB-
put to the outside world via IC3 and potentials. The PCF8591 has a different A connector for connection to the

7-8/2006 - elektor electronics 25


HANDS-ON I/O-BOARD

K2 K3 K4 K5 K6 K7 K8 K9
K24 K1
C16

R13

R15
T9 T11 T13 T15

R8

R6

R4

R2
T2 R11 T4 T6 T8

R17

K18
R9
K19

R10

R14

R16
R7

R5

R3
T1 T3 R12 T5 T7

T12
T10 T14 T16
D2 C3 C5
C17

R18
R20
C18
C1
K20

IC4 C4
C15 C8
R1

C6

IC3
IC1

IC5
C13 C14

C10 C9
K26
K21

IC6
D1

R19
C11
C7

C12

R21
K27
IC2

K25
C2
K22

R23
K23 K17 K16 K15 K14 K13 K12 K11 K10 IC7

C19
K28
V

H4

R22

Figure 2. Practically the entire outer region of the board is occupied by a large number of connectors.

COMPONENTS T1-T8 = BC850


T9-T16 = IRFZ34N
# CP-002B-ND)
K25, K26 = 20-pin (double row) socket,
IC1 = 7805 pitch 0.1”
LIST IC2 = CA3130
IC3, IC5 = PCF8574T
K27 = USB connector type B
K28 = USB connector type A
IC4 = PCF8591T PCB, order code 060098-1
Resistors IC6,IC7 = P82B715TD Ready assembled and tested board,
R1-R19 = 4kΩ7 order code 060098-91
R20-R23 = 330Ω Miscellaneous
K1 = 9-way sub-D plug (male), angled * only required in combination with SMS
Capacitors pins, PCB mount * chip
C1-C16,C18,C19 = 100nF (SMD 0805) K2-K17,K19-K23 = PCB terminal block,
C17 = 10µF 25V radial lead pitch 5mm For all items 060098-xx: see SHOP
K18 = 32-way DIL socket * pages and/or
Semiconductors K24 = mains adaptor DC socket, PCB www.elektor-electronics.co.uk
D1 = LM336Z (TO92 case) mount (CUI Inc. type PJ-002B, Digikey
D2 = 1N4001

GameBoy module. K27 is a USB-B con- was switched on, due to the initial SMDs. Next in line are the DIL and
nector intended to be used for connec- state of the PC8574. SMD ICs. IC2 can optionally be fitted
tion to a PC. That makes it unneces- As already mentioned, the MOSFETs in a socket. After that, you can fit the
sary to constantly disconnect and can handle currents up to around 5 A. rest of the components.
reconnect cables when you want to Incidentally, you can also use the pin- You can connect a mobile phone directly
control the module from the GameBoy compatible BUZ11 in place of the to the circuit via a serial data cable con-
while linking it to a computer at the IRFZ34N. It is no longer being made, nected to K1 if the optional SMS module
same time via an I2C to RS232 adapter. but you can doubtless still find it on is also fitted. You can order the SMS
All digital inputs and outputs are the shelf here and there. module at www.rk-tech.org.
directly accessible on K25 and K26. The power supply is a simple design
That means you can check the outputs using a 7805. That means you can sim- Of course, this circuit is also perfectly
by connecting low-current LEDs ply use a standard AC adapter with a suitable for use as a general-purpose
directly to K26. Don’t forget to use cur- voltage of 9 V or more as a power I2C bus interface — it doesn’t have to
rent-limiting resistors for the LEDs. source. D2 provides reverse-polarity be restricted to use in combination
The PCF8574T has open-drain outputs protection in case you accidentally with the GameBoy module. An I2C-
that can source adequate current for connect a different adapter with the based system with all sorts of control
that purpose. wrong polarity. and switching capabilities can be used
We use the SMD version of the well- for innumerable purposes aside from a
known BC550 here for inverters home bus system. That makes this I2C
(T1–T8, BC850) that drive MOSFETs Construction I/O Box suitable for a wide variety of
T9–T16. Otherwise the outputs would Assembling the circuit board is not dif- applications.
go high immediately after the circuit ficult. Start by soldering all the small (060098-1)

26 elektor electronics - 7-8/2006


The Corn Exchange, Conduit St, Lichfield. Staffs. WS13 6JU
Lichfield Electronics Tel: 01543 256684 E-Mail: [email protected]
LED Flashing Kits Telephone kits Switch and control kits
Arrow Chasing Light 21 LED Build Your Own Telephone Infrared Remote Relay
A simple but fun kit to build an LED pointing This great kit lets you build a tone/pulse phone Control 1 10A Mains device by infrared
Arrow, ideal for near exits or as an indicator? With mic and ear piece, no batteries required. Remote control. Range: 25ft. (on/off)
2.9”x2.2”, 9-12V A great kit to build and use. 2ch 50ft version also available
£9.99 £28.99 £18.99
6 program 4 channel DC chasing light. 12V 100W. (FK144) £15.99 Telephone In Use indicator. Requires phone lead (FK318) £2.99 Light Dimmer 500W: uses a Triac. With LED (FK415) £5.99
Electronic Windmill 25 LED ,adjustable speed. (FK153) £9.99 Telephone Interceptor: Listen in on phone calls. (FK306) £8.99 Light Sensor with 5A 250V relay. With LED (21-053) £6.99
4 way traffic light. 12 LED. How do they work? (FK148) £9.99 Telephone Radio Transmitter (FM 88-108 Mhz) (FK320) £8.99 Touch Switch 10A 240V Touch on/touch off (FK405) £8.99
Two Way Chasing Light 35 dot. Uses LED display. (FK151) £7.99 10W Telephone Ringer, drives bell or speaker not inc(FK305)£9.99 Voice control switch 7A 240V, clap on/clap off (FK409) £9.99
240V flasher. 2CH 1400W, adjustable speed. (FK144) £7.99 Phone Ring Signal 500W Flash a lamp when the phone rings£12.99 Water Pump Level Control with 7A 240V relay. (FK425) £9.99
Two way V.U. Meter. 10 LED. Displays volume (FK102) £4.99 Dual Station Intercom with speakers (FK313) £10.99 Electronic Code Switch & relay. 7A 240V 4 digit. (FK422) £14.99

Postage Power Supply kits Power Amplifier Kits Our Shop


Order Value P&P Cost 0-30V 3A Variable Regulator 15+15W Power Amp Located in the city
£4.99-12.99 £2.00 Build a high quality variable voltage regulator This quality kit uses 2X TDA200SR IC’s, centre of Lichfield
Using this simple to assemble kit. Includes heat syncs and full instructions. We are within
£13.00-22.99 £3.00 easy reach from Birming-
£23.00-49.99 £8.00 £15.99 30VDC or 2x12VAC required Requires only a 12V power source.
£24.99 (FK608) ham. All stock is carried on
site and is on display. If you
£50-£150 £12.00 0-30V 1A Variable Regulator, as above but 1A. (FK808) £7.99 Power Amp. OTL. 30W Mono R1%: Req 50VDC (FK656) £14.99
Above prices UK Only. Variable DC Regulator 0-12V from 12V. 500mA. (FK807) £4.99 Power Amp. BTL. 15W Mono. Req 12VDC (FK607) £14.99 have any questions our staff
Phone or e-mail for Ireland . DC Down Converter. 12v to 6 or 9V. Uses 7806 (FK805) £3.99 Power Amp. IC 8+8W Stereo. 12VDC TDA200SR (FK605) £13.99 would be be happy to help,
Payment by cheque, card or P/O Power Supply 6-9-12V 0.3A. Inc transformer (FK801) £8.99 Power Amp. IC 8W Mono. 12VDC TDA2030 (FK604) £8.99 whether you are just starting
Mini Emergency Light. When mains fails, it lights(FK802) £5.99 Power Amp. 2+2W Stereo 3-12V DC TBA820M (FK603) £9.99 out or a pro.
Open Mon-Sat 9:15-5:00
133 Kits in stock!!! 12V Low battery alarm. Suit car or boat. (FK915) £6.99 Power Amp 2W Mono 3-12V DC TBA820M (FK602) £5.99

Intruder Alarms Radio kits Everything Else


Super Tone Control: Stereo Adjust Bass, treble, etc (FK628) £22.99
Magnetic Switch Alarm Shortwave Radio Reciever DIY Digital Multimeter: with transistor checker. (03-150K) £16.99
Make a digital burglar alarm with this great A great kit to make a short wave reciever for Stereo Simulator: Splits source based on frequency.(FK651) £14.99
Kit, simply attach the magnet to a door and 2.2 - 7Mhz. Easy to build. Uses the 4007 IC. Video Amplifier 1 to 4 ch. Adjustable gain. 12V (FK655) £12.99
the switch to the surround, hide the control 9V (21-020)
£16.99 board, arm it and wait. £9.99 Human to Robot Voice Changer with speaker.
Rat and Cockroach Banisher circuit with speaker
(FK930) £12.99
(FK929) £8.99
Walky Talky Kit, pair. 27Mhz. 150mW to 1W (FK711) £34.99 Bass Booster. Mono.(Audio) 12V DC (FK642) £6.99
Passive Infrared Sensor & relay 5A 250V delay off (FK510) £27.99 Advanced AM/FM Radio & case. Req Freq Gen (21-027A)£16.99 Electric Shock Machine. Low Power. 9V (FK901) £5.99
Infrared Burglar Alarm/relay. Make an IR tripwire. (FK505)£24.99 Simple FM Radio 88-108Mhz. Uses TDA7000 (FK707) £14.99 Two tone door bell with speaker. (FK238) £5.99
Intruder Alarm with delay function & speaker. (FK501) £9.99 Advanced AM Radio & case. Req freq generator (21-028A) £13.99 Police Siren with speaker. (FK234) £5.99
Visitor Chime with speaker. Ding Dong. Req switch (FK502) £7.99 FM Wireless Mic: Very simple transmitter. 9V (FK702) £6.99 Condencer Mic with pre-Amp 9V. Drives a speaker (FK648) £4.99
Pocket Transistor Radio: Uses MK484 clone IC (21-001) £9.99 2 tone signal generator: 500Hz & 1kHz for radios (FK903) £3.99
And this is only 59 of our kits
See the web site for the rest>>> WWW.LICHFIELDELECTRONICS.CO.UK

1HZ7KH3&2VFLOORVFRSHWKDW
¿WVLQWKHSDOPRI\RXUKDQG
7KH3LFR6FRSH 3&2VFLOORVFRSHV

7KLVFRVWHIIHFWLYHVROXWLRQLVD3&2VFLOORVFRSHFRQQHFWHGDQG
SRZHUHGYLDWKH86%FRQQHFWLRQ(UJRQRPLFDOO\GHVLJQHG
WR¿WLQWKHSDOPRI\RXUKDQGWKLVLVWKHSHUIHFWSRUWDEOH
FRPSDQLRQIRUWRGD\¶VHQJLQHHURQWKHJR+DQG\WRWUDYHO
ZLWKDQGHDV\WRVHWXSIRUWKHQRYLFHDQGWKHSURIHVVLRQDO
WKH3LFR6FRSH SURYLGHWKHSHUIHFWVROXWLRQWR
\RXUWHVWDQGPHDVXUHPHQWQHHGV$VZLWKDOO3LFRSURGXFWV
OLIHWLPHVRIWZDUHXSJUDGHVDQGWHFKQLFDOVXSSRUWDUHDYDLODEOH
IUHHRIFKDUJH

‡8SWR06VUHDO ‡6XSSOLHGZLWK3LFR6FRSH
WLPHVDPSOHUDWH 3LFR/RJDQGELW
SURJUDPPLQJOLEUDULHV
‡8SWR0+]
EDQGZLGWK ‡&RPSDWLEOHZLWK:LQGRZV
6(0(DQG;3
‡'LJLWDO(76HQKDQFHV
UHSHWLWLYHVLJQDO ‡NVDPSOHEXIIHU
VDPSOHUDWHWR*6V
3LFR6FRSH 
3UHVHQWHGLQDKDQG\SURWHFWLYHFDVHSHUIHFWIRU\RXUWRROER[
6LQJOH&KDQQHO6FRSH6ROXWLRQV
$YDLODEOH1RZ)URP2QO\…

ZZZSLFRWHFKFRPKDQGKHOG

7-8/2006 - elektor electronics 27


INFOTAINMENT

ELECTROSHA

1. Workplace with various projects ‘under 2. Inexpensive (web)server (Feb. 2006) and 3. Modding for Home Improvement (June 2006).
development’. Electronic Stamping (Sept. 2006). Central control for all equipment.

28 elektor - 7-8/2006
CK free-lance Modding & Tweaking expert
Jeroen Domburg in his student digs
6

4
3

4. Jeroen’s personal server, secured ‘suspending’ 5. Modified display; supplies info on currently 6. Christmas Light String (Dec. 2005) still in
to maximise space in the bed-sitter. playing music selection. budget enclosure.

7-8/2006 - elektor 29
BBC Radio-MP3
001
Richard Salisbury
for Seniors
Just recently the author had cause to
make an MP3 player for a 93-year old
recently moved to a nursing home. There,
radio reception turned out to be hope-
less, mainly owing to interference from
TL lamps. The elderly person involved
can neither see well nor has good manip-
ulative skills (arthritis), while learning new

ously whether the amplifier is on or not station. Of course, much more music
(the author used a 15-pound speaker set could be loaded on the player since
/ amplifier for a computer which stereo makes no sense and it could be
switches the 12 volts AC). The trans- encoded at a slower rate.
former was replaced with a double sec- An initial problem of the MP3 player’s
ondary winding to avoid any earthing output level not being well matched to the
problems between the USB charging amp input was solved by choosing
device and the amplifier ground. another amplifier (Velleman K4001)
The unit is working well and plays the which has a more suitable input sensitiv-
client’s favourite music for about 4-3/4 ity of 40mV.
hours, more or less like a personal radio (060070-1)

MP3 player stereo amplifier

to twin speakers
AUDIO

procedures is sure to present problems. USB-A


to K1
The solution to the radio reception prob- TR1

lems was to build an iRiver U10 MP3


12V
player into a speaker box which looks
like an old fashioned radio and has only
Mains
an ON/OFF button and volume control.
The unit is powered by the normal mains 12V IC1 D1 D2
and can remain unplugged for about ten L7806 1N5819 1N4007

hours before it stops. Remarkably, that D3


68 Ω

R1
also happens on being replugged into K1
the mains. Due to a firmware problem of C1 C2 C3 1N5819 1
2
+5V

the U10, on 5 volts appearing on the 100µ 390n 390n BT1 3


D–
B1 25V D+
USB connector it assumes it is connected 4
GND
4 cells 1V2 R2 R3
to a computer and stops playing. 500mAh USB-A
22k

22k

The circuit diagram is all straightforward


and speaks for itself. The U10 is fixed in
a window on the back of the player with 060070 - 11

the keys locked. Hence, it plays continu-

30 elektor electronics - 7-8/2006


Laser Alarm
Dimitris Kouzis-Loukas
002
This circuit is a laser alarm system like
the one we see in various movies. It uses
a laser pointer beam to secure your
valuables and property. Essentially,
when the beam gets interrupted by a
person, animal or object, the resistance
of a photodiode will increase and an
alarm will be activated.

The laser and the receiver can be fitted in


same box, sharing a common power sup-
ply. As the receiver draws less than 10 mA
on average, you’ll soon find that the laser +U B
is the most current hungry device! Mirrors +5V...+9V

are used to direct the beam in whatever < 10mA


C D1
setup you require. Examples of a passage C2
P1 R2
and an area protected by the alarm are BPW34 A 33k 100n
500k
shown in the diagram. BPW34
In the circuit diagram we find a TL072 SFH203
3 8

op-amp (IC1.A) configured as voltage IC1.A


1

comparator between the voltage refer- 2


R1
4
ence provided by the adjustable voltage

470 Ω
C TL072
divider P1/R4 and the light-dependent
R3 R4
voltage provided by the voltage divider C1 D2
10k

10k

consisting of photodiode D1 and fixed 10µ


resistor R3. When the laser beam is inter-
rupted, the voltage on comparator pin 2 060133 - 12

drops below that at pin 3, causing the


output to swing to (almost) the positive
supply voltage and indicating an alarm
condition. This signal can drive a siren,
a computer or a light that hopefully will
deter the intruder. Alternatively it can be
used to ‘silently’ trigger a more sophisti-
cated alarm. Resistor R2 provides some
hysteresis to prevent oscillation when the
two comparator input voltages are almost
equal. Capacitor C1 makes the circuit
immune to short, accidental interruptions
of the beam, e.g., by flying insects. If you
want your circuit to have faster responses
you can reduce its value to 1 µF.
The operation of the circuit is illustrated
by the waveform diagram, which also
proves the hysteresis action that sets an
upper and a lower threshold on the input
voltage. You can also see the delay intro- can ‘see’ the laser beam directly. The
duced by capacitor C1.
The circuit is simple and could be assem-
small hole should be filled with a black
drinking straw so that only light from the
Warning
bled on a piece of breadboard. After direction of the laser beam can enter. All safety precautions supplied with
assembling the circuit and testing it, you With the appropriate setup of the box the laser you are using must be
should mount it in a black box that has and the mirrors, the laser beam is so
just a small hole. You may decide to put intense that even direct sunlight cannot observed. Laser power should be kept
the laser in the same box but only if you affect the operation of the photodiode. as low as possible.
are sure there is no way the photodiode (060133-1)

7-8/2006 - elektor electronics 31


RC Servo
003
Ray King
Tester/Exerciser
The design presented here is for a device
for testing radio control (RC) servos. The
present design has features that make it
especially useful to people designing and
building radio control equipment. By
building a number of these devices in a
single enclosure an entire radio con-
trolled model can be set up and tested
without having to actually use the RC
transmitter.

The most unusual feature of this design As a


is that it doesn’t use a joystick or similar r spec
the p eaders a ial servic
analogue device to determine the servo rojec ct e
t is a ive in RC to our
position. Instead it gives an output of lso o m odell
inclu ffere ing
precisely 1.5 ms that can be changed prog ding all p d as a kit ,
ramm arts, P of pa
up or down in steps of 0.166 ms and and A e rts
BS ca d microc CB,
gives a display on a line of LEDs of the se. T ontro
040 h eo ller
position selected. This is of particular use correct working. A further LED indicates on the button 172 rder code
if you are designing and testing radio selection of this mode. pressed the -71. is
control devices that use the receiver out- Finally the device uses very few compo- output pulse
put directly, enabling a known pulse nents and is extremely cheap to build length will
width to be applied without resorting to since the PIC processor carries out all of be adjusted
using an oscilloscope. With this facility the timing functions. accordingly.
the devices can be calibrated simply The circuitry is a pretty straightforward When first
and quickly. implementation of the good old PIC switched on the cir-
Secondly the device has the ability to 16F84 processor with eight LEDs D1-D8 cuit will output a servo
switch to an ‘exercise’ mode. Selecting and three switches S1, S2, S3 con- pulse of 1.5 ms duration and the
this mode cycles the servo between the nected. The software generates a servo middle LED of the array will be lit. Press-
extremes of its travel and serves as a use- output signal every 20 ms then scans the ing the ‘up’ or ‘down’ buttons will
ful quick test of normal servos to verify switches for a button press. Depending increase or decrease the pulse width by

1 IC2
7805 +9V

R5 R4 R6 R1
C3
10k

10k

10k

10k

100n D1

14
D2
4 6
MCLR RB0
7 D3
K1 RB1
S 17 IC1 8
RA0 RB2 C4
Servo 18 9 D4
under RA1 RB3
1
Test RA2 PIC16F84 RB4 10 100n
2 -AP 11 D5
RA3 RB5
3 12
RA4/T0CKI RB6
13 D6
RB7
D8 OSC2 OSC1
D7
15 16 5
X1

R3 R2
S1 S3 S2
C2 C1
1k

1k

27p 27p
DOWN UP MODE 8MHz

040172 - 11

32 elektor electronics - 7-8/2006


D7 D6 D5 D4 D3 D2 D1

IC2
040172-1
R2 0
D8 C4 K2
K1 R1 +
T C2 R5 R4 R6
+

IC1
S
R3

S1 S3 S2
X1

C1
DOWN UP MODE
C3 ROTKELE )C( 1-271040 040172-1 (C) ELEKTOR

COMPONENTS LIST
Resistors D4, D8 = LED, 3mm, high efficiency, Case: Hammond 1591ATBU
(1/4W 10%) yellow IC socket 18p
R1,R4,R5,R6 = 10kΩ IC1 = PIC16F84(A), DIL18 case, Mains adaptor DC socket
R2, R3=1kΩ programmed, order code 040172-41 PCB, order code 040172-1
IC2 = LM2940, TO220 case (or 5V 1A Project software, free download
Capacitors low drop equivalent) 040172-11 from Elektor website
(5mm lead pitch)
C1,C2 = 27pF Miscellaneous A kit of parts is available from Elektor
C3, C4 = 100nF X1 = 8MHz quartz crystal, 32pF parallel Electronics; order code 040172-71,
load capacitance, HC49 case or low- see SHOP pages or website. Kit
Semiconductors profile model contents as components list.
D1,D2,D3,D5,D6,D7 = LED, 3mm, high K1 = 3 way SIL pinheader
efficiency, green S1, S2, S3 = pushbutton, 1 make contact

0.166 ms and the LED display will move The source code was written using Pro- size) batteries, and then use four alkaline
as appropriate to show the pulsewidth ton PIC Basic+ which then compiles into cells or five NiMH rechargeables to
selected. assembler and object code. For those obtain a raw supply voltage of 6 V. This
At any time the ‘mode’ button may be with a PIC programmer, all project soft- will necessitate the use of a low-drop reg-
pressed which causes the device to ware including the hex and source code ulator for IC2, like the 4805 or the
switch to/from the ‘exercise’ mode. A files is available as a free download, file LM2940 you find suggested here
servo connected to the output will cycle ref. 040172-11.zip, from the Elektor because it will not drain an almost flat
repeatedly from end to end of its travel Electronics website. The PIC is also avail- battery due to its own current. An on/off
— a useful indication of whether the able ready programmed though Readers switch is also recommended. The standby
servo is operational or not. Services under number 040172-41. current consumption of the circuit
An Elektor-style PCB was designed for the Several options are available for power- amounts to about 5 mA.
project and the artwork is shown here. ing the circuit. A 9-V PP3 (6F22) battery
Only one wire is required on the board. may look okay at first blush but then it Finally, PIC burners among you using the
The author’s own prototype incorporated will be exhausted quickly even with small hex file should set the config bits as fol-
two of these boards in a single enclosure servos. A mains adaptor (‘battery elimi- lows: HS (10) (since xtal > 4 MHz );
so that two servos on a model can be nator’) is possible, but precludes field WDTE disable (0); PWRTE enable (0).
tested at once. The board shown in the use. Undoubtedly the most elegant The other config bits are for code protec-
photograph is a prototype differing from approach, then, is the use of a case with tion and their use is at your discretion.
the final version in minor detail. a battery compartment for penlight (AA (040172-1)

IR Remote Control Tester


Malte Fischer piezo buzzer directly to an IR receiver IC.
004
much easier to carry around than bulky
This method is almost as simple as con- test equipment.
This small circuit is ideal for checking the necting a photodiode directly to the input Operation of the remote control is indi-
basic operation of an infrared remote of an oscilloscope, but has the advan- cated by the buzzer making a chattering
control unit. The circuit is based on the tage that no oscilloscope is needed: the noise. The circuit is very sensitive and has
brilliantly simple idea of connecting a compact unit is always ready to use and a range of several metres.

7-8/2006 - elektor electronics 33


The TSOP1738 integrated IR devices from other manufacturers
receiver accepts, amplifies and IC1 can be used, and of course car-
demodulates the IR signal from the 78L05 R1
rier frequencies other than
100 Ω
remote control, producing an out- C3
38 kHz can be used. The circuit
put with a frequency of around BT1 BZ1 still works if there is a mismatch
700 Hz. The piezo buzzer is con- 4µ7 16V
between the nominal carrier fre-
nected to its output, rendering the C1 C2
IC2 quencies of the transmitter and
9V
signal audible. 100n 100n receiver IC, but range is reduced.
All the other components are sim- It is still, however, adequate for
ply concerned with producing a determining whether a remote
TSOP1738
stable 5 V power supply from the control is producing an IR signal
9 V PP3-(6F22) type battery. 060120 - 11 or not.
Instead of the TSOP1738 similar (060120-1)

Step-Down Converter
005
Dirk Gehrke, Texas Instruments
Controller
+3V3...+6V R1
33m Ω
The TPS6420x controller is designed to
S
operate from one to three series-con- G T1

nected cells or from a 3.3 V or 5 V sup- IC1 4


Si2323
ply obtained from a USB port. At its out- 5
I SENSE
6
D L1 +3V3
VIN SW
put it can produce 3.3 V at 2 A, suitable 5µH 24m Ω
2A9
for powering a microcontroller-based sys- TPS64202 R2 R3
C3
DBV
tem. With a suitable choice of external 1 3 619k
EN FB 4p7
components (inductor, P-channel MOS- Optional
2
FET and Schottky diode) the device can C1 C4

be operated over a wide range of possi- R4


47µ
X7R 10µ D1 C2 6V3
ble output voltages and currents. A fur- 100m Ω
365k

10V

ther advantage is its extremely low qui- MBRM120


escent current consumption in power-
down mode (100 nA typical) and in 050267 - 11

no-load operation (20 mA). Also, if the


input voltage is less than or equal to the
desired output voltage, the device can TPS On time Off time Applications
connect the output directly to the input.
Ideal for high efficiency over the
Using just a few external components the 64200 1.6 µs 600 ns
entire range of output loads
TPS6420x can cover an output voltage
range from 1.2 V up to the input voltage Reduced on-time for higher fre-
at up to 3 A, as long as a suitable P- 1.6/0.8/0.4/ quency operation than TPS64200,
64201 600 ns
channel MOSFET and Schottky diode 0.2 µs with switching frequency outside
audio range
are used. The device is an asynchronous
step-down converter which, unlike the
Ideal for high switching frequency
more widely-used PFM (pulse-frequency
applications where the mark-space
modulation) and PWM (pulse width ratio approaches 1, such as con-
modulation) types, involves a constant 64202 0.6/0.8/0.4 µs 300 ns
verting 3.8 V to 3.3 V; the mini-
on-time and/or constant off-time. Con- mum off time determines the
ventional controllers operate in PWM switching frequency
mode at medium to high loads, switch-
ing to PFM at lower loads in order to Ideal for circuits with a low mark-
minimise switching losses. The controller space ratio where high switching
frequency is required, such as con-
described here also adjusts its switching 64203 0.6 µs 600 ns
verting 5 V to 1.5 V; the minimum
frequency in accordance with the load on time determines the switching
to achieve a similar effect to the frequency
PFM/PWM controllers.

34 elektor electronics - 7-8/2006


The circuit diagram shows a classical inal value. At very low output currents the If the Si2323 P-channel MOSFET from
step-down converter with an input volt- controller therefore operates in ‘discon- Vishay-Siliconix is not available, the
age range from 3.3 V to 6 V and an out- tinuous mode’ (DCM). Each switching IRLML6401 (12 V type) or IRLML6402
put voltage of 3.3 V at a current of up to cycle begins with the current at zero. It (20 V type) from IRF can be used instead.
2 A. The optional 33 mΩ shunt resistor rises to the threshold or maximum value, Both these types have a higher on resist-
provides for current limiting. The and then falls again back to zero. At the ance, but do offer a lower gate capaci-
TPS64202 offers a minimum on-time moment of switch-off the Schottky diode tance. An alternative for the Schottky
selectable between 1.6 ms, 0.8 ms, causes the residual energy in the induc- diode suggested is the MBRM140 (avail-
0.4 ms and 0.2 ms and a fixed off-time tor to appear as a quickly-decaying oscil- able from Digi-Key and Farnell), although
of 300 ns. A MOSFET in the supply volt- lation at the resonant frequency of the this is in an SMB package rather than the
age path is switched on by the controller output filter. This low-energy oscillation in Powermite package of the MBRM120.
for as long as is necessary for the output discontinuous mode is normal and has The voltage drop at 1 A is somewhat
voltage to reach its nominal value, or no adverse effect on the efficiency of the higher: 0.6 V instead of 0.45 V. The
until the maximum permissible current, as converter. It can be damped using the devices are manufactured by IRF and
determined by the shunt resistor, is (optional) RC series network. ON Semiconductor.
reached. If the current does exceed this At higher output currents the switch-down (050267-1)
limit the MOSFET is switched off for converter operates in continuous conduc- Literature at http://www.ti.com:
300 ns. If the nominal output voltage is tion mode (CCM). In this mode the induc- SOT23 Step-Down Controller, document
reached, the MOSFET is switched off and tor current never falls to zero. The output reference number SLVS485
remains in the off state until the output voltage is directly proportional to the TPS6402 Evaluation Module (3.3 V, 2 A),
voltage once again falls below the nom- switching mark-space ratio in this mode. document reference number SLVU093

Fuse Saver
David Clark
006
re1

This circuit will be particularly useful to 12V


10A
those hobbyists who use a ‘breadboard’ to
try out ideas and who also use a simple
D1 D4 D3 D5
‘home-made’ DC power supply consisting OVERLOAD OK
of a transformer, rectifier, smoothing red 1N4001 1N4001 green
capacitor and protective fuse, that is, one K1 K2
without overcurrent protection! RE1 D2
R5
1k

In this circuit, the detecting element is 9V...19V2 320 Ω

resistor R6. Under normal conditions, its +10V...+30V DC R1


1N4001
L1
voltage drop is not high enough to switch D7
*
100 Ω

on transistor T1. The value of R6 can be 4mH


0Ω9 1N4001
altered to give a different cut-off current, T1
as determined by Ohm’s Law, if required. *see text R3 D6
1k
When a short circuit occurs in the load,
1N4001
the voltage rises rapidly and T1 starts to 2N3904 R4 R2 R6
C2 C1
conduct. This draws in the relay, switching
0Ω47
100k

100k

its contacts, which cuts off power to the 47µ 47µ


25V 25V 3W
external circuit, and instead powers the
relay coil directly, latching it in this sec- 060076 - 11
ond state. The circuit remains in this state
until the primary power supply is
switched off. D1 (red) and D5 (green) indicate what nected to the main transformer-rectifier-
Capacitors C1 and C2 hold enough state the circuit is in. capacitor-fuse power supply via K1, and
charge (via D3, D4 and D6, which pre- Inductor L1 slows the inrush of current the output is connected to the (experimen-
vent the charge from being lost to the rest when the circuit is switched on, which tal) load via K2. Note that the input volt-
of the circuit, whichever state it is in) to would otherwise cut off the circuit imme- age must be a floating supply if Vout– is
keep T1 switched on and power the diately. D2 and D7 provide the usual grounded via the load, as Vin– and
relay while it switches over, and R2 and back-emf protection across the coils. Vout– must not be connected together.
R4 provide slow discharge paths. LEDs In use, the input of the circuit is con- Some consideration needs to be given to

7-8/2006 - elektor electronics 35


a number of components. First, the (DC only). R1 could be replaced by a a ‘slow-blow’ type; ‘fast’ fuses will rup-
choice of relay Re1. For the prototype, wire link for operation at input voltages ture before the relay has time to switch.
this was obtained from Maplin, part num- below 10 V, or increased in value, as Also note that this device is meant to save
ber YX97F. This is has a coil resistance determined by either the application of fuses, not replace them. A mains trans-
of 320 Ω, which with R1 forms the col- Ohm’s Law once more or trial and error, former must always be fused if it is not
lector load for T1. Its allowed pull-in volt- for an input voltage above 30 V. designed to run safely, i.e., without pre-
age range is nominally 9 V to 19 V, Coil L1 was obtained from Farnell, part senting a fire hazard, even if its output
which limits the input power supply volt- number 581-240. Finally, the protective has a continuous short-circuit fault.
age to between around 10 V to 30 V fuse for the input power supply should be (060076-1)

Hyper-Simple
007
J. Van der Sterre
Battery Capacity Tester
The circuit described here is eminently
suitable to indicate the capacity of a bat-
tery. We use a cheap electric clock for
M1
this. By connecting a resistor across the
M
battery terminals, the battery is dis-
charged somewhat faster than with the
clock alone. If we pick a resistor with a M1 BT1
value of 5.6 Ω, the discharge current
amounts to 1.2 V / 5.6 Ω = 214 mA. If 1V5
BT1
we multiply this with the number of hours R1

that the clock ran after the battery was 5Ω6


0W5
connected up then we know (approxi-
mately) the capacity of the battery. R1
060153 - 11

When discharging a NiCd battery we


need to make sure we remove the bat-
tery the moment the clock stops running.
NiCd batteries do not tolerate too deep ommend keeping an eye on the voltage connecting a multimeter in parallel with
a discharge very well. We therefore rec- in one way or another, for example by the resistor. (060153-1)

Design for
008
Nils Körber
Märklin Light Signals
which requires just a switch and two red or green signal is wanted, the volt-
diodes. It is based on the fact that, seen age is simply applied via diodes D3 and
Märklin’s light signal Type 74391 (block- from en electronics point of view, the light D4. Change-over switch S1 then deter-
ing signal) for size HO model railway signal consists of two anti-parallel-con- mines which colour will be seen. Surely
sets is fairly new and, at 10 euros nected LEDs with dropping resistors. a very economical solution.
(£7·00), reasonably affordable. There is, If in more complex setups it is required to
however, a little problem in that its oper- The lower section at the right of the dia- have direct control over which colour the
ation requires the use of signal keyboard gram, Da, Db, Ra and Rb represents the light signal on the track is to be, it suffices
Type 72750, which makes the setup not typical inner circuit of such a light signal. to add two further anti-parallel-connected
only more expensive but also inflexible. When the output voltage of the light LEDs, D1 and D2, in the connection
There is, fortunately, another solution, power source is applied to the circuit, between switch S1 and the light signal.
simpler and much more economical, both LEDs light. However, since only a So far, so good. But now for a few spe-

36 elektor electronics - 7-8/2006


cial aspects. Typically, a light signal con-
tains a standard green LED, whereas the R1
1k5
red LED is usually a low-current type. isolated track selection
Therefore, the dropping resistors have dif- red
S1

ferent values. In the present circuit it is (motor current)


therefore necessary for D2 also to be a
low-current type. Unfortunately, recent
Märklin light signals are already fitted
with two low-current LEDs. This can be
ascertained by temporarily connecting D3 D1
"green"
the present circuit to the light signal and yellow
light blue
measuring the direct current for the two D4
(lighting current) Ra Rb
switch positions. Standard LEDs draw "red"

560 Ω
2x 1N4148 D2

3k3
more than 10 mA, whereas low-current
types draw not more than 5 mA. Da Db

If D3 and D4 are Type 1N4148, it is brown


dark blue
green red

possible to use the circuit with about five (lighting current)


light signals fitted with standard LEDs or
050170 - 11
with up to twenty fitted with low-current
LEDs. If Types 1N4001 are used, up to
1 A can be drawn.
dropping resistors (or an additional one last rail before the light signal and power
With railway tracks for analogue opera- in series with D1 and D2) must be used. this rail via the second contact of S1 —
tion, which normally use 16 V AC power Finally, a tip that is as simple as it is prac- as already shown in the circuit diagram.
sources, Märklin light signals may be tical. To retain the superb facility of ana- Many other hints and advice for model
connected directly or via D1/D2. In case logue tracks whereby the train does not railway enthusiasts may be found on the
of digital tracks that use higher supply drive on when the signal is red, but stops author’s web site: www.koerber-home.de
voltages, correspondingly higher-value automatically, isolate the power line to the (050170-1)

USB Switch for Printers


Liam Maskey
K2 D+ D+ K1
009nected up, the presence of the 5-
USB-B 3 3 USB-B
volt power signal on its USB port
This circuit switches a printer’s 2 D– D– 2 causes Re1 to switch over to the
USB connection from a PC to a 1 +5V 1 printer’s connection to K2 and the
laptop. What was needed was 5 6 4 4 6 5 laptop. Unplugging the laptop
a method of allowing a laptop to S1 returns control of the printer back
use the printer occasionally while to there PC.
+5V USB2
at all other times the printer The circuit was tested on a USB-
would be connected to the PC. D1 RE1
1.1 compliant printer and a PC
Instead of unplugging the printer and laptop that had USB-2.0 high-
from the PC and then into the speed ports. The PCB traces for
D+ K3
laptop, the circuit switches the 1N4001 D+ and D– should be kept as
3 USB-A
USB connection automatically. D– 2 short as possible and ideally
K1 and K2 are standard type-B 1 should be the same length. The
USB sockets, while K3 is a USB 4 6 5
relay should be a low-power type
type-A socket. The USB lead from (5 V at <100 mA coil current) with
the laptop plugs into K2 while the 060103 - 11 two changeover (c/o) contacts.
PC’s USB lead plugs into K1. A Switch S1 is only required in sit-
USB cable from K3 connects the uations where the two computers
printer to this circuit. The cable from the nected to K2, so the USB signal to the you want to select between are perma-
PC is always plugged in while the cable printer comes from the PC via K1, the nently present and connected up to the
from the laptop is only connected when- normally closed contacts of relay Re1, circuit. The switch then selects the com-
ever this device needs to print. through to K3 and from there to the puter having access to the printer.
In normal operation the laptop is not con- printer. Whenever the laptop is con- (060103-1)

7-8/2006 - elektor electronics 37


010 Stepper Motor Controller
U+

R2 R8
C3

10k
100k

S1 1000µ
IC3 25V
5
1
4
R1
R4 16 2
1k

470k 3 3
0
CTRDIV10/ 2 D1 TDA2030
1
DEC D2 "I"
4
IC1 2
7 D3 M1
1 IC2 3 IC5 A2 A1
3 7 10 D4 "Q" 5
4 1
5
6 14 1
LF356 & + 5 4
2 5
M
6 4x 2
4 P1 13 6 1N4148
7
3 B1 B2
9
4017 8
11 TDA2030
R5 9
15 12
330k CT=0 CT≥5 IC4
1M 5
2
8
4
1

3
R3 R6 R7 R9
C1 C2
TDA2030
5k6

5k6

10k
100k

0µ47 2µ2
16V

050246 - 11

Gert Baars ing edges of the clock signal. The Grey


code can be generated from the outputs
Stepper motors are available in several by using two OR gates, which are
versions and sizes with a variety of oper- formed here using two diodes and a
ating voltages. The advantage of this resistor for each gate, to produce the I
general-purpose controller is that is can and Q signals.
be used with a wide range of operating Here ‘I’ stands for ‘in-phase’ and ‘Q’ for
voltages, from approximately 5 V to ‘quadrature’, which means it has a 90-
18 V. It can drive the motor with a peak degree phase offset from the I signal.
voltage equal to half the supply voltage, It is common practice to drive the wind-
so it can easily handle stepper motors ings of a stepper motor using a pair of
designed for voltages between 2.5 V push-pull circuits for each winding, which
and 9 V. The circuit can also supply is called an ‘H bridge’. That makes it pos-
motor currents up to 3.5 A, which means sible to reverse the direction of the cur-
it can be used to drive relatively large rent through each winding, which is nec-
motors. The circuit is also short-circuit essary for proper operation of a bipolar
proof and has built-in overtemperature motor (one whose windings do not have mentioned I and Q signals, with the
protection. centre taps). Of course, it can also be inverting inputs set to a potential equal
used to properly drive a unipolar motor to half the supply voltage. That potential
Two signals are required for driving a (with centre-tapped windings). is supplied by the third TDA2030. The
stepper motor. In logical terms, they con- Instead of using a push-pull circuit of this outputs of IC3 and IC4 thus track their
stitute a Grey code, which means they sort, here we decided to use audio ampli- non-inverting inputs, and each of them
are two square-wave signals with the fier ICs (type TDA2030), even though drives one motor winding.
same frequency but a constant phase dif- that may sound a bit strange. In func- The other ends of the windings are in turn
ference of 90 degrees. IC1 generates a tional terms, the TDA2030 is actually a connected to half the supply voltage, pro-
square-wave signal with a frequency that sort of power opamp. It has a difference vided by IC5. As one end of each wind-
can be set using potentiometer P1. This amplifier at the input and a push-pull ing is connected to a square-wave signal
frequency determines the rpm of the step- driver stage at the output. IC3, IC4 and that alternates between 0 V and a poten-
per motor. The Grey code is generated IC5 are all of this type (which is econom- tial close to the supply voltage, while the
by a decimal counter in the form of a ically priced). Here IC3 and IC4 are other end is at half the supply voltage, a
4017. Outputs Q0–Q9 of the counter go wired as comparators. Their non-invert- voltage equal to half the supply voltage
high in succession in response to the ris- ing inputs are driven by the previously is always applied to each winding, but it

38 elektor electronics - 7-8/2006


alternates in polarity according to the where R5 is given in kΩ. stop the motor. When S1 is closed, the
states of the I and Q signals. That’s If a stepper motor is switched off by clock signal stops but IC2 retains its out-
exactly what we want for driving a bipo- removing the supply voltage from the cir- put levels at that moment, so the continu-
lar stepper motor. cuit, it’s possible for the motor to continue ous currents through the motor windings
The rpm can be varied using potentiome- turning a certain amount due to its own magnetically ‘lock’ the rotor in position.
ter P1, but the actual speed is different for inertia or the mechanical load on the The TDA2030 has internal overtempera-
each type of motor because it depends motor (flywheel effect). It’s also possible ture protection, so the output current will
on the number of steps per revolution. The for the position of the motor to disagree be reduced automatically if the IC
motor used in the prototype advanced by with the states of the I and Q signals becomes too hot. For that reason, it is
approximately 9° per step, and its speed when power is first applied to the circuit. recommended to fit IC3, IC4 and IC5 to
could be adjusted over a range of As a result, the motor can sometimes ‘get a heat sink (possibly a shared heat sink)
approximately 2 to 10 seconds per revo- confused’ when starting up, with the when a relatively high-power motor is
lution. In principle, any desired speed can result that it takes a step in the wrong used. The tab of the TO220 case is elec-
be obtained by adjusting the value of C1, direction before starting to move in direc- trically bonded to the negative supply
as long as the motor can handle it. The tion defined by the drive signals. voltage pin, so the ICs can be attached
adjustment range of P1 can be increased These effects can be avoided by adding to a shared heat sink without using insu-
by reducing the value of resistor R5. The the optional switch S1 and a 1-kΩ resis- lating washers.
adjustment range is 1:(1000 + R5)/R5, tor, which can then be used to start and (050246-1)

Paraphase Tone Control


Ton Giesberts
011
As opposed to the widespread Baxandall
circuit (dating back to 1952!) a ‘para-
phrase’ tone control supplies a straight
frequency response as long as the bass
and treble controls are in the same posi-
tion. This unique property makes the
‘paraphase’ configuration of interest if
only treble or bass needs to be adjusted
— it is not possible to adjust both at the
same time! Essentially, it’s the difference
in setting of the tone controls that deter-
mines the slope of the frequency
response, and the degree of bass/treble
correction.

The circuit in Figure 1 is simplicity itself,


based on two networks C1-C2-C3/R9-
R10-R11 and C5-C6-C7/R12-R13-R14.
The first is for the high frequencies (tre-
ble) response, the second, for the low fre-
quencies (bass). The roll-off points have Specification
been selected, in combination with C4
Current consumption (no signal) 8 mA
and C8, for the sum of the two output sig-
nals to re-appear with a ‘straight’ fre- Max. input signal 1 Veff (at max. gain)
quency response again at the output. Gain at 20 Hz +13.1 dB max.
Roughly equal output levels from the net- –6.9 dB min.
works are ensured by R6 = 7.15 kΩ and
at 20 kHz +12.2 dB max.
R8 = 6.80 kΩ. However, the operating
–7.6 dB min
principle requires the input signals to the
two networks to be in anti-phase. Gain (controls at mid position) 2.38 x
For best operation the networks are Distortion (1 Veff, 1 kHz) 0.002% (B = 22kHz)
driven by two buffers providing some 0.005% (B = 80 kHz)
extra gain. The gain of IC1.D is slightly

7-8/2006 - elektor electronics 39


R2 R6
10k 7k15

K1 6 K2
R1 C9 R16
2 13 7
10k C1 C2 C3 C4 IC1.B 100 Ω
1 14 5
IC1.A IC1.D 2µ2
3 P2 12 R17
47n 47n 47n 68n

100k
TREBLE
R9 R10 R11
100k IC1 = TL074

8k2

8k2

8k2
R4 R5
+15V

1k
10k
+15V
R3 R7 C10
1k
10k

R15
100n
C5 C6 C7 4

1M
P1
10n 10n 10n
IC1
11
BASS C11
10
R12 R13 R14 C8
100k 8 100n
IC1.C 2k2 2k2 2k2
9
100n -15V

R8
6k8 -15V 060015 - 11

higher than that of IC1.C to ensure the mid positions for a straight response. which may be increased (within limits) by
overall response curve remains as flat as To audio fans, the circuit is rewarding to using lower resistor values here. The val-
possible at equal settings of the tone con- experiment with, especially in respect of ues shown ensure a tone control range
trols. Because each network introduces a the crossover point of the two networks. of about 20 dB.
loss of about 1.72 (times), IC1.D and R3 and R4 determine the control range, IC1.B buffers the summed signal across
IC1.C first amplify the signal. The gain is
set at about 8 (times) allowing input sig-
nal levels up to 1 V to pass the circuit at
maximum gain and distortion-free. The
2 +6

+4
gain also compensates the attenuation if
you prefer to keep the tone controls at the +2

+0

d
-3
COMPONENTS LIST B
r -5

Resistors A -7
R1-R4 = 10kΩ -9
R5,R7 = 1kΩ
R6 = 7kΩ15 -11
R8 = 6kΩ80
-13
R9,R10,R11 = 8kΩ2
R12,R13,R14 = 2kΩ2 -15
R15 = 1MΩ 20 50 100 200 500 1k 2k 5k 10 k 20 k
R16 = 100Ω Hz 060015 - 12

R17 = 100kΩ
P1,P2 = 100kΩ preset or chassis-
mount control potentiometer, linear
law
3
Capacitors
1-510060
C1,C2,C3 = 47nF MKT, lead pitch ROTKELE )C(
K2

K1

5mm OUT1

C4 = 68nF MKT, lead pitch 5mm


C5,C6,C7 = 10nF MKT, lead pitch R1
C9

R2
5mm
R17
R16

R15 C11
0

C8,C10,C11 = 100nF MKT, lead


C10

pitch 5mm IC1


C9 = 2µF2 MKT, lead pitch 5mm or
C5

C8

7.5mm
R12

C7

-
R11
R8

R7

R5
R6

C1

Semiconductors
R13

060015-1

IC1 = TL074
C4

R9
C6

Miscellaneous R14 R10


C3

C2

K1,K2 = line socket, PCB mount, e.g.


P1

P2

T-709G (Monacor/Monarch) (C) ELEKTOR


R3

R4

060015-1
PCB, ref. 060015-1 from The
PCBShop

40 elektor electronics - 7-8/2006


R15. C9 removes any DC-offset voltage stable at unity gain. Also, watch the sup- A simple circuit board was designed for
and R16 protects the output buffer from ply voltage range. the project (Figure 3). Linear-law poten-
the effects of too high capacitive loads. The graph in Figure 2 (produced by our tiometers may be fitted directly onto the
R17, finally, keeps the output at 0 V. Audio Precision analyser) shows nine board. Two boards are required for a
The choice of the quad opamp is rela- response curves obtained by setting the stereo application. The relevant connec-
tively uncritical. Here the unassuming two tone controls to minimum, mid posi- tions on the boards are then wired to a
TL074 is used but you may even apply tion and maximum. Note that 0 dB is rel- stereo control potentiometer.
rail to rail opamps as long as they are ative to the mid position of the pots! (060015-1)

Modulated Light Barrier


Heino Peters
012
1 +5V

It’s good fun to keep an eye on all sorts of R2 R5 R3


things in your environment and on the

10 Ω
1k

10k
basis of events in this environment to
switch, for example, lamps or buzzers.
To help with this, the light barrier 4 8 4 8
described here can be used to guard an R R4 R D1
7 7
entrance. You can use it to signal of R1
DIS 10k DIS
IC1 IC2 LD274 IR
someone is walking through the corridor,
6k8

3 P1 3
OUT OUT
or to check if the car has been parked far 2 TR 555 2 TR 555 R6

10k
enough in the garage to be able to close 6 THR 6 THR
T1
the door. The circuit consists of a trans- CV 10k CV C3

mitter, which sends modulated infrared C1 5 1 C2 5 1


100µ
light and a receiver, which recognises 100n 1n BC517
16V

this. The circuit used here is almost insen-


sitive to daylight or fluorescent light and 060086 - 1 - 11
therefore can be used outside.
The transmitter (Figure 1) generates
about 1000 times per second, for a partially charge via R8, but this is not of output, C5 will be immediately discharged
period of 540 ms, a burst of 36 kHz. sufficient duration to exceed the voltage of and the output of IC4b will become a ‘1’.
IC1 has been set with C1, R1 and R2 to 2.5 V. Only when the light barrier is inter- With R9 and C5 this signal is stretched to
a frequency of about 1000 Hz. The out- rupted will C4 charge far enough that the about one second. If you increase the
put of IC1 ensures that IC2 will oscillate output of IC4a will toggle and become a value of R9 to 100 kΩ, then this will
about 1000 times per second for a ‘0’. Because IC4a has an open-collector become about 10 seconds. R12 and R13
period of about 540 ms. IC2 is set to a
frequency of 36 kHz with C2, P1, R4
and R5. The output of IC2 drives the IR
LED D1 via transistor T1. C3 and R3 pre-
2 +5V
TSOP1736
vent the reasonably high current through R9 R10 R12 R15
8
D1 from generating too much interfer-
10k

10k

3k3
100k

IC4
ence on the power supply rail. 4
The receiver (Figure 2) is quite a simple R14
light beam
design, because IC3 already does a lot of 100k interrupted

the work for us. When the IC ‘sees’ an IR- R13


5
signal with a frequency of 36 kHz, the out- IC3
1k
3 7
put of IC3 will become ‘0’. The transmit- 2
1 6
IC4.B
D2 IC4.A
ter circuit alternates between sending an 3 2
IR-signal of 36 kHz for 540 ms and is
1N4148
quiet for 470 ms. When this signal arrives 1 C4 C5
R11
IC4 = LM393
10k

at IC3, C4 will discharge via D2. Because TSOP1736


100n
the non-inverting input of IC4a is set to 100µ
16V
2.5 V, with the aid of R10 and R11, the
output of IC4a will be a ‘1’. In the inter- 060086 - 1 - 12

vening quiet periods of 470 ms, C4 will

7-8/2006 - elektor electronics 41


are included to prevent chatter of the out-
put around the trigger point, although 3 IR-LED LD274 IR-sensor TSOP1736
there is not really a risk of that happening
in this circuit. Together with R14, the out- D1

put of IC4b delivers a clean logic signal


IR
that we can use for further processing.
The quickest way of calibrating the fre- 060086 - 1 - 13
quency of IC2 to 36 kHz, using P1, is
with the aid of an oscilloscope. If you do
not have one of those, then point the IR- You should not have a problem with between the transmitter and receiver. In
LED D1 at the receiver IC3 and turn P1 ambient light with this circuit. If you do this case the solution is also a short
so that the voltage on the inverting input have a problem because, for example, piece of tube for both the transmit LED
of IC4a is as low as possible. Make sure there is direct sunlight on IC3, then you as well as the receiver (Figure 3).
that IC3 during the calibration does not will need to place it inside a small tube Make sure that the tubes are opaque
receive too high a signal by placing the and point it at the IR LED. In this way no (paint black or use water pipe, for
IR-LED a considerable distance away or direct sunlight can reach the receiver. If example). The wires to the IR LED can
by not pointing directly at the receiver. If the IR LED and the receiver are placed be several meters long without any
this procedure is not that successful then too close together it is possible that the problems. Do not place the receiver IC
just set P1 to the centre position, this receiver will sense light reflected off the too far from the circuit.
works just fine usually. walls, even when someone is standing (060086-1)

Power MOSFET
013
Wolfgang Schubert
Bridge Rectifier
F1

R5A
The losses in a bridge rectifier can easily 4A T
IRFZ48N
82 Ω

IRF4905
become significant when low voltages
are being rectified. The voltage drop R5 R1
10k

10k

across the bridge is a good 1.5 V, which


is a hefty 25% with an input voltage of 13
14
6 V. The loss can be reduced by around 12
IC1.D
D D
50% by using Schottky diodes, but it G T1 G T3
G S
would naturally be even nicer to reduce it S S D
to practically zero. That’s possible with a R9 IRFZ48N R11 IRF4905
68k

68k

2
1
synchronous rectifier. What that means is R6 R2 3
IC1.A

using an active switching system instead


8k2

8k2

of a ‘passive’ bridge rectifier. 6V 4 C1 C2 C3


IC1 = TL084 IC2
The principle is simple: whenever the 3A
R7 R3 11 2200µ
16V
100n 2200µ
16V
instantaneous value of the input AC volt-
8k2

8k2

10
age is greater than the rectified output 8
IC1.C
voltage, a MOSFET is switched on to R12 R10
68k

68k

9
IRF4905 IRFZ48N
allow current to flow from the input to the S S

output. As we want to have a full-wave G T4 G T2


5
rectifier, we need four FETs instead of 7 D D
IC1.B
four diodes, just as in a bridge rectifier. 6
R8 R4
R1–R4 form a voltage divider for the rec-
10k

10k

tified voltage, and R5–R8 do the same


for the AC input voltage. As soon as the R8A
82 Ω

input voltage is a bit higher than the rec-


tified voltage, IC1d switches on MOSFET 060042 - 11
T3. Just as in a normal bridge rectifier,
the MOSFET diagonally opposite T3 must
also be switched on at the same time. next half-wave, so IC1c and IC1a switch not fully symmetrical. The input voltage is
That’s taken care of by IC1b. The polarity on T4 and T1, respectively. reduced slightly to cause a slight delay
of the AC voltage is reversed during the As you can see, the voltage dividers are in switching on the FETs. That is better

42 elektor electronics - 7-8/2006


than switching them on too soon, which have internal diodes, which are shown in the FETs. The IRFZ48N (55 V @ 64 A,
would increase the losses. Be sure to use in dashed outline here for clarity. They 16 mW) specified by the author is no
1% resistors for the dividers, or (if you allow the circuit to start up (with losses). longer made, but you might still be able
can get them) even 0.1% resistors. There’s not much that has to be said to buy it, or you can use a different type.
The control circuit around the TL084 is about the choice of FETs – it’s not critical. For instance, the IRF4905 can handle
powered from the rectified voltage, so an You can use whatever you can put your 55 V @ 74 A and has an internal resist-
auxiliary supply is not necessary. Natu- hands on, but bear in mind that the loss ance of 20 mΩ.
rally, that raises the question of how that depends on the internal resistance.
can work. At the beginning, there won’t Nowadays, a value of 20 to 50 mW is At voltages above 6 V, it is recom-
be any voltage, so the rectifier won’t work quite common. Such FETs can handle cur- mended to increase the value of the 8.2-
and there never will be any voltage... rents on the order of 50 A. That sounds kΩ resistors, for example to 15 kΩ for
Fortunately, we have a bit of luck here. like a lot, but an average current of 5 A 9 V or 22 kΩ for 12 V.
Due to their internal structures, all FETs can easily result in peak currents of 50 A (060042-1)

Multimeter
as Lightning Detector
Karel Walraven
014
Most digital multimeters have a sensitiv-
ity of 200 mV and in input impedance of
10 MΩ. With this information you can
calculate that at full scale there will be a
current of 20 nA (nano-ampères). In real-
ity you have a very sensitive ammeter in
your hand.
Now that we know this, it becomes a
mission to do something with that knowl-
edge. In other words, here is a solution
that requires a problem...

For example, try the following:

Connect the ‘COM’ of the voltmeter to


ground (safety earth from a power point,
central heating, plumbing, etc.). Connect
an old bicycle wheel spoke or a length of
thin copper wire to the ‘V’ socket so that
you get a kind of antenna. When you
place this impressive looking apparatus
on a windowsill during a thunderstorm
and set the meter to the 200 mV range,
you will, with a bit of luck, see nice
deflections during lightning strikes. A nice
thing is that you will see a build-up of
static charge long before the flash, and
immediately after the lightning flash the blade somewhere. Attach this razor blade Most of the mantles used in gas and
charge is gone. Be aware of your own at the top of the antenna. And again, be petroleum lamps contain a small amount
safety and those of others: Don’t walk out- careful: keep children and pets away. of radioactive material and also smoke
side with the thing or surreptitiously lead In the picture you can see an assembly detectors that work with an ionisation
the ‘antenna’ to the outside. This is really were the top of the antenna has one turn. chamber are (lightly) radioactive. It is bet-
dangerous. In these modern times people The razor blade is clamped in this and ter to leave the smoke detectors alone,
still die from lightning strikes! in addition it is a lot harder to injure your- because they often contain very poison-
According to theory it is possible to self this way. ous substances, but a piece of lamp man-
improve the lightning detector somewhat. The ‘reception’ can be improved a lot tle could be secured to the razor blade
A sharp point or edge collects more than a more by ionising the air in the region of with some two-component epoxy glue.
rounded one. You probably have a razor the antenna with the aid of radioactivity. (064015-1)

7-8/2006 - elektor electronics 43


Preset Circuit
015 for Servos
+5V
IC1
7805

K1
R3
C3 C4 C2 C1
33k

100n 1000µ 100n 330n


16V

14

16 13
RA7/OSC1/CLKIN RB7/T1OSI/PGD
15 12
RA6/OSC2/CLKOUT RB6/T1OSO/T1CLK/PGC
4 11
RA5/MCLR/VPP RB5
3 IC1 10
RA4/TOCLK/CMP2 RB4/PGM
2 9
RA3/AN3/CMP1 RB3/CCP1
1 8
RA2/AN2/VREF RB2/TX/CK
18 7 S5
RA1/AN1 PIC16F628 RB1/RX/DT
17 6
RA0/AN0 RB0/INT

SAVE 1
5
S1 S3 S6
D2 D1

MIN MAX
+ RECALL 1 SAVE 2
S2 S4 S7
R2 R1
1k

1k

- RECALL 2 SAVE STARTUP

060082 - 11

Elmar Jongerius need to be repeated about every 20 ms. A Also make sure that the servo is con-
pulse duration of 1.5 ms corresponds nected correctly. Different manufacturers
This circuit was called into life to operate approximately to the neutral position of the use different colour codes. Fit C3 as
servomotors from the model world. The servo. The limit positions of the servo are at close as possible to the PIC. This is
emphasis here is remembering certain pulse durations of about 0.8 and 2.2 ms because C3 serves to suppress interfer-
preset values. For this, the internal mem- (this depends on the type of servo). ence from the servo.
ory of a PIC16F628A is used. The program running in the microcon- The software for the project has been writ-
The module can be used to automate var- troller consists of a loop, which is ten in PICbasic and includes comments.
ious mechanical functions. In addition to repeated every 20 ms and comprises the
the usual model building applications, following steps:
the circuit can also be used for the oper- No. Name Function
ation of small cranes, mirrors, etc. The • check for pushbutton presses; Move the servo in the
preset-circuit can also be useful when • check for valid values and turn on one S1 Up
positive direction
doing demonstrations. of the LEDs if the limit value has been
The hardware is very simple by design. reached; Move the servo in the
S2 Down
When the circuit is powered up, it auto- • send the pulse; negative direction
matically drives the servo to the initial • wait 20 ms.
position. The circuit is operated using Recall the value
S3 Recall 1
seven pushbuttons. The table details the When checking for pushbutton presses, of Set 1
functions of the pushbuttons. The pull-up the IC will immediately carry out the cor-
Recall the value
resistors for the pushbuttons are already responding action, for example storing a S4 Recall 2
of Set 2
built into the PIC and the de-bouncing is value in EEPROM. Because the buttons
handled by the software. Two LEDs are are checked once every 20 ms, addi- Store the current
S5 Set 1
used to indicate the limit values and the tional de-bouncing is not necessary. position in Set 1
power supply is provided by a standard We have a few things that need to be
circuit around a 7805. Additionally, it is noted regarding the construction of the Store the current
S6 Set 2
position in Set 2
convenient to use a connector so that a circuit. Provide sufficient cooling for IC1,
servomotor can be connected easily. particularly if it is used with a high power Store current position
The operation of the servo is done with servo or if the servo is exerting force con- S7 Set Initial
as initial position
pulses of different lengths. These pulses tinuously, for example against a spring.

44 elektor electronics - 7-8/2006


The program is easily compiled and option- The program code can be downloaded order code 060082-41. A version of
ally changed with the free Lite version of from www.elektor-electronics.co.uk, you’ll PICbasic can be obtained from
the Proton PICbasic compiler. It is however find it filed as number 060082-11.zip. www.picbasic.org.
necessary to remove the comments. A pre-programmed PIC is available as (060082-1)

Direction Sensitive
Light Barrier 016
1 +5V

R8 R11 R9 R12 R13


8 14
10k

10k

10k
100k

100k

IC5 IC6
IC3 4 7
3 D4 RE1
2
1
D2 IC5.A
3 2

1N4148
1
1N4001
T1
TSOP1736 R14
9 13
D 10k
IC6.B
11
C
12 BC517
IC4
5 R S
2
7 10 8
D3 IC5.B
3 6
IC5 = LM393
1N4148
1 IC6 = 4013
R10
C4 C5
TSOP1736
10k

10n 10n

TSOP1736
5 1
D
IC6.A
3 2
C
R S
4 6
060086 - 2 - 11

Heino Peters and off when leaving the room. The cir- sion with one IR transmitter and two
cuit for this has many similarities with the receivers. Both types of installation are
With two light barriers closely positioned modulated light barrier appearing else- shown here, which one is most suitable
one after the other it is possible to estab- where in this Summer Circuits issue. depends on the actual application.
lish in which direction they have been There are two ways to position the light When used in a doorway, one transmitter
crossed. If, for example, you place it at barriers, namely a completely duplicated is sufficient if the receivers are placed
the entrance of the toilet then you can use installation in opposing directions (this to about 5 cm apart. With a wider pas-
it to control the lights: on when entering prevent mutual interference) and a ver- sage, an installation with two separate

2 IC3
TSOP1736
D1
LD274
IC3
TSOP1736
light barrier 1
outward direction

outward direction
inward derection

inward derection

D1
LD274 light barrier 1

light barrier 2 light barrier 2

D1 IC4 IC4
LD274 TSOP1736 TSOP1736

060086 - 2 - 12

7-8/2006 - elektor electronics 45


IR-transmitters is a better solution. This cir- slightly different than those of the modu- IC4 stops receiving IR-light. The 4013
cuit has a range of several meters, even lated light barrier and the circuit is the CMOS-IC used here contains two D-
if the sun shines directly on the receiver! same for both types of installation. flipflops, of which we use only one. The
We again use the TSOP1736, which is instant that light barrier 2 (IC4) is
We use the exact same IR-transmitter(s) sensitive to IR-light that is modulated at a unblocked again, is used to clock the
as for the modulated light barrier. For the frequency of 36 kHz. D2, R8 and C4 state of light barrier 1 (IC3) through to
installation with two separate IR-transmit- ensure that the received pulses from IC3 output Q1. This signal drives the relay
ters it is sufficient to duplicate R6, T1, D1, at the output of IC5a result in a ‘1’ when via T2, which operates the light in the
C3 and R7 from the circuit of the modu- the beam is not interrupted. When the room. The circuit therefore turns the light
lated light barrier. Output OUT (pin 3) of beam is interrupted this output will on or off the moment that light barrier 1 is
IC2 can drive two of these IR-drivers with- become a ‘0’ within about 1 ms. In the uninterrupted.
out any difficulty. The receivers are same way IC5b generates a ‘0’ when (060086-2)

89LPC9xx USB
017 Programming
1 5 +3V3
IC2
LP2985 red
3 4 D3
ON/OFF BYPASS

R4 14
C7 2 C8 C9 T1 JP1
IC2
680 Ω

2µ2 10n 2µ2 7

6402

R3
green yellow C6
4k7

D1 D2
L1 C4 100n

R1 R2 100n IC2 = 74HC02


1k5

1k5

21
FB 20 4
VDD
VCC VCCIO
23 5 18
CBUS0 TXLED RXD P1.0 TXD
22 1 17 IC3
CBUS1 RXLED TXD P1.1 RXD
13 3 12
C3 CBUS2 IC1 RTS P1.2 SCL
14 2 11
CBUS3 PWREN DTR IC2.C P1.3 SDA INT0
10n 12 6 IC2.A 8 IC2.D 10
CBUS4 SLEEP RI 2 10 11 JP2 P1.4 INT1
9 1 9 ≥1 13 6
DSR 3 ≥1 12 ≥1 P1.5 RST
19 10 5
RESET DCD P1.6
15 FT232R 11 4
USBDP SSOP28 CTS IC2.B P1.7
16 5
K1 3 USBDM 4 89LPC935
27 17 6 ≥1
2 OSCI 3V3OUT
28 26
1 OSCO TEST

C2 C1 GND GND GND AGND C5


USB-B 4 7 18 21 25
47p 47p 100n

064013 - 11

Back in November 2003 you could we propose here a USB version. For this plain language: this method only works
already read about a small development we use a well-known USB/RS232-con- with a well-behaved program. And this
system for the (then) new series of con- verter chip, the FT232R. is obviously not always the case in a
trollers from the 8051-compatible The 89LPC9xx series can be placed in development environment!
89LPC9xx-family. A nice feature of the programming mode in two different When you also look at the schematic from
current 89LPC9xx-series is that these ways: by transmitting a ‘break’ over the 2003, you will see that very little has
chips can remain in the circuit while (re- serial port or by providing three defined changed. Really the only difference is that
)programming. All that’s required for this reset pulses immediately after power-on. the RS232 interface chip has been
programming is an RS232 port. But We use the latter method, because this is replaced with the FT232R. As you will
because many modern computers do not a hardware solution. This is because the know, the USB-interface is terribly slow
have an RS232 connection any more, ‘break’ has to be sensed by software. In when the handshake lines such as DTR

46 elektor electronics - 7-8/2006


and RTS are used. Fortunately that is not pole change-over switch does wonders! another voltage then the processor will
the case here, since DTR and RTS are Note that the processor is placed in pro- be powered from its inputs via the pro-
used just once at the beginning and end of gramming mode by three reset pulses tection diodes and programming will not
the programming cycle. The actual pro- after power-on. If the power supply volt- work then!
gramming is done by transmitting com- age does not drop sufficiently before- It is possible (but not necessary) to power
mands and data across the serial port. hand (<2.7 V), then the processor will the circuit through a low-drop regulator
not be placed in power-up mode by the from the USB-connection.
A few remarks: brownout circuit and therefore cannot be You can also omit L1, but it is better to
To be able to program you will have to placed in programming mode either. put a few turns of wire through a ferrite
change a jumper each time. On the one That is why a resistor of 4k7 has been bead.
hand this is a little tedious, but on the added to drop the power supply voltage The pin numbering shown is for the
other hand it gives a little bit of security. faster and lower. Check the inputs in your SSOP-28 package.
During software development a double application. If these are powered from (064013-1)

DC-coupled
Audio Amplifier
Peter Bitzer
018
1
Designs for audio amplifiers with DC cou- R1a
C1a
100k

pling to the load are not often encountered BT1


470µ
these days, even though they offer definite 6V
LS
advantages. One advantage is that there
IC1 9V
is no need for the complication of a sec- 300 Ω
ond (symmetric) power supply; another is R1b
C1b
good frequency and phase response.
100k

Also, no special electrolytic capacitors are 470µ


6V
needed for voltage stabilisation, and
switch-on ‘thump’ is much reduced. 060067 - 11

To try to rescue this class of circuit from


obscurity the author has designed a head-
phone amplifier working along the lines
illustrated in Figure 1. It consists of a
2 approx. 1.5 - 2.5 mA

IC1 = MC1458
voltage divider, a voltage follower and
the loudspeaker in the headphones, 3
8
L
whose other side is connected to the junc- L IC1.A
1
R1a 2 R3a
tion of two electrolytic capacitors, provid-
10k
100k

ing the virtual earth. The potential at this LS a


C1a
point is, of course, half the supply voltage. P1a
50k R4a
All we need to do now is suitably couple log 300 Ω
470µ
6V
1k

BT1
in the audio signal to be amplified. R2
4k7
Figure 2 shows a practical realisation of u C2
this idea in the form of a stereo head- C2
9V
R4b
phone amplifier. The amplifier itself con-
1k

10µ
sists of IC1 and P1, R3 and R4 (giving a P1b 3V LS b
C1b
gain of 11). This part of the circuit 50k
log
R1b R3b
demands no further explanation, and the 300 Ω
470µ
6V
10k
100k

same goes for the voltage divider men- 6


tioned above, formed by R1a and R1b. R IC1.B
7

The signal is coupled in via the poten- 5


R
4
tiometers. C2 and R2 have a special pur-
pose: C2 connects the bottom end of the
potentiometers (ground for the input sig- 060067 - 12

nal) to the virtual earth. However, this


capacitor creates a feedback path which
can lead to oscillation of the amplifier tendency to oscillate. It is possible to cal- nents, but it is better to determine them by
under some circumstances. R2 damps this culate suitable values for these compo- experiment. C2 must be sufficiently large

7-8/2006 - elektor electronics 47


that stray electric fields do not cause unac- electrolytic is unimportant as no significant an oscilloscope. Depending on the
ceptable hum at the output. R2 must be voltage appears across the network. It is degree of asymmetry in the circuit, the
sufficiently large that the voltage at the possible to try the circuit out with the voltage at the virtual earth point can take
amplifier’s virtual earth stabilises quickly C2/R2 network shorted and observe the a considerable time to stabilise.
enough after switch-on. The polarity of the behaviour of the circuit at switch-on using (060067-1)

019 Phono Splitter


+12V IC1
7812T +17V...+30V
2x 1N4148
R8 R10
C12 C11 D2
301 Ω

120 Ω

10µ 10µ
D3 1%
T4
C13 C8 C23 C22

47n 220µ 47µ 22µ


BC560 16V 35V
R12
10k

R13
10k

R1 R6 R2 R3
C1 C2 C3
499 Ω

499 Ω

499 Ω
12k

8n2 8n2
1% 8n2 1% 1%

R11 T1 T2 T3
C9
294k

12p
1% BC560 BC560C BC560C

C4

T5 C15 C19
C10 470p 47µ K2 47µ K3

220n
BC550 R14 R15 R16 R17
T6 C5 C14 C18
105 Ω

105 Ω
1k8

1k8

K1
10µ 1n 1n
1% 1%
J310

R5
100 Ω

1%
R9 R4 R7
D1 C7 C6
D4 D5
22k
1M

C17 C16 C21 C20


100p
2k5 470µ 47n 47n 47n 47n

1N4148 1N4148 1N4148


060119 - 11

Marcel van de Gevel gramme, the signals from two record play- not possible either because all the line
ers had to be sent to a large radio mixing inputs of the small club mixing panel were
This circuit is intended to send the signal panel (which is also the entry point for jin- already in use. Switching between them
from a record player with a magnetody- gles and presenter microphones). For a was also not desirable; another switch
namic (MD) element to two different programme with modern dance music the that can be in the wrong position...
RIAA-amplifiers without creating any signals had to be routed to a small club The circuit works as follows. The feed-
problems with ground loops. A kind of mixing panel that was positioned between back ensures that the signal voltage of
distribution amplifier for phono signals, the two record players. the element will be across R5. The signal
in other words. Connecting in parallel was not an option, current that results from this, runs through
The circuit was originally designed by a because it will create a ground loop and T1 and, because the bases are tied
local VHF FM broadcast station called the load for the element will be wrong. together, also through T2 and T3. This
‘Haarlem 105’. For the golden-oldies pro- An RIAA amplifier for each player was causes a signal voltage across R14 and

48 elektor electronics - 7-8/2006


R16. By connecting one side of R14 or tion amplifier. There is hardly any DC essential to properly terminate an MD-ele-
R16 to the local ground of the mixing voltage across D4 and D5, so that they ment. This is realised in this amplifier with
panel, the signal voltage will be between do not conduct. As a result the outputs for feedback via R11. This results in lower
the input and the local ground of the mix- the signal voltages are well isolated from input noise compared to simply soldering
ing panel. This connection to the local each other, which reduces the risk of a a 47-kΩ resistor in parallel with the input.
ground of the mixing panel is done via ground loop. Trimpot R4 is required because of the
the screens of the phono plugs. The part If there is no connection between the wide tolerance of field effect transistor
of the chassis at the output must definitely ground of the distribution amplifier and T6. Adjust R4 so that there is about 1 V
be isolated. the grounds of the mixing panels then across R1. If R4 is a carbon trimpot, then
D4 and D5 operate like a kind of auto- D4 and D5 will conduct. Everything con- the wiper has to be connected to the pos-
matic ground lift switch. It is the intention tinues to function, but there is a relatively itive side (as indicated in the schematic) to
that the ground from the distribution low-impedance connection between the prevent anodisation of the wiper.
amplifier is connected in one way or screen of X2 and the screen of X3 via
another to the ground of the mixing pan- the diode, which can cause a weak The distribution amplifier has four identi-
els, obviously without creating a ground ground loop if the grounds of the mixing cal channels, enough for two stereo
loop. The DC from T2 and T3 flows via panels are also connected together via record players and is powered from one
the screens of the phono cables and the another path. 7812, which does not need a heatsink.
ground connection back to the distribu- An input impedance of 47 k is absolutely (060119-1)

Transcutaneous Electrical
Nerve Stimulator (TENS)
Klaus Rohwer
020
S1

A Transcutaneous Electrical Nerve Stim-


R1
ulation (TENS) device is, put bluntly, a BC556
100k

T1
D1
machine for giving electric shocks. The
author was prescribed such a device on 8 4
R3 1N4004
R2 R
loan by his orthopaedic specialist. The BT1 C1 7
6k8
47 Ω

DIS
unit has a large number of programmes, IC1
100µ 3
of which he used only one. Measuring 9V 16V
P1 2 TR 555
OUT
TR1
the signals at the output of the device in 6 THR
this mode revealed damped oscillations CV
C3
10k
at a frequency of approximately 1 5 4n7
2.5 kHz, with a repetition rate of approx- C1 C2 400V

imately 100 Hz. How hard can it be to 100n 10n 1 : 10

make such a device ourselves?


The simple circuit uses a CMOS 555 050281 - 11

timer to produce a brief pulse which


feeds a 1:10 miniature transformer.
Together with a 4.7 nF capacitor the and medical suppliers. They generally as a pdf file at http://www.elektor-elec-
transformer makes a parallel resonant cir- have connectors compatible with 2 mm tronics.co.uk.
cuit: the resonance leads to a consider- banana plugs, and so it is possible to (050281)
able increase in the output voltage. make up the necessary cable yourself.
The pulse width can be adjusted using a To treat responsive parts of the body, Warning
potentiometer, here shown combined such as the arm, the potentiometer need
No part of this circuit may be connected to
with the on-off switch. Wider pulses pro- not be turned up far to obtain the neces-
the mains voltage, accidentally or intention-
duce higher output voltages. Since a sary sensation. Less sensitive parts, such ally, by means of any equipment or compo-
peak voltage of up to 200 V can be pro- as the knee or foot, need a rather higher nent including a transformer.
duced, the transformer must have ade- voltage and hence a correspondingly
quate insulation: Conrad Electronics type higher potentiometer setting. Disclaimer
516260-62 is suitable. A low-cost phono Anyone considering building a TENS unit
This circuit is not approved for medical use
socket at the output gives reliable connec- with multiple (microprocessor-controlled)
and must not be used on young children or
tion to the electrode cable. The adhesive programmes might wish to read the arti-
persons suffering from epilepsy. Medical
electrodes shown in the photograph (dis- cle ‘Low Impact Muscle Stimulator’ in the advice should be sought from your GP
posable and permanent types are avail- April 2000 issue of Elektor Electronics. before all use.
able) can be obtained from pharmacies The article is also available for purchase

7-8/2006 - elektor electronics 49


021 Slave Flash Trigger

IC1 = 4013
S1.A R1 R2 S1.B
22k

10k

T1
C3 14 6
IC1 5 S 1
D
4n7 7
IC1.A
2N3906 3 2
C
R
BT1 4

C1 C2
to remote
9V 10 Flash Gun Trigger
100µ 100n R via lead
9 13
25V D
D2 D1
IC1.B
11 12
C
S
2x
1N4148
8
R4 R5 R7
TRI1

1k
1k5

470k D3

R3 R6 R8 TIC206D
D5 D4
C4 1N4148 C5
10k

10k

100k
2µ2 47p
SFH300-2 Tant 16V
READY

060116 - 11

Peter Metcalfe The presented trigger circuit optically fier T1 into the dual flip-flop clock IC1.
receive the camera flashes and either One output of a flip-flop illuminates an
Using any camera in a dull or dark envi- fires at the same time as the first flash or LED as a ‘ready’ signal. A double pole
ronment generally requires the use of sup- has one flash delay before triggering 3-position slide switch, S1, selects none
plementary light. This is a standard tech- the slave flash. Additional counting cir- (e.g. for Kodak camera) or one (e.g. for
nique, and even where adequate natural cuitry is required for more than one Olympus camera) flash delay before
lighting exists, to take conventional film delay (covered by modified circuit not triggering. Both flip-flops are used in the
pictures with enhanced contrast using a presented here). 4013, the clock signal derived from the
‘fill-in’ flash for foreground subjects in flash is used (triggered on the rising
shade. A flash is often built into the cam- Here’s how it works. The response of clock signal) to ‘divide by two’ and trig-
era body, but the internal flash is not usu- phototransistor D5 to the external camera ger the TIC206 triac on the first or sec-
ally powerful enough to illuminate sub- flash is pulsed by a transistorised ampli- ond flash. A simple RC timed reset
jects much more that 3 m or so from the
camera. On SLR cameras a hot-shoe is
provided for triggering an auxiliary, Camera Reset
Ready Clock 1 Clock 2 Reset
more powerful flash, but the small pocket Dependent Delay

cameras are not so equipped. However, R1 & R2


it is possible to trigger a slave flash from
the camera flash by optical means. CLK1 & CLK2
Even so, things are not so simple, for
some cameras, e.g. Olympus, Nikon, Q1 (= D2)

Canon actually fire twice, although it


Q1 (= D4)
appears to be once to the naked eye.
The first flash sets the exposure and the Q2
second takes the picture. Help on syn-
chronisation requirements may be Q2
found at various websites maintained
Trigger point 1
by professional photographers. See 0' delay
Trigger point 2
also www.caves.org.uk/flash/docs.html 1' delay
Return to
for a series of articles with kits by a 4013 triggered on rising clock signal
060116 - 12
initial state
caving enthusiast.

50 elektor electronics - 7-8/2006


mechanism around R6-C4 is used with ger voltage of either polarity can be SFH300-2 photodiode is supplied by
a relatively long delay (about half a sec- handled. Maplin as part number MES NP64U. The
ond) before resetting the entire circuit. The 2N3906 may be replaced by its triac may also be a TIC126D.
The advantage of the triac is that a trig- near equivalent the BC212L. The (060116-1)

Model Railway Turnout


Control
Hans Zijp
022
+U LOGIC
This small circuit can be used to control +5V...+12V
model railway turnouts operated by AC * see text
L1

voltages. A logic level in the range of T1


TRI1 * TIC206D
5–12 V can be used as the control sig- 2x MT2
1N4148
nal. The coils of the turnout are switched
BC547 D1
using triacs. G MT1 TRI2
C1 2x MT2
Changes in the logic level of the input R1
TIC206D
470 Ω
signal are passed on by the buffer stage 47µ
D2
G MT1
built around T1 and T2. The buffer stage 16V
R2 R3
T2
is included to boost the current available MT1 G

10k

10k
MT2
at the gates of the triacs. If the input goes
high, this positive change is passed BC557

through via C1. That causes a positive 050155 - 11

current to flow through D2 (D2 is reverse


biased) to the gate of T3. That triac
switches on, and power is applied to the gised. This circuit takes advantage of the any type of turnout coil.
turnout coil. This situation persists until C1 fact that triacs can be triggered by nega- You can also use a different type of triac
is fully charged. No more current flows tive as well as positive gate currents. if you wish. However, bear in mind that
after that, so the triac does not receive If the turnout coils are energised for too the TIC206 requires only 5 mA of gate
any gate current and switches off. long, you should reduce the value of C1. current, while most triacs want 50 mA.
If the input is set low, a negative current If they are not energised long enough, That will cause the switching times to
flows briefly via C1. It can flow through increase the value of C1. become quite short, so it may be neces-
D2, but not through D1. T4 is switched The TIC206D can handle several sary to reduce the value of R1.
on now, and the other turnout coil is ener- ampères, so it can easily drive just about (050155-1)

Pipe Descaler
Christian Tavernier relatively expensive (especially when we
023
functions at around 10 kHz when the only
discover what they are made of!), we capacitor C6 is operating; in other words,
For many years now, magnetic (or elec- decided to offer this project to our read- when T1 is blocked. The latter is controlled
tromagnetic) water descaler devices have ers. For the price of a few tens of pounds, by another astable oscillator, based on
been showing up on the shelves of Home you will be able to evaluate the state of IC1 this time, but which functions at about
Improvement and other DIY stores all over your own faucets, pots, and other pipes. 1 Hz. When T1 is turned on by IC1,
Europe. Despite the numerous studies The device we’re offering as a project is capacitor C4 is effectively in parallel with
completed on that subject, by manufactur- identical to top-of-the-line items found on C6 which divides the frequency produced
ers as well as by various consumer asso- sale; in other words, it includes the bi-fre- by IC3 by two, i.e. to about 5 kHz.
ciations, none have been able to con- quency option because it seemed that In order to have high amplitude signals,
clude on the efficiency of commercial would be the best way to fight lime scale the power supply operates with a mid-
pipe descalers in a decisive manner. deposits. An initial astable oscillator, point transformer utilized in an unconven-
Since electronic devices of this type are based on a traditional 555, labeled IC3, tional way, with simple half-wave rectifica-

7-8/2006 - elektor electronics 51


tion. The first half of the secondary deliv-
S1 D1 R7
ers 15 VAC which, after being rectified, TR1
4k7
filtered and regulated by IC2, supply sta- 1N4004 0W5
IC2
ble current of 12 VDC to supply power D2 7812
to the oscillators. 220V

The entire secondary makes it possible to 1N4004


have available, after rectification, F1
C2 C3 C5

approximately 40 VDC which is used to 1000µ 25V 10µ 25V 1000µ 63V
100mA
supply power to coils L1 and L2, wound
2 x 15V
around the pipe systems on which the 2VA5...3VA

assembly will work. To do that, IC3 is fol- R1 R4 R5


* see text
lowed by high-voltage transistor T2 (a

1k
22k

6k8
BF457 or equivalent) which chops this 8 4 8 4
high voltage to 5 or 10 kHz frequency R D3 R
7 7
depending on the state of IC1. R2 DIS R6 DIS
IC1 IC3

6k8
LED D3 lights up to signal that the power
100k

supply is present. 2 TR 555


OUT
3 2 TR 555
OUT
3
L1
*
6 THR R3 6 THR R8
Coils L1 and L2 are simple inductors C4

22k

22k
made from insulated flexible wire, with CV 10n CV
1 5 T1 1 5 T2
about ten windings each. They have to C1 C6

be wound around the pipes carrying the 22µ 10n


water to be ‘treated’ and are spaced 25V BC547 BF457
about ten centimeters from each other.
Neither the material of the pipe system, 060105 - 11 L2 *
nor its diameter, should have any influ-
ence on the efficiency of the device.
Paradoxically, these coils have one end ning of this article, that our goal with this device as those sold in stores, so that you
in the air, which may surprise you as project is not to explain the principle but can perform your own tests.
much as us but we indicated at the begin- rather to allow you to make the same www.tavernier-c.com (060105-1)

024 Mains Indicator


RL
C1 C3
220µ 220µ D7
K1

6V3 6V3
230V
D1 D2 D3 D4 D5 D6

C2 C4
220µ 220µ

2x 6V3 6V3
1N5401 D3...D6 = BAT85 044029 - 11

Karel Walraven
unfortunately you’d better duck for cover resistor should be adjusted depending on
if you tried… the magnitude of the current.
It is not always immediately obvious The obvious solution would be to place It would be better to insert two anti-par-
whether a power-consuming appliance is a (power-) resistor in series with the load allel diodes in the power lead. Unfortu-
switched on or not. Examples are the and connect an LED with series resistor nately, the voltage drop is too low to
lamp in the attic or the shed, or electric across it. However, this solution has signif- power an LED. It does work with 6
heating in an awkward place. A nice icant disadvantages, for instance, the diodes, for that matter, but the power loss
solution would be to connect an LED power loss is relatively large (easily a is then also 3 times greater.
directly in series with the appliance, few watts). In addition, the value of the We therefore chose a solution with two

52 elektor electronics - 7-8/2006


diodes, followed by a 4 times voltage
multiplier in the form of a cascade rectifier. 044029-1
That is an energy friendly solution. The C1 C3

H1
current through the LED is automatically K1
limited by the internal impedance of the

D4

D6
D1

D2

D3

D5
1-920440 D7 044029-1
cascade rectifier. The impedance isn’t
that small, despite the large electrolytic
capacitors. Use a low-current LED, other-

H2
C2 C4
wise the LED will probably not be bright
enough. The 1N5404 used here can
handle up to 3 A
(3 A × 230 V = 690 W).
If the power is less than 200 W, you COMPONENTS LIST diode)
D7 = LED, low current
could use two 1N4004s instead.
The voltage across the diodes is a Capacitors:
Miscellaneous:
square wave with an amplitude of about C1-C4 = 220µF 6.3V
K1 = 2-way PCB terminal block, lead
1.3 Vpp. The voltage multipliers are pitch 5mm
Semiconductors:
used to turn this into the LED voltage. D1,D2 = 1N5401 PCB, order code 044029 from The
This will only work if the voltage drop D3-D6 = BAT85 (or any other Schottky PCBShop
across the diodes in the multipliers isn’t
too large. That is why these diodes are
Schottky diodes. These only have about their value, the greater is the amount of tion distances of 6 mm (also in air). For
a 0.35 V voltage drop. Exactly which current that can be delivered. the same reason, use a 5 mm LED (not a
type of Schottky diode that you use is Keep in mind that working with mains 3 mm one!) and fit it as far into the
not too important. voltage can be fatal. Build the circuit in enclosure as possible. Mount the PCB in
You are free to experiment with the value such away that there is no risk that live the enclosure with nylon bolts.
of the electrolytic capacitors. The larger parts can be touched and maintain isola- (044029-1)

Simple Slave Flash


F Roesky
025
+U

Current designs of slave flash units are, in R1


the opinion of the writer, too complicated
and may be simplified without any prob- C1 D1 2M2...4M7

lems and without losing any of their useful-


ness as may be seen from the accompa- 100n 6V2
T1 R3
nying circuit diagram. This proposed cir-
16
10M

cuit offers a number of advantages: 3 R5


TH1

• no need for an additional power BP CTRDIV10/


1
0
2
S1 10M
source, since power is derived via the 103 DEC
2
4 C4 BRX45
sync contacts of the main flash unit; 15
CT=0 3
7
IC1 1n
• automatic reset (no need for a button); 4
10
1
• operates with new as well as older 14
5
6
5
main flash units (contact voltage &
6
+ 7
>100 V); R2 13
8
9

In spite of these proven practical prop-


1M

11
9
74HC4017 12
erties, the design is simplicity itself. It is T2 CT≥5
R4
controlled by a low-current CMOS dec-
10M

8
imal counter IC1, a Type 74HC4017, T3
BC
which enables the entire circuit to be 548
powered directly via the sync contacts of C2 C3
the main flash unit via resistor R1 and BSS89
4n7 47n
voltage limiter D1.
The control circuit based on transistor T1 050047 - 11

7-8/2006 - elektor electronics 53


also operates with minimal quiescent cur- red-eye effect. After about 0.4 second, C1 is recharged to a level at which the
rent. When a flash is detected, T1 pro- when the main flash unit is discharged, circuit is operational again.
vides a clock pulse to IC1. Depending IC1 is reset via R4, C3 and T3. At that If the circuit is to be polarity-sensitive,
on the position of switch S1, the low- instant, the current drain of IC1 connect a small bridge rectifier rated at
power thyristor fires on the second or increases briefly and the voltage across 400 V between the contacts of the main
third flash pulse, so that it does not react C1 collapses. This is of no consequence, flash unit and terminals JP1 and JP2.
to the preliminary flash that prevents the however, since after at most one second (050047-1)

026
Jeff Macaulay
Hybrid Headphone Amp
ECC 82
Potentially, headphone listening can be f
f 5 1a D2 +12V
technically superior since room reflections 4 6
R7
are eliminated and the intimate contact 1N4001
2k 1g

39k
3 7
between transducer and ear mean that T5

only tiny amounts of power are required. 2 8


The small power requirement means that 2g f f 1k C5

transducers can be operated at a small 1 9 BC517


1000µ
2a fM 16V
fraction of their full excursion capabilities T4

thus reducing THD and other non-linear


R4 R6
distortions. C2
T3
BD139

1k
91k

This design of a dedicated headphones V1 C4


amplifier is potentially controversial in 100n ECC82 1 (6)
BC517
that (1) it has unity voltage gain and (2) C1
D1
2200µ
(7) 2 T2 16V
employs valves and transistors in the
10µ
same design. R1 3 (8)

Normal headphones have an impedance 4 5 2x


10k

BC550
of 32 Ω per channel. The usual standard T1

line output of 775 mV to which all qual-


R2 R3 R5
ity equipment aspires will generate a C3
22 Ω
91k

15k

power of 100µ
25V

U2 / R = 0.7752 / 32 = 18 mW 050347 - 11

per channel across a headphone of this


impedance. An examination of available equivalent: 12AU7). This device, as Indeed the main problem of using a
headphones at well known high street opposed to a transistor configuration, valve at low voltages is that it’s fairly
emporiums revealed that the sensitivity enables the output stage to be driven difficult to get any real current drain.
varied from 96 dB to 103db/mW! So, in with a constant value, low impedance. In In order to prevent distortion the output
practice the circuit will only require unity other words, the signal from the low stage shouldn’t be allowed to load the
gain to reach deafening levels. impedance point is used to drive the high valve. This is down to the choice of out-
As a unity gain design is required it is impedance of the output stage, a situa- put device. A BC517 is used for T3
quite possible to employ a low distortion tion which promotes low overall THD. because of its high current gain,
output stage. The obvious choice is an At the modest output powers required 30,000 at 2 mA!
emitter follower. This has nearly unity of the circuit, the only sensible choice Since we have a low impedance output
gain combined with a large amount of is a Class A circuit. In this case the stage, the load may be capacitively cou-
local feedback. Unfortunately the output much vaunted single-ended output pled via C4. Some purists may baulk at
impedance of an emitter follower is stage is employed and that comprises the idea of using an electrolytic for this
dependent upon the source impedance. of T3 and constant current source T1- job but he fact remains that distortion
With a volume control, or even with differ- T2. The constant current is set by the generated by capacitive coupling is at
ent signal sources this will vary and could V be voltage of T1 applied across R5. least two orders of magnitude lower than
produce small but audible changes in With its value of 22 Ω, the current is transformer coupling.
sound quality. To prevent this, the output set at 27 mA. T3 is used in the emitter The rest of the circuitry is used to condition
stage is driven by a cathode follower, follower mode with high input imped- the various voltages used by the circuit.
based around an ECC82 valve (US ance and low output impedance. In order to obtain a linear output the

54 elektor electronics - 7-8/2006


valve grid needs to be biased at half the form of the capacitance multiplier circuit valve heater. The ECC82 has an advan-
supply voltage. This is the function of the built around T5. Another BC517 is used tage here in that its heater can be con-
voltage divider R4 and R2. Input signals here to avoid loading of the filter com- nected for operate from 12.6 V. To run
are coupled into the circuit via C1 and prising R7 and C5. In principle the it T4 is used as a series pass element.
R1. R1, connected between the voltage capacitance of C5 is multiplied by the Base voltage is obtained from the emitter
divider and V1’s grid defines the input gain of T5. In practice the smooth dc of T5. T4 has very low output imped-
impedance of the circuit. C1 has suffi- applied to T5’s base appears at low ance, about 160 mΩ and this helps to
ciently large a value to ensure response impedance at its emitter. An important prevent extraneous signals being picked
down to 2 Hz. added advantage is that the supply volt- up from the heater wiring. Connecting
Although the circuit does a good job of age is applied slowly on powering up. the transistor base to C5 also lets the
rejecting line noise on its own due to the This is of course due to the time taken to valve heater warm up gently. A couple of
high impedance of V1’s anode and T3’s fully charge C5 via R7. No trace of hum volts only are lost across T4 and although
collector current, it needs a little help to or ripple can be seen here on the ‘scope. the device runs warm it doesn’t require a
obtain a silent background in the C2 is used to ensure stability at RF. heat-sink.
absence of signal. The ‘help’ is in the The DC supply is also used to run the (050347-1)

Antenna
Height and Range
Gert Baars
027
In practice these distances turn out to be
larger than those computed using the for-
At frequencies below 30 MHz or so, radio H
mula. This has to do with the propagation
transmitters can normally be received over D
s
of electromagnetic fields. It appears that
great distances because ceratin layers of the wave is subject to reflection and does
the ionosphere reflect radio signals with a curve a little with the surface of the Earth.
certain frequency. These reflections nor- This is readily observed with so-called
r
mally do not take place at higher frequen- temperature inversion layers. The weather
cies, so the maximum distance that can be r circumstances are such that hundreds of
covered is, in principle, limited to the visi- kilometres can be covered without prob-
ble horizon. How this theoretical distance M lems using signal frequencies in the VHF
can be calculated is explained here. range. But even without these special
The accompanying figure indicates the weather conditions the distances that can
various distances required. M is the cen- be covered appear to be larger than pre-
tre point of the Earth, r is the radius, H is dicted by theory, as already mentioned.
the height at which the antenna is 060083- 11
With the antenna height of 15 m
placed, s is the length of the signal path assumed earlier, the distance that can be
between antenna and horizon and D is covered appears to be of the order of
the distance across the Earth’s curved sur- 40 km, instead of the calculated 13.8 km.
face. Because in practice H will be much s2 = 2rH How the propagation of electromagnetic
smaller than r, s will be approximately waves actually works is a complicated
equal to D. The signal path s between or: matter covered in many excellent books
antenna and horizon is perpendicular to and publications. However, it is known
the radius of the Earth. This means that s = √(2rH) that at frequencies in the GHz range the
we can apply Pythagoras’ Theorem to distance that can be covered becomes
find the relationship between antenna The average radius of the Earth is progressively smaller as the frequency
height and distance to the horizon. 6,371 km. √(2r) is therefore about 113. increases. This is also the reason why
According to the Theorem: The formula can now be simplified to: parabolic antennas for SHF frequencies
are positioned as high as is practicable.
r2 + s2 = (r + H)2 s = 113 √(H) The amount of transmitter power plays a
= r2 + H2 + 2rH secondary role in all this.
where s and H have to be expressed in What does matter however, is the height
Collecting terms results in: kilometres. of the receiving antenna. The same for-
An example: a VHF FM antenna is posi- mula can be used for this antenna (that
s2 = H2 + 2rH tioned at a height of 15 m. the maximum is s = 113 √(H)). The theoretical total dis-
distance at which a line-of-sight connec- tance that can be covered is then the sum
Because H2 is much smaller than 2rH it tion is possible amounts to: of both distances to the horizon.
can be left out. So it follows that: 113 √(0.015) = 13.8 km. (060083-1)

7-8/2006 - elektor electronics 55


028
Frans Janssens
Simple Hybrid Amp
The debate still goes on as to which are
better, valves or transistors. We don’t
intend to get involved in that argument
here. But if you can’t make your mind up,
you should try out this simple amplifier.

This amplifier uses a valve as a pre-ampli-


fier and a MOSFET in the output stage.
The strong negative feedback makes the
frequency response as flat as a pancake.
In the prototype of the amplifier we’ve
also tried a few alternative components.
For example, the BUZ11 can be
replaced by an IRFZ34N and an ECC83
can be used instead of the ECC88. In
that case the anode voltage should be
reduced slightly to 155 V. The ECC83
(or its US equivalent the 12AX7) requires
2 x 6.3 V for the filament supply and
there is no screen between the two tri-
odes, normally connected to pin 9. This
pin is now connected to the common of
the two filaments. The filaments are con-
nected to ground via R5.
If you’re keeping an eye on the quality,
you should at least use MKT types for
coupling capacitors C1, C4 and C7. Bet-
ter still are MKP capacitors. For C8 you
should have a look at Panasonic’s range
of audio grade electrolytics. A few specifications
P1 is used to set the amount of negative (IRFZ34N, ECC83, 155 V using 064011-1 and 064016-1, Uff = 12.6 VDC, 8 Ω
feedback. The larger the negative feed- load, T2 set to 1.3 A)
back is, the flatter the frequency response
will be, but the smaller the overall gain min. gain 12.3x
becomes. With P2 you can set the quies-
max. gain 31.6x
cent current through T2. We have chosen
a fairly high current of 1.3 A, making input sensitivity 0.64 V at min. gain
the output stage work in Class A mode. bandwidth >200 kHz
This does generate a relatively large LF roll-off 11 Hz
amount of heat, so you should use a
THD+N (1 kHz/1W/8Ω) 0.09% (BW = 80 kHz)
large heatsink for T2 with a thermal coef-
ficient of 1 K/W or better. supply ripple (100 Hz) –80 dB (at 1 W output)
For L1 we connected two secondary Pmax (1% THD) 7.6 W (1 kHz)
windings in series from a 2x18V/225 damping factor 17
VA toroidal transformer. The resulting
inductance of 150 mH was quite a bit
more than the recommended 50 mH. saturating when a large DC current flows 0.8 mm enamelled copper wire, firmly
However, with an output power of 1 W through the coil. fix the E and I sections back together with
the amplifier had difficulty reproducing Such a core may be found in obsolete a piece of paper in between as isolation.
signals below 160 Hz. The distortion equipment, such as old video recorders. The concepts used in this circuit lend
rose to as much as 9% for a signal of 20 A suitable core consists of welded E and themselves very well to some experimen-
Hz at 100 mW. To properly reproduce I sections. These transformers can be con- tation. The number of supply voltages
low-frequency signals the amplifier needs verted to the required inductor as follows: can be a bit of a problem to start with.
a much larger coil with an iron core and cut through the welding, remove the For this reason we have designed a
an air gap. This prevents the core from windings, add 250 to 300 windings of power supply especially for use with this

56 elektor electronics - 7-8/2006


C2
1
220p
R3 P1
BUZ11 2k2
4k7

+180V +12V +16V

1N4001 C9
L1
G S
R6 R9
C3 C5 D1 4700µ 25V
D 50mH

4k7
100k
2A
10µ 400V 100n
C8

T1
V1 4 700µ
1,3A
1 6 R4 25V
T2

180 Ω
C1 BC337 R13
2 7

1Ω5
C7
100n C4
3 8 R10
2µ2 LS1
4 9 5

47k
ECC88 2µ2 BUZ11
250V
f2 f1 P2
R1 R2 R5 R7 R8 R11 R12
D2 C6 C10
8Ω
180 Ω

1Ω5

1Ω5
1k

4k7
1M

100k
100µ 100n
25V 4k7

1N4001 050153 - 11

COMPONENTS LIST Capacitors


C1 = 100nF 250V MKT, lead pitch
Inductors
L1 = ≥ 50 mH, not on board, see text
15mm, dim. 7x18 mm max.
Resistors C2 = 220pF Semiconductors
R1 = 1MΩ C3 = 10µF 400V radial, lead pitch 5 D1,D2 = 1N4001
R2,R4 = 180Ω mm ∅ 13mm max. T1 = BC337
R3 = 2kΩ2 C4 = 2µF2 250V, lead pitch 27.5 mm,
T2 = BUZ11 (or IRFZ34N)
R5 = 1kΩ dim. 11x30 mm max.
R6,R7 = 100kΩ C5,C10 = 100nF
R8, R9 = 4kΩ7 C6 = 100µF 25V radial Miscellaneous
R10 = 47kΩ C7 = 2µF2, lead pitch 5 or 7.5mm V1 = ECC88 with 9-pin valve socket
R11,R12,R13 = 1Ω5 5W C8,C9 = 4700µF 25V radial, lead pitch (Chelmer Valve Company)
P1,P2 = 4kΩ7 preset 7.5mm, ∅ 18mm max. Heatsink for T2, ≤1 K/W
PCB, ref. 050153-1 from The PCBShop

amplifier (Quad power supply for hybrid found that the ripple on this supply was If you use a separate transformer for the
amp). This can of course just as easily be responsible for a severe hum at the out- filament supply you can try and see if the
used with other amplifiers. put of the amplifier. To get round this circuit works without R5. During the test-
The supply uses a cascade stage to out- problem we designed a separate voltage ing we used a DC voltage for the fila-
put an unstabilised voltage of 170 V for regulator (High-voltage regulator with ment supply.
the SRPP (single rail push pull) stage short circuit protection), which can cope Although you may not suspect it from the
(V1). During initial measurements we with these high voltages. test measurements (see table), this ampli-

T f1 f2 1-351050 +12V 0 +16V L1 050153-1


ROTKELE )C( C7 (C) ELEKTOR
R5 C5
C1 T2
D1
R6

T1
R4

C9
R12
C6
R7
R8
R9

R10
R11
D2

V1
R1
R2

C8
R3
R13

C4
C3 +180V
P1 P2
C2 050153-1 + LS1 - C10

7-8/2006 - elektor electronics 57


fier doesn’t sound bad. In fact, it is eas- the amplifier more powerful, in which the supply needs to be able to output the
ily better than many consumer amplifiers. case we recommend that you use more required current, which becomes much
The output power is fairly limited, but is than one MOSFET in the output stage. greater at higher output powers. The effi-
still enough to let your neighbours enjoy The inductor also needs to be made ciency of the amplifier is a bit over 30%.
the music as well. It is possible to make beefier. Since this is a Class A amplifier, (050153-1)

Programming
029
Parallax, well known for its successful
the Propeller IC
Basic Stamp IC, has recently introduced +3V3 DIL
the Propeller: a new microcontroller with 11 (7)
RES
a certain difference. It packs no less than C1 R5
T3

eight 32-bit processors (referred to as PC 10k

COGs in Propeller jargon) into a single Serial Port 10n R6


K1 BC547
package with only 40 pins. That design

10k
R1 R4

Parallax Propeller
makes genuine simultaneous multipro-
10k

4k7
1

cessing possible, and the sophisticated 6


2 Rx Rx 40 (38)
internal structure of the device makes it BC547 A31
7 T1
relatively easy to implement video and 3 Tx
R2
10k
signal-processing applications. 8 T2
R3 R7
4 DTR Tx 39 (39)
1k A30
10k

The Propeller can be programmed in 9


5 GND
assembly language or the high-level Spin BC557

language. The processor and the pro-


SUB D9
gramming tools were developed entirely 9 (5)
VSS
in-house by Parallax, with the hardware LQFP
being designed from scratch starting at 064005 - 11

the transistor level. The basic idea behind


that was to avoid becoming involved in
all sorts of patent disputes with other processors, the Propeller has a simple is also possible for anyone who prefers
manufacturers. The result is astounding, serial programming interface. The devel- to work with the familiar RS232 port.
and for software developers it certainly oper’s toolkit from Parallax has a modern Don’t forget that the Propeller works with
requires a change in mental gears. USB port for that purpose, but a reason- a 3.3-V supply voltage.
As is customary with modern micro- ably simple alternative (illustrated here) (064005-1)

030
Jörg Trautmann
LED Phototherapy Unit
look at these devices in more detail, we gic reactions in the body, since it acts
find that their operation is relatively sim- against free oxygen radicals and
It is widely thought that light can be ther- ple to explain. strengthens the immune system, reducing
apeutic for the human skin and soul. Light Common to all the devices is that they inflammation of the mucous membrane.
at the correct wavelength may also be emit intense red light with a wavelength of Since this treatment does not take the
effective against depression and allergies. 660 nm. Some biophysicists claim that form of a medicine, but rather the form
There is a wide range of products on the light of this wavelength can have a posi- of visible light, there is no risk of side-
market, at prices from a few tens of tive effect on the human body and can effects. There has been scientific research
pounds to a hundred pounds or so, initiate healing processes. This so-called showing that this therapy does not work
which are presented as universal reme- ‘phototherapy’ is a treatment which is in every case, but success rates as high
dies for dust allergies or hay fever. If we claimed to have an effect against aller- as 72 % have been reported. Since it

58 elektor electronics - 7-8/2006


may not be possible to obtain these
devices under the NHS or under private S1

medical insurance, our thoughts naturally


turn to do-it-yourself. R3
L1

For the enclosure we decided to use an

1k
old nasal hair trimmer. These can be
470µH
obtained new for a few pounds, or you C1
may have an old one that can be recy- BT1

cled. The choice of enclosure also dictates R2 470p C2

2k2
the choice of battery: the unit contains a 100µ
3V
holder for an AA-size cell. The circuit must T1
R1
T2 D1 1V5
therefore not only be very compact (there 1k

is little spare room in the enclosure), it 2x


BC547
must also be able to drive a high-bright-
ness red LED from a voltage between 1 060143 - 11

V and around 1.6 V. Here again we can


indulge in a little recycling: we can re-use
the circuit from a Mini Project by Burkhard do-it-yourself phototherapy unit. V. The current consumption of the circuit is
Kainka for driving a white LED, published In view of the small number of compo- about 20 mA. Assuming the circuit has
in Elektor Electronics in June 2002. In this nents, the circuit can be assembled by been built correctly, the red LED should
circuit the inductive voltage pulse is lim- soldering them together directly or by light brightly as soon as power is
ited by the LED itself, ensuring that the out- using a small piece of stripboard. The cir- applied. Five to ten minutes’ use in each
put voltage will automatically match the cuit can operate from a wide range of nostril every day should be sufficient to
forward voltage of the LED. The circuit is voltages, and so we can use either an obtain noticeable benefit after two weeks
suitable as it stands for driving a high- alkaline AA cell or an AA-size NiMH of treatment.
brightness 660 nm red LED to make a rechargeable cell with a voltage of 1.2 (060143-1)

E-blocks =
cheaper PLC design 031

John Dobson be frustrated with the fact that you are puts which would cost you just over £
paying in excess of £ 100 for a simple 10 if you put it together yourself. Well
If you are a habitual user of PLCs (pro- system that (hardware-wise) contains only here is a suggestion that could help you
grammable logic systems) then you may a couple of inputs and a couple of out- develop your own PLC for a lot less.

7-8/2006 - elektor electronics 59


Hopefully you will by now have read equivalent to a PLC, and the flow chart tion of PLC on it. A motor driving board
about our E-blocks™ solution. There are driven program Flowcode, is an easy-to- will be available shortly.
two new E-blocks available: an opto-iso- use graphical development environment
lator board and a relay board. The pho- which you can use for driving your PLC. E-blocks modules, sensors and associated
tograph shows them connected to a The hardware (i.e. circuit boards) are software are available through the Elek-
PICmicro Multiprogrammer. The combi- supplied with the complete circuit dia- tor Electronics SHOP, see www.elektor-
nation of a PICmicro programmer, opto- grams so with a little work you can make electronics.co.uk
isolators and a relays is functionally a circuit board with your own configura- (060079-1)

Rear Fog Lamp


032 for Vintage Cars
15

RE1
5A

85
30
LA1 86

D1 S1
87

15 85

D2

T3 1N4008 T4
R8
10k

BC517 BC337

R7
C3 16 C4
10k

IC1
8 47µ 7 9
LA2 100n 16V R6
1 S 6 10 S 15 L
J J 3k3
IC1.A 5 11 IC1.B
K K
58K 2 3 13 14
C C
R10 R9 R1 R2 R R R5 R4
820 Ω

4 12
10k

10k

47k
100k
470k

0W5
T1 T2
R3
S
D3 1k IC1 = 4027
C1 C2
BC547B BC547B
15V 1µ 1µ
500mW 16V 16V

050378 - 11

fuse bay

Eric Vanderseypen
prevent the fog lamp from going on T3 acts as an emitter follower, and it only
when the lights are switched on if the supplies power to the circuit when the
According to current legislation in many driver forgot to switch it off after the last lights are switched on. For safety rea-
countries, vintage cars must also be fitted patch of fog cleared up. sons, the supply voltage is tapped off
with a fog lamp at the rear. The circuit described here extends that from the number plate lamp (L2),
In modern cars, there is a bit of circuitry technology back in time. The circuit is built because it is on even if you accidentally
associated with the fog lamp switch to around a dual JK flip-flop (type 4027). drive with only the parking lights on. The

60 elektor electronics - 7-8/2006


wire that leads to the number plate lamp D1 (a low-current type, and yellow
usually originates at the fuse box. according to the regulations). The Q out- Note
As the states of the outputs of IC1a and put of IC1a energises relay Re1 via T4 This circuit is only suitable for
IC1b are arbitrary when power is and thus applies power to the rear fog use in cars with 12-V electrical
switched on, the reset inputs are briefly lamp L1. Free-wheeling diode D2 protects systems and negative ground.
set high by the combination of C1, R1 T4 against inductive voltage spikes that
and T1 when the lights are switched on occur when the relay is de-energised. tion switch.
(ignition switch on). That causes both Q In older-model cars, the charging voltage The pushbutton switch must be a momen-
outputs (pins 1 and 15) to go low. of the generator or alternator is governed tary-contact type (not a latching type).
IC1a and IC1b are wired in toggle mode by a mechanical voltage regulator. These Ensure that the pushbutton and LED have
(J and K high). The Set inputs are tied to regulators are less reliable than the elec- a good ground connection. Fit the LED
ground (inactive). tronic versions used in modern cars. For close to the button.
that reason, a Zener diode voltage-lim- The following ‘Bosch codes’ are used in
The driver uses pushbutton switch S1 to iter circuit (D3 and R9) is included to the schematic:
generate a clock pulse that causes the keep the voltage at the emitter of T3
outputs of the flip-flops to toggle. The below 15 V and thus prevent the 4027 15 = +12 V from ignition switch
debouncing circuit formed by C2, R4 from being destroyed by an excessively 58K = number plate lamp
and T2 is essential for obtaining a clean high voltage. 86 = relay coil power (+) IN
clock pulse, and thus for reliable opera- The supply voltage for the circuit is 85 = relay coil power OUT
tion of the circuit. C1 and C2 should tapped off from the fuse box. An acces- 30 = relay contact (+) IN
preferably be tantalum capacitors. sory terminal is usually present there. 87 = relay contact OUT
The Q output of IC1b directly drives LED Check to make sure it is fed from the igni- (050378-1)

Adjustable Current Limit


for Dual Power Supply
Malte Fischer
033+15V
IC1 IC4 IC6
This current-limiting circuit, shown in this +U IN LM317 R1 7815 7805 +5V
example as part of a small bench power
supply, could in principle be used in con- adj. R3

junction with any dual-rail current source. C1 C4 C6 C8


The part of the circuit to the left of the dia-
100n 100n
gram limits the current at the input to the C3 IC3
dual voltage regulator (IC4 to IC7) so
100p
that it is safely protected against over- adj.

load. The circuit shown produces outputs


at ±15 V and ±5 V. LM317 R4

The voltage regulators at the outputs


(7815/7805 and 7915/7905) need no
further comment; but the current-limiting cir-
P1
cuit itself, built around an LM317 and an
LM337, is not quite so self-explanatory. C2
C5 C7 C9
R5
The upper LM317 (IC1) manages the cur- 100n
100n
rent limiting function for the upper branch
adj.
of the circuit. The clever part is the com- R2

bination of the two resistors R1 and R3 –U IN LM337 7915 7905 - 5V


between the output and the adjust input IC2 IC5 IC7
of the regulator. In the basic LM317 con- –15V 060123 - 11

figuration in current-limiting mode (i.e.,


as a constant current source), just one
resistor is used here, across which the value is 1.25 Ω. Unfortunately it is not We can solve the problem using the tech-
regulator maintains a constant voltage of practical to try to build an adjustable nique of dividing the resistor into two resis-
1.25 V. The current is thus limited to a dual-rail current-limited supply in this way, tors. Only the resistor at the output of the
value of 1.25 V/R. To obtain a maxi- as stereo potentiometers with a value of LM317 (R1) serves for current sensing. The
mum current of 1 A, for example, the for- 1.2 Ω are extremely difficult, if not impos- second resistor (R3) causes an additional
mula tells us that the necessary resistor sible, to obtain. voltage drop depending on an additional

7-8/2006 - elektor electronics 61


(and adjustable) current. When the sum of LM337, along with resistors R2 (1.2 Ω) across IC1 and R1. If we allow a total of
the two voltages reaches 1.25 V current and R5 (120 Ω), performs the same 4 V for the current limiting circuit in each
limiting cuts in. This makes it possible to functions. branch, this means that the circuit as a
adjust the current limit smoothly using the A further LM317 (IC3) is used to set the whole should be supplied with at least
current in the second resistor (R3). This can overall current limit point by controlling ±22 V to produce well-regulated outputs
be done simultaneously in the positive and the additional current. The resistance used at ±15 V and ±5 V.
negative branches of the circuit, as the dia- with this voltage regulator, wired as a cur-
gram shows. rent sink (R4 in series with P1) determines If the symmetrical input voltage is to be
the additional current and therefore also provided using a single transformer wind-
It would of course be wasteful to arrange the output current in both the negative ing, two diodes and two smoothing
for the current flowing in the second resis- and positive branches of the circuit. Since capacitors, it important to ensure that the
tor to be of the same order of magnitude we also want the total resistance of R4 capacitor values are sufficiently large, as
as the current in the main resistor. We and P1 to be 120 Ω, we use a value of there will be considerably more ripple
therefore make the value of the second 22 Ω for R4 and 100 Ω for P1 to give a than there would be with full-wave rectifi-
resistor considerably greater than that of wide adjustment range for the output cur- cation. Depending on the application,
the main one. If the main resistor (R1) has rent from a few milliamps to 1 A. capacitors C6 to C9 at the outputs of the
a value of 1.2 Ω (giving a maximum cur- The minimum input voltage for the circuit fixed voltage regulators can be electrolyt-
rent of 1 A), and the second resistor (R3) depends on the desired output voltage ics with a value of 4.7 µF or 10 µF. To
a value of 120 Ω, the necessary voltage and maximum output current. The input improve stability, electrolytic capacitors
drop is achieved using an extra current to the 7815 should be at least 18 V. We can also be connected in parallel with
of 10 ent limit will be 1 A. should allow approximately a further C1, C2, C4 and C5.
For the negative branch of the circuit the 1.2 V + 2.2 V for the voltage drops (060123-1)

034 Tiny RGB


1 +VCC

R1 C1
10k

8
100n

1 5
PB5 PB0
IC1
6 3
PB1 PB3
ATtiny15LP
7 2
PB2 PB4
R2 R3 R4
180 Ω

180 Ω

27 Ω

Kingbright 1 2 3 4
R B G B
D1

1 ANODE RED
2 ANODE BLUE
2 5 1 5 COMMON CATHODE LF59EMBGMBW 5 6
3 6 4 3 ANODE GREEN
4 ANODE BLUE
6 COMMON CATHODE
050027 - 11

Tobias Flöry LEDs with a controller already built-in on from www.elektor-electronics.co.uk free
the market but where would be the fun in of charge as file no. 050027-11.zip.
This circuit is a good example of a micro- the ready-built version? You will certainly A pre-programmed controller (part no.
controller design using the absolute min- learn much more by building and pro- 050027-41) can also be ordered from
imum of external components. The gramming the design yourself. the online shop at the same address.
ATTiny15L microcontroller from Atmel has
three of its outputs connected to an RGB The brightness of each LED is controlled The Kingbright RGB LED used in this circuit
LED (or three individual red green and using Pulse Width Modulation (PWM). actually contains one red, one green and
blue LEDs) and produces changing colour This is accomplished in software and the two blue LEDs. This helps compensate for
patterns. There are of course multicolour source code is available to download the poorer output from the blue LEDs and

62 elektor electronics - 7-8/2006


for the relative insensitivity of our eye to resistor (R4) needs to be almost ten times average will be around 25 mA. More
the blue end of the spectrum. The light smaller than the series resistors R2 and information on this design together with
output thus can produce a better white R3 used for the other LEDs to maintain a some other interesting designs can be
colour balance. The forward voltage similar drive current. found on the author’s website at www.flo-
drop of the blue LEDs (4.5 V) is also ery.net and look for ‘tobi’s corner’.
quite a bit higher than green (2.2 V) or Maximum current consumption of the cir- (050027-1)
red (2.0 V) so the value of the series cuit is approximately 35 mA but the

Gentle Breeze
Rainer Reusch
035
4,00V @ 30°C (1,040k)
4,11V @ 35°C (1,080k)
Where there is heat, let us bring cooling: 4,23V @ 40°C (1,122k)
4,47V @ 50°C (1,209k)
a fan will do the job, but unfortunately 4,72V @ 60°C (1,299k)
+12V
fans are usually noisy. In many cases there
is no need for the fan to run continuously at R1 R3 R5 R9

full speed, and so it makes sense to con- KTY81/110


10k

82k

1k2
trol the fan speed in response to the tem-
T1
perature of the heatsink or device being C2
R6

4k7
cooled, switching the fan off entirely if it
should fall to room temperature. 100n R10 BC161/10
1,09V 2 2N2907A

4k7
The circuit shown here does this and 1 13
IC1.A
even offers a little more. The low-cost 3 14
IC1.D
KTY81-110 is used as the temperature 12
8V @ 30°C
sensor, in a negative-feedback arrange- 12V @ 50°C
M1
R8
ment with an operational amplifier. The 270k M
R2 R4 R7
temperature-dependent voltage at the C4
390 Ω
1k

39k

non-inverting input to opamp IC1.A leads 10µ


12V DC

to a voltage variation at the output 25V

(pin 1) from 4 V at 30 °C to 4.72 V at


IC1 = LM324
60 °C. The second stage (IC1.D) con- +12V

verts this relatively small swing and incon- R11 R14

venient voltage offset into the range 8 V 4


2k4

20k

C1
IC1
to 12 V suitable for the fan. The third 11 100n
operational amplifier works as a com-
11,8V @ ‹30°C 11,8V @ ›60°C
parator. At room temperature its output 6
0V @ ›35°C
R16
4,53V 0V @ ‹40°C

sits at nearly 12 V and pulls the output 7


D1
7k5

9 OVERTEMP
IC1.B
of the second stage with it, switching 5
1N4148 IC1.C
8

transistor T1 off. If the temperature 10


R13 C3
exceeds 35 °C the comparator switches; 130k R17
diode D1 blocks and the control circuit 10µ 180k
R12 25V R15
can operate as normal. The hysteresis of
1k2

12k

the comparator has been set so that the


comparator state will only change again,
turning off the fan, if the temperature falls 060057 - 11

below 30 °C. Capacitor C3 ensures that


the fan is run at full voltage for about 0.7
seconds immediately after switch-on, so a comparator. If the sensor temperature The circuit is sufficiently accurate without
that the motor will start reliably. reaches a value of 60 °C, the compara- adjustments, but metal-film resistors with
The fourth opamp in the LM324, IC1.C, tor output goes high (to nearly 12 V). The a tolerance of 1 % should be used. Some
is used to create an over-temperature output will only go low again (nearly of the values used are from the E24
warning indicator. This is necessary in 0 V) if the temperature falls below 40 °C. series. The supply voltage is used as a
case the fan, even running at full speed, An LED (with series current-limiting resis- reference throughout, and so should be
is not able to provide enough cooling, or, tor) can be connected to its output (pin well regulated: a 7812 voltage regulator
because of a fault, cannot reach full 8); alternatively a transistor could be is adequate.
speed. This opamp is also configured as used to drive a relay. (060057-1)

7-8/2006 - elektor electronics 63


036
Friedrich Weigand
Toothbrush Timer
It has been known since Einstein that time
is relative. This seems to apply particularly
to children, who can make seconds and
minutes seem like days and years when
faced with unpopular chores like clean-
ing their teeth. To get the little dears to
spend the three minutes recommended by
experts on their teeth, parents concerned
for the dental health of their children can
resort to electronic means. And so much
the better if you can get your children to
help out with building the device!

COMPONENTS LIST
Resistors
R1 = 9-way 1kΩ SIL array

Capacitors
C1,C2 = 22pF
C3 = 100nF
C4,C5 = 10µF, 63V, radial

Semiconductors
D1 = LED, green, low current, 5mm 1 +5V
1 R1 9x 1k

D2-D6 = LED, yellow, low current,


5mm
D7,D8 = LED, red, low current, 5mm 2 3 4 5 6 7 8 9 10
D9 = LED, blue, 5mm
D10 = 1N4001
IC1 = AT90S2313-10PC
(programmed, order code
050146-41) D1 D2 D3 D4 D5 D6 D7 D8 D9

IC2 = 7805

Miscellaneous
X1 = 4MHz quartz crystal
Case: e.g. Bopla type BOS 503
1 wire link +5V
PCB, order code 050146-1
C3

100n
20

1
The circuit of the toothbrush timer (Fig- 19
PB7
RST

ure 1) uses the familiar Atmel RISC 18 IC1 2


PB6 PD0
17 3
AT90S2313 microcontroller, together 16
PB5 PD1
6
PB4 PD2
with an oscillator formed by X1, C1 and 15 7
PB3 PD3
C2. The microcontroller is available 14
PB2 PD4
8

ready-programmed (order code 13


PB1 PD5
9
12 11
IC2
050146-41). It drives a row of LEDs. PB0 PD6
AT90S2313P ≥ +9V D10 7805 +5V
Green LED D1 flashes every second. The XTAL1 XTAL2
green ten-second LEDs and the red one- 5 4 10 1N4001
X1
minute LEDs light in sequence and remain C5 C4
on until three minutes have elapsed. Then
C1 C2
all the LEDs go out and the blue ‘finished’ 10µ
63V
10µ
63V
LED D9 starts flashing every second, indi- 22p 4MHz 22p

cating the end of brushing time. The port 050146 - 11


currents are limited to 2 mA to 3 mA by

64 elektor electronics - 7-8/2006


the array of 1 kΩ resistors: this is enough (6F22) type battery be accidentally con- board to allow the LEDs to stand above
for the low-current LEDs, which are used nected the wrong way around. the other components and poke through
in order to ensure a long battery life. A The whole circuit can be built on the holes in the enclosure. A socket should
5 V fixed voltage regulator (IC2) and printed circuit board shown in Figure 2. be used for the microcontroller. Almost all
decoupling and smoothing capacitors C3 There are a few wire links near to the the components are polarity-sensitive:
to C5 round off the circuit. Diode D10 resistor array. The voltage regulator, crys- check carefully before you solder!
prevents damage should the 9 V PP3 tal, C4 and C5 are mounted flat on the (050146)

2
C3

IC1
D1 X1

C1 C2

D2 D3 D4 D5 D6 C4

R1
IC2

D7 D8 D9

0 + 050146-1 C5
1-641050 050146-1
D10 ROTKELE )C( (C) ELEKTOR

Opamp
VHF FM Transmitter
Gert Baars
037for this. The output voltage is
+9V about 6 Vpp at a power supply
ICs that in the past were far too voltage of 9 V. The transmitter
C4
expensive for the hobbyist tend power amounts to about 50 mW
to be more favourably priced 100n at a load of 50 Ω. This is about
these days. An example of this R1
R4
20 times as much as the average
33k

ANT1
is the AD8099 from Analog 5k6 ca. 10cm oscillator with a transistor.
Devices. This opamp is avail- With a short antenna of about
able for only a few pounds. The AUDIO C1 R3 7
10 cm, the range is more than
8
AD8099 is a very fast opamp 150 Ω
3
1 sufficient to use the circuit in the
(1600 V/ms) and has high- 100n
2
IC1 6 home as a test transmitter.
impedance inputs with low input 4 Because the output signal is not
capacitance. AD8099
RD8
free from harmonics the use of
The bandwidth of the opamp is R5 an outdoor antenna is not recom-
so large that at 100 MHz it still R2 C3
1k mended. This requires an addi-
has a gain of nearly 40. This C2
tional filter/adapter at the output
33k

means that this opamp can be 10p (you could use a pi-filter for this).
330p
used to create an RC oscillator. The FM modulation is achieved
The circuit presented here 060095 - 11
by modulating the hysteresis,
realises that. which influences the oscillator
The circuit has a few striking frequency. An audio signal of
characteristics. Firstly, unlike normal oscil- is continually being charged and dis- about 20 mVpp is sufficient for a reason-
lators that contain transistors this one charged when the voltage reaches the able output amplitude.
does not have any inductors. Secondly, hysteresis threshold. The output continu- The package for the opamp is an 8-pin
there is no need for a varicap diode to ally toggles as a consequence. This SOIC (provided you use the version with
do the FM modulation. results in a square wave output voltage. the RD8 suffix). The distance between the
The opamp is configured as a Schmitt With a 10-pF trimmer capacitor the fre- pins on this package is 1/20 inch
trigger with only a small amount of hys- quency can be adjusted into the VHF FM (1.27 mm). This is still quite easy to sol-
teresis. The output is fed back via an RC broadcast band 88-108 MHz). The fre- der with descent tools. If SMD parts are
circuit. In this way, the trimmer capacitor quency of the oscillator is stable enough used for the other components as well

7-8/2006 - elektor electronics 65


then the circuit can be made very small. As an additional design tip for this cir- With an RC oscillator this is 1:9.
If necessary, a single transistor can be cuit, we show an application as VCO For the second tip, we note that the circuit
added to the circuit to act as microphone for, for example, a PLL circuit. When the can provide sufficient power to drive a
amplifier. The power supply voltage may trimmer capacitor is replaced with a diode mixer (such as a SBL-1) directly.
not be higher than 12 V, because the IC varicap diode, the frequency range can This type of mixer requires a local oscil-
cannot withstand that. The current con- be greater than that of an LC oscillator. lator signal with a power from 5 to
sumption at 9 V is only 15 mA. That’s because with an LC-oscillator the 10 mW and as already noted, this oscil-
As with all free-running oscillator cir- range is proportional to the square root lator can deliver 50 mW. A simple atten-
cuits, the output frequency of this speci- of the capacitance ratio. With an RC uator with a couple of resistors is suffi-
men is also sensitive to variations of the oscillator the range is equal to the entire cient in this case to adapt the two to
power supply voltage. For optimum sta- capacitance ratio. For example: with a each other.
bility, a power supply voltage regulator capacitance ratio of 1:9, an LC oscilla- (060095-1)
is essential. tor can be tuned over a range of 1:3.

038 Presence Simulator


L

IC1.B D4 230V
5
4
P1 6 & 14
1N4148
IC1
470k 10V
16 7 0W4 T1
D1
R5
2M2 CTR14 7
3
IC2 4
5 BC547 TRI1
4
C2 11 !G 5 IC1.D C3
1µ RCX 6 12 D2 4µ7 R7
9 6 11
CX + 14 13 & 100 Ω TIC206D
R1 P2 10 7
63V RX CT 13 1N4148 63V
8
22k

220k 15 IC1 = 4093


9
R4 1 R8 T2
4060 11
S1
1k

47k 12 2
CT=0 12
3 load
IC1.A 13
R2 1 S2 0W5 BC557
3
1M 2 & R6
8
* C4
390k

R3 IC1.C
C1 8 D3
10 220n F1 N
9 &
LDR 22µ
25V
1N4148 100mA

060106 - 11
* see text

Christian Tavernier ing an observer with bad intentions to level. This has the effect of triggering triac
believe that the premises are occupied. T3 through gates IC1.C, IC1.D and tran-
Among the many anti-theft devices that Creating such a function with a microcon- sistors T1 and T2. At the same time, this
are available, presence simulators have troller is certainly very easy and has clears the reset input from IC2 which is
a special role to play. In fact, while an already been done many times in the none other than the classic 4060 in
alarm system generally reacts the instant past, but the project we are proposing CMOS technology.
the intrusion is detected, or sometimes a now is intended for those among you Considering the values of C2, R4 and
little afterwards, in all cases the damage who do not want to, or who cannot pro- P2, the internal continuous oscillator in
has already occurred. The purpose of the gram this type of circuit. As a result, our IC2 functions at a frequency on the order
presence simulator is to stop intrusions diagram only includes very common of 5 Hz. Consequently, its output Q12
beforehand by making crooks think that logic circuits from the CMOS 4000 fam- (pin 2) changes state at the end of
someone is at home. Working from the ily, with quite respectable results. approximately one to two hours (depend-
principle that the majority of home burgla- Ambient light is measured using the LDR ing on the P2 setting) while Q13 (pin 3)
ries, with break-in, happen particularly at R3 and, when it goes below a threshold does the same, but in two to four hours.
night, a properly designed presence sim- determined by the adjustable potentiome- Depending on whether a link has been
ulator turns on the lights as evening falls, ter (P1) setting, like when night falls, it installed on S1 or on S2, gate IC1.B out-
then turns them off a few hours later, caus- drives the IC1.A gate output to a low put thus changes state after one to four

66 elektor electronics - 7-8/2006


hours, having the effect of blocking triac to high level, in other words at dawn and To ensure proper operation, we should
TRI1 through IC1.D, T1 and T2. Simulta- LDR R3 detects lights again. pay careful attention to the placement of
neously, diode D1 blocks the oscillator Thanks to its low consumption, this circuit the LDR, to prevent the device being influ-
contained in IC2 and, therefore, the can be directly powered by the mains enced not only by light from the house to
assembly stops in this state. It is dark, the using capacitor C4. The latter must be a be protected, but also by potential street
light was lit for one to four hours, accord- class X or X2 model, rates for 230 VAC. lights, or even headlights of passing cars.
ing to the setting of P2 and the wiring of Such a model, called a self-healing Finally, since it is directly connected to
S1 or S2, and it just went out. A return capacitor, is actually the only type of the mains, the assembly must be mounted
to the initial state can only happen after capacitor we should use for power sup- in an insulating housing, for obvious
IC2 is reset to zero, which occurs when plies that are directly connected to the safety reasons.
its input from reset to zero (pin 12) goes mains supply. www.tavernier-c.com (060106-1)

Thrifty LED Protector


039 ghost. As soon as the
An LED is sure to fail if current through R5
the current through it is increases to about
too high. You will soon 25 mA, T2 will conduct,
discover this after you T1 will block and T3 will
have blown a few up. A also block. The current
simple resistor in series cannot flow through T3
suffices to solve the any more and will look
problem and a better for another path, in this
solution is almost incon- case through LED D1,
ceivable, because in which will now light up.
this case you need only By placing D1 in this
one additional cheap position it acts in fact as a
component. As the free-wheeling diode,
power supply voltage which is good for the effi-
increases, an increasing ciency.
amount of power is lost As soon as the current
in the resistor. In partic- drops, T2 will block
ular with battery-powered equip- +9V again and T3 will conduct. R6
ment it is worthwhile to make a provides a small amount of hys-
R1 R3
power-saving version, which does teresis so that the switching fre-
4k7

15k

require a few more parts however. T3 quency of about 50 kHz does not
become unnecessarily high (which
The circuit shown in the figure has R2
BC557 would increase the loss).
deliberately been designed with The circuit works from about five
15k

2N3906
* see text
parts that everyone will have volts, depending on the forward
lying around, except perhaps the R6
voltage of the LED. From about
L1
small coil. T1
*
D1 C1 9 V you will clearly notice the
100k

T2 100n improvement in efficiency. The cir-


In nearly all modern switching R4 4mH7
cuit is suitable for all types of LEDs,
1k
power supplies there is an attempt 2x R5
including the blue and white ones
25mA
to monitor the current. It is gener- BC547 that need 3.5 V. The voltage that
22 Ω

2N3904
ally the case that components will is generated by the coil will auto-
fail if the current or power is too matically adapt. The maximum
high and this is very effectively BC547B 2N3904 060128 - 11 power supply voltage is 24 V.
BC557B 2N3906
avoided with this technique. It A little clarification regarding the
works like this. Resistor R5 meas- choice of coil: the value is not
ures the current through the coil critical, it could just as easily be
and T2 ‘watches’ to make sure it 3.9 mH or 6.8 mH. Even 10 mH
doesn’t become too large. L1 will C E E C can be used, especially if the
B B
never go into saturation, which power supply voltage is greater
could cause T3 to give up the than 9 V. The coil does need to

7-8/2006 - elektor electronics 67


be suitable for at least 25 mA. You can have a diameter of 7 mm. Incidentally, and can nevertheless handle high cur-
usually take a guess based on the phys- there have been great advances rents. Unfortunately they are not usually
ical dimensions of the coil. The coil will regarding coils in the least few years. available in values over 1 mH.
have to be at least 15 mm long and Modern SMD-coils are much smaller (060128-1)

040 Binary Clock


IC1
K1 LM7805

+5V
7V...12V B1
R11
390Ω

I = 100mA max.
C3 C1 C2 C4
B80C1500 D21
470µ 100n 100n 47µ
25V 16V
D22

1N4148 Hours Hours Minutes Minutes Seconds Seconds


R12 R1 x 10 x1 x 10 x1 x 10 x1
220Ω

220Ω
+5V
"1"
R2 D1 D2 D3 D4 D5 D6
220Ω
R13 R14 R16 C5
D23
"2"
4k7

4k7

10k

100n D7 D8 D9 D10 D11 D12


R3
220Ω
14
1N4148 "4"
17
RA0 R4 D13 D14 D15 D16 D17
4 18
MCLR RA1 220Ω
3 1
RTCC RA2
IC2 2 "8"
RA3
D18 D19 D20
11
RB5
10 T1
RB4 R5
13 9
RB7 RB3 1k
12 8 T2
RB6 RB2 R6
PIC16C54 RB1
7
1k
6 T3
RB0 R7
OSC1 OSC2 1k
T4
16 15 5 R8
X1
1k
T5
R9

S1 S2 R15 D24 1k
C6 C7 4MHz C8 T6
4k7

R10
1k
10µ 15p 15p
4V7 16V

6x BC550C 020390 - 11

Marco Freitag seconds, and units of seconds. The val- ally drive all of the LEDs, and doing so
ues are read row by row from top to bot- would also require several additional
Unusual clocks are not uncommon in tom: one, two, four, and eight — in other components, the display is multiplexed.
Elektor Electronics. The version presented words, binary. With a bit of practice, it’s In order to nevertheless make the low-cur-
here is based on the binary clock (not yet even possible to quickly and easily read rent LEDs nice and bright, the magnitude
on display) in the new Museum of Math- the time in a single glance. of the current pulses is made significantly
ematics in Gießen, Germany (www.mm- The supply voltage for the circuit comes higher than the rated current.
gi.de/htdocs/mathematikum/index.php?5 from a simple mains adapter with an ac Buttons S1 and S2 can be used to set the
13), but it is entirely compatible with an output voltage of 8–15 V at a maximum time. If you press S2, you will arrive at the
ordinary living room. However, the output current of 300 mA. The voltage setting menu after a brief LED test (all LEDs
hours, minutes and seconds have been must not be rectified, since the micro- on). The value of the first column can now
further divided into units and tens to controller uses the frequency of the ac be set to any desired value using S2.
make them easier to read, which yields voltage (50 Hz) as a clock signal with Pressing S1 takes you to the next column.
six columns: tens of hours, units of hours, long-term stability. As PIC16C54 does This continues in the same manner until
tens of minutes, units of minutes, tens of not have enough output ports to individu- the configuration mode is exited after the

68 elektor electronics - 7-8/2006


020390-1

H1
H2

D1 D2 D3 D4 D5 D6

D7 D8 D9 D10 D11 D12

D17
1-093020

020390-1
D13 D14 D15 D16

D18 D19
D20
T2 T3 T5
T4 T6
T1

D23
R10

R16
R5
R6
R7
R8
R9

D24

R4
R3
R2
R1
IC1

IC2

C6
R11

C5

C2
X1
R12
R15
R14
R13

C3
C1
C8

C7

C4
D21
D22

B1
H3

H4

K1 ~ ~ S2 S1

final column. The clock will continue to lead soldered in place, after which they
COMPONENTS LIST run, starting with the newly set value. must be aligned. The remaining leads
We have designed a printed circuit should only be soldered after the LEDs
board layout for the binary clock. Fitting are all nicely lined up.
Resistors:
R1-R4,R12 = 220Ω the components to the board couldn’t be The board can be displayed ‘bare’ or fit-
R5-R10 = 1kΩ easier, although you mustn’t overlook the ted into a small plastic enclosure. A
R11 = 390Ω set of nine wire bridges. As one of them transparent enclosure is quite practical,
R13,R14,R15 = 4kΩ7 is underneath the microcontroller, the lat- since it eliminates the need to drill holes
R16 = 10kΩ ter must be fitted with a socket. The LEDs for the LEDs.
should initially be fitted with only one (020390-1)
Capacitors:
C1,C2,C5 = 100nF
C3 = 470µF 25V radial
C4 = 47µF 16V radial
C6 = 10µF 16V radial
C7,C8 = 15pF

Semiconductors:
B1 = B80C1500 (80V piv, 1.5A)
D1-D20 = LED, low current, colour to
personal taste
D21 = LED
D22,D23 = 1N4148
D24 = zener diode 4.7V, 0.5W
IC1 = LM7805
IC2 = PIC16C54-04/P (programmed,
order code 020390-41)
T1-T6 = BC550C

Miscellaneous:
K1 = 2-way PCB terminal block, lead
pitch 5mm
S1,S2 = pushbutton, 1 make contact
X1 = 4MHz quartz crystal
Project software on disk: order code
020390-11 or Free Download
PCB, order code 020390-1 from The
PCBShop

7-8/2006 - elektor electronics 69


1-Wire Thermometer
041
Heino Peters
with LCD
Although accurate digital thermometers
are now available at low cost, it remains
exciting and instructive to build one your-
self. The present circuit is particularly
intended to help the reader in the use of
a PIC processor Type PIC16F84 (see
www.microchip.com), a temperature sen-
sor with 1-Wire protocol Type DS1820
(see www.maxim-ic.com), an LCD screen
with 2x16 characters (HD44780 com-
patible) and a light sensor with an LDR
that determines whether the background
lighting of the LCD should be on.

The circuit is provided with a 9-way sub-


D connector that enables it to be linked
to the COM gate of the PC. This connec-
tion also enables the circuit to be pro-
grammed as appropriate.
Quartz crystal X1 in combination with
capacitors C1 and C2 ensures that the

1 +5V
LCD1
DS1820

16 C4
IC2 LC DISPLAY 2 x 16
8 100n
VDD
VSS

R/W
VO
RS

D0
D1
D2
D3
D4
D5
D6
D7
A
K
E

+5V
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
DQ

+5V

R1 R6 R7
C3
10k

3k3

P1 R8
IC3
K2 100n 10k
10 Ω

3
2
1
14
BC547 T1
IC2
DS1820 R3
4 1
1k MCLR C2
15
EN3
6
K1 RB0/INT SRG8
7 IC1 17 3
RB1 RA0 C1/
1 8 1 R9
RB2 RA2
6 9 PIC16F84 18 2 4
10k

RB3 RA1 1D 2D 3
2 10 2 5
R4 RB4 RA3 LCD_1
7 11 3 6
10k RB5 RA4/T0CKI LCD_2
3 12 7
RB6
8 13 14
RB7
4 13
R5 OSC2 OSC1
9 12
1k 15 16 5
5 X1 11
R2
9
10k

SUB-D9 C1 C2 10

33p 4MHz 33p 4094

060090 - 11

70 elektor electronics - 7-8/2006


PIC16F84 K2 R6
R1 060090-1 K1

Configuration bits R8 R7 R2 K1A

R4
Oscillator XT (01)

C2
A IC1
R3
WDTE off (0) T1
R5
C C1

R9
C3
PWRTE on (0)
CP off (1) (all bits) 0 X1
P1
+5V IC2

C4
1 15
1-090060
16 LCD1
PIC processor, IC1, runs at a frequency
of 4 MHz and that each instruction in
the program lasts exactly 1 µs. This is
useful for the timing in the program, 060090-1
which, by the way, is available as a
free download on the Elektor Electron-
ics website (file no. 060090–11.zip).
Resistors R3, R4 and R5 enable IC1 to
be programmed directly by a PC via
connector K1. Resistor R1, which may
any type of LDR, and R2 form a poten-
tial divider that, depending on the ambi-
ent light, sets a ‘0’ or a ‘1’ on input RB4
of IC1. The data line of temperature sen-
sor IC3 is connected to terminal RA4 of
IC1. This terminal is the only open-col-
lector one of IC1 and is exactly what is
needed for the 1-wire data line. Resis- the Elektor website (the .ASM file). After
tor R7 ‘pulls up’ the data line in quies-
cent operation.
you have added your own adaptations,
make a .HEX image by clicking on the
COMPONENTS
The right-hand section of the diagram
BUILD icon. Then, use the free program
NTPICPROG.EXE from Andres Hansson
LIST
enables the display of the temperature. (http://www.geocities.com/CapeCanav
To limit the number of connections to the eral/7706/ntpicprog.zip) to program Resistors
R1 = LDR (small model)
processor, the LCD is controlled via the the .HEX file in the PIC via the COM R2,R4,R6,R9= 10kΩ
series/parallel converter in IC2. The LCD gate of the PC. The 5-V supply rail must R3,R5 = 1kΩ
proper is driven in the 4-bit mode remain connected during programming. R7 = 3kΩ3
(DB4–DB7). Also, the Register Select, RS, Do not program the PIC with a note- R8 = 10Ω
P1 = 10kΩ preset, horizontal
and the backlight must be provided with book, but use a desktop PC, since the
the appropriate signals. IC2 converts the voltage levels at the COM gate of a Capacitors
8 bits provided serially by IC1 into 8 notebook often are only 3–5 V, C1,C2 = 33pF
parallel bits. The rising edge of the strobe whereas a minimum of 10 V is C3,C4 = 100nF
signal from RA2 instructs IC2 to set the needed. Also, do not use a
Semiconductors
previously received eight bits at the out- USB/RS232 converter, because that
T1 = BC547
puts. The falling edge clocks them to the usually confuses the timing. IC1 = PIC16F84A-04CP
screen via enable input E of the LCD. (programmed, order code
Since only six of the eight bits are Once you have this setup working, the 060090-41)
needed, individual extensions may be step to other applications is easy. IC2 = 4094
IC3 = DS1820, DS18S20
accommodated at outputs LCD1 and The circuit is readily constructed on the
LCD = alphanumerical LCD, 2x16
LCD2: for instance, a buzzer or an LED. printed-circuit boards shown. Start with characters, 44780-compatible
The combination of R9, T1 and R8 pro- the wire links, so that they are not over-
vides a current of 100–200 mA from looked at a later stage. If you do not Miscellaneous
output Q3 (pin 7) of IC2 to the backlight want to program the PIC yourself, a pro- K1 = 9-way sub-D socket (female),
angled, PCB mount
of the LCD. The contrast of the display grammed one may be ordered from Elek-
K2 = 3-way SIL pinheader
may be adjusted with P1. tor (order code 060090–41). A power X1 = 4MHz quartz crystal, parr. cap.
source of 5 V capable of providing a 32pF, HC49 case
The associated program is written in current of up to 100 mA is required. 5 wire links
assembly code; it may be adapted as PCB, ref. 060090-1 from The
PCBShop
needed by downloading development Note that the circuit does not provide
Source and hex code files, ref.
area MPLAB from www.microchip.com protection against polarity reversal or too 060090-11, free download from
Design a project in MPLAB and within high a supply voltage. www.elektor-electronics.co.uk
this, load the source code available at (060090-1)

7-8/2006 - elektor electronics 71


Easy Home
042
Carlos Ferreira
Remote Control
Happens to everyone! You’re comfort-
ably installed on your sofa watching TV
and then all of a sudden you need to get
up to turn the lights on or off, or to draw
the curtains. Many living rooms these
days have a double head-up ceiling light,
a floor lamp and an electric window/cur-
tain control. The idea is to control all
these devices, and more, with the TV
remote control.

The circuit designed for maximum indo-


lence in front of the telly is built around the
PIC16F84. The ‘F84 was chosen mainly
because of its internal EEPROM, which is
necessary to store the user-programmable
infrared codes. To control such devices as
mentioned above, four relays are used,
working together with lamp switches in a
two way configuration.
K1
+5V +5V +5V
Looking at the circuit, the DIP switch TSOP1836
block and the associated resistor array SFH5110
TK1833
connected to microcontroller port A are D2 RE1

used to program the IR codes and to


select the operation mode for all the out- 1N4148 T1
R3
puts (described further on). The IR sensor 1k
is connected to port line RB7 on the PIC. BC547A
The lower nibble (set of 4 bits) of port B is +5V 1 2 3 +5V
K2
+5V
used to control the output relays via 1-k
resistors and BC547 transistors. It is also C3
used to control multifunction indicator LED S1 D3 RE2
100n
D1 on port line RB6. 1 2 3 4 5

Components C1, C2 and X1 generate 14


1N4148 T2
R4
the microcontroller clock signal while C3 4
MCLR RB0/INT
6
1k
helps to keep the supply voltage as clean RB1
7
17 8 BC547A
as possible. 18
RA0 IC1 RB2
9 K3
RA1 RB3 +5V
The circuit should be powered by a 5-V 1 10
RA2 RB4
regulated supply capable of providing 2
RA3
PIC16F84
RB5
11

enough current for the four relay coils 3


RA4/T0CKI RB6
12
D4 RE3
13
(approximately 140 mA per relay) plus 2 3 4 5 6
RB7

OSC2 OSC1
a few mA for microcontroller, IR sensor
15 16 5 1N4148 T3
and LED. X1 R5
1k
The circuit is designed to respond to R1 1 5x10k
infrared commands coded to the Philips R2 BC547A
C1 4MHz C2
K4
1k

RC5 protocol. The protocol consists in a +5V +5V


22p 22p
frame of 14 bits. The first two bits,
always at ‘1’, are used to start the frame. IC2 D1
D5 RE4
3
The third bit is the flip bit, this bit indi-
cates when a key is pressed repeatedly. 1
1N4148 T4
The next five bits are used to identify de R6

system which the message is sent. The 2


TK1833
1k

last six bits represent the sent command. BC547A


050233 - 11
Note that in RC5 speak a logic ‘1’ is a
transition from 0 V to Vcc, and logic ‘0’

72 elektor electronics - 7-8/2006


ROTKELE )C( 1-332050 050233-1 050233-1 (C) ELEKTOR
K4
D1
T4

D5
R2 RE4
IC2
R6
K3
T3

D4
IC1

RE3
C3 R5

X1 T2 D3

S1 RE2
R4
K2
T1
C1
C2

D2

RE1
R1

R3
K1
- +

is a transition from Vcc to 0 V, where the the relays is saved in the microcontroller The Easy Home Remote Control is config-
period of one bit is 1.7778 ms. Many EEPROM and retrieved every time the ured as follows.
articles on RC5 have appeared in this PIC re-initialises. 1. Switch the circuit on with all DIP
magazine. The actuation of electric curtains differs switches set to OFF.
from lamps as it’s necessary to send a 2. Flip ON switch #5 (switch connected
The software developed for the project is short pulse to the relays. to RA4/TOCK1) to enable programming
stored in the PIC microcontroller. It allows To make the home control more versatile it is mode. Using Table 1, set the other
four different RC5 codes to be saved and possible to control all relays (configurable switches as required to save desired IR
used to control the four outputs. For by the DIP switches) in one of two modes: codes in EEPROM.
example, your TV remote may be able to 3. Flip OFF switch #5 to select working
control five systems: TV (default), VCR, • toggle between ON and OFF positions mode. Using Table 2, configure the
DVD, AMP, SAT. If, for example, you do with memory for lamps; other switches to select the desired relay
not have VCR then the relevant IR codes • output pulse for other devices like elec- mode.
are available for Easy Home Control. If tric windows-curtains.
your remote control is not compatible In working mode a fast-blinking LED (D1)
with RC5 codes, you can buy a cheap If you’re a keen energy saver, it is also means reception of IR codes with no
universal remote control to do the job. possible to program an IR code to turn associated function; 1-second blink
To avoid the relays changing state owing off all the relays (and save 5 V·140 mA means programmed IR code was
to a power cut in your home, the state of = 0.7 watts per relay). received and corresponding action was

Table 1. Programming Mode


COMPONENTS LIST
DIP switch ON (S1) DIP switch OFF (S1) Set code for

Resistors #1 #2, #3, #4 relay 1


R1= 5-way 10kΩ SIL array
#2 #1, #3, #4 relay 2
R2-R6 = 1kΩ
#3 #1, #2, #4 relay 3
Capacitors
C1,C2 = 22pF #4 #1, #2, #4 relay 4
C3 = 100nF #1, #2 #3, #4 All relays OFF
Semiconductors Note: LED blinks 1 second after code set.
D1= LED, low current
D2-D5 = 1N4148
IC2 = IR receiver module, e.g.,
TSOP1836, SFH5110 or TK1833
T1-T4 = BC547 Table 2. Working Mode
DIP Switch (S1) OFF = Toggle Mode ON = Pulse Mode
Miscellaneous
X1 = 4MHz quartz crystal #1 toggle relay 1 1-second pulse at relay 1
IC1 = PIC16F84, programmed, order
code 050233-41 (see Elektor #2 toggle relay 2 1-second pulse at relay 2
SHOP pages or website) #3 toggle relay 3 1-second pulse at relay 3
PCB, ref. 050233-1 from The PCB
Shop #4 toggle relay 4 1-second pulse at relay 4
Re1-Re4 = PCB mount relay, 5V coil,
Notes: Led blinks 1 second after any action on relays. Fast blinking of the LED means bad
140mA.
RC5 reception or correct RC5 code but no action associated with it.

7-8/2006 - elektor electronics 73


performed. In programming mode, the 1- website. File number 050233-11.zip
second blink means the IR code was may be found by clicking on Magazine Warning
saved in the microcontroller EEPROM. → 2006 → July/August. The PIC is also Screw contacts on K1-K4 and PCB tracks to the
The assembly code file for the PIC used available ready-programmed from the relay contacts may carry the mains voltage. All
relevant precautions must be observed in
in this project is available as a free Publishers as order code 050233-41.
respect of electrical safety
download from the Elektor Electronics (050233-1)

043
Gérard Guilhem
Recycling Flasher Lights
1 TR1

During the Christmas holidays, you lose R3 R2

count of the number of homes lit up like


FLASH
Christmas trees, like fireflies by the thou-
sands which twinkle and flash, outlining
T1
words, the shape of designs, characters, C1 D1

or animals. TR2
BT1
C2

We are proposing a garland of lights you S1 LA1


R1

will not find at your neighbour’s house


1V5
and at the same time to do something
good for the environment— because we 060161 - 11
are going to recycle. The string described
here is only composed of electronic photo
flasher lights. Only the richest municipali- kind of model. neon flashlight La1.
ties have the potential to buy this type of It is difficult to imagine a simpler dia- That is precisely what we need, in detail:
decoration due to its hefty price tag, but gram. Transistor T1 is the only active we are not going to spend the entire
we are going to make the same at a component. Helped by TR1 and R1, it evening pressing different buttons to trig-
ridiculously low price. produces approximately 300 V from 1.5 ger the flash. Therefore, we have to find
First step: go to a photographer’s shop volts supplied by the alkaline battery. an automated technique for this process
and kindly ask the shop owner or staff to C1 charges progressively and the neon by giving it a somewhat random charac-
set aside some used, disposable flash miniature ‘Ready’ lamp La2 lights up to ter.
cameras. Staff will normally be very signal that the energy stored is sufficient The result of all these reflections take the
happy to do that because, in any case, to obtain a good flash. shape of the diagram in Figure 2
these units end up in the trash after being In parallel, and even more rapidly, C2 is which, as compared with the first dia-
processed. You will need about twenty at charged via TR2 and R3. All that’s left to gram, has three new components (after
least, preferably of the same type, that do is wait for the amateur photographer having lost two, now useless!).
will make the task easier. to press button S1, which has the effect Thyristor TH1 will be charged from trig-
Second step: open each camera, remove of discharging C2 into TR2 that produces gering, as soon as the voltage at C3 ter-
the battery, discharge the capacitor (one the high-voltage pulse necessary to fire minals, charged via R3, exceeds the fir-
never knows) and finally, remove the
electronic flasher board. Two possibili-
ties: the printed circuit is small and can
therefore be used as such after a small
2 TR1

modification, or the printed circuit is too R2 R3

big which will force you remove the com-


FLASH
ponents you’ll be using on a board of
your own design.
T1
You should start by copying the diagram C1 D1
DI1
and identifying the components. 95% of TR2
BT1
flasher boards are designed based on C2
32V
the diagram in Figure 1. TH1
R1
22n C3
There are several variations, some sur-
1V5
prisingly complex for a disposable mod- 100n

ule, including a measurement cell and a 060161 - 12


thyristor, for example. Do not use that

74 elektor electronics - 7-8/2006


ing threshold of the diac DI1 which sup- TR1
plies the trigger current. 3 R2 R3 R4
A judicious choice of values for R3 and
C3 makes it possible to have one flash FLASH
per second. In order to avoid too high
D2
energy consumption, the value of C1 is T1
adjusted to 4.7 µF, even 10 µF, for DI1
C1 D1
1N4004
TR2
nicely padded flashes without using too D3
C2
much current. 32V R1 1N4004
You will, no doubt, have noticed the 22n
TH1
C3
LA1

absence of the neon miniature bulb and


100n
its resistor which are no longer useful.
Last problem to solve: the power supply. 060161 - 13

We are not going to interrupt the New


Year’s Eve party to replace used batteries.
It is out of the question to power the setup It’s reasonable to reserve 24 V for 20 two holes to force the wires through and
from 1.5 V as the number of flashes we flasher units, with a protection resistor of ensure an airtight seal.
are dealing with, the current would be too about 10 Ω to limit the current surges, Another option is translucent heat shrink
high. It would be better to supply 1.5-V not forgetting a 1-amp fuse. tubing of the proper size. We will cut an
voltage to each module, the modules The best result will be obtained using an adequate length of tubing, or 4 cm more
being mounted in series, taking care to adjustable constant current power supply than the length of the module. The wires
limit the current to approximately 500 between 0.5 and 1 A, which allows us are coated with a drop of heat shrink-
mA. As illustrated in the partial diagram to play with the flash frequency. The num- able glue, then the tubing is retracted.
of Figure 3, we will provide each mod- ber of flashes is obviously a function of The end is immediately flattened using a
ule with a pair of 1N4001 diodes that will the current supplied. flat clamp until totally cooled. Repeat for
produce a drop in voltage between 1.3 It is recommended, for safety reasons, to the other end. This should make for a
V and 1.4 V, and that works out perfectly. stay below 40 volts. This corresponds to good airtight seal.
The flashers are mounted in series on a close to 40 flashlamps (and a few A purposely designed printed circuit will
wire whose two end points are con- evenings to set them up), but since we still allow you to reduce the size of the mod-
nected to a DC power supply. We should have quite a few months before the holi- ule to a minimum.
account for about 1 V per module. We day season... Average consumption is approximately
can actually consider that the majority of 12 watts for 20 flasher modules, which
flashes will occur during charging and What remains is the ‘packaging’. Every- is perfectly reasonable and the result
will only reach the 1.4 V level a few thing depends on the size of the finished obtained is surprising, original and
tenths of a second before the actual flash, module. You could potentially use hous- superb.
the average voltage being around 1 V. ing for translucent film in which you drill (060161-1)

Earth Fault Indicator


Christian Tavernier
044
devices are frequently in wet conditions,
live the screw and/or lug used to connect the
The security of many electrical devices L earth wire to the device frame corrodes
depends today on the availability of an D1 gradually and ends up breaking or caus-
230V
earthed mains outlet. We should remem- 1N4007 ing a faulty contact. The remedy is then
ber that these are connected to the frame worse than the problem because the user,
R2
or to the metal housing of the equipment thinking that he/she is protected by
1M5

and so it routes to the protective earth (PE) earth, does not take special precautions
connections. In this setup, mains voltage, earth 0W5
and risks his/her life.
R1
however small, will cause the differential E 150k
However, all that’s needed is an
circuit breaker to trip. The circuit breaker extremely simple system to automatically
LA1
is part of any modern electrical installation. C1 detect any break in the earth connection;
This type of security device may however so simple that we ask ourselves why it is
220n
become defective due to common corro- neutral neon 160V not already included as part of all fac-
sion as we have seen many times on var- N tory production for appliances that carry
ious older household devices, as well as 060108 - 11 any such risk, as we have discussed
on construction sites. Actually, since these above. We propose it as a project for

7-8/2006 - elektor electronics 75


you to build using this schematic. at the same time. This phenomenon is ously get rid of its series resistor which
The live wire (L) of the mains power supply reproduced indefinitely as long as the would prevent proper operation here.
is connected to diode D1 which ensures earth connection has not been restored, During installation of the circuit in the
simple half-wave rectification which is suf- and the neon light continues to flash to appliance to be protected, we should also
ficient for our use. The current which is attract attention in case of danger. clearly mark Live (L) and Neutral (N) (for
available is limited to a very low value by Building the project is not particularly dif- example, seek Live with a simple screw-
resistor R2. If the appliance earth connec- ficult but, since it is a project aimed at driver) because inverting these two wires
tion to which our circuit is installed is effi- human safety, we must take the maximum at this point will disable proper operation.
cient, this current is directed to earth via of precautions concerning the choice of The final point, which is self-evident con-
resistor R1 and the rest of the circuit is components utilised. Therefore, C1 must sidering the principle used here: the earth
inactive due to insufficient power. have an operating voltage of at least 160 connection for our setup must be hooked
If the earth connection is disconnected, volts while R2 must be a 0.5-watt resistor, up to the frame of the appliance to be
the current supplied by D1 and R2 not for reasons of power dissipation, but protected at a different point than where
charges up capacitor C1. When the volt- in order to maintain the voltage. The neon the normal earth wire is connected.
age at the terminals of the capacitor light can be any type, possibly used, or it www.tavernier-c.com (060108-1)
reaches about 60 volts, neon indicator may be part of an indicator light to make
light La1 is turned on and emits a flash- it easier to attach to the protected appli-
ing light which discharges capacitor C1 ance. In the second case, we must obvi-

On/off
045 Infrared Remote Control
D1 R8 C5 F1 L
2k2
1N4007 0W5 470n 100mA
R9 250V
X or X2
2k2
R2 R5 0W5
C1 14
load
390 Ω
47k

IC2
470µ 7 R6 R7
25V
390 Ω 470 Ω

1
IC3 6

IC2 = 74HC74

TRI1 230V
2 4
4 10
C2 MOC3041
3 S 5 11 S 9
C C TIC206D
10n
IC1 IR receiver 2 IC2.A 6 12 IC2.B 8
D D
R R
T1 R3 1 13
R1 C3 R4
1M

D2
100k 1M5 C4

BC547
15V 47n
0W4 250V N
X or X2

060107 - 11

Christian Tavernier remote control. Therefore, the first one Q of IC.2A makes IC.2B change state,
you find allows you to turn off the light which has the effect of turning on or turn-
Most homes today have at least a few and enjoy your movie in the best possi- ing off the LED contained in IC3. This circuit
infrared remote controls, whether they be ble conditions. is an opto triac with zero-crossing detec-
for the television, the video recorder, the The infrared receiver part of our project is tion which allows our setup to accomplish
stereo, etc. Despite that fact, who among entrusted to an integrated receiver (Sony switching without noise. It actually triggers
us has not cursed the light that remained SBX 1620-52) which has the advantage the triac T2 in the anode where the load
lit after we just sat down in a comfortable of costing less than the components to be controlled is found. The selected
chair to watch a good film? This project required to make the same function. After model allows us to switch up to 3 amperes
proposes to solve that problem thanks to being inverted by T1, the pulses delivered but nothing should stop you from using a
its original approach. In fact, it is for a by this receiver trigger IC2a, which is more powerful triac if this model turns out
common on/off switch for infrared nothing other than a D flip-flop configured to be insufficient for your use.
remote controls, but what differentiates it in monostable mode by feeding back its In order to reduce its size and total cost,
from the commercial products is the fact output Q on its reset input via R4 and C3. the circuit is powered directly from the
that it is capable of working with any The pulse that is produced on the output mains using capacitor C5 which must be

76 elektor electronics - 7-8/2006


a class X or X2 model rated at 230 volts be mounted in a completely insulated a small disadvantage which is that some-
AC. This type of capacitor, called ‘self- housing. A power outlet model works times it might react to the ‘normal’ utiliza-
healing’, is the only type we should use very well and can easily be used to inter- tion of one of these, which could be
today for power supplies that are con- space between the grounded wall outlet undesirable. To avoid that, we advise
nected to ground. ‘Traditional’ capaci- and that of the remote control device. you to mask the infrared receiver window
tors, rated at 400 volts, do not really Based on this principle, this setup reacts as much as possible so that it is neces-
have sufficient safety guarantees in this to any infrared signal and, as we said sary to point the remote control in its
area. Considering the fact that the setup before, this makes it compatible with any direction in order to activate it.
is connected directly to the mains, it must remote control. On the other hand, it has www.tavernier-c.com (060107-1)

Charlieplexing
Do you think it is possible to drive an 8-
046
digit, 7-segment display with only nine 1
(9) connections? Yes certainly, and here
we show you how it’s done.
Normally speaking, a 7-segment display
Seg dp

Seg dp

Seg dp

Seg dp

Seg dp

Seg dp

Seg dp

Seg dp
Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g
Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e
Seg f

Seg f

Seg f

Seg f

Seg f

Seg f

Seg f

Seg f
CC

CC

CC

CC

CC

CC

CC

CC
has eight LEDs (including the decimal Seg a

point) that have to be controlled with eight Seg b


Seg c
Seg d

inputs and one common output. The cor-


Seg e
Seg f
Seg g

responding segments of all the displays


Seg dp

Cathode 8

are connected together and only one dis-


Cathode 7
Cathode 6
Cathode 5
Cathode 4
play is activated at a time because each Cathode 3
Cathode 2
Cathode 1
display has its own common anode (or 060124- 11

cathode) connection. This requires 8 + 8


= 16 connections, as shown in Figure
1. But it is certainly possible to do this
with only nine connections, provided the
2
multiplexing is done a little smarter. The
notable feature in Figure 2 is that the
Seg dp

Seg dp

Seg dp

Seg dp

Seg dp

Seg dp

Seg dp

Seg dp
common output of each display is also
Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g

Seg b

Seg d

Seg g
Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e

Seg a

Seg c

Seg e
Seg f

Seg f

Seg f

Seg f

Seg f

Seg f

Seg f

Seg f
CC

CC

CC

CC

CC

CC

CC

CC
connected to a segment (but each to a dif- Drive Pin 8

ferent segment). In addition it is necessary


Drive Pin 7
Drive Pin 6
Drive Pin 5
Drive Pin 4
that the drive electronics is capable of Drive Pin 3
Drive Pin 2
Drive Pin 1
both sourcing current and sinking current. Drive Pin 0
060124- 12

This works as follows:


To keep things simple we’ve drawn only
two displays in Figure 3. CC0 drives to flow. This current has to flow via a seg- The segments from display #1 can now
both a segment (of display 1) as well as ment (the leftmost one in this case) but be illuminated.
a common cathode (of display 0). that segment is connected in the reverse (060124-1)
When this line is logic zero, the segments direction! Display 1 remains dark there-
from display 0 can be illuminated when fore and the same applies to the other six You can find more information in applica-
they are supplied with current. The seg- displays. tion note 1880 from Maxim:
ments of display 1 would also like to light In Figure 4 you can see what the path www.maxim-ic.com/appnotes.cfm/
up, but there is nowhere for their current of the current is when CC1 is logic low. appnote_number/1880

+ + + + + + + + + + + + + + + + + +

3 4
Seg dp

Seg dp

Seg dp

Seg dp
Seg g

Seg d

Seg b

Seg g

Seg d

Seg b
Seg e

Seg c

Seg a

Seg e

Seg c

Seg a
Seg f

Seg f

CC0 CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC0 CC1 CC2 CC3 CC4 CC5 CC6 CC7

DISPLAY 0 DISPLAY 0
CC0 CC0

DISPLAY 1 DISPLAY 1
CC1 CC1

060124- 13 060124- 14

7-8/2006 - elektor electronics 77


047
Jean Brunet
R8CKey
The small board shown in the photo-
graph will conveniently replace the instal-
lation of several components when using
the R8C 16-bit Tom Thumb module for
programming.
In Figure 1, you’ll find the transistors
and their corresponding resistors, the
Reset button and the Mode switch, all
from our first article on the R8C/13.
The R8Ckey is powered by the setup
using the K2 6-pin connector which is
plugged into socket K3 that normally
holds the R8C module. This is used to
bypass various components, specifically
those which made up the original power
supply. The advantage here, of course,
is to enable a much easier insertion of
the R8C module.

Mounting the R8CKey board


There isn’t a lot to say about making the
R8Ckey board. The PCB artwork (Fig-
1a T2
R1
ure 2) shows that installing the compo- 100k
K2
K1
nents is extremely easy. Adding a BC
R2 TXD1
4k7

1 MODE
switch, a button and a few passive and 558C
6 GND
active (two transistors) components 2 RXD +5V
should not be too difficult. 7 T1 RESET
R3
Begin by soldering the gold-plated single- 3 TXD
27k
RXD1
8
row 6-contact connector. Solder it with its 4 BC
plastic base in order to retain the proper 9 R4 548C
spacing, then forcefully slide out the plas- S1 S2
10k

tic part to remove it.


Solder the resistors, the transistors, the SUB-D9

Reset button and the slide switch S2.


The cable is soldered on the R8Ckey TXD1
K3

with the braided ground wire directly on MODE

the ground layer of the board. Two GND

nylon self-locking cable ties keep the b +5V


RESET
cable in place. At the end of the cable, RXD1
pin 2 of the RS-232 port corresponds to
R8C/13
RxD on the board, while, on the copper
1 32 R5
side, pin 3 corresponds to TxD, and pin RXD1 TXD1
10k

2 31
AN6
5 carries ground. 3
RESET AN5
30
4 29
AN4
5 28
Implementation of the R8CKey VSS MODE
6 27
Warning: Make sure the R8Ckey is 7
AN3
26
VCC AN2
properly oriented in socket K3. It must be 8
P17 AN1
25

positioned with the copper side toward 9


P16 AN0
24
10 23
the R8C. Inversion will destroy the tran- 11
P15
22
P14 P30
sistors on the board. 12
P13
21
13 20
P12 P31
The R8Ckey is very easy to use. You only 14
P11
19
15 18
have to insert it into its socket in front of 16
P10 P32
17
P45 P33
the R8C, respecting the orientation, as
we were saying above, the ‘copper’ side

78 elektor electronics - 7-8/2006


2 3

facing toward the R8C. Then, connect the


9-way sub-D plug to the RS232 port on
the PC. Turn the setup on, slide the Mode
COMPONENTS
switch toward the top, and push the Reset
button. Now, all that’s left to do is start
LIST T2 = BC558C

programming the chip. Miscellaneous


Resistors
R1 = 100kΩ S1 = pushbutton (Reset)
Installation at the top of the R2 = 4kΩ7 S2 = slide switch, PCB mount (Mode)
R8C/13 R3 = 27kΩ K1 = 9-way sub-D socket (female) for
The diagram given in Figure 1b is prac- R4 = 10kΩ
cable mounting (RS232)
tically ‘transparent’ because it is limited to Semiconductors K2 = 6-way gold-plated SIL pinheader
a simple 6-pin connector. We propose the T1 = BC548C 1 m shielded cable with 2 conductors
component mounting plan for this second
board and its track design in Figure 3.
Making the second printed circuit, the nected between the Mode pin (pin 28) of used ‘as is’ with this printed circuit design
one for the R8C side is very simple, as the R8C board socket and the +5 V line. program. The relevant files can be down-
can be seen in this example. loaded from the author’s website:
The only thing to solder on the board The PCB artwork was produced in Pro- http://perso.wanadoo.fr/asnora/R8C/
being tested is the 10 kΩ resistor con- teus ARES format and can therefore be r8ckey.htm (060175-1)

Automatic Range Hood


Heino Peters
048
+5V...+15V

Come to think about it, it’s a bit strange R3 R4 R5 R7 R10


8 D1
that range hoods in our kitchens don’t C1
3k3

3k3

3k3

3k3

3k3

IC1 cooker
switch on and off automatically. After all, 4 RE1
hood
100n
a simple temperature sensor under the 1N4001
hood can detect whether a burner is on. R9
100k
The circuit described here goes a step fur- 3
R6
ther and compares the temperature under IC3.A
1
3k3
5 T1
R1 2 7
the hood with the temperature just outside IC3.B
3k3

6
the hood. At a certain (adjustable) tem- IC1 IC2 LM335 BC517
BC517

perature difference, the hood will be P1

switched on, possibly along with the lamp IC3 = LM393


2k5
under the hood. After the burners are shut LM335 LM335
R2 R8
off, the hood fan and lamp will switch off
3k3

3k3

adj C E
again by themselves. The advantage of B

using two sensors is that the hood will


have the same switching characteristics in 060089 - 11

the summer as in the winter.

7-8/2006 - elektor electronics 79


When building the circuit, it’s important 0 V to the supply voltage (or vice versa) ing voltage of the relay. It’s also conven-
to ensure that IC1 is located beneath the in the transition region. The output of the ient to fit the relay in a small box with an
hood in the middle and IC2 is located IC3b will thus be at the supply voltage, electrical outlet and plug so it can be eas-
next to the hood or above it. If the tem- which will switch on T1 via R10. That ily and safely inserted between the plug
perature under the hood is higher than causes the relay to engage and switch and outlet of the range hood.
the temperature outside it, the open-collec- on the fan and lamp of the range hood. The circuit works best with a gas cooker,
tor output of IC3 will be pulled up to the P1 can be used to adjust the output volt- because the heat rises immediately after
supply voltage by R6. The combination age of IC1 over a range of approxi- a burner is lit. With a ceramic or inductive
of IC3 and R7–R10 forms a Schmitt trig- mately 0.1 V, which corresponds to cooking top, it takes a bit longer for the
ger, which we need because the output of around 10 °C. It’s a good idea to use a relay to be actuated.
IC3a does not change immediately from supply voltage that matches the operat- (060089-1)

Eight-channel Scope
049
H. Steffes
Input
+12V

Two channels are C3 C2


usually sufficient to
10µ
perform the majority 100n
25V
+5V
of circuit measure-
ments carried out at R10
14 C31 14 C32
the test bench but IC1 IC2
680 Ω

sometimes it would 7 100n 7 100n IC1.F IC4


R3 5
be useful to be able 13
1
12
10k
3 7
R6
to see what is going 1%
6
5k6

2 1
on in more than two IC1.E 4
R4 8
places simultane- 11
1
10 1% R11
10k LT1227
470 Ω

ously. The price of 1%


R7 R9
5k6

10k

multichannel oscillo- IC1.D


P1
scopes however dic- 9 8
R5
1% 1% C6 C7
1 10k
tates that these are R2
10k 1%
R8
100n 10µ
1k

for professional
10k

25V
IC1.A CTR4
users only. The cir- 1 2 1 0
3
1%
1 + IC2.A 4
cuit described here CT
C1 5 –5V
shows that with a lit- 2
CT=0 6
3 11
tle ingenuity it is per- 470p
10
0
0
MUX

G
fectly possible to 9 7
2
expand the numbers Ch 1
4
0
of input channels to Ch 2
3
1
5
2 IC3 +5V
eight. The circuit has Ch 3 2
1 3 74HC151
Ch 4
been designed with Ch 5
15
4
6
16 C8
simplicity in mind Ch 6
14
5 IC3
13
and can only be Ch 7 6 8 100n
12
used for viewing dig- Ch 8
7
7
EN
ital waveforms. 0
There are two basic 060013 - 11

blocks to the circuit


diagram; an N to 1
multiplexer and a staircase waveform put was displayed on an oscilloscope the as a different horizontal trace on the
generator with N output level steps. All screen would show all eight signals super- screen. Providing the staircase waveform
the common logic families contain a mul- imposed on each other so it is necessary remains in synchronism with the channel
tiplexer chip in their ranks and the type to separate them vertically. This output sig- multiplexing, each of the eight inputs will
74HCT151 (IC3) used in this design is a nal is therefore mixed with the output of be redrawn in the same position one
low-cost eight to one multiplexer which a staircase waveform generator which above the other on the screen.
switches any one of the eight input signals switches in time with the channel multiplex The display is useful for analysing the tim-
through to the common output. If this out- signal so that each channel is displayed ing behaviour of simple digital circuits

80 elektor electronics - 7-8/2006


and its eight bit wide input is ideal for R8) driven by the three binary coded out- of the multiplex frequency to suit the type
monitoring the data bus and input/out- puts of the counter which also switch the of signal under measurement.
put ports of a low-speed microprocessor multiplexer (IC3). The multiplexer output With a switching frequency in the order of
system. The circuit actually is useful as a signal and staircase waveform are now 2 MHz it is necessary to display the
rudimentary logic analyser for digital cir- mixed at the inputs of the fast opamp eight channel outputs on an oscilloscope
cuits using slow clock speeds. IC4. The oscillator frequency can be which has a minimum input bandwidth
The staircase waveform is generated by adjusted by P1 from 100 kHz to approx- of around 20 MHz.
an R/2R type of resistor network (R3 to imately 1.8 MHz. This allows adjustment (060013-1)

84x48-pixel
Graphics LCD 050
1 2

for just a few pounds! 96x64 pixels). You can find numerous (in the telephone) to establish contact.
sites on the web which sell this product Two DIY solutions are possible:
Marcel Cremmel (new or used) as a one-off or in bulk. 1. we solder an 8-wire ribbon cable to
After such praise, what is there to criti- the pads (Figure 1). Don’t forget, the
Alphanumeric displays (having ? lines of cise? Any difficulty in implementation is pitch is 1.14 mm !
n characters) are very popular. Reason- due to the connections. The connector is 2. we reproduce the original connection
ably priced, they are rather easy to composed of gold-plated ‘spring’ blades system. Tests have shown excellent relia-
implement. However, here we are pro- (on the LCD) which rest on solder pads bility with tin-plated solder pads. Inter-
posing to replace them with a graphics
LCD that scores better on a number of
aspects: 3 IC1
LCD Nokia 3310

• it’s graphic! (84x48 pixels); 19


1
&
EN
9

• can be used to display up to 6 lines K1 10


Ecouteur
of 14 characters (8x5 matrix); 1 STROBE 1
VDD
14
• anyone can create his/her own char- AUTOFDX
ERROR
15
2
3
D0
D1
330 Ω
R1
R2
2
3
18
17
2
3
SCLK

acter font; INIT


16
4 D2
330 Ω
R3 4 16 4
SDIN
330 Ω
• easy to drive (5-wire synchronous SLCTIN
17
18
5 D3
330 Ω
R4 5 15 5
D/C
CE
serial connection); 19
6 D4
330 Ω
R5 6 14 6
GND GND
11

• superior contrast; 20
7
8
D5 7
8
13
12
7
8
CAP
12

• only consumes 110 µA at 3.3 V 21


9
D6
D7
9 11
RESET

• can be backlit 22
23
10
ACK 74HC541
C2

• and what’s more it only costs from 2 24


11
12
BUSY IC2
10µ 6V3

to 4 pounds, new! 25
13
PE LP2950ACZ-3.0
READY +3V0

But where can we find this LCD with such DB25


PORT LPT 20
an unbeatable price/quality ratio? Actu- C1
IC1
ally, we are referring to a part in a 10
100n
widely-distributed product: the LCD in a
Nokia 3310 mobile telephone (the 3410 060080 - 11

can also be used, the resolution is then

7-8/2006 - elektor electronics 81


ested readers will find artwork for PRO- LSB
TEL software on the Elektor website. 4 0

Y-address
Connector
Do not attempt to extract the display from
its plastic casing as the display also MSB

includes part of the telephone keyboard. 5

You can get rid of it with a plastic cutout 0 X-address 83


060080 - 13
(the red line on the photo in Figure 2).
Do not cut out the top part if you are
planning to use the original connection
system — the securing screws can be 5 6
used to maintain contact pressure.

Power supply
All you need to do is apply a supply volt-
age of between 2.7 and 3.3 V to the
display. The display has its own the DC-
DC converter which produces the
required current for the LCD, decoupled
by C2 (see diagram in Figure 3).
You will find a test program in C on the • variable speed scrolling in 4 direc-
Programming Elektor website (ref. 060080-11.zip) tions;
The LCD uses a controller type PCD8544 that has the most common functions: ini- • saving the drawing.
from Philips [1]. Full documentation is tialisation, write text (two font sizes) and
available on the web. The circuit has a simple drawing (pixel and straight track). The low current consumption of the LCD
screen memory organised into six lines It is written for the MSP430 family in the means it can be powered from the printer
of 84 bytes, or 504 bytes. The eight bits free IAR environment [2] but is easily output port. However, a 3 V regulator
of a byte represent the states of eight ver- adaptable to other microcontrollers and buffer gates have been added to
tical pixels corresponding to the screen because it does not rely on hardware avoid any risk of damaging or overload-
(state 1 = black pixel, see Figure 4). from a specific resource (SPI coupler, ing the LCD electronics. For example, the
In order to display text, for example, the among other things). LCD does not seem to like voltages
program should ‘draw’ each letter in the Furthermore, a program called applied to logic inputs in the absence of
screen memory. Test_LCD_Nokia_3310 is available (see the supply voltage.
Assigning registers for the PCD8544 con- Figure 6). It runs on the PC and is used (060080-1)
figuration and for the ‘screen’ RAM is to test the display connected to the par-
carried out by a synchronous serial con- allel port as shown in the diagram in Fig-
nection: ure 3. Internet Links
• SCE : selection of the circuit (5) The installation of this program is simple: [1] www.semiconductors.philips.com/
• SDIN : serial input output (3) copy the executable to any folder and products/
• SCLK : synchronous clock (2) the TVicLPT.sys file to C:\Windows\Sys- [2] MSP430, 4K KickStart Edition v3.40A
• D/C : given selection/command (4) tem32\Drivers. on www.iar.com
• RES : Reset (8) The archive file ‘LCD_Nokia’ containing all
Available functions: of the files mentioned in this article can be
Figure 5 shows the typical timing dia- • free drawing with the mouse; downloaded free of charge from
gram for writing a command. • text drawing; www.elektor-electronics.co.uk

051
Bart Trepak
Call Acknowledged!
shout above the level of the CD of a call as well as confirming to the caller
player/TV/games console in their bed- that the ‘message’ has been received. This
This circuit could be used (depending on room. Rather than resorting to a full-blown is especially useful in the latter case, as the
your circumstances) by a gentleman to intercom system, a simpler solution was call may be easily drowned out by the
summon his butler, a manager his secre- envisaged and while a buzzer could eas- music playing in the headphones.
tary or as in the author’s case to call the ily fulfil this function, this circuit has the The circuit, which requires no compli-
kids down to dinner without having to advantage of providing a visual indication cated switching, uses a simple two-wire

82 elektor electronics - 7-8/2006


connection between the two stations and
utilises the fact that the forward voltage MASTER SLAVE
drop of a blue (or white) LED is greater
S1
than that of a red, green or yellow one. S2
The circuit is based on a two-transistor
R1 R2 R3 BZ1
multivibrator which is used to pulse a red D2 D3

10k

100k

100k
LED (D3) as well as the buzzer Bz1 on red
blue
and off at about 1.5 Hz when push but- BT1
ton S1 is closed. This frequency may of R4

560 Ω
course be altered if required by chang-
9V
ing the values of the capacitors. The D1 optional

diode D1 in series with the collector of


transistor T2 is required to isolate the out- C1 C2 1N4148
put from the effects of the buzzer cir- 4µ7 4µ7 red/green/yellow
cuitry, which would alter the multivibra- T1 25V 25V T2

tor frequency. 1N4148


2x
In principle, the multivibrator could be 2N3904
dispensed with but a pulsed
050385 - 3 - 11
buzzer/flashing led is much more notice-
able than a continuous signal especially
in noisy conditions. Since the voltage
across a red LED is typically about 1.5 preoccupied teenager. diode to raise its forward voltage above
V while a blue LED requires at least 2.5 V When the recipient presses the acknowl- that of the red LED in the receiver could
to 3 V to light, the blue LED will remain edge (push to break) switch S2, the red be used instead.
off when the call button S1 is pressed. LED/buzzer are disconnected allowing The circuit may be powered by a 9-V bat-
Despite being rated for operation at 3- the blue LED to flash at the sending sta- tery, a mains power supply being unnec-
12 V, most piezo sounders can still pro- tion indicating to the caller that his call essary in view of the low power con-
duce a piercing sound from the pulsed has been received. Alternatively, if a blue sumption and infrequency of use of the
1.5-V available across the red LED which LED is not available, a red or green type circuit.
should get the attention of even the most in series with a forward biased silicon (050385-3)

Multi-Colour
Flashing LED
Light effects have always been popular.
052
Now that LEDs are available in all sorts of
shapes, sizes and colours for reasonable
prices, a whole gamut of possibilities has
become feasible. Examples are case mod-
ding (embellishing PC cases with all kinds
of lights, windows, etc.), adorning scoot-
ers, motorcycles and cars with various
light ornaments, mood lighting in different
colours and we could go on.

In Elektor Electronics we also regularly


feature circuits with LEDs. One circuit
flashes LEDs, another drives multi-
coloured LEDs. On one occasion stan- around for donkey’s ages. They are quite from one to another. This effect is even
dard logic (counters, shift registers, etc.) nice, but spectacular they are certainly nicer if the components are used next to
is used to drive the LEDs, on another not. The company I.C. Engineering offers each other. Because of small variations
occasion a microcontroller is used. But something much nicer: a three colour LED between LEDs, one LED will change
there are also solutions that do not in a package with a diameter of 5 mm, colour a little faster than another, which
require additional driving electronics. which also contains all the control elec- results in a colourful play of lights. This
tronics. This ‘LED’ only requires a power ‘LED’ is eminently suitable to make a nice
Ordinary flashing LEDs that require no supply voltage of 3 V to give a continu- light ornament without too much effort.
more than a series resistor have been ous ‘light show’. The colours blend slowly (064014-1)

7-8/2006 - elektor electronics 83


053
Andreas Köhler
USB Fuse
Life in the 21st century would be almost
unbearable without some of the computer
peripherals that PC users now look on as
essentials — take for example the USB
powered teacup warmer; this device is
obviously an invaluable productivity tool
for all users but it could prove a little tire-
some if the extra current it draws from the
USB port is sufficient to produce a
localised meltdown on the motherboard.
In a slightly more serious vein a similar
situation could result from a carelessly
wired connector in the design lab during
prototyping and development of a USB
ported peripheral. What’s needed here
is some form of current limiting or fuse to
prevent damage to the motherboard.

The MAX1562 shown in Figure 1 is a


purpose-built USB current limiter from the
chip manufacturers Maxim. The device
operates with a supply voltage from 4.0
to 5.5 V with an operating current of

1 IN
2
D1
CHARGE
ON 1
PUMP
5 6
IN OUT red
IN 5 2
FAULT IC1
IN 7 7 8
IN OUT
ISET 4 ILIM R1 MAX1562 R2
4 2
THERMAL 6 OUT 5k6 ISET FAULT 1k5
SHUTDOWN
25mA
8 OUT ON GND
FAULT LOGIC 1 3
20ms TIMERS P1
C1 C3 C2
OSC
MAX1562 ULVO
25kHz
BIAS REF

1µ 220n 4µ7
3 10k
GND 060024 - 12

060024 - 11

typically 40 µA or 3 µA in standby
mode. The circuit introduces a very low COMPONENTS
resistance in the power line (typically 26 Capacitors
mΩ but guaranteed less than 50 mΩ) LIST C1 = 1µF (SMD 1206)
C2 = 4µF7 10 V, tantalum
from an internal MOSFET. The FET gate C3 = 220nF (SMD 1206)
bias voltage is generated on-chip from a Resistors
charge pump circuit. Semiconductors
R1 = 5kΩ6 (SMD 1206) D1 = LED, low current
The chip can distinguish between an R2 = 1kΩ5 (SMD 1206) IC1 = MAX1562ESA
overload and a short circuit condition in P1 = 10kΩ preset PCB, ref. 060024-1
the supply line by measuring the voltage
drop across its internal resistance; if the
voltage is less than 1 V a short circuit is
assumed and the chip pulses a (limited)
3 P1
D1 1-420060
+
IC1

0 0
output current every 20 ms in an effort
060024-1 060024-1
R2
C3
C2

R1 C1
to raise the output voltage. This approach
will eventually be successful if the short

84 elektor electronics - 7-8/2006


circuit was caused by a large value kΩ resistor in series with a 10 kΩ preset Figure 2 shows a diagram of the man-
capacitor across the USB supply pins or giving an adjustable current limit ufacturer’s application circuit. The FAULT
an external hard drive which have a high between 1.097 and 3.057 A. This output drives an LED via a series limiting
in-rush at start up. If the supply rail is not range should be sufficient for the majority resistor which reduces the LED current to
pulled up within the first 20 ms the of applications. Increasing the preset 2 to 3 mA. The MAX1562 is available
FAULT output (pin 2) is driven low. resistance reduces the current limit level. in a HESA variant (with an active high
The output current limit is set by a single Any intermittent connection in the preset ON signal) or ESA version (with an
resistor on pin 4 (ISET): (caused by a dirty track etc.) will switch active low ON signal). The chip is pack-
the chip into shut down. The MAX1562 aged in an 8-pin SMD outline. Figure
ILIM = 17120 / RSET. also contains a thermal cut out which 3 shows a small PCB layout for the cir-
turns off the output when the chip temper- cuit using mostly SMD components.
The circuit diagram shows a fixed 5.6 ature exceeds 160 degrees C. (060024-1)

Electronic
Torricelli Barometer * 054
IC1
7805 D11 +9V

1N4004
C1 C3 C2 4
IC4
100n 220n 470µ 11
25V

3
1
IC3 3 IC4.A P1 D1
2 R3
4 R6
1k

-VO 22k IC4 = LM324 D2


47k

3
2 9
+VO D3
8 12 1
R4 IC4.C L1
10 14 7 18
1 1k IC4.D REFOUT L2 D4
13 5 17
SIG IC2 L3
6 16
MPX2200AP 5 RHI L4 D5
R5 R9 R8 15
7 L5
IC4.B
120 Ω

1k 1k 14
6 L6 D6
13
LM3914 L7
4 12
R2 RLO L8 D7
9 11
1k MODE L9
R7 8 10
REFADJ L10 D8
R1
1k

2
D9
1k

D10
060110 - 11

Christian Tavernier which, if not as beautiful, is still less toxic ential and at a very low level, we had to
for the environment in case of breakage. resort to the use of four operational ampli-
Although it does not have the same As indicated on the drawing, the pressure fiers IC4.A to IC4.D, contained in one
charm as real mercury barometers with sensor utilized is a Motorola MPX2200AP. LM324, to obtain levels that can be
long glass tubes on pieces of carved and This circuit is adapted for measuring processed easily. As long as potentiome-
polished wood, the Torricelli barometer absolute pressure and has a range well ter P1 is adjusted correctly, this group of
discussed here is a functional equivalent suited for atmospheric pressure. Without operational amplifiers delivers a voltage
and electronic replica of the Torricelli entering too deep into the technical of 1 volt per atmospheric pressure of
barometer. Actually, rather than display- details, such sensors deliver an output of 1,000 hPa to the LM3914. Since the
ing the atmospheric pressure on the tra- voltage proportional not only to the meas- atmospheric pressure will be within the
ditional digital displays, we preferred to ured pressure but, unfortunately, to their range 950 to 1040 hPa at sea level, we
reproduce the general look of this supply voltage as well. Hence they must need to make an expanded-scale volt-
respected predecessor of electronic be powered from a stable voltage which meter with this LM3914 in order to better
barometers. The mercury tube is, of is ensured here by the use of IC1. exploit the 10 LEDs that it can control. That
course, replaced by a simple LED scale Since the output of the MPX2200 is differ- is the role of resistors R7 and R8 which

7-8/2006 - elektor electronics 85


artificially raise the minimum voltage value from a 9-volt battery but only if used very with an existing barometer or, even bet-
the chip is capable of measuring. occasionally. Since this is usually not the ter, telephone the closest weather sta-
Consequently, we can ‘calibrate’ our LED case for a barometer, we advise you to tion. They will be happy to give you the
scale with one LED per 10 hPa and thus use a mains adaptor instead supplying information.
benefit from a measurement range which approximately 9 volts. (060110-1)
extends from 950 hPa to 1040 hPa. In Calibration basically entails adjusting
principle, you should not have a need to the potentiometer P1 to light the LED cor- * After Evangelista Torricelli, 1608-1647, Italian
go beyond that in either direction. responding to the atmospheric pressure physician who proved the existence of atmospheric
The circuit may be conveniently powered of your location at the time. Compare pressure and invented the mercury barometer.

Contrast Control
055
Heino Peters
for LCDs
R1 = 227x10-6 x 293 /
(200x10-6)
500 µA +5V 200 µA
The adjustment control for the R1 = 333 Ω
Vo
contrast of an LC-Display is typ-
LM334
ically a 10-k potentiometer. This IC1 V+ Note that the current supplied by
works fine, provided that the 200 µA the LM334 depends on the tem-
P1 adj.
power supply voltage is con- Vo perature. This is also true for the
R1
stant. If this is not the case (for current from the display, but it is
330Ω

example, with a battery power 10k LM334 V– V+ V–


not strictly necessary to have a
700 µA adj
supply) then the potentiometer linear relationship between these
has to be repeatedly adjusted. 060091 - 11
two. Temperature variations of
Very awkward, in other words. up to 10° will not be a problem
The circuit described here offers however.
a solution for this problem. This circuit results in a power
The aforementioned potentiometer is presented here ensures that there is a cur- saving of over 25% with an LCD that
intended to maintain a constant current rent of 200 µA to ground, independent itself draws a current of 1.2 mA. In a bat-
from the contrast connection (usually of the power supply voltage. By substitut- tery powered application this is definitely
pin 3 or Vo) to ground. A popular green ing a 2.2-kΩ potentiometer for R1, the worth the effort! In addition, the contrast
display with 2x16 characters ‘supplies’ current can be adjusted as desired. The does not need to be adjusted as the bat-
about 200 µA. At a power supply volt- value of R1 can be calculated as follows: tery voltage reduces.
age of 5 V there is also an additional When used with LCDs with new technolo-
current of 500 µA in the potentiometer R1 = 227x10-6 x T / I. gies such as OLED and PLED it is advis-
itself. Not very energy efficient either. able to carefully test the circuit first to
Now there is an IC, the LM334, which, Where T is the temperature in Kelvin and determine if it can be used to adjust the
with the aid of one resistor, can be made I is the current in ampères. In our case brightness.
into a constant current source. The circuit this results in: (060091-1)

Protection
056
Christian Tavernier
for Telephone Line
Paradoxically, now that we are hooking served by overhead telephone lines,
up delicate and expensive equipment there’s an obvious risk of very high volt-
A long time ago when telephones were such as telephones filled with electronics, ages being induced on the lines during
so simple almost nothing could go amiss fax machines, (A)DSL modems, etc., this thunderstorms. While we have lost count
from an electrical point of view, Telecom protection has disappeared. today of all of the modems, fax machines
operators installed surge protection on all However, if you have the good fortune to and other telephones that have been
telephone lines exposed to storm risks. live in the countryside in a building destroyed by a ‘bolt of lightning’, surpris-

86 elektor electronics - 7-8/2006


ingly you only have to invest a few which also limits the voltage
pounds to get a remarkably effi- EL R1 SL between line wires to a maximum
cient protection device like the one a 10 Ω a of 250 volts. Even if this value
we are proposing here. 3W seems high to you, we should

telephone line
During a storm, often with light- gas
discharge LA1
R3 remember that all of the author-
ning striking near a telephone line, tube ized telephone equipment, carry-
VDR
the line carries transient voltages V250LA4
ing the CE mark must be able to
up to several thousands of volts. T21-A230X GeMOV, SiOV withstand it without damage. This
Contrary to the HV section of tele- EL R2 SL is not always the case however
vision sets or electrical fences, on b 10 Ω b with some low-end devices made
which practically no current is run- 3W 060112 - 11 in China, but that’s an entirely dif-
ning, in the case of lighting strik- ferent problem.
ing current surges of thousand of Since pulses generated by light-
amps are not uncommon. suddenly becomes a full conductor to the ning are very brief, the ground connec-
To protect oneself from such destructive point of being able to absorb colossal tion of our assembly must be as low-
pulses, traditional components are not currents without being destroyed. The inductance as possible. It must therefore
powerful or fast enough. As you can see one we are using here, whose size is of be short, and composed of heavy-duty
on our drawing, a (gas-filled) spark gap the same magnitude as an ordinary one wire (1.5 mm2 c.s.a. is the minimum). If
should be used. Such a component con- watt resistor, can absorb a standardized not, the coil, composed of the ground
tains three electrodes, insulated from 5,000 amps pulse lasting 8/20 ms! connection, blocks the high frequency
each other, in an airtight cylinder filled Since we are utilizing a three-electrode signal that constitutes the pulse and
with rare gas. As long as the voltage spark gap, the voltage between the two reduces the assembly’s effectiveness to
present between the electrodes is below wires of the line or between any wire nothing.
a certain threshold, the spark gap and ground, cannot exceed the sparking Finally, please note that this device
remains perfectly passive and presents voltage, which is about 250 volts here. obviously has no effect on the low fre-
an impedance of several hundreds of Such protection could theoretically suffice quency signals of telephones and fax
MW. On the other hand, when the volt- but we preferred to add a second secu- machines and it does not disturb (A)DSL
age rises above this threshold, the gas is rity device made with a VDR (GeMOV or signals either.
very rapidly ionized and the spark-gap SiOV depending on the manufacturer), (060112-1)

SMD Crystal-Adapter
057
K1 IC1

1 8 (14)
1 8
IC1
OSC
4 5
4 5 (11)
Ton Giesberts small SMD package. We originally used
the SG531P-series from Seiko Epson in
The idea for this adapter was really born the design for the A/D-converter. This
out of necessity. The 24.576-MHz crystal (7) (8) comes in a kind of 8-pin DIL package.
oscillator that is used in the Audio ADC So, to nevertheless enable us to use the
2000, (24 bit/96 kHz, March 2001) is ( ) = 14-pin DIP Citizen version, we designed a very
not (easily) available any more. A col- 064003 - 11 small circuit board that adapts the SMD
league who was interested in the circuit device with 4 pins to the footprint for the
and was keen to try out the prototype 8-pin DIP version. The connection pin
realised that a 25 MHz oscillator was 48000 Hz, or 24.576 MHz. Fortunately order is the same. In addition, we have
used at the time. In order to create useful this frequency is available as part of a made the PCB also suitable for the 14-
recording material it is of course necessary series of oscillators from Citizen, the CSX- pin version (SG531P series). This
to use the correct sampling frequency, 48 750FC series, to be more specific. requires two additional pins. These are
kHz, that is. This requires 512 times These oscillators are housed in a very located at pins 7 and 8 of the 14-pin

7-8/2006 - elektor electronics 87


package and are connected to pins 4 There is also a third letter after the type clear: the dot on the package of the
and 5 respectively of the 8-pin package. number, which indicates the accuracy: C CSX750FCC is pin 1 of the oscillator.
Pin 1 is in both cases the enable pin and or F for 100 ppm and B for 50 ppm. We used thin pin headers for the connec-
pin 8 (8-pin) and 14 (14-pin) are +5 V. If the PCB is to be used in place of an 8- tions so that the small adaptor can be fit-
Pay close attention when ordering the pin oscillator then you can trim the board ted into an IC-socket or soldered directly
oscillator. It so happens that there are also along the line that is clearly visible on the onto a PCB.
3.3-V versions (CSX-750FB and FJ). You solder side of the board. The solder side The IC is available from Digi-Key.
need a 5-V version for the Audio-DAC. (copper side) is the top side. Just to be (064003-1)

058
This circuit performs a similar func-
Battery Saver
gate threshold voltage (around 2 V
tion to the ‘sleep’ button on a radio for the FET types specified). The
R1 R3
alarm clock; pressing the button length of the ‘on’ period depends
100 Ω

1k

connects the battery supply to some on three factors; firstly the value of
external equipment or circuit (repre- S1 R2 which governs the capacitor dis-
sented by RL) for a preset time RL charge current, secondly the capac-
BT1
period. The period can be extended 4V5...12V ON itance of C1 and finally the supply
by pressing the button again before voltage from the battery BT1. When
‘time out’. The circuit will avoid the R2
C1 D1 C1 is charged to a higher voltage it
10M

situation where you forget to turn off G T1 takes longer to fall below the thresh-
47µ
some battery powered equipment 25V old level. The component values
and return to find the battery is flat. S D
given will produce an ‘on’ time of
Unlike a digital alarm clock sleep BS170 ≤ 100mA
060121 - 11
around 10 minutes with a supply of
IRL540 ≤ 1A
function the circuit here is based on 5 V. The FET turns off relatively
a simple analogue timer which uses slowly at the end of the ‘on’ period;
very few components. Pressing but- this should not cause a problem if
ton S1 rapidly charges C1 via R1. When FET is negligible for the two types of FET the switched equipment uses only ana-
the voltage on C1 exceeds the threshold specified (for a maximum load current of logue circuitry but can lead to a momen-
voltage at the gate of FET T1 it conducts either 100 mA or 1 A). tary malfunction if the equipment contains
and switches the battery to RL. The drain- T1 remains conducting as long as the digital circuitry.
source voltage drop introduced by the voltage on C1 is greater than the FET (060121-1)

059
Heino Peters
Electronic Touch Switch
nails, etcetera, which are placed close The voltage at the non-inverting input of
together on a non-conducting surface. In IC1.b amounts to half the power supply
Mechanical contacts have the disadvan- this circuit a comparator of the type voltage (through voltage divider R4 and
tage that they wear out. That is why it is LM393 has been used. R5) and is lower than the voltage on the
practical to use an electronic ‘touch inverting input. The output of IC1.b is
switch’ in some situations. With such a In the idle state there is, via R1, a voltage therefore a ‘0’.
touch switch the resistance of the human equal to the power supply voltage on the If the two touch contacts are bridged with
skin is used for the switching action. non-inverting input of IC1a. Because the a finger, the voltage at the non-inverting
The schematic shows the design of a cir- inverting input of IC1a is set with R2 and input will become low enough to cause
cuit that senses the resistance of the skin D3 to D5 at the supply voltage minus the comparator to toggle state. The moist-
and converts it into a useful switching sig- 1.8 V, the open-collector output of IC1.a ness of the skin results in a resistance of 1
nal. The touch switch contacts can be is, via R3, equal to the power supply volt- to 10 MΩ.
made from two small metal plates, rivets, age. This voltage is inverted by IC1.b. If this circuit is used in the vicinity of

88 elektor electronics - 7-8/2006


equipment that’s connected to the mains, +6V...+20V
then it can be sufficient to touch only the
upper contact to operate the switch, pro- R1
D3
R3 R4 R8
8
vided that the circuit has been earthed. C1

10M

10k

10k
100k
D1 D4 IC1
The body then acts as an antenna which 4 R7
100 µ
receives the 50 Hz (or 60 Hz) from the D5 25V 100k

mains. This is enough to toggle IC1.a at


R6
the same 50 Hz. C1/R3 prevent this 1k
5
7
50 Hz from reaching the input of IC1b 3
IC1.B
1 6
and provide a useable ‘pulse’ of about 2
IC1.A

10 s at the output of IC1.b.

S1 R2 R5
Note that a fly walking across the touch D2 D1, D2 = 1N4001 IC1 = LM393

10k

10k
D3...D5 = 1N4148
switch conducts enough to generate a
switching signal. So do not operate
important things with this circuit (such as
060084 - 11
the heating system or the garage door).
Do not make the wires between the touch
contacts and the circuit too long to pre- The power supply voltage for the circuit voltage in the range from 6 to 20 V can
vent picking up interference. is not very critical. Any regulated DC be used. (060084-1)

Audible Flasher Warning


Udo Burret
060
D5

Vehicle indicator control


If you’re a biker or scooter rider you’ll P1
C1 1N4001 T1
know how easy it is to forget to cancel 500k
1000µ
your flashing indicators after turning with- R1
25V
LA1 LA2
out an audible reminder. Constantly S2
10k

glancing at indicator lamps is hardly an 8 4 D1 D2


R
option; your eyes should be on the road R2
7
DIS 4x indicator
+12V
T1 1N4001
ahead! The simple circuit shown here IC1 relay
100k

R3
3
provides an audible reminder. The clever 2 TR 555
OUT 1k2
D3 D4
bit is the way it doesn’t annoy you by 6 THR BC327
LA3 LA4 S1
beeping the instant you activate the flash- CV BZ1

ers but only after a preset time, in other 1 5


C2 C3
words when your indicators are active T2 LA1 ... LA4: indicator lights
S1, S2: indicator switch
longer than normal. 2µ2
25V
10n

Supply to the circuit is through the flasher


relay. With the indicators activated a 1 050392 - 11

squarewave voltage reaches bridge rec-


tifier D1-D4 via terminal T1 or T2, with The timer always charges and discharges sounder to operate. This applies only
the other terminal remaining grounded capacitor C2 to a level between a third when +12 V is present at the collector
through the indicator lamp that’s inactive. and two-thirds of the operating voltage, of transistor T1, which is the situation
The pulsed DC voltage is stored and producing an interval of when the flasher relay is just switched on
smoothed in C1, with D5 preventing the and the indicator bulbs light up.
electrolytic from discharging during the 0.7 x C2 x (R2 + R1 + P1) [s] The circuit is built inside a splash-proof
periods when the flasher voltage is off. enclosure, installed on your machine in
This also provides an adequately clean The preset enables you to set this delay a position that’s out of harm’s way. The
supply voltage for the 555 timer when- up to a second or so. The initial delay, audible sounder can be positioned any-
ever the indicators are operating. before the sounder first operates, is sig- where outside the enclosure if it’s a
Timer IC1 is used here as an oscillator nificantly longer, however, because the waterproof type. The audible control unit
and controls a piezo sounder by means of electrolytic has zero charge. Only after requires only two cable connections,
transistor T1. The output of the 555 is this delay is the output active, for the which can be made at any convenient
active Low, meaning that initially the tran- pulse duration of 0.7 x C2 x R2 (equiva- access point.
sistor is blocked and the sounder is silent. lent to about 0.15 seconds), enabling the (050392-1)

7-8/2006 - elektor electronics 89


061
Ton Giesberts
SCSI Adapter

This circuit (admittedly a big word for


three connectors), was born out of neces-
sity. Many years ago, when reliable scan-
ners were still being made, there were
faster and more expensive models with a
SCSI interface. In many cases, as part of
the package, a proprietary SCSI controller
for the PC was delivered with it. This was
typically an ISA bus controller. When
upgrading to another SCSI controller (PCI-
bus), and also motivated by being able to
connect better hard disks and other periph-
erals, a new cable was required to con-
nect the high-density connector of the new
controller to the older 25-way sub-D or 50-
way Centronics connector.
In these days of SATA2 and FireWire, the
use of SCSI as a fast interface to devices
is no longer required, unless you happen the PC have a female connector. The new 25-way sub-D and for the converter a
to have, for example, a very good qual- cable that you bought cannot be used high-density connector. The schematic
ity scanner with SCSI interface. There are and you will have to look for another shows the necessary connections and
converters that can connect a SCSI solution. One of these is to make an their names. We don’t discuss this any
device to the USB-bus. These have a adaptor, which allows the USB/SCSI further, there is plenty of information
male high-density connector for the SCSI converter to be connected directly to the available on the Internet.
interface, while the controllers internal to scanner. For the scanner we assumed a The PCB consists of two parts. One is for

SCSI 2 high density


K3
1 26 DB0_B
K2 K4 2 27 DB1_B
DB5_A 1 2 DB7_A DB7_B 1 2 DB5_B 3 28 DB2_B
SUB D9 3 4 DB1_A DB1_B 3 4 4 29 DB3_B
K1 5 6 DB3_A DB3_B 5 6 5 30 DB4_B
REQ_A 1 7 8 DB0_A DB0_B 7 8 6 31 DB5_B
14
MSG_A 2 9 10 DB2_A DB2_B 9 10 7 32 DB6_B
15 C/D_A
I/O_A 3 11 12 DB4_A DB4_B 11 12 8 33 DB7_B
16
RST_A 4 13 14 DB6_A DB6_B 13 14 9 34 DBP_B
17 ATN_A
ACK_A 5 15 16 DBP_A DBP_B 15 16 10 35
18
BSY_A 6 17 18 RES3_A RES3_B 17 18 11 36
19 SEL_A
7 19 20 RES1_A RES1_B 19 20 RES1_B 12 37 RES3_B
20 DBP_A
DB0_A 8 21 22 21 22 13 38
21 DB1_A
9 23 24 RES2_A RES2_B 23 24 RES2_B 14 39 RES4_B
22 DB2_A
DB3_A 10 25 26 RES4_A RES4_B 25 26 15 40
23 DB4_A
DB5_A 11 27 28 ATN_A ATN_B 27 28 16 41 ATN_B
24
DB6_A 12 29 30 ACK_A ACK_B 29 30 17 42
25
DB7_A 13 31 32 MSG_A MSG_B 31 32 18 43 BSY_B
33 34 C/D_A C/D_B 33 34 19 44 ACK_B
35 36 I/O_A I/O_B 35 36 20 45 RST_B
GND_A
37 38 SEL_A SEL_B 37 38 21 46 MSG_B
TERMPWR_A
39 40 REQ_A REQ_B 39 40 22 47 SEL_B
RST_A 41 42 BSY_A BSY_B 41 42 RST_B 23 48 C/D_B
24 49 REQ_B
GND_A GND_B 25 50 I/O_B
TERMPWR_A TERMPWR_B

TERMPWR_B
GND_B

064007 - 11

90 elektor electronics - 7-8/2006


064007-1

064007-1
(C) ELEKTOR
fitting the right-angle 25-way male sub-D therefore only one pin header required.
connector and the other for the high-den-
sity connector. The PCB has been
You may have to take into account the
locking screws of the male sub-D connec-
COMPONENTS
designed in such a way that the two com-
ponent sides can be connected together
tor. These are probably already present
on the scanner and you will have to
LIST
via a double row pin header (2?21 remove them from the adapter. The
K1 = 25-way sub-D plug (male),
pins). By selecting the spacing between adapter is held in place firm enough angled pins, PCB mount
the boards just right, so that the height of without the locking screws. K2,K4 = 2x21-pins pinheader (see
the connectors is about the same, a Unfortunately it turned out that the soft- text)
robust and compact adapter can be ware for the scanner could not cope with K3 = 50-way angled SCSI-2 high-
density connector, PCB mount (e.g.,
made. The photo shows what the inten- the USB driver for the converter, but that Farnell # 369-3752 or # 854-037)
tion is. There is really no opportunity for is another story. PCB, ref. 064007-1
mistakes. K2 is also K4 and there is (064007-1)

Telephone Ringer
Christian Tavernier
D1
062
LA1
C1 R1 1N4004 R2
If you are lucky enough to have a big 1k 220 Ω
1µ D3
house, a large garden, and small chil- 250V
230V
2A max.
dren, this project just might interest you. a
L
IC1 R3
It’s actually a telephone ringer capable of D2
telephone C2
making any mains-powered device work line VDR
230V

from the ringer of your fixed line. With it, b 6V8


47µ
25V
V250LA4
0W4 N
you will be able to control a high-pow-
ered siren or horn, as you like, in order
to relay and amplify the low-level sound S202T02 060113 - 11
of your telephone (making it audible in a
big house or in a large garden)! Alterna-
tively, you can make a lamp light (or an age on a fixed telephone line is pretty exchange believe the line is occupied.
indicator light) and so create a ‘silent high. Since Europe and the EU Commis- Therefore, capacitor C1 has the dual role
ringer’ (helpful when small children are sion have not yet interfered, the exact of insulating this project with respect to
napping). The other interesting part of this value of this voltage and its frequency direct current present on the line while
simple and inexpensive project is that it varies according to the country, but that’s unoccupied, or while occupied, while
doesn’t require a power supply, contrary not important here. The line carries direct also allowing the ringer current to pass.
to similar items on sales in the shops. current whether unoccupied or occupied. The latter is rectified by D1 and clipped
Before examining the drawing and Moreover, no more than a few hundred by D2 which makes about 6 V DC avail-
understanding the principle involved, it mAs needs to be stolen from an unoccu- able to the C2 terminals when a ringer
is important to know that the ringer volt- pied telephone line to make the PSTN signal is present. This voltage lights LED

7-8/2006 - elektor electronics 91


D3 which only serves as a visual indicator with four pins. The pinout will not cause model indicated here is generally avail-
of proper operation as does the LED con- confusion because the symbols shown on able. The load will be limited to 2 A,
tained in IC1. This is a high-power photo our diagram are engraved or printed on considering the model selected for IC1,
triac with zero crossing detection from the the packaging. Since this circuit is not yet which is more than sufficient for the appli-
mains, which allows it to switch the load very common, we need to mention that cation planned here.
it controls without generating even the it’s available from the Conrad Electronics Finally, since a number of components in
lowest level of noise. This component, that website (www1.uk.conrad.com). this circuit are connected directly to the
we might just as well call a solid-state For the purpose of safe operation, the cir- mains power supply, the assembly should
relay, was selected because it is comes in cuit is protected by a GeMOV on the be placed in a completely insulated hous-
the form of a package similar to a mains side, called Varistor, VDR or SiOV ing for obvious safety reasons.
TO220, a little bigger, and equipped depending on the manufacturer. The (060113-1)

063 Slug Repellent


+U
R1
1M
CTR7 12
0
IC1.A 11
1
1 2 1 9 T3 T4
1 + IC2 2 D1
6
CT 3
C1 5
4 1N4148
2 4 IC1.E IC1.C
CT=0 4024 5 R2 BUZ171 BUZ171
100n 3 11 10 5 6
6 1 100k 1
3
IC1.B C2 K2
1 10n
4
D2

+U
1N4148 IC1.D
R3 D3
9 8
100k 1
14 C5 14 C6
C4 T1 T2
IC1 IC2
7 100n 7 100n
10n

BUZ11 BUZ11

+U
IC1 = 40106 T5

R4 R6 R8 BUZ11 R7
F1 +U 8
47k

2k2
1M
160k

K1
BT1
1A6 IC3 2
HYST
3 IC1.F
C3 THRESH D4
4 13 12
6V R5 OUT 1
100n ICL8211
1N4148
47k

060179 - 11

Uwe Kardel Something should be done about this, A second experiment was done based
any right-minded electronics engineer is on a home-made design: Square pieces of
Anyone who has a vegetable garden never going to admit defeat. Special PCB material of 5x5 mm were glued on
knows the problem. As soon as the straw- ridges are available from garden centres the four corners of a large printed circuit
berries start to get some colour, a net to stop slugs and there is also a special board. Copper wire with a diameter of
needs to be placed over the plants to pre- ribbon shaped material with wires woven 1 mm was soldered on the little squares
vent birds from eating the harvest. But in. The power supply comes from a 9-V so that the surface of the PCB was com-
what emerges the next morning? Some- battery. A practical experiment indicated pletely enclosed. A voltage of 6 V was
one still has had a nibble from the nicest that slugs were not the least bothered by applied to the copper wire. This worked
strawberry. The culprit is usually still in these current-carrying wires: they noncha- much better. Two slugs that acted as
the neighbourhood: A large brown slug. lantly climbed right across the ribbon. guinea pigs stayed the entire night on the

92 elektor electronics - 7-8/2006


PCB. They were, despite the rain, not slugs sleep during the day. At the fall of age detector. The clock generator is
able to beat the electronic obstacle. dusk they started to move and they formed by R1, C1 and IC1a. No great
Unfortunately, by the morning the copper appeared to be able to escape the demands are placed on the clock circuit,
wire was already badly oxidised. square without effort. They did this by except one: Only when the duration of
The search was now on for a practical stretching themselves out at a right angle the positive voltage is exactly identical to
mechanical construction for this system in and bypass the copper wire without the duration of the negative voltage is the
the garden. Moreover, AC has to be used touching it. This was obviously not a corrosion of the wires effectively sup-
for the power supply to limit the corrosion. good solution. Therefore, another, new pressed. That is why IC2 divides the gen-
The first choice was an L-shaped tinplate construction was required. erated frequency by two and in this way
profile of 12x165 mm. The long side of The solution was found by suspending guarantees a duty-cycle of exactly 50%.
the metal was pushed deep into the the wire outside the tin sheet, at a dis- The buffer stages are built around IC1b, c,
ground to prevent the slugs from crawl- tance of about 5 mm. The slugs are then d and e and provide for a small delay in
ing underneath. Every 15 cm small unable to pass without touching the wire the drive signal for the driver stage. This
pieces of PCB of 10x10 mm were glued and water droplets hang straight down prevents that T1 and T3, and T2 and T4
on top (250 pieces in total), with the cop- from the wire where there is no tin sheet. respectively are driven simultaneously. Oth-
per wire soldered on top of that. The dis- The wires are again soldered to small erwise the current consumption of the cir-
tance between the tin sheet and the cop- PCBs, which are screwed to the tin sheet cuit is too high. The circuit alternately turns
per wire was about 1.5 mm. The results angle profile. For this purpose a hole of on T1 and T2 at the same time, or T3 and
were excellent: not a single slug dared 3.2 mm diameter was drilled in the tin T4. In this way, a square wave AC voltage
to cross the barrier. They crawled up to sheet every 15 cm. First, the PCBs are of 12 Vpp is generated at the output.
the copper wire and then turned back. screwed to the tin profile, the profile is IC3, an ICL8211, provides the under-volt-
Except, this barrier does not work against placed in the garden and bent into the age protection. The LED flashes slowly while
flying slugs. Flying slugs? Certainly! These correct shape to enclose the strawberry the battery is in good condition. When the
are the slugs that the neighbour finds in field. The final step is to attach the wire voltage becomes too low, the LED will flash
his garden and throws across the fence. to the PCBs. During assembly, it is wise faster. In addition, transistor T5 will block,
After a few months, it was noticed that to keep a conduction tester at hand and so that no voltage is applied to the slug bar-
the battery was exhausted quite quickly check frequently for short circuits. The rier any more. This is only necessary if the cir-
and there was also some corrosion. Mea- smaller the distance between the wire cuit is powered from a rechargeable bat-
surements indicated that during heavy and the tin sheet, the better it works, even tery. If ordinary batteries are used to power
rain the current could increase to about against small snails, but as the distance the circuit, T5 can be omitted and replaced
1 A because of droplets on the copper is decreased, the risk of short circuits is with a wire link. With a battery power sup-
wire. So, another solution was required. increased. ply it is also a good idea to connect a
The wires had to be suspended, just like This installation has proved itself in a switch in series with the LED, which is then
the overhead conductor of a tram. practical experiment lasting two years. only turned on when checking the battery
In the next experiment, a square of 1x1 During this time it functioned without voltage. This improves the life expectancy
m was surrounded by a slug barricade problems and keeps slugs out of the veg- of the battery. This reduces the current con-
where the wire was fastened on the etable garden. sumption from 1.5 mA to 0.4 mA. During
underside of the horizontal piece of tin The AC voltage power supply consists of damp weather the current consumption
sheet. Ten slugs were placed inside the a clock generator, a driver stage in increases considerably.
square. Nothing happened at first: the bridge configuration and an under-volt- (060179-1)

Miller Capacitor
Gert Baars
064
1). The gain A is negative. In addition,
1 C
input current I, input voltage U and out-
There are amplifier circuits that have put voltage Uo are also drawn in. The
capacitance between the input and out- input current I is equal to Ic and the input
UC
put. If the gain is positive, this can lead IC voltage U is equal to Uc + Uo. Uo in turn
to oscillations. If the gain is negative, I is equal to the product A U. From this fol-
another outcome is the result. We can A lows that
deduce this from the following theoretical
circuit. Uin Uout Uc = U–Uo = U (1–A).
An amplifier with a negligibly low output
impedance, an infinitely high input 060075 - 11
Substituting into the formula the current
impedance and gain A has feedback in that flows through a capacitor, Ic =
the form of capacitor C (refer Figure C(dUc/dt) results in

7-8/2006 - elektor electronics 93


JFET-opamp A1 is necessary to prevent may not be too large. Otherwise, the AC
dU (1 − A) R1 from appearing in parallel with Cm voltage across Cm will cause clipping at
I = C⋅
dt and affecting the corner frequency. A2 is the output of the second opamp. At max-
the actual (inverting) amplifier. The gain of imum Cm, the gain of A2 is about 20
We rearrange this as A2 is equal to P1/R1. C is the capacitor times. The peak-to-peak value of the input
which is enlarged artificially. The remain- voltage may therefore not be more than
dU ing components only serve to set the about 1/20 of the power supply voltage.
I = (1 − A) ⋅ C ⋅
dt operating point of the circuit. Cb blocks The circuit will always work well for
any DC voltages and needs to be rela- smaller signals, provided the frequency
Now we can see that the gain deter- tively large, for example 25 times the is not too high.
mines the relationship between I and C. C maximum Cm. For A1 and A2 we used an LF356 and
appears to be larger by a factor of (1–A) From the test results it appears that Cm is TL081 respectively. These are mainly used
(note: if A is negative, you can actually indeed equal to (1+P/R1) C. Cm can be for frequencies not exceeding 100 kHz.
speak of a factor 1+A larger). varied with a potentiometer from about Very fast JFET opamps could extend the
This is called the Miller effect. The appar- 560 pF to 12 nF. useful frequency range to applications in
ent (larger) capacitance is called the As is usually the case, there are a few the RF-range. For LF applications we
Miller capacitance. When designing sig- limitations in practice. The input signal could also use a dual opamp for A1 and
nal amplifiers you need to take A2, such as the TL082.
this capacitance into account. The value of capacitor C can
We can actually use this Miller
2 +Ub
be changed to suit the applica-
C1
capacitance in other ways. If R2
tion. With opamps of the type
we make A variable, with an 560p AD8099 with a C of 22 pF
100k

adjustable resistor for example, P1 we can make a (tuning) capac-


we create a variable capacitor. Cb itor with a value from 22 to
100k
For this purpose we conceived R1 440 pF, for use up to 30
IC1 4k7
the following schematic (see R4 MHz. The alternative, a vari-
IC2
Figure 2). cap diode that can be varied
1M

Cm is the apparent capacitor in capacitance over a range of


between the input of the circuit Cm 20 times (or more) is not used
and ground. If we connect a in practice very much any
signal generator via a series R3
C2 more. Other applications for
100k

resistor to the input and meas- this circuit are, for example,
4µ7
ure the input voltage with an 63V adjustable LC-filters for audio
oscilloscope, we can easily 060075 - 12
applications.
determine the corner frequency. (060075-1)

Automatic Windshield
065
Christian Tavernier
Washer Control
+12V
Most, if not all, recent cars have an
R4
impressive amount of electronics, whether
220k

it be ABS brake systems, engine control T2 D2


RE1
S1 S2
with injection calculators, airbag activa- windscreen windscreen
tion, or other various functions, called washer
switch
12V
wiper
switch
BC557
comfort functions. Among them is one R5 R6 1N4148
which we tend to forget because it has
1k
22k

become so common today. It turns on the


T1 T3
windshield wipers automatically for a D1 R1 R2 P1
150 Ω 100k
few seconds after the windshield cleaner. 1N4004 470k
BC548C TIP29
This practice is almost indispensable M1
R3 R7
TIP31
M C1
windscreen
because it avoids any dripping of excess
10k
470k

washer
pump
rinse product right in the middle of a just- 10µ
25V
cleaned windshield. Unfortunately, many 060109 - 11
‘low end’ cars or some of the older cars
are not equipped with this automatic

94 elektor electronics - 7-8/2006


function which is a very nice convenience emitter-base junction, due to the presence power consumed by the windshield
to have. So, since all that is required is a of diode D1. wiper motor, relay Re1 will imperatively
handful of components that any electron- It thus keeps T1 in the conductive state be an ‘automobile’ relay. You can find
ics hobbyist worthy of the name already during a certain time, the exact period very low-priced ones at many car acces-
has in his/her drawer, we will discuss the of which depends on the setting of P1. sory shops (and even at some component
circuit proposed here. T1 in turn saturates T2, which then does retailers). These relays maintain contact
the same for T3. The Re1 relay is there- under 12 volts and often do not have
This project is super simple and simply fore connected which maintains the more than one work contact but they are,
keeps the windshield wiper activated for windshield wiper in operation because in general, capable of cutting off about
a few seconds after the windshield its work contact is wired in parallel to 20 amps.
washer control contact has been the control switch. Once C1 is suffi- Finally, the only delicate point of this proj-
released. ciently discharged, T1 is blocked, which ect is to properly identify the control wire
While the windshield washer pump is then blocks T2 and T3 and deactivates for the windshield pump on one hand,
operating, the 12 volts delivered by the relay Re1. and the windshield wiper motor on the
battery are present at the terminals and The type of components is not really crit- other. Observing what is happening at
are therefore charging capacitor C1. ical, even if we indicate specific refer- the various connections with a simple
Once the windshield washer has ence numbers for T3, any low-power npn voltmeter, should get it right without too
stopped, this capacitor can only dis- transistor with a gain over 25 will work. much difficulty.
charge through R2, P1, R3, and the T1 However, considering the amount of www.tavernier-c.com (060109-1)

Optical Pulse Generator


066

This little aid was originally designed to The circuit is build around a trio of stan- 1000, 500 or 250 Hz (see table). The
test the Shutter Time Meter from the January dard logic ICs. Firstly a 74HC4060 (IC1) frequency is then passed on to J2 and the
2006 issue. This meter was specifically is used to provide a quartz crystal accu- dual decade counter IC2 (a 4518). This
designed for ‘analogue’ SLR cameras. rate reference for the duration of the does not need to be a fast HC-type, since
pulses. For the crystal frequency we the frequency is at most 1 kHz. With J2
In order to measure the exposure time of choose the common 4.096 MHz value. the frequency can be reduced by 1, 10
a camera accurately, it will first have to To test all the ranges of the shutter time or 100 times. This frequency is then
be checked with a well-defined signal meter, we choose three different pulse applied to IC3 (a 5-stage Johnson-
first. This circuit was designed for that lengths in three different decades, counter). This has been set up in such a
purpose. But the circuit can also be used namely: 1 / 2 / 4 / 10 / 20 / 40 / way that in the end there appears only
if you need a well-defined pulse for some 100 / 200 / 400 ms. one single pulse at the output. The advan-
other purpose. With jumper J1 you select a frequency of tage of the Johnson-counter is that each

7-8/2006 - elektor electronics 95


+5V

S1
C4 16 C5 IC2 = 4518
IC2
100n 100n C6
8
IC2.B
R3
CTRDIV10 100n
C3

1M
10 11
E ≥1 0
9 + 12 10n
IC1 16 C 1 IC3 16
13
2 3
7 15 14 R4 0
CTR14 3 CT=0 3 CTRDIV10/ 2
1

10k
5 DEC
4 4
11 !G 4 2
RCX 5 15 7
9 6 CT=0 3
R2 CX + 6 10
10 14 4
1M RX 7 IC2.A 1
R1 CT 13 5 R5
8 CTRDIV10 5
J1 J2

180 Ω
6
1k

15 2 3 13
9 E ≥1 0 & 6
X1 1 2 1 1 + 4 1 2 + 7
11 C 1 9
12 2 4 3 5 3 4 14 8
CT=0 12 2 11
3 6 5 7 6 5 6 9
13 CT=0 3 12 D1
4.096MHz CT≥5

C1 C2
8 8 HSDL-4230
74HC4060 74HC4017
33p 33p

064006 - 11

output is free from glitches and has a has practically no influence on the length changed be selecting another crystal fre-
duration that is exactly equal to the of the pulse. If you would like to use quency. The current consumption in the
period of the clock input. another LED then you will have to look idle state is less than 2 mA. In our pro-
closely at the switching time. This needs totype, while the circuit is delivering a
We choose Q2 as the output. Q4 is used to be small compared to the duration of pulse, the current consumption increases
to stop the counter. Q0 is only active if the pulse. If you want to use the circuit briefly to about 18 mA.
we push the reset-button S1. IC3 will then with a logic level output then you can Do not forget the wire link under IC2
start to count. To ensure that the reset just omit D1. when assembling the circuit.
does not affect the duration of the pulse, If necessary, the pulse lengths can be (064006-1)
a differentiating RC-network R4/C3 gen-
erates a short reset pulse. R3 ensures that
C4 is discharged after releasing S1.
Also, just to be sure, we don’t use the
+
D1

R5
second counter output but use the third
C6
C3

one instead. For the same reason, to stop IC3


the counter we use the fifth output. Espe-
R3
R4

cially with longer times you will notice


064006-1 (C) ELEKTOR
J2 C5

that the pulse will arrive at the output a


short time after pressing the switch. IC2
S1

R5 drives a current of nearly 20 mA


064006-1
J1 C4

ROTKELE )C( 1-600460


through D1. D1 provides sufficient light
C1
C2

for this application to trigger the receiver IC1


diode in the shutter time meter. An unusu-
ally fast type was selected for the LED, R2
X1

R1
which, with a switching time of 40 ns,

J1 J2 Pulse (ms)
COMPONENTS LIST Semiconductors
1-2 5-6 1 D1 = HSDL-4230
3-4 5-6 2 Resistors IC1 = 74HC4060
R1 = 1kΩ IC2 = 4518
5-6 5-6 4 R2,R3 = 1MΩ IC3 = 74HC4017
1-2 3-4 10 R4 = 10kΩ
R5 = 180Ω
3-4 3-4 20 Miscellaneous
S1 = pushbutton, make contact, 6mm
5-6 3-4 40 Capacitors
C1,C2 = 33pF J1,J2 = 3-way pinheader with jumper
1-2 1-2 100 X1 = 4.096MHz quartz crystal
C3 = 10nF
3-4 1-2 200 C4,C5,C6 = 100nF ceramic, lead pitch 1 wire link.
5-6 1-2 400 5mm PCB, ref. 064006-1

96 elektor electronics - 7-8/2006


Hard-Wired Code Lock
067
+12V...+15V

R5
C2 C3 C1

3k3
100n 100n 100µ
S1 16V
1 4x 1N4148 R6
100k
D1 D2 D3 D4
S2 D5
2 14
IC1.A

IC1.B

IC1.C

IC1.D
IC1 1N4148
S3 3 4 10 11
3 7
& & & &
16
S4
IC socket
4 1 2 5 6 8 9 12 13
3
0 CTRDIV10/
S5 2 DEC
1
5 4
2 CT=0
15
7
3 IC2
S6 10
6 4
1
5
S7 5
6 4017
7 6
7
14
+ &
R7 electronic
9 doorlock
8
3k3

S8 D6 red 11 13 connections
8 9
IC1 = 4011 12
CT≥5
S9
9
8
green
dual LED T1
S10 R8
0 R1 R2 R3 R4
10k
3k3

3k3

3k3

3k3

BC517

060085 - 11

Heino Peters reset input (pin 15) of IC2, which causes the buttons for the each of the remaining
output Q0 (pin 3) of IC2 to be the only digits of the code are pressed correctly
Installations with restricted access are output with a ‘1’ level. All other counter within 10 seconds, the Q4 output
often protected using an access code. If outputs are at the ‘0’ level. Dual LED D6 (pin 10) will ultimately go to ‘1’ and the
you don’t have particularly demanding will be on and red to indicate that a dual LED will change to green. After 10
requirements regarding modifying the code can be entered. If the button for the seconds, C1 will again be discharged
code, you can manage quite nicely with first digit of the preset code is now and the dual LED will change back to
a static design with the access code fixed pressed (in this case the ‘0’ button), the red. The Q4 output can be used to switch
in the hardware. output of IC1a will go to ‘0’ and the reset something, such an electronic door latch.
The access code can be set by inserting input of IC2 will also go to ‘0’ via D1 If you want to change the code, you only
wire links in the IC socket shown at the and D5. When the button is released, a have to change the configuration of the
left in the schematic diagram. The code rising edge appears at the clock input of wire jumpers in the IC socket.
‘0280’ is shown configured in the draw- IC2, which causes the counter to be The combination of diodes D1–D4 and
ing. The user enters the code with incremented by 1. Thanks to R6 and C1, R5 acts as an AND gate. If the output of
S1–S10. The most important components the reset input of IC2 remains low for one of the four NAND gates in IC1 is ‘0’
in this circuit are the four NAND gates around 10 seconds. Output Q1 (pin 2) (which is always the case if a correct but-
(4011 CMOS IC) and the counter with of the counter is now ‘1’ as a result of the ton is pressed), a ‘0’ is applied to the
ten decoded outputs (4017 CMOS IC). clock pulse, and IC1b is waiting for the clock input of IC2 as long as the button
R1–R4 hold the four pushbutton inputs at second button (‘2’) to be pressed. If that is held pressed. If you find a delay of 10
ground level if no button is pressed. No doesn’t happen within 10 seconds, C1 seconds too long, you can reduce the
measures need be taken to debounce the discharges via R5 and R6 to a level that value of R6 or C1. The time is approxi-
switch signals, since the circuit simply causes IC2 to be reset. Dual LED will mately equal to the product of R6 and
ignores repeated button presses. In the again become red, and the user must C1 (R6 x C1).
quiescent state, a ‘1’ is applied to the start entering the code again. However, if (060085-1)

7-8/2006 - elektor electronics 97


068
Uwe Reiser
LM35 to ADC
The circuit described here is designed to
be used with the ‘LED Thermometer’ (else-
where in this issue), but can also be used
as a signal conditioner for connection to
any analogue-to-digital converter (ADC).
The circuit is sufficiently interesting in itself
that we have decided to describe it sep-
arately. The familiar and popular LM35
temperature sensor produces an output
voltage that varies by 10 mV per Kelvin
over a temperature range of –55 °C to
+150 °C. This is not suitable for driving
an ordinary unipolar input of an ana-
logue-to-digital converter with an input
range of 0 V to 5 V: we need to add an
offset to the sensor voltage and then
amplify it.

That covers the two main parts of the cir-


cuit diagram shown in Figure 1. The circuit
is designed to allow a measurement range
of –24 °C to +84 °C. Over this range, the
output voltage of the sensor varies from R6 + 1. The voltage offset is generated by component values for any desired temper-
–240 mV to +840 mV. Both these values IC2.A, which shifts the ground of the ature range. Calculating suitable values
must be shifted by a further 0.5 K (or LM35, to which its output is referred, to a for the voltage divider formed by R1, P1
5 mV) to allow for an extra half a degree potential of 245 mV × 4.587 = 1124 mV and R2 is straightforward. Jumper JP1
at either end of the range. This gives a total relative to the circuit ground. Overall, this allows the circuit to be calibrated: connect-
voltage range of 1090 mV, and hence a means that the voltage at the output of ing the output of the offset opamp IC2.A
necessary gain of A = 5000 mV / 1090 IC2.B is exactly 0 V at a temperature of directly to the input of amplifier IC2.B sim-
mV = 4.587. Amplification is done by –24 °C and 5 V at +84 °C. ulates the condition of being at the lower
IC2.B, whose gain is given by A = R7 / These two formulae can be used to select extreme of the temperature range.

1 D1 IC1
1N4002 7805

R3
100 Ω
R1 1 LM35CZ
C3 C5 C7
3k9

100µ 2
100µ IC3
25V 100n 25V JP1

1
5
3 R8
7
0 IC2.B 330 Ω T
2
R4 6
P1 1 K2
IC2.A 100 Ω
3
K1 250 Ω R6 R7
C1 8 C2
9...12V 1k3 4k7
IC2
AC/DC
470µ 25V 4 100n R2 R5
C6 C8 C9
820 Ω

27k

100n 1µ 100n
25V

C4 D2

100µ
IC2 = TLC272 030190 - 2 - 11
1N4002
25V

98 elektor electronics - 7-8/2006


2 C9
P1
K2

(C) ELEKTOR
ROTKELE )C(

R1

R4
R3
IC1 C2 C7

JP1
R2
IC2

R6
C8
C3

030190-2
2-091030

D1

C6
IC3

R5
R7
C5
D2
C4 C1 R8
K1 030190-2
9..12V 0

COMPONENT LIST R7 = 4kΩ7


R8 = 330Ω
Semiconductors
D1,D2 = 1N4002
P1 = 250Ω preset IC1 = 7805
Resistors IC2 = TLC272
R1 = 3kΩ9 Capacitors IC3 = LM35CZ
R2 = 820Ω C1 = 470µF 25V
R3,R4 = 100Ω C2,C5,C6,C9 = 100nF MIscellaneous
R5 = 27kΩ C3,C4,C7 = 100µF, 25V K1 = 2 solder pins
R6 = 1kΩ3 C8 = 100µF, 25V K2,JP2 = 3-way pinheader
1 Jumper

The circuit is powered from a mains adap- used). To avoid the need to use rail-to-rail The overall accuracy of the thermometer
tor with an output of 9 V to 12 V (either opamps, diode D2 is used to lift the circuit is highly dependent on the precision of
AC or DC). Although the current consump- ground to approximately 0.7 V above the the components used. In particular, R6
tion is only around 50 mA, a 1 A fixed IC’s negative supply. and R7 should be as close as possible to
voltage regulator is used to produce a sta- The sensor electronics can be built on the their calculated values. The output volt-
ble 5 V supply, since no heatsink is then small printed circuit board shown in Fig- age of the regulator is also important if
required. The regulator directly supplies ure 2. There is a single wire link, it is used as the reference voltage for the
the voltage divider for IC2.A and can also between C3 and IC2. It is worth pointing A/D converter. Deviations from nominal
provide power for a connected ADC cir- out that not only the sensor, but also all values will result in an expansion or a
cuit. The supply for the sensor is decou- the other components, must be capable compression of the overall temperature
pled from the rest of the circuit by R3 and of operating over the desired tempera- scale.
C7 to reduce interference. Diode D1 oper- ture range. The ‘C’-suffix versions of the (030190-II)
ates either as a rectifier (when an AC sup- sensor are specified to work from –40
ply is used) or as protection against °C to +110 °C, while the ‘D’ versions are Internet link
reverse polarity (when a DC supply is specified to work from 0 °C to +100 °C. www.national.com/pf/LM/LM35.html

ZigBee Switching for


Remote Control
Richard Hoptroff to say that you can’t use it for switching
069
the HC-L profile. When configured as an
anything else, for example, to add Zig- output, the endpoint’s digital output cor-
The ZigBee standard defines data formats Bee remote control to your projects. responds to the last message received
known as ‘profiles’. These ensure that prod- The Pixie Switcher from Flexipanel from a switching input.
ucts produced by different manufacturers (www.flexipanel.com) is a commercially Input endpoints to output endpoints cor-
are interoperable. available HC-L switching module with relation is managed by one-time setup
One of the first data formats to be devel- integral antenna and up to 8 switching procedures called ‘joining and binding’.
oped out was the Home Controls–Lighting control lines known as endpoints (EPs). When first powered up, a device will
(HC-L) profile. This is designed for send- When configured as an input, the end- look for a ZigBee network to join. Security
ing simple on/off messages, and its main point voltage is monitored. If it changes permitting, any router node can then
purpose is designed to remove the need state, a message is generated as allow the new node to become its neigh-
to run cables to wall-mounted light required. ‘On’, ‘off’ and ‘toggle’ mes- bour in the network.
switches in buildings. However, that’s not sages are supported by all devices using Once the new node has become a mem-

7-8/2006 - elektor electronics 99


ber of the network, its inputs The Bind input and Status LED
and outputs must be ‘bound’ 1 are only used during joining
R1 R2 R3
to corresponding outputs and and binding. When the push-

4k7

4k7

4k7
inputs on other nodes in the buttons connected to EP1 and
network. This is achieved by VDD EP2 are pressed, messages
pressing the ‘bind’ button on EP1 are transmitted to the receiver.
both devices at the same time. 2x
EP2
Pixie Figure 2 is the receiver. By set-
AA cell
One input can control multiple Switcher ting ModeB high, it is config-
outputs and vice versa. For BIND STATUS
D1
ured as a router. This means it
example, it would be quite MODE
A, B VSS can allow battery powered
feasible for a bedside or hall- R4
sleeping devices (such as the
S1 S2 S3
way switch to turn off all the transmitter) to join it as a

470 Ω
lights in the house. neighbour. Routers, however,
A typical application circuit is must be always-on and so are
shown in the schematics, 060078 - 11
not really suited to battery
where one Pixie Switcher unit powering. ModeA is also
has been configured to have wired High, indicating that this
two inputs and the other to router is in fact a coordinator.
have two outputs. This config-
2 +2V1...+3V3
The difference between the
uration must be done prior to D2 RE1
two is that when a coordinator
R2
placing the modules in the cir- powers up, it starts a new net-
4k7

cuit shown, using the RxD 1N4148 work instead of looking for an
and TxD serial interface pins D3 RE2 existing one to join. Every Zig-
(not shown). MODE
A, B
VDD
T1 Bee network has one coordi-
Figure 1 shows the transmit- 1N4148
nator. If further routers nodes
Pixie
ter. The ModeA and ModeB BIND EP1
T2
were added to this network,
Switcher
pins are grounded, so the they would have to have the
STATUS EP2
transmitter will operate in D1 ModeA pin low. EP1 and EP2
VSS
sleep mode and only wake up on the receiver are connected
when a button is pressed. The S1
R1
2x BSS138N to relays via MOSFET driver
470 Ω

modules can run at anything transistors. The relay contacts


between 2.1 V and 3.3 V, can then be connected to any
so it can be connected 060078 - 12 project circuit.
directly to two AA batteries. (060078-1)

Measuring
070 Battery Charge
It is not generally known that it is possi-
ble to ascertain the extent of charge of a
5.00
battery with a standard digital volt-
meter. It does not apply to all kinds of 4.75
battery, but it does to, for instance, 4.50
0.2 C
Lithium-ion batteries. 4.25
1.0 C
Voltage [V]

4.00
Although there are quite a few different
types of Li-ion batteries, it is possible to 3.75
generalize to a degree. The graphs in 3.50
the figure (from Panasonic) show clearly 3.25
that the terminal voltage of the cell drops 2.0 C
3.00
in direct relation to the diminution of the
charge. This means that a simple voltage 2.75
0 100 200 300 400 500 600 700 800 900 1000
measurement suffices to determine the
state of charge of the battery. Note that Discharge Capacity [mAh] 064017 - 11

the figure shows three graphs each relat-


ing to a given load. This means that the

100 elektor electronics - 7-8/2006


output voltage must be measured under resistors are only rated at 0.25 W to Calculate the current during an interval
load conditions to obtain a satisfactory 0.33 W. It is therefore wise to use a num- by dividing the mean voltage (start volt-
result. Moreover, the value of the load ber of resistors in parallel, for example, age plus final voltage divided by 2) by
must be known. Also, the battery must be five of 100 Ω each. the resistance. The charge is the current
under load for at least a minute. To obtain more exact measurements, first thus computed times the elapsed time.
There are two ways to proceed. If the draw the graph of your particular bat- The graph shown applies to a battery of
load is known and constant as, for tery. Charge it fully and then connect the 900 mAh. A current of 0.2 C is then
instance, in a pocket torch, measure the load, for instance, the five 100 Ω resis- 0.2 x 900 = 180 mA; 1 C is 900
voltage and read the corresponding tors. Measure the output voltage every mA; 2 C is 2 x 900 = 1.8 A.
charge from the graph. If there is no five minutes and enter the results on an
load, or it is not known or variable, Excel sheet to give a nice curve. If the 5- The proposed method is not suitable for
apply a temporary load in the form of a minute intervals are not exact, enter the NiCd or NiMH batteries, but it is for
resistor. If the value of this is 20 Ω , for real times and choose ‘spread’ as curve. lead-acid batteries, provided that the tem-
instance, use the upper graph (0.2 C, Only this type of sheet can cope with perature is constant. Bear in mind that an
180 mA). If a single resistor is used, this irregular measurement intervals. More- old lead-acid battery has a slightly differ-
will get quite hot, because it has to dissi- over, Excel is able to transpose the time ent graph from a new one.
pate 0.66 W, whereas most standard on the horizontal (x-) axis into charge. (064017-1)

High-voltage Regulator
with Short Circuit Protection
071
D1

Ton Giesberts 1N4004


T2
There are many circuits for low voltage R1 MJE350
regulators. For higher voltages, such as 22 Ω
R2 R5 R6
supplies for valve circuits, the situation is C2
C3
100 Ω

47k

100k
different. That’s why we decided to 100p
15p
design this simple regulator that can cope T1
C1

with these voltages. This circuit is obvi- 100p

ously well suited for use in combination T3


BC557B
with the quad power supply for the hybrid
amp, published elsewhere in this issue.
MJE340 C5
170V T4 155V
The actual regulator consists of just three 100n
250V
transistors. A fourth has been added for
the current limiting function. The circuit is BD140 D2
a positive series regulator, using a pnp 39V
transistor (T2) to keep the voltage drop 0W5
as low as possible. R3 R4 D3 R7
C4
The operation of the circuit is very
10M

47k

100k

39V

straightforward. When the output voltage 0W5


100n

drops, T4 pulls the emitter of T3 lower.


This drives T2 harder, which causes the 064016 - 11

output voltage to rise again. R4 restricts


the base current of T2. C1 and C2 have
been added to improve the stability of We use two zener diodes of 39 V con- emitter current of T3). This is obviously
the circuit. These are connected in series nected in series for the reference voltage, not a temperature compensated circuit,
so that the voltage across each capaci- giving 78 V to the base of T3. Because but for this purpose it is good enough.
tor at switch-on or during a short circuit R6 is equal to R7 the output voltage will The current limiting section built around
doesn’t become too large. You should be twice as large, which is about 155 V. T1 couldn’t be simpler. When the output
use capacitors rated for at least 100 V T4 acts as a buffer for potential divider current rises above 30 mA the voltage
for C1-C3. D1 protects T2 against nega- R6/R7, which means we can use higher across R1 causes T1 to conduct. T1 then
tive voltages that may occur when the values for these resistors and that the volt- limits the base-emitter voltage of T2. R2
input is short-circuited or when large age is not affected by the base current of is required to protect T1 against
capacitors are connected to the output. T2 (this current is about the same as the extremely fast peak voltages across R1.

7-8/2006 - elektor electronics 101


R3 is needed to start the regulator. With- burn your fingers if you’re not careful! use a higher reference voltage, you
out R3 there wouldn’t be a voltage at the The lower the input voltage is, the more should replace T4 with a MJE350. If you
output and hence there wouldn’t be a current can be supplied by this regulator. only ever need to draw a few milli-amps
base current in T2. R3 lets T2 conduct a This current is determined by the SOAR there is no need to include T4 and R4.
little bit, which is sufficient for the regula- (Safe Operation ARea) of T2. During a The potential divider (R6/R7) can then
tor to reach its intended state. short circuit and an input voltage of 140 be connected directly to the emitter of T3.
During normal operation with a voltage V the current is about 30 mA and T2 The ripple suppression of the circuit is
drop of 15 V across T2 and a current of certainly requires a heatsink of at least about 50 dB. The quiescent current is
about 30 mA there is no need for extra 10 K/W in those conditions. 2.5 mA and for small currents the
cooling of T2. The junction temperature To increase the output voltage you should dropout voltage is only 1.5 V.
is then 70 °C, which means you can use a larger value for R6. If you want to (064016-1)

072
Eberhard Haug
Driver for 20 LEDs
This contains closely-matched PNP tran-
sistors. The current mirror function is ingly high efficiency. The current in each
If we wish to use a step-up switching reg- implemented in the first (regulated) chain chain is calculated as follows:
ulator to run several LEDs from, for exam- by connecting the base and collector of
ple, a 3 V battery, we find that the max- its transistor together; the base and emit- ILED = 95 mV/R1 = 95 mV/4.7 Ω
imum usable mark-space ratio limits us to ter connections of all the transistors are = 20 mA.
driving just a few LEDs in series. If we also wired in parallel. Since there will be
have seven white LEDs in series the total a small effect on the currents in the other The circuit can operated from voltages
forward voltage will be about 7 times chains, it is best not to dispense with their from 3 V to 10 V. If fewer than five LEDs
3.4 V, or 23.8 V, requiring a mark- series resistors R, in the interests of are used in each chain, or if LEDs with a
space ratio of around 90 %. This is the improved current matching. lower forward voltage are used, the bat-
upper limit for many tery voltage may need to
switching regulators. If we D21 be reduced: it must be
want to drive more LEDs, L1
MBRM140
IC2 THAT320 lower than the total for-
we must divide them into a 10µH ward voltage drop of the
(800 mA) 3 12 5 10
number of parallel strings, chain. Otherwise, as with
for which the regulator will any boost converter, an
of course have to supply unregulated and potentially
2 1 13 14 6 7 9 8
the necessary current. damaging current will flow
There are various ways to *see text continuously through the
D1 D6 D11 D16
drive a parallel array of LEDs. Also, if the chains
series-connected LEDs. The contain different numbers
7 1
simplest approach is to VIN ≥ 3V SW OVP of LEDs or if different colour
wire a number of chains, 2 IC1 * D5 D10 D15 D20 LEDs are used, care must
VIN
each consisting of the same MIC2291 be taken to ensure that the
3 6
number of LEDs and a EN -34BML FB
R1 R2 R3 R4
sum of the LED forward
series resistor, in parallel, C1 C2 voltages is greatest in the
* * *
4Ω75

AGND PGND
hoping that the total for- 2µ2
4 8
2µ2 first (regulated) chain.
ward voltage of the LEDs in The EN input allows the
each chain is approxi- 060156 - 11 LED array to be turned on
mately the same. We can (EN>1.5 V) or off
sense the current in a single (EN<0.4 V), or dimmed
chain using a sense resistor R, and thereby The circuit shows a type MIC2291 PWM using a PWM signal. An alternative (ana-
deliver the same current to the other chains step-up LED driver from Micrel driving a logue) dimming technique is also
as well. Unfortunately, the assumption that four-by-five LED array. This arrangement described in the MIC2291 data sheet.
the total forward voltage of the LEDs in leaves the device a little headroom in The Schottky diode must be a fast-switch-
each chain is the same is not always terms of mark-space ratio and total ing type with a low capacitance and low
borne out in practice. power. The voltage at the output will be voltage drop, such as the MBRM140 or
To get around this problem we can use a at most 18 V in normal operation. A par- SS14. Ceramic capacitors C1 and C2
multi-way current mirror, which can, for ticular advantage of the MIC2291 in this should be XSR or X7R types with a suit-
example, be constructed using a bipolar circuit is its low feedback voltage of able working voltage. The 10 µH coil
transistor array such as the THAT320. 95 mV, which makes for a correspond- must have a rated current of at least

102 elektor electronics - 7-8/2006


600 mA without saturating, and it should V overvoltage protection circuit (and an Internet links
also have as low a resistance as possible. extra OVP pin); the MIC2291YDS in a MIC2291 data sheet:
And of course, when building an LED 5-pin SOT-23 package is a low-cost ver- www.micrel.com/_PDF/mic2291.pdf
driver circuit with a switching speed of sion without overvoltage protection. Application example:
1.2o the layout and construction of Since we would otherwise have to imple- www.micrel.com/_PDF/App-Hints/
switching regulators should be observed. ment this protection externally, the MLF ah-59.pdf
The MIC2291-34BML and its lead-free type is preferred. THAT320:
counterpart the MIC2291-34YML in a 2 (060156) www.thatcorp.com/300desc.html
mm by 2 mm MLF package have a 34

Tiny Simon
IC2
073
LM2936Z-5
+9V

R2 R5 R8 R11
C1

220 Ω

220 Ω

220 Ω

220 Ω
10µ
16V
D1 D2 D3 D4

IC1
R1 8
150 Ω
R4 5
PB0/AIN0
150 Ω 6 1
PB1/AIN1 PB5/ADC0
R7 7
PB2/ADC1
150 Ω 2 3
PB3/ADC3 PB4/ADC2

R10
150 Ω 4
S1 S2 S3 S4 ATTiny13 BZ1

R3 R6 R9 R12
100 Ω

100 Ω

100 Ω

100 Ω

050391 - 11

Clive Graham microcontroller running software written point is automatically selected upon
for the project. As you can see from the power-up. Dynamic I/O switching is used
The ‘Tiny Simon’ game is based upon the circuit diagram, the ATtiny13 chip in its to reduce pin-count — the LEDs and push-
‘Simon says...’ sequence following game 8-pin case does not require much in the buttons are conected to the same pins on
which has proved popular over the years. way of external components to make an the ATTiny13!
Although not particularly original in con- attractive little game that hopefully will The game runs from a 9-volt PP3 type bat-
cept, this implementation of the game, put keep children busy for a while. tery. The low quiescent current of less than
together for use by playschool children, The software was coded in AVR assembler 8 µA is due to the use of a micropower
has a number of noteworthy features. using the freeware Atmel AVR Studio4. It regulator type LM2936Z-5 and extensive
is available free of charge from the Pub- power saving features on the ATtiny13
The game uses sound (via a piezo- lishers’ website as file number 050391- (the micro draws less than 1 µA!).
sounder) and light (via four LEDs) to dis- 11.zip. Careful use of modular program-
play an extending sequence to the player, ming allows for easy changing of music Construction is very simple and the parts
who has to follow and repeat back the generated during the game (stored in EEP- are inexpensive and easily obtained. The
sequence via a set of four press-switches. ROM) and other features. An 8-stage max- component count is so small that construc-
If the sequence is remembered correctly, imal length pseudo-random number gen- tion of the circuit on a piece of Veroboard
a celebratory tune is played (with light erator (in software) is used to produce a is a perfectly acceptable option. The pho-
show) and the sequence extended by a varied and easily checked light sequence. tograph shows an experimental construc-
further element. If not, the player is shown Feedback taps can be altered in software tion of the game is an ABS box. The
the correct sequence and, after a short to produce a different sequence. Each small, hand-held construction allows easy
‘jingle’, is invited to play again. starting point for a sequence is saved in operation for those with small fingers!
The circuit is built around an ATtiny13 EEPROM, so if power is lost, a new starting (050391-1)

7-8/2006 - elektor electronics 103


074
Uwe Reiser
LED Thermometer
The circuit described here is the digital
and display section of a thermometer; the
analogue circuitry and signal conditioning
required to use an LM35 temperature sen-
sor are described elsewhere in this issue
(‘LM35 to ADC’). The analogue-to-digital
converter used here is hidden inside a
PIC16F873 microcontroller behind the
RA5 port pin. It has a resolution of 10 bits
(1024 steps), allowing a temperature
range of 128 °C to be divided into steps
of exactly 128 °C / 1024 = 0.125 °C.
Displaying a range of 1024 steps of one
eighth of a degree, or even just 128 steps
of one degree, on a row of LEDs is hardly
practical. A better plan is to specify a
desired temperature value and allow the
microcontroller to indicate deviations from
that temperature over a small range; effec- fitted) a 900 ms delay loop in the soft- two or more sockets for the switches. The
tively moving a magnifying glass over the ware is bypassed and the display is LEDs are situated at the edge of the
temperature scale. updated at full speed. board so that their leads can be bent
The BCD-encoded switches are used to A printed circuit board layout is available through 90 ° if desired. When the board
set the desired centre temperature. When for the digital section of the thermometer is populated (not forgetting the wire links
the measured temperature is equal to this (see Figure 2). The two BCD switches near the resonator!) and the soldering
value the centre two-colour LED D6 will are in 6-pin DIL packages and can eas- has been checked on both boards, JP2
light green. If the temperature deviates ily be fitted in sockets so that they can can be fitted and the circuit can be
from this value, the LED will light yellow. protrude through the lid of an enclosure. tested.
LEDs D1 to D5 indicate positive devia- If the microcontroller is also be fitted in a During initialisation the microcontroller
tions and LEDs D7 to D11 indicate neg- socket it may become necessary to stack will run a power-on self test: the row of
ative deviations in steps of one degree.
If the overall measurement range is from
–24 °C to +84 °C we can therefore set
the centre point between –19 °C and
1 R1
C2
C1
10k

+79 °C. Half-degree steps are indicated


100n 10µ
by two neighbouring LEDs lighting simul- K1 16V
R2
220 Ω
D1
+5
taneously. For example, between 1 20 R3
220 Ω
D2
+4
19.75 °C and 20.25 °C just one LED will 7
MCLR
R4
220 Ω
D3
+3
T RA5
light; between 20.25 °C and 20.75 °C 6
RA4 RC7
18 R5
220 Ω
D4
+2
17
the next LED will also light; and between JP2 RC6
R6 D5
IC1 16 220 Ω +1
20.75 °C and 21.25 °C just the second S1
8
1 28
RB7
RC5
RC4
15
D6
LED will light. If just the top or bottom LED 5 4
2 27
RB6 RC3
14
R7
3 26 13 220 Ω
is lit, it means that the temperature is out- 2
4 25
RB5 RC2
12 0
1 RB4 RC1 R8
220 Ω
side the displayable range. The BCD- RC0
11
PIC16F873
encoded switches (S1 for the tens digit S2 RA3
5
1 24 4 R9 D7
and S2 for the units) used to set the cen- 8
2 23
RB3 RA2
3
220 Ω -1
5 4 RB2 RA1
tre value have the advantage that there 2
3 22
RB1 RA0
2 R10
220 Ω
D8
-2
is no need for mental acrobatics convert- 1
4 21
RB0 R11
220 Ω
D9
-3
ing between decimal and hexadecimal OSC1 OSC2 R12
220 Ω
D10
-4
8 9 10 19
when setting or checking the value. Since X1
8MHz
R13
220 Ω
D11
-5
negative numbers cannot be set using the
switches, the value is expressed as the
offset from the bottom of the temperature
range. The software updates the dis-
played value every second if JP2 is fitted; 030190 - 1 - 11

if, however, port RA4 is high (jumper not

104 elektor electronics - 7-8/2006


2 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1

R13
R12
R11
R10
R9
R8
R2
R3
R4
R5
R6
R7
S1 S2
ROTKELE )C(

(C) ELEKTOR
JP2
IC1 C2
R1

K1
1-091030 030190-1
030190-1 X1 C1

COMPONENTS LIST Capacitors IC1 = PIC16F873-20/SP, programmed,


C1 = 100nF order code 030190-41
Resistors C2 = 10µF 16V radial
R1 = 10kΩ Miscellaneous
R2-R13 = 220Ω Semiconductors X1 = 8MHz ceramic resonator (3 pins)
D1-D5,D7-D11 = LED, 5mm S1,S2 = BCD complement switch (APEM
D6 = TwinLED (DuoLED) green/yellow PT65-702)

LEDs is lit in sequence from bottom to Now switch off the power supply, in position 0). Apply power and adjust
top. Each of the 23 possible display pat- remove JP1 on the digital board and set P1 until LED D11 lights; this corresponds
ters is shown for 100 ms. Finally the the BCD switches to the zero position. to the lower limit of the temperature
two-colour LED flashes yellow twice, and On the analogue board connect the measurement range.
the unit starts to display the temperature. LM35’s ground to the amplifier input (JP1 (030190-I)

Harmonic Generator
with Single Opamp
Gert Baars
075
non-inverting input. The circuit
Quartz crystals have the property amplification, which in principle
that their amplitude/phase charac- V+ must be unity to ensure oscillation,
teristic repeats itself at frequencies is determined by the network
C2
that are an uneven multiple of the formed by R4, R5 and trimmer
fundamental frequency. There are 100n capacitor C3. This network is fre-
R1 X1
* * see text
so-called overtone crystals that are quency-dependent such that the
100k

cut in such a manner that they pos- amplification increases as the fre-
sess this property to a greater quency rises. The network gain is
extent. However, in principle, any R3 7
8
adjustable with C3. The setting of
330 Ω
3 3f, 5f, 7f
crystal may be used on one or more 1 the capacitor must be such that the
IC1 6
of its harmonic frequencies. Har- 2 gain is too small for oscillation at
monic generators based on transis- 4
the fundamental frequency, but suffi-
AD8099
tors may operate satisfactorily on R4 RD8 cient for, say, the 5th or 7th har-
the 3rd harmonic, but if the 5th or 100 Ω monic.
7th harmonic are wanted, the circuit C3 The author uses a standard com-
40p
becomes less reliable and requires R2 R5
puter crystal of 10 MHz. Depend-
frequent adjustment. C1 ing on the setting of C3, the circuit
10 Ω
100k

This circuit is based on a single, fast 10n


provides a stable output at frequen-
opamp and oscillates readily at the cies between 50 and 70 MHz. It
3rd, 5th or 7th harmonic. The 060147 - 11 should be noted that these frequen-
opamp is set up as a non-inverting cies are multiples of the series fun-
amplifier with the quartz crystal con- damental frequency of the crystal.
nected between its output and the Tuning is carried out simply with a

7-8/2006 - elektor electronics 105


frequency counter. The output frequency is In principle, the circuit may be used for voltage of 5–9 V (the maximum supply
varied with C3. When the capacitor is frequencies of up to 100 MHz, when voltage for the IC is 12 V).
roughly at the correct setting, the fre- the values of R4 and R5 may need to be The peak to peak output voltage has a
quency ‘locks’ as it were at the harmonic. reduced. When a crystal with a higher value of about that of the supply voltage
The area where locking occurs is not well- fundamental frequency, say, 15 MHz, is less a few volts. The output can provide
defined, however, so that the setting of C3 used, the circuit may be tuned to the 3rd a current sufficient to drive relatively low-
is not critical. When tuning is completed, harmonic, that is, 45 MHz. impedance loads.
the output frequency is crystal-stable. The circuit should be tested with a supply (060147-1)

Quad Power Supply


076 for Hybrid Amp
C16 C18 C20

D8 D9 D10 D11 D12 D13


C16...C21 = 470µ 63V
D8...D13 = 1N4004 F2
C17 C19 C21 L3 32mA T 170V
30mA
K2
1mH
C22

47µ 400V

C3 C1
K1 D3 D1

47n 47n L1 L2
F1
30V 5 IC1 4
VIN VSW
80VA 100µH 100µH 16V
2A5 T 5A 5A R3 R4 5A
C4 C2
LT1074CT

6k8
14k0

D4 D2 VC GND FB
47n 47n

2 3 1
R1
D1...D4 = B10100 D6
2k2

D5
C8 R2
C5 C6 C7 C9 C10 C11 C12 C13
2k21

POWER
100n 100n 100n 100n 220µ 220µ 100n
63V 63V

2x 1000µ 63V MBR1645


K6 IC2 +12V
F4
TR1 +16V 7812
230V 32mA T
K4
f K3
F3

6V C14 C15
750 mA 12V
K5 1A
100n D7 10µ
0A5 T
f 63V

230V
1N4148 JP1
6V
4VA5
064011 - 11

Ton Giesberts
regulator, which means that the circuit the 16 V into a stabilised voltage for the
can be built with relatively standard com- buffer stage.
This power supply was designed for use ponents and will have a high efficiency. When an ECC83 (12AX7) is used in the
with the ‘Simple hybrid amp’ published The power loss is less with this device hybrid amp we could use this 12 V to
elsewhere in this issue. It is of course suit- compared to a linear voltage regulator. power the filaments in the valve as well,
able for use in other applications as well. This allows us to use a higher transformer although we really need 12.6 V. The
We’ve used a cascade generator for the voltage and a smaller cascade section to current taken by the valve is about 150
170 V, a switch mode supply for the 16 generate the 170 V (which is required mA, which means that the 12 V regula-
V, a series regulator for the 12 V and a for the SRPP stage in the amplifier). The tor needs to be fitted with a heatsink. This
separate transformer for the 6.3 V fila- lower input current also results in smaller can be a small version of an SK129
ment supply. losses in the bridge rectifier (D1 to D4). heatsink from Fischer (38.1 mm, 6.5
We’ve chosen an LT1074CT (IC1) for the A standard 12 V regulator (IC2) turns K/W). To increase the voltage by 0.6 V

106 elektor electronics - 7-8/2006


we’ve added diode D7 to the ground have the option of using an LT1074HVCT x √2 V for the no-load voltage, which
connection of the regulator. If an output instead. This can work with an input volt- comes to nearly 170 V. L3 and C22 fil-
voltage of 12 V is required you should age of up to 60 V, which means we ter out any HF interference coming from
close JP1, which shorts D7. could use a 40 VAC transformer. The IC1. When the cascade supplied 20 mA
IC1 and D5 require a little more cooling same cascade circuit can then easily gen- the output voltage dropped to 140 V. At
and for this the 63.5 mm version of the erate 220 VDC. The standard LT1074CT heavier loads we recommend that you
SK129 will suffice (4.5 K/W). Both com- can cope with up to 45 V, so we’re use a smaller cascade circuit and a
ponents can be mounted on opposite using IC1 fairly close to the limits of its higher transformer voltage (and also use
sides of the heatsink. You have to make specifications in this circuit. an LT1074HVCT because of the higher
sure that they are electrically isolated A cascade circuit generates the HT sup- input voltage).
from each other and the heatsink! You ply for the valve. It would also have been The filament voltage for the valve is gen-
should take a look at the website of Lin- possible to use a separate transformer erated by a 4.5 VA transformer, which
ear Technology (www.linear.com) and with a bridge rectifier and smoothing in practice had an output a bit above 6 V
take note of the layout recommendations capacitor to generate this voltage. But and therefore came closer to the required
regarding the use of an LT1074. then we’d have to find a 4.5 VA trans- 6.3 V. Another solution is to use a spe-
You can use standard chokes for L1 and former with a 40 V secondary and con- cial transformer or a stabilised 6.3VDC
L2, rated at 5 A. If you want to remove nect it the ‘wrong’ way round. As this supply. Any of these will work, so it’s
more of the residual 100 kHz switching isn’t exactly a standard transformer we down to your own preference which of
frequency you could always add an dropped that idea. these you’ll use.
extra LC filter at the output. The diodes in The source for the cascade generator is It is in principle possible to use the sup-
the bridge rectifier are B10100’s. These now an 80 VA transformer. The capaci- ply for two channels. However, if you use
are Schottky rectifiers, which have a low tors in the cascade circuit have higher the ECC88 in the amplifier you may find
forward voltage drop (only 0.7 to 0.8 V values than are strictly necessary. This it’s necessary to use a separate cascade
at 10 A). We have chosen diodes with makes it easier to calculate the expected generator for each channel.
a reverse voltage rating of 100 V so we output voltage. In our case this is 4 x 30 (064011)

Mains Slave Switcher I


Bart Trepak L
077
There are many situations where two or C1
X2
more pieces of equipment are used 1µ 250V
together and to avoid having to switch R1

each item on separately or risk the pos-


100 Ω

sibility of leaving one of them on when S1


D2
switching the rest off, a slave switch is
often used. Applications which spring to 1N4148 RE1 D3 R2

mind are a computer/printer/scanner


1k

230V

etc or audio amplifier/record deck/tuner L1

1N4148 BC557
combinations or perhaps closest to every T2

electronics enthusiast’s heart, the work T3

bench where a bench power C3


RL1 T1
supply/oscilloscope/soldering iron etc WORKBENCH
D1
C2 22µ LA1
40V
are often required simultaneously. The (SLAVE) BC547
47µ
last is perhaps a particularly good exam- 15V 40V
BC547
DESKLAMP
N (MASTER)
ple as the soldering iron, often having
no power indicator, is invariably left on 050385 - 1 - 11
after all the other items have been
switched off. Obviously the simplest solu-
tion is to plug all of the items into one Slave switches normally sense the current resistor to be inserted. This circuit, which
extension socket and switch this on and drawn from the mains supply when the is intended for switching power to a work
off at the mains socket but this is not master unit is switched on by detecting bench when the bench light is switched
always very convenient as the switch the resulting voltage across a series resis- on, avoids resistors or any modifications
may be difficult to reach often being tor and switching on a relay to power the to the lamp or slave appliances by sens-
behind or under the work bench. slave unit(s). This means that the Live or ing the electric field around the lamp
Neutral feed must be broken to allow the cable when this is switched on. The lamp

7-8/2006 - elektor electronics 107


Warning
The circuit itself is not isolated from the
mains supply so that great care should
be taken in its construction and testing.
The sensor wire must also be adequate-
ly insulated and the circuit enclosed in a DESKLAMP
box to make it inaccessible to fingers (MASTER)
etc. when it is in use.

then also functions as a ‘power on’ indi-


cator (albeit a very large one that cannot
be ignored) that shows when all of the
equipment on the bench is switched on.
SWITCH SENSOR WIRE
230V
The field, which appears around the
lamp cable when the mains is connected, LAMP ON/OFF
can be sensed by a short piece of insu- MAINS
lated wire simply wrapped around it and
this is amplified by the three stage ampli- 230V WORKBENCH
fier which can be regarded as a single (SLAVE)
super-transistor with a very high gain.
050385 - 1 - 12
The extremely small a.c. base current
results in an appreciable collector current
which after smoothing (by C3) is used to Since the transistor emitter is referenced value of the T2 emitter resistor. The sens-
switch on a relay to power the other to mains Neutral, it is the field around ing wire must of course be wrapped
sockets. Power for the relay is obtained the mains Live which will be detected. around a section of the lamp lead after
from a capacitor ‘mains dropper’ that Consequently, for correct operation the the switch otherwise the relay will
generates no heat and provides a d.c. Live wire to the lamp must be switched remain energised even when the lamp
supply of around 15 volts when the relay and this will no doubt be the case in all has been switched off.
is off. The output current of this supply is lamps where the switch is factory fitted. The drawing shows the general idea with
limited so that the voltage drops substan- In case of uncertainty, a double-pole the circuit built into the extension socket
tially when the relay pulls in but since switch to interrupt both the Live and although, depending on the space avail-
relays require more current to operate Neutral should be used. The sensitivity able an auxiliary plastic box may need
them than they do to remain energised, of the circuit can be increased or to be used.
this is not a problem. decreased as required by altering the (050385-1)

078
Richard Hoptroff
Serial to Bluetooth
special-purpose microcontroller,
+3V3...+5V such as the PIC18F4550) to make
When computer makers switched data transmission possible. That
from RS232 to USB, one of the VDD sounds like a zero-sum game,
collateral benefits was TTL com- RxD TxD CTS which raises the question: if you
patibility with regard to the sup- already have to use an extra IC,
ply voltage as well as signal lev- TxD RxD RTS why not go directly to Bluetooth?
els. Unfortunately, there was also Micro- And in fact, there are already sev-
LinkMatik
collateral damage, primarily in controller eral Bluetooth modules available,
the form of an enormous increase complete with an integrated
Connect
in the complexity of the data Detect
Status antenna and simple serial inputs
transmission process. All you and outputs. However, many of
Mst/Slv VSS
need for connection to an RS232 them have the disadvantage that
serial port is a level converter, but they are controlled using AT com-
USB requires an extra IC (such as 060077 - 11 mands, which makes it necessary
the Cypress CY7C68000 or a to use an additional controller.

108 elektor electronics - 7-8/2006


However, there are also autonomous mod- The service known as ‘Serial Port Profile’ allow you to use these lines for purposes
els available, such as the new LinkMatik (SPP) is the appropriate service of the other than their intended use, as is often
module (www.flexipanel.com). If its LinkMatik module. If the security function is done with ‘normal’ serial interfaces.
Mst/Slv pin is held low, it waits until some- enabled, you will have to enter the PIN As the data is buffered in the module
thing wants to connect to it. If the pin is code of the module (set to ‘0000’ when before and after wireless transmission,
high, the module actively searches for first delivered). Once a connection has RTS and CTS are generated locally.
devices that are ready to establish a con- been established, the Status pin of the mod- These two signals only control data flow
nection. That means you can set up a short- ule goes to a high level to indicate that it to or from the module, but not over the
range radio link without using a computer is ready for bidirectional data transmission. wireless link.
by simply coupling two modules together. Now you can simply use the familiar TxD It is generally not possible to have more
However, generally speaking you will and RxD lines to transmit serial data. The than one serial link via Bluetooth per PC.
probably want to control an external RTS and CTS lines are also available for However, Bluetooth-2.0 compatible mod-
device from a PC. In that case, you can let controlling the data flow. If you do not ules have recently become available, and
your PC search for devices that are ready need that function, you can simply con- they allow up to four serial links to be used
to establish a connection. When the PC nect these two lines together. However, concurrently along with other functions.
finds a module, it lists its available services. this wireless serial interface does not (060077-1)

Thunderstorm Predictor
Karel Walraven
079
R6 R4
Sure, listening to VHF FM has great

47 Ω
3k9

advantages over MW/LW AM from the


old days — now we have bright stereo ANT1
P1 R6
free from interference, fading and noise! D2

However, your FM radio will no longer 330 Ω


1N4148
predict the arrival of a thunderstorm as 22k

did the AM radio many years ago — L1


C3
T2
D1

reliably and hours before the trouble was


10mH 100n
upon you! The crux is that AM detection
will faithfully reproduce the effects of R1 R2
C4
R3 BT1
C6
22k
180k

2k2

lightning and other massive static dis- T1


100µ
3V
100µ
C2 T3
charges approaching in a very simple 10V 10V

way: they’re audible as slight crackling 10n


C5
noises in the loudspeaker, almost irre- T4

spective of the tuning of the radio! 4n7

Assuming no AM radio is available any- L2 R5


C1
more, a dedicated VLF receiver tuned to
2k7

820p
about 300 kHz can faithfully detect the 330µH

crackle of approaching lightning. The T1, T3, T4 = BC547B, 2N3904 064012 - 11

simple receiver shown here consists of a T2 = BC557B, 2N3906

loosely tuned amplifier driving a kind of


flasher circuit that blinks an LED in syn-
chronicity with the lightning bolts. The fre- den drops in T1’s collector voltage. Pre-
quency and intensity of the LED activity set P1 is adjusted until the LED remains Warning
indicates the intensity and distance of the off when you’re sure there’s no thunder- This circuit and in particular the antenna
storm respectively. storm around for a few hundred miles. must not be used to attract lightning.
Consequently, neither the circuit nor the
Looking at the circuit diagram, the LED The value of the LED series resistor is sub-
antenna may be used outdoors and/or pow-
driver is not biased to flash until a burst ject to experimentation and LED current. ered from the mains.
of RF energy, amplified by T1, arrives at L2, C1 and the antenna are coarsely
the base of T2. The receiver works off 3 tuned for resonance at about 300 kHz.
volts and has a negligible standby cur- Frequency-wise, lightning is a fairly mitter! The input signal is obtained from
rent of about 350 microamperes which broadband phenomenon so any tuning to a 70-cm long piece of stiff wire, with coil
will hardly dent the shelf life of a couple between 200 and 400 kHz will be fine L1 inserted for impedance matching and
of 1.5-V D-size cells. T2 and T3 form a for the circuit but make sure you’re not lengthening the antenna electrically.
monostable generator triggered by sud- accidentally tuned to a nearby VLF trans- (064012-1)

7-8/2006 - elektor electronics 109


080
Stefan Delleman
Active Antenna
Short-wave listeners often are not able to,
or allowed to, install a long-wire antenna
or other large dimension antenna in or
around the home. In such cases, the pres-
ent active antenna, intended for the fre-
quency range 3–30 MHz, may be found
useful. The author used a 1-metre long rod
or brass tube with a diameter of 2–6 mm.
The circuit consists of two parts, one to
be located close to the antenna, while
the other should be placed in the associ-
ated power supply of the receiver. The
two sections may be connected by a
coaxial cable of up to 20 m long with-
out causing any discernible attenuation.
The antenna signal is pre-amplified by a
two-stage combination, T1-T3. The main
amplification is provided by the input
transformer, formed by L3, L4, and L5, in
the receiver section. This is followed by this, it is better to wind the two coils as wind two separate coils (see photograph).
a switch that enables the frequency one, that is, 30 turns with a tap than to (040383-1)
range to be selected (3–10 MHz in posi-
tion LOW, and 9–30 MHz in position
HIGH). The signal strength may be BF245
adjusted to suit the receiver with poten- BF247
tiometer P1. ANT1
L7
The active antenna is readily constructed T1
C3 C4
D
with the aid of the two printed circuit C1 100n 47µ 1mH
G BF247B 25V
boards shown. G D
T3
Since we are concerned with only rela- 1n S R4 S
100 Ω
tively low radio frequencies, the choice of
3V2

K1
components is not too crucial. Various 2N5109 C2 R6 coax 2N5109
BFW16
39 Ω 50 Ω
types of FET may be used: BF245, BF246, 100n
to K2
2V4

BF256, or the SMD variants of these, but L1 L2


10 w 10 w
do mind their connections! The same
applies for the transistors: BFW16, BFY90, R1 R2 R3 R5
150 Ω
1k
470k

220k

BFR91, BFR96; any of these will do. C E


B
A few hints for readers who conduct their
040383 - 11
own experiments. A lower value of capac-
itor C1 results in a somewhat looser cou- +9V
pling to the antenna, but also in lower sig-
L8 30mA
nal strength. It may be worthwhile to C9 C10
BFY90
1mH
replace the capacitor with a variable type. 100n 47µ
Inductor L6 ensures that the output volt- 0V
T2
25V
Low D
age at higher frequencies (30 MHz) is S1 C7
G
not much higher than at lower frequen- L5
22 w BF245A
cies (3 MHz). This is because the Q fac- K2 C5
47p S C E
High B
tor of coils L4 and L5 increases at higher L6
receiver CASE
2V5

C8 K3
frequencies, which leads to higher ampli- 47p
BFR91
tudes. This is compensated by L6. This L3 L4
C6 R7
100n BFR96
inductor may be omitted and replaced by 1w 8w B C
1M

P1
a wire bridge, but then the output volt- 500p 470 Ω
log.
ages at higher frequencies increases. E

Aim at obtaining as tight a coupling as 040383 - 12


feasible between L4 and L5. Because of

110 elektor electronics - 7-8/2006


040383-1
C3 C4
1-383040 +

C1 C9 0
L7

L8
C2 L5 T
R4
R6 S1 C10
T1 T3 T C5
L2
R1

R2

L1
C7 T2

R5
T L3 L4
R3 P1 C8
ROTKELE )C( R7
L6

(C) ELEKTOR

040383-1

COMPONENTS LIST Capacitors


C1 = 1nF
L5 = 22 turns 0.7mm ECW, 12mm
diameter (wind on 10mm drill bit)
C2,C3,C8,C9 = 100nF L7,L8 = 1mH miniature choke
Resistors C4,C10 = 47µF 25V radial
R1 = 470kΩ C5,C7 = 47pF
R2 = 220kΩ C6 = 500pF tuning capacitor Semiconductors
R3 = 1kΩ T1 = BF247B
R4 = 100Ω Inductors T2 = BF245A
R5 = 150Ω L1,L2,L6 = 10 turns 0.7mm ECW, 4mm T3 = 2N5109
R6 = 39Ω diameter (wind on 3.5mm drill bit)
R7 = 1MΩ L3 = 1 turn 0.7mm ECW, around L4
P1= 470Ω logarithmic L4 = 8 turns 0.7mm ECW, 12mm Miscellaneous
diameter (wind on 10 mm drill bit) PCB, ref. 040383-1 from The PCBShop

Alternative
Halogen Supply
Stijn Coenen lamps to be initially powered from the 5-
081
Operation of the circuit is as follows. As
V rail of the supply via RE2, so that they soon as the PC supply provides power,
Readers who do not care to modify the are preheated. Subsequently, they are IC1.B drives T1 into conduction and RE2
power supply of an old PC into a suitable powered from the 12-V rail via RE1, closes. The potential at the non-inverting
halogen power source (see our April while at the same time the 5-V rail is dis- input of IC1.B is 6 V, while that at the
2006 issue), may find the present design connected. This ensures that the current inverting input rises from 0 V. Lamp LA1
a welcome alternative. surge through the lamps is so small that is then connected to the 5-V rail.
The circuit does not need any changes to the protection in the power supply does After a short span of time, the voltage
the power supply. It allows the halogen not react. across C1 has risen to a value where

7-8/2006 - elektor electronics 111


IC1.B changes over, whereupon T1 is cut
off. At the same time, IC1.A drives T2 +12V +5V
into conduction. The circuit is then decou-
pled from the 5-V rail and connected to
R6 R1
the 12-V terminal. The 5-V rail in the PC RE1

470Ω
D1

47k
D3
power supply is protected against spikes
on the 12-V line by D1. 10CTQ150-1
P1
Diode D2 protects IC1 against over-volt- D2
8 1N4148
T2
2
age on its inputs should the 12-V rail fail. 47k
1
R4
IC1.A 4k7 RE2
Resistors R4 and R5 limit the base cur- 3 D4

rents of the transistors. D3 and D4 are 1N4148 BC547B


quenching diodes.
1N4148
The time during which lamp LA1 is pow- 6 T1
R5
ered by 5 V is preset with potentiometer IC1.B
7
4k7
5
P1. The maximum time span is about LA1

0.33 s and the minimum 3.3 ms. The 4 BC547B


R3 R2
C1
latter is perhaps rather short, but it also 12V

47k
1M
150W
depends to some extent on the type of
10µ 25V
power supply used. Some experimenta-
060151 - 11
tion may be worthwhile!
(060151-1)

Low Loss
082
Michel Franke
Step Down Converter
quiescent current: 120µA @ +12V +9V...+60V
1N4148 250µA @ +60V
This circuit arose from the need of the R1 R7 R6 Ue
D3
author to provide a 5 V output from the
1M
330k

330k

T2
24 V battery of a solar powered genera-
tor. Although solar power is essentially
free it is important not to be wasteful espe- T3 C6 C7
BC327
cially for small installations; if the battery 26µA @ Ue = +12V
C3 C4
R5 220µ 220µ
runs flat at midnight you’ve got a long 63V 63V
220k

2SJ221
2SJ174
wait before the sun comes up again. The 1n 3n3
100V
20A
basic requirement was to make an effi- D1 D2
0Ω22

cient step-down converter to power low


voltage equipment; the final design BAT46 C2 BAT46
shown here accepts a wide input voltage

from 9 to 60 V with an output current of
500 mA. The efficiency is very good
+3V3
IC1
L1
* +5V
R2 T1
3 7 ≈110mH
even with a load of 1 mA the design is 100k
6 D4 1 Ω
≤ 500mA
TL061
still better than a standard linear regula- 2
BS170
tor. The low quiescent current (200 µA) 4 SB360
SB160
also plays a part in reducing losses. R4 C8 C9

Some of the components specified (par- 100k


R3.A R3.B C5 220µ 220µ
ticularly the power MOSFET) are not the D5 C1 10V 10V
330k

470k

most economical on the market but they 10n

have been deliberately selected with effi- 3V3


ZRC330A01
100n

ciency in mind.
When power is applied to the circuit a * see text 050264 - 11

reference voltage is produced on one


side of R2. D1 connects this to the sup-
ply (pin 7) of IC1 to provide power at ers the IC from the output. Diode D1 below the reference voltage on pin 3,
start-up. Once the circuit begins switch- becomes reverse biased reducing current this produces a high level on output pin
ing and the output voltage rises to 5 V, through R1. When the circuit is first pow- 6. The low power MOSFET T1 is
D2 becomes forward biased and pow- ered up the voltage on pin 2 of IC1 is switched on which in turn switches the

112 elektor electronics - 7-8/2006


power MOSFET T3 via R5 and the kHz. The variable clock rate dictates that supply to IC1.
speed-up capacitor C4, the output volt- the output inductor L1 needs to have the A maximum efficiency of around 90 %
age starts to rise. relatively high value of 100 mH. was achieved with this circuit using an
When the output approaches 5 V the The coil can be wound on ferrite core input voltage between 9 and 15 V and
voltage fed back to the inverting input of material with a high AL value to allow the supplying a current greater than 5 mA,
IC1 becomes positive with respect to the smallest number of turns and produce the even with an input voltage of 30 V the
non inverting input (reference) and lowest possible resistance. Ready-made circuit efficiency was around 80 %. If the
switches the output of IC1 low. T1 and coils of this value often have a resistance circuit is used with a relatively low input
T3 now switch off and C3 transfers this greater than 1 Ω and these would only voltage efficiency gains can be made by
negative going edge to the base of T2 be suitable for an output load current of replacing D4 with a similar device with a
which conducts and effectively shorts out less than 100 mA. lower reverse breakdown voltage rating,
the gate capacitance of T3 thereby The voltage divider ratio formed by R4 these devices tend to have a smaller for-
improving its switch off time. and R3 sets the output voltage and these ward voltage drop which reduces losses
The switching frequency is not governed values can be changed if a different out- in the diode at high currents. At higher
by a fixed clock signal but instead by the put voltage is required. The output volt- input voltage levels the value of resistor
load current; with no load attached the age must be a minimum of 1 V below R1 can be increased proportionally to
circuit oscillates at about 40 Hz while at the input voltage and the output has a reduce the quiescent current even further.
500 mA it runs at approximately 5 minimum value of 4 V because of the (050264-1)

10,000x
with One Transistor
Gert Baars
083
acteristic of the transistor. In practice, it
+U b turns out that the transistor does actually
For a collector follower with emitter resis- have an output resistor between collector
Rb Rc
tor, you’ll often find that the gain per and emitter. This output resistance exists as
stage is no more than 10 to 50 times. a transistor parameter and is called ‘hoe’.
The gain increases when the emitter resis- Co U out
In normal designs this parameter is of no
tor is omitted. Unfortunately, the distor- consequence because it has no notice-
tion also increases. able effect if the collector resistor is not
T
Ci
U in large. When powering the amplifier from
With a ubiquitous transistor such as the 340 V and setting the collector current
BC547B, the gain of the transistor is to 1 mA, the collector resistor will have a
roughly equal to 40 times the collector value of 338 kΩ. Whether the ‘hoe’-
current (Ic), provided the collector current parameter has any influence depends in
is less than a few milliamps. This value is 060074 - 11 the type of transistor.
in theory equal to the expression q/KT, We also note that with such high gains,
where q is the charge of the electron, K is the base-collector capacitance in partic-
Boltzmann’s constant and T is the temper- be about 40?(12–5) = 280. ular will start to play a role. As a conse-
ature in Kelvin. For simplicity, and assum- Notable is the fact that in this way the quence the input frequency may not be
ing room temperature, we round this gain can be very high in theory, by select- too high. For a higher bandwidth we will
value to 40. ing a high power supply voltage. Such a have to use a transistor with small Cbc,
For a single stage amplifier circuit with voltage could be obtained from an isolat- such as a BF494 or perhaps even an
grounded emitter it holds that the gain ing transformer from the mains. An isolat- SHF transistor such as a BFR91A. We
Uout/Uin (for AC voltage) is in theory ing transformer can be made by connect- will have to adjust the value of the base
equal to SRc. As we observed before, the ing the secondaries of two transformers resistor to the new hfe.
slope S is about 40Ic. From this follows that together, which results in a galvanically The author has carried out measurements
the gain is approximately equal to 40IcRc. isolated mains voltage. That means, that with a BC547B at a power supply volt-
What does this mean? In the first instance with a mains voltage of 240 Veff there age of 30 V. A value of 2 V was cho-
this leads to a very practical rule of will be about 340 V DC after rectifica- sen for the collector voltage. Measure-
thumb: that gain of a grounded emitter tion and filtering. If in the amplifier circuit ments confirm the rule of thumb. The gain
circuit amounts to 40⋅Ic⋅Rc, which is the power supply voltage is now 340 V was more than 1,000 times and the
equal to 40 times the voltage across the and the collector voltage is 2 V, then the effects of ‘hoe’ and the base-collector
collector resistor. If Ub is, for example, gain is in theory equal to 40 x (340–2). capacitance were not noticeable
equal to 12 V and the collector is set to This is more than 13,500 times! because of the now much smaller collec-
5 V, then we know, irrespective of the However, there are a few drawbacks in tor resistor.
values of the resistors that the gain will practice. This is related to the output char- (060074-1)

7-8/2006 - elektor electronics 113


Programmer Board
084
Jean Brunet
for the R8C/13
This board is a spin-off of the K5
10-pound ‘R8C Tom Thumb’ SUB-D9
R3

4k7
project published in the Febru- 1 R8C/13 T2
ary 2006 issue of Elektor Elec- 6
1 32
R4

2 RXD RXD1 TXD1 100k


tronics. T1
2
AN6
31
7
R1 BC
The author has added an LED R5

10k
3 30 558C
3 TXD RESET AN5
27k 4 29
behind the 5-V regulator and 8
5
AN4
28
BC VSS MODE
three small connectors (ground 4
10k
R2 548C 6
AN3
27
9
(0V); +5 V on the bottom left) to 5 S1
7
VCC AN2
26
8 25
supply power to potential RESET
P17 AN1
9 24
daughterboards. Connectors are 10
P16 AN0
23
P15
linked to the R8C/13 output K4 IC1 11
P14 P30
22
D1 S2
ports. 7805 12
P13
21
13 20 MODE
The layout of components has 1N4004 14
P12 P31
19
P11
been selected in order to ensure +9V C1 C2 C3 15 18
P10 P32
easy manipulation. The connec- 16
P45 P33
17
10µ 10V 100n 100n
tions are arranged in the upper
area of the board, while the
R6
Reset button and Mode switch
1k

are found in the lower area. K1 K2 K3 C4


Enough space has been left at D2
10µ 10V
around module board so that it
is easier to extract it without a 060125 - 11

special tool.

Following the advice of special-


ists on Elektor’s R8C Forum, the author toward the bottom. A test with a simple male but there is nothing to stop you from
opted for a 7805 regulator. ohmmeter will help avoid an error in using female connectors, even though the
The BC558C transistor (upper right) is direction. Do the same verification for the male connectors seem to be sturdier. For
shifted to the right so as not to complicate reset button. Test and verify that it is actu- the Tom Thumb module, use IC socket
handling the R8C/13 Tom Thumb mod- ally open when in rest position before sol- strip that can be sectioned.
ule. In this way, it’s easy to install the dering it in the correct direction. The component overlay and other PCB
module on the carrier board, as well as to Connectors linked to the R8C module are artwork (Proteus format) are available on
remove it.

Installation
of components
The component type codes and
characteristics can be found in
the component list; a glance at
the photo lets you identify every-
thing, as does the overlay for
the components, on the other
page.
Do not forget to install the wire
links and resistor R5 between
the links for the R8C module
before plugging in the latter.
The reset pushbutton is found on
the bottom, slightly shifted to the
left, and the programming
switch is found on the right.
Pay attention to the direction of
the switch. It is more practical for
the off position to be directed

114 elektor electronics - 7-8/2006


the author’s web page devoted to this
project. Lots of other information on the COMPONENTS Semiconductors
D1 = 1N4004
project may be found on the R8C Service D2 = LED, red, dia. 3mm or 5 mm
Page at LIST T1 = BC548C
T2 = BC558C
www.elektor-electronics.co.uk/ IC1 = 7805
Resistors
Default.aspx?tabid=110 R1 = 27kΩ Miscellaneous
R2,R5 = 10kΩ S1 = pushbutton (reset)
There the artwork is reproduced in a R3 = 4kΩ7 S2 = slide switch, lead pitch 2.5 mm
slightly different form from what you are R4 = 100kΩ (programming)
R6 = 1kΩ K1,K2,K3 = 2-way pinheader
used to, but it works very well for mak- K4 = mains adaptor socket
ing your own board. The dimensions of Capacitors K5 = 9-way sub-D socket (female), PCB
the PCB are 51 x 71.5 mm. C1,C4 = 10µF/10V mount
In the file download, this diagram is a C23,C3 = 100nF 2 lengths of 16-way IC socket strip (for
R8C module socket)
mirror image so that the ink comes into
contact with the copper, which is prefer-
able during UV illumination. If you are
using the diagram printed in the maga-
zine, you should mirror it to obtain the
Program listing: toggle_all.mot
same result.
#include “sfr_r813.h”
The author uses an inkjet printer and
stacks three transparencies. long t;
To utilise this board, all you need to do is
insert the R8C/13 module in its socket, void main(void)
making sure the quartz crystal is turned {
toward the RS-232 base, as in the photo. /*————————————————————————-
Connect the RS-232 cable to the com- - Change on-chip oscillator clock to Main clock -
puter and then apply the supply voltage ————————————————————————-*/
(adaptor supplying between 9 and 12 V).
prc0 = 1; /* Protect off */
Testing the board cm13 = 1; /* Xin Xout */
cm15 = 1; /* XCIN-XCOUT drive capacity select bit
To test the board, load the program tog-
: HIGH */
gle_all.mot or compile the program
cm05 = 0; /* Xin on */
below, whose purpose is to make all of cm16 = 0; /* Main clock = No division mode */
the R8C/13 ports blink. cm17 = 0;
cm06 = 0; /* CM16 and CM17 enable */
Now you are fully equipped to better dis- asm(“nop”); /* Waiting for oscillator to stabilise
cover the possibilities of the R8C/13 */
module and to conjure up super applica- asm(“nop”);
tions from this minimal configuration. asm(“nop”);
asm(“nop”);
Programming ocd2 = 0; /* Main clock change */
To program the module, all you need to prc0 = 0; /* Protect on */
do is to move switch S2 toward the bot-
prc2 = 1; /* Protect off to write on pd0 */
tom and press the pushbutton to reset the
pd0 = 0xFE; /* bits 1 à 7 sur p0. an0 = p0_7, an1 = p0_6
module. Start the FDT Simple interface. In
... an6 = p0_1. p0_0 is not present in the device.
the menu, as an option, check Autodiscon- pd1 = 0xFF; /* Set Ports be used for output*/
nect and Erase device before program. pd3 = 0x0F; /* just p3_0 ... p3_3
Load toggle_all.mot and click on pro- pd4 = 0x20; /* just p4_5
gram flash.
After confirming programming, move the while (1) /* Loop */
Mode switch up and press S1 (reset). {
With the help of an LED and a 1-kΩ resis- p0 = 0xFE;
tor in series, verify the operation of the p1 = 0xFF;
R8C outputs one by one. If one of them p3 = 0x0F;
does not produce LED flashing, you p4_5 = 0x01;
should verify the soldering. for (t=0; t<50000; t++);
p0 = 0x00;
The author, who contributed to a series
p1 = 0x00;
of pages in the R8C section on the
p3 = 0x00;
French Elektor site, has his own website p4_5 = 0x00;
at the following address: for (t=0; t<50000; t++);
http://perso.wanadoo.fr/asnora/R8C/ }
platine_de_programmation.htm }
(060125-1)

7-8/2006 - elektor electronics 115


Intelligent Interface
085
Christian Tavernier
for 1 to 8 Servos
Today, radio-controlled (RC) servos are R4 +4V8...+5V5
100 Ω
very common in robotics and there are
often many present in one robot. In gen- K1
eral, a hexapod utilizes at least three ser- C2 C1 A
vos, while a simple arm can use between
10n 100µ
six or seven of them. If the control of such 10V K2
servos remains theoretically easy to pro- B

duce with a microcontroller, having sev- 14


K3
eral within the same robot causes the see below 4

1 - 8 standard servo motors


RST C
microcontroller to overload very quickly, C 16
XT1 IC1 SA
6
X1
spending more time in the end managing SB
7
8 K4
servos than doing the calculations neces- 10MHz 15
SC
9 D C3
XT2 SD
sary to properly operate the robot. In serial input
A B MIC800 SE
10
2 1000µ
fact, we should remember that a radio SER
SF
11
K5 10V
17 12
control servo is operated with pulses AD0 SG E
18 13
whose width varies from 1 to 2 ms and 1
AD1 SH
AD2
defines its position. The problem is that K6

these pulses must be repeated at least 3 5


F

every 20 ms if we want the servo to stay


K7
in position. It is precisely this repetition,
G
multiplied by the number of servos being
controlled, that ends up overloading the K8
microcontroller that controls them. H
Therefore, we propose a fix for this prob-
lem using a specialised circuit capable
of controlling one to eight standard radio C
060104 - 11

control servos via very simple controls R3


A TTL B
transmitted by a common asynchronous
4k7

servo
serial connection. We are referring to the PIC BASIC

MIC800 from Mictronics (www.mictron- RS232


T1
B
A R1 B A R2
ics.com). The application schematics 22k 10k
could not be simpler.
BC547
Not counting a simple quartz crystal (X1)
and the usual loading capacitors (C1 Conrad
Graupner
Futaba Multiplex Robbe Microprop Simprop
/JR
and C2), the circuit is directly connected
to 1-8 servos it will control. Concerning
the serial connection, three different pos-
sibilities are offered, depending on
what’s connected to points A and B are
in the diagram:
• one direct connection when there is a
TTL control signal from a microcontroller input signals in negative logic (a logic 1 xxx where:
with a UART and capable of supplying corresponding to a Low level and vice • m is a letter included between S and
serial signals in inverse logic (one Basic versa). In the case of a direct TTL connec- Z which corresponds to the MIC800
Stamp, for example); tion, and depending on the possibilities address. In fact, if you consult the
• one 22 kΩ resistor, if there is a serial of the UART contained in the related datasheet available on the Mictronics site
connection with true RS-232 levels; microcontroller, it is sometimes impossi- (www.mictronics.com), you’ll soon notice
• one transistor with inverted wiring in ble to generate such signals. Therefore, that you can place up to eight MIC800s
the case of TTL control by a microcon- we must should an inverter transistor. on a single serial connector and control
troller having a UART, but unable to pro- Dialogue with the MIC800 occurs at up to 64 servos in this way. This option
vide serial signals in inverse logic (PICBa- 2,400 baud on 8 data bits, without par- is not utilized here and the address is set
sic, for example). ity. The syntax of the commands to be to S using pin grounding AD0 to AD2.
In fact, the MIC800 was designed in sent for controlling the servos is extremely • n stands for a letter between A and H
order to be directly controlled by any true simple and is composed of the next indicating the servo to control in compli-
serial RS232 connection. It thus accepts group of coded characters in ASCII m n ance with the marks, as indicated in our

116 elektor electronics - 7-8/2006


drawing at the connectors (K1 correspon- SEROUT Pin, 16780, [’’S’’, ’’X’’, DEC write:
ding to A, and K8 to H). Pos, CR] SEROUT Pin, 138, 0, 0, [’’S’’, ’’X’’, DEC
• xxx is a number between 001 and (Pos), 13]
128 which indicates the position where Pin is utilized for the serial port, X After turning on the MIC800, all outputs
required for the servo, 001 correspon- is the letter identifier of the servo included of the servo control are inactive. Then, as
ding to the extreme counter-clockwise between A and H (K1 to K8) and Pos is soon as a command has been sent to a
position and 128 to the extreme position the desired position included between 1 servo destination, the corresponding out-
in the other direction. and 128. put automatically generates the pulses
From a Basic Stamp, all you need to do is required to maintain its position as long as
write it as shown in the following example: With a PICBasic (www.comfiletech.com) the circuit remains on.
and the same text as below, we would www.tavernier-c.com (060104-1)

Bicycle Speedometer
with Hub Dynamo
Hans Michielsen
086
The idea for this circuit came when the
author had problems with the wireless
speedometer on his bicycle. Such a device
consists of two parts: the cycle computer
itself and a transmitter that is mounted on
the front fork. A small magnet is attached
to the spokes so that the transmitter sends
out a pulse for every revolution of the
wheel (as long as everything has been fit-
ted properly). Since the range of the trans-
mitter is limited (about 75 cm), you’ll be
lucky if it works straight away. And when
the voltage of the battery starts to drop
you can forget it. The following circuit gets
round these problems.
A Shimano NX-30 hub dynamo has 28
poles. This results in 14 complete periods
of a 6 V alternating voltage per revolu- +12V
tion (when loaded by a lamp; under no
load the voltage is much higher). C1, R3

C2, D1 and D2 double the voltage of the *


15k0

AC output. Regulator IC2 keeps the volt- 16


+12V
9 D6
age to the transmitter and the divider IC 2x CTR12
0
7
1

at a safe level (12 V, the same as the


R1
10k0
BAT18 10
+
1
2
6 D9 *
5
original battery). The divider chip (IC1) IC2 D3 D10 3
3 D7 IN
LM7812 IC1 4 2
divides the frequency of the signal from C1
D1
MBR5828 5
2
CT 3x
the dynamo by 14, so that a single pulse R2 4040
6
4
13
BAT18
100µ 7
goes to the transmitter for every revolu-
20k0

25V 12
8 3
G1
tion of the wheel. This pulse enters the cir- D2 C2 C3
11
9
14
15
GND
10
cuit at the point where the reed contact 100µ 330µ
CT=0
11
1
6V
was originally. 25V 25V
8
The circuit is built inside the front light,
MBR5828 3x BAT18
since it has enough room and a cable D4
* see text
from the dynamo is already present. The
D5
distance to the cycle computer is smaller
as well in that case. D8
060166 - 11
The following tip can be used if you want
to save yourself a few components. In the
author’s prototype the counter divided by wheel was adjusted to 16/14th of the puter. In that case you can leave out D4,
16 and the setting for the size of the real size in the setup of the cycle com- D5 and D8. (060166-1)

7-8/2006 - elektor electronics 117


Temperature Sensitive
087 Switch for Solar Collector
V+ S1 CIRCUIT TEST
V+

R9 R17
SOLAR
R7 R11
2k7

PANEL

2k2
100k
Hyst. min (133k) = 0V5
NTC 10k Hyst. max (33k) = 1V5
5
R6
7
R2 IC1.B 100k R8 P2
C7 6
R5 33k
9k1

100k
100k


25V
3 T1
R12
V+ 10 1
IC2.A 10k
8 2
R10 IC1.C
9 BC638
POOL

R13 D1 RE1
NTC 10k R3 CIRCULATION

680 Ω
3 PUMP
R4 100k
1
R1 IC1.A 100k
C8 2 P1
D2 1N4001
9k1

C3
Vref min = 0V
1µ Vref max = 5V
25V 100n
PUMP ON
100k

5
13 12
7
IC2.B
6 IC1.D
R21
10k
IC3 R23
LM7812 14
470 Ω

V+
16 14
+15V D3 V+ R20
V PH V STAB
470 Ω

11 10
R19 VCNTRL
1N4001
IC4
680 Ω

R22
13 15
C4 C5 C6 VR MAX VI 1k
D21 D22 UAA170
D4 12 1
330n 330n 100µ VR MIN
25V
5V1 5V1 H G F E D C B A
POWER ON
2 3 5 4 6 7 8 9

IC1 = LM324
V+ IC2 = LM393

D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20
4 C9 8 C10
IC1 IC2
11 100n 4 100n

050217 - 11

Tom Henskens starts up. The warm water will then be which can easily pick up interference.
pumped to the swimming pool and the Both potential dividers are followed by a
This circuit can be used to turn the pump temperature difference will drop rapidly. buffer stage (IC1a/IC1b). IC1c and R3,
on and off when a solar collector is used This is because fresh, cool water from the R4, R5 and R6 make up a differential
to heat a swimming pool, for example. swimming pool enters the collector. amplifier (with unit gain), which measures
This way the water in the collector has a Once the difference is less than 3 °C the the temperature difference (i.e. voltage
chance to warm up significantly before it pump is turned off again. difference).
is pumped to the swimming pool. A R10/R1 and R9/R2 each make up a When both temperatures are equal the
bonus is that the pump doesn’t need to potential divider. The output voltage will output is 0 V. When the temperature of
be on continuously. be about half the supply voltage at a tem- the solar collector rises, the differential
The basis of operation is as follows. perature around 25 °C. amplifier outputs a positive voltage. This
When the temperature of the water in the C7 and C8 suppress any possible interfer- signal is used to trigger a comparator,
solar collector is at least 10 °C higher ence. The NTCs (R9 and R10) are usually which is built round an LM393 (IC2a).
than that of the swimming pool, the pump connected via several meters of cable, R7 and P1 are used to set the reference

118 elektor electronics - 7-8/2006


voltage at which the comparator changes The full scale of the LED bar is equal to mounted inside the filter compartment
state. R8 and P2 provide an adjustable the reference voltage of the comparator. (where it exists), which continually pumps
hysteresis. R11 has been added to the This means that when the last LED (D5) of the swimming pool water. This will give
output of IC2a because the opamp has the UAA170 turns on, the comparator a good indication of the temperature of
an open collector output. switches state. This is also indicated by the water.
A power switch for the pump is created D2.
by R12, T1 and Re1. D1 protects T1 The power supply has been kept fairly The way the circuit has to be set up
against voltage spikes from the relay coil simple and is built around a LM7812 depends how it has been installed and is
when it is turned off. regulator. The circuit is protected against very much an experimental process. To
A visual indication of the state of the con- a reverse polarity at the input by D3. You start with, set hysteresis potentiometer
troller is provided by IC4 (UAA170), a have to make sure that the input to the (P2) halfway. Then set the reference volt-
LED spot display driver with 16 LEDs. The regulator is at least 15 V, otherwise it age to about 1.5-2 V with P1.
reference voltage for the comparator is won’t function properly. On a sunny day you can measure the
buffered by IC1d and fed to input voltage difference to get an idea as to
VRMAX of the UAA170. R20/D21 and There are a few points you should note which reference voltage needs to be
R23/D22 limit the input voltages of IC4 to regarding the mounting of the NTCs. adjusted.
5.1 V, since the maximum permissible NTC R9 should be placed near the out- The hysteresis setting determines how
input voltage to the UAA170 is 6 V. put of the solar collector. You should long the pump stays on for, which is until
When there is no temperature difference, choose a point that always contains the minimum temperature difference has
LED D20 turns on. As the temperature dif- water, even when some of the water been reached.
ference increases the next LED turns on. flows back a little. NTC R10 should be (050217)

Simulation Applets
088

Simulation programs for analogue cir- nents. Unfortunately, the addition of com- The simulations aren’t limited to just elec-
cuits come in all shapes and sizes, and ponents has not (yet?) been fully imple- tronics; other subjects such as physics
at various prices. It is often much easier mented in the program: you’ll see the and mathematics have also been exten-
to test a circuit on a PC instead of reach- added component appear in the circuit sively covered. There’s more than enough
ing for the soldering iron. diagram, but it won’t have any effect in on this website to keep you happily occu-
The website of Paul Falstad contains a the operation of the circuit. But don’t let pied for a few hours...
free Java applet that illustrates how vari- that spoil your fun. Its usefulness is (060196-1)
ous basic analogue and digital circuits increased by the addition of a large Web link
work. Voltages and currents can be library of example circuits, which makes www.falstad.com/mathphysics.html
brought to life in simulated scope this applet educational as well. Each sim- The electronics simulation can be found
screens; circuits can be modified by the ulation is accompanied by a short under Electrodynamics/Analog Circuit
addition, removal or alteration of compo- description. Simulator Applet

7-8/2006 - elektor electronics 119


089
Ullrich Kreiensen
Universal LCD Module
Interfacing an LCD to a microcontroller
system is daily bread and butter for the
average electronics engineer. There are
innumerable variants and many circuit
suggestions for interfacing the six to
seven LCD signals to a microcontroller
system. In an effort to prevent continual
reinvention of the wheel the author of this
design used this simple formula:

(LCD module + Atmel controller) +


(a touch of software)
= (universal display module)

to design this versatile display unit and


PCB.

There are no surprises in the circuit dia-


gram in Figure 1. A low cost controller
type AT90S2313 takes commands from
the serial interface and controls a stan- 1 +5V
LCD1

dard 2x16 LCD display module. The con- +5V IN LC DISPLAY


troller also decodes key presses on the C4
VDD
VSS

R/W

4x4 keypad. This configuration is usually


VO
RS

D0
D1
D2
D3
D4
D5
D6
D7
A
K
E

sufficient for most applications requiring 10µ


16V
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

just a basic user input/output device. C1 C5


+5V
100n 100n

From a hardware perspective there is not +5V


K1 R1
*
too much to describe because all of the RXD 20
GND
functions are performed in software. TXD
1
RST 12
PB0
Transistor T1 controls the brightness of the LED+ 2
PD0
IC1
PB1
13
T1
LED backlight using Pulse Width Modu- 3
PD1 PB2
14
6 15
lation (PWM), the average LED current is 7
PD2 PB3
16
PD3 PB4
BS170
given by: 8
PD4 PB5
17
9 18
PD5 PB6
11 19
PD6 PB7
UR1 / R1 x tON / tON + tOFF AT90S2313
XTAL1 XTAL2

Where UR1 is the voltage at LED+ on K1 5 X1 4 10


* see text
minus the voltage drop across A and K C2 C3

on the LCD controller pins and tON/ tON


27p 27p
+ tOFF is the mark-space ratio of the 11.0592MHz
PWM drive signal produced by IC1. The
maximum permissible LED current is spec-
ified in the display module data sheet. S1 S2 S3 S4

0 1 2 3 D1
Software for IC1 can be downloaded
S5 S6 S7 S8
from www.elektor-electronics.co.uk for 1N4148

free, the file number is 050259-11.zip. 4 5 6 7 D2

S9 S10 S11 S12


1N4148

8 9 A B D3

S13 S14 S15 S16


1N4148
Figure 1.
The universal LCD interface circuit basically C D E F D4

consists of a programmed Atmel controller, 1N4148 050259 - 11

an LCD module and 16 keys.

120 elektor electronics - 7-8/2006


2

050259-1
1 -952050
3

F
LCD1

S12

S16
S4

S8
K1

C4

E
T1

S11

S15
COMPONENTS LIST

S3

S7
R1

C5

D
Resistors

S10

S14
S2

S6
R1 = see text

C2

C3

C
Capacitors

X1
C1,C5 = 100nF

S13
S1

S5

S9
C2, C3 = 27pF D1
C4 = 10µF 16V radial
IC1
D2
D3
Semiconductors
D4
C1
D1-D4 = 1N4148
T1 = BS170
IC1 = AT90S2313, order code
050259-41

Miscellaneous
X1 = 11.0592MHz quartz crystal
S1-S16 = pushbutton type D6
LCD module, 2x16 characters
PCBs, ref. 050259-1

A preprogrammed controller can also be


ordered from the site shop as item
050259-41. The CodeVision AVR com-
piler was used for software development.
A demo version is available on the Inter-
net but this version contains a restriction
of 500 bytes on the maximum code size.
A ‘modification’ in the code gets round
this by specifying the larger 8515 con-
050259-1

troller and then resetting the stack pointer


to the correct value for the 2313, the
overall effect is to increase the code
space to 2 kBytes.

The complete module can be controlled


by sending ‘escape sequences’ to the
serial communication port. These consist
of an ASCII ‘escape’ character (27 in
decimal) followed by a command char-
acter. A list of these commands is given
in table 1; they can also be used for con-
trol by a general purpose terminal pro-
gram to facilitate the process of software
development and debugging. In addi-
tion the display has a ‘RAW’ mode
which writes all subsequent characters
directly to the display. An ‘Esc N’
sequence switches it back to normal

Figure 2.
The finished PCB provides a neat, universal
input/output module.

7-8/2006 - elektor electronics 121


mode. Finally special characters can be
Table 1. Command character function in ‘N’ mode.
created and used for display dimming;
further details are contained in the down- Dec. ASCII Function
loadable PDF file. 8 BS clear the character on the left of the cursor
9 TAB move the cursor to position 0 or 8
Figure 2 shows the populated double- 10 LF Line Feed – change line
sided PCB. The LCD module and keypad 11 HOME cursor to top left hand corner
are mounted on one side while the con-
12 CLR clear the display
troller and all the other components are
fitted to the reverse. Fit a good quality 13 CR cursor to the start of the line
socket for IC1 so that it can be easily 27 ESC begin the command sequence
removed for software updates. 28 RIGHT shift cursor one position right
29 LEFT shift cursor one position left
(050259-1)
30 UP change the line the cursor is on (like LF)
31 DOWN change the line the cursor is on (like LF)

090
Uwe Kardel
Hard Disk Switch
D4

In these times with viruses and other D1


RE1 Hard disk 1
threats from the Internet it would be nice K2

to have reassurance that the PC cannot 4


3
+5V

be infected. That is why this circuit was D1 ... D6 = 1N4148 2

designed. It makes it possible to install 1


+12V

multiple hard disks inside the case of a


PC, which are separated in such a way D5

that viruses cannot move from one disk


D2
Hard disk 2
to another. from PC supply
K1
RE2
K3
4
4 +5V
+5V 3
In this case there are three drives 3
2
2
installed, one for use of the Internet via 1
1
+12V
+12V
ADSL, one for working with email and
F1
one for other applications. If data from C1 S1 D6 ADSL
Modem
the Internet never arrives on the third disk, 1000µ
500mA

25V D3
it is effectively protected against viruses. RE3 Hard disk 3
K4
The solution outlined here has been in 4
+5V
satisfactory use for a couple of years. R1
3
2
There is an additional benefit: if there are
1k

1
+12V
ever any problems with the operation of
the computer, then it is very easy to
change to another hard disk to check if 060178 - 11

the problem manifests itself there as well.


In this case, fault finding can be made
much easier. The selection of the desired hard disk is trolytic capacitor C1 is charged via R1,
The circuit operates by only switching done with a rotary switch. This has to be so that the common contact of the rotary
over the power supply voltages (5 V and set to the correct position before the com- switch is quickly at 0 V. This prevents an
12 V) of the hard disks. The hard disk is puter is switched on. When the power accidental change of hard disk while the
out of service without a power supply. supply is turned on, one of three relays computer is in operation.
This works without a problem with S-ATA is driven via diode D1, D2 or D3. The The ADSL modem is powered from the
disks. With IDE disks this only works with relays are provided with a hold circuit PC. This power supply voltage is only
modern drives. There may only be a via a second diode (D4, D5 and D6). In present if hard disk number 2 is selected.
combination of hard disks on the relevant this way the selected relay remains ener- This prevents the use of the Internet if one
port and no CD-ROM, DVD-drive, CD- gised as long as the power supply volt- of the other disks is selected.
burner or something similar. age is present. After switching on, elec- (060178-1)

122 elektor electronics - 7-8/2006


How to! connect your
project to the PC
John Dobson
091
1
Connecting a project to your computer
used to be a simple affair – your micro-
controller would have a UART (Universal
Asynchronous Receiver Transmitter)
which was compatible with the RS232
protocol. You would then simply put a
MAX232 converter chip onto the micro-
controller and a 9-way D-type socket
which linked your design using a stan-
dard lead directly to your PC. From an
application like Visual Basic, you could
then communicate directly to your proj-
ect using Windows COM routines. Alter-
2
natively, you used the parallel port and
simply waggled individual pins using the
old BASIC [outp] command.

Then USB came along to make all our


lives “easier”. Due to the non-trivial cod-
ing required to tame the USB interface in
microcontrollers having internal USB con-
nectivity, alternative solutions have
emerged – most notably the FTDI chip
that acts as an interface between RS232
and USB. You can see this solution on the 3
E-blocks USB232 board in Figure 1.

The FTDI device takes care of all the


tricky USB negotiation for you and pro-
vides a link between a TTL level UART
interface on the microcontroller and the
USB port on your PC. On the PC side
you are supplied with a virtual COM port
driver which you can drop into your
Visual Basic application, providing com-
patibility with older programs that find that Windows has a native infrared tooth then it is possible to buy a low-cost
worked on the serial port. The FTDI COM driver which can be used by PCMCIA compatible card, or a Bluetooth
devices also provide DLLs for faster non- Visual Basic or your other development adaptor for the USB port.
com port compatible communication. system.
The obvious choice for replacing the
Almost all laptop PCs have an IrDA Bluetooth was originally specified to RS232 link between hardware projects
port. IrDA is an internationally defined replace the cables round the back of and your PC would be USB — but this sys-
standard for infrared communication your PC. The system has some great tem is currently too complex to implement
that’s used on laptops, mobile phones, advantages: it is a wireless system with in a microcontroller. The FTDI drop-in chip
and PDAs. Implementing the IrDA stan- a range of up to about 100 meters, and will be the easiest choice for replacing the
dard is as difficult as you want to make transmission through walls. A number of RS232 link, but designers should also con-
it: the infrared techniques at the basic off the shelf modules are available like sider alternative wireless/infrared solutions
physical layer are not that hard, but the the TDK one on the E-blocks Bluetooth which present some significant advan-
actual coding and decoding of data is module shown in Figure 3. This con- tages to the end user.
very complex. Fortunately Microchip verts Bluetooth into a TTL compatible data
offer an IrDA decoder chip or ‘stack’ stream which can interface directly with E-blocks modules and associated soft-
which sits between the infrared trans- any old microcontroller UART. To transfer ware are available through the Elektor
ceiver and your microcontroller. What’s data or commands, you will need some Electronics SHOP, see www.elektor-elec-
more, an E-blocks module is available understanding of the Bluetooth AT proto- tronics.co.uk
(Figure 2). On the PC side you will cols. If your laptop does not have Blue- (065122-1)

7-8/2006 - elektor electronics 123


Expansion for Universal
092 Interface
1
IC5.A
R4 1
3
4k7 2 ≥1
C1
U+
680p
15 IC5.B IC5.C IC5.D
RTS EN3 5 8 12
IC1 1 4 10 11
C2 6 ≥1 9 ≥1 13 ≥1

SRG8
3
C1/
DTR
2 4
1D 2D 3
5
6
7
TxD 14
13
12
D1 D2 D3
11

9
4V7 4V7 4V7
10
4094N

+UB U+

U+
C2 C3
16 14
IC1 IC5
8 7 15 15 15
100n 100n EN3 EN3 EN3
1 1 1
IC2 C2 IC3 C2 IC4 C2

SRG8 SRG8 SRG8


3 3 3
C1/ C1/ C1/

IC5 = 4081N 2 4 2 4 2 4
1D 2D 3 1D 2D 3 1D 2D 3
5 5 5
6 6 6
U+ 7 7 7
14 14 14
13 13 13
C4 C5 C6
16 16 16 12 12 12
IC2 IC3 IC4 11 11 11
8 8 8
100n 100n 100n 9 9 9
10 10 10
4094N 4094N 4094N
050109 - 11

Roland Plisch neously to its outputs. This arrangement delayed by R4 and C1, via AND gates
can easily be extended by adding further IC5.B, IC5.C and IC5.D when the corre-
The ‘Universal Interface for Windows’ shift registers in cascade, allowing data sponding output (Q6, Q7 and Q8
designed by Burkhard Kainka (Elektor words of (in theory) any desired size to respectively) of the first shift register is
Electronics, December 1999 Supplement, be built up byte by byte. active. The software sends a 16-bit word
page S2) provides for a range of input containing the address and a data byte
interfaces along with eight digital out- The circuit in Figure 1 shows shift reg- in a single transfer. For example, to select
puts, all under direct control of a PC’s ister IC1 connected as before to the PCs Q6 and hence IC2, it is necessary sim-
serial port. The program (available for interface. The serial data pass through ply to add 2048 to the eight-bit data
free download from http://www.elektor- this device first, and then, via its serial value; for IC3 add 4096, and for IC4
electronics.co.uk under ‘Magazine’) uses cascade output (pin 9) to three further add 8192. The circuit can be extended
the TXD signal to clock eight data bits 4094s. The last (i.e., eighth) bit of the in similar fashion using the spare outputs
from the DTR signal into a 4094 shift reg- shift register appears on this cascade pin. of IC1 (pin 4 to pin 7 and pin 14) to con-
ister. On the positive-going edge of the The three shift registers IC2, IC3 and IC4 trol further 4094s.
RTS strobe it transfers these bits simulta- receive their strobe pulses, slightly (050109-1)

124 elektor electronics - 7-8/2006


New
KW 1281 Interface
Florian Schäffer
093
+5V
Cars made by the Volkswagen/Audi C5
group (VAG) are easy to interface to 1µ +U B

using the OBD-2 connector: the VAG- 16V


2
COM software allows values to be read R3

560 Ω
1 V+ 16
out from the car and parameters to be C3 C1+
K1
set. The communications protocol used is 1µ 3
C1–
IC1
1
called KW 1281. Versions of VAG- 16V 11
T1IN T1OUT
14
2
6
R2
T1
10 7 7
COM up to 311 require the use of an T2IN T2OUT 3 2k2
12 13 8
isolated interface connected to the PC’s 9
R1OUT R1IN
8
4
9 BC547B
R2OUT R2IN 5
serial port to protect both the car’s com- C4
4
C2+
C6 2N3904
puter systems and the PC itself from pos- MAX232 1µ
5 15 RS232
sible damage. A popular and rather min- 1µ
16V
C2–
V-
16V
1:1 cable
imal design for the circuit is ‘Jeff’s inter- 6
C7
SUB D9

face’; however, this employs


optocouplers which are not always read- 1µ S1
16V
ily available from electronic component +5V +U B
shops. Also, the optocouplers are run at
a rather infelicitous operating point,
K2
entailing the use of several trimmer poten- 7 1 R1
560 Ω
VDD VBB 1 +U B +5V
tiometers and correspondingly compli- IC3 6
8 2 2
cated adjustments. 5
CEN NC
3
7 IC2
TX 8
6
RX ISO
4 4 D1 78L05
9
The problem can be solved with the use of MC33290 5
R4
1N4148
two interesting ICs: the L9637D from ST

330 Ω
3
K3 SUB D9
Microelectronics and the (OBD) C1 C2 D2
Motorola/Freescale MC33290D. Both 9 1

include an ISO 9141-compliant inter- 10 2 100n 100n

face. The L9637D, at a price of two 11 3


POWER

pounds or so, is the more expensive, but


12 4 K2'
can withstand voltages of up to 36 V,
13 5 1
making it suitable for use with commer- 2
6

cial vehicles that use a 24 V supply. At 14 6


3
7
8
58 kbit/s it is also too slow to connect 15 7 4
9
to the CAN bus, which can operate at up 16 8
5

to 500 kbit/s. The MC33290D is only


SUB D9
specified for operation up to 18 V, but OBD
is fast enough for OBD over CAN and is 060097 - 11
therefore the better choice for our circuit.
As far as VAG-COM is concerned the dif-
ference is not significant, as KW 1281
operates at a maximum speed of just ible with older cars, separate provision The components are readily available;
10400 bit/s. must be made for connection to the L-line the ISO interface chip can be obtained
as the ISO interface chip only supports from Farnell or Segor Electronics. No
This chip is responsible for the OBD side the K-line. We have therefore added a adjustments are required to the circuit,
of the circuit; on the serial port side we transistor to drive the L-line: the direction since all the devices used are standards-
use a MAX232. The MAX232 converts of data transfer on this line is only from compliant. The author has made a
the serial signals between the levels used the PC to the car. Most cars use only the printed circuit board layout available on
on the interface and TTL levels, while the K-line and do not require the L-line at all. his homepage, as both an Eagle file and
MC33290 converts between TTL levels We have therefore also added a switch a PDF. The page also contains much
and the ISO levels. The circuit draws to allow the signal to be isolate from the other information, including details of the
power from the car’s 12 V supply over OBD connector. This allows testing of software.
the OBD cable. A simple voltage regula- whether the car uses the L-line for initiali- (060097-1)
tor produces the +5 V supply voltage, sation or not. A straight-through (not a
whose presence is indicated by the LED. crossed-over null modem) cable is used Internet link
To ensure that the circuit remains compat- to connect to the PC. http://www.blafusel.de

7-8/2006 - elektor 125


Multimedia
094
Christian Tavernier
RIAA Preamplifier
IC1 = NE5532 R1 D1 +12V
Even if a large number of album titles 100 Ω
1N4004
once available on vinyl are now, little by R2
little, being proposed as CDs, not all are 8 C1 C2 C3
*

2k2
IC1 optional
available and far from it. You may have 4 10n 1000µ 100µ
treasures in your collection that you would 25V 25V

like to burn on CDs. First, preserving a


CD is easier than preserving a vinyl C4 C5

record, and second, we have to admit 1n 100µ

that turntables are disappearing, even on


25V R3
C8 C9
see text *

100k
fully-equipped Hi-Fi systems. From a point R7
5n6
R8
1n5

of view of software and PCs, converting 620k 51k

from vinyl to CD is not a problem. A large R C6


3
number of programs, whether paid for 1
R4 C7 R
IC1.A 220 Ω
freeware, are available to re-master vinyl 470n
2
10µ
records with varying degrees of success 1k
R9 63V

and to eliminate pops, crackles and other R6 R5

undesirable noises. All of these programs

22k
100k

C10
work with the sound card of your PC and
22µ
that, admittedly, is where the problem 25V
starts. Most high-quality turntables are
equipped with a magnetic cartridge C13 C14
R10
which typically delivers just a few mV. The
100k

5n6 1n5
cartridge signal requires a correction of R14 R15

a specific frequency, called RIAA correc- 620k 51k

tion. If our older readers will perfectly L C11


5
recall what RIAA is all about, others from R11 C12 L
7
470n IC1.B 220 Ω
the CD generation may not know what 6
10µ
the acronym RIAA stands for, guessing it R16 63V
1k

may have something to do with illegal R13 R12


22k

downloading of music on the Internet.


100k

C15

For mechanical reasons related to the


22µ
vinyl engraving procedure, high-boost fre- 25V

quency correction is carried out while 060111 - 11


respecting a very precise curve defined
a long time ago by the RIAA (Recording
Industry Association of America) and, in order to match the RIAA correction as with a dotted line will not be useful. Since
which therefore, quite naturally, was bap- closely as possible. the circuit only uses a few mA, such a
tized RIAA correction. The input has an impedance of 47 kΩ, solution is acceptable unless your collec-
Reversing the correction is the role of to which is the standardized value of mag- tion of vinyls is impressive...
the preamplifier for the magnetic car- netic cartridges, and its 1,000-Hz gain If you desire a more elegant technical
tridge. Since this correction boosts the is 35 dB which allows it to supply an out- solution that might sometimes cause
lowest frequencies, such a preamplifier put level of a few hundred mV typically more undesirable noise on the signals,
is very sensitive to all undesirable noises, required by for the line input of a PC you may want to wire up the compo-
hums, including, of course, the one com- sound cards. nents within in the dotted lines and you
ing from the 50-Hz (or 60-Hz) mains The connection between the cartridge can steal the 12 V positive voltage avail-
power supply. It is important to take that and the input of the amplifier requires able from your PC. A Y-connector
into account while making this project shielded wiring to avoid the hum prob- inserted on the power supply of one of
which must be done carefully with lems discussed above. Likewise we rec- the internal drives or peripherals will
respect to grounding and shielding. ommend fitting the assembly in a metal work very well for that.
The schematic of our preamplifier is very housing connected to the electric ground. Finally, you may also use a mains
simple because it uses a very low-noise With respect to the power supply, three adapter set to 12 V and connect it to the
dual operational amplifier. Here the solutions are proposed: If you are a +12-volt point of the drawing in order to
NE5532 is used, whose response curve purist and you want to rule out any noise benefit from additional filtering, which is
is modelled by R7, R8, C8, and C9 (or whatsoever, you will utilize a simple 9-V not a luxury for some.
R14, R15, C13, and C14 respectively) battery. Then, the components outlined (060111-1)

126 elektor electronics - 7-8/2006


Multicolour HD LED
095 +5V
IC1
A1 1 6 5

T1
K1 2 4
K1
CNY17
red
+5V
BC547

10k
black
R1
black
R2
yellow
560Ω +12V

IC2
A2 1 6 5 D1

T2 0V
K2 2 4
CNY17
DUO LED
BC547

10k
R3
R4
560Ω 030117 - -11

Andreas Köhler the original LED. The somewhat lower


voltage drop of the infrared LED results
030117-1
Most PC enclosures provide only a single in a somewhat greater current, but there’s T1

H1
H2

R1
R2
LED to indicate hard disk access, with the hardly any need to worry about over- K1 IC1
LED being connected to the motherboard loading. The optocouplers eliminate the A1
D1
via a two-pin connector. However, this problems with the different voltages. On K2

R3
R4
A2
LED only works with IDE drives, and if a the output side, a Darlington transistor IC2
T2
SCSI disk controller is fitted, its activity consisting of the phototransistor and a
H4

1-711030 K1
will not be visibly noticeable. This small BC547 drives the multicolour LED. The
circuit remedies that problem using a mul- 10-kΩ resistor (whose value of is not crit-
ticolour LED. ical) provides secure cut-off of the driver 030117-1
The activity LED for the IDE interface is transistor. The base of the phototransistor
usually driven by a connected device via in the CNY17 is left open.
one or more open-collector stages. It illu- The series resistors for the individual LED
minates if either of the two possible IDE elements are dimensioned using the stan-
drives is activated. The shared series dard formula. It may be necessary to
resistor limits the current and also pro- adjust their values slightly, depending on
vides short-circuit protection. Even if the the relative brightness levels. The circuit
LED is shorted out due to faulty wiring, can also operated from the +12-V line
the current is restricted to a safe level. of the power supply if the values of the
An obvious solution would be to have the series resistors for the LEDs are suitably
IDE and SCSI disks drive a shared dual modified. If necessary, a third optocou- COMPONENTS LIST
LED, but unfortunately the current flows pler stage can be added to allow a
from the positive supply line through a three-colour LED (red, green and blue) to Resistors:
R1,R3 = 10kΩ
series resistor, the LED and a transistor to be driven.
R2,R4 = 560Ω
ground. The dual LED would thus have to The circuit board has been designed to
have a common anode, but no such be so small that the components can be Semiconductors:
device exists. All known multicolour LEDs fitted in a few minutes and everything D1 = Dual LED with 3 pins (Conrad
have a common cathode lead. That can be suspended from the LED in the PC Electronics # 187496)
IC1,IC2 = CNY17-2
means they cannot be connected directly, enclosure. A drop of hot-melt glue will T1,T2 = BC547B
but we’re not that easily defeated. prevent the circuit board from becoming
Only a small additional circuit is needed dislodged due to vibration. The supply Miscellaneous:
to allow the LED to be driven by the differ- voltage reaches the circuit via a normal K1 = 4-way SIL connector
Small disk drive connector for PCB
ent interfaces. small drive connector, to make it easy to
mounting, or solder pins (see text)
In this circuit, each of the drive signals obtain the necessary plug. Otherwise, PCB, order code 030117-1 from the
from the two controllers is fed to an opto- you can also use ordinary solder pins. PCBShop
coupler, which acts nearly the same as (030117-1)

7-8/2006 - elektor electronics 127


096
Paul Goossens
RC Switch
It is sometimes necessary for an RC
(remote control) model to contain some
kind of switching functionality. Some
things that come to mind are lights on a
model boat, or the folding away of the
undercarriage of an aeroplane, etc. A
standard solution employs a servo, which
then actually operates the switch. Sepa-
rate modules are also available, which
may or may not contain a relay.
A device with such functionality is emi-
nently suitable for building yourself. The
schematic shows that it can be easily
realised with a few standard compo-
nents.
The servo signal, which consists of pulses
from 1 to 2 ms duration, depending on
the desired position, enters the circuit via
pin 1 of connector K1. Two buffers from
IC2 provide the necessary buffering after
which the signal is differentiated by C2.
This has the effect that at each rising
edge a negative start signal is presented The aforementioned 555 is configured as this a little later on.
to pin 2 of IC1. D1 and R4 make sure a one-shot. The pulse-duration depends on Via IC2.C, the fixed-length pulse is, pre-
that at the falling edge the voltage at the combination of R2/C1. Lowering the sented to the clock input of a D-flip-flop.
pin 2 of IC2 does not become too high. voltage on pin 5 also affects the time. This As a consequence, the flip-flip will
IC1 (TLC555) is an old faithful in a results in reducing the length of the pulse. remember the state of the input (servo
CMOS version. A standard version (such In this circuit the pulse at the output of IC signal). The result is that when the servo-
as the NE555) works just as well, but this will last just over 1.5 ms when T1 does pulse is longer than the pulse form the
IC draws an unnecessarily high current, not conduct. When T1 does conduct, the 555, output Q will be high, otherwise
while we strive to keep the current con- duration will be a little shorter than the output will be low.
sumption as low as possible in the model. 1.5 ms. We will explain the purpose of It is possible, in practice, that the servo

+U B

+U B = max. +15V

R4 R2 K2
D1
100k

150k

D2
IC2.D
9 10
1
8 4
IC2.A BAT85
R JP1 1N4148
3 2 7 5 1 IC2.E max. 100mA
1 DIS D
IC1 IC2.C IC3.A 11 12
K1 C2 1
2 3 7 6 3 C 2
TR OUT 1
IC2.B
1n TLC555 R S IC2.F
5 4 6
0V 1 THR 4 6 14 15
1
CV
+U B
1 5
IC2 = 4049 R5
470k

R1 IC1 = 4013
4k7

9 13
D
1 14 T1 IC3.B T2
C3 C4 C1 R3
IC2 IC3 11 C 12
47k
8 7
100n 100n 10n R S
BC547 10 8 BC547

044030 - 11

128 elektor electronics - 7-8/2006


that is, the output could be high at one
C4
time and low the next. To prevent this
K1 JP1 chatter there is feedback in the form of

R3
+ R1, R3 and T1. This circuit makes sure
0V
that when the flip-flip has decided that

1-030440IC3

IC2

R5
the servo-pulse is longer than the 555’s

044030-1
pulse (and signals this by making output
T1
R2
Q high), the pulse duration from the 555
C3

C1
T2 is made a little shorter. The length of the
R4
R1

IC1

C2 servo-signal will now have to be reduced


D1 + K2
D2 by a reasonable amount before the
044030-1
servo-pulse becomes shorter than the
555’s pulse. The moment this happens,
T1 will stop conducting and the mono-sta-
ble time will become a little longer. The
COMPONENTS LIST Semiconductors:
D1 = BAT85 or similar Schottky diode servo-pulse will now have to be longer
D2 = 1N4148 by a reasonable amount before the flip-
Resistors: IC1 = CMOS 555 (e.g., TLC555 or flip changes back again. This principle
R1 = 470kΩ ICM7555)
is called hysteresis.
R2 = 150kΩ IC2 = 4049
R3 = 47kΩ IC3 = 4013 Jumper JP1 lets you choose between the
R4 = 100kΩ T1,T2 = BC547B normal or inverted output signals. Buffers
R5 = 4kΩ7 IC2.D through to IC2.F together with R5
Miscellaneous: drive output transistor T2, which in turn
Capacitors: JP1 = jumper with 3-way pinheader
drives the output. Note that the load may
C1 = 10nF K1 = servo cable
C2 = 1nF K2 = 2-way pinheader or 2 solder pins draw a maximum current of 100 mA.
C3,C4 = 100nF PCB, available from The PCBShop Diode D2 has been added so that induc-
tive loads can be switched as well (for
example, electrically operated pneu-
signal is nearly the same length as the variation in the servo signal could there- matic valves).
output from the 555. A small amount of fore easily cause the output to ‘chatter’, (044030-1)

Increased Range
for DVM 097
R1
INH

Vin R2

Iin

INL

Range R1 R2
040037- 11
2V 910k 100k
20 V 1M 10k
Vin
200 V 1M 1k Voltmeter modules are readily available, current with these modules.
both as LCD- and LED-versions. A disad- In order to measure higher voltages we
2000 V 1M 100 Ω
vantage of these modules is the standard have to reduce the voltage with a poten-
200 mA 0Ω 1k measuring range of 200 mV DC. So, tial divider. For this purpose we add R1
with such a module you can only meas- and R2. R1 is connected in series with
2 mA 0Ω 100 Ω
Iin ure DC voltages up to 0.2 volts. Fortu- the + input of the module and R2 is con-
20 mA 0Ω 10 Ω nately it is not difficult to increase the nected in parallel with the inputs. In the
measuring range to higher voltages. In table we can see the correct ratios of R1
200 mA 0Ω 1Ω
addition, it is also possible to measure and R2. These modules typically have an

7-8/2006 - elektor electronics 129


input impedance of more than 10 MΩ. In contrast with the input impedance of a to take into account that lethal voltages
With the attenuator in front of it the input voltmeter, the input impedance of a cur- can be present in the circuit, particularly
impedance reduces to 1 MΩ, still high rent meter needs to be as low as possi- with the 200-V and 2000-V ranges. In
enough for most measurements. ble. The input impedance of this circuit addition, the specifications of your ordi-
depends on the range and is practically nary, common or garden resistor do not
To measure current with a voltmeter we identical to the value of R2. As a conse- permit these kinds of voltages. When
first have to convert the current into an quence, keep in mind that there is a volt- measuring these high voltages suitable
equivalent voltage. Resistor values for age drop across the meter of up to 0.2 V. resistors need to be used.
doing this are also shown in the table. When making measurements you have (040037-1)

098 R3 R4
Geiger Counter
10M 10M
+5V

LS1
R6
C2 C3 D7 C11
*

100k
100n 100µ 10V 100n
TR1 1N4148 D8
C6 C8
0W5 A 32 Ω

R2
D2 D3 D4 D5 D6
1N
C4 4148
100k

230V
6V

8 4 8 4
R
22n * R
2 C5 C7 C9
TR 6 7
3 THR DIS
OUT R5
P1 R1 IC1 T1 IC2
10M
100k

7
DIS C5...C8 = 22n / 250V
555 555 R7
D1...D6 = 1N4004 2 3
100k 6 TR OUT 1k
THR BC546B
CV CV K1
1 5 D1 * see text R8 1 5
C1 C12 C10 C13
1M

22n 10n 22n 10n


75V

040291 - 11

Malte Fischer measurements; the most common and sim- ing of a 6 V mains transformer. An alter-
plest detector type is the Geiger counter. nating voltage of around 250 V is pro-
April this year was the twentieth anniver- The design described here uses two duced at the primary side which is then
sary of the Chernobyl reactor accident. In NE555 type timer ICs, a small mains multiplied by the classic voltage multiplier
the days following the incident winds transformer and a few other standard com- configuration consisting of cascaded
deposited much of the reactor contents ponents to make a low cost and simple to capacitors and diodes to produce
across central Europe, Scandinavia and build Geiger counter. The only fly in the around 700 V DC. The voltage is fed
the UK. A large area surrounding the reac- ointment is likely to be locating a Geiger- back to the timer input through resistors
tor is still off limits but just how much of the Mueller (GM) tube; this is not in any way R3 and R4 to provide some stability of
fallout is still lying around on our gardens a standard component. The on-line auc- the output voltage.
and farmlands? At the time of the release tion site eBay may provide a source of The counter tube anode is connected to
Iodine 131 was responsible for many new or used counter tubes or alternatively 700 V via a 10 MΩ protection resistor.
cases of thyroid cancer but with a half life Google will be useful in identify stockists. In normal operation with no radiation
of 8.1 days this does not pose much of a A brand new type ZP1300 tube can be detected there will be no current flowing
threat in the long term. Strontium 90 is purchased from ALRAD [1] at a cost of through the tube and gas filling. When a
more of a problem; it has a half life of 28 £55.00 plus VAT. The GM tubes are listed radiation source is brought close to the
years and more than 50 % of the fallout under nuclear products and nucleonics. tube, ionising radioactive rays pass
still remains. Radio caesium affects the The counter tube requires a high voltage through it and collide with some gas
food chain and can contaminate milk, in the region of 700 V. IC1 is a NE555 atoms knocking a few electrons out of
meat and to a lesser extent crops. timer configured as an astable multivibra- their shell; this produces a current pulse
Radioactivity is invisible so a detector is tor switching the BC547C transistor from the tube terminal which in turn gen-
needed before we can start to make any which in turn drives the secondary wind- erates a voltage pulse across the 1 MΩ

130 elektor electronics - 7-8/2006


resistor high enough to trigger IC2. The to K1. A copy of an original Philips tains a useful Geiger selection guide.
NE555 effectively amplifies the pulse to Geiger tube data sheet is available at
produce the familiar tick-tick sound of a http://sbarth.dyndns.org/seiten/geigerza [1] www.alrad.co.uk
Geiger counter from the speaker LS1. An ehler/18550.pdf. Philips tubes are now [2] www.centronic.co.uk
external pulse counter can be connected made by Centronic [2] and their site con- (040291-1)

DRM Receiver Upgrade


1
099
R6
D1' ... D3'
1k
D1
BB313 K K K K K +5V

C11 R9
R13 C15
270k

27k
100n
A2 A1 A3 C13 10µ
A2 A1 A3 5 16V
R11 R12
7 2
100n IC2.B 27k 27k
C6 6 1
IC2.A
3
+5V 100n R8 R10 R14 R15
C14

100 Ω
L2

1k
R1
27k

27k
1k

100n
C4 C7
1µH5
JP1
22p 100n C10
CON6 R4
8 1k
R18 C2
C5 R5 100n
7 6 +5V 1k
OSCO OSCI 1M
R19 100p C22 CON3
100n IC1 R2
1 4 13 27k
INA OUTA 27k R16
14 100n
NE612 IC2.D
27k

R3
2 5 12
INB OUTB 27k 9 T2
8
C12 C8 C9 C21 IC2.C
3 10 CON1

100n 100n 100n 100n BS107


CON4
T3
+5V R17 C18
R20 C1
27k

1k 47µ
100n BS107 16V
T1
C16

100n
+12V IC3
BF245 D2 78L05 +5V
L1 C3
C17
(18) CON5 CON7 1N4001
CON2 R7 100n 4
C19 C20
45p IC2 IC2 = LM324
470 Ω

(2)
100n 11 100n

060140 - 11

Burkhard Kainka matic gain control (2/06). particular giving better image frequency
Both of these add-ons have been subject rejection and higher receiver sensitivity
The DRM Receiver described in the to continuous refinement by the author so that more distant DRM, AM, SSB and
March 2004 issue of Elektor Electronics and the resulting combined circuit shown CW broadcasts can be detected.
has proved very popular and many thou- here can now be assembled on a ready-
sand of the receivers are already in the made PCB. This design equips the DRM The RF input stage of the circuit in Figure
field. Its excellent design is both simple receiver with an automatically tuned pre- 1 is tuned by a varicap and passed
and inexpensive. In the best tradition of selector for short wave signals in the fre- through the source-follower formed by T1.
homebrew construction we have sup- quency range from 3.5 MHz to around A tuning voltage is generated by the pas-
ported the receiver by publishing two 16 MHz and an automatic gain control sive PLL circuit and NE612 mixer. The
add-ons to the basic design; an auto- (AGC). The modifications improve the DDS output signal from the receiver is
matic preselector (11/04) and an auto- properties of the basic DRM receiver, in connected to the input connector CON6.

7-8/2006 - elektor electronics 131


The type of varicaps used in this design
have a capacitance of 480 pF at 1 V. 2
Triple packaged BB313 are shown on the
diagram but individual BB112 varicaps
can be substituted. An additional (unused)
BB313 shown on the diagram facilitates
future expansion of the design. The sec-
ond part of the circuit is an automatic
gain control stage built from an LM324
quad opamp which can provide up to 30
dB gain of the 12 kHz IF output signal to
compensate for signal fading. Two VMOS
transistors type BS107 are used as the
controlling element where the drain-source
current controls the internal resistance.

The finished PCB in Figure 2 shows a


neat circuit layout, coil L1 consists of 20

COMPONENTS LIST
Resistors C18 = 47µF 16V radial block, lead pitch 5mm
R1,R4,R6,R14,R18,R20 = 1kΩ CON3 = 3.5mm jack socket
R2,R3,R8,R10-R13,R16,R17,R19 = 27kΩ Semiconductors CON4,CON5 = pinheader or wires
R5 = 1MΩ D1 = BB313 or 3 off BB112 CON6,CON7 = 1mm dia. solder pin
R9 = 270kΩ D2 = 1N4001 L1 = inductor former with core (Conrad
R7 = 470Ω T1 = BF245 Electronics # 516651) and ECW
R15 = 100Ω T2,T3 = BS107, BS170 0.3mm
IC1 = NE612 L2 = 2µH2 fixed inductor
Capacitors IC2 = LM324 PCB, ref. 060140-1
C1,C3,C5-C14,C16,C19-C22 = 100nF IC3 = 78L05
Suggested kit supplier:
C2 = 100pF www.geist-electronic.de
C4 = 22pF Miscellaneous
C15 = 10µF 16V radial J1 = Jumper Ready built and tested units from:
C17 = 45pF trimmer CON1,CON2 = 2-way PCB terminal www.modul-bus.de

132 elektor electronics - 7-8/2006


turns of 0.3 mm enamelled copper wire to disconnect the AGC signal. a good synchronisation performance
(ECW) with a tap at the second turn up The automatic preselector requires a across the entire tuning range. The high-
from the ground end of the coil, it is small amount of alignment to achieve est frequency which can be tuned
wound on a 5 mm diameter coil former optimum performance. Firstly tune the depends on the voltage level on the var-
fitted with a screw-in ferrite slug. preselector to a station at the low fre- icaps so it is important to use a 12 V
quency end of the scale and adjust the mains adapter to achieve the widest
The regulated output signal is available ferrite slug in L1 for maximum signal possible tuning range.
at connector CON1 and the stereo jack strength. Next tune in to a strong station The receiver board uses a 9 V adapter
socket CON3. This PCB is connected to at the upper end around 15 MHz and and this limits the upper frequency range.
the receiver PCB via connectors CON4 adjust trimmer C17 for maximum output (060140-1)
to CON7, jumper JP1 can be removed signal. These two alignment points give

Computer Off Switch


100
IC1.C
1N5817 R1 C2
5 6
100k 1
D1 10µ
25V
R3 R2 IC1.D
14
K1
1M
100k

9 8
1 IC1 1 2x
+5V IC1.A
2 7 C3 1N5817 1N5817
D– 1 2
3 1
D+ IC1.E
4 10µ D3 D4 D5
GND 11 10
1
USB - A D2 D6
Re1
C8 C9 C1 C7 C6 C5

IC1.F 10µ
470µ 330p
25V 13 12 25V 1N4148
1
1N5817 3x 1000µ
25V

IC1 = 40106
IC1.B T1

3 4
1
C4
BSS295

060177 - 11

Uwe Kardel A PCB design is available for the elec- The capacitors charge up in about two
tronics part, but not for the high voltage seconds after switching on. The circuit is
How often does it happen that you close part. It is best to solder the mains wires now ready for use. When Windows is
down Windows and then forget to turn off straight onto the switch and to insulate closed down, the 5-V power supply volt-
the computer? This circuit does that auto- them with heat shrink sleeving. age disappears. C4 is discharged via R2
matically. After Windows is shut down C8 is charged via D1. This is how the and this results in a ‘0’ at the input of
there is a ‘click’ a second later and the PC power supply voltage for IC1 is inverter IC1b. The output then becomes a
is disconnected from the mains. Up to now obtained. A square wave oscillator is ‘1’, which causes T1 to turn on. A voltage
there were no mains switches available built around IC1a, R1 and C9, which is now applied to the coil in the mains
with a magnetic coil to turn off the power drives inverters IC1c to f. The frequency is switch and the power supply of the PC is
supply voltage, but now one is available about 50 kHz. The four inverters in par- turned off. T1 is a type BSS295 because
from Conrad Electronics , with the article allel power the voltage multiplier, which the resistance of the coil is only 24 Ω.
number 70061 for a price of 12.95 Euro has a multiplication of 3, and is built When the PC is switched on, the circuit
(approx. £ 9.00). Surprisingly enough, from C1 to C3 and D2 to D5. This is draws a peak current of about 200 mA,
this switch fits in some older computer used to charge C5 to C7 to a voltage of after which the current consumption
cases. If the circuit doesn’t fit then it will about 9 V. The generated voltage is drops to about 300 µA. The current
have to be housed in a separate enclo- clearly lower than the theoretical when switching on could be higher
sure. That is why a supply voltage of 5 V 3x4.8=14.4 V, because some voltage is because this is strongly dependent on the
was selected. This voltage can be lost across the PN-junctions of the diodes. characteristics of the 5-V power supply
obtained from a USB port when the circuit C5 to C7 form the buffer that powers the and the supply rails in the PC.
has to be on the outside of the PC case. coil of the switch when switching off. There isn’t much to say about the con-

7-8/2006 - elektor electronics 133


struction of the circuit itself. The only coil. That is why there has to be a dis- the low-voltage part of the circuit. Also
things to take care with are the mains tance of at least 6 mm between the con- refer to the Electrical Safety page pub-
wires to the switch. The mains voltage ductors that are connected to the mains lished from time to time In this magazine.
may not appear at the connections to the and the conductors that are connected to (060177-1)

Speed Pulse Generator


101
Stefan Schwarck
for PC Fans
V+

This circuit generates speed pulses from K1


C3
R8
470 Ω R1 R5 K2

1k

47k
the speed-dependent voltage spikes gen- 8
IC1
16
IC2
100n
erated by commonly used types of PC R3 4 8
IC1 = TL082 IC2 = 4520
power supply fans, which are superim- 56k
2

posed on the supply voltage. The pulse 2


D2 R6
EN
0
3
1 6 IC2.A 4 R7
signal can be used by the motherboard C1
3
IC1.A 22k
7 1
1
5

4k7
1N4148 IC1.B C 2
to monitor the speed of the fan. For this 100µ
5
3
6 T1
R4 R
purpose, the pulses are tapped off from 16V
1k

a fan connected to K1 via capacitor C1 BC547C

and amplified by opamp IC1a (one half R9 R2


D1
of a TL082 dual opamp). The second C4 C2
470 Ω

1k

opamp in the Tl082 (IC1b) transforms the 100n


15n

resulting signal into a clean rectangular 1N4148


060146 - 11 V–
clock signal and passes it to a binary
counter circuit in the form of IC2a
(4520), which reduces the frequency by ply voltage for the circuit is also taken from minimise the voltage loss to the fan.
a factor of 2. A BC547C transistor (T1) the motherboard via this connector. Com-
connected to the counter output provides ponents C3, C4, R8 and R9 create an arti- The circuit is suitable for use with CPU
an open-collector output at K2 for con- ficial ground potential at half the supply fans and fans for graphics cards in addi-
nection to the motherboard. voltage (6 V), which serves as a reference tion to power-supply fans.
K2 can be connected directly to a fan con- voltage for the opamp. Diode D1 should (060146-1)
nector on the motherboard. The 12-V sup- have the lowest possible voltage drop to

102
Bart Trepak
Mains Slave Switcher II
vacuum cleaner switch. This unit was The circuit diagram shows a simple
designed to fulfil this function by automat- mains slave switch based on this idea.
Many power woodworking tools such as ically switching on the vacuum cleaner The coil may be wound directly onto the
saws and sanders have a provision for when the power tool is switched on. reed switch using insulated single core
connecting a vacuum cleaner hose to In this circuit, current flow is sensed using hook-up wire or enamelled copper wire
suck up the dust and debris produced by a reed relay which is not only cheap but of sufficient gauge to carry the current
their operation. The problem is of course provides a positive indication that current drawn by the power tool (or master
that the vacuum cleaner must be switched is flowing and dissipates very little appliance). In practice this should be as
on when the tool is switched on and as power. Reed switches are often used in thick as possible to cater for any power
the operator’s attention must be directed burglar alarms where they sense the appliance while still enabling a sufficient
towards the work in hand especially magnetic field from a small magnet but number of turns to be accommodated to
when a blade with large teeth is spinning it is also possible to produce a magnetic produce the required magnetic field
only inches from his fingers, there is often field by winding a coil around the reed which will depend on the reed switch
little incentive to look away to locate the switch and passing a current through this. and is therefore best determined by

134 elektor electronics - 7-8/2006


Warning N
L1

S1
The circuit is by its nature connected RL1 RL2
directly to the mains supply. Great care C1 REED
SWITCH
SLAVE X2 MASTER
should therefore be taken in its con- (VACUUM 1µ 250V (POWER
struction and the circuit should be CLEANER) R2 TOOL)

100 Ω
enclosed in a plastic or earthed metal
D2
box with mains sockets fitted for the
master and slave appliances. 230V
RE1 D3 1N4148

1N4148
experiment. As a guide, a one-inch reed
D1
switch with 40 turns reliably switched on C3 C2

with the current flowing through a 150- T1 22µ 47µ


S2
15V
watt lamp (approx. 625 mA) but larger 25V R1 25V
1k
reeds may require more turns. If the mas-
2N3904
ter appliance draws less current (which L

is unlikely with power tools) more turns 050385 - 2 - 11


will be required.
The reed switch is used to switch on tran-
sistor T1 which in turn switches the relay response and keep the relay energised switch the intended appliance (vacuum
RE1 and powers the slave appliance. during the mains zero crossings when the cleaner) and the coil should have a min-
Since reed switches have a low mechan- current drawn by the appliance falls to imum coil resistance of 400 Ω as the
ical inertia, they have little difficulty in fol- zero and the reed switch opens. C1 simple d.c. supply can only provide a
lowing the fluctuations of the magnetic drops the mains voltage to about 15 V limited current. C1 drops virtually the full
field due to the alternating current in the (determined by zener diode D1) and this mains voltage and should therefore be a
coil and this means that they will switch is rectified and smoothed by D2 and C2 n X2-class component with a voltage rat-
on and off at 100 Hz. C3 is therefore to provide a d.c. supply for the circuit. ing of at least 250V a.c.
fitted to slow down the transistor The relay contacts should be rated to (050385-2)

Advertisement

School of Technology

ate
passion
Are you c tro nics?
our ele Yes to all of these?
about y it,
ilding k Then upgrade your qualifications, by
love bu ?
Do you g thing
s w ork studying at Derby
m ak in
and
career, BSc(Hons) Electronics
o u want a
D o y what
paid for ? BSc(Hons) Electrical &
getting yd g o in
you enjo Electronic Engineering
Also Foundation Year, and HNC/HND
Electrical & Electronic Engineering

• For people who love electronics, taught by people who


love electronics
• Part-time and full-time study modes available
• Flexible entry qualifications, with recognition of current experience
• Easy upgrades from HNC to HND to BSc (Honours)
• Final Year options give specialist training in key topics, like digital
signal processing, embedded systems, EMC, or power electronics
For further details view: http://vertigo.derby.ac.uk/ and email or phone:
Dr Amar Bousbaine: [email protected] 01332 591760 OR
Tim Wilmshurst: [email protected] 01332 591350

University of Derby, Kedleston Road, Derby. DE22 1GB. UK

7-8/2006 - elektor electronics 135


7-8/2006 - elektor electronics 137
This Issue:
SUMMER CIRCUITS EDITION 2006
More than 100 small circuits, tips and ideas
ALSO! GAMEBOY AS HOME AUTOMATION CONTROLLER

Next Issue:
FREE PHILIPS MIFARE RFID CARD
design your own application
with our matching RFID Reader

Want to know everything each month?


SELECT YOUR OWN ANNUAL SUBSCRIPTION
AND RECEIVE A FREE 1W LUXEON LED TORCHLIGHT*
Fill out the Order Form with this issue today!

Subscription rates and conditions may be found at the back of this issue.
* Offer available to Subscribers who have not held a subscription to Elektor
Electronics during the last 12 months. Offer subject to availability.
Take out a free subscription to
E-weekly now
Do you want to stay up to date with electronics and
computer technology? Always looking for useful hints, tips
and interesting offers? Subscribe now to E-weekly, the free
Elektor Electronics Newsletter.
Your benefits:
The latest news on electronics in your own mailbox
each friday
Free access to the News Archive on the Elektor website
You’re authorized to post replies and new topics in our forum

Register today on www.elektor-electronics/newsletter

Elektor Electronics (Publishing)


Regus Brentford • 1000 Great West Road
Brentford TW8 9HH • United Kingdom

Telephone +44 (0) 208 261 4509


Order now using the Order Form in Fax +44 (0) 208 261 4447
the Readers Services section in this issue. Email: [email protected]

ELEKTOR AUDIO BOOKS 3 must-haves for all audio-enthusiasts!

Build your own Modern High-end Build your own High-End


Audio Valve Amplifiers Valve Amplifiers Audio Equipment
To many people, the thermionic valve Valve amplifiers are regarded by many The name high-end equipment is a good
or electron tube is history. However, to be the ne plus ultra when it comes indication of the prices charged for it. For
whether it is nostalgia, interest in the to processing audio signals. The com- those who cannot, or will not, pay these
technical parameters, the appeal of a bination of classical technology and high prices, there is a solution offered in
gleaming amplifier chassis with softly modern components has resulted in a this book: build your own at considerable
glowing valves or perhaps the firm con- revival of the valve amplifier. The use cost savings. This book is aimed not only
viction that the sound of a valve cannot of toroidal-core output transformers, at this sector of the market, but also at
be bettered, it is a fact that the valve is developed by the author over the past the many enthusiasts who want to be able
making a come-back. This book con- 15 years, has contributed to this revi- to experiment and to make their own
tains, apart from construction projects val. This book explains the whys and modifications to their high-end equipment.
for preamplifiers, power amplifiers, and wherefores of toroidal output transfor- Contents include solid-state and valve
amplifiers for musical instru- mers at various tech- preamplifiers and power
ments, information on the nical levels and offers amplifiers, active cross-
operation of electron tubes, innovative solutions over filters, an active
while the first chapter gives for achieving perfect subwoofer, a headphone
a short history of the valve. audio quality. amplifier and more.
ISBN 0 905705 39 4 ISBN 0 905705 63 7 ISBN 0 905705 40 8
253 Pages 264 Pages 262 Pages
£15.55 (US$31.00) 25.95 (US$52.00) £15.55 (US$31.00)

7-8/2006 - elektor electronics 139


ALPHA
T E H R X I
D P A W S
V Y T O B Q M
X K B S H F E
O M G A F R V T
D E H P K B N L
L X T S Y
So you thought our V B A J K L U
Hexadoku puzzles were hard S F I O G M A R
to solve? ”You ain’t seen
K X C R U D O G
nothing yet”! For this year’s
Summer Circuits issue we’ve T S Y X F C
designed Alphadoku, a super S W O P M J K
version of Hexadoku you’ll F T G J C A S U
find so complex we’re pretty B Q L N D
sure it will take you every
E H K L A X P S
spare hour or even the better
part of your summer P S E L Y G C
holidays to solve. M V U B I C D
Lots of Elektor Electronics readers have
C I T R Q O W
taken a great liking of the Hexadoku puz-
zle printed for the first time in our Janu-
H X L N F K R T
ary 2006 issue. Feedback from you all
indicated that the electronics-oriented
J C I N D A
Hexadoku was a welcome change from
the well established Sudoku puzzle. V J Y S F N G H
Despite the varying degree of difficulty
of the puzzles we get hundreds of correct X Q N Y C K V E
solutions every month, a clear sign that
lots of Elektor Electronics readers (and C F I R D L
their family members) like to exert their
brain to the maximum. L W M P Y E H
In this double Summer Circuits issue we
step up the complexity of the puzzle by R O B H J
presenting a giant Alphadoku with a

140 elektor electronics - 7-8/2006


The ultimate brain rack
DOKU for the summer holidays
whopping 25 times 25 boxes (thanks are due to our reader Mr. S. Jobse).
V G J L Y The instructions for the puzzle are really just as straightforward as for the Hexadoku
variant, only the series of characters to be used is a bit longer. Alphadoku employs all
U O H I F letters of the alphabet except Z.
In the diagram composed of 25x25 boxes, enter letters in such a way that all letters A
through Y occur once in every row, once in every column, and in every one of the 5x5
C S U boxes (marked by the thicker black lines). A number of clues are given in the puzzle
and these determine the start situation.
I O M R Your solution may win a prize and requires only the letters in the red boxes to be sent
to us (see below). The puzzle is also available as a free download from our website
L B H (Magazine → 2006 → July/August).

A I
F N G E
D T Y
Q U A
P
Solve Alphadoku and win!
Correct solutions enter a prize draw for
C an

T L B E E-blocks Starter Kit Professional


worth £ 248.55
N L J R and three
Elektor Electronics Shop
U F Q V Vouchers worth £ 35 each.

V Y P
Entering the competition
R A C X M Please send the letters in the red boxes by email, fax or post to
M N W Elektor Electronics Alphadoku
Regus Brentford - 1000 Great West Road
B W K Brentford TW8 9HH - United Kingdom.
Fax (+44) (0)208 2614447.
E N K G Email [email protected]
J S V P Subject: alphadoku 07-2006.

The closing date is 1 September 2006.


S E I Competition not open to employees of Segment b.v., its business partners and/or associated publishing houses.

W G O R T
Prize winners
R T E The solution of the May 2006 Hexadoku is: 02675.
The E-blocks Starter Kit Professional goes to:
B I S Rob Quin (Caste Douglas).

X N W U J An Elektor SHOP Voucher worth £35.00 goes to:


Duncan Boag (Norfolk, UK), Jani Okker (Tampere, SF) and
A O N I.M. Williams (Sutton Coldfield, UK).

C K D T S Congratulations to the lucky winners!

7-8/2006 - elektor electronics 141


ELEKTORSHOWCASE
To book your showcase space contact Huson International Media
Tel. 0044 (0) 1932 564999 Fax 0044 (0) 1932 564998

ATC SEMITEC LTD AVIT RESEARCH ELNEC


www.atcsemitec.co.uk www.avitresearch.co.uk www.elnec.com
Thermal and current-sensitive components USB has never been so simple... • device programmer
for temperature control and circuit protection; with our USB to Microcontroller Interface cable. manufacturer
• NTC Thermistors • Current Diodes Appears just like a serial port to both PC and • selling through contracted
• Thermostats • Re-settable Fuses distributors all over the world
• Thermal Fuses • Temperature Sensors Microcontroller, for really easy USB connection to
your projects, or replacement of existing RS232 • universal and dedicated device programmers
Call today for free samples and pricing • excellent support and after sale support
Tel: 0870 901 0777 Fax: 0870 901 0888 interfaces.
See our webpage for more • free SW updates
BETA LAYOUT • reliable HW
details. Only £29.99 inc vat.
www.pcb-pool.com • once a months new SW release
Beta layout Ltd Award- • three years warranty for most programmers
winning site in both COMPULOGIC LTD
English and German FIRST TECHNOLOGY TRANSFER LTD.
www.compulogic.co.uk http://www.ftt.co.uk/PICProTrng.html
offers prototype
PCBs at a fraction of the cost of the usual Internet Remote Control Starter Kit £139.99 Microchip Professional C
manufacturer’s prices. Create a simple web based remote control and Assembly
interface for many applications Programming Courses.
DESIGN GATEWAY • Miniature Web Server Module The future is embedded.
www.design-gateway.com • Analogue/Digital Module Microchip Consultant / Training Partner developed
PalmLogic II .... US$ 399.00 • PSU courses:
• Compact Logic Analyzer (L116mm x W73.3mm x T3mm) • Manuals, software, example HTML code • Distance learning / instructor led
• High sampling rate (400 MHz/ 8ch, 200 • Assembly / C-Programming of PIC16, PIC18,
MHz/16ch, 100 MHz/32ch) PIC24, dsPIC microcontrollers
• USB 2.0 high speed mode
• 8MB memory storage
h)
CONFORD ELECTRONICS • Foundation / Intermediate
• Bus Analyzer function http://www.confordelec.co.uk
• Multiple waveform windows Lightweight portable battery/mains audio units FUTURE TECHNOLOGY DEVICES
• Waveform save/restore offering the highest technical performance. http://www.ftdichip.com
Microphone, Phantom Power and Headphone FTDI designs and sells
DESIGN GATEWAY Amplifiers. Balanced/unbalanced signal lines
USB-UART and USB-FIFO
www.design-gateway.com interface i.c.’s.
with extensive RFI protection.
True PCI Starter Kit .... US$135.00 Complete with PC drivers,
• PCI Development Kit these devices simplify the task of designing or
• Based on 200,000 gates FPGA upgrading peripherals to USB
• Extension connectors for 72 pin I/O DANBURY ELECTRONICS
• Configuration support for JTAG and slave serial http://www.DanburyElectronics.co.uk FUTURLEC
• Free PCI Core for Target Mode Transformer manufacturers since 1983. Visit our http://www.futurlec.com
new site! Also link directly to Mike Holme’s Valve/- Save up to 60% on
DESIGN GATEWAY Tube DIY amplifier site, featuring our standard Audio • Electronic Components
www.design-gateway.com Transformers (Mains, Output, Chokes, PP, SE, etc). • Microcontrollers, PIC, Atmel
Ethernet IO .... US$115.00
• 8 bits embedded network microcontroller • Development Boards, Programmers
• 6 channels available for 10 bits ADC Huge range of products available on-line for
• Ethernet 10 BASE T 10 Mb EAGLEPICS immediate delivery, at very competitive prices.
• UART port RS232/RS485, Max Speed http://www.eaglepics.co.uk
at115200bps Embedded Internet Solutions HEROS TECHNOLOGY LTD
• 35 bits general purpose I/O • Stand alone TCP/IP module www.herostechnology.co.uk
• 500 bytes user area flash memory • Platform independent Introducing Modular Concept for
• Simple "AT-like" command set microcontrollers.
DESIGN GATEWAY • GPRS or modem connection
Suitable for Developers, Pre-production,
www.design-gateway.com Educational and Hobby applications.
VariClock ... US$163.00 • E-Mail, FTP, HTTP, UDP
• WinPIC2006 USB full speed programmer.
• Adjustable clock signal synthesizer • Development board available
• CPU microcontroller modules.
• 3 rotary switches for frequency setting • Free development utilities • Peripheral modules for all microcontrollers.
• Standard DIP pin arrangement • Free UDP-only stack
• Support both 3V/5V by on-board regulator IPEVA LIMITED
VC250M14P Frequency range : 25-400 MHz
http://www.ipeva.com
Frequency setting : 1MHz step EASYSYNC IPEVA sell low cost USB FPGA
VC100M14P Frequency range : 25-100 MHz http://www.easysync.co.uk
Frequency setting : 100 kHz step for 25-
development boards. IPEVA
EasySync Ltd sells a wide provide Design Consultancy
50 MHz
range of single and multi- for Embedded Systems,
: 200 kHz step for more
port USB to RS232/RS422 OpenCores-IP, FPGA, ASIC, HDL translation and
than 50 MHz
and RS485 converters at competitive prices. migration. Tel. 0870 080 2340.

142 elektor electronics - 7-8/2006


products and services directory
JLB ELECTRONICS NEW WAVE CONCEPTS ROBOT ELECTRONICS
www.jlbelectronics.com www.new-wave-concepts.com http://www.robot-electronics.co.uk
Suppliers of electrical / electronic parts and Software for hobbyists: Advanced Sensors and Electronics for Robotics
consumables. Including: • Livewire circuit simulation • Ultrasonic Range Finders
• Cable ties / bases software, only £34.99 • Compass modules
• Tools / hardware • PCB Wizard circuit design • Infra-Red Thermal sensors
• Bootlace ferrules software, only £34.99 • Motor Controllers
• Connectors Available from all Maplin Electronics stores and
• Vision Systems
• Solvent sprays & cleaners www.maplin.co.uk.
• Wireless Telemetry Links
• PVC Tape
• Embedded Controllers
• Heat Sink compound OLD COLONY SOUND LAB
www.audioXpress.com
KMK TECHNOLOGIES Ltd. Premier source for DIY audio
http://www.kmk.com.hk for 35 years!
SK PANG ELECTRONICS
Low Cost DIY Robotic Kits New catalog features: http://www.skpang.co.uk
and Computer • Books • ELM OBDII IC
Controller Boards. • CDs • VAG-COM Interface
• Test & Measurement • OBDII connector and cable
LONDON ELECTRONICS COLLEGE • Kits • Modtronix Micro X board
http://www.lec.org.uk
Full range of products and • Embedded Ethernet Controller
Vocational training and education for national
magazines for the DIY audio enthusiast! • PIC Microcontroller, CAN Bus driver
qualifications in Electronics Engineering and
Information Technology (BTEC First National, Major credit cards taken online.
Higher National NVQs, GCSEs and Advanced PCB WORLD
Qualifications). Also Technical Management and http://www.pcbworld.org.uk
Languages. World-class site: Your magazine project or SYTRONIC TECHNOLOGY LTD
prototype PCB from the artwork of your choice www.m2mtelemetry.com
MQP ELECTRONICS for less. Call Lee on 07946 846159 for details. Supplier of wireless modules and accessories for
http://www.mqpelectronics.co.uk Prompt service. remote
Leaders in Device monitoring M2M applications.
Programming Solutions. ULTRALEDS • GSM/GPRS TCP/IP modules
• Online shop http://www.ultraleds.co.uk • Embedded GSM/GPRS modem
• Low Cost Adapters for all tel: 0871 7110413 • Development Kits
Programmers Large range of low cost Ultra bright leds and Led • GPS modules
• Single Site and Gang Programmers related lighting products. Major credit cards • GSM/GPS antennas
• Support for virtually any Programmable Device taken online with same day depatch.
• Adapter cables
Online ordering facilities.
Tel (01394) 210911
SHOWCASE YOUR COMPANY HERE
Elektor Electronics has a feature to help customers • For £330 + VAT for the year (£30 per issue
promote their business, Showcase - a permanent for eleven issues) we will publish the above plus
USB INSTRUMENTS
feature of the magazine where you will be able to run a 3cm deep full colour image - e.g. a product http://www.usb-instruments.com
showcase your products and services. shot, a screen shot from your site, a company USB Instruments specialises
• For just £220 + VAT (£20 per issue for eleven logo - your choice in PC based instrumentation
issues) Elektor will publish your company name, Places are limited and spaces will go on a strictly products and software such
website adress and a 30-word description first come, first served basis. So please fax back as Oscilloscopes, Data
your order today!
Loggers, Logic Analaysers
I wish to promote my company, please book my space: which interface to your PC via USB.
• Text insertion only for £220 + VAT • Text and photo for £330 + VAT
NAME:..............................................................ORGANISATION:................................................ VIRTINS TECHNOLOGY
JOB TITLE:...................................................................................................................................... www.virtins.com
PC and Pocket PC based
ADDRESS:.......................................................................................................................................
virtual instrument for
.......................................................................................................................................................... electronics enthusiasts,
...........................................................................TEL:....................................................................... students, professionals and
PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 scientists, including sound
card real time oscilloscope,
COMPANY NAME ......................................................................................................................... spectrum analyzer, and signal generator. Free to
WEB ADDRESS.............................................................................................................................. download and try.
30-WORD DESCRIPTION.............................................................................................................
ELECTRONIC ENTHUSIASTS
.......................................................................................................................................................... Only one magazine tests its projects and circuits in its own lab before publication

.......................................................................................................................................................... ELEKTOR ELECTRONICS


THE ELECTRONICS &
.......................................................................................................................................................... COMPUTER MAGAZINE
.......................................................................................................................................................... Contact: Worldwide Subscription Service Ltd,
Unit 4 Gibbs Reed Farm, Pashley Road, Ticehurst TN5 7HE
Telephone: 01580 200657 Fax: 01580 200616 www.elektor-electronics.co.uk

7-8/2006 - elektor electronics 143


&REEDOWNLOADSAVAILABLEON
WWWELEKTOR ELECTRONICSCOUKEBLOCKS

E-blocks AVR-Kit
C for AVR microcontrollers single user £ 118.00
E-blocks AVR multiprogrammer £ 77.65
E-blocks LED board £ 14.65
E-blocks LCD board £ 19.30 E-blocks Starter Kit professional
E-blocks Switch board £ 14.65 Flowcode professional £ 118.00
Total value: £ 244.25 USB Multiprogrammer £ 77.30
Special Offer:  £ 171.80 LED-board £ 14.65
Switch-board £ 19.30
LCD-board £ 19.30
Total value: £ 248.55
Special Offer:
 £ 166.00
E-blocks Easy Internet Kit Extra: PIC16F877 microcontroller
Flowcode Professional £ 118.00
E-blocks LED board £ 14.65
E-blocks LCD board £ 19.30
E-blocks USB Multiprogrammer £ 77.30
E-blocks Starter Kit basic
E-blocks switch board £ 14.65
Flowcode student/home: £ 59.90
E-blocks internet board £ 71.95
USB Multiprogrammer: £ 77.30
PIC16F877 £ 10.50
Total value: £ 137.20
Ethernet ‘crossover’ cable £ 5.30
Special Offer:  £ 96.00
Total value: £ 331.65
Special Offer:
 £ 232.50

Learn more about E-blocks? E-blocks Easy CAN Kit


For more information, visit Flowcode Professional £ 118.00
www.elektor-electronics.co.uk/eblocks E-blocks LED board £ 14.65
Ordering 2 x E-blocks LCD board £ 38.60
Use the order form at the back or go to 2 x E-block USB Multiprogrammer £ 154.60
www.elektor-electronics.co.uk E-blocks Switch board £ 14.65
E-blocks will be shipped after receipt of payment.
2 x E-blocks CAN board £ 67.00
Prices are exclusive of postage.
2 x PIC16F877 £ 21.00
Total value: £ 428.50
Special Offer:  £ 299.00
Elektor Electronics (Publishing)
Regus Brentford
1000 Great West Road Telephone +44 (0) 208 261 4509
Brentford TW8 9HH Fax +44 (0) 208 261 4447
Order now using the Order Form in United Kingdom Email: [email protected]
the Readers Services section in this issue.

More information on www.elektor-electronics.co.uk


CD-ROM
BESTSELLERS
Home Automation
This CD-ROM provides an 1
overview of what manufactu-
rers offer today in the field of
Home Networking, both wired
and wireless. The CD-ROM 302 Circuits 304 Circuits 305 Circuits
contains specifications, stan- ISBN 0-905705-25-4 ISBN 0-905705-34-3 ISBN 0-905705-36-X
dards and protocols of com- 354 pages 366 pages 369 pages
mercially available bus and £10.35 (US$ 21.00) £13.45 (US$ 27.00) £15.55 (US$ 31.00)
network systems. For develo-
pers, there are datasheets of specific compo- Complete your 30x circuits series now!
nents and various items with application data.
End-users and hobbyists will find ready-made The 30x series of Summer Circuit compilation books have been best-
applications that can be used immediately. sellers for many years. You can use these books not only for building
£12.95 (US$ 22.90) the circuits described,

Robotics 2 but also as a treasure


trove of ideas or circuit
A large collection of data- adaptions for your own
sheets, software tools, tips, experiments. Many
tricks and Internet links to readers have found in
assorted robot constructions these books that new
and general technical infor- approach, new concept,
mation. All aspects of modern or new circuit they were 307 Circuits 308 Circuits
robotics are covered, from looking for. ISBN 0-905705-62-9 ISBN 0-905705-66-1
sensors to motors, mechanical 342 pages 367 pages
parts to microcontrollers, not forgetting matching £18.20 (US$ 37.00) £18.20 (US$ 37.00)
programming tools and libraries for signal
processing. £12.05 (US$ 21.25) BESTSELLING BOOKS
Elektor 2005
3 Top-5
This CD-ROM contains all
editorial articles, with the 1 Visual Basic
exception of New Products for Electronics Engineering
items, published in Elektor Applications
Electronics magazine Volume ISBN 0-905705-68-8 £27.50 (US$ 51.50)
2005. Using the supplied Acro-
bat Reader program, articles 2 Microcontroller Basics
are presented in the same lay- ISBN 0-905705-67-X £18.70 (US$ 33.70)
out as originally found in the magazine. The Disk-
Mirror utility on this CD-ROM allows your earlier 3 308 Circuits
Elektor year volume CD-ROMs (1997-2004) to ISBN 0-905705-66-1 £18.20 (US$ 37.00)
be added to a large archive on hard disk for fast
4 PC-Interfaces under Windows
access and easy reference. A built-in search
ISBN 0-905705-65-3 £25.95 (US$ 22.90)
function allows you to find references in any
article from the archive on hard disk, or from 5 307 Circuits
individual year volume CD-ROMs you have ISBN 0-905705-62-9 £18.20 (US$ 37.00)
available. £16.25 (US$ 28.75)

More information on www.elektor-electronics.co.uk


Order o
www.elektor-el
Order now using the Order Form in
the Readers Services section in this issue.

Onboard OBD-2 Analyser OBD-2 Analyser


(May 2006) (July/August 2005)
Kit of parts including PCB, programmed controller, compo-
Kit of parts including
nents (including IC7 ; IC3 = PCA82C250,
ATMega board, pro-
12 V), enclosure and RS232 cable.
gramming adapter
OBD cable not included.
board, preprogrammed
ATMega microcontrol- 050092-71
ler and all compo- £ 52.50 / $ 96.95
nents, but excluding
LC display and Case. OBD cable
050092-72
050176-72
£ 27.55 / $ 51.95
£ 24.80 / $ 46.70
ESR/C Meter
LCD-display (September 2005)
Kit of parts including PCB, default LCD module, 2x16
4 x 20 caracters, 60 x 98 mm, with background lighting
characters and programmed controllers.
050176-73
Enclosure not included.
£ 28.80 / $ 54.50
040259-71
£ 63.99 / $ 119.95
Case, Bopla Unimas 160
with Perspex cover and mounting plate
Matching enclosure
050176-74
040259-72
£ 15.80 / $ 29.90 £ 6.99 / $ 12.95

READY-BUILT PROJECTS £ $ GBPLC - Gameboy PLC


ClariTy 300-W Class-T Amplifier 050190-1+2 PCBs, bare, GBPLC Module & Programming Interface 11.70 22.00
030217-91 Amplifier board with SMDs pre-fitted; cores for L1 & L2 34·50 55.70 050190-51 Programmed PAL, EEPROM and Flash IC 11.00 20.75
050190-91 Ready-built and tested GBPLC Module and Programming Interface
Electrosmog Tester
050008-91 PCB, ready built and tested 50·00 94.25 GBPLC - I2C I/O Box
050008-71 Matching enclosure 10·25 19.30 060098-1 PCB, bare 17.90 33.75
060098-91 Ready-built and tested board
Flash Microcontroller Starter Kit
010208-91 Ready-assembled PCB incl. software, cable, adapter & related articles 69·00 112.50 Binary Clock
020390-11 disk, project software 5.20 9.75
Gameboy Digital Sampling Oscilloscope (GBated articles 103·00 020390-41 PIC6C54-04/P, programmed 8.05 15.10
183.00 NO. 355 JUNE 2006
LPC210x ARMee Development System
040444-91 Processor board, ready-made and tested 25·50 48.05 FM Stereo Test Transmitter
050268-1 PCB 11·70 22.00
Micro Webserver with MSC1210 Board
030060-91 Microprocessor Board, ready-assembled 75·90 142.95 Network Cable Analyser
044026-91 Network Extension Board, ready-assembled 44·50 83.95 050302-1 PCB 8·20 15.55
044026-92 Combined package (030060-91 & 044026-91 & related articles) 117·50 220.95 050302-11 Disk, PIC source code 5·20 9.75
050302-41 PIC16F874-20/P 16·90 31.85
NO. 356/357 JULY/AUGUST 2006
NO. 354 MAY 2006
RC Servo Tester/Exerciser
040172-11 Disk, project software 5.20 9.75 Onboard OBD-2 Analyser
040172-41 PIC16F84(A), programmed 10.30 19.40 050176-72 Kit of parts, incl. 050176-1, 050176-2, 050176-42, all components,
040172-71 Kit, incl. PCB, controller, all parts excl. LCD and Case 24.80 46.70
050176-73 LCD, 4x20 characters with backlight 28.80 54.50
LED Thermometer 050176-74 Case, Bopla Unimas 160 with Perspex cover and mounting plate 15.80 29.90
030190-11 Disk, project software 5.20 9.75 050176-42 ATmega16, programmed 10·30 19.45
030190-41 PIC16F873-20/SP, programmed 16.50 31.00 050092-71 OBD-2 Analyser: Kit of parts without cable 52·50 96.95
Toothbrush Timer 050092-72 OBD-2 Analyser: DB9 to OBD adapter cable 27·55 51.95
050146-11 Disk, project software 5.20 9.75 Mini ATMega Board
050146-41 AT90S2313-10PC, programmed 6.90 12.95 050176-1 PCB, includes adapter PCB 050176-2 8·95 16.85
Easy Home Control NO. 353 APRIL 2006
050233-11 Disk, project software 5.20 9.75
050233-41 PIC16F84, programmed 10.30 19.40 Simple recharable A Cell Analyser
Universal LCD Module 050394-1 PCB, bare 4·80 9.04
050259-11 Disk, project software 5.20 9.75 050394-11 Disk, PC Software 5·18 9.75
050259-41 AT90S2313, programmed 6.90 12.95 Universal SPI Box
1-Wire Thermometer with LCD 050198-41 AT89C2051-24PC, Programmed 7·25 13.65
060090-11 Disk, project software 5.20 9.75
060090-41 PIC16F84A-04CP, programmed 10.30 19.40
Order o
www.elektor-el
Order now using the Order Form in
the Readers Services section in this issue.

Onboard OBD-2 Analyser OBD-2 Analyser


(May 2006) (July/August 2005)
Kit of parts including PCB, programmed controller, compo-
Kit of parts including
nents (including IC7 ; IC3 = PCA82C250,
ATMega board, pro-
12 V), enclosure and RS232 cable.
gramming adapter
OBD cable not included.
board, preprogrammed
ATMega microcontrol- 050092-71
ler and all compo- £ 52.50 / $ 96.95
nents, but excluding
LC display and Case. OBD cable
050092-72
050176-72
£ 27.55 / $ 51.95
£ 24.80 / $ 46.70
ESR/C Meter
LCD-display (September 2005)
Kit of parts including PCB, default LCD module, 2x16
4 x 20 caracters, 60 x 98 mm, with background lighting
characters and programmed controllers.
050176-73
Enclosure not included.
£ 28.80 / $ 54.50
040259-71
£ 63.99 / $ 119.95
Case, Bopla Unimas 160
with Perspex cover and mounting plate
Matching enclosure
050176-74
040259-72
£ 15.80 / $ 29.90 £ 6.99 / $ 12.95

READY-BUILT PROJECTS £ $ GBPLC - Gameboy PLC


ClariTy 300-W Class-T Amplifier 050190-1+2 PCBs, bare, GBPLC Module & Programming Interface 11.70 22.00
030217-91 Amplifier board with SMDs pre-fitted; cores for L1 & L2 34·50 55.70 050190-51 Programmed PAL, EEPROM and Flash IC 11.00 20.75
050190-91 Ready-built and tested GBPLC Module and Programming Interface
Electrosmog Tester
050008-91 PCB, ready built and tested 50·00 94.25 GBPLC - I2C I/O Box
050008-71 Matching enclosure 10·25 19.30 060098-1 PCB, bare 17.90 33.75
060098-91 Ready-built and tested board
Flash Microcontroller Starter Kit
010208-91 Ready-assembled PCB incl. software, cable, adapter & related articles 69·00 112.50 Binary Clock
020390-11 disk, project software 5.20 9.75
Gameboy Digital Sampling Oscilloscope (GBated articles 103·00 020390-41 PIC6C54-04/P, programmed 8.05 15.10
183.00 NO. 355 JUNE 2006
LPC210x ARMee Development System
040444-91 Processor board, ready-made and tested 25·50 48.05 FM Stereo Test Transmitter
050268-1 PCB 11·70 22.00
Micro Webserver with MSC1210 Board
030060-91 Microprocessor Board, ready-assembled 75·90 142.95 Network Cable Analyser
044026-91 Network Extension Board, ready-assembled 44·50 83.95 050302-1 PCB 8·20 15.55
044026-92 Combined package (030060-91 & 044026-91 & related articles) 117·50 220.95 050302-11 Disk, PIC source code 5·20 9.75
050302-41 PIC16F874-20/P 16·90 31.85
NO. 356/357 JULY/AUGUST 2006
NO. 354 MAY 2006
RC Servo Tester/Exerciser
040172-11 Disk, project software 5.20 9.75 Onboard OBD-2 Analyser
040172-41 PIC16F84(A), programmed 10.30 19.40 050176-72 Kit of parts, incl. 050176-1, 050176-2, 050176-42, all components,
040172-71 Kit, incl. PCB, controller, all parts excl. LCD and Case 24.80 46.70
050176-73 LCD, 4x20 characters with backlight 28.80 54.50
LED Thermometer 050176-74 Case, Bopla Unimas 160 with Perspex cover and mounting plate 15.80 29.90
030190-11 Disk, project software 5.20 9.75 050176-42 ATmega16, programmed 10·30 19.45
030190-41 PIC16F873-20/SP, programmed 16.50 31.00 050092-71 OBD-2 Analyser: Kit of parts without cable 52·50 96.95
Toothbrush Timer 050092-72 OBD-2 Analyser: DB9 to OBD adapter cable 27·55 51.95
050146-11 Disk, project software 5.20 9.75 Mini ATMega Board
050146-41 AT90S2313-10PC, programmed 6.90 12.95 050176-1 PCB, includes adapter PCB 050176-2 8·95 16.85
Easy Home Control NO. 353 APRIL 2006
050233-11 Disk, project software 5.20 9.75
050233-41 PIC16F84, programmed 10.30 19.40 Simple recharable A Cell Analyser
Universal LCD Module 050394-1 PCB, bare 4·80 9.04
050259-11 Disk, project software 5.20 9.75 050394-11 Disk, PC Software 5·18 9.75
050259-41 AT90S2313, programmed 6.90 12.95 Universal SPI Box
1-Wire Thermometer with LCD 050198-41 AT89C2051-24PC, Programmed 7·25 13.65
060090-11 Disk, project software 5.20 9.75
060090-41 PIC16F84A-04CP, programmed 10.30 19.40
INFO & MARKET SNEAK PREVIEW
Every cop
Free!
y of th
Elektor Ele e September 200
ctronics w 6 issue of
RFID Reader MiFare RF ill
ID card fro come with a free
contains a mP
In the September 2006 issue we publish a small RFID reader that’s unique ID hilips. Each card
num
specially designed to extract information from MiFare RFID cards experimen ber for you to
(compliant with the ISO/IEC14443A standard). The circuit may be t with.
built as a stand-alone unit capable of reading the serial number of
an RFID card and displaying it on an LCD. A switching output on the
board allows, for example, a door to be opened when a certain
RFID serial number is decoded.
If you build the USB version you get PC connectivity which enables
additional information to be retrieved from the RFID card. The cir-
cuit is built around a Philips 89LPC935 microcontroller.

Theme Plan for 2006


January . . . . . . .Recycling / Reverse Engineering
USB/DMX-512 Interface February . . . . . .Motors / Propulsion
March . . . . . . . .Development / Microcontrollers
The DMX512 system is increasingly used to control complex (stage)
April . . . . . . . . .Power Supplies / Safety
lighting systems used not only by professionals but also by amateur
May . . . . . . . . .Soldering / Etching
drama groups. Lots of lighting gear, floodlights and so on, comes with
June . . . . . . . . .Test & Measurement
a DMX512 interface incorporated. To be able to control DMX512 com-
July/August . . . .Summer Circuits
patible devices, your PC needs to have a dedicated interface connected
September . .RFID / Satellites
to one the serial ports. The circuit we present employs the modern USB
October . . . . . . .E-Simulation
interface and is remarkably compact. An XLR connector at the output
November . . . . .Chipcards / Security
provides the connection path to the available DMX network.
December . . . . .Electromechanical / Enclosures

RESERVE YOUR COPY NOW! The September 2006 issue goes on sale on Thursday 24 August 2006 (UK distribution only).
UK mainland subscribers will receive the magazine between 18 and 22 August 2006. Article titles and magazine contents subject to change, please check our website.

NEWSAGENTS ORDER FORM


SHOP SAVE / HOME DELIVERY
Please save / deliver one copy of Elektor Electronics magazine for me each month

Name: ............................................
Address: ............................................
Please cut out or photocopy this form, com-
Post code: ............................................ plete details and hand to your newsagent.
Telephone: ............................................ Elektor Electronics is published on the third
Date: ............................................ Friday of each month, except in July.
Signature: ............................................ Distribution S.O.R. by Seymour (NS).

www.elektor-electronics.co.uk www.elektor-electronics.co.uk www.elektor-electronics.c


Elektor Electronics on the web
All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can
be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, cir-
cuit boards, programmed ICs and corrections and updates if applicable.
Complete magazine issues may also be downloaded.

In the Elektor Electronics Shop you’ll find all other products sold by the pub-
lishers, like CD-ROMs, kits and books. A powerful search function allows you
to search for items and references across the entire website.

Also on the Elektor Electronics website:


• Electronics news and Elektor announcements
• Readers Forum,
• PCB, software and e-magazine downloads
• Surveys and polls
• FAQ, Author Guidelines and Contact

148 elektor electronics - 7-8/2006


Order Form
Please supply the following. For PCBs, front panel foils, EPROMs, PALs, GALs, microcontrollers and diskettes, state the part number and

07/08-2006
description; for books, state the full title; for photocopies of articles, state full name of article and month and year of publication.
PLEASE USE BLOCK CAPITALS.

Description Price each Qty. Total Order Code


METHOD OF PAYMENT
(see reverse before ticking as appropriate)
Visual Basic for Electronics Bank transfer
Engineering Applications
NEW £ 27.50
Cheque
(UK-resident customers ONLY)
Microcontroller Basics £ 18.70 Giro transfer
CD-ROM Elektor 2005 £ 16.25
CD-ROM Home Automation £ 12.95

Expiry date: .................................................

Verification code: .........................................

SWITCH ONLY:
Start date: ....................................................

Issue number: ..............................................

Sub-total
Prices and item descriptions subject to change. Please send this order form to *
The publishers reserve the right to change prices (see reverse for conditions)
without prior notification. Prices and item descriptions
P&P
shown here supersede those in previous issues. E. & O.E.
Total paid Elektor Electronics (Publishing)
Regus Brentford
1000 Great West Road
Brentford TW8 9HH
Name
United Kingdom
Tel.: (+44) (0) 208 261 4509
Address + Post code
Fax: (+44) (0) 208 261 4447
Internet: www.elektor-electronics.co.uk
[email protected]
*USA and Canada residents may
(but are not obliged to)
Tel. Email use $ prices, and send the order form to:
Old Colony Sound Lab
P.O. Box 876, Peterborough

Date – – 2006 Signature NH 03458-0876. Tel. (603) 924-6371, 924-6526,


Fax: (603) 924-9467


EL07/08 Email: [email protected]
Order Form
07/08-2006

Yes, I am taking out an annual subscription METHOD OF PAYMENT


(see reverse before ticking as appropriate)
to elektor electronics and receive a free Bank transfer
1 W Luxeon LED Torchlight. Cheque
(UK-resident customers ONLY)

I would like: Giro transfer

Standard Subscription (11 issues)


Subscription-Plus
(11 issues plus the Elektor Volume 2006 CD-ROM)

* Offer available to Subscribers who have not held a subscription Expiry date: .................................................
to Elektor Electronics during the last 12 months. Offer subject to availability.
See reverse for rates and conditions. Verification code: .........................................

SWITCH ONLY:
Start date: ....................................................
Name
Issue number: ..............................................
Subscription

Address + Post code


Please send this order form to

Elektor Electronics (Publishing)


Regus Brentford
1000 Great West Road
Tel. Email Brentford TW8 9HH
United Kingdom
Date – – 2006 Signature Tel.: (+44) (0) 208 261 4509

* cross out what is not applicable Fax: (+44) (0) 208 261 4447
Internet: www.elektor-electronics.co.uk
EL07/08 [email protected]
ORDERING INSTRUCTIONS, P&P CHARGES

Except in the USA and Canada, all orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address
using the Order Form overleaf. On-line ordering: http://www.elektor-electronics.co.uk
Readers in the USA and Canada may (but are not obliged to) send orders, except for subscriptions (for which see below),
to the USA address given on the order form. Please apply to Old Colony Sound for applicable P&P charges. Please allow 4-6 weeks for delivery.
Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows:
UK: £4.00 Europe: £5.00 (Standard) or £7.00 (Priority) Outside Europe: £8.00 (Standard) or £12.00 (Priority)

HOW TO PAY

All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff.

Bank transfer into account no. 40209520 held by Elektor Electronics (Publishing) / Segment b.v. with ABN-AMRO Bank, London. IBAN: GB35
ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us.
Cheque sent by post, made payable to Elektor Electronics (Publishing) / Segment b.v.. We can only accept sterling cheques and bank drafts
from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country.
Giro transfer into account no. 34-152-3801, held by Elektor Electronics (Publishing) / Segment b.v. Please do not send giro transfer/deposit
forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre.
Credit card VISA, Access, MasterCard, JCBCard and Switch cards can be processed by mail, email, web, fax and telephone. Online ordering
through our website is SSL-protected for your security.

COMPONENTS

Components for projects appearing in Elektor Electronics are usually available from certain advertisers in this magazine. If difficulties in the supply
of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive.

TERMS OF BUSINESS

Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this
time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our
consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the
goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be
received at our Brentford office within 10-days (UK); 14-days (Europe) or 21-days (all other countries). Cancelled orders All cancelled orders
will be subject to a 10% handling charge with a minimum charge of £5·00. Patents Patent protection may exist in respect of circuits, devices,
components, and so on, described in our books and magazines. Elektor Electronics (Publishing) does not accept responsibility or liability for failing
to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits,
diskettes and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be
reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission
of Elektor Electronics (Publishing) in writing. Such written permission must also be obtained before any part of these publications is stored in
a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior
permission. Limitation of liability Elektor Electronics (Publishing) shall not be liable in contract, tort, or otherwise, for any loss or damage suffered
by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor Electronics (Publishing) other
than to supply goods as described or, at the option of Elektor Electronics (Publishing), to refund the purchaser any money paid in respect of the goods.
Law Any question relating to the supply of goods and services by Elektor Electronics (Publishing) shall be determined in all respects by the laws
of England. January 2006

SUBSCRIPTION RATES FOR ANNUAL


SUBSCRIPTION

Standard Plus
United Kingdom £41.90 £48.80
Surface Mail
Rest of the World £54.50 £61.40
USA & Canada US$ 95.50 US$106.50
Airmail
Rest of the World £68.90 £75.80
USA & Canada US$120.00 US$131.00

HOW TO PAY SUBSCRIPTION CONDITIONS

Bank transfer into account no. 40209520 held by Elektor Electronics The standard subscription order period is twelve months. If a perma-
(Publishing) / Segment b.v. with ABN-AMRO Bank, London. IBAN: GB35 nent change of address during the subscription period means that
ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). copies have to be despatched by a more expensive service, no extra
Please ensure your full name and address gets communicated to us. charge will be made. Conversely, no refund will be made, nor expiry
date extended, if a change of address allows the use of a cheaper
Cheque sent by post, made payable to Elektor Electronics (Publishing) service.
/ Segment b.v.. We can only accept sterling cheques and bank drafts Student applications, which qualify for a 20% (twenty per cent) reduc-
from UK-resident customers or subscribers. We regret that no cheques tion in current rates, must be supported by evidence of studentship
can be accepted from customers or subscribers in any other country. signed by the head of the college, school or university faculty. A
standard Student Subscription costs £33.50, a Student Subscription-
Giro transfer into account no. 34-152-3801, held by Elektor Plus costs £40.40 (UK only).
Electronics (Publishing) / Segment b.v. Please do not send giro transfer/ Please note that new subscriptions take about four weeks from receipt
deposit forms directly to us, but instead use the National Giro postage of order to become effective.
paid envelope and send it to your National Giro Centre. Cancelled subscriptions will be subject to a charge of 25% (twenty-
five per cent) of the full subscription price or £7.50, whichever is the
Credit card VISA, Access, MasterCard, JCBCard and Switch cards can higher, plus the cost of any issues already dispatched. Subsciptions
be processed by mail, email, web, fax and telephone. Online ordering cannot be cancelled after they have run for six months or more.
through our website is SSL-protected for your security. January 2006
ISBN 0-905705-68-8
496 pages
£27.50 / US$ 51.50
Visual Basic
New

for Electronics Engineering Applications


This book is targeted towards those people that want to control
existing or home made hardware from their computer. After familia-
rizing yourself with Visual Basic, its development environment and
the toolset it offers are discussed in detail. Each topic is accompanied
by clear, ready to run code, and where necessary, schematics are
provided that will get your projects up to speed in no time. Order now using the Order Form in the
Readers Services section in this issue.
This book discusses tools like Debug to find hardware addresses, set-
ting up remote communication using TCP/IP and UDP sockets, writing
Elektor Electronics (Publishing)
your own internet servers and even connecting your own block of
Regus Brentford
hardware over USB or Ethernet and controlling it from Visual Basic.
1000 Great West Road
All examples are ready to compile using Visual Basic 5.0, 6.0, NET Brentford TW8 9HH
or 2005. Extensive coverage is given on the differences between what United Kingdom
could be called Visual Basic Classic and Visual basic .NET / 2005. Tel. +44 (0) 208 261 4509

See also www.elektor-electronics.co.uk

INDEX OF ADVERTISERS
ATC Semitec Ltd, Showcase . . . . . . . . . .www.atcsemitec.co.uk . . . . . . . . . . . . . . . . . .142 Lascar . . . . . . . . . . . . . . . . . . . . . . . . . . .www.lascarelectronics.com . . . . . . . . . . . . . . . .8

Audioxpress, Showcase . . . . . . . . . . . . . .www.audioxpress.com . . . . . . . . . . . . . . . . . .142 Lichfield Electronics . . . . . . . . . . . . . . . . .www.lichfieldelectronics.co.uk . . . . . . . . . . . . .27

Avit Research, Showcase . . . . . . . . . . . . .www.avitresearch.co.uk . . . . . . . . . . . . . . . . .142 London Electronics College, Showcase . .www.lec.org.uk . . . . . . . . . . . . . . . . . . . . . . . .143

Beijing Draco Electronics . . . . . . . . . . . . .www.EzPCB.com . . . . . . . . . . . . . . . . . . . . . .137 Microchip . . . . . . . . . . . . . . . . . . . . . . . .www.microchip.com . . . . . . . . . . . . . . . . . . . . . .3

Beta Layout, Showcase . . . . . . . . . . . . . .www.pcb-pool.com . . . . . . . . . . . . . . . . .137, 142 MQP Electronics, Showcase . . . . . . . . . .www.mqpelectronics.co.uk . . . . . . . . . . . . . . .143

Bitscope Designs . . . . . . . . . . . . . . . . . .www.bitscope.com . . . . . . . . . . . . . . . . . . . . . . .9 New Wave Concepts, Showcase . . . . . . .www.new-wave-concepts.com . . . . . . . . . . . .143

Breadboarding Systems . . . . . . . . . . . . . .www.breadboarding.co.uk . . . . . . . . . . . . . . . . .7 Newbury Electronics . . . . . . . . . . . . . . . .www.newburyelectronics.co.uk . . . . . . . . . . . . . .6

ByVac . . . . . . . . . . . . . . . . . . . . . . . . . . .www.byvac.co.uk . . . . . . . . . . . . . . . . . . . . . .135 Number One Systems . . . . . . . . . . . . . . .www.numberone.com . . . . . . . . . . . . . . . . . . . . .8

Compulogic, Showcase . . . . . . . . . . . . . .www.compulogic.co.uk . . . . . . . . . . . . . . . . . .142 Nurve Networks . . . . . . . . . . . . . . . . . . . .www.xgamestation.com . . . . . . . . . . . . . . . . . . .6

Conford Electronics, Showcase . . . . . . . .www.confordelec.co.uk . . . . . . . . . . . . . . . . . .142 PCB World, Showcase . . . . . . . . . . . . . . .www.pcbworld.org.uk . . . . . . . . . . . . . . . . . . .143

Cricklewood . . . . . . . . . . . . . . . . . . . . . . .www.cctvcentre.co.uk . . . . . . . . . . . . . . . . . . .139 Peak Electronic Design . . . . . . . . . . . . . . .www.peakelec.co.uk . . . . . . . . . . . . . . . . . . . .137

Danbury, Showcase . . . . . . . . . . . . . . . . .www.DanburyElectronics.co.uk . . . . . . . . . . . .142 Pico . . . . . . . . . . . . . . . . . . . . . . . . . . . . .www.picotech.com . . . . . . . . . . . . . . . . . . . . . .27

Design Gateway, Showcase . . . . . . . . . . .www.design-gateway.com . . . . . . . . . . . . . . .142 Quasar Electronics . . . . . . . . . . . . . . . . . .www.quasarelectronics.com . . . . . . . . . . . . . .136

Eaglepics, Showcase . . . . . . . . . . . . . . . .www.eaglepics.co.uk . . . . . . . . . . . . . . . . . . .142 Robot Electronics, Showcase . . . . . . . . . .www.robot-electronics.co.uk . . . . . . . . . . . . .143

Easysync, Showcase . . . . . . . . . . . . . . . .www.easysync.co.uk . . . . . . . . . . . . . . . . .10, 142 Showcase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142, 143

SK Pang Electronics, Showcase . . . . . . . .www.skpang.co.uk . . . . . . . . . . . . . . . . . . . . .143


Elnec, Showcase . . . . . . . . . . . . . . . . . . .www.elnec.com . . . . . . . . . . . . . . . . . . . . . . .142
Sytronic Technology, Showcase . . . . . . . .www.m2mtelemetry.com . . . . . . . . . . . . . . . .143
Eurocircuits . . . . . . . . . . . . . . . . . . . . . . .www.thepcbshop.com . . . . . . . . . . . . . . . . . . . .6
Ultraleds, Showcase . . . . . . . . . . . . . . . .www.ultraleds.co.uk . . . . . . . . . . . . . . . . . . . .143
First Technology Transfer Ltd, Showcase .www.ftt.co.uk . . . . . . . . . . . . . . . . . . . . . . . . .142
University of Derby . . . . . . . . . . . . . . . . . .www.vertigo.derby.ac.uk . . . . . . . . . . . . . . . . .135
Future Technology Devices, Showcase . . .www.ftdichip.com . . . . . . . . . . . . . . . . . . .11, 142
USB Instruments, Showcase . . . . . . . . . .www.usb-instruments.com . . . . . . . . . . . . . . .143
Futurlec, Showcase . . . . . . . . . . . . . . . . .www.futurlec.com . . . . . . . . . . . . . . . . . . . . . .142
Virtins Technology, Showcase . . . . . . . . .www.virtins.com . . . . . . . . . . . . . . . . . . . . . . .143
Heros Technology, Showcase . . . . . . . . . .www.herostechnology.co.uk . . . . . . . . . . . . . .142

Ipeva Limited, Showcase . . . . . . . . . . . . .www.ipeva.com . . . . . . . . . . . . . . . . . . . . . . .142


Advertising space for the issue of 19 September 2006
Jaycar Electronics . . . . . . . . . . . . . . . . . .www.jaycarelectronics.co.uk . . . . . . . . . . . . . . . .2
may be reserved not later than 22 Augustus 2006
JLB Electronics, Showcase . . . . . . . . . . .www.jlbelectronics.com . . . . . . . . . . . . . . . . .143 with Huson International Media – Cambridge House – Gogmore Lane –
Chertsey, Surrey KT16 9AP – England – Telephone 01932 564 999 –
KMK Technologies Ltd, Showcase . . . . . .www.kmk.com.hk . . . . . . . . . . . . . . . . . . . . . .143
Fax 01932 564998 – e-mail: [email protected] to whom all
Labcenter . . . . . . . . . . . . . . . . . . . . . . . .www.labcenter.co.uk . . . . . . . . . . . . . . . . . . . .152 correspondence, copy instructions and artwork should be addressed.

7-8/2006 - elektor electronics 151

You might also like