February 2010 AU 5 S 13.90 - NZS 16*90 - SAR 99.95 £ 4 65 MAM www.elektor.co, Toe cocker When The Ni 3 hi C QUASAR electronics i7» Etecfronic KJt Specialist* Since !PV3 Quasar Electronics Limited PO Box 6935, Bishops Stortford CM234WP, United Kingdom Tel: 01279 467799 Fax: 01279 267799 E-mail: sales@quasarelectronrcs.com Web: www quasarelectronics.com Postage & Packing Options {Up to 0 5Kg ^cbe II 3-7 Day Delivery - E4.95 UK Miinlwwl Europe (EU) - £8 95; Rest of Worid - £12 96 to 0 Sfq I Order online for reduced price UK Postage? We accept all major crediUdebit to Quasar Electronics. Prices include 111 % VAT Please visit our online Shop nnn fim H t ail projects, modules and publications. DocDetolvM Poctrcfi M s m 1 m i -*#*«* . ■ ' i i Motor Drivers/Controllers I Controllers & Loggers Here are just a few of our controller and driver modules for AC, DC, Unipolar/ Bipolar stepper motors and servo motors. See website for full range and details* Computer Controlled / Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vdc 5. 6 or S-3ead unipolar stepper motor rated up to 6 Amps. Provides speed and direc- tion control Operates in stand-alone or PC- controlled mode for CNC use Connect up to six 3179 driver boards to a single parallel port, Board supply: 9Vdc. PCS: 80x50mm. Kit Order Code: 3179KT - £15,95 Assembled Order Code: AS3179 - £22.95 Computer Controlled Bi-Poiar Stepper Motor Driver Drive any 5-50Vdc, 5 Amp bs-polar stepper motor us- ing externally supplied 5V HHftfj levels for STEP and DI- RECTION control. Opto- isolated inputs make il ideal for CNC applica- tions using a PC running suitable software. Board supply 8-3GVdc. PCS: 75x85mm, Kit Order Code. 3158KT - £23.95 Assembled Order Code: AS31 58 - £33.95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32Vdc, 10A) in both the forward and re- verse direction The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer Screw terminal block for connections. Kit Order Code. 3l66v2KT - £22.95 Assembled Order Code AS3166v2 - £32.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-ISVdc, Box supplied Dimensions (mm): 6QWxl00Lx6GH. Kit Order Code: 3067KT - £17,95 Assembled Order Code: AS3067 - £24.95 Most items are available in kit form (KT suffix) or assembled and ready for use (AS prefix). Here are just a few of the controller and data acquisition and control units we have. See website for full details. Suitable PSU for all units: Order Code PSU445 £7.95 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board 5A mains rated relay outputs. 4 isolated digital Inputs Useful in a variety of control and ri^nfej *** sensing applications Con- trolled via serial port for programming (using our new Windows interface, terminal emula- tor or batch fifes). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code 3108KT - £64.95 Assembled Order Code AS31G8 - £79.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port C or F. Continuously logs up to 4 separate sensors located ^ 2G0m+ from board Wide range or tree software applications for stor- mg/using data. PCB just 45x45mm, Powered by PC Includes one DS1820 sensor. Kil Order Code: 3145KT - £19.95 Assembled Order Code: AS3145 - £26.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Arl High security. 4 channels. Momentary or latching relay output. Range up to 40m Up to 1 5 Tx's can be learnt by one Rx (krt in- cludes one Tx but more avail- able separately). 4 indicator LED 's. Rx PCB 77x85mm. 12Vdc/6mA (standby). Two ana Ten channel versions also available. Kit Order Code: 3180KT - £49.95 Assembled Order Code: AS3180 - £59.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on I off any of the 4 relays as de- sired User settable Security Password. Anti- Tamper. Rings to Answer. Auto Hang-up and Lockout Includes plastic case Not BT ap- proved 130x1 1Qx3Qmm. Power: 12Vdc Kit Order Code: 3140KT - £74.95 Assembled Order Code: A3314G - £89,95 Infrared -2-^5 Indr. boa'c '■= 5.s a *- infrarec ^ : : T og ; e : - - : -- Kit Orde- : : : AsSr — z ez ~ New! 4-C~ ; Monitor & C . o-t" 4 change : *- . serial con :-r- monitcr a^z = . troller vvith for Dallas Z5‘ :52 DS18B2C d ;:a - momete' sers: *: rated relay Relays a r e T '-ieze allowing ftexib ■, ■ way you : ; = T . temperatj'-e et v RS 232 menace Centro' ^ '27dC/0,5A £59 95 5 : 42 - £69.95 : n T emper3ture 3 r Board program free Kit C :s' C: » _ - i - : S' * *. : sach ,1 Four 5A . ze output control sensor channels __ ’r e inkage in any 3 -ds f: r reading sent via the e text strings. - T ” z jnms ns or our - 5c*t.vare - £63.95 PIC & ATM EL Programmers We have a wde range of low cost PIC and ATMEL Programmers, Complete range and documentation available from our web site. LiA.' Ji.ji.-YUti liliKi 40*pin Wide 2IF socket (ZIF40W) £14.95 ISVdc Power supply (PSU120) £19.95 Leads: Serial (LDC441) £3.95 / USB (LOC644) £2.95 USS & Serial Port PIC Programmer USE Se* s connection. Header cable for 3S Z "nee Windows XP software. Wide range supported PfCs - see website for complete listing ZIP Socket/USB lead not included Supply: 16-18Vdc Kit Order Code: 3149EKT ■ £49,95 Assembled Order Code AS3149E - £59.95 USB 'All-Flash* PIC Programmer USB PIC programmer for a l 'Flash' devices. No externa 1 power supply making it trul, portable Supplied with box and Windows Software ZIF S :c-,et and USB lead not included Assembled Order Ccce AS3128 - £49,95 See website for full range of PIC & ATMEL Programmers and development tools. Secure Online Ordering Facilities • Full Product Listing. Descriptions & Photos • Kit Documentation & Software Downloads ORE YOU REHLLY SURE YOU HAVE THE BEST TOOL? (lllkfo ^:-V- - - JTTTTTTT BOTTOMS RC? OFF BOTTOM RC6 OFF HHiUi fcftWViV 9 UWww iillsIMd I***-*- 1 *4 “A couple of years back when I bought my Ea$yPIC4 and got to know it I was convinced MikroElektronika made the very best all-round development hardware. 1 he Easy PI C6 has just strengthened that opinion." Roman Black EasyPlC6 is a development system for 8-, 14-, 18-, 20-, 28- and 40- pin PIC microcontroller applications development and testing. The mikrolCD (Hardware In-circuit Debugger) enables very efficient step by step debugging. Examples in C, BASIC and Pascal are provided with the board. When surveyed, 93.6% of customers would recommend our products to their friends Order EasyPIC6 Development System right now and considerably reduce your prototype development time. MikroElektronika l iersibooks EASYPIC6 Find your distributor: DEVELOPMENT SYSTEM http://www.mikroe.com/en/distributors/ www.mikroe.com Power — not brawn "Power' was set as the theme of the month and powerful it will be. For many electron- ics enthusiasts, designing power supplies is a necessary evil. And when the power level lies in the ampere range instead of the milliampere range, quite a few design- ers find themselves in unknown territory. However, this can be remedied by new highly integrated chips, ready-made driver modules, and clever reference designs, in addition, many tools are available on the Web, and most of them are free. In this the February 2010 issue of Elektor we provide get-you-going information on the subject (or keep-you-going?) in two articles, Stable Starting Points (page 20) and Torture Rack (page 23}, To which I should hasten to add Tailored Cooling (page 14) because sadly some of the power you've paid for goes to waste as heat and we should find ways to deaf with that! Also on power wastage, while modern lamp technology claims to reduce electri- cal power consumption besides making us sleep better and feel less troubled with eco concerns, It also prompts a critical look at PFC (power factor correction). A non issue with the traditional incandes- cent fight bulbs rapidly being phased out, PFC now looks like area where technology is not, or not yet, making a contribution to power economies — in short, a lower elec- tricity bill. We did some research on off the shelf lamps claimed as "all the latest' and you can read the results on page 60. Femto 05 on page 38 proves that a lot of computing power can be packed in just a few kilobytes, just as we did in the old days when RAM was scarce & costly and programming required thinking instead of just pizzas, beer and broadband DSL. It should also stimulate many multitask- ing OS writers and suppliers to have a more than critical look at the size of their final product as it’s often gargan- tuan compared to the application itself, WLAN routers and WiFi devices are now firmly established in the 2,4 GHz ISM band, all clamouring for bandwidth to operate properly. Our 2.4 GHz Bandalyser (page 54) will not just tell you j ust how busy the band is in your area, but also the where/ what/ who about the main inter- ference sources your router should avoid by clever channel hopping now and then, Jan Suiting Editor 6 Colophon Corporate information on Elektor maga- zine, 8 Mailbox Monthly pick of letters to the Editor. 10 News & New Products A monthly roundup of afi the latest in electronics land. 14 Tailored Cooling For heatsink dimensioning, help is just around the corner. 23 Torture Rack PSU testing the dynamic way, but simple too. 24 Battery Checker Handles up to ten cells at up to io amps. 30 Winamp Controller With USB and a motor driven slide potentiometer. 40 Motorbike Chain Oiler with PIC An ingenuous circuit for automatic chain lubrication, 38 FemtoOS The world's tiniest multitasking operating system? 43 The Loudest! Tweaking the Portable PA for best performamce, 44 PCB design — it’s not witchcraft! Tricks and tips on board design from the Elektor lab. 46 Capacitors to the rescue The noble art of decoupling to prevent oscillation. 4 02-2010 elektor CONTENTS 24 Battery Checker This intelligent battery checker wilt determine the state of cells so that an opti- mal selection can be made from them to form a pack. It is essential to measure not only the capacity of the ceils, but also their internal resistance. 60 38 Femto OS Here’s a minuscule multitasking operating system that’s currently ported to 44 of Atmel's AVR microcontrollers. It is open source and licensed under CPLV3. Femto OS is different! For one, it's is extremely economical with RAM and flash memory, 70 54 The 2.4 GHz Bandalyser 7 With this handy portable scanner, you can quickly and easily see which WiFi and WLAN frequencies are being used in your area and which channels you should avoid for your own wireless network links* 77 60 Blinded by the Light? The latest lamp technologies are claimed to save huge amounts of power but has their power factor correction (PFC) been overlooked or is it a simple matter of poor standards and sluggish industry regulation again? We investigate. Volume 36 February 2010 no. 398 Loud and Clear A portable PA system with feedback suppression. The 2.4 GHz Bandalyser Scan the WiFi band for WLAN activity and Interference sources. Design Tips Computer digital audio interface Blinded by the Light? Lamp power factor correction investigated! The ATfVhS Radio Computer FM, AM, RDS* all crammed into one chip! TTL Bluetooth Dongle Wireless data communications was never easier. Design Tips Audio amplifier in dinner mint format Hexadoku Our monthly puzzle with an electronics touch. Retronics: Elektor Teletext Decoder (1981) Regular feature on electronics ’odd & ancient'. Coming Attractions Next month in Elektor magazine. elektor 02-2010 5 elektor international media bv Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. * ■ i « » M"iS Vi UH i '.tii-iijrv J(i I u PFC CRACKDOWN mp power factor revealed 6 NEW PROJECTS tha" 1 CH^f t as*** ANALOGUE • DIGITAL W MICROCONTROLLERS & EMBEDDED AUDIO • TEST & MEASUREMENT t m 4 Volume 3.6, Number 39S. February 2010 ISSN 1757^0875 Elektor aims at inspiring people to master electronics- at any persona! level by presenting construction projects and spotting developments in electronics and information tec hnology. Elektor International Media, Reg us Brentford, toqo Great West Road, Brentford 1 W89HH, England, Tel, (+44)208 4^09. fax; (+44) 208 261 4447 www. elektor.com The magazine is available horn newsagents, bookshops and electronics retail outlets, or on subscription Elektor is published 11 limes a yea - with a double issue fa July & August Elektor is also published In French. Spanish, American English, German and Dutch, Together with franchised editions the magazine is on circulation In mote than 50 countries, Intel iwtional Editor. WisseHettinga (w.hettinga:'' elektor.nl) Jan Busting (editor4elektor.com) Harry Baggen< Thijs Beckers. Eduardo Corral Ernst Ktempelsauerjens Nickel. Ctemens Valens, Antoine Aulhier (Head). Ton Giesberts, Luc Lemmons, Daniel Rodrigues, Jan Visser. Christian Vossen He d wig H ennekens ( sec ret ar i aa t ; e I ek to r.n 1 1 Giel Do Is, Mart Schroijen Paul Snakkers Carlo van -Nisteirooy Elektor International Media, Regus Brentford, iqoo Great West Road, Brentford TW8 9HH, England. Tel (+44) 208 2614509, fax: (+44) 208 261 4447 Internet: wwvwe I ektcf.com/ subs 6 02-2010 elektor Elektor Tools for PCB Productio PCB-DIY All the Way It’s clear that a good set of tools is required for PCB production and SMD component stuffing. With the Elektor stencil machine you get the solder paste accurately positioned, and the pick & place device is ideal for manual fitting of SMT compo- nents on circuit boards. machine and pic k & placet oQj. r Elektor Pick & Place Tool For manual fitting of SMT components on circuit boards * Adjustable anti -static arm rest for stable positioning of components * Anti-static component storage system * Magnetic supports forPCB * Suction tool with different pickup needle sizes * Maintenance-free vacuum pump * Kit of parts for home assembly, with dear manual 450x150 x 100 mm | 2.5 kg £575.00 | US S935.QD l €645.00' ' Prices including VAT (Ell destinations), excluding shipping. 3ektor Elektor Stencil Machine Use a stencil for accurate applying of solder paste on circuit boards * Accurate X t Y alignment of PCB frame * For single and double sided PCBs and single-sided populated PCBs * Magnetic standoff supports for PCB * Rapid and secure fixing of stencil * Stencils do not need fixing holes * Maintenance-free and robust aluminum frame * Kit of parts for home assembly, with clear manual 151 15.5 so* i,OI Further information and ordering at www.elektor.com/pcbtools Emaili subsr riptions '-'elektor. co m Rates and terms are given on the Subscription Order Form. Elektor international Media b.v. P.O- Box n NL-&H4-ZG Suite re n The Netherlands Telephone: (+31) 46 4389444. Fax: [*31 ) 46 4370161 Distribution; Seymour, 2 East Poultry Street, London ECiA, England Telephone;+44 307 4594073 UK Advertising Hu son International Media, Cambridge House, Gog more Lane. Chertsey. Surrey KT16 9AP, England. Telephone: *44 1932 364999, Fax: +44 1932 564998 E m ail : r. elgar? h u son m ed i a.co m 1 n ter net: ww w, h uso nmedia.com Advertising rates and terms available on request. Cupyi igbl Muriel' 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 published in our books and magazines \ other than third-party advertisements) are copyright Elektor International Media b.v, and may not be reproduced 1 or transmit- ted in any form or by any means, including photocopying, scan- ning an recording, in whole or in part without prior written per- mission from the Publisher. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may 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) 01 other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guanas tee to return any material submitted to them. IMdumec Prices and descriptions of publication-related Items subject to change. Errors and omissions excluded. ■0 Ut-klOr In [trnal in nal Media b.u, 200-9 Printed in the Netherlands elektor 02-2010 7 MAILBOX AVR, dB and LDR collide at D/A Junction Elektor November 2009, page 43, ref. 080654 Dear Sir — I hesitate to imply any sort of criticism of your excellent organ, but I must comment on the recent article "AVR, dB and LDR Collide" by Daniel Rodrigues, Daniel is very critical of a design using a light dependent resistor (LDR) in a digitally controlled volume control. The basis of his criticism is the resistive range of an LDR was only 50 to 2000 ohm. In fact there are plenty of LDRs available with dark resistance of up to 25 megohm which is altogether a differ- ent kettle of fish. In this sort of application an LDR could be used very effectively as one leg of a potent ial divider, to replace a conven- tional potentiomer in a low-level part of the circuit. In some configurations this device can be made to approximate a log-law potentiometer for audio applications. This not only provides a solid-state alternative to a potentiometer, but also makes it easy to create multi-ganged devices controlled by a single voltage source. It is easy to make a resistive optocoupler by gluing an LED to an LDR and covering the assembly with heat shrink sleeving. Alter- natively these devices are available ready made, such as the Silonex NSL32SR3. On a note of thanks, I always enjoy reading Elektor from cover to cover, and 1 particu- larly like the Retronfes column. Paul Lister Daniel Rodrigues replies: actually, the compo- nent Mr. Lister refers to was tested . I did not ■ Publication of reader's or res p on de nee is at the discretion of the Editor - Viewpoints expressed by correspondents are not necessarily those of the Ed 1 for or Publisher. mention the component because it’s not RoHS compliant (which is not stated in the datasheet though!). It's also slow (taking 10 sec to achieve 25 Mil), distorts the audio signal and its not RoHS compliant, containing high amounts of cadmium. So. it's becoming increasingly diffi- cult to find LDRs with a larger resistance range. It may also be worth noting that the circuit as discussed in the article is based on the LDR being inserted in the ( low- power) loudspeaker line . Circuit suggestions for T-Reg (2) Mailbox, December 2009, page S. Dear Editor— I read the letter in December 2009 Elektor from Alexander Voigt with interest I can add a little to your discussion on failures of valves; I worked on the rebuild of the Colossus computer at Bletchfey Park for several years. That machine uses 2,500 valves and we had to replace valves now and then . There are at least two ways that valves can be damaged. The first is called cathode stripping; this is where the anode voltage is applied before the cathode is at working tem- perature. Because the vacuum in the tube is not perfect, ions can form and fall back onto the cathode and because they are heavy, they knock the coating off the cathode. The second is called cathode poisoning: this is where the cathode is at working temperature but there is no (or little) anode voltage to attract electrons out of the cathode. A cloud of ions forms around the cathode and this eventually leads to contamination of the material which forms the cathode. Thermionic valves in early computers suffered this fate because logic gates are either on or off. If off, then cathode poisoning is possible as no anode current is flowing, often for long periods, 1 hope this helps. An excellent magazine. Charles Coultas Thanks for that Charles and keep up the good work at B letch ley Park. Suggestions for Retronics Hi Jan — thanks for a great magazine. You have appealed for new subjects For your * Correspondence may be translated or edited For length, clarity and style, * When replying to Mailbox correspondence, please quote Issue number, * Please send your MailBox correspondence to: ’Retronics' series of articles. He'e c es 1) Magnetic Amplifiers and indeed whole suite of saturable reactors an: : ::■ ball miscellaneous transductors. Fasc ris- ing devices. 2} The Amplidyne, Metadyne and Mag - ■ con rotary amplifiers, OK, they may one - nate more from the heavy-power end of the electric-device spectrum but they are especially interesting for shear ingenuitv and the capability of controlling massive amounts of power with such a small mag- nitude of control current. 3) We take cheap, mass-produced con- sumer goods for granted but the fact that this is possible rides solely upon the back of advanced sensor; transducer technol- ogy, Could you delve into the early days of these devices. Just to kick this one off, have a look at the Petoscope. I think you will be intrigued. 4) I would particularly like to see some- thing on the "might-have-been” devices that never quite got out of the lab. For example., ultra-miniature vacuum-tube ‘chips' designed using silicon integrated circuit technology, cold-cathode sub- strate materials (no, I ’m not talking about orthodox cold-cathode gas-filled tubes but the elimination of the heater entirely), revolutionary display technologies, even most recently, the abandoned new-con- cept electron-emission method behind Canon/Toshiba's flat-screen alternative. I trust this keeps you busyl Andre Rousseau The Petoscope and the ' might-have-beens ' in particular should make excellent reading in Retronks , which I started writing and editing in December 2004 and is currently in its 53rd instalment mostly thanks to the encourage- ment. hints, equipments , oddball de\ ces and enthusiastic contributions I got from . . j, the Elektor readership. The same for tne subjects Andre has kindly suggested - f anyone con come up with a 700-word an>c ! z - the items mentioned, or s imply his he ~ fa , w re v intage eg uip m ent or elec ironic de , : ■ a 0 i h es i- tate to contact me. Jan Buittng, Editor. editor<§elektQr.com or Elektor, The Editor, 1000 Great West Road, Brentford TWS 9HH. England “ rWQr 8 02-2 D ’ ■"N Complete practical measurement systems using a PC ogramming in C# and Visual Basic This is a highly-practkal guide for Hobbyists, Engineers and Scientists wishing to build measurement and control systems to be used in conjunction with a local or even remote Personal Computer. The book covers both hardware and software aspects of designing typical embedded systems based on persona! computers running the Windows operating system. It s use of modern techniques in detailed, numerous examples has been designed to show dearly how straightforward it can be to create the interfaces between digital and analog electronics, programming and Web-design. Hardware developers will discover how use of latest high-level language constructs overcomes the need for specialist programming skills. Software developers will appreciate how a better understanding of circuits will enable them to optimize related programs, including drivers. There is no need to buy special equipment or expensive software tools in order to create embedded projects covered in this book. [^ektor 292 pages * ISSN 978-0-905705-79-8 £28.50 * US S46.0G Elektor Reg us Brentford 1 000 Great West Road Brentford TW89HH United Kingdom Tel, +44 20 8261 4509 elektor 02-2010 9 NEWS & NEW PRODUCTS LED driver delivers over 20 amps of continuous LED current Linear Technology's LT3743 is a syn- chronous step-down DC/DC converter designed to deliver constant current to drive high current LEDs, The device’s 5,3 V to 36 V input vo Stage range makes it ideal for a wide variety of applications, includ- ing industrial, DLP projection and archi- tectural lighting. The LT3743 provides up to 20 A of continuous LED current from a nominal 1 2 V input* delivering in excess of 80 watts. In pulsed LED applications* it can deliver up to 40 A of LED current or 1 60 watts from a 1 2 V input. Efficiencies as high as 95% eliminate any need for external heat sinking and significantly simplify the thermal design. A frequency adjust pin enables the user to program the frequency between 1 00 kHz and 1 MHz so designers can optimise efficiency while minimising external component size. Combined with a 4mm * 5mm QFN or ther- mally enhanced TSSOP-28 package, the LT3743 offers a very compact high-power LED driver solution. The LT3743EUFD is available in a 28-pin 4mm x 5mm QFN package, whereas the LT3743EFE is available in a thermally enhanced TSSOP-28. Extended temperature versions* or T grades, namely the LT3743IUFD and LT3743IFE are also available. All versions are avail- able from stock, www.iinear.com (090832V!) ByteSnap showcases electronics design projects at Southern Electronics 2010 For the first time at Southern Electron- ics in Farnborough from 10-11 Febru- ary 2010 on stand D12, ByteSnap Design will be demonstrating its work for Rota- link, a designer and manufacturer of mini- ature motors* transmission and controls. The companies will be highlighting a new product which measures the precise posi- tion of a gearbox running at up to 500 rpm and the number of turns made. The new product will be of potential interest to a wide range of applications including valves, lighting effects, antenna position- ing, seat adjusters, curtain openers and instrumentation, ByteSnap Design will also be showcasing Its bespoke embedded electronics design, embedded firmware and board design services. The company will also highlight work it has undertaken for its clients that has speeded up product time to market and created innovative, robust and high quality electronics and software products. Visitors to the stand will be able to see other products that ByteSnap Design has success- fully helped to bring to market, including working prototypes of a GSM based M2M device, the Zigbee and Bluetooth based Plogg smart energy meter and its award winning work on the Plogg Network controller. Its recently launched SnapUl Windows CE User Interface build tool which cuts development times by simplifying the graphic design element of compelling Uls will also be demonstrated on the stand. www, bytes nap, co.uk (091076-i) Gas station and convenience market fitted with ioo% LED lighting The promised energy efficiency anc : : as a result of LED based lighting so u: proving a reality at Morrisons' Iliir: gasoline station and convenience 1 - in the United Kingdom, The solut : - ated by Philips Lighting, demonstr. - benefits and appropriateness of L_ s I ! Rebel based luminaires for both -> and external applications. Most - tantly, the LUXEON based solutic - Philips have enabled Morrisons t: - - * substantial energy efficient gains compromising performance. The c~ v - at Illingworth from the canopy anc wash to the signage and refrigera: nets utilizes high power, high effi c = : * __ EON Rebel LEDs and Morrisons r - impressive energy savings of appr- 45% across the installation. Philips Mini 300 luminaires v, T™ . . ; Rebel have replaced the old s: . a _ metal halide fittings and by : - ing motion detection, the sole: t'* - cacy is further increased, Efr’Lis; :e ~s are not made at the expense _ : illumination. The signage requirements on site . e - - ized using the revolutionary nev. : - rs Poster Box Module 300 Series (patent : ■_ ing) in all of the site s illuminated : grs. Aluminium profiles wash fight ac - :r re sign and make optimal use of tne ignt by re-cycling it in the box. LUXEON Rebe LEDs are used here as well and the result is 5 un form light without the stripes usually associated with fluorescent tubes. Not only is energy con- sumption reduced by over 75%, the long service life of the product contributes to significantly reduced ongoing maintenance costs. At Illingworth, accent lighting for selected 02-2010 elektor NEWS & NEW PRODUCTS merchandise such as driving accessories and seasonal goods was achieved utiliz- ing adjustable 10 watt Spot LEDs. The long useful life of the LUXEON LED light sources means that maintenance costs are signifi- cantly reduced and no re-lamping should be required throughout the life of the store. www.philipslumileds.com (091076-!!) National Instruments tools integrate with Windows 7 National Instruments has announced soft- ware and hardware compatibility with Windows 7 to help engineers and scien- tists attain faster performance and higher throughput within their applications. Engi- neers and scientists who are considering upgrading to the latest computer hard- ware can take advantage of several new features in the new operating system. This release, which includes performance and usability enhancements, provides a smooth upgrade experience and improves the envi- ronment for hardware and software com- patibility, making it ideal for measurement and workstation applications. Windows 7 contains features that provide increased USB data acquisition throughput and take full advantage of multicore processors to improve responsiveness and offer compat- ibility with the latest computer technolo- gies, including support for PCI Express and 64-bit processors. By combin- ing Windows? with the Lab- VIEW graphical design platform for test, control and embed- ded system development, engineers and scientists can achieve effi- ciency gains including elimination of non-nec- essary tim- ers, selective hub suspension and lower enumeration time for USB flash devices, which increase the performance of USB test and measurement devices. In recent benchmarks of the new Nl Com- paetDAQ chassis with LabVIEW, engineers observed a 10 percent increase in over- all attainable bandwidth in Windows 7 as compared to the same hardware running on Windows XP. The increased hardware performance combined with the multi- core optimisation of both the Windows 7 operating system and the LabVIEW devel- opment environment result in a perform- ance increase of up to 20 percent when performing high-speed or multifunction 1/ O measurements. To take advantage of these performance increases, engineers may need to install new drivers. Drivers compatible with Windows 7 are available for download from National Instruments at the website below. Data acquisition applications written in Lab- VIEW and using Nf hardware on a multicore computer will benefit from the improve- ments in Windows? designed to further optimise the use of these processors. Lab- VIEW is an inherently multithreaded soft- ware platform that assigns independent, asynchronous processes to separate threads that can be executed in parallel by separate computer cores. LabVIEW programmers can create multiple computationally inten- sive tasks in a single application to run in parallel and optimise the use of all availa- ble cores. Engineers and scientists can use Nl drivers such as IN!-DAQmx t which are also multithreaded, to efficiently create high-performance acquisition and analy- sis applications, without having to manu- ally spawn and manage sepa- rate threads. A benchmark LabVIEW appli- cation with four parallel loops on a quad-core machine exe- cutes up to 8 percent faster in Windows 7, com- pared to Windows XP, Additionally, an Nl TestStand parallel sequence benchmark appli- cation executes up to 10 percent faster. www.nE.com/wind0ws7 (091076-lV) PropScope is here! The PropScope from Parallax is a two-chan- nef oscilloscope that's capable of reading 25 million samples per second with 10 bits of resolution over 1 V, 2 V, 1 0 V, or 20 V peak-to-peak waveforms. Power is pro- vided through the USB port requiring only a single cable to connect the PropScope to any laptop or desktop PC. A built-in expansion port allows additional capabilities and upgrades, by simply plug- ging in an expansion card. A PropScope DAC card is even included, providing an analogue trigger, a 4-bit digital trigger, an 8-bit digital to analogue converter, and a 4-bit NTSC/PAL output. Other cards will be available to add even more useful features. The included software provides a tradi- tional scope interface along with auto measurements and the ability to store and export waveforms. The software also pro- vides features not normally available in a stand-alone oscilloscope, including a func- tion generator, a logic analyzer, a spec- trum anafyser, a vector-scope, and more. Features: 2 input channels 25 Msps Maximum Sample Rate 20 Vpp maximum input range (-1 0 V to + 10 V when DC-coupled) 10-bit input resolution over either the entire 20 Vpp range, or selectable 1 0. 2, and 1 Vpp ranges, lx / 1 0x selectable probes The Propscope retails at $249.99 directly from Parallax USA or the equivalent in focal currency from Parallax' authorised distrib- utors and resellers. www.Parallax.com (search ‘PropScope* or "32220') (091076-!!!) etektor 02-2010 11 NEWS & NEW PRODUCTS SMD DCF77 receiver antenna used by Racetech racing team Racetech is a team consisting of 45 students studying vehicle construction, mechanical engineering, industrial engineering and management, geo-engineering and min- ing and other subjects. With teamwork they develop, construct and build a racing car they hope will enable them to parties pate in the German “Formula Student' 5 rac- ing series held at the Hockenheimring. PREIVIO develops the state of the art anten- nas for atomic watch signal reception in the racing cars. The antenna receives the radio signal from the DCF77 station (Frankfurt, Germany) in real time, this signal is proc- essed by the car electronics to get an accu- rate time value. The multiple sensor meas- urement system of the vehicle is synchro- nized with the remote data logger using this signal. PREIVIO has developed the first radio dock receiver antenna in SMD technology (RCA- SMD series}* in the market for applications like automotive and outdoor lamp on/off control. This component is supplied in reels to automatic assembly process by SMT pick and place machine. In VLFtime receiver cir- cuits the antenna is big component; PREMO has miniaturized this antenna to make pos- sible using low profile PC Bs with 1 00% inte- gration level to avoid external cables con- nection manually. The antenna is delivered after a fine tun- ing at PREMO, at specified frequency. This tuning process is carried out in the PREMO manufacturing line using a high reliability automatic station. This station checks the antenna performance in real time. The new antennas are configured as t-C res- onant parallel tank (RCA-SMD-77A: 1.3mH I | 3.3 nF for 77,5 kHz and RCA-SMD-6GA: 2.1 mH | | 3.3 nF for 60 kHz) which offer a higher resistance (more than 75 kil) at reso- nance frequency (±0.2 kHz). The Standard SMD version of this new radio dock antenna (at 40 kHz, 60 kHz and 77.5 kHz) is already available in the market. Other trough-hole versions and cable connections including others resonance frequencies are under development and will be available in Q2 2010 . www.grupopremo.com (091076^) PIC32 development and microcontroller board with interpreted BASIC The new ByVac 6V513 utilises the familiar PIC architecture to give a USB enabled board running a PIC32 Microcontroller at SO MHz. On board is a micro SD Card holder which the BASIC can take full advantage of. Utilis- ing subdirectories and long fie names it is compatible with the FAT 16 filing system. The board is programmed via the SD Card or serially via the USB, programs can be stored on RAM, Flash or the SDCard. There is an on board Flash loader so the BASIC application or any other software can be upgraded via the USB, there is no need for a specialised programmer All operations are done serially at a superfast 2 M Baud. The BV51 3 Is aimed at beginners, utilising the BASIC interpreter and professionals because all of the hard work is done. The BASIC is unique in that it will interface with C programs written as Plug-Ins giving the full advantage of BASIC interactivity and the speed of C. Basic func- tions can even be scheduled to run at given Intervals. All of the documentation is on line at the Byvac website (below). The board ts available now and supplied in three forms, without sockets, with sockets fitted down- wards for plugging into a mother board and with turned pin sockets for breadboarding. Prices start from £16.50. www.pEc32.byvac.com (09TQ76-VI) $7000 in cosh prizes available! M. T s a/ Low cost, high performance ISM band RF modules at 2.4 GHz Radiocrafts AS now expand their product line with two new modules, the low cost RC2500- RC232 and RC2500HP-RC232. These are multi-channel RF transceivers with embed- ded protocol. RC2500 is below US$10 in vol- ume, The RC25QQHP includes a range exten- sion IN A and 100 mW PA. The new' modules have numerous applications in M2M commu- nication, sensor and control networks. The module Is a complete RF system solu- tion including a high performance multi- channel FSK radio transceiver and a packet protocol handler, with an easy-to-use UART interface. The embedded RC232™ proto- col provides a point-to-multipoint solu- tion with individual addressing or broad- cast, and CRC check for signal integrity. The module can also be used as a wireless RS232 / R54S5 cable replacement. The compact module, measuring only 1 2.7 x 25.4 x 3,3 mm* makes up a complete RF modem in one single tiny package, replac- ing tens of components compared to a dis- crete design. No external components are required, except an antenna. The modules are delivered on tape and reel for efficient volume production. It's small size and low power consumption makes it ideal for 12 02-2010 elektor NEWS & NEW PRODUCTS Linx and Parallax co-sponsor $3,000 RF design contest linx Technologies Inc, announced an RF design contest jointly sponsored with Parallax Inc, The contest is based on the new Parallax 433 Transceiver board which incorporates the Linx LT Series transceiver. This easy to use and low cost module is capable of sending and receiving serial data wirelessly between microcontrollers or to a PC enabling the cre- ation of applications limited only by the designer's imagination. Three thousand dollars in cash prizes as well as numerous product giveaways will go £0 winning designs. Contest registration is underway and open until April 30, 2010, All entries must be received by May 31 , 2010. Elektor readers are expressly encouraged to participate! www. pa ra I laxxo m/ta bid/Sai/ Def a u ft, a spx ( o 91 076- Vj 1 ) ntegration into size constrained battery operated equipment. The modules are based on a new very low cost platform, and have been developed for volume applications with a price target of less than US$10 at 50k, The new mod- ules are pin compatible with the RC1 1x0 series giving the customer a complete range of replaceable modules at 433, 868, 91 5 and 2450 MHz, The RC2500-RC232 and RC2500HP-RC232 (set to 1 0 mW) are pre certified for opera- tion under the European radio regulations for license-free use. When used with quar- ter-wave antennas a Jine-of-sight range of 1 ,000 and 3,500 meters (3,000 to 10,000 ft) respectively, can be achieved at low data rates. Both modules are also designed for operation under the FCC regulations. Mod- ules and Demo Kits are available now, www.radiocrafts.com (091 07 6- Vi II) Atmel and H&D Wireless deliver world’s most power efficient embedded Wi-Fi solution Atmel® Corporation is collaborating with H&D Wireless to deliver an IEEESQ2J 1 b+g Wi-Fi solm n for Atmel's 32-bit AVR® microcontrol- lers. In this col- laboration, H&D Wire- less will pro- vide the SPB104 Wi-Fi extension board which is easily connected to the AVR32 UC3 evaluation kits through the SD card socket. This collaboration results in the industry's most power efficient Wi-Fi solution, with an overall power consumption five times lower than any other similar solution on the market, AtmeLs AVR32 MCUs claim to achieve the industry's lowest power consumption with 0.48 mW / MHz in active mode, I.SpAwith RTC running and below 100 n A in shut- down mode, H&D Wireless' modules offer Wi-Fi capa- bility for the 802.1 Ib+g spectrums with a throughput of 1 to 54 Mbps, The device offers 1 50 pW sleep power consumption, 2.4 years of battery fife, 220 mW TX power and an interface compatible to SDIO and SPL In addition, the RF power output is 7- 8 dB higher than the average on the market at +17.5 dBm, www.a tme fxo m/ wifi www. hd-w ireiess.se 18-pin PIC® micros feature enhanced mid-range core and extreme low power consumption Microchip announces the PIC 1 6(L)F1 826 and PICT 6(l)F1 827 general-purpose 8-bit microcontrollers (MCUs) — the latest PIC 1 MCUs to feature the Company's Enhanced Mid-range core. With this extension into the 18-pin range, the PIC1 6(L)F1 826/7 MCUs provide an advanced peripheral set that includes an mTouch™ capacitive touch-sensing module and dual PC 1M /SPI interfaces, along with TF T versions featur- ing industry-leading low power consump- tion via Microchip's nanoWatt XLP extreme Low-Power technology. The introduction of these MCUs 1 provides an excellent low cost, pin-compatible migration path for legacy 18-pin PIC MCUs, while delivering increased performance and Industry-lead- ing low power operation. With Microchip's Enhanced Mid-range archi- tecture, the MCUs provide a 50% increase in performance and 14 new instructions that make programming with the C language more efficient, resulting in up to 40% bet- ter code efficiency over previous-generation S-bit PIC MCUs. In addition to the mTouch capacitive touch-sensing module and dual I2C/SPI interfaces, peripheral enhance- ments include enhanced PWM functional- ity, and a Digital Signal Modulator that ena- bles designers to customise communication interfaces and combine many functions into a single MCU. The integration of Microchip's nanoWatt XLP technology, which lowers standby cur- rent to just 0.030 pA at 1 ,8 V (typical), deliv- ers market- lea ding current consumption, further improving overall energy efficiency and extending battery life in a broad range of applications. The PICkit™ 2 18-pin Demonstration Board (part # DM 164120-4, $23,99) pro- vides a quick and easy way to evaluate and develop with the PIC1 6(L)F1 826/7 MCUs, The board includes four LEDs t a potentiom- eter for an Analogue-to -Digital Converter (ADC) t a pushbutton, a prototyping area, a 6-pin connector for the PICkit™ 3 In-Circuit Debugger/Programmer (part # PC 1 641 30), as well as two bare boards for designers to use for their own project. (091076-XII) elektor 02-2010 COOLING Tailored Cooling Online help for heatsink dimensioning By Harry Baggen (Elektor Netherlands Editorial) Too many electronic circuits produce a certain amount of heat, which must be dissipated quickly and effectively to ensure proper component operation. All sorts of heatsinks are available for this purpose, but how can you calculate how much cooling you need, and how can you choose the right heatsink? Help is available on a variety of websites. The saying ‘Where there's smoke, there's fire” most likely origi- nated before the era of electronic circuits, as otherwise we would probably say, 'Where there's electronics, there's heat? When elec- trons flow through an electronic component, they generate heat. This occurs not only as a result of the circuit design, such as with a class A audio amplifier, but also because semiconductor devices never have ideal characteristics. In digital circuits, where the devices only switch between ground potential and the supply voltage, you might expect that no heat dissipation would occur. However, it does occur due to the finite switching times of digital components. If you add to this the fact that nowadays everything must operate at the highest possible dock rate, it s easy to understand why heat dissi- pation is not limited to analogue circuits. In order to ensure that analogue as wefl as digital components have a long useful life, it is essential to keep the temperature of the silicon chips within limits. This is usually achieved with the aid of heatsinks, which are available in all sorts and sizes. Unusual solutions, such as heat pipes, Peltier coolers and liquid cooling, can be used in special situations. However, they are rarely used in prototyping, where at most you might use a fan for forced -air cooling. Heatsink calculations Heatsink calculations are most often necessary with analogue cir- cuits, such as voltage regulators or power amplifier ICs, in such cases, you usually know how much power must be dissipated and how the circuit will be fitted in an enclosure. In the same way as with an electrical circuit, heat transfer can be calculated using thermal resistances, thermal differentials and heat flows. The semiconductor chip acts as a thermal source, which pro- duces a certain amount of heat. The thermal differentials are the temperature differences across the various thermal resistances arranged in series. Figure 1 shows an example of a thermal circuit diagram, which you have probably seen before In electronics books or application notes. The various components of this diagram are described briefly below. The first thermal resistance (fi thjjmb ) is located between the junc- tion of the semiconductor device and the device package, which is called the mounting base or case (e), The next thermal resistance Is located between the device case and the heatsink and is desig- nated R Lh mb . h . The value of this resistance depends on the material between the case and the heatsink, such as an insulating pad and/or thermal paste. Resistance /? thh . a represents the interface between the heatsink and the ambient medium (usually air). The diagram also shows a thermal source that supplies a heat flow P. The value of the first resistance R lh is stated on the data sheet of the semicond uctor device manufacturer. While you ' re looki ng at the 14 02-2010 elektor COOLING data sheet, you should also note another value that you will need for heatsink calculations: the maximum allowable semiconductor junction temperature Tj. This value should never be exceeded, as otherwise the life of the device will be shortened dramatically. The value of the thermal resistance R tU nib . h depends on how the device is mounted. It is fairly low if the semiconductor device is fitted directly to the heatsink. It can be reduced even further by using thermal paste, If insulated mounting of the semiconductor device is neces- sary, you can choose from a variety of insulating materials, such as silicone rubber or aluminium oxide (alumina). The manufacturers of these materials a Iso specify their thermal resistances. Finally, you have the thermal resistance from the heatsink to the ambient (R th h , ,). You can obtain this value from the data provided by the heatsink manufacturer. The specified value usually applies to a black heatsink with vertical fin orientation. If the heatsink has a natural alumin- ium finish instead of a black finish, the thermal resistance can be assumed to be around 1 0% higher. If the heatsink is fitted with the fins horizontal instead of vertical, the thermal resistance can eas- ily be 20 to 40% higher than the stated value. If it is fitted inside an enclosure, the air flow will be reduced considerably, which consider- ably increases the effective thermal resistance of the heatsink. When dimensioning a heatsink, you should always base you calcu- lations on the maximum power dissipation of the semiconductor device. For instance. If the maximum voltage over a voltage regu- lator is 6 V and the maximum current is 1 A, it must be able to dis- sipate at least 6 W. You should aim to ensure that the temperature of the semiconductor device never exceeds the maximum allow- able value, and it is better to stay somewhat below this limit. With a maximum junction temperature of 175 °C and an average ambient temperature of 25 °C, the total temperature difference over all of the thermal resistances must not exceed 1 50 °C, Given the amount of power to be dissipated, the total thermal resistance can be cal- culated as ^th total ^ AT/P- 1 50/6 = 25 T/W = 25 K/W). If the temperature regulator 1C is packaged in a case with a thermal resistance R lh j, mb of 5 °C/W and the 1C is fitted directly to the heat- sink without an insulating tab, so that R thnib _ h * s very l° w (around 0.1 -0.2 °C/W), you wilt need a heatsink with a thermal resistance less than 20 K/W because the thermal resistances are in series and their sum must be no higher than the calculated value. Heatsinks of this sort designed for PCB mounting are readily available. This completes our overview of the principles of heatsink dimen- sioning. in practice, you need to be especially careful with the details when large amounts of power must be dissipated. A vari- ety of insulating pads and thermal pastes are available nowadays, and you should pay attention to a variety of properties such as the mounting method, maximum insulation voltage and hold-down force when making your selection. An excellent article on the subject of cooling electronic components Idcan be found on the Elliot Sound Products website. 090S7£- ? t Figure 1, Thermal circuit for heatsink calculations. Web-based help There are a lot of websites that can help you with heatsink dimen- sioning and selection. Most of them have a calculation page where you only need to enter a few basic values. Here we describe a few of the more interesting sites. Online calculations The German heatsink manufacturer Alutronic provides a handy cal- culation program called ‘Alutronic RthK Calculator', which you can download after registering on the site. There is also an online ver- sion of this program, which can be used without registration [2], The values of the previously described thermal resistances and the amount of power to be dissipated can be set using sliders that are adjusted with the mouse, after which you can immediately see the maximum thermal resistance of the heatsink. The page also shows the maximum temperature of the heatsink, which is important information if the heatsink is mounted where it can be touched. Figure 2. This online program from Alutronic lets you use sliders to set all the necessary values. elektor 02-2010 15 COOLING ' Otitm C*kdU«i* ,j_ IhfftlHH mwHUJir.tr. E 15® Figure 3, Clear and simple: the online heatsink calculator on the Changpuak website. ■Hcalilnk cjScuIjIdi Ycf. 2.0 HK Software 2QQ0 [St] T ctgi POw«J 1 25 wan JtrCtjjriJfWMlue 1 175 TXcwf I 50 TjIcui Nvrtfefli t-.l lr#rx!cn r~ 1 Tl*nw<6« KAV Viluc r~ 15 fwulotQf KfW ttjJue r~ 01 •CtlwiAVflU He^frilt, XJiff Vfllw 1 3? 127* Teteui He* Qw Figure 4, This free program from BK Software is small but very handy. RS Components i 3 ! also provides an online calculator, in this case a fairly basic version with no graphic frills. It performs the stand- ard calculation using values that must typed in by the user. After these values are entered, the thermal resistance of the heatsink is shown. AAVID Thermalloy is a large manufacturer of all sorts of heatsinks and related products. Various aids for heatsink dimensioning are available on this site I 4 L The Daycounter website offers a large number of programs (more than 50) for all sorts of electronics calculations. Ifs certainly worth your while to have a look around here. The heatsink calculation pro- gram i 5 l takes the standard approach (comparable to the RS pro- gram}: you type the various values in the boxes and the program calculates the thermal resistance of the heatsink. As an extra fea- ture, this site also provides some information on the standard values of frequently used heatsinks. The Changpuak site I 6 !, which is run by a Swiss electronics enthu- siast with a penchant for Thailand (hence the unusual name), also provides an online heatsink calculation program. It takes the same approach as the previously mentioned sites: you enter several val- ues, and then it calculates the thermal resistance of the heatsink, A few illustrations dearly indicate the components associated with the values to be entered. Like the previously mentioned site, this site also offers other items of interest to electronics enthusiasts. Stand-alone programs Professional heatsink calculation programs are usually rather pricey (too expensive for casual use), although they offer more features in return. However, there are also heatsink calculation programs that can be downloaded free of charge. We already mentioned the stand-alone version of the RthK Calculator program from Alutronic, Another handy program is Heatsink Calculator V2.0 from BK Soft- f Pnrn UntdM C.VtBMCafculaferllnl.pp ' 1 C Ife'V- r.* ^ 2 s m ■ Ml4» 3*- M I.M.A ■W ramiW. *■- — i j m COCi MJW 5 HI too t«E t t *P* 1 XU ! X DXK «33T iihhc an: C EQ£* am >VIM nm i m 4 EM i m :cm c m a xw azn 1# mtxt SSS® ntror dKto . (n i* 1 OH tm idtt* GSM b«w VWTi m 1 i£ eofia tm gw ll'rfiffli 1 3K> 1 X CDCOC 5«n PW a unr □ -031 ■ ajn 1 X torn :cnn cur n cjocs' □ais «»! 1 rn fl-iSX yHE> : am bum ocao 4 xx Am _ 1 Ml !« cdttr tflonp &*» dtttt ntttu fcr HbCi fW.- i n -L OWLlftt AM* *7 3DtE Lik fctf! f-XH Dami : l? PW dj»n G#*r >■ G-H11 In iftit irai tm n-cma cm* Cr«Mii ■ ntw i im: 1 Mil Hrfciil Pi* £ p.. r« Figure 5. As you can see from the Lattice Semiconductors Power Figure 6. An online calculator for forced-air cooling is available on Calculator program, a lot more factors are involved in power the Novel Concepts website, dissipation calculations for complex digital ICs. iG 02-2010 elektor COOLING Figure 7. Frig us Primore lets you configure your own heatsink (left) and examine its characteristics, including the temperature profile over the heatsink (right). ware, written by a Danish electronics enthusiast. This program can be downloaded from his website I 7 L The nice thing about this pro- gram is that you can choose which vaiue you want to have calcu- lated. You enter all the known or desired resistance values and leave the box of the value you want to know empty. This value is shown after you press the button. This means that in addition to calculating the maxim u m al lowable thermal resistance of the h eats i n k as with the other programs, you can also determine the maximum allow- www.parattax.com Friendly microcontrollers , legendary resources. Milford Instruments www.milinst.com Spinvent mwv.spinvent.co.uk PropScope USB Oscilloscope The PropScope (#32220) is a two-channel oscilloscope that is capable of reading 25 million samples per second wi*& ten bits of resolution over one, two, ten, or twenty volt peak to -peak waveforms. Power is provided via USB port, requiring only a single cable to connect the PropScope to any PC. The included DAC card provides an analog trigger, a four-bit digital trigger, an eight -bit digital to analog converter a four-bit NTSC/PAL output. The included software proviaes a traditional scope interface along with auto measurements, the ability to store and export waveforms, a function generator, a logic analyzer, a spectrum analyzer, an u vector sc ope. elektor 02-2010 17 COOLING Figure 8. The Microelectronics Heat Transfer Laboratory site also enables you to configure a heatsink according to your specific wishes. able ambient temperature for a given power dissipation when you use a particular heatsink. You can also perform calculations with more than one transistor on the same heatsink. Of course, we shouldn't restrict our attention to analogue appli- cations, Heat dissipation is a significant factor in the digital world as well, especially with complex ICs such as the CPU in your com- puter. Specifically for its own ICs, Lattice Semiconductors offers the Power Calculator program I s ), which you can use to calculate the power dissipation of Lattice FPCAs and CPLOs along with the necessary heatsink. Altera offers a similar program for its own ICs. which takes the form of a spreadsheet called PowerPlay PL These programs are a good deal more complex than standard heatsink calculation programs. Forced-air cooling or custom dimensioning? The Novel Concepts website l 10 ! has a program for heatsinks with forced air cooling (using a fan), which provides an easy way to determine how much power a heatsink with a given set of dimen- sions can dissipate in combination with a particular air flow. For this purpose, you enter the dimensions of the heatsink and the number of fins, as well as the expected speed of the air stream along the fins. This site also has several other calculators for spe- cialised cooling calculations. Of course, you may wish to design your own heatsink, or maybe you have a collection of several types of heatsinks for which you do not have any specific data available. In such cases, the websites men- tioned below can be very helpful. The website of frigus Primore, a company that specialises in ther- mal calculations, offers a variety of special programs for all sorts of thermal calculations. Some of them have demo versions that can be downloaded and used for a limited period. The online heatsink dimensioning program available here I 1 h is especially interesting. You can use this program to configure your own heatsink (dimen- sions, number of fins and fin height) and then calculate its thermal resistance, temperature rise per watt and several other things, all online. In addition, a three-dimensional drawing of the heatsink is displayed, and you can rotate ft in all directions using the mouse. You can then use the ‘Heat Sources’ tab to view the temperature profile over the heatsink, with the option of specifying exactly where the component is attached to the heatsink and the dimen- sions of the component. Very enlightening! On the website of Microelectronics Heat Transfer Laboratory (MHTL), you can also dimension a complete heatsink yourself and calculate its characteristics using the Natural Convection for Rec- tangular Heatsinks program l 12 S. Overview There are many manufacturers of heatsinks and related products, such as thermal pastes and insulation materials. A good starting point for looking for a suitable product or solution is the overview available on the Heatsink Guide site l 13 !. Although it’s certainly not complete, it does cover a tot of suppliers and sources. If you’re looking for an extensive, practically oriented description of heatsink calculation and fitting, you should certainty read through the ’Heatsinks’ article published in 1994 1 14 L (090872) Internet Links and References [ 1 ] http://sound.westhost.com/heatsinks.htm [2] www.alutronic.de/indexE. php?g=S&sg=1 [3] http://uk.rs-online.com/web/ generalDfsplay.html?id=infozone/cakulatQrs&ftle=heatsink [4| www.aavidthermalloy.com/technical/thermal.shtml [5] www.daycounter.com/Calciilators/ Heat-Sink-Temperature-Calculator.phtml [6] www.changpuak.ch/electronics/cak_23.html [7] http://bygselvhifi.dk/ heatsinkcak.htm [8] www.iatticesemi.com/products/designsoftware/ powercakulator.cfm [9 1 www.altera.com/support/devices/estimator/pow-powerplay.jsp [10) www.novelconceptsinc.com/ calculators-forced con vection-heat-sin k-therma I - resists nee. cgi [11 j wwwfrigprim.com/online/natconvJieatsink.html [12] www.mhtl.uwaterloo.ca/RScalciilators.html [13] www.heatsink-guide.com/ content.php?content=manufacturers.shtml [14] ’Heatsinks: how and when to use them’. Elektot Electronics, June 1994, pp 30-33 02-2010 elektor THE ORIGINAL SINCE [99 A PCB-EQflL Beta LAYOUT Specialising in Prototype PCBs Free Laser Stencil I with all Prototype PCB orders 1 WD prototype service Chemical Tin Finish (no extra cost) 0800 3 89 8560 1 Simply id orde B-POOL 1 send you r 0NUNE COM • sales r layout files i@pcb-pool.com I 1 I n. Pul SjSA.': weekly elektor newsletter ^ Take out a free subscription to E-weekly now Do you want to stay up to date with electronics and computer technology? Always looking for useful hints, tips and interesting offers? Subscribe now to £-weekly, the free Elektor Newsletter. Your benefits: * The latest news on electronics in your own mailbox each friday ■ Free access to the News Archive on the Elektor website * You’re authorized to post replies and new topics tn our forum n«emint» + MRIXX j i ' J"j , MWJtf ■? n r: ~Jt* -■ i ' ,.'r. Liii-iiii- ' -f r *-. i TTiM' -.l r-e r ' Lf.' f r~- injhiijt'ii h .■ --- a A-ru rilin' 4J A i m p !■*-" j c* -lin *-"•» -l- If -* w** ur *— ;i r ril i . i.ri , J . in M ■ hiFll*> Register today on www.elektor.com/ newsletter O l/) a> CL O u t/i O u 0- The new PicoScope 4000 Series high-resolution oscilloscopes i4 T B “ V s * ■ 4m ■ r « _e - .-f- i L ■ ■ — ■ * V s ■ ■ 1 an ( .. The PicoScope 4224 and 4424 High Resolution Oscilloscopes have true 12-bit resolution inputs with a vertical accuracy of 1 %. This latest generation of PicoScopes features a deep memory of 32 M samples. When combined with rapid trigger mode, this can capture up to 1000 trigger events at a rate of thousands of waveforms per second, * PC-based - capture, view and use the acquired waveform on your PC. right where you need it Software updates - free software updates for the life of the product USB powered and connected - perfect for use in the field or the lab Programmable - supplied with drivers and example code Resolution Bandwidth Buffer Size Sample Rate Channels 12 bits (up to 16 bits with resolution enhancement) 20 MHz (for oscillscope and spectrum modes) 32 M samples shared between active channels 80 MS/s maximum PicoScope 4224: 2 channels PicoScope 4424: 4 channels USB 2.0 Trigger Types Rising edge, falling edge, edge with hysteresis, pulse width, runt pulse, drop out, windowed Connection www,picotech.com/scope1054 01480 396395 elektor 02-2010 1 9 POWER SUPPLIES Stable Starting Points An introduction to electronic power supplies By Thijs Beckers (Elektor Netherlands Editorial) Practically every electronic circuit needs one: a power supply. The most common source of energy for all our circuits is the AC power outlet. The function of a power supply is to turn this voltage into something more useable. What do you have to look out for when it comes to designing this elementary part of a circuit? The simplest supply is of course a type that uses a single rectifier This Is followed by the full-wave rectifier. When an electro- lytic capacitor is added to this the resulting output begins to look like a reasonable DC voltage, A choke can be added in series (see Figure 1 ) in order to reduce the inevitable ripple at the output. When more stability of the DC voltage is required some further action is needed. The easiest is the addition of resistor and a zener diode (see Figure 2), This simple solution is suitable for currents up to about 50 mA (depending on the voltage). The circuit is often enhanced with the use of a transistor, where the voltage across the zener diode is used as a reference voltage. The regulated output voltage is then about 600 to 700 mV less than the zener voltage. The value for R in kilo-ohms has to be chosen such that the zener diode is properly biased and suf- ficient current can flow through the base of the transistor: R-(VS-V 0 )/(/ l +5) where / L is in mA. The next step (and one that is very easy to implement, see Figure 3) is to use one of the voltage regulators from the well-known 78xx and 79xx range, which are series regulators with three pins. The 78xx range regulates positive voltages, whereas the 79xx range is meant for nega- tive voltages. These devices have made life very easy when there is a need for a sym- metrical, stabilised power supply. The built in diodes at the outputs of the regulator ICs p rotect them fro m potential latch -ups when they're switched on. Voltage regulators come in several other varieties. The LM317 (positive voltages) and the LM11 7 (negative voltages) have an adjustable output: if you need more cur- rent. there is the LT1 08x range which can supply up to 7.5 A, Design criteria When selecting the transformer you have to take the fosses in the components and the expected ripple into account. The minimum required transformer voltage can be calcu- lated using this formula: V^iVo + A V min + y R + 2V D )/v2 Where V 0 = output voltage, AV mfn = mini- mum voltage drop across the regulator IC.V R = ripple voltage at the input of the regulator, V D = voltage across the rectifier diode. A good approximation for the ripple volt- age (V R ) can be obtained using the follow- ing rule of thumb: V R -//2p where / is in amperes and C is in farads. The frequency depends on the type of rectifier used (half wave or full wave). 20 02-2010 elektor POWER SUPPLIES All other values can be found in the data sheets for the components used. A small tip: Consider using Schottky types for the rectifying diodes. These can make the required AC voltage just low enough so you can choose a transformer with a lower output voltage. You have to keep the following in mind . .hen selecting the (bridge) rectifierand the smoothing (reservoir) capacitors: the elec- trolytic capacitors are only charged up for a relatively short period, which is when the voltage from the rectifier is larger than that stored in the capacitor(s), see Figure 4. This results in large spikes in the charging cur- rent. The area underneath the current spike corresponds to the power that the circuit has drawn from the eiectrolytic capacitor and which therefore has to be replenished by the rectifier. In order to reduce the ripple voltage, larger eleetrolyttes are often used. The consequence of this is that although the ripple voltage is reduced, the time available to the rectifier to recharge the electrolytic is also reduced. Assuming that the power con* sumption is the same, the size of the current surge will increase significantly (the area under the graph remains the same), which can have more serious consequences (such as burnt-out rectifying diodes). In practice the transformer will be the larg- est limiting factor for the peak current. It will go into saturation fairly quickly and won't be able to supply the theoretical current requested of it. When it comes to selecting the diodes for the rectifier you can use the fo I (owing rule of thumb; The maximum current that the diodes have to withstand is \2 times the peak current that the secondary winding of the transformer can deliver. To be on the safe side we nor- mally specify twice this peak current. Don't forget that with the large currents involved it will often be necessary to put heatsinks on the rectifiers to keep them cool. A good approximation for the values to use for the electrolyses is that you need about 2200 pF per Amp, Internet For more complex designs such as switch- mode power supplies there are tools and programs available from several (semicon- ©~ f L Vo > — © “ €) Vo * — © 1 (°> — - T 1 © 09M74 ■ 12 Figure 1 . A bridge rectifier, a choke and an electrolytic capacitor are enough to provide a reasonably constant voltage. Figure 2. The addition of a zener diode as a reference increases the stability of the output voltage. Figure 3. Thanks to integrated voltage regulators such as those from the 78xx and 79xx range the creation of stable supplies has become child's play. Figure 4. The peak current that occurs during the charging of the electrolytic capacitors can become quite large. elektor 02-2010 21 POWER SUPPLIES Potkm Supply l>ci»an Spflc and LTC FioduCi Spjh^i Basic Power Supplies Requirements: # u( Dl/lpUl f 5 ) m Output RM I Minimum VJn 10 V I 12 v if A Majdmtim Vki 1-t V NairMT^I Vtn 12 V Functionalities: P crwx?r Good intfkator m 3 Oft. Pock Sync, 1 ^3 Vout Tracking J YES S,t?EiWj te Sensing | YES l! Margining [ YES 1 TVpe | ALL l) Sy dir cl 1 I Close 0.2 0.4 0.S 1 1.5 2 3 4 5 7.5 10 Current [A] Thickness of copper track = 35 pm 9-30031 - ii Figure 5. The program LTpowerCAD supplied by Linear Technology Figure 6. This graph shows just how easily lets you specify a large number of parameters for your power supply. PCB tracks can heat up. ductor) manufacturers. An example of this is the ‘program* LTpowerCAD H I from Linear Technology. With this Microsoft Excel based tool it is very easy to design a (switch-mode) power supply that satisfies all the parame- ters specified on the form (see Figure 5), The online tool Webeneh Power Designer \2\ from National Semiconductor also bursts with options and features. This list can be extended with the tools from Fairchild 1*1. WPer Design Software v,2,24 HI from STMi- croelectronics and Sw/ftberPro l 5 1 from Texas Instruments. These are probably the most well-known. Bear in mind that most of these programs are only suitable for use with (a certain range of) special ICs made by the manufacturer in question. All of them are however free to use. For those of you who would like to find out more about designing switch- mode power supplies, take a look at the website at www. smps.us, This site contains a huge amount of information on the subject, including an overview of the topologies used 1 6 L Another interesting website is at www.powereslm. com. Here you can design circuits from ‘Switched Mode Power Supplies 1 (SMPS)* which satisfy all the criteria that you've specified, PCB layout When a circuit diagram on paper has to be converted into a PCB layout we obviously come across alt sorts of physical properties and obstacles. A few tips are very useful here and we wouldn’t want to keep them from you. The smoothing capacitors should be positioned as dose as possible to the point that needs smoothing. This means close to the components rather than the supply. Long PCB tracks introduce extra imped- ance (especially at higher frequencies) that reduces the effectiveness of the smooth- ing. In circuits that work at higher frequen- cies extra care has to be taken to keep these tracks as short as possible. Remember that current always flows in a loop. As you can see from Figure 3, current loops also play a big role in power supplies. The red arrow indicates that the supply cur- rent flows in a loop via the Ground. When calculating the total path length of the cur- rent you therefore also have to consider the length of the Ground track (or Ground plane if it exists). The peak current into the electroly tics that was mentioned earlier also flows via the Ground connection. To avoid unwanted Interference in 'heavy 1 power supplies it is best to keep this current loop outside the Ground plane. This is done by wiring this separately and to choose the connection between the two large smoothing capaci- tors as the Ground point (where the Ground symbol Is drawn in the circuit). This is some- times called the star point. Another area that should be given consider- able thought when designing the PCB is the width (and thickness) of the tracks. Not only do they have a certain resistance, they can also heat up. The graph in figure 6 shows how much the temperature rises with cer- tain widths of tracks and the size of the current through them. As can be seen, the temperature rises quickly as the current increases. It is sensible to limit the temper- ature increase to 30-40 degrees C because the graph shows the rise under ideal circum- stances. Once the PCB has been mounted inside a case it can't lose the heat as easily and the temperature could rise much fur- ther, which could have disastrous conse- quences on the circuit, „ (090874) Internet Links [1 ] www Ji near.com/designtools/ soft ware/ Itpowercad.jsp [2] www, national.com/ analog/ webench/power |3j www.fairchildsem3.com/design_tools/ index.html |4| www. st.com [5] http://focus.tj.com/docs/tool5w/fofders/ pi int/switc herpro.htm I 1 6j www.smps.us/topologies.html 22 02-2010 elektor POWER SUPPLY TESTER Torture Rack By Harry Baggen {Elektor Netherlands Editorial) and Ton Giesberts (Elektor Labs) How can you find out how stable a lab or benchtop supply is? You can get a good impression of the stability of a power supply under various conditions by loading the output dynamically* This can be implemented using just a handful of components. Apart from obvious factors such as output voltage and current, noise* hum and output resistance* it is also important that a power supply has a good regulation under varying load conditions* A standard test for this uses a resistor array across the output that can be switched between two values* Manufacturers typically use resistor values that correspond to 1 0% and 90% of the rated power 1 output of the supply. The switching frequency between the values is normally several tens of hertz (e,g. 40 Hz). The behaviour of the output can then be inspected with an oscilloscope, from which you can deduce how stable the power supply is. At the rising edge of the square wave you will usually find an overshoot, which is caused by the way the regulator functions, the inductance of the internal and external wiring and any output filter. This dynamic behaviour is normally tested at a single frequency* but the designers in the Elektor lab have tested numerous tab supplies over the years and it seemed interesting to check what happens at higher switching frequencies. The only items required for this are an ordinary signal generator with a square wave output and the circuit shown in Figure 1 . You can then take measurements up to several megahertz, which should give you a really good insight for which applications the power supply is suitable* More often than not you will come across a resonance frequency at which the sup- ply no longer remains stable and it's interesting to note at which frequency that occurs* The circuit really is very simple. The power MOSFET used in the cir- cuit is a type that is rated at 80 V/75 A and has an on-resistance of only 10 m£2 (V GS - 10 V). The output of the supply is continuously loaded by R2* which has a value such that 1 / 1 0 th of the maxim um output current flows through it (R2 = V max /0.1 / max ). The value of R 1 is chosen such that 8/ 1 0 th of the maximum current flows through it (R1 = V ma JQ*8/ max )* Together this makes 0*9 f max when the MOSFET conducts. You should round the calculated values to the nearest El 2 value and make sure that the resistors are able to dissipate the heat generated (using forced cooling* If required). At larger output currents the MOSFET should also be provided with a small heatsink. The gate of the FET is con- nected to ground via two 1 00 O resistors, providing a neat 50 0 impedance to the output of the signal generator. The output volt- age of the signal generator should be set to a level between 5 V and 1 0 V, and you Ye ready to test. Start with a low switching frequency and slowly increase it, whilst keeping an eye on the square wave on the oscilloscope* And then keep increasing the frequency.,* Who knows what surprises you may come across? Bear in mind though that the editorial team can't be held responsible for any damage that may occur to the tested power supply; the use of this circuit is at your own risk! (090875) elektor 02-2010 23 POWER SUPPLIES Battery Checker IN II _ | By Rudiger Britzen (Germany) A battery pack is only as strong as its weakest ceil. This intelligent battery checker will determine the state of cells so that an optimal selection can be made from them to form a pack. It is essential to measure not only the capacity of the cells, but also their internal resistance. In theory it is relatively easy to determine the capacity of a battery: it is the integral of the discharge current over the time it takes a fully charged cell to reach its speci- fied end-of-discharge voltage. This voltage is different for cells of different chemistries. In practice a single cell is discharged and the current Es measured regularly. Each measurement is made over a suffi- ciently short period that the current can be considered as constant over that period, at least compared to the overall accuracy of the measurement. The current measure- ments are summed and the result converted to a capacity in the appropriate units, usu- ally mAh (milliampere-hour). Discharge is stopped when the end-of-discharge volt- age is reached. Criteria When selecting cells to make up a battery pack the total capacity is not the only crite- rion of importance. Equally important is the internal resistance of the cells, which can be calculated by dividing the load current into the difference between the terminal volt- age under load and the open-circuit termi- nal voltage, It is also interesting to know at what current the end-of-discharge volt- age is reached and the total charge drawn from the cell to reach this point. The battery checker has a ‘constant voltage' mode to make this kind of measurement, on which subject more in the section below describ- ing the software. In order to be able to provide adequate load for powerful cells, discharge currents as high as 10 A are needed. Commonly-available battery packs rarely consist of more than ten NlCd or NiMH cells, and so a voltage range of 0 V to 1 2 V is sufficient. The user interface consists of a 2-by-1 6 LCD panel, a three-col- our (red, yellow and green) LED, four but- tons, and an EIA232 interface for configu- ration and control. The battery voltage is measured using separate voltage sense wires to ensure that the readings taken are not affected by the voltage drop along the wires used to carry the discharge current. This voltage drop will be significant at the higher discharge currents envisaged. The circuit The battery checker internally uses three different supply voltages, which are gener- ated by the circu it i nvol ving TR 1 , FI * B1 , C 1 , IC1 , IC2 and ICS and associated decoupling 24 02-201G elektor POWER SUPPLIES LCD1 SC337-J5 0TLI31 ■ II Figure 1 . Circuit diagram of the battery checker. The battery under test is connected to two separate pairs of terminals, one pair to carry the discharge current and one to measure the terminal voltage. elektor 02-2010 25 POWER SUPPLIES Features - Voltage range o V to 12 V (corresponding to o to 10 NiCd or NiMH cells) * Discharge c urrent up to 1 0 A * Internal resistance measurement at the start of the discharge process (average of ten readings) - Constant current discharge with switch-over to constant voltage discharge * Display of set-point and actual values of voltage and current - Display of discharge time, total charge. Internal resistance, heatsink temperature and fan speed * Controlled using four pushbuttons to set cell count, required discharge termination voltage and required discharge current * Calibration facility for A/ D con verter and cu Trent reg ulator PWM * Backlit 2-by-i6 character LCD * Status LED * Heatsink temperature monitoring wiLh fan control (proportional controller) * Serial interface to output values and to receive control messages - Maximum power dissipation 120 W (with special cooling), adjustable 40 W limit In software * Free download of software and printed circuit board layouts at www.dektor.com/ 071131 Figure 2* The Windows software displays the settings and the instantaneous measured values. 00 : 00:01 00 : 05:13 00:10:25 00:15:37 00:20:49 00:25:01 00:31:13 00:02:37 00 : 07:49 00 : 13:01 00:10:13 00:23:25 00:20:37 00:33:49 00:36:25 D7113I-13 1062 mAh 944 mAh 526 mAh 706 mAh 590 mAh 472 mAh 354 mAh 236 mAh 1l£l mAh Figure 3. A planned extension to the software will feature log files and graphical output, such as this plot of charge against time. capacitors. The voltages are: 5 V, for the microcontroller and display; TO V, for the current regulator; and 12 V for the fan. As is so often the case the circuit centres on a microcontroller, IC5, Around it we have an 8 MHz clock oscillator (XI ), 2.56 V pre- cision voltage source D1 used to provide a reference for the analogue-to-digital con- verter, watch crystal X2 and quad opera- tional amplifier IC4. IC4.A acts as a buffer amplifier for the PTC thermistor attached at K8, used as a tem- perature sensor. The opamp is wired as a non -inverting amplifier and provides a gain of 2 for the voltage dropped across the thermistor. IC4.B is also configured as a non-inverting amplifier and provides a gain of 5 for the voltage dropped across precision shunt resistor R38: this voltage is directly propor- tional to the discharge current. IC4.D buffers the battery voltage, which is divided by 5 by the potential divider formed by R 1 9 and R20. The battery under test is connected to the circuit in two places: at K7 where the discharge current is drawn, and between pins 8 and 10 of K6. where the terminal voltage is measured. Separate connections should be made to the battery terminals from these points on the circuit, as mentioned above, IC4.C forms part of the current regulator. A DC level, smoothed by the low- pass fil- ter formed by C20 and R35, appears at its non-inverting input. This voltage is one tenth of the average value of the PWM sig- nal present on PD4 (pin 1 8) of the micro- controller, because of the potential divider comprising R32 and R35, The output of the operational amplifier is connected to the base of T2 via R33, and the emitter of this transistor is connected to the gate of power FET T4 via the current divider formed by R34 and R37. The values of R33, R34 and R37, together with the current gain of T2 and the gate capacitance of T4 t determine the char- acteristics of the current regulation control loop. The voltage across R38 in the drain circuit of T4 is proportional to the instanta- neous discharge current flowing. This volt- age is taken via R36to the inverting input of IC4.C There are twofuseholdersfor F2 and F3 (each for a 6.3 A fast acting fuse) in the source circuit of T4 P as the fuseholders are 26 02-2010 elektor POWER SUPPLIES not rated to carry 1 0 A. T3 allows the cur- rent regulator to be switched off quickly by pulling the base of T2 to ground. The circuit around IC6 is in accordance with its data sheet, converting between the TTL levels of the microcontroller and EIA232 voltage levels. Firmware The software running in the microcon- trailer is i nterrupt-driven. The body of the code (at main) runs after a reset and con- figures and initialises all the inputs, out- puts and timers (Initialize, RefreshLCD). The code then enters an infinite loop, react- ing to watch crystal timer overflows (every 250 ms), button presses and the reception of complete data messages, setting outputs appropriately. Timer 0 generates interrupts at a frequency of 488.28 Hz. The service routine reads the state of the buttons and performs debounc- ing. Timer 1 A and Timer 1 B are configured as PWM generators to drive the current reg- ulator (Timer 1 B) and the fan (Timer 1 A). Timer 2 is clocked by the 32.768 kHz watch crystal and overflows every 250 ms. This triggers the sending out over the EIA232 interface either of Instantaneous measured values and set points (current, ceil volt- age, cell count, charge, discharge time and so on) or of device settings (characteristic curves, maximum values, parameters for constant voltage mode), in response to a corresponding request. Also, the interrupt flag ClockCrystalTimer is set, which causes the function CalculateValuesQ to be called from the main loop. Ca3culateVa1ues() first performs analogue- to-digital conversions on the battery volt- age* the voltage dropped across the shunt (which is proportional to the discharge cur- rent), and the voltage across the thermis- tor (which depends on the heatsink tem- perature). These values are used to calcu- late settings for the fan and the discharge current (if enabled), as well as to update the running total of charge. The function also implements ‘constant voltage mode' and the measurement of the internal resistance of the battery. If the heatsink temperature exceeds the value ‘CSMAxTemperatureln- Cefsius 1 discharge is stopped for the time period specified by 'CSCoolDownPeriodL In 'constant current mode' the battery is Ini- tially discharged at a user defined current (‘SetCurrentlnlOmA') down to a preset voltage ('SetVoltagelnl DOmV + 'CSCurren- tReductionUDeltaln 1 0OmV 1 ). Then, as soon as the voltage (‘Measu red Voltagetn 1 OOmV') has remained below the preset level for given time ('CSCurrentReductionTime'}, the discharge current is reduced in steps (‘CSCurrentReductionAmount’) until a min- imum value {‘CSCurrentReductionMinCur- rentlnlOmA'} is reached. The unit contin- ues to discharge the battery at this current until the final discharge voltage (‘SetVolt- agelnl GOmV) is reached. The graph of cur- rent against time gives a clear picture of the performance of the cell, and is much more informative than a bald capacity value. The internal resistance of the battery is measured at the start of the discharg e pro - eedure. The measurement is done by first measuring the open-circuit voltage of the battery and then measuring the terminal voltage with the specified discharge cur- rent being drawn. The measurement is repeated ten times at intervals of one sec- ond. The two smallest and the two largest calculated values for the internal resistance are discarded and the remaining six values are averaged, the result being displayed on the LCD, The code to perform this calcula- tion is unfortunately relatively involved and not necessa ri ly very easy to understa nd : this part of the Ca leu late ValuesQ function may be hard to modify. The function ProcessKeyQ includes the state machine behind the battery checker. Depending on the current state, a keypress recognised in the Timer 0 overflow interrupt code will cause a switch to a new state or some other response. The function RefreshLCDQ writes informa- tion to the LCD panel depending on the cur- rent state of the system, Windows software The Windows software gives access to the basic functions of the battery checker and can also be used as a basis for expansion. The program displays the set points for cell About the Author Rudiger Britzen, 32, studied Electron- ics and Information technology at the German Army University in Munich, and works principally as a systems engineer in the defence industry. Alongside that he is also, as Britzen Embedded Systems, an independent hardware and software developer. voltage, discharge current and cell count, and the measured values for current, volt- age, heatsink temperature, fan speed, dis- charge time and total charge (see Figure 2). These set points and the 'constant voltage discharge' setting can be configured. If a value of less than 1 00 is entered in the field 'Reduce Current to %\ the discharge current will be reduced by the given percentage fac- tor at the end of any period longer than the time given at ‘Reduce Current after' during which the cell voltage remains below the value 'Final Cell Voltage' plus 'Delta Cell Voltage'. This process repeats until the min- imum discharge current is reached. The unit's status is reflected in the status fane of the window as a virtual LED, with colours corresponding to those of the LED on the unit. After connecting the battery checker to the PC, choose the correct COM port set- ting and initialise communication by click- ing on the ‘Connect’ button. If the connec- tion is successfully made the input fields will become active and the unit can be config- ured and controlled. The author is planning an expanded version of the software that will allow the display of log data, graphical presentation like that shown in Figure 3. and configuration of all the new settings. Protocol The author has developed a protocol for communications between the PC and the battery checker, using seven-byte mes- sages to carry sixteen-bit values with eight- bit identifiers. The identifier is split into two bytes and the data value into four bytes, and a checksum is appended. The header file RBE_SP16.h and code RBE_SP16.c encap- sulate the protocol and also implement a FIFO buffer* Every 250 ms by default the battery checker send out either the set-points and measu red values or, in response to a request, the core settings of the device (the variables whose names begin 'CS') as a single message with appended checksum (31 bytes in total). elektor 02-2010 27 POWER SUPPLIES COMPONENT LIST Resistors (5%, Q.25W unless otherwise indicated) R1 -R4 t RG-R1(X R1 5.R16.R1 7. R19. R21-R24, R26-R29, R33= 10k_Q R5 - 4,02kQ ( 1 %) R1 1 ,R1 2,R 1 8,R31 *R40 = 1 k£2 R1 3 - 2,2kQ R14, R30 t R39 - I 50 Q R20 t R25 = 2.49kQ (1 %) R32, R36 -47kQ R34 - 100 Q R35 « 5,6kQ R37 - 47011 R38 = 50mO 0.5 % precision power resistor, e.g, Isabellenhutte Heusler type PBV 0,05 (Conrad Electronics # 447382*6 2) PI = 1 Qkfl preset, horizontal P2 - 2,5kQ preset, vertical Capacitors Cl = lOGQpF 63V radiaUead pitch 10mm C2.C4,C6, C9-C12 - lOOnF 50V ceramic C3.C5.C7 = 47|iF 25V radial, lead pitch 0.1 inch Cl 3-C1 7 = tj.iF 1 6V radial, lead pitch 0. 1 inch C8.C18.C1 9X21 = 10nF ceramic C20 = 1 OOpF 1 6V, radial, lead pitch 0.2 inch Inductors L I = 1 00 pH miniature choke (resistor body) Semiconductors 81 = D8104C (Taiwan Semiconductor). 1 A 400V bridge rectifier (e.g. Farnell # 706796) D1 - LT1009CLPG4 (T)). 2.5V voltage reference. TO-92 case (e.g. Farnell # 9589724) D2 = 1N4004 1C 1 = 7805 with 1 5 K/ W heatsink IC2 = 7810 0-7812 !C4 = TLC274BCM (Tl), DIP- 14 with socket ICS = ATmega32-16PU (ATM EL). DIL-40 with socket, programmed, or* dercode 071 131*41 ‘ IC6 = MAX232N (Tl) f DIP-1 6 with socket T1 J2J3-BC337-40 T4 = IRFP064NPBF (International Rectifier, e.g. Farnell # 8649227) 15 - BD679 Miscellaneous K1 ■ 2-way PCB screw terminal, lead pitch 7.5mm K2,K3,K8,K9 = 2-pin pinheader, 0.1 inch lead pitch K4 = 3-pin pinheader, 0, 1 Inch lead pitch K5 - 1 6-way (2x8) pinheader, 0, 1 inch lead pitch K6- 10-way(2x5) pinheader, 0.1 inch lead pitch K7 = 2 solder pins, 1 .3mm diam, LCD 1 = 2x16 characters, e.g. DEMI 62 17 SYH-PY /V (Elektor-Shop # 030451-72) TR1 = PCB transformer, 1 2V 0.33A secondary, e.g. E138/ 1 3.6 4.0 VA (Pulse), part no.: 038-5414.0 (230V primary), 038-5402.0 (115V pri- mary) or NAHM type BV El 382 1191 (230V primary) XI - 8MHz quartz oscillator module, e.g. AEL Crystals type O8M000000I.642 (Farnell # 9509712) X2 - 32.76 kHz watch crystal, cylindrical case FI - fuse 0.31 5A 250V, slow blow, dim, 5x20mm. inch fuseholder and cap F2 t F3 = fuse 6.3A last, dim, 5x20mm, inch luseholder 9- way sub'D socket 4 pushbuttons for front panel mounting Fan, 1 2VDC. 80mA, dim. 40x40mm KTY 81-122 (MXP), PTC temperature sensor. SOD-70 case Heatsink, Fischer Elektronik type SK 68/50 SA, dim, 50x46x33mm, rat- ing 4.6K/W Bicolor LED (green/red), 5mm dtam. Heat conducting glue for securing temperature sensor to heatsink Terminal posts. 4mm diam. (1 red, 1 black) PO nos. 071 131 -1 f (PSU) and 071 131 -2' (main board) Kit of parts no, 071131-71 containing RGBs, a programmed microcon- troller and all parts (except case) is available from Lhe Elektor Shop, see www.eleklor,com/07 1131 Figure 4. Component mounting plan for the power supply board and the main board. 2 * 02-2010 elektor POWER SUPPLIES Figure 5. The Eiektor laboratory prototype under test. Construction and operation Both the main board and the power sup- ply board are populated exclusively using through -hole components (Figure 4), The tracks between the connection points for the 1 .5 mm 2 wires (at l<7), the FET and the shunt should be tinned over with extra solder (assum- ing the board does not have a solder mask) or reinforced using suitable soldered silver wire (if the board does have a solder mask). It is recom- mended to test the boards separately, starting with the power supply board. It is essential to ensure that all wires and components carrying mains voltages are adequately Insulated and cannot be touched, fn addition, it is advisable to use an isolation transformer. Check that the correct voltages appearon K2. Power the main board using a laboratory supply set to a conservative current limit of say 1 00 mA. If nothing appears on the dis- play, adjust P2 to set the contrast suitably. If everything appears to be working so far, you should find operating the unit self- explanatory. Two buttons {‘Up' and ‘Down' navigate through the menus, the third but- ton ('OK') confirms an input, and the fourth ('Back'} cancels an operation. With the main board connected to the power supply board, adjust PI so that the voltage on D1 (i.e., on pin 32 of ICS) is exactly 2.5 V. The next step is to calibrate the analogue-to-digital converter (for the battery voltage and the shunt voltage) and the current regulator. To do this, go to the calibration menu and select the battery voltage ADC, Short the battery voltage measurement terminals (pins B and 10 of K6) together and press the confirmation button to calibrate the 0 V point. Now con- nect the voltage measurement terminals to as precise a 6 V source as possible and press the confirmation button again. Next, calibrate the current regulator. Con- nect a voltage source capable of delivering at least 2 A to the load terminals of the bat- tery checker (on K7) t with an ammeter in series with one of the connections. Then select the appropriate menu Item and adjust the PWM value using the navigation buttons to make the current in the load as dose to 2A as possible. Finally, calibrate the ADC for the shunt voltage. Again, a 2 A source is required connected to the load terminals. Simply select and confirm the appropriate menu option. The calibration values can be stored in EEP- ROM by selecting the “Store settings 5 menu option. The text is followed by a * * 5 if one or more of the current settings differs from that stored in EEPROM, The parts list does not recommend a par- ticular enclosure for this project. The author used a TEKG CAB 022.9 enclosure for his prototype, and for the Eiektor prototype we used a Retex Elbox 33030202, The parts mounted on the front panel (LCD, buttons and sockets) are connected to the relevant points on the printed circuit board using ribbon cable or wire. For the current-carry- ing connections wire with a cross section of at least 1 ,5 mm cross-sectional area is needed. A DfY battery holder Ordinary battery holders and charging cra- dles are only really suitable for currents of up to about 3 A. A cheap plastic battery holder may start to melt around the con- tacts at a discharge current of 2.5 A. The problem does not arise with cells that have solder tags. For individual cells without solder tags the author found a solution using a ratchet clamp found in a local tool shop next to the ordinary woodworking damps. With a bit of skill It Is possible to repurpose the damp as a high current discharge clamp'. The ratchet damp has a smooth action without steps and so can easily grip cylindrical ceils, allowing currents of up to 1 0 A to be drawn without significant temperature rise. How- ever, it Is important to be careful to avoid overloading cells: during testing the author succeeded in inadvertently destroying two brand new Panasonic A A cells through over- heating in constant voltage mode {U=0,9 V, current reduction after 1 s) with an initial current of TO A, (071131) eiektor 02-2010 29 PC-BASED ELECTRONICS Winamp Controller By Markus Hirsch (Germany) ; project implements a physical progress bar for Winamp. Here m a small ATmega microcontroller ^ uses the USB interface to provide a bidirectional link between the Winamp software and a hardware studio fader, which acts as a combined indicator and entry device. i A variety of remote control devices for Winamp I’l and other PC-based media play- ers have been available for a good while. They include infrared interfaces (Winlirc), web browsers (Ajaxamp), and hotkeys on the keyboard. All of these systems have Features * K v sir al prog res s bar for Wina mp * - ; m ard and reverse using a physical * : .ver supply via USB port * Data transfer via USB port * So ng t f I e d sp lav on LCD module (2 xi6 characters) * F our buttons for Play. Stop, Next, and Previous * Runs wrth Winamp 5 5 (tested with Winamp 5.541) one thing in common, which is that they are limited to buttons or keys or use virtual progress bars on the computer monitor. If you want to have a complete hardware interface unit with the same level of sophis- tication as the virtual Winamp design, you need a physical progress bar The difficulty with this is that it falls outside the usual scope of electronics for electro- mechanical devices. The solution must be simple and reproducible, and It should be possible to build it without having your own machine shop. A standard studio fader unit provides a suit- able solution. This is a motorised potenth orneter, consisting of a linear mono slider potentiometer driven by a DC motor. The potentiometer and motor assembly forms a compact unit that is easy to use (Figure 1 ). The drive requirements are also relatively simple, so it can readily be integrated with the software to serve as a physical progress bar. The software also allows its behaviour to be modified and optimised relatively easily. You can also use this project as a basis for your own modifications or extensions, since the source code of the Windows program and the AVR firmware is available Hardware The circuit (Figure 2 ) uses well known, read- ily obtainable components. It is built around an Atmel ATmega 16 AVR microcontroller. Here the internal oscillator can be used, since the circuit does not require especially high processing power. A standard LCD module is used to display the song titles. It can easily be driven using BAS- COM AVR code [I K Four simple pushbuttons connected to four I/O pins of the microcon- troller are used to control the operational functions of the media player (Play, Stop, Next 30 02-2010 elektor PC-BASED ELECTRONICS and Previous)* The internal pull-up resistors of these pins are enabled, which saves four resis- tors on the board* The buttons pull the I/O pins to ground when they are pressed* Tne connection to the PC Is provided by the USB port. This has the advantage that the unit can also be used with relatively new PCs that have only USB interfaces. In addi- tion, the USB interface provides a 5 A/ sup- ply voltage with sufficient current capacity, so we can dispense with an external power supply for the Winamp controller, A USB / serial converter in the form of an FT232RL 1C in the circuit provides the link to the USB port. To ensure that the Winamp controller is recognised by every PC as a USB device and avoid the need to configure the Com port in the Windows program before using the controller, it is necessary to program this FTDI 1C with suitable USB descriptors. This Is described in more detail later on. An L293D (IC3) is used to drive the motor of the studio fader. Only one of the two H bridge drivers in the 1C is used. As the volt- age (5 V) and the current (500 mA maxi- mum) available from the USB port are both somewhat on the low side forthe fader used here (see 'Practical aspects'), PWM mode is not used for driving the motor. As a result, the motion of the slider is limited to a fixed speed. The software compensates for this by working in small steps. The feedback signal that indicates the slider position to the microcontroller is provided directly by the potentiometer, which is wired as a voltage divider con- nected between the 5 V supply voltage and ground* The wiper of the potentiometer is connected to pin 4 of connector K2, which in turn is connected to I/O pin PA4 of the ATmega* This pin is configured as the input of the internal A/D converter. The voltage on the wiper of the potentiometer is thus digitised and processed in the software as the position value. As a component designed for use in audio mixing boards, the studio fader has the advantage of a low noise level. This means that the motion of the potentiometer won’t interfere with your listening pleasure* AVR firmware As already mentioned* the software for the AVR microcontroller has been developed Figure 1 . An Alps studio fader is used as a combined indicator and entry device. USfl-S vcct> CT 'ne- l ■u MUn U £ 1 s PM (ADM. PC*C£CL> PCI :50A;- p«**K3> PC3 [TCty PAS (ADC n PCS (TIKI PAiMflCJl PCifTMl- PAKAOCi! PAti’JtOCfii PCS |TDI| PCS |T05£l | ftJ (ADCTJ 'C2 pcTfTOSCZl ATn'ngalfMGFC PM PHO!] pBMCKrrsj pdi itkdi- PB1 (T1| PBi[MTQh PD) PEI lAINI.'DCyi HHLQtiB! PfiiffSj PPIlQCiAt PSilMQ^i PH |EP| PflS |HiSO;i P07 |QC2| P3T iSCKj # i 0 ^ 3 RESET E i S |3 X iiii & c- DEB - O - O t * TA ! PT X 31 1? Figure 2, Schematic diagram of the Winamp controller, which the PC sees as a USB device. elektor 02-2010 PC-BASED EL ECTRONICS Figure 3, The Visual Basic program Wincon links the external hardware to the Winamp API via USB. with BASCOM, In normal operation, the software compares the value received via the serial interface with the current position of the slider. If these values differ, the slider position is adjusted accordingly. If one of the buttons is pressed or manual repositioning of the slider is detected, the AVR microcontroller sends the PC a data byte with the new position. Manual repositioning is recognised based on various trigger conditions: The slider value changes while the motor is not energised The slider value changes while the motor is energised, but in the wrong direction The slider value changes while the motor is energised, but at the wrong speed (the slider is blocked) Windows software On the PC side, a small Visual Basic pro- gram connects the external hardware to the Winamp API (with the aid of the USB r . Itavtu u-i-npir tl® ft* -rt si m rf ra l - 4E1 ■ i. '..^r * -p- ft* ■ * ■ „ * Jj ftp*"* ■ j, at AlW*'** * i ■ KnUrti * f Ho rtvr* , i, w.^1 - J (COM * l#T | J (d hit flfTI i J »r«t' CMrrigXMIl * ♦ HlfcHWU + * yr* l * ( IrUr^-k" n Figure 4. The Winamp controller In Windows Device Manager. The FT232RL designators are programmed to a I low the Winamp controller to be recognised as a USB device. interface), it is not necessary to configure a Com port setting, since the function Ft_ getport() can determine which serial port is being emulated (Figure 3). If the device is COMPONENT LIST Resistors R 1 - see text R2 ~ 1 OkiT PI - IflkU preset P2 = mixing desk fader with motor, Alps type RSAON i 1 M9 ( 1 Oki>) oi RS60N M M9 1 5ku); see text Capacitors C1,C2,C3,C4,C5.C6.l 9 = IQfJnF C7.C8 * 47 pf CIO = 47yF 16V radial Inductors U.12 - lOpH axial choke, e.g Bourns jW Mil- ler 5300- 13-RC Semiconductors IC1 =FT232RL(FTDt) IC2 - AT mega 1 6- 1 6FU { Atmel), programmed IC3 - L293D (ST) or L293DNEE4 (Tl) Miscellaneous K1 - USB socket, type B. PCB mount K2.K4.K5 = 5-way 511 pinheader. 2.54mm tead pitch K3 = 6-way OIL pinheader, 2 54mm lead pitch SI -S4 = pushbutton. 5mm footprint; PCB mo u nl , e . g M u I tit nm p M 1 DT 56- 5 H LCD1 = LCD module 2x 1 h characters, e.g. Display tech 162C PCB 8 090531-1 Project software, file u Q9D531 1 1 from 1 5 1 Kit of parts including PC B item ft 090531*71 from the Elektor Shop oi [5) Figure 5, The Elektor lab prototype of the Winamp controller. 32 02-2010 elektor ELECTRONICS Figure 6. The fully assembled lab prototype PCB. not connected, no connection is found and an error message is displayed. The p rogra m has to perform only th ree sim- ple tasks, which allows it to be very com- pact and tidy: 1. The current position of the virtual progress bar in Winamp is sent to the hard’ ware every second. 2. If the external hardware reports that the fader has been repositioned manually, the software executes a 'fast forward 1 or 'fast reverse' to the corresponding position in the song. 3. If a new song is played, its title is sent to the hardware in 32-bit format If Winamp is not running, an error message is displayed or the icon in the system tray turns red. The software can be modified or extended using the free Visual Basic Express devel- opment environment |3 L For example, you could change the functions of the control buttons. When one of the four buttons is pressed, a value in the range of 251 to 254 is sent The value range from 0 to 200 is reserved for the slider position, FT232RL programming The benefits have already been mentioned briefly: if the descriptors of the FT232RL are programmed properly, Windows pro- grams (such as programs generated in Vis- ual Basic) can recognise the USB device and independently detect the associated tom port (Figure 4), This requires changing the product descrip- tion of the FT232RL into 'Wincont The driv- ers for the USB-to-sena! converter are usu- ally available on the Windows system, so no installation will be required. The PID and VID however have to remain at the original FTDI value. The free FTProg program from FTDI W js used here for programming. This program Is well documented. A XML file available on the Elektor website 151 for free downloading is used for device program- ming. If you want to make do without this step you may select a COM port manually in the VB program. The source code of this program is also included in the download- able Zip file. If it is desired to retrofit the automatic COM port function to your own project, all you have to do is change the product name into TT232L’ and convey the relevant string as a parameter to the FT-getportQ function. Practical aspects A printed circuit board (Figure 5) has been developed for assembling this circuit. Jt con- sists of two parts: a microcontroller board and a keypad board with four buttons, which can be separated from the micro- controller board. Assembly is straightfor- ward, with the exception of the FT232RL (ICl). It is the only SMD component in the circuit, and it is fitted on the underside of the board. With a bit of practice, the 5SOP- 28 package (lead pitch 0.65 mm) can be sol- dered reasonably well by hand. The LCD module is also fitted on the under- side of the board. It can be plugged in using pin and socket headers (see Figure 6), The value of R1 should be chosen according to the LCD module that is used. If a module Prototype & small series PCB specialists EURO PCB proto STANDARD pool r * IMS pool dedicated prototype service widest choice 1 - 100 pm technology metal -backed — TEC H pool CIRCUITS On demand Call us; 020 8816 7005 Email: euro@eurocircuits.coin at Southern 'Electronics Show: Stand all options up to 16 layers ALL S Instant online pricing Instant online ordering Low pooling prices Deliveries from 2 days No tooling charges Stencil service WWW. .com elektor 02-2010 33 PC-BASED ELECTRONICS Figure 7, The author’s prototype. without backlighting is used, pins 15 and 16 of the LCD module are not used and R1 can be omitted. The prototype was built using a module with a green backlight, with pin 1 5 connected to the anodes of the backlight LEDs and pin 1 6 connected to the cathodes, fn the circuit diagram (Figure 2), pin 15 is connected to +5 V and pin 1 6 is connected to ground by R1 . The voltage across the LEDs (U F ) is specified in the LCD data sheet as 4.2 V, with a typical LED current of 160 mA. This yields the following value for R1 : (5V“4.2V)/0.16A-5Q We used a value of 5.6 Q in our lab prototype. If you use a display module with a different type of backlight, you should adjust the value to match the LED current recommended by the manufacturer. For example, a model with a visually more attractive but more expen - si , e blue-white backlight has a much lower LED current (around 1 5 to 40 mA). The microcontroller can be programmed in circuit using a suitable programmer, such as Elektor USB AVRprog or AVRISP Mark II, via the ISP port on the PCB (connector K3). The kit of parts on sale fort this project contains a ready-programmed microcontroller. The author used a readily obtainable Alps studio fader for the motorised potentiom- eter. Two versions are available from cata- logue distributors such as Mouser, Relchelt and Conrad Electronics: one with a 5-kQ potentiometer and 60 mm slider travel, and another (slightly more expensive) with a 1 0 -kQ potentiometer and 1 00 mm slider travel. The author used the latter version In his prototype (Figure 7), while the smaller 5-kQ version can be seen in the photos of the Elektor lab prototype. Both versions can be used, although we recommend the 1 0 - kQ version due to its longer slider travel. The only wiring that is required is to con- nect the studio fader and the keypad PCB to the microcontroller PCB. The slider potenti- ometer is shown In the schematic diagram with its leads connected to pin 1 (+5 V), pin 4 (slider) and pin 5 of K2, while the motor leads are connected to pins 2 and 3 of K2. If the slider motion matches the progress bar on the monitor after the unit is put into service, the polarity of the motor lead connections is correct. Otherwise (or if the slider does not move) the motor leads must be reversed. The prototype can be admired in action in a video clip [5! produced by the author. In normal operation, with the device con- nected and Winamp playing an MP3 file, the PC sends the current progress bar posi- tion to the device and the slider is continu- ously moved to the corresponding position. When the song ends, the slider returns to its initial starting point. If you use the mouse to change the position of the virtual Winamp slider while a song is playing, the slider of the fader also moves to the corresponding position. Thanks to the dual operating mode, the stu- dio slider in the circuit can also be used as an input device. If the slider is moved manually, the motion is detected by the AVR microcon- trol ler and motor-driven operation is stopped Immediately. If after this the slider remains in the same position for a certain length of time, its position is sent to the PC and the Windows program moves to the corre- sponding position in the tune. The four but- tons can be used to change to the previous or next song or to triggerthe Winamp Play and Stop functions. The song title is shown on the LCD module in two lines of sixteen char- acters each. If you don't see anything on the display, it may be necessary adjust the dis- play contrast with trim pot PI . 090531-1 Internet Links 1 1 1 www.winamn.com (Winamp) (21 www.mcseiec.com (BASCOM AVR) 1 3 1 www, m 1 c rosof t . com / ex pr ess/ vb/ Defa u I L as px ( Visual Basic Express) [ 4 J wwwJtdichip.com {FT232RL driver documentation and programming tool) |5| www. elektor.com/ 090 5 3 1 (Elektor projec t web page) 1 6 1 www. d i a ma n 1 tcxo m / pt ojcc ts/ elect ro n i c s / 02 1 (author’s WiRamp controller demo video) About the author Markus Hirsch was horn in Hanover in 1978 and grew up in Vienna. During his course of study in precision mechanics at the University of Hanover, he discovered his passion for digital electronics — even though this had little in common with his main couise of study. Af- ter working several years in a medium-sized industrial firm (ultima- tely in a quality assurance position). Markus completed a course of study in electrical engineering at a technic al college. He now enjoys combining his two fields of knowledge. E-mail: markus.hirsch@diamanbc.com Website www.diamantic.com 34 02-2010 elektor READERS CIRCUITS Motorbike Chain Oiler By Esko Viiru (Finland) Problem #1: rainy day, 200 miles £0 go, chain lube spray / forgotten / empty / under loads of baggage. Problem #2: Touring with buddies who have shaft driven bikes. Take a break and think it’s a good time to oil the chain. “What the #*% are you doing? Got a problem with your bike?” That’s enough! Something must be done. Bulky shaft driven bike? No thanks. Belt driven? Phew! How about an automatic chain oiler? Problem #2a; where's a cheap and reliable oil dispensing device, please? The author is grateful to MC Jaykat from Finland s ! for the idea to use a low-geared windscreen washer pump as the oil dispenser A visit to the local equivalent of Die Ludotfs l2 i resulted in a spring loaded non-return valve and some windscreen washer tubing. Main problem solved, the rest of project wilf be 'just electronics and software'. Not quite. Real motors have interna! resistance (R) and electromotive force (EJ that's directly proportional to the rotation speed. If you want to accurately measure a fluid volume through electromagnetic force, the voltage drop due to the motor's internal resistance is effectively cancelled: E=U-R*I m m s m To keep things simple, let’s ignore the motor's inductance. To justify this simplifi- cation, the motor is powered by a constant current source. Some analogue circuitry will be needed — can’t be helped. The electronic design The circuit of which the schematic is shown in Figure 1 and the wiring diagram in Fig- ure 2 gets its supply voltage from the bike's Figure 1 , Circuit diagram of the motorbike chain oiler with Intelligent oil dispensing. elektor 02-2010 35 READERS CIRCUITS Figure 2 How to connect the unit to various signals and wires on the bike (example. Suzuki SV6505). battery via the ignition switch and a fuse (5 A). Power for the windscreen washer pump is switched by power transistor T1 which gets its control from a PIC microcon- troller via driver T2 . The retu rn cu rrent from the motor is passed through current meas- uring resistor R7. When the motor current reaches its high limit, transistor T3 starts to conduct and steals' base current from transistor T2. This results in T2 and com sequently T1 being cut off. Negative volt- age spikes due to the motor coil(s) being switched off suddenly are shunted off by flywheel diode Dl. The motor voltage is measured by op amp IC2D which is connected as a differential amplifier. The amplification factor of 0.27 scales the motor voltage (max. "14V) down to the PIC's safe measuring range (max. 5 V). The motor current is sensed by R7, Differential amplifier IC2.C then ampli- fies the sense voltage by 2, resulting in a total amplification of 1 V/A. The 'simulated tachometer signal' for the motor speed measurement is realized by subtracting the (calculated) voltage drop due to the motor's internal resistance (RJ from the total motor voltage. This is done by IC2.B which is connected as an asymmet- rical differential amplifier The amplification for the non-inverting input {i.e. motor volt- age) is unity (1), The total amplification for the motor voltage is thus: 0.27 * 1 = 0,27. The pump motor used was found to have an R of 1 .0 Q, So, the voltage drop due to the R is 1 V/A which happens to be the same ‘slope' as that of current measuring op amp IC2.C. Because the motor voltage is scaled down by 0,27, the voltage across /? must also be scaled by the same factor 0^27. Thus, the amplification for the invert- ing input is 0.27. Referring to the labels in the circuit diagram we have; MEASVOLT = 0.27 * motor voltage MEASCURR ® 1 V/A * motor current S1MTACHO - 0.27 x (motor voltage - 1 V/A x motor current}; [[Q] = [V/A]) The measured signals are connected to the PIC's (analogue) inputs via low pass filters. Diodes D4, D5and D6 clamp excessive input voltages to safe levels. The type LM224 op amp is used because the common mode range of its inputs reaches GND and the output can go down to GND as well. However, the sink current of the 11V1224 is very small when the output is near GND, so pulbdown resistors are connected to the outputs. The digital part is quite straightforward. Pulses from the speed sensor on the bike are connected to 1C2.A but noise spikes are filtered out first. IC2.A's input impedance is high (1 00 kH) to prevent excessive load- ing of the speedometer electronics. The op amp is configured as a Schmitt trigger and its output is taken to a PIC digital input via resistor. Diode D3 damps the input voltage to the safe level. The Schmitt trigger and the low pass filter are designed based on the speedometer signal present on a Suzuki DL/SV650. Both switch inputs on \2 have pull-up resis- tors with small capacitors connected in par- allel to eliminate noise spikes. The PIC1 6F676P is configured to use its internal 4 MHz oscillator so a dedicated crystal is not needed. There are two supply rails: +1 2 V and +5 V. The +1 2 V is taken from the bike battery Figure 3. The board is double-sided and has a mix of SMD and through-hole components. 36 02-2010 elektor READERS CIRCUITS through diode D2 and it powers op amp IC2 as well as voltage regulator IC4. The regula- tor is the ubiquitous 7805 and it powers the rest of the control electronics. Software An assembly code program was developed under Linux using these ‘gputils* (tools); gpasm, (assembler/compiler) and gplink (linker) |3 c For Windows there is a free (assembler) development environment available from Microchip tailed MPLAB IDE, The final firmware is transferred to the PIC micro using the Tait' classic programmer and ICprog software under Windows XP, I C prog requires that the NT/2000/XPparal- lel port driver be installed on the system, A more contemporary alternative to use is the Microchip PICKit 2 or one of its clones. The program has the following functions: - Rain / Dry setting at start up, - Manual start of oiling sequence, - Automatic lubricating with two adjustable parameters: (t) travelled distance between oiling sequences and (2) pump s on T time during oiling sequences. The commented source code as well as the HEXcode files are available free from the Elektor website f 4 k Construction hints and operation Because space is at a premium in a mod- ern motorbike, it is suggested to build the circuit on a double-sided PCB populated with 5MD as well as through hole compo- nents, The author s PCB design may be downloaded from |4? ; Eagle and Gerber for- mats are supplied. Soldering should not be a problem because no extremely small or multi-pad SMD components have been used. The PIC microcontroller should be mounted in a high quality 1C socket. Diode D2 is placed between connector pads and it might be good idea to leave some clearance between it and the PCB surface. Figure 3 gives an impression of the finished board. The PCB is designed to fit Into a Kemo type Gill plastic case with dimensions 90x50x25 mm. Due to the limited space (mainly height) inside the case, the connec- tion wires are soldered directly to the PCB. Figure 4, Suggested mounting of control circuit, pump and oil Tank' on a Suzuki SV650S motorbike. Wire-to-wire connectors are used outside the case. Finally, the operation of the unit by means of the two pushbuttons is described in a document called 080256~W.pdf included in the project download at I 41 . (080256) Internet Links [1] www.24.fi/mcjaykat 1 2 1 http://press.d i scovery.com/emea/ dsc/ prog ra ms/d ie-ludolfs/ [ 3 1 http://gputi Is. sou rceforge.net/ [4| www.elektor.com/080256 Figure 4 r Rather than dripping oil on the chain and spilling most of it while riding, the dispenser lubricates the rim of the chain wheel. elektor 02-2010 37 OPERATING SYSTEMS Femto OS By Clemens Valens (Elektor France Editorial) and Jerry Jacobs (Elektor Labs) Do small embedded systems need a multitasking operating system? Can’t you just program everything in one big loop? Sure, But have you ever noticed the wait between switching on your DVD player and the first signs of the drive responding to the Play button? We bet that there is no OS inside, just a big loop. It is easy to do better since there exists an OS for even the smallest of microcontrollers. The next question Es: do you have to write one yourself? On Wiki- pedia almost one hundred are listed already, but ignoring the proprietary systems and those that are not under active develop- ment, the list is actually much shorter. Probably the only one that will fit into 8 KB of flash memory and 512 bytes of RAM and still do something useful is Femto OS l a L It was written by Dr R, Vlaming MSc. to be a general-purpose OS t useful in many different applica- tions. The word 'femto* ( 1 th 15 ) in Femto 05 indicates that the OS is very small indeed. Coals Femto OS is a multitasking realtime operating system (RTOS) with a fairly generic design, it Is portable and currently ported to 44 of AtmePs AVR microcontrollers. It is open source and licensed under GPLv3. Femto OS differs in several respects from other operating systems. First of all Femto 05 is extremely economical with RAM and flash memory. Only the things you really need get compiled into the kernel. For example, you can run eight independent LED blink- ing tasks within 1 KB of flash and just 47 bytes of RAM, Or you can run a shell, serial communications (so you can log into the device) and eight other tasks on an ATtinySSl (8 KB flash, 51 2 bytes RAM). We sincerely believe that Femto OS is the smallest OS on the planet. The code is well documented too. Why use a multitasking OS? Often, when a microcontroller is performing a task, It warts in an infinite loop until something happens — a button press for exam- ple, before it wilt do something tike switching on or off a light, !n pseudo code: forever do { wait for yellow button to be pressed; invert yellow light state; } Now suppose you have two buttons and two lights. The following program does not work well (can you see why?): forever do { wait for yellow button to be pressed; invert yellow light state ; wait for blue button to be pressed; invert blue light state; } so we have to do something fike forever do { wait for yellow or blue button to be pressed; if button was vellow T then invert yellow light state ; if button was blue then invert blue light state ; } But wouldn't it be much simpler if we could use two loops that 38 02-2010 elektor OPERATING SYSTEMS Getting started with Femto OS are two ways of getting started with Femto OS: the easy way a * d the hard way. Both ways start with downloading the Femto OS c 5 tri button from the Femto OS web site r -T In the archive file for this article you will find a readme file. Read it. it’s highly detailed and contains lots of useful Information. The easy way is to use Femto 05 with AVR Studio |6 l and WinAVR nut this only works with Windows. You have to download and in* stall these two programs and then run the i nsta I l_avrstud ^work- space, bat file that's included in the Femto OS distribution. That's it. you're done! Our example is presented as an AVR studio project and you could copy it into the IDB/studioprojects Folder of the OS distribution. The hard way, For those who like to know everything, is also detailed in the readme file. The hard way works on Windows, Linux and Mac, would be executed in parallel? Like this: forever do { wait for yellow button to foe pressed; invert yellow light state; } forever do { wait for blue button to be pressed; invert blue light state; } This is the premise of the multitasking OS —you can have one or more ‘tasks’ that are executed simultaneously, allowing you to reduce program complexity. It Involves setting up your own Femto OS tool chain, building ever y- thing (yes, everything, the compiler too) from scratch. In our experi- ence this is only for the real geeks and it never works, but we gave U a try anyway So we did install Cygwin (this was on a Windows Vista machine), downloaded the special packages, ran the configuration scripts, built the whole kit and caboodle and what say: no errors! Ok, it look E i vc? hours and 200 MB buL then we were able to com- pile a 258 byte program] To be honest* we did run In an annoying Windows Vista security problem: we (administrators) were not al- lowed to access the Femto OS source files... Using the file properties the security settings were changed to get 'total control' and then it worked. To discover this it's necessary to Inspect the compile_results file In the MamCode\binades\ Folder of the Femto OS distribution. Alternatively* take the easy way... A typical multitasking OS design Figure 1 shows the flowchart of a typical multitasking OS. After some system initialisation (the timers of the AVR for example) the scheduler takes over. The scheduler keeps a list of all tasks and selects one of the tasks to run. Which task has to be started next will depends on its priority (more important tasks go first!) and, with priorities being equal* which tasks did not yet run. This is called round robin. Once a task has been selected the context for that task Is restored, and execution resumes at the point where the task was halted earlier on. What does that mean ‘the context is restored’? Program execution is no more than bit manipulation of the registers of the CPU and the memory. When a program resumes execution after being inter- rupted. at least the registers it was working with should contain the same values as before the interruption. So a ‘context save’ makes sure that the regularworking registers of the CPU — the Status Reg- ister and Program Counter— are saved in a special area of memory Figure 1 . The flow chart of a basic operating system. efektor 02-2010 39 OPERATING SYSTEMS system startup System initialization j system boot hook system hooks lick hooks central system event handling file handling watchdog handling task initialization in it hook init hook init hook watchdog task restart task restart task restart enter sleep hook enter idle hook , context restore context restore sleep exit sleep hook task x task context save context save context restore task context save general calls OS control synchronization external calls 1SR type 1 forced switch manual switch event flag general calls OS control synchronization Interrupt control [ I task calls OS control synchronization interrupt control fsle system dsscnpilao itltemtp!z&€r CS * «';.i Cf tmrntefiPuprflDte OS (dii* SCBC1 'SR D9WW3 n Figure 7. The flow chart of Femto OS is a bit more complicated than the one in Figure 1 , but not that much. where the program stores return addresses and temporary varia- bles: the stack. The stack pointer itself must be saved at some fixed location. Just before the end of the interruption, the register values are read back from the stack and written to their original locations. This is a context restore. If the context save and restore are done properly, a program never notices that it was interrupted. When a task has run for a while, the OS takes control again by interrupting It, usually by means of a timer interrupt, the so called t/ofc interrupt, immediately after the interruption, the context of the task Is saved and its state is frozen. We have now reached the block named switch in Figure 1 . The process is called pre-emption because the task cannot refuse this interruption. The task control block (the memory that holds all the information about a task) is updated, and the scheduler selects a new task for execution. If there are no tasks ready to run -they may all be waiting for something - the scheduler selects the idle task, which does nothing. It can happen that a task wants to call a function that controls the 05. or a task may want to communicate with another task, so it might call some synchronisation functions. In such cases the task no longer needs to run and it may dedicate the execution time left to other tasks. The task switch is now voluntarily (so-called coop- erative operating systems work solely on this basis). As discussed, the context save and restore ensure that the environ- ment of the task that's allowed to run is identical to Its environment when it was switched out. But what about the rest of the mem- ory? Or indeed the registers of the peripherals? For the most part, it doesn't really matter since the task never uses it. And for the part the task is using, it will often be the only one using it, so this part will not be touched when the task is not active. What remains are the registers in use by more than one task. How is this organised? Well, it isn’t. It is your responsibility. Of course the OS offers some synchronisation tools and semaphores to make life a bit easier, but you, the application builder, have to be careful. If you aren't, tasks may deadlock forever. This Is about all there is to the design of a clock driven pre-emp- tive multitasking operating system. Of course, there are all kinds of other exotic desig ns out there, but for the discussion about Fem- to OS this backdrop will be sufficient. Femto OS features In Figure 2 you wilt recognise the generic OS design from Figure 1 but also notice many new blocks. First of all, we have a system ini- tialisation with a global boot hook and every task has an initialisa- tion hook, which are places where you can add custom functions to initialise, for example, hardware before your tasks start. These are one-time initialisations. The block ‘central system 7 contains a few more gadgets. Event handling takes care of possible events that you may have initiated. These are used to quickly fi re up a task from an interrupt or other task. Subsequently, file handling unblocks possible tasks that were waiting for an EEPROM write operation to end, A watchdog tests for tasks that are no longer responding and that may need to be 40 02-2010 elektor OPERATING SYSTEMS Timinq models eKl&HIrLl interrupt e*l ml top priority ISR V Wii|| priority 3 \lSSK2 task 2 li.sk 2 priority 0 | o$k 0 j | lask 1 I F idle 1 jtdskOl 3 Figure 3 shows an example of how tasks execution evolves over time. The horizontal axis represents time, the vertical task priority. This snapshot of the system starts with a forced context switch (red rectangle), followed by execution of task 0. After a while this task transfers execution to the OS: a manual context switch takes place (green rectangle) followed by the execution of task L If it also hap- pens that task I does not need the full time, it requests a manual context switch again and the rest of the tick time left is spent in the idle state. In the mean time task 2 has woken, and since this one has a higher priority, it takes precedence. During execution of task 2 an interrupt takes place which is handled immediately. After completion of the ISR, task 2 continues until it gets interrupted by the tick interrupt. Unfortunately, task 2 hadn't finished yet, but since it has the highest priority it is rescheduled. When done it yields control to the OS who reschedules task 0. Then an interrupt arrives that forces a context switch before starting the ISR, When the ISR completes no context needs to be saved, but the context of task 1 must be restored* Mote that, although task 0 has not yet finished, task I is scheduled anyway. This Is because the OS has noway of knowing if a task has finished or not, so It assumes It is. restarted. This is a useful option for checking if a communication bus is still busy and removes the need for countless timeout checks throughout the program. And lastly the scheduler selects a task fol- lowing the simple prioritised round robin scheme. Besides starting a normal task, the system can go into idle mode, which is not a task but simply a power saved state in 05 space. The system can also go to sleep (if supported by the hardware). This is a special power down mode of the chip that Includes the tick interrupt. Just as In the generic 05, tasks can be interrupted by the tick inter- ru pt or by a ma nua I switch . B ut In contrast with the g eneric OS , the Femto OS control calls take place In OS space for most functions, hence force a manual switch first, after which the operation Is exe- cuted. This way the task stack is not used for these operations, and thus the task stack size can be smaller. In Femto 05 most calls that directly Force a context switch are called taskXXX and may only be used from within a task. In addition to that, there are also general calls, starting with genXXX that may be called from within tasks as well as from interrupt service routines. They do not force a context switch and are executed in the same space as the one they where called from and are usually very quick. Femto 05 provides everything you need for safe Inter-task commu- nication, This is important when two (or more) tasks need to share data or access the same register. Mutexes, queues and rendezvous are therefore fully supported. We do not have enough space here to dig deep into these advanced concepts, but as a potential Fern- &guidistani licks | taskQ || task teskO [ | lasK 1 1| HaskQ [JtgskT j * 1 ft* (feed) * honesuime sJrce j laskQ^ q taskt || taskO [| task 2 j ^ , .... . ■ ■ ^ max time reached 4 (MW I 14 Normally, ticks come at equidistant time intervals, which is line for most situations, but not for all. To illustrate this, have a look at Fig- ured In the upper time line you see two tasks running. Since task 0 uses most of the time between the ticks (but not all of it) there is little time for task 1 left. But. because it did run, the OS will restart task 0 after the tick interrupt. This goes on and on and may lead to starvation of task 1 . In extreme cases it may even execute a few in- structions only. Although such situations are rare, the do occur and can be hard to track down. Femto OS lets you use another timing model, called honest timing, In this case, at program start the tick interrupt timer is reset so every task gets a full tick time to run. If the task completes before the next tick arrives* the timer is reset for the next task. The tick counter keeps on counting regular ticks (for these are deduced from the sub tick counter) although It rnay lag a little. Observe that; in this model task 1 does not starve. In fact, this allows another possibility: vari- able time slices per task where each task has its own maximal time slice. This can be very handy if you know beforehand that a particular task needs a little more time than one tick to complete and it may reduce context switch overload considerably. to OS user it is good to know that the tools to handle this properly are available. Controlling relays,*. It is all very well to know how an OS works in theory and how use- ful It is etc., but we are hands-on people and we want to play with it. Nothing beats a real-life example to illustrate how things work in practice. Elektor has published many AVR- based boards so we decided to reuse one of these. We went for the ATM 18 board 151 to try Femto OS on. To make it more interesting we also added the I/O port expander (071035-5) with the relay extension card (071035- 6) K T he ATM 1 8 board sports a n Atmel AV R ATmegaB 8 m rcroco ntrol I er with 8 KB program flash and 1024 bytes SRAM memory. Because Femto OS has a very small memory footprint there Is enough mem- ory for a pretty big application with multiple tasks. We prepared a simple application that nicely illustrates how three tasks can make a programmer's life much easier. Of course you can download the source code from our web site I 51 . ...using multitasking The first task is a data output task. It writes data to the shift regis- ter of the port expander board over a synchronous bus. The port expander controls eight relays. This kind of communication Is a good target for a task. The application only has to send data to the task and the task will make sure that the bits and bytes are transmit- # elektor 02-2010 41 OPERATING SYSTEMS Whv would I want an OS on mv microcontroller? ■Most people do not understand why you would want an operating system on a microcontroller, yet everybody wants one on his PC, The first PC with its 8088 5 MIPS max processor wasn't a lot more power- ful than a modern small microcontroller but yet we all wanted a DOS (disk operating system) on it. And these early operating systems weren't even multitasking. The reason for this is probably that most people think of Windows. Linux or Mac when they hear ’OS 1 and how would you squeeze that in an S-bit microcontroller? Within the context of Pernio OS, these big operating systems look just like an Airbus A38G compared to small ted in the right way. While the task is doing just that, the application can do something else, A second task reads the state of the five switches that live on the ATM! 8 base board. The switches connected to port lines PDO-3 con- trol the relays and the switch connected to PD4 selects between the two rows of four relays (RE 1 -4 and RE5-8) on the relay card. The switches are connected to 0 V and have an internal pull-up set on the port, so they are read as ‘zero' when they are pressed. Finally a third task provides some visual feedback by controlling two LEDs to show which row of relays is selected. If LED1 lights up the relays RE1 to RE4 are selected, else LED? lights up indicating that the relays RES to RES are selected. The LEDs are connected to PBO and PB1. If you look at the application file, the one with ’Elektor’ in its name, you will find only a few functions and no ‘main’ (the main can be found in u femtOQS_core.c”). So how does this work? With Femto OS you have to decide at compile time how many tasks you intend to run. That’s how the 05 can be so small. A special configuration file is used to toll the compiler what parts of the OS it should include and which functions are the actual tasks. If you want to understand in detail how the configuration process works, you are in fora long voyage through pre-processor land. For a quick start it is easier to just use the example configuration file t, config_application + h” and change the parameters you need (only change the ones you understand). Under the header "TASK NAMES" you define the names of your tasks (Display, Speed and Switch in our example). Then, under the header “INCLUDE TASKS" you tell the compiler which tasks should run. In the application file you should provide a function for each task with a name that starts with iL appLoop_" followed by the name of the task (appLoop_Switch, appLoop_Speed & appLoopJDisplay in our example). If you do this correctly the Femto OS core will call your tasks at runtime. You now have sort of as many main functions as that you defined tasks (up to 1 6). remote controlled indoor helicopters. Yet they both fly. An operating system Is useful when you have many peripherals, and modern microcontrollers come loaded with these. The operating system takes care of many low-level tasks to cant rof the peripherals and makes life of the application programmer easier. That's why you want an OS, to relieve you from the tedious tasks of handling time- outs everywhere, to do the bit-banging for you, to process interrupts properly. If you use an easily portable 05 L you can run your applica- tion on many different processors without modifications. Reuse your code and save time and money, just by using an OS. This example only shows a small piece of the many capabilities of Femto OS, In the OS distribution available at |; you can find several other examples that you could try on the ATM] 8 board. Refer to the Getting Started document supplied with the Femto OS frame to learn how to, well, get started! Once you are up and run- ning, you can try our example. Mice, but I am not convinced After reading about our example some of you will remark that they can do the same thing using interrupts and loops etc. You are right; you do not have to use an OS. But take a good look at our example and notice how simple it really is. We only wrote the file that has ‘Elektor' in its name and configured some settings. If you were to write this application using interrupts or polling you can look for- ward to spending a lot of time testing and figuring out how to get it working properly. You can save this time (and several headaches) by letting the OS handle it for you. Let other people do the hard work for you while you are having a beer. (ogoS42-l) Links and references [1 i http://en.wikipedia.org/wiki/Llst_oLreal-time_operatIng_systems [2 1 http://femtoos.org, this text is partly based on the Femto OS user’s guide [3] ATM 1 8 AVR Board, Elektor, April 2008 |4| ATM 1 8 Relay Board and Port Expander. Elektor, October 2008 [ 5 ] www. e I e kto r. com /09Q 84 3 [6] www.atmel.com/avrstudio 1 7 1 winavr.sourceforge.net External interrupts Femto OS can handle external interrupts in two ways: by setting an event flag or by using an interrupt service routine (ISR). The event flag can be used to wake up a high priority task which is waiting for this event. This task will then run at the next tick interrupt. There are two 1 SR flavours: ISR I and I5R II. An ISR of type I can be reached after an interrupt from (almost) anywhere in the program. whether it is in task space or OS space, but ft has limited functional- ity. An ISR of type II can only be reached from within a task. If such interrupts happen while the OS is running, their execution will be postponed until a task is started. Such interrupts can also force the currently running task to yield just before or right after the execution of the ISR. 42 02-2010 elektor The loudest! By Ton Ciesberts (Elektor Labs) & Thijs Beckers (Elektor Netherlands Editorial) Elektor Live! 2009 was almost there. In the weeks leading up to the event, Ton Ciesberts was busy in the Elektor lab with designing, measuring, testing and building of a sufficient number of ‘Portable PAs* (as they are called in-house) to support the speakers at the event Ten units had to be assembled by hand* When soldering the parts of the {mostly SMD populated) boards, our own 5MD oven and a few extra hands from interns came in very handy! To help the speakers to be more intelligible in front of their audi- ence, it was our intention to make the box amplify the higher frequencies a little more to improve the intelligibility and make the speech sound dearer. This objective was achieved* The upper curve shows the frequency response of the circuit with- out the frequency shifter, so only the microphone preamplifier in combination with the output stage* The frequency response increases with a slope of about 7.5 dB across the entire band- width from about 200 Hz to about 5 kHz* In the middle curve the frequency shifter is inserted in the signal path and we can see the frequency response of the boxes (produced in great haste) as they were used at the Live! event* Also because of the extensive ‘practical test' at the Live event we went back into the lab and did some further tests with the frequency shifter in the circuit and with the frequency shifter bypassed using a jumper between K1 and K2 (refer to the sche- matic of the article on the portable PA elsewhere in this issue). Doing these comparisons we had the impression that the acous- tical feedback with and without frequency shifter occurred at much the same volume, although the sound was different. This was quite a strange result of course, since the theory behind the anti-feedback circuit is quite solid* Since the feedback fre- quency was quite high, we changed the filter components in the microphone and output amplifiers so that we now have a flat frequency response instead of a response that increases slightly with frequency. The frequency response now looks like the curve in the bottom figure* We chose Butterworth charac- teristics for the filters. When comparing the modified box with an ‘original 1 one the result appears to be positive. That means, the modified box could be turned up much louder than the original box before acoustical feedback occurred* So the design was a success. Jn addition to these filter changes we also experimented some more with the frequency shifter* A shift downwards (the sig- nal was shifted down in frequency compared to the origi- nal) resulted in a somewhat poorer performance than a shift upwards* The latter also makes the sound a little clearer, simply because all frequencies are reproduced a little higher* As a result of these experiments, the characteristics of the filters in the modified box are the same as those in the implementa- tion described in the article that can be found in this issue* We had the impression that the loudspeaker volume in this imple- mentation could be turned up a little higher before acoustical feedback occurred. As a consequence of the adapted frequency response the sound has certainly become a little fuller, hut the clarity of the voice is reduced a little, but this is very subjective of course, but worth the effort in our opinion* If you would like to experiment for yourself with the characteris- tics of the filters on the microphone/output amplifier PCB then here are the component values for the increasing frequency response characteristic that we used originally* R5 = 2k2 R6 ~ 6k8 R7 — 12k C2 = 100 n C5 t CG p C7 = 100 n C12 = 22n C13 - 1 n (091 048) elektor 02-2010 43 E-LABDS INSIDE PCB design - it’s not witchcraft! For many electronics enthusiasts it's no big deal selecting the right transistor for a circuit, calculating an appropriate capaci- tor value or choosing the right logic !Cs to perform a particu- lar function when needs must. After this it's little more effort to knock up the circuit on a breadboard or soldering it up on a scrap of Veroboard, Job done! On the other hand, designing a matching printed circuit board (PCB) is a tougher challenge for many electronics enthusiasts. In some cases a substantial number of components need to be laid out in a logical and functional manner, all the time checking minimum inter-track clearances, smallest sizes for solder pads and all matter of other issues. Have no fear though — designing a PCB is certainly not witchcraft. At Elektor Labs we develop several dozen boards a year, both using surface mount devices (SMDs) and also for through-hole (TH) placement. !Fs true that lab director Antoine Authier's team have a customised version of Altium Designer (a powerful CAD program) at their disposal, which provides elaborate simulation and auto- routing capabilities. Actually, however, these functions are used relatively infrequently, reports Chris Vossen, in charge of many microcontroller and Test & Measurement projects in the lab. “When we line up components I try to transfer each of the cir- cuit's functional groups onto the PCB as a complete entity," says Chris, The power supply, the microcontroller plus its support cir- cuitry and the analogue electronics are types of blocks that are seldom subdivided down to their individual components, Altium enables multiple components of the schematic to be tagged simultaneously (see illustration), so that they can then be placed on the PCB and moved around as a group. That said, Chris can manipulate individual components by hand almost as rapidly. Another feature of the CAD package is more significant: main- taining a set minimum distance between the tracks (traces), between solder pads and finally between pads and tracks. In its board -view mode Altium Designer uses colour codes to indicate whether all these requirements have been observed correctly, even when routing is carried out manually. In Altium this is an Interactive process, whereas many other CAD programs carry out the design-check with the press of a single key. With SMD boards, which are sold (partially) populated in the Ele- ktor Shop, the Elektor developer must maintain a minimum separa- tion of 0,1 5 mm. This is laid down by our PCB producer. Eurocircuits, to meet the European 'Class 6' regulations [1 ] that Elektor aims to observe. "On boards that users themselves will fit out with compo- nents I increase the separation to 0.3 mm, to make their task sim- pler," adds Chris. To make the soldering task even more user-friendly the Elektor Labs staff also increase the solder pad dimensions for many commonly used components by 2 mm or more. “On boards that don’t have to be ultra-compact I also make the tracks a bit wider than usual," continues Chris. ForourUSB-to- Magic Eye adapter [2] (see photos) the tracks are almost entirely 0,7 mm wide. One exception is the tracks running between two pins of the microcontroller, which were drawn manually a bit narrower for clearance. Where high currents are involved Chris prefers to use free calculation programs on the Internet, such as the one at [3]. You can set parameters such as the thickness of the copper track layer (generally 35 pm for Eurocircuits), the current, peak voltage and so on. It’s natural that people who carry out PCB design as part of their daily work build up plenty of experience. Our Elektor designers and editors have compiled the following d igest of tips for laying out components, routing and more, (090873) j 1 ] www,eu roc i re u it s . co m / i mag es / stori es / c fassi ficat to n % 2 Oja nua ry % 2 0200 9 . pd f \ 2 ] www. el e k to r. com j 0907 8 8 | 3 ] http://desmith.net/NMdS/Electronics/TraceWidth,html [4J http://www.elektor.com/magazine/ co n st rue t ion - e! ec t rica 1 - s a fety . 83362 . 1 y n kx 44 02-2010 elektor When compactness is not a major consideration and the boards will be assembled by hand, thro ugh- hole components are the better choice, in this case you can use the pins of these components as ‘vias\ On the other hand surface mount components can save a whole load of drilling on self-made PC8s. They make it simpler to achieve objectives such as minimum length for tracks (British English) or traces (American English), minimal area inside track loops* etc* The orientation of components should consider not only simplicity of assembly but also the need to test the circuitry afterwards* This is the time to remember the need for test points! The place for switches, press buttons* plug-in connectors, LEDs and other user-interface components is outside the enclosure. Anything requiring subsequent access should be on the front panel of the case* Components that require assembling with the right polarity should all have the same orientation. Manual routing is preferable to using the autorouter The latter has its uses nevertheless for discovering bottlenecks and other critical points* When routing never even think about giving up! Many PCBs appear unroutable* at the outset* yet after a while it turns out you have plenty of space to spare* If you're not satisfied with your efforts* it's better to go back a step or two rattier than just muddle onwards. Separate analogue circuitry from digital whenever possible. On multilayer boards arrange tracks carrying signals so that one of the layers hosts the vertical tracks and another one accommodates the horizontal ones. If possible reserve one layer or side exclusively fora continuous ground plane. Only in exceptional situations* e.g* with high speed op-amps, is this undesirable* Keep tracks carrying heavy currents well away from sensitive pickups, sensors and suchlike* Beginners should take special care with mains and high voltages! The normal rufe for (European) Protection Class I [4j requires a minimum separation of 3 mm between a track carrying mains voltage and any other track or the casing. At Protection Class II this distance rises to a minimum of 6 mm (between a track carrying mains voltage and the case, between multiple mains tracks or between mains tracks and low-voltage sections of the circuit). For the other regulations see [4]* Ground and earth tracks require exactly the same consideration as the power supply tracks. Electromagnetic interference can be minimised by keeping the power and ground tracks parallel (or better still arranged over each other on either side of a double- sided board)* Bends should be no more than 45°. Sharp angles between the tracks and the pads are also to be avoided. Observe PCB manufacturers’ requirements without exception in order to avoid unpleasant surprises later* If you are using software for checking conformity to specifications, carry out these checks regularly at each design phase* A border of 0. 1 2 ” (approx. 3 mm) around the edge of the PCB should be kept entirely clear of components* If components are to be inserted by machine you must provide at least three location marks. Don't forget the holes for fixing screws or pillars! Don't skimp on text markings on the PCB: indicate polarity, voltages, on-board functions, part designation, design date, version number,,. Check not just twice but three times that all components will actually fit the PCB! Leave time at the end of the process for some tidying up and circuit first. Link the groups together only after you have finished this stage. Short tracks are better than long ones. High impedance connections are more sensitive to interference and for this reason require to be kept as short as possible* Where tracks form a loop, their surface area should be kept to an absolute minimum* Decoupling capacitors must be located as close as possible to the switching element that needs to be decoupled. Tracks carrying signals should be routed early on (first the short ones* then the long ones). Except, that is* when the power supply tracks are particularly critical. Bus lines should be routed alongside one another* r. 2ll5jOM thr. BCa.QOE n I y. EM.on-o d* -uwKHiml , ! , li JJ,!*, M lira, cco dx .tf.MO ml 13W, KK) ily 215,030 JTji] Jf r-H,m Mr 7,' * * < Ik- it ib* r-FJ-HMan T,* 1 . 1 , 1 . {METM-I dektor 02-2010 Jens Nickel (Elektor Germany Editorial) The team here in the Elektor lab are a good mix of young engi- neers and some more experienced Veterans". Ton Ciesberts has been with Elektor now for over 20 years so I guess he would count himself as one of our Vets' . Audio design is Ton's area of expertise. He has been responsible for many excellent projects and given valuable input to almost every article that concerned itself with high quality audio appearing in this publication over the last 20 years. With his experience it's no surprise that he sometimes gets a Deja-vu moment when a new design lands on his desk. The portable 'PA amp' featured In this month's maga- zine I 1 3 is a case in point. It uses the MAX9768 class D amplifier from MAXIM which according to the application note requires four capacitors for supply decoupling. Both a 33 pF and a 1 pF capacitor are connected in parallel to the two voltage supply pins to ensure suppression of the widest range of frequen- cies. The chances are that internally this chip has two output stages' Ton suggested was the reason for the two supply pins. It reminded him of the 96 kHz sampling rate converter which he authored in the April 2001 edition of Elektor 1 2 L This used three capacitors in parallel for supply rail decoupling; one 1 pF. one 1 00 nF and one 1 nF, If you look closely at photos of the proto- type in the article you can see three different sized SMD capaci- tors mounted next to each other at either side of the C5842G chip. 'When a manufacturer indicates this kind of detail in a data sheet or application note it is wise to follow their recommenda- tion' advised Ton. 'And another thing, when a low ESR or high ripple current type of electrolytic is specified in the parts list there's usually a good reason for itr It's not only important to check the voltage rating of a n electro* lytic but also its ripple current rating. Ton had first hand experi- ence ofthisasayoung engineer. One of his earlier designs was a 650 W DC inverter for an in-car audio amp or 'car booster' which featured in the October/ November editions in 1 994. 'For 46 capacitors Cl S and Cl 9 1 just used standard 1 0,000 pF radial electro I y tics' he explained ‘however during the first soak test on this design l found a major problem, after power up the thing began running so hot 1 could actually feel the heat from some distance a way A loud crack ensued and superheated capacitor internals flew around the lab. After a rethink 8,800 fiF 'Slkuref' type electro- lytics from Siemens, were substituted in the design and were specified in the parts list. Capacitors came to the rescue of another large project that Ton had been working on for over a year but this time they were a much smaller variety. The beast In question was the Titan 2000 power amplifier. This fully symmetric high power mono audio amplifier is capable of delivering up to 2000 W in a bridge con- figuration, It was one of the most complex designs ever featured in Elektor l 3 J with no less than 52 transistors some of which were sourced from the supplier at that time (Avera) In Japan. With all the theoretical work behind him and the first 25 x 1 0 cm proto- type board fully stuffed with components, switch-on came as something of a shock; 'With no input signal the output would just hang, sometimes at +70 V sometimes at -70 V 1 It didn't take him long to find that the amplifier was oscillating but at such a high frequency the voltage amplifier couldn't keep up. To track down the source of instability Ton armed himself with a handful of 100 pF capacitors and a scope. First for some HF decoupling of the supply rails, with just one capacitor on each rail there was little improvement but after placing four at points along the length of each rail (in such cases ‘cut and try' is often the only way to go to find the most effective positions) peace broke out, the oscillations ceased and the amp became stable. (090S76) [1 j www.elektor.come/090675 [2] www.elektar.com/Q1 0014 [3] www.elektor.eom/99000T 02-2010 elektor / — \ / — \ / — \ / — \ / — \ A N T E X uuuuu a n t e * IM1 2 230V *- C£ 60+ years of experience It may surprise you but buying an Antex soldering iron costs less than you think in the long run, British made to exacting standards, they last significantly longer than many imported brands. With a wide range of thermally balanced models, and temperature controlled irons too, you can always be sure to find an iron that meets your needs. A large range of replacement tips are available for most irons, and technical help is on hand from our offices in Devon UK. Buy Online Our new website has all of our irons, and soldering spares and accessories available 24hrs a day. Most items are shipped next day. Why not give antex.co.uk a try! Antex offer a wide choice of input voltages and bit profiles for our soldering iron range * * ^ ^ < * i www.antex.co.uk Antex Electronics Ltd 2 Westbridge industrial Estate Tavistock, Devon PL19 8DE, UK Tel: +44(0)1822 613565 Fax: +44(0)1822 617598 Email: sales@antex.co.uk Web: www.antex.co.uk PIC Cookbook for Virtual Instrumentation Several case studies included The software simulation of gauges, control-knobs, meters and indicators which behave just like real hardware components on a PC's screen is known as virtual instrumentation. In this book, the Delphi program is used to create these mimics and PIC based external sensors are connected via a USB/RS232 converter communication link to a PC. Several case studies of virtual instru- ments are detailed including a compass, an oscilloscope, a digital and analogue thermometer, a FFT-based Frequency analyser, a joystick, mouse-control panels and virtual displays for cars and aircraft. Full source code examples are provided both for several different PICs, both in assembler and C, together with the Pascal code for the Delphi programs which use different 3rd party Delphi virtual components. [3ektor L 264 pages • IS8M 9784)-9Q570S'84-2 £29,50 * US $47,60 Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel. +44 20 8261 4509 Further information and ordering at www.elekto EH elektor 02-2010 47 Loud and Clear By Ton Giesberts (Elektor Labs) and Thijs Beckers (Elektor Netherlands Editorial) mav enouah to ryone can understand you. However, vou have to ck with this sort of personal PA system Regardless of whether the occasion is a guided tour or i^i i ^ i"* ^ ^ ifi ti" f i i ^ f *i ^ I ii a 1 1 tj = t- J i ^ c»j f -jc "t. r t) volume For the Elektor Live! 2009 event 1 l| T we wanted to make things a bit easier for the speakers in the rings of the Philips Evoluon building [:| by designing a portable pub- lic address system that is small and light enough to be carried on the user’s belt. The problem with such a design is that due to the relatively small distance between the loudspeaker and the microphone* there's a fairly good chance of feedback howl. This occurs when the headset microphone picks up the sound from the loudspeaker, amplifies it, and emits it again via the loud- speaker, which produces an irritating howl- ing tone. For this reason, we incorporated a previously published anti-feedback mecha- nism in our design: a frequency shifter. Frequency shifting The most important consideration in this application is avoiding feedback. The loud- speaker Es carried at waist height and is thus relatively dose to the microphone. With a static configuration, an adjustable narrow-band blocking filter (a notch filter) is a good option. However, in our applica- tion the microphone and the loudspeaker move relative to each other when the speak- er's head moves. This means that the filter tuning would need to be adjusted continu- ously. Nowadays it's possible to implement this sort of thing with a digital signal proc- essor (DSP), but we considered this option a bit over the top ForaDlY project. Manual adjustment of the notch filter is impractical, so we had to take a different approach to suppressing feedback. We pub- lished an article on a 'feedback killer 1 in the February 1 990 issue of Elektor Electronics (as the magazine was called then). This cir- cuit appeared to be a good choice for our purpose. It raises or lowers the frequency of the input signa I by a few hertz so the outpu t signal differs slightly from the input signal. This prevents the repeated amplification of 4 s 02-2010 elektor Features * Maximum output powenoW/8 ft (with 14 V supply) ■ Feedback suppression by frequency shift] ng * Suitable for electrel and dynamic microphones ■ Low current consu mption * Can also be used without the frequency shifter as a portable active speaker a particular frequency (the feedback fre- quency). Of course, we modified the origi- nal circuit somewhat for our application. This feedback killer works as follows: all- pass filters are used to split the input signal into a pair of signals with a 90 phase differ- ence. These two signals are mixed with two clot k signal s (carrier wa ve) , which al so have a phase difference of 90 degrees. The result- ing signals are then summed. This produces a signal corresponding to the sum of the input signal and the carrier signal. There are a few difficulties with this approach. For proper operation, the signals must have a phase difference of exactly 90 ; but the a II -pass filters cannot achieve this fully. In addition, a sinusoidal signal should actually be used as the carrier signal instead of a square-wave signal. However, the cir- cuitry necessary for signal mixing is much simpler with a square-wave signal. As a square-wave signal can be regarded as the sum of sinusoidal signals, this can be cor- rected reasonably well by using a low-pass filter to eliminate everything except the desired mixer product. In order to obtain the desired frequency shift of the input signal, the sum signal is mixed with a signal at almost the same fre- quency as the carrier signal. This produces all sorts of sidebands In the frequency s pectru m, b ut we want to keep only one of them. Accordingly, we filter the other ones out. The frequency difference between the two carrier signals determines the ultimate frequency shift of the input signal. For a mathematically formulated version of this arrangement, see the original article pub- lished in 1990. Figure 1 . As you can see from the schematic diagram, the frequency shifter employs quite afewopamps. elektor 02-2010 49 E iektor H; (BOATS - M Figure 2 . The frequency response curves of the frequency shifter (green), the microphone amplifier with output amplifier and filter (red) and the overall circuit (blue). Upgraded implementation The present circuit is battery powered, so we took several measures to reduce the current consumption, including using half as many all-pass filters. This eliminated one quad opamp. For the opamps. we selected rail-to-rail devices from National Semicon- ductor that combine low current consump- tion (360 pA) with high bandwidth. This alone yielded a savings of 1 8 mA. in addition, the supply voltage from four alkaline cells (6 V) is considerably lower than the supply voltage of the original design (around 8 V), and we used the faster HC family of logic devices. The net result is that the current consumption of the entire circuit (under quiescent conditions) is now only 1 5 mA instead of 45 mA as in the origi- nal design. The choice of HC logic devices prevents the use of a higher supply voltage, although the opamps can handle a higher voltage (24 V), We also changed the component values in a few places. The input amplification is reduced by a factor of 2 because the supply voltage is a good deal lower (see Figure 1 ), The low-pass filters are built around !C2a- IC2d. The pass band of the phase shifter is approximately 300 Hz to 4 kHz (±2 devia- tion), which is good enough for speech. We selected Texas Instruments devices for the analogue switches on account of their very low resistance. This allows the resist- ances of the summing opamp (IC1 b) to be reduced by a factor of 1 0, which yields less noise and better signal processing. Capaci- tor Cl 0 limits the bandwidth of the mixer input signal in order to reduce the harmon- ics in the mixer output signal. The opamp is followed by a low-pass filter that further suppresses undesired harmonics, in order to keep the noise level low, the resistance values of the subsequent inverter are also an order of magnitude smaller than In the original 1 990 circuit. The mixer is fol- lowed by a tow-pass filter and then a high- pass filter. This arrangement prevents the high-pass filter from letting through unde- sirable harmonics from the second mixer. The corner frequency of the low-pass fil- ter is slightly more than 7 kHz, The corner frequency of the high -pass filter is approxi- mately 270 Hz (see Figure 2). Capacitor C35 reduces the gain to 1 at high frequencies. As a result, the frequency response curve drops by 1 ,7 dB from 460 Hz to 4 kHz. The filter has been redesigned to have a charac- teristic resembling a 1-dB Chebyshev filter, which makes its cut-off a bit sharper. As a result, the gain is somewhat higher at low frequencies, but this Is more than offset by the characteristics of the filters of the micro- phone and output amplifiers. The coupling capacitor at the input (Cl ) has virtually no effect on the amplitude curve (it flattens the curve by 0.1 dB). The maximum frequency shift can be set using Cl 7 and/or C20 and is approximately 30 Hz. The amplitude modulation (a ripple signal at the shift frequency) is 7,5%. This is due in part to the simplification of the all- pass filters and in particular the component tolerances, which have a detrimental effect on the operation of the circuit. The end-to- end gain is approximately 2.7 with small sig- nals, It is somewhat less with larger signals (2.55 at 100 mV). The lowest distortion level (0,23% as measured with our prototype) occurs at an input signal level of 10 mV. The distor- tion increases with increasing input signal level to 1 % at 30 mV and 3.2% at 1 00 mV, as measured with a frequency shift of +1 3 Hz. Microphone amplifier and output amplifier For obvious reasons, the enclosure that holds the circuitry, loudspeaker and batter- ies should not be overly large. Consequently, both PCBs are designed to use SMD compo- nents. This leaves a reasonable amount of space for the loudspeaker, which uses the enclosure as a speaker box. The amplifier board comprises a microphone amplifier, a high-pass filter and a class D amplifier with a low- pass filter (see Figure 3). The latter fil- ter is combined with the driver stage of the output amplifier. In order to provide the usual supply volt- age to an efectret microphone, we used a standard phantom supply circuit with a 2.2- kfl resistor connected to the supply t ail (for a totaf resistance of 2 42 k£i including the decoupling resistor). The resulting open- circuit voitage is 3 V, If you use a dynamic microphone, you can omit R2 (2.2 Hi), Balanced supply voltages for the micro- phone amplifier are obtained by tapping off the ground level from the middle of the battery chain. The microphone supply volt- age Is adequately decoupled by R1 and Cl, The DC offset voltage of the microphone is decoupled by C2, We chose an ST dual rail-to-rail opamp for the subsequent amplifier stage: the 1S922ID, which we have used previously in other projects. The amplifier stage is designed to have adjustable gain in order to compensate for large differences in the sen- sitivity of various types of microphones. The gain can be adjusted over a range of 1 to 21 with PI , This arrangement also allows the 50 02-2010 elektor Figure 3, The microphone and output amplifier board is laid out so that it can be used without the feedback shifter board. Only one jumper between K1 and K2 is necessary for this. circuit to be used as an active loudspeaker for an MP3 player or similar device (with R2 omitted as necessary). At maximum gain, the bandwidth is reduced somewhat by C3 and C4. fn light of the fact that the enclosure is worn on the user's body and makes use of a head- set with a microphone, a third-order high- pass filter with a gain of 2 is placed after the input stage. This provides adequate suppression of low-frequency rumble and eliminates the problem of reproducing low frequencies with a small loudspeaker. The filter is a Butterworth type with a corner f re- quency of approximately 240 Hz. The output of the preamplifier stage is feed to connector K1 for connection to the fre- quency shifter. The input of the output amplifier (K2) is located right next to K1. This way the output amplifier can be con- nected directly to the microphone amplifier by a simple jumper. The ground level of the input stage is half the supply voltage, while the ground level of the output amplifier is the negative battery voltage. A capacitor (Cl 1 ) is connected in series with the ground terminal of the out- put amplifier input to decouple this voltage difference. With the voltage available from four pen- light cells, an output power of 2 W into 8 Q. is possible with a bridge amplifier. For the output amplifier, we looked for an 1C that can also handle more than 5 V. We chose a very nice (extremely small) 1C from Maxim, the MAX9768ETG+, which comes in a 4 x 4 mm 24-lead TQFN-EP package. The power stage has an operating supply voltage range of 4.5 V to 1 4 V, Despite its small dimensions, this 1C can deliver 1 0 W to an S-i'l loudspeaker with a 14-V supply voltage. At 6 V the figure is 2 W into 8 O, or nearly twice as much into 4 £L The power dissipated in the iC is transferred to a cop- per plane on the PC8 by an exposed pad on the bottom of the package. The amplifier IC has a separate driver stage that operates at a lower supply voltage (2.7 V to 3,6 V}. The driver stage can be configured to provide extra gain. It needs a separate 3.3-V voltage regulator. To allow this board to be connected to a higher sup- ply voltage if so desired, the voltage reg- ulator must be also be able to handle the highervoltage. One of the few devices that meets this requirement is the National Sem- iconductor LP2980A1M5-3.3. This IC which comes in an 50T23-5 package, can handle up to 16 V, Note however that the maxi- mum rated voltage of the IS 9 22 is 12 V, which makes this the maximum operat- ing voltage of the microphone and output amplifier board without further adapta- tions. Schottky diode D1 protects the volt- age regu lator if the input voltage is less tha n the output voltage, which may for example occur If the batteries are shorted. The voltage regulator has an extremely low dropout voltage of only 60 mV at 1 0 mA, This means that the entire circuit will still operate even when the batteries are close to empty. If the voltage drops below 4 V, the undervoltage lockout will disable the IC. With regard to the features of the IC, such as the patented spread-spectrum modulation, see the data sheet. There are far too many features to describe here, even in summary form. Here we took advantage of the possibility of using a potentiometer (P2) to control the volume. We selected spread-spectrum modulation with filterless mode. We were guided primarily by the typical application circuit in the data sheet, and we used the evaluation kit as reference for the layout. The passive output filter that is usually nec- essary can be omitted in this application because the speaker leads are shorter than 20 cm. However, we did fit ferrite chokes (LI and L2) in the speaker output lines. Capaci- tors Cl 8 and Cl 9 enhance the HF filtering. The selected SMD chokes (0805 package) have a DC resistance of only 50 mft and can handle 2 A. This corresponds to the maxi- mum current of the MAX9768 (soft output current limit). The supply voltage for the power stage of the IC Is fed via two pins. Each pin is well decoupled with its own electrolytic capaci- tor (Cl & C 2). Here we used a somewhat pricey type from Nichicon with a low ESR elektor 02-2010 MIC1 13 090675 - 13 Figure 4. Follow this wiring diagram to connect everything together. that can handle 1.9 A. The supply volt- age connection on the PCB is additionally decoupled by a relatively large electrolytic capacitor with a low E5R that can handle a hefty 3,4 A, It is important to use high- quality electrolytic capacitors in order to obtain a reasonably long service life from the circuit. The circuit operates with a fairly high switching frequency (300 kHz - 7,5 kHz), and normal electrolytic capaci- tors are not suitable for this. The battery connection is additionally decoupled by a small choke (13). The volume control input is decoupled by Cl 4. A connector is used for the potenti- ometer leads so the potentiometer can be fitted independent of the position of the board. The volume can be adjusted in 64 steps. The volume range is approximately 1 00 dB, which is easily more than enough. The internal gain of the 1C is 9,5 dB maxi- mum from the volume control stage (see also Table 6 in the data sheet) plus 20 dB from the output stage. The maximum total gain is thus around 30 dB. Additional gain can be configured with the driver stage. This is done using two resis- tors, just like a standard inverting amp li Her built around an opamp, We took advantage of this option to incorporate a second-order low-pass filter without having to use another 1C, The inverting input can be used to con- struct a second-order multi-feedback filter. This is implemented as a second-order But- terworth filter to provide a gain characteris- tic that is as flat as possible over the desired bandwidth. The corner frequency is 5 kHz. The gain of this filter is -1 . Feedback via the supply voltage may occur at higher gain. Final assembly The enclosure we used for our prototype has dimensions of 32 x 1 00 x 162 mm. With the loudspeaker, the battery holders and the two PCBs Installed in the enclosure, there’s not much space left over. We fitted a 3.5-mm stereo headphone socket, poten- tiometer P2, and a dual-pole switch on one side. The loudspeaker we used is too deep to mount on the inside of the enclosure as actually intended, so we mounted it on the outside of the enclosure. The layouts of the two PCBs for this project can be downloaded free from the associ- ated web page The PCB for the microphone and output amplifiers is Fitted on the side, which is also where the connectors are located (switch, MIC1 and P2). if everything Is laid out prop- erly, the rear of the loudspeaker just clears the frequency shifter board. We made a flat hook bracket from a piece of alumin- ium (20 x 50 mm) for attaching the enclo- sure to a belt or trouser pocket. It is fitted to the back of the enclosure (level with the loudspeaker). All connectors are implemented as pin head- ers, so you can use sockets for testing. After the boards are fitted in the enclosure, you can also solder thin stranded wire directly to the header pins. Twist the wires to be joined together (with two wires) or braid them together (with three wires) to reduce the likelihood of problems. Use somewhat thicker wire for the loudspeaker. The wir- ing diagram in Figure 4 clearly shows how to connect everything together. Of course, you can also use a different enclo- sure and select a different loudspeaker. Pay attention to the efficiency of the loud- speaker. According to the manufacturer's specifications, the efficiency of the type we used is 88 dB/W, but many loudspeak- ers with these dimensions have much lower efficiency. If a low-efficiency type is used, the output amplifier will not be able to sup- ply enough power. In other words, you will need a higher supply voltage, which means more batteries. Note that the frequency 32 02-2010 elektor COMPONENT LIST Frequency Shifter Resistors (SMD 0805) R1 ,R5.R6,R8,R9,R1 1 -R22.R28-R34 = 1 Okn 0,1 25W R2,R3.R23-R27 = 1kfi1SS0.125W RIO = 8.2kQ 1% 0.125W R4 ~ 4.3kfi 1 % 0.250W R7 s 5.1 kn 1%0.250W R35.R36 = 1 MO 1% 0.125W Capacitors (SMD 0805, except Cl 7, €20) Cl = 220nF10%25V.X7R C2 = 4.7nF 10% 50V, X7R C3.C1 3,04 = 47nF 10%50V,X7R C4.C8.C9 = 10nF 10% 50V, X7R C5.C23-C34 = lOOnF 10% 50V, X7R C6.C7.C16 = InF 10% 50V, X7R Cll = 1.8nF 10% 50V. NPO C12 = 270pF 5% 50V. NPO 0 5 = 6,8nF 10% 50V, X7R shifter is connected directly to the battery voltage, and its maximum supply voltage is 6 V. If the supply voltage is higher than this, a few more voltage regulators will be necessary. Practical results From practical experience, it appears that the most important factor in avoiding feed- back howl is to use a good headset with a directional microphone located as dose as possible to the user's mouth. The best way to avoid feedback howl is to ensure that the m i c rophone cannot pick up the sou nd from the loudspeakers. C10= lOGpF 5% 50V, NPO Cl 7X20 = 5GpF 25 V. SMD trimmer. AVX type CTZ3E-50C-W1-PF Cl 8.C21 = 22pF 5% 50V, NPO Cl 9X22 = 12pF 5% 50V, NPO C35-l.5nF10%50V.X7R Semiconductors IC1 JC2JC4 = LM6134AIM SMD (5014) IC3JC5 - 74HC4066 SMD (SO-14) IC6JC8 = 74HC4060 SMD (SO- 1 6) IC7JC9 = 74HC74 SMD (SO-14) Miscellaneous X1.X2 = 8MHz quartz crys- tal, SMD, AVX type For best results, the frequency shifter should be configured for a positive frequency shift. With a bit of experimenting, you can read- ily find the best shift value by ear. For those of you with access to an accurate frequency meter, measure the difference between the frequencies at the outputs of D-type flip- flops IC7 and IC9, We found 1 3 Hz to be a good compromise between a 'robot voice' effect and feedback suppression. The ten- dency to feedback howl is further damped by the slight decrease in gain at higher fre- quencies. Although a negative shift can also be used, feedback is more likely to occur in this situation. A repetitive sliding tone CX49CFWB080QOHOPE5ZZ K 1 , K2 = 2-pin pinheader, right angled K3 = 3-pin pinheader, right angled PCB # 090675-2 see www.elektor. com/090675 occurs if the volume is set to high, since the frequency shifter prevents the generation of a continuous tone. If you use the circuit as an active speaker, for example with an MP3 player, the frequency shifter can be omitted. This will reduce the current consumption by nearly half. (090675) Intwnpt 1 inks I 1 I lb I I 1 V- (a L_ | I I I \ J 1 1 1 wvm.dek tor.nl 1 tHeklorltvo2009 1 in Dutch) 1 2 1 cnvw dse n h ~ evolunn/historie-e.htm 1 3 1 www < lek tor com/ 0906 75 COMPONENT LIST Microphone & Output Amplifier Resistors (SMD 0805 except P1.P2) R1 = 220521% 0.125W R2.R8.R9 = 2.2kO 1 % 0. 1 25W R3 = lOkO 1% 0.125W R4 = 1k£l 1%0.125W R5 = 3.3kO 15S0.125W R6 = 6.2kO 1 % 0. 1 25 W R7 = 8.2kQ 1% 0.1 25 W R10.R11 = 5.6kO 1% 0.125W R12 - 12kO 1% 0.125W PI = 2 Oka 20% 0.2 50 W, SMD, Vishay Sfernice type TS53YJ203MR10 P2 = 1 Oka 20% 0.250W. SMD. Bourns type 3310Y-001-103L Capacitors (SMD 0805, except C1,C21,C23.C27) C 1 ,C2 1 ,C2 3 = 33pF 20% 16V, SMD chip type 5x6 mm C2 = 220nF 10% 50 V, X7R C3.C10.C1 1 .C20.C22.C24.C25 = 1 pF 1 0% 1 6V. X7R C4 - 470pF 5% 50V. NPO C5.C6.C7 = 1 50nf 10% 50V C8.C9.C16.C1 7.C26 = 1 0OnF 50V 1 0%, X7R 02,04 = TOnF 10% 50V, X7R C13-1.5nF10%50V.X7R Cl 5 = 2.2pF 10% 50V. X7R 08,09 = lOOpF 5% 50V, NPO C27 = 2 2 Oil F 16V 20%. SMD chip type 10x1 Omm Inductors (SMD 0805) LI ,L2 = Murata type 8LM2 1 PG221SN1D (2200 at 100MHz, 50mn. 2A) L3 - Murata type BLM2I PG600SN1D (600 at 100MHz.25mO.3A) Semiconductors D1 = PMEG201 OAET (SOT-23) (1 A 20 V SMD Schottky diode) IC1 = MAX9768ETC+ (TQFN-EP) IC2 = TS922ID (SO-8) 1C3 = LP2980A1M5-3.3 (MA058) Miscellaneous K1 .K2.MIC1 - 2-pin pinheader, angled K3.P2 = 3-pin pinheader, angled LSI ,BT1 ,BT2 = 2-pin pinheader, straight 2 battery holders for 2 AA cells Loudspeaker, 2W 8a, e.g. Eurotec Internation- al type 59-F67. 00-01 FR Enclosure, dim, 165 x 100 x 32 mm, e.g. MULTICOMP type MCRH31 65 (Farnell # 1520395) Switch, double pole double throw, 2A 3.5mm stereo jack socket for panel mounting PCB #09067 5-1, see www. elektor. com/090675 elektor 02-2010 53 WIFI ANALYSER The 2.4 GHz Bandalyser By Marce! Romijn (The Netherlands) The 2.4-GHz band is frequently used nowadays for wireless links between all sorts of devices. This often leads to problems with wireless local area network (WAN) links when different networks close by operate on the same channel. With this handy portable scanner, you can quickly and easily see which frequencies are being used in your area and which channels you should avoid for your own wireless network links. The world around us is full of electromag- netic signals. Some parts of the electro- magnetic spectrum can be used without a licence. One section of the RF spectrum that has become very popular in recent years is the 2,4-CHz band, which is one of the Indus- trial, Scientific and Medical (ISM) bands [1 l Many applications make use of this band. To mention just a few: WiFi LANs, BIueTootb* wireless computer peripherals, transmit- ters for remotely controlled model cars and planes, wireless music players and loud- speakers, and so on. Interference sources such as microwave ovens also operate in or near the ISM frequency allocation. With the increasing use of this band, the likelihood of unwanted interactions between these applications, or even inter- ference, also increases. If you have a prob- lem with interference, how can you track down the cause? One solution is to use a scanner that shows you which signals are bei ng tra nsm itted 1 n the 2 ,4-GHz band, such as the 2,4-CHz spectrum analyser published a few years ago in Elektor !2 L The 2.4-GHz scanner described here Is based on that design, but it has a major advantage compared with the original design: it is implemented as a portable instrument with its own display, so you don’t need a separate PC. A built-in micro- controller scans the 2,4-GHz band and shows the results on a graphic LCD screen. The scanner employs the same front-end module as the original design — a Cypress Semiconductors CYWUSB6935 — but the module is driven directly by the microcon- troller via the SP! interface, which consider- ably boosts the scanning rate. How it works The scanner works exactly the same way as the previously published 2.4-GHz spectrum analyser. Only the received signal strength indication (RSSI) portion of the CYWUSB6935 module is used here (see the block diagram in Fig- ure 1 ). The microcontroller first tunes the frequency synthesizer to one the channel s in the 2.4-GHz band and waits until the front- end module indicates the signal strength in the selected channel. Then it switches to the next channel and repeats the measure- ment process. As soon as all the channels in the band have been scanned this way, the measured data is used to plot a scan on the LCD screen. To avoid missing fast-changing signals, each channel can be scanned sev- eral times in succession. 54 02-2010 etektor WIFI ANALYSER The circuit The circuit (see Figure 2) is quite straight- forward and consists of several main com- ponents: a microcontroller (IC2) that han- dles the control tasks, the CYWUSB6935 module (MODI ) for scanning the 2,4-GHz band, a Nokia 3310 LCD module for output (NOKIA331G), and three pushbuttons (SI to 54) for input As the CYWU5B6935 module and the LCD module both have an operat- ing voltage of 3.3 V, we decided to operate the microcontroller at this voltage as well. A low-drop voltage regulator provides a dean 3.3 V supply voltage, even when the circuit is powered from four AA or AAA cells (dry cells or rechargeable^). As already mentioned, the CYWUSB6935 module and the LCD module are driven by the microcontroller via the SP! bus. Con- nector K1 is also connected to the SPI bus to allow the microcontroller to be pro- grammed or reprogrammed. The serial port of the microcontroller can be accessed via connector K2, This port could potentially be used to let the circuit communi- cate with the outside world, although it is not used in the present scanner design. Note that this port also operates with 3,3-V signals. The supply voltage of the scanner is also available on connector K2, This could poten- tially be used to power a MAX3232. in the other direction, this connector could be used to provide the circuit with a stabilised 3,3-V supply voltage, but in this case the voltage regulator would need to be omitted. Instead of using this circuit as a scanner, it would be possible to use two assembled circuit boards to implement a wireless link (optionally with bidirectional communica- tion), In this case the microcontroller could be used to perform the more difficult tasks, such as driving the CYWUSB6935, while a simple protocol could be used on the serial port. One of the units could be built without the LCD module and fitted in a robot, while the other unit could be used to view the robot's parameters and send commands to the robot. There are lots of potential appli- cations, and we Ye sure that Eiektor readers can come up with even more ideas. Features * Scans all 84 channels of the 2.4-CH2 band approximately 20 times per second * Displays the maximum value measured in each channel - Each frequency channei can optionally be measured several times in succession * The entire 2,4-GHi band can optionally be scanned several times In succession * 3.3 V operating voltage, stabilised by a low-drop voltage regulator - Serial port for future expansion * Built-in transceiver module allows the unit to be used for other (wireless) applications CYWUSB6935 Z m K 2 5 ^ dTOMft.11 Figure 1 , Block diagram of the Cypress CYWUSB6935 WiFi data transceiver. i-L? 8 LCDl vec © I IT IJB RESET I-* ICS P074SCK] Pat!^l£D) F*B4|SS) PDllAIMirOCO!. PfllRHTiJ Peimj PBO(*CK/TftJ ATMEGA32+-20A pA^Aoeoj pcotseu ARE? PD7((K?l PD6<|ICPp PD5(0«C1A] PD^OCl&| PDJJVNTOh PCIfTXOi FtHHflXDl 1 C 15 14 13 IK 11 Vcc -3 VDD SC LX 50IH CMC NoHIa 3310 LCD ECl Sis- GNP CAP Ik l(ta Mv VmSBflESET Vcc © VCC u WUSIH IRQ 3 MODI p 5 wiso RESET IflQ- 55 5CK NC MOS* HC 4 .ft RE fi T PAt(AQCI) PA2(ADC2) PA3(ADC3) PAHADClj PA5-1ADC5I PA&iAOCt PP.HADC7) AfiWD G N D XTfttl PCI {S DA) pcarrcjt) PC3(T«Sl FC4fT»> PCSfTH) PCHTOECTl PCTlTOSCT) Oho KTAU GHD EHirefl 1 □Ottr. e 6 K 1 7 Ci 22 p H h t cs 2Jp I : OH! MMi 530985-11 Figure 2. The main components of the circuit are an ATmega324, a Cypress WiFi module. and a display module from a Nokia 3310 mobile phone. eiektor 02-2010 55 WIFI ANALYSER COMPONENT LIST Resistors R1*R2,R3 # R7,R8 P R9 “ 1 OkU R4,R5,R6-270a Capacitors C 1X2X3=* lOOnF C 4,C7= lOuF 16V radial C5,C6-22pF Semiconductors D1 = 1N400I tCI = LD-11 17V33 (ST Microelectronics) IC2 3 AT meg 3324 -2 DA (programmed. Elektor Shop # 090985-41) MODI - CYWM6935 module (Famdl it 1319925/1321748; R5 Components # 382-620) Miscellaneous XT = 11 0592MHz quartz rrystnl K1 " 6-pin (2x3) pinheader K 2 = 4-pin pinheader SI ** miniature switch S2.S3 + S4 - pushbutton, 5mm, PCB mount 1 2-pin (2x6) connector for MODI , lead pitch 2mm ILD lor Nokia 331 0 mobile phone (search Nokia 331 0 display' on Ebay) 9V battery wit b clip-on leads, or 4 A A or AAA cells with holder Project software# 090985-1 1 and Eagle tile for PCB # 090985-1, available free from ]4] Figure 3, The spacious layout of the PCB makes assembly easy. . • •#. m % • Figure 4. The display module consists of the actual display and a keypad section. Construction The author designed a PCB for the scanner (Figure 3) with a fairly spacious layout, so assembling the board should not present too many problems. Only one SMD com- ponent is used: the microcontroller, which comes in a 44-lead TQFP package. The CYWUSB6935 module is ready to use and only has to be plugged into a header. Note however that the pin spacing is 2,00 mm instead of the usual 2,54 mm (0,1 inch). You can buy the LCD module on the Internet at various sites, including eBay. The module comes with a flexible circuit that includes the contacts for the telephone keypad (see Figure 4). Remove the flexible circuit and saw the plastic substrate in two along the red lines shown in Figure 5. Be careful not to saw off the eyelet just below the display, since it is used for fitting the display. To ensure that the display contacts are cor- rectly aligned on the PCB, there is a plastic tab on the display that fits into a hole in the PCB, The LCD module can be fitted securely to the PCB with two M2 screws at the top and an M3 (3 mm) screw at the bottom, as can be seen in Figure 6, Start the assembly process by fitting the microcontroller, since It Is an SMD com- ponent, Soldering this 1C requires a steady hand and a soldering iron with a fine tip. First secure the 1C at one corner by solder- ing one lead in place, then align it precisely and solder the remaining leads. You can remove solder bridges between the leads afterwards with a bit of desoldering braid. After this, all of the other components can be fitted. Make sure that electrolytic capaci- tors C4 and C7 and diode D1 are fitted with the right polarity. The final assembly steps are to attach the LCD module to the board and plug in the CYWUSB6935 module. A 9- V battery provides an adequate source of operating power. The firmware The microcontroller can be programmed via connector K1 . Note that the microcontroller has a supply voltage of 3.3 V, so it must be programmed using 3.3-V signals. The Atmel STK500 development module can be set to operate at 3.3 volts, so the microcontrol- ler can be programmed using this module without any problems. If you only have a 5- V programmer, you will have to adapt the voltage level. You can use a MAX3392 for this as described in [3] , or you can use a level shifter built from discrete components. The software is available on the Elektor web- site i J1 as a free download. For readers who would rather not program the microcon- 56 02-2010 elektor WIFI ANALYSER t roller themselves or are not able to do so ( a pre-programmed 1C is available from the Elektor Shop (item # 090985-41 ). The user interface Once the firmware has been loaded into the microcontroller, the unit will display the main menu after it's switched on. The screen shows several options, which you can navigate using the buttons* The Up and Down buttons move the cur- sor, while the Enter button executes the selected menu command* From the main menu, you can start the scanner, adjust the display parameters, or show infor- mation about the CYWUSB6935 module and the firmware* If you change any of the display settings, such as the contrast, you can store the new settings in the micro- controller EEPROM so that they will be used automatically the next time* Figure 5, Saw through the plastic substrate Figure 6, The display module is fitted to the along the red lines marked on this photo* PCB with two M2 screws and an M3 screw. If you switch on the scanner while holding the Up button pressed, the display param- eters are reset. If you hold the Enter button pressed while switching on the unit, the scanner enters the Contrast menu directly after it starts up, and you can then use the Up and Down buttons to adjust the contrast* The author has noticed that the standard display settings yield an unreadable result with some display modules* The spectrum of the 2,4-GHz band is dis- played in the scan mode. The frequency scale is indicated by tick marks directly below the spectrum plot* In most areas the ISM section of the 2.4-GHz band is divided into 84 channels from 2.4000 GHz to 2.4835 GHz, and the LCD module just hap- pens to have 84 columns. The centre fre- Links and References [1] Wireless links, Elektor January 2009 ( 3 I Universal User Interface Module. Elektor December 2008 [2] 2.4 GHz WiFi Spectrum Analyser, Elektorjune 2007 HI www.elektor.com/090985 Tel: 01635 40347 Newbury Electronics Ltd Fax ; 01 63S 36143 Faraday Road Newbury Berks RGH2AD e-matf: cine uils^newbtirv.tcosn .co.u K www. rtewbcryelectrcui icsxo.uk elektor 02-2010 57 WIFI ANALYSER Menu Control The main menu is pictured at the top here. The Setup and About menu items each have a submenu. the submenu ‘Setup’ has five options: Use the lirst three menu items to adjust the contrast, bias, and temperature coefficient of the LCD module. Use the EEPROM Store menu item to save the settings in the microcontroller EFPROM When the scanner starts up, the saved val- ues are read from the EE PROM and used to configure the LCD module. The final menu item, Back, returns you to the main menu. If you select About from the main menu, the following three options are displayed: The Transceiver menu item shows informa- tion about the CYWUSB6935 module in the unit, including the unique manufacturing number: The Firmware menu item shows the firmware version number. If you select Scan in the main menu, scan- ning is started (lower picture): The scanner starts up in Run mode, in which it constantly scans the entire 2.4-CHz band and shows the results on the LCD module. The maximum reading for each channel is saved and displayed. After a few seconds, you can easily see how the 2.4-GHz band is being used. In the scan picture, you can see that WiFi hand 1 is being used by a device that oc- cupies approximately 20 channels. This is the author's wireless music player. You can also see a somewhat weaker signal in WiFi band 6. This is probably tine wireless local network of one of the author's neighbours, in addition, a fairly strong continuous signal can be seen in channel 5 L This is a narrow- band signal, and it is constantly present The author was not able to determine the origin of this signal. There are no signals in the channels above 4PGI ♦ Scan as mmm ♦ ir.ex.up ♦ About ran see l ver Firmware <*■ Back Contrast B i as T emp . Coeff » E EPROM Store Back * i i i i i t t i i i Scan: Run- QyprPSS III! I B ryijJI ISBF935 Silicon ID = A roduct ID = 7 Manuf act . I D = 0x 1 B7B978F Marcel Rom i j n 2.4 GHz Scanner Uersion 8,4b 'Scan ■ •Scan: un +Scan ■ BEK channel 52. Here you can see the maximum noise floor level. The scanner menu appears at the bottom of the screen. You can use the Up and Down buttons to navigate through this menu. Depending on the selected menu item, you can initiate an action or adjust a setting. Use the first menu item to set the scan mode. It can have the values Run, Hold, and Off. Press Enter to select a different scan mode. This is indicated by displaying the selection in reverse video. Use the Up and Down buttons to select the desired setting. Press Enter again to save the setting, after which you can continue navigating through the submenu. The next menu item controls whether the peak values (the limits') are shown (Show) or hidden (Hide). Use the following menu Item to reset the peak values. If you press Enter with this menu item selected, the peak values are reset immediately. This is a menu item that performs an action directly. The following menu item indicates how many times each channel should he meas ured before the scanner switches to the next channel. The highest reading of the repeated measurements is used. The next menu item is similar, but instead of indicating how many times the measure- ment is repeated for each channel, it indi- cates how many limes the entire 2.4-GHz band should he scanned before the results are displayed. The final menu item exits the scanner set- tings submenu and returns to the main menu. quencies of the 1 3 WiFi channels are also indicated below the tick marks. A single-line menu that can be used to set the scanning parameters is located at the bottom of the screen, just as with the regu- lar menu, the Up and Down buttons can be used to navigate through this menu, while the Enter button can be used to perform an action onset a value. The menu interface is described in more detail in the Menu Control inset. (090985) 58 02-20T0 elektor DESIGN TIPS Computer digital audio interface By Joseph Kreutz (Germany) Computer motherboards and lots of other computer devices are fitted with digital audio inputs and outputs in S/PDIF format, but which only produce or accept a TTL-level signal. Despite their undoubted usefulness, opto-interfaces are usually lacking. The project described in this article is intended to make up for this shortcoming. The receiving part comprises a transformer-isolated S/PDIF electri- cal interface, based on the receiving section of IC3, an SN75179B or equivalent differential driver/ receiver. This part of the circuit is arranged in such a way as to produce a zero output signal if there is no input signal present. The opto receiver IC2 is a TORX173. Logic gates 1C 1 b to I C 1 d a re wi red to form a n 0 R gate to steer the signals to the TTL output, from where they will be applied to the equipment intended to receive them. Needless to say, the optica! and electrical Input can't both be used at the same time, since otherwise it would be impossible to decode and use the signals. The function of IC1 a, along with D1 , 02, and the R2/C1 and R3/C2 networks, is to indi- cate if such an error condition arises, in which case the LED lights to indicate the problem. Transformer TR1 is hardly difficult to make: a primary of six turns of enamelled wire (0.3-0. 5 mm dia.; AWG # 28-24) and a second- ary of 1 2 turns of the same wire are wound onto an Epcos L44-X830 ferrite ring (12.5 mm dia. ). Any ferrite ring with a - 2200 nH/vturn will do. The TTL signal from the computer device is applied to the driver sec- tion of JC3. The inverting output is applied to transformer TR2 via C6 and R7. TR2 uses the same ferrite ring as TR1 t but has 20 turns for the primary and eight for the secondary. You'll need to make sure you connect its primary in reverse phase, to make up for the signal inversion introduced by IC3, The non-inverting output of O's driver section is connected to a TOTX173 opto-transmitter. Natu- rally. there's no problem at all about using the electrical and optical digital outputs at the same time. Building this circuit requires no special comments. Each IC needs to be decoupled by a QJ pF capacitor as dose as possible to its sup- ply pins, and overall decoupling of the circuit at lower frequencies will be taken care of by a 1 0 juF, 1 6 V electrolytic capacitor. The 5 V supply rail can be derived from the computer equipment where the interface is going to be installed. (ogobn-l) +5V LECM collision indicator IC1.A R1 — | 470R | +5V ©- IC1 = 7iMCT0O 1 C7 ZJ 1C1 lOu OS0611 -11 elektor 01-2010 59 POWER FACTOR CORRECTION Blinded by the Light? ems arise. By Ton Giesberts (Elektor Labs} & Clemens Vaiens (Etektor France) When the load of a power supply is not purely resistive but reactive, or worse, non linear, the current through the ioad may not have the same shape as the voltage across it, and a phase difference between voltage and current will exist. In this case the apparent power drawn by the load is larger than the real or active power consumed by it. The ratio between the real power and the apparent power is called the power factor. When its value drops too low, probl Alow power factor is a problem for energy providers, not the users, because they only pay the real power consumed. Energy providers have to assure that their power supply systems are capable of safely providing the total apparent power demand of all users. Since the apparent power is always higher than the real power, the supply system {AC grid) has to be over dimensioned, which is expensive. More power also means higher losses in the form of heat and con- sequently more resources are necessary to produce the real power Non-linear loads also create harmonics that produce excess heat and may cause interference in other equipment. It should be dear by now; we want a power factor of 1 (say, one), i.e. apparent power should equal real power. High volume energy users like industrial plants actually have to pay for the apparent power they use but households generally don’t. Industrial users sometimes install special equipment to control their power factor striving to approach the value 1 . This is called power factor correction (RFC), The European standard IEC 61000-3-2 |S] sets detailed limits for a consu mer (not professio nal ) load u p to a nd including 1 6 A per phase connected to the public AC grid. Table 1 shows the subdivision into four classes A, B. C and D of which the last two are the most interesting to us. All electrical equipment mar- keted to European consumers must comply with this standard. Linear and non-linear loads Most loads are not purely resistive. Incandescent light bulbs are, but as soon as there is a bit more involved the foad becomes a complex impedance. Many loads have motors and these are typically induc- tive loads. That’s why the reaf current usually lags the line voltage. The phase difference, often called phi ({pin Greek), between the cur- rent and the voltage is a measure for the power factor. As a matter of fact, when the current and the load are both perfect sine waves then the power factor is simply equal to cos(tp) (Figure 1 ). This is why the power factor is also called cos phi, even though this is incor- rect when the wave shapes involved are not perfect sines. But when they are, the power factor can be corrected by adding a capacitor (or banks of them) in parallel with the load, and that's exactly what professional users sometimes do. Thanks to the capacitors they keep their energy bills down. Today, electrical loads are becoming increasingly more complex and many have even gone non-linear, i.e. the current is no longer a linear function of the AC grid voltage. This happens as soon as rectifiers and switched mode power supplies enter the arena, which is the case for most of our modern house- hold electronics like computers, TV sets, fluo- rescent lighting and LED light bulbs, etc. Non-linear currents have harmonics that can cause problems when capacitors are used to improve the power factor. In certain cases the harmonics in combination with these capacitors may result in resonances producing overvoltage situations and heat, potentially damaging equipment. Power factor correction of non-linear loads requires other tech- niques than simply adding a capacitor to the load. It can be done passively with (bulky) filters that suppress the harmonics produced by the load. Another approach is active RFC, a method that adds electronics circuitry to the load to make it look more passive. Measuring the power factor To measure a load's power factor you need to measure the real or active power with a wattmeter and the effective load current / and the effective voltage V n:r across the load. The product l nm * V is the apparent power and the power factor PM s the real power divided by the apparent power. Most people do not have the neces- sary equipment to measure these quantities properly and besides it’s a dangerous operation if you cannot isolate the load from the AC power lines. Elektor labs have done some measurements of Class C equipment (lighting) using the circuit from Figure 2. A variac (variable trans- former) was used to isolate the toad from the AC power line and a 1 00: 1 oscilloscope probe (special high-voltage version) was used to measure the voltage at the load. The 1 0 Q resistor was a 5 W type. If you do not have these tools, please do not try to repeat our meas- urements, it can be lethal! rrns nns Go □2-2010 elektor POWER FACTOR CORRECTION Our oscilloscope was a LeCroy 9410 capable of displaying in real time the Fourier series {magnitude and phase) of one of the traces. We used that feature on the current meas- urements to visualise the harmonics. In all experiments / tms was measured with a Fluke 187 true rms multimeter. Some real measurements To Illustrate the effect of a load on the power factor we first measured a traditional incan- descent 100 watt light bulb. This Is a pure resistive load and the PF should be L Fig- ure 3 shows the results: the current is per- fectly In phase with the voltage and has the same shape; it is indeed a resistive load hence PF - 1. Note that the phase trace shows two peaks for the third and seventh harmonic, even though the magnitudes of these harmonics are very small. The reason is the distortion of the AC power line voltage wave shape which is not a perfect sine wave at alL Next we measured a fluorescent tube (36 W TL-D made by Philips). The traces in Figure 4 show a reactive load, although not perfect as the current wave shape is clearly distorted around the zero cross- ings. The Fourier traces show a dear third harmonic and a small fifth. Nevertheless, the current is very reactive and may be cor- rected with a capacitor (which was absent in our test setup). Ignor- ing the harmonics the PF for this tube is about 0.5 because the phase difference between the current and the voltage is about 60° and cos(60) = 0,5, When we started measuring on compact fluorescent lamps (CFLs), also known as energy saving lights, things became more interesting. We looked at three different models, two recent ones (a Philips PLE- C PRO 1 1 W and an unknown 1 1 W model found in a product from a well-known Swedish furniture manufacturer} and a several years old but still working lamp (20 W Isotronic 10112). Figures 5 to 7 show the results that look surprisingly similarand strange at the same time. These wave shapes are typical for these kinds of lights and show their switch- ing nature. Determining the power factor from such traces is difficult unless you have access to the Fourier series that goes with them. The trick is to first determine the effec- tive value of the in-phase fundamental fre- quency of the current and then divide it by the measured effective current / . For the rms Philips PLE-C the magnitude of the fundamental is about 700 mV across 1 0 H with a phase differ- ence of 20 degrees. Hence, the in-phase current Es (700 mV/1 0 Q) * cos(20) = 66 mA and its effective value is 66 mA/\'2 - 47 mA, The I value we meas- ured for this lamp was 67 mA, which gives us a PF of 0.70 for this lamp. Similar reasoning gives us a PF of 81/107 = 0,76 for the Isotronic bulb and 56/76 = 0,73 Figure 1 . The relation between voltage, current and power factor . P = VI and p.(P) is the average value of the power R (source: Wikipedia) Figure 2, Experimental setup to determine some power factors, for the Ikea lamp. From the CFL to the LED lamp Es just a small step. The LED lamp is making big progress in market share (In quality too, but not as spectacular) and many of you will have one or more at home. The 1 if 1 1 ir i. : ji L i ■1 \ J* / f Chon 1 10 ms 5 V Chon 2 10 ms 2 kV P4 V v & 4 V Vi -f \ - Xi H \ \ / *7“ / \ _L $ \ \ / / 1 \\ - : / : i \ $ \ 1 fi cm .5 V * CN2 2 V & T/div 10 ms 7 1 . .1 s | i % - 4-4- l -1 ji j VC -1 P , P : J J Kill X 1 L jt a ■ -» 1 1 ! 1 MM Lrn "TTTT Mil FFTtl) . 1 kHz . 1 k° jl II | ^l_i 1 - - - - 4., — : : — - .... FETCH , 1 kHz 5 V A JL 5 . 0 ms 090BBS-13 Figure 3. Results from a 1 00 W incandescent lamp. This was a 220 V model and the measured f was 440 mA. rrm elektor 02-2010 61 POWER FACTOR CORRECTION Table 1 . Equipment classification Class Description A Balanced three-phase equipment; household appliances, excluding equipment identified as class D; tools, excluding portable tools; dimmers for incandescent lamps; audio equipment. Equipment not specified in one oF the three other classes shall be considered as class A equipment. 6 ■ For table tools, ait welding equipment which is not professional equipment, (Professional equipment is equipment not available to the consumer.) C Lighting equipment. D Equipment having a specified power less than or equal to 600 W. of the following types: personal computers and personal compu- ter monitors; television receivers. Source: IEC 61000-3-2 & 1 J— .a - Chan 1 1 1 0 ms 5 V ' f\ \ / .. \ - \ jl / A ... , A. 1 1 - 1 - Li % - f j A i / h —f f J {j-iqjt* jf, o kV \ , ' ( / S / / ' N , i \ V / / WIJ V x \ > \ f \ \ ' / CHI .5 CH2 2 V& = T/di v 10 ms V 1 — J ■ ■ * * J 1 ± i "1"T r F" - T ■ ■■ f ' 1 ll . 1 kHz . 1 +■ m. - - - 1 1 'T- J .... FFTCU .1 kto 5 v ff — J '! — 5 . 0 ms 090586- 14 Figure 4, A reactive load in the form of a 36 W fluorescent tube; cos(O) = 0,5J = 352 mA. ' 1 rms k H L ■ 7 f T Jr i i *x ! 1 Chan 1 10 ms 2 V 10 ms 2 kV <1 1 - 1 * O J [ |A- i - ■ vU n ■ 1 1 hjt \J l 4 if- J / j£l \ 1 1 ‘ ■■ \ I l 1 / ™ chi .2 v a CH2 2 V T/div 10 ms I \ •- j FI | 1 / -■ ■ s ; ■ 1 \ -JL+J nr V ■— . - - ■ "T f — A - . 1 kHz . 1 k J i 1 LT — - ‘ * » - ' i| - -I- - ■ - -9- J FFT , 1 khz ,5 V lL A ^JU. A u/Lh A A JL 5,0 ms osaaas-is Figure 5* An 1 1 W PLE-C PRO CFL from Philips. / = 67 mA. traces in Figures 8 and 9 show the results for two models we had lying around, a monochrome one and a three-colour lamp with indi- Figure 6. As Figure 5, but now for the fkea lamp. / m = 76 mA. vidual remotely controllable colours. These lamps were both from that widely known brand called "Made in China*. The current traces are very spiky, due to the lit- tle bit of power consumed by these lamps, but they result in a very wide spectrum. For these lamps, PF - 20/34 = 0.59 (monochrome) and 12/28 = 0.43 (three-colour). Do they pass? 1 1*' 5UHK ;:tw40v - IEC 61 000-3-2 subdivides lighting equip- ment (Class C) into devices consuming up to and including 25 W and those that con- sume more. For both subclasses maximum figures have been set for harmonic currents, see Table 2, The three CFL lamps and the two LED lamps examined in the lab all have strong harmonics- most of which do not respect the values in the third column of Table 2. Should we therefore con- clude that these lamps are illegal on the European market? Probably not, as there is a second clause for lamps that consume up to and including 25 W — see (and try to 62 02-2010 elektor POWER FACTOR CORRECTION Table 2. Limits for class C equipment Maximum permissible harmonic current Harmonic order Active input power > 25 W Active input power < 25 W n % of input current at fundamental frequency mA/W ’ The third harmonic current, expressed as a percent- age of the fundamental current, shall not exceed 86 % and the fifth shall not exceed 61 %\ moreover, the waveform of the input current shall be such that it begins to flow before or at 60*, has its last peak (if there are several peaks per half period) before or at 65° and does not stop flowing before 90°, where the zero crossing of the fundamental supply voltage is assumed to be at Q c . 7 2 - 3 30 * power factor 3.4 5 10 1 1.9 7 TO 9 5 0.5 11 3 0.35 13^ia6sn &»» M 5DP nseinl Er.flM :DPfecM 01 t .-** f ’pP ibttto 0* &P Pal i I* Dwi 130000007 . « 5 £ L4Wviaf>g , .'•I - *3 JO lr*!ka«ah C? - ■' y . Tar^e Ujh-sJ EdAtMi Fjjl f -■».! s' T 1 1 - ,J «'/ ™ urit'+sfl v^TSIl^dl Tiafi:pati^si kg Rs lief ini dl DeMi-fCwinPrr^W:-, friiLi: 00 !r--k' 0i T>: CimJ Gi*t L«i d fttoJ Conner, r<,;ir I, £H Hi £••** Gm Ffc«thJPr> Siefrj rjfi 3&03030 h uwl R- £ vc*s*‘ cad Loc-si Hom* Ot 1 i -• t*!. r .» e».g ftjir iK-'i Ty &*2 fl r-*\ t ijcvil N«thi F.k E.-epi ly. ESflAk* Sfia^BF &W- r * Cnvf Lot -si AdtSa • fl, hrrtf h c *j rj/*; F.I iiN-. K5, - Me t- iJD ['ai - ft FfT- T ■. L&4 F> ,1 N'r'i Adtffi ■; I II ■ E ■«* !■• i try Srofij 00 P-r E Device F«#«: tele.** s CEE 7E t'? 1 MO Cc -mOs;; li^M Ti trad Ikmtl' l -r^>h Hi Cfi Mxk 1 if j n» rySL^'j; DO HrinyeE' JA-Hrjre-’ DOOOOOOajiS’. 1 w^tjt & ■ « '-At th acksunnw] Itttflttl | b*m e> command | Ewwfale biejk. . t*T :^M[ 4ICD&PI The other 'slave' device responds by sending a Bluetooth 'confirm 1 . When this 3s received by the master device it is converted into the cor- responding hex code sequence and sent out from the master's UART, 4P N 'O © U Gt 6F,6FJ4,68 t 2Q,53, 65, 72, 69, 6t 6C,20 t 50, 6F, 7 2.74.20.31.00 . 03 Once again the profile's name is shown in bold: 42,6C.75,6574 T 6C6FJ4, 68,20,53,65.72,69,61 ,6C,20>50 t 6F f 72 T 7 4,20,31 = Bluetooth Serial Port 1 Request (and confir m) messages always use the following (hexadecimal) format: Start byte Type ID Opcode Data Length Checksum Data Stop byte 02 1 Byte 1 Byte 2 Bytes (Low byte first) 1 Byte X Bytes 03 The Type ID can be 52 (Request), 43 (Con- firm) or 69 (Indication) which denotes the transfer of additional information. So the following sequence illustrates a typi- cal communication exchange (opcodes and data bytes are shown In italics): The sequence 'B4,EE,7E,D1 ,12,00‘ shown in bold is the unique hardware address of the target Bluetooth device. This address Is assigned by the device manufacturer much like the MAC address of a network adapter or network interface card. Now the name of the target device can be requested: O2,52,02,O6,OO J 5A,B4,££W^D7 J ?2 T OO,O3 Atypical reply would be: 02 ,43 ,02 J 2 , 00, 57 ,00, B4, EE, 7E,D1, 12,00, 0A f 54,65, 73, 74,44 , 65, 76, 69, 63, 65, 0 3 Which contains the Bluetooth address again and then the name of the device (5 4,65,73,74,44,65,76,69 t 63,65 = the ASCII hex codes for + TestDevke’) Now if is established that the device can talk and understand 'SPP h a connection can be configured using SPP connection request: 02.52.04.08.00. 64.0 7,B4 r ££,7£,D7, 12,0 0,01,03 The correct PIN is now sent (default value '0000'): 02 ,52, 75,0 B,0O,D2. B4,£E,7£,D 1, 12,00,04 ,30,30,30,30 , 03 The Bluetooth address is included and also the sequence 30,30,30,30 = 0000 Le. the PIN Finally the UART is switched to 'transpar- ent* mode: 02.52. 1 7.01 .00. 64.07.03 Devices in range receive inquiry request: 02, 52,00, 03,00, 55.04,00, 00, 03 A typical reply would be for example: 02.43.00. 01 .00.44.27.03 02.69. 07. 09. 00. 73, B4,££ P 7£,D7, 72,00, 70 ,07,32,03 Now using SOAP we can find out all the serv- ices available. First we must send an SOAR connection request: 0 2,52 ,32,06,00,8 A, 04, EE, 7E,D 7 , T2, 00,03 If the connection is successful the received reply is: 02,43,32,01 ,00,76,32,03 The Bluetooth chip now stops interpreting the serial data as commands and just passes the data on 1:1. (090455-1) Internet Links ( 1 1 www.elektnr.ccim M/08021 3 1 2] www.nationaLcom/ds/l M yLMXLJ838.pdf [ 3 1 www.elektor ,com/080824 [4 j www,nalionaLcoTn/anakjg/wireiess/1mx9838 |5j hUp://bluetooth H com/BkietooTh/Technolcjqy/VVorks !6| www,elektoncorn/99204 1 [7] www.nafinnaLcom/appinfo/cp3000/files/SBK/ AN 1 699_LMX9838SWUC.pdf 1 8 j www.dektor.come /0904 55 elektor 02-2010 73 DESIGN TIPS Audio amplifier in dinner mint format By Ton Ciesberts (Elektor Labs) There are countless situations and systems devisable in which a sound signal needs to be amplified in order to drive a (small) loud- speaker, but where space constraints rule out the use of a regular A few measurements were carried out on the prototype and the results in the table below show what happened at a supply voltage of 6 volts and a loudspeaker impedance of 8 ohms; sized amplifier. For these situations, this sub miniature amplifier is perfect. With some skills it can be assembled to a size smaller than an after dinner mint! The TDA7052, which was released by Philips a many moons ago, is a typical example of a fully integrated circuit. The only external com- ponents required are two decoupling capacitors. That's all. In the circuit dia g ra m of the a m pi ifier you ca n find a n internal sc he- matic of the integrated circuit It's easy to see two amplifiers con- nected in a bridge arrangement. This is done in order to squeeze a "decent power from the 1C at relatively low supply voltages, A preset has been added to the input to prevent the circuit from being overdriven, this will be appreciated in view of the high sensi- tivity of the TDA70 52. If required, this can of course be a real poten- tiometer with knob and all to adjust things on the fly* Maximum power output is just over 1 watt, which is more than enough for most applications. The power supply voltage can be up to 1 S V, but be aware that voltages above 6 V or so can cause the 1C to become hot* When using higher voltages, use a loudspeaker with an impedance greater than 8 ohms or limit the input signal of the amplifier. Don't worry about FUBR-ing the amplifier though* Even though the 1C heats up, an internal thermal security will stop anything from blowing up. THO+N * 0.09% (1 kHz. 1 00 mW in 8 fi) | 0.3% (20 kHz. 1 00 mW in 8 LI) P mas. 750 mW (THD+N = 1%) 1 W (THD+N = 1 0%, heavily dipped output signal' *) Gain 3S dB (PI at maximum) Supply voltage 3-1 8 V Current consumption 5 mA (quiescent) 340 mA ( 1 W continuous power output) r THD+N = Total Harmonic Distortion plus Noise dipping only noticeable at 2% distortion. Pretty good results for an amplifier this simple! The construction of this mini amp is unlikely to cause problems. If you work neatly, the circuit will most definitely work. Some people have taken it as a challenge to make the circuit as small as possible. TDA7052 Whatever you choose to do, we wish you a lot of fun tinkering! (i-00909) 14 02-2010 elektor TO DISCOVER. r^toMor 1*1(1*31 TfJ EKISCOWtl Ts« r? 2C/111 & Relatives >>>£».. l..i! W ""aff (ot wjilwpamp' The upgraded Elektor-PLUS subscription! ' im ■t-M — n«J,rJir» r-: — O All 1 1 issues including the Summer Circuits edition O Included in your PLUS subscription: Annua! DVD 2009 0 20 % cheaper than normal retail price o Welcome gift worth £25 O Up to 40% discount on selected Elektor products ( ) Elektor is delivered to your doorstep every month o Read your copy before everyone else O NEW: On your personalized Eiektor PLUS website, you have permanent access to the three latest issues of the magazine in PDF format, as well as to a fast Elektor search engine! NEW: exclusive access wW w.elektor-plus.co M si* 1 When taking out an Elektor PLUS subscription you get exclusive access to www.elektor-plus.com where the three latest editions of Elektor magazine are available in the form of pdf files (Le. the current issue and the two pre- ceding ones), With a simple click you download the complete issue (front to back!) or any single article, www.e I ektor-plus.com also sup- plies the most extensive Elektor search engine found on the web. However the upgraded PLUS subscription offers many more interesting extras like free E-books and supplementary articles. www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. INFOTAINMENT Hexadoku Puzzle with an electronics touch Feel like solving a puzzle again? Here’s another Hexadoku that hopefully allows you to escape from those daily tribulations for a while. Send the hexadecimal numbers in the grey boxes to us and enter the prize draw for a fine set of Elektor vouchers. Have fun! Th e i nstruction s for this p uzzle a re straightforward. I n the diag ra m composed of 16 * 16 boxes, enter numbers such that ad hexadeci- mal numbers 0 through F (that's 0-9 and A-F) occur once only In each row, once in each column and in each of the 4*4 boxes (marked by the thicker black lines). A number of dues are given tn the puzzle Solve Hexadoku and win! Correct solutions received from the entire Elektor readership (all edi- tions v. odd v. id e i autc ■ mat ical I y enter a prize draw for one Elektor Shop voucher worth £ 8U € 100 and three Elektor Shop vouchers worth £ 40.00 / € 50.00 each. We believe these prizes should encourage all our readers to participate! and these determine the start situation. All correct entries received for each month's puzzle go into a draw fora main prize and three lesser prizes. Alt you need to do is send us the numbers in the grey boxes. The puzzle is also available as a free download from www.elektorcom. Participate! Please send your solution (the numbers in the grey boxes) by email to hexadoku@elektor.com - Subject: hexadoku 02-2010 (please copy exactly). Include with your solution: full name and street address. Alternatively,, by fax or post to: Elektor Hexadoku 1000, Great West Road - Brentford TW8 9HH - United Kingdom. Fax (+44) 208 2614447. The closing date is March 2, 2010. Prize winners The solution of the December 2009 Hexadoku is: FI 482. The E~block$ Starter Kit Professional goes to: Mark Lucas (UK). An Elektor SHOP voucher goes to: Wolfgang Beckmann (Germany). Keijo Kirrikki : (Finland), K, D. Reinartz (Germany). Congratulations everybody! 1 4 8 9 C 3 D A 2 E 5 7 B 0 6 F 2 B D C 6 5 F 7 9 0 A 8 4 E 3 1 0 6 F E 9 1 8 2 D 4 B 3 5 C 7 A 5 3 7 A 0 E 4 B F 6 1 C D 9 2 8 6 7 2 B 1 D A C 8 9 F 4 3 5 0 E A 5 E D 4 6 9 0 B 7 3 1 C F 8 2 C F 1 4 8 2 3 5 A D 0 E 7 B 9 6 9 8 3 0 E B 7 F ijc 5J 2 6 1 A 4 D 3 A B 6 F 9 5 D U 1 C 0 2 8 E 7 F 2 C 7 3 0 E 6 5 8 D A 9 4 1 B E 1 9 5 A 8 2 4 [3 B. 7 F 0 6 D C D 0 4 8 B 7 C 1 6 2 E 9 A 3 F 5 4 D 6 1 5 F B 9 0 C 8 2 E 7 A 3 B 9 5 3 7 A 6 E 1 F 4 D 8 2 C 0 8 E 0 F 2 C t 3 7 A 9 B 6 D 5 4 7 C A 2 D 4 0 8 E 3 6 5 F 1 B 9 1 C 3 5 7 F 7 3 C E 4 1 6 A 5 2 E 5 F G 7 2 1 9 B 1 F G 8 E 4 9 1 8 E 7 2 G 3 6 E D F 3 C 8 G 4 1 B A 6 7 4 F 1 3 9 C D 8 F A 7 6 3 9 B D C B 5 6 9 3 2 7 F 4 1 7 1 3 F D 6 B 9 2 E c 7 F E C 8 9 7 A C 2 1 B 5 A 2 6 5 8 9 G E F 7 C G 9 F E 2 The competition is not open to employees of Elektor International Media, its. business partners and/or associated publishing houses. 02-2010 elektor RETRONICS Elektor Teletext Decoder (1981) By Jan Suiting (Elektor UK/US Editorial) Some of you may be surprised to read this but I don't have to do an awful lot to catch items for presenting on the Retronfcs page(s) of Elektor — the vintage stuff usu- ally comes to me after a phone call or an email best typified as “lady-of-the-house sez it must go, or else Recently I've also heard these: "Our new management feels the equipment is surplus to their require- ments.,, "... me attic's starting to creak” and "... such a pity it goes to waste". To which I say keep ‘m coming as we have lost most prototypes of Elektor projects pub- lished over the past 40 years or so. Teletext, an information service based on text and simple graphics all carried via ana- logue TV broadcasts, did take a few years to develop out and mature into a standard (with lots of ifs, buts and hiccups in differ- ent countries). It started in 1 970 when crea- tive BBC and IBA engineers agreed that the 25 picture lines in the field blanking period of a TV signal were suitable for conveying "information 1 instead of just being invisible to viewers at home, as well as mainly black on the oscilloscope They succeeded in filling this vacant area with up to 1 5 characters per line to convey "internal program informa- tion”. When in 1 972 the BBC's experimen- tal Tetedato service was launched the capac- ity had risen to an impressive 32 characters per line. Later that year a conflict of stand- ards occurred when the ISA launched its very own Oracle system, to which the BBC responded by renaming its version to Ceefax ('see facts'). After two years of polite rivalry and customer frustration up and down the country, the IBA, BBC and BREMA were marshalled by the CPO into agreeing on a standard for teletext, essentially combining the best of Orocle and Ceefax while adding colour and simple graphics {no fancy stuff — not even Pacman level). Again two years later the tests' were ended and the defini- tive standard laid down. The system was quick to spread across Europe, viewers call- ing up pages by the 100 K’s every day show- ing weather information, stock exchange lists, airport arrivals/departures and traffic announcements. Wherever 1 s a dearth there's also an oppor- tunity. I’ve no evidence of affordable TVs with buift-En teletext functionality by around 1 980, and the few' decoders on the market at the time required major surgery to the TV set. Elektor in 1 981 filled the gap by pub- lishing a DIY TT decoder that could be con- nected between the aerial and the TV set — so no telly in pieces on the carpet! The Elektor system comprised three cir- cuit boards. The first, described in the October 1981 issue along with a general introduction to the teletext system, con- tains the decoder using state-of-the-art LSI chips with fine names like VIP (SAA5Q30), TAG (SAA5041), TIC (SAA5020) and TROM (SAA5051) — thanks for those great acro- nyms, people at Philips/Signetics! As with most LSI, you kind of glue it all together and follow the datasheet for the most part. I per- sonally remember those SAASOxx ICs were horribly expensive and difficult to get. The control board described in the Novem- ber 1981 issue was mostly an interface between the user keyboard and the decoder proper. It contained a bunch of 74LS TTL ICs like shift registers, timers and flip-flops. Rather unexpectedly, the article series seemed to veer off course by suggesting to feed the video output of the decoder to a suitable point in the TV set. Several add-on circuits were shown and hints were given to isolate the TV set from the AC power lines. Fortunately, in December 1981 the original promise of no tinkering with the TV set' came true with the description of the video control board. This contained ICs like the LM1889N VHP modulatorand the LM1886M RGB decoder, both of which achieved star- dom later as they were cheap and an easy way of getting through to the TV screen without opening the family's prize posses- sion. The "aerial way’, finally, came at a great expense in the form of yet another board, this time for the ‘teletext receiver', compris- ing a commercial VHF/UHF TV tuner module and a TDA2541 IF am p/demodulator chip. The obvious missing link to the project, a three-voltage power supply, was published in February 1 982, The complete Teletext decoder was a mam- moth project covering about 25 densely filled B&W pages in Elektor and it must have cost a small fortune to construct exactly as detailed in the magazine. The articles had the complete PCB artwork printed at full scale for everyone to etch their single- sided circuit boards at home. Like my friend Eric Post who kindly supplied a fully assem- bled decoder, neatly assembled, wired and Installed in a Teko box (not pictured here). The ET TD was a fi ne exam pie of Elektor and its keen readers being ahead of the mar- ket, as TV sets with internal teletext were rare and/or expensive at the time. Hence a fully a working teletext decoder was sure to impress friends and neighbours with important information like snow levels on the Chamonix skiing slopes or the zloty exchange rate! Today, teletext is in the final phase of being killed off by the Internet and digital TV, with many providers folding after about 30 years starting, ironically, in the UK. It's proof that Latin ‘tele' means Tar 1 in terms of dis- tance, not time. (090762) Retronfcs is a monthly column covering vintage electronics including legendary Elektor designs. Contributions . suggestions and requests are welcomed; please send an email to editor@elektor.com elektor 02-2010 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 01 2^ (0) 1 932 564999 Fax 0044 (0) 1932 564998 AVIT RESEARCH w w w. a vitresea rch . 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 ot existing RS232 interfaces. See our webpage for more details. From £10.00, BETA LAYOUT www, pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype RGBs at a traction of the cost of the usual manufacturer’s prices. BLACK ROBOTICS www.blaokrobotics.com Robot platforms and brains for research, hobby and education. * Make your robot talk! * TalkBotBrain is open -source * Free robot speech software * Robot humanisation technology * Mandibot Gripper Robot ByVac www.byvac.coni • PIC32 With BASIC • ARM With Forth • USB to I2C • Serial Devices • VT100 LCD Displays DECIBIT CO.LTD wwiv. d e ci bit.com * Development Kit 2.4 GHz * Transceiver nRF24L01 * AVR MCU ATmega168 CEDA ¥ f Vp * V . y U uL 1 1 1 ceda@vsnl.com -learning $5 Hourly PCB Layout @ S5 Hourly Learn PCB Designing with Multimedia DVD in OrCAD, PADS & ALLEGRO Self or e-learning with support by email, phone & web-meeting DESIGNER SYSTEMS h ttp ://www. designe rsystems .co.uk Professional product development services, • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets. GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44(0) 845 5192306 | i i.-i-i. Iirw- im it i(Lt EASYDAQ www.easydaq.blz • USB powered, 4 relays + 4 DIO channels • Will switch 240VAC @ 1 0A • LabVIEW, VB, VC, C#, Java • Screw terminal access ^4 • Free shipping • From £38 Design & supply of USB, Wireless, LAN, Internet & Serial Relay, DIO 8t DAQ products. info@easydaq.biz EASYSYNC http://www,easysync,co,ul EasySync Ltd sells a wide rang e of single and m ulti- port USB to RS232/RS422 and RS485 converters at competitive prices. y 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 First Technology Transfer Ltd , FIRST TECHNOLOGY TRANSFER LTD. http ://www.ftt. co.uk • Training and Consulting for IT, Embedded and Real Time Systems • Assembler, C, C++ (alt levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas, Tl, Freescale • CMX, uCOSII. FreeRTOS. Linux operating systems • Ethernet, CAN, USB , TCP/IP, Zigbee, Bluetooth programming FLEXIPANEL LTD www.fiexipanel.com. TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors FUTURE TECHNOLOGY DEVICES h ttp:// www . ftdLchip.com FTDl 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 Instruments A Rohde & Schwarz Company 0 Oscilloscopes 0 Power Supplies 0 Radio Frequency Measuring instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com HEXWAX LTD www.hexwax.com World leaders in Driver-Free USB ICs: • USB-UART/SPI/I2C bridges • TEAteaf-USB authentication dongles • expand 10 -USB I/O USB expander • US8-FiieSys flash drive with SPI interface • USB- DAQ data logging flash drive 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 NVGs, GCSEs and GCEs). Also Technical Management and Languages, HE 78 02-2010 elektor products and services directory MQP ELECTRONICS mqp.com • low cost USB Bus Analysers • High. Fufl or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes ww. elektor. com RFID COMPONENTS http/w ww.apdanglia.org.uk z or DIY, OEM's & Experimenters • EM41G0 Cards .99 p (Prices inc vat) • Keyfobs £1 .09 • R/W Keyfobs £1.65 • RFID Coils £2,95 • RFID PCB with RS232 port • RFID IC J s EM4G95 - U227GB • micro RFID module (similar to Core ID12) • Free Reader download - Technical pages Order online 24 hrs - Tel: 01244 520684 ROBOT ELECTRONICS http .7/ www, ro bo t- e I ectron ics.co.uk Advanced Sensors and Electronics for Robotics * Ultrasonic Range Finders * Compass modules * Infra-Red Thermal sensors * Motor Controllers * Vision Systems * Wireless Telemetry Links * Embedded Controllers ROBOTIQ http://wwwJobotiq.co.uk Build your own Robot! Fun for the whole family! Now, available in time for Xmias • Arduino Starter Kits *NEW!I* • Lego NXT Mindstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • ROB Robots (kits and components) email: sales@robotiq.co.uk Tel: 020 8669 0769 USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. s.VS; SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help c li sto it i c is prt > m t >te Iheir b u si ness. Showcase - a permanent feature of the magazine where you will be able to showcase your products and serv ices. IT. ■ For just £242 + VAT (£22 per issue for eleven issues,) Elektor will publish your company name, website address and a 30- word description • For £363 + VAT for the year (£33 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 arc 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 m\ space: * Text insertion only for £242 + VAT * Text and photo for £363 + VA2 .^^1 , X 3^1 li, .......a................... ...... .................. a...,.,...,........, 1 1 ^ Ci . \ I ^ \ J I ( 1 \ T JOB TITLE* ^ .•* « . M Ji J_a 1 . fa - # - r - - r ■ -i- - a- a + a + * a hiii + iti t I + itH d a >- * >- a r a r a r ■ ADDRESS: h M • i» + « + l II - J E J E fa B - 4. . S. . 4. - - . .fa. p fa. - , ■ ■ B ► fa a ■#■ b rBTBTBa-Ba-aa n a- B ii- fe # -fa a- -B a ■ fa fa *■“ “4 - a a- a r a- a a a a p a far B B° B * .TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME ... WFFt ADDRESS T T L_i I.J *■' ■- M—i* L/ 1L 11. 1— i k„J a ■ ij a a a a ■ a * a * ■ + + fa fa # fa-fa + HtaTB^BTflii + H R -r fa 4 a a fa a fa a ir a a a a a a a a a a a a a a a 30- WOR D DFSCR I PTIO IS? “ >_/ I 1 — J I— J I * V i \ I 1 t 1 X— F J ’ B 4 .BJBJ.BJ B 4 J J BBJ.BJ.BJ.aj BJ BJ BJ B J BJ BJ B B BBJB I B J. B E B fa. B -fa B fa 1 t M + 1 f ■ fa! 41 +1 + B + ^ M I + F 4 ?*■ fa fa 4 » fa fa fa » fa fa fa 4 fa fa* fa I fa I fa I fa B fa i r a a a * a ■ a a- a a a fa fa a 'fa fa a- a raTB-raa aa a a aa r a r a r i fa ■■ 'fa fa -fa ■ * ■ » * % -fa 4 ■ falfaBfaf fa fa ■ + i -fa a + I + i! + i fa- fa 4 fa + 6 4- fa 4 fa fa a fa fa s + - fa s fa i fa fa fa fa s fa a fa- a r bp bp b aBi a a a a aa BJ BJ I. J I. J BJ BJ BB-f.BJ.BJ.B4. BJ ! fa I ! fa fa fa ! fa i fa I fa H I* C fa fa 4 fa fa fa* fa fa" fa fa + § ■ fa- fa fa " fa bjbjbjj.^.^bjb. r a B B - a - a a- - i I B J E J B J I. J B J B B B B 4. B 4. S 4 B J. B 4 ■ fa I fa L J elektor 02-2010 79 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Going Strong A world of electronics from a single shop! Complete with a free pen and SMD-tool Elektor Personal Organizer 201 0 Do you already have a diary for the coming year? If you don’t, you can end your search now. We have exactly what you need: a diary specially designed for electronics enthusiasts. The Elektor Personal Organizer 201 0 makes planning your appointments a real pleasure, and you always have ready access to have handy information that everyone who works with electronics needs to know. In addition to the usual features such as an appointments calendar, address book and notes pages, this organizer has around 40 pages (in English) packed with useful information for you as an electronics specialist, both professionally and in your leisure time. For example, there is an extensive collection of formulas and tables for calculating current and voltage, component descriptions, physical constants, connec- tor pin assignments, and much more. This organizer also includes information on international trade fairs related to electronics and computer technology. I5BN978-9Q-533T2471 * £24.90 * US $40,20 Circuit design and programming Complete practical measure- ment systems using a PC This book covers both hardware and soft- ware aspects of designing typical embed- ded systems based on person a Ico mputers running the Windows operating system. It's use of modem techniques in detailed, numerous examples has been designed to show clearly how straightforward it can be to create the interfaces between digital and analog electronics, programming and Web-design, With an emphasis on learning by doing, readers are encouraged by exam- ples to program with ease: the book pro- vides dear guidelines as to the appropriate programming techniques "on the fly". 292 pages ■ ISBN 978-0 -9Q57G5-79 8 £28,50 * US $46.00 C* 2008 AMP NET Programming j'CN- ►, l I -TTHliNlt EUSO.TJE EH-H I ^ rf >, At.LW3¥1h 0l*lctor Learn more about C u programming and .NET C# 2008 and .NET programming This book is aimed at Engineers and Scien- tists who want to learn about the .NET en- vironment and C# programming or who have an interest in interfacing ha rdware to a PC, The book covers the Visual Studio 2008 development environment, the .NET fra m ewo rk a nd C# prog ramni i ng I a nguage from data types and program Row to more advanced concepts including object ori- ented programming. 240 pages * ISBN 978-0-905705-81-1 £29,50 * US$47.60 Prices and item descriptions subjectto change. E, & CUE 02-2010 elektor 8o Home electric power Your own Eco-Electrical A Home Power System This book provides the semi-technical, power-conscious homeowner a place to begin in the quest for home electric power. Both the essential principles and detailed information on howto build ormaintain a home electric system off the utility grid are presented in an easy-going style. This booklet will help you to safeguard or de- velo p you r own ho m e ele c trf d ty su pp ly . 1 1 contains step-by-step calculations, practi- cal details, examples and much more. 96 pages * ISBN 978-0-905705- 82-8 £16.50 * US $26.70 PIC cookbook for virtual Instrumentation Several case studies included PIC Cookbook for Virtual Instrumentation The software simulation of gauges, con- trol-knobs, meters and indicators which behave just like real hardware components on a PC’s screen is known as virtual instru- mentation. In this book, the Delphi pro- gram is used to create these mimics and PIC based external sensors are connected via a USB/R5232 converter communication fink to a PC Case studies of virtual instruments are detailed including a compass, an oscillo- scope, a digital and analogue thermometer and virtual displays for cars and aircraft 264 pages ■ ISBN 978-0-905705-84-2 £29,50 - US £47.60 A Look into the electronics of eco -power Practical Eco-Electrical Home Power Electronics This book is a sequel to Your own Eco- Electrical Home Power System and goes deeper into the electronics of photovol- taicand thermal solartechnologies* wind power conversion, inverter circuits, and loads such as electronic lighting. Power electronics circuit theory is presented while analyzing commercial circuits, including little-known converters and subtleties such as snubbers and leakage inductance. The book also offers in-depth coverage of power system strategizing for optimal efficiency and utility, inclu- ding a 1 70 V DC bus, commercial solar charger design with detailed circuit explanations, wind generator electric machine electromechanical theory, wind converter design requirements and the se ri es -L ze ro -c u r re nt- s wi tc h t ng co n verier and power supplies found inside loads connected to home power systems and their potential problems and conse- quences for inverters. 192 pages * ISBN 978*0-905705-83-5 £24.90 • USS40.20 Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: saIes@elektor.com 110 issues, more than 2,100 articles DVD Elektor 1 990 through 1 999 This DVD-ROM contains the full range of 1 990-1999 volumes (all 110 issues) of Elektor Electronics magazine (PDF). The more than 2,100 separate articles have been classified chronological lly by their dates of publication (month/year), but are also listed alphabetically by topic, A comprehensive index enables you to search the entire DVD. ISBN 97 8*0 -905 70 5- 7G -7 £69.00 * US SI 11,30 See the light on Solid State Lighting DVD LED Toolbox This DVD-ROM contains carefully-sorted comprehensive technical docu mentation about and around LEDs. For standard mod- els, and for a selection of LED modules, this Toolbox gathers together data sheets from all the manufacturers* application notes, design guides, white papers and so on. It offers several hundred drivers for power- ing and controlling LEDs in different con- figurations, along with ready-to-use modules (power supply units. DMX con- trollers, dimmers, etc.). In addition to opti- cal systems* light detectors, hardware, etc,, this DVD also addresses the main shortcoming of power LEDs: heating. This DVD contains several Elektor articles (morethan 100) on Lhe subject of LEDs. ISBN 978-90-5381245-7 £28,50 * US £46,00 elektor 02-2010 81 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Modern tech n ol o gy for ewe ryone FPGA Course FPCAs have established a firm positron in the modem electronics designer's toolkit. Until recently, these 'super components' were practicallyreservedforspecialistsin high-tech companies. The nine tessonson this courseware CD-ROM are a step by step guide to the world of Field Program- mable Gate Array technology. Subjects covered include not just digital logic and bus systems but also building an FPGA Webserver, a 4-channel multimeter and a USB controller. The CD also contains PCB layout files in pdf format, a Quartos man- ual, project software and various supple- mentary instructions, ISBN 978-30 -53B1 -225-9 £14-50 * US $23,40 Completely updated The prog ram package con sistsof eight data- banks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers, A further eleven applica- tions cover the calculation of, for exam pie, LE D seri es d ro ppers , zener d iod e series resis- tors, voltage regulators and AMVs. A colour band decoder is included for determining resistor and inductor values, ECD 5 gives in- stant access to data on more than 69,000 components. All databank applications are fully interactive, allowing the user to add, ed it a nd com pi ete co m pon ent data . ISBN 978-90-5381-159-7 04.90 * US $40,20 MIAC for Home Automation (January 2010) A MIAC is an industrial programmable lo- gic controller (FIX) that can be used In a wide variety of electronic system s. Inter- nally ithas a powerful 1 8F4455 PIC micro- controller which is connected directly to a USB port. As a result it can be easily pro- grammed using either Flowcode, C or as- sembly. The article in Elektor's January 2010 issue shows how to implementate a simple home automation system with an alarm by using three MIACs. Populated PCB in enclosure ArlJ 090278-91 * £154.00 ■ US$248.40 Preselector for Elektor SDR (December 2009) Pektor’s Software Defined Radio (SDR) is deservedly popular. The performance of a receiver depends to a large extent on its input filters, A selective input circuit im- proves antenna matching and immunity to interference from other strong signa ls. This preselector allows the use of up to four filters, tuned under software control using va ricap diodes, Atuned loop anten- na is also described that lets you use our SDR without an outdoor antenna. Kit of parts, contains partly populated board, coil formers , ferrite rod with coils Art,# 090615-71 - £47,00 * US$75.90 R32C Web Server (November 2009} The R32C microcontroller goes Internet! A small add-on mod u le for the application board from our September 2009 issue combines a TCP/IP chip plus Ethernet inter- face, a network connection with built-in transformer and status LEDs. This handy combination makes it child's play to implement a web server and many other Internet applications without getting involved in complexities such as TCP/IP protocols, PCB, populated and tested WIZ8 J 2Mi module with W5 1 00 chip Art.# 090607-91 * £ 1 3.00 * L'S S29 Ifi OBD Analyser NG (September 2009} The compact OBD2 Analyser in the June 2007 issue was an enormous success - not surprising for an affordable handheld onboard diagnostics device with auto- matic protocol recognition and error codes explained in plain language. Now enhanced with a graphical display, Cortex M3 processor and an Open Source user interface, the next generation of Elektor 1 s standalone analyser sets new standards fora DIY OBD2 project. The key advan- tage of this OBD2 Analyser NG is that it’s self-contained and can plug into any OBD diagnostic port. Kit of parts including DXM Module, PCB SMD-prefiJted, cose f mounting materials and cable 82 Prices and item descriptions subject to change, E. & O.E 02-2010 elektor Febma ry 2 0 1 0 { No, 398} ^ ^ ® * + + Product Shortlist February: See www. elektor.com + + + January 2010 {No. 397) USB Magic Eye 090788-1 Printed circuit board * * 9.9tL..,„ 16.00 090788-41 ... ATtiny231 3-20PU. programmed ...,.9,90 16,00 M I AC fo r H o me Au to mation 090278-91 ... Populated PCB in enclosure 1 54.00 .,,.,24840 Dimmer wit ha Micro 09031 5-41 ... PIC12F629A, programmed 7.60 1 2.30 December 2009 (No. 396) Preselector for Elektor SDR 09061 5-71 ... Kit of parts, contains partly populated board coil formers, ferrite rod with coils, , 47,00**.**. ,75,90 Top -of-the -Bill Lights Sequencer 0901 25*1 PCB, bare {master module)... 1 0.80 17.50 090125-2 PCB. bare {lamp module) 2.30 3.80 090125-41 ... Controller (PIC1 SF2550) for main PCB, programmed 14.50 ,23.40 0901 25-42 ...Controller (P1C1 2F5084/SN) for lamp unit, programmed 2.30,,..,... 3.80 The Vikings Are Coming! 080948*71 ,.. Kit of parts: bare PCB and bluetooth module BTVI222 23.70. ...... 38, 30 Minimallstk Time Switch 090823-41 PIC12F683-I/SN, programmed 6.50...,,,, 10.50 November 2009 {No, 395) So! derStation ‘Plus' 090022-41 „.PIC1SF4520, programmed..,,,. 1 1 ,50 18,60 AVR-Max Chess Computer 081 101-1 Printed circuit board. ,.., 1 2.90 20.90 0B1 101-41 ...Programmed controller ATmega 88 11.50 18.60 081101-71 ...Kit of parts ind, PCB, p rogra mm ed co ntrol I e r and com ponents „ 29 ,90 „48 . 30 R32C Web Server 080082- 71... Appi i c ation Boa rd with SMD parts pre fi tted , plus all other components 1 24.50 200.90 080928-9 1 . . , P 32C Sta rter Kit: p rocesso r boa rd pup u fated and tested. Too I chain on CD, 27.00 43.60 090607-7 1 ... PCB, populated and tested WIZB12MJ module with W5 1 00 chip 1 8,00, .,..., 29. 1 0 October 2009 (No. 394) Pocket Preamp 080278-71 ... Kit of parts, iiMiriimn m .ISHipBBHI-HI'HTBB*' *• + ■ Pt! H ■ M? M ( PS IsS-S Mi>f> 65.00 4 ■ PS S 104.90 Digital Barometric Altimeter 080444-41 ,,. PIC 18F2423. programmed 15.00 ..24.20 September 2009 {No. 393) R32C Application Board " 1 0 082 -7 1 ... Kit of pa rts in dud Eng Ap plkatio n Boa rd wi th SM D parts pre Fi tted P plus all other com po nen ts 124 .50, , „ .2 00 , 90 38 0928-91 ... R32CStarterkit: Processor board populated and tested, Tookhain on CD ,,,, 27,00 43.60 OBD Analyser NG 090451-71 ...Kit of parts including DXM Module, PCBSMD- prefitted, case, mounting materials and cable 84.00...,. 135. 50 Battery Monitor 0 304 5 1 -72 ... -LC display .. . .. ... ..... ... n. .. ... ... r ... ......... ..... .. 1 1 .00, ,,,,,, 1 7.S , 0 080824-1 „.* Printed circuit board...,...,., 12,90 20.90 080824-41 ,„ Programmed controller LPC2 103 16.50,, .,..,26 .70 Complete practical measurement using a PC ISBN 978-0-905705-79-8 .,,, £28,50 US$46.00 PIC Cookbook for Virtual Instrumental tun ISBN 978-0-905705-84-2.... £29.50 US$47.60 Practical Eco-Electrical Home Power Electronics ISBN 978-0-905705-83-5.... £24.90 US$40.20 Your own Eco-Electrical Home Power System ISBN 978-0-905705-82-8.... £1 6.50 .....US 526.70 C# 2008 and .NET programming ISBN 978-0-905705-81-1..,. £29,50 US $47.60 QQO Z? •Jl J OVD Elektor 1990 through ISBN 978-0-905705-76-7 £69.00 ...US $ 1 1 1.30 iii v D LED Toolbox ISBN 978-90-5381-245-7.... £28.50 US $46.00 ECD5 ISBN 978-90-5381-159-7.,.. £24,90 US$40,20 FPGA Course ISBN 978-90-5381 -225-9.... £14.50 US $23.40 Ethernet Toolbox ISBN 978-90-5381 -214-3.... £19.50 .... US $31,50 SDR Preselector Art. # 090615-71 £47.00 US $75.90 R32C/111 Starterkit Art. # 080928-91 £27.00 US $43.60 R32C Web Server Art.# 090607-91 £18.00 US$29.10 R32C Application Board Art. #080082-71 £1 24.50 ...US $200.90 OBD Analyser NG Art. #090451 -71 £84.00 —US $135.50/ Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Reg us Brentford 1000 Great West Road Brentford TW8 9HH * United Kingdom Tel, +44 20 82614509 Fax +44 20 8261 4447 Email: sales@elektor.com elektor 02-2010 83 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR ATMiS VisiOLED This doorbell has a few features seen in top of the range Miami condos only: visitors have their RFID card scanned at the entrance and the houseowner sees a photo of the visitor on an OLED display. A button push opens the door This ambitious project employs the now famous Elektor ATIVhS microcontroller board (from April 2008) and the associated RFID reader (June 2009). The free software is open to extension and expansion! Three-channel DMX512-A Receiver The DMX512-A system is used in many of today's lighting systems Installed in theatres and concert halls. The same is also increasingly applied for outside lighting of large build- ings, In this project a DMX-512 lights control is realised with the aid of a Texas Instru- ments MSP430 microcontroller. It handles the DMC communication as well as controlling three LED power drivers using pulsewidth communication. A DIP switch allows the DMX addressto be set. Mini Class D Amplifier Although switching audio power amplifiers are now well established, home constructors often find themselves restricted to simple circuits. The switching audio amp in the March 2010 edition of Elektor is small, neatly designed and comes with a number of extras. The circuit is based around a MAX9744 and outputs 2x20 watts at an efficiency of 94 L1 o. The project has built-in volume and tone control as well as a backlit LCD. No knobs... every- thing is adjusted using a remote control! The JVfom h jfjif) rsiwcomtfs on sole on Thursday, February {UK distribution only). UK mainland subscribers will receive the issue between Februat y t2 and 15, iota. Article tides arid magazine contents subject to change; please check the <\ Magazine tab on www.elektt ir.c ■ m : vw.elektor.com www.elektor.com www.elektor.com www.elekt Elektor 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, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you’ll find all other products sold by the publishers, like CD-ROMs, DVDs, kits, modules, equipment, tools and books. A powerful search function allows you to search for items and references across the entire website. Slektor jet: i al Christmas 1 Oiler ** ** W. r. - 1*1 . U i^fl Also on the Elektor website: Electronics news and Elektor announcements • Readers Forum PCB, software and e-magazine downloads Time limited offers FAQ, Author Guidelines and Contact iff f£4iE ! v IriftrrtUb.C IrbtlK ■fC'S'iCt'J Kiel IMW Sficfc 5u6*cr» BOW F^ru.-n lull Birxil*. *31. BF Qe-L^ ' WKHt 'm t i-g vUC » jui! it? 14 r i» m CmL 7 rtf ,nj^-*e ix £*»r VllkKnlrt )P Irii H >rfT hwi RefcSBi PIC CtDiBwi dvr yirtrf lAtVun4F4lM>t 5*111*1' .,4 k. *ap c»>k.-mc Sena 0 W CaiTVC-PDHi W 1'tF * NHlftl e pcbx ri (MrtUn v H.frlxi-fd ^ Ottrr, M tklkr Cr*9rti wmmumm IPH1PH mv 1 I k-li" P-tlildl >*r jsli, Kit of parts Elekt e /■mjT-ii-Hi*! r-r n. PrpliclfpM CrJr .Hi.' ItUi'i . . r -■ 1 1 , ' Bu i IBB WCirf# t — S1=SS=M e-(Fr E:rx i Ki hl e lektor PCB Strvm Pi t* ftMk IS r-« f : r T«#ta F*h tlra:- ihi E ! ea(vSli"[ir*Kinnc , - J J Pi, k ij: r T *i»d fed 1 npni, rre |tiS null El ■M 84 oi-20io elektor ■ ■ Description Price each Qty. Total Order Code PIC Cookbook _ for Virtual Instrumentation £29.50 Complete practical measurement systems _ using a PC £28.50 Practical Eco-Electrical Home Power Electronics £24.90 Your own Eco-Electrical Home Power System £is.so Sub -to to/ Prices and item descriptions subject to change. The pu b Ei s hers reserve th e rig ht to cha n ge p rices P&tP without prior notification. Prices and item descriptions shown here supersede those in previous issues, £, & 0,E, Total paid METHOD OF PAYMENT [see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK- resident customers ONLY) □ Giro transfer □ T5 " □ 41 — 1 1 — Jl— — __U JL IL Expiry date: Verification code; Please send this order form to ’ (see reverse for conditions) Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Address + Post code Tel. Email Date - - Signature EL02 Te!.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com sales'? elektor.com USA and Canada residents should use S prices, and send the ordei form to: Eiektnr US 4 Park Street Vernon C 1 060 66 USA Phone: 86D-875-2199 Fax: 860-871-0411 E mail: sales » eleklor.com Yes, I am taking out an annual subscription to Elektor and receive a free 2GB MP3 player*. I would like: _] Standard Subscription (11 issues) HI Subscription-Plus (1 1 issues plus the Elektor Volume 2009 CD-ROM + exclusive access to www.elektor-plus.com) Offer available to Subscribers who hove not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Nome Address + Post code Tel Email Dote Signature EL02 METHOD OF PAYMENT {see reverse before ticking as appropriate) | | Bank transfer | | Cheque (UK-resident customers ONLY) | J Giro transfer Expiry date: Verification code: Please send this order form to Elektor Reg us Brentford 1 000 Great West Road Brentford TWS 9HH United Kingdom Teh: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com subscri ptionsfr clektor.com ORDERING INSTRUCTIONS, P&P CHARGES Afl orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. Online ordering: www.elektor.com/shop Readers in the USA and Canada should send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Elektor US for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £1 1.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 with ABN-AMRO Bank, London, IBAN: CB35 ABNA 4050 3040 2095 20. BIC: ABNACB2L Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no, 34-1 52-3801 , held by Elektor Electronics. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre, Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security, COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive, TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran- tee this time scale for all orders. Returns Faulty goods or goods sent in error maybe 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 2 1-days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5,00, Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines, Elektor does not accept responsi- bility 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 adver- tisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed -circuit boards may be produced for private arid personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall iiii-rrBSTrr»*Trssv tp-- — I. SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £49.00 £61.50 Surface Mail Rest of the World £63,00 £75.50 Airmail Rest of the World £79.00 £91*50 USA £64.95 1 See www.elektor.c0m/usa Canada £75,95 for special offers HOW TO PAY Bank transfer into account no. 40209520 held by Elektor Elec- tronics. with ABN-AMRQ Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIG: ABNAGB2L, Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics, We can only accept sterling cheques and bank drafts from UK-resident cus- tomers 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-380 1 * held by Elektor Elec- tronics. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email* web, fax and telephone. Online ordering through our website is SSL-protected for your security. be determined in all respects by the laws of England, January 2010 ■■aaj.iiBBan i ^ t ■ j i ■ l _ j ■ c b j i ■ l ■ j i ■ ibaiiraiiiaai in nnan ■. n ■ ■ i ■ ■ ■ i t ■ p-^-i SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a permanent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs E39.20, a Student Subscription-Plus costs £5 1 .70 (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 2010 lektor Order custom-designed boards from the Elektor PCB Service The advantages at a glance • Professional quality PCBs. • No film charges or start-up charges. • No minimum order quantity or charge for this service. Available to private and commercial customers. • Design check applied to all entries. We’ll let you know within 4 hours! ■ Two RGBs supplied - three produced. If tile third board is also okay, you receive it as well - tree of charge! Quick, cheap and secure www.elektorpcbservice.com Index of Advertisers Anfex Electronics Ltc APD, Showcase Avit Research. Showcase Beijing Draco Electronics Ltd Seta Layout. Showcase Black Robotics, Showcase By Vac, Showcase * CEDA. Showcase.. Decfbtt Co. Ltd. Showcase Designer Systems Showcase Easy DAG, Showcase Easysync. Showcase Elnec, Showcase . . Eurocircuits , ...... Fsret Technology Transfer Lid Showcase . . FlexiPanel! Ltd. Showcase F utu re Tec h nology D evuc es . S ho wc as e Hameg, Showcase. HcxWax Ltd. Showcase . . ........ www.antex.coMk ...... — 4 t + k ■ i t h ■ 1 ^7 www.apd 3 nglta. 0 rg.uk . ...79 www.avitresearch-CO.uk . . . ■ ■■■■!,■■■ 1 I, / £1 www.eipeit.com 9 ■* + + B — + + ■ ■ 1 t ■ V vAvw.pcb-pooi.com ,,...,,,19, / 8 wwwbtackrobotics.com . . . 78 www.byvac.com !■■■')■■■■■■ 7 8 www.ceda.ijrr, . , 7 A •*■--41 r -» i »■ P V Hwv.decrM.com ......... wmv. designersystems . co. ufc 78 www.easydag.Piz 73 www.easysypc.co.ok ...... 78 wvmelnec.com 78 www.eurocircuits.com ..... ■ - + + fe ■ 1 r ■ • • 33 wwwMco.uk ...... ■«**+•■*■• f r 1 73 wwwJtexipanet.com . . 78 1 • ■ ■ 4 1 t- ■ f l i 1 U wwwjtdichip.com www.hameg.com 76 www.hexwax.com 78 Lab center. . + 1 iWjwJabcenier.com 88 London Eieclronics College. Showcase ..... www.tec.ofg.uk 78 MikroElekironika. ... * , , t www.mikroe.cofn + . . . 3 MOP Eieclronics, Showcase. www.mqp.eom 79 Newbury Electronics www. newburyefecfronics. co. uk , , .57 Murve Networks . . , wv/v/.xgamestation.com , . . * 57 Parallax ..... www.parattax. com 17 Pico www picotech.com/scopeW54 19 Quasar Electronics Robot Electronics, Showcase Robotiq, Showcase Showcase USB Instruments. Showcase Vir tins Technology, Showcase twiv, quasaretectromcs.com 2 www robot -elect fonies. co. uk 79 . . www. roboliq.co.uk . 79 . . wwwMsb-insttvnKnis.com 79 . wwwMrtinSMom. ........ 79 Advertising space for the issue 18 March 2010 may be reserved not taler Ihan 16 February 2010 with Huson International Media - Cambridge House * Gogmore Lane - Chertsey. Surrey KT10 SAP - England - Telephone 01932 564 999 - Fax 01932 564 99S - e-mail: ros.elgar@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. elektor 02-2010 1 The latest version of the Proteus Design Suite harnesses the power of your computer’s graphics card to provide lightning fast performance. Together with unique transparency options it’s now easier thari ever to navigate and understand large, multi-layer boards. PROTEUS DESIGN SUITE Features Board Autoplacement & Gateswap Optimiser. Direct CADCAM, ODB++ & PDF Output. Integrated 3D Viewer with 3DS and DXF export Mixed Mode SPICE Simulation Engine. Co-Simulation of PIC, AVR, 8051 and ARM7. Direct Technical Support at no additional cost. Hardware Accelerated Performance. Unique Thru-View™ Board Transparency. Over 35k Schematic & PCB library parts. Integrated Shape Based Auto-router. Flexible Design Rule Management. Polygonal and Split Power Plane Support All levels of the Proteus Design Suite include a world class, fully integrated shape-based autorouter at no additional cost • prices start from just £150 exc. VAT & delivery Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com