E I iTHEIKlit DSIOEOZ Now that we are not the cricket wizards anymore, we've reverted back to our trusty soldering irons! Call or log on to our website and apply for a FREE 400 page catalogue. You can purchase on the Net from us 24/7/365 through our secure encrypted system. Post and packing charges are modest and you can have any of 8000+ unique products delivered to your door within 7-10 days of your order. I Smart Card Programmer Kit KC-5361 £15.95 + post & packing Program both the microcontroller and EEPROM in the popular Gold, Silver and Emerald wafer cards. Cards need to conform to ISO-7816 standards, which includes the ones sold by Jaycar. Powered by 9-12VDC wall adaptor or 9V battery. Instructions outline software required which is freely available on the Internet. Kit supplied with PCB, wafer card socket and all electronic components. PCB measures: 141 x 101 mm Jaycar cannot accept responsibility for the operation of this device, its related software, or its potential to be used in relation to illegal copying of Smart Cards in Cable T.V. set top bOXeS. Ml XM Wafer Card ZZ-8800 £3.85 + post & packing This is a multi-chip 'smart card' based on the PIC 16F84A and is coupled with a 24LC16B EEPROM, compatible with most reader/programmer units available including the programmer above. Theremin Synthesiser Kit KC-5295 £14.75 + post & packing The Theremin is a weird musical instrument that was invented early last century but is still used today. The Beach Boys' classic hit "Good Vibrations" featured a Theremin. By moving your hand between the antenna and the metal plate, you can create strange sound effects. Kit includes a machined, silk screened, and pre drilled case, circuit board, all electronic components, and clear English instructions. ill?! We Stock... Electronic Components, Sub-Assemblies & Electronic Kits Power Products & Accessories Audio & Visual Equipment & Accessories Computer 61 Telecoms Accessories Burglar Alarms 61 Surveillance Equipment Lighting Products 61 Accessories Gadgets 61 Unique Gifts 9VDC power supply required (Maplin #GS74R $9.99). Universal High Energy Ignition KC-5419 £27.75 + post & packing A high energy 0.9ms spark burns fuel faster and more efficiently to give you more power! This versatile kit can be connected to conventional points, twin points or reluctor ignition systems. Includes PCB, case and all electronic components. ^’Provec/ ' \ N "Clock Watcher's" LED Clock Kits KC-5416(blue) £55.25 + post & packing KC-5404(red) £41.75 + post & packing These clocks are hypnotic! They consist of an AVR driven clock circuit, that also produces a dazzling display with the 60 LEDs around the perimeter. It looks amazing, but can't be properly explained here. We have filmed it in action so you can see for yourself on our website www.jaycarelectonics.com! Kit supplied with double sided silkcreened plated through hole PCB and all board components as well as the special clock housing! Available in Blue (KC-5416) and Red (KC-5404). in i 11 1 : High Performance Electronic Projects for Cars BS-5080 £7.00 + post & packing Australia's leading electronics magazine Silicon Chip, has developed a range of projects for performance cars. There are 16 projects in total, ranging from devices for remapping fuel curves, to nitrous controllers The book includes all instructions, components lists, color pictures, and circuit layouts. There are also chapters on engine management, advanced systems and DIY modifications. Over 150 pages! All the projects are available in kit form. High Range Adjustable Smart Fuel Mixture Display KC-5374 £8.95 + post & packing This new 'smart' version has a few additional touches such as, auto dimming for night driving, emergency lean-out alarm, and better circuit protection. Another great feature, is the 'dancing' display which operates when the ECU is operating in closed loop. Kit supplied with PCB and all electronic components. • Car must be fitted with air flow and EGO sensors (standard on all EFI systems) for full functionality. Recommended box UB3 $1.95 each Temperature Switch with LCD KC-5376 £22.75 + post & packing Heat can be a major problem with any car, especially modified and performance cars. The more power, the more heat, so you need to ensure you have adequate cooling systems in place. This temperature switch can be set anywhere up to 2192°F, so it is extremely versatile. The relay can be used to trigger an extra thermo fan on an intercooler, mount a sensor near your turbo manifold and trigger water spray cooling, or a simple buzzer or light to warn you of a high temperature. The LCD displays the temperature all the time, which can easily be dash mounted. ^onitorw'g tore - 400+ page Catalogue aycar Post and Packing Charges: Order Value Cost £20 - £49.99 £50 - £99.99 £100 - £199.99 £200 - £499.99 £500+ Cost £5 £10 £20 £30 £40 Max weight 121b (5kg) - heavier parcels POA. Minimum order £20. Log on to www.jaycarelectronics.co.uk/elektor for your FREE catalogue! 0800 032 7241 (Monday - Friday 09.00 to 17.30 GMT + 10 hours only). For those who want to write: 100 Silverwater Rd Silverwater NSW 2128 Sydney AUSTRALIA FT232R usb uart with MCU Clock Generator and FTDIChip-ID™ Security Dongle A MORE Integration - EEPROM, internal clock generator, and USB termination resistors on-chip. Functionality - integrates the functions of USB UART, MCU clock generator and Security Dongle into a single chip. Flexibility - five 10 pins can each be user configured as Sleep, Transmit Enable, Power Enable, MCU Clock Output, TX/RX LED Drive or GPIO Pin Security - FTDIChip-ID™ technology helps protect your application software. I/O Drive Capability - from 5.5v down to 1 .8v levels at 4mA or 12mA programmable strength. I/O Modes - synchronous and asynchronous Bit-Bang I/O OS Support - in house developed & supported drivers for Windows 98,ME,2K, Server 2003, XP, XP64, Embedded XP, Mac OS8,9,X, Linux, Win CE + many 3rd party drivers. Driver Options - VCP and D2XX drivers for all Windows platforms and Linux. Technical Support - a wide range of evaluation kits available from the outset make evaluating the FT232R a snap. Package Choices - SSOP28 and QFN32 Interface Options - also available with a parallel FIFO interface ( p/n FT245R ). •* EVALUATION LESS External Components - no crystal, EEPROM or USB termination resistors required. Board Space - new QFN package takes up only 25mm 2 of pcb area. Manufacturing Cost - minimal external component count coupled with competitive pricing reduces the overall cost. Programming - FT232R comes pre-programmed with each part having a unique USB serial number burnt in. This eliminates the need to program the EEPROM in many cases and saves on production time / cost. Time to Market - FT232R eliminates USB driver and firmware development in most cases thus significantly reducing time to market. FT232* Europe HQ Future Technology Devices International Ltd. 373 Scotland Street, Tel. ; +(44) 141 429 2777 Glasgow G5 8QB, Fax. : +(44) 141 429 2758 United Kingdom E-Mail : sales1@ftdichip.com gboso cbus* GBUS2 www.ftdichip.com A 1 6-bit Microcontroller Starter Kit for under 1 0 pounds With this issue we start selling our R8C/1 3 Starter Kit at a price you can't refuse: just £8.30 plus P&P. If ever you wanted to get your hands on a ready- made 1 6-bit microcontroller board with associated software tools on a CD-ROM now's the time to grab yourself a bar- gain. For the benefit of our readers we've been able to strike an exclusive deal with Renesas and their distributor Glyn for the distribution, at very low cost, of their R8C 1 6-bit microcontroller module. That's right, a module, so there's no SMDs to solder or parts lost to mum's vacuum cleaner. All you need to do is solder a normal size pinheader supplied with the kit. This, we're pretty confident, most of you will be able to pull off. Although supposedly we're test- ing your solder skills, the real reason the pinheader isn't on the modules is that it allows low-cost packaging to be used. You can start using your R8C microcon- troller module straight away using the 'get-u-going' examples in this issue. Next month, we will take the project one step further by mounting the tiny R8C module on a motherboard that not only unleashes the full connectivity in terms of port lines etc, but also adds five or so add -on functions like USB and a power supply! The module being available at low cost through our Readers Services and with several follow-up articles (including a 'C Programming' mini course) in the pipeline, our R8C project is expected to generate quite a bit of interest. As you read this, my colleagues Denis and Patrick in the website department will have created easy links on the home page to a special R8C section that takes you to the ordering system or to dedi- cated topics in our online Forum. There, we hope, users will start exchanging ideas and help each other in case of problems. With apologies to those already aware of it, our online Forum is open to anyone — 'write' access to Forum topics however is a privilege of those of you having subscribed (free of charge) to the E-weekly newsletter. My current estimate is that about 35 percent of buyers or subscribers to the maga- zine have already done so, which is encouraging to say the least. Jan Buiting, Editor fading the way Th is article should appeal to enthusiasts using radio controlled scale mod- els that include an electrical motor without permanent magnet brushes, usually called 'brushless motors'. These ultra-quiet motors require complex drive electronics and Elektor comes up with the goods. Piezoelectric actuators and motors are finding more and more applications. These drives feature excellent dynamics, accuracy down to nanometres and tiny physical dimensions. Nothing to stop the march of the miniature machines! CONTENTS Volume 32 February 2006 no. 351 38 A 1 6-bit Tom Thumb Thanks to the efforts of Elektor Electronics and Glyn, for the first time now a European elec- tronics magazine supplies a complete microcon- troller starter board and accompanying software CD-ROM at less than 1 0 pounds. We already introduced the Rene- sas R8C in the previous issue. Now it's time to start using it. know-how 16 The Quiet Revolution 34 Micro Motors hands-on Brushless Motor Controller 38 A 1 6-bit Tom Thumb 46 Inexpensive (Web) Server 60 Spa rks 'n Arcs 70 6 V Dynamo Regulator 74 Design Tips Automatic gain control for DRM receiver FBI Siren with flashing light Parallel resistor calculations Gain control for Elektor DRM receiver Digital sinewave reference generator 46 Inexpensive (Web) Server Here's how to modify an £20 router into a network or web server. We do need to add some extra storage space and also show you how to add a USB port to an inexpensive router. Apart from providing the required mem- ory expansion it also offers ways to implement many other applications. technology Audio Amplifier with Problems 56 E-blocks — now you CAN info & market 6 Colophon 8 Mailbox Corrections & Updates News & New Products 84 Sneak Preview infotainment 10 Qu izz'Away (December 2005 solution) 69 LabTalk: Our Components Retronics: The Old Physics Lesson 79 Hexadoku (2) lektor lectronics Volume 32, Number 35 1 , February 2005 ISSN 0268/45 1 9 Elektor Electronics aims at inspiring people to master electronics at any person- al level by presenting construction projects and spotting developments in elec- tronics and information technology. Publishers: Elektor Electronics (Publishing), Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) (0) 208 261 4509, fax: (+44) (0) 208 261 4447 www.elelctor-electronics.co.uk. The magazine is available from newsagents, bookshops and electronics retail outlets, or on sub- scription. Elektor Electronics is published I I times a year with a double issue for July & August. Under the name Elektor and Elektuur, the magazine is also published in French, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Mat Heffels (m.heffels@segment.nl) Editor: Jan Buiting (editor@elektor-electronics.co.uk) International editorial staff: Harry Baggen, Thijs Beckers, Ernst Krempelsauer, Jens Nickel, Guy Raedersdorf. Design staff: David Daamen (head of design), Ton Giesberts, Paul Goossens, Luc Lemmens, Karel Walraven Editorial secretariat: Hedwig Hennekens (secretariaat@segment.nl) Graphic design / DTP: Ton Gulikers, Giel Dols Managing Director / Publisher: Paul Snakkers Marketing: Margriet Debeij (m.debeij@segment.nl) Subscriptions: Elektor Electronics (Publishing), Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) (0) 208 26 1 4509, fax: (+44) (0) 208 26 1 4447 Internet: www.elektor-electronics.co.uk Email: subscriptions@elektor-electronics.co.uk Rates and terms are given on the Subscription Order Form Head Office: Segment b.v. RO. Box 75 NL-6I90-AB Beek The Netherlands Telephone: (+31)46 4389444, Fax: (+31)46 4370161 Distribution: Seymour, 86 Newman Street, London Wl P 3LD, England UK Advertising: Huson International Media, Cambridge House, Gogmore Lane, Chertsey, Surrey KTI 6 9AR England. Telephone: +44 (0) 1 932 564999, Fax: +44 (0) I 932 564998 Email: r.elgar@husonmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. International Advertising: Klaas Caldenhoven, address as Head Office Email: advertenties@elektuur.nl Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts pub- lished in our books and magazines (other than third-party advertisements) are copyright Segment, b.v. and may not be reproduced or transmitted in any form or by any means, including photocopying, scanning an recording, in whole or in part without prior written permission from the Publishers. Such written permis- sion must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may exist 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 Publishers to alter the text and design, and to use the contents in other Segment publications and activities. The Publishers cannot guarantee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Segment b.v. 2006 Printed in the Netherlands EF' J comp/ilibla * Support 18. 28 and 40-pm Dip tkqdal cMiro«eni Irqm cfePlC30 fanny 4- QrhtKwudLED*. switches. peiertti omfllfitf* Rs-232 inferlae#. PS^E and ICD;-? conoedoiE, a nd MMC-SD card Biol * All ID Unas available lor expq Soil waiu and samples BIG' 3 80-pin PlCmicro Starter Pack £119.00 V ' ■■.■ t. ■ ■ - JL - >. ■ - •-«.- ' * High quality cfcrvefcpnwnt board ■ BuiR-n USB 2,0 p logrummar ■ Window* ®t'M£ i'2000/XP- compatfclfl * Supports Ihfl 1316*1 SQ-pln tifl4»W iFdrn |he 18f PlCnucro lamily * Cn board LEDs, *w4ch«s. poRonti- orhfllbl^, Iwn FIS 232 !rH 0 ifflCfl&, PS-2 connedor, and MMC'SD and Corn- pad Flash caid dots ■ Alt ID lines available tor expansion ■ BKJPIC3 Slartar Pit*, UndudR: ^ PtClsFB52D MCU module i 1 5x2 charade r LCD J 126X84 pixel graphic LCD * DSl852flterhpemlur6 mmtu ■ USB programming.'power lead ■' Pragrammng softwaie and examples IsPK PRO 64/80-pin dsPIC Starter Pack £14900 * High Quality devflidprne m tenid * BuiH in USB 2.0 progiarnniei * Windf'jws- 93 HI ?itO" XI 1 compair.’lo ■ Suppofl* 64 JWKl W-piri chgMal SKjnif 11 tfinlmlEflr& trnm the d*PlC?b limtly - Orhbowd LCD*. * wile he*, iwe Fts 232 inlarlaew. fiS-485 menace 1WO CAN interfaces, real- time dock 12-bfl AD and DA and C F card skn ■ All 1*0 bnas available lor axpanston 4 rfcPICPF&O srortflf PmM mciludw: dsFIC30F6D14 DSC module *' 16x2 character LCD r 128x64 pixel graphic LCD - DS18S20 Iflmfflrsturfl Sfln&5r k' USB pforjramniiingfjciwfir lead ■■■ Programming software and examples- BIG M i 64-pin AVR Starter Pack £119.00 « High q*. :-.lil y davalopmarrl boaid ■ Suit- m USB J.&piogrsmmflr ■ Wndows Sfl-'ME *2806 XP compalbla « ^uppoils 64 -pin AVR m ic rocord rotters ■ Qn-b04td LED*. tWflCNSt, pfltfllllp- flPMrtett, l wo FiS-232 iintflrlncflt. ps-? Cfjfinflddr am MHCi^D and Coni- pad Flash card slots -■ All LD Rnas available loi expansion - Si^AVFt Siader Padc indutfw: * ATffl*gal2&MCU mflduto 16x2 diarader LCD 128x64 pixel graphic LCD osi8S20tflmi>tiF3tute sof *■' U$8 pfbgfamruwi^powflf l&sd « Programming! software and examples PSoC Starter Pack £119.00 » High quaMy baufllqpmerK board * Birfl ‘Hi USB 2,8 prcpniim«f ■■ WmxIowe W campalibUe * Supports B, 20, ?i and 4fl-pm DIP PSoC mixfld sAjnfli'Mntrollfli* * Dn-board LEDfi SMrtche*. polenli- emetofs. RS-232 IfMitooa, R^-485 mlarTace. CAM pttariace. real-time dock, and MMCiBD and CF card slots r An ID lines available lor expansion ■ Ea*yP$oC3$lartflrPflcif includes v 45 pm PSoC mrcroooniroler * 1 6x2 character LCD ^ 126x84 pfXat graphic LCD v DS 1 8 S 26 lempflrfliiKfl 4 USB programming-power lead ^ Piogr3mnnng *Oltwaae ^hd examples ^readboarcung System* ean supply al MikroE tettrarnkfi prcwhicfcs frem, ntocR cradfl and *bfl tards accepi&d Pnee* shewn extf nde daiivflry and VAI Bread boarding Systems Software and hardware development tools Tel: 0845 226 9451 Web i www.b read boardi ng .co.uk INFO & MARKET NEWS & NEW PRODUCTS Pocket-sized DVB-T receiver design with USB 2.0 Micronas today announced immediate availability of Mic- StickD, a production-ready refer- ence design which enables watching and controlling live DVB-T broadcasts on any USB 2.0-equipped desktop and note- book PC. The design is built around best-in-class components to achieve the required reception performance: a Micronas DRX 3975D COFDM (coded orthog- onal frequency division multiplex- ing) demodulator, a Microtune® MicroTuner™ MT2060 digital TV tuner and a Cypress EZ-USB FX2LP™ controller. OEMs can put this reference design into pro- duction immediately. DRX 3975D is the first COFDM demodulator to substantially exceed all requirements of the NorDig-Unified vl .0.2 Receiver Specification. This allows a sin- gle design for MicStickD to be compatible with all DVB-T recep- tion standards worldwide. Mic- StickD enables you to freely roam across the country or throughout your home. DRX 3975D uses advanced dig- ital filtering techniques, in com- bination with a powerful A/D converter and PLL configuration, to ensure a crisp viewing expe- rience even under challenging adjacent channel conditions. Thus, a simple, non- switchable SAW filter is suffi- cient. A unique pre-SAW IF sense input enables fully autonomous and stable RF-AGC control of the MT2060 eliminat- ing the need for additional RF- AGC circuitry. DRX 3975D implements a progressive digital algorithm in the channel estima- tor, leading to exceptional results in multipath and dynamic echo conditions. This is important for Single Frequency Networks and indoor reception. The Microtune MT2060 single- chip tuner is engineered to com- bine low power consumption with excellent radio frequency (RF) performance. Its single 16- MHz crystal is sufficient to pro- vide the clock signal for both the MT2060 and DRX 3975D. The Cypress EZ-USB FX2LP controller easily handles the high data rate of digital television. All of these features combine to deliver top-quality TV images from a USB device measuring only 2.2 cm by 6.2 cm (0.9" by 2.5"). The MicStickD tuner and capture driver is compliant with the Microsoft Broadcast Driver Archi- tecture (BDA) standard for Win- dows. This ensures optimum per- formance and compatibility with PC software applications, such as CyberLink PowerCinema™. There is no need for an external power supply, because MicStickD fully complies with the USB 2.0 bus- powered specification. The MicStickD reference design comes complete with schemat- ics, Gerber files, Protel design files, a Bill-of-Materials (BOM) and driver software. The BOM has been carefully optimized for low manufacturing cost. MicStickD can be built for around 20 USD in quantities of 100K. OEMs can add an enclo- sure design of their choosing and go straight to production. This royalty-free MicStickD DVB-T USB design kit is available now. Product information on the DRX 3975D COFDM demodulator may be found at www.micronas.com/ products/ by_function/ drx_397yd/ productjnformation/index.html www.micronas.com ( 067016 - 1 ) Veronex customisation services The Veronex family of small plas- tic instrument cases from Vero Electronics, a division of APW, is extremely versatile, suitable for a wide variety of OEM, con- sumer electronics, electrical and instrumentation applications. Available as standard in three colours, four plan sizes, nine heights, plastic and aluminium front panels and three different configurations. The extensive range of accessories and a short lead-time full customisation serv- ice makes it one of the most adaptable small enclosures on the market. As the original manufacturer, VERO Electronics is fully equipped with the required sys- tems and equipment to be able to offer a rapid response proto- typing service, short run pre-pro- duction quantities and volume manufacturing of modified and customised versions. The Quick Customisation Service is simplic- ity itself: AutoCAD files or engi- neering drawings are freely available to customers, who sim- ply mark them up with the required modifications and return them to receive a firm quotation. All sizes can be supplied with an internal copper-silver painted coating to provide EMC capabil- ity; typical attenuations are bet- ter than 95 dB at 1 MF Iz, falling to 46dB at 1 GHz. All sizes can be moulded in many different materials and colours; milling, punching, drilling and silk screen- ing of both the enclosure body and end panels is also available. IR-transparent end panels, battery compartments and holders, belt clips, LCD viewing windows can all be supplied. Vero Electronics, Electron Way, Chandlers Ford, Hants S053 4ZR. Tel: + 44 (0)23 8026 6300, fax:+ 44 (0)23 8026 5126. www.vero-electronics.com (0670 1 6 - 2 ) 12 elektor electronics - 2/2006 USB UART bridge has built-in security dongle Future Technology Devices Inter- national Ltd (FTDI) have unveiled the FT232R - the next genera- tion of their popular USB- UART Bridge family. This highly inte- grated device includes onboard EEPROM, master clock genera- tor, 3.3 V LDO regulator, reset generator and USB termination resistors. Only two external decoupling capacitors are required for a minimal configu- ration. In addition to the full set of modem control signals, the device features five IO pins which can be configured in EEP- ROM to have several functions including providing a output clock which can be used to drive an external MCU or FPGA. Each device has a unique number (the FTDIChip-ID™) burnt into it at manufacturing time which cannot be altered by the end user. Though an encryption scheme, this feature can be used by product designers to protect their applica- tion software from being copied. FT232R features a wide range of royalty-free FTDI developed drivers for 32 and 64 bit oper- ating systems including Win- dows, CE, Linux and MAOOS. The FT232R comes in both stan- dard SSOP-28 and miniature QFN-32 5mm x 5mm package options. A version of the device with a parallel FIFO interface (p/n FT245R) is also available. Future Technology Devices International Ltd., 373 Scotland Street, Glasgow G5 8QB. Tel. (+44) (0)141 429 2777, fax (+44) (0)141 429 2758. salesl@ftdichip.com. www.ftdichip.com (0670 1 6-3) Game console development doesn't have to be a War Of The Worlds Nurve Networks LLC's new XGameStation Pico Edition edu- cational game console develop- ment kit is now shipping world- wide. The Pico Edition is a fol- low up to the previously released pre-assembled XGameStation Micro Edition. The Pico Edition is for students and hobbyists that actually want to build the system by hand from a kit of parts. The Pico Edition comes as a kit com- plete with a solderless bread- board and all the components to build an entire working game console in about 1-2 hours. Video games generate billions of dollars in revenue each year and game programming books occupy rows of bookstore shelf space. Video game development has made its way into college curriculums and entire game pro- gramming universities have emerged. But video games run on advanced hardware, the design of which is a black art that few understand. For more than a decade, books by Computer Scientist and best- selling game development author Andre LaMothe (his latest title "Tricks of the 3D Game Pro- gramming Gurus") have taught generations of game developers to create today's cutting-edge video games. Now, his focus is changing from video game soft- ware to video game hardware with the unveiling of the XGameStation Micro and Pico Editions, a revolutionary new way to learn about the hard- ware that goes into building game consoles themselves. The XGameStation Pico Edition (XGS PE) is a complete game development kit inspired by clas- sic systems such as the Atari 2600, 800, Apple II, C64 and Nintendo Entertainment System. The XGS PE kit includes a kit complete with all the parts, nec- essary cables, an eBook written by Andre LaMothe on the design and programming of the XGS Pico Edition along with all the software necessary to create your own games, demos, and experiments. Armed with a complete under- standing of how the system was built and operates, users then create their own games or play games made by their peers. The online community at www.xgamestation.com com- pletes the system's appeal, pro- viding a place for XGameStation developers to share ideas, soft- ware and even discuss hard- ware modifications. The system plugs into any NTSC TV and supports vintage Atari 2600 controllers. XGameStation Pico Edition's games and appli- cations are stored on the internal processor's Flash memory, allow- ing users to develop and down- load their games from a PC using the accompanying tools. The official Website for the XGameStation is www.xgames- tation.com/?refid=pr, where you will find media, downloads, demos, and more information on purchasing the XGS Pico and Micro Editions. (0670 1 6-4) 2/2006 - elektor electronics 13 INFO & MARKET NEWS & NEW PRODUCTS New 1 6-bit XAP4 processor core ASIC n ^ e r- MU. I XAF4 IP- MUVI in? -» F ■ "i c 'JTJLWMM FLAkn I t RW ivS-ClM ■ I AJtMOGW I HI IITIMV OJVOW iHtinM CHCUTPY d-1 kly a Mhpv Cambridge Consultants has released a new 1 6-bit RISC microprocessor IP core, which it will feature at the Design & Reuse IP-SoC conference in Grenoble, France on December 7th and 8th 2005. The all-new 1 6-bit XAP4 features a modern, high-performance RISC architecture with low gate count, low power consumption and high code density. It is opti- mized for use in cost and per- formance sensitive ASIC designs and is available for evaluation now. On a 0.1 8 micron CMOS fabrication process, XAP4 can deliver up to 63 Dhrystone MIPS at a clock frequency of 117 MHz. This benchmark perform- ance of 0.54 MIPS/MHz is a 50% improvement over Cam- bridge Consultants' previous 1 6- bit processor, XAP2, which has been manufactured in hundreds of millions by licensees such as CSR, and in ZigBee radios, auto- motive devices and low-power industrial and medical sensors. The XAP4 has both 1 6-bit data and address buses and is capable of running programs up to 64 kBytes. The first implementation of the processor has a two-stage pipelined Von Neumann architec- ture. It is delivered to licensees as a soft IP core in Verilog RTL that can be synthesized in as few as 1 2k gates for ASICs where die size and power consumption must be as small as possible. Cambridge Consultants has already delivered XAP4 to one licensee and is in dis- cussion with other prospective cus- tomers at present. The 1 6-bit XAP4 is the latest addition to Cambridge Consul- tants' microprocessor core line- up. There is also the 32-bit XAP3 for more demanding applica- tions, and in development is the XAP5 that also uses 1 6-bit data but extends the address bus to 24-bits, providing support for larger program sizes up to 16 Mbytes. All these processor cores include Cambridge Consultants' SIF debug logic, which provides full control over the processor and access to its debug registers, together with non-invasive access to any part of the processor's memory map for data acquisition while a system is running. The architecture and design of the XAP3, XAP4 and XAP5 processors was conceived at Cambridge Consultants to fulfil the requirements of modern ASIC-based systems running code written by different pro- grammers including real-time operating systems. All the processors include hardware support for privileged operating system modes where code run- ning in user mode cannot cor- rupt supervisor or interrupt code. Code is position independent and there is also support for unaligned data access, making programs easy to port and quick to run. Most programs will be written in C and the processors feature direct support for many of the language constructs, which results in higher code den- sity. There is hardware support for rapid context switching, for example, when interrupts occur, and there are multi-cycle instruc- tions to speed up multiply, divide and block copy operations. All of Cambridge Consultants' XAP microprocessors are sup- ported by its xlDE integrated soft- ware development and debug environment, which includes a programmer's editor, assembler, debug interface, instruction set simulator, project build manager and GCC compiler, which pro- vides the path for programming in C++. xlDE is quick and easy to install and use on Windows PCs, with Linux/Unix and Mac OS versions also available. xlDE can be customized to add features specific to a licensee's ASIC or ASSP, and licensees can brand and deliver xlDE to their developers. Other advanced technical fea- tures of the XAP3, XAP4 and XAP5 include: hardware support for operation as a slave proces- sor when a master processor downloads a code image and bootstraps the XAP, support for multi-processor debug over SIF and architectures for combining XAP with Cambridge Consultants' APE signal processing engine, which offers a dynamic data path routing capability. Details of the cores can be found at www.CambridgeConsultants.com / ASIC, including trial downloads of the xlDE software tools. Cambridge Consultants Ltd, Science Park, Milton Road, Cambridge, CB4 ODW, UK. Tel: +44 (0)1223 420024; Fax: +44 (0)1223 423373; www.cambridgeconsultants.com (0670 1 6-6) Advertisement Your price conscious PCB supplier Verified Online price calculation Online ordering Online order tracking Online 24/24H and 7/7D Interested? Contact us: +32 15 28 16 30 E-mail: euro@eurocircuits.com a la carte ■ €*< U ■ On demand rs ■■ l *2$ ■ fw ' pooling for standard boards up to 6 layers from 1 to 1000 pieces from 4 working days onwards - technology at the right price - up to 8 layers - from 1 to 1000 pieces - from 3 working days onwards your board, our challenge up to 20 layers from 1 piece onwards from 2 working days onwards 14 elektor electronics - 2/2006 SOT-23 Li-ion / Li-polymer battery charger Microchip announces the expan- sion of its power-management family with the MCP73831 bat- tery charger - a fully-integrated, single-cell, Li-lon/Li-Polymer charge-management controller. Equipped with a pass transistor, current sensing and reverse-dis- charge protection, the MCP73831 charger reduces the number of components needed for battery-charger designs. Another key feature of the MCP73831 charger is its simple status output that directly drives single or multi-colour light-emit- ting diodes (LEDs). Its highly accurate, pre-set volt- age regulation (maximum up to 0.75 percent) results in more fully charged batteries and extended battery life. In addi- tion, the device's charge current is user-programmable, enabling customized charging currents for specific applications. The con- troller also features on-chip ther- mal regulation that decreases charge current in over tempera- ture situations, thus preventing damage to the device. The charger also supports multiple regulation voltage outputs, mak- ing it an effective charging solu- tion for different types of Lithium battery technology. The device's 5-pin SOT-23 or 8- pin, 2 mm x 3 mm, thermally efficient DFN package enables smaller, smarter charger designs for a variety of portable devices such as Blue- tooth® headsets, MP3 players and digital cameras. The thermal efficiency of the DFN package also allows high charging cur- rents of up to 500 mA for faster charging. Microchip offers the MCP7383 1 EV Evaluation Board for $45 to support the develop- ment of battery charger applica- tions using the new MCP73831 charger. This board is available today at http: / /buy.microchip.com /. The MCP73831 is available today for sampling and volume production. For additional infor- mation on the product see www.microchip.com/MCP7383 1 (0670 1 6-5) SmartProg2 now with USB The growing popularity of note- book PCs and the absence of the parallel interface (LPT port) even on desktop PCs is the rea- son for the gradual extension of the portfolio of Elnec program- mers with types connectable to a PC through the USB port. The first such Elnec programmer with the USB interface was BeeP- rog. SmartProg2 comes as the second one. Thousands of sold SmartProgs were the argument for a modification of the type, to make it connectable to a PC through the USB port instead of the LPT port. The basis of Smart- Prog2's hardware is a 40-pin versatile pindriver and freely pro- grammable voltage generators, as well as the limitation of the logical high level, which allow to support low-voltage (as well as true LV) chips, from 2 V up. All supported chips with up to 40 pins are programmed in the base socket. The traditional diagnostic POD (for self-testing) is an ELNEC standard. The quality hardware is comple- mented by top software, which, as a standard, supports all MS Windows operating systems (from WIN. 95 to WIN.XP). The latest version of the software is available on our website (www.elnec.com), free of charge, of course. SmartProg2 supports more than 10500 pro- grammable circuits (February 2005) and their number is con- stantly growing. SmartProg2 is controlled by a status automat, based on a pow- erful FPGA circuit, and it sup- ports communication with a PC through the full-speed USB 2.0 interface, so the programming of circuits is very fast. Its reliability is enhanced by the classic ELNEC-designed metal casing. The dust cover of the ZIF socket, supplied as a standard, and a rubber pad under the socket's lever, protecting the program- mer's surface against damage, speak about the sense of detail. SmartProg2's target segment is the customers who require a ver- satile programmer as well as those who find BeeProg too powerful and therefore unneces- sarily costly. 'In circuit' program- ming through the ISP connector may therefore be the decisive argument for SmartProg2 becoming your favourite. More information at: www.elnec.sk (0670 1 6-7) 2/2006 - elektor electronics 15 KNOW-HOW DC MOTORS Electric motors are impressively simple and efficient. Whereas even the most modern diesel engine might have an efficiency of no more than 45 %, a modern DC motor can achieve a figure as high as 98 %. This is accompanied by extremely high torque, excel- lent power-to-weight ratio, good reliability and comparatively low cost. Following extraordinary developments in the field of electric model aircraft, the special qualities of DC motors have also led to their increasing use in hybrid vehicles. Unfortunately, the perfect mobile power source still needs to be invented before the steam-engine-inspired internal combustion engine can finally be consigned to the museum. 16 elektor electronics - 2/2006 When efficiency figures rise to within a few percent of the magical 100 % value, minds will no doubt fill with doubts and thoughts of perpetual motion machines. But there is no need for concern: here physics is on our side. And it will not come as a surprise that the automo- tive industry is also turning to the electric motor with hybrid technology. Indeed, the electric motor has already made more progress than many realise: already the first race has been won by an electrically- powered vehicle. A modern vehicle, although not usu- ally electrically-powered, will nevertheless have a starter, steering, cooling system, electric windows, elec- tric mirrors, powered seat adjustments, ventilation and suspension control, all driven by electric motors. This list is far from complete: a fully-equipped lux- ury car will have well over a hundred invisi- ble DC-powered helping hands, driving demand for greater efficiency and lower weight. Although in a comparatively less advanced state of development, the situation has been similar in model aircraft technology for some time. The might of the DC motor is pitted against the force of gravity in electric aircraft under F5B com- petition rules, where a two kilo- gram model aircraft can be cata- pulted vertically into the air at 80 metres per second. The power consumption of these motors, which have a mass of around 300 grams, can be nearly four kilowatts. Although some might dismiss these hobby activi- ties as frivolous, they have in fact acted as a pacemaker for other, more 7 down to earth 7 applications. Any DIY fan will appreciate the increased productivity that comes from having a convenient and light cordless screwdriver: a benefit of powerful and low-weight motor and bat- tery technology. What it's all about The electric motor is a transducer which converts electric power (P in ), the product of voltage (U) and current (/), into mechanical power (P out ), which can be calculated by multiplying angular velocity (co) by torque (t). The effi- ciency (r|) is calculated as the ratio between the output power and the input power. Power loss is the difference between the input power and the output power (Figure 1); this power is not strictly 'lost', but rather con- verted into heat. This dissipated heat warms the internals of the motor, which reduces its efficiency further as the resistance of the copper increases. Ultimately this can lead to overload and thermal failure: with temperature sensitive magnetic materials this can occur at between 1 20 g C and 1 50 g C. Good efficiency is of fundamental importance to electric motors, not just in the interest of better use of energy, but also in the interest of longer operating life. Two motors of equal size, one with an effi- ciency of 80 % and one with an efficiency of 90 %, although differing in efficiency by 7 only 7 10 %, differ in power dissipation by 50 %. The maximum power that can be converted by an electric motor is also chiefly dependent on its efficiency. Forced cooling systems, such as built-in fans, can of course be added, but these make the motor more complicated. They also consume power even when they are not actually needed, such as under Figure 1. The electric motor is a very effective converter of power. low load and correspondingly high rotational speed. Another characteristic of modern motors is that achieving high rotational speeds (greater than 50,000 rpm) no longer presents an obstacle. In the majority of applica- tions electric motors should be able to produce enough torque, reducing the need for gearing even to the point where direct drive using a hub-mounted motor is feasible. Of course, a high current is required to achieve a high power output, which can be expensive, especially when using batteries. To achieve the same torque with lower current, the number of turns in the motor windings can be suitably increased; this has the side-effect of increasing the resistance of the windings. In either case, the power dissipation in the windings must be borne in mind. The power dissipation depends on the current and the resist- ance: P = PR. The shape of the windings is also impor- tant. The available space must be filled as completely as possible ( 7 high fill factor 7 : see Figure 2) and as much of the copper as possible should move within the magnetic flux: the ends of the windings contribute to power losses but not to torque. It is difficult to achieve high torque and high efficiency simultaneously, but there are a few techniques available to try to get the best of both worlds. An example is the use of a strong magnetic field. If permanent magnets are used, then the main question is one of material cost. Modern DC motors use neodymium (NdFeB) magnets, which have up to ten times the energy product (B x H ) of normal ferrite (SrFe) magnets. This increases torque and reduces the specific rotational speed (n spec ). Neodymium magnets can achieve remanence values of up to 1 300 millitesla (mT). Unfortunately they are more temperature sensitive: for higher thermal robustness cobalt-samarium magnets (for example SmCo5 alloy) can be used, although these offer a remanence of 7 only 7 up to about 1000 mT (Figure 3). Figure 2. A high fill factor is important: here there is some room for improvement! 2/2006 - elektor electronics 17 KNOW-HOW DC MOTORS Figure 3. Large ferrite magnets are being superseded by small neodymium- based magnets. Figure 4. Diagram of a conven- tional iron-cored motor. Figure 5. The brush system in a mechanically-commu- tated DC motor is com- plex, lossy and prone to wear. Figure 6. Diagram of a mechani- cally-commutated iron- less core motor. Figure 7. Diagram of a brushless motor with interior rotor. Magnets Shaft _A Bearing Back iron 050321 - 12 Back iron lllllllllllllllllllllllllllll Rotor Armature (potted coil) Magnets Brushes Connections / Commutator 050321 - 13 A powerful magnet is only half the battle. Like an elec- tric circuit, the magnetic circuit must be short and of adequately large cross section (low 'magnetic imped- ance'). This is best achieved using a large amount of iron, which is also, unfortunately, heavy and responsi- ble for further losses. When an iron core (which in con- ventional motors also carries the windings) rotates in a magnetic field there are iron losses which comprise losses due to hysteresis and losses due to eddy currents, and which are speed dependent. It is not possible to prevent these losses, and so the efficiency of the motor decreases with increasing speed. To reduce the losses as far as possible, motor manufacturers use high-quality iron (a 'soft magnet') and a large number of segments. Iron cores are never solid, but divided lengthwise into as many layers as possible, isolated from one another and thus cutting the path of eddy currents. Eddy cur- rents arise not only in the core but also in all other elec- trically-conducting parts of the motor, including the magnet and the windings. These are reduced by the rather involved technique of segmenting the magnet and making the windings from a number of fine parallel wires or a braid rather than a single solid conductor. The desire to avoid iron core losses has prompted the invention of iron-free motors, but these do not exactly offer high levels of torque. The ideal motor, then, has yet to be invented: we must be content with selecting a suitable motor depending on the requirements of each application. Classical designs In numerical terms the dominant technology is the iron core motor (Figure 4). The rotor has at least three coil segments, which suffice for most low-voltage applica- tions. High operating speeds require a balanced epoxy- potted rotor. Around it, separated by an air gap of a few tenths of a millimetre, is the stator com- prising a system of permanent magnets. The motor housing completes the magnetic circuit (like a return wire in an elec- trical circuit). The coil connections run to the individual commutator segments, from where the current flows via sliding brushes (generally made of copper- loaded graphite, also called 'carbon') to the motor con- nections. The brush arrangement is the part most prone to wear and failure. Its size reflects the power of the 18 elektor electronics - 2/2006 motor: in high-current motors the commutator (also known as the 'collector') is large and the wide brushes exert a high pressure in order to minimise voltage drop. The whole system looks, and behaves, like a shoe brake. Motors of this type require a high no-load current just to overcome the braking torque. The motor operates rather more economically at higher load, when the external torque is several times greater than the internal torque. Conversely, smaller brushes exerting a lesser force can only carry low currents if wear is to be kept within rea- sonable limits, which considerably restricts the range of possible applications of these motors. A further disadvan- tage is the radio-frequency interference produced by the commutator, which increases wear and entails the use suppression measures (Figure 5). More sophisticated are the so-called 'ironless core' motors (Figure 6). Here an iron-free armature (generally a self-supporting coil potted with fibreglass cloth) rotates around a central magnet. The motor enclosure completes the magnetic circuit. Since there is no iron rotating in the field, iron losses are negligible and efficiencies of over 90 % are possible. These motors also offer relatively low torque since the magnetic flux has to span two air gaps and the thickness of the coil. Ironless core motors are generally powered via fine precious-metal brushes. Their advantage is their high efficiency (albeit at low power) and in particular the low inertia of the rotor. They are therefore suitable where rapid response is required with continuously changing speed and direction of rotation. Figure 8. Construction of a two-pole motor with air-gap winding. Figure 9. Diagram of a slot- wound four-pole motor. Silicon replaces carbon The wear and losses entailed by the use of a commutator are not the only disadvantages of a conventional motor. Since it is a purely mechanical construction, the manufacturer has rather limited choices regarding current management. Things are rather different when we introduce mod- ern elec- tronics into the pic- ture (see the text box and the brush- less motor controller project, elsewhere in this issue). Of the two halves of the magnetic system it is now not necessarily the electrical part, i.e. the coil, that has to turn. In electroni- cally- commutated, and therefore brush- less (or sometimes 'BL') motors, it is the mag- net that turns (Figure 7). This gives a smoother rotation than can be achieved using copper coils and speed stability is also improved, now depending only on the quality of the bearings, which are the only remaining mechanical parts prone to wear. The first brushless motors delivered power at very high speeds, meaning that a planetary gearbox needed to be attached. The motor itself is of simple construction: all that is involved is a cylindrical central magnet with three potted coils around it and a laminated iron enclo- sure to complete the magnetic circuit (Figure 8). Since the ends of the windings are relatively large in this design of motor, the devices are considerably longer Figure 10. Pseudo-iron-free 'Tango' motor with a six-pole rotor. Tango 45-08 brushless motor Figure 1 1 . The speed, torque and efficiency of the motor of Figure 10 depend on the motor current. 2/2006 - elektor electronics 19 KNOW-HOW DC MOTORS Figure 1 2. The distance between the magnets in a multi- pole machine (in this case with exterior rotor) should not be too small. Right, a ten-pole rotor where one pole is formed by each group of three adjacent magnetic strips. rather than an opposite, south pole. The enclosure com- pleting the magnetic circuit can then be made thinner, thus reducing the total weight of the motor. An interesting development in this direction is the 'Tango' modellers' motor from Kontronik. The 6-pole rotor (Fig- ure 10) is surrounded by an iron-free self-supporting coil as stator. This is enclosed in a thin-walled iron cylinder which completes the magnetic circuit. The novel feature is that this cylinder is mechanically linked to the rotor and turns with it. There is thus no relative motion between the magnetic field and the iron, minimising speed-dependent losses. This is a brushless variation on the ironless core motor which, thanks to the use of six poles, offers formi- dable torque (see Figure 11). Figure 13. Diagram of a brushless motor with exterior rotor. Figure 14. Brushless motor with exterior rotor designed for use in models. than their diameter. This gives improved efficiency (greater than 90 %) and power-to-weight ratio. More poles Greater torque is of course desirable. One tried and tested method is to increase the number of magnet poles: in conventional technology (using brushes) this was sim- ply too complicated to achieve. A four-pole motor (Fig- ure 9) has a magnet pole every 90 degrees, alternating north and south. This functions as if there were two motors in one enclosure. This halves the speed of the motor, as one transition from north to south and back cor- responds to only half a revolution. The torque, however, is multiplied by four. Sometimes we speak of an 'electri- cal 2:1 reduction gearing'. This idea can be taken further: to six, eight or even ten poles distributed around the rotor, with a corresponding gearing-down effect. The paths of the magnetic flux are also shorter, running from a north pole to an adjacent, External rotors Of course there are limits to the number of poles that can be used. As the magnets get smaller the windings also have to be split into more and more segments. In itself this does not cause any great problems, but it turns out that as the poles of the magnets are sited closer and closer together efficiency falls off. This is because part of the flux finds its way to a neighbouring pole without pass- ing through the stator. As a result, the gearing relation- ship between speed and torque does not hold for higher pole counts. Greater spacing is required between the poles, which implies that they need to be arranged in a larger circle (see Figure 12). So as not to increase the size of the enclosure, the design is turned inside-out: thin permanent magnets on the outside, thick electromagnets (the coils) on the inside. The result is a so-called 'external rotor' (see Figure 13). One useful side-effect of this arrangement is the greater leverage that the force pro- duced between stator and rotor has on the output of the motor, which increases torque still further. The exterior of the motor can no longer be held fixed, but there is the advantage that the magnets, turning along with the exte- rior part of the enclosure, are better cooled and therefore less likely to overheat when the motor is overloaded. Multi-pole exterior rotor designs, with their exceptional torque, are pre-eminent among electric motors and strike terror into the hearts of gearbox manufacturers. If a gear- box is required, it is essential to ensure that it can with- stand the torque the motor is capable of producing. A disadvantage of the exterior rotor design is that it is harder to cool the stator, which now lies in the middle of the motor. Copper and iron losses have to be managed, and there is less space for the windings. The main appli- cation area for this type of motor (Figure 14) is there- fore where brief or intermittent bursts of power are required, such as in hybrid-drive cars and in electric model aircraft. A special place is occupied by LRK motors, which fulfil the requirements of modellers for directly driving as large a propeller as possible. They fea- ture a very simple and therefore economical construction: a free-running rotor with normally 14 magnets (ten mag- nets is also possible) encloses a 1 2-part stator. A special winding technique is used called 'separated phase sec- tors', or SPS: here each phase is assigned to a separate sector. This guarantees a very close magnetic coupling between the two magnetic systems and a high speed reduction ratio and correspondingly high torque. Drives of the future Power electronics and modern magnetic materials have brought about radical, but practically unnoticed changes 20 elektor electronics - 2/2006 in electric motor technology: what one might call a 'quiet revolution'. In many applications brushless electric motors deliver better power-to-weight ratio than fuel-powered engines. In automotive drive systems we are only now learning how to take advantage of the enormous torque that electric motors can provide, practically independent of speed, as featured in high-performance hybrid vehi- cles such as the Lexus RX 400h. The main electric motor in this large car delivers 1 23 kW (1 67 bhp) with a torque of 333 Newton-metres. A second electric motor driving only the rear axle provides a further 50 kW (68 bhp) with a torque of 1 30 Newton-metres. Together the two motors form a permanently engaged three-phase electronically-controlled drive operating from a maximum voltage of 650 V. The battery for the hybrid system is made up from a total of 240 NiMH cells. With a nominal cell voltage of 1 .2 V this makes for a total battery voltage of 288 V, from which a central inverter generates appro- priate voltages for the motors. Each cell has a capacity of 6.5 Ah, giving a total stored energy at 288 V of 1 .87 kWh. The battery can deliver a power of 45 kW. The current trend towards hybrid technology not only has the benefit of saving energy and reducing CO 2 emis- sions; it also means that electric drives in larger cars can be tested and refined without using revolutionary battery technology. If at some point a suitable power source (such as the fuel cell) becomes available to allow a purely electric drive system to be built, the relevant motor technology will already be mature. The hybrid concept will take another step forward when lithium-based batter- ies, which are considerably more powerful than their nickel-based counterparts, are used in cars. Here again model aircraft builders are already one step ahead! ( 050321 - 1 ) What keeps it turning? Fundamentally all electric motors consist of two magnetic sys- tems which interact with one another. One is fixed, and is called the stator. The other is mounted so that it can rotate, and is called the rotor. In modern DC electric motors one of the systems is invariably constructed using permanent mag- nets with fixed polarity while the other is constructed from electromagnets whose polarity depends on the direction of current flow in them. The interaction between the two systems is governed by the familiar principle that like poles repel and unlike poles attract. To achieve continuous rotation it is nec- essary to reverse the polarity of the electromagnet system at the moment when the two (previously) unlike poles come to their point of closest approach. In electric motors this polarity reversal is called commutation. In conventional motors the polarity reversal is achieved using purely mechanical means, where copper commutator segments rotate under fixed 'brushes' with which they make electrical contact. In brushless (BL) motors electronic circuits in the form of bridges constructed from power FETs are used (Figure 15). To be able to start the motor up and keep it running, at least three half bridges are required. The three outputs go to the motor windings, which can be arranged in a delta or in a star configuration (Figure 16). Figure 1 5. Simplified three-phase bridge drive circuit. The control electronics ensures that two switches in the same column are never on simultaneously. The three windings are connected to the DC supply in turn, so creating a rotating magnetic field that drags the rotor with it. Exchanging two of the phase connections will reverse the direction of the motor. The similarity to three-phase motors is striking. In principle the electronically-commutated DC motor is identical to a syn- chronous motor, although the field rotation rate is not fixed in relation to the mains frequency and the motor need not lose step with the field under high load. The types of brushless motor described here generally produce their own field fre- quency in the control electronics, the field turning as the rotor does and the windings only being switched when the rotor is in the correct position. To determine the position of the rotor poles magnetic field sensors (such as Hall effect sensors) can be used; more recent designs, however, dispense with the sensors and determine the position of the rotor from the back EMF pro- duced by the motor, which is available across any winding that is not at that moment connected to the power supply. Since this voltage can only be measured when the motor is running, start-up must be done in 'open-loop' mode without this feedback: sensorless motors therefore tend not to start up very smoothly. As you would expect from Elektor Electronics, we put theory into practice: elsewhere in this issue you will find a project to build a controller for brushless DC motors. Delta arrangement A Star arrangement Y Figure 1 6. The motor windings con be wired in a star or delta arrangement. 2/2006 - elektor electronics 21 Speed control for radio controlled scale models This article mainly concerns enthusiasts using radio controlled scale models that include an electrical motor without permanent magnet brushes, usually called / brushless motors'. 22 elektor electronics - 2/2006 The massive inter- est in recent years for this type of propulsion system has made it possible to take electric motors to record levels in terms of efficiency and compactness, with the inevitable trade-off of increased complexity in control electronics. This article descri- bes the basic theoretical principles lin- ked to the operation of these motors, and a solution that is dependent on the ST7 microcontroller, recently introdu- ced to the market and completely dedi- cated to this type of application. The brushless motor Not very complicated, a brushless motor is characterised simply by three coiled phases, distributed along a sta- tor and positioned across a rotor com- posed of permanent magnets. Manu- facturers often state the number of pole pairs characterising their motors. Applying current to the coils produces a magnetic field. The ‘secret’ lies in an appropriate sequence applied to three phases of the motor in order to induce mechanical rotation. The three coils will allow us to produce a magnetic field in six different direc- tions; the induced (coils) and ‘natural’ magnetic fields of the magnets tend to be aligned from this point, to finally describe a complete rotation. To do this, you will need six switches, which are, in our application, none other than MOSFETs, in order to apply the sequence also known under the Main features: • Input voltage: 5.5 to 20 V • Current: 1 8 A • Phase advance independently adjustable for min. & max. speeds (0 to 30 degrees) • Soft-start / Active braking / Throttle calibration • BEC can be disengaged and released & choice of battery type (6 to 14 NiMh/NiCd cells, automatic detection of 2 to 4 LiPo cells) •Adjustable PWM frequency: 12/24/48 kHz • Buzzer mode (loss of receiver signal) name of ‘trapezoidal method’ ( cf the shape of the motor current waveform). Figure 1 shows the current induced in the coils during these six steps, and the resulting mechanics are shown in Figure 2. current through windings A, B and C +V D c Figure 1 . Six successive steps for one complete rotation of the induced magnetic field. Figure 2. Alignment of the induced magnetic field for each of the six steps. 2/2006 - elektor electronics 23 HANDS-ON RC MODELLING Figure 3. Voltages at the terminals of phases A & C (step 1 ). The control principle We can model the power stage, with six switches operating at fixed-fre- quency PWM (Pulse Width Modula- tion), allowing us to describe six dis- tinct steps during which two of the three phases are excited. We’ll call phase 1 +Vcc phase 2 voltage at phase B / demagnetisation commutation T 1. T4 _^ T1 . T6 050157-16 Figure 4. Demagnetisation of the phase being observed. passing from one step to the following step, ‘commutation’ (1 — >2, 2 — >3, 3 — >4, 4 — >5, 5 — >6, 6 — >1) The current is adjus- ted by varying the pulse width (duty cycle) of the control signals applied to the power MOSFET gates, thus allo- wing the coil and magnet fields to reach alignment more or less quickly. And it follows, at low current, we get low rotation speed, and conversely. The entire control principle of this type of motor depends on the response to only one question: when should the commutation from step n to step (n + 1) occur? For that, we must be able to detect magnets passing in front of the coils, and to remain in perfect synchro- nisation with this mechanism at each step. In addition, we must verify that the motors are really synchronous motors, because, in the end, stator flux and mechanical rotation speed will be identical with only one pole pair; the number of pole pairs determine the ratio between electrical time (time required for six switches) and mecha- nical time (time required to complete one complete physical rotation). The- refore, one motor with only one pole pair will need six commutations (step 1 tthrough 6) to perform one 360- degree rotation. For two pole pairs, we must perform two times six commuta- tions, or 12 commutations. Here, we see the ratio enabling the conversion between electrical and mechanical fre- quency: a motor which has, for exam- ple, seven pole pairs, revolving at an RPM of 15,000 (or 250 Hz), will actually operate at an electrical frequency of 7*15000/60 = 1750 Hz, or a commuta- tion frequency of (passing from step n to (n+1)) from 6 * 1750 = 10.5 kHz. Be careful not to confuse commutation fre- quency and applied PWM frequency on the motor windings, as they are two very independent things! The first controllers that came into being some years ago actually came with Hall-effect sensors informing the electronics about the rotor position and causing commutation at the right time. More recently, in response to a wider motor market, sensorless’ solutions were introduced, being capable of accommodating connections to three phases. Clearly, our setup falls into this last category. Detection of the rotor position and synchronisation At each step, only two or three phases are utilized. Why not use this floating phase to send the signal which will trigger the next commutation? This is an excellent idea relating to the elec- trical data moved at this specific point. And what happens? When the motor runs, the movement of the magnets induce a voltage (increasing or decrea- sing) to the unenergised coil terminals (electromotive force), and this happens independently from the energy injec- ted into the other two coils (manual rotation of the axis and a simple volt- meter in AC mode connected between two phases of a unconnected motor enables us, in general, to generate consequential voltages). With the help of this induced voltage, we are then ready to detect a synchronous signal from magnet movement. Figure 3 shows oscillograms of phases A and C during step 1. We apply the PWM signal to MOSFET Tl, while T4 effectively short-circuits phase B to ground. Phases A and B form a resistor divider (theoretically, the phases have the same resistor), and we receive the PWM signal in A divided by two at point C, to which the voltage induced by magnet movement is added. All that is left is to choose a precise point on this curve which will give us one piece of synchronisation data — all that is needed is one simple voltage reference and one comparator. After filtering, we can trigger a signal indicating that the induced voltage has reached the value set by the reference, also called ‘zero-crossing’. After this, commutation can intervene after a cer- tain manually adjusted time delay. This delay is used to adjust the phase 24 elektor electronics - 2/2006 advance and the system efficiency. A very strong advance allows us to obtain more motor revolutions at the cost of more current consumption. Finally, please note that this electromo- tive force can only be detected after the coil has been completely demagne- tised, which means waiting after each commutation. Figure 4 clearly shows this phenomena when passing from step 1 to step 2. Brushless controller for R/C The proposed setup depends on a recently introduced microcontroller put on the market by the STMicroelectro- nics company, the ST7MC (MC for Motor Control). This unit contains eve- rything you need to drive a 3-phase stage (permanent magnet motors as well as induction motors), in addition to a list of comparators, digital filters, and other reference voltages, in order to operate all types of brushless motors, as in this example. Here, we need to make an 8-bit core with 8 kB of Flash memory and 384 bytes of RAM, just enough to handle the software required for this application! More standard peripherals are used to bols- ter the core, like a 10-bit CAN, two 16- bit timers, one supply voltage supervi- sor, one PLL to double and filter the clock signal, and so on. Schematics: a modular approach Considering the nature of this applica- tion, we had to find a compromise bet- ween compactness, component sup- ply, and performance in comparison with what we can already find on the market. For compactness, a modular approach was selected in order to be able to electronically separate control electronics and the power stage. Some readers could, for example, adapt the control module to a home made power stage. Moreover, two double-sided modules give us four layers of copper for soldering the components, which is far from being a luxury! We opted for a discrete approach and avoided exo- tic integrated circuits that are practi- cally impossible to find in general retail stores. On the performance side, the microcontroller is really what makes the difference! Its digital filters, easy to configure, give us the freedom to do without RC filters in order to extract information faster, without added phase delay. Even more interesting, this micro permits four sampling methods (one of which is patented), and two of them are implemented here, guaranteeing us a progressive, secure start-up. The micro board The schematics for this board, shown in Figure 5, are brilliant by their sim- plicity. The power supply for the micro, the receiver, and the servos are built with the help of two 5 V/l A regulators in parallel with a low-drop type. Select the BA05FP model rather than the L4941, which offers standby voltage of more than 20 V (approximately 18 V for the L4941). Obviously, there is no ques- tion of powering four standard servos with 20 volts given the power to be dissipated; in this case, we need to opt for a switch mode power supply or simply a separate external battery for the receiver and servos. It all depends, therefore, on the work load (type of servos) and the power to be dissipated (it only concerns one 2/2006 - elektor electronics 25 HANDS-ON RC MODELLING linear regulation). Regulators are used to power one receiver and several ser- vos with no problem with approxima- tely ten volts (be careful that there is no resistance in the controls because consumption can rapidly bring about overheating of the regulators followed by a standby setting). The signal coming from the receiver is applied to pin PD3 and the D1/R3 network is used to somewhat boost the receivers, ope- rating at low voltage (3.3 V). A small I 2 C EEPROM is used to backup controller programming. PA3 is connected via a resistor divider and is used to monitor battery voltage. The MCES input (pin 4) is used to put the power stage on standby when a low level is applied to it; it is not used in the setup and will be forced into high state. The AVD (Auxiliary Voltage Detector, detector of low voltage on the micro power supply) will generate an interrupt which will immediately cut- off the power stage if the power sup- ply drops below 4.75 V in order to gua- rantee, at a minimum, the power sup- ply for the servos and receiver. This is only temporary and the power stage will be operational again as soon as the power supply is brought back up to a minimum of 5.3 V or the program- med BEC cut-off voltage (which is necessarily superior, or at least equal to, 6 V for two Li-Po or six NiMH cells). It may be time to think about putting down your model! Also note that sud- den power stage cutoffs are either the sign that the batteries are reaching the end of their lifespan and can no longer supply the current required, and that the voltage will drop dramatically, or that defective servos are drawing too much current from the regulators. For the rest, we have six independent control signals for the MOSFET gate commands (MCOO to MC05); pins 10 to 12 are inputs enabling the sampling of signals relative to the detection of ‘zero-crossing’ events. Two sampling modes are combined here; the first, used to start-up the motor, is a sam- pling when the PWM gate command signal is OFF (method patented by ST). Pins 10 to 12 are then directly connec- ted to phases via resistors RIO, R12 and R14 (outputs PDO, PD1 and PC3 are left in high impedance), and the sampling occurs at each PWM pulse, as is shown in Figure 6. This method allows for increased sensitivity because the zero-crossing signal is not attenuated by any resistor divider. When the motor reaches sufficient rate, the sampling occurs during the ON time of the PWM. Outputs PDO, PD1 and PC 3 go to low state and the PWM signal then returns to a level that can be understood by the micro, via divi- ders R10/R11, R12/R13 and R14/R15. The reference voltage used becomes external, present on PBO. Figure 7 shows the oscillogram of the unenergi- sed phase. High-frequency sampling (1 MHz) during the ON time of the PWM makes it possible to achieve a ratio of 100%, and guarantees a maximum rate (no phase delay due to using RC networks as in traditional setups). The power stage We opted for an entirely discrete approach, as the diagram in Figure 8 shows, in order to make the setup accessible. We did not want to use specialised integrated circuits to control the power MOSFET gates. The driver designs were not easy because the specifications call for a variable power supply voltage of between 5.5 and 20 V and require utilising synchro- nous rectification (see explanation below) to make our setup more attrac- 26 elektor electronics - 2/2006 +UBATT © J13 -> 0 f +UBATT © BAT+ £ BT1 Cl 8 5 J14 -► 0 * 470|i 25V Cl 2 lOOn K3 O- O o- o o- o PHASE B BAT- C1 lOOn K2 O- O- o- o- o- o- MCOO MCOI MC02 MC03 MC04 MC05 see text +UBATT © +UBATT ©- J11 0- FDS6675 „ „ FDS6675 PHASE C PHK12NQ03LT 5 PHK12NQ03LT BC817-40 1 Oi T36 T42 Cl 4 lOOn R33 T24 BC807-40 \ n yH 270 Q I BSS138 2N7002 I® X T30 4 +UBATT © D5 BAT54C a X R45 ~| R35 T38 , T BSS138 T 2N7002 X PHASE C PHASE A BC817-40 R31 © T34 _ T22 R25 nt?\ r^n-UnJ 13 _ T40 © BSS138 2N7002 BC807-40 +UBATT -© +UBATT © C11 100n R37 X X R32 +UBATT © T16 5 R38 JTrt X D1 BAT54A T17 FDS6675 „ FDS6675 PHASE A PHK12NQ03LT 5 — T35 Jf©T R26 f | XA BC817-40 | | 270flH y*~ / BSS138i 2N7002 T Cl 3 lOOn T28 4 X PHK12NQ03LT 8 J10 -0 FL X T29 4 D4 BAT54C X R39 R40 X BC817-40 R34 © T37 X-J 25 R28 fllri — r^n-UnJ 6 _ T43 © BSS138 2N7002 BC807-40 +UBATT -© +UBATT © +UBATT © | R36 T— _j T39 X r ©T R30 r | hA BC81 7-40 I 1 270 a | -\j i- / BSS138 I , 2N7002 T FDS6675 „ FDS6675 PHASE B PHK12NQ03LT PHK12NQ03LT J12 — 0 — ( H H 5 6 7 X T33 4 D6 BAT54C X R48 050157-12 Figure 8. Circuit diagram of the y power stage' module. tive and better-performing than the controllers currently available for sale. The final setup could also be accom- modated with any other power MOS- FET, as long as it is capable of commu- ting current required. A large choice of transistors in S08 case can work, the ones used in our setup are just an example. The three-phase bridge actually has three identical branches; let’s focus on one branch only, for example the set T22/T23/. . ./T17/T29 (top left of the dia- gram). First, the micro control signal is raised again. With the help of a small MOSFET and a pull-up resistor (R3/T22), we go from a TTL level to an output toggling between 0 volts and virtually the power supply voltage. The 1-kfl resistor is sufficient as a good compromise between the slew rate on the drain and low static power consumption (resistor R22 dissipates when MOSFET T22 is ON; small cur- rent consumption in that case). This signal is then handled in two different ways. For the P MOSFET, we drive a push-pull composed of transistors BC817/BC807. We based our choice of these transistors on their low V beon characteristic which makes it possible to stay below the V gs threshold the P MOSFET, with a gain and capacity in high current, guaranteeing impeccable OFF and ON positioning of the power transistors, no matter what their tem- perature. Relating to type N MOSFETS, a simple gate pull-up to the power supply voltage is performed using BC817, and the OFF setting is directly exercised by the small MOSFET at dri- ver input (T22). Therefore, a complete push-pull stage is not necessary in this specific case, and we have more than the V forward of the BAT54C diode which is interposed between the T22 drain and the MOSFET T28/T29 gate. One more thing on the network of resistors and diodes in the power MOSFET gate (D4/R39, for example). In order not to overload the power supply, and to avoid any risk of short-circuiting the branch (cross-conduction, the MOSFETs of the same branch then 2/2006 - elektor electronics 27 HANDS-ON RC MODELLING +Vqc +Vqc Figure 9. Current during PWM ON and OFF. conduct at the same time, which can cause a short-circuit and, in general, destroy the transistors), it is imperative to prioritize a very fast OFF setting and a slow ON setting. In this way, the BAT54C diodes allow for a very fast pull-up/down to the power MOSFET gates (to 0 or +Vbattery according to the type N or P of the MOSFET), while the ON setting is at 240 £2 (R37, for example). We can then operate the motor-control cell of the micro to its utmost and utilise synchronous rectifi- cation. How about that? Synchronous rectification Figure 9 shows what happens in a bridge branch when the PWM signal is applied to the P MOSFET. When the Figure 10. The double-sided board of the power stage. Figure 1 1. The double-sided board of the control module. PWM is ON (closed switch), the cur- rent thus passes through the top MOS- FET to go into one of the motor phases. When the PWM is OFF (open switch), the current (continuous to the coil ter- minals) must make a path via the bot- tom transistor in the same bridge branch. If the bottom MOSFET is OFF, this current shall pass this way via the internal freewheeling diode (poor diode quality, in general). A rise in temperature will result, which is, by the way, the main reason a MOSFET stage would overheat in this type of application. In summary, why not uti- lise the bottom MOSFET N when the top MOSFET P is OFF? That is quite clearly the definition of ‘synchronous rectification’. When the top P MOSFET “is open”, the bottom N MOSFET closes after an adjustable time delay called dead time which is required to avoid any short- circuit of the branch; this time delay has been set at 325 ns in this applica- tion. Then, the current no longer flows to the freewheeling diode, but rather to the MOSFET. Transistor heating is significantly reduced because then only one resistor, equivalent to a few milliohms, is visible on the current path. A fair number of manufacturers do not take advantage of synchronous rectification because the microcontrol- lers utilised are simply not capable of generating such signals. Construction The boards are both double-sided, and components must be soldered to each side (a necessary evil to keep the size of the circuit within the correct propor- tions). Despite the fineness of some copper traces, it is very well possible to build these boards with traditional materials. The author has made nume- rous PCBs with a simple laser printer and a ferric chloride etching solution. If you do not have access to boards with through holes, then it is best to proceed with installing bridges via lin- king each side of the circuit (using wire wrapping, for example) and to cut them as close as possible to the board. Next comes installing the integrated circuits, such as the micro, 5-V regula- tors, EEPROM, quartz crystal, as well as the two rows of six MOSFETs: for the latter, be careful to align them pro- perly, avoiding raising some of the devices with respect to others because you will have to add a common heat- sink. If not, a fine file can be used to level the MOSFET modules; however, 28 elektor electronics - 2/2006 be careful not to damage the silicon! Note: due to very strong currents flo- wing (peak currents potentially above 25 A), it is absolutely imperative to plate (tin) the MOSFET supply lines as well as the copper lines going toward the three phases, or else risk des- troying the copper traces! A good sol- dering iron and a little coordination make it possible to distribute an even layer of tin (keeping it flat because these traces pass under the MOS- FETs). It is also advised to pull two lines of copper between the two MOS- FET rows (1-mm diameter cable, for example) to phases ‘a’ and ‘b’ (unne- cessary for phase ‘c’ which is right next to its connector). Next, we can proceed to installing all of the discrete components, such as resistors, diodes, stage MOSFETs for gate control and push-pull stage MOS- FETs. Finally, we advance to soldering the C18 electrolytic capacitor (low ESR), placed between the two battery supply connectors (there is enough space for a second capacitor for those who would like to add another one, but it’s not really necessary for the power level of this setup, but may become necessary if you make a ‘heavy-duty’ stage, since it’s only about adding parallel MOSFETs). We can then solder the two power supply cables to the battery and the cables to the three phases of the motor. Finally, we still have to proceed to the installation of connectors K1 and K2 on the power board section. It is recommended to do a small opera- ting test before coupling our two boards. To do this, solder three 10 kfl pull-down resistors between ground and pins 2, 4 and 6 at K2, as well as three other 10 kfl pull-up resistors bet- ween +V CC and pins 1, 3 and 5 in order to switch all MOSFETS to OFF (open switch). With the help of a small power supply from 5 to 15 V, current-limited (500 mA, for example, avoid batteries or rather use a series resistor from 20 to 50 Q, for example, to power the cir- cuit), first verify the levels present on each power MOSFET gate; each MOS- FET P gate must be brought to an approximate voltage +V CC minus the Vfoeon on the BC817 (or approximately ! COMPONENT | LIST I Microcontroller board Resistors: R1 ,R4 = not fited R2 = AkQ7 1 R3,R5 = 1 Okfl I R6 = 22kfl I R7=15kf2 I R8 = 5Q6 | R9 = 5kHl I R10-R15 = 6kfl8 I R 1 6 = 3kfl3 Capacitors: Cl ,02,03,05,06,07 = lOOnF C4 = not fitted C8 = 1 OnF 1 09*, Cl 2* = 4|jF7 20V low ESR I 010 = 47fjF 6V3 I Cl 1 * = 2fjF2 5V low ESR I Semiconductors : I D1 = BAT54 . IC1 = M24C01 IC2 = ST7MC1, programmed, Publishers order code 0501 57-41 ) 103,104 = L4941 BA05FP Miscellaneous: XI = 8MHz quartz crystal K1 ,K2 = see text K3 = 3-way SIL header with 1 jumper PCB, ref, 050157-1 from The PCBShop Power driver board Resistors: R25-R30 = 270Q R31-R36 = lkfl R37-R48 = 240Q Capacitors: Cl, 011-017= lOOnF C2-C1 0 = not fitted 018 = 470pF 6V3 Semiconductors: D1,D2,D3 = BAT54A D4,D5,D6 = BAT54C T16-T21 = FDS6675 T22-T27 = BSS1 38, 2N7002 T28-T33 = PHK1 2NQ03LT T34-T39 = BC8 17-40 T40,T42,T43 = BC807-40 T41 = not fitted Miscellaneous: K2,K3 = see text PCB, ref. 050157-1 and -2 from The PCBShop Controller configuration PWM 24 kHz Brake OFF Soft-start ON Auto LiPO detect (3 cells, 1 2.6V) BEC OFF Phase advance at min rate: 1 8 degrees, at max rate: 30 degrees 2/2006 - elektor electronics 29 HANDS-ON RC MODELLING The environment A small budget makes it easier to take risks. Development tools are free, only the debugging/ programming interface needs to be paid for. Softec microsystems (http://www.softecmicro.com) proposes a debugging interface used to emulate and program all of the devices of the whole ST 7 flash family. Finally, it is possible to obtain a ST7MC starter kit. (www.softecmicro.com/ products. html?type=detail&title=AK-ST7FMC) includes a micro board, a high-voltage power stage, a brush- less motor and software, operating in Windows, to learn and get practice on this type of application. 300 to 400 mV), while the MOSFET N gates must be at almost zero voltage. Next, we can apply a voltage of +V CC on pins 2, 4 and 6 to put the MOSFET P to ON (closed switch). Verify that we have approx 300 to 400 mV voltage at each gate. Disconnect the +V CC from pins 2, 4 and 6 (MOSFET P OFF), and short-circuit pins 1, 3 and 5 to ground. Then verify that we have an approxi- mate voltage of +V CC less 300 to 400 mV on the gates of each N MOS- FET. Everything is operational? Per- fect! You can then unsolder the pull- up/down resistors, and solder the two boards. All that is left to do is add a little bit of heat-conducting paste to the MOSFET metal tabs, add a small heatsink, and wrap it all in a piece of heat shrink tubing; so well done you could mistake it for a commercial pro- duct!. One last important point; for those who would like to make their own PCB layout; it is absolutely necessary to separate wiring for ground lines and + V cc of power MOSFETs from the rest of the circuit, in order to avoid any pro- blem of commutation noise. Star wiring is therefore necessary. In the current version of the Brushless Controller for R/C Models, some of the components are not required (place has been reserved for future extension, such as a regulation loop, for example). Consequently, it is possible to omit the following components: - C19 on the power board (which is, in any case, wired on the outside), this additional capacitor may be needed for more ‘heavy-duty’ power stages (as mentioned above). - Pull-up resistor R1 on the SCL line from the unused EEPROM, (removed from the diagram but present on the layout) D2, R4, C4, I<4, reserved for a second additional path to adjust a regulation loop, for example (not imple- mented in this version of the software, perhaps one day soon?). Implementation and operation The most appropriate spot for the controller is in a ventilated part of the scale model, if possible. This obviously depends on available space. An instruction manual, that may be down- loaded from our website, will help you configure the controller. At the least, you must have calibrated the throttle for the initial tests. Modellers will reco- gnize traditional configurations for this type of circuit, like active braking, soft- start to gentle start, for example, elec- trical helicopter rotors, choice for PWM operating frequency, configuration for battery type. We have, however, opted for a 2-point adjustable phase advance (see instruction manual) allowing us to have a linear variation (dependent on the throttle position) between mini- mum and maximum motor speed; it is actually generally preferable to have soft timing (10-15 degrees, for exam- ple) and more aggressive with hard timing (25-30 degrees). If your motor is operating at a high (electrical) frequency, please note that it is better to have a high PWM fre- quency (24 or even 48 kHz). For exam- ple, for a motor rotating at 20,000 RPM having eight pole pairs, we obtain a commutation frequency of: 6 (commu- tations per electrical cycle) * 8 (pole pairs) * (20,000 RPM/60) = 16 kHz. In order to guarantee a minimum number 30 The author Florent Coste received his engineering degree in microelec- tronics in 2000 from the Charles Fabry Institute in Marseilles, France. Since that time he has been employed as an applica- tion and support engineer by STMicroelectronics and is based in Hong Kong. Having specialised in microcontroller software, he worked for two years in close collaboration with Asian clients to implement the multimedia platform. Later, he specialised in motor control applications, which led him to develop projects based on micros (specifically the ST7MC, to mention only the latest, trendy ST micro) dedicated to driving synchronous (brushless, air conditioned, for example) and asynchronous (induction) motors. A big fan of aeromodelling and electronics, Florent uses his knowledge in those two fields to further his hobby. of PWM pulse widths between each commutation, it is better to use an ope- rating frequency of 24 of 48 kHz! Rela- ting to overheating of the power MOS- FET, despite a higher frequency, that does not change a lot because we are using synchronous rectification. The curious among you can connect a volt- meter/oscilloscope in frequency meter mode to pin PA5 of the microcontroller; the TTL signal is at a frequency iden- tical to the electrical frequency of the motor. Knowing the number of pole pairs allows us to immediately deduce the timing of the motor (reminder: motor timing (RPM) = 60* F elec /num- ber of pole pairs). One last point that we have not yet stressed: when star- ting with a cold motor, start-up always follows a linear acceleration ramp during which we ‘force’ the motor to a sufficient timing level (by manually setting the current and the time bet- ween each commutation) to be able to detect the electromotive force on the unenergised windings (from which comes the characteristic clicking noise at start-up with ‘sensorless’ control- lers). In this application, this phase is always at 12 kHz of PWM in sampling mode during OFF time (ST patented method, see Figure 8). Once started, the micro will automatically switch into synchronous rectification mode, at the PWM frequency that has been pro- grammed by the user, and sampling during the ON time (see Figure 7). Attempt at conclusion It is absolutely impossible to make a detailed presentation of control methods related to brushless motors in only a few pages, and there remain many things to say regarding theory, as well as about the ST7MC microcon- troller! However, the more inquisitive among you will be able to satisfy their desire for further knowledge by rea- ding the many application notes on the STMicroelectronics website (AN1905 for example: http://www.st.com/ston- line/books/pdf/docs/10267.pdf). The software was written in C and requi- red several months to develop. The choice was based on the COSMIC compiler (16 k version, free on the COS- MIC website: http ://www. cosmicsoftware .com/down load_st7_16k.php which is a reference in terms of code optimisation. A down- loadable generic library on our Elektor website gives you the option of attempting multiple experiments, and why not, in the end, write your own custom software? It is entirely possi- ble, for example, to implement a regu- lation loop like the one described in the application note mentioned above — very useful for R/C helicopters in order to have constant rotor timing. Plenty of room for experiments! If you use our setup as your target board during every debugging (or programming) session, you will have to add pull-up resistors to the ground or +V CC on the K2 connector (as already explained in the “construction” paragraph), in order to ensure that all the MOSFETs are OFF (open switch); actually, outputs MCOO to MC05 of the micro, in this specific example, move into high impe- dance, and no longer ensure that they are OFF. ( 050157 - 1 ) Internet links Softecmicrosystems: www. softec micro.com COSMIC: www.cosmicsoftware.com/ download_st7_l 6k.php STMicroelectronics: www.st.com Application note: www.st.com/ stonline/books/ pdf/ docs/ 1 0267.pdf Starter-kit ST7MC: www.softecmicro.com/ products. html?type =detail&title=AK-ST7FMC 31 Qua&ar ElKiidfPCt Lmnited PO Bor 6935. Bishops Slortford CM23 4WP, Unite*! Kingdom T«£ 0370 240 1 E 326 Fax: 0370 400 1045 F nina 1 1 : sal&sigquasar steel rorucs. com Web: www.QuasarEJectrorncs.com PWW * K«i||h0 Optiftfli lUp -C 2K® BhWwtidnr UK ftt^rtclard 1-7 Djy DcHmhv - Cj &5 UK MalviUAd Naxl Day Dallvvy - £§ ». Eufdpe | EUJ.£i;>: Rtsl yf World EL 9 95 |up !o 0 !■* f**« ** N W* ucct|rf bH) nuiw c i , 1 1 r.-detift tard&. Mike cftaquw/PO’* pjyjbi-e td QuOUf Etecirontci Priced include- 17.5% VAT. Call f\*vt tiff ou f FflfE CATALOGUE with UkUiIs Of Crtwr KO ifciti, prdfHti, modulA-A and piifclKaliena. DlsefrUfils tot bull! u jarafcdH!^. QUASAR electronics Motor Ortv>rr‘C:ifit(ollwt Heine nr# jys.1 a tew of our eonlrollef and driver modules- for AC, DC. uni pofcar/bipolar stepper motors and servo motors Set websde ter full details. mm Bidirectional DC Meter Controller Control the speed of mosl Mimmgn DC motors (rated up to 32Vd»‘5A,) in twfeh the forward and reverse directum The range of control is from fully OFF to telly ON in both directions The uiredion and speed are co ri- ff plied using a single potentiometer Strew terminal Uucfc for comediong Kit Order Code 3l«tT*tUM Assembled Order Code AS3166 - £23.96 DO mt*t Spei Controller |IATl«Vf Control the speed of almost any common DC motor ratexi up Ip 10CV/5A Pulse width mockjlation output tor rftaitimum motor torque at all speeds Supply 5-1 5Vdc B ox supplied Dimensions (mm) 6 QWkI00Lx 6QH hi! Order Code 3067 KT 111.95 Assembled Order Code: AS3067 - £19.16 PC t Standalone Unipolar Stepper Motor Driver Drives any 5, 6 or ELlead unipolar stepper motor rated up to 6 Amps max Provider speed and direc- tion control Operates in stand-alone or FC- conrtrolled nude Up lo sue 31 79 driver ‘boards can bt connected to a single parallel port Supply 9Vdc, PCB. 00x50 mm Kit Order Code 31 79KT - 1 1 1 .96 Assembled Order Code AS3179 £18.96 WW Bi-Poiai Stepper Moior Driver Drive any bipolar stopper motor uw rig exlemeily sup- . - *ji plied SV levels for stepping a nd direchon control. These usoa lly come fro m software running on a computer. Supply 8-30Vdc. PCS: 75x6Smm Kit Order Code 31 58KT - £ 14 .96 Assembted: Order Code AS3159 - £27,16 Most ate his are available in tall form (KT suffix) or assembled and ready for use (AS prefix), CREDIT CARD SALES 17 71 Cofrlroileri A Loggers Here are just a few of the controller and data acquisition and control units we have Sec website ter full details Suitable PSU ter all unite Order Cede PSU 345 £9 95 Rolling Code 4 -Channel UMF Remote State -of-lhe-Art. Hiffh security 4 channels Momentary or btching relay output. Range u p lo 40m Up to 1 5 Tx's can be learat by one Rx (kri in- eludes one Tan but more avail- able separately). 4 indicator LED V Rx PCB TTxfiSmm, 12Vd&‘6mA {sfandhy) Two end 1 Ten chrintief ver&'orrs also OvSi ianl& Kit Orde r Code 31 80KT - £3196 Assembted Order Code: AS3180 - £47.16 Compute! Temp erai u re Data Logger 4-channel* tempera! ure log- ger for serial port. *C or D F Continuously lo gs up to 4 ^eparaie sensora located 2TOm* from board Wide range of free software appfi- cOtibins fqr -Stenn^uSiog data PCS pu$l 3Ek38mm Powered by PC. Includes one DS182G sensor and four header cables. Kit Order Code 31 45KT - £ 1196 Assembled Order Code: AS 3 145 - £23.96 Additional D5I820 Sensors - £3,96 each uffy DTWf Telephone Relay Swilehei Cal! your phone number using a DTMF phone from anywhere in Ehm world and remotely turn on-uff any of the 4 relays as deared Uset sella bte Security Password, Ami- Tamper. Rings lo Answer, Auto Hang-up and Lockout includes plastic case Not BT ap- proved. t30xt10x30mm Power 12Ude Kit Order God# 3140KT - £33.96 Assam tied Order Code A5314Q - £69.96 &erial Isotated HQ Module Computer puntroiitd 6- channel relay board 5A mams rated relay outputs 4 isolates.: digrtal tfiputS Useful m a variety of contra! and sensing applications. Controlled via serial port for programming (using our new Wm- dow&inte-rfape, lermmal emulator or batch files) Includes plastic case 1 34klOOi3^mm Power Supply: OVdc-EOOmA Kit Order Code: 310&KT - £49.96 Assembled Order Code A331Q3 - £69.96 Infrared R C Relay Board Individually control 12 on- board relays with included mfraned rarode central unit Toggle or mome-nta ry 1 5m * range It 2x1 22mm Supply: l2Vdfci‘£L5A Kit Order Code 3142KT - £39.9 6 Assembled 0 r ^ m i cne, AS 31 A 2 - £ 49:66 We have a wde range of low cosl FiC and ATMEL Programmers Gompiete range and documental on available from our web site. Progt&mmw Ac eMtflr/ 4 |? 44 -pin WideZiF socket (ZIF40W] £l i.40 ISVdo Power supply IRSU0 10) £19.9$ Leads: Parallel (LDC 136) £4 96 t Serial (LDC441) £4.96 / USB (LPC944} £2 J6 mm* USB All-Flash PIC ProgmfnmaL USB PIC programmer For all 'Flash 1 devices No external power smppty making it truly portable. Supplied with box and Wndows Software ZIF Socket and USB Plug A-B lead not ind. Krt Order Code 312SKT-E34J6 Assembled Order Coda. AS31 2fl - £44.96 ■^ICALL" MC Programrrrai ■PlCALL" will program virtu- aly all 3 to 40 pn ssnat- moere' ANDparaffeZ-moEte | PIC 16C5x family)* pro- grammed PIC micro cormol- lera 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:96 ATMEL 39-xxxx Programmer uses serial pert and any Standard terminal cpmms progra m 4 L E P 5 display the status. ZIF sockets not included Supply iS-lSVdc Kit Order Code 31 23KT - tUM USB 4 Serial Port FIC Programmer USB- Serial connection Header sable ter 1CSP Free Windows software Wide range of sup^ i ported PICs - see website for "oomptete listing ZlF SockeVUS© Plug A-B lead not md Supply: 16-1 SVdc Kit Order Code 3149CKT - £34.96 Assembled Order Code AS3149C - £49.96 www. q uasa r@ I ©ctroin ics.com rJoi Number One Systems The world beating PCB design software Easy- for Windows •'#7/ Easy-PC version 9 just gets better Winning accolades the world over, Easy-PC for Windows V9 is another major milestone in the evolution of this extremely popular software tool. Try a demonstration copy of Easy-PC and prepare to be amazed at the power, versatility and remarkable value for money. Version 9 fetaures ■ 3D Board View ■ New Win XP User Interface ■ Reverse Engineer SCM from PCB ■ Track Fattening ■ Interactive Schematic Routing ■ New Sliding Toolbars ■ Component Clearance Checks ■ Alphanumeric Pin Names Plus many more exciting features Fully integrated Schematics & PCB layout in a single application complete with forward and back annotation. Design and rules checks at all stages ensure integrity at all times. Professional manufacturing outputs allow you to finish the design process with ease. Stop press... Stop press... Stop press... Stop press... Easy-PC imports Eagle files as well asTsien Boardmaker 2 files call for a brochure, prices & CD on +44 (0) 1684 773662 or e-mail sales@numberone.com you can also download a demo from www.numberone.com Number One Systems - Oak Lane - Bredon - Tewkesbury - Glos - United Kingdom - GL20 7LR UK Microsoft® Windows®XP, 2000, ME, 98, Windows NT® PicoScope 3000 Series PC Oscilloscopes The PicoScopc 3000 series oscilloscopes arc the latest offerings from the market leader in PC oscilloscopes combining high bandwidths with large buffer memories. Using the latest advances in electronics, the oscilloscopes connect to the USB port of any modern PC, making full use of the PCs’ processing capabilities, large screens and familiar graphical user interfaces. • High performance: IOCS 4 sampling rate & 200MHz bandwidth • 1MB buffer memory • High speed USB 2.0 interface • Advanced display & trigger modes • Compact & portable • Supplied with PicoScope & PicoLog software PtCI raaa lr— a < rau la»|l» ■ i 1704 VMXt 7 MIK« f i(a u a u in OUtAMHi n>OKM PC Caaaacttaa 3900 lOOMli AO&t DOOM* a 9 • l ■» lrif>» r fM In*i la AOaPi ft 19KB ■ lit* f 3H ! 100«V «• ;90V U4tl9D'imS1 1 dHMttWd 390* 90GMM* 1000 a iKXMC* 9 *tm i 1 aa*«« ta AOti Ola 100MH# II Tel: +44 (0) 1480 396395 www.picotech.com/scope287 Technology Limited 2/2006 - elektor electronics 33 KNOW-HOW MOTORS Micro Motors March of the miniature machines Jens Nickel Figure 1. This piezoelectric motor with a single- channel drive can produce linear and rotational movements [3]. (Source: Elliptec) Piezoelectric actuators and motors are finding more and more applications. These drives feature excellent dynamics, accuracy down to nanometres and tiny physical dimensions. In many cases the discovery of a new physical phenom- enon has precipitated an immediate technical revolution: examples include X-rays and the transistor. In other cases it has taken several decades before the potential of a discovery is realised, such as in the case of super- conductivity (discovered in 1911) and the effect we describe below. In the year 1 880 two French brothers, Jacques and Pierre Curie, discovered that charge is generated on crystals of tourmaline when pressure is applied. This became known as the piezoelectric effect (from the Greek word 'piezein' meaning To press'). The reverse phenomenon was also observed: certain materials change shape in characteris- tic ways when a voltage is applied. Apart from piezo- electric gas lighters and quartz crystals (which exploit both processes), technical applications were of rather a recondite nature. In the last ten or twenty years there has been a resurgence of interest in the piezoelectric effect, with the promise of making electric drives with revolution- ary characteristics. That this has become possible is due in no small measure to advances in materials science and (micro)controller technology. Ceramics in fashion The piezoelectric effect is observed in many naturally- occurring materials. One example is quartz: if pressure is applied along a particular axis of the crystal (the so- called polar axis), a voltage can be measured across the corresponding opposite sides: for more details see the text box. If a voltage is applied across the crystal, it shrinks or expands. This is known as the inverse piezo- electric effect. There are synthetic materials that exhibit even better characteristics than quartz. Lead zirconate titanate (PZT), a ceramic, can even be polarised, which means that the axis and polarity of the piezoelectric . The ceramic is corn- effect can be determined at will [1 posed of a large number of individual crystals fused together, which gives rise to an interesting effect. Under a strong electric field the orientation of the polar axis shifts by up to 1 80 °. If the ceramic is cooled from the molten state the individual crystals are randomly oriented and the material as a whole exhibits no piezoelectric effect. Under a strong electric field the polar axes of the individual crystals align, giving rise to expanded domains all polarised in the same direction and a pre- 34 elektor electronics - 2/2006 ferred axis to the material. By analogy with the magneti- sation of iron in a magnetic field such materials are also called 'ferroelectric'. Polarised PZT exhibits an exception- ally strong piezoelectric effect in the direction of this axis. Since ceramics are now relatively easily available in a wide range of forms, they are the materials of choice in several applications, which we shall now look at [2]. Resonators To construct a drive we will need to use the inverse piezo- electric effect. Depending on the polarity of the voltage applied along the polar axis the material will shrink or expand by up to 0.15 %. Using an alternating or pulsed voltage the material can be made to oscillate. The partic- ular material used, the polar axis and the direction of the electric field, and the shape of the sample all have an effect on the resulting movement. Piezo elements can be made to oscillate in longitudinal length mode, thickness extension mode, transverse bending mode or shear mode as required [1 ]. Large displacements and corresponding oscillation can be achieved when the applied voltage varies at the reso- nant frequency of the sample, which depends on its elas- ticity and its dimensions. This technique is employed in quartz crystal oscillators, where a block cut from a very pure quartz crystal (in the right direction!) forms an exceptionally precise and stable RF frequency standard. Actuators Among applications of the inverse piezoelectric effect we distinguish 'resonators' from 'actuators and motors'. Actua- tors move by a few micrometres when a DC voltage is applied. This movement can be increased using a lever sys- Figure 2. A piezoelectric valve in a diesel injection pump. The grey piezo actuator at the right moves the needle in the nozzle. (Source: Siemens YDO) tern or by arranging a series of actuators in a stack. Com- plex motions can also be realised using cunning physical arrangements and wiring of multiple actuator elements. One example application is the micropump, capable of pumping a few nanolitres to a few microlitres of fluid. Such devices are used in inkjet printers and in chemical analysis applications. The piezoelectric actuators in mod- ern direct injection diesel and petrol engines resemble a valve. A pressure of up to 2000 bar is built up by a stack of piezoelectric elements (Figure 2) moving a needle inside a nozzle. When required a tiny drop of fuel (a few microlitres) is injected into the cylinder. Because of its high speed it is immediately whisked into a combustible mixture. Compared to conventional injection nozzles, which use magnetic valves, the piezoelectric actuators are some three times faster and allow multiple injections per stroke of the cylinder. This lets the fuel burning process be further optimised. A closer look at a quartz crystal The piezoelectric effect can readily be explained with reference to quartz (SiC^). The atoms in quartz form a regular grid with each silicon atom being surrounded by a tetrahedral arrangement of oxygen atoms (Figure A). The oxygen atoms tend to attract electrons from the silicon atoms, making the silicon atoms positively charged and the oxygen atoms negatively charged. If pressure is applied to the quartz crystal along the axis joining an apex of the tetrahedron to the middle of the opposite base, the opposing charges are pushed relatively closer together, giving rise to an electric field (Figure B), and a potential dif- ference can be measured. This distin- guished axis of the quartz crystal is called a polar axis. If pressure is applied perpendicular to this axis the quartz crystal expands along its polar axis because of its elasticity. The charges move in the opposite direc- tion, resulting in an oppositely- polarised electric field (Figure C). The piezoelectric effect is not present in all crystal structures: if the positive and negative charges are arranged in a cubic lattice as in cooking salt, the charge movements on average cancel out over the entire crystal and the sub- stance consequently exhibits no piezo- electric effect. The piezoelectric effect is (almost exclusively) linear, which means that a doubling in pressure corresponds to a doubling of the electric field. In other words, the ratio between the mechanical pressure and the electric field is a constant. The constant depends on the direction of the pressure and the direction of the field: since there are three spatial dimensions for each quantity there is a total of nine constants in all. Also, shearing motions can produce an electric field, so that for a full description of the piezoelectric effect for a given substance a total of 18 constants must be specified! 2/2006 - elektor electronics 35 KNOW-HOW MOTORS Figure 3. The sliding stage shown is moved using a piezoelectric drive. (Source: Physik Instrumente (PI) GmbH & Co. KG) WKn™ IM 4SMUI Sui Figure 4. This piezoelectric motor driver kit from Trinamic offers four output signal channels. (Source: Trinamic). Figure 5. Diagram of a travelling wave motor. Exposed on the right is the stator, whose segmentation can be clearly seen. (Source: Ref. [7]). Another application is in the field of consumer electron- ics. Thomson make a rear-projection television where a piezoelectric actuator moves a mirror in the light path rapidly to and fro to move the picture up or down by up to one line. With the aid of a cunning control circuit the effective resolution is thus increased [3]. Piezoelectric motors In a piezoelectric motor the oscillation of the fixed piezo element (the stator) must be transferred to the moving part (the rotor). In principle the rotor can be periodically pushed by a linearly moving stator and be held fixed in between pushes (the 'inchworm' principle), or it can con- tinue to move in the same direction because of its inertia. More advanced are the so-called ultrasound motors. Here the piezo element has a voltage applied to one side and is set oscillating using, for example, a squarewave signal. Strong resonance is achieved at a frequency between 30 kHz and 1000 kHz: hence the name 'ultra- sound motor'. The material is shaped so that two oscilla- tions (a bending oscillation and an extension oscillation) are superimposed, making the end of the stator move in an elliptical path. At one point on this elliptical path the stator touches the rotor, advancing it by a few microme- tres. At a different frequency the two component oscilla- tions are superimposed in such a way that the elliptical motion occurs in the reverse direction and the motor turns backwards. This principle is used in a motor made by the company Elliptec. The compact unit comprises a 2 cm long distinc- tively-shaped aluminium piece incorporating a pioze ele- ment (see Figure 1) with a spring at one end. The spring presses on the element and its free end pushes on a small wheel or on a small plastic rod. A microcontroller is used to control the motor, generating a 5 V to 8 V square or sine wave. According to the manufacturer, the controller should have a resolution of at most 1 kHz (preferably 300 Hz): a single-pin output is sufficient. The best choice is to use a microcontroller with built-in PWM function. The squarewave signal must be amplified using two transistors and filtered using a coil to remove har- monics from the signal sent to the device [3]. At a frequency of around 79 kHz the Elliptec motor runs forwards, and at a frequency of around 97 kHz it turns backwards. The two partial movements are superim- posed in a way that causes the elliptic movement to be backwards. The optimum frequency can be determined by the control electronics, for example by measuring the current consumption of the unit. The speed of the motor can be controlled by adjusting the mark-space ratio of the signal. The motor delivers a force of between about 0.2 N and 0.4 N; the step size is given by the manufac- turer as 1 0 |jm. One application for this tiny motor is in models: Marklin have used the motor to slowly (and hence realistically) raise the pantograph in a model elec- tric locomotive [4]. Advantages A piezoelectric motor produces no magnetic field, and can therefore be used in sensitive nuclear magnetic reso- nance tomography machines. Also, piezoelectric motors move in very tiny steps. The speed and power output of these motors is therefore limited, but the micrometre-scale steps allow an exceptionally high positioning precision. Once the desired position is reached a DC voltage can be applied, which allows partial forward or reverse steps with accuracy in the nanometre range. This makes the piezoelectric motor ideal for sliding stages in nanotech- nology applications and microscopes and for microma- nipulators in analysis and medicine (Figure 3) [5]. Machine tools where only a small holding force is required can also make use of piezo motors. In contrast to the motor described above, which only requires a sin- gle channel to control it, this type requires two, four or even more signal output channels. Trinamic in Hamburg have developed a control module for use with the piezo 36 elektor electronics - 2/2006 motors produced by the Swedish manufacturer Piezomo- tor [6]. It generates four phase-shifted periodic signals with a programmable waveshape at a resolution of eight bits (Figure 4). Travelling waves The principle of the travelling wave motor, developed in the early 1 980s in Japan, can be used to obtain precise rotational motion. The annular stator is made up of indi- vidual piezoelectric elements with alternate polarisations, connected together with a continuous metal contact. If a DC voltage in the region of 200 V is applied, the ele- ments alternately expand and contract, deforming the sta- tor ring into an undulating shape. A sinusoidal alternat- ing voltage sets up standing waves. In order to create a travelling wave the ring is partitioned into two (or more) electrically isolated and separately stimulated zones. If sinusoidal signals are applied to the two zones with the same frequency but with a phase offset the standing waves superimpose to create travelling waves. The gener- ally cross-shaped rotor, the same size as the stator, is pressed onto the stator by a spring such that there are always several moving points of contact (Figure 5). The advantage of this high-friction arrangement is that the travelling wave motor retains its position when power is removed, dispensing with the need for a brake. The rotor is driven round by the tangential component of the force from the travelling wave: the greater the force, the greater its movement. The speed of the rotor can there- fore be controlled by adjusting the mark-space ratio of the drive signal: a higher mark-space ratio implies a greater displacement. Practical motors from various man- ufacturers achieve torques from 0.0003 Nm to 2 Nm with stator diameters from 3 mm to 90 mm. Rotational speed lies in the range from 2000 rpm down to 70 rpm with operating frequencies from 650 kHz down to 42 kHz. This type of piezoelectric motor is distinguished by its excellent dynamics. Only small masses are being moved, which allows for high acceleration. Also, at very low rotational speeds, travelling wave motors can develop relatively high torque and a gearbox is often unneces- sary. An alternative to this type of motor with rotating bending-mode waves is to use a stator with thickness extension mode oscillations; in yet another design a bending-mode wave is set up in a cylindrical stator. Usu- ally microcontrollers are used for control, with a power output stage and possibly also a transformer to further increase the output voltage. One application for such travelling wave ultrasound motors is in autofocus lenses. To produce a sharp picture, the individual elements of the lens must be moved together, usually on a worm-type drive. Since great agility is required but the distances involved are relatively short, the situation is ideal for a piezoelectric motor. Applications for piezoelectric motors are not yet exhausted provided their power can be increased further. They will shortly be used in aviation (for moving aircraft control surfaces) and in robotics. There is no technical reason why they could not also be used in such general- purpose applications as windscreen wiper motors or elec- tric windows, but here the mass-produced conventional motor still have the upper hand in terms of mass-produc- tion costs. ( 050375 - 1 ) Applications of the direct and the inverse piezo effect Direct piezo effect (pressure to voltage) Sensors (for pressure and acceleration) Keyboards Pick-up arms Microphones Spark production (gas lighters) Inverse piezo effect (voltage to pressure) Resonators and sound Ultrasound sources (liquid level measurement, flow rate measurement etc.) [5] Piezoelectric loudspeakers Frequency references (quartz crystals, ceramic resonators) Ceramic filters Piezo actuators Micropumps (Injection nozzles, inkjet printers, chemical analysis etc.) Active damping systems Consumer electronics (see text) Piezo motors Autofocus lenses Sliding stages (microscopes, medicine, tools etc.) Modelling Other applications still under development References and links [1 ] www.piceramic.com/piezoeffekt.html [2] www.piceramic.com/technologie.html [3] www.elliptec.com [4] http://www.siemens. com/index. jsp?sdc_p=dl 187140 il 1 84346lmnl 1 841 01 ol 1 84346pFEcfs5u20zl &sdc_sid= 32992667905& [5] www.physikinstrumente.de/ products/ section7/ piezo_motor_index.htm [6] www.piezomotor.se/ [7] Dynamics of Ultrasonic Motors, Thomas Sattel, dissertation, Darmstadt 2003. 2/2006 - elektor electronics 37 HANDS-ON MICROCONTROLLERS Gunther Ewald and Burkhard Kainka Thanks to the efforts of Elektor Electronics and Glyn, for the first time now a European electronics magazine supplies a complete microcontroller starter board and accompanying software CD-ROM at a very attractive price. We already introduced the Renesas R8C in the last issue. Now it's time to start using it. Now it’s for real - from this issue you can order a circuit board with an R8C/13 microcontroller and the neces- sary software, at price consisting of P&P and handling only The service is strictly limited to stocks and pro- vided exclusively for Elektor Electron- ics readers in co-operation with Glyn. So if you want to grab an R8C starter kit, order it straight away — the online method using our website is by far the fastest. There are three good reasons for using the Renesas R8C/Tiny family: first, it provides 16-bit computing power at a low price; second, it comes with a free but nevertheless very capable C com- piler; and third, no programming hard- ware is necessary, because code can be easily downloaded to flash mem- ory via the RS232 port. We already introduced the board and the soft- ware in the January 2006 issue. If you missed that article, you can download it free of charge from the Elektor Elec- tronics website at www.elektor-elec- tronics.co.uk (select the Magazine tab, then January 2006). Our objective in this article is to help you start using the board. 38 elektor electronics - 2/2006 Our R8C starter kit is available - now you can get going! The software When installing the nec- essary software, follow the instructions exactly as given in order to ensure that what you later see on your PC matches what we describe here. Install the KD30 moni- tor/debugger first, fol- lowed by the NC30 C compiler with the HEW development environ- ment and an update. Installation in this order is important so the HEW will find the debugger already installed and link it in properly. Next, install the debugger package in order to integrate the debugger into the development environment. Later on, you only need to start the HEW in order to have everything together on your screen. Finally, you have to install the Renesas Flash Development Toolkit (FDT), which enables you to download finished programs to the microcontroller. After you insert the CD, a product summary in PDF format will be displayed first. You should see the main directory of the CD after you close the product summary. Alternatively, you can right-click on the drive icon and select 'Open' in order to skip the PDF intro. The most important directories on the CD are \Software and \Sample_NC30. They contain all the necessary programs (which should now be installed) and the initial sample projects. 1 . KD30 The executable installer file KD30V410Rl_E_20041203.exe. is located in the \Software\kd30400rl \ directory on the CD. Start the installation and confirm the default path C:\MTOOLY 2. NC30 Run the setup file nc30wav530r02_2_ev.exe in the \Software\ nc30v530r0_hew\ directory on the CD. First you have to select whether you want to install the Japanese ver- sion or the English version. Most of our readers will probably prefer the English version. The program suggests C:\Program FilesXRenesas as the default installation path. You should con- firm this path. A second default path is shown for the tool chain: C:\Renesas\NC30WA\V530R02. You should also accept the default path name, as well as all subsequent default path names. At the end of the installation, an individual site code is dis- played. You can ignore it, because it is only necessary for registering the software. If you purchase the full version of the compiler, you will automatically receive a CD with your own code for enabling the software. After you have installed the HEW, you have to run the installer for the AutoUpdate program. As shown in the figure, con- firm that you wish to receive weekly updates from the Renesas Tools website. That enables you to keep your soft- ware 'fresh' all the time. If the PC on which your software is installed does not have access to the Internet, you can cancel installation of AutoUpdate without causing any problems. The most recent update file is on the CD, and it must be installed next. After being installed, the updater immediately checks to see whether there is anything new and automatically downloads the latest changes. The first update will then be installed auto- matically. The PC must then be restarted before you continue. 3. Update HEW This step is only necessary if you have not already down- loaded the latest update from the Internet and installed it. Run the first HEW update from the CD by starting hewv40003u.exe in the \Software\HEW_V-4.00.03.001_Update directory on the CD. That will update your compiler to the latest version (Database Version 7.0). That is important, because the sam- ple projects have been generated for this version. Although you can use the new version to load older projects, which will then be updated automatically, regressing to an older version of the compiler is not that easy. 4. Debugger package Run the installer file ml6cdebuggervl00r01.exe in the \Software\Debugger PackageX directory on the CD. Follow the instructions of the installer program and confirm your agreement to the licence conditions. Everything else is auto- matic. You must restart the computer after this installation. 5. Flash Development Toolkit Install the FDT by running the installer file fdtv304r00.exe in the \Software\Flasher_FDT directory on the CD. Confirm all default settings. Everything else is automatic. When everything has been installed, you will find the Renesas program group under Start / All Programs. The two relevant programs in the group are High-performance Embedded Workshop and Flash Development Toolkit. 2/2006 - elektor electronics 39 HANDS-ON MICROCONTROLLERS Figure 1 . The hardware you can order from us at low cost forms a complete microcontroller system. Figure 2. The fully assembled board with the pin headers fitted. SUB-D9 J 2 RXD X 3 TXD 8 ] 2?k y © BC 548C H 1 +9V -7e Q > o H 1N4004 78L05 ■> * ^OOn ^ ^ ^ OOn R8C/13 - o 8 _ 9_ 10 11 12 13 14 15 _ 16 O O - O - o - o RXD1 |Qfl TXD1 AN6 RESET AN5 AN4 VSS MODE AN3 VCC AN2 P17 AN1 PI 6 ANO P15 P14 P30 PI 3 PI 2 P31 P11 P10 P32 P45 P33 Q - Q - a - Q - a - _ 31 30 29 28 27 26 25 24 23 BC 558C 22 21 20 19 18 17 I N 050179-2- 11 Figure 3. The circuit diagram of a minimal system for initial tests. The hardware The low-profile PCB with pre-assem- bled SMD components is supplied with two pin headers that you must fit and solder yourself (Figure 1). That yields a complete processor module in the format of a 32-pin DIL IC (Figure 2). There is also space reserved on the board for a 14-way pin header, but it does not have to fitted right away because it is only needed for the E8 debugger. The actual microcontroller (the R8C/13) is contained in the 32-pin LQPF SMD package, which measures 7 by 7 mm and has a lead spacing of 0.8 mm. The marking ‘R5F21134FP#U0’ reveals that it is an R8C/13 with 16 KB of flash ROM. We selected the R8C/13 because it has the same characteristics as its ‘siblings’ (R8C/10, R8C/11 and R8C/12). The board also comes fitted with a 20-MHz crystal and the neces- sary capacitors, as well as several other capacitors and resistors. Alto- gether, this amounts to a complete microcontroller system. Once a pro- gram has been loaded, all you have to do is connect a 3.3-V or 5-V supply volt- age and you’ve got a working system. Program code can be loaded using a serial interface; no special program- ming hardware is necessary. That’s because the microcontroller has a debug interface and a corresponding boot program that can be used to copy the software into the flash ROM. First contact In the next issue of Elektor Electronics, we will describe a complete develop- ment system with RS232 and USB interfaces. But you naturally don’t want to wait that long to try out the board. For that reason, we describe a solution here that only requires a few components from your parts bin: • a source of 5-V power, preferably sta- bilised by a voltage regulator • an inverting level converter for con- nection to the RS232 port • a pushbutton reset switch • a mode switch to select the program- ming mode The microcontroller board feeds out all the microcontroller leads one to one. As we already mentioned, a crystal, a few capacitors and some resistors are fitted on the board. The schematic dia- gram in Figure 3 shows only the con- 40 elektor electronics - 2/2006 nections that are essential for a ‘quick start’, so you can get your bearings as fast as possible. The connections not shown in the figure must always remain open. Figure 4 shows an exper- imental setup on a prototyping board. The serial port of the PC is connected here via transistor inverters. Although a MAX232 could be used just as well for this purpose, the transistors will probably be easier to find in your parts bin. A BC548C NPN transistor inverts the TXD signal from the PC and feeds it to the RXD1 input of the microcon- troller. This input does not have an internal pull-up, so the collector resistor is essential. In the opposite direction, TXD1 drives a BC558C PNP transistor. The RXD input of the PC has its own pull-down, so the collector resistor can be omitted here. The MODE input of the microcon- troller determines whether the inter- nal boot program or a downloaded user program is run after a reset. The MODE input is pulled high by a 10-kfl resistor when the switch is open, which causes the user program to be started. If you want to load a program into the flash memory, you first have to close the switch in order to pull MODE low. Then you must briefly press the Reset switch. That causes the microcontroller to start up in the debug mode, which allows new soft- ware to be loaded into the flash ROM. After the software has been trans- ferred, open the Mode switch and press the Reset switch again. That causes the downloaded program to be started. However, duty comes before pleasure, and in this case the duty is installing the software on the PC. That’s described step-by-step in the inset. Follow the instructions exactly as given in order to ensure that what you later see on your PC matches what we describe here. Ready, set, flash! The first thing you should do is to try out the Flash Development Toolkit (FDT) by downloading a finished pro- gram to the microcontroller. For the time being, we’ll skip the process of developing you own programs, so you can enjoy some tangible results as soon as possible. After installing the Renesas software package, you will find the FDT pro- gram in the Windows ‘Start’ menu. The program is shown there in two ver- sions: a full version and a compact Figure 4. A prototype of the test system built on a lab prototyping board. ‘Basic’ version. Start ‘Flash Develop- ment Toolkit Basic’ (Figure 5). You must configure several settings the first time you start the program. If necessary, you can access them later on via the Options / New Set- tings menu. Select ‘R5F21134’ as the microcontroller type, and select the upper of the two core protocol options (Figure 6). In the next window, select the serial interface port from the range COM1-COM4. The third window asks you to specify a baud rate for the link to the microcontroller. Enter ‘9600 baud’ here (Figure 7). Finally, you have to specify whether you want to enable readout protection for the microcontroller. As the risk of criminal industrial espionage is rather small with the initial familiarisation programs, you can dispense with any form of protection. Save the settings as shown in Figure 8. That completes the preparations. Hurrah, it blinks! Now connect the board to the specified COM port on your PC. Close the Mode switch and briefly press the Reset switch. The microcontroller will enter boot mode and wait for you to send it data. The next step is to download a fully compiled program to the microcon- troller. On the CD, you will find the ‘Sample NC30’ folder with several sam- ple projects. That includes the project folder ‘Sample_NC30\ port_toggle’, which contains the folder ‘port_toggle\ Release’. The file port_toggle.mot is located in the latter folder. It is a pro- gram in Motorola hex format that can be downloaded directly to the micro- controller. Specify the path to this file, and then start the download process by select- ing ‘Program Flash’. The download takes around two seconds. The flash memory is first erased, and the new program is then copied over. If every- thing goes properly, the message ‘Image successfully written to device’ will be displayed. Open the Mode switch and briefly press the Reset switch. That will start the program that you just downloaded. The program toggles the first four lines of Port 1 (P1_0 to Pl_4) at a slow rate, so you can observe their states using a LED with a series resistor. The ports of the R8C and the other M16 microcontrollers have a low imped- ance in the output direction, regard- less of whether they are in the high or low state. That means you must always use a series resistor (1 k£2, for 2/2006 - elektor electronics 41 HANDS-ON MICROCONTROLLERS Figure 5. The Flash Development Toolkit, Basic version. example) when connecting a LED to them (Figure 9). All of the sample programs described below can be copied to the microcon- troller in the manner just described. If the R8C cannot be flashed due to a communication error, it must be left without power for one minute to erase the internal RAM loader. This error can occur if you have been working with the debugger before attempting to download a program. The R8C as a musician Like to try another hardware test? Then download the ‘Jingle_Bells’ Motorola file from the R8C project to the microcontroller. Connect a small 8- Q loudspeaker or a headphone with a 1-kfl series resistor to the board (Fig- ure 10), and then start the microcon- troller. You will hear a simple melody. Incidentally, this program uses the internal high-speed ring oscillator (8 MHz) and does not require the crys- tal oscillator. If you touch an oscillo- scope probe to the crystal lead Xin (pin 6) or Xout (pin 4), you will see that no clock signal is present (in contrast to the situation with the port_toggle project). As you can hear from the absence of any sour notes coming from the speaker, the internal RC oscillator is fully adequate for this task. That means you could flash the program into an R8C/13, connect it to a piezo- electric speaker and a 3-V button cell, and hang it from your Christmas tree or insert it in a Christmas card. Now that you know the hardware is OK, your fingers are probably itching to start programming something, aren’t they? OK, it’s time to start up the integrated hardware development environment (HEW). In order to keep things fairly simple at first, let’s start by making a few changes to an exist- ing project. We’ll also work without the debugger to start with. High C You can use HEW to generate assem- bly-language projects. However, pro- gramming the R8C in assembly lan- guage is significantly more difficult than programming it in C, because there are so many different data for- mats and addressing modes. The C compiler looks after all that for you. You don’t even have to know whether the microcontroller is processing a word, a byte or a bit. In this case, C is easier than assembly language even for peo- ple who are only used to working in assembly language. The unfamiliar notation will quickly become second nature after you work through a few examples, so there’s no need to be afraid of C! First copy the entire ‘port_toggle’ proj- ect from the CD to your PC. When you start a new project, use a directory such as C:\WorkSpace, which is also the default directory suggested by HEW. In the Renesas program group, start the ‘High-Performance Embed- ded Workshop’ program. A selection window is displayed when the pro- gram starts, and you can specify whether you want to generate a new project or open an existing project. Use File/ Open Workspace to open the port_toggle file. All the files belonging to the project will then be shown at the left. Click on port_toggle.c to open the source code file. Everything should then appear as shown in Figure 11. Next, you should try to compile the project, just for the exercise. First you have to decide whether you want to generate a debug version or a release version. You should work without the debugger for now, which means you should select the ‘Release’ option Figure 6. Selecting the microcontroller type and transmission protocol. 42 elektor electronics - 2/2006 Figure 7. Selecting the baud rate. under Build / Build Configurations. Then start the compilation by select- ing Build / Build All. The C source code will be compiled, linked, and written to the output directory \Release in the form of a Motorola hex file. The entire process is listed at the bottom of the Build window. At the end, you’ll see the longed-for message that signals success: Build Finished 0 Errors, 1 Warning No errors - that’s very good! Warnings occur relatively often and aren’t all that dramatic. In this case, the warning reads: ‘Warning (ln30): License has expired, code limited to 64K (10000H) byte(s)’. You don’t have to worry about that, because you’re using the free ver- sion of the compiler, and 64 kB is any- how more than R8C/13 can hold. If you wish, you can download the output file to the microcontroller again and run the program. It will work just as well as the Motorola hex file on the CD. Now let’s have a look at the source code: while (1) /* Loop */ { pl_0 = 0; pl_l = 0; pl_2 = 0; pl_3 = 0; for (t=0; t<50000; t++); pl_0 = 1; pl_l = i; pl_2 = 1; pl_3 = 1; for (t=0; t<50000; t++); > program, you must use Build All to compile the program and then use FDT to download it to the microcontroller again. A sense of time Now we come to the crystal oscillator of the microcontroller. The port_toggle sample program uses the crystal oscil- lator, which runs at 20 MHz. As already mentioned, there are also two internal RC oscillators with frequen- cies of 125 kHz and 8 MHz, respec- tively. In fact, the microcontroller always starts up with the low-speed ring oscillator enabled. If you look at the data sheet for the R8C/13, you will see the complicated clock-generation arrangement for the R8C, with a total of three oscillators and several optional divider stages. The port_toggle sample project demonstrates how to switch from the 125-kHz oscillator to the crystal oscil- lator: prcO =1; /* Protect off */ cml3 =1; /* Xin Xout */ cml5 =1; /* XCIN-XCOUT drive capacity select bit : HIGH */ The core of the program consists of a simple, self-explanatory loop. First the ports are enabled, then there is a wait loop, then the bits are disabled, and finally there is another wait. Even if you don’t have any experience with C, you can right away see where you could make some changes. For instance, you could shorten the wait loops to make everything run a bit faster. For example, you could set the count to 25,000 instead of 50,000. You could also try reducing the count to 2 and see how fast it runs then. You can even remove the wait loops entirely by using the comment sign 7/’ to render them ineffective. Of course, you won’t be able to use a LED any more to check the signals, but an oscilloscope will show a high-frequency square- wave signal. Each time you modify the ProgF*fnmln£ Upltans the l-LASH I 4 pii: Ktr.wvi*i.i uw ■ hftrhwwp -vri l and dpttdbpmpd ivVj >/ de nee Hsuld/fly Ike* FVo£m , Ivw , i f "uJinili: " liln '|i li ■ ^ Niw fhfrjpjfara 1 J I r ijkrt 144414 U^ijrrrtP# AE OCtf-renfl ¥ti [K- write: I V- h A ii it vfiii Jl '.v* j Mtu-bgng ' V.'.'ii l The T Deft 1 £•£ sy ; K-~wirv3 id awf iil IBP Figure 8. Readout protection is unnecessary. 2/2006 - elektor electronics 43 HANDS-ON MICROCONTROLLERS Figure 9. Connecting a LED to P1_0. cm05 =0; /* Xin on */ cml6 =0; /* Main clock = No division mode */ cml7 = 0; cm06 =0; /* CM16 and CM17 enable */ asm("nop"); /* Waiting for stable oscillation */ asm( "nop" ) ; asm( "nop" ) ; asm( "nop" ) ; ocd2 =0; /* Main clock change */ prcO =0; /* Protect on */ The above listing shows the relevant instruction lines at the beginning of the source code. It’s necessary to change a few control bits in System Clock Control Registers 0 and 1, but they are initially in protected mode. This protection is disabled in the first line so the relevant control bits can be altered. After the bits have been Figure 1 0. Connecting a loudspeaker to the microcontroller. switched, we have to wait a little while for the oscillator to stabilise after being started up. After this, the clock source is changed and write protection is re-enabled. From now on, all pro- grams will run at 20 MHz. If you now remove this entire block of code from the listing, including prcO = 1 and prcO = 0, the oscillator will not be changed and the microcontroller will continue operating at 125 kHz. To make it possible to observe the result within a finite length of time, you must also shorten the wait loops by a factor of 100: void main (void) { pdl = OxOF; /* Set Port 1.0 - 1.3 be used for output*/ while (1) /* Loop */ { pi 0=0; Figure 1 1 . The port toggle project in the development environment. pl_l = 0; pl_2 = 0; pl_3 = 0; for (t=0; t<500; t++); pl_0 = 1; pl_l = i; pl_2 = 1; pl_3 = l; for (t=0; t<500; t++); > > The LED will blink somewhat more slowly now, but the microcontroller will run with very low power con- sumption. The internal high-speed ring oscillator, which runs at 8 MHz, provides a com- promise between really fast and really slow. The Jingle_Bells sample project shows how you can use it. Copy the following relevant instruction lines into your program: prcO =1; // Enable High Speed Oscillator (8 MHz) hrOO = 1; asm ("NOP") ; asm( "NOP" ) ; hrOl = 1; prcO = 0; You should also have a look at the Timer_Interrupt project. If you’re trying to use a timer for the first time, you can of course pore through the R8C/13 data sheet, but it’s better to start with a working bit of code from a sample pro- gram and then read the relevant por- tions of the data sheet while trying out your own modifications. Besides timer initialisation, the Timer_Interrupt sam- ple program shows how to implement an interrupt function in C. You’ll find even more sample programs in the application notes on the CD. If you’re now eager to generate your own personal project, you can find the necessary information on the Elektor Electronics website at www.elektor- electronics.co.uk (look for the R8C link in the right-hand column). There you will find a simple example that explains in step-by-step fashion how to generate your own application pro- gram without relying on an existing project. And if you still have questions, a dedicated Forum topic for the R8C starter kit has been set up on the Elek- tor Electronics website. ( 050179 - 2 ) Reference www.glyn.com 44 elektor electronics - 2/2006 Lichfield Electronics The Com fxchqnge. Cpr^gtt St, UchDekl. Slfftts WS1 3 6JU tel: COT 543) 256614 Onllrtfr. www.LkhfiddEltclEOniicied.uk Partial Stock List Hobby Kit; I'kfc.i I VV 1 hBHhrtiltlrr simple Vint mm Ur 1 nicL.iBC M>>rm IlflWY Uhl PSH I tefllJjl ’’■lwll (lll-rli t kri Lh-lBtf- kli 1 1 ‘j‘Jim Ur I nfmi^d Mu ■ ^ t’lpsfr AM HMh" hi! Viu-rni km-h tr-lng < j r HI WlRituMIe rrmif i □ r MuJIji K nnfrvr MU-i* Drfcslw kri ^luH-k I- 1 r l- ll l pi J t m Mil KhiLhi MinJfcnl Vihr kit L.lEhil VftMiF Jhil KirlriV I- InlriHllL- Efekr kil Snwml t irirnlir Ul I lyhl \rln-»lfd ttarm lALEDFMfri* Vel>uh * >H So Bering ! ron s, Etc. liMir'^inwcun l il v| IW.W %»« it?* hi.r dr gun iSi.** *a$mt '+.1+ inw til.** a^rt r^f I'm & ■. bn.,|, car?* ImP, Tipi rnmi El Vi «■!» I-H fnre- l\l £l.f! 4H»FHrref«?kkr4M U.tt Idn I'll 4nr4.»ltkr.^l ITP* Stilikr hw* El. 9^ JIM m Sailin' Him CA.W Soft inn- pm CM Murium Imn W.W CkfprBnU tl.TS I Fudl .|J-filL' II. MJ Babcni EltctrWUCS &Wk& RiMmhIIh rinll In IdlJili-Ui WbiIi- f-iJff Ssrt k* KbiIkf W-Vm I I ■miIIhiiiA. U.W rni|rrh hr UsiIh ^BiBlrian. tW hiipjilf iiii|.i.ir w ipwl'iw pitmN E 1 ? ? IS NIB pit ir-HTk jt.L'M.W A«rllh rrnjrrh fwl h Him h HIIIvhIpiIk I -I.*?. PtbcIhbI link- Pmprrl*. Uffl r rp fl ini I hiliw-iifR k yWji l B t-tA 5 Pnfl'kiMl|tiln~F > kriiroik **? Lkrtn-aK Frajrctk ferihi KNrfi-n M.^5 iS-^laph i -'feMiifk pFi>J«ii ll.V? k fff ri-D^-rti ii. w hnrBlp4NHb M.w Till bipipiRdl ClHlFidM LW Npln khlhj^feL I .lllixt. FKI'K^H E. + .TT i rt Lill[« N.W HvtiEhvrEkMi. l.f.W IE ' I s rmm i\ Hk- h (irejirti. 14.99 rinjrrr Uu ililiht inf *n-*ihfcir^. II.W Him lu IhrsiuA ■ml ^IjIi 1*4 HV t-l.'HI Hrcinur « L^nlr I. TTI - K" 1 ^ H-*? ■i lh R M i Rwiilr l* CMfl® IT V £4*5 I «uh I'iHliRK I kf lri.nK I'F^kt** 11. I fee An uf ViHc-rM^. 0.99 Him Fv uw I ml fr H|«l|wnrn[. EI.U'I C^ri I hr mail Tr-nm ■ Mullimrlrr t4L*f TeiitureHlTern Tim Affy w SKi i^TTlfMii ri! ir* 3e>de*if^ nn h ww of dur hu uthHl I! IS a 55UV 20S dSCC nan-wW stand & wp aro ciM'e-ni We Also sell 1 i>A n'tfhiHi Fniniv>i 'lift mcLil miilnfi lifWcwtMi flBW ftMD FPMriwi 41 I Vi CHkMll\riJ- rhrfnii-Wh.ri I Wiif LIT U»'*1 1N54 nnH* dMnl I I Jiiprjj^!^ 1'f‘dknkil lS-4n.Ji.Ji +n| isjmcdi.ji HriJyir Kf-^ikK IJftVcnn-i !?( ii.S'ft-' /cncr'i- 5r I 1 1 1 pin ilIrjt mti (KKCTu-ril IV^l’t ddiditam I!IS h ' I Li |J i X -«>:kLV- mr Si^trth v: tVuiKh Jack i9t I'S'ihi Hj. 72 it 1 4pr, rTK9THir> wckdli I hH-iLX:LcM fbfwfu "Jih I nm'-foiFrKn M W Mj l.ir 1'ifOTrt.trt MltjI MhO p. "Ilj ^ if- | MulbiM l'T 4 L-idliiiL HxJiaJ i I l-l, I hi I;, la. | b i'hfilfT lAiif f«fn L'cmmic [lise C^w. Enmnnny 1'dpft TfikUfU^ 1.1. 4-? I TKin-tili I s i;. [ 7K| -n? iw i ; LMJHFT ^5p sss 'it I M ‘hciriJ ibulH Muir' DON'T LOSE YOUR TEMPER Before phoning us - if you are looking for a hard-to-find part. We have over 20,000 items in stock - including obsolete and up-to-date parts. WHY NOT VISIT OUR WEBSITE www.crickIewoodelectronics.com 2N 2SA 2SB 2SC 2SD 2P 2SJ 2SK 3N 3SK 4N 6N 17 40 AD ADC AN AM AY BA BC BD BDT BDY BDW BDX BF BFR BFS BFT BFX BFY BLY BLX BS BR BRX BRY BS BSS BSV BSW BSX BT BTABTB BRWBU BUK BUT BUV BUW BUX BUY BUZ CA CD CX CXA DAC DG DM DS DTA DTC GL GM HA HCF HD HEF ICL ICM IRF J KA RIAL LA LB LC LD LF LM M M5M MA MAB MAX MB MC MDAJ MJE MJF MM MN MPS MPSA MPSH MPSU MRF NJM NE OM OP PA PAL PIC PN RC S SAA SAB SAD SAJ SAS SDA SG SI SL SN SO STA STK STR STRD STRM STRS SV1 T TA TAA TAG TBA TC TCA TDA TDB TEA TIC TIP TIPL TEA TL TLC TMP TMS TPU U UA UAA UC UDN ULN UM UPA UPC UPD VN X XR Z ZN ZTX + many others We accept Mail, telephone & email orders. Callers welcome. Opening hours Mon-Sat 9:30 - 6:00 Connect L J Cricklewood Electronics Ltd 40-42 Cricklewood Broadway London NW2 3ET Tel: 020 8452 0161 Fax: 020 8208 1441 sales @ cricklewoodelectronics.com WIZ-C for the PIC - Rapid Application Development in C NOW available with USB Development System USB development Support * Add on library provides point and click CDC support to WIZ-C * Installs ss 3 virtual com pqn - access from C, Visual BASIC, Hyporferminal oEc, * Development board (pictured) ba^ed on 18F2550 supplied with bootloader and sample application * See website Tor details WIZ-C - ANSI Compiler and Rapid Application Development in C * WIZ-C is more than a C Compiler for the PIC - iH$ a complete development environment with rapid access to library components with point and click set up, * Ideal lor beginners, includes full tutorial manuals and an introductory manual to I he C language. * Syntax, hightighfting editor, * Full ANSI C Compiler ■ Large libraries included for displays, pons, data transfer, keypads, graphics, bootloader and C standard functions, * Extensive simulation capabalilies, very rapid program nx-ecuhon, includes simulation of LCD, LED' switches, 12 C, RS232 terminals ole. fnspecl C variables in C formal * Logic analyser can display waveforms of PIC pans and internal registers simplifying debugging. ■ Includes assembler to allow you to develop assembler projects in (heir own right, or as part of C projects * LITE version supports the most popular PIC devices - academic users may choose these types * UK written and supported. * Priced from £35.00 We accept major credit cards and Switch. Older securely from our site w^vw.fored.co.uk or contact us by phone or fax on 01 S9G-6B1 51 1 . email infoffifored .co.uk . Forest Electronic Developments, 12 Buldowne Walk, Sway, Lymington Hampshire, S041 EDU www.fored.co.uk info@fored.co.uk 2/2006 - elektor electronics 45 HANDS-ON MODDING & TWEAKING Inexpensive (web] Modify a router/switch — Mo Jeroen Domburg & Thijs Beckers Do you have an (old) PC that functions as a server and is turned on 24 hours per day? That takes quite a lot of energy. It can be done much cheaper, using a modified router. We do need to add some extra storage space, but that isn't a problem! In this article we'll show you how you can add a USB port to an inexpensive router. Apart from providing the required memory expansion it also offers the possibility for many other applications... The UK and many other counties are currently swamped with (A)DSL and cable Internet connections. Most of these connections only permit one PC at a time to connect to the Internet. There are several ways round this problem, allowing a number of PCs to use the Internet simultaneously. The most popular solution makes use of a so-called ‘router’. This is a small box into which the Internet cable plugs. A number of PCs can also be connected, all of which then have access to the Internet. These boxes are often consid- ered as ‘black boxes’. It does what it’s designed to do and it doesn’t really matter what’s inside. They’re rarely opened, since it hardly makes sense to repair them. For less than twenty pounds you can get a new one. Because of this, only a few people are aware that such a router is in fact a small computer with a proper operat- ing system on board. There are five Ethernet ports, one power connector and a reset button, but no USB socket... and we do need one of these. We have to do something about that. Inside the box: there is some space left on the Close-up of the 5 V supply (still to be built). This is board where components have not been mounted, required for the USB port. The empty space which will come in very useful. suggests that the voltage would be regulated by U10 and a handful of passive components... 46 elektor electronics - 2/2006 One of the cheapest routers that is currently available is the Sweex LB000021. This router is for sale for as little as £19. It is a low-cost router that uses Linux for its operating sys- tem. Linux, and a few other tools run- ning inside the router, are open-source programs under the GPL licence. The most important requirement of this license is that the source code used in the product has to be included with it. The fact that the source code is openly available makes it possible for the router to be used in applications that weren’t even considered by the manufacturer. From the outside the device doesn’t look special. It is a small box with only six connectors: a power input for the supplied power-supply, an Ethernet socket for the cable from the ADSL or Cable modem and four Ethernet sock- ets for connecting the PCs. What can’t be seen from the outside is that there are two other useful connectors hidden inside the router, which have not been used by the manufacturer. When we open the router (which is easily done by unscrewing four cross- headed screws from the underside of the case), we can take a look at the PCB. The design is typical of many embedded products. We can see RAM and ROM chips, the baluns for the Eth- ernet connections and an ADM5120P at the heart of the router. This chip contains everything required to imple- ment a router: a MIPS based processor, an embedded switching system for the four local Ethernet connections, two MACs for the Ethernet communica- tions, two USB ports, a serial port and a handful of general-purpose I/O lines. Not all of these can be accessed from the outside of the router. The two most obvious missing connectors are the two USB ports. This can however be rectified. If you take a look at the PCB inside the router, you’ll see that some space has been reserved for the USB ports. It’s just that the parts for these weren’t mounted during the manufacturing process. It’s therefore possible to add these USB ports your- self (see inset). USB ports are obviously a nice addi- tion, but what can you do with them? ...but we don't need to supply a lot of power so instead of the elegant circuit that the manufacturer had in mind, we'll use a 7805. The centre pin is the negative connection and for C91 we'll use 100 pF. Apart from 5 V, the controller also requires a clock signal, which is supplied by XI. According to the datasheet this little package should be a 48 MHz type. R16 (1 kW) also needs to be mounted. It's not the end of the world if you can only get the crystal in a rectangular package. If you just solder the two leftmost connections normally... F ■ “ - IF 2/2006 - elektor electronics 47 HANDS-ON MODDING & TWEAKING ...you can solder the bottom-right connection to the Now it's the turn of the components around the From left to right: an electrolytic capacitor (10 mF) right-hand pad of L4. The remaining connection USB port. Although there is room for two USB and four resistors (1 5 k, 22 W, 22 W and 1 5 k). (top-right) isn't required and can be cut off. ports, we only build one. LI and L2 should really be inductors, but it works If you want to use more USB devices it is easier to just as well if you use wire links. C95 and C96 can use an external USB hub. also be left out. As it is, the router can be easily hacked by modifying or replacing the pro- grams stored in its Flash memory. A number of people have done this already and have added several func- tions to the firmware. Details can be found in references [1] and [2]. One problem you come up against when adding software to the Flash memory is that the available memory is fairly sparse. The Flash-ROM inside the router is ‘just’ 2 Megabytes. This is microscopic compared to modern hard drives in PCs, which can easily be 100,000 times as big. It’s therefore not possible to add many programs if you just make use of the Flash memory. Luckily there is a way round this prob- lem. When you connect a USB drive to the (just added) USB port of the router, the router can use this as a hard drive. If this USB drive is a card reader or a USB memory stick, the resulting server will be smaller than a lunch box. On this server it should be possible to install all applications that can be installed on a normal server. On top of this, when you use Samba (Windows Network access for Linux) the USB drives can be made accessible to everybody on the network, without having a power-hungry PC on day and night. The router can also function as a web server. The files required to implement this can be found on our website at www.elektor- electronics.co.uk (click on ‘Magazine’, then underneath ‘Archive’ click on the arrow next to the year and choose the required month). With the right pro- grams and hardware it is even possi- ble to build domotica projects. This will be covered in the next instalment. ( 050360 - 1 ) Web links: m www.norocketscience.com/router [2] http://midge.vlad.org.ua/wiki About the author: Jeroen Domburg is currently study- ing electronic engineering at the Saxion University in Enschede, The Netherlands. He is an enthusi- astic hobbyist, who spends much of his spare time on microcon- trollers, electronics and computers. In this section we will be able to examine and build some of his projects. This project can also be found on the Internet at http://sprite.student.utwente.nl/ ~jeroen/ projects/lb00002 1 Female USB connectors aren't easy to get hold of, but you could also use a socket from a USB extension cable. Do take care that the socket doesn't make contact with the pads of SW1. We still need to make a hole in the case for the USB socket. Since we've already invalidated the warranty by modifying the PCB, it doesn't really matter if we add a hole to the case as well. Now the router has a fully functioning USB port. We recommend that you use a 512 MB Compact Flash card as hard drive, which will contain all programs and data. 48 elektor electronics - 2/2006 Elektor Electronics (Publishing) Regus Brentford • 1000 Great West Road Brentford TW8 9HH • United Kingdom Telephone +44 (0) 208 261 4509 Fax +44 (0) 208 261 4447 Order now using the Order Form Email: sales@elektor-electronics.co.uk in the Readers Services section in this issue. Step into the fascinating world of microcontrollers Microcontroller Basics Burkhard Kainka Microcontrollers have become an indispensable part of modern electronics. They make things possible that vastly exceed what could be done previously. Innumerable applications show that almost nothing is impossible. There’s thus every reason to learn more about them, but that raises the question of where to find a good introduction to this fascinating technology. The answer is easy: this Microcontroller Basics book, combined with the 89S8252 Flash Board project published by Elektor Electronics. This book clearly explains the technology using various microcontroller circuits and programs written in several different programming languages. In the course of the book, the reader gradually develops increased competence in converting his or her ideas into microcontroller circuitry. ISBN 0-905705-67-X Flash Microcontroller Starter Kit Elektor Hardware & Software Step into the fascinating world of microcontrollers with the Elektor Electronics Flash Microcontroller Starter Kit. Order now the ready-assembled PCB incl. software, cable, adapter & related articles. Contents of Starter Kit: • 89S8252 Flash Microcontroller board (ready-assembled and tested PCB) • 300-mA mains adapter • Serial cable for COM port • Software bundle on CD-ROM • Article compilation on CD-ROM 230 Pages £18.70 / US$ 33.70 £69.00 /US$112.50 More information on www.elektor-electronics.co.uk TECHNOLOGY AMPLIFIERS A few months whi e scrutin- ising a great design for a pulse-width modulated audio amplifier with a 2x100 W power rating and a very small enclosure, we were immediately very enthusiastic and thought this design would certainly deserve a place in Elektor Electronics. So our resident audio designer was going to put the circuit through its paces. The results were most unusual and this led to an extensive investigation of what was wrong with the amplifier. Was there a fault in the design or was something else the matter? This turned out to be quite a quest... 50 Ton Giesberts Design: Stefan Wicki a Differential Input Pl-Controller P400 1 > lOOpF R409 100k R410 100k U400A Audio Right In 1R425 C404 f OOhm — -100pF R426 IMeg 470nF C401 470nF C405 : lOOpF C407 ^ IMeg R437 lOOnF IMeg R413 r R414 r i — 1 Analog Inverter Comparator 10k U400B lOOnF R403 47k TP402 H=l 1IN+ TS974 AGND AGND AGND AGND +11V_A A 100k C409 TP407 Feedback +11V_A A 47k U400C TS974 C403 lOOpF C415 10k R416 10k U400D TP403 Audio- (from Sheet 1) | Triangle ) — TS974 R406 47k C4 33pF TP404 Audio+ Filter and Feedback R407 H-Bridge Driver +1 1 V_A A R417 +11V_D A ■x T AGNE in C417 InF C418 InF 10k C410 | Right PWM-BuT" |\BLI_R \ALI_R from Current Limiter | Disable ) (from Sheet 2) P AGND H-Bridge B VD400 ES1B R419 1.2k I BHB BHO BHI BHS BLI BLO ALI ALO DEL VDD VSS AHS AH I AHO DIS AHB 5^D401 ES1B BHO_R / BHS_R . BLO_R / ALO_R / AHS_R . \BHO_R \BHS_R AHO_R/ TP414 BGH TP416 AGH TP415 BGL TP410 — □ TP411 □- AHS \BLO_R \AHO_R \AHS_R R430 6.8 R431 £jSJ t401 t4 ° 3 fS I £ *SI7852DP TP417 AGL 6.8 \ALQ_R to Current Limiter (to Sheet 2) < ILIMR+ < PGND R434 SHUNT 22m/lW i R423 TP405 1.2k BLI □ R420 560 I IC431 lOOpF PGND PGND +11V_D R424 TP406 1.2k ALI Right PWM-Bus > 7 T ALI R / 1R436 560 : ^C432 lOOpF I J PGND PGND Output Filter X I L402 x i C421 2.2uF/100V L403 ^ c&yk T :C423 0.47uF/100V R.433 4.7/1 W ;C422 2.2uF/100V X T IC425 68nF/100V C 1 Speaker Out Right ;C424 0.47uF/100V 050183 - 11 Figure 1. One channel of the CDAMP designed by Mr. Wicki (a) and the accompanying triangle generator (b). b Triangle Generator (330kHz) C106 First impressions looked so promising! The Swiss lecturer in electronics Mr. Stefan Wicki offered us a design for a power amplifier (the ‘CDAMP’) that he had developed and uses as a construction project for his stu- dents at the University of Applied Sciences in Aargau. The schematics and photos looked very promising and the prototype in a very small enclo- sure arrived in due course. The amplifier appeared to have been well thought through, both externally as well as internally (see photo). All connections are located on the rear. On the front you will find two LEDs and the on/off-switch. The ampli- fier is almost completely built with SMD parts and is well presented. The enclosure is made entirely from alu- minium and as a result has a solid look. One detail that attracted our attention however was the way the input signal was routed from the input to the PCB. Here two thin twisted litz-wires are used per channel, but these were seen to run right over the top of the output filters and final power stages! Schematic The amplifier was accompanied by a detailed circuit description, which explained the operation of all parts at length. In Figure la we show the schematic of one output stage (as drawn by the author). This clearly illustrates the design of the amplifier together with the triangular- wave generator (Figure lb). For clarity, we have left out all the other parts (other channel, power supply, protection, etc.). The audio signal goes to an input buffer first, and is then combined in a pi-style regulator with the feedback signal from the output stage. The signal then continues on to two comparators operating in anti-phase, which compare the volt- age with the signal from the triangle generator. The comparators supply the PWM signal that is used to drive the final stage. The final stage consists of a bridge of four power FETs. The loud- speaker is connected between the FETs via an output filter. A special H- bridge IC from Intersil provides the 2/2006 - elektor electronics 51 TECHNOLOGY AMPLIFIERS gate drive for the FETs. In addition to generating the correct drive signals, the IC also inserts a brief ‘dead’ time at the switching edges to prevent the two series-connected FETs from conducting at the same time during the transition. This is the whirlwind overview of the design. Complete schematics and a detailed description are available from the designer’s own website ( www. wictronic . ch) . First measurements According to the accompanying tech- nical specifications, the distortion from the amplifier would amount to 0.05% (THD) and that sure is a very good value for a class-D amplifier. We were therefore curious what the outcome of our own measurements would be. So we went to work in the Elektor Elec- tronics lab with our Audio Precision System Two analyser. The first measurement was to deter- mine the distortion of one half of the bridge into a load of 4 Q. It is common practice to measure the distortion at 1 kHz with an output power of 1 W. To our surprise this turned out to be sev- eral percent, measured from one half of the bridge to ground. Also, when view- ing the signal on a ‘scope, the distor- tion was clearly visible. The sine shape was flattened on top quite early on. Measuring symmetrically, between the two half-bridges, the signal was rea- sonable, however. But even then the distortion was still more than a worry- ing 0.5%. Is there something wrong with the prototype; perhaps it is not adjusted properly? Since the amplifier only operates from a single supply volt- age, both the FET outputs have to be at half the power supply voltage for opti- mal output. This appeared to be correct and this was also the only adjustable parameter in the entire design. The fact that the symmetrically meas- ured distortion is lower can be explained by the fact of the symmetri- cally implemented negative feedback. Any errors in the signal processing are then reduced depending on the amount of negative feedback. But since the schematic clearly shows that both halves of the bridge are identical and are driven by identical (antiphase-) sig- nals, the difference between the out- puts (apart from the phase) and there- fore the distortion, should be minimal. Each of the bridge halves actually pro- duced a signal with different amplitude and distortion. So the plot thickens. In order to see exactly what was going on, the amplifier was driven a little harder, supplying 10 W into 4 Q (see Figure 2). The scope now displayed the output signal getting stuck at around 20 V. It appeared that there was clipping in the output stage, but this could not be possible because the power supply voltage was set to 30 V. Despite the ‘clipping’ phenomenon, the amplifier could be driven further (to 50 W into 4 Q, see Figure 3). In the waveform of Figure 3 there appears to be crossover distortion. However we’re dealing here with a class-D amplifier here, not with a class- B output stage! As a result of our Right Channel Chinch Input * Speaker + 4 Ohm 12V DC... Output fnn www.wictromc.ch WJ1P.1 r 11 CHI. Ourawl TS4 MV 1*4flW D* II CHit Cuwl Otl OuiwilOtl DM Ml Q« ac i,Dto^ vm itfcrtflOOHj cm it vpc :U4 i |ife h L - 1 ipy: r L \ \ 1 h, / J \f t f f \ \ \, ^ CHI Qunm I 144Mfs/ Ctiraw II M I II M MV CHn tarwl Oti Ouiw II 04 l-ll Qfl at I OTB^-s 1/cr ifcti.OQOHj Figure 2. At an output of 1 0 W into 4 f2 the output signal gets stuck at about 20 V. Figure 3. At increased drive (50 W/4 Q), a type of cross-over distortion seems to occur. 52 elektor electronics - 2/2006 anic ply + - Speaker + 30VDC 4 Ohm Chinch Lit Output Inpul measurements we got the feeling that something was not right with this amplifier. Perhaps a component was defective? However, we could quickly rule that one out, since the other chan- nel provided similar measurement results. What was going on here? Back to the designer Consulting with the designer of the cir- cuit caused a reaction of disbelief over our measurements. He also asked us to assess the amplifier acoustically. The latter turned out - no surprise here - to be rather bad. During the listening test we also kept an eye on the speaker signal with an oscilloscope, and even then the crossover distortion in the bridge halves was visible. We were also asked to confirm that the duty cycle of the amplifier equalled 50% without an input signal. This was correct and can be determined from the oscilloscope picture that clearly shows that the output is at half supply voltage. Next item on the checklist: was the power supply capable enough? That could surely not be the problem, we had used a big lab power supply that is capable of delivering at least 40 A. After reporting our results we were asked to make a few more measure- ments on the amplifier, such as power supply voltage, differential input amplifier, the triangle amplitude and (again) the symmetrical output signal between the bridge halves. These were all correct, except for the output signal, as we had established earlier. The designer also suggested overshoot in the output filter as a possible cause for the strong distortion, but in our opinion the output filter could never cause distortion this bad. We were not making much progress here! According to the designer every- thing was in order (all the samples that he had built gave him comparable measuring results), but according to us something didn’t smell right. More measurements After we had spent all this time on this amplifier we could not just abandon it and we decided to investigate further to determine the cause of the amplifier behaviour. The preceding measure- ments gave the impression that the input amplifier, the internal regulated power supply and the PWM-modulator were all largely correct. But there was still no explanation for the severely dis- torted output signal from the bridge halves. To check the signals to the driver IC for the MOSFETs, we meas- ured those via a small low-pass filter (10kQ/100 pF). The signal (Figure 4) did not show any asymmetry on either input to the HIP4082 (the noise is the remainder of the PWM-modulation). This signal is not quite sinusoidal because the neg- ative feedback in the output stage compensates and this results in a devi- ating curve. This led is to the conclusion that the driver IC, a HIP4082 from Intersil, had to be responsible for the problems in the output stage. CH I OurriBlI !WCV Ojmo'UMffl Dfl II CMCW CHn Oyw I Otl Owiwj- II 04 DfH HI 04 oc i mo«5 i/oi; ifofrjoooHj ct+i;i.cKKJivajfVLx: iua m urn »ij Cri i ran ei - i* OH* Oum® ! £i,6ffly gym® Ij gMOY grij i l| .KfflV C*ii Ou l 04 CX-w II 04 01 £.580 -“-5 I/O! 151 .078 Hz II 0* Figure 4. The integrated control signal that drives the HIP4082 is not quite Figure 5. After a few modifications, the output signal from our test circuit sinusoidal because of the negative feedback that is present. finally started to resemble the input signal. 2/2006 - elektor electronics 53 TECHNOLOGY AMPLIFIERS Test circuit We were now in so deep that the phenome- non would not let go of us any more. We decided to order a few of the driver ICs from Intersil and built our own test circuit. We simply had to know what was going on! For our own version of the output stage we bought the DIP version of the IC (HIP4082IP) instead of the SMD ver- sion. For the MOSFETs we used TO220 types (IRF530 from ST). We used stan- dard parts for the remainder of the cir- cuit as well. Of course, as a result the active part of the circuit turned out a little larger than the original amplifier, but our test circuit should nevertheless give comparable test results. We delib- erately did not put the output filter on the PCB so that it was easier to exper- iment with the core of the circuit. On the (single-sided) test PCB the dead time was made adjustable by connect- ing a potentiometer in series with the resistor at the DIL-pin, so that we could measure the effect of this. For the signal generator we designed a purely digital circuit specifically for this test that generated a maximum modulated PWM signal. The generator supplies two clock pulses in anti- phase, the duty cycle of which can be varied in 16 steps from 0 to 100%. This modulation is synchronous with the clock frequency, which should result in a clean triangle signal at the output (measured via a steep filter). With this signal every defect should be immedi- ately obvious. Disappointing results With the original values (100 nF for the bootstrap capacitors) the output sig- nal was far from ideal, collapsing to about half the supply voltage. For the clock signal we chose about the same frequency as in the CDAMP, namely 313 kHz. This frequency is much higher than the rec- ommended upper limit of 200 kHz in the datasheet. But in the CDAMP we had already halved the clock fre- quency at one stage and that made no difference then, so we now stuck to the same frequency. As a minimum resistance for the dead time we used 2.5 k£2, since this theoretically would result in a maximum current of 4 mA. The IC is powered from 12 V, so that the voltage across the resistor should amount to V DD -2 V. Unfortunately that was not the case in practice. At a smaller resistance value, the voltage was also reduced. The maximum cur- rent, 5 mA, was found to flow when the resistance was 1.2 k£l The voltage was then only about 6 V. This is some- thing that is not mentioned in the datasheet, the value of the dead-time can only be read from a graph. When increasing the dead time, the output voltage appeared to collapse and reach some sort of limit. It was much better when the bootstrap capacitor was increased and after increasing the supply voltage to 15 V the output signal finally took the shape that was expected (Figure 5). Measurements were made without a load through a simple first-order RC- filter, so that the remains of the pulse width modu- lation are still clearly visible on the oscilloscope. Why the remainder of the posi- tive output voltage, when the power supply voltage is increased, passes unhindered through the FETs is still a mystery. Increasing the power supply voltage to the bridge made no difference to the operation. Our test circuit did exhibit a similar behaviour as we had observed with the CDAMP sample when the power supply voltage was lowered. During our experiments, half of the bridge in the IC burned out sponta- neously on two occasions. The first time it was not entirely clear what caused the malfunction. The second time it happened when increasing the dead time when a 4 £2 load was con- nected. This signalled that it was time to stop with this experiment. Conclusion Considering the results from our test circuit, it is not likely that we will use the HIP4082 in a new design. The only thing the IC needs to do, is to turn the MOSFETs on and off making sure that both FETs in one half of the bridge do not conduct simultaneously. Unfortu- nately in practice this IC does not appear to be sufficiently robust to fault situations and the IC is also the cause of the poor measurement results of the CDAMP amplifier. Perhaps comparable ICs from different manufacturers are better behaved, for example the MIC4102 from Micrel (100 V Half Bridge MOSFET Driver with Anti-Shoot Through protection). ( 050183 - 1 ) 54 elektor electronics - 2/2006 BHI AHI DIS & & U/V LEVEL SHIFT El— j>-£> V DD liil- DETECTOR UNDERVOLTAGE ALI DEL 5 I — o TURN-ON DELAY ■a AHB BHB O KJ DRIVER UJ H> — E3 AHO BHO EH — X Leftrear v liqhtcluster 1®-S| cm BIS Slight cator 5 rake verse CAN bus 1 m 2 065030-13 the low level software communication protocols. Physically, the CAN bus itself consists of a twisted pair of wires which use differential voltages for data transmission — there is no earth (ground) wire in CAN and differen- tial voltages make the system very immune to noise. CAN is designed primarily for control and hence the messages used are small at just eight bytes maximum. As illustrated in Figure 1, the basic message structure contains two parts: a message identity and message data. The actual structure is a little more complicated than this, with error detection, synchronization and other bits being embedded into each message. However, one of the great benefits of CAN is that the ICs used take care of these details for you and provide you simply with message and data information. Functional overview Figure 2 shows a typical CAN node on a network. All nodes have a microcontroller with I/O circuitry, a CAN controller and a line driver which interfaces the CAN-L and CAN-H differential connections to the CAN con- troller. Some microcontrollers have the CAN controller embedded (i.e., on-chip) which reduces the cost of the node. These devices can be seen on the image of the EB018 E-blocks board shown in the introductory pho- tograph. You can see that the connections to the CAN node are Power, Ground, CAN-H, CAN-L and then other connections to I/O as required. In order to understand how CAN works at a higher level let's consider Figure 3 which shows some of the possi- ble CAN nodes in a car. In this context where a node is a complete functioning unit, the node is often referred to as an Electronic Control Unitor ECU. Here you can see five ECUs: an engine temperature sensor, an instrument panel, a switch on a brake pedal and ECUs for the left and right hand rear light clusters. Although the wires are not shown here all power and grounds are connected, and all CAN-H and CAN-L terminals are connected by 100-ohm terminated twisted pair wires. In practice you may find the foot brake connected to the instrument panel ECU etc., but for illustrating how CAN works let's just assume the system is as shown. A key feature of CAN is reliability, and this is kept to a maximum by keeping traffic on the CAN bus to a mini- 56 elektor electronics - 2/2006 mum. In a conventional network you might think that the foot pedal would tell the central processor on the instru- ment panel that it has been pushed down, and the instru- ment panel would then tell the light cluster ECUs to turn the brake lights on, and so on! Surprise — CAN works differently. When the pedal is depressed the brake pedal ECU issues a message effectively stating "broke pedal pressed". This message is issued to the whole bus. The light cluster ECUs are programmed so that when they see the "brake pedal pressed" message on the CAN bus they power up the appropriate lamp. This has kept message flow to a minimum, and if the instrument panel ECU — or any other ECU — is not working then the core important functions of the network are still active. This is an example of one type of data exchange for impor- tant 'mission critical' data: if your brake lights don't come on then you could run into trouble, or it would run into you! However if this method was employed by all devices con- nected to the bus then the traffic would be quite large — with more traffic meaning reduced reliability. So, a sec- ond technique for data exchange is used. Looking at tem- perature monitoring, for example, the central instrument cluster wants to know what the temperature of the block is so 'temperature' can be displayed on the instrument console and — if necessary — the warning light acti- vated. The designers of the system will have decided that the temperature needs to be monitored at, say, five sec- ond intervals. So, every five seconds, the central console will issue a message saying "can anyone tell me what the block temperature is?" The ECU on the block is pro- grammed to look for the message "can anyone tell me what the block temperature is?", to then measure the tem- perature, and reply with a message stating "the block temperature is" followed by the temperature data. A key problem Having understood the basic principles behind CAN, the next question is "exactly how is the basic message struc- ture used to communicate all this information?". Here is a key difficulty of CAN. Whilst the general CAN methodol- ogy, the electrical connections, packet structure, error cor- rection and low level software are fully specified, all the rest is left up to you. In practice this has meant that every automotive manufacturer has chosen their own propri- etary protocols. Massey Ferguson will be different to Audi will be different to BMW, and so on. The reason for this is probably twofold: firstly, automotive companies don't want unauthorized people tapping into the bus that manages all the safety-critical electronic devices in the vehicle; and secondly diagnostic equipment and training are valuable revenue streams. Delving deeper in To understand how the messages in a CAN system are constructed, let's consider the temperature dialogue ear- lier. Every message has an ID (identification). The system designer needs to designate each ID with a function. So, let's say the ID for can anyone tell "me what the block temperature is?" is ID 400. Correspondingly, let's say the ID for " the block temperature is" is ID 401 . The sys- tem designer then has to decide how to use the data- bytes transmitted to transfer information. To keep things simple, we can say that the first data byte is 0 for posi- tive temperatures, and 1 for negative temperatures. We can then say that the next three bytes are used for 1 00s of C, 1 0s of C and units of C. Now in practice, this would rarely be the case, but as we are interested in teaching automotive technicians — among others — it might be a good idea to avoid hexadecimal notation and 1 6-bit numbers at this point. So, if the temperature is 76 degrees Celsius then the message data would be 0076. For this dialogue the transactions on the bus would therefore be: ID Data Console ECU 400 - Block ECU 401 0076 Here we can see the Console ECU requesting the temper- ature and the block replying with the data, the console then displays the data on the dashboard. CAN Flowcode and E-blocks do it? The simple example above shows that at a very high level, the way CAN works is very simple. One of the real strengths of the Flowcode software supplied with E-blocks is that it allows all of the complex parts of CAN to be taken care of in the background and only exposes users to the messaging parts of CAN. Within Flowcode some custom macros have been written for the E-blocks CAN controller board that allows it to be easily controlled by those with little programming skill. The macros provided allow the ID and data to be easily set up in the transmit screen (Figure 4), which is invoked in a single Flowcode icon. Similarly, in the receive dialogue screen (Figure 5), the ID and data can be picked up by a single Flowcode icon, and placed in user variables. In the receive dialogue screen, more advanced users can click on the 'details' button to access further advanced functions like filters and masks, as well as view the CAN data string, but for most users these details aren't terribly important. Putting this together The screendump in Figure 6 shows a Flowcode pro- gram for a notional brake pedal in a car. Here we are using the E-blocks Multiprogrammer with a 40-pin 2/2006 - elektor electronics 57 TECHNOLOGY E-BLOCKS Figure 4. Transmit dialogue screen. Figure 5. Receiver dialogue screen. Figure 6. A simple Flowcode program that sends CAN messages when the brake pedal is activated. PIC1 6F877A with internal USART. Onto this we place the CAN board on port C, and our brake switch goes onto bit 0 of Port B. The first icon in the program initializes the CAN board. Then we have an endless loop. In the loop we get the input from the brake pedal, and if it is at logic 1 , or the brake is pressed, we transmit the CAN message corresponding to the brake being pressed. A very similar program in the receiving ECU has an end- less loop that constantly monitors the receive buffer and takes appropriate action. Conclusion CAN is a complex protocol that has many detailed fea- tures designed to provide a high data rate, high reliabil- ity control network between lots of separate processors. Implementing CAN is a complex task in languages like C, but doing so with Flowcode and E-blocks is actually very simple. Applications that you might want to consider include a wide variety of home automation tasks, control of outdoor train sets, burglar alarms, and many others. The Flowcode CAN component is a free download from the Elektor web site and will operate with all Professional versions of Flowcode. ( 065030 - 1 ) Earlier in this series Electronic Building Blocks, November 2005. E-blocks and Flowcode, December 2005. E-blocks in Cyberspace, January 2006. Articles may be downloaded individually from our website. Two offers you CAN't resist This month as a special offer to encourage you to investi- gate CAN we are making available an Easy CAN Kit consisting of: • Two PICmicro Multiprogrammers with USB cables; • Two 1 6F877A PICmicro microcontrollers; • Two CAN boards; • One Switch board; • One LED board; • Two LCD boards; • Flowcode 2.1 Pro version. For a discounted price of £ 299.00 or € 449.00. Also, to support last month's article on using embedded microcontrollers to develop web pages we are making an Easy Embedded Internet kit available which includes: • PICmicro Multiprogrammer with USB cable; • One 16F877A PICmicro microcontroller; • One Internet board with crossover cable; • One Switch board; • One LED board; • One LCD board; • Flowcode 2.1 Pro version. For a discounted price of £ 232.50 or € 349.00. Further details, also on other E-blocks, may be found in the E-blocks department of our website SHOP at www.elektor-electronics.co.uk 58 elektor electronics - 2/2006 B mfLtlli E-blocks Easy Internet Kit Connect your blocks to the internet E-blocks are small self-contained electronic E-blocks Easy CAN Kit A complex system made transparent The CAN bus is a resilient, high data rate bus for communicating between electronic devices in situations where high data reliability is required. One use of the CAN bus is in the automotive circuits and printed circuit boards that can * * . be combined to create functioning electronic /W _ L- . ~ jS applications and systems. With the E-blocks In- ternet board you can connect your own system to the Internet. This module is perfect to quickly addasimplewebpagetoyourembedded system. Thisthen permits (measu- rement) data to be inspected remotely. Applications include reading out a weather station, switching lighting systems and monitoring and controlling machines! The application area is truly spectacular! industry where it is being used as a substitute for copper wiring looms in cars. The E-blocks Easy CAN Kit allows you to employ this professional bus system in your own applications. Implementing CAN is a complex task in languages like C, but doing so with Flowcode and E-blocks is actually very simple. As a special offer to encourage you to investigate CAN we are making available an E-blocks Easy CAN kit at 30% discount. An offer you CAN’t resist! E-blocks Easy Internet Kit: Flowcode Professional £118.00 E-blocks LED board £ 14.65 E-blocks LCD board £ 19.30 E-blocks USB Multiprogrammer £ 77.30 E-blocks switch board £ 14.65 E-blocks internet board £ 71.95 PIC16F877 £ 10.50 Ethernet ‘crossover’ cable £ 5.30 Total value: £331.65 Special Offer: \ 30 % L / d\sco«°y> £ 232.50 E-blocks Easy CAN Kit: Flowcode Professional £118.00 E-blocks LED board £ 14.65 2 x E-blocks LCD board £ 38.60 2 x E-block USB Multiprogrammer £154.60 E-blocks Switch board £ 14.65 2 x E-blocks CAN board £ 67.00 2 x PIC16F877 £ 21.00 Total value: V £428.50 \ Special Offer: / \ 30 °/° L d\sc° u ”>> Ordering Use the order form at the back or go to www.elektor-electronics.co.uk E-blocks will be shipped after receipt of payment. Prices are exclusive of postage. Learn more about E-blocks? For more information, visit www.elektor-electronics.co.uk/eblocks HANDS-ON JACOB'S LADDER Some people find electric arcs scary, while others find them especially fascinating. If you're not afraid of a few kilovolts and observe due safety precautions, you can use the circuit described here for some interesting experiments. However, you must always remain alert and keep safety in mind, because the voltages and currents generated by the circuit can have nasty consequences. Ton Giesberts If you search the Internet for things related to high voltage, you quickly encounter terms such as ‘Tesla coil’ and ‘Jacob’s Ladder’. In its original form as invented by Nikola Tesla, a Tesla coil is an air-coupled transformer that works entirely on the principle of resonance and can easily generate potentials of several hundred thousand volts or even a few million volts. At such voltages, electric arcs jump ran- domly to surrounding objects, and we do not regard that type of experiment- ing as something that can be respon- sibly suggested as an example. When the subject of high-voltage experiments is mentioned, many peo- ple have a mental image of two spheres with sparks jumping between them. An example of such a device is the Van De Graaf generator, which was built by Dr Robert J. Van de Graaf and could generate 5 million volts. Our ambition here is quite a bit more modest. A device that produces a well- defined arc between two conductors spaced a small distance apart is safer. A nice example of this is the Jacob’s ladder. An electric arc between two long conductors heats the air if it has sufficient energy, and the hot air pro- duces enough convection to cause the arc to move upward. If the two conduc- tors are arranged in the form of an extended V with the distance between the conductors increasing in the upward direction, the applied voltage will ultimately be too low to maintain 60 elektor electronics - 2/2006 Experimenting with a Jacob's Ladder the arc. After the arc is extinguished, a new arc will be formed again at the bottom. In principle, this can be achieved with little or no electronics. All that’s needed is a power supply that can provide 10-15 kV at 20-40 mA, which amounts to a hefty mains transformer that can deliver suffi- cient voltage and power. Of course, the transformer must meet rather demanding requirements, such as ade- quate insula- tion and a high leakage induc- tance in order to limit the current, because the arc is practically a short circuit. A circuit consisting of nothing more than a transformer is not particularly interest- ing for a magazine dedicated to electron- ics. It’s more educa- tional to see how the voltage can be generated in a different manner. Here we deliberately decided to use a DC voltage, because a DC arc has a nice blue colour, instead of the white arc generated by an AC voltage. In retrospect, that was not such a good decision, but we’ll say more about that later. The circuit Despite what we just said, we use a transformer to generate the high volt- age. However, the dimensions of the WARNING. Working with high voltage can be fatal. The circuit described here is not for begin- ners. Do not build or use it unless you are experienced in dealing with high voltages. output voltage of ‘only’ 1000 V. We also decided to use a mains transformer to provide a lower input voltage. That at least makes the primary side of the transformer a bit safer. We chose a supply voltage of 80 V to prevent the turns ratio of the transformer from being too high. That saves quite a few turns on the secondary side. The pri- mary winding requires two sets of 12 turns, and the secondary requires a total of two times 75 turns. We decided to ground the centre of the secondary winding, so the voltage between the ends of the secondary winding and ground is ‘only’ 500 V. That keeps the maximum volt- age between the primary and secondary windings within reasonable limits. Of course, you’re free to wind the second- ary as a single winding so it floats with respect to ground. If you do that, it’s a good idea to double the insulation between the primary and the secondary. transformer can be kept modest, even though it provides a fair amount of power, by using a frequency that is considerably higher than the mains fre- quency. One of the problems in making a DIY transformer for extremely high voltages is the insulation and the breakdown voltage of the materials that are used. On top of that, we have to ensure that it’s reasonably easy to build the circuit as a DIY project. For that reason, we decided to use an To keep the electronics relatively sim- ple, the transformer has two identical primary windings so it can be driven in push-pull mode. That’s easy to do with a toroidal-core transformer by using a bifilar winding (two wires in parallel). The details of the transformer construction are described further on in this article. The push-pull configu- ration allows the transformer to pro- vide the maximum amount of power that is possible with the selected core. A brief guide to working with high voltage • Ensure that the circuit cannot be switched on unintentionally or by unauthorised persons. Always switch off the voltage before making any circuit modifications. In case of doubt, always discharge the capacitors - not only in the cascade stages, but also in the main power supply. Ensure that all metal parts that are not connected to the cir- cuit are properly earthed (box, etc.). Always stay a safe distance away from the electrodes when the circuit is switched on. Regard all voltages as potentially lethal. Never replace the fuses by types with current ratings higher than the specified ratings. • After you have checked everything, check everything once again. • Do not conduct experiments in damp or humid surroundings. • If you must make adjustments to a live circuit, always work with only one hand. Source: http://www.pupman.com/safety.htm 2/2006 - elektor electronics 61 HANDS-ON JACOB'S LADDER +VDD © J^“f ^^OOr R1 I 1 12k | — f p ffr LS J ci / fT 25k 150p +VDD © r© 14 © AST OSC AST -T Q RCC IC1 4047 Q cx RX +T RST RET 13 10 BC337 ^J 2 ~© BC327 .11 12 +VDD © ^-JJ 3 -© BC337 ^J 4 BC327 K3 SEC1 TR2 225 VA 30V r\ kJ r\ kJ o r\ kJ r\ kJ K4 C14 SEC2 30V C15 +80V © FI D1 R2 12Q hi BY448 R3 1 33 Q T5 s '-I l»i N ✓ s IRF640 R6 D2 R4 — BY448 R5 1 33 Q C7 In T6 S ✓ . -Il^i N / N IRF640 5AT A1 A2 TR1 R7 -| 330 Q h K1 B1 B2 © C8 \4li7 100V lOOOVp ^ K2 R8 H 330 Q h © see text RIO H 47QQ | — Cl 3 +80V © Cl 2 C11 D7...D10= BY329-1000 C C12...C15 = 47n/250V 1000^1 100 V D6 1 N4004 IC2 +9V © 78L09 ■> * — • — D4 D3 15V 10V 1 CIO C9 _V_p5 C6 C5 C4 C2 U±3 u±3 1=1 / / !==□ U±3 p, lOOOp lOOn ©P lOOn lOp lOp V 100V Y loop 25V MW3 pW3 63 \/ 6 3V -• — ♦ — ♦ • • -• • 4 • • • POWER 050192-11 +VDD © LI lOpH Figure 1 . Except for the fast diodes and the transformer, the circuit is built using standard components. In practice, the centre tap of the pri- mary winding is connected to the pos- itive supply voltage. Each of the other two ends is alternately connected to ground by transistor switches. To ensure that the two transistors are never conducting at the same time, they are switched off faster than they are switched on. The time when nei- ther of the transistors is conducting is called the ‘dead time’. The disadvan- tage of this arrangement is that each transistor must withstand twice the supply voltage when the other one is conducting, because the two halves of Cl C3 C5 C7 C9 ©HI lOOOVp 2 ©£ Hh Hh rlh Hh rlh r~^ D1 D2 D3 D4 D5 D6 D7 D8 D9 DIO 3! 3E 3! 3E 3! * 3E 3E 3E X * C2 C4 C6 C8 CIO hh t - — HH HH HH HH HH — S + ioooov Cl ...C20 = 5600pF / 2000V D1...D20 = DSA1-18D (1800V/7A) Cll Cl 3 Cl 5 Cl 7 Cl 9 ©-HI [^lOOOVp J ©£ Hh Hh rlh Hh rlh Dll D12 D13 D14 D15 D16 D17 D18 D19 D20 X X X X X X X X X X » Cl 2 Cl 4 Cl 6 Cl 8 C20 f H H 1-| H h |-1 h H h |-4 — S -loooov 050192-12 Figure 2. The schematic of the cascade stage is also standard. 62 elektor electronics - 2/2006 the primary winding have opposite polarity. In this case, that means each transistor must be able to switch more than 160 V. We chose an inexpensive transistor type, the IRF640, for our experiments. It has a breakdown voltage of 200 V, a channel resistance of 0.18 Q, and a continuous switching current rating of 18 A. However, if you find yourself blowing up MOSFETs too often in the enthusiasm of your experimenting (and that’s bound to happen), you may want to try using the IRFB260N. It is considerably more robust, but it’s also a good deal more expensive. The max- imum continuous current rating of the latter type is a hefty 56 A (and that in a TO220 package!), and the maximum junction temperature is 175 °C. The channel resistance is also considerably lower: less than 0.04 Q. One drawback is that the input capacitance is a factor of 3.5 greater, so switching losses will be increased. The buffer stage for driv- ing the MOSFETs is not actually designed to handle that. The drive circuitry (Figure 1) is built around a nearly antique IC from the 4000 family, the 4047, which is described as a ‘monostable / astable multivibrator’. It has a separate output (OSC) for the internal astable multivi- brator, and it also has a divide-by-2 cir- cuit with two antiphase outputs. PI allows the frequency at the divider out- puts to be adjusted over a range of approximately 35-110 kHz. That makes it possible to select a different core material or change the number of turns, if so desired. In our tests, we were able to leave the frequency at the lowest setting (PI turned fully anti- clockwise). The IC is operated in the astable mode. The two antiphase out- puts are quite convenient for driving the MOSFETs. Unfortunately, a 4000- series output cannot provide very much current, so separate buffer stages are necessary to drive the high gate capacitances of the MOSFETs. The buffer stages consist of a pair of complementary emitter followers formed by T1-T4. Type BC337 and BC327 transistors are used for the NPN/PNP pairs. They have a peak switching rating of 1 A and sufficient gain. The switch-off time of the MOS- FETs is reduced by a factor of around 3 by connecting an extra resistor and diode across R3 and R5. That ensures that the two MOSFETs will never be conducting at the same time, which would amount to a short circuit. The RC network R6/C7 damps any over- shoots that may result from switching the MOSFETs. C8 provides additional decoupling for the transformer supply voltage, and it must be fitted as close as possible to the associated leads. R7 and R8 protect the transformer against hard shorts, but they also have another function: if the arc conductors are placed closer together than neces- sary for the maximum voltage gener- ated by the circuit, the input of the cas- cade stage forms a sort of high-voltage Zener. The distance between the con- ductors determines the maximum charge voltage of the capacitors. Any voltage above that level is converted into heat by R7 and R8. Fuse FI pro- tects the high-voltage transformer against long-term overloads, and fuse F2 for the mains transformer protects the entire circuit. The supply voltage for the high-voltage transformer is provided by a 2 x 30-V transformer. Transformers with 60-V secondaries are not standard items, and a supplementary benefit is that the cen- tre tap can be used to increase the effi- ciency of the auxiliary supply circuit for the 4047 (due to the lower voltage drop). R10, D6 and D4 convert the cen- tre-tapped secondary voltage into a raw 15-V DC voltage in order to keep the dissipation of the 78L09 regulator rea- sonably low. The output voltage of the 78L09 is further filtered and buffered by LI, C2 and C3, because the peak cur- rents for switching the MOSFETs are greater than what the IC can supply. D3 protects the output of the 78L09 against any spikes that may be present, and D4 does the same thing for the input volt- age of the voltage regulator. The main supply voltage is provide by four fast rectifier diodes, which can handle 7 A at a voltage of 1,000 V. This working voltage is more than what is strictly necessary, but it was chosen to be on the safe side. The diodes are located next to each other at the edge of the circuit board, so they can be eas- ily fitted to a small aluminium plate for cooling if necessary (electrically iso- lated, of course). C12-C15 filter the diode switching spikes. Standard MKT capacitors are used for this purpose, because they have higher working voltages than normal ceramic types. Three terminal blocks (K3-K5) are located on the circuit board for con- necting the mains transformer. The fourth terminal block (I<6) is used to connect the mains transformer to the mains circuit (via fuse F2). Now let’s return to the output of the converter. One way to convert an AC voltage to a high DC voltage using standard components is to use what is called a ‘cascade circuit’. That consists of a series of diode/capacitor pairs that increase the output voltage by the peak value of the applied AC voltage for each section of the cascade (see Fig- ure 2). A drawback of this arrangement is that the capacitive load on the AC source increases with each section, while the apparent capacitance of the high-voltage output decreases in the same ratio. All the capacitors are actu- ally connected in series, and with a cascade circuit having ten identical sections, the output capacitance is only one-tenth of the value of each individ- ual capacitor. In other words, the out- put impedance increases significantly. One way to counteract this is to drive the cascade with a high-frequency volt- age and ensure that the transformer supplies a hard AC voltage. We used the same philosophy for the cascade stage as for the secondary winding of the transformer. Instead of using a single cascade to generate the output voltage, we decided to use two cascades. Each one supplies half the desired voltage, but they have opposite polarities. The full voltage is thus pres- ent between their two outputs, but the voltage with respect to the surround- ings is only half as much. Of course, that doesn’t mean the circuit is safe to touch, but it does make it a bit safer. The approach we took (using a DC out- put) proved to present a problem in practice. Despite the high switching frequency, the output voltage turns out to not be hard enough, so spikes at the output of TR1 can charge the capaci- tors in the cascade to a higher voltage than what we expected. We also found that the voltage across the diodes can rise to a dangerous level. When an arc is struck between the two conductors or electrodes, the voltage on the capac- itors drops to a lower value. That causes the arc to be briefly inter- rupted, which allows the voltage on the capacitors be built up again. That creates a repetitive effect. As already mentioned, R7 and R8 limit the ‘short-circuit’ current. That brings us to the snag: the transformer, which is nearly ideal, turns out to be the problem. Too much heat is dissipated in R7 and R8 in order to maintain an arc, and there is even a chance that the transformer may become overloaded. If that happens, the core will be driven 2/2006 - elektor electronics 63 HANDS-ON JACOB'S LADDER into saturation and immediately create a short circuit, and T5 and T6 will be dead well before fuse FI blows. It’s thus a good idea to choose a distance between the electrodes that causes a prudently repetitive arc (bear in mind the rule of thumb of 10 kV per centime- tre). That still provides a nice effect, and besides nice blue sparks it gener- ates a considerable amount of noise and, unfortunately, a good deal of ozone. That means your experimenting area must be well ventilated. The main circuit should preferably be fitted in a well-earthed metal box with forced-air cooling, in order to dissipate the heat generated by R7, R8, Trl, and the heatsink for T5 and T6. Figure 3. The main circuit board is reasonably compact. When assembling the board, ensure that R7 and R8 are placed sufficiently distant from the board to provide adequate cooling. 64 elektor electronics - 2/2006 Construction Fitting the components to the main cir- cuit board should not present any problems (see Figure 3 and Figure 4). However, fitting the leads of the DIY transformer is a bit fiddly. Small bends must be formed in the leads of transistors T5 and T6 so they can be fitted to heat sinks. After that, the transistors should be attached to the heat sinks using insulating wash- ers. Solder the heat sinks in place first, followed by the transistor leads. As R7 and R8 generate a considerable amount of heat, they must be fitted spaced above the circuit board. Try to maintain a clearance of 1 cm. If they SJSJ Figure 4. The prototype. Despite its moderate dimensions, this circuit delivers around 200 W at 1 000 V. We tried to keep the circuit as simple as possible to make DIY construction reasonably easy. j COMPONENTS LIST i Supply board I Resistors: R1 = 12kn R2,R4 = 12 a R3,R5 = 33 a R6 = 47Q 5 W R7,R8 = 33CK1 10W R9 = 6kf28 I R 1 0 = 470Q 5W I PI = 25k£2 preset I Capacitors: I Cl = 150pF C2,C4 = IOjiF 63V radial C3,C5 = lOOnF ceramic C6 = 1 OOjlxF 25V radial C7 = 1 nF 400V MKT C8 = 4(iF 7 100V MKT, lead pitch 27.5mm C9 = lOOnF 100VMKT 010,01 1 = 1 OOOjiF 1 00V radial, max. diameter 1 8mm C 12-015 = 47nF 250V MKT Inductor: LI = 1 OjiH Semiconductors: D1 ,D2 = BY448 D3 = zener diode 1 0V 1 .3W D4 = zener diode 15V 1 .3W D5 = LED, low-current D6 = 1 N4004 D7-D1 0 = BY329-1 000 T1,T3 = BC337 T2,T4 = BC327 T5,T6 = IRF640 or IRFB260N IC1 = 4047 IC2 = 78L09 Miscellaneous: K1-K4 = 2-way PCB terminal block, lead pitch 5mm K5,K6 = -way PCB terminal block, lead pitch 7.5mm TR1 = 2 x core B64290-L82-X830 (N30, 50 x 20 mm)*, e.g.. Epcos (Schuricht cat. no.: 330603); 2x12 turns. 0.8mm ECW primary (approx. 2 times 1 .5m); 2 x 75 turns. 0.5mm ECW secondary (approx. 2 times 8m)Fl = fuse 5A/T (slow) with PCB mount holder F2 = fuse 1A/T (slow) with PCB mount holder 2 x heatsink type SKI 29 63,5 STS (Fischer/Dau Components) (63.5mm high, 4.5K/W) Mains transformer, secondary 2 x 30V @ 225VA, e.g. Amplimo/Jaytee # 68017 PCB, ref. 050192-1 from The PCBShop * see text 2/2006 - elektor electronics 65 HANDS-ON JACOB'S LADDER Figure 5. This is what can happen if R7 and R8 are too close to the circuit board. are closer to the board, they may cause charring of the PCB (Figure 5). Other types of rectifier diodes may possibly be used, as long as they are pin-com- patible types in TO220 packages and can handle at least 200 V and 7 A. Assembling the cascade boards is quite straightforward (see Figure 6 and Figure 7). A combined ‘shape’ is used on the board for the diodes, so you can use types other than the IXYS type DSA 1-18D that we used (1800 V / 7 A) Besides the relatively common TO220 types, you can also use SMD types in an SMB package, such as the STTH112. We first tried the latter type of diode in a cascade with somewhat smaller capacitor values. However, we found that it gave up the ghost fairly often during our experiments. It’s pos- sible to find diodes that can handle rel- atively high voltages, such as the SM6500 series from VMI, but they are difficult to obtain. During our experiments, it became apparent that the impedance of a cas- cade of ten diode/capacitor pairs is especially high. We thus decided to use 5600-pF capacitors instead of the 1800-pF types we were using up to then. Both types come from the Pana- sonic line of high-voltage ceramic disc capacitors, which are characterised by low losses and are specifically intended to be used in switching appli- cations with high voltages. We select a series with a working voltage of 2 kV in order to avoid any problems from the spikes at the output of the transformer. COMPONENTS LIST Cascade board Capacitors: C1-C20 = 5600pF 2000V, Panasonic (High Voltage Disk Capacitor (Y5P) ECK3D562KBP), Digi-Key # P9574- ND Semiconductors: D1-D20 = DSA 1-1 8D (1800 V/7 A) IXYS, Digi-Key # DSA1-1 8D-ND Miscellaneous: PCB, ref. 050192-2, from The PCBShop Figure 6. The two drcuit boards for the cascade stages are nearly the same. The only difference between the two is that the diodes are oriented in opposite directions. 66 elektor electronics - 2/2006 Alternatives A collection of alternatives is described at http://www.geocities.com/CapeCanaveral/Lab/5322/hv2.html. For example, neon-lamp transformers, microwave oven power supplies and ignition coils can be used for a Jacob's ladder. Besides Jacob's ladder applications, this site describes other high-voltage projects and supplies. An example is making your own high-voltage capacitors (Leiden jars). Several high-voltage projects are also described at www.uoguelph.ca/~antoon/circ/hv/hv.html. The www.teslamania.com/ has spectacular photos and film clips of high-voltage perils. The operation of the 'quarter shrinker' is also described there. That's certainly entertaining reading. Additional designs and photos can be found at www.richieburnett.co.uk/tesla.shtml. That site also gives considerable attention to the theoretical background of generating high voltages. If you still have an appetite for more, have a look at http://tesladownunder.iinet.net.au/index.html. There's also a lot of experimenting going on 'down under'. Besides demonstrating high-voltage applications, this site shows several other remarkable phenomena, such as fer- romagnetic fluids and other magnetic gadgets. illustration courtesy of Resonance Research Corporation, www.resonanceresearch.com The cascade circuits are suitable for use with all values in this product series (ECKA3DxxxKBP). The shape was chosen to match the largest dimension (5600 pF). The lead spacing is 7.5 mm for the smaller values and 10 mm for the larger ones. Of course, the cascade circuits are so simple you might consider building them using point-to-point wiring, but a more robust construction such as this is cer- tainly safer. That’s why we designed a separate circuit board for the cascade stages. We also added the option of extending the cascades: the circuit boards for the same polarity can be connected in series. That means the output voltage can be increased by 10 kV for each board. In that case, inputs a and b (or c and d) must be connected to aa and bb (or cc and dd). The output of each board is bb or dd, respectively. Bear in mind that the no- load voltage per board is a bit more than 10 kV. The high-voltage transformer The most difficult part of building any sort of converter that uses inductive components (or more honestly, the most bothersome part) is winding the coil or transformer if it’s not possible to use ready-made components. In this case, we chose the most difficult option possible by deciding to use a toroidal core. If you want to wind a coil on a toroidal core by hand, you must first calculate the length of wire neces- sary for the required number of wind- ings. Of course, it’s a good idea to take a bit more than necessary. The toroidal core is not the only obsta- cle; the winding method is also diffi- cult. The reason we chose a toroidal core is the high secondary voltage. To make it possible to use standard mate- rial and avoid using expensive high- voltage wire, we decided to wind the secondary in a single layer. That’s the only way to ensure that the voltage between adjacent turns is as low as possible. If we assume that spikes up Figure 7. A fully assembled cascade board. Small, but (highly) dangerous! 2/2006 - elektor electronics 67 HANDS-ON JACOB'S LADDER to nearly 2 kV occur, the voltage between two turns of the secondary winding is only 13 V. In order to have a well-defined voltage between the pri- mary and secondary windings, we wound the secondary with a centre tap that is connected to circuit ground. The secondary winding is wound first, in two stages, which is why two con- nection points for the centre tap are provided in the ground plane. Each turn requires approximately 105 mm of wire. In total, you thus need two 8-m lengths of 0.5-mm enamelled copper wire. It’s not critical to have exactly 75 turns in each half of the winding; a few turns more or less won’t matter. What’s important is to wind the turns patiently and place them tightly together on the core. Be careful to avoid putting a kink in the wire. Make sure that the two ends of the second- ary winding emerge at a certain dis- tance apart so they fit well to the cir- cuit board. The same applies to the two ends for the centre tap. Once the secondary is wound, it must be insulated. You’ll have to buy special insulating film for that. Do not use adhesive tape, electrician’s tape or anything of that sort. The insulation must have a certain mechanical strength and electrical insulation rat- ing, and it must be able to handle a thermal load. The symmetric primary winding is considerably easier to wind. To ensure good symmetry, wind the two wires in parallel (see Figure 8). Two 1.5-m lengths of 0.8-mm enamelled copper wire will be adequate for the primary winding. Start the winding next to the centre tap of the secondary and wind in the direction of one end of the sec- ondary winding. After six turns, cross over to a point on the core at the same distance from the other end of the sec- ondary as where you stopped with the sixth turn. Give the two wires a twist during the crossover so the polarity of the primary winding is correct. Other- wise you’ll create a solid short circuit, because the core will immediately become saturated. Finish the primary by winding the remaining six turns to arrive back at the centre tap of the sec- ondary. The transformer should have a reasonably symmetric appearance. For our first test, we used a core with a diameter of 50 mm and a height of 20 mm, with N30 core material (www.schuricht.de). Unfortunately, it proved to not provide sufficient power, so we glued two cores together using two-component epoxy glue (see the photo of the assembled board). Practical setup Use well-insulated wires to connect the cascade boards to the main board. If necessary, fit them in one or more lengths of electrical wiring conduit. The distance between the two inputs of the two cascade boards does not have to be all that large. Two to three centimetres is more than enough. The distance between the outputs must naturally be larger. The voltage differ- ence just before the arc strikes can be considerably more than 20 kV. As a rule, spontaneous breakdown occurs at around 10 kV/cm. We used a small bench vice with insu- lated jaws to hold the two cascade boards for our experiments. To avoid a hard short-circuit between the cas- cade boards when an arc is struck, we fitted two 1800-fl, 10-W resistors (from the Vishay AC 10 series) in series with the electrodes in our provisional setup. They proved to be especially good at handling the high voltage. To avoid creating secondary breakdown sites, we soldered thin wires in series with them and bent the wires so the solder joints were sufficiently distant from the arc location. That’s because high- voltage breakdowns tend to originate on small or pointed surfaces, even if the distance between them is rela- tively large. A transparent plastic housing is the best choice for maximum safety. That also makes it easy to mount the elec- trodes with adequate insulation. During our tests, we used a Variac to adjust the voltage of the circuit. That made it easy to vary the output volt- age. If you use a normal transformer, we recommend using a switch-on delay circuit, such as the ‘mains on delay circuit’ published on page 74 of the July /August 1997 issue of Elektor Electronics. You can also power the cir- cuit from a ‘normal’ regulated power supply. Of course, the supply must be able to provide 80 V and a couple of amperes, and current limiting is proba- bly desirable to increase the useful life of various things. If you use such a supply, the value of R10 should be increased to 1 kfl or somewhat more, as otherwise the dissipation of R10 will be too high (as will the current through D4). ( 050192 - 1 ) Figure 8. This shows how you should wind the transformer. Although this is version 2.0 of the transformer (as opposed to version 3.0 in the photo of the prototype), the winding method is the same. Legend: © = C4 in the schematic; © = Cl; © = B2; © = A2; © = C2 and C3; © = Bl; © = Al. 68 elektor electronics - 2/2006 LABTALK INFOTAINMENT Karel Wa I raven Newcomers to this magazine quite often send us emails with lots of questions about the compo- nent choice for projects described in the maga- zine. Although photographs of our prototypes provide lots of clues, they can't tell the whole story of how we picked such and such a compo- nent for a specific function. Some additional information is given in this article. Resistor, SFR25 (Vishay BComponents), 0.4W, 250V, 5%, metal film axial. Capacitor (Vishay BComponents), lpF8, 50V, 5%; NPO radial mono-cap ceramic. Capacitor, MKT (Epcos), lOOnF 63V 5% polyester radial Decoupling capacitor (Epcos) lOOnF 50V 10% radial leaded multilayer ceramic X7R. Axial electrolytic capacitor 4pF7 63V. Radial electrolytic capacitor 4pF7 63V. In the parts lists printed with con- struction articles in this maga- zine, most components lack an exact description. That's not only because the application is not particularly demanding in respect of component ratings, but also because we assume that you, the electronics enthusiast, know perfectly well what we mean. However, many less con- fident readers have problems deciding which parameters are tight and which are 'fairly loose'. Resistors We normally use resistors speci- fied at 0.25 watts, 5% tolerance and a maximum working volt- age of 200 volts. Of course, you are free to use better-specified components like metal film resis- tors, 2% or 1% close tolerance, or types rated for 250 V or 300 V. The same for the power dissipation specification; 0.33 watt or 0.5 watt will also fine as long as the relevant com- ponents fit on the board. A specific problem with resistor values comes from the fact that different systems for number notation are used throughout the world. A number of countries on the European Continent use a comma (,) rather than a point (.) for the decimal separator. Because Elektor is read all over the world, we needed to solve the problem and did so by omit- ting the separator altogether, printing the 'k' (for kilo) or 'M' (for mega) in its place. As an added advantage, it improves the general legibility, as a deci- mal point (or comma) may eas- ily disappear with poor printing or on a bad photocopy. So, for the past 30 years or so we've written '4k£27', not 4.7k£2, 4700£2 or 4,700£2. Capacitors These can be subdivided into three classes depending on their value. The first group is formed by radial (single-ended) ceramic capacitors with a value of (almost) zero pF (picofarards) to 1000 pF. If no further indication is given, they have to be able to withstand at least 50 V while the temperature coefficient is not an issue. The typical tolerance in this group is enormous at up to ±20%. The lead pitch is usually 5 mm, although 2.5 mm also occurs in RF circuits. The second group has a value of 1 nF (one nanofarad or 1000 pF) to about 1 (llF (one microfarad). For these we usu- ally employ radial devices with a polyester dielectric and a tol- erance of ±10%. The working voltage is again 50 V. These caps are produced by many dif- ferent manufacturers and are generally uncritical in the appli- cation (unless otherwise noted of course). Our printed circuit boards allow polyester capaci- tors with a lead pitch of 5 mm or 7.5 mm to be fitted. In some case, only 5-mm devices can be accommodated, and this is expressly stated in the parts list. The third group is formed by electrolytic capacitors with val- ues (generally) below 1 juF. Here the tolerances are huge, of the order of -20% to +50%. The working voltage may be any- thing between 3 and a couple of hundred volts. In general, an electrolytic capacitor does not require a higher voltage specifi- cation than the circuit supply volt- age (this incidentally applies to all components). Electrolytic caps come from tens of different sup- pliers, and their electrical prop- erties may show up vast differ- ences. We attempt to design our circuits in such a way that nearly every type of modern electrolytic capacitor can be used. One of the few exceptions are switch- mode power supplies in which massive peak currents and high switching frequencies occur. The high internal resistance of a 'bad' electrolytic in a critical spot in an SMPSU causes ripple on the output voltage. Plus the cap will run very hot, and believe it or not: there exist elec- trolyses with a life expectancy of 1000 hours at 80 degrees C! However, these are exceptions and we will always provide an indication where special param- eters are required. As already mentioned, we spec- ify minimum values, like 10 (llF, 10 V. Your supplier may not have this particular device in stock, offering you ' 1 0 juF 35V', or '10 |aF 63V' instead. Fine alternatives, it would seem, because a higher voltage does no harm. However, do keep an eye on the device size as the alternative may no longer fit the board. Not all manufacturers produce every combination of value and working voltage because it often happens that a 1 0 jliF, 10 V electrolytic cap is just as large (and has the same price) as a 1 0 (nF, 35 V type. When purchasing parts for use in out laboratory we purposely select devices with a relatively large size, so that alternative brands will also fit the board we've designed. With just a few exceptions — duly mentioned in the parts list — electrolytic capac- itors are now radial types. ( 050315 - 1 ) 2/2006 - elektor electronics 69 HANDS-ON VINTAGE Ulf Schneider This 'bulletproof' electronic regulator was originally designed to replace the troublesome original electromechanical regulator on the author's vintage BMW/EMW R35 motorbike. A large number of BMW/EMW devotees have since successfully tested this unit on their machines without problem. The design is universal and should be suitable for all bikes using the same switched-earth field regulation method. The author designed this regulator for his EMW R35-3 motorbike. The bike was built by Eisenacher Motoren Werken (EMW) based upon the pre- war R35 machine from BMW. Produc- tion of the bike continued for many years after 1945. This electronic regulator design uses semiconductor switches instead of the unreliable electromechanical regulator. Vintage purists may dismiss the modi- fication as ‘non original’ but the origi- nal unit was always unreliable and notoriously difficult to set up; adjust the regulator under no load conditions and the battery becomes drained when the machine is driven with the headlight on (which these days is essential). Adjust the regulator under load and the battery ‘boils up’ when the engine is run with the lights off. The electronic regulator goes a long way to solving this problem. The design is suitable for all 6-V dynamos with a rating up to 75 W where the field coils are switched to ground. The regulator draws less than 250 jl/A quiescent current. A potential divider network allows the terminal charging voltage to be adjusted to suit the type of cell fitted to the bike (Table 1). The regulator exhibits a temperature coefficient of approximately -7 mV/ °C which is closely matched to lead-acid battery characteristics. The original A diagram of the original regulator cir- cuit is shown in Figure 1. With the dynamo at rest the reverse-current switch (contacts 4/5) is open and the wiper of the field current switch (2) provides a path to earth for the field winding through contact 1. When the dynamo begins to rotate there is suffi- cient residual magnetism in the field cores to ensure an induced voltage in the rotating armature coils. This volt- age finds a path to earth through the field coil, reinforcing the field magnet- ism and producing a higher output voltage and strengthening the excita- tion field. The armature output voltage increases as the rotational speed increases until it reaches approxi- mately 6.5 V when the reverse-current coil pulls in contacts 4 and 5 connect- ing the dynamo output to the bike electrics including the battery. The out- put voltage continues to rise with increased rotation until the level at the voltage regulator coil is sufficient to pull the field connection contact 2 away from 1 (earth). Current through the field winding can now only travel to earth through the 6 £2 wirewound resistor mounted on the dynamo stator. Current through the field coil drops, reducing the output voltage. With increasing speed, dynamo output con- tinues to rise until the voltage at the regulator coil is sufficient to pull con- 70 elektor electronics - 2/2006 61 51 Figure 1 . The original dynamo circuit. tact 2 all the way up to contact 3, effec- tively shorting out the field winding and reducing the excitation field to a minimum. This process repeats 50 to 250 times per second and regulates the output voltage to around 7 V. The reverse current coil consists of a few turns of thick wire wound (in the oppo- site direction) over the top of the regu- lator coil so that current through the coil reduces the regulator field. At low speed when the dynamo output is less than the battery voltage the field pro- duced by the reverse current pushes open contacts 4 and 5 to prevent the battery discharging into the dynamo. A 2 1 st century alternative Figure 2 shows our contact-less semi- conductor replacement for the pre-war vibrating regulator. A MOSFET is used to switch the field winding to ground instead of the regulator contact. Elec- tronic regulation means that we can dispense with the second regulation stage and 6 Q resistor in series with the field coil. The field current through T1 is controlled by IC1, a micropower comparator type MAX921 which con- tains a voltage reference source (see Figure 3). The comparator is perma- nently connected to the battery via connection 51 of the bikes wiring so it was important to use this IC for mini- mum quiescent current. The lion’s share of this quiescent cur- rent flows through Dl, D2 and the volt- age divider formed by R1 and R2. The zener voltage of D2 (5.1 V approx) together with the voltage drop across Dl (0.6 V approx) should be fairly close to the 6 V battery voltage in order to keep the quiescent current to a mini- mum. With a 6-V battery the quiescent current for the entire circuit is less than 250 jilA, to put this figure in per- spective it is less than the battery’s self discharge current i.e. even with nothing connected, more charge leaks away through internal losses in the battery than this circuit requires. Cur- rent through the voltage divider chain increases proportionally once the dynamo output voltage goes over 7 V. The voltage divider defines the regu- lator’s output charging voltage and the resistor values are chosen so that the output voltage is at the required level when the comparator input volt- age at pin 4 is the same as the refer- ence at pin 3. R4 and R5 define the level of switching hysteresis and ensure that the MOS- FET switches quickly with low losses. D3 and D4 protect the comparator from any voltage spikes induced on the bikes wiring system. Cl introduces a time constant to the voltage sense level and help to reduce electrical noise produced by the com- mutator brushes. It controls the repe- tition rate of the two stage regulator and its value can be changed if the dynamo requires a different switching frequency. D5 is a fast switching flywheel diode used to suppress the back-emf gener- ated across the field coil when T1 switches. The charging current is adjusted dynamically owing to the high induc- tance of the field coil and the flywheel diode action. Diode D6 is a Schottky double diode with very low forward conduction voltage and can comfort- ably handle the generators short cir- cuit output current, it replaces the Figure 2. Circuit diagram of the electronic regulator. 2/2006 - elektor electronics 71 HANDS-ON VINTAGE Figure 3. Block diagram of the MAX92 1 low power comparator. reverse-current actuator in the original regulator circuit. VaristorR6 protects the FET drain con- nection from any high voltage spikes that may be present. The BTS115A TEMPFET has a very low ‘ON’ resist- ance and contains a non destructive device shutdown mechanism when the case gets too hot. Diode D6 can also benefit from this if it is thermally coupled to Tl, for this reason they should be mounted as close together as possible on the heatsink. Excessive heat in D6 will also trigger Tl to shut down and protect the regulator. of a 470 kfl variable resistor, a good quality (low ripple), finely adjustable power supply with an accurate voltage display (or DVM) and an LED together with a series resistor to act as an indi- cator light. During adjustment diode D6 needs to be bridged by connecting a wire link between D + and 51, next connect the LED together with its series resistor between D + and DF (Anode to D+). Connect two leads to the 470 kfl variable resistor, one to the wiper and the other to one end of the track; now solder the other ends of these leads to the pads where Rl.B will be positioned. Figure 4. SMD components ensure a compact PCB. Putting it all together Figure 4 shows the regulator PCB assembly. Lack of space inside the dynamo casing means that some SMD components are needed for the design. Electrolytic capacitors have poor relia- bility at high temperatures so a multi- layer ceramic capacitor is specified for C2. The regulator will spend its life in a reasonably hostile environment so it is a good idea to protect it as much as possible from the ingress of oil/water and general highway crud by ‘potting’ it inside an insulating casting. How- ever before we get to this stage it is necessary to do a bit of tweaking on the test bench. The two resistors Rl.A and Rl.B are connected in parallel in the circuit. The value of Rl.A is speci- fied as 6.8 kfl while Rl.B needs to be determined empirically with the help The power supply should be connected between 51 and earth of the regulator connections. Adjust the output voltage according to the type of battery which will eventually be fitted (see Table 1). If the bike isn’t used regularly you can afford to increase this voltage level by 100 mV without harming the battery, alternatively if it’s in regular use the level can be decreased by around 100 mV. With this regulator the output voltage is still not completely inde- pendent of load but it is hugely improved compared to the original unit. Rotate the variable resistor until the LED comes on then back off until it just goes out. The variable resistor is now set to the value necessary for Rl.B so carefully remove its leads from the PCB and measure its value. Choose a resistor from the E24 or E48 series of resistors closest to the measured value and fit to ! COMPONENTS LIST ! Resistors: (SMD case 1 206) R1 = 6kD8 (see text) R2,R5 = 4kD7 R3 = 1 00D R4 = 1 MD5 R6 = S05K20 (varistor) Capacitors: (SMD case 1 206) Cl = 4nF7 C2 = 3[jF 3 (ceramic multilayer) Semiconductors: D1 = LL4148 D2,D3 = zener diode 5V1 (SMD) D4 = zener diode 9V1 (SMD) D5 = EGP50D D6 = BYV32E-1 00 Tl = BTS1 1 5 A IC1 = MAX291 PCB, ref. 050241-1 from The PCB Shop Figure 5. The author's prototype fitted to the R35 dynamo mounting plate. 72 elektor electronics - 2/2006 Table 1 Recommended charging voltage Cell Type Fully charged ter- minal voltage (V) Gel lead-acid 7.25 Wet lead-acid 7.35 Wet NiCd 7.40 position Rl.B on the PCB. Once you are satisfied that the unit is working correctly the complete PCB can be fitted to a suitable dynamo mounting plate and encapsulated in potting compound; the authors fin- ished regulator is shown in Figure 5. It is advisable to thoroughly check the dynamo before the unit is fitted and ensure that the earth lead is first dis- connected before the unit is wired up, not forgetting to reconnect once every- thing is in position. The electronic unit will not work with a deeply dis- charged battery or with no battery fit- ted to the bike but apart from this restriction the regulator should pro- vide many thousands of miles of reli- able operation, keeping the battery healthily charged and thanks to the improved lighting, giving a much clearer view of the road ahead! (050241-1) Advertisement I * | ( Mir AL3A M& J I M i Ji 4- JAm 41 F*F^ fl f » if “ HlfW W !!• ••>' t‘ f.li >uu# fj vi* m ■ j 41 -*.>-** _ l **- s ™ Hi * 6 i '"ftp lifl tn /wm > i i LfMrt-unp in* m k < ■nmrmmm ilf fc w ^ ri i • * ijjjn# if -i?Ti j, AMI ik . ' hr * 9 Tl IlHMf "Th MM If *i to mA ko#, ~ ■ > ■» #tfi — 4 i i i t j -«N mi *rf J*- Mam to Bto fttft CHiHb mmk fr-wmr- k .1 I n ■. r/# '»’ v \ + S m a* « Tel: 01 635 40347 nnhvt ud fu: QllnHlU r jr^wp r dm^ Mb Mil &n c-nuU: cnEiKl:CnniFtyjYlc«n.ta.irt. DncLDA.uk: Servicing Your Complete P rdtdtvpe Needs 4 ) Tc , .:i | vii 7 -b'/iL . * 1 Sdfevj mtfutiftf V Anycpnrwir n Ff 4 !. 6 mL 35 ym&f o Paasw l^s aisfftff /t#ts 0 CAW / CAD cofisuftiog EUftOCARQ a m ■ + Tooting + ptfmpim + WIT A Ah ' AJ MU . 1 AH IA 1 tmr rjy iTiy.r,^j.'#4 IJM .PC8-POOl.COM '&cirH-irlCR.: TTM s-iidnn^ 2/2006 - elektor electronics 73 HANDS-ON DESIGN TIPS Automatic Gain Control (or DRM Receiver Burkhard Kainkar A DRM receiver typically supplies an intermediate frequency (IF) out- put signal of 12 kHz to the PC soundcard. Demodulation is han- dled by software running on the PC, taking into account that large signal level differences may occur. Using an AGC (automatic gain control) circuit we achieve the best possible signal level applied to the sound card under all receive conditions. Particularly with extreme fieldstrength varia- tions (due to fading etc.), an AGC guarantees fewer hiccups in the decoding process. The DRT1 receiver from Sat Schneider (www.sat-schneider.de) already has an input for gain control. Using the VGCJN terminal on the receiver, the gain may be con- trolled with a slope of 25 dB/V. With the Elektor Electronics DRM receiver, AGC is also fairly easy to install as an upgrade, see the rel- evant Design Tip. A control amplifier for DRM needs to comply with some spe- cial requirements to make sure the signal is not corrupted. Fast level changes in particular must be avoided. The circuit pre- sented here accepts the 1 2-kHz IF signal from the DRM receiver and turns it into a control volt- age. The first stage is a half- wave rectifier. At first blush it would appear that a diode is missing. The rectifier operates as an amplifier with output signal range limiting. Positive half cycles are amplified about 10 times. At the negative half cycles, however, the output volt- age is zero because the LM358 operates from a single 5-V sup- ply rail, hence cannot supply drive in the negative range. The upshot is that we have a very basic half-wave rectifier that's not hindered by any threshold voltage as usual from diodes. The rectifier output signal is applied to an inverting integra- tor. An average direct voltage exceeding 0.5 V at the input causes a falling voltage at the integrator output; a smaller volt- age, a rising output voltage. The complete regulation loop consist- ing of the gain control in the DRM receiver and the gain-con- trolled amplifier regulates the receiver output voltage to a con- stant level of about 1 00 mV. The governing factor is the control loop time constant that prevents abrupt level changes. The circuit is not only useful with DRM reception — AM and SSB modes will also benefit from it. In connection with the DRT1 , the gain span is about 115 dB, ensuring that the optimum gain is available at all times. ( 050235 - 1 ) FBI siren with flashing light Arthur Schilp This ultra-simple circuit will pro- duce the familiar sound of sirens used by US police cars on emer- gency calls. A small lamp will also flash syn- chronously with the siren sound. The circuit is capable of pow- ering loads greater than 1 A for one or more lamps or a pow- erful loud- speaker, the kit producing quite a bit of noise and light. The circuit is built from two astable multivi- brators, in this case the familiar 555 of which two are present in an NE556 case. Of course, you are free to use two 555s if that suits you better. Both timer ICs are configured to operate as astable multivibrators. The first timer is configured with R1 , R2 and C2 to supply a rec- tangular signal of about 2 Hz at pin 9. The lamp is switched on and off by way of power transis- tor T1 . The second 555 is config- ured using R4, R5 and C 5, and supplies a square wave at pin 5 that drives the loudspeaker. The toggling voltage at the output of the first timer (pin 9) causes elec- trolytic capacitor C3 to be partly charged and dis- charged, periodically, via resistor R3. C3 is connected to the con- trol input of the sec- ond timer (pin 3), causing it to work as a VCO (voltage con- trolled amplifier). The upshot is that the fre- quency of the square wave applied to the loudspeaker rises and falls periodically, ren- dering a good imita- tion of the wailing sound of the US police car siren (we hear too often in movies). The small number of dead-standard compo- nents used enables this circuit to be built on Veroboard without problems. ( 050349 - 1 ) +4V...+12V 74 elektor electronics - 2/2006 Parallel resistor calculations Ton Giesberts This design tip describes a simple equation to compose a desired resistance from two parallel con- nected resistors. The formula for parallel connec- tion of two resistors may be found in any electronics textbook and reads: R eq = R] R2/ ( R 1 + R2) In many cases, a theoretical value required in a circuit will deviate somewhat from off the shelf val- ues in the E-series. In analogue fil- ters, for example, maintaining the exact value is a must and even an E96 value is usually too inaccu- rate. The obvious solution to the problem is then to take the next higher E96 value and connect a high value in parallel in order to arrive at the computed value. In those cases you know the desired value as well as the nearest E96 value. A formula similar to the one above may then be used to calculate the required parallel resistor, where R is the desired value; Rp is the E-series value (e.g. E96, but equally El 2 or E24); Rp is the unknown resistance. From the above basic formula we can derive R = Rp. Rp / (/?£ + Rp) Rp Rp = Rp R + Rp R Rp. Rp — Rp R = R e R So, we get for Rp: R P = R E R/ (R e - R) where Rp > R. This equation should be easy to remember as it looks very much like the textbook version for par- allel resistances. Of course there are programs to calculate all pos- sible combinations, but using a simple desktop calculator is often quicker and more convenient. When the second resistor becomes too large, for example, larger than 1 M£2 or 1 0 M£2, you may decide to take a slightly higher value as a starting pint for the E series calculation. Parallel connection of resistors i.e. pre- ferred over series connection in the case of modifications to an existing circuit or PCB layout, as it is usually easier to connect a parallel resistor. The added resistor Rp does not have to be a close tolerance type as it has less influence on the equivalent value. In most cases a 5% tolerance type will be more than adequate. ( 050381 - 1 ) Gain control for Elektor DRM receiver LED LDR LED1, LED2, LED3 = low current, red LDR1, LDR2 = Ik ... 40k 050359 -11 Burkhard Kainka Adding automatic gain control (AGC) to the Elektor Electronics DRM Receiver (March 2004) is a useful undertaking. The original receiver was designed to have fixed gain for the strongest sig- nals, with some headroom afforded by the large dynamic range of the sound card. Admit- tedly weaker signals we would like to boost a little, if only that were possible. A gain control add-on would be desirable, provided its addition does not compromise the linearity of the receiver. The extension pro- posed here employs a home- made optocoupler consisting of a superbright red LED and an LDR. The construction of the coupler in an aluminium tube (Figure 1) was taken from the Photoelectrical Oscillator (PEO), a 'Rejektor' cir- cuit shown in Mailbox, Elektor January 2006, on page 8. The governing advantage of this LDR/LED combination is the pure ohmic resistance of the LDR, which guarantees low distortion. In the DRM receiver, the LDR/LED assembly is inserted into the feed- back path of the 1 2-kHz amplifier as shown in the circuit detail in Figure 2. The drive signal comes from a circuit contained in the box marked 'AGC', this is an AGC amplifier copied from another Design Tip, 'Automatic Gain Con- trol for Elektor DRM Receiver'. This sub-circuit was originally devel- oped for the DRT1 receiver. Here, its output voltage (0-4 V) controls the LED brightness. The dashed lines denote the connections between the existing Elektor DRM receiver and the add-on circuit for automatic gain control. Depending on the degree of illumi- nation by the LED, the LDR resist- ance will vary between about 1 k£2 and 1 M£2. The feedback network in the receiver fixes the gain at about 9 times. At an LDR resistance of 1 k£2, the gain rises to about 220 times. This system provides a gain range of 27 dB. That's just about right for this receiver, raising the sensitivity without the risk of overloading by stronger signals. The AGC improves the perform- ance of the Elektor DRM Receiver in respect of weaker signals. Adding it is worthwhile in almost all cases, but even more so if the receiver is used to listen to ana- logue (AM) broadcasts. For that application, we found Peter Carnegie's 'G88JCFSDR' pro- gram (www.g8jcf.dyndns.org) very useful. This 'software defined radio' excels in filters with adjustable bandwidth, software AGC, S-meter, spectrum readout and various demodulators, all of which provide great enhance- ments to the receiver. ( 050395 - 1 ) +5V 2/2006 - elektor electronics 75 HANDS-ON DESIGN TIPS Digital sinewave reference generator +5V Martin Ossmann When it comes to testing and measuring audio circuitry, a very clean and stable 1-kHz signal is often required. The Wien Bridge has been the preferred circuit con- figuration for many years. In the digital age however there are alternative means available. A low-cost microcontroller drives a D/A converter, whose output sig- nal is filtered using a bandpass in order to suppress alias frequen- cies. This setup guarantees an output signal that's spectrally pure as well as stable in respect of amplitude and frequency — everything you would like to have for spot-frequency measurements. Figure 1 shows the way the above concept has been turned into a practical circuit. The 1 6-bit D/A converter is remarkably cheap at less than 80 p from Reichelt, Germany, which helps to keep the cost of the circuit as low as possible. Microcontroller IC1 generates 74 samples in l 2 S format in every 1-kHz period. This creates a sampling rate of 74 kHz — much higher than your average CD player. The two cur- rent outputs of the DAC IC2 have been connected in parallel to maximize the signal-to-noise ratio. The first opamp of the TL062 acts as a current-to-voltage converter. The second opamp is configured as a bandpass element. Preset PI is used to adjust the circuit for maximum output voltage. The measured spectrum is shown in Figure 2. The first and second harmonics are more than 80 dB down with respect to the 1-kHz signal. The alias frequencies around 74 kHz are suppressed to the extent that it's difficult to prove their existence. The circuit is quickly built on a piece of Veroboard (Figure 3). In order to prevent ground loops, it is recommended to power the circuit from a set of (recharge- able) batteries. Here, four NiMH batteries are used. In conclusion, the simple battery- powered 1-kHz generator described here can be built for less than three pounds. It is free from complex adjustments, preci- sion capacitors and inductors. The software to program into the microcontroller is available as a Free Download from www.elek- tor-electronics. co.uk; the file num- ber is 050353-1 1 .zip. ( 050353 - 1 ) Note . Although the AT90S1200 is no longer produced by Atmel, it is still widely available from retail outlets like Reichelt, Segor and Sander. A successor type is available, see Atmel's application note no. AVR093: 'Replacing AT90SI 200 by ATtiny2313'. 76 elektor electronics - 2/2006 RETRONICS INFOTAINMENT Jan Buiting Magnetism lies at the root of elec- tricity which in turn is at the root of (nearly) all electronics. The sub- ject of this month's instalment of Retronics is a small brownish suit- case which, when first opened (Figure 1), took me back instantly to physics classes about 30 years ago, in particular those aimed at teaching me the princi- ples of electricity and magnetism. The suitcase was shown to me by a retired classroom assistant who had kept it in safe storage for more years that he could remember. In fact, he had two of these suitcases, one incomplete, the other, complete, unused and in pristine condition as shown here. The 'Electricity and Mag- netism Demonstration Set for Physics Classes" (Fig- ure 2) contains two large coils (one with a lamp fit- ting on it); a centre-zero moving coil meter, its nee- dle so large it can easily be read it from the back of the classroom; a magnetic rod with North and South poles; a sheet of hard plastic; a slab of soft iron, a 6-V lamp; a 4.5 V bat- tery, an assortment of resistance wire; test tubes containing iron powder and (I think) copper fil- ings; an adapter/holder for the resistance wire; a mains cord and last but not least a copiously illus- trated teacher's manual. The suit- cases and the components inside are hand made to very high stan- dards, with metal clamps and pieces of wood carefully secured at critical places inside to prevent damage to the highly prized con- tents. The meter and coils have a bright green lacquer finish imme- diately recognised as 'techie'. Without any attempt at exhaus- tiveness, I will describe a couple of experiments that can be per- formed by the physics teacher and/or his assistant in front of a classroom full of (hopefully) atten- tive pupils. Figure 3 shows the most elementary setup described in the manual. When the magnet rotates through the coil with the thinner wire on it, alternating cur- rent is indicated by the meter nee- dle swinging to and fro. Yes Mike it's AC (alternating current), "which nobody con deny". DC, then, is proven beyond reason- able doubt by connecting the meter to the battery and reversing the + and - connections. The coil with the thicker wire can be stacked on top of the other one, the 6-V lamp screwed into its socket, the mains cord plugged into the socket on the lower coil and... nothing happens! That is, until you insert the iron slab verti- cally into the coil openings and hey presto the lamp lights. You've actually built a transformer con- sisting of a primary (thin wire), a secondary (thick wire), and mag- netic coupling, stepping down the 230 V mains voltage to a safe level. The lamp inten- sity can be varied by verti- cally moving the iron slab in the coil openings. Next up you can replace the lamp by a length of resist- ance wire secured between the arms of special Perspex adapter and watch the thin- ner wire burn out — an odd smell and there's your basic fuse. These suitcases reportedly were made between 1 960 and 1965 and the one that's complete and in new condition must be priceless. Maybe one day it will make it to Floglt! —I (065008-1) 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-electronics.co.uk, subject: Retronics EE. 2/2006 - elektor electronics 77 This Issue: BRUSHLESS MOTORS in practice Next Issue: FREE BOOKLET Short Course C for Microcontrollers Select your own annual subscription and receive a free 1 W Luxeon LED Torchlight Available options • Elektor Electronics annual subscription (standard) You receive 1 1 issues, including the July/August double issue. • Elektor Electronics annual subscription-PLUS You receive 1 1 issues, including the July/August double issue, plus a copy of the Elektor Electronics Volume 2005 CD-ROM (normal price £16.25). Your saving: approx. £10.00! Please fill out the Order Form with this issue. Subscription rates and conditions may be found at the back of this issue. PUZZLE INFOTAINMENT Hexadoku Puzzle with an electronic touch Judging from the large number of correct solutions we received by email and regular post our new Hexadoku puzzle launched in last Janu- ary's issue has met with great interest. The puzzle also appears to be well liked by family members and friends of the electronics fans buying Elektor or subscribing to it, probably because of the extra challenge posed by the hexadecimal number series. Entering the competition Please send the numbers in the grey boxes by email, fax or post to Elektor Electronics Hexadoku Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom. Fax (+44) (0)208 2614447 Email: editor@elektor-electronics.co.uk Subject: hexadoku 02-2006. The closing date is 1 March 2006. Competition not open to employees of Segment b.v., its business partners and/or associated publishing houses. E 2 3 D 8 A 6 3 4 2 5 A 9 6 F 7 B 8 7 6 D 9 1 4 F 3 5 C F 1 A 7 2 4 9 D F 8 5 D B A C 0 9 7 5 4 C E B 6 B 8 0 D 5 3 7 A 6 F F A 8 E 4 9 D 2 6 5 E 4 A C 3 7 2 0 9 5 C B 3 E 7 6 8 1 8 F 7 D C 9 5 A D C E 2 6 8 B 3 0 3 7 0 F E 4 E 8 9 3 A 5 C D 4 C 5 A Solve Hexadoku and win! Correct solutions qualify for an E-blocks Starter Kit Professional worth £248.55 and three Elektor Electronics Shop Vouchers worth £35 each. We believe these prizes should encourage all our readers to participate! Elektor's new brainteaser for the electronics enthusiast and keen reader of the magazine appeared to be fairly difficult to solve. Many readers report having spent quite a few hours completing the thing, and were happy to rise to the challenge. The instructions for the puzzle are straightforward. In the diagram composed of 1 6x1 6 boxes, enter numbers in such a way that all hexadecimal numbers 0 through F (that's 0- 9 and A-F) occur once in every row, once in every col- umn, and in every one of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puz- zle and these determine the start situation. Your solution may win a prize and requires only the num- bers in the grey boxes to be sent to us (see below). The puzzle is also available as a free download from our website (Magazine — » 2006 — > February). ( 065043 - 1 ) 2/2006 - elektor electronics 79 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. (0) 1 932 564999 Fax 0044 (0) 1 932 564998 ALLGOOD TECHNOLOGY www.allgoodtechnology.com Low-medium volume sub-contract assembly. SMT specialist since 1990. Customers include military, aerospace etc. 0402 to BGA capabilities, automatic assembly and hand built prototypes. ATC SEMITEC LTD www.atcsemitec.co.uk 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: 0870 901 0777 Fax: 0870 901 0888 DESIGN GATEWAY www.design-gateway.com PalmLogic II .... US$ 399.00 • Compact Logic Analyzer (L1 1 6mm x W73.3mm x T3mm) • High sampling rate (400 MHz/ 8ch, 200 MHz/1 6ch, 100 MHz/32ch) • USB 2.0 high speed mode • 8MB memory storage L * • Bus Analyzer function • Multiple waveform windows • Waveform save/restore DESIGN GATEWAY www.design-gateway.com True PCI Starter Kit .... US$135.00 • PCI Development Kit • Based on 200,000 gates FPGA • Extension connectors for 72 pin I/O • Configuration support for JTAG and slave serial • Free PCI Core for Target Mode TRUE pet DESIGN GATEWAY www.design-gateway.com Ethernet 10 .... US$115.00 • 8 bits embedded network microcontroller • 6 channels available for 10 bits ADC • Ethernet 1 0 BASE T 1 0 Mb &tt • UART port RS232/RS485, Max Speed atl 1 5200bps • 35 bits general purpose I/O • 500 bytes user area flash memory DESIGN GATEWAY www.design-gateway.com VariClock... US$163.00 • Adjustable clock signal synthesizer • 3 rotary switches for frequency setting • Standard DIP pin arrangement • Support both 3V/5V by on-board regulator VC250M14P Frequency range : 25-400 MHz Frequency setting : 1 MHz step VC100M14P Frequency range : 25-100 MHz Frequency setting : 1 00 kHz step for 25- 50 MHz : 200 kHz step for more than 50 MHz £ = 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. Only £29.99 inc vat. 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. BURN TECHNOLOGY LTD http ://www. b u rntec . co m Test & Measurement Equipment Distributors • Anemometers • Clamp Meters • Light Meters • LCR Meters • Sound Meters • Multimeters • Device Programmers Burn Technology Limited, Winfrith Technology Centre, Dorchester, Dorset, DT2 8DH Tel: (01305) 852090 Fax: (01929) 463214 COMPUCUT http://www.compucutters.com Computer Numerical Control from your home PC. Great for tricky jobs, and accurate repetitive work. We supply: - Software - Interface - Manual - Support Price £250 plus postage. COMPULOGIC LTD www.compulogic.co.uk Internet Remote Control Starter Kit £139.99 Create a simple web based remote c interface for many applications • Miniature Web Server Module • Analogue/Digital Module •PSU • Manuals, software, example HTML CONFORD ELECTRONICS http://www.confordelec.co.uk Lightweight portable battery/mains audio units offering the highest technical performance. Microphone, Phantom Power and Headphone Amplifiers. Balanced/unbalanced signal lines with extensive RFI protection. DANBURY ELECTRONICS http://www.livinginthepast.demon.co.uk Here you will find our mains and output transformers in Mike Holme’s range of valve/tube amplifiers (PP & SE). Also circuits, parts lists, chassis, advice. EAGLEPICS http://www.eaglepics.co.uk Embedded Internet Solutions • Stand alone TCP/IP module • Platform independent • Simple "AT-like" command • GPRS or modem connection • E-Mail, FTP, HTTP, UDP • Development board available • Free development utilities • Free UDP-only stack 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 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 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 FUTURLEC http://www.futurlec.com Save up to 60% on • Electronic Components • Microcontrollers, PIC, Atmel • Development Boards, Programmers Huge range of products available on-line for immediate delivery, at very competitive prices. IPEVA LIMITED http://www.ipeva.com IPEVA sell low cost USB FPGA development boards. IPEVA provide Design Consultancy for Embedded Systems, OpenCores-IP, FPGA, ASIC, HDL translation and migration. Tel. 0870 080 2340. 80 elektor electronics - 2/2006 products and services directory JLB ELECTRONICS www.jlbelectronics.com Suppliers of electrical / electronic parts and consumables. Including: • Cable ties / bases • Tools / hardware • Bootlace ferrules • Connectors • Solvent sprays & cleaners • PVC Tape • Heat Sink compound KMK TECHNOLOGIES Ltd. http://www.kmk.com.hk Low Cost DIY Robotic Kits and Computer Controller Boards. 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 Advanced Qualifications). Also Technical Management and Languages. MQP ELECTRONICS http://www.mqpelectronics.co.uk Leaders in Device Programming Solutions. • Online shop • Low Cost Adapters for all Programmers • Single Site and Gang Programmers • Support for virtually any Programmable Device NEW WAVE CONCEPTS www.new-wave-concepts.com Software for hobbyists: • Livewire circuit simulation software, only £34.99 • PCB Wizard circuit design software, only £34.99 Available from all Maplin Electronics stores and www.maplin.co.uk. OLD COLONY SOUND LAB www.audioXpress.com Premier source for DIY audio for 35 years! New catalog features: • Books •CDs •Test & Measurement • Kits Full range of products and magazines for the DIY audio enthusiast! PCB WORLD http://www.pcbworld.org.uk World-class site: Your magazine project or prototype PCB from the artwork of your choice for less. Call Lee on 07946 846159 for details. Prompt service. ULTRALEDS iUJ traJ eefe*** http://www.ultraleds.co.u!^^^ tel: 0871 7110413 Large range of low cost Ultra bright leds and Led related lighting products. Major credit cards taken online with same day depatch. 1 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 adress 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! 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 QUASAR ELECTRONICS www.QuasarElectronics.com Over 300 electronic kits, projects and ready built units for hobby, education and industrial applications including PIC/ATMEL programming solutions. Online ordering facilities. Tel: +44 (0) 870 246 1826 Fax: +44 (0) 870 460 1 045 Email: sales@QuasarElectronics.com QUASAR ttlaelrtiftici ROBOT ELECTRONICS http://www.robot-electronics.c o.uk • Ultrasonic rangefinders • Motor H-Bridge controllers • Magnetic Compasses • RC servos and controllers • PIC programmers and components • Electronic Design/Development and Manufacturer to industry SK PANG ELECTRONICS http://www.skpang.co.uk • ELM OBDII 1C • VAG-COM Interface • OBDII connector and cable • Modtronix Micro X board • Embedded Ethernet Controller • PIC Microcontroller, CAN Bus driver Major credit cards taken online. SYTRONIC TECHNOLOGY LTD www.m2mtelemetry.com Supplier of wireless modules and accessories for remote monitoring M2M applications. •GSM/GPRS TCP/IP modules • Embedded GSM/GPRS modem • Development Kits • GPS modules ± . • GSM/GPS antennas 1 • Adapter cables Online ordering facilities. Tel (01 394) 210911 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 for electronics enthusiasts, students, professionals and scientists, including sound card real time oscilloscope, spectrum analyzer, and signal generator. Free to download and try. ELECTRONIC ENTHUSIASTS Only one magazine tests its projects and circuits in its own lab before publication ELEKTOR ELECTRONICS THE ELECTRONICS & COMPUTER MAGAZINE Contact: Worldwide Subscription Service Ltd, Unit 4 Gibbs Reed Farm, Pashley Road, Ticehurst TIMS 7HE Telephone: 01580 200657 Fax: 01580 200616 www.elektor-electronics.co.uk 2/2006 - elektor electronics 81 lektor Order o www.elektor-el Order now using the Order Form in the Readers Services section in this issue. CD-ROM ECD Edition 3 Elektor’s Components Database gives you easy access to design data for over 5,000 ICs, more than 35,000 transistors, FETs, thyristors and triacs, just under 25,000 diodes and 1 ,800 optocouplers. All databank applications are fully interactive, allowing the user to add, edit and complete component data. £12.95 (US$ 22.90) Robotics A large collection of data- sheets, software tools, tips, tricks and Internet links to assorted robot constructions and general technical infor- mation. All aspects of modern robotics are covered, from sensors to motors, mechanical parts to microcontrollers, not forgetting matching programming tools and libraries for signal processing. £12.05 (US$ 21.25) Audio Collection 2 A unique CD-ROM for the true audio lover, containing no fewer than 75 audio designs from the past five year volumes of Elektor Electronics magazine. The articles on the CD-ROM cover test & measurement equipment, amplifiers, digital audio and loudspeaker technology. Highlights include the Crescendo Millennium Edition, Audio-DAC 2000, Audio-ADC 2000 and the I R-S/PDIF Transmitter and Receiver. Using the included Acrobat Reader you are able to browse the articles on your computer, as well as print texts, circuit diagrams and PCB layouts. £12.05 (US$ 21.25) More information on www.elektor-electronics.co.uk Handbook for sound technicians This book contains chapters on basic theory; microphones and musical instruments; various types of amplifier; loudspeakers; effects equipment; recording techniques; lighting equipment; the rehearsal room; and faultfinding and small repairs. It also contains a useful glossary of terms used in sound engineering and a list of adjectives describing sound colouring. PC-Interfaces under Windows PC Interfaces can be used for more than just the printer, mouse, modem and joy-stick! While it was relatively easy to directly access PC interfaces using a DOS com-puter, under Windows things are not all that simple. This book (CD-ROM incl.) shows you how it can be done. The authors describe the DIY construction and programming of a number of highly interesting circuits. ISBN 0-905705-65-3 265 pages £25.95 (US$ 22.90) PC Window j ISBN 0-905705-65-3 265 pages £25.95 (US$ 22.90) BESTSELLING BOOKS =1 Mkrocontbolur Basks Top-5 Microcontroller Basics ISBN 0-905705-67-X £18.70 (US$ 33.70) PC-Interfaces under Windows ISBN 0-905705-65-3 £25.95 (US$ 22.90) 308 Circuits ISBN 0-905705-66-1 £18.20 (US$ 37.00) Modern High-end Valve Amplifiers ISBN 0-905705-63-7 £25.95 (US$ 52.00) Handbook for sound technicians ISBN 0-905705-65-3 £25.95 (US$ 22.90) More information on www.elektor-electronics.co.uk nline at ectronics.co.uk Due to practical constraints, final illustrations and specifications may differ from published designs. Prices subject to change. See www.elektor-electronics.co.uk for up to date information. ESR/C Meter Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 (0) 208 261 4509 Fax: +44 (0) 208 261 4447 Email: sales@elektor-electronics.co.uk Kits & Modules (September 2005) Kit of parts including PCB, default LCD module, 2x16 characters and programmed controllers. Enclosure not included. 040259-71 £63.99/$ 119.95 Matching enclosing 040259-72 £6.99/$ 12.95 OBD-2 Analyser (July/August 2005) Kit of parts including PCB, programmed controller, compo- nents (including IC7 ; IC3 = PCA82C250, 12 V), enclosure and RS232 cable. OBD cable not included. 050092-71 £52 .50/ $96.95 OBD cable 050092-72 £27.55/ $51 .95 Ready-built PCB (excl. enclosure) 050008-91 £ 50.00 / $ 94.25 Matching enclosure 050008-71 £ 10.25/$ 19.30 Electrosmog Tester (June 2005) Complete kit (not inclu- ding IC3) with Lassen iQ-receiver and extra long cable, CD with software and water- proof antenna case. 040264-71 £77.65/$ 146.25 GPS Receiver on USB (June 2005) Further products from Elektor Electronics: 34-50 55.70 READY-BUILT PROJECTS ClariTy 300-W Class-T Amplifier 030217-91 Amplifier board with SMDs pre-fitted; cores for LI & L2 Flash Microcontroller Starter Kit 010208-91 ready-assembled PCB incl. software, cable, adapter & related articles 69-00 112.50 Gameboy Digital Sampling Oscilloscope (GBDSO) 990082-91 ready-assembled board, incl. the PC software and related articles 103-00 183.00 Micro Webserver with MSC1210 Board 030060-91 Microprocessor Board, ready-assembled 044026-91 Network Extension Board, ready-assembled 044026-92 Combined package (030060-91 & 044026-91 & related articles) LPC210x ARMee Development System 040444-91 Processor board, ready-made and tested NO. 351 FEBRUARY 2006 Brushless Motor Controller 050157-41 ST7MC1, programmed A 1 6-bit Tom Thumb 050179-91 R8C Starter Kit fc'Tilil NO. 350 JANUARY 95-watt Laptop PSU Adaptor 050029-1 PCB Automatic Attic Window Controller 0501 39-1 1 Disk, PIC source & hex code 050139-41 PIC1 6F84A-20I/P, programmed 030451-72 LCD Modue 2x16 characters 030451-73 PLED Module 2x16 characters SMD Reflow Soldering Oven 050319-1 1 Disk, source and hex code 050319-41 AT89C52/24JI, programmed 030451-72 LCD Modue 2x16 characters 030451-73 PLED Module 2x16 characters Timer Switch for Washing Machine 050058-1 PCB 75-90 142.95 44-50 83.95 117-50 220.95 25-50 48.05 3-80 7.15 8.30 15.60 4-80 9.05 5-20 9.75 13-10 24.65 7-25 13.65 25-50 48.05 5-20 9.75 7-60 14.25 7-25 13.65 25-50 48.05 8-90 16.70 050058-1 1 Disk, PIC source & hex code 5-20 9.75 050058-41 PIC16F84, programmed 13-10 24.65 NO. 349 DECEMBER 2005 From A to D via USB 050222-1 PCB 7-95 14.95 050222-41 IOW24-P, programmed 9-40 17.75 Telephone Supervisor 050039-41 PIC1 6F628-20/P, programmed 8-20 15.55 050039-81 CD-ROM, PIC hex & source codes, LCM First Server 6-90 12.95 NO. 348 NOVEMBER 2005 Remote Control by Mobile Phone 040415-1 PCB 6-20 11.65 04041 5-1 1 Disk, PIC source & hex files 5-20 9.75 040415-41 PIC16F84A-20/P, programmed 10-30 19.50 Synchronous Servos 020031-1 1 Disk, project software 5-20 9.75 020031-41 AT90S2313-10PC, programmed 7-85 14.85 NO. 347 OCTOBER 2005 27C512 Emulator 030444-1 1 Disk, project software 5-20 9.75 030444-31 EPM7064SLC84-15, programmed 27-50 51.95 030444-41 AT90S8515-4PC, programmed 15-10 28.35 Colossus Jr. 040267-11 Disk, PIC source code 5-20 9.75 040267-41 PIC1 2F675-C/P, programmed 4-10 5.35 Flash Lock for PCs 050107-41 PIC1 6F628A-I/SO, programmed 5-00 9.45 050107-81 CD-ROM, project software 6-90 12.95 Products for older projects (if available) may be found on our website www.elektor-electronics.co.uk home construction = fun and added value INFO & MARKET SNEAK PREVIEW C Programming Mini Course Many electronics enthusiast have not only embraced microcontrollers but also written the odd program. Although assembly code is great for rela- tively short programs, when it comes to large software projects or sub- programs involving maths and other advanced functions, it is often bet- ter to turn to a higher programming language like C, which has been the industry standard for a number of years already. The March 2006 issue of Elektor Electronics comes with a free booklet that teaches you the basic elements of programming in C, including a few noteworthy examples for our low-cost R8C microcontroller board. Theme Plan for 2006 January Recycling / Reverse Engineering February Motors / Propulsion March Development / Microcontrollers April . .Power Supplies / Safety May . .Soldering / Etching June . .Satellites July/ August . . .Summer Circuits September . . . .Esoterics / Test & Measurement October .... . .e-Simulation November . . . .Chipcards / Protection December . . . .Electromechanical / Enclosures Application Board for R8C The R8C/1 3 module used for the initial experiments in this issue may be small but it has a lot of potential. However, this can only be unleashed if you have a motherboard that opens up the full connectivity of the micro board. The R8C Application Board described in the March 2006 issue offers two serial ports, a USB connector, a connector for an LCD module, a stabilised power supply, an array of LEDs and last but not least a handy prototyping area. Also... FPGA basics; Microcontroller Development Kits; E-blocks; Hexadoku Puzzle. Versatile FPGA Unit Lots of digital circuits may be replaced in one go by an FPGA. Doing so not only saves board space, but also yields a speed increase when compared to discrete logic parts. Unfortunately, FPGAs are only available in SMD cases that are impossi- ble to solder by hand (especially BGAs). That is why Elektor labs have developed a multilayer FPGA unit that's supplied ready-built and tested to you. The module has a powerful FPGA sporting lots of RAM and flash memory. RESERVE YOUR COPY NOW! The March 2006 issue goes on sale on Thursday 16 February 2006 (UK distribution only). UK subscribers will receive tbe magazine a few days before this date. Article titles and magazine contents subject to change. NEWSAGENTS ORDER FORM SHOP SAVE / HOME DELIVERY Please save / deliver one copy of Elektor Electronics magazine for me each month Name: Address: Post code: Telephone: Date: Signature: lektor lectronics lea-ding the w a y Please cut out or photocopy this form, com- plete details and hand to your newsagent. Elektor Electronics is published on the third Friday of each month, except in July. Distribution S.O.R. by Seymour (NS). www.elektor-electronics.co.uk www.elektor-electronics.co.uk www.elektor-electronics Elektor Electronics on the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, cir- cuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Electronics Shop you'll find all other products sold by the pub- lishers, like CD-ROMs, kits and books. A powerful search function allows you to search for items and references across the entire website. Also on the Elektor Electronics website: • Electronics news and Elektor announcements • Readers Forum, • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact 84 elektor electronics - 2/2006 Please supply the following. For PCBs, front panel foils, EPROMs, PALs, GALs, microcontrollers and diskettes, state the part number and description; for books, state the full title; for photocopies of articles, state full name of article and month and year of publication. PLEASE USE BLOCK CAPITALS. Description Price each Qty. Total Order Code CD-ROM CD-ROM Elektor 2005 £ 16.25 CD-ROM Home Automation £ 12.95 CD-ROM ECD Edition 3 £ 12.95 Microcontroller Basics £ 18.70 li * **** E-blocks Starter Kit basic £ 96.00 E-blocks Starter Kit professional £ 1 66.00 E-blocks Easy Internet Kit £ 232.50 E-blocks Easy CAN Kit £ 299.00 Sub-total Prices and item descriptions suhject tn change The publishers reserve the right to change prices p&p without prior notification. Prices and item descriptions reir shown here supersede those in previous issues. E. & O.E. Total paid Name Address + Post code METHOD OF PAYMENT (see reverse before ticking as appropriate) □ □ □ □ Bank transfer Cheque (UK-resident customers ONLY) Giro transfer Expiry date: Verification code: SWITCH ONLY: Start date: Issue number: Please send this order form to * (see reverse for conditions) Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: (+44) (0) 208 261 4509 Fax: (+44) (0) 208 261 4447 Internet: www.elektor-electronics.co.uk sales@elektor-electronics.co.uk Tel. Email Date - - 2006 Signature EL02 Yes, I am taking out an annual subscription to elektor electronics and receive a free 1 W Luxeon LED Torchlight. I would like: Standard Subscription (11 issues) Subscription-Plus (11 issues plus the Elektor Volume 2005 CD-ROM) * Offer available to Subscribers who have not held a subscription to Elektor Electronics during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email -Q CO Date * cross out what is not applicable EL02 - 2006 Signature *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: SWITCH ONLY: Start date: Issue number: .... Please send this order form to Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: (+44) (0) 208 261 4509 Fax: (+44) (0) 208 261 4447 Internet: www.elektor-electronics.co.uk subscriptions@elektor-electronics.co.uk ORDERING INSTRUCTIONS, P&P CHARGES Except in the USA and Canada, all orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. On-line ordering: http://www.elektor-electronics.co.uk Readers in the USA and Canada may (but are not obliged to) send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Old Colony Sound for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: UK: £4.00 Europe: £5.00 (Standard) or £7.00 (Priority) Outside Europe: £8.00 (Standard) or £12.00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40209520 held by Elektor Electronics (Publishing) / Segment b.v. with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics (Publishing) / Segment b.v.. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics (Publishing) / Segment b.v. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA, Access, MasterCard, JCBCard and Switch cards can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor Electronics are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5-00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor Electronics (Publishing) does not accept responsibility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor Electronics (Publishing) in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor Electronics (Publishing) shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor Electronics (Publishing) other than to supply goods as described or, at the option of Elektor Electronics (Publishing), to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor Electronics (Publishing) shall be determined in all respects by the laws Of England. January 2006 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £41 .90 £48.80 Surface Mail Rest of the World £54.50 £61.40 USA & Canada US$ 95.50 US$106.50 Airmail Rest of the World £68.90 £75.80 USA & Canada US$120.00 US$131.00 HOW TO PAY Bank transfer into account no. 40209520 held by Elektor Electronics (Publishing) / Segment b.v. with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics (Publishing) / Segment b.v.. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics (Publishing) / Segment b.v. Please do not send giro transfer/ deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA, Access, MasterCard, JCBCard and Switch cards can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. 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) reduc- tion in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs £33.50, a Student Subscription- Plus costs £40.40 (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 2006 5 a> lectromcs cd-rom Elektor 2005 This CD-ROM contains all editorial articles, with the exception of New Products items, published in Elektor Electronics magazine Volume 2005. Using the supplied Acrobat Reader program, articles are presented in the same layout as originally found in the magazine. The DiskMirror utility on this CD-ROM allows your earlier Elektor year volume CD-ROMs (1997-2004) to be added to a large archive on hard disk for fast access and easy reference. A built-in search function allows you to find references in any article from the archive on hard disk, or from individual year volume CD-ROMs you have available. Index of Advertisers Allgood Technology, Showcase www.allgoodtechnology.com ATC Semitec Ltd, Showcase www.atcsemitec.co.uk .... Audioxpress, Showcase www.audioxpress.com .... Avit Research, Showcase www.avitresearch.co.uk . . . .80 .80 .81 .80 Beta Layout, Showcase www.pcb-pool.com 73, 80 Breadboarding Systems www.breadboarding.co.uk 11 Burn Technology LTD, Showcase www.burntec.com 80 Compucut, Showcase www.compucutters.com 80 Compulogic, Showcase www.compuiogic.co.uk 80 Conford Electronics, Showcase www.confordelec.co.uk 80 Cricklewood www.cricklewoodelectronics.com 4845 Danbury, Showcase www.livinginthepast.demon.co.uk 80 Design Gateway, Showcase www.design-gateway.com 80 Eaglepics, Showcase www.eaglepics.co.uk 80 Easysync, Showcase www.easysync.co.uk 7, 80 Elnec, Showcase www.einec.com 80 Euro circuits www.thepcbshop.com 14 Forest www.fored.co.uk 45 Future Technology Devices, Showcase . . .www.ftdichip.com 3, 80 Futurlec, Showcase www.futurlec.com 80 Ipeva Limited, Showcase www.ipeva.com 80 Jaycar Electronics www.jaycareiectronics.co.uk 2 JLB Electronics, Showcase www.jibeiectronics.com 81 KMK Technologies Ltd, Showcase www.kmk.com.hk 81 Labcenter Lichfield Electronics London Electronics College, Showcase MQP Electronics, Showcase New Wave Concepts, Showcase Newbury Electronics Number One Systems Nurve Networks PCB World, Showcase Pico Quasar Electronics, Showcase Robot Electronics, Showcase Showcase SK Pang Electronics, Showcase Sytronic Technology, Showcase Ultraleds, Showcase USB Instruments, Showcase Virtins Technology, Showcase .www.iabcenter.co.uk 88 . www. lichfieldelectronics. co.uk 44 .www.lec.org.uk 81 . www. mgpelectronics. co.uk 81 .www.new-wave-concepts.com 81 . www. ne wburyelectronics. co.uk 73 .www.numberone.com 33 . www.xgamestation. com 73 . www. pcb world, org. uk 81 .www.picotech.com 33 .www.guasarelectronics.com 32, 81 . www. robot-electronics, co.uk 81 80, 81 .www.skpang.co.uk 81 . www. m2mtelemetry. com 81 .www.ultraleds.co.uk 81 .www.usb-instruments.com 81 .www.virtins.com 81 Advertising space for the issue of 14 March 2006 may be reserved not later than 14 February 2006 with Huson International Media - Cambridge House - Gogmore Lane - Chertsey, Surrey KT 1 6 9AP - England - Telephone 01 932 564 999 - Fax 01 932 564998 - e-mail: aerrvb@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. 2/2006 - elektor electronics 87 Schematic & PCB Layout JLU ! JL J ■ a 1 • I E i Mm Schematic i f jf i V 1 ■ 1 u I 1,1 ■! .1 » * i, m i jf CFU Wodeff Auto Routing naMptufufti ^ Virtual System Modelling New Features £-4 in Version 6.8 Interactive Design Rule Check, Mitring / Unmitring. Enhanced track editing. The Complete Electronics Design System Powerful & flexible schematic capture. Auto-component placement and rip-up/retry PCB routing. Polygonal gridless ground planes. Libraries of over 8000 schematic and 1000 PCB parts. Bill of materials, DRC reports and much more. Mixed Mode SPICE Circuit Simulation • Struct/Array expansion. • ELF/DWARF file loader. • Berkeley SPICE3F5 simulator with custom extensions for true mixed mode and interactive simulation. • 6 virtual instruments and 14 graph based analysis types. • 6000 models including TTL, CMOS and PLD digital parts. • Fully compatible with manufacturers’ SPICE models. • Expanded model libraries. Call Now for Upgrade Pricing Proteus VSM - Co-simulation and debugging for popular Micro-controllers Supports PIC, AVR, 8051, ARM7 and BASIC STAMP micro-controllers. Co-simulate target firmware with your hardware design. Includes interactive peripheral models for LED and LCD displays, switches, keypads, virtual terminal and much, much more. Compatible with popular compilers and assemblers from Microchip, Crownhill, IAR, Keil, and others. Electronics 53-55 Main Street, Grassington. BD23 5AA Tel: 01756 753440 Fax: 01756 752857 Contact us for Free Demo CD ARM/LPC2000 MODELS FOR PROTEUS VSM NOW AVAILABLE www.labcenter.co.uk info@labcenter.co.uk