www.elektor.com OKTOBER2008 aus$12.90-nz$15.50-sar 84.95 -us$ 9.95 £3.90 FAST NI-MH BATTERY CHARGER KIT KC-5453 £1 1 .75 plus postage & packing A truly versatile charger, capable of handling up to 15 of the same type of Ni-MH or Ni-Cd cells. Build it to suit any size cells or cell capacity and set your own fast or trickle charge rate. It also has overcharge protection including temperature sensing. Ideal for R/C enthusiasts who burn through a lot of batteries. • Kit includes PCB and all specified electronic components. • Case, heatsink and battery holder not included. IMPROVED LOW VOLTAGE ADAPTOR TOOLS & ACCESSORIES QM-1323 DMM £10.00 plus postage & packing A budget priced meter with everything you need - capacitance, temperature and 1 0A on AC and DC, compact and light weight with rugged moulded case. • Data hold • Temp range: -20° to 760°C • Case included • Category: Cat III 600V • Display: 4000 count • Ave/RMS: True RMS • 1 37(H) x 65(W) x 35(D)mm • For full specs see our website a ► -i / POWERTOOL BATTERY CHARGER KIT KC-5436 £1 1 .75 plus postage & packing Enhance the performance of the charger supplied with your power tool with this controller. It incorporates charge timeout, min and max temperature monitoring, Delta charge detection, power and charge LED indicator, adjustable Delta V, temperature settings, and optional adjustable trickle charge. Suits both Ni-Cd and Ni-MH cells. • Kit includes PCB with overlay, case, all electronic components and clear English instructions. AMPLIFIER MODULES @ KC-5470 £26.25 plus P&P distortion amplifier module uses the new ThermalTrak power transistors and is largely based on the high-performance Class-A amplifier. This improved circuit has no need for a quiescent current adjustment or a Vbe multiplier transistor and has an exceptionally low distortion figure. BATTERY ZAPPED KIT MK II • 3 soldering tips • 1 torch attachment • 1 rope cutter FRFF RATA! (1CHF POST & PACKING CHARGES HOW TO ORDER Checkout Jaycar’s extensive range We have kits & electronic projects for use in: • Audio & Video • Car & Automotive • Computer • Lighting • Power • Test & Meters • Learning & Educational • General Electronics Projects • Gifts, Gadgets & Just for fun! For your FREE catalogue logon to www.jaycarelectronics.co.uk/catalogue or check out the range at www.jaycareiectronics.co.uk jaycarelectronicsxo.uk Order Value Cost £10 -£49.99 £5 £50 -£99.99 £10 £100 - £199.99 £20 £200 - £499.99 £30 £500+ £40 Max weight 121b (5kg). Heavier parcels POA. Minimum order £10. • ORDER ON-LINE: www.jaycarelectronics.co.uk • PHONE: 0800 032 7241* •FAX: +61 2 8832 3118* • EMAIL: techstore@jaycarelectronics.co.uk • POST: P.O. Box 107, Rydalmere NSW 21 1 6 Australia • ALL PRICING IN POUNDS STERLING • MINIMUM ORDER ONLY £10 *Australian Eastern Standard Time (Monday - Friday 09.00 to 17.30 GMT + 10 hours only) Expect 10-14 days for air parcel delivery Note: Products are despatched from Australia, so local customs duty & taxes may apply. Prices valid till 31/10/08 • Kit supplied with PCB and all electronic components. • Heatsink and power supply not included. • Output Power: 135WRMS into 8 ohms and 200WRMS into 4 ohms • Frequency Response at 1 W: 4Hz to 50kHz • Harmonic Distortion: <0.008% from 20Hz to 20kHz KC-5463 £4.50 plus postage & packing This handy regulator wi let you run a variety of devices such as CD, DVD or MP3 players from your car cigarette lighter sockets, even a digital camera or powered speakers from the power supply inside your PC. This unit can supply 3 V, 5 V, 6V, 9V, 1 2 V or 1 5 V from a higher input voltage at up to four amps (with suitable heatsink). • Kit includes screen printed PCB and all specified components. Heatsink not included. KC-5471 £16.00 plus post & packing The amp module (KC-5470) is powered using an unregulated rail only. This power supply kit is specifically designed to provide a balanced +/- 55VDC supply to power this fantastic amp kit. It has two LEDs, which illuminate when power is present on the rails and the assist in slowly discharging the filter caps when power is switched off. • Kit includes PCB and all electronic components. KC-5427 £29.00 plus postage & packing This kit attacks a common cause of failure in wet lead acid cell batteries: sulphation. The circuit produces short bursts of high level energy to reverse the damaging sulphation effect. This improved unit features a battery health checker with LED indicator, new circuit protection against badly sulphated batteries, test points for a DMM & connection for a battery charger. • Kit includes case with screen printed lid, PCB overlay and all electronic components with clear English instructions. • Suitable for 6, 1 2 and 24V batteries • Powered by the battery itself QM-3532 HOBBYIST’S MAGNIFIER £8.50 plus postage & packing This handy magnifier has a 2 times main magnifier lens with 5 times insert lens and 2 LED lights mounted on a flexible arm. Can be free-standing or clamped to a surface up to 38mm thick. • Lens 1 10mm (dia.) • Includes protective lens pouch Requires 3 x AAA batteries (Use SB-2413) TS-1112 GAS SOLDERING IRON £8.50 plus postage & packing Everything you need to solder; silver solder, braze, heatshrink, strip paint etc. Refillable with stand, extra tips, torch and cutting attachment. A £jJJ mmmmmamm jnycar USB 20 IN-CIRCUIT High-Performance On-Board Programmer utvtuai-Mtn i BOARD PIC develop- ment system Thanks to man JKw features, you can start creating your greafgPvices immediate- ly. ^Sports 8-, 14-, 18-, 20-, 28- and 40- pin PlCrrriierocontrollers (it comes with the PTC16F887). The (Hardware In-circuit Debugger) enables very efficient step by step debugging. Examples in , , and language are provided with the board. EasyPIC5 comes with the following printed documentation: EasyPIC5 Manual, PICFIash2 Manual and mikrolCD Manual. Also EasyPIC5 is delivered with USB and Serial cables needed for connecting with your iffifi - Hardware In- bugger on-board enables easy debugging EasyPIC is a world-class tool that AtllAlA iIaAIAA Evolving product features and modern input design require the use of touch screens. The with connector available on EasyPIC5 is a with the ability to display and receive information on the same display. It allows a display to be used as an input device. Simple installation onto the face of a GLCD for easy connection to EasyPIC5 board with built-in Touchscreen Controller and Connector. SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD mikroElektronika DEVELOPMENT TOOLS | COMPILERS | BOOKS Find your distributor: UK, USA, Germany, Japan, France, Greece, Turkey, Italy, Slovenia, Croatia, Macedonia, Pakistan, Malaysia, Austria, Taiwan, Lebanon, Syria, Egypt, Portugal, India, Thailand, Taiwan, Czech and Slovak Republic. http://www.mikroe.com/ I e kt o r electronics worldwide Go with the Reflow Do-it-yourself SMD reflow oven controllers were published in the January 2006 and December 2007 issues of Elektor — and what a response they got from you! To us it was just another proof that surface mount technol- ogy (SAAT), however sneaky for tininess, is 'hot' and does not stop many Elektor readers from slap- ping together the odd circuit using this technology. Not forgetting schools and small labs of course, which at some point will feel a compelling need to start 'baking' circuits. Because Elektor is not your usual paper-churning publishing house we set out to find a ready-made SMT reflow oven, specifically one with improved accuracy and control as compared with a modified pizza oven, and suitable for retailing to our readers. Our quest for an apt product quickly took us into China but it was not without pitfalls like CE and RoHS approvals, flaky manuals, deep seas, high winds and customs red tape for container loads of ovens. We managed to pull it off however and proudly present the Elektor SMT Reflow Oven. It is our belief that this tool will empower many an electronics enthusiast to securely exploit SMT / SMD / SMA and provide a new impulse to his or her activities in the field of electronics. In good Elektor tradition the use of the oven is backed up with illustrated theory and hands-on information to enable you all to master virtually every aspect of SMT assembly: workshops, maga- zine articles, gizmos and tools — all in the pipeline! Alongside the heavy coverage of the SMT Oven in th is issue the lab and editorial teams have again managed to produce many pages worth of projects and articles that hopefully provide an incentive to solder and assemble, learn about new products and technologies, or just while away for a few hours browsing the pages (in offices too!). There sure is something for everyone. Wisse Hettinga International Editor In this cluster of articles we cover not just the ins & outs of the new Elektor SMT oven but also how to deal with those tiny components you just can't afford to ignore anymore for up to date circuit board design and manufacturing. We also cover the past and future of SMT and present a handy guide to preparing boards for reflow soldering. Come see us at: - AES Convention, San Francisco, October 2-5 - Embedded Systems, Boston, October 27-30 Audio Amateur Inc. / Elektor USA booth u 34 Multi-purpose GPS Receiver Stand-alone GPSs when teamed them up with suitable electronics can perform our positioning or navigation tasks just as accurately as manufactured products everyone seems to have in their cars recently. This article shows how to get two such devices up and running. Despite the fact that the CAN protocol is a serial protocol, it can't just be connected to (the serial port of) a computer. The all-round USB-CAN adapter described here provides a compact and simple solution! CONTENTS Volume 34 October 2008 no. 382 projects Elektor SMT Precision Reflow Oven Before Baking... Baking... Multi-purpose GPS Receiver Communicating with CAN BASCOM AYR Course (2) RF Sweep Frequency Generator / Spectrum Analyser ATM1 8 Relay Board Design Tips Testing Trailer Connectors PeDAI Power RF Sweep Frequency Generator / The instrument described in this article combines the functions of a sweep frequency generator and a spectrum analyser. In the SFG mode, it can be used to measure the frequency characteristics of selective components or circuits at frequencies up to 450 MHz. 18 22 70 Now that our ATM1 8 project with the levitating magnet in the previous issue has become truly active, we can use a relay board to implement even more external effects. 75 76 technolo The SMD Success Story SMT of the Future Two Low Cost Scopes info & market Colophon Mailbox News & New Products Elektor SHOP Sneak Preview infotainment Hexadoku Retronics: Elektor TV Games Compu- ter (1979) ELECTRONICS WORLDWIDE elektor international media Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. ektor GtWMC TMiNT SATISFACTOI circuits, Ideas Volume 34, Number 382, October 2008 ISSN 1757-0875 Elektor aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 1 1 times a year with a double issue for July & August. Elektor is also published in French, Spanish, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Hettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff: Harry Baggen, Thijs Beckers, Ernst Krempelsauer, Jens Nickel, Guy Raedersdorf, Clemens Valens. Design stc Antoine Authier (Head), Ton Giesberts, Luc Lemmens, Daniel Rodrigues, Jan Visser, Christian Vossen Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DT Giel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Customer Services: Anouska van Ginkel Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com 6 elektor - 10/2008 Visit China with E ektor combine electronics and culture "3 v ants r Elektor s second Study Trip to China is planned for 9-18 November 2008. And you can join us! Check your diary today and visit the Elektor website for more detailed information. J Jii turn? More info, programme and registration at www.elektor.com/china During this 10-day trip we will visit the China Electronics Fair in Shanghai, a professional industrial electronics fair with an area of no less than 60,000 m 2 . We will also pay at least one visit to the well-known 'electronics high street' in Shanghai. As the name suggests, this street is entirely dedicated to electronics shops, each vying to be the largest. In addition, a variety of interesting company visits are on the itinerary (with a tour of the production department). We are also organising a business conference where you can obtain a wealth of information about doing business (and how not to do business) in China. Naturally, there's also time for culture. We will visit the Forbidden City, Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form Head Office: Elektor International Media b.v. P.0. Box 1 1 NL-61 1 4-ZG Susteren The Netherlands Telephone: (+31 ) 46 4389444, Fax: (+31 ) 46 43701 61 Distribution: Seymour, 2 East Poultry Street, London EC1A, England Telephone:+44 207 429 4073 UK Advertising Huson International Media, Cambridge House, Gogmore Lone, Chertsey, Surrey KT1 6 9AP, England. Telephone: +44 1932 564999, Fax: +44 1932 564998 Email: p.brody@husonmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photo- graphs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Elektor International Media b.v. and may not be reproduced or transmitted in any form or by any means, including photocopy- ing, scanning an recording, in whole or in part without prior written permission from the Publisher. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may ex- ist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guarantee to return any mate- rial submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media b.v. 2008 Printed in the Netherlands 10/2008 - elektor 7 INFO & MARKET MAILBOX Free LED Driver Dear Editor — I've been an Elektor subscriber for over 30 years and still enjoy every copy. The September 2007 issue came with a free LED driver board, and in the accompany- ing article I read that the board could be used with several LEDs in series. Being a model railway enthusiast, it struck me that that the little board might be used for by Faller coach model. The coach contains a 2.4-V battery (2 off 1 .2 V rechargeables) I thought I could use for vehicle lighting comprising four LEDs. After a few quick tests the circuit worked just fine with four LEDs, however the 2.4-volt supply voltage caused start failures on occasions. I lowered the supply using two diodes and then the circuit worked perfectly. The schematic shows the complete circuit of the coach with the LED driver and the LEDs and the photo shows the results. Thanks for the board I got from you at no charge. Fred van Etteger (Netherlands) LED wt LED «rtt [y IED rood 2nni \ji LED rood 2i»m A brilliant application , Fred , thanks for that. However ; two dio- des in series to reduce the driver supply voltage seems wasteful — one diode would be tight on the maximum supply voltage , so it all looks quite critical. It may be an idea to connect two LED drivers in series , although admittedly we have not tried this ourselves. Ring Flash Dear Elektor — from an old tech, a big "thank you guys" for a consistently excellent magazine. The Ringflash article (Febru- ary 2008) is really inspiring, however there two minor errors on the circuit for the Kodak disposable flash, Fig. 1 on page 52. - the label for the 300 Volts output should read V- Flash (300 V). The inverter section is negative-ground, but like many of these units the high-volt- age section is positive-ground — the main electrolytic is shown correctly. — in the (discarded) trigger section, what is shown as the second neon, NE2, is in fact the (300>350V!) shutter flash trigger contacts. When I asked the local photo processor for a used dispos- able camera I had twenty forced on me! Several different brands! There is considerable variation in physical form, cir- cuit, quality, and accessibility, with the Kodak being one of the better and more common. This pile contains not only working flash units; but at least, an almost fresh alkaline AA battery, a LED or neon, a 350 V low-ESR electro- lytic of 80 to 160 |jF, one 22 nF/350V, and a high-volt- age diode, etc.; plus several different lenses, and some springs. This trove will help considerably with my next valve guitar amp build. Application of a hot-air paint- stripping gun to a few old computer boards has yielded a snowstorm of useful compo- nents; dead PC power supplies (also available free) have 80 to 90% recoverable compo- nents, and the cases make good project platforms. What do you do with the hands-free set, squashed $600 digital camera, and 1 GByte flash drive you found in the street? And all this normally goes into landfill rather than recycling — what a terrible everyday waste of useful electronic stuff, free for the asking. Roly Roper (Austral a) As you may have gathered from the 'Modding & Tweaking' series of articles by various authors , we also enjoy taking apart the odd bit of defunct electronics , if only out of curiosity how stuff can be made so cheaply. When I was young I picked up the odd TV set or radio from the street before garbage collection day. This grot' as my parents called it, actually provided a good stock of electronic components to reuse in my own projects. Compact fluorescent lamps (2) Dear Sir — I read with great interest the letter by Andrew Denham on Compact Fluo- rescent lamps ( Mailbox , May 2008). I would like to add two things to the discussion on this CFLs and light sources. I would like to see a dimma- ble CFL system. I have used special dimmers and chokes to control 'normal' fluorescent tubes with mediocre results. For CFLs, a special wall dim- mer that signals to the lamp's control electronics would need to be designed to replace the standard phase control dimmer unit. There is a new light source available: the Luxim Plasma Light. The LIFI (TM) is a pill-sized plasma light with an output of some 140 lumens per watt. Further information may be found at: www.lifi.com/ pdfs/T TechBriefHowLIFIWorks.pdf The review by Treehugger is also worth mentioning: www.treehugger.com/ files/2008/04/luxim-plasma- lifi-light-bulb-led-cfl.php I hope that my comments are of interest. Ian Goodall (UK) Very useful remarks and additi- ons there Ian, many thanks. Wiring up Dear Editor — now over 40 years ago I managed without too much of a problem to wire up a control panel for control- ling the then cutting edge technology of the teleprinter network and needing some 2240 separate wires and some 1 20 control switches. As far as I remember I only made one wiring error and that took all of 30 minutes to put right. I now want to use the out- put of a computer mouse or similar to drive a display to show the movement of the table on a milling machine in my workshop. I did have the absurd thought that by simply walking to a spectialist dealer and asking for bits that would 8 elektor - 10/2008 ted in 2004. PFC is only required in Class D equipment and no lon- ger in Class A which covers audio gear. Class-A and Class-D, by the way , are not related to the design of the ampli- fier. work together I could with only minimum difficulty arrive at the right set of components. This it now looks is impossible no one publishes in any form a list or book saying the output of which component will be okay as the input to the next compo- nent in the chain. In my case the output of the mouse or coder will be okay as an input to the driver for the display. Could either you or another reader please let me in on the secret of how it is done? With the vast quantity of various components available in the market place it would take for ever to line up the various parameters! Phil Pumphrey (UK) Yes Phil the days of simple elec- tronics seem to have vanished 'not with a bang , but a whisper' to quote a great poet. If readers are able to help Phil , write to the Editor , please. Improving the Mugen amplifier Dear Editor — I believe the lin- earity of cathode follower V2a in the Mugen amplifier ( Elektor October 2007, Ed.) may be improved by connecting the lower end of R 7 (22kQ) to output of the amplifier (junction 21 ,22) instead of to ground. The modification enables R7 to function as a real current source, reducing the current fluctuations in the ECC88. The result is better cathode tracking and reduced distortion. Guido Tent (Netherlands) Thanks for the tip Guido , we spread the word and hope Mugen constructors will find it useful. SAPS-400 Dear Elektor — this is to express my disappointment with the article on the SAPS- 400 power supply published in the June 2008 issue of Ele- ktor. Firstly, the supply has no power factor correction (PFC) hence does not reflect state of the art technology, especially for such high power. Secondly, a components list and detailed construction guidance is missing. The article says "There are many more considerations to be kept in mind during the design, such as Eddy currents, varnishing to avoid vibration or mechanical noises, etc, but these fall out of the scope of this description." This seems somewhat contradictory to me as you first mention the aspects to be taken into considera- tion and then decide not to describe them in detail. This makes me wonder about the purpose of publishing the article as it looks like a description of a commercial item for sale only. J.H. Stil (Netherlands) Sorry to read you did not like the article. Others did, and we tried to make it as interesting as pos- sible for our wide readership. Concerning the PFC aspect , the author's research indicates that many changes in equipment classification were implemen- Consequently there is no legal requirement to provide for PFC in the SAPS-400 — and even if it were , it would only apply to equipment with a total power exceeding 75 watts. The effec- tive power of audio equipment is taken as I /8th of the maximum power ; i.e. 50 watts in the case of the SAPS-400 and well below the limit. None the less , PFC may be implemented in future versi- ons of the supply. There is no parts list as argua- bly this project is not suitable for home construction from parts. The custom wound transformers and other special components are hard to obtain as one-offs and even a kit of parts would cost more than the ready-assem- bled module. Besides , there are also electrical safety aspects to consider. Details on incorpora- ting the unit in equipment are included with the module , as well as available online from our website , together with some measurement results. The purpose of the text you quote from the article is to indicate just a few of the many aspects to be duly considered during design and test. The accompanying article 'Cool Power' and the free supplementary document from or website provide in-depth dis- cussions of the problems and pit- falls when designing an SMPSU for the specific purpose of powering audio amplifiers. The intention of the three articles is to explain the operation of the main circuit in the supply dis- cussing options available for designing a switch-mode power supply and providing an intro- duction into developing one's own power supplies. In view of the special character of this design and the fact that similar units are few and far between on the market we are confident of the interest in the articles as well as the SAPS-400 ready-made module available through the Elektor SHOP. Mai I Box Terms • Publication of reader's orrespondence is at the discretion of the Editor. • Viewpoints expressed by correspondents are not necessarily those of the Editor or Publisher. • Correspondence may be translated or edited for length, clarity and style. • When replying to Mailbox correspondence, please quote Issue number. • Please send your MailBox correspondence to: editor@elektor.com or Elektor, The Editor, 1 000 Great West Road, Brentford TW8 9HH, England. 10/2008 - elektor 9 INFO & MARKET NEWS & NEW PRODUCTS Mini-PCI and PCI video capture The new BVM MP-601 0 video cap- ture card is the latest addition to the family of mini-PCI and PCI form fac- tor cards that enable a PC to be used as the heart of a security/sur- veillance video system, processing and storing multiple input video feeds for later review and analy- sis. The MP-601 0 mini-PCI card is a high performance and cost-effec- tive board with four-channel video and audio inputs and a single video and audio output channel. The com- pression parameters for each input channel can be independently con- figured. It support 120 fps NTSC at 740x480 and 100 fps PAL at 704x576 formats, has program- mable OSG, MPEG4 and M-JPEG audio and vision compression and operates under Windows XP, Win- dows 2000 and Linux. Scode DVR software is supplied, enabling the PC display to be configured with different combinations of inputs and events such as motion image detection to genhas programma- ble OSG, MPEG4 and M-JPEG audio and vision compression and operates under Windows XP, Win- dows 2000 and Linux. Scode DVR software is supplied, enabling the PC display to be configured with different combinations of inputs and events such as motion image detection to generate an interrupt to bring the particular feed to the forefront of the display. The complete family consists of four mini-PCI boards ranging from a single input / output board to a 16 feed input unit; the five-strong PCI form factor units range from four input boards, expandable to manage 24 feeds, to eight input units, again expandable to man- age 24 feeds. www.bvmltd.co.uk (080713-1) Elektor trip to China: programme finalised Elektor's second study trip to China is beginning to take shape. After the flight on 9 November, a busy programme kicks off offering nine days worth of interesting meet- ings with the Chinese electronics industry. A new feature of the trip is a specially staged business con- ference where participants have an opportunity to contact repre- sentatives of the Chinese industry and government. On top of that, European experts on China report on their experiences, explaining points to pay attention to when doing business with Chinese partners. The trip also comprises a number of company tours. This time round some highly interesting electronics manufacturing companies will be visited, including Neways and Ximec, specialized not only in PCB manufacturing and finished products, but also in research and design (photograph: Neways com- pany presentation). Neways spe- cializes in hybrid technologies, covering circuit mounting on a ceramic carrier with the advan- tage of higher component density on boards. Test & measurement equipment manufacturer Rigol is best known for its low-cost oscillo- scopes, but also has signal genera- tors, digital multimeters and virtual instruments in its product range. Participants may visit production facilities in these and other compa- nies, which is not normally allowed to foreigners. The trip to China also comprises a visit to the China Electronics Fair, one of the five largest electronics exhibitions in all of Asia. Shang- hai's 'Electronics Highstreet' is of course not skipped - imagine a street worth's of every conceivable electronic component including all the latest microcontrollers, graphic displays and lots more. Last but not least, the trip offers sightsee- ing and a good deal of Chinese culture. Places available at the time of printing! www.elektor.com / china-trip www.neways.de www.rigolna.com (080693) World's first 0302 1.0 jj F 2-element capacitor array Murata has introduced the world's first 0.9x0. 6mm (0302) 1 .0 pF 2-element capacitor array, part number GNM0M2R60E 1 05M. This new 0302-size 2-element capacitor array has achieved 1 .0 pF per element, which is unprecedented even for a single 0.6x0. 3 mm (0201) device. Capacitor array products help to reduce mounting surface area and mounting costs compared to mounting multiple monolithic capacitors. Due to its structure, a capacitor array can achieve greater capacitance in the same footprint compared to multiple monolithic capacitors. By apply- ing Murata 's cutting-edge dielec- tric material technology, each ele- ment of the 0302 capacitor array is able to achieve 1 pF with higher capacitance than current tech- nology allows for a single 0201 ceramic capacitor. The GNM0M2R60E1 05M capaci- tor array is suitable for general use although the 1 pF model is typically used as a decoupling capacitor for mobile phones, mobile PCs, and digital AV equipment. Samples are available now. www.murata.eu (080713-IV) 10 elektor - 10/2008 c£ uj PicoScope 5000 Series The No Compromise PC Oscilloscopes Wish clas^-lcading bandwidth, sampling rate, memory depth and an array of advanced high-end features,, the PicoScope SGOO PC Osci Ho scopes give you the features and performance yog need without any compromise. 250 MHz bandwidth 1 GS/i real-time sample rate 123 megasample record length * ■* * ■ lUDiin j ■ i LU Advanced Triggers In addition by the standard triggers the PitoScape 5000 aeries comes as standard with pulse wdth B wmdow H dropout ceidV H and leak level triggering. 250 MHz Spectrum Analyser High-speed USB 2»Q Connection Automatic Measurements Arbitrary Waveform Generator Define your own wtv^Tcinni or select from & prede^ned siflnafes with- the 12 bit. 125 M5/s ^rbiirary vrivdomi generator. Waveform Playback Top! M PiteSkope software now allows ydu (o go baCV. review, i W and analyse -up to 1000 captures W within fcs waveform plsyb-ack tool. Technology The P^coSropc 3000 Series of oscilloscopes from Pico Technology me iiidi 'i gener.il pui pose .ml hljjh resoluiiaii niodds Wiih 12 hii resolution and 1 h accuracy, the 10MHz Ficol-ico^e 3-5 21 la able to detect changes is sm.il « 0.021 -'M^ppm) m, ski 13 it Ihe ideal d-rtirutnel oscilloscope for analog design and analysis. Theh^er speed 3 bit models m the P'-coSeope 3QIXI i ies i . at j": ;■■ .. img rate? u .;■ : 2CKJM5/S and up to 1 record lcrl S ths for general pu-pose and portable applications. The PicoScope 2000 strlts oscilloscopes ^ jL offer single a^d dual chanrncl units that offer highly ^ porl able/ low coil solutions to genera! purpose testing. 1 he ^ award winning 2 5MHz handheld PicoScope 2105 (Its L Ijj Cdflnfi&ri ably ;nco ini' p.ilm of your h md yet *tni include* £ ^ the powerful! Icatures lou^d in larger oscilloscopes, £ www.picotech.com/scope490 jj to check ouc our full lino of PC-based inicrumcncs or call 01480 396 395 for inform a t\on and a product catalogue INFO & MARKET NEWS & NEW PRODUCTS ICC for Propeller ICC for Propeller, from Image- Craft, is an ANSI C develop- ment tool for the Parallax Pro- peller chip. The IDE features project-based design and sup- ports C86 dialect source and C-based Propeller objects. The Propellent Library is directly supported by the IDE for ease in build-to-run development cycles. ICC for Propeller comes in both a Standard Version (#32385) and also a Non-Commercial Version (#32380) . Both versions feature an ANSI C compiler for Propeller L MM code generation with an editor, project manager, and code browser. The Non-Commerical version supports programs as large as 16 k while the Standard version supports pro- grams as large as Hub RAM. The Propeller chip makes it easy to rapidly develop embedded applica- tions. Its eight processors (cogs) can operate simultaneously, either inde- pendently or cooperatively, sharing common resources through a cen- tral hub. The developer has full con- trol over how and when each cog is employed; there is no compiler- driven or operating system-driven splitting of tasks among multiple cogs. A shared system clock keeps a * . * r s ■CCV 7 tor ProMlar C ion( MO)d ¥7 tm ^ ; r each cog on the same time reference, allow- ing for true deter- ministic timing and synchro- nization. Three pro- gramming languages are available: C (via ICC for Propeller), the easy-to- learn high-level Spin (native), and Propeller Assembly (native) which can execute at up to 1 60 MIPS (20 MIPS per cog). ICC for Propeller is available for p .n*i» nrm *>■ i > mm 0 <* - •> r V « Z ■80 • I WSRfiSPTi SL purchase from Parallax, www.parallax.com Inc. (080713-V) Single-Chip solution Receives Top Honours Micronas announced that LCD HDTV products based on their VCT-Premium have recently been rated top of the class by leading industry publications. Sony's brand-new KDL-52W 4000 LCD TV was rated best of all tested 52" Full HD LCD TVs by the Ger- man magazine 'Video' in July. In May, HDTVTest.co.uk rated the KDL-40W 4000 "the best LCD HDTV — in terms of both picture and sound quality — in 2008", and 'What Hi Fi, Sound & Vision' testified in June: "One of the sharp- est, punchiest, most detailed HD performances yet; terrifically bal- anced and clean SD playback." JVC's LT-42DR9 was rated best among all tested 42" LCD TVs by the German consumer test maga- zine 'Heimkino' in June, and 'What Video & Hi-Def TV', from the UK, awarded the 42DS9 a full five-star verdict: "The 42DS9 delivers the finest picture quality we have yet seen from a JVC LCD TV." With the growing adoption of Blu- ray™, movies are increasingly being delivered at 24 frames per second (fps). The VCT-Premium sup- ports this 24p mode — showing true cinematic video quality. Micronas' VCT-Premium is the third generation of Micronas' VCT-family of single-chip flat-panel TV proces- sors, providing a complete solution for a Full HD LCD TV featuring inte- grated audio, video, teletext, and on-screen display (OSD). TVs pow- ered by VCT-Premium can accept content with standard or the new extended color space (x.v.Color™) and expand the color formats to work with Wide Color Gamut pan- els. VCT-Premium is shipping in mass-production to leading world- wide LCD TV manufacturers. www.micronas.com (080713-III) Old Problems solved by new solutions The prob- lem of obso- lescence in electronics is a common issue for manufactur- ers. Often manufactur- ers end up in expensive last time buy opera- tions or desperately searching the world to find the remaining stock in existence. Enterpoint's Craignell modules offer an alternative to these costly procurement operations, often with performance improvements as an additional benefit. The initial release of the new range of Craignell modules from UK based Enterpoint offer alternative procurement solutions for hard to find components in DIL28, DIL32, DIL36 and DIL40 packages. The heart of the Craignell modules is a Xilinx™ SpartanTM-3E FPGA which performs the logic or memory function of the obsolete component being replaced. The high density of the FPGA solution allows functions of up to 500,000 gates to be imple- mented. This allows logic functions as complicated as an 8088 micro- processor or memory devices as large as 16 Mbit to be replicated in a single Craignell module. In addition to the FPGA, Craignell modules contain power regulators and I/O buffering to allow opera- tion from a single supply between 3 V and 5.5 V and can tolerate and drive CMOS levels on all I/Os mak- ing the module highly adaptable. Enterpoint offers the Craignell modules in either raw un-pro- grammed format for customers to implement their own logic func- tions or as turnkey solutions with design of replacement logic func- tions already implemented. Typi- cal replacement, or enhancement, functions replicated in Craignells include Microprocessors, UARTs, PIOs, Counter Timers, Clock Gen- erators SRAM, Eprom, Flash, FIFOs and Dual Port memories. The Craignell module range is priced from £ 25 (US $ 50), in 1 00 off quantities. www.enterpoint.co.uk (0807 13-VII) 12 elektor - 10/2008 • • * 0 9 Mi f? M * 1 1 ' For the widest choice of components from all the major manufacturers, visit rswww.com/electronics rswww.com/electronics 08457 201 201 m INFO & MARKET NEWS & NEW PRODUCTS Electronworks electronic kits You don't have to be mad in life.... Second thoughts, yes you do. Elec- tronworks have taken some of life's insanity (and lots of their own) and put it into electronic kits. Electron- works' aim is to make learning electronics fun and to bring you a range of kits that are both practical and educational. A whole tonne of kits and ideas is available for unleashing in the coming months, so if you are young or old, new to electronics or a seasoned veteran you will find something to suit your needs. For example, Electronworks' MP3 booster amplifies the output of your MP3 player, so you can fill the room with music via your PC Omniscient PIC32 compiler HI-TECH Software recently launched an 'omniscient' ANSI C compiler for Microchip's PIC32 family of microcontrol- lers that can boost real-time performance by 25% or more, and can provide nearly dou- ble code density. HI-TECH C® PRO for the PIC32 MCU Fam- ily is the only PIC32 compiler that optimizes stack and regis- ter allocation across all code modules prior to generating the object code. Smaller code gen- erally executes more quickly and requires smaller, less expensive flash memory for storage. The HI-TECH C PRO compiler has an omniscient code genera- tor (OCG) that collects compre- hensive data on every register, stack, pointer, object and varia- ble declaration across the entire program. It uses this information to optimize register usage, stack allocations and pointers across the whole program. It also ensures consistent variable and object declarations between mod- ules and deletes unused variables and functions. HI-TECH C PRO is the only PIC32 compiler with this capability. The majority of other PIC32 com- pilers are based on GCC compi- lation technology which generates code one-module-at-a-time, without comprehensive cross-module data. Without knowing how objects are used across the whole program, it is impossible to achieve the same level of optimization as an OCG compiler. In code density bench- marks, HI-TECH's OCG compiler achieves code that can be as much as 40% smaller than that generated using industry leading GCC-based PIC32 compilers. The smaller code size can cut device costs by reducing the amount on on-chip flash required. HI-TECH Software also provides its own Eclipse-based IDE, HI-TIDE™ 3, including full project management, a flexible editor and a fast, accu- rate simulator. HI-TIDE connects to the HI-TECH C JTAG Debug Interface, which is provided free of charge with the HI-TECH C PRO compiler package. HI-TECH C PRO for the PIC32 MCU Family is available now through September 30, 2008 for the introductory price of US$ 1595, after which it will sell for US$ 1995 It includes, free of charge, HI-TECH Priority Access™ (HPA) — 12 months access to updates and technical support — as well as a 30 day money back guaran- tee. Multi-user, and educational user discounts are available. A fully functional 45-day trial version of HI-TECH C PRO for the PIC32 MCU Family can be downloaded, free of charge, at HI-TECH's website. http://microchip.htsoft.com (080713-VI) 14 elektor - 10/2008 BitScope USB Mixed Signal Oscilloscope Analog Digital Digital Storage Oscilloscope Dual Channel Digital Scope with industry standard probes or POD connected analog inputs. Fully opto-isolated. Mixed Signal Oscilloscope Capture and display analog and logic signals together with sophisticated cross-triggers for precise analog/logic timing. Multi-Band Spectrum Analyzer Display analog waveforms and their spectra simultaneously. Base-band or RF displays with variable bandwidth control. Multi-Channel Logic Analyzer Eight logic/trigger channels with event capture to 25nS. DSP Waveform Generator Optional flash programmable DSP based function generator. Operates concurrently with waveform and logic capture. Mixed Signal Data Recorder Record to disk anything BitScope can capture. Supports on-screen waveform replay and export. User Programmable Tools and Drivers Use supplied drivers and interfaces to build custom test and measurement and data acquisition solutions. Inventing the future requires a lot of test gear... ...or a BitScope BS100U Mixed Signal Storage Scope & Analyzer Innovations in modern electronics engineering are leading the new wave of inventions that promise clean and energy efficient technologies that will change the way we live. It's a sophisticated world mixing digital logic, complex analog signals and high speed events. To make sense of it all you need to see exactly what's going on in real-time. BS100U combines analog and digital capture and analysis in one cost effective test and measurement package to give you the tools you need to navigate this exciting new frontier. O CK 0 * o m rtl tScg*p* 5: < Standard 1M/20pF BNC inputs Smart POD Connector Opto-isolated USB 2.0 12VDC with low power modes BitScope DSO Software for Windows and Linux BS100U includes BitScope DSO the fast and intuitive multichannel test and measurement software for your PC or notebook. Capture deep buffer one-shots, display waveforms and spectra real-time or capture mixed signal data to disk. Comprehensive integration means you can view analog and logic signals in many different ways all at the click of a button. The software may also be used stand-alone to share data with colleagues, students or customers. Waveforms may be exported as portable image files or live captures replayed on another PC as if a BS100U was locally connected. www . bitscope .com 10/2008 - elektor 15 INFO & MARKET NEWS & NEW PRODUCTS Free step-by-step guide to REACH Farnell has produced a step-by-step guide to REACH regulations (Reg- istration, Evaluation and Authori- sation of Chemicals). The easy- to-read document, downloadable from the company's Global Leg- islation website (www.global-leg- islation.com), is designed to sup- port electronics design and other engineers in quickly assessing the impact of REACH, and understand- ing how to achieve compliance with the regulations. Written in collaboration with ERA Technology, the guide condenses 280 pages of regulations into five easy-to-read pages and has already been adopted by AFDEC members, FBDi in Germany and NEDA in the United States as their recommended refer- ence guide to cus- tomers. The guide is complimented by a PDF covering recent guidance around 'Substances in Articles'. REACH, currently in its pre-registration phase, is an inte- grated system for Registration, Evalu- ation and Authori- sation of Chemicals across the EU and currently covers an estimated 30,000 substances. The regulations aim to improve the protec- tion of human health and the environment while maintaining competitiveness, and enhancing the innovative capabil- ity of the EU chemi- cals industry. www.farnell.co.uk (08071 3-VIII) Cypress PSoC Designer™ 5.0 released Cypress Semiconductor Corp. (introduced PSoC Designer™ 5.0, the industry's first and only integrated design envi- ronment that includes both code-free and high-level lan- guage pro- gramming modes in one package. Cypress has combined the revolutionary PSoC Express™ visual embedded system design tool with the full-featured PSoC Designer software to create a new design paradigm — users can now start projects in a drag- and-drop visual design mode (sys- tem-level view) and then move to code-based design in C language (chip-level view) to refine and customize their projects, all from within a single tool. In addition to integrating the PSoC Express functionality, the new PSoC Designer 5.0 tool includes the more powerful version 9.61 of the HI-TECH C® PRO compiler for the PSoC® Mixed-Signal Array. The new compiler includes a new 'Lite' mode that designers can use free of charge without any time or code-size limits usually associ- ated with free compilers. Users can download PSoC Designer 5.0 free of charge. www.cypress.com / psocdesigner www.cypress.com / psoc www.cypress.com / psoctraining (080713-IX) Artificial sounds from hybrid cars Farnell has produced a step-by-step guide to REACH regulations (Reg- istration, Evaluation and Authori- sation of Chemicals). The easy- to-read document, downloadable from the company's Global Leg- islation website (www.global-leg- islation.com), is designed to sup- port electronics design and other engineers in quickly assessing the impact of REACH, and understand- ing how to achieve compliance with the regulations. Written in collaboration with ERA Technology, the guide condenses 280 pages of regulations into five easy-to-read pages and has already been adopted by AFDEC members, FBDi in Germany and NEDA in the United States as their recommended reference guide to customers. The guide is compli- mented by a PDF covering recent guidance around 'Substances in Articles'. REACH, currently in its pre-registra- tion phase, is an integrated system for Registration, Evaluation and Authorisation of Chemicals across the EU and currently covers an estimated 30,000 substances. The regulations aim to recommended reference guide to customers. The guide is complimented by a PDF covering recent guidance around 'Substances in Articles'. REACH, cur- rently in its pre- registration phase, is an integrated sys- tem for Registra- tion, Evaluation and Authorisa- tion of Chemi- cals across the EU and currently covers an esti- mated 30,000 substances. The regulations aim to improve the protection of human health and the environment while maintaining competitiveness, and enhancing the innovative capabil- ity of the EU chemicals industry. www.farnell.co.uk (08071 3-VIII) 16 elektor - 10/2008 Capacitive Touch Sensing In a Flexible, Single-chip Solution Capacitive touch interfaces provide an excellent way to add low-cost, reliable and stylish buttons into your design. Microchip Technology's mTouch™ Sensing Solution includes comprehensive development kits and a free diagnostic tool to make implementation easy and fast. Our free source code can be seamlessly integrated with your existing firmware on a single PIC® microcontroller - eliminating the need for additional controllers. THE mTouch SENSING SOLUTION FEATURES: GET STARTED IN 3 EASY STEPS 1 . Visit the mTouch Sensing Solutions design center at www.microchip.com/mTouch 2. Download free libraries and source code 3. For a limited time, save 20% off a variety of touch sensing development tools when you purchase from www.microchipDIRECT.com and use voucher code EUMTOUCH. • FREE license libraries and source code • A FREE diagnostic tool • Integration with 8- and 16-bit PIC microcontrollers • Easy expansion, with support from 6 to 100 pins • Low-power operation Intelligent Electronics start with Microchip ^ www.microchip.com/mtouch & Microchip The Microchip name and logo, the Microchip logo, MPLAB and PIC are registered trademarks of Microchip Technology Incorporated in the USA and other countries. mTouch and PICDEM are trademarks of Microchip Technology Incorporated in the USA and other countries. All other trademarks are property oftheir respective companies.© 2008, Microchip Technology Incorporated. All Rights Reserved. ME211Eng/08.08 Microcontrollers Digital Signal Analog Serial Controllers EEPROMs TECHNOLOGY SMDS These early SMD ICs are M300 series JVIECL (Motorola emitter-coupled logic) devices from 1967. (Photograph: NRW Finance Authority Computer Centre) Figure 1. TO-91 flatpack package, from an old Motorola data sheet. The SMD SMDs have been with us since the Ernst Krempelsauer (Elektor Germany) The introduction of the SMD package is closely linked with the development of the first integrated circuits at the beginning of the 1960s. It was not until the 1980s and 1990s, however, that SMDs began to dominate the market, the tiny packages enabling the manufacture of ever more technologically sophisticated mobile phones, notebooks and PDAs. When the first integrated circuits went into mass production it was of course essential to design a suitable package. It was clear that the cylindrical metal transistor-style cans left something to be desired in terms of heat dissipation effi- ciency and ease of making internal connections. One of the first packages intended specifically for ICs was the 'flat- pack', designed by Yung Tao at Texas Instruments in 1 962. It measured approximately 6 mm by 3 mm (1/4 inch by 1/8 inch) and had ten flat leads, five on each side. In appearance it was very similar to a modern SMD pack- age. Figure 1 shows a 10-pin flatpack (later standardised as 'TO-91 ') of the type used for example by Motorola for their very high speed MECL logic family. These flatpack logic devices, which were soldered to the copper side of a printed circuit board, enabled the construction of powerful (for the time) mainframe computers with clock frequencies 18 elektor - 10/2008 of up to 20 MHz (see Figure 2). Passive components, on the other hand, had leads with a round cross-section which were fitted through holes in the board and soldered on the reverse side. Most ICs, however, became available in the DIL package, first designed by Bryant Rogers at Fairchild in 1 964, two years after the flatpack. The DIL package is still a familiar sight today (Figure 3). The path to success As the example of the 'antique' computers mentioned above indicates, SMD-type devices were first used in applications where considerations of performance and reliability out- weighed considerations of cost. Hybrid circuits, with mini- ature components surface-mounted on a ceramic substrate, were a kind of (somewhat expensive) stepping stone on the way to modern surface-mount technology. SMDs were for a long time more expensive than their leaded brethren, but the advantages of compactness and reduced circuit board production and assembly costs smoothed the way for their widespread adoption. SMD boards do not require holes to be drilled for the components and (because they are smaller) are inherently cheaper. A further advantage is their superior RF performance, which benefits analogue and digital circuits alike. This is a result not only of the overall smaller dimensions, but also, and more significantly, because the components do not have leads with attendant inductance and parasitic capacitance. The RF properties of SMD circuits are also more reproducible: small differences in the lead length of through-hole devices and in distances, both from component to component and from component to board, all affect RF behaviour. A further decisive factor in favour of SMDs is the increased reliability of machine-assembled boards: failure rates can be reduced by as much as a factor of 1 00. And, as their mar- ket share has increased, SMDs have also generally become significantly cheaper than conventional components. The progress of SMD technology is inextricably linked with the development of GSM mobile phones over the last dec- ade or so. Enormous leaps have been made in miniaturisa- tion, cost reduction, production quality control, robustness and in improving RF performance by packing these tiny devices together as closely as possible. Evolution In a conventional (carbon) film resistor the leads are con- nected to caps fitted to either end of a ceramic tube, which is coated with the resistive material. If we dispense with the leads and simply solder the caps directly to the pads of a printed circuit board we have made an SMD resistor. This kind of cylindrical SMD package is known as a MELF (metal Figure 2. Flatpack logic ICs soldered to the top surface of the printed circuit board were an essential part of this 1960s mainframe computer, the most powerful of its time. The board comes from a Telefunken TR440, first produced in 1969. (Photograph: NRW Finance Authority Computer Centre, http://www.rzf-nrw.de) Figure 3. The trusty DIL package was first used in 1964, two years after the first SMD- style flatpack package. Figure 4. Diodes without wires: the cylindrical MELF package is a derivative of the leaded package. 10/2008 - elektor 19 TECHNOLOGY SMDS Figure 5. Most SMD components come in chip-style packages. Figure 6. SMD transistors and smaller ICs have connections along the edges of the package. Figure 7. Even special-purpose devices such as this MS5534-CP/-CM pressure sensor from Intersema (www.intersema.comj are frequently available in SMD packages. electrode leadless face), mini-MELF or micro-MELF, depend- ing on its size. This package is still used, chiefly for diodes (Figure 4), NTCs, PTCs and high pulse load, high voltage and high stability resistors. The majority of SMD components are rectangular in shape: the so-called 'chip' package (Figure 5). Resistors and capacitors have connections formed by caps at either end, while transistors and smaller ICs have leads along the long edges (Figure 6). As technology has advanced SMD packages have become smaller and smaller, with modern devices measuring less than 0.5 mm along an edge. SMD packages are also being introduced for more and more of the bulkier components, such as inductors, connectors, switches and relays, as well as for specialised components such as microphones and other sensors (Figure 7). The main demand here is not for miniaturisation but rather for the SMD components to be able to withstand the tempera- tures of reflow soldering without damage or adverse effect on service life. It was not long before SMD ICs outgrew the restrictions of placing connections around the edge of the package. Grad- ually such packages are being superseded by a design where the connections take the form of a grid of hemi- spheres on the underside of the device. The pitch of the grid can range from 1 .5 mm down to below 0.5 mm (see Figu re 8). The so-called BGA (ball grid array) package allows ICs to be manufactured with over 1 000 connections. Soldering requires a precision-controlled reflow system, and joints can only be inspected using X-ray equipment. Development of SMD package designs still continues apace: you can read more in the article elsewhere in this issue by my colleague Clemens Valens. ( 080714 - 1 ) Literature and Internet Links 'SMD (Surface Mounted Device)', Elektor December 1985. Figure 8. A device in a BGA (ball grid array) package, here with 'only' 169 solder balls. ft i ft ft ft ft ft ft ft ft * ft • ft ft ft ft ft ft ft ft 6 ft ft ft- ft ■t ft ft ft ft ft • ' 's- ft t ft ft 1 ft ft 4 4 ft £■ 4 ft ft ft ft ft ft ft ft * ft ft ft ft ft ft ft ft ft * ■ ft ft ■ft ft ft L ft ft 4 ft 3 ft ft ft * ft *' ft ft ft ft ft 4 t ft ft ft ft ft ft ft ft ft ft * ft ft ft ft ft ft ft ft 4 ft #,ft ft ft ft 4 ■ ft ft ft TM To pLinQ RRMRqil ,5-DClO 1 » ft ft ft s .ft t : j : : * ft- .9 * ft ft ft- ft t 4# ft £ :■ i s a 4 ft ft ft ft ft * « ft « * ft # * ft * * ft ft ft ft ft. 4 Christian Tomanik: 'SMDs? Don't panic!', Elektor January 2003, p. 44 and February 2003, p. 32. http://smithsonianchips.si.edu (National Museum of American History's Chip Collection) http://homepages.nildram.co.uk/~wylie/ICs/monolith.htm (The first monolithic integrated circuits, by Andrew Wylie) http://www.hbci.com/~wenonah/history/edpart6.htm (Tommy Cichanowski's History of 'Western Technology': The Inte- grated Circuit Era) www.vaxman.de/historic_computers/telefunken/tr440/ tr440.html (photograph of the Telefunken TR440 mainframe) www.rzf-nrw.de/museum/museum4.html (technical information on the Telefunken TR440 mainframe, in German) http://en.wikipedia.org/wiki/Surface-mount_technology (main Wikipedia page on SMD) 20 elektor - 10/2008 Paltronix Limited, Unit 3 Dolphin Lane, 35 High Street, Southampton, SOM 2DF I Tel: 0845 226 9451 I Fax: 0845 226 9452 I Email: sales@paltronix.com Product information and secure on-line ordering at www.paltronix.com. Major credit and debit cards accepted. Prices exclude delivery and VAT. Please see our website at www.paltronix.com for further products including components, microcontroller development tools, prototyping aids, educational robot kits, test equipment and wireless communications products. EasyPIC5 C Starter Pack — everything needed to start developing PIC projects in C for just £189 Get an oscilloscope, logic analyser and much more with the PoScope USB-based Instrument for only £79 With a PoScope you get: • Dual-channel oscilloscope • Spectrum analyser • Dual-channel chart recorder • 16-channel logic analyser with UART, SPI, I2C and 1-wire serial bus protocol decoding • 8-channel pattern generator • Square-wave/PWM generator This latest version of the popular PoScope is a must-have tool for those developing microcon- troller-based projects or with a general electronics interest and provides the features of six instruments in one compact PC-based unit at an incredibly low price. The PoScope connects to one of your desktop or laptop PC’s USB interfaces (USB 1 .1 or USB 2.0), is Windows XP and Vista compatible and comes with easy-to-use software. The PoScope provides two BNC connectors for oscilloscope, spectrum analyser and chart recorder inputs and a 25-way female D-connector for logic analyser and pattern generator input/outputs. Supplied with USB connecting cable and software and manual on CD-ROM. A PoScope Bundle is also available for £119, which additionally includes two high- quality oscilloscope probes and a logic analyser test lead and clip set. The dual-channel oscilloscope provides voltage and frequency measurement, absolute, differential and external trigger- ing, adjustable pre-trigger, marker meas- urements and filtering. Specifications include a 100Hz ~ 200kHz sampling rate, 1126 samples/channel (1 channel) or 563 samples/channel (2-channel) memory depth with pipe reading of 64k samples per channel, 10-bit resolution A/D and input voltages from -20 ~ +20V. The spectrum analyser provides Ham- ming, Hanning, Blackman and Blackman- Harris window functions. Dual-channel oscilloscope view The chart recorder provides dual-channel recording at sampling rates from 0.01 Hz ~ 200kHz with a maximum record time of 24 hours at Fs < 100Hz. A/D resolution and input voltage range are again 10-bit and -20 ~ +20V respectively. Pix-Cell GSM Controller New product — the Pix-Cell is a stand-alone controller offering GSM/GPRS communications, three digital inputs, three 10-bit analogue inputs, SPDT relay output and RS-232 interface priced at £129. ZeroPlus Logic Analysers A range of powerful 16 and 32-channel logic analysers with advanced serial bus protocol decoding including CAN, LIN, USB, UART, SPI, I2C, 1-wire and more. With prices from only £125, there’s a logic analyser in this range to suit all needs and budgets. Universal Development System The UNI-DS3 is a versatile micro- controller development system supporting PIC, dsPIC, 8051, AVR, ARM and PSoC devices with an extensive range of built-in I/O features and on-board USB programmer priced from £109. The EasyPIC5 C Starter Pack contains everything needed to start learning about and devel- oping with PIC microcontrollers using the C programming language. The package contains the popular EasyPIC5 development board, a full version of MikroElektronika’s powerful mikroC compiler, USB and serial cables, blue backlit 16x2 character and 128x64 graphic LCDs, touch-screen overlay for graphic LCD, DS1820 temperature sensor and a 40-pin enhanced Flash PIC16F887 microcontroller — all for just £189. The EasyPIC5 C Starter Pack is well-suited to beginners and experienced developers alike and comes with high-quality printed documentation and a large number of easy-to-understand example programs for a number of PIC microcontrollers. The EasyPIC5 supplied in the starter pack is a full-featured development board for PIC10F, 12F, 16F and 18F microcontrollers in 8, 14, 18, 20, 28 and 40-pin packages. The EasyPIC5 incorporates an on-board USB-based PIC programmer and in-circuit debugger as well as a useful selection of built-in I/O devices such as LEDs, switches, 7-segment displays, potentiometers, RS- 232 interface, PS/2 and USB connectors and provision for fitting of the included LCD displays, touch-screen and DS1820 tem- perature sensor. What’s more, all of the PIC’s input/output lines are available for connection to your own circuits or to any of our huge range of low-cost optional add-on boards such as Ethernet, RS-485, CAN, LIN, IrDA and RFid communications, EEPROM, SD/ MMC and Compact Flash storage, 12-bit A/D and D/A, and many useful interfacing and prototyping boards. EasyPIC5 BASIC Starter Pack and EasyPIC5 Pascal Starter Pack also available at £149 each. Similar starter packs also available for 8051 , AVR and dsPIC — please see our website at www.paltronix.com for prices and full details. The logic analyser provides 16 channels (eight when pattern generator in use) with a sampling rate of 1kHz ~ 8MHz, internal and external clocking, versatile triggering and an input range of 0 ~ +5V. Memory depth ranges from 1544 bits/channel (Fs <= 1MHz) to 128 bits/channel (Fs <= 8MHz). Built-in serial bus protocol decoding facilitates the decoding of UART, SPI, I2C and 1-wire serial buses. The pattern generator allows eight of the logic analyser’s channels to be used to provide output waveforms from 1 kHz ~ 1 MHz with a memory depth of 1544 bits/ channel and an output voltage of OV for logic “0” and 3.3V for logic “1”. The PWM generator provides a 7.8125kHz output with a 1 ~ 100% adjust- able duty cycle. Square waves can also be output with a 50% duty cycle and an adjustable frequency ranging from 3.91kHz to 1 MHz. 'gjfm h. - ■ 1 ■ . _ ■ ” J - r* . rw » j-- Sixteen-channel logic analyser view ■ — ... ■ ii ■ UART, SPI, I2C and 1-wire decoding view Supplied in the EasyPIC5 C Starter Pack is a full version of MikroElektronika’s mikroC, a power- ful integrated development environment and C compiler for PIC12, PIC16 and PIC18 microcon- trollers. With its built-in user-friendly features, mikroC makes developing code for PICs easier than ever. When used in conjunction with the ■ i 1 EasyPIC5 development board, mikroC provides full in-circuit debugging capabilities. mikroC also provides a library of ready-written routines that provide support for all of the EasyPIC5’s on- board I/O devices and optional add-on boards. This enables programs to be quickly constructed V even when working with advanced features such as CAN, Ethernet and USB communications, character and graphic LCDs and touch-screen, and EEPROM, MMC/SD and Compact Flash data storage. mikroC also incorporates useful tools such as LCD custom character generator, GLCD bitmap generator, USART, HID and UDP terminals and 7-segment display decoder. 10/2008 - elektor 21 TECHNOLOGY SMT SHUT of the Future Whatever next to solder (or not)? Clemens Valens (Elektor France) So you finally mastered hand soldering a 0805 package and now you're expected to migrate to 0603 and next up is 0402! Did you know that there exist 0101 size resistors? That's 0.3 mm by 0.22 mm! Imagine hand soldering such a part when just seeing it is a challenge on its own. That's why our foxy browser was fired up to prepare ourselves for what we may have to mount (on boards) tomorrow. Electronic component packaging has always been driven by consumer demand. Admit it — you too want smaller and niftier electronic gadgets that offer more yet cost less. Nobody expects a mobile phone to be just that — we want it to be feature-packed and consequently electronic prod- uct manufacturers have to fit ever more 'functionality' into forever shrinking products. By implication, electronic com- ponent manufacturers have to cram more transistors into smaller housings. Now if you thought that these new, invariably smaller, hous- ings were invented by chip manufacturers, you're mistaken. Electronic component package design is not just a science — it's a thriving business and industry with conferences, dedicated magazines, exhibitions and large multination- als like Amkor [1], ASAT [2], ASE [3], Flip Chip [4] and Tessera [5] in the arena. So what are all these people doing and what have they been up to lately? Photo 1. Amkor's latest BGA package, the FC M BGA (Flip Chip Moulded BGA), up to 1229 (or was it 1228?) contacts with JEDEC standard 1.0 mm pitch on a 40 by 40 mm surface, (courtesy Amkor) • ■ * * * * * m *■ * * ■* * ■ # ■ ■ a * m * m m m # m * tr d- m m m m m # * ■ ■m * m m # # m m m m m m ■ -a m m m m ■ ■ m mm • ft m m m * # # # * * * # # m mm# it# m # # • « * m m m * *• * m # • p- ■ m * • * * m • Hd ■ ■ ini ■ ■ E3 (£3 ■ ■ ill! ■ ■ ^mkor® fc m bga 40 x 40 BGA All right, you've heard about BGA (Ball Grid Array) pack- ages, you probably have seen them, you may even have steered clear of them, but did you know that there are as many different BGA packages as there are inkjet cartridges? Asking for plain- vanilla 'BGA' only gets you an obliging smile — the insider asks for (jBGA, Face- up pBGA, |jBGA-W, PBGA, HSBGA, L2BGA, CSBGA, EBGA, HPBGA, SBGA, TSBGA, TEPBGA, CLTBGA, VBGA, VFBGA or fpBGA. Impressive? This list isn't even exhaustive... Luckily for us electronic part end users, a BGA is usually just a BGA — a flat bit of hard material with lots of small metal beads on the side that is supposed to be fixed to the PCB. The only thing we notice is the grow- ing number of components that come packaged as BGA, the growing number 22 elektor - 10/2008 of beads (some have over 1500!) and their decreasing pitch, which is currently down to 0.40 mm. No more leads? As you will have gathered from the above, BGA packages will play an increasing role in future electronics. Does this mean that we will no longer see any component leads? No, leaded packages, or 'exposed pad packages' like SOIC, SOP, QFP and PLCC, will keep their place because even though they take up relatively large amounts of board space, they do have their advantages, notably when it comes to heat dissipation, testability, ground plane con- nectivity and mechanical strength. Compatibility with most existing SMT mounting processes is another very important reason for making such packages stick around for some time to come. Compatibility considerations and long life cycle products also assure the availability of the good old DIP for many years to come. Leads are not always bits of metal sticking out of a pack- age. A so-called Dual or Quad Flat No-lead (DFN or QFN) package is considered a 'leadframe' package, but it does not really have leads. Instead, its connections are just exposed metal pads on the bottom and the sides of the package that are soldered to the board. You can get QFN parts with more than 1 20 pins and although they are dif- ficult to mount, pins are easily probed. No more solder? Package (PoP), where chips are pre-packaged before being stacked and allowing existing chips to be used. Chip stacking is another way of getting more in less space. In this case the chips, which may come from different chip manufacturers, are simply glued on top of each other, with- out connections between them. Wafer Level Packaging (WLP) is the latest trend. With this technology the wafer is bonded directly to the external con- nections (beads, you guessed it) without interconnecting wires. WLP is currently being used for relatively small com- ponents with few I/O like linear, analogue and passive devices. Contrary to a System on a Chip (SoC) where the whole cir- cuit is built on one and the same chip, a System in a Pack- age (SiP) contains several chips and even passive compo- nents in one package. A SiP is more flexible than a SoC because not many circuits are suitable for being integrated on one chip. The 'P' of a SiP may be a BGA, but not nec- essarily so. The funny thing with chip scale packaging techniques (CSP, not to be confused with Chip Scale Package, a BGA-style package only slightly larger than the chip) is that even though dies are getting thicker, packages are getting thin- ner. Currently BGA packages can be as thin as 0.4 mm. ( 080662 - 1 ) Internet Links [1] www. a m ko r. co m [2] www.asat.com Not only Fred in the Shed is hindered by seemingly impos- sible to mount components, the professional board assem- blers are affected too. Tools are needed not only too prop- erly mount these highly integrated, high pin count, fine- pitched parts, but also to test and repair the boards that use them. Soldering is becoming more and more difficult with RoHS and other ecological require- ments. This is why chip pack- agers and board manufac- turers are currently looking into solderless mounting techniques. 3D chips Even though 1 ,500 connec- tions on a BGA is a stag- gering number, there are always people who want more. However with con- tinually diminishing board space, components can only grow in height (like cities), which is done by adding more levels. Several techniques for stack- ing chips in packages have been developed. Some use — surprise! — BGA to inter- connect the chips. This tech- nique, called ball stacking, is mainly used for memory chips that can easily be wired in parallel. A related technology is Package on [3] www.aseglobal.com [4] www.flipchip.com [5] www.tessera.com Photo 2. This new real time clock (RTC) from NXP comes in a tiny 11-pad QFN housing. The big pad in the middle often serves as a ground pin, heat sink or both, or simply to improve mechanical strength, (courtesy NXP Semiconductors) 10/2008 - elektor 23 SMT REFLOW OVEN Elektor SMT Preci what you set is what you get Jan Buiting The Elektor SMT reflow oven will faithfully handle most if not all your soldering of projects using surface mount devices (SMDs). The oven is particularly suited for use not just in Colleges, workshops, clubs and R&D laboratories, but also by the advanced electronics enthusiast. This precious workbench tool is at home where SMD boards have to be produced to a variety of requirements on size, components and soldering materials. Apart from the handle on the drawer giving access to the PCB tray, the user interface consist of an LCD and five buttons on the front panel. From now on, "anyone can play SMD" although some funny smells, burned or half cooked products can be expected as you practice — just don't tell Teach or the Missus and get your oven mittens out. Technical Specifications Line voltage Line frequency Max. power consumption Internally fused Heating methods Operating system menus Modes of operation Temperature phases (curve sections) Time / Temp, range for pre-heating phase Time / Temp, range for heating phase Time / Temp, range for soldering phase Temp, range for heat preservation phase Temp, range for cool down phase Time / Temp, range for Repair mode Effective tray area Size Weight Case and finish CE and RoHS 230 VAC 50-60 Hz 1650 W 10 A far-infrared radiation and hot air (mixed heating) English, German (partly), Chinese • Solder (5 user-defined temperature phases) • Repair (rework) (1 user-defined temperature phase) pre-heat -*• heat (soak) -* solder (reflow) -*• heat retention 0 to 5 min. / 70 °C 0 to 5 min. / [pre-heat temp.] to 220 °C 0 to 60 s. / [heat temp.] to 280 °C [solder temp.] to [[solder temp.] - 50 °C] 70 °C to [heat retention temp.] 0 to 90 min. / 70 to 250 °C 280x280 mm (11x11 inch) 418x372x250 mm (16.5x14.6x10 inch) 16.7 kgs (net) steel, high-gloss grey lacquer finish approved (relevant tests applied for by Elektor) cool down Do not... ... replace the internal fuse until the electrical fault condition has been lifted. ... operate other electrical appliances on the same power outlet as the oven. . .. use the oven to heat foodstuffs. ... place the oven in a tightly enclosed space — a minimum 20 cm (8 inch) clearance is required from any wall or object. ... place combustible materials or liquids in, on or near the oven. ... place the oven on a table cloth, to prevent blocking the air intake. ... operate the oven at high ambient temperature and/or humidity conditions. ... operate the oven without a proper Protective Earth (PE) connection. ... open the tray until the oven has finished the cool down phase and even then use safety gloves. . .. ignore manufacturers' advice on using SMD components, associated reflow parameters and tools. 24 elektor - 10/2008 sion Reflow Oven (actual model supplied may differ slightly from sample shown here) Buzzer (inside) A small buzzer acknowledges pushbutton pres- ses and is activated on fault conditions to alert the user(s). User interface The success or failure of a reflow soldering process on a printed circuit board designed for SMT parts is wholly determined by your settings for tempera- ture and duration of the various phases the board is taken through in the oven. Fortunately, reflow soldering materials are well documented and fol- lowing the manufacturer's advice (often presented in tables) for the temperature and duration of the 'phases' is a good way to be successful, even the first time round! The LCD/pushbutton area on the front panel of the oven offers a convenient way of defining just about every useful temperature curve, the shape and length of which will be governed by the mate- rials at hand, plus your personal preferences and experience. The bright blue LCD (liquid crystal display) will tell you what options to pick and values to set from the oven menus, as well as report on operating status. The control buttons have acoustic feedback through the buzzer. The run, O, O and set buttons may have different functions depending on the menu texts appearing above them on the LCD. Board tray with handle The net surface area of 280x280 mm, slotted steel bottom plate and guide support rails of the PCB tray allow your circuit board(s) to be placed and removed easily, as well as moved in and out of the oven without a risk of tilt, vibration or shock. Be sure to wear safety gloves when removing a hot PCB before the end of the cool down phase (not recommended). Fuseholder Do not unscrew the fuseholder unless the fuse has to be replaced after resolving an electrical fault in the oven. The power cord must be pulled before removing or installing the fuse. Air intake (under) The bottom of the case has large slots to fresh air to be taken in. The oven stands 20-mm high rubber feet. allow on four Power on/off switch A heavy-duty double-pole illuminated rocker switch that connects or disconnects the line voltage to/ from the internal circuitry. Always switch the oven OFF when not in use for some time. Power cord receptacle An IEC line power (1 1 0-250 VAC) appliance soc- ket. An approved power cord and a power line outlet with protective earthing (PE) must be used. Extraction fan The air extraction fan is controlled as a function of internal temperature and assists the cool down process. It also helps to remove fumes from the instrument. Keep the fan area clean and clear. ( 080663 - 1 ) 10/2008 - elektor 25 SMD BOARD PREPARATION Before Guy Raedersdorf (Elektor France) An operation in several stages Soldering a board using SMD components is done in several stages. Well assume you have a nicely- designed little board intended for SMD components, like the one shown in Figure 1 . Cleaning... It's important to degrease the board so the solder will flow properly and take nicely. To be able to work properly, and thereby guarantee opti- mum results, the board must be thoroughly cleaned before- hand and the solder pads perfectly clean and free from grease. The whole outcome of the reflow soldering process depends on this. Use isopropyl alcohol for this job. Once you are satisfied with your work, you can go on to the next stage. Figure 1. The bare board has been cleaned using a cleaning product such as alcohol. Applying the soldering paste Once the cleaning stage is over, you can have fun with the dispenser or syringe used to apply the soldering paste or cream where (and only where! it's needed. The success of the whole reflow operation is largely depend- ent on how carefully the soldering paste is applied. So you need to make sure you apply enough, but not too much — this takes a bit of doing to get it just right! There are two options: either do it by hand, applying the required amount of paste to each pad, or use a sort of pre- cut template, a stencil that can be made with the help of a So here you are, the proud owner of a reflow oven (or maybe you've got the chance to use one belonging to a friend or acquaintance), all set to produce your very first board using SMD components - for you always have to start somewhere. 26 elektor - 10/2008 Preparing a board for reflow soldering It's all very fine having a super professional' reflow oven like the one mentioned in this cluster of short articles, only to risk being disappointed with the results. But this is just what is in danger of happening if you don't take a minimum of care in preparing your boards for 'baking', as this is actually the most important thing, given the temperatures involved. Figure 2. A dispenser like the one being used here is a practical tool for applying the soldering paste. suitably-engraved piece of epoxy PCB. Here, we've opted for the first approach. So the most important thing here is to arrive at the right quantity: neither too little paste (poor soldering = poor con- tacts) nor too much (creating more shorts than are strictly necessary!). Using commercially-available dispensers, it's not easy to apply the small amount of paste needed for proper soldering of tiny components like resistors or capacitors. Instead, you can use a small syringe (Figure 2) bought from the chemist's (without a needle, of course!), with a diameter of around 1 mm (to allow the paste to flow through it smoothly). However, a larger dispenser is very suitable for applying the paste to the larger pads for a multi-pin SMD 1C. It's enough to leave a small, continuous, cross-wise trail in the centre of the pads, as during solder- ing capillary action will 'draw' the soldering paste over the copper pads (Figure 3). It's a good idea to have some way of inspecting your work close up — a magnifying glass (1 Ox) or a bench lamp with a large magnifier. One little pitfall to be wary of: if the pads or lands are larger than the component (especially with 2-pin compo- nents), the component is in danger of floating and becoming misaligned. On the other hand, if the pads are in accord- ance with the component manufacturer's recommendations, the component is 'sucked' by the molten paste and aligns itself automatically. Note: if you examine the soldering paste under a micro- scope, you can see it's made up of thousands of tiny beads of solder coated in a sort of resin that will disappear dur- ing reflow soldering. Figure 3. Without using a stencil, it's virtually impossible to apply the paste to each contact without some overspill. Figure 4. Dozens of different types of SMD tweezers and pliers are available. What you need is a pair of sprung tweezers, to avoid getting cramp when fitting small SMDs. 10/2008 - elektor 27 SMD BOARD PREPARATION Figure 5a. An electric suction pipette lets you position larger SMD components accurately. More compact versions do exist... Figure 5b. Close-up of fitting a multi- pin component using an electric suction tool. Figure 6. Our first "guinea pig' is ready to face the IR heat in our reflow oven. Some tips... Soldering paste is prone to hardening. Low temperatures prevent its going off too quickly. So don't forget to keep your soldering paste in the fridge when you're not using it. A lower temperature will avoid its drying out, so hopefully it will keep for some months, way beyond the 'use by' date. If you take your paste out of the fridge, you'll need to leave it time to get back up to room temperature. The characteristics of the soldering paste have a notice- able influence on the values to be set on the reflow oven. Lead-based pastes, not recommended if you want to respect the RoHS directives, have a lower melting point than lead- free pastes. The reflow temperature must be some 20 °C higher than the melting point of the paste. Use the so-called 'no-clean' paste, which obviates the need to remove flux residues. Care should be taken not to inhale the vapours given off by soldering pastes. Sources of information The Internet is an outstanding information tool. If you go off looking for information about soldering SMD compo- nents, you come across some brilliant ideas, like the one from Dean F. Poeth II [1], who suggests making a sort of pair of tweezers with a multimeter function, so that you can instantly check the value of an SMD component before fit- ting it to the board. Of course, you do have to select the appropriate range for the component concerned (R, C, or L). There are also commercial versions of this type of instru- ment that switch over automatically to the type of compo- nent held in the tips to give its value (Q, |jF, or pH) [2]. Brilliant! Conclusion As we have seen, soldering SMD components takes even more care than the traditional soldering that many of us used for years before SMD components came along. As the saying goes, "Patience is a virtue"... In this article, we're not going to attempt to deal with 'cor- recting' a board coming out of the reflow oven once the soldering operation has been completed. This side of things will be dealt with in the article 'Baking...!' in this cluster of articles. ( 080692 - 1 ) Fitting the components Now it's time to fit the components. For the smaller compo- nents, you can use a pair of SMD tweezers (Figure 4), for those with a nice flat surface (particularly multi-pin ICs), a suction pickup tool will prove ideal (Figures 5a and 5b). Take care that the components are placed perfectly straight, as the slightest misalignment can lead to a disappointing result after soldering. Once the components have been sol- dered, it's quite possible that you may notice some (slight) asymmetry in a series of small components arranged in aligned rows; this is all part of the deal. After critically examining your work one last time (posi- tioning, polarity, value, and type of components), all that remains to be done is to place the finished board (compo- nents uppermost, obviously) on the rack in the reflow oven drawer (Figure 6). Internet Links [1] http://poeth.com/SMD.htm [2] www.smt-tool.com/ For further reading http://en.wikipedia.org/wiki/Surface-mount_technology http://sss-mag.com/prototyp.html www.curiousinventor.com/guides/Surface_Mount_Soldering 28 elektor - 10/2008 n n o /n A N T E X LJLJLJLJLJ Ante* offet a wide choice of input voltages and bit profiles for our soldering iron range * + 60+ years of experience It may surprise you but buying an Antex sofdering iron costs less than you think in the long run, British made to exacting standards, they last significantly forger than many imported brands. With a wide range of thermally balanced models, and temperature controlled Irons too, you can always be sure to find an iron that meets your needs. A large range of replacement tips are available for most irons, and technical help is on hand from our offices in Devon UK. 8uy Online Our new website has all of our irons, and soldering spares and accessories available 24hrs a day. Most items are shipped next day, and we offer free carriage throughout Europe. Why not give antex.co.uk a try! vwvuv.antexxo.uk FREE shipping on alt orders Ant ex Electronics Ltd 2 Westbridge Industrial Estate Tavistock, Devon PL 1 9 BDE, UK Tel: +44(0)1822 613565 Fax: +44(0)1822 617598 Email: sales@antexxo.uk Web: www.antexxo.uk SERVICING YD U R COMPLETE PROTOTYPE NEEDS 1 EUROCARD (160 x 100 mm) + Tooling + Photoplots + VAT Price example Any size and contour possible! Optional: • Soldermask • Fast-turnaround • Silkscreen • 4-Layer Multilayer • 6-Layer Multilayer mwkmo dun sawmm* r .- ^ — iul Free 080C Simply send your files A/*A A /I /If /l/l If and order ONLINE: rVV a rt#l/it Vi f/wl Professional PCB Supplier milh LI >1 "J" 1 " B 1 1 *• | If j M | 1 1 TTTTtTinj URL: IHAHW.iZPDB.GOm Ennaii S£]les@^zpcb.com Tel: +96 139 1002 1704 HDJ Up T* 50 Lay&ri. 2 . 5 fflil Tj'C, 0 . 1 mm Hole Size Other products Stencils, Keypads, frontpanels, FlfisPCn. Fnc-iosurfis. Turnkey Serves, 10/2008 - elektor 29 SMT REFLOW OVEN USE Baking... Guy Raedersdorf (Elektor France) So here in front of you is the lovely circuit board that you've been taking such great care with. The only problem is that the SMD components are only held in place by no more than capillary effect of the soldering paste. To make the connections permanent, the board will need to be 'baked' in the reflow oven. Figure 1. The front of the reflow oven is as simple as could be. From left to right, the On/Off button, the button to start the process, the O and O buttons, and the store / confirm button. Here's a sort of photo-story of this operation, which doesn't involve any special tools. We're off! Once you have the board prepared (soldering paste applied, all the components fitted and correctly positioned), it is time to place the PCB, with all the usual precautions, onto the tray in the reflow oven. Let's close the drawer and off we go. You are in front of the reflow oven, which looks like Fig- ure 1 . Before moving on to the soldering operation proper, you need to start by defining the oven settings, i.e. how it behaves over time. Temperature and time are crucial fac- tors. Generally, manufacturers of soldering paste and com- ponents give optimum temperature values for the former, and maximum periods not to be exceeded for the latter. A reflow soldering process graph will look something like the one given in the 'Soldering curve' box. Your finger... in the pie Let's take a look at the various stages in the form of screen representations. At start-up, you are offered the possibility of choosing your language. Then you get to Screen A, with the terms SOLDER, TEMP, and TIME on the top line that don't change. (There is also a REPAIR function, which we'll come back to later). You can navigate around the menu structure by using the O and O keys. You can go on to select the operating mode, which offers a choice between PREH (PREHeat), HEAT and SOLDER, KEEP and COOL. The left-h and column is the only one where the text changes, since the TEMP and TIME param- eters vary according to the elements entered by the user and the current process (PREH, HEAT, COOL, REPAIR). Before you can move on to the actual soldering, you need to start by entering the settings for the operation, which can vary depending on the soldering paste used and the characteristics and size of the board not forgetting those tiny components on it. Settings Now you will be entering the temperature and time settings for each phase of the reflow soldering process. Preheating (PREH) This mode (Screen B), which you activate using the O key, is used to bring the board and components gradually up to the correct temperature, thereby avoiding any internal stresses on the board or components. 30 elektor - 10/2008 ...or how to use the Elektor Reflow Oven Using the SET key (on the right-hand end), you can define the preheating temperature and duration (Screen C). The O and O keys allow you to set the temperature, which can be from 70 to 150 °C. Once the elements are OK, press SET, or else RUN (without saving modifications) to go back up to the previous level. Once the temperature has been defined, pressing SET again lets you adjust the duration (TIME). The time range is from 0 to 5 minutes (05:00). SET stores the value, and RUN will take you back to the start of the flowchart. Heating (HEAT Pressing the O key moves you on to the HEAT func- tion (Screen D). The setting procedure is similar to that described above. This menu defines the soak temperature (max. 240 °C) and the time for which this temperature is maintained (HEAT). Soldering (SLDR) Then you move on to the Solder step (SLDR) (Screen E). Press SET to store the soldering temperature and move on to the time. Press SET again to store this setting. The upper temperature limit is around 280 °C. Once the setting has been stored using SET, you can go on to set the required time (from 250 to 280 °C, the soldering time cannot exceed a maximum of 30 seconds; below 250 °C the limit goes up to a maximum of 60 seconds). Temperature Retention (KEEP) For the 'KEEP' phase of the process it is possible to define a temperature only (Screen F). Finally, all soldering processes end with a period of... Cooling (COOL) This parameter (see Screen G) too can be modified using the corresponding controls (OK, O and O). Logically, there is no option to set the time — the temperature falls to a cer- tain threshold, and that's all there is to it. It's worth noting that the system is intelligent and only offers the option of O and/or O if it is logically possible. Off we go! Pressing the RUN key starts the automated process, which will then follow the settings you've just made. On the dis- play (Screen H), you see 'Working...' which will stay there until the process is finished. The PREH (Screen I), HEAT, SLDR, KEEP, and COOL steps will be displayed one after another. During preheating (PREH), the temperature increases gradu- ally until it reaches the set value, where it remains for the set time. When the preheat time has elapsed, the temperature rises again in the HEAT mode (Soak stage. Screen J) until it has reached the set value, this stage being maintained for the length of time set for soaking. Then the oven moves on to solder mode (SLDR) (Screen K) which lasts for just the few tens of seconds that have been set. The system has just gone into temperature retention mode (KEEP, Screen L). When this period comes to an end, the iOLDER TEMP TIME >REH 51 C 05 : 00 orking. EXIT 10/2008 - elektor SMT REFLOW OVEN USE Soldering curve Here it's the practical side of things we're interested in, so we're not going into theoretical details. But it's worth being aware that a reflow soldering curve is shaped something like the one in the figure here. It has five stages: Preheating, Heating, Soldering, Retention, and Cooling down. Very often, the sections blend into one another, giving a continuous curve. However, some manufacturers of components, PCB materials and soldering pastes do suggest giving some of the reflow soldering steps a 'plateau', to allow the elements involved to better absorb the thermal shock and thereby avoid the stresses that might cause malfunctions. So an optimum duration and tem- perature can be set for each of these steps, except for KEEP and COOL (down). Normally, soldering paste manu- facturers give a duration of 5-6 minutes for the whole process. Some ovens, like the one de- scribed here, possess more flex- ible settings in terms of times and temperatures. The curve gives a good idea of the reference tem- peratures and times (it's worth noting that in the case of lead- free soldering paste, the peak of the curve reaches a higher temperature (235 °C to 250 °C or even 255 °C, instead of 208- 230 °C), which it maintains for a few tens of seconds (typically 45 to 70 s). At 70 °C the operation is over but be sure to wear safety gloves when removing your board from the oven if you can't wait for the COOL phase to finish. IR heating elements are put into standby (or turned off com- pletely). The cooling period (COOL) starts (Screen M) and the internal extraction fan runs until the temperature inside the J OLDER "temp TIME LDR 240 1: 00:23 or king . . EXIT oven has dropped to virtually that of the surrounding air. When the operation is over, the oven announces this by Completed' (Screen N). There is one option left that doesn't apply to normal soldering... Repair The 'REPAIR' mode (displayed at the top left — no screen dump for this) is used in the event that a soldering operation has failed to produce the desired result, or if SMD compo- nents are to be salvaged from a board! Here too you can set the temperature and time to the required values using the O and O buttons. The time is limited according to the temperature range selected: between 70 and 150 °C, there is no time limit; between 150 and 200 °C, the maximum time is 60 min- utes; and between 200 and 250 °C, 5 minutes maximum. If you've applied the soldering paste and fitted the compo- nents with the necessary care and attention, the board you take out of the reflow oven will hopefully look like the one in Figure 2. If not, get out the ingredients again... Is that all? An intelligent device implies displaying messages not only when everything's working as it should, but also in the event of problems. In this event, a large ERROR appears on the second line, and the bottom line explains in plain language the nature of the unit's 'worries' - excessive temperature, heating element(s) not working, etc. 32 elektor - 10/2008 Conclusion Once the settings to be used for a particular operation have been correctly defined, using the reflow oven ought not to present any problem. Preparing the board is what takes all the care and attention. ( 080664 - 1 ) Internet Links www.curiousinventor.com/guides/Surface_Mount_Soldering www.seed-solutions.com/gregordy/Amateur%20Radio/ Experimentation/N2PKVNA/SMT.htm Figure 2. The result of an earlier try-out. Advertisement Elektor SWT Oven ■FS Multi-purpose and indispensable to professional and enthusiast Selected, tested & certified by Elektor Including Elektor-produced user manual Fully menu controlled Ideal for R&D laboratories, schools, small companies and... electronics enthusiasts Product support from Elektor Customer Services Demo video on www.elektor.com/smtoven Order before 1 November 2008 and get £ 83 - € 1 00 - US$ 75 discount! You pay £ 799 - € 995 - US$ 1450 (plus shipping) r-llektor L_3shop Sign up before 1 November 2008 and get £83 (€100/US$ 75) discount 1 . r Art. #080663-91 • Price: £882 • € 1095 • US$ 1525 (reduced price till 1 November 2008: £ 799 • € 995 • US$ 1450) Main technical specifications Line voltage: 230 V AC / 1 650 W Line frequency: 50-60 Hz Size: 418x372 x250 mm (16. 5 x 14. 6 x 10 inch) Weight: 1 6.7 kg (net) Effective PCB area: 280 x 280 mm (11 x 1 1 inch) Further information and ordering at www.elektor.com/smtoven . w 10/2008 - elektor 33 GPS RECEIVER For those who are keen to know everything! Christian Tavernier (France) Although satnav systems have been in our cars for some years now, it's only recently that stand-alone GPSs have appeared aimed at the amateur market. Despite their small size and often very affordable prices, they have nothing to envy their predecessors, and if we team them up with suitable electronics, they can perform our positioning or navigation tasks just as accurately as the manufactured products. Although these receivers are relatively simple to use, Internet research shows that many amateur electronics or ro- botics enthusiasts don’t know how to set about exploiting these little techno- logical jewels. So in this article we’re suggesting three different projects where you can learn how to use these receivers. Totally standardized dialoguing - or almost! Historically, the first GPS information was used by mariners, and Naval ones at that. No surprise then that the GPS should have adopted the NMEA (Na- tional Marine Electronics Association) communication protocol, originally designed to facilitate data exchange between the various instruments on board, long before GPS even existed. If you only want to build the GPS re- ceivers described here, the subtleties of this protocol aren’t of any great im- portance to you. However, if you want to modify these receivers or perhaps build a GPS receiver into your robot, we invite you to read the box about it. Then you’ll be able to see that it’s still relatively simple... well, almost! In fact, although all current GPS re- ceivers do indeed respect the hard- ware part of the protocol, along with the basic character format, during our experimenting we noticed that certain receivers do take a few liberties with the frame content. The format of certain data - for example, altitude or ground speed - can actually vary from one de- vice to another, making decoding the data a bit more complicated (pun in- tended). We’ll come back to this later. The receiver chosen for these projects For these projects, we’ve chosen the EM-406A receiver, made in South-east Asia (where else, these days?) by Glo- balsat Technology Corporation [1] and available from Lextronic [2], amongst others. This receiver is very compact at only 30 X 30 X 10.5 mm yet offers charac- teristics that will be the envy of certain car model manufactures. Fitted with an SiRF Star III, it achieves a remarkable sensitivity of -159 dBm - to the point that the author was able to acquire 8 satellites even with it shut in a metal desk drawer located inside a reinforced concrete building. Powered from a voltage between 4.5 and 6.5 V, the GPS receiver draws just under 45 mA. The only slight niggles in this fanfare of praise are the techni- cal documentation - which, although it gives the appearance of being com- prehensive, is in fact inaccurate, par- ticularly in terms of the NMEA frames format; its output level - described as ‘TTL’, it isn’t really, which may pose problems of interfacing with certain microcontrollers, as we’ll be seeing fur- ther on; and finally, the format of cer- tain data in its NMEA frames, which is a little. . . ‘creative’! Despite this, the EM-406A is still an excellent choice, as you’re about to see. However, as all GPS receivers out- put the NMEA frames used by these projects, there’s nothing to stop you choosing another model of receiver, or even using your car satnav, provid- ed its data output is accessible - and that’s usually the case with the better models. 34 elektor - 10/2008 9 0 ! D H I E i A WCP5 94V-0 DISPLAYTECH 204A A PC/GPS interface The first project on offer is extremely simple, and makes it possible to inter- face the GPS receiver with the RS-232 serial port of any computer equipment, and hence, a PC. It will enable you to use your PC for navigation using differ- ent pieces of software - and not neces- GPS NMEA frames The NMEA standard was created to facilitate the exchange of data be- tween electronic navigation equipment. So it's only to be expected that the GPSs use it, since the first users of these devices were mariners. The standard used by GPS receivers is NMEA version 01 83, which states that data transmission occurs in asynchronous serial form with 8 data bits, 1 stop bit, and no parity, at a speed of 4,800 b/s. This standard operates by sending messages or frames, all organized in the following way: A frame always starts with the character $ (dollar) followed by two let- ters that identify the type of sender (GP in the case of a GPS, but you might also find EP for a position beacon, HC for a compass, etc.). Then come three other letters identifying the type of frame for the sender concerned. In the case of GPSs, the RMC frame is the most common (for the simplest devices, the only one even), but you do also find GGL, GGA, GSA, etc. Then come the various data fields, each separated by commas. The order and size of these fields depend on the frame involved and so there is no common rule for all the frames. The * (asterisk) character immediately follows the last data (i.e. with no separating comma) and precedes a 2-character checksum, calculated by performing an exclu- sive OR on all the message characters from $ to * inclusive. So here, for example, is what an RMC frame provided by a GPS looks like: $GPRMC,1 14630.325, A, 431 5. 0426, N, 00603. 2734, W, 0.20, 307.53, 31 0508„E*54 If one data element is missing from a field, the place for it must be present all the same, so you may find two successive commas, as shown at the end of the example above. The various frames arrive in an order not defined in the standard, since they are in any case clearly identifiable by their header (the five letters following the $ character). The standard defines more than 30 frames just for GPSs alone. So it's quite out of the question for us to reproduce them all here, espe- cially since the majority of GPS receivers provide only a few of them. So we're offering you just the two most useful frames in the two tables here. You can find out all about the others in the instructions for your GPS, if it provides them. As far as the EM-406A receiver used for these projects is concerned, it provides the GGA, GLL, GSA, GSV, RMC, and VTG frames, the for- mats of which are (more or less) described in its data sheet, down- loadable from the manufacturer's website (see address list). Before investigating these formats, do note that the RMC frame is the minimum frame needed for navigation, and is sometimes the only one used by the simplest devices. 10/2008 - elektor 35 GPS RECEIVER Contents of a typical GGA frame Format Signification SGPGGA Indicates the start of the frame, the sending device, and the type of frame hhmmss.dcm Time in UTC, to the nearest thousandth of a second ddmm.mmmm Latitude in degrees, minutes, and fractions of minutes N or S North or South dddmm.mmmm Longitude in degrees, minutes, and fractions of minutes Wor E West or East X 'fix' indicator : 0 = fix invalid, 1 = fix valid, 2 = fix valid, differential mode NN Number of satellites being used XX HDOP horizontal dilution of precision AAAA Altitude in metres above sea level M Altitude units (M for metres) DDDD Difference in altitude between the WGS84 ellipsoid and sea level M Difference units (M for metres) SSSS Age of the differential data in seconds NNNN Differential station ID *XX End of frame indicator and checksum Contents of a typical RMC frame Format Meaning SGPRMC Indicates the start of the frame, the sending device, and the type of frame hhmmss.dcm Time in UTC, to the nearest thousandth of a second A ou V Valid (A) or invalid (V) data ddmm.mmmm Latitude in degrees, minutes, and fractions of minutes N or S North or South dddmm.mmmm Longitude in degrees, minutes, and fractions of minutes Wor E West or East VW Ground speed in knots CCC.CC True heading in degrees and fractions of degrees JJMMAA Date XXX Variation E orW Sense of the correction (East or West) *XX End of frame indicator and checksum + 12 V applied to power socket Kl. For the USB link, we could use the Ele- ktor/FTDI TTL-232-R cable (SHOP item 080213-71) which will connect header K2 to the PC’s USB port. In addition, activating the EN signal via the USB cable allows the MAX242 to disable the RS-232 port transceivers, GPS/PC adaptor sarily of the payware type, as we’ll be telling you below about some excellent freeware. This interface will also let you display, on the PC, the NMEA frames actual- ly transmitted by the GPS receiver. If you plan to build this receiver into a project of your own, or modify the soft- ware for the stand-alone GPS receiver we’re proposing, this will prove a very handy investigative tool. Figure 1 gives the circuit diagram of this interface, which shows a certain originality, as it can be powered either from a PC’s USB port or by an exter- nal PSU (depending on the position of jumper JP1: external towards the out- side, USB towards the inside of the PCB). This board can be connected to the PC in two ways: via either a COM port or a USB port. In the case of the serial approach, the MAX242 converts the receiver’s (al- most) TTL output signal levels into RS- 232 levels, and vice-versa. In this case, use of an external power supply will be obligatory. As both the MAX and the GPS receiver need +5 V, a common or garden 3-ter- minal regulator will allow us to obtain this from any voltage between + 8 and thereby protecting the USB cable from overloads if the COM port is still con- nected (dual connection is possible!). We recommend you not to use both power supplies at the same time. If you are only ever going to be pow- ering via the USB, the supply compo- nents (Kl to C3) may be omitted, and JP1 fitted towards the inside, or even replaced with a wire link. Even though most of the communica- tions will be going from the GPS to the PC, it should be noted that this inter- face is bi-directional, as the EM-406A receiver is capable of understand- 36 elektor - 10/2008 ing a certain number of elementary commands. Construction Construction of this project is very easy, thanks to the PCB we’ve pro- duced, the overlay for which is shown EM-406A GPS receiver module. VIN IC2 RX EM-406A TX 1PPS GND GND K1 -o -o PWR2.5 K4 X GND IC1 78L05 D1 -M- 1N4004 Cl 470u 25 V 0 ♦ C2 220n V CC C3 lOu 25 V GND r± ^0( J^OOn GND K5 O K2 GND C6i 100™ 12 ±L 13 C7i ioo” _10 5 C4 II lOOn CO VDD EN SHDN C1+ VCC IC3 Cl- T1 IN T10UT T2IN T20UT R10UT RUN R20UT R2IN C2+ MAX242 C2- GND VE :E 18 17 15 8 _ 14 16 C5 II lOOn JP1 O r± ^0 ^100n GND K3 GND GND 11 10 O SUBD9% GND GND 070309 - 11 A Figure 1. Circuit diagram of GPS/PC adaptor. Figure 2. PCB component overlay for GPS/PC adaptor. in Figure 2. To minimize wiring, it car- ries all the components in Figure 1. The connector on the GPS link cable is really tiny and its female socket (K4) very difficult to source (see compo- nent list). Also, it is tricky to solder on the track side of the PCB. To avoid this problem, we’ve also made provision for four pins on the board on a 2.54-mm (0.1-inch) pitch (K5) which can be used to make the link with the receiver. In this case, it will be necessary to cut the plug off the receiver’s little cable to free off the conductors so they can be fitted with a 2.54 mm-pitch SIL fe- male connector, cut down to a length of four contacts, which will mate with header K5 (note that header K5 hasn’t yet been fitted to the prototype in the photo). GPS software for PC The unit is very simple to use. All you have to do is connect it to the PC us- ing a cable fitted with 9-pin sub-D con- nectors. Take care! Given the pinout of Jl, you need to use a straight-through cable (the commonest type), not one with crossed wires. The supply should be connected be- tween the pins marked +8 to +12 V and Ground, if you are using a plug-top PSU, which must be capable of pro- viding 100 mA or so and in that case doesn’t need to be regulated. In this case, link SI must be fitted. If the +5 V supply is tapped off the keyboard or a USB port, SI is removed, freeing up the +5 V connection pad in- tended for this very purpose. As soon as power is applied, the red LED on the GPS receiver will light up - steadily at first while it acquires satellites, then flashing when it has ‘seen’ enough to be able to provide valid data. Note that the receiver includes a su- per-capacitor, enabling it to ‘hot re- 10/2008 - elektor 37 GPS RECEIVER Hjii._j*Lr i rruH- rv !* ip- -iHBpia fo-r-^hfcH ■*- >dwi «.i- wt ? V? A * ■> HI - * Figure 3. VisuaIGPS offers a very comprehensive display. Figure 4. GPS TrackMaker has a cartography system. Figure 5. GPS Diagnostics lets you display and decode the NMEA frames. start’, i.e. acquire the satellites very quickly if it has not been moved since it was powered-down, as long as it hasn’t been left without power for too long. To exploit the data provided by the GPS, you can use one of the count- less free or paid up applications avail- able on the Internet. A simple Google search will offer you an overwhelming choice, but as far as we’re concerned, we recommend you try, for example: - VisuaIGPS [3], one of the most com- prehensive, offering (Figure 3) both a decoded display of the GPS data and the contents of its output frames, with the added possibility of saving them to a file. Take care, though, not to get muddled up: VisuaIGPS is free, while VisualGPSXP is paid for. - GPS Track Maker [4], just as free, also allows the GPS output data to be displayed, but also offers navigation fa- cilities (Figure 4) by means of a large number of maps that can be download- ed from the Internet. - GPS Diagnostics [5] has a slightly less rich interface (Figure 5), but does still display all the data output by the GPS receiver, along with the raw con- tent of the frames it provides. So whether you opt for GPS Diagnos- tics or VisuaIGPS, you’ll have an excel- lent tool for saving the frames provided by the GPS receiver and then if neces- sary analyse them at leisure. Let’s not forget these frames are just a series of ASCII-coded characters (as shown in the box), and so can be manipulated using any text editor. A very simple stand- alone GPS receiver This first receiver is very simple to con- struct - so much so that we haven’t even designed a PCB for it. However, let's render unto Caesar that which is . . . Lextronic's. It actually comes straight out of Application Note 36 relating to the Cubloc circuits from Comfile Tech- nology, a well known advertiser in the French edition of Elektor. As Figure 6 shows, the circuit is in- credibly simple: apart from the GPS receiver itself, it requires only an LCD display - admittedly a bit special, we’ll be coming back to that later - and a Cubloc CB220. Let’s not forget that this circuit, which we’ve already discussed in our Summer 2007 special robotics double issue, is in fact a hybrid micro- controller, similar in concept to the fa- mous Basic Stamps from Parallax, with which it is also pin compatible. Though still based on an Atmel ATMegal28 processor, the Cubloc CB220 is more powerful than the Basic Stamp and has a much fuller and better-perform- ing Basic interpreter. The GPS receiver serial output is con- nected to the input of the UART built in to the CB220, which in turn drives the display - an LCD alphanumeric type with 4 lines of 20 characters - via just the two port lines P8 and P9. An I 2 C bus is available, and the CLCD display from Comfile Technology [6] is also fit- ted with this type of interface, referred to by Comfile as ‘Cunet’. Only pull-up resistors for the I 2 C bus SDA and SCL lines need to be added. Switch SI lets you choose two differ- ent display screens: the first indicates the first eight satellites received with their respective levels in the form of bargraphs; the second displays time, latitude, longitude, number of satel- lites being received, and indicates if the details displayed are valid. The 9-pin sub-D connector marked J1 is not used in normal operation — only during the programming phase of the CB220, which is carried out from the serial port of any PC running the free Cubloc Studio development software. Given the simplicity of the circuit, we built the project on prototyping board, also on offer from Comfile under part no. ‘CB220 proto’, as the price of about € 10 (approx. £ 7.50) is less than the cost of the items you’d need to build it. Board wiring amounts to fitting resis- tors R1 and R2, the connectors for the display and the connection to the GPS receiver. For the latter, we proceeded in the same way as for the RS-232 in- terface above, but with only 3 pins, as this project operates only in the direc- tion GPS microcontroller. Take care! The CB220 can be powered using an unregulated voltage between + 5.5 V and +12 V via its pin 24 (VIN), and it will then output a stabilized voltage of +5 V from its pin 21 (VDD). However, this option must not be used in this particular project, as the CB220’s built-in regulator can’t sup- ply the combined current of the GPS receiver and display together. So the whole circuit needs to be powered via pin 21 (VDD) of the CB220, which in this case becomes its power input. If you still want to use the jack wired onto the CB220 prototype board, two minor modifications need to be made. The first is to slightly bend pin 24 of the CB220 so that it no longer enters the 38 elektor - 10/2008 24-pin socket and hence stays ‘float- ing’. The second is to make a wire link - underneath the IC, for example - be- tween the cathode of diode D1 and the + 5 V pads in the experimental wiring area so that the centre contact of the jack connects the +5 V to the CB220’s VDD input on pin 22. The CB220 is programmed via the Cubloc Studio software, downloadable free from Lextronic’s website. Then all you need do is connect one of the PC’s serial ports to the 9-pin sub-D connec- tor on the CB220 prototype board, con- figure Cubloc Studio accordingly, and run the software programming corre- sponding to Application Note 36. This software can also be downloaded from the Lextronic website in the form of a .zip file containing all the resources for all the application notes relating to the CB220. This listing is provided in the form of source code, and in BASIC moreover, and is well covered in the aforemen- tioned application note, so we won’t repeat these comments here. But we do still recommend you to only study +5V ®- 0 - J1 Programming r~ 7 3 8 \ 4 / 9 5 E2 Ground 6 si El LCD1 c LC DISPLAY V J D > -I < 2 tb O D (3 + « W 8 _ 9_ 1 0_ 11_ 12 21 © SOUT VIN SIN ATN RES IC1 PO PI 5 pi PI 4 P2 PI 3 P3 PI 2 P4 P11 CB220 P5 P10 P6 P9 P7 P8 J- X“ 24 22 14 13 23 R1 20 19 18 17 J 6 15 R2 PS1 R3 -0^> R2 -cvo- R1 I H $ Cl ] — 0^3 — • RESET 47 |i 15V GPS RECEIVER PPS GND TX RX VCC GND EM-406A 070309-12 Figure 6. Circuit diagram of the very simple stand-alone GPS receiver. LCD1 Li K5 vr -o -o PWR2.5 LC DISPLAY < O co Q |> m a j m I? > > > a: a: o o OT-Nn^finiosiijiu OOOOOQOO I I MCLR © RB7 RAO/ANO IC2 RB6 RB5 RA1/AN1 RB4 RA2/AN2 RB3 RA3/AN3 RB2 RA4/T0CKI RBI RA5/AN4 RBO PIC18F2520 RCO RC7/RX RC1 RC6/TX RC2 RC5/SD0 RC3/SCL RC4/SDA ^ m ^ m SUMMER/ WINTER SCREEN 1/2 o CO o CN( o CO o C4 22p 20 MHz C5 "p 28 27 26 25 24 23 22 21 GND PI CONTRAST £ 10k GND m - 1 oo | o> J oj t GND © IC3 GND IC3B 18 / 17 4 _16_ 15 IC3A K7 ^ 1 K6 R7_ "R rs X IC3 = 74HCT04 GND GPS RECEIVER R1 K1 BACK- LIGHT V RX IC4 TX EM-406A 1PPS GND GND I 070309 - 13 Figure 7. Circuit diagram of the comprehensive autonomous GPS receiver. 10/2008 - elektor 39 GPS RECEIVER Figure 8. Component overlay for the comprehensive self-contained GPS receiver. it after you’ve read the inset about the contents of NMEA frames. Note that this software decodes frames using detection of commas (the field delimiters). Once the program has been down- loaded into the CB220, the link with the PC can be disconnected for good, and the circuit then becomes stand- alone. Moreover, since you have both the source listing and the Cubloc Stu- dio development tool, you can modify this software at your leisure if the dis- played information doesn’t suit your needs. In this way you might, for exam- ple, decode the end of the GGA frame to add a display of altitude, or the end of the RMC frame to display speed. The circuit operates as soon as the pro- gram has finished loading, but if the display only shows its blinking cursor instead of the GPS information, check its I 2 C address is correct. This is set to 1 by the program line: Set Display 2 , 0 , 1 , 50 , while the CLCD displays seem to be supplied with an I 2 C ad- dress set to 0. In that event, modify accordingly either the position of the display’s DIP switches (to make its ad- dress 1), or the program line (to use a display at the PC zero address). A comprehensive self- contained GPS receiver The above receiver is certainly perfect- ly functional and very quick to imple- ment, but it still costs quite a bit, main- ly because of the cost of the CB220 and the associated CLCD display. So now we’re suggesting you really ‘get your hands dirty’ by building a receiver from scratch. The wiring for the very simple stand-alone GPS receiver on the CB220 prototype board amounts to very little. Figure 9. Block diagram for fitting a GPS receiver into a robot. Just like the previous one, this has an LCD display with 4 lines of 20 charac- ters - but a type without serial or PC interface, and so much cheaper to buy. In addition, more and different infor- mation is provided. What’s more, our receiver is totally self-contained, as it can be powered from two 1.5 V dry cells, or better still, two 1.2 V recharge- ables. It is relatively compact, as it fits onto a PCB that mounts onto the back of the display board. The source list- ing of the software used is provided for you to download free, allowing readers to adapt it to their needs if the choices made by the author do not suit you. The receiver circuit shown in Figure 7 is easy to follow. The heart of the cir- cuit is IC2, a PIC18F2520 microcontrol- 40 elektor - 10/2008 ler. Using an IC from the PIC 18 family allows us to have an extended instruc- tion set and larger program and data memories than with the PIC 16 family, for almost the same price. It controls a standard LCD display with parallel in- terface in 4-bit mode, which explains why DB0-DB3 are not connected. The presence of switch K1 means you are free to choose a backlit display - at the price of increased power consumption, of course, but more legible in low-light conditions. The signal from the GPS receiver goes to the input of the PIC’s built-in UART, but first has to be brought up to level by IC3. This is one of the criticisms we COMPONENTS LIST GPS/PC Adaptor Capacitors Cl = 470jL/F 25 V radial C2 = 220nF MKT C3 = 1 Oa/F 25 V radial C4-C9 = lOOnF ceramic Semiconductors D1 = 1N4004 IC1 = 78L05 IC2 = GPS receiver type EM-406A (see text) IC3 = MAX242 (Maxim IC) Miscellaneous K1 = PCB mount DC adaptor socket K2 = 6-way SIL pinheader K3 = 9-way sub-D socket (female), PCB mount K4 = connector type SM06B-SRSS-RB (Digikey) made above of the EM-406A module: its logic High output level of 2.85 V is lower than the 4.00 V minimum High threshold of input RC7 on the PIC. So without IC3, the UART would never re- ceive any data whatsoever. The pushbutton connected to header K4 lets you toggle between the dis- play screens. One shows latitude, lon- gitude, altitude, and speed; the other, time (real, summer/winter depending on the position of switch S2), date, number of satellites being used, and battery voltage. Switch S2 (K2) lets you choose be- tween BST and GMT so as to display the ‘real’ time and not the raw UTC (Universal Time) provided by the sat- ellite. Switch S3 (K3) is not used in the version given here, but it’s still provid- ed for anyone who might want to add functions to this project. To obtain a high-efficiency power sup- ply, we’ve dispensed with a conven- tional linear regulator and used an LT1300 from Linear Technology (IC1). From an input voltage applied to pow- er jack header K5 between +2 V and + 5 V, this remarkable circuit provides a stabilized voltage of +5 V at a cur- rent of up to 400 mA in the configura- tion used here. So two 1.5 V dry cells or two 1.2 V rechargeables are perfect for powering this project, giving it around ten hours of operation. The battery voltage is also applied, via K5 = 4-way SIL pinheader JP1 = 3-way SIL pinheader with jumper PCB copper track layout, free download # 070309-1 from www.elektor.com Comprehensive Autonomous GPS Receiver Resistors (0.25W / 5%) R1 = 100D R2-R5 = 1 OkU R6 = 220D R7 = 0D* Capacitors Cl = 1 OO/iF 25V radial C2 = 47jL/F 25V radial C3 = 1 OnF ceramic C4,C5 = 22pF ceramic resistor R6 and protective zener D2, to input AN2 of the PIC’s analogue-to- digital converter (ADC), enabling us to display it and hence be able to judge how much operating time is left. Resis- tor R7 (0 Q = it’s a wire link!) is only fitted if you want to establish com- munication from the PIC to the GPS module and thereby be able to experi- ment with sending commands using the PIC. Construction Construction is particularly easy as there are no SMD components and the PCB is a single-sided type with a track pattern that’s easy to copy, even with limited resources, as you can see from Figure 8. The display is mounted onto the board. The choice of components presents no difficulty, but if you don’t use the rec- ommended type for LI, be careful to choose a choke capable of handling a current of 800 mA without saturating. If you don’t, the LT1300 will work bad- ly, or not at all. We have provided two options for connecting the GPS receiver. If you’re lucky enough to be able to get hold of a male header for K7, you’ll be able to solder it in place on the top of the board. If not, as in the other two cir- cuits, you can use 2.54 mm-pitch male pin headers and modify the receiver cable as explained above. The connec- tions to the various switches are like- Semiconductors LCD1 = alphanumeric LCD, 4 lines of 20 characters IC1 = LT1300 IC2 = PIC18F2520, programmed, Elektor SHOP # 080309-41 IC3 = 74LS04 D1 = 1N5817 (must be Schottky) D2 = 5.1V or 5.6V 400 mW zener diode Miscellaneous LI = 22 yL/H, Panasonic type ELC08D (e.g. RS Components) Qzl = 20MHz quartz crystal PI = 1 OkD preset H K1 -K4 = 2-way SIL pinheader K5 = DC adaptor socket K6 = 4-way SIL pinheader K7 = connector type SM06B-SRSS- TB(LF)(SN) (Digikey) Type EM-406A GPS receiver (see text) PCB copper track layout, free download # 070309-2 from www.elektor.com wise brought out on the same type of pin headers. As far as the display is concerned, we fitted 2.54 mm-pitch female strip con- tacts to the back of it and male con- tacts at the same pitch on the copper side of the PCB. This is an easy way to construct an assembly that’s easy to dismantle in the event of problems. In order to simplify the PCB layout and keep it single-sided without needing too many wire links, we’ve not fitted an ‘in-circuit’ programming connec- tor for the PIC. So it will need to be programmed using an external pro- grammer before it’s fitted into its sock- et. Elektor has described numerous projects of this type, and you’ll also find one you can build yourself on the 10/2008 - elektor 41 GPS RECEIVER author’s website. The IC is also avail- able ready-programmed via the Elektor website (see component list). The software to be programmed into the PIC is available for download from the Elektor website, as well the au- thor’s own website, in two forms: an object file (with a .hex extension), ready to be programmed into the PIC, and the source file in Mikroelektroni- ka Basic [7], since this is the compiler we used for this project. Before fitting the PIC into its socket and connecting up the display and GPS receiver, connect the batteries to the circuit and check you have got +5 V on the LT1300 output. If this is OK, you can turn off the power, fit these last el- ements, and apply power again. The display should first indicate “Acquiring Sat.’’ then “Invalid Data»while the re- ceiver is not ready. However, as soon as the receiver’s LED starts to blink, the information it provides should ap- pear on the screen. Software and incorporating into a robot The software used for this receiver is inspired by that suggested by Marcel Durieux in the Mikroelektronika forum, with a certain number of adaptations aimed at making it work with the EM- 406A receiver, not used in the original version. While the previous receiver decod- ed the frames by detecting and then counting the commas (field delimiters), this one receives a complete frame and the range into an indexed variable. The advantage of this method is that it is simpler to implement. The reception of the characters sent by the EM-406A module is taken care of by the follow- ing very short function: sub function ReadChr as byte do loop until USART_Data_Ready = 1 result =USART_Read end sub All that remains is to call it up in a loop to store the characters sent by the GPS receiver into an indexed vari- able. End-of-frame (EOF) detection can be achieved either by receiving the asterisk that precedes the checksum, or when the number of characters re- ceived is clearly greater than the maxi- mum allowed by the standard. Here’s an example: do GPSstr [i] =ReadChr if GPSstr [i] =" *" then i = 0 else i = i + l end if loop until (i=0) or (i=75) Frame decoding is then performed, ac- cording to the position of the data in the indexed variable GPSstr [i] . Ac- cording to the NMEA standard, this position is fixed for a given piece of data. Unfortunately, the EM-406A re- ceiver is a little ‘creative’ in terms of the length of the fields at the end of the RMC frame, requiring some adjust- ments in order to display the date, as you can see from a look at the BASIC listing. We won’t go right through the listing here, but have highlighted two extracts from it to help those who might want to incorporate such a receiver into a mobile robot, for example. This is ac- tually very simple with the information in this article, but we do need to draw your attention to a couple of points. The first concerns the accuracy of a GPS receiver, which is not unlimited, and depends heavily on the number of satellites being correctly received. In the best cases, we can hope for around 2 to 3 m with 7 or 8 satellites being received. When this number is reduced, the accuracy drops off rapid- ly, approaching 10 m with only 4 satel- lites. This is enough for route-finding in a car, but not for your robot to be able to pass between a chair and a table in your lounge, for example - unless of course you live in a castle! The second concerns the decoding of the GPS frames, which is a time-con- suming task, especially if you want ‘good’ accuracy, which implies con- stant position updating. So it must not be tasked to the robot’s main proces- sor, which would have to spend most of its time just doing this. So we recom- mend using the architecture given in Figure 9, where a microcontroller - and why not the PIC18F2520 of our previ- ous receiver? - receives and decodes the frames. All it then has to do is pro- vide the robot with just the required in- formation - most usually, latitude and longitude. This can take place via its SPI port for example, or over the I 2 C. In this way, the robot’s main processor is free to get on with its most important primary responsibilities, and only come and collect the ready-to-use informa- tion when it actually needs it. Conclusion Apart from suggesting three projects we hope you’ll have found interest- ing, we also hope this article has been able to answer some of the questions frequently found on the Internet about how to interface a GPS receiver with a microcontroller. ( 070309 - 1 ) Internet Links [1] Globalsat Technology Corporation: www.globalsat.com.tw GPS receiver manufacturer. Product datasheet downloading. [2] Lextronic: www.lextronic.fr Distributor for the GPS receiver and Comfile products. Downloading the datasheets and instructions for the CB220, the LCD display, Cubloc Studio and the very simple GPS recei- ver software. [3] VisuaIGPS LLC: www.visualgps.net Downloading the VisuaIGPS software. [4] GPS Track Maker: www.gpstm.com Downloading the GPS Track Maker software. [5] CommLinx Solutions: www.commlinx.com.au Downloading the GPS Diagnostics software. [6] Comfile Technology: www.comfile.co.kr Manufacturer of the Cublocs. Downloa- ding the data sheets and instructions for the CB220, the LCD display, and Cubloc Studio. [7] Mikroelektronika: www.mikroe.com Publisher of the MikroBasic BASIC compiler used for the full GPS receiver. [8] Author's website: www.tavernier-c.com Downloading of the software for both GPS receivers. [9] Elektor website: www.elektor.com Downloading the software for both GPS receivers. 42 elektor - 10/2008 .co.uk Supptmrs of PCB Soldering Equipment £ Rework Stations NEW IN STOCK 328 Working Platform 2W0 7(JW SoleterFng Sutton Online Price £74.95 Kn Ii-Kiurl^ Hri \*!-Guh <■■■ AH JDW^okltfingifiin wflhFumc i^feOTibcr n 1i toeing ftn ialck *1rg 'eviT p .. .ih-Htsir mg Elen r: V*t .-nrc 1 ! Vji I n i ik.hrKriiM.irn Pad 1C FtenunaJ Toof 2KCV&WFiHWS Online Pfke £1 39,95 j Sectoring Iron Ti r >t & Air Wintlet — ■ “ n “ - Test-pins.co.uk a* T f fl'iWM. Rmptofei t r*ab*t For Test-pins & Probes Visit www, ftfif-jD/rti, co, uk tkov* 6&cour^oxJs a$oapj>is& ww w.pcb-so I cferi ng.co.uk A|lianG*lfe b*>ddtl4fln Iftflyni'^KC^Erc. 3 +44 |0}l3S2 4MTM W WW, peb-EO Setup, transmit tab). The filtering of messages can be set up 46 elektor - 10/2008 and adapted via the Filter sub-menu. Messages can be filtered in three dif- ferent ways: liny CAN view Pfn(x - single : a CAN message with a certain Id is extracted from the data stream. - range : messages with an Id between two programmable values (‘Id start’ and ‘Id stop’) are displayed. - masked: the Id is filtered using a mask. Only those bits that have a ‘1’ in the mask field (see Figure 5) are com- pared. The values of the other bits in the received message are ignored. In the transmit list the values for the CAN Id and other data can be rep- resented in several ways. A prefix is used to show how the data is dis- played: ‘x’ stands for hexadecimal, ‘d’ stands for decimal, ‘b’ for binary and ‘c’ for ASCII. To change the display method you should click on the prefix with the mouse. Let's get started! The module is supplied with all SMD components already mounted. Only the through-hole components need to be soldered on the board (Figure 6). When the USB connector has been mounted the controller can be pro- grammed. But before you can do this, the driver for the FTDI chip (USB inter- face) has to be installed. Until this has happened you should not con- nect the module to the USB port. The most up-to-date driver can be down- loaded from the FTDI website [1]. At the time of writing these are version 1.35rl for Linux and version 2.04.06 for Windows, for which you can also download a e setup executable' called CDM2.04.04.exe. To program the microcontroller you first need to plug on programming jumper J2. Only then should you connect the USB cable (please note: J2 should NEVER be plugged on or removed while the USB cable is connected!). The computer will then detect the new hardware (in the case of Windows) and show it as a USB serial port. Download the software from the Ele- ktor website and extract the files from the zip file. Next run the pro- gram TCanFirst in the folder .../Tiny- CAN/fu_down/TCanFirst. This pro- grams the Flash Bios of the module. After a message has appeared say- ing the flashing has completed suc- cessfully you can unplug the USB File CAN Macro Fftcr Plugins View Options Help DBS I New Load Save Ex* srnp CAN Reset Setup Macros Msg. -Type Id DLC Date (I*®*) Data (ASCII) Macro PHO dear Outputs Set Outputs STD 281 i 5 IS 10 01 00 80 STD CD N i OA 20 00 02 01 STD 123 I > 48 45 4C 4C 4F HELLO STD mu ^ i 1 1 /:/. S.5 hh 77 HH . "jfDIITV STD 020 2 ! 80 OF . . Get Temp. Sensor I Gel Temp. Sensor 2 Filter messages Index Msg -Type Id DLC Data (Hex) & Test 1 STD 001 3 AA OF 19 Transmit Paste Te«r. 2 STD nn? 2 75 in Data (ASCII) ii. © 12S kBit/c | CAN: Ok. | RUN | System Onlne Figure 4. The relevant information is clearly laid out in the main window of the software. cable and remove the programming jumper (J2). After reconnecting the USB cable the red LED should light up. You are now at the stage where you can program the actual firmware. For this you need to run the program TCanProg that is found in the folder .../Tiny-CAN/ fu_down/TCanProg. When the green LED lights up you know that every- thing has completed successfully. For a future firmware update you only need to carry out the last action again (run TCanProg). The CAN monitor program can now be started. Tiny CAN View is a CAN monitor pro- gram available for both Windows and Figure 5. The filter parameters can be easily modified in the filter setup window. Figure 6. The module is really very compact and tidily laid out. The status LEDs show the current operational status. 10/2008 - elektor 47 USB-CAN ADAPTER Linux. It can be downloaded from the Elektor website via the link on the project page for this article. The pro- gram is a GNU Open Source project and has been written in C with MinGW/ GtkT- and it makes use of the GTK+ library, as we mentioned earlier. This can be downloaded from the link in [2]. Choose the Development Environment Revision and install the library. Tiny-CAN View makes an automatic connection with the USB-CAN adapter when mhstcanl.dll is chosen as the driver. In the CAN tab in the setup menu you can select maximum data rate. The other tabs aren’t required for the first run and can be ignored for now. As we mentioned earlier, the pro- gram makes use of filters to keep the data stream to a manageable level. The received data can also be stored in a file and CAN messages can be trans- mitted. Support for Standard (11-bit IDs) and Extended Frames (29-bit IDs) is built in. All required links and programs have been grouped together on the project page for this article on the Elektor website. From there it is easy to find all the software and drivers. The PCB layout for the circuit can also be found there. For those of you who find the SMD packages too small to solder, the mod- ule is also available as a kit of parts from the SHOP section of our website www.elektor.com. This kit consists of a board that has al SMD components already mounted. You are therefore left to solder only the through-hole (‘leaded’) components. ( 071120 - 1 ) r — — — — — — — — — — ______ — ______ — ______ — ______ — — — — — n • Some projects using CAN Home automation http://coroco.sourceforge.net — CARACA stands for CAN Remote Automation and Control with the AVR. CARACA is a home automation project based on a network of individually programmable circuits. These circuits can carry out different tasks, such as switching devices on or off, decoding signals from IR remote controls, controlling thermostats, and so on. Each node in the network can communicate with any other node via the robust CAN protocol and the status can be monitored on a PC, which in turn can be connected to the Internet. Toyota Prius www.eoa-phev.org/wiki/Prius_PHEV_User_lnterfoces — On this page the possibilities are discussed regarding the modification of the user interface and the State Of Charge Manipu- lation in the Toyota Prius. Such a device should be able to deal with the logic as described in the Prius PHEV Pseudo Code. Satellite http://con-do.moroco.info — CAN-Do! is a microcontroller (widget) that was designed for use as an interface to the wiring harness of a satellite and use this network to gain access to the integrated Housekeeping Unit that manages the different satellite subsystems. The pri- mary aims are the reduction in the required amount of cabling and the simplification of the integration in a space ship. Internet Links m www.ftdichip.com [2] http://gladewin32.sourceforge.net [3] www.mhs-elektronik.de/tiny-can 1 Temperature control www. ece. usu. edu/ experiences/5770_projects/zone_heoting_system_sp03/index.htm i - On this site a system is described that has been developed by a group of students, and i which controls the temperature in a number of separate rooms within a house. A computer 1 program is used to set the temperature for several 'zones' and to view the current status. A dedicated controller keeps track of the status i of each zone and turns on the heating or air i conditioning when required. 1 The main controller communicates via a CAN bus with the zone controllers, which control i the valves in the central heating system and i which return the temperature to the main con- 1 trailer. The PC communicates with the main controller using a standard serial link. L ______ ______ ______ ______ ___ ______ _J 48 elektor - 10/2008 FRONT PANELS & HOUSINGS Cost-effective single units and small production runs Customized front panels can be designed effortlessly with the Front Panel Designer. The Front Panel Designer is available free on the Internet or on CD. • automatic price calculation • delivery in 5-8 days • 24- Hour-Service if required Schaeffer AG • Nahmitzer Damm 32 • D-12277 Berlin • Tel +49 (0)30 8058695-0 Fax +49 (0)30 805 8695-33 • Web info@schaeffer-ag.de • www.schaeffer-ag.de Sample price: 32,50€ plus VAT/shipping tel. 01298 70012 fax. 01298 70046 www.peakelec.co.uk sales@peakelec.co.uk gfectroilc de? Handheld Test Gear - Cool, Smart. Atlas DCA Atlas ESR Atlas DCA Model DCA55 Semiconductor Analyser Identifies type and pinout! Atlas ESR Model ESR60 ESR and Capacitance Meter Resolution of 0.01 ohms! Atlas LCR^'Jj Atlas SCR Atlas SCR Model SCR100 Atlas LCR Model LCR40 Inductor, Capacitor, Resistor Analyser Triac and Thyristor Analyser Automatic part identification. Auto gate test current up to 100mA UK: Please add £1.00 p&p to your order. Prices include UK VAT. Please see website for overseas pricing. j, n*r. Parallax We wrote the book on microcontroller education For over 1 0 years Parallax has provided free curriculum and software to students of all ages. www.parallax.com Milford Instruments (+ 44 ) 1977 683665 http://www.milinst.com 10/2008 - elektor 49 MICROCONTROLLERS Burkhard Kainka The port pins are the gateway between real world events and the microcontroller. The user can send out control signals and read back information. Here we give a few simple programming examples to quickly get you started inputting and outputting data. A look at the data sheet gives some insight into the com- plexity of the port architecture of these microcontrollers (Figure 1). The ports can be configured as output or input (with or without pull-up resistors). Despite their complexity they are quite easy to use and only three important registers are needed to define the port configuration: The Data Direc- tion Register (DDRx), the Port Output Register (PORTx) and the Port Input Register (PINx). There is also a single PUD bit Figure 1. The ATmega port architecture. WPx: WRITE PINx REGISTER 080551-11 (pull-up disable) which disconnects all pull-ups. The follow- ing example programs begin by using Port B. Reading input values After a reset the internal Data Direction Register is reset to zero which configures all the ports as inputs. The Port Register is also reset to zero. In this condition the port pins look to the outside world like typical high impedance dig- ital CMOS inputs (Figure 2). With all the inputs open-cir- cuit the value stored in PINB is random and changes if you touch the pins with your finger (first discharge any static charge you may be carrying). Listing 1 uses Port B as an input port. The following is an example of values you will see on the screen. 63 0 61 0 The values of PINB are changing but PORTB remains at zero, which is not surprising because we have not yet changed the port output register. PORTB is displayed in this example just to underline the difference between the PINB and PORTB registers. Experience has shown that this causes a great deal of frustration for newcomers who con- fuse the two register names: "how come I get a reading of zero when there is 5 V on the input pin?" The answer of course is that you should not read PORTB but PINB (read it as Port In B) to get the value of the input pin. 50 elektor - 10/2008 Writing to an output port The second example outputs data from Port B. It is neces- sary to write to the Data Direction Register to configure B as an output port. In BASCOM-AVR there are two ways this can be achieved; you can use the Register notation method (Ddrb = 2 55) or the BASIC version (Conf ig Portb = Output) either method has the same effect. To run this example it's necessary to change the Goto instruction at the beginning of the program to read Goto Test2 and recompile. To turn on alternate LEDs at the output port the decimal value 85 is written into Portb. Listing 2 includes the hexa- decimal (&H55) and binary equivalent (&B01 010101) of this value, they are only included to demonstrate alternate formats. All of the LEDs on portB are switched (Figure 3) to produce the lighting effect (the LED boogie-woogie!). The Me ga32 has all eight port lines available for use but the Mega8 or Mega88 uses port pins PB6 and PB7 for connection of a crystal. When the fuses are configured to use an external crystal these two port pins are no longer available as I/O. The same is true for other dual purpose pins i.e if the hardware UART is used PDO and PD1 are not available as I/O pins. Using the pull-up resistors When the inputs are connected to devices like switches or optocouplers (with open-collector outputs requiring a load resistor connected to VCC) it is ideal to use the built-in pull- up resistors instead of fitting additional external resistors (Figure 4). Writing a 'O' to any of the DDRx bits config- ures the port pin as an input and writing a 7 1 ' to the cor- responding PORTx bit connects a pull-up resistor to that pin (Listing 3). With nothing connected to the inputs the program displays: 63 255 63 255 When the pull-ups are used the quiescent state of the input pin is a logic 7 1 7 so external signals must pull the input low. Connecting PBO to ground produces an PINB value of 62. With an input shorted a current of around 1 00 |jA flows to ground which indicates that the pull-up resistor has a value of 50 kQ. This corresponds well with the 20 kQ to 1 00 kQ range quoted in the datasheet. measuring Capacitance The ATmega port architecture is very versatile and allows a very simple capacitance meter to be built. The capacitor under test (in the range 1 nF to 10 |jF) is simply connected directly to port PBO and ground (Figure 5). The program Test 4 (Listing 4) first discharges the capacitor by output- ting an active low level. The internal pull-up resistor is then enabled which charges the capacitor. The program meas- ures the time taken for the capacitor voltage to reach a logic 7 1 7 (2.5 V approximately). The value of capacitance is proportional to the charge time. It is necessary to calibrate the unit because of the manu- facturing tolerances in the values of both the pull-up resist- ance and the input voltage threshold. Calibrate using a close-tolerance capacitor and change the multiplication factor (0.0730) to obtain a result corresponding to the 080551 - 12 Figure 2. A floating CMOS input. Listing 1 Port input 'Bascom ATmega Ports $regfile = "m88def.dat" $crystal = 16000000 Baud = 9600 Goto Testl Testl : Dim D As Byte Do D = Pinb Print D D = Portb Print D Waitms 300 Loop Listing 2 Port output Test2 : Config Portb = Output ' Ddrb = 255 Portb = 85 Portb = &H55 Portb = &B0 1 010101 Waitms 200 Portb = 170 Portb = &HAA Portb = &B1 0 101010 Waitms 200 Loop .. . n >- c c h M D f .. . J l i 1 080551 13 Figure 3. Connecting an LED. 10/2008 - elektor 51 MICROCONTROLLERS Figure 4. The internal pull-up resistors. Figure 5. The principle used for capacitance measuring. Figure 6. Connecting a unipolar stepper motor to the ATM 18 test board. Pullup ( * 1 • I i Pullup c LJ £ r> _ • !> ! \ A i ± c * \ i I - i T 080551 - 15 stated capacitor value. The measurements show some vari- ation but should be accurate enough for most applications. Repeated measurements of the same capacitor gave the following spread: 1009 nF 1001 nF 1005 nF 1002 nF Listing 3 Using the pull-ups Test3 : Ddrb = 0 Portb = 255 ' Pullups Do D = Pinb Print D D = Portb Print D Waitms 300 Loop required to drive inductive loads (e.g. motors or relays) it is necessary to connect the common cathode of the chip's protection diodes (pin 9 on IC2 or pin 8 on K6) to the load supply voltage pin 2 on K2 (VIN). The supply voltage on K2 depends on the type of motor used and can be in the range 6 V to 12 V. Two pushbuttons are connected to PB0 and PB1 to provide direction control of the motor. The BASCOM program is really simple, it just sequences through all four phases with four variables Phase(l) to Phase(4). In the case where the motor just vibrates instead of rotating it is a simple job to swap phases in the program and saves changing the motor connections. The programming examples Test5 to Test7 in Ports. bas (free download from www.elektor.com) contain several exercises to drive a stepper motor one of which shows how to build an analogue voltmeter where the motor controls the needle position. ( 080551 - 1 ) Driving a stepper motor Those of you who have a unipolar stepper motor (maybe salvaged from an old printer or 5.25-inch disk drive) may wish to experiment using this next example. Flere the micro- controller uses the ULN2003 open-collector driver chip on the Elektor ATM1 8 test board (Figure 6). Only four outputs are required so we use pins PC0 to PC3. When this chip is Listing 4 Capacitance measurement Test4 : 'C-meter 1 nF . . lOpF Dim T As Word Dim C As Single Dim S As String * 10 Do T = 0 Ddrb .0=1 Portb .0=0 'low Z, 0 V Waitms 1000 Ddrb .0=0 Portb .0=1 ' Pullup Do T = T + 1 Loop Until Pinb.O = 1 C = T * 0 . 0730 C = Round (c) Print C ; " nF " Loop 52 elektor - 10/2008 QUASAR electron ics Quasar Electronics Limit PO Box 6935, Bishops Stqrtford CM23 4WP, Tel: 0870 241 ed United Kingdqm 6 1826 Fax: 0870 460 1045 E-mail: sales@quasarele ctronics.com Web: www.(puasarElectrj>nics.com 08717 Postag^ 3-7 Day Europe 'Order We acc to Quas Please 95 & Packing Op Delivery - £3 (EU) -£6.95; R4 (inline for reduq opt all major cr ar Electronics, visit our online projects;, modules and ions (Up to 0.5 UK Mainland st of World - £! ed price UK Pc idit/debit cards Prices include shop now for publications. Credit Card Scales : UK Standard fery - £8.95; I) gross weight) Next Day Deliv f).95 (up to 0.5Kg stage! . Make cheque^/PO’s payable 17.5% VAT. details of over 5 Discounts for b d 177 00 kits, Ik quantities. 168 The Electronic Kit Specialists Since 1993 Motor Dirivers/Controllein Here are just a few of our controller and driver modules for AC, DC, Unipolar/Bipolar s;tepper motors and servo motors. See website for full range and Pdetails. O! for ntrollels & Lodgers data acquisition See website for SI! Here are just a few of the controller and full details. S all units: Order Code PSU and control units we have uitable PSU 445 £8.95 Computer Controlled / Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vdc 5, 6 or 8-lead unipolar stepper motor rated up to 6 Amps. Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode for CNC use. Connect up to six 3179 driver boards to a single parallel port. Board supply: 9Vdc. PCB: 80x50mm. Kit Order Code: 3179KT - £12.95 Assembled Order Code: AS3179 - £19.95 Computer Controlled Bi-Polar Stepper Motor Driver Drive any 5-50Vdc, 5 Amp bi-polar stepper motor using externally supplied 5V lev- els for STEP and DIREC- TION control. Opto-isolated inputs make it ideal for CNC applications using a PC running suitable software. Board supply: 8-30Vdc. PCB: 75x85mm. Kit Order Code: 3158KT - £17.95 Assembled Order Code: AS3158 - £27.95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32Vdc, 10A) in both the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166v2KT - £17.95 Assembled Order Code: AS3166v2 - £27.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15Vdc. Box supplied. Dimensions (mm): 60Wx100Lx60H. Kit Order Code: 3067KT - £13.95 Assembled Order Code: AS3067 - £21.95 lost items are available in >r assembled and ready for kit form (KT suffix) use (AS prefix). 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay outputs. 4 isolated digital inputs. Useful in a variety of control and ^sensing applications. Con- trolled via serial port for programming (using our new Windows interface, terminal emula- tor or batch files). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £54.95 Assembled Order Code: AS3108 - £64.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located 200m+ from board. Wide range ot tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £17.95 Assembled Order Code: AS3145 - £24.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £44.95 Assembled Order Code: AS3180 - £54.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. Not BT ap- proved. 130x110x30mm. Power: 12Vdc. Kit Order Code: 3140KT - £54.95 Assembled Order Code: AS3140 - £69.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m+ range. 112x122mm. Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £47.95 Assembled Order Code: AS3142 - £59.95 PIC & ATM EL Programmers We have a wide range of low ATMEL Programmers. Comply documentation available from Programmer Ac 40-pin Wide ZIF 18Vac Power su Leads: Parallel (LDC441) £3.95 / cost PIC and te range ancj bur web site cessories : socket (ZIF4( pply (PSU01 (LDC136) £3. USB (LDC64 0W) £14.95 0) £18.95 05 / Serial 4) £2.95 NEW! USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP software. Wide range of supported PICs - see website for complete listing. ZIF Socket/USB lead not included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £39.95 Assembled Order Code: AS3149E - £49.95 ft - NEW! USB 'All-Flash' PIC Programme^ USB PIC programmer for all ‘Flash’ devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included. Assembled Order Code: AS3128 - £44.95 “PICALL” PIC Programmer “PICALL” will program virtu- ally all 8 to 40 pin serial- mode AND parallel-mode (PIC16C5x family) pro- grammed PIC micro control- lers. Free fully functional software. Blank chip auto detect for super fast bulk programming. Parallel port connection. Supply: 16-18Vdc. Assembled Order Code: AS31 17 - £24.95 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. Program/ Read/ Verify Code Data, Write Fuse/Lock Bits, Erase and Blank Check. 4 LED’s display the status. ZIF sockets not included. Supply: 16-18Vdc. Kit Order Code: 3123KT - £24.95 Assembled Order Code: AS3123 - £34.95 PI W ww w.Qi uasarElectnpnics O O « n J™ Se cure Online O rdering Facilit ies • Full Proc Juct Listing, D escriptions & Photos • Kit [ Jocumentatior l & Software C downloads TEST EQUIPMENT Gert Baars (The Netherlands) The instrument described in this article combines the functions of a sweep frequency generator ('wobbulator') and a spectrum analyser. In the SFG mode, it can be used to measure the frequency characteristics of selective components or circuits at frequencies up to 450 MHz. The spectrum analyser mode can be used to measure the outputs of circuits and equipment, as well as antennas. The measuring system described here consists of two parts: a hardware module in a separate enclosure with all the signal inputs and outputs, and software that runs on a PC under MS Windows. The measurements are dis- played in graphic form on the PC moni- tor, and the user can configure all the variables and options as desired via the keyboard. A major advantage relative to many commercial stand-alone instruments of this sort is the large screen area. In addition, the measured characteristics can easily be saved to disk or printed out. Beside the two measuring modes already mentioned, the instrument can be used to generate a signal with a fixed frequency in the range of 5 kHz to 450 MHz, which means that it can be used as a test transmitter. As the spectrum analyser is essentially a direct-conversion receiver, the instru- ment also includes an audio output. This allows it to be used to listen to AM or FM radio signals. A VFO (varia- ble frequency oscillator) function is also included, which allows any desired off- set frequency to be configured for the first post-mixer (IF, intermediate fre- quency) stage of the receiver. The software also has an option for making measurements with a SWR bridge. An SWR (standing wave ratio) bridge (which can be connected exter- nally) can be used for direct measure- ment of the standing-wave ratio of a device such as a 50-Q antenna. Block diagram The original intention was to simply make a sweep frequency generator (SFG) for frequencies extending as far as the UHF (70 cms) band. However, the idea of adding a spectrum ana- lyser function arose quite quickly. This is only natural, since an SFG already includes a large number of the ele- ments necessary for a spectrum ana- lyser, such as a DDS (direct digital synthesizer) IC, a logarithmic detec- tor, and a microcontroller with an A/ D converter and UART. The main addi- tional elements that are necessary are a mixer and some IF filters. Of course, the software must also be able to make use of both functions. The block diagram (Figure 1) thus rep- resents two different circuits that can be selected by the control function. The control function, which takes the form of a microcontroller, is connected to a PC via a serial link, and it receives commands and parameters from the PC. Based on the received commands and parameters, the microcontroller executes tasks that generate data, which is then returned to the PC where the data is processed and displayed by software running in the PC. Thanks to this approach, the user can operate the entire system from the PC and the measured data is displayed in graphic form. Sweep Frequency Generator portion The sweep signal for the instrument is generated by a direct digital syn- thesizer (DDS). The DDS operates with a reference frequency (REFCLK) of 1000 MHz, and it can generate sig- nals up to 450 MHz with a step size of 0.24 Hz. As the DDS provides samples at a 1000-MHz rate, the output signal can be regarded from a mathemati- cal viewpoint as being multiplied by 1000 MHz. This generates spurious products that make output filtering necessary, and this is provided here by a 450-MHz lowpass filter. As two signals are necessary because a local oscillator (LO) signal must also be sup- plied to the mixer, the filter is followed by a two-way splitter with an imped- ance of 50 Q. The SFG (‘wobbulator’) output signal from the splitter has an amplitude of approximately -8 dBm (90 mV eff into 50 Q), which makes it quite suitable for measuring the pass characteristics of a wide variety of fil- ters. In the spectrum analyser mode, the wobbulator output is terminated in 50 Q in order to avoid influencing 54 elektor - 10/2008 Technical Specifications Sweep Frequency Generator Horizontal: Maximum frequency: 450 MHz Minimum usable frequency: 5 kHz Sweep: any desired scan between DC and 450 MHz Resolution: 1 /650 of the scan width Sweep rate: 0.2, 0.5, 1 , 2, 5, and 10 s/scan Linear or logarithmic frequency scale Vertical: Range: 0 to approx. -60 dB Resolution: 1 dB Accuracy: approx. 2 dB Output: 50 D, -8 dBm Input: 50 Q or active probe with 1 MD // 4 pF input impedance Spectrum Analyser Horizontal: Maximum frequency: 450 MHz Minimum usable frequency: 0.1 MHz Sweep: any desired scan between DC and 450 MHz Resolution: 1/650 of the scan width Sweep rate depends on scan width, detection bandwidth and accu- racy; range approx. 0.25 s to 30 s Vertical: Range: 0 to approx. -80 dBm Resolution: 1 dB Accuracy: Average ±2 dBm (in part dependent on scan rate) Detection bandwidths: 25 kHz and 100 kHz Input impedance: 50 D or active probe (1 Mf2 // 4 pF) the amplitude of the LO signal for the mixer. The SFG input (on the right in the block diagram) can be 50 Q or an active probe with a input impedance of 1 MQ // 4 pF, which is nice for working with filters because they often require a matching impedance much greater than 50 Q. This way the attenuation due to mismatching is much smaller, which means that the vertical meas- uring range is much larger. The probe also provides many other benefits with all sorts of measurement tasks for which low loading is desirable. The signal on the SFG input is first preamplified. The resulting output sig- nal closely approaches the maximum input level ( + 17 dBm) of the subse- quent logarithmic detector, which also increases the vertical measuring range. The detector is followed by a low- pass filter to ensure that only the ‘DC’ component (in a manner of speak- ing) reaches the microcontroller’s A/D converter. 10/2008 - elektor 55 TEST EQUIPMENT Figure 1. Block diagram of the sweep frequency generator / spectrum analyser. Obviously, the frequency response of the device under test (DUT) can be measured by connecting the wobbu- lator output to the DUT input and the DUT output to the SFG input and then performing a frequency scan. Spectrum analyser portion The spectrum analyser operates on the direct-conversion principle. This provides a number of benefits. To start with, it allows the IF filters to take the form of lowpass filters, which are easy to make as DIY filters. Another important benefit is that the image frequency is referenced to the LO fre- quency, which has the significant effect of making the bandwidth twice as large as that bandwidth of the post- mixer filter. This way, bandwidths of 25 kHz and 100 kHz are obtained with 25.5-kHz and 50-kHz lowpass filters. The software ensures that the right measurement data is displayed. The input of the spectrum analyser is connected directly to the mixer. The type of mixer used here is marked by very high linearity. A preamplifier ahead of the mixer would only make things worse. The post-mixer filter is followed by an amplifier, which boosts the signal amplitude to a level that matches the range of the subsequent logarithmic detector. The same detec- tor is used for the spectrum analyser and SFG functions by switching the signal paths according to the operating mode. The remaining hardware is the same as for the SFG, with the major difference being found in the software for the spectrum analyser and sweep frequency generator functions. Schematic diagram Sweep Frequency Generator input preamplifier The input stage of the SFG consists of a broadband amplifier in the form of an ERA-5 IC (IC1) from Minicircuits [1]. This 50-Q stripline broadband ampli- fier was chosen for its high IP3 and 1-dB compression point. In simplified terms, this means that the input stage has good immunity to the generation of undesired spurious products in the presence of large input signals, which could cause false measurement results, but it can still supply adequate out- put power. The gain of the ERA- 5 is a constant 22 dB from DC to 1000 MHz, which makes it more than suitable for the desired bandwidth of 450 MHz. This MMIC also has a noise figure that is low enough for our application. Detector In order to achieve a large dynamic measuring range, we decided to use a logarithmic detector. The Analog Devices [2] AD8307 (IC7) used here has a bandwidth of DC to well over 500 MHz, and it outputs a DC voltage that is proportional to the level of the input signal in dBm. The input sig- nal range of this detector is approxi- mately -75 dBm to -I- 17 dBm. The max- imum level ( + 17 dBm) is somewhat on the high side, which is why the previ- ously mentioned ERA-5 preamplifier is included in the circuit. Another impor- tant aspect of this logarithmic detector is that it can track fast changes in the input level. This is necessary to avoid an excessively long delay for sweep generation, so the time required to per- form a sweep can be kept within rea- sonable limits. A simple lowpass filter (R25-C83-R26- C84) after the detector prevents resid- ual signal components from reaching the A/D converter. A/D converter The A/D converter is integrated in the microcontroller (IC12). This 10-bit suc- cessive-approximation A/D converter provides 10-bit conversion results with a conversion time of approximately 110 \is. It can also operate at higher conversion rates, but this comes at the cost of accuracy. The advantage of 10- bit resolution is that if desired, the ver- tical scale can be enlarged while still maintaining relatively high accuracy. As a result, a vertical scale of 25 dB still has the same accuracy as a verti- cal scale of 100 dB. Microcontroller The hardware is controlled by a micro- controller in the form of an Atmel type ATmega8535 [3]. This 8-bit RISC micro- controller can achieve 16 MIPS (million instructions per second) with a clock rate of 16 MHz. However, we use a 14.7456-MHz crystal here so that the baud rate of the integrated UART can be set to exactly the desired value of 115,200 baud. Among other things, this microcontroller features 8 kB of flash program memory, an 8 -channel / 10-bit A/D converter, 512 bytes of RAM, and a serial UART, which make it an out- standing choice for this application. The link between the UART and the COM port requires level conversion in order to adapt the signal levels of the UART ( + 5 V / 0 V) to signal levels of the COM port (±12 V). A Maxim [4] MAX232 (IC11), which requires only a few external components, is used for this purpose. DDS The sweep signal for the SFG output and the LO signal for the spectrum analyser mixer are generated by an Analog Devices AD9858 (IC12). The outstanding feature of this particular DDS IC is its high clock speed, which extends to 1 GHz. This very advanced DDS makes it easy to generate fre- 56 elektor - 10/2008 quencies up to 450 MHz with 32-bit precision, which amounts to a step size of 0.233 Hz. In addition, this 100- pin DDS IC has extremely low phase noise (more than 145 dB below the car- rier level). It can also be controlled in parallel or serial mode. Even the serial mode is more than fast enough for use as a sweep generator. Another feature of this IC, which is not used in this design, is that it can store four exter- nally selectable frequency profiles for ultra-fast frequency hopping. Another noteworthy aspect is that the DDS chip must be powered from 3.3 V, while the maximum dissipation can be as much as 2 watts. In addition to the DDS, the AD9858 houses a PLL and a mixer. They are also user-programmable, but they are disabled in this application by means of software initialisation and not used in the circuit in order to avoid unneces- sarily increasing the power dissipation. The full-scale output current of the DDS is set by an external resistor. Here we chose a safe figure of 20 mA. Accord- ing to the manufacturer, this yields the least amount of spurious products. DDS reference clock One thing that initially appeared to be a problem was generating a sta- ble 1-GHz reference clock signal for the DDS. Solutions such as a crystal oscillator with multipliers or an extra PLL appeared to require an undesira- ble number of additional components, while a simple free-running oscillator might drift too much. Consideration was also given to using the internal PLL of the DDS IC for this. We discovered that a 1000-MHz SAW (surface acoustic wave) resonator is available from Tai-Saw [5], with type number TC0306A. A supplementary benefit of a reference oscillator built around this sort of resonator (X2) is that it does not have to be adjusted, and any small deviations can easily be compensated in the software (a cali- bration feature is provided for this). DDS output filter As already mentioned, the digital technique used to generate DDS sig- nals inherently causes spurious prod- ucts to be generated as well. There are also residual components of the 1000-MHz clock in the output signal. A 450-MHz, seventh-order Chebyshev filter was developed to eliminate them. The inherent impedance of the filter is 50 Q, and it has four trim capaci- tors that must be used to adjust it for proper response. The chance of devia- tions would be too large if fixed-value components were used here. Inciden- tally, the adjustment is not difficult, and it can be performed directly with the aid of the sweep frequency gener- ator, so no additional instruments are needed. A certain amount of ripple can be seen on the screen when the filter is properly adjusted, and there is some roll-off due to the reduced sensi- tivity of the AD8307 detector as well as the reduced amplitude of the DDS signal. However, the software has a calibration function that can be used to restore a perfectly straight-line characteristic. The filter is followed by a simple 50- Q splitter to yield two output signals: one for the wobbulator output and the other for the LO input of the spectrum analyser mixer. As both outputs of the splitter must always see a 50-Q load, the microcontroller connects a 50-Q termination resistor across the wobbu- lator output when the spectrum ana- lyser is being used. Mixer Very high requirements are placed on the mixer for the direct-conversion spectrum analyser. A balanced-diode mixer is far from being good enough, due to the low isolation between the ports, and its switching behaviour is an even larger drawback. The multi- plication of the LO signal with the RF signal must be as linear as possible, which is only possible with a good active mixer. An outstanding mixer for this appli- cation is the AD831, once again from Analog Devices. This special low-dis- tortion mixer produces very low dis- tortion even with relatively large input signals, it has sufficient isolation, and it can be used with input and LO sig- nals up to 500 MHz. With this mixer, the LO input is usually driven into saturation. For this purpose, it has an internal amplifier for the LO signal. However, the LO signal can be sup- plied via an adjustable attenuator so that the signal amplitude can be set to exactly the level that yields the least distortion. This can be done quite eas- ily by scanning a signal in spectrum- analyser mode. If the LO signal ampli- tude is too high, a spike will be seen at f/3 of the input signal. The adjusta- ble attenuator can be set to reduce the level of this spike until it just disap- pears in the noise floor. It is important to reduce it to just this level and no fur- ther, as otherwise the mixer will atten- uate the signal more than necessary. The adjustable attenuator is imple- mented using a PIN diode so that it can be used at high frequencies. The mixer also has an internal output amplifier, which we are happy to use here because it is better to amplify the signal before the IF filter, since the noise voltage is directly proportional to the bandwidth. This allows a lower amount of IF gain to be used, which also results in less noise. In this way we manage to achieve a noise floor of approximately -80 dBm. The mixer must have an output impedance of 50 Q in order to properly match the impedance of the IF filters. The cou- pling capacitors at the output deter- mine the lowest intermediate fre- quency, and they must have a rela- tively high value. Otherwise a visible dent in frequency response will occur when the scan width is fairly small relative to the bandwidth of the IF fil- ter, due to the direct-conversion prin- ciple. With larger scan widths, which of course will most often be used in practice, this phenomenon is com- pensated in software and the display shows taut, needle-shaped frequency lines. Post-mixer filters The filters ‘behind’ the mixer deter- mine the bandwidth of the spectrum analyser. We decided to use two selectable filters with bandwidths of 12.5 kHz and 50 kHz, respectively. Due to the direct conversion principle, the bandwidth is doubled to 25 kHz and 100 kHz. These filters should be as steep as possible. The desired prop- erties can be approximated with 1 1 th - order elliptical filters - which means a flat amplitude characteristic up to the corner frequency, followed by a very steep skirt so that the base width is small enough for this application, even at -80 dB. We achieved this by wind- ing our own coils on toroidal cores. The 14-mm 4C65 cores that we used have a mUi specification of 125. This is not especially large for a toroidal core, but it must be said that toroidal cores with very large mu values are almost always made from a material with a relatively high ohmic resistance. This results in core losses, which in turn reduce the Q factor. Here we used ordinary MKT capacitors with good results. A sup- plementary benefit of using toroidal cores is that they are usually rather insensitive to external fields. The two IF filters are selected by a set of TQ-2 relays operated by the micro - 10/2008 - elektor 57 PROJECTS TEST EQUIPMENT J? C2 R2 PI T1 Iprobe I K1 IC1 \-5 SM C30 II C27 Cl 3 C8 ”^C9 Iprobe K2 (5v}-» . SA son BF979 CIO II lOOn 50kHz lOOn 1 9 12 3 2 20 D3 D4 2x MA4P7001 C11 II R5 VP VP VP AN IFN IFP AP RFP OUT VFB CM 2* 17 hr RIO - | 49 09 h C23 lOOn MF IN RE1 II II 47T _rww 65T ^C25 ^C26 Jci ^5n ^7n5 ^68n ^7c C33 C35 JHHh C37 R15 yYYYV 69T lOOn _/- YYYV 58T lOOn 50kHz MF OUT 47n RE2 C41 C51 C55 AD831 R7 II RE1 GND COM VNVNVNGNDI LON LOP 5 8 15 1 3 lOn lOn [Z}= R9 1N4148 TQ2-12V T3 BS170 12kHz5 102T C45 _/'V'V'v''v_ 143T C48 11 II 10r C5 . II 2 . II lOn C56 II II 4n7 L10 1 V V \ , II 4n7 L1 1 128T 60T +9M Jc39^C40 Jc43^C44 Jc46^C47 Jc49^C50 Jc53^C54 ^C57^C5 ^?3n ^33 n ^220n^68n ^330n^r0 0 n^330n^47n ^000^001^3311 ^ ?7i II II !! RE2 1 | D6 -"{23 Z TQ2-12V 10 1 T4 1N4148 — 1 |\ BS170 C62 n 470n R14 R16 C63 BA479S BS170 R22 H 1M H IC14 LI 6 lOfiH +9M -© IC15 R49 Cl 29 Cl 30 =] ■ ■ r m A lOp lOOn R12 " Ik MIX LO R13 BS170 T7 L22 L23 T I L24 ^^103 T| lOOn Cl 00 lOOn X2 TC0306A R24 R25 HI— 1000MHz 4b R26 HI— lOOn Cl 02 lOOn Cl 04 lOOn 93 94 31T32T35J36T 40 43 44 47 70 73 Til BFR93A R17 QOOQOQOQOQ OOOOOOOOOO 34 AVDD AVDD AVDD AVDD REFCLK D9 SMBJ3V3 IC9 IS K5 RS232 v+ _ C1 + © IC11 Cl- T20UT T2IN TIOUT T1 IN R2IN R20UT RUN RIOUT C2+ MAX232 C2- V- 16 C88 lOOn A IN LI 8 LI 9 lOpH 29 L20 28 L21 lOpH 27 lOpH — C90 lOOn 10 14 LI 7 lOOpH 84 R35 IC12 81 82 30 vcc AVCC RESET PBO/TO/XCK IC10 PB1/T1 PAO/ADCO PB2/AIN0/INT2 PA1/ADC1 PB3/AIN1/OCO PA2/ADC2 PB4/SS PA3/ADC3 PB5/MOSI PA4/ADC4 PB6/MISO PA5/ADC5 PB7/SCK PA6/ADC6 PA7/ADC7 AREF ATmega8535 -PDIP PC7/TOSC2 PD7/OC2 PC6/TOSC1 PD6/ICP1 PC5 PD5/OC1 A PC4 PD4/OC1 B PC3 PD3/INT1 PC2 PD2/INT0 PD1/TXD PC1/SDA PDO/RXD PCO/SCL -Li XTAL1 XTAL2 -1- 12 15 31 C95 18p 13 XI I I 12 C96 18p 2k2 2k2 2k2 I R27 . | R28 I R29 -| 2k2 [ R30 32 11 99 92 FUD RESET AD9858 DACBP DACISET REFCLK IORES RD/CS DGND DGND DGND DGND o o z z o o Q Q OOOOOOOOOO CPGND CPGND AGND AGND AGND OOO OOOOOOOOOOOOO <<<<<<<<<<<<< 95 96 29 30 37 38 39 41 42 49 50 52 69 74 80 XI = 14, 7456MHz C94 58 elektor - 10/2008 040360-11 controller in response to a command from the PC application. Post-mixer amplifier Like the mixer, the amplifier that fol- lows it must have very good charac- teristics. We chose the AD8099, which is listed as an opamp with extremely low distortion and noise. This opamp - which is also affordable - is made by Analog Devices. It has an enormous bandwidth of no less than 3.8 MHz, which is not especially important for this application but certainly worth mentioning. The very low noise contri- bution of the IF amplifier is especially important because it keeps the noise floor of the spectrum analyser as low as possible. The noise is reduced even further by dimensioning the input sec- tion of this IC for an AC impedance of 50 Q, which matches the impedance of the IF filters. A simple lowpass filter is located at the output of the intermedi- ate frequency amplifier to restrict the noise spectrum. Active probe An active probe is included because 50 Q would be too much of a load for many measurements. It has been kept as simple as possible and consists of only five components (Figure 4). It can thus be built into a small external enclosure, such as the body of a ball- point pen or felt pen. The probe has an input impedance of 1 MQ // 4 pF and a maximum usable frequency of about 450 MHz, and it can be used with the spectrum analyser as well as the SFG. As the probe attenuates the signal slightly, a separate calibration button is included in the software to compen- sate for all the deviations. The cali- bration data is saved automatically in specific .ini files so it can be reused. This means that the calibration only has to be performed once. When the instrument is switched to work with- out the probe, the standard calibration file is automatically read from disk and used. For convenience, the probe is pow- ered directly from the hardware. An approach using chokes is not desira- ble here. Large chokes are necessary for low frequencies, and they usually have high internal and stray capaci- tance. A simpler and better solution Figure 2. The resulting schematic diagram is rather extensive. The DDS IC occupies a central position here. is to power the probe with a DC cur- rent. For this purpose, a switchable current source is provided at the SFG input and the spectrum analyser input, in the form of a PNP transistor (T1 or T2, respectively) with an adjustable collector current that can be switched off by the microcontroller, since a DC current could have undesirable effects when measurements are made without the probe. The ‘Use Probe’ command in the Options menu of the PC appli- cation switches the probe supply on or off. In principle, any transistor can be wired as a current source, but here the collector capacitance should be as small as possible. We thus selected a UHF transistor, in this case the BF979. The probe current from each transistor can be set to approximately 14 mA by adjusting the potentiometer connected to the base. At this current, the DC voltage on the collector of the transis- tor is approximately 5 V. Input protection The inputs of the spectrum analyser and SFG are protected against exces- sive input signals. For this purpose, two PIN diodes (type MA4P7001) are connected to each input in reverse parallel. These PIN diodes from M/A- COM [6] have a blocking capacitance of 0.7 pF and the threshold voltage of each diode is 1 V, so the input signal is limited to 2 V pp . This corresponds to + 10 dBm, which both inputs can han- dle easily. Each diode can dissipate 3 W for a relatively long time, or 10 times this much for a short time. In practice, this means that the diodes will still do their job if (for example) the output of a 25-watt transmitter is accidentally connected directly to the spectrum analyser input. This is because relatively modern transceivers automatically and quickly reduce the output power in such situations due to the resulting low load impedance. The diodes have a very low imped- ance if they are overdriven, so almost all the supplied power is reflected. The author suspects that the input capac- itors will fail before the diodes if too much power is applied to the input, although arguably he has not tested this. It is thus advisable to use SMA devices with a relatively small pack- age size for the series capacitors. Then if an accident occurs, you only have to replace these capacitors. DDS power supply and cooling The DDS should be powered from a 3.3- V supply, and its current consumption 10/2008 - elektor 59 TEST EQUIPMENT 09 M R1 I — M— EQ POWER FI ki 230V -s- 100mA T TR1 F2 2A T C3 6V 10VA C4 Cl • • C2 250mA T FAN C5 cm X 4700|a 25V F3 DDS+ 800mA T C6 lOOn - 0 -® TR2 F6 D1...D8 = MBR10100 C1...C4, C7...C10 = 47n F5 s 50mA T -EEh 500mA T C9 12V 5VA CIO C7 F7 C8 v+ T □□ g ~© C11 cm 4700|a 25V 400mA T C12 lOOn - 0 -® 040360-12 Figure 3. Two power supply transformers with rectifiers and smoothing capacitors are located on a separate power supply board. is approximately 600 mA. This means that the IC must dissipate around 2 W of heat. For this purpose, the IC has a thermal pad on the bottom of the pack- age, which is supposed to make con- tact with thermal vias in the PCB that transport the heat to the bottom of the board. The necessary vias are thus present in the PCB layout. In order to do this properly, you need a reflow sol- dering oven (as described in another article in this issue). The supply voltage for the DDS IC is provide by an LM317 (IC15) set to an output voltage of 3.3 V. The input volt- age is approximately 7 V, so the voltage Uni| ^ VV -l* 1 o> a a> PROBE , T1 N D BF982 7 - 1m RG174 50 n 040360-13 Figure 4. The active probe comprises only five components. regulator must dissipate around 2 W. It is fitted with a small heat sink for this purpose. To increase the working life of all this, the author fitted a small fan in his prototype to provide forced-air cooling. The voltage regulator and its heat sink are located close to the DDS IC so that they can both be cooled by the same fan. Mains power supply A separate power supply PCB has been designed for the main power supply. It holds two mains transformers along with the necessary rectifier diodes and capacitors (Figure 3). The power sup- ply board provides supply voltages of 7 V and 12 V. A separate connector is provided for a fan if desired. Software The software consists of two pro- grams: (1) firmware (i.e. object code created from assembly language) for the microcontroller in the hardware and (2) a Delphi program for the PC. Here it should be noted that the major- ity of the tasks are performed by the PC program. Logarithmic calculations, for example, are very cumbersome in assembly language, so the Delphi pro- gram performs all intensive computa- tions and only sends simplified param- eters and commands to the ATMega microcontroller, whose primary task is to control the hardware. Communication protocol A separate protocol was created for the communication between the PC pro- gram and the firmware controlling the hardware. For each communication ses- sion, the PC sends a command to the microcontroller, which acknowledges it by returning the command (echo). After this, the PC sends a number of param- eters, such as the start frequency, scan parameters, step delay, step size, and so on. The microcontroller waits for the PC to issue a ‘start’ command before it performs a sweep using the most recently sent parameters. The results from the A/D converter are sent to the PC during the sweep. Some parame- ters are always the same, such as the scan width and the two fixed IF band- widths. These parameters are defined as constants. In this way, specific commands and parameters are sent to the hardware after certain options or actions have been selected on the PC, and the hard- ware is then instructed to perform the actual measurement. The commands have been assigned simple names, such as ‘hello’, ‘start’ and ‘data’, and the software sees them as single-byte codes. Assembly-language program The assembly-language program used to build the microcontroller firmware begins in the usual manner with a reset interrupt routine. Among other things, this routine initialises the I/O ports, the A/D converter, the UART, and the DDS. This means that their parameters are set according to the desired configuration. The main program, or ‘mainflow’, starts after the reset routine. The only thing mainflow does is to periodically check the UART receive buffer to see whether any data has been received. If it has, the program checks to see which com- mand is involved, which determines the subsequent course of action. The most important routines are the ones that execute a wobbulator sweep or a spectrum analyser sweep and send a frequency word to the DDS. There are also several auxiliary rou- tines, such as timer functions, starting and reading an A/D conversion, etc. 60 elektor - 10/2008 Delphi program The main task of the Delphi program developed for this project (Figure 5) is to display the measured charac- teristics. Delphi provides outstand- ing graphics capabilities, such as pro- cedures for drawing lines. Basically what the program does is to send com- mands and data to the hardware and then read in the measurement data. This data is collected in a buffer, and a graphic is generated after all the data has been received. The program can also send the graph- ics to the printer or save them to disk so they are stored for examination or use in documentation later on. The program has a menu bar with sev- eral options, such as selecting a fre- quency scale graduated in hertz, kil- ohertz or megahertz. You can set the start and end frequencies, or you can opt to set the centre frequency and scan width instead. The latter option is particularly convenient for measur- ing filters when the centre frequency is known. The Options menu lets you choose the speed of the spectrum analyser scan. The choices here are Slow, Normal and Fast. You can thus choose to scan faster with somewhat lower accuracy in order to obtain a quick impression of the spectrum, such as for measuring signals received from an antenna. You can also select a linear or loga- rithmic horizontal scale for the sweep frequency generator. The logarith- mic scale gives a better picture of the steepness of filters, for example, while the linear scale gives a better indica- tion of measurements with a narrow scan, such as measuring the character- istics of ceramic or crystal filters. The Options menu also has a calibra- tion function. You can calibrate the fre- quency scale, for example by scanning a signal with a known frequency. After you click the point where the centre frequency should be, the actual fre- quency of the DDS reference oscillator is known, and it is stored immediately in a calibration file. The vertical scale can also be calibrated with and with- out the probe. This also takes only a mouse click, after which the calibra- tion data is stored for subsequent use. In principle, calibration only has to be performed once, but there is no harm in recalibrating the instrument occa- sionally, since component values tend to drift over the course of time. Another option is ‘Use Probe’. If you click this option, the current sources for the active probe are enabled and the calibration file for the probe is read in and used as long as the probe is enabled. Yet another option is Adjust LPF’. If you tick this option, the max- imum frequency is set to 500 MHz instead of the usual 450 MHz. You can use this to perform a 500-MHz scan in order to adjust the DDS output fil- ter for 450 MHz. The details of this are described in the adjustment proce- dure, which is included in the supple- mentary documentation for this arti- cle available on the Elektor website as document 040360-W. In addition to the graphic display and the menu bar, the Delphi program has several Edit windows. They can be used to enter numbers, such as the frequency and decibel (dB) values that determine the scale graduations for the graphic display. There are several buttons on the screen for starting and stopping scans. There are also ‘radio buttons’ for setting the scan rate and the bandwidth of the spectrum ana- lyser. Most of the program’s user-inter- face functions can be selected and used with the mouse. When the Delphi program is closed, certain settings (including the COM port settings) are saved automatically in a file called ‘Settings.ini’, which is located in the folder containing the main program. These settings are automatically read and restored when the program is started again, so they do not have to be entered anew each time. Scanning principle The sweep frequency generator and the spectrum analyser both work with a scan width of 650 frequencies. This is not especially significant for the SFG, but in the case of a relatively broad scan with the spectrum analyser the frequency step equal to (f2 - fl)/650 may be larger than the post-mixer bandwidth. For instance, the step size is nearly 700 kHz with a scan from 0 to 450 MHz. The problem with this is that it would be easy to miss some signals. This is solved by having the hardware per- form ‘sub-scanning’. This means that the hardware independently performs a scan between two successive fre- quency values. With a scan of 0 to 450 MHz and a detection bandwidth of 25 kHz, the hardware must execute 28 steps (700/25) for each X coordi- nate. In this case the microcontrol- ler determines the largest measured value, which is then sent to the PC. This method is perfectly satisfactory, but it costs a lot of time. The scan time for 450 MHz with a 25-kHz bandwidth can easily be more than 30 seconds. However, you can use the ‘SASpeed’ command in the Options menu to increase the scan speed. This option is intended to be used to obtain a quick impression of a spectrum by accept- ing lower accuracy. With this option, a scan from 0 to 450 MHz with a band- width of 100 kHz takes only 3 seconds. Scan rates with smaller scan widths are proportionally faster, reaching as much as several scans per second. More information As this is a complex project with con- siderable scope, we have put all the practical information (such as con- struction, adjustment, components list, command summary and the soft- ware user’s guide) in a separate docu- ment, which can be downloaded free of charge from the Elektor website (no. 040360-W). The PCB layouts (040360- PCB) and PC software (040360-11) are also available on the website. A pre- programmed microcontroller is availa- ble for this project (no. 040360-41), and the circuit boards will be available in due course from www.ThePCBShop. com. ( 040360 - 1 ) Internet Links [1] Minicircuits: www.minicircuits.com [2] Analog Devices: www.analog.com [3] Atmel: www.atmel.com [4] Maxim: www.maxim-ic.com [5] Tai-Saw: www.taisaw.com [6] Ma-Com: www.macom.com 10/2008 - elektor 61 MICROCONTROLLERS ATM 18 Relay Board Have it all your own way Udo Jurss and Wolfgang Rudolph (Germany) Since time immemorial, people have always wanted to see the effects of their deeds and shown them to others. Among electronics hobbyists and professionals, this often takes the form of wanting to make some action inside a computer visible to the outside world. Today we usually refer to this as Regulation and control' instead of 'having things your own way'. Now that our ATM18 project with the levitating magnet in the last issue has become truly active, we can use a relay board to implement even more external effects. Just imagine sitting in your easy chair and using a remote control to control everything that serves your comfort and convenience: lamps, the radio, a fan, and what have you. For this to be possible, you need a few relays. Sup- port for eight loads should be adequate in most cases, so the design described here incorporates eight relays. Eight relays in turn require eight out- put lines, but this is a luxury we can- not afford here. We already kept the use of I/O lines to a minimum with the LC display, and here again we have to use them economically. For this rea- son, we have developed a suitable interface board, which enables the Mega88 to control the relays with only two I/O lines. Two I/O lines is the limit But how can you switch eight relays with only two bits? Here again, the an- swer is serial data. In other words, the bits from the test board are transmit- ted sequentially to an old standby: a 4094 shift register. In order to under- stand how the circuit works, you have to look at the data sheet for the 4094. Figure 1 shows the internal logic of Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 080357 - 12 Figure 1. Internal logic of the 4094 shift register. Clock Output Strobe Data Parallel Outputs Serial Outputs Enable Q1 Qn Qs (Note 1) Q x -T 0 X X Hi-Z Hi-Z Q7 No Change A_ 0 X X Hi-Z Hi-Z No Change Q7 1 0 X No Change No Change Q7 No Change V 1 1 0 0 Qn-i Q7 No Change s- 1 1 1 1 Qn-1 Q7 No Change 1 1 1 No Change No Change No Change Q7 Figure 2. The truth table from the 4094 datasheet. 62 elektor - 10/2008 and Port the IC, with eight flip-flops accompa- nied by eight output latches. At the Qs output (pin 9), the bits vanish into thin air after the eighth pulse on the clock input (pin 3). You could connect the data input of another shift register to this pin and use the bits for some other purpose. However, a special role is reserved here for the Q\ output (pin 10). The output of Q8 appears on this pin as well, but only on the falling edge of the clock signal. This means that it acts like a sort of ninth bit in the storage register. The truth table in the data sheet (Figure 2) shows this clearly. The Q\ output does not assume the state of the output of Q7 (Q8 in the block diagram) until the falling edge of the clock. This port expander is a small, inde- pendent circuit board that can also be used without the downstream re- lay board. Now that you understand +5V +5 V K1 0 O GND n* ^^00n 15 DATA CLK D > CLK R1 D1 16 VDD OE IC1 4094 STR VSS Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 QS QS 14 ! BAS40-6 9_ 10 4 K2 1 8 5 2 7 6 _r\_ 3 6 7 r _r\. 4 5 14 5 4 13 _r\_ 6 3 12 r _r\. 7 2 11 8 1 U J 10 18 17 16 15 14 COM > IC2 08 07 06 05 04 O! ULN2803 13 03 12 II GND 02 01 K3 02 3 03 4 04 5 05 6 06 7 07 8 08 9 10 O O o o 080357 13 Figure 3. Schematic diagram of the port expander with the 4094 shift register and ULN2803 power driver. 10/2008 - elektor 63 MICROCONTROLLERS how the shift register works, it’s time to take a closer look at how the over- all circuit works (see Figure 3), since we intend to support three inputs with only two bits. The Q\ output is used to gate the strobe signal. A strobe pulse is only generated if Q\, Data and Clock are all high. The corresponding three- input AND circuit is built using a dual Schottky diode (BAS40-6), since the necessary noise immunity could not be achieve with ordinary silicon diodes. This arrangement compels us to use the following program sequence to transfer all eight bits: 1. Eight ‘0’ bits are loaded into the shift register. This is done by set- ting Data low and generating eight clock pulses. Each bit is shifted in on the rising edge of the clock sig- nal. After this, all of the internal Q outputs are low. However, the levels on the output pins do not change because the strobe pulse is blocked by the low level of the Data signal. 2. Next, we shift a ‘1’ bit into the 4094. It will subsequently appear at Q\ after eight clock pulses. 3. Next we transfer seven data bits, each with the desired level (high or low, corresponding to ‘relay en- gaged’ and ‘relay disengaged’), and each accompanied by a clock pulse. The data bits are shifted in on the positive clock edge. 4. The eighth bit is transferred at the end in a special manner. First we set the Data line to the desired level. This time we do not gener- ate a complete clock pulse, but in- stead leave the Clock line set high temporarily. This causes all eight bits to be shifted to their final po- sitions. However, Q\ is still holding the state of the previous bit, which was set to 1 nine clock pulses ear- lier. Now we set the Data line high if it was not already set high for the last bit. This causes the strobe pulse to be generated via the di- ode/resistor network. The eight bits are thus passed to the out- puts. After this the Data and Clock signals can be returned to the low level in any desired order. This procedure is fast and reliable, and it saves an additional I/O line. Relay board The circuit of the relay board (Figure 4) is very simple. A power connector and a diode for reverse-polarity protection, as well as an LED to indicate that the supply voltage is present, are essen- tial. There is also a 10-way pin head- er for the input signals. If you solder 64 elektor - 10/2008 r L IC2 mmmmm i in u bi m a ii : D i tjKl - I UIN [i il ^ GND 1 J C3 ci ifl] W s v J I^tHm Ir -eo.eee Ki:) ? 34 R6 ROwlBDl 1P12R13 K9 h M. #»#*♦'#£> ~ ."V-. ■.PBfi 'j 5 ' AD7 -« ! mBt-oz 0 > * -J.P2 M 1 M M -^r v > " '*00601 c< ^ O O G O Nos^NQh-nrio JOQ ommm^itncsffico — Q. a a. a. o a a an l^n it il il d it J * O© o 4 ' | V* ? C ®" 5 ® > K8 1Ubl R „ * « #* tfafwyStTHl . c . 2 . j(BU . sVlS - rj -f5f 3 t I 1 1 % I • #., ^ *•?'■. » i it O a* *V r9 .•« „ jp *dl .«•. ,*4 ..Jr / C^-v'X^sdub 2 R1 0803UJ 5-2 OWO K8 RST •=• '** j3 ■V^ |h| *v^ ^3**£3,I _ V I W 8 * * ° I £ ° I S 3* S I °h So e4\ o' | -i'fo z fy »j ■ tOI ■ wtmipln 3 ' r„ I • 1WCI • IX L 01 . - : ■•' w » — DVAOS?VS ®M8l$0 5vaWvoT I ] ~ XIA?l * l-31^D uodmo DVAOSrVS ^ ^ DV A OSZ V 01 | .JVAOSZ VOl 1-31SD UOdUJO ova os? vs SM91S0 Ova osz v oi I g)W^? — DOA?l 1-B15D UOUUJO 3VA OS? V S ^ ^ OV A OS? V 01 | g)TC»\^ — ooa?i 1-31SD UOiJULJO 3 A? i|l s ,w K rrJ ^ IT « A LE04 jr ( ’r+7 ii ; omRon GSLE-1 , ,2V0C = £*t@ ■ 10 A 250 V AC 0518W8 5A2S0V £ omRon G5LE-1 12VDC “ ■ 10 A 250 V AC A _..,., 0 5 A 250 V AC 05 8W8 A omRon G5LE-1 12VDC-- ^^(g ■ 10 A 250 VAC 05I8W8 5A 250V ^ omRon G5LE-1 12V0C ^^(g ■ 10 A 250 VAC 0518W8 5A 250V ^ Figure 5. Port expander PCB. a socket header to the port expander board (Figure 5), you can plug it on top of the relay board (Figure 6). Of course, you can also use the relay board without the port expander board by connecting a set of leads direct- ly from the UNL2003 outputs on the ATM 18 test board (connector K6 on the test board) to it and then connecting the ULN inputs (on connector K7 of the test board) to the pins of the microcon- troller I/O port. However, this is not as elegant as our two-wire solution. Diodes connected in parallel across the relay coils (freewheel diodes) must al- ways be fitted to limit the high voltag- es that result from the coil inductance when the relay is de-energised. LEDs with series resistors are also useful for helping you recognise the states of the relays. The relays used here are rated for cur- rents up to 5 A, and the circuit board tracks can also handle this current COMPONENTS LIST ATM18 Port Expansion Board # 080357-5 Passive Components R1 = 4kD7 (SMD shape 0805) Cl = 1 OOnF (SMD shape 0805) Semiconductors D1 = BAS40-1 (SMD) IC1 = 4094 (SMD SO 16) IC2 = ULN2803 (DILI 6) Miscellaneous K1 = 4-way pinheader K2 = 8- way pinheader K3 = 1 0-way pinheader PCB, bare, order code 071035-5, see Elektor SHOP PCB with SMD parts mounted, order code 071035-95, see Elektor SHOP o — ; ^ r; J j T f 1 T '( ? - — • ■V <4> '1 i' ■«' , ,1 , . P * p * ■«' • 10/2008 - elektor 65 MICROCONTROLLERS r — — — — — — — — — — — — — — — — — — — n j COMPONENTS LIST j ATM18 Relay board # 080357-6 i Resistors i i R1 -R9 = 4kf27 i Capacitors Cl = 220jL/F 16V i Semiconductors i i D1 = 1 N4004 i i D2-D9 = 1 N41 48 i 1 LED1 -LED9 = LED, 3mm diam. 1 Miscellaneous JP1 = 1 0-way box header i K1 = DC adapter socket, PCB mount | i K3-K10 = 3-way PCB terminal block, i i lead pitch 5mm i 1 Rel-Re8 = Omron G5LE 1 PCB, bare, order code 071035-6, see Elektor SHOP Kit of parts (PCB and all components), i order code 071035-72, see Elektor ( i SHOP i L _ _ _ _ __ _ J Figure 6. Relay board component layout. level. In theory, they could be used to switch the mains voltage (110 V or 230 V) - the track spacing is adequate for this - but hobby electricians (such as the author) are well advised to avoid this temptation. If the board were used this way, it would have to be fitted in a suitable enclosure and it could only be used to switch devices with suita- ble protection against contact with po- tentially live parts (because the relay switches only one side of the circuit). The message is thus: stay away from 110 V or 230 V if you aren’t a qualified electrician. As the port expander is built using SMD ICs, the board is available pre-as- sembled. By contrast, a parts kit with a bare PCB is available for the relay board with its relatively large, easily soldered components. C code As usual, an example program writ- ten in C is available for downloading from the Elektor website. This program (ATM18-RC5_Relay) uses the relay board for convenient control of all eight outputs via an RC5 remote control. The decision regarding which two I/O lines to use to control the port expander de- pends on which other hardware func- tions are needed. The C program is written for an application with an LCD module connected via a two -wire inter- face. In this configuration, the display shows the current state of the relays. It occupies I/O lines PB1 and PB2 (see the May 2008 issue of Elektor). The RC5 receiver is connected to PB0 (see the June 2008 issue of Elektor). The PD5 and PD6 pins can then be used for Listing 1 Excerpt from main.c RC-5 button assignment: 1 . . 8 : Switch corresponding relay on/off 0 : Switch off all relays 9 : Switch on all relays Test board wiring for ATM18_LCD application COMPONENT *** LCD 2-wire interface CLOCK DATA ATM 18 PIN PB1 (can be changed in "application . h" ) PB2 (can be changed in "application . h" ) *** Port expander 2 -wire interface CLOCK DATA *** IR receiver *** Receiver supply +/■ Receiver output PD5 (can be changed in "application . h" ) PD6 (can be changed in "application . h" ) K4 (watch out for proper polarity!) PBO ICP1 66 elektor - 10/2008 the Clock and Data lines, respective- ly. If necessary, you can easily assign other pins. Everything you need to use the circuit successfully is contained in main.c (Listing 1). One important point is that the remote control unit that you use must use de- vice code ‘0’ (video recorder). With this arrangement, you can use buttons 1 through 8 to independently switch each relay on or off. The 0 button clears all the outputs, so it is a sort of ‘closing time’ button: everything off! BASCOM example For beginners, the BASCOM example program PortExpanederl.bas is prob- ably easier to understand. It uses the same pin assignments for the port ex- pander but omits the LCD. Instead, data is output via the serial interface for test purposes. In this way, you can see which data is sent by the RC5 re- mote control. The listing shows the data transfer to the shift register in the procedure Sub Pe_write_byte. I/O line D6 is the data output, while D5 supplies the clock signal. The main routine reads data from the RC5 receiver and uses it in exactly the same way as the C program. This means that you can use buttons 1 through 8 to switch individ- ual relays on and off, while button 0 clears all the outputs. Experience with infrared control units has shown that the only real difficul- ty is finding a suitable remote control unit. If you have found one that gen- erates RC5 signals, it may turn out to use the wrong device address. For this reason, the Basic program intentional- ly accepts all device addresses. This means that it does not matter whether the remote control belongs to a video recorder, a television set, or some oth- er device. The device address and the command byte are output each time via the serial interface. This is useful for troubleshooting, ( 080357 - 1 ) Listing 2 PortExpa rider 1 .bas 'ATM18 Port expander, Relays, RC5 'Clock = PD5 , Data = PD6 $regfile = "m88def.dat" $crystal = 16000000 Baud = 9600 Dim Address As Byte , Command As Byte Dim Mask As Byte Dim N As Byte Dim State As Byte Dim Relay As Byte Dim Ctrl As Byte , Ctrl_old As Byte Pe_clock Alias Portd.5 Pe_data Alias Portd.6 Config Portd = &B01100000 Config Rc5 = Pinb.O Declare Sub Pe_write_byte (d As Byte) Enable Interrupts Print "Port Expander" Relay = 0 Pe_write_byte Relay Do Getrc5 (address , Command) If Address < 255 Then Ctrl = Command And &B 10000000 If Ctrl <> Ctrl_old Then Print Address Print Command Command = Command And &B 01111111 If Command = 1 Then Toggle Relay. 0 If Command = 2 Then Toggle Relay. 1 If Command = 3 Then Toggle Relay. 2 If Command = 4 Then Toggle Relay. 3 If Command = 5 Then Toggle Relay. 4 If Command = 6 Then Toggle Relay. 5 If Command = 7 Then Toggle Relay. 6 If Command = 8 Then Toggle Relay. 7 If Command = 0 Then Relay = 0 Pe_write_byte Relay End If Ctrl old = Ctrl End If Loop Sub Pe_write_byte (d As Byte) 'Write Byte To Port Expander Mask = 1 Pe_clock = 0 'Clear data signal Pe_data = 0 'Clear all stages of shift register For N = 1 To 8 Pe_clock = 1 Waitus 5 Pe_clock = 0 Next N 'Set High Level For Qs Pe_data = 1 'Cock in QS Pe_clock = 1 Waitus 5 Pe_clock = 0 'Do this for 7 databits For N = 1 To 7 State = D And Mask If State = 0 Then Pe_data = 0 Else Pe_data = 1 End If Pe_clock = 1 'Clock in data with rising edge Waitus 5 Pe_clock = 0 Shift Mask , Left Next N 'last bit Pe_data = 0 State = D And Mask State = State / Mask If State = 1 Then Pe_data = 1 'Set Strobe Pe_clock = 1 'Clock in data Pe_data = 1 Waitus 5 Pe_data = 0 Pe_clock = 0 End Sub End 10/2008 - elektor 67 o LU >< Q_ iternet. adio Things of the past Elektor is now & tomorrow (tnfefcPi Secure a head start in electronics with a subscription! [ Advantages to subscribers 3-tn WtP 3 taV er ’ OSB Vo»c e Cheaper than 1 1 issues from the newsstand With every issue subscribers get up to 40% on selected Elektor products As a welcome gift you get a free 2GB MP3 player worth £31 .50 No queues, travelling, parking fees or ‘sold out’ Elektor is supplied to your doorstep every month Always up to date - read your copy before everyone else < Q_ www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 elektor - 10/2008 Or use the subscription order form near the end of the magazine. 68 Electronics inside out! The free e-magazine about internet, computers, hacking, tweaking, modeling, gadgets, geekstuff, gaming and DIY electronics. The e-zine you have to check out now! Receive i-TRIXX in your mailbox FOR FREE each Wednesday! ANDRE L_*.M OTI-sIl ' !d AuAMLd TA 7 7 UN LtAHW arcr’-l&r-aTE#" How TET DLi'LU iwii voirfr EJW*J vidsrja O^r Aiid 900/MQO t Si™* » SpHCrm, .. . - ... >. v r P yM * -■ Afiptfi II A CHnnudBH 641 ' “VI fc ' ' JNGIUDFS*^ /^M r * •w— S% - '< ; 4 t' rCiHI HiiHrf fcli 4 .VU Sl-ihmli! '1 *tt< FunfiJii to Ltd'll C^'^wd^S^siemsI h, ■, v- fiff , I‘IHhimTIhi 1 TTi frtlfi i filTi hi Him r ' ^ .y -C-jii^rik-Softpiia^ B mi.b i Kin. -ri: HJfr "-s -V; ;to/ m pi M^w-g . 1 hp Hiftipii > * '■ JWPfUnF*: C.T-|dr > *■-. IS WWW t XEAME5TAT!QN;CDM Pm: -■ 1 Z : . L-! •■ • l .» IJ | aui-'roMlIj^NUWvz-.HLT Tel: 01 635 40347 biivvliury EJi:i:lnim:::-; Lid Frn:UlB3Q 36143 hintef HKpI H-i-Iiliy BCiteROU B&D ‘ mzil: nlmjltienr'.vhj^'.tivaii.rfl.iili: KtiVnH'JTHrhiiryiJuktirins. ra.uk Play the i-TRIXX Quiz and win! Test your knowledge about internet, computers and electronics. Take your chance now and play the i-TRIXX Quiz. There are great prices to win! From the Elektor labs: Simple, useful and fun electronic circuits! Powered by Check i-TRIXX.com and subscribe now! Elektor 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 Newsletter. Your benefits: i The latest news on electronics in your own mailbox each friday i Free access to the News Archive on the Elektor website * You’re authorized to post replies and new topics in our forum 0 weekly i --r -i-*— ■ 1 o ri>r^ n r..-rjrteiUWU)ai * ■ - - ■ ■ - -i ■ ■ ■ kiai i — Gvt 'tff.ftflDUi Elefclor I tm]«yv--r H-.nl '■avc r,|r,l Yunr Ein ieHn dud nrvnrni i i va p f ■ •'-Tf-n-P p --B- fhv n hctc -nv. : jijrf e?+ -L- . . i : r -uz i - '« jviaf 4 k ■ ■ u. m w"m > ■ w i k *i ■* " ■ M ■- r - 4 - -1 4 - I 1 !- *& Register today on www.elektor.com/newsletter 10/2008 - elektor 69 TECHNOLOGY REVIEW Two Low Cost Scopes Economy digital oscilloscopes from the Far East Dr. Thomas Scherer (Germany) The cathode ray tube (CRT) has made way for the LCD and digital has replaced analogue technology. This trend is also evident in the design of oscilloscopes. Prices are falling: a good specification DSO from China can now be found for € 600 (£ 450) or less. One of our freelance contributors Thomas Scherer got the chance to put two economy scopes through their paces. Sitting on my workbench for the past 20 years or more has been my faithful friend, a single channel Hameg 103 oscil- loscope (Figure 1). In more recent years my often repeated motto: '10 MHz is bandwidth enough' has started to sound a little unconvincing and anyway it would at least be nice to have a scope with a second channel. With these thoughts in mind I had recently been searching the Internet for a suitable replace- ment for my old oscilloscope. It was something of a coincidence when I got a call from the Elektor office asking me to try out two low-cost scopes from the Far East. This would be an excel- lent opportunity to get my hands on these machines and find out if they really could take the place of my old Hameg. What follows is a subjective assessment of just two models and may be of some help to those of you in the similar position who are considering investing in some test equipment. Manufacturers There is certainly no shortage of digital oscilloscopes avail- able today but most models are aimed at the professional Figure 1. The 22 year old Hameg 103 oscilloscope on the author's workbench. user with prices that reflect their specification. The cost of many of the higher-spec models from the established test equipment manufacturers is equivalent to what you would expect to pay for a decent family car. Trawling the Net for oscilloscopes costing less than 1000 euros (approx. 750) however does not generate too many hits. Two companies who are producing relatively low-cost test equipment are Rigol and Owon. Both manufacturers are based in China and are typical of the many new companies that have sprung up over the last ten years, fuelling the country's massive economic growth. In addition to the standard digital 'scopes they also produce variants with integrated logic analyser functions. Although the sampling clock rate is way too low to be of any use on modern PC systems with their gigahertz clock speeds they can perform a useful role debugging the majority of modern-day microcontroller designs. It was two of these combination scopes that I had available for this test. For my own needs the additional analyser functions are not so interesting so for this report I confined my comparisons to the oscilloscope functions only. Owon MSO5022 The offering from Owon (Figure 2) is the lighter (1 kg) of the two scopes on test despite it being the bigger of the two models. The larger case 350 x 155 x 120 mm (WxHxD) is necessary to accommodate the impressive 7.8" colour display. This screen size is big enough to display full 640 x 480 pixel VGA resolution images. Although the screen gets full marks for its size this type of LCD uses low cost STN technology and consequently does not have such a good viewing angle as the more expensive types of LCD. The col- ours assigned to functions and displayed waveforms can- not be changed (at least I couldn't work out how to change them!). The MSO5022 comes with the range of accessories shown in Figure 3. 70 elektor - 10/2008 On the positive side the large display is impressive and individual selector switches are used to select the vertical amplification for each channel. Control knobs can adjust the vertical position of each waveform. At the rear of the unit is a compartment for an optional rechargeable battery pack allowing the scope to be used independently of the mains. The scope takes around 10.5 W (measured) which should allow a few hours operation on batteries. There is no fan fitted. The menu is quite easy to navigate and did not require reference to the handbook. The quoted band- width of 25 MHz is sufficient for my needs as is the memory depth of 5,000 samples. The A/D converter has an 8-bit resolution. Now to look at some of the features that were less impres- sive: The vertical sensitivity is adjustable up to only 5 mV/ div. and while gain steps of 1 , 2.5, 5 are well spaced there is something important missing here: fine adjustment. My old Hameg has a variable gain knob which can be used to increase the vertical magnification up to 1 .7 mV/div. The time base is adjustable in steps from 5 ns to 5 s/div. but again the lack of a manual time base expansion control is frustrating. The larger screen dictates that this unit takes up a little more space on the workbench than the Rigol. To make good quality screenshots the scope can be con- nected to a PC using either a USB or serial port. The soft- ware necessary to run a virtual oscilloscope program on the PC is included on a CD. Despite successfully installing the driver on my PC running Windows XP the computer failed to recognise the scope on the end of the USB cable. Okay, I thought, no problem, I will use the serial port but attempts at communication over this port were also unsuccessful. By this time I had convinced myself that there was probably a conflict with some previously installed software. With this in mind I attempted to install the USB software on my lap- top which has a relatively new installation of XP and very few additional programs. The result was rather disappoint- ingly the same. After a few hours of tinkering and despite my conviction that the software must have worked at least once in Beijing I decided to throw the towel in. When all else fails a memory stick can be used to store and Figure 2. The two-channel MSO5022digital scope from Owon with built-in logic analyser. Figure 3. The package from Owon includes: Software-CD, manual, logic analyser clips, two 1:10 switchable scope probes with spares and a USB cable. 10/2008 - elektor 71 TECHNOLOGY REVIEW Figure 4. The two-channel DS1102 digital scope from Rigol with built-in logic analyser. Figure 5. The package from Rigol includes: Software-CD, manual, logic analyser clips, two 1:10 switchable scope probes with spares and a USB cable. transfer files from the USB socket on the front of the scope to a PC using the Owon software. tion while providing protection from the worst knocks. The wider analogue bandwidth (1 00 MHz) of this model is not really an issue here, the company also makes lower cost 25 MHz and 40 MHz scopes comparable to the specifica- tion of the Owon. The Rigol certainly has more useful fea- tures and the whole concept seems better Thought through'. In use the Rigol also has a better feel; the knobs operate smoothly and you are left with the general impression of a better build quality. Fine adjustment of the vertical amplifica- tion is available by pushing and rotating the vertical scale knob. The timebase also features delay and fine position control. Use of the cursor is quite intuitive. The measurement ranges go from 2 mV to 10 V/div. verti- cal and 2 ns to 50 s/div. horizontal. The memory depth is 8,000 samples in standard mode and can be expanded to 5 1 2 k samples. The greater number of settings and adjustments available on the Rigol scope give it more flex- ibility and make it a more useful tool on the test bench that the competitor. The trigger function alone has 15 dif- ferent modes and the user interface has a choice of ten languages. After the frustrating experience trying to connect the Owon to a PC I was not looking forward to attempting the same with the Rigol. I need not have worried; the drivers and software were installed without any problem and as soon as I connected the PC and scope with a USB cable the new hardware was recognised and ready for use. The screen- shot in Figure 6 shows that practically all of the scopes front panel controls are represented on the PC screen. Waveforms appear on the screen after a very slight delay. One negative aspect of the PC display is the representation of the scope's knobs. These are drawn as very simple push buttons for incrementing and decrementing the setting and are a little clumsy to use. More annoying is that once com- munication with the PC is established it is only possible to control the scope functions from the PC. So if you want to quickly change the settings on the scope's real knobs it is first necessary to disconnect the USB cable. This feature is a little impractical. Rigol DS1102C The most obvious difference from the Owon is size, at 303 x 154 x 133 mm (WxHxD) the Rigol is a little more com- pact and is fitted with a 5.7" display (Figure 4). The Rigol again does not use the best technology PVA/MVA or IPS type LCD, and with its smaller screen can only manage 320 x 234 pixels. Weighing in at 2.4 kg the Rigol is more than twice as heavy as the Owon. The scope comes with a set of accessories similar to the Owon (Figure 5). The DS1 1 02C does not have space for a battery power pack but with a power consumption of 26 W the batteries would not last too long between charges anyway. The scope runs warm and is fitted with a fan. The Rigol scope also comes with its own handy tote bag allowing the scope, pods, probes and accessories to be neatly stowed for transporta- Figure 6. The Rigol virtual oscilloscope. A Personal choice In terms of features, build quality and after-sales support both of these offerings still have a long way to go before they can be favourably compared to similar machines designed by the more established European or North Amer- ican manufacturers. Both machines have a significant price advantage howe- ver; the Rigol model on test retails at over 1,000 euros (approx. £ 750) whereas the Owon will set you back just over 600 euros (approx. £ 450). Both companies also offer several other versions without the logic analyser function and with bandwidths of 25, 40 and 60 MHz. For my needs the lowest spec model would be sufficient. To get the best of both worlds we would need to take the innards from the Rigol and marry them up with the display from the Owon but that is not a viable option. The day will no doubt come when the electron beam makes its final journey across the graticule of my Hameg and the chances are that on that day it will be replaced by a Rigol machine despite the shortcomings of its display. ( 080411 - 1 ) Internet Links [1] www.owon.com.cn/eng [2] www.rigolna.com 72 elektor - 10/2008 Our range of more than \ 43 hardware circuit boards, \ CD-ROMs, sensors and accessories \ has just got bigger. \ In addition to the new versions of \ Flowcode we now have bundles to allow you to rapidly develop systems based on RFID and Zigbee technology. BENEFIT NOW! The retail price of our bundles is at a significant discount to the sum of the individual parts. You’ll save a massive 30% discount w.r.t. individual items! Ordering Use the order form near the end of the magazine or go to www.elektor.com (shop). E-blocks will be shipped after receipt of payment. Prices are exclusive of postage. electronics worldwide More information and free downloads available on www.elektor.com/eblocks TECHNOLOGY DESIGN TIPS Testing trailer connectors Erwin Deumens For testing the lighting of trail- ers or caravans you really need two people: one to operate the switches and pedals, the other to check that the lights work. This has been the most practi- cal way until now. When you use the circuit from this design tip you can do the testing on your own. The circuit isn't complicated. The pin of the trailer that is test- ed is connected to two opamps (configured as comparators) and compared to two reference voltages. We have specified an NE5532 for the opamps, but any other opamp that can operate at about 14 V (such as a 741) can also be used. The reference voltages are obtained by passing a constant current of 1 mA through two resistors (R 1 and R2). This creates a voltage of 1 00 mV at pin 6 and 2.3 V at pin 3 of IC1 . When the pin being tested (i.e. the lamp) works correctly, the voltage on the pin will be be- tween 100 mV and 2.3 V (for example: a 12V/5W lamp has a resistance of about 30 Q. At a current of 1 0 mA this cre- ates a potential difference of 300 mV). A current of 1 0 mA will then flow through LED D1 , which causes it to light up. The outputs of 1C 1 A and 1C 1 B are both high and D2 stays off. If there is a short to ground some- where, the output of IC1 B will become low and both D1 and D2 will light up. When the lamp has burnt out the voltage at the pin will be equal to the supply voltage of the circuit. In that case there is no current flow through D1 . The output of 1C 1 A is then low, which causes D2 to light up. The ground of the circuit should of course be connected to the ground of the trailer or caravan. In the diagrams for some of the most common connectors you can see which pin is connected to which lamp, so you can eas- ily find out where the problem is. It is of course also possible to build the circuit 7 or even 1 3 times, so you can test all lamps in one go, but it works just as well with a single circuit. ( 070051 - 1 ) PeDAI power Jan Visser Even if there are cycle tracks and special maps, some cyclists will stubbornly try to find their own way - these die-hards can be recognized not only by the latest GPS or PDA kit fitted to handle bars, but sadly also by the desperate looks and moan- ing as result of flat batteries ex- perienced 'by the roadside'. According to Elektor's cycling expert Jan Visser, two hours of continuous use is about the most you can from a GPS-run- ning PDA fitted on a bicycle. This Design Tip should lengthen the useable period to about five hours increasing the cyclist's chances of reaching the destina- tion hopefully with meaningful GPS guidance. The circuit shows that the alter- nating voltage supplied by the (hub or wheel) dynamo is recti- fied by Schottky diodes. These exhibit a forward drop of just 0.3 V and so allow some more headroom for the L4805 volt- age regulator. The USB cable connections al- low the charging voltage to be fed directly to the PDA. The result is some charging of the battery while cycling and lon- ger use of the GPS function on your bike. ( 080538 - 1 ) 74 elektor - 10/2008 PUZZLE INFOTAINMENT MaYaHAkM Pu«lewithan I 1 vAO\JUr\v4 electronics touch Here's another Hexadoku puzzle to exercise the odd brain cell. Get out a pencil and enter hexadecimal numbers 0 through F in the boxes in such a way they occur once only in each row, column and 4x4 area. Send us your solution and enter a prize draw for an E-blocks Starter Kit Professional and three Elektor Shop vouchers.. The instructions for this puzzle are straightforward. In the diagram composed of 1 6 x 1 6 boxes, enter numbers such that all hexadecimal numbers 0 through F (that's 0-9 and A-F) occur once only in each row, once in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle and these determine the start situation. All correct entries received for each month's puzzle go into a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. The puzzle is also available as a free download from our website. SOLVE HEXADOKU AND WIN! Correct solutions received enter a prize draw for an E-blocks Starter Kit Professional worth £249 and three Elektor SHOP Vouchers worth £40.00 each. We believe these prizes should encourage all our readers to participate! The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses. PARTICIPATE! Please send your solution (the numbers in the grey boxes) by email to: editor@elektor.com - Subject: hexadoku 10-2008 (please copy exactly). Include with your solution: full name and street address. Alternatively, by fax or post to: Elektor Hexadoku Regus Brentford - 1 000 Great West Road - Brentford TW8 9HH United Kingdom - Fax (+44) 208 2614447 The closing date is 1 November 2008. PRIZE WINNERS The solution of the July/Auqust 2008 AlphaSudoku is: HKCEAO The E-blocks Starter Kit Professional goes to: Andie Elizabeth French (UK). An Elektor SHOP voucher worth £40.00 goes to: Mike Parker (UK); Tuomo Hyyronmaki (FIN); Gerard Schouw (SA). Congratulations everybody! F 3 6 B C 8 E D 8 A 5 3 E 1 D 2 4 F 8 6 D E A 4 B 5 F 4 2 3 A 8 B 7 5 9 D 6 1 7 0 3 2 4 F 2 7 5 C 0 0 C 1 D 6 A 2 8 5 F 1 A C F 2 E 4 0 8 3 D 8 9 7 4 A E 9 A 6 D 8 5 F C 0 7 E 6 2 C F 0 4 3 1 8 F 0 D 9 2 6 E 9 E 5 C 1 7 A B C 3 1 F 9 A D (c) PZZL.com D 5 B E G 2 H N K 7 3 1 0 C 6 9 P L F 8 4 1 J M A N 1 1 6 C 8 A 0 D E G H F L 7 2 K M J 4 P B 5 9 3 0 M 2 L 4 9 J P F 3 8 D E K 1 7 A B H 5 G C 1 6 N 9 J 7 K P 1 C L M 6 5 B N A 4 D E G 1 3 F H 8 0 2 3 A H F 8 5 B G 1 4 2 J P M 9 6 C N 0 1 K E L 7 D 4 6 9 8 3 E F 1 J B N P K G A M 0 H D C 1 2 7 L 5 1 0 K G F P 6 9 3 C D 7 8 4 L A 5 1 2 N B M E J H M L E P N K 4 8 7 H C 5 1 2 B J 9 3 6 F 1 D A G 0 H B J A D M 1 2 5 L 1 9 6 3 0 E 8 7 4 G C K P N F 7 2 C 1 5 D G A N 0 H F M E J B 1 P L K 8 6 4 3 9 6 7 3 4 1 J E H 0 K L A C N F P B D G M 9 5 1 2 8 B C P 0 L 1 9 3 2 D J 6 5 1 H F 4 8 7 A M G N K E G H N D E A 5 6 8 P M 2 4 7 K C 3 9 1 0 J L F B 1 A K F M J B 7 4 1 N E 3 9 8 G 1 6 2 5 L H 0 D P C 1 8 5 9 2 F L M C G P 0 D B 1 N H K E J 3 A 6 4 7 2 3 1 5 6 L D B P 1 F G H J N K M C A E 7 9 0 8 4 C P G J A 0 3 1 9 M B 4 7 5 D L 2 6 8 1 E N H F K L 1 M H K N 8 5 6 F A 1 2 9 E 0 7 4 3 P D J B C G E F 0 N B G 2 7 4 J K 8 3 6 C H 1 5 9 D L 1 M A P 8 4 D 7 9 H K C E A 0 L 1 P M G J F N B 6 3 2 5 1 5 E A 1 H 4 M K L 1 6 C J F 2 3 G 0 P 7 N 8 9 D B K N 8 2 M 7 0 F G 9 1 E A D 3 4 L 1 B 6 5 P C H J P G 4 B 0 6 N E A 8 7 K L H 5 1 D J C 9 2 F 3 1 M J 9 L C 1 3 P D B 2 4 N G 1 8 5 F A M H 0 7 K E 6 F D 6 3 7 C 1 J H 5 9 M B 0 P 8 N E K 2 A 4 G 1 L 10/2008 - elektor 75 INFOTAINMENT RETRONICS 11 lllllllllll I III 1 1 1 1 1 1 1 ■lllllllllll 1 . 2 3 4 » 4 * R N! 4 - 4 * 1 u Elektor TV Games Computer (1979) James Jacobs (Australia) Next year will mark the thirti- eth anniversary of the Elektor TV Games Computer (TVGC), which first appeared in the April 1 979 issue of Elektor. The TVGC project was 'adopted' by various advertisers in later issues of the magazine, selling in kit form for £ 200-300. console contained the monitor ROM, RAM and a DIN socket for a cassette recorder; use of this effectively transformed the con- sole into a basic TVGC. A variety of expansions for the system were designed and pub- lished in Elektor magazine from 1979 to TVGC was a pair of expansion slots, designed to accept com- mercial game cartridges for the consumer Interton VC 4000 and Radofin 1292 Advanced Programmable Video System consoles, which were likewise based on the Signetics 2650A and 2636 chips. Effectively the TVGC could be considered as This innovative machine, designed by Elektor and Philips, was based around hardware from Signetics, a US subsidiary of Philips: most importantly, the Signetics 2650A CPU and the Signetics 2636 Pro- grammable Video Interface (PVI). A regular PAL television set was used to display output. A Philips 2 k 'monitor' ROM served as BIOS and operating system, allowing programs to be loaded and saved via the cassette interface, the machine to be programmed, and debug- ging performed. Interactive, open-platform computing 30 years ago! The PVI supported 16-colour graphics, reusable scalable sprites, score display and lim- ited background graphics. A 28-key keyboard and a pair of analogue joysticks were used for input. The total RAM was 2 k in the basic machine and 5 k in the expanded machine; this was shared between the monitor ROM software and user games. This computer was in a func- tional sense a rough superset of the professionally manufac- tured games consoles of its day. For example, the 'Hobby Mod- ule' cartridge for the Radofin Although the basic machine already had a square wave gen- erator, the expanded version fea- tured a pair of General Instru- ment AY-3-891 0 Programmable Sound Generators (PSGs) (later computers such as the 16-bit 1985 Atari ST had to make do with just one of these!). An interesting option on the a development sys- tem for such consoles; certainly there were many games which were released both as TVGC cassettes and console cartridges. Which were the originals and which were the derivatives is not always easy to ascertain. Also, a 'Rapid Loading Games' project, enabling the use of 76 elektor - 10/2008 CddE EPROMs instead of cassettes for program storage, and a plug-in EPROM programmer, essentially gave the system a primitive form of Flash memory. A hardware- based random number genera- tor (RNG) was another project. Various software written by enthusiastic readers was avail- able through the then fledgling Elektor Software Service, not only on cassette but also on 45 rpm vinyl records! Third-party soft- ware was provided on cassette by, among others, Hoc- available for the system. Enter- prising and audacious users also programmed their TVGCs as clocks, Lotto predictors, music players and so on, demonstrat- ing the machine's versatility. In 1981 Elektor's Editor Paul Hol- mes compiled and expanded the magazine articles on the TVGC into a comprehensive 248-page book that also appeared in translation in Dutch, French and German. The Emerson Arcadia 2001 con- sole family (1982) used the 2637 PVI instead of the 2636 and an exciting introduction to microprocessors computer Elektor Publishers Ltd. osoft. TVGC games, being located in RAM, could and did use self-mod- ifying code extensively and also leveraged routines in the monitor ROM. Unsurprisingly, they were also typically highly timing-dependent. There were dozens of games ' ible. Unfor- tunately no 2637- based com- puters were designed. By this time the 32 k address space and 8- level stack of the 2650 were becom- ing restrictive and systems based on the 6502, Z80 and 6809 CPUs were dominating the market. f In recent years there has been a resurgence of interest in the Elektor TVGC. It now pos- sible to emulate these systems under Windows with the open- source WinArcadia emulator [1]. (Amiga versions are also available). It has been extended to accommodate features that weren't possible on the real hardware, such as gameplay recording and playback, turn- ing off the collision detection to cheat in the games, setting data watchpoints, and so on. There is also a friendly community of enthusiasts to this day [2]. Being rare and treasured items, these machines command a premium in the market. Each is effectively a hand-crafted piece; for example, extensive calibra- tion routines were required to compensate for the variety of joysticks that were in use. The TVGC main unit pictured here is in careful storage in the Retronics cabinet at Elek- tor House. It has a Perspex case and cover (here removed) for 'look but do not touch' display and demonstrations at shows and exhibitions where visitors would marvel at all the high tech innards. Sadly, none of the game cartridges, keyboard, extension boards and joysticks have survived the Elektor's com- pany moves or space realloca- tions for vintage projects (mostly equating to: "into to the skip"). If these bits were available to fire up the TVGC (say on the Retron- ics workbench in the Elektor lab) your next issue would be in seri- ous danger of not appearing in time. ( 080412 - 1 ) Web Links [1] amigan. classicgaming. gamespy.com [2] tech.groups.yahoo.com/ arcadia2001 consoles Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are welcomed; please send an email to editor@elektor.com □ □ a i 1 + + □ i + □ + □ + □ 3 a □ 1 I □ i 10/2008 - elektor 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 564999 ATC SEMITEC LTD www. atcse m itec . co . u k Thermal and current-sensitive components for temperature control and circuit protection; • NTC Thermistors • Current Diodes • Thermostats • Re-settable Fuses • Thermal Fuses • Temperature Sensors Call today for free samples and pricing Tel: 01 606 871 680 Fax: 01 606 872938 AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. B0W00D ELECTRONICS LTD www. bowood-electronics.co.uk Suppliers of Electronic Components • Semiconductors • Opto Electronics • Passives • Enclosures • Switches • Stripboard • PCB Materials • Popular Special Offer Packs Online Store, all major cards Same day despatch upto 3.00pm Personal Service sales@bowood-electronics.co.uk Tel: 01246 200222. C S TECHNOLOGY LTD www.cstech.co.uk Low cost PIC prototyping kits, PCB's and components, DTMF decoder kits, CTCSS, FFSK, GPS/GSM, radio equipment and manuals. PCB design and PIC program development. DECIBIT C0.LTD. www.decibit.com • Development Kit 2.4 GHz • Transceiver nRF24L01 • AVR MCU ATmega168 DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0)1872 223306 EasyDAQ j •' i.- -- www.easydaq.biz • USB powered, 4 relays + 4 DIO channels • Will switch 240VAC @ 10 amps • Screw terminal access • LabVIEW, VB, VC • Free shipping • From £38 Design & supply of USB, USB Wireless, Ethernet & Serial, DAQ, Relay & DIO card products. info@easydaq.biz EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • device programmer s manufacturer • selling through contracted distributors all over the world • universal and dedicated device programmers • excellent support and after sale support • free SW updates • reliable HW • once a months new SW release • three years warranty for most programmers YOUR ELECTRONICS OPEN SOURCE http://dev.emcelettronica.com Website full of Projects and Resources for Electronics Engineers and DIY. • Tutorial • Hardware (Schematic & Gerber) ” • Firmware (Asm &C) • Reference Design Everyone can submit a story as a useful source! 'Share for life' First Technology Tttofltfof £fd. FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk/PICProTrng.html Microchip Professional C and Assembly Programming Courses. The future is embedded. Microchip Consultant /Training Partner developed courses: • Distance learning / instructor led • Assembly / C-Programming of PIC1 6, PIC1 8, PIC24, dsPIC microcontrollers • Foundation / Intermediate FLEXIPANEL LTD www.flexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB ILP ELECTRONICS LTD www.ilpelectronics.com Tel +441233750481 Fax +441 233750578 ILP have been manufacturing audio modules since 1 971 and apart from our standard range we also offer a custom design service for the OEM market. 78 elektor - 10/2008 products and services directory LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and GCEs). Also Technical Management and Languages. IE C m MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes OBD2CABLES.COM http://www.obd2cables.com • Thousands of OBD cables and connectors in stock • Custom cable design and manufacturing • OBD breakout boxes and simulators • Guaranteed lowest prices • Single quantity orders OK • Convenient online ordering • Fast shipping Visit our website, or email us at: sales@obd2cables.com ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! • MeccanoTM Compatible • Computer Control • Radio Control • Tank Treads • Hydraulics Internet Technical Bookshop, 1-3 Fairlands House, North Street, Carshalton, Surrey SM5 2HW email: sales@robotiq.co.uk Tel: 020 8669 0769 RADIOMETRIX www.radiometrix.com The leading global developer of ISM band, low power radio modules for wireless data transmission: • Transmitters • Receivers • Transceivers • RF modems • Evaluation Kits SCANTOOL.NET http://www.scantool.net ScanTool.net offers a complete line of PC-based scan tools for under £50. • 1 year unconditional warranty • 90 day money back guarantee • For use with EOBD compliant vehicles • Fast shipping • Compatible with a wide range of diagnostic software Visit our website, or email us at: sales@scantool.net USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £220 + VAT (£20 per issue for eleven issues) Elektor will publish your company name, website address and a 30-word description For £330 + VAT for the year (£30 per issue for eleven issues) we will publish the above plus run a 3cm deep full colour image - e.g. a product shot, a screen shot from your site, a company logo - your choice Places are limited and spaces will go on a strictly first come, first served basis. So-please fax back your order today! _ n I wish to promote my company, please book my space: • Text insertion only for £220 + VAT • Text and photo for £330 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION 10/2008 - elektor 79 BOOKS, CD-ROMs, KITS & MODULES A world of electronics from a single shop! JSl 1 From LED to graphical LCD The Universal Display Book for PIC Microcontrollers The newcomer to Microchip's PIC microcontrollers invariably gets an LED to flash as their first attempt to master this technology. You can use just a simple LED indicator in order to show that your initial attempt is working, which will give you confidence to move forward. This is how the book begins — simple programs to flash LEDs, and eventually by stages to use other display indicators such as the 7-segment display, alphanumeric liquid crystal displays and eventually a colour graphic LCD. As the reader progresses through the book, bigger and upgraded PIC chips are introduced, with full circuit diagrams and source code, both in assembler and C. In addition, a small tutorial is included using the MPLAB programming environment, together with the EAGLE schematic and PCB design package to enable readers to create their own designs using the book's many case studies as working examples to work from. Approx. 208 pages • ISBN 978-0-905705-73-6 • £23.00 • US$ 46.00 Computer Vision P'rineiplm and frractite ■\ Principles and Practice Computer Vision Computer vision is probably the most ex- citing branch of image processing, and the number of applications in robotics, au- tomation technology and quality control is constantly increasing. Unfortunately enter- ing this research area is, as yet, not sim- ple. Those who are interested must first go through a lot of books, publications and software libraries. With this book, how- ever, the first step is easy. The theoretically founded content is understandable and is supplemented by many examples. 320 pages • ISBN 978-0-905705-71-2 £32.00 • US$ 64.00 PIC Mf cracanlrollcrs Silent alarm, poetry box, night buzzer and more PIC Microcontrollers This hands-on book covers a series of exciting and fun projects with PIC micro- controllers. You can built more than 50 projects for your own use. The clear ex- planations, schematics, and pictures of each project on a breadboard make this a fun activity. You can also use it as a study guide. The technical background infor- mation in each project explains why the project is set up the way it is, including the use of datasheets. Even after you've built all the projects it will still be a valuable reference guide to keep next to your PC. 446 pages • ISBN 978-0-905705-70-5 £27.95 • US$ 55.90 v y v j Prices and item descriptions subject to change. E. & O.E 80 elektor - 10/2008 ‘^t-.rrm rr i-pj r a lor Electronics Engl nearing An plications 5.0, 6.0, VBA, .NET, 2005 Visual Basic for Electronics Engineering Applications This book is targeted towards those people that want to control existing or self-built hardware from their com- puter. After familiarizing 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 nec- essary, schematics are provided that will get your projects up to speed in no time. 476 pages • ISBN 978-0-905705-68-2 £29.95 • US$ 59.90 309 CIRCUITS Fully elaborated electronics projects 309 Circuits The present tenth edition of the popular '30x Circuits' series of books once again contains a comprehensive variety of cir- cuits, sub-circuits, tips and tricks and de- sign ideas for electronics. Among many other inspiring topics, the following cate- gories are well presented in this book: test & measurement; RF (radio); com- puters and peripherals; audio & video; hobby and modelling; microcontrollers; home & garden; power supplies & bat- tery chargers; etcetera. 432 pages • ISBN 978-0-905705-69-9 £20.95 -US$41.90 v y A DIY system made from recycled components Design your own Embedded Linux control centre on a PC This book covers a do-it-your-self system made from recycled components. The main system described in this book re- uses an old PC, a wireless mains outlet with three switches and one controller, and a USB webcam. All this is linked to- gether by Linux. This book will serve up the basics of setting up a Linux environ- ment - including a software develop- ment environment - so it can be used as a control centre. The book will also guide you through the necessary setup and configuration of a Webserver, which will be the interface to your very own home control centre. All software needed will be available for downloading from the Elektor website. 234 pages • ISBN 978-0-905705-72-9 £24.00 • US$ 48.00 More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com All articles published in 2007 Elektor 2007 This CD-ROM contains all articles pub- lished in Elektor Volume 2007. Using the supplied Adobe Reader program, articles are presented in the same layout as originally found in the magazine. An extensive search machine is available to locate keywords in any article. The instal- lation program nowallows Elektor year volume CD-ROMs you have available to be copied to hard disk, so you do not have to eject and insert your CDs when searching in another year volume. With this CD-ROM you can produce hard copy of PCB layouts at printer resolution, adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other programs. ISBN 978-90-5381-218-1 • £17.50 • US$35.00 More than 68,000 components ECD 4 The program package consists of eight databanks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. A further eleven applications cover the calculation of, for example, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A colour band decoder is in- cluded for determining resistor and in- ductor values. ECD 4 gives instant access to data on more than 68,000 compo- nents. All databank applications are fully interactive, allowing the user to add, edit and complete component data. This CD- ROM is a must-have for all electronics enthusiasts. ISBN 978-90-5381-159-7 • £17.50 • US$ 35.00 v j 10/2008 - elektor 81 PRODUCT SHORTLIST, BESTSELLERS Modern technology for everyone FPGA Course FPGAs have established a firm position in the modern electronics designer's toolkit. Until recently, these 'super components' were practically reserved for specialists in high-tech companies. The nine lessons on this courseware CD-ROM are a step by step guide to the world of Field Pro- grammable Gate Array technology. Sub- jects covered include not just digital logic and bus systems but also building an FPGA Webserver, a 4-channel multimeter and a USB controller. The CD also con- tains PCB layout files in pdf format, a Quartus manual, project software and various supplementary instructions. ISBN 978-90-5381 -225-9 • £14.50 • US$ 29.00 Software Tools & Hardware Tips Ethernet Toolbox This CD-ROM contains all essential in- formation regarding Ethernet interfaces! Ethernet Toolbox includes a collection of datasheets for dedicated Ethernet inter- face ICs from many different manufac- turers. It provides a wealth of information about connectors and components for the physical layer (PHY) and specific software tools for use with the Ethernet (Software). To help you learn about the Ethernet in- terfaces, we have compiled a collection of all articles on this topic that have ap- peared in Elektor and complemented them with additional documentation and links to introductory articles on Ethernet interfaces. The documents are PDF files. ISBN 978-90-5381-214-3 • £19.50 • US$39.00 v y Prices and item descriptions subject to change. E. & O.E DCC Command Station (September 2008) Electronics is making more and more in- roads into the domain of model trains. Trains are now controlled with digital codes, and in many cases the entire sys- tem can be operated from a computer. Elektor presents a design for the device that forms the heart of a digitally control- led model railway: the DCC Command Station. The computing power in this de- sign is provided by a highperformance ARM7 processor. Kit of ports incl. programmed ARM module Art. # 070989-71 • £88.50 • US$ 177.00 A low-cost home automation server based on a Freescale Coldfire 32-bit mi- crocontroller. The project has been de- signed with open source in mind and doubles as a powerful Coldfire develop- ment system using free CodeWarrior soft- ware from Freescale. DigiButler activates electrical appliances in and around the home, accepting on/off commands from a WAP phone, through an Ethernet net- work or via a webpage at an allocated IP address and with full access security. Kit of ports including SMD-stuffed PCB, programmed microcontroller ; all leaded parts and CD-ROM containing both Elektor articles , TBLCF documentation , datasheets , application notes and source code files. Art. #071102-71 • £29.00 • US$ 58.00 (May 2008) Tthe linear supply. With the SAPS-400 we offer a powerful, adjustable symmetrical supply that's ideal for lightweight audio power amplifiers and happily sits in less than a quarter of the space taken by a comparable supply of conventional de- sign. PCB, populated and tested, ready- mounted in aluminium U profile Art. # 070688-91 • £159.00 • US$318.00 Elektor SMT Reflow Oven (October 2008) The Elektor SMT reflow oven will faithfully handle most if not all your soldering of projects using surface mount devices (SMDs). The oven is particularly suited for use not just in Colleges, workshops, clubs and R&D laboratories, but also by the ad- vanced electronics enthusiast. This pre- cious workbench tool is at home where SMD boards have to be produced to a variety of requirements on size, compo- nents and soldering materials. Size: 4 1 8x372x250 mm (16.5 x 14.6x 10 inch) Art. # 080663-91 • £882.00 • US$ 1525.00 Reduced price till 1 November 2008: £799.00 • US$ 1450.00) SAPS-400 Digibutler (May & April 2008) 82 elektor - 10/2008 ■\ October 2008 (No. 382) £ us$ Communicating with CAN 071 1 20-71 .... PCB, partly populated 54.90... ...109.80 Elektor SMT Precision Reflow Oven 080663-91 .... Ready to use oven (230VAC only) 882.00 ... .1525.00 Multi-purpose GPS Receiver 070309-41 .... Programmed controller PIC1 8F2520 11.60... 23.20 ATM18 Relay Board and Port Expander 071 035-72 .... Relay PCB with all components and relays 36.90... 73.80 071 035-95 .... Port Extension PCB, populated with SMD 13.40... 26.80 RF Sweep Frequency Generator / Spectrum Analyser 040360-41 ....Programmed controller ATmega8535 21.80... 43.60 September 2008 (No. 381) DCC Command Station 070989-71 .... Kit of parts incl. programmed ARM module 88.50... ...177.00 July/August 2008 (No. 379/380) Portable Thermometer 08041 8-41 .... Programmed controller PIC1 6F684 9.00 1 8.00 Dimmable LED light 070963-41 .... Programmed controller AVR231 3 1 1 .90 23.80 Solar-powered Automatic Lighting 080228-41 .... Programmed controller PIC1 2C671 9.00 1 8.00 Battery Discharge Meter 070821 -41 .... Programmed controller PIC1 6F676-20I/P 5.90 1 1 .80 070821 -42 .... Programmed controller PIC1 6F628-20/P 9.00 1 8.00 Operating Hour Counter 070349-41 .... Programmed controller PIC1 2F683 5.90 1 1 .80 Lamp in a Wine Bottle 080076-41 .... Programmed controller ATtiny45 5.90 1 1 .80 Energy-efficient Backlight 080250-41 ....Programmed controller ATmega32 22.50 45.00 Deluxe '1 23' Game 080132-41 ....Programmed controller ATmega8-PU 9.00 18.00 Reaction Race using ATtinyl 3 0801 1 8-41 .... Programmed controller ATtinyl 3 4.90 9.80 Underwater Magic 071037-41 ....Programmed controller AT90S8515P 14.90 29.80 Flowcode for Garden Lighting 0801 1 3-41 .... Programmed controller PIC1 6F88 1 1 .90 23.80 Tent Alarm 080135-41 ....Programmed controller ATtinyl 3V 4.90 9.80 Programmable Servo Driver 080323-41 .... Programmed controller PIC1 2F675 5.90 1 1 .80 Simple USB AYR-ISP Compatible Programmer 080161-41 ....Programmed controller ATmega8-l 6AU 11.90 23.80 Intelligent Presence Simulator 080231 -41 .... Programmed controller PIC1 2C508 5.90 11 .80 LiPo Manager 080053-41 .... Programmed controller PIC1 6F84 1 1 .90 23.80 GPS Receiver 080238-41 ....Programmed controller PIC16F876A 23.00 46.00 Universal Thermostat 080090-41 .... Programmed controller PIC1 6F628 9.00 1 8.00 DTMF-controlled Home Appliance Switcher 080037-41 .... Programmed controller ATmega8-l 6PC 9.00 1 8.00 Solar-powered Battery Charger 080225-41 .... Programmed controller PIC1 2C671 9.00 1 8.00 RGB Lights 08041 9-41 .... Programmed controller PIC1 2F675 5.90 1 1 .80 Microlight Fuel Gauge 080054-41 ....Programmed controller ATmega8 9.00 18.00 Digital Rev Counter for (Older) Diesels 071 1 33-41 .... Programmed controller AT90S231 3 5.90 1 1 .80 Golf Tally 0801 81 -41 .... Programmed controller ATTiny44 5.90 1 1 .80 v J Bestsellers r._.i I _i I i! . \ ’A r 1 2 3 >/> o 4 o CQ 5 1 2 t/t s 3 o C£ ■ 4 O u i 1 t/> q> o 2 3 o& w 5 Embedded Linux Control Centre ISBN 978-0-905705-72-9 £24.00. US$ 48.00 PIC Microcontrollers ISBN 978-0-905705-70-5 £27.95. US$ 55.90 Computer Vision ISBN 978-0-905705-71 -2 £32.00..... US$ 64.00 Visual Basic for Electronics Engineering Applications ISBN 978-0-905705-68-2 £29.95. US$ 59.90 309 Circuits ISBN 978-0-905705-69-9 £20.95..... US$ 41 .90 FPGA Course ISBN 978-90-5381-225-9 £14.50. US$ 29.00 Elektor 2007 ISBN 978-90-538 1-218-1 £1 7.50..... US$ 35.00 ECD 4 ISBN 978-90-5381-159-7. £17.50. US$ 35.00 Home Automation ISBN 978-90-5381-195-5 £13.90. US$ 27.80 Ethernet Toolbox ISBN 978-90-538 1 -214-3 £1 9.50. US$ 39.00 DigiButler Art. # 071 1 02-71 £29.00. US$ 58.00 SAPS-400 Art. # 070688-91 £159.00 ...US$318.00 SpYder Discovery Kit Art. # 060296-91 £9.00.... US$ 18.00 Elektor Internet Radio Art. # 071081-71 £1 15.00...USS 230.00 DCC Command Station Art. # 070989-71 £88.50.. US$ 1 77.00 Order quickly and safe through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH * United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com 10/2008 - elektor 83 INFO & MARKET SNEAK PREVIEW REMOTE CONTROLLED VOLUME POT Remote control is now common for all sorts of equipment in and around the home. With most quality audio gear it's also great to be able to adjust the volume remotely. However, home made and high-end amplifiers however often lack the functionality and that's why we describe a remote volume control that employs a premium Alps potentiometer with motor drive. The electronics involved allows the pot to be controlled with just about any RC5 compatible remote you may have lying around. BUILD YOUR OWN ELECTRIC BIKE Next month we show how to build an electric bicycle from a kit of parts of (no wonder!) Chinese origin. For little money we got an electromotor, a drive unit, a 'throttle', two brake handles and a sensor. The motorised wheel replaces the existing front wheel on your bike. The kit was taken through its paces in the Elektor labs to see if it's any good and the results are published next month. CELLPHONE REMOTE SWITCHER Many situations exist where it would be useful to be able to switch electrical equipment (such as a heating system) on and off from large distances. The circuit published in next month's Elektor enables this to be achieved with an ordinary cellphone (a.k.a. 'mobile' or GSM). Three switching outputs are available for mains-powered equipment. The Text (SMS) message returned by the circuit tells you the current status of each of these outputs. If a GPS receiver is connected up, it is even possible to have the unit send you map coordinates of the remote circuit. The November 2008 issue comes on sale on Thursday 23 October 2008 (UK distribution only). Article titles and magazine contents subject to change, please check 'Magazine' on www.elektor.com UK mainland subscribers will receive the issue between 17 and 20 October 2008. w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor. Elektor 33 the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applica- ble) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you'll find all other products sold by lektor electronic* worldwide m BENEFIT NOW! ts the publishers, like CD-ROMs, kits and books. A powerful search function allows you to search for items and refer- ences across the entire website. c = ~ i = - CnMK cet :n • [•rcrm.ov* mom 0 0 3 t*««ur* tr»ntfur*r fv Prafeop. s>* 9 >p*t>c fitment art wetd chairpttns * *os« sorter Piets retenotar for 2 BV 0 Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact I S^KOr OKr' .tet U2S3 g 8oo«i a CO- Aom* (CtS h *06 Jt% yPCBs :: tlofclor l-vwu :: itoktorjotM :: Construction projocts •Vtfit ■ in 4 j , Workshop Hutercl... SjOffWt piiikierCfM'S t#S o*'» [fronts Onfy for ouhocrlhoro ^IK «ntf* pr." M«r*W tetor. submit! ng Cuts ions l rtVOW Our FAQ Mttor' Su minor Saving* y. 84 elektor - 9/2008 Description Price each Qty. Total Order Code Universal Display Book for PIC Microcontrollers Design your own Embedded Linux Control Centre on a PC CD-ROM FPGA Course £14.50 Computer Vision £32.00 PIC Microcontrollers £27.95 (323 (323 £23.00 £24.00 Free Elektor Catalogue 2008 Prices and item descriptions subject to change. The publishers reserve the right to change prices without prior notification. Prices and item descriptions shown here supersede those in previous issues. E. & O.E. Sub-total P&P Total paid Name Address + Post code Tel. Email Date - - Signature ELIO Yes, I am taking out an annual subscription to Elektor and receive a free 2GB MP3 player*. I would like: I I Standard Subscription (11 issues) Subscription-Plus (11 issues plus the Elektor Volume 2008 CD-ROM) * Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email Date - - Signature ELIO METHOD OF PAYMENT (see reverse before ticking as appropriate) Bank transfer Cheque (UK-resident customers ONLY) □ Giro transfer Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com sales@elektor.com *USA and Canada residents may (but are not obliged to) use $ prices, and send the order form to: Old Colony Sound Lab P.0. Box 876, Peterborough NH 03458-0876. Tel. (603) 924-6371, 924-6526, Fax: (603) 924-9467 Email: custserv@audioXpress.com METHOD OF PAYMENT (see reverse before ticking as appropriate) Bank transfer | Cheque (UK-resident customers ONLY) □ Giro transfer Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com subscriptions@elektor.com 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. Online ordering: www.elektor.com/shop 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: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £11.00 (Priority) HOWTO 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 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. 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. 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 and MasterCard 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 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 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 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 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 other than to supply goods as described or, at the option of Elektor, 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 shall be determined in all respects by the laws of England. September 2007 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £42.00 £49.00 Surface Mail Rest of the World £56.00 £63.00 Airmail Rest of the World £71 .00 £78.00 USA & Canada For US$-p rices please check www.elektor.com HOWTO PAY Bank transfer into account no. 40209520 held by Elektor Electronics, 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. 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 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 and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL- protected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a perma- nent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra 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 service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of student- ship signed by the head of the college, school or university faculty. A standard Student Subscription costs £33.60, a Student Subscription- Plus costs £39.20 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. 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 higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 2008 ClmSccin 5ScaH%d ElmScan 5 is an advanced diagnostic package for use with EOBD compliant vehicles. • Read and clear trouble codes • Access up to 192 engine parameters • Advanced Graphing and Data Logging • Built-in Dyno and Drag Strip feature • And much more... Your price conscious PCB supplier EUllE) CIRCUITS Online price calculation Online ordering Online order tracking Online 24/24H and 7/7D Interested? Contact us: +44 2088 167 0 05 E-maik euro#eu rocircuits.com www.eurodrcuits.com A |a carte pooling for standard boards up to 6 layers from 1 to 1000 pieces from 3 working days onwards - pooling with more options - up to 3 layers - from I to 1O00 pieces - from 3 working days onwards your hoard, our challenge up to 16 layers from 1 piece onwards from 3 working days onwards Index of Advertisers Allendale Electronics Ltd www.pcb-soldering.co.uk Antex Electronics Ltd www.antex.co.uk 43 29 ATC Semitec Ltd, Showcase www.atcsemitec.co.uk 78 Avit Research, Showcase www.avitresearch.co.uk 78 Beijing Draco www.ezpcb.com 29 Beta Layout, Showcase www.pcb-pool.com 29, 78 Bitscope Designs www.bitscope.com 15 Bowood Electronics Ltd, Showcase www.bowood-electronics.co.uk 78 C S Technology Ltd, Showcase www.cstech.co.uk 78 Decibit Co. Ltd, Showcase www.decibit.com 78 Designer Systems, Showcase www.designersystems.co.uk 78 EasyDAQ, Showcase www.easydaq.biz 78 Easysync, Showcase www.easysync.co.uk 78 Elnec, Showcase www.elnec.com 78 EMCelettronica Sri, Showcase www.emcelettronica.com 78 Euro circuits www.eurocircuits.com 87 First Technology Transfer Ltd, Showcase . . www.ftt.co.uk 78 FlexiPanel Ltd, Showcase www.flexipanel.com 78 Future Technology Devices, Showcase. . . . www.ftdichip.com 78 ILP Electronics Ltd, Showcase www.ilpelectronics.com 78 Jaycar Electronics www.jaycarelectronics.co.uk 2 Labcenter www.labcenter.com 88 Lektronix www.lektronix.net/ about/ careers 43 London Electronics College, Showcase . . . www.lec.org.uk 79 Microchip MikroElektronika MQP Electronics, Showcase. . Newbury Electronics Nurve Networks Paltronix Parallax Peak Electronic Design Pico Quasar Electronics Radiometrix, Showcase Robot Electronics, Showcase. Robotiq, Showcase RS Components ScanTool, Showcase Schaeffer AG Showcase USB Instruments, Showcase . Virtins Technology, Showcase www.microchip.com/mtouch 17 www.mikroe.com 3 www.mqp.com 79 www.newburyelectronics. co.uk 69 www.xgamestation.com 69 www.paltronix.com 21 www.parallax.com 49 www.peakelec.co.uk 49 www.picotech.com 11 www.quasarelectronics.com 53 www.radiometrix.com 79 www. robot-electronics, co.uk 79 www.robotiq.co.uk 79 www.rswww.com/electronics 13 www.obd2cables.com, www.scantool.net . . 79, 87 www.schaeffer-ag.de 49 78, 79 www.usb-instruments.com 79 www.virtins.com 79 Advertising space for the issue of 17 November 2008 may be reserved not later than 21 October 2008 with Huson International Media - Cambridge House - Gogmore Lane - Chertsey, Surrey KT 1 6 9AP - England - Telephone 01 932 564 999 - Fax 01932 564998 - e-mail: p.brady@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. 10/2008 - elektor 87 than All levels of the Proteus Design Suite now include a world class fully integrated shape based autorouter at no additional cost. The Proteus Design Suite also incorporates ■ Professional schematic capture ■ Highly confi ■ Publication quality schematics ■ Interactive c ■ Fully configurable bill of materials ■ Polygonal a ■ Large component libraries for both ■ RS274X, E) simulation and PCB layout database e> Mixed mode SPICE circuit simulation 3D Viewer v ■ Co-simulation of PIC, AVR, 8051 and an d DXF ex ARM7 microcontroller firmware ■ Automatic component placement and gateswap optimization Prices start from just £1 50 - visit our website for full details or to download a free demo. Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com exc. VAT & delivery