Fireflies Easy experimenting with Artificial Intelligence + Super Robots Myths, promises, threats + Sceptre The software library Unilab A switch-mode 0-30 V / 3 A bench supply + OBD Analyser NC gets Bluetoothed Measuring Tweezers Special tools for measuring SMD components WWW ;.;om USB 2.0 host/slave controller. - Handles USB host interfaces and data transfer functions using the in-buiit 16-bit enhanced MCU with 256 kbyte Flash and 16kbyte RAM. - Royalty-free flexible 'C' language Integrated Development Environment including compiler, drivers libraries and RTOS kernel to provide the designer with PIMP YOUR PIC WITH OUR COMPILERS \jtnC PRO t« PtCTBs»mfHlPi Will >«> iv* Op J$ £ * ^ el » } ap YW*** fAjrte ' 13 □ , - ♦‘K - ;■ r tomfi. *■ Tiaih fji=4alr> » LCD CM * lcd pa ■ LCD PS * UCP D7 * LCD EN LCD RS s i-ai^l .stifi a GW fl* ‘ 'nmp * •Dta lew V*Ju*: lr.lt Mm Ct_GMlU:a_CLEAf!J .* j. = a oi! lc : '-isa GP_y f? ? ; ;,cd_o«M - - is • 1 ■ )-■ -tilHS ZEZ ictIChrr:. ii’c’ ^ //— .wjfn Jiysp ' initials* ?-Cr cJejf LCr Tur." -urjp:- i?fi 3 4* ® J V J G ■ O P * lOd j p O a D a mmk muz a a m ■ pff r ■ — - -r ,- - ••■.;-• 1 ' Ow R«»»t 0 ; D*J!;its It" ) j Cw Wrl ta >. '! t Do tay_us i : J f On Eta eat () ; Dw ^ 1 1 1 9 [ I ; n-if Write i >; t,*«a * c-*_-fiaae i f i L emp <= Ow fleiHi [1 t« -v - nrrp; — f^ntz 4rui display result an Led ipiay . Te.sper n . ssr * < t // Onevire rasmt liffM l • f7i,iLe SKTS Pi L‘* i iswuv ztXfsxtnri rflW^Mr J* V /tiLrr v-E-RmjJSJj '£iIX,FjtSfc 7 iJ.TUf r-5i7TTiJinrf RHAl SCHA V T{J m MVaePi Vrtijtf-- □ U ii* £1 *' **> ** *1 • 61 s ^ 1#* + Aim tc 1 » Add St'isi WlrtaMl drum LsE 1 ■v Siurcn tarupridJjM oy asui'^tiFp' rmmar Haunt Vfllu- Adurms h;l7l“ CneV^im { } OrfOSA A crud -yirniuM 1 OxCKKfO mfl.chsr 32 (hflOCE etifir' 32 0)ticC PRO Id C. iPmgrafU PlBS’WikrDd&idnjftka^dtraC PJIO Ip C Prg^rsr^i “ ' ! I ■>•_: Hl* 1 r i-n * ‘.aT I Ih r &C PROIj C Pr^ra^. Files, 1 / tsofitehlf Drika' mlhraC F^O To > 1*9 9'-' K WeHif.gu tti Weiiaije Teal 1 • HrxPir. bohmaf iopg E£ -o m 1 1 n u .ii-d Pritpo*53efl In ! Hirii 2*>npieffiOi' Slai9e3 Canp»eii v 4J5fwr cjt, W fire C<3^vlnfl I' *7 ;*# “iOjOtl Si.<<«tili/ » F-1 Lrwl m i vIhtis "■HWl Gonraa-d i-.ii . _ l.lfirury hfanugtrr ^ ^ lJ 1 □ Birttifn ► □ CKfi.So - j~l Cortvnmpiirit - I, J Ctyp® - ■ j iSPl.eitrmai - □ Gtt Q ShSCl. Fflnh " D K*rWMH4*4 * E :L«f 0 icd.Cfv’.sidjiiiii T Cl MancheHsf ■ nw*th ► 0 Qk» Wpd ■ DfS2 * OHS^ti ■ ' I Q>*4llkHahB > SI a Mikroelektronika compilers for PIC offers the easy-to-use user interface, which was designed to get you going fast with your PIC microcontroller. Modern and user oriented IDE which comes with compilers will show you that microcontroller project development can be easy and fast. Compilers comes with wide-range of libraries that are completely documented and supplied with practical examples. Also, there is set of tools that is used for collecting project information such as statistics and various types of tool that are used for application testing. MikroElektronika DEVELOPMENT TOOLS I COMPILERS t BOOKS www.mikroe.com Pop it off the stack Contrary to what some readers seem to think or even fear, assembling Elektor as a monthly journal is hardly ever a problem in terms of articles in stock. Indeed I've a small stack of articles worth 50 odd pages I can easily slot into any edition — no problem, it seems, but thafs in terms of pages only. The trouble comes with the various factors exerting force on the content. Let me list a few, not necessarily in order of importance: the theme of the month, the enthusiasm of a lab worker about his XYZ widget, advertising pages sold and arriving at 11.59, announcements printed on the Coming Attractions page, Anglo-American electronics culture issues, embedded systems shows, cover design, competitors' coverage of the subject, author contracts, Items sold in our web shop, articles to be supplied for translation to licence partners. Each of these factors (there are many more) can clash with just about any of the others, so the conflict matrix Is potentially large, while the only dead certs I look at every month are: 88 pages to fill and the edi- tion to arrive at subscribers on [date#i] sort of punctually and in bookshops on [date#2+5], punctually. While this paints a grim situation, nothing untoward happened these past 399 editions and in fact it's the wide diversity of subjects and articles that brings relief rather than complication. The edition at hand is a fine example of variegated articles at many levels and covering the ever increasing areas and niches modem electronics seems to diverge into. We look at robotics both high brow {Super Robots, page 16) and down to earth (Fun with Fireflies, page 58) with the latter article a small gem by presenting a hands-on approach to the concepts of artificial Intelligence and robot swarms. Our efforts at removing widespread fears of working with SMD parts conti- nues unabated with Measuring Tweezers (page 22) in which five of those nifty tools are examined to see if they are worth the investment. Another can of worms called microcontroller vs, conventional electronics can remain largely dosed this month with both 'sides' served almost equally in terms of pages. Tell me If you think otherwise and I wilt put your message on the stack of things to do to keep everybody happy in 88 pages, jan Suiting Editor, Elektor UK & US editions 6 8 10 22 44 Colophon Corporate information on Elektor magazine. Mailbox Monthly pick of Letters to the Editor News & New Products A monthly roundup of all the latest in electronics land. Super Robots Myths, promises and the 'here and now', with a focus on swarm theories applied to robotics. Measuring Tweezers five SMD measuring tweezers compared and put through their paces. Unilab A construction project for a switch-mode 0-30 V / 3 A benchtop power supply. Grasping the Sceptre Continuing on from last month we discuss the software library developed for the Elektor Sceptre ARM platform. A Fast Charger Here's how to turn a low-cost computer S MRS into a battery charger — and not just for the Elektor E-Wheelie. Latest from the Elektor Lab On guests in the lab and fighting corrosion with protective sprays. The making of the dsPIC board A look behind the scenes of project production in the Elektor lab. C0 2 meter under test A road test of our C 0 2 meter. How does it perform In a car? 4 nfin CONTENTS Volume 36 April 2010 no. 400 16 Super Robots With time, things that were once considered phantastleal quite often get to be ‘realised’. How close are we to realising the kinds of robots and intelligent com- puter systems depicted in films such as HAL in Kubrick's 2007 A Space Odyssey , or the lifelike child in At, or the kinds of robots in i Robot? 22 Measuring Tweezers SMD parts are a pain to deal with —you can hardly tell different types of passive components apart, and the markings are not especially clean Now, with special SMD measuring tweezers, you can quickly check what type of component you have and measure its value. We tried out five such devices in our lab. 26 Unilab This switch-mode 0-30 V / 3 A dual power supply is especially handy when you need more than one supply voltage. Naturally, both supplies are galvanically isolated, so they can also be connected in series for higher voltages or in paral- lel (connected via diodes) to provide more current 54 Bluetooth for OBD-2 Elektor 1 s hand-held OBD Analyser NG has an open-source operating system and a biFilt-in expansion port. Both enable a Bluetooth module to be integrated with ease. Now at the other end of an RF link you can view engine parameters and faults on a netbook or notebook PC! 48 Small is Beautiful: MinimodiS Introducing the successor of the Elektor ATMiS: pushbuttons, LCD, USB, I2C, ISP/SP1 and an ATmega32, all on a compact board. 54 Bluetooth for OBD-2 Th is is what you need to extend your GBD-2 Analyser NG with wireless communication to a laptop, netbook or notebook PC, 58 Fun with Fireflies Learn about the basics of robot swarms and artificial intelligence with these little creatures, 64 BurnorTurn? Got a dead hard disk lying around? Why not convert it to a motor and make it do something useful? 67 Beep, beep ... Sesame A keypad operated door lock with a musical talent. 70 5 V Power Controller Convert "anything* between 2 V and 8 V into a stable and reliable 5 V source for microcontroller projects, 75 Design Tips A voltage booster for Arduino UV light box 76 Hexadoku Our monthly puzzle with an electronics touch. 77 Retro nics: C4WIIVI 24cm ATV Transmitter (1994) Regular feature on electronics odd & ancient*. 84 Coming Attractions Next month in Elektor magazine. elektor 03-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 beginnerto diehard, from student to lecturer, information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. Jektor Apir Fireflies Easy experimenting with Artificial Intelligence + Super Robots Myths 4 promises, threats + Sceptre The software library i J Unilab A switch -mode 0- 30 V / 3 A bench supply + OB D Analyser IMG gets Bluetoothed Measuring Tweezers Special tools for measuring 5MD components ANALOGUE • DIGITAL jynH MICROCONTROLLERS & EMBEDDED AUDIO • TEST & MEASUREMENT Volume 36, Number 400, April 2010 ISSNT757-0875 Elektor asms at Inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology, Elektor International Media, Bogus Brentford. 1000 Cl eat West Road, Brentford TW8 gHH, England. Tel. (+44)208 2&t 4509. fax: (+44)208 261 4447 wwuv.elek tor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subset ipti on. Elektor is published n times a year with a double issue for July & August aii— __ _ Elektor is also published in French, Spanish, American English, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor, Wisse Hettinga (w. hettinga@elektQr.nl) Jan Bolting (edStor@elektor.com) Harry Bag gen, Thijs Beckers, Eduardo Corral, Ernst KrempeJsauer, |ens Nickel, Clemens Valeris. Antoine Authier (Head), Ton Giesberts, Luc Lemmens. Daniel Rodrigues, Jan Visser. Christian Vos sen Edo one] secretarial: HedvvSg Hennekens (seer eta riiaat@elektor,nl) Giel Dots, Mart Sehroijen Paul Gnakkers Carlo van Nistelrooy Elektor international Media, Regus Brentford. 1000 Great West Road, Brentford TW8 9HH. England. Tsi ' -44 20 8 2 G 1 4509 . fa x: (+4 4) 20 & 261 4447 I n tern e t: vvvvw.el e ktor.com/ subs 6 04-2010 elektor Elektor Tools for PCB Productio (ZZ^> 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. £90 1 S150 1 €100 DISCOUNT r Elektor Pick & Place Tool For manual fitti ng of SMT components on circuit boards * Adjustable anti static arm rest for stable positioning of components - Anti static component storage system * Magnetic supports for PCB * Suction tool with different pickup needle sizes - Maintenance-free vacuum pump - Kit of parts for home assembly, with clear manual 450 x 150 x 100 mm | 2.5 kg £575.00 | US $915,00 J €645.00* ' Prices including VAT (EU destinations), excluding shipping. JJektor Elektor Stencil Machine Use a stencil for accurate applying of solder paste on circuit boards * Accurate X,Y alignment of PCB frame * Forsinglc and double sided PCBsand 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 dear manual 450 x 100 x 60 mm | 5.5 kg £395.00 I, US $645,00 I €445.00 ’ Further information and ordering at www.elektor.com/pcbtools ^ r E m ail: su bscriptions&dck for, com Rates and terms are given on the Subscription Order Form, Elektor Internationa I Media b.v, P.Q. Box n NL.-6114-ZG Susteren The Netherlands Telephone: (+31) 46 4389444, fax: (+31) 46 4370161 Distribution Seymour, 2 East Poultry Street, London ECiA, England Telephone:* 44 207429 4073 UK Advertising; Huson international Media, Cambridge House, Gog more Lane. Chertsey, Surrey KT16 gAP, England, Telephone: 144 1932 564999, Fax: +44 1932 564998 E mail: r, elg a r® 1 h u sonm ed ia.co m Internet: www.h u son med la. com Advertising roles and terms available on request. Copyright Notice The circuiLs described in Lhis magazine are for domestic Lise only. All drawings, photographs, printed circuit hoard layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines {other than third-party advertisements) are copyright Elektor International Media b.v, and may not be reproduced or 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 hir failing to identifv such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the texL and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guaran- tee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. Flektor International Media b.v. Printed in the ^elherlejids elektor 04-2010 1 MAILBOX OTOOra - 1;' LEDs as photosensors — busted? ‘LEDs double as photosensors’, Analogue Design Tips, Elektor January 2010 ( 0703S6-] ) A number or readers responded to this Design Tip , some confirming its operation and hap- pily experimenting , others suspecting that it was an early April Fools joke : Thomas Scherer one of our regular contributors put the circuit through its paces and reported on the results of his measurements as follows: Dear Jan — I checked out a number of LEDs fn my collection. The interesting conclu- sion is that some of them work, some don't, and some are excellent In my tests, the blue LEDs gave the worst results. With the other colours, I measured anything from 0.5 V to nothing. Even some of the white LEDs generated around 120 mV, The best results were obtained with red, green or yellow LEDs with clear, colourless pack- ages. They yielded an amazing 1 .2 to 3 .3 V, LEDs with clear coloured packages were also somewhat better than those with dif- fuse coloured packages. Otherwise 1 could not draw any systematic conclusions; it appears to depend on the manufacturer. Even a pair of LEDs that must be 30 years old still produced 60 mV, My test condi- tions were: illumination with a 20-W fluorescent lamp (daylight colour) at a distance of 50 cm. Modern wireless technology The 2,4 GHz Bandaiyser, E lektor February 2010 (090985-!) Dear Editor — i am pleased to see that you are featuring more and more projects related to modern wireless technology (ISM, ZigBee, WLAM, etc.) in your maga- zine. You published an article in the Febru- ary issue on a 2.4-GHz scanner. It's a bit of a pity that the wireless receiver module used in this project (type CYWM6935) has already been discontinued by the manu- facturer. As you also designed the scanner described in this article around an Atmel AVR microcontroller as the main control unit (and you regularly use this microcon- troller in other projects as well), I would like to suggest that you consider a project using the new (and thus highly current) Atmel ATmegal28RFA1 microcontroller. This device features a 2.4-GHz transceiver module integrated on the same chip as the microcontroller. As I personally use Atmel microcontrollers frequently and by prefer- ence, I look forward with great anticipa- tion to an Elektor project featuring this new device, so that I can learn something about how to use it. Rodrigo Supper The problem with product discontinuation is unfortunately sometimes unavoidable because it cannot be foreseen . However in most case s the components remain available from distribu- tors and retailers for a relatively long time. The other side of the coin is that with new ICs you sometimes have to wait a long time after the product announcement before real products become available: the elapsed time between the first design samples and the actual avail - ability of regular production devices is often sev- eral months. There have also been cases where fully developed projects could not be published because regular production of the devices con- cerned was simply cancelled in economically uncertain times. In such cases, all you're left with is a few prototypes and your expenses. I agree that the ATmega microcontroller plus wireless transceiver combo could form the basis for an interesting project ; Accordingly , I have forwarded your suggestion to my col- leagues in the Elektor Jab with my worm recommendation. Hands off my loudspeakers ’Power Cut Alert*, Christmas Holidays Circuits, Elektor December 2009 Dear Jan — I recently completed a project for converting my loudspeakers into an active loudspeaker system. It cost a lot of time, effort and money. As my loud- speakers were stolen once already, I also thought about how I could prevent this in the future. The aim was to protect the loudspeakers reliably and unobtrusively without using an additional cable. As the loudspeaker system is driven by a balanced signaljt would be possible to use the "phantom supply' principle to apply a DC voltage to the loudspeaker signal line and monitor this voltage. With this arrangement, an alarm will be generated if the XLR connec- tor fo r the ioudspea ker is d iscon nected , The drawback of this approach is that the loudspeakers and the amplifier outputs must be isolated from the phantom voltage. This would require using (large) capacitors to couple the audio signal in and out while blocking the DC voltage. This is not especially practical, and cer- tainly not desirable. Another option would be to use motion □1 00 E r u H i D [1 £ G 8 04-2010 elektor MAILBOX sensors, but this would certainly create problems with our industrious house cleaner, who has no fear of dusting off the loudspeaker enclosures. In the December 2009 issue of Elektor, f found a circuit under the heading 'Power cut alert’ that is designed to monitor the AC mains voltage. Even though my application is quite differ- ent, this circuit is also suitable for provid- ing property protection, and I certainly regard my expensive loudspeakers as property worth protecting. Of course, the same technique could also be used with other valuable Items. I have now built and tested the circuit, and it works perfectly. As soon as the AC power cable of the active speakers is unplugged, the alarm goes off. I n order to disable the alarm if necessary, 1 mounted a Cinch socket in an inconspicuous location on the loudspeaker connector pane! and connected it to the emitter and collector of the BC547 transistor. To disable the alarm, it's only necessary to plug in a shorted Cinch plug , but burglars won’t know this (or at least I assume that burglars do not make a habit of reading Elektor!), The only drawback of this circuit is that the battery needs to be replaced from time to time. However, the battery could be replaced by a small power supply with a transformer and rectifier that charge a large electrolytic capacitor and keep it charged as long as the mains voltage is available. If mains power is lost, the charge in the capacitor will allow the piezoelectric alarm to operate as long as necessary. Of course, the capacitor charge won’t last for several hours, but it will last long enough to cause the burglars to flee, G, Luyt (Netherlands) Compensation method 'Two black boxes", Retro nics, March 2010 Hi Jan — 1 always find the Retro nics articles fascinating. For the article In the March 2010 issue (Two black boxes’), you actu- ally didn't need to go so far back in time to find a description of the compensation method. It was described in the 1 980 edi- tion of the Radio and Electronic Laboratory Handbook by M.G. Scroggle, who was very well known at that time. For more information, see: http://phy3ab.nuaa.edu.cn/edit/Upload- File/20091 151 7446235.pdf CJ, War ners Thank you very much for your response. The arti- cle in the PDF document does indeed describe the compensation method in detail I wasn't able to find a modern description of this principle because / didn't think of using ' potentiometric ’ as a search term. This illustrates once again that you can't find everything on the internet if you don't know the right search terms. Incidentally what especially struck me when I was in the attic of De Slegte (in Utrecht) with that book in my hands was that the schematic diagram (Figures in my article) was virtually a construction drawing for my compensator. Per- haps the accompanying photo makes this more apparent. The circular selector switches are arranged differently, but you can probably imagine how excited / was with the similarity. The original version of my article included a longer quote , / hod to omit it due to lack of space , but it may be nice to present the full version of the quote here , which is written in an old-fashioned style that is a (ways fun to read: let A B be a wire with large resistance (Figure 4). A constant element with high electromo- tive force E is connected between the extremi- ties A and B, The two elements El and E2 to be compared are connected (as shown in the schematic drawing) to point A and to a pin 5, from which a lead proceeds further by means of a moveable contact. If one now determines the two points PI and P2 at which no current flows through the galvanometer branch circuit with El and E2, respectively the foi lowing expres- sion hoids true: E1/E2 = resistance of API / res/stance of AP2 With an extended wire of uniform thickness, the ratio of the resistances can s imply be taken to he the ratio of the lengths. If one imagines this extended wire to he replaced by a resistor substi- tution box , for each change in the resistance 4 C it will be necessary to relocate the contact C to a different point in the resistor substitution box , hut in such case it will generally prove impossible to maintain the resistance of A Bata constant value. However ; if A B is replaced by two identical resis- tor substitution boxes connected in series, and C is taken to be the point at which these two boxes are connected together, one can adjust resistance AC to any desired value less than A B while maintaining a fixed resist- ance between A and B. This only requires that the shorting plugs removed from the one box he plugged into the same positions in the other box, which a/though if may in itself appear simple, often gives rise to errors. Conse- qu en tly, ins t rumen ts ha ve been devised in which the mutual changes to the resistances are effected entireiy automatically so that a constant resistance is always present between the two end points , An instrument of this sort is called a compensator, if one examines the current flow in Figure 5, it is immediately apparent that no matter how the knobs are adjusted , the same resistance is always present between the +B and-B terminals, namely 14,999.9 while by contrast the resistance between points +0 and - Dean be set to any value from 0.1 to 14,999.9 il. The numerical markings next to the knobs directly indicate the value of this resistance .’ Tm sure you'll agree with me that this text does full justice to the ingenuity of the automatic compensator Rolf BEijleven MailBox Terms * Publication of reader's correspondence is at the discretion of the Editor. * Viewpoints expressed by correspondents are not necessarily those of the Editor or Publisher, • Correspondence may be translated or edited for length, clarity and style. •When replying to Mailbox correspondence, please quote Issue number, • Please send your Mail Box correspondence to: editor@elektor.com or Elektor. The Editor, tooo Great West Road, Brentford TW 8 gHH, England, elektor 04-2010 9 NEWS & NEW PRODUCTS Nl Multisim n simplifies circuit simulation for teaching and design National Instruments introduces Multisim 11 , the latest version of its circuit simulation software, with specialized editions for both hands-on learning and professional circuit design. The easy-to-use Multisim software delivers a graphical approach that abstracts the complexities of traditional circuit simulation, helping educators, students and engi- neers employ advanced circuit analysis technology. The academic edition of Multisim 1 1 incorporates specialized teaching features and is complemented by circuits textbooks and courseware. This inte- grated system helps educators engage stu d e n t s a nd re i nf o rc e circuit theory with an interactive, hands-on approach to investi- gating circuit behavior. Widely implemented throughout academia, technical colleges and four-year universities choose Multisim for its interactive com- ponents, simulation- driven instruments and integration to real- world analog and dig- ital measurements. Multisim 1 1 Profes- sional helps engineers optimize circuit designs, minimize errors and reduce prototype iterations. When combined with the new Nl Ulti board 1 1 layout and routing software, Multisim provides engineers a cost-effective, end-to-end prototyping platform, its inte- gration with Nl LahVIEW measurement software also helps engineers define custom analyses to improve design validation. Key benefits of Multisim 1 1 include the following: Multisim tt Academic Simplify digital circuits teaching by exporting raw VHDL from a programmable logic device (PLD) schematic Guide hands-on electronics experiments with new educator-requested AC single- frequency analysis Correlate simulated data with real-world measurements by integrating with the Nl Electronic Laboratory Virtual Instrumentation Suite (Nl ELVIS) educational prototyp- ing platform Multisim ti Professional Simulate better with SPICE parser improvements, updated BSIM models, support for advanced parameters and enhanced digital simulation accuracy Prototype easier and ensure design synchronization and transparency with enhanced forward/backward annotation from the Multisim schematic to an Ultiboard layout Improve design communication with on-page connectors and a new WYSIWYG net naming system Readers can learn more and watch videos about Multisim 1 1 by visiting the web page below. www.m.com/multisim/upgrade [100106-I) CPS receivers with or without antenna The PM 8 -648 CPS module from Parallax provides high performance with a SiRFstar- III chipset and integrated patch antenna. See the Parallax CPS Comparison Chart to evaluate this model side-by-side with the very similar PMB-68S and the low cost PMB-248. The PMB-648 CPS features 20 parallel sat- ellite-tracking channels for fast acquisition of NMEA0183 v2.2 data for robotics naviga- tion, telemetry, or experimentation. There is a built-in patch antenna; rechargeable battery for memory and RTC backup; cable for power, TTL and RS-232 connections. Features: high sensitivity * SiRFstarlll chipset 20 parallel satellite tracking channels for fast acquisition and ^acquisition built-in rechargeable battery for memory and RTC backup supports NMEA01 83 V2.2 data protocol includes cable for power, TTL and RS-232 connections The new PM8-688 CPS module has a SiRFs- tarlll chipset and integrated patch antenna plus an MMCX connector for the company's external GPS antenna. The PMB-688 retails at $39.99. wwAf.Parallax.com (100106-!!) 10 04-2010 elektor NEWS & NEW PRODUCTS Haptic piezo controller Maxim Integrated Products introduces the MAXT1835 fully integrated, programma- ble HPC (haptic piezo controller) for single- layer and multilayer piezo actuators. The MAX1 1835 is a novel haptic solution that provides customers with an enhanced, true M touch” experience with touch screens. Consumers are accustomed to ‘feeling* the button press on keyboards, keypads, and many modern devices* Touch screens and capacitive sensors provide an interac- tive user interface, but the user cannot feel the touch because there is no mechanical button. The MAX1 1835 adds the feeling of mechanical feedback to touch screens and capacitive buttons* The product can be used with any touch-screen or touch-button con- troller. However, as part of its new TacTouch concept, Maxim provides design-in sup- port and reference designs guaranteeing an optimal touch experience and simplified design-in when combined with the compa- ny's touch-screen controllers. Texas Instruments and Circuit Cellar launch DesignStellaris 2010 Design Contest Texas Instruments and Circuit Cellar' invite you to compete against other top embedded engineers around the world In the Texas Instruments Design- Steilaris 2010 Design Contest! The sky is the limit when you're designing with an ARM-based Texas Instruments Stelfaris microcontroller featuring the SafeRTOS real-time kernel inte- grated into on-chip ROM* By entering a project you could win a share of SI 0,000 in cash prizes and recognition in Circuit Cellar magazine! Texas Instruments has generously supplied everything you need to get started! The Stelfaris EKK-LM3S9B96 Evaluation Kit includes: an evaluation board with an 80 MHz LM359B96 MCU featuring Ethernet MAOPHY, CAN, USB OTG, and SafeRTOS in ROM; a time-limited copy of the Kell RealView Microcontroller Development Kit, cables, docu- mentation, and SteJIarisWare software. So how do you get started? Easy. First, to learn more, visit link # 1 below. Then request your complimentary sample kit using link # 2. Tl has generously provided all the essentials you need to get started! Because Circuit Cellar s primary role is publishing a print magazine about hands-on embedded systems projects, every DesignStellaris 2010 contest entrant is viewed as a potential author. Industry leaders pay attention to these contests. Circuit Cellar maga- zine is proud to report that a considerable number of past contest entrants say that the publicity from their participation benefited both their careers and manufacturing ambitions. As of December 1 , 2009, Circuit Cellar is an Elektor International Media publication. 1 * wwwxircuitcel Icir.com/dcsignstellaris2010;' index.htm I 2. www.circu1tcellar.com/designstcllans2010/kit.html (100106-! If) oesteisiii Stellaris" ™ ^ T C H-jtAs iwrreunQrts ) CIRCUIT CELLARI Target applications are any consumer or industrial equipment that has touch-screen displays or traditionally has mechanical but- tons. Typical examples include cell phones, MIDs (mobile Internet devices}, MP3 play- ers, portable media players, digital photo frames, multifunction printers, digital still/ video cameras, and POS (point-of-sale) terminals* The MAX1 1835 drives both single-layer and multilayer piezo actuators over a wide 5V to 250V voltage range. The wide output volt- age range not only lets designers choose between these two types of piezo actua- tors, but also guarantees a future-proof solution for alternative actuator technolo- gies. By integrating a user-programmable haptic pattern generator, programmable boost converter, and high-voltage, high capacitive load driver, the MAX1 1835 gen- erates a user- configurable, slew-rate-li un- ited, boosted voltage output The MAX1 1835 has sufficient on-chip memory to simultaneously store multi- ple user-defined haptic waveforms, which are downloaded at power-up through the serial I2C interface* During operation, only a haptic trigger pulse is required from the system or application processor to play out the waveform. Unlike other driver ICs, no high-speed waveform pattern needs to be sent during operation. This simplifies code design on the system or application proc- essor, reduces software load, and improves haptic response time. Obtaining low latency (from the instant of touch detection to hap- tic response) is crucial to effectively mimic the real-world feeling of a button press. www.maximHc.com/IVlAX11835 (100106-IV) Configure a custom power supply in under five minutes ACAL Technology announce the immediate availability of the Extelsys powerKit which allows designers to use the world's small- est power supplies to configure a plug-and- play custom power module in under five minutes. Each powerKit contains an application-spe- dfit Xgen powerPac chassis module, and seven different Xgen powerMod dc output modules which can be inserted, removed or exchanged to create a custom power-sup- ply. These provide a range of output volt- ages, from 1.5V to 58V, with a maximum current of up to 50A. The kits are presented elektor 04-2010 11 NEWS & NEW PRODUCTS in a rugged case and include two pairs of serial, and two pairs of parallel, links as well as power and signal connectors, documen- tation, screwdriver and a voltage adjust- ment tool. The Xgen series of power sources provides additional flexibility with a number of user- configurable functions. These include local and remote adjustment, adjustable straight- line or foldback current limit and output inhibit/enable functions. powerMods can be configured in parallel for higher-current applications and in series for operation at higher voltages. High-efficiency conversion techniques allow Xgen series power sources to achieve minimal power losses, whilst advanced packaging reduces their size to cre- ate the industry’s smallest power supplies. The powerKit has been optimised for stand- ard, medical, high -temperature and low- noise applications. The standard and medi- cal versions are available with power ratings of 1 340W or 7 SOW, with 6 and 4 powerMod siots respectively; the powerKit for high- temperature applications has a 6GQW rating and six slots; whilst the low-noise powerKit is rated for 1 200 W and offers six slots. www. a ca 1 1 e ch no I ogy . com / u k / exce I sy si ( 100106 -V) Customizable high-speed USB2.0 module QuickUSB from Saelig Company is a unique and customizable quick and easy USB2.0 connectivity solution. This compact 2 ,T x1 1 ' circuit board implements a bus-powered Hi- speed USB 2.0 endpointterminating in a sin- gle SO- pin target interface connector. With the companion QuickUSB Customizer soft- ware, you can tailor the QuickUSB Module to give your product a custom-developed took and feel with a user-defined *My Prod- uct' string descriptor, a unique RID (Product ID), and a user- defined serial number to cre- ate uniquely identifiable products. Today, any product that connects to a PC must have a Hi-Speed USB 2.0 connec- tion, and a number of generic solutions are available. But when you finally have your USB interface working, USB device must be assigned product ID (PID) and a ven- dor ID (VID). VIDs are assigned by the USB Implementors Forum at approx. $2,000. None of these generic solutions allows you to easily make a product that enumerates on a PC with your company and product identification. QuickUSB gives you the ability to include a complex, high-performance computer interface Into you r product quickly and easily. No-one will even know it's Quick- USB inside. QuickUSB is a functional mod- ule that includes built-in firmware, a device driver and software that works on Windows 98SE, ME, 2K, XP, Vista and Windows 7. !t includes drivers and software applications that work right out of the box. The Quick' USB Library supplied supports all the popu- lar programming languages and works v\ :r any language that can call a DLL. QuickC 5 = Is supported on Linux too (MacOS X supp c n will be available soon). QuickUSB module provides: an 8 or 16- - : High Speed Parallel Port for really fast cat: transfer, from DSPs or FPGA based circi. :s up to three general- purpose 8-bit para a I/O ports; two RS-232 ports; one I2C pr:. with multiplexer; one soft 5P3 port or F Re- configuration port. These interfaces g . a the designer the ability to convert exist - : products to USB 2.0 or create new des cm from scratch, fn both cases, the soft,. a supplied with the modules eliminates a~ need to understand the workings of USB 2. ’ while making it really easy to access the d r - ferent interfaces from the PC, This is a com - plete implementation of USB 2.0 that uses full speed potential unlike other options that are "compatible” with USB 2.0 but use much slower USB 1.1 data transfer. With QuickUSB, 96 MBps bursts on parallel port and 20 MBps continuous data are possible. These software libraries include the USB 2.0 drivers, application DLL and examples of using the software in most commonly used programming languages, includ- ing Visual Basic, C++ and Delphi, The DLL includes functions to read and write individ- ual bytes or data blocks from each interface, and all the set up details needed to provide flexibility e.g. LSB or MSB first on SPI port, input or output on each I/O pin or baud rate on serial port. QuickUSB modules are available now from Saelig Co, Inc, Pittsford \Y, USA at SI 49 each. wfww.saelig.com ( 100106 - VI) New high frequency LCR Meters GW Instek pr-: emt : : new high frequency LCR Meters tra LC7-S 1 1 OG and the LCR- 8105G. —:‘v atest members of the GW Instek ra~ge, :~ese high frequency LCR mete -3 ree ca a aped to satisfy the grow- ing -ees’ : '"equency component and mcc. e aaactf^ sation. - : ; - : . :-.e opment of telecommu- " :a: _ ~ a: “ " ; ;gy. the need for accurate - :_a _ : component and module mrecteica: - s essential. The LCR-8OO0G - - e accuracy, versatility and high -i. a .v ide range of component — i:: _ - e — e - ‘s: including DC resistance : _'e“e":s and voltage/current moni- ; : - - : I : ^ -orient characteristics can be a a number of circuit models = - ; :e3i ‘■ecjencles to emulate real circuit : : ea: :r ensuring accurate verification a - : ;n J aantly reduced trial and error ■ — a Customised program sequences can - m : :ec . sing the Multi-Step function. 12 04-2010 elektor NEWS & NEW PRODUCTS Each program sequence supports up to 30 test steps set with separate parameters and test limits. This allows normally tedious test routines to be automatically stepped through with the press of a button. To easily verify components, the Graph Mode plots component response over a wide range of frequency or voltage sweeps. Both GP1B and R5-232C interfaces are standard to display test results on a PC or for remote control, www, q wi nstek.com (i o 01 o 6 - VI I } Australia’s youngest engineers to innovate using Altium Designer Altium is adding a local element to its FIRST Robotics Competition (FRC) sponsorship, supporting the first Australian team to enter the worldwide competition. The FRC is an annual robot design com- petition organized by FIRST, a not-for- profit organization dedicated to fostering a greater understanding and appreciation of science and technology. Designed to inspire young people to innovate, the FRC challenges teams of students to develop a robot in six- weeks using a standard kit of parts and a common set of rules. The com- petition attracts thousands of students and is televised by stations around the world. This year Altium is sponsoring the Australian FRC team as well as providing all 1 ,800 FRC teams with a 1 2-month licence of Its elec- tronics design software, Altium Designer. This gives young engineers real-life experi- ence with the same electronics design tool used by organisations that include NASA, Cessna, Cochlear and the Volkswagen Group of America, Alti urn’s extended support also sees engi- neers from Altium’s research and develop- ment team mentor the students. 'The FIRST Robotics Competition provides a wonderful opportunity for young engi- neering minds to experience science and technology in a fun and competitive envi- ronment," said Matt Schwaiger, Senior Vice President of Global Customer Success. "We are proud to be fostering the talents of these students and providing them with all the tools and support they need to excel in the FIRST Robotics Competition." The FRC Championship will be held April 1 5- 1 7, 201 0 in Atlanta’s Georgia Dome. "Australia doesn’t produce enough of its own engineers and we can't afford to wait until kids are at HSC level before we start trying to get them interested,” said Australian team coordi- nator, Associate Professor Mike Heimlich. "This program is designed to get kids excited about engineering, science and technology by giving them the opportunity to see what a fun and creative process work- ing in this field can be,” VAVw.altium.com (iooio6-Vllf) Three C/V characterization capabilities in one chassis Keithley Instruments' Model 4225-PMU Ultra Fast l-V Module is the latest addition to the growing range of instrumentation options for the Model 42QQ-SC5 Semiconductor Characterization System, It integrates ultra- fast voltage waveform generation and cur- rent/voltage measurement capabilities into the Model 4200-SCS’s already powerful test environment to deliver the industry's broad- est dynamic range of voltage, current, and rise/fall/pulse times, expanding the system’s materials, device, and process characteriza- tion potential dramatically. Just as important, the Model 4225-PMU makes ultra-fast l-V sourcing and measurement as easy as mak- ing DC measurements. Its wide program- mable sourcing and measurement ranges, pulse widths, and rise times make It well- suited for applications that demand both ultra-fast voltage outputs and synchronized measurement— from nanometer CMOS to flash memory. Unlike previous solutions, which required up to three different test stands to characterize a device, material, or process thoroughly, the Model 4225-PMU's broad dynamic range allows characterizing the full range of materials, devices, and processes with a single set of instrumentation. Now, labs can configure one flexible system to handle all three measurement types: precision DC l-V (Model 4200-SMU), AC impedance (Model 4210-CVU C-V Instrument), and ultra-fast I- V or transient l-V (Model 4225-PMU), Each 4225-PMU module provides two channels of integrated sourcing and meas- urement but takes up only one slot in the nine-slot chassis. Each chassis can accom- modate up to four modules for a maximum of eight ultra-fast source/measure channels. Each channel combines high speed voltage outputs (with pulse widths ranging from 60 nanoseconds to DC) with simultaneous current and voltage measurements. The module provides high speed voltage puls- ing with simultaneous current and voltage measurement, at acquisition rates of up to 200 megasamples/second (MS/s) with 14-bit ana log -to-drgital converters (A/Ds), using two A/Ds per channel (four A/Ds per card). Users can choose from two voltage source ranges (±1 0 volts or ± 40 volts into 1 megohm) and four current measurement ranges (800 milliamps, 200 mllliamps, 10 milliamps, 100 microamps). Each Model 4225-PMU can be equipped with up to two optional Model 4225-RPM Remote Amplifier/Switches, which provide four addi- tional low current ranges. They also reduce cable capacitance effects and support auto- matic switching between the Model 4225- PMU, the Model 421 Q-CVU, and other SMUs installed in the chassis. The Model 4220-PGU Pulse Generator Unit, which offers a voltage- sourcing-only alternative to the Model 4225- PMU, is also available, http:// keit h I ey . a c ro ba t . com / P7740274 2 j (1001 06- IX) 13 elektor 04-2010 NEWS & NEW PRODUCTS World’s smallest motor now even smaller Last year Elettor reported on the small- est hand-made mini- ature electric motor, with an E-weekly item in April 2009 editon and an article with a drive circuit in the Features of the new diameter 13 mm length 03 mm volume 0,9 mm3 weights mg November 2009 edition of Elektor. With this speed 500-1 0,000 rpm motor, Elektor reader jos d'Haens booked a world record and managed to obtain an official certificate from Guinness World Records, natu- rally accompanied by a notice In the well-known Guinness book. Now, thanks to improved and refined production methods and production tooling, jos d'Haens has succeeded in further reducing the size of the motor, which was already good for a world record last year, so much that its volume could be reduced from 1 + 9 mm 2 to 0.9 mm 1 (or more precisely, 1 30 x 0.65 = 0.863 mm 5 ), which breaks the 'psychological barrier' of 1 mm 3 . In order to achieve this, a small CNC machine tool was developed for drilling the holes in the motor end plates (hole diameters 03 mm and 0.1 mm). Thanks to improved polishing of the shaft and rhodium plating of the bear- ings t it was possible to increase the speed to the range of 10,000 to 12,000 rpm. In the meantime, a new control circuit has also been developed as an alternative to the original combination of a 555 1C and a 401 8 1C. Now a programmed ATtinyl 3 micro- controller handles this task. This makes driving the motor a good deal easier, but the original method is still preferable for high speeds because it allows the frequency to be ramped up more gradually. This is an impressive achievement, which is bound to be rewarded by a new certificate from Guinness World Records. Here at Elektor we have no doubt that Jos has plans for even further miniaturisation. The photo shows the motor next to a 50-eurocent coin for comparison. (iooioG-X) World’s First 4 Channel / 30 GHz solution enables 56 Gb/s IQ Modulated QPSK analysis LeCroy Corporation has extended the power of its Wave Master® 830 Zi 30 GHz real-time oscilloscope by providing a sim- ple and fast method to combine two oscil- loscopes and provide 4 channels at 30 GHz. This solution Is ideal for measurement and analysis of 28 to 56 Cb/s IQ modulated sig- nals where ultra-high real-time bandwidth and four channels is required, or for cap- ture and detailed analysis of other leading edge technologies. The solution is enabled with the Zi-8CH -SYNCH Oscilloscope Syn- chronization Kit, which is compatible with all WaveMaster 8 Zi models, so It may be used to create four channel data captures from 20 GHz to 30 GHz or eight channel data captures from 4 GHz to 16 GHz. The oscilloscope synchronization kit is com- prised of a small hardware module that plugs into one of the two oscilloscopes. Once attached, it identifies that oscilloscope as the ‘Master 1 for display and control pur- poses. A variety of other cables for trigger synchronization, dock sharing, and data transfer are connected between the "Mas- ter" and a ‘Slave 1 oscilloscope. Triggering of both oscilloscopes may be performed in a pseudo-auto trigger mode, or by applica- tion of a customer trigger signal. Upon suc- cessful trigger, all waveforms from both the ‘Master’ and the 'Slave 1 oscilloscope are dis- played on the ‘Master’ oscilloscope grid for easy viewing, debug and analysis. The com- plete setup time is no less than 5 minutes prior to deskewing channels. The LeCroy WaveMaster 830 Zi oscillo- scope was launched on January 5, 2009 as the second product line developed from LeCroy T s next-generation “Apollo' chipset. The scope features a real-time band- width of 30 GHz and a sampling rate of 80 Gigasamples/second on two channels. The complete acquisition system used in the Alcatel-Lucent experiment used two Wave- Master 830 ZI oscilloscopes for a total of 4 channels at 30 GHz. www.lecroyxo.uk (iooio6-XI) Multi-Instrument 3.2 released Virtlns have realeased Multi-Instrument 3.2 a nd offer it for d ownload at for 2 1 days 1 fu I ly functional free trial. The free trial period is valid even if you have tried previous ver- sions of the software on the same compu- ter before. If you are our existing customer, you areeli- g i ble for free u pg ra ding to the same license level you own. Both softkey and hard key upgrade links are available a the Virtins website. fl Q-iOiiCQ' % ' 0.GQ1263 V 9a.7i3&40 '.16 04-2010 elektor NEWS & NEW PRODUCTS New features in Version 3.2 include and added DDP Viewer, the ability to run the program as an ActiveX automation Server, the Hot Panel Setting Toolbar, added func- tions to Lock / Unlock Panel setting under Help submenu, functions to Hide j Show various Toolbars In Dislay Setting Dia- log, “Start Frequency” option for X axis in Spectrum Analyzer and Spectrum 30 Plot, and more. vwwv.virtins.com (iooio6-X!V) Speed, performance and low cost combined in spectrum analyzer Anritsu has developed the MS2830A Spec- trum Analyzer which is an addition to the expandable M5269xA product line and sup- ports high measurement speeds and supe- rior performance at a low cost. As a result this helps improve efficiency of R&D and production, cutting measurement time, improving yield, and reducing power con- sumption to cut C02 emissions. The new instrument supports frequency ranges from 3.6 to 13.5 GHz, providing superior RF specifications for average noise level of-1 53 dBm (1 GHz, without preampli- fier), third-order inter-modulation distortion (TO I) of +15 dBm, a nd total level accu racy of ±0,3 dB (typical). Easily customized expand- ability from the minimum configuration to an all-in-one advanced TRx tester helps keep down costs to only what Is needed, and is available from less than TO l< . The measurement speeds for basic spec- trum analyzer functions, such as sweep- ing, frequency switching, peak search, display and reading of measurements put the MS2830A at the top of its class, while the Vector Signal Analysis option supports even faster measurement of band widths up to 31 ,25 MHz. The instantaneous averaging of modulation signals and noise dispersion measurement significantly out perform all conventional sweep spectrum analyzers. The MS2830A is caopable of measuring average noise levels of -153 dBm (1 GHz, without preamplifier), third-order inter- modulation distortion (TOI) of +1 5 dBm, and has a total level accuracy of ±0.3 dB (typical), yet at a low cost of below 1 QK€. The IV152S3QA can be customized from basic configuration to comprehensive all-in-one tester to meet customer’s current needs at minimum cost or to minimize future expan- sion costs. This provides the convenience of a modular based system, but with the per- formance and convenience of a dedicated test instrument. The MS283GA consumes 45% less power than current models, cutting electricity costs and saving CO, emissions. The IVtS269xAand MS2830A measurement software are fully compatible. Using the MS269xA for R&D and the MS2830A for manufacturing reduces production start-up times and makes it easy to transfer control software from R&D to manufacturing. www. anritsu, com (100106-Xll) Fast signal plotting and chart creation under Windows LightningChart Pro from the Finnish company Arctlon is especially designed for profes- sional data acquisition software, PC-based oscilloscopes and signal analysers, scientific research, medical and other real-time measurement and signal monitoring applica- tions, Optimized for high-speed sampled signal data handling with innovative CPU overhead saving techniques, it is able to handle huge point counts, where all other chart/ graph controls get delayed, frozen or crashed. By utilizing great power of modern display adapters, the screen resolution can be very high even with the most demanding real-time measurements. There are numerous horizontal scrolling modes available, providing an ideal and smooth scrolling effect for every scenario. The data handling capacity is up to hundreds of millions of new data points / sec. LightningChart Pro allows using many different series types, signal tracking cursors and signal markers. Data handling capacity and performance is excellent also in signal review and analysis applications. For that purpose, it has also built-in customisable scroll bars, with 64-bit value range for direct usage as sample indexing in long high speed measurements. Appearance Is fully customisable providing very modern user interface. For easy properties setup, charthasa built-in Chart editor window. wvwv.arctton.com (100106-XIH) eloktor 04-2010 15 ROBOTICS AND ARTIFICIAL INTELLIGENCE Super Robots Myths, promises, threats and the ‘here and now’ By Andrew Eliasz (First Technology Transfer Ltd., United Kingdom) Artificial Intelligence and ‘Intelligent Robots’ are topics that fire the imagination. Generally, imagination runs ahead of what can be achieved, yet, with time, things that were once considered phantastica! quite often get to be ‘realised’. How close are we to realising the kinds of robots and intelligent computer systems depicted in films such as HAL in Kubrick’s 2001 A Space Odyssey , or the lifelike child in Al, or the kinds of robots in I Robot? A common theme in many science fiction books and films involv- ing robots is based on the fear, that lies deep in many of us, that robots created 'to serve mankind" may turn on it and either destroy or enslave it* This may have something to do with the fact that we live in a culture where getting rich and acquiring power is seen by many as the only goal in life* The potential of achieving such things with the aid of powerful Al software and versatile ’smart’ robots appeals to such people, but there is always the fear +f what if they acquire our values and turn out to be better than us”. It is quite possible that one of the many current developments in Artificial Intelligence and Robotics whose significance has not yet been realized may turn out to be a key 21 st Century technology. Maybe some of the topics covered here will inspire some of the next generation of Elektor projects, or be the start of an illustrious engi- neering career. Let’s hope that these future developments serve a socially useful purpose. Learn from nature At the outset it is worth noting that simple mechanisms can some- times give rise to very complex behaviour, as, for example, dem- onstrated by fractal and chaotic systems, or the complex behav- iours demonstrated by social insects such as ants, termites or honey bees. Leaving aside deep philosophical discussions as to the nature of intelligence we may list pertinent questions like ■ what kinds of intelligent systems can we buitd now or in the near future? * what kinds of mechanisms can be constructed for moving around and manipulating the environment without direct (human) intervention? ■ what can we team from studying how biological systems have evolved and the strategies that have developed for allow- ing organisms and systems to flourish, and how might these insights be applied? Food for thought! Back on earth, the Ingredients’ at our disposal are * sensors * transducers capable of providing motion or manipulation capabilities * analogue and digital electronics components - software (either compiled directly into silicon, or executed via a processor or processors) * sources of computer inspiration from biology * patterns for constructing artificial life models in hardware * competitions and challenges designed to stimulate research and progress * patterns and protocols for learning and communication This is a multi-disciplinary brew that should attract not only special- ists but also technophiles, interdisciplinarians and ‘broad thinkers’, and the results should by n ow surpass 'a utonomous robots’ of which there are plenty a roun d already (Figure 1 ) . A good sta rting point for those interested in the Inspirational role of biology in computing is Nancy Forbes 1 book P on, among others, attempts to construct information processing systems that use biological systems. Techniques based on this work and ideas that have been applied to various aspects of robotics such as path planning, image processing, locomotion control and data fusion include neural networks, genetic algorithms and artificial immune systems. Areas that are still in their very early stages include DNA computing, self-assembly and nan- otechnology and amorphous computing (based on models of cell colonies or swarms of bees — systems that demonstrate self-organ- ising capabilities). A fascinating and reasonably up to date collection of descriptions of actual robots and robot models inspired by exam- ples from living organisms has been put together by Adamatzkyand Komosrnski 1^1, Here can be found such marvels as * the stiquito, a hexapod insectoid robot that uses heat activated nitinof wires for locomotion, and a description of attempts to construct and study a colony of such Insectoids; * using neural networks and delayed reward protocols to learn legged locomotion such as how to hop over rough terrain, or, how to ru n if you re a fou r legged robot * a swimming and walking robotic salamander (the one described here uses PICT 6 and PI Cl 8 microcontrollers and 12 1 for interprocessor communication, although a CAN bus based version is planned.) * a gorilla robot that can walk on two legs, or use all four limbs for locomotion, or climb ladders and swing from branch to branch 16 04-2010 elektor ROBOTICS AND ARTIFICIAL INTELLIGENCE "How do you spot a ‘rogue’ robot?” (from the film “ I Robot") (a form of motion is called “brachiation") * the use of genetic algorithms to optimise the design of the walking mechanisms of legged robots • the use of FPGA devices to implement the perception, and navi- gation systems for roving robots by means of a reward based conditioning strategy (you might think of it as applying Pavlo- vian conditioning to the developing of robot behaviour) ♦ the use of microbial fuel cells to power robots * using slime moulds as a mechanism for controlling robot behav- iour by interfacing a slime mould 'chip 1 to a microcontroller The approaches just described are still a long way from being widely applied but do demonstrate the potential and excitement associ- ated with this area of robotics research. Currently it seems unlikely that robots will contain purely biological systems inspired software or make heavy use of biological sensors and biological control sys- tems. Development of biological systems inspired software is com- putationally very intensive and time consuming, and hence can only be applied to fairly specific problems. Kismet and the human(oid) factor Learning and language capabilities are likely to become more and more important for a whole range of robot applications e.g. com- panion robots, exploratory robots, “smart” household appliances (think of e.g. a much improved ROOMBA that can be ta ught and instructed by voice). Smartness should include the ability to communicate e.g. robot- human communication, robot-robot communication. Devising soft- ware endowing robots with language and learning capabilities (e.g. being able to tefl a robot to perform some task or take note of some feature in its environment) is a very complex task, even if we are considering a language restricted to a fairly narrow domain. Think how you might build and program a robot that could respond appropriately to an instruction such as “pick up those socks and put them in the laundry basket". If you don't believe me then dip into a copy of Language and teaming for Robots i 3 J, an apparently introductory book till you try to implement the code it outlines. Yet , considerable progress has been made in realising such socia- ble machines. An impressive example of what could be achieved Figure 1 . It’s too easy to call a robot autonomous 1 if biological aspects are not, or insufficiently, included in the design. elektor 04-2010 17 ROBOTICS AND ARTIFICIAL INTELLIGENCE Figure 2. Kismet in action (stills do not do it justice). using 1990's technology was MIT's Kismet HI, “an expressive robotic creature with perceptual and motor modalities tailored to natural human communication channels” (Figure 2 ). The computing power underlying Kismet is fairly substantial involving four Motorola 63322 embedded systems running a specialised variant of Lisp; nine net- worked workstations running QNX (a Unix like RTQS): networked Linux and Microsoft Windows machines. The videos of Kismet interacting with real live humans are very impressive. The resources consumed in developing Kismet prob- Figure 3. Nao footballers at the RoboCup 2009 Final, fortunately Aldebaran has an IDE for "Choreographing" NAO robot movement. ably ran Into several millions of dollars even allowing for the fact that bright MIT PhD students are a cheap source of labour (the hard- ware alone cost around S25K). Software maintenance costs would be huge if Kismet were to be deployed in the real world. It should not come as a surprise that the Kismet project is no longer being actively pursued. Sociable robots Progress in the practical realisation of sociable as well as team player robots requires the availability of standardised platforms with standardised application development frameworks at prices in the 1GK-20K range. An example of one such robot is Nao l s l, a human- oid robot that has been used in the development of Robot Soccer teams (Figure 3). its underlying development environment Is Gos- tai’s URBL For those with more limited budgets it is worth noting that URBI has also been ported to Lego Mindstorms INIXT. Socially capable robots can be found in helping children and adults with learning and social interaction difficulties, such as those suf- fering from autism. The robot dolls and faces developed for this work are far less complex and sophisticated than Kismet, for exam- ple, but have proven to be remarkably effective. These robot dolls and toys, because of their relative simplicity make possible less overwhelming social experiences and are very forgiving of social faux pas. One such cute simplified robot is called Keepon (Fig- ure 4), and it has proven to be remarkably successful in helping children with communication disorders. From concept to silicon As with software engineering, so also with robotics and Ai there is the dream of a "magic silver bullet” that will banish complexi- ties and make building super robot systems almost effortless. Many people take software for granted and it is not all that uncommon to hear statements such as “it can't be that difficult it s only a piece of software”, or "what do you mean by claiming that designing and writing software Involves considerable creativity , Unlike power- ful, well organised and politically well connected professions such as the legal or medical professions the engineering and software engineering professions are not held in great esteem. Very few users of mobile phones, for example are even remotely aware of the complexity of the software that makes these almost indispensible “gadgets” work, not only the image and voice processing, but also the underlying operating system and the need to make the soft- ware extremely reliable. The blue screen of death is not an option for mobile telephony software. Yet, the software for autonomous robots must be even more reliable, especially where robot malfunc- tion may result in serious damage or injury. The problem with software is that it "contains bugs”, and the more complex the software the larger the number of bugs. It would be extremely rash to claim that any computer system was completely bug free. It must also be pointed out the processors too may con- tain bugs that may necessitate workarounds when implementing software that will run on these processors. For some, so called hard realtime' applications it is a bug if the software does not respond to certain events within a specified time of the event occurring, or if 18 04-2010 ciektor ROBOTICS AND ARTIFICIAL INTELLIGENCE Swarm robotics and Ad Hoc smart networks An 1 -Swarm nome. A "swarm" of Symbrion Robots* For robots to co-operate socially they need to communicate in some way. They can either all communicate via some central communica- tions hub t or, they can make use of self "Organising wireless networ- king technology of the kind used in Ad Hoc networks* Quite a few of the robots being developed in this context have turned out to be surprisingly complex. Current swarms are relati- vely small in number ( 10 *s to 100 ’s of robots). The J -SWARM project aims to deploy a swarm of a thousand or more tiny (they will fit into a 3 mm sided cube) robots [7], Some fascinating projects on swarm behaviour include * Symbrion -Replicator, which is also exploring the use of Artificial Immune System techniques for controlling swarm behaviour [ 8 ] and developed from the I -SWARM project and the open S WARM - ROBOT project [9] • the S-Bot project developed attheEPFLin Lausanne (Switzerland) [ 10 ] The Symbrion bots and the 5-Bots contain quite powerful proces- sor hardware needed to run the complex software that makes them work so well. The processors being researched for the various Sym- brion bots include ARM7, ARM Cortex 1 1 , XScale PXA270 (ARM 1 0) and Blackfin. The S-Bot has a 400 MHz XScale CPU, 64 MB Flash. 32 MB RAM and 1 2 distributed PIC microcontrollers for low level l/Q and sensor handling. Development of applications using these swarm robots requires use of simulators to explore various scenarios before trying them out on the real robots* 1 WiFi r □ ■H O DC/DC 3x PIC processor XScale Linux 400 MHz 64M RAM (CompactFlash) PIC processor 3x PIC processor “0- C -H HT- - 4 - — ^ — c ^3- — c -H 1^7 2x servo gripper and arm motor U omnidirectional camera 4x microphone temperature sensors C gripper sensor elevation motor rotation motor gripper motor PC Bus Lithium Ion Battery 10 Wh PIC processor 2D traction sensor PIC processor 8x RGB LEDs t differential tree Is 100013- T1 Block diagram of an S-Bot. elektor 04-2010 19 ROBOTICS AND ARTIFICIAL INTELLIGENCE Figure 4. ‘Keepers' can help children with communication disorders. and it is partly in response to the annoyances of having to grapple with dosed source frameworks that powerful open source frame- works are being developed. A good example is the ROS framework — which works with e.g, the PR2 robot (Figures), and an example of Figure 5. WillowGarage's PR2 Robot a framework that is moving from closed to open source in the URBI framework — which works with e.g. the MAO robot. The best robot — no such thing There are many tradeoffs to consider when building robot systems. In the case of software the selection of algorithms and frameworks may need to take into account issues such as scalability and speed, and obtaining the ‘best’ solution or simply a ‘good enough 1 solu- tion. For instance if we look at image processing software there is a great deal of difference between software that can distinguish between balloons of different colours, perform numberplate rec- ognition, or recognise facial gestures. Similarly, with voice recogni- tion there is a whole range of difficulty levels e.g, recognising a few dozen words, processing whole sentences, or being able to hold a rational and interesting conversation. For autonomous mobile robots the locomotion and navigation plat- form is an essential subsystem. At the simplest level there are line following and maze traversing robots. At a higher level there are robots that need to be able to explore, learn about and navigate in their environment, like the robots entered into the Trinity College Fire Fighting Robot competition. At a still more advanced level there are robots such as NASA’s Mars Explorer, or the robots that compete in the DARPA autonomous vehicle event. Sensors and subsystems found in autonomous robots, typically include • touch / contact / bump sensors • sonar or laser-based ranging sensors • digital compass and GPS • LEO / photodiode sensors for e.g. line following • odometry subsystem (e.g, using optical encoders) • CCD cameras • iR imaging sensors • Radar subsystem The inputs from all these various subsystems and sensors need to be co-ordinated and acted upon appropriately. The more input data and the faster the input data rate the more complex the software needed to handle it. For systems with relatively few sensors and performing relatively simple tasks an approach based on Finite Statemachines (FSMs), or their more complex relations Extended FSMs, Hierarchical Finite FSMs and Statecharts may be sufficient State Machines can be mod- elled using UML Case Tools and quite a few of these Case Tools are capable of generating code from the state machine design. IAR h s Visual State tool is a good example of a tool aimed at embedded systems developers that concentrates on the use of Statecharts for embedded systems design. For more complex systems there are many options to choose from i 6 ) to carry out subtasks such as transformation, feature extraction, pattern recognition, sensor data fusion. Here you’ll find techniques such as digital signal processing, statisti- cal and syntactic pattern recognition e.g. using Bayesian networks or Hidden Markov Models (HMM), discriminant functions. Classifica- tion And Regression Trees (CART), Neural Networks, Genetic Algo- rithms, Artificial Immune Systems (AIS) as well as various hybrid 20 04-2010 elektor approaches based on combinations of the above techniques (e.g, using a Genetic Algorithm to evolve a Neural Network}. These tech- niques can be deployed in an ‘adaptive" or ‘non adaptive 1 Le. fixed manner. Developing software for robotics systems has many interrelations with developing simulation* computer game, entertainment system and "electronic trading" system software. Simulation can be used to explore robot capabilities before the robot has been constructed, or to explore various deployment scenarios before robot deploy- ment in the field. It is perfectly reasonable to devise robots that exist purely as software running on powerful computers, or a network of such computers connected via the web. Examples of such hots include chatterbots, game playing bots and e-trading bots. By providing these bots with access to semantic web resources such as knowledge rich 'ontology 1 based repositories (e.g, by exposing these resources as web services) it is apparent how the capabilities of robot systems can be extended. Adding in smart sensor based Ad Hoc networks it is easy to envisage entire ‘communities' of robots with varied self organising capabilities. If we further add in the pos- sibility of interfacing robots with biological systems {e,g. arrays of electrodes implanted into e.g. animal brains, or arrays of surface electrodes picking up signals associated with neural activity) it is possible to envisage all kinds of applications of which prosthetic limbs and exoskeletons are but a starting point. Adding in the dis- coveries from stem cell research, molecular biology and genetic engineering suggest the development of e.g, computers with bio- logical extensions. The ethical issues with developing and deploying such technologies are many and complex. (100013) Internet Links and References [1] Forbes. Nancy; "Imitation of Life, How Biology is Inspiring Computing", MIT Press, ISBN 0-262-06241-0 (Pbk) (2005). [2] Adamatzky, Andrew; Komosinsky, Maciej; "Artificial Life Models in Hardware*. Springer. ISBN 978-1 -84882-529- 1 , (2009), |31 Crangle. Colleen; Suppes, Patrick: "Language and Learning for Robots", CSLJ Publications, ISBN 1-881526-19-4, (1994) f4| www.ai . m it.edu/projects/humanofd -robotics-group/kismet/ kismet.html [5] www.aldebaran-robotics.com/en [6] Duda, Richard, 0; Hart, Peter. E; Stork. David, G; “Pattern In- terscience. ISBN 0-471-05699-3 (2001) [7] http://robJpr.kit.edu/engfish/research.php [8] www.symbrfon.eu/ [91 www. s wa rm robot.org/ [1 OJ http://lis.epfl.ch/research/projects/SwarmBots/index.php The new PicoScope 4000 Series high-resolution oscilloscopes a> t/i V) 0 u • mm CL w, I “V lllUU The PicoScope 4224 and 4424 High Resolution Oscilloscopes have true 12-bit resolution inputs with a vertical accuracy of 1%. This latest generation of PEcoScopes 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 4 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 Connection Trigger Types 12 bits (up to 16 bits with resolution enhancement) 20 MHz (for osdNscope 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 Rising edge, falling edge, edge with hysteresis, pulse width, runt pulse, drop out, windowed www, pf cotech, com/scope 1063 01480 396395 elektor 04-2010 21 SMD MEASURING TWEEZERS Measuring Tweezers By Harry Baggen (Elektor Netherlands Editorial) SMDs are nice and compact, but their small dimensions also have some drawbacks. You can hardly tell different types of passive components apart, and the markings are not especially clear. With special SMD measuring tweezers, you can quickly check what type of component you have and measure its value. We tried out five such devices in our lab. SMDs have several advantages compared with conventional leaded components. For example, they take up much less space on the PCB, which allows the entire circuit to be made a good deal smaller. Thanks to the small component dimensions, the signal paths can also be shorter, which results in less interference and allows opera- tion at higher frequencies or dock rates. However, there are also some disadvantages. Especially with relatively large ICs, manual PCB assembly is rather difficult. You quickly reach the point where you need an SMD oven If you want to do a good job of assembling boards with SMDs, Another disadvantage becomes apparent in prototype assembly or when you need to repair a board fitted with SMDs: component overlay markings are usually minimal due to the tiny dimensions. For this reason, SMD boar ds from the Elektor Shop often do not have any component overlay at all, and in such cases we print the boa rd layout at somewhat larger scale in the ma gazine. The differences in the external appearance of resistors, inductors and capacitors are also often so small that you have to guess at what type of component you're looking at. Manufacturers of measuring instruments have also recognised this prob- lem, and they have developed special devices to deal with it Now we can hear you thinking: things actually aren’t all that bad; you can manage fairly well with a multimeter and suitable (small) probe tips. That's true, of course, but with special measuring equipment it's a whole lot easier to make measurements on passive SMD components. For this review article, we surveyed the market to see what types of measuring tweezers are available. By this we mean RC and RLC meters equipped w'ith special tweezers for use with SMDs. Some of these instruments have all of the circuitry and the display built into the base of the tweezers, resulting in a more or less conven- ient instrument (more about this later) that you can use to meas- ure component values and (in some cases) determine what type of component you're measuring, all without having to direct your gaze somewhere else. There are also ‘normal’ multimeters where the meter (with the display) is a separate unit and SMD measure- ment capability is provide by special tweezers equipped with a cable that can be connected to the meter. Five candidates The instruments in this practical test differ considerably in their basic design and price. First we have two measuring tweezers, priced at less than £35 (€40), that are suitable for measuring resistors and capacitors. One of these instruments can also measure DC voltage. Our third example of ‘pure’ measuring tweezers is the Smart Tweez- ers instrument, a clever device for making R, L t Cand voltage meas- urements that features a significantly higher price tag — nearly £260 (€300). This is the only instrument in the group that is also suitable for lefties, since it has a configurable display orientation. In addi- tion, we have two meters with a fairly conventional design. The Peak Brand i Second Source Model Price (approx, rrp) Suppller(s) Agilent vwwv.agilent.com U1732B U17S2ASMD tweezers around £200 (€230) exd. VAT tweezers around £25 (€30) exd. VAT Agilent webshop or authorized distributors worldwide. Siborg www.siho rg .com /s m arttweezers Smart Tweezers £260 (€295) and up. exd. VAT Siborg webshop. Peak Electronics www. peake lee. co.uk LCR4G with PEAK-5 MD03 accessory (SMD tweezers) £79 irtcl. VAT (€81 exd. VAT) Tweezers £20 (€23) Peak webshop or authorized distributors. Voltcraft Extec RC- 1 00 SMD tester Ex tec Tweezers £20 ind. VAT Conrad Electronics: www1.uk.tonrad.com, # 121434 -S9. Extec Tweezers Voltcraft Tenna SMD-200 RCD meter fenna Component Tester £30 (€35) (ind. VAT) Conrad Electronics: www 1 . Lik.co n rad , com , # 1 23007 - 89. Tenna: Parnell # 1749431 22 04-2010 elektor SMD MEASURING TWEEZERS Atfas LCR40 is a small, intelligent LCR meter priced at around £80 (€1 0G), with a tweezers probe available as an accessory. The final member of the group is the Agilent U1 7328, an RLC meter with a large display and priced at around £200 (€230), An accessory SMD tweezers probe is also available for this instrument. Voltcraft RC-ioo / Extec SMD tester This is a lightweight RC meter in tweezers form, powered by two LR44 button cells. The reasonably large 3 3 / d -digit display Is easy to read. The 'Function’ button (which also acts as an on/off but- instrument does not recognise the component type automatically, so you need to know whether you are dealing with a resistor ora capacitor. There is a Relative' button for making relative measure- ments (measuring the difference between one component value and another one). Voltcraft SMD-20 0 / Tenna Component Tester This meter has the same basic design as the RC-100, but with a somewhat different case design and a different colour (grey Instead of dark yellow). It is also powered by two LR44 button cells, and it ton) selects the measurement mode: resistance, capacitance, or diode. The meter has autoranging capability (which cannot be disabled) for resistance and capacitance measurements. The resistance ranges extend to 40 Mil, while the capacitance ranges extend to 200 pF, The forwa rd voltage of the diode is displayed in diode mode. Power is switched off automatically after 1 5 min- utes of non-use. The RC-100 is reasonably adequate for measuring SMDs. The tips of the tweezers are fairly wide and rounded off, which makes it difficult to make good contact with the contact surfaces of SMDs, especially if they are already soldered on a board. Although the autoranging function is handy, it takes several seconds for the instrument to find the right range. With high capacitance values, you have to wait qu ite a wh i le before the rl g ht va I ue a ppea rs . The also has a 3 3 / 4 -digit display. However, it differs in operation. After being switched on with the 'Function' button, the meter enters scan mode where ft automatically determines what type of com- ponent it is connected to (resistor, inductor or capacitor) and then displays the component value (or the forward voltage if the com- ponent is a diode). You can manually select a component type by repeatedly pressing the ‘Function’ button, and you can use the sepa- rate “Range' button to disable autoranging and select a particular range. The resistance ranges extend to 60 MO, while the capaci- tance ranges extend to 60 pF. Power is switched off automatically after 1 0 minutes of non-use. As a special feature, the SMD-200 allows the tweezers portion to be unplugged and replaced by a cable (included) with an adapter and probe tips. In this configuration, the device can be used as a replace- eleklor 04-2010 23 SMD MEASURING TWEEZERS ment for a regular multimeter, and tt enables you to measure DC and AC voltages up to 600 V. The SMD-2GQ is somewhat more satisfactory than the R0-1 00 for measuring SMDs* thanks to its automatic component detection* which is certainly convenient. The tips of the tweezers are very simi- lar to those of the RC-100, which means they aren't great. The autor- anging function is reasonably fast and certainly usable in practice. According to the user guide, the auto-scan function does not work properly with capacitors larger than 6 (iF. However, in practice we had no trouble measuring values exceeding 1 00 pF without need- ing to change to manual operation, Siborg Smart Tweezers This is the most luxurious SMD tester in the group, with prices start- ing at around £270 (€300). You may not see the difference right away, but the secret is in the details. The probe arms extending from the case, which has a good ergonomic design, are excellent; the tips are finished very precisely and mate well. You can even fit differ- ent types of tips (available as accessories). The meter body holds the circuitry and a graphic display (with 4-digit resolution for the main value) and three LR44 button cells; a version with a recharge- able battery and charging station is also available. The measuring have the knack it's pretty smooth. The probe tips make good con- tact and can be positioned precisely. With resistors, capacitors and inductors, the component is identified almost immediately and the measured value is displayed along with extra information at the top of the display, such as the measuring frequency and (with inductors and capacitors) either the internal resistance or the dissipation fac- tor or £> (quality) factor {user selectable). This way you can imme- diately get an idea of the quality of the component. Four different measuring frequencies can be selected: 1 00 Hz, 1 20 Hz, 1 kHz and 10 kHz, When a diode is measured, a diode symbol is displayed if it is OK. The voltage trace mode is a nice extra feature, but it's not especially convenient because it must be selected separately in a submenu and you also have to change the setting of a small switch. However, that*s the only shortcoming of what is otherwise a very handy little meter, which unfortunately is rather pricey. Peak Atlas LCR40 The LCR40 is housed in a small enclosure with a two-line display that shows the value of the measured component with 4-digit resolu- tion. It is powered by a 1 2-V alkaline battery. A short, permanently attached cable with two small probe tips provides the connection to the component to be measured. You can also connect an acces- tweezers are activated and operated by a sort of thumbwheel with a built-in pushbutton. There is a fairly extensive menu that can be used to select all sorts of manual modes and other settings, but by default the Smart Tweezers are configured for automatic LCR detec- tion. You can also switch manually to diode measurement, voltage measurement* or even a trace mode in which the screen shows a sort of osci lloscope display for slowly changing voltages. The meas- uring ranges (manual or autoranging ) extend to 10MQ, 5000 pF. and 1 000 mH. The voltage range is limited to S V. A cap is included for protecting the probe tips. The meter switches off automatically after a user-configurable time (default: 30 seconds). Making measurements with the Smart Tweezers Is a piece of cake. The thumbwheel control takes a while to get used to, but once you sory cable with SMD tweezers (SMD03) in place of the dips. The meter switches off automatically around 1 5 seconds after a meas- urement is made. This instrument automatically detects resistors, capacitors and inductors* and it has autoranging capability (which cannot be disa- bled). Operation is especially simple, with only two buttons avail- able. The ‘On/Test* button switches on the instrument and starts the measurement process. The value appears on the display five seconds later; this delay can be eliminated by pressing the button a second time. Only the component value is shown with resistors, but with capacitors and inductors you can also display the measur- ing frequency selected automatically by the instrument (1 , 1 5 or 200 kHz, depending on the component value, or DC with relatively 24 04-201 q elektor SMD MEASURING TWEEZERS Other options If you don’t want to right away buy a separate meter For measuring SMDs, you can always buy a tweezers accessory, which are available from mail order suppliers, including Mouser, Famell and DigiKey, The accompanying cable and banana plugs typically allow the add-on to be connected to a normal multimeter. Many multimeters nowadays can also measure capacitance, so this arrangement at least enables you to measure resistors and capacitors. it is also possible to put build your own SMD tweezers, for example from a few pieces of PCB material. You can find a detailed construc- tion description for this on the Maxim Integrated Products website at vrww.maxinvic.com/app-notes/index.mvp/id/4459 high-value electrolytic capacitors). The internal resistance of induc- tors is also measured, and you can use this to calculate the Q fac- tor. The LCR40 is suitable for resistors up to 2 MO, capacitors up to 1 0,000 uF, and inductors up to 1 0,000 mH, There’s not much more to say about the LCR40. It is easy to use, produces accurate measurements, and automatically detects the component type. One drawback is the fact that you have to press the button each time you want to make a new measurement, which is dearly intended to achieve long battery life. The tweezers acces- sory is easy to use, and the right-angle metal tips provide a good grip on small SMD components. Agilent U1732B This is the only instrument in the group with a conventional form factor. It is approximately the same size as a typical multimeter. The meter has an especially large, clear display that shows the primary measured value (4’/^ digits) along with several other items, such as the selected component type, the measuring frequency, dissipation has an optical port for connection to a PC using an accessory cable. It has several built-in terminals for fast measurement of leaded com- ponents, and several short cables with alligator dips are included, Agilent can also supply a special SMD tweezers accessory for this meter, equipped with three connectors (+, - and shield). Although this is a fairly large instrument, the U1732B is convenient in use. The connecting cable is fairly long, but the build-in shield makes it reasonably thick, with the result that it sometimes gets in the way. The measuring tweezers are solidly built and have nicely finished gold-plated tips, but they are certainly not petite. The tips are also fairly large, and they have such a smooth finish that the SMDs sometimes pop out. The meter works quite well, is very accu- rate, and provides a lot of information. There are a variety of extra features that we did not try out for this practical test, such as testing components within specific tolerance ranges and measuring com- ponents in series or parallel mode. This may not be the most suit- able instrument for use as a special SMD meter, but it is otherwise an excellent instrument with such a low price that it should actually be standard equipment in every electronics lab. factor, 0 factor or phase angle (user selectable), and a few other settings. It also has backlighting, which can be switched on manu- ally. This instrument does not automatically detect the component type; you must first press a button to select what you want to meas- ure (inductance, capacitance or resistance). However, it does have autoranging (which can be disabled). The measuring ranges extend to 10 M£2, 1 0,000 uF, and 1000 H. The basic accuracy is a respect- able 0.5% in the resistance ranges and 0.7% in the inductance and capacitance ranges. It takes several seconds to make a measure- ment. There is a button for changing the standard measuring fre- quency (1 kHz) to 100 Hz, 120 Hz or TO kHz. With capacitors and inductors, you can choose to have the dissipation factor, Q factor or phase angle shown in addition to the component value. The meter Conclusion For electronics entusiasts who occasionally need to measure SMDs, the inexpensive measuring tweezers are doubtless usable but fairly limited, and their mechanical construction is not so great. The Peak LCR meter is a good deal better; it is fast and accurate and has serv- iceable tweezers. Unfortunately, you have to press the button for each measurement and the display switches off rather quickly. The best choice For SMD measurements is unquestionably the Smart Tweezers; you only need to grasp a component with its pointed tips and it shows you the component type and value, including the dissi- pation factor or Q factor. However, it is rather expensive, so it is prob- ably only attractive for people who work with SMDs on a daily basis. The Agilent U1 732B is a robust and accurate LCR meter with quite a few features, and it is more than worth its price for electronics enthusiasts and professionals who need to make LCR measurements fairly often. Although the SMD tweezers accessory has very nice mechanical construction, it is not especially suitable for making measurements on such tiny components. In addition, the U 17328 does not have automatic component detection, which makes it less suitable for quickly sorting out loose SMDs. The main question is how you intend to use such an instrument. The Smar t Tweezers are especially handy for working exclusively with SMDs, but the drawbackofinstruments of this sort is that they are poorly suited to measuring leaded components. If you are look- ing for a general-purpose solution, the relatively inexpensive Peak LCR40 or the somewhat more expensive but vastly more versatile Agilent U1 732B is a much better choice. ( 091038 ) elektor 04-2010 25 POWER SUPPLIES UniLab By Sebastian Richter and Stephan Pohl (Germany) A power supply with adjustable output voltage and current limiting is part of the basic equipment of every electronics lab. However, the increased complexity of a switch-mode design scares away many potential builders, even though it actually isn’t all that complicated if you use a suitable combination of well-known technologies. The circuit described here is suitable for a building a single or dual power supply. The Idea of developing a switch -mode labo- ratory power supply arose in the electron- ics enthusiasts group M l of the Institute for Power Electronics and Electrical Drives (ISEA) P) at RWTH University in Aachen, Germany. Conceived as a starter project for novice electronics designers, it manages without a microcontroller and can be imple- mented at low expense. This power supply is based on an integrated switching regulatorto keep the component count within reasonable limits. The func- tional units of this 1C include voltage regula- tion, switching signal generation, and inte- grated power switch. This means that only a few external components are necessary. Thanks to the compact construction, it is easy to bu i Id a dual power supply in a single end osu re. A d ua I power supply is especia lly handy when you need more than one sup- ply voltage. Naturally, both supplies are gal- vanically isolated, so they can also be con- nected in series to achieve higher voltages or used In parallel (connected via diodes) to provide more current. Architectures A conventional power supply architecture has a mains transformer followed by a rec- tifier and a linear regulator that controls the output voltage. At high power levels with a large difference between the input and out- put voltages, a linear regulator dissipates a lot of power as heat and needs a large heat sink. This high power dissipation makes the power supply inefficient, and it means that the transformer must provide the dis- sipated power as well as the useful power. This makes the transformer unnecessarily heavy and expensive. Another option, which results in signifi- cantly lower power dissipation and thereby improved efficiency, is to use a switch- ing regulator instead of a linear regulator. Although secondary-side switch-mode power supplies are somewhat more com- plicated than power supplies with linear regulators, they have only slightly higher component counts thanks to the availabil- ity of integrated circuits. The higher effi- ciency allows a more compact design, and in particular a distinctly smaller heat sink. Although the mains transformer cannot be eliminated, it is smaller than with a lin- ear regulator because the higher efficiency means that transformer does not have to provide as much power that is dissipated as heat. By contrast, a primary-side switch-mode power supply rectifies the mains voltage straight away without a mains transformer and filters the rectified voltage to obtain a high DC voltage (325 V). This Is then con- 26 04-2010 elektor POWER SUPPLIES Features * Adjustable secondary-side switch-mode power supply {buck converter) * Output voltage 0-30 V (typical) {25 V minimum) * Adjustable current limiting up to 3 A * Maximum output power 90 W * Compact PCB layout * Switching frequency 52 kHz * Parts kit available from the ElektorShop verted into a low AC voltage by the com- bination of a suitable converter (such as a full-bridge circuit) operating at a high fre- quency (in the kilohertz range) and a small high-frequency transformer. This voltage is in turn rectified to obtain a low DC volt- age, A galvanically isolated sensing cir- cuit feeds this voltage back to the regula- tor section of the converter, which in turn maintains the desired output voltage. The major advantages of this technology are the very small transformer (depending on the switching frequency) and high efficiency (90% or better is possible). However, this form of low-voltage generation requires a very high component count and a com- plex design, and due to the high input volt- age it can be hazardous in the construction and test phases. In addition, the inductive components in particular must often be custom-made. Consequently, we decided to use the sec- ondary-side switch mode option for this project, which is intended to be suitable for novices. It utilises a step-down (buck) con- verter topology Dl. Switching regulator Many ICs are available to simplify the con- struction of buck converters* The National Semiconductor LM2576 used here is a mem- ber of the Simple Switcher family HI and has already become almost a classic example of its type* Along with a power switch, it con- tains the functional units for generating the pulse-width modulated drive signal and reg- ulating the output quantity. Figure 1 shows a block diagram of the internal structure of the LM2 576 as well as the standard configu- ration for output voltage regulation. The regulator operates by comparing the voltage on pin 4 of IC1 with an internal 1.23- V reference voltage. The difference signal is amplified and compared with a sawtooth waveform. The sawtooth signal goes to zero at the start of each switching cycle, and the power switch is switched off at the same time. When the instantaneous value of the sawtooth signal exceeds the value of the amplified difference signal, the power switch is switched on and remains on until the start of the next switching cycle. As a result, the output voltage (V [JUt in the sche- matic diagram shown in Figure 2) is regu- lated such that the voltage on pin 4 of IC1 , which is taken from the junction of voltage divider PI /R 12, is 1*23 V* If PI Is adjusted to a higher resistance, the voltage on pin 4 drops. This causes the switch to remain on longer, and the output voltage increases to the point that the voltage on pin 4 is again 1.23 V. In the opposite direction, reduc- ing the resistance of PI causes the switch to remain off longer, which causes the out- put voltage to drop. However, it is not pos- sible to reduce V out below 1 .23 V with the standard circuit. If PI is set to 0 O, the out- put voltage is connected directly to pin 4 via R14. R1 4 is included in the circuit to prevent the output of IC3b from being connected directly to the power supply output when PI is set to its minimum value {0 i>). A negative auxiliary voltage is generated to allow V out to be adjusted down to 0 V, On the positive half-cycles of the input AC voltage, D2 conducts and charges C2* On the negative half-cycles, D2 is cut off and D3 conducts whenever 02 is charged to a higher voltage than 03. Capacitor 02 dis- charges into 03, causing 03 to be charged to a voltage that is negative relative to ground. This voltage Is stabilised by an LM377 linear regulator (102), and it can be adjusted with P3 so that the reference ground potential (PGND) for IC1 is negative relative to the power supply ground by the amount of the reference voltage* This means that the voltage on pin 3 of 101 is -1 .23 V. This off- set only affects the regulator circuit in IC1 , while the output voltage V (UJt remains refer- enced to CND, This trick makes It possible to adjust v out down to 0 V* With this buck converter topology, output capacitor 05 can be ‘actively' charged by switching on the power switch, with the result that V 0Mt rises. However, 05 can only be discharged 'passively' by the connected load whife the power switch is off. It Esthete- Figure 1. Block diagram and basic circuit of the switching regulator. elektor 04-2010 27 POWER SUPPLIES fore a good idea to provide a minimum load, here consisting of R4 and R5, to allow the output voltage to quickly reach the set level even when no external load is connected. Current limiting Adjustable current limiting is often very helpful in a lab environment in order to pro- tect the connected circuitry. For this pur- pose, the circuit detects the voltage across sense resistor R8 t which is proportional to the output current. lC3a amplifies this sig- nal by a factor of approximately 4 t and C6 attenuates high-frequency noise, P4 is used to compensate for the offset of the current sensing circuit (including the offset of Oa), Ob is wired as an adjustable non invert- ing amplifi er, with D6 and D7 at the output allowing only positive output currents. As a result, Oh can increase the voltage on R1 2 but not reduce it. If Ob increases the volt- age on pin 4 of 1C 1 above the val ue resulting from the setting of PI , the current limiter causes the power switch to switch off ear- lier. This reduces the value of V out and thus limits the output current to the maximum level set by P2, If the current is less than the set maximum value, the anode of D6 (and D7 as well) is negative relative to the cathode, which causes the diodes to be cut off. In this state, the switch-off point of the power switch is determined solely by the voltage regulator. D6 is connected in series with D7 to prevent reverse -voltage breakdown of the LED, since the maximum allowable reverse voltage of the LED is only around 5 V. The upper limit of the adjustable current range can be preset with P5. The lower limit is determined by the maximum gain of Ob. The desired current limit level (maximum current) can be set within these limits by adjusting P2. As an LED, D7 provide a visual indication when current limiting is active. Construction and initial use The transformer should be rated for at least 1 .2 times the nominal output power of the power supply, which means at least 90 watts or so for a single power supply. The secondary voltage should not be higher than 25 V, since the maximum voltage that 1C1 and IC2 can handle is 42 V. With a 25- V transformer, you still have some safety margin even with 1 0% overvoltage on the AC mains. If you want to build a dual power supply, you can use a toroidal transformer with twice the power rating and two sec- ondary windings as an alternative to two separate transformers. For sense resistor R6, you can use a length of inexpensive resist- ance wire instead of a Teal' sense resistor. With the specified resistance wire, a length ♦ Figure 2, Power supply schematic diagram. A negative auxiliary voltage allows the output voltage to be adjusted down to 0 V. 28 04-2010 elektor POWER SUPPLIES COMPONENT LIST Figure 3. The double-sided circuit board allows very compact power supply construction* Resistors f default: 250 m W 1 %) R1 ,R2 = 8200 R3 = 2400 R4,R5 = 560ft 1W R6 = 0.05ft 5W (Vishay Dale type LVR- G5K0500FE73 or 1 ,73ft/m resistance wire, see text) R7.R8 - 1 2kft R9 = 47 kO RIO = 39kft R11 = 160kH R12.R13 - 1 kft R14 = 100Q R15 “ TOOkft Rl6 = iokn PI = 25kft potentiometer, linear P2 = 250kft potentiometer, linear P3 " 50 ft trim pot, multiturn, vertical P4 = 1 0kft trimpot, multiturn, vertical R5 = 50kft trimpot, multiturn, vertical P6 = 1 kft trimpot, multiturn, vertical P7 = 2000 trimpot. multiturn, vertical Capacitors Cl * 10.000pF50V radial C2,C3 - 220pF 63V radial C4 - 1 OQpF 63 V radial C5 = 22O0pF 63V* radial C6 = 680pF ceramic C7 - lOOnF ceramic Inductors LI = 330pH 4.5A (mu Rata Power Solution type 1433445C) or 330 pH 3 A (Wurth type 744137) Semiconductors B 1 = 800V 6A bridge rectifier (e.g. Vishay type CSIB6S0) D1 = 1 N5822 (Schottky diode, 40V 3A) D2»D3 = 1 N4007 D4 = zener diode 22 V 1 W D5 - zercer diode 18V 1W D6 = 1N4148 D7 “ LED, 3mm* red* low current (2mA) ftl - LM2576T-AD) (National Semiconductor) (see text) IC2 = LM337LZ IC3 = LM358AIM Miscellaneous TR 1 = power transformer, seconda ry 25V 3 . 2 A (see text) Heatsink forICl (TO-220 <9,9K/W. e.g, Fischer Elektronik type SK 1 29 25.4 SIS) K1 ,K2 = 2-pin PCB terminal block, lead pitch 5mm K3 = 6-pin DIL pinheader, lead pitch 2.54mm (OH”) PCB, order code 090786-1 Kit of parts, contains all components except power transformer. Order code 090786-71* see Elektor Shop section or www, elektor, com/090786. 090786-i v2 Cc>Elektor elektor 04-2010 29 POWER SUPPLIES About the authors Sebastian Richter completed his studies in Electrical Engineering at RWTH Aachen University in 2005 and was awarded the degree of Diplom- Ingenieur (equivalent to an MSc). Since then he has been working as a research assistant at ISEA in the field of power electronics. He is also actively involved in teaching and is one of the co-founders of the Institute's electronics enthusiasts group. Stephan Pohl completed his studies in Electrical Engineering at RWTH Aachen University in 2008 and was awarded the degree of Diplom-lng- enieur. Since then lie has been working as a hardware designer at PicoLAS GmbH, where he is involved in the development of current sources for laser diodes. During his studies, he served as an advisor forthe electronics enthusiasts group at ISEA, in which role he was primarily in- votved in teaching students analogue circuit technology. of wire equal to the distance between the through-plated lead holes will have a resist- ance of approximately 50 m Cl. Any small dif- ference can be compensated by adjusting P5. With regard to parts selection, it is impor- tant to use a genuine National Semiconduc- tor LM2576-ADJ, since problems may arise with 'type-equivalent" components from unknown manufacturers. Before assembling the circuit board (Fig- ure 3), you should preset mufti-turn trim- pots P3 and P4 for minimum resistance (for this purpose, connect the wiper to the appropriate potentiometer terminal as indicated by the PCB layout). After assem- bling the board, you should again check the polarisation of the electrolytic capaci- tors (Cl > C2, C3 and C5) and setting PI and P2 to mid travel before switching the circuit on for the first time. If the circuit is working properly, it should be possible to adjust the output voltage from approximately 0 V to around 25 V after it is switched on. To precisely adjust the zero point, rotate PI (preferably a multiturn potentiometer) to its minimum resistance and connect a load. Now you can adjust P3 to set the output voltage to exactly 0 V. To calibrate the current sensing circuit, meas- ure the voltage across the series connection of R1 5 and P6 (between (IC3a pin 1 and K3 pin 6) with no external load connected. Adjust P4 until this voltage is set to zero. If you now connect a low-resistance load to the output and turn P2 to its upper limit, you can adjust P5 to set the upper limit of the adjustable current limit range (do not exceed 3 A), A proper lab power supply also has volt- age and current displays. Voltage divid- ers R15/P7 (voltage) and R16/P6 (current) are provided for this purpose. Potentiom- eters P3 and P4 are used to set the zero points for the output voltage and current. while P6 and P7 are used to calibrate the built-in instruments. For this purpose, set the power supply output to a point near the upper end of Its voltage or current range and calibrate the built-in instru- ments by comparing the displayed values with reference values measured using a multimeters. If you want to build a dual lab power supply with two UniLab boards, a tailor-made dis- play unit with a backlit four-line LCD mod- ule is being developed in the Elektor lab. It continuously shows the voltage and current of the two outputs. Along with this display unit, Elektor provisionally plans to publish an article on a suitable enclosure and a front panel design in a future edition, (090786) figure 4. A tailored display unit with a backlit four-line LCD module is being developed in the Elektor lab for building a dual lab power supply with two UniLab boards. Links and Reference Documents [ 1 1 Bragard. Michael and Richter. Sebastian: 'LED Top with Special Effects'. Elektor December 2008 (download from www.elektor.com/080678) [2] www.isea .rwth-aachen.de/en 13] Sanchez Moreno, Sergio: ‘Cool Power 1 , Elektor June 2008 (download from www.elektor.com/080l 98) [4] LM2576 data sheet (download from www.natlonal.com/ds/LM/LM2576.pdf} 30 04-2010 elektor Virtual; Assembly Free Component We add value to PCBs when others just sell it. One Stop Manufacturing Service $ 1 0 ea. for 5pcs 4"x4" 2L Free Solder Mask & Silkscreenf Assembly Components Pcbs Enclosules Fpcs Keypads www.EzPCB.com Email: sales@ezpcb.com Please Visit www.machinepier.com For Machining | plug-in CNC card dJ PH * 1 - ~ ETi E Ki T; CAI R D + SOFTWA RE Don ’t j H st test it,,, Special Offer pricos hr limited period or while stocks lust! electronic design ltd The Famous Atlas LCR, Model LCR40 Passive component analyser. Identify inductors, capacitors and resistors. Auto frequency selection. Removable probes. Optional SMD Tweezers. Crocs and Clutch Grabbers. Supplied wilh battery and universal hook probes. Auto-Range a: luH - 10H 1 pF - IO.OOOuF 1 Ohm - 2M Nominal Accuracy: Resistance 1% Inductance 1.5% Capacitance 1.5% Test frequencies: 1kHz, 15kHz and 200fcHz Dimensions. 1 Q3K70K20mm Alias SCR - Model SCR100 Connect Triacs qr Thyristors any way round. Auto pan +pinout identification Check gale IQOuAio 1t>0mA. Measures gale voltage drop Regulated loadjgst conditions Capacitance and ESR! Capacitance 1uF to 22.000uF ESR 0.01 ohms to 2Q ohms Gold plated croc £75,00 tnc Alias ESR PLUS - ESR7Q Audible alerts! ESR 0,01 ohms to 40 ohms. Capacitance measurement. Our best ESR overt ms Atlas DCA - Model DCA55 The famous Peak Atfas* Now with premium probes. Connect any way round to denlify semiconductor type, pinout and lots of parameters. TrmnsiSiKirK Oarlinglons MOSrETii Duxius LEDs and Atlas IT - Model UTP05 Identify network cabling type. Identify many fault types Tests sockets and cables Complete with all this *•* \ (£60.00+ VAT) Atlas Star Pack (LCR/DCA) Includes the Allas LCR, Atlas DCA and a premium padded carry case, spare battery. Peak Electronic Design Ltd, West Road House, West Road, UK: Please add £2.75 p&p per order. Suxlon, Derbyshire, SKI 7 SHF. Prices include UK VAT. tel. 01 296 7001 2 www.peakelec.co.uk sa!es@peakclcc.co.uk See website for overseas oricos efektor 04-2010 31 SCEPTRE Grasping the Sceptre By Clemens Valens (Elektor France Editor} jutf ■O' ptogr*iptfiWf s ff&f&pud / [ms iff. cj /y- fait mrM* ■ r a»5‘ **1 vkm 4 $ C* % ■_’■ C/C** Find ” nc j b tue r co r/L pover C &l U£TOOTh_onj ; f imer_wait^jns( ,jjj); Mat I t 5 seconds for module to Stablf7Z£ J; pttOT* for connection (p i n~1234 1 . i - ?y_ f£i r ; ft_jnodule_ info(): r t True); ■ n ' J ; ii!^ da t d . felting Sy, L - flaw , a v > - ■' ' ^ tefen- t C °&‘ ;■ v \ fast prototyping )!atform is no use without echnical support. However well-designed he hardware, however comprehensive the software, if no-one explains howto actually use it all, it won’t be as easy to use as you'd like. So having described the hardware last month, here now are the explanations and details of the Sceptre software. Let your reign begin! Before getting into the details of program- ming the Sceptre, let's start by reminding ourselves of a few of the basic principles of programming in C. Oh yes, most of the Sceptre is programmed in C — for the time being, at least, as there are plans afoot for a C++ layer. We're not aiming here to go into detail about C itself, but rather, about the mechanism for converting a program writ- ten in C into executable code for the micro- controller. It's important to understand how all this works so as to be better able to program any microcontroller-based system, including the Sceptre, of course. Figure 1 gives a flow diagram that shows which tool is used at which moment and with what type of data. At the top, we find the application In C, which may be made up of several files. At the bottom, the execut- able to be programmed Into the microcon- troller. So what goes on in between? First of all, the compiler 'translates’ (com- piles) the source code In C to turn it into source code in assembler language. The 32 04-2010 elektor SCEPTRE Figure 1 , Flow diagram for the compilation chain. compiler can issue warnings and flag up errors. Always take care to resolve any warnings, if you possibly can. Errors are of the typo* or 'undefined object 1 variety, and must be corrected , or else you won't be able to goon. It’s the assembler that converts the source code into assembler language, creating from it what are called 'objects 1 . At this point, it's possible to add other functions written directly in assembler. This will often be the case for a special file commonly named CRT (from C Runtime) or Startup, which contains the very low level system initialization. In this file, the interrupt and reset vectors and stack are initialized, along with the memory and the p re-initialized var- iables, it's also from this file that we call the main function of a program in C. The linker Incorporates all the objects pro- duced by the assembler into the executable. It also adds the objects archived in libraries that the application is going to need. The libraries contain functions that don't change very often, like printf, but which can be re- used over and over again. If this tool fails to find certain objects, It will return 'unre- solved externa l'-sty I e errors. The linker requires a map of the memory in order to organize the objects and create links between them. With the help of this map (or table), it determines the function addresses and writes them into the various calls and jumps in the program. That’s why it’s called a linker’. It's up to the user to provide this memory map (also called a linker script’), since It depends of course on the hardware. The end product of the linker is an execut- able file that can be programmed into the microcontroller. What we've just been describing Is the 'com- pilation chain’. The previous instalment explained that we've opted for WinARM l 2 \ as our compilation chain. You can refer back to part 1 for details on installing WinARM. Apart from the functions for controlling the board, the Sceptre’s software distribution PI contains the elements needed for the com- pilation chain, such as a Startup file and a memory table(, ID fife). The compilation chain is launched using the make command, a very powerful program (included in WinARM, of course); make runs a script usually named makefile. A makefile contains all the commands and options for producing an executable from the source Hies and libraries. Make is so powerful that a makefile can be extremely complex and incomprehensible. So the best thing to do It to take a makefile that works and adapt it to your own project. Naturally, the Sceptre distribution also contains a makefile. The Sceptre library Since the Sceptre offers a certain number of on-board peripherals, it’s only logical to bring all their drivers together into one library to make them easier to use and save 100017-12 Figure 2. The Sceptre library, its contents, and its place in a project. a little compiling time, since they don't have to be re-compiled every time. At the time of writing, the library already con- tains the drivers for the USB, the SD mem- ory card reader, the Bluetooth module, the UARTSt the counters, the real-time clock (RTC), ADC, DACs, PWM, the thermometer, and the accelerometer (Figure 2). Certain functions for Initializing the micro are also included in the library, along with part of the newlib interface (see boxaboutnewlib). Not surprisingly, the library is called sceptre (.a), in order to use it, you need to include the file sceptre. h in your project and tell the linker where it can find the library. The Sceptre library offers functions that make it easier to use a peripheral. For exam- ple, to set up a Bluetooth connection, all you have to do is call the blue toot ^con- nect function after the module has been initialized. To read the accelerometer, there is the accelerome t er_read function, while thermometer read Jets you read the thermometer. It's easy, too, to turn the Sceptre into a USB key thanks to usb_ Tnass_storage_irL.it and usb_mas5 stor- age tick. Files on the SD card are manipu- lated using f_open t f close, f_read and fwrite (similar to fopen, f close, freed and f write in Hbc) and to write to serial port 0, there is printf . You see, a lot of the work has already been done — and it's not finished yet! Take a look at the documenta- tion in the doc\html folder, starting from the mdex.htmf Hie. elektor 04-2010 33 SCEPTRE Flash Magic Toab 33 T animal, I Ffle ISP OfJfoiW ea Q A3* Figure 3. Here's how to run the Flash Magic terminal and configure it. The speed of the terminal’s serial port can be different from that of the programming mode. Figure 4. ft works! The Sceptre start-up messages on an RS-232 terminal 1 . You can extend, modify, and correct the library, as you have access to everything. Each time you modify something in this library, you'll need to re-compile it This can be done at a command-fine prompt by running the make command in the distri- bution's core directory (perform a ‘clean 1 first so as to be sure you are starting out from zero): C : \sceptre\core>make clean C ; \sceptre\core>make For ARM7 experts, here's an interesting bit of information: the library can be com- piled in ARM mode or in thumb interworks (iw) mode. In ARM mode, the Sceptre is a true 32-bit system, but the executables are larger. In thumb-iw mode, the executables are smaller, but also slower, as the processor works in a 16-bit-compatible mode. With 51 2 kB of program memory, there's plenty of room to store a program in ARM mode, but programming the microcontroller will take longer. By default, the library is com- piled in ARM mode; to compile it in thumb- iw mode, use: C : \sceptre\core>make clean C : \sceptre\core>make ARM_MODE = thumb That way, you'll get the sceptre-iw.a library. Always check that the application and the library are using the same mode! The Sceptre library includes other libraries found on the Internet, in particular Ipcusb HI and fatfs l 5 E The former provides the USB driven the latter is a FAT file system making it possible to read and write Win- dows, Linux, or MAC-compatible SD cards. When you compile the Sceptre library, you may see a number of warnings dur- ing compilation of files from the external libraries. Ignore them, there's nothing terribly serious, these libraries work pep fectly. Given that these libraries are main- tained independently of Sceptre, we avoid modifying them. Getting stuck in-* The Sceptre distribution contains a test application named app_pre!oad. This pro- gram is pre-loaded on the Sceptre boards available from our website lb and lets you check easily that the whole board is work- ing properly. To use it, you need to con- nect the Sceptre’s USB port (JP4 and JP5 on pins 1 and 2) to a computer with the FTDI drivers installed (see previous article 1 1 1 ). Run an RS-232 terminal program on the computer — for example. Flash Magic bl- and configure the correct serial port for a speed of 1 1 5,200 baud, eight data bits, no parity, and one stop bit (see Figure 3). Dis- able the hardware flow control Press the board's Reset button. Now you should see a screen similar to the one in Figure 4* After a few seconds, the application attempts to open an SD card to write a few tittle files with information about the system to it, then, for 30 seconds or so, it saves in two other hies the data read from the ther- mometer and accelerometer (wave the board about a bit!) By writing a file named test_bt.pls to the SD card, containing a name in ASCII (1 6 characters max., with no spaces or you request the Bluetooth test and the module starts up. Lastly, the Scep- tre becomes a 'USB key' that also sends the thermometer and accelerometer data to serial port 0 . It is now possible to hot-con- nect the Sceptre's USB pin header so as to access the 'USB key 1 : remove JP5, then JP4, refit JP4 on pins 2 and 3, and finish by fit- ting JP5 on pins 2 and 3. It's also possible to change the USB key mode into serial port mode, but nine times out of ten, this will entail re- booting the board. If you connect an LED with its anode to pin 1 of K7 and its cathode to GND via a 330 Q (or so) resistor, it will flash at a frequency of 1 Hz ♦ With the Bluetooth module enabled, It ought to be possible to connect to a compu- ter and send data. The Sceptre sends every- thing It receives on UART0 to the Bluetooth module and vice-versa. The test application is compiled via a com- mand-line prompt in the app^preload directory: C : \sceptre\app_preload>make clean C : \sceptre\app_preload>make The test application's makefile compiles the application and if necessary the Scep- tre library too. If everything works properly, make will end without any errors and creates a preload* hex file. This is the file you'll have to pro- gram Into the microcontroller, using for example Ipc21isp (included in WinARM) or Flash Magic (see previous article [1])* The latter detects automatically if the HEX file lt T s supposed to use has been modified {what's more, it displays the date and time the file was last saved), so all you have to do is dick on the Start button to begin the flashing. The flashing will take longer or less time, depending on the file size. Unless you're keeping an eye on the programming, 34 □ 4-2010 elektor SCEPTRE you may not spot the Flash Magic success message, as it goes oft about 30 seconds after the end of flashing. Flashing the microcontroller using Ipc21 isp is done using the command (if you're using COM4): Ipc21isp -control preload. hex com4 38400 12000 The -control option indicates that it’s Ipc21isp that puts the board into program- ming mode and will restart it once program- ming is over. Two indicators alongside the USB socket show if a data transfer has in fact taken place. We recommend taking the test application as a starting point for your own project. Thanks to its makefile, you don't need to compile the library separately* Create a directory for your project alongside the app_preload directory so as to ensure that all the paths remain correct* Consult the main.c file to find out how to use the Scep- tre library. You can use any text editor to write a pro- gram, just so long as the source code doesn't contain any formatting codes or page formatting (nothing but ASCII, in other words!) The Programmer's Notepad (PN) i 6 l editor supplied with WinARM is a good choice (see box). Add your C files into your project’s make- file (not into the library one!) below the tine ‘SRC - mainx\ like this (note the k +=’!): SRC - main.c SRC += my_f ile * c You can add as many files as you tike. To change the name of your executable, mod- ify the line: TARGET =t preload by entering the name you want. To be continued. .. The Sceptre library is still not complete. Cer- tain parts are almost finished, others have barely been started, and new functions are going to be added as you go along. In the coming months, well be presenting exten- sions and applications for the Sceptre which will all offer new possibilities. Updates will be announced on l 7 i, (1000174) Proarammer’s Notepad 2 The WinARM distribution also includes Programmer's Notepad 2, a special text editor for programmers. This tool can be found in the WinARM\pn directory and is initially configured for WinARM. There is now a more recent version PL Alt you need do to Install this version is to delete everything in the WtnARMlpn directory except for the tools sub-directory containing the macros for WinARM. Next, down- load the Portable Edition and unzip it into the WinARM \pn directory. Use the command Tools-> [WinARIVLC] make all - CTRL-F7 to co m p i I e y ou r p rog ra m . PN picks up the messages issued by the tools called by make and displays them in the Output window. Do look at the messages care- fully, as there may be warnings or errors to he corrected. Sometimes a tool stops because of an error that’s nothing to do with your pro- gram, but which indicates a Windows problem (noticed in particular with Windows Vista), if this happens to you, it’s better to cal! make manually from the command line prompt. print!, fopen, ... libc, newlib, syscalls, and BSP GNU C includes the libc library containing a very large number of functions that make programming in C easier Certain of these func- tions depend on the hardware, particularly the functions that manip- ulate files and data streams* Normally, it’s the operating system (OS) that makes the link between the hardware and libc, but where the OS doesn't do it, it’s up to you the user to do it yourself (only if you want to make use of these functions, of course). This is why a version of libc for embedded systems has been introduced, with the name of newlib. This new !ibrary offers an interface named syscalls which lets you graft a board support package (BSP) onto the library in order to adapt it to the hard- ware. If now you are only using standard C functions in your application, ail you have to do is modify the BSP to make it all work on another platform. 100017-13 elektor 04-2010 35 SCEPTRE For the Sceptre, we’ve incorporated some of the syscalls in order to allow use of printf, fopen, etc. Among others, printf is a very handy function for debugging and lets you send character strings to Scep- tre's serial port 0. Documentinq usinq Doxvqen It's important to document software, but this is not always easy and one soon forgets to update the documentation following a modifi- cation* Tools exist that let you automatically extract the comments (KEMs) from a piece of software so they can he presented in a usable form. Doxygen is one of these tools, and by no means the least. What's more, Doxygen is free and open-source, and so Ideally suited for our project, Int accelerom(?ter_read ( fkat r fn_dst ) Read the accelerometer Para meters: Address to wnte data to. Returns: The number of bvtes read an success, -1 otherwise. Definition at line 51 of file occelern meter, c, To make the most of Doxygen' s capacities, you need to respect cer- tain layout rules for source files* Like any self-respecting software, Doxygen offers a plethora of options that you'll probably never use, but already with just a handful of commands, it's possible to do some good things. So remember to format your comments like this: / * + * ©file * Description of file, */ A Doxygen comment starts with / ’ * and ends with * / — the other asterisks are optional, it’s also possible to enter a Doxygen comment on a single line using ///. An "^ffle 1 block is obligatory, in order for Doxygen to take account of the file. Use the block below for commenting on a function. / * * * Short function description* * ©pa ram cparameter name> cparameter description * ©return description of value returned^ */ Doxygen extracts all these blocks of comments and creates from them a collection ol HTML pages (among others) with the links to the definitions, sources* types* etc* — IV s very impressive. Take a look, for example, at the Sceptre documentation included in the distribution. And here’s another very handy Doxygen command; @todo Doxygen creates a special page with each todo found. With a func- tion like that, you'll never forget anything again! In the world of microcontrollers, it's very important to use vari- able types that correspond to the hardware. The size of the types depends on the hardware, and the fact that a character uses eight bits on platform A by no means implies that it will use as many on platform EL So to avoid such difficulties* you define dear types like uint8_t (unsigned 3-bit integer) or int32_t (signed 32-bit integer). Unfortunately, everyone does this a bit after their own fashion, and the result, when you glean your code a bit from everywhere, is that you often find yourself with several definitions of the same type (and not necessarily identical) like BYTE, BOOL, or DWORD, which the compiler doesn’t like one bit So we strongly recommend you to only use the types defined in sysinth* supplied with the GNU tools* This file contains type definitions specially designed for programming mi- crocontrollers, Do this* and everyone will be grateful to you for it. Internet Links I VI www.elektorxom/090559 HI so u reef o rge.net/projects/lpcusb Pi www.siwawi.arubi. [5] elm-chan.org/fsw/ff/OOindex_e.html u ni-kl.de/avr_projecls/ a rm_projec ts/ #wmarm t&l www, pnotepad.org PI w w w.ele kto r.com / 1 0 0 0 1 7 id elektorembedded.blogspot.com 04-2010 dektor Now available: Tools and accessories _ for prototype PCB ass r cod as PULSQWIX THE ORIGINAL SINCE 1994 Email: sales@pcb-pool.com free 1 Phone UK: 0800 389 8560 Servicing Your complete PCB prototype needs. 8 hour prototype service 1 mm material now available Free Laser SMT Stencil with all PCB prototype orders Supported File Formats LAYOUT 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 PCBs supplied - three produced. If the third board is also okay, you receive it as well - free of charge! Quick, cheap and secure www.elektorpcbservice.com elektor 04-2010 37 READERS CIRCUITS A Fast Charger By Uwe Hofmann, Gunter Ceroid and Dr. Thomas Scherer (Germany) Here’s how three ElektorWheelie fans came up with an idea for a fully automatic fast charger to keep the batteries in prime condition. This low-cost design uses an off-the-shelf switch-mode power supply coupled to an intelligent controller and can be easily adapted to charge other types of cell. In 2009 we published the complete con- struction details of the ElektorWheelie |1J , a single-axle, self balancing, electric pow- ered personal transporter. 31 was through the German forum that the three authors made contact. Before long they had agreed that a fast charger for the ElektorWheelie 1 s two lead acid batteries would make a useful addition to the project. The idea was to add an external controller to an existing low-cost industry standard 1 2 V 60 W switch -mode power supply (SMPS} shown in Figure 1 . It needed a little more investigation to make sure it was up to the job. The SMPS must supply a voltage of 14.4 to 14.8V for the Figure 2 . The SMPS output voltage is sensed by a TL431 (SHR1 ) shunt regulator. Figure I.Thc SMPS used here. These types of power supplies are now widely available and are quite cheap. Figure 2a. A flying lead is soldered to R21 in the SMPS so that its output voltage can be controlled by the external add-on board. 04-2010 elektor READERS CIRCUITS final charging phase and must also remain stable with an output of less than 10 V. Lifting the lid revealed a fairly typical layout using a switched primary winding. The sec- ondary voltage level is sensed by aTL431 Hl three pin adjustable shunt regulator (SHR1 in Figure 2). This type of regulator is also known as an l adju stable zener diode' ; the zener voltage is defined by a simple volt- age divider network (see Figure 3). The regulator senses the secondary voltage and adjusts the switching controller on the primary side via an optocoupler. The out- put voltage adjustment preset can be seen in Figures 2 and 3. This basic operating configuration is standard and used in hun- dreds of other 5MPS designs so you are not restricted to the model specified here. In order to convert this basic 5MPS into an 'intelligent’ battery charger we need to add a microcontroller to measure current (via a series ‘sense’ resistor) and control the volt- age using the TL431 fitted in the SMPS, Tweaking the supply As shown in Figure 3 a connection to the TL43 1 5 s reference pin is necessary so that an external voltage can control the SMPS’s out- put voltage. From the resistor values used in the SMPS it was calculated that a control voltage of 0 to 5 V connected via a 1 0 Kfl resistor would produce an output voltage range from 9.5 V to 1 5.5 V. Resistor R21 on the SMPS circuit hoard has one end connected to pin 1 of the TL431. This is a convenient point to solder the wire which will feed in our external control volt- age (see Figure 2a). A test with a 10 k resis- tor connected to 5 V gave an output voltage Figure 3. The circuit diagram. from the SMPS of 9.5 V. The upper voltage level however hit a wail at 1 4.7 V even with the 10 kn resistor grounded. This is not going to be quite enough to fully charge a 12 V lead acid battery. It seems as though there is some additional voltage limiting measure built into the circuit for safety, A closer look revealed the culprit; under- neath the transformer Is a 1 3 V Zener diode wired in series with the input LED of an optocoupler. Its output is connected to the switch-mode controller 1C to limit the out- put voltage. The solution was to add a sil- icon diode type 1N4148 in series with the zener to lift the threshold, the maximum output voltage increased to 15.4V (see Figure 4), The circuit With the aid of a microcontroller and a few additional components we can build a fully automatic charging station (Figure 5). For processing power you can use an ATtiny24 < it has everything required already built-in: an ADC input to measure levels of current and voltage, a PWIV1 output with 16-bit resolution to generate the 0 to 5 V control voltage and some digital outputs to switch the charging supply and control an RGB LED to display one of seven distinct colours to indicate the charger's status. A crystal is not needed if the interna! 8 MHz oscillator is used. A low reference voltage (1 .1 V) allows the use of a low impedance current sense resistor and reduces energy dissipation. A 5 V voltage regulator supplies power to the controller and LED. The power MGSFET T2 disconnects the output when an error is detected. Power Schottky diode D1 pre- vents a potentially destructive current flow- Features ► For fast chargeable 12 V lead acid batteries. - 3.5 hour fast charge. * Protected against short-circuit and reverse polarity connection, * Optimised charging curve, * Based on a modified low-cost industry standard SMPS. * High efficiency from 76 %, * Dead battery detection. * The firmware supports g Ah cells, other cell capacities can be accommodated. * Suitable for lead-acid and LiPo rechargeable cells. ing through the parasitic diode ofT2 if a bat- tery is connected in reverse to the charger. The two paralleled Schottky diodes con- nected to the port pins PA1 and 2 likewise protect these inputs against accidental bat- tery reversal. IC1 calculates the charge current by measur- ing the voltage drop across R9. A 2 W resis- tor will suffice for current up to 3.6 A, The 10-bil A/D converter and 1.1 V reference voltage allow a measurement resolution of around 10 mA, The output voltage is measured by R1 0 t R12 and PI. The maximum voltage drop across Figure 4. Hidden under the transformer is an over-voltage protection zener diode and optocoupler. An additional silicon diode in series with the zener diode raises the maximum output voltage by 0.7 V. eiektor 04-2010 39 READERS CIRCUITS Table 1 . Operating modes Mode Description Voltage Current LED 1 No Battery < 1 V - white 2 Deep discharge 1 tolO.V - yellow 1 3 1 Pre-charge 5 0 to 1 2 V 1/20 C cyan 4 Start fast charge >12 V increasing violet 5 Fasi charge 12 to 14.6 V max. 3/1 0 C blue 6 float charge 13.8 V max. 1 /50 C green | 7 Error - - red 8 TO (time-out) - - blink Table 3 . Using standard components Component Description IC1 ATtiny24 r Dill 4 IC2 78105 , D1 SB540 D2 1N4148 D4.D5 SB140 ri RC547 , t2 IRF540 Table 2 . Error modes Mode Description when... LED A Overvoltage > 1 5 V red B TO pre-charge Mode 3 >1 h blink cyan C TO start charge Mode 4 > 1 0 s blink violet D TO fast charge Mode 5 > 4 h blink blue R9 is 036 V which leaves 0.74 V of the of the 1.1V reference voltage to measure the volt- age. This means that the measuring resolu- tion of a 1 5.5 V level (at maximum current) is not 1 5 mV but more like 22 mV* Correction for the scaling change is performed in firmware. The controller produces a 1 0-bit PWM sig- nal of a few kiloher tz filtered by the low pass filter formed by R3 and C2. The result- ing smoothed DC level in the range from 0 to 5 V is connected to the reference pin of the TL431 in the SMPS via resistor R2. R3 FDD&614 Figure 5. Two ICs plus a few discrete components converts the SMPS into an efficient battery charger. and R2 together make 9.5 kO in total. The SMPS now outputs a controllable voltage level in the range from 9.5 V to 1 5.4 V. R2 can be changed to alter the voltage range if necessary. Operational Modes The following describes charging a 12 V 9 Ah (1 C = 9 A) lead add battery. The operat- ing and failure modes are fisted in Tables 1 and 2. * After switch on the controller measures the voltage on the output and switches to mode 1 if no battery is connected. The SMPS output voltage will be set to less than 10 V. * With a battery connected the control- ler measures its voltage. A value of less than 10V indicates the battery is either in deep discharge or one of its cells ts defec- tive. The charger switches to mode 2. * A battery voltage in the range from 10 V to 1 2 V, will initiate a pre-charge phase supplying a charge current of 1 /20 C (= 450 mA). After one hour if the battery is still ‘bad' the controller indicates failure modeC * Should the battery voltage rise above a 1 2 V threshold the controller initiates mode 4 where the current ramps up to reach 3/10 C(= 21 A) in a few seconds, * This charge level is maintained in mode 5 for a maximum of four hours. When the battery voltage reaches 14.6 V a constant-voltage charge phase begins which gradually reduces the charge cur- rent with rising cell voltage. * When the charge current falls to 1 /5G C = 1 80 mA it enters float charge mode, supplying a maximum current of 1 /50 C and a maximum voltage of 13.8 V until the battery is removed. Construction Thanks to the miniaturisation expertise of Uwe Hofmann we have managed to cram 40 04-2010 elektor READERS CIRCUITS Figure 6, 3D simulation of the mini PCB topside rendered using Target 3001 . The double-stded board is not through- hole plated. Figure 7, 3D simulation of the mini PCB Figure 8. Prototype of the twin fast underside rendered using Target 3001 . chargers laid bare (rough draught) for the Ensure that the diode and MOSFET are ElektorWheelie with 2x1 2 V outputs, correctly fitted. everything onto a PCB measuring just 3 x 3,7 cm (Figure 6), the circuit could almost be fitted in the SMPS case. The disadvan- tage is that SMD components are used but all of the components specified can be eas- ily hand soldered if necessary. All the PCB files are available so those of you with the facilities can make the board yourself. The PCB requires some through-contacts to be soldered by hand to connect between the two layers. The PCB and the circuit diagram in Target-3001 format, the PCB layout in EPS format and the firmware source code {also the hex file) can be freely downloaded from the article's web page When soldering the components to the PCB by hand first start on the underside with T2 COMPONENT LIST Resistors (SMD 1206) R1 ,R7 = 18k£2 R2 = 6.8k ft R3 = 2.7kft R4 = 470ft R5=1.5kft R6 = Ikft R8 = 12kft R9 = 0.1ft 2W R1 0 - 27kft R11 = 1.2kft PI = 500ft, multiturn preset and D5 (Figure 7) these are quite bulky and the board becomes hot when they are sol- dered in place. Afterwards solder the top- side components. When a soldering oven is used bake the top side components, leaving the few remaining underside components to be hand soldered. Finally solder the connec- tor and preset carefully into place, the plas- tic on these components cannot withstand high temperatures for too long. The board is double sided but not through-hole plated so there are a few pads which require a small length of wire soldered through to make connections between the two layers. The RGB LED must be a common anode type with four pins. Diffuse 5 mm LEDs manufac- Ca pad tors (SMD 1206) C1.C2 = ipF 25V, electrolytic or multilayer C3,C4 = lOGnF C5,C6 = 10nF Semiconductors D1 - 5QWQ03FN, Schottky. SMD T0252AA D2 - LL4148, SMD MINIMELF D3 - 4-pin RGB LED. 5mm, common anode * II = BC846, SMD SOT23 T2 = FDD5614, SMD TQ252AA tCI = ATtiny24, SMD SOM IC2 = LM78L05A, SMD SOS tured by A-BRIGHT are suitable r T Although a neat job is produced it is not absolutely necessary to use the PCB, The circuit is quite straightforward and can be built using conventional leaded compo- nents on a small square of prototyping perf- board. Table 3 lists the necessary leaded components. Adaptations The circuit as It stands has been designed to fast charge a 1 2 V lead acid battery with a capacity of up to 12 Ah, The firmware assumes that a 9 Ah (as specified for the Ele- ktorWheelie) will be charged. The Elektor- Wheelie uses two batteries so two separate fast chargers connected in series (Figure 8) Miscellaneous K 1 = 3-pin PCB plug, lead pitch 2.54mm (0.1") K2 = 2-pin PCB plug, lead pitch 2.54mm (0.1 M ) K3 = 6-pin double row pinheader SMPS 12V, 5A ’ Silicon diode for SMPS, e,g, 1 N4 1 48 ' PCB * Firmware' for 1C 1 ' see text elekfcor 04-2010 4 1 READERS CIRCUITS Test and calibration Ontf the add-on controller board is fully populated connect a bench top power supply (minimum voltage range: 8 to 1 4 V @ 1 A) to pins 1 and 3 of connector KI . Now carry out the following calibration procedure: • Mode i: First set the bench power supply output to 8 V and then switch it on. The add- on board LED showing white indicates that the circuit is functioning correctly. ■ Mode 2: Link V- from Ki with V+ from K2 . 1 his effectively bypasses T2 and Di, The output on K2 will be 8 V and the LED will show yellow. • Mode 3: Set the bench supply output to exactly 10 V. Pi can now be adjusted to the point at which the LED switches from yellow to cyan. ■ Mode 4 & B: Increase the voltage slowly, when the voltage gets to 12 V the LED turns to violet, 10 slater the LED will begins blinking violet indicating that the current ramp up to 3/10 C was not achieved in 10 s. • Mode 5: Set the bench top supply to 13,5 V and connect a load to pass a current of 0.2 to 0.3 A (e.g, two 100 Q/4W resistors connected in parallel). Switch the bench supply quickly off and then on. the LED will show blue. • Mode 6: Reduce the output loading so that 100 to 150 mA current flows {remove one of the 100 ii load resistors). This is now the end of the fast charge phase and the charger switches to float charge. The LED changes to green. Remove the wire linking V+ on connectors Ki and K2 and then remove the load resistor, load current now' Tails below the minimum threshold for a connected battery and the controller switches to mode 1. Now with the calibration almost complete we can dispense with the bench top supply and connect the SMPS plus and minus to connector KI . The flying lead from the SMPS connects to the 'PWM 1 position on KI. AL switch on the LED should show white. Turn the output voltage adjust preset on the SMPS until a value of 9.5 to 9.9 V is reached. Fnsure that the LFD on the SMPS does not start flickering, The charger is now ready for use. T he voltage drop across R 9 gives the charging current. Table 4* values for LiPo cells Mode Description 1 | No battery 2 Deep discharge 3 Pre-charge 4 Start fast charge 5 Fast charge 6 Float charge A Overvoltage - SMPS rating RIO 3 cell <1 V < 9 V 9 to 1 1 V >11 V 12.6 V 12V >13 V 12V 27 kn 4 cel l < 1 V < 12 V 13 to 14.1 V >14.3 V 16.8 V 16 V >17.2 V 15V 36 ki7 Current 1/10 c Increasing 1C _J/ 50 C 4 A The Authors Uwe Hofmann is a technician working at Miniatur-Wunderland in Hamburg. Germany w Gunter Ceroid Is a self-employed radio and TV technician & l Dr, Thomas Scherer works as a technical author and designs laboratory equipment, 42 will be required to enable the batteries to be charged independently. The pin assign- ments of the charger plug are the same as that used in the previous ‘Power Charger* article fd, The circuit can easily be adapted to cater for other rechargeable batteries. It is however important to choose a SMPS capable of sup- plying sufficient current. The supply's nomi- nal output voltage should correspond with the battery’s nominal voltage* The SMPS we used here exhibited a certain degree of ‘ hunting 1 if we tried to adjust the output to less than 9.5 V. This condition is not danger- ous but caused the LED to pulse. The add- on controller board described here is suit- able for use with SMPSs with outputs In the range from 8 V to 20 V. To use the fast charger for any voltage other than 1 2 V it will be necessary to change the value of the voltage divider formed by RIO and R 1 1 . In addition some constants defined in the firmware need changing. This last part is easy; the source code is well documented and written in BASCOJVL Thanks to the pro- gram size it is possible to recompile the software using the size- restricted free demo version of the BA 5 COM environment* The fast charger is also suitable for use with 4 Ah LiPo cells popular with model builders. With a charge current of 4 A = 1 Cthe LiPo cells will be fully charged in a little over an hour* Table 4 gives values for each mode of the charging process. (090858} Internet Links i 1 ) www.elektor.com/090248 [ 2 www. e I e ktor. d e / w 1 1 eel fe- forum | 4 j www.falrchildsemi.com/ds/ TL% 2 FTL 431 .pdf [ 5 j www.elektor, com /0908 5 8 [6 ] www. a -brig h t com , t w/ f u I Iclamp/AL- 513 RGBW-A-Q 04 .pdf [ 7 1 www, elektor.com/090582 [ 8 ] www .miniatur-wunderland.de [ 9 ] www.gerold-online.de/cms 04-2010 elektor Guests in the tab February was chilly but we were pleased to extend a warm wel- come to some visitors who dropped by to see us, Remco Krul of National Instruments brought the latest release of Multisim with him (see News; www.ni.com/inultisim). Our February article 'Blinded by the Light 1 also prompted a visit from Gerard Grashof of Fluke (www.fluke.com). Armed with a '434 Power Quality Ana- lyzer 1 he was able to give us more insights into power factor meas- urement of LED lamps. More on this in our next edition! Rob Staals (photo) of JTAG Technologies (www.jtag.com) was spreading bly testing. In V the old days M V’ | llfflfj "V g W ' an assem- ) ? ,11 bled PCB was ? tested in a fixture using a ^ to contact - ity of today's multi-layer boards using hlgh-density LGA and BGA chip outlines means that some signals cannot be probed. This is a real headache for board testers. The answer is boundary scanning. In essence each signal pin of each chip has a dual function; In test mode they are configured as a cell in a ‘boundary scan' shift register passing through every chip on the PCB. Test patterns can be shifted into place and latched into the chips to generate outputs. Individual PCB tracks can be tested and shorted/open circuits pads identi- fied. After testing, all the chips revert to normal mode and the test circuitry effectively becomes invisible. In addition to the register cells the manufacturers need four extra pins on each 1C for control and passage of the serial data. Most manufacturers (but not all) now offer JTAG interface capability option for their chips, Rob’s Company supplies the fixtures and software for boundary scan board testing. With the circuit net list the software automatically tests all connections. Memory modules can be tested by simulat- ing the signals of a boundary-scan enabled microcontroller. Corrosion fighter spray by Jens Nickel Last month we took a look at the problem of dusty pots and wafer switches. This provoked an email from a long time Eiektor reader (from issue 1 1) praising the article he went on to outline a problem he had himself. A tele- phone socket fitted In the wall of an outdoor enclosure often had a layer of condensation on the plastic faceplate. Despite a good level of ventilation, over the years the humidity has resulted in leakage currents and oxidation of the plug contacts, corrosion of the conducting tracks, terminal block and to some extent the incoming telephone wire pair. His question is how can he rectify the prob- lem? Should the telephone outlet and plug assembly be covered with a layer of non-con- ducting silicon grease or petroleum jelly? Or would a dose of 'Kontakt 61 T contact coating do the trick? We hesitate to recommend either of these options; besides the mess there is a very real chance that the plug contacts will get smeared with grease when the phone is unplugged and poor/intermittent contact will add to the problem. 5 k ht mnS Scfiulz gcgen Ntte**: WET.PROTECT !ilr aMe A fairly recent development of a spray coating is Ideally suited to this situation. The company at www.wet-protect.com advertises a range of sprays which claim to protect electrical cir- cuits from the effects of water ingress and condensation. The spray leaves a permanent water repellent protective film over the sur- face. A promotional video shows a treated hair dryer operating under water! (Don’t try this WET PROTECT one at home). Similar products may be avail- able from other suppliers, let us know which ones you’ve found to actually work — highest odds among products for model building and ship repair. In the meantime Graupner distrib- ute rebadged cans of WET. PROTECT. Graupner products are stocked by model shops through- out the world. eiektor 04-3010 ELabslnside@Elektor * Got a question for the designer of an Eiektor circuit? * Any contributions or comments on the E-Labs Inside stones? ■ Suggestions of boards or electronic software that you think would be interesting to review? * Discovered anything new that you want to tell us about? Don't hesitate; we look forward to your feedback sent to elabsinside@elektor.com, please include [e-labsj in the subject line. LT) GG < UJ E-LABS INSIDE making the dsPIC board By Jens Nickel project in its own right Elektor developer Daniel Rodrigues got down to work on the project We usually receive many more projects than we have space to print. So first we make a preliminary selection at an editorial meeting, bringing together both editors and lab technicians. This whittles the total down to about ten high-quality projects every month. These go on the ‘waiting fist" of interesting cir- cuits , which forms the basis on which the individual editions of Elektor are planned, taking into account the Publishing Plan, The editorial meeting takes place about four months ahead of the planned publication date for the magazine, and projects that make it this far then go off to the labs. It starts with a prototype A printed circuit board is not essential for a project, but does make it much more attractive. An assembled and function- ing printed circuit board from the author gives us confidence that the project can be made to work, but nevertheless we reroute all boards in our labs in order to comply with our house style and to generate component mounting plans. Usually our in-house developer will ask the author(s) to send in his pro- totype, and in this case it was not long before Daniel had a O 0 0 P O O O olSO d O 0 p p p ^ o -o o o o o o Q P O o C' o o o o o a -o *a Ti L 'Mn ■ ■ filler The 'dsPIC board', a processor hoard with a range of interfaces, was originally conceived by two authors from the French-speak- ing part of Switzerland, and so communications were handled by the staff of Elektor’s French edition. We had not previously used the dsPOO, a powerful PtC-family microcontroller with rather impressive processor board on his bench {see photo). The authors also sent in their CAD files, by good fortune pre- pared using Altium Designer, the same package as we use in our labs. We can also accept Eagle PCB and schematic files, as well as Ultiboard or Multisim files. DSP functions. The authors had already designed a printed cir- cuit board, developed a few working example applications, and produced comprehensive documentation. The editorial meet- ing approved the project without hesitation. A few months passed before publication plans crystallised for this compact board. During that time the authors, working at the celebrated Ecole Poly technique in Lausanne, sent us updates and extensions to his project, including an elegant expansion After a quick scan of the circuit diagram Daniel started to check the availability of the components used. If a component seems hard to obtain we will try to find a more readily-available sub- stitute, although this is not always possible in the case of some special-purpose devices. In the case of the dsPIC board Daniel had little cause for concern: “I changed the fuses," he reports, “because holders for the fuses the author had used were not hoard for controlling a solar heating installation. This made the project a perfect fit for the May 2010 issue, whose theme was to be 'green electronics’ (see Publishing Plan at www.elektor, com). At the planning meeting for that issue, at the beginning of January, the team quickly came to the conclusion that we should publish the two circuit boards as two separate articles, since the processor board might be interesting to readers as a easy to find.” To bring the design into line with our standards, SMDs in an 0603 package were replaced by 0805 types. This makes the project a little easier for constructors. “In some cir- cuits we have to replace everything: voltage regulator, micro- controller, display, the lot," says Daniel When substituting components, there are often also corresponding changes to be made to firmware as well 44 04-2010 elektor Once Daniel has put together the parts list for the board, he passes it to Jan Visser in the next-door office, jan knows the catalogues of mail order giants such as Farnell, Conrad Elec- tronics and DigiKey backwards: "it usually takes three days to a week to get all the parts in/' he explains. Of course our lab also boasts an extensive stock of standard SMD and in particular leaded components. We also keep about forty different types of microcontroller, and the Elektor Shop sells a wide range of pre-programmed devices. The Eiektor PCB Meanwhile, Daniel has been working on the printed circuit board. Since Altium CAD files had already been prepared, the work was quicker than usual. First the components are posi- tioned on the blank board, using the footprints provided by the author. Tve tried to keep roughly to the component placements the author used,"' Daniel says. For our double-sided board lay- out we made sure all connectors were mounted on the same side of the board. As can be seen from the screenshots (author's layout on the left, ours on the right) we have also removed alf the 90 ° corners from the tracks, replacing them with 45 ° turns. For the original layout the author had made vias using the leads of components — common practice for prototypes but not suit- able for professional manufacture. So these were changed, and then finally the dimensions of the board (already a little larger than the original) were rounded up to a whole number of centi- metres. We don't often work to standard sizes such as the Euro- card format unless the requirements of a particular enclosure dictate otherwise. The finished board design is then sent for manufacture to our partners Eurocircuits, just across the border in Mechelen, Bel- gium, This gives a little time for our engineers to work on other projects before components and circuit board come together in the lab. By the middle of February there area good dozen cir- cuits in the pipeline for the summer double issue. Daniel is making progress with the second board, and has some questions for the authors. In particular he is concerned about the type of flow sensor the author is using in his solar installa- tion. Fie has also noticed an oddball connector used to supply power to the temperature sensors. To the author for testing As soon as the two boards have been made and populated they undergo a range of tests. “'For this project we just checked for shorts and other obvious problems/ 1 Daniel explains. For func- tional testing the board is sent to the authors, who can try it out in conjunction with the other expansion boards they made, They can also replace the boards in their solar installation with our versions fora practical test “Doing those tests here would have been difficult," Daniel remarks, "because we don't have the necessary sensors and magnetic valves to hand,” He also notes that authors will often have much more experience and skill in using special-purpose devices like the dsPIC microcontroller, pointing out that it would take a long time just to write suitable test routines to exercise all the pins and interfaces on the microcontroller, What tf the authors find that Elektor board doesn't work? Daniel grins, “Then we just have to work quickly/' Like time and tide, publication deadlines wait for no man. Find out what happens in the next instalment! (091079) We receive a steady stream of questions from readers who have designed interesting circuits. How do we decide which projects make it into the magazine? What do we require from the author? Flow is the work divided between author and the Elektor labs? Here we complement our 'Author Guidelines' (which can be found tucked away on our website under 'Service') with our 'Making of E-Labs Inside pages. elektor 04-2010 45 E-LABS INSIDE Meter under test By Jens Nickel Back in January we mentioned that we were working on the design of a newC0 2 meter. This one is specifically designed for use in cars where the confined space can quickly lead to a build up of C0 2 concentration in the air. Its effects are well known: headache* sickness and poor concentration. We chose a C0 2 sensor which uses the principle of infrared absorption. The alternative is a laboratory-grade cell but these are not so practical; they require a couple of hours before pro- ducing an offset-corrected measurement. The sensor used for this design is ready to go within one minute* true to the plug'n'play philosophy we can just plug the C0 2 meter in (to It's a tough job..* One cold February morning we assembled in the car park* we would be using my (aging) VW Golf to put the C0 2 meter through its paces. The plan was a short journey through the countryside and then around 20 miles of motorway driving. Before starting we calibrated the meter using some local fresh air to give a reading of 400 ppm. In the first few miles we switched the car ventilation system to recycle so that no fresh air would be drawn in. As expected the meter reading began to rise* after just five minutes it had already exceeded 1 000 ppm and was still rising steeply. At eight minutes we had reached 1 740 ppm but the rise was now less steep (we guessed this was probably due to air leakage around the door seals). At this level you don't need a meter to tell you that the C0 2 concentration is high* you are increasingly aware of the stuffy* fuggy atmosphere and feel a growing urge to open a window. After another ten minutes the C0 2 level had plateaued at around 1900 ppm* again we guessed that leakage around the doors had achieved equilibrium with the expelled CO z . 1 900 ppm is a surprisingly high reading after just 1 5 min- utes driving. Prototype*** The sensor is produced by ZyAura of Taiwan, It features a high level of integration including an SPI interface* This allowed us to get the first prototype up and running relatively quickly. The module repeatedly sends data packets over this interface indi- cating the C0 2 concentration and air temperature. Alf that's necessary is a microcontroller (e,g. an ATmega) to extract and display the data, A small alphanumeric display using HD4478Q compatible commands is all that's necessary for display pur- poses. Chris Vossen was able to produce the necessary firmware relatively quickly using pre-programmed software building blocks {in the form of C functions). From the hardware point of view the prototype only needed a small square of prototyp- ing board, a couple of chips for the power supply and a suit- able enclosure (not forgetting ventilation holes to allow for air circulation). .,.but someone has to do it We were all feeling uncomfortable so everyone was in agree- ment with the next stage of the test... we needed air. We switched the ventilation controls to draw in fresh air and turned the fan on. Depending on the fan setting we recorded readings between 1 1 00 and a more bearable S00 ppm. For the last part of the test we would really be stretching our powers of endurance to the limit; travelling at 70 mph with an outside temperature hovering around zero centigrade we switched the ventilation fan to maximum and wound down the windows. The C0 2 concentration quickly dropped to just over 600 ppm. Result: The sensor has a really fast reaction time and its good resolution means that you quickly get an indication whet her C0 2 concentration is stable* decreasing or increasing. This informa- tion can be critical when several people are gathered together in a confined space. The head of our lab Antoine Authier had also discovered that you don't need a full car to get high levels of C0 2 ; he had recorded in-car levels of 1 300 ppm and above during his dally 50 minute commute through rush hour traffic. This little box of tricks is going to be very useful, If alt goes well we will reveal all in the May 2010 edition of Elektor, (ogogSi) ... and test Once we had the prototype sorted it was dear that we would need to devise a rigorous and punishing series of trials to fully test the design (would you expect any less?). We had previously made preliminary lab tests on the circuit and our chief designer Antoine Authier had already tested the meter in his own car. The time was now right to make a more system- atic trial using a real-world test environment; I went in search for some willing lab rats.,. By the end of the day I had assembled our team; Chris volun- teered to shout out the readings f rom the passenger seat* Anto- ine would make notes and our graphic designer Mart Schroijen wou Id be responsible for ta kl ng some photos. 46 04-2010 elektor QUASAR electronics tog fteefronfc Kft Specialist $/nee 1993 Quasar Electronics Limited PO Box 6935, Bishops Slortford CM 23 4WP, United Kingdom Tel: 01279 467799 Fax: 01279 267799 E-mail: sales@quasarelectrontcs.com Web: www.quasarelectronics.com Postage & Packing Options (Up to 0 5Kg gross weight): UK Standard 3-7 Day Delivery - £4 95: UK Mainland Next Day Delivery - £9 95 Europe (EU) - £8.95; Rest of World - £12.95 (up to 0 5Kg) I Order online for reduced price UK Postage! We accept all major credit/debit cards. Make cheque s/PO's payabfe to Quasar Electronics. Prices include 15.9% VAT. Please visit our online shop now for details of over 500 kits, projects, modmes end publications Discounts for butk quantities. 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 l Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vdc 5. 6 or 8-lead unipolar stepper motor rated up to 6 Amps. Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode for CMC use. Connect up to six 3179 driver boards to a single parallel port. Board supply: 9Vdc. PCB: 8Gx5Qmm. Kit Order Code: 31 79KT - £1 5.95 Assembled Order Code: AS31 79 - £22.95 Computer Controlled Bi-Polar Stepper Motor Driver Drive any 5-50Vdc. 5 Amp bi-pofar stepper motor us- ing externally supplied 5V levels for STEP and DI- RE CTI OIM control. Opto- isolated inputs make it ideal for CNC applica- tions using a PC running suitable software. Board supply; 8-30Vdc. PCB; 75x85mm, Kit Order Code: 3158KT - £23,95 Assembled Order Code; AS3158 - £33*95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to |T 32Vdc, IGA) in both the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer, Screw terminal block for connections. Kit Order Code: 3166v2KT - £22.95 Assembled Order Code: AS3166v2 - £32,95 DC Motor Speed Controller (100W7.5A) Control the speed of I I almost any common DC motor rated up to 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-l5Vdc. Box supplied. Dimensions (mm): 60Wxl00Lx60H. Kit Order Code: 3Q67KT - £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- channe! relay board. 5A mains rated relay outputs, 4 isolated digital inputs. Useful in a variety of control and ^sensing applications. Con- trolled via serial port for programming (using our new Windows interface, terminal emula- tor or batch files). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 31Q8KT - £64.95 Assembled Order Code: AS31Q8 - £79.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. a C or °F. Continuously logs up to 4 separate sensors located _ 200m+ from board. Wide range of tree software applications for stor- ing/using data. PCB just 45x4 5mm. Powered by PC includes one DS1820 sensor. Kit 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-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx's can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately), 4 indicator LED 's. Rx: PCB 77x85mm, 12Vdc/GmA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £49,95 Assembled Order Code; AS318G - £59.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTIVTF phone from anywhere in the world and re- in otel y turn on /off a ny " 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 10x3Qmm. Power: 12Vdc, Kit Order Code: 3140KT - £74,95 Assembled Order Code: AS3140 - £89.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m + range. 112x122mm, Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £59.95 Assembled Order Code: AS3142 - £69.95 New! 4-Channel Serial Port Temperature Monitor & Controller Relay Board 4 channel computer serial port temperature monitor and relay con- troller with four inputs for Dallas DS18S20 or DS18B20 digital ther- mometer sensors (£3.95 each). Four 5 A rated relay channels provide output control. Relays are independent of sensor channels, allowing flexibility to setup the linkage in any way you choose. Commands for reading temperature and relay control sent via the RS232 interface using simple text strings. Control using a simple terminal / oomms program (Windows HyperTerminal) or our free Windows application software. Kit Order Code: 3190KT - £69.95 PIC & ATMEL Programmers We have a wide range of low cost PIC and ATMEL Programmers. Complete range and documentation available from our web site. Programmer Accessories: 40-pin Wide ZIF socket (ZIF4GW) £14.95 ISVdc Power supply (PSU120) £19.95 Leads: Serial (LDC441) £3,95 / USB (LD0644) £2.95 USB & Serial Port PIC Programmer USB/$erial connection. Header cable for ICSP. Free Windows XP software. Wide range of supported PICs - see website for complete listing. ZIF Socket/USB lead not included. Supply; 16-1 8Vdc. Kit Order Code: 3149EKT - £49.95 Assembled Order Code: AS3149E - £59.95 USB All-Flash' PIC Programmer USB PIC programmer for ail 'Flash' devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included. Assembled Order Code: AS3128 - £49.95 See website for full range of PIC & ATMEL Programmers and development tools. No.1 a KITS Secure Online Ordering Facilities * Full Product Listing, Descriptions & Photos • Kit Documentation & Software Downloads MICROCONTROLLERS By Wolfgang Rudolph and Dr DetievTtetje (Germany) Minimodi8 is a very compact general-purpose microcontroller module. It includes frequently requiied peripheral components, such as pushbuttons and an LC display, as well as several interfaces (USB, PC and ISP/SPI), You only have to assemble the peripheral circuitry necessary for your specific application and connect it to the Minimoch8. This way you can build a complete device with entry and display capability in almost no time. This tiny microprocessor module immedi- ately invites comparison /The KIM-1 compu- ter Id was a sensation when it was launched in 1976. For US$245, you got a real compu- ter with a 6502 microprocessor running at a 1-MHz clock rate. Of course, the KIM was supplied 'naked': no case, no power supply, and no interfaces {see Figure 1), Neverthe- less, the first boards cost around £1 50 at that time and were hard to come by almost everywhere outside of the USA. In terms of processing power, the Mini- modlS is leagues ahead of the KIM. Although the Minimod 1 3 lacks some of the features of the distant ancestor of today’s PCs, such as the system monitor program and an abundance of I/O ports, it offers many excellent technical features and is distinctly more compact than the KIM-1. The inset provides a brief summary of the integrated features, including pushbuttons, an LC display, a 64-KB EEPROM, and three interfaces: USB, PC and ISP/SPI. Integrated boot loader The Minimod 18 board measures 80 by 25 millimetres (Figure 2), which makes it only half as large as the already pleas- antly small ATM 18 board. It is fitted with an ATmega328P-AU microcontroller in a TQFP32 package The only essential dif- ference between this microcontroller and the ATmegaSS is its considerably more gen- erous memory capacity, so it is fully com- patible with our AT Ml 8 projects. This also allows us to sacrifice a bit of the flash mem- ory space for an integrated boot loader. A boot loader is a small program located at the top of flash memory. If the microcon- troller is configured appropriately, it starts this program first. After starting up, the boot loader can establish a link to an exter- nal device, receive data, and store the data in flash memory orEEPROM. This eliminates the need for accessory hardware in the form of a programmer. The Minimod 18, which 48 04-2010 elektor MICROCONTROLLERS can be ordered from the Eiektor Shop, comes pre-programmed with an adapted version of USBaspLoader, This means that newcomers no longer have to procure addi- tional programming hardware. USBaspLoader emulates the very popular and widely used USBasp programmer UI and is thus compatible with a large number of PC programs, including the widely used program AVR-Dude, which is conveniently included with the GCC compiler (WinAVR), Alt you need is a USB cable, since the Mini- modi 8 has a built-in USB port. The USB port is connected to the same pins as the 'Passepartout' project featured in Eiektor March 2010, Just like it, the MinimodlS board is powered directly from the USB port. If you hold the left button pressed while applying power to the board (plugging in the USB cable), the Minimodi 8 enters pro- gramming mode and can write data to the flash memory and internal EEPRGM. You have to launch AVR-Dude for this purpose. For example: to copy the contents of the file ‘hello. hex 1 to flash memory, enter 'avrdude -c usbasp -p m328p -U fIash;w;heflo,hex* in the command line (see Figure 3), Press the right button to exit programming mode and Features Microcontroller: * Atm el ATmega328P-AU AVR RISC microcontroller * 32 KB flash memory * 1 KB EE PROM * 2 KB RAM * SADCinputs * 3 timers and 6 PWM channels * 20 MHz dock * IK, 5PI, and U5ART interfaces * Supply voltage 1 .8-5.5 V Board: ■ USB socket - Power supply over USB possible ■ 16 MHz crystal * 64 KB EEPRDM with \K interface ■ EADIP5Q82-HNLED LCD module {2x8 alphanumeric with LED backlight) * Contrast adjustment trim pot ■ 2 buttons * Connector for SPi/ISP * Connector for \ 2 C and ADC Figure 1. KIM-1 was one of the first hobby computers that did not require any soldering by the user (photo: University of Stuttgart [7]). COMPONENT LIST Resistors R1 ,R2,R5 = 2.2kQ (0603) R3,R4 = 680 (0603) R6 = l Oka (0603) PI = 10kH Trimmer (TC33) Capacitors (0603) C1,C2 = 22pF C3-C6 - lOOnF Inductors LI =10 pH (0603) Semiconductors Dl,D2^3.6V(SOT23) IC1 = AT24C5 1 2 (SQ-08M) !C2 - ATmega328-AU (TQFP32-08), program- med, Eiektor order# 090773-41 Miscellaneous LCD = E AD I PS O 8 2- H N LE D K1 - 1-pin pin header, right angled l<2 = USB-B socket K3 = 6-pin pinheader, angled 51 ,S2 = PCB mount pushbutton XI = 1 6 MHz quar tz cry- stal (ABM3) PCB. order #080950-1 from Eiektor Shop or ready populated and tested module with preinstalled bootloa- der, Eiektor Shop or- der# 090773-91* Figure 2. The compact PCB can easily be fitted in your own equipment. eiektor 04-2010 49 MICROCONTROLLERS 1 iiTE^tjeaiUf fa rder un^ " * C S xfro tauten te iind Elnetc 1) nn gn n \T ie i j«n x E igcnc !>.* t n 1 r n^M iti i mo AtS >*w nl< c «’■: W ]i - p n32$p II I lnirh:w:kHci -Iiex ALUMlurte : AUK de«i-« Initialised Ami I'oartv to ,icceirt msiii'uet itrns Beading e miiiiuiiiiUKinoiJiiiJiEiniitttiMiiiittuttiiuUMiJifliui^naiinHmiurtinutiittii i 1 B 0 * u.to* Avriludi : Deu ice sjgjimup* c BxlP^jDf ..mi’ctcciit: MOTE- FL.0RH ni'mtrv >IAC been ^lsrif icil. Ail Clause H:yx Je UJ.II be perfumed Jn ilhiblt tl»ir: lealufr. -Slice if y the 6 option, dii rdude : e pas iri>r e h i y A^rdudc : ruArilnji iiviiut file ’"lie 1 1-u . kni^ „i v urie = inpu t file ha 1 la , he * #«it c d© U?i r 1 4td *■ 1 n t n I II u * dv i-dmlc : w i* it int f la e h < 5$ H hy t e s > : Uritin? ; d n tl m I i I • i ill I P i] P IE tl INI nu H » INI II 1 IU 31 11 U U n u Li □ In ti d n tr mi: It Lk It II U U INI ll Tl I l«fl* «- 14 e uvrcUirte ; I. 5 B bytfir. □! (Util ye it ten ivrrtudd - uerifying t La e h msp* r y * n-; t hr l In- hi- -. vrdultn : in. tA rtatii t lasll date Fetid iriimT i 1 1«- Itelln.ltex: vrdyde : inpu 1 lilp hallo. Imex Ante detected A 3 intel lick urduile : input File liellra.lwx contains r i 5 (l byte-. lAvrdudc l ff >:il i ng uri chip fl-.tr.li d,i l a : iReatling J I 106, It-HV: iVJ l L d.u d.c : u >• i‘ i f v i ! J !J - - - jiurrtEtd c - B 5 B bytes of f Irtsh siei- if sir d imrrtLLilp t mf Emmie i S‘i*st. Lr Oli nurdiiilE iIufie . 1 li.iriK (mu . Figure 3. The microcontroller can be programmed in practically no time with the free AVR-Dude PC program. Figure 4. The alphanumeric display module has LED backlighting. start the application program (the down- loaded program). This is all you need in most cases. However, the system does not atlow you to change the fuse settings (which control the baste operation of the microcon- troller) in programming mode. This is actu- ally an advantage for novices, since it's pos- sible to make costly mistakes with the fuse settings. Under certain conditions, you can even render the Minimodi 8 totally unpro- g ram triable. 8y contrast, nothing can go wrong when you use the boot loader. if direct programming is nevertheless nec- essary for some reason, such as replacing the boot loader with a new version, you will have to use an external programmer. It can be connected to six-way connector K3. Before you do this, you must alter the configuration of the solder bridge on the back of the board to make the Reset pin available in place of the Slave Select (SS) pin and transform the SPI interface into an ISP interface. This gives you full control over the configuration and programming of the microcontroller. Display A DIPS0B2-HNLED module from Electronic Assembly HI is used for the display. This is a very high-contrast, backlit module with two lines of eight characters each (Figure 4). Unlike the two-wire LCD module of the ATM 1 8 board, it is connected in the conven- tional manner with a 4-hlt bus, which allows the optimised library functions of BASCOM or corresponding modules for other compil- ers can be used. This only requires adjusting the pin assignments. The same holds true for programs written for the ATM1 8 board If you want to run them on the Minimodi 8 board. On the Minimodi 8 board, PD4-PD7 and PCI -PC3 are used for the Enable, R/W and RS signals (see the schematic diagram in Figure 5). The display contrast can be adjusted using trim pot PI . USB interface As already mentioned, the USB-B port can also be used to power the Mini-modi 8 board. The port circuitry follows the rec- ommendations of the V-USB project HI in order to allows USB driver 'USB Jreiber' to be used. This driver is also used for the boot loader. The Minimodi 8 board Is also very suitable for implementing many other applications that simulate a USB device in software, such as a PC keyboard or other device. The module can be powered either via the USB port or via pin 2 of SPI/1SP connector K3. The module draws around 60 mA, most of which us used to backlight the LC display. If you use the Minimodi 8 board without a PC, it can be powered from a 5-V AC mains adapter with a USB connector. These AC adapters are available at very reasonable prices. Other interfaces A standard SPI interface, which is supported by the Atmel hardware, is provided for driv- ing external peripherals. You can alter the configuration of solder jumper]! to convert it to a programming Interface (ISP port). The pins can also be used individually for digital I/O signals. Pins PB3, PB4 and PBS are con- nected to pins 4, 1 and 3 of connector K3, The three A/D converter inputs (ADC6, ADC7 and ADCO/PCQ) are available on pins 3, 4 and 5 of connector K1 . This gives the Mini mod 1 S access to the worl d of ana logue electronics. A PWM output of the microcon- troller (PD3) is also available on pin 6 of con- nector K1 Jt can alternatively be used as an interrupt input {INTI ). The connectors can be used independently (one 6-way and one 10-way) for connect- 5 ° 04-2010 elektor MICROCONTROLLERS f LCDt ^ \ EADIPSQ82-HNLED J QQOQQQQQ 090773 11 f igure 5. Various ATmega microcontroller signals are available via connectors. Eng your own peripheral circuitry using flat cables. However, it is also possible to fit the additional hardware on a single PCS with a 2- row by 10-way socket header, which can be mated directly with the MinimodlS board. The AREF input, which supports the use of an external voltage reference, Is also fed out to pin 1 of connector K1, There is no jumper for connecting the reference volt- age line to V cc as on the ATM 18 board, since the ATmega has internal capability for using the supply voltage (AVCC) as the reference voltage. The Minimodi 8 board has two pushbutton switches (SI and S2) that use the Internal pull-up resistors of the ATmega microcon- troller, SI (left) Is connected to PB1 . while S2 (right) is connected to PBG. The 64-KB onboard EEPROM (IC1 ) provides sufficient storage space for using the Mini- modi 8 as a data logger, among other pos- sibilities. The 24C51 2 EEPROM is connected over an PC bus and can be accessed directly from BASCOM. With GCC, you can simply use the included PC library. The entire circuit design corresponds to Atmel's recommendations. An external 1 6- MHz crystal is provided for dock generation, a 1 Q-kn pull-up resistor is connected to the Reset input, and a 100-nF film capacitor is provided for supply decoupling. The AREF input also has an external 1 00-nF film capac- itor. and AVCC is decoupled from the V cc rail by a 10-pH inductor and a film capacitor. The first program The controller in the LCD module is com- patible with the widely used HD44780 con- troller, The Internet offers C programmers a variety of libraries for driving LCD mod- ules, which only require configuring the right pin assignments. For maximum com- patibility, the R/W input of the LCD mod- ule is connected to PC3. This allows polling of the controller’s Busy flag, which many libraries in fact do. However, BASCOM does not make any use of this input; instead, It assumes that this pin is tied to ground. Con- elektor 04-2010 Si MICROCONTROLLERS 'Hello World" listing $regf ile - „m328pdef . dat " $crystal ” 16000000 $baud - 19200 Shwstack = 32 $swstack = 10 $framesize = 40 $initmicro Config Lcdpin = Pin , Db4 PortdL 6 , Db7 = Portd , 7 Config Led. - 16 * 2 Cls Led „Hello" Loweriine Led „ World" End initmicro : Ddrc .3=1 Porte, 3 - 0 Return 1 specify the used micro ' used crystal frequency ' use baud rate ' default use 32 for the 'hardware stack 1 default use 10 for the 'SW stack 1 default use 40 for the ' frame space 1 run subroutine _init_miero Portd . 4 , Db5 = Portd. 5 , Db6 E = Porte. 1 , Rs = Parte. 2 'configure led screen, '8*2 not available 'end program 'LCD i R/W low ATmega microcontroller pin utilisation PB0&PB1: Buttons 1 & 2 PB2-PB5: ISP/SPI interface PC0: ADG0 / digital I/O PCI; LCD E PC2: LCD RS PC3: LCD RW PC 4 & PCS ; PC I n ter face (external EEPRGM) PCS: Reset PD0“PD2: US8/RS232 interface PD3: PWM/INT1 /digital I/O PD4-PD7: LCD D4-D7 AVCC. AREF t ADC6, and ACD7 are used for A/D conversion sequently, it is necessary to pull PC3 low before starting to configure the LCD mod- ule. This is done by l $initmicro' in BASCQM. The example program shown in the L Hetlo World 1 listing illustrates how to access the LC display with BASCOM. This program can be downloaded from the project page for this article [6]. W hat’s next? This general-purpose miniature module is a perfect starting point for developing your own applications. All you have to do is assemble your own circuit on a bit of pro- totyping board, download your program code to the Minimodi 8 via the USB port, and then mate the boards. Now you 1 re ready to go! However, we aren’t leaving you entirely on your own. Two applications for the Mini- modi 8 are already underdevelopment, and they should be published in Elektor the near future. One is a general-purpose battery charger that only requires assembling the power circuitry on another PCB. The other is a weather station with a data logger and wireless sensors. Here the Minimodi 8 can also show the acquired data on the display. On top of this, you can run most of the pre- viously published ATM 1 8 projects on the Minimodl 8 board. This usually requires only minor adaptations to accommodate the hardware differences (available pins and LCD module drive). Incidentally, we don’t plan to toss the ATM 18 board on the scrap heap. We will continue to use it in future projects, (090773-I) Internet Links |1 j http://en.wikipedia.ofg/wiki/KIM-1 [2] www.atmeLcom/dyn/resources/prod_documents/8 161S.pdf [3 1 www.obdev.at/products/vusb/usbasploader.html 1 4] http://www.lcd-module,com/eng/pdf/doma/dips082e.pdf [5] http: / / vus b . wi k i dot xo m [6] http://www.elektor.com/090773 1 7 j http: //com pu termuseu m.in format! k.u nLstuttgart.de 04-2010 elektor 52 TO DISCOVER The upgraded Elektor-PLUS subscription! o All 1 1 issues including the Summer Circuits edition O Included in your PLUS subscription: Annual DVD 2010 O 20% cheaper than normal retail price o Welcome gift worth £25 o Up to 40% discount on selected Elektor products o Elektor is delivered to your doorstep every month O Read your copy before everyone else O NEW: On your personalized Elektor 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 wwW .eleKtor-p' us - com When taking out an Elektor PLUS subscription you get exclusive access to wwvwelektor-ptusxom where the three latest editions of Elektor magazine are available in the form of pdf files fix. 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.elektor-plusxom aiso 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, jjektor Or use the subscription order form near the end of the magazine. AUTOMOTIVE ELECTRONICS Bluetooth for OBD-2 By Folker Stange and Erwin Reuss (Germany) The hand-held OBD Analyser NG Featured in the September 2009 edition of Elektor has an open-source operating system and a built-in expansion port. Both enable a Bluetooth module to be integrated with ease. Now at the other end of an RF link you can view engine parameters and faults on a netbook or notebook PC! The OBD Analyser NG Ml diagnostics tool uses an AT90CAN1 28 controller with 1 28 KB flash memory- This is more than enough for hand-held use but if you were planning to implement a trouble-code database you would soon start to feel that memory space was becoming a little cramped- Likewise its simple display is ideal for quick diagno- sis of simple problems but does not allow more complex graphical representations of sensor readings. Nowadays the majority of netbook or notebook computers come equipped with a Bluetooth interface and 54 04-2010 elektor if yours does not have one a low-cost Bluetooth dongle can easily be added. With this in mind, what's to stop us from adding a Bluetooth Interface to the popular OBD analyser NG and (with the right software) turning it into a far more useful and sophisticated engine dataanalyser? The Bluetooth module The BTM-222 module is the central player in the expansion of the OBD analyser NG- Regular readers will rec- ognise It from the role it played as an add- on to our ATM18 microcontroller board described in the December 2009 edition of Elektor. In its application here the Blue- tooth module and decoupling capacitors are mounted onto a small carrier board soldered to the analyser’s expansion port using pinheader strips. Printing the quar- ter-wave antenna directly on to the PCB simplifies construction and assembly of the expansion board Into the case of the OBD analyser. The BTM-222 is a class 1 type of mod- AUTOMOTIVE ELECTRONICS Figure 1 . The complete Bluetooth expansion circuit requires little more than the BTM-222 Bluetooth module and a voltage regulator. Table 1 . Bluetooth Class vs, range Class Max, Power JmW] Max, Power |dBm] Range (unobstructed) [m] Class 1 1 100 20 approx, 100 Class 2 2.5 4 approx. 50 Class 3 ' 1 0 approx. 1 0 Features • Bluetooth Class i (range up to 100 m) * Antenna printed on the PCB * RF data rate of 19200 Baud • Low cost Bluetooth module - 28 mm x 38 mm PCB , ule which specifies a maximum transmit- ter power of 100 mW (20 dBm}, giving a range of a rou nd 1 00 m (300 ft) . I n order to achieve an RF link over this distance it is nec- essary for the Bluetooth transceiver in the notebook or netbook to also be Class 1 . A Class 2 or 3 module wifi result in a reduced operating range (see Table 1)* If your PC has low-power or no Bluetooth capability then a Bluetooth USB stick (make sure it's Class 1} can be added at very little cost. The circuit and construction The circuit (Figure 1 ) consists of just a Blue- tooth RF module (IC1 ) } a voltage regulator (1C2) and two rows of pinheaders (jl and J2). IC2 converts the 5 V supply to 3,3 V required by the Bluetooth module. The pinheaders carry the 5 V supply and three control sig- nals, Port pin PF5 from the analyser's micro- controller is used here to switch the power regulator on the BTM-222 under software control, PF6 and PF7 carry the serial data communication between the BTM222 and a software DART in the OBD analyser. Assembling the expansion board and fit- ting it to the analyser is relatively simple. The PCB (Figure 2} is supplied with the voltage regulator and supply decoupling capacitors already fitted so It Is only nec- essary to mount the BTM-222, Do this in the same way that you would solder a large SMD 1C but just solder the Rx 3 Tx, antenna, supply voltage and ground pins to their PCB pads, just five pins of the Q8D ana- lyser's expansion port are required by the expansion module (see photos). All of the 20 pins however pass through the expan- sion board (Figure 3) to facilitate any future developments. Get your motor running Before we can begin communications with the Bluetooth module we need to check that the OBD analyser NG is running the latest firmware version (available from the Elektor website 1 2 I). The firmware support- ing Bluetooth operation is the file named HandheldOpen_121 in the zipped folder 09091 8-1 1, This latest firmware version has been shipped with the OBD analyser NG kit Capacitors C1,C2 = IjxFSMD Semiconductors IC1 = BTM-222 Bluetooth radio module IC2 - TS5205CX 533 (SMD SOT23) Miscellaneous JTJ2 * 10 -pin pinheader Kit of parts, contains partly populated PCB and all components. Elektor Shop # 090918-7 ! . see www.elektor.com / 0909 18 since January 2010. Those of you who took delivery before this date will need an ISP programmer (e.g. either ffi or I 4 1), See the 'Firmware update’ text box for details of how to transfer the latest firmware version to the controller. Figure 2. The Bluetooth PCB uses a length of PCB track as a 'printed 1 antenna. COMPONENT LIST elektor 04-2010 55 AUTOMOTIVE ELECTRONICS Updating the Firmware Check the OBD analyser NC main menu options, if the Bluetooth mode is not available (all versions below build 121} then you need to down- load the latest firmware version from the Elektor Website i 2 l. You will require an ISP programmer with a 10 -pin connector to fit the Atmel AVR controller family of devices (see 1*1 or Ml for example). This is connected to programmer socket SV1 on the component side of the PCS. If the programmer provides a supply voltage on pin 2 of SV1 the analyser should be unplugged from the vehicle's OBD connector for program- ming. In this case fit jumper]3 (behind pin 2 on SV1 }. The downloaded software ZIP folder can now be unpacked to a directory and the soft- ware run. Firmware update will take just a few seconds. nwOvi! * r (On - pi*s™k.r,4i .i: 0 DlO } «3N 3k -ft UupUf- O’tafiHri# JO E.wrthW X i v InMiLjor ’ mart'-f mn 11 CD SO] 1JTO m >n -’Hn ar MC 9 ,-J* M l ,1 it if in, 3u3j,t, t-t L «HkJJWTW«r iMjf i i ¥ PC software for the OBD Analyser NG So far we have dealt with the 0 BD a nalyser NG 's hardware expansion. The only thing missing is diag- nostic software running on the laptop to interpret and display engine data. The moDiag program Nl performs this function and is available as three dif- ferent versions offering increased levels of sophisti- cation. MoDiag is optimised for OBD interfaces us- ing ACV and DIAMEX chip sets and therefore ideally suited for the Elektor OBD analyser NG which uses a DXM module. The program stores sensor readings during transit in Flies with a : \csv extension for later analysis using spread sheet programs such as MS Excel, Bluetooth communication removes the need for any in-car cabling which could potentially distract the driver. Also interesting is the graphical representation of the lambda readings which can be used to identify a worn-out sensor. The ability to combine several sensor readings on the display gives the laptop a big advantage* In contrast the hand held OBD ana- lyser on its own does notallow this flexibility. Similarly a database containing the meanings of all the possible diagnostic trouble codes greatly speeds up fault identification whereas the hand held unit does not have memory space to accommodate this feature. The moDiag 'profes- sional’ version can also map a 3D representation of a combination of sensor data. 3E* 4D tt ii 71 n K m 100 ■1- un^ ■ .J jr—' 1 ’"' j DVrvn JDX.2S El i r **- Using either the moDiag ‘expert 1 or ‘professional’ version allows continuous measurements of engine powder and torque to be displayed as a graph. The current instantaneous value is also shown on the display, The professional version also Includes a special LPC adjustment mode to optimise an engine set up for LPG operation and includes a large library of trouble code meanings. The 'professional' version is useful for ve- hicle workshops and includes functions to optimise LPG engine conversion settings and also has an extensive data base to store documenta- tion, diagnostic reports, data readings and gas conversion details of every customer’s vehicle. The Bluetooth set up procedure described in the text can be simplified by the use of a small assistant in the moDiag program which independ- ently searches for the interface and in most cases avoids the need to use the Windows device manager. moDiag is suitable for PCs running Windows 2G00 r XP. Vista or Windows 7. The standard version of the program is free and available for download from the Elektor website i2 h Matthias Tiehen For operation you will require a Bluetooth- capable Windows notebook or netbook (as described above). The first step is to plug the OBD analyser NIG into the vehicle’s OBD con- necter. Now select the Bluetooth option (Fig- ure 4 ) from the menu on the OBD analyser. When activated the blue backlight tights up* On the notebook Windows will indicate that a new Bluetooth device is available. A serial port should have been found, click on this and then ‘next’. Now enter a passkey. In our case we simply use the sequence 1 1 234' and then press Enter. Windows now activates the newly found Bluetooth device and displays some GOlVl ports. The first “detailed 1 COM-Port is the one which needs to be entered into the application software (OBD software running on the notebook) as the communication port. The application software can be the 'moDlAG 1 DJ software, or similar. 56 04-2010 elektor AUTOMOTIVE ELECTRONICS An automatic scan performed by the applica- tion software will search and confirm that the correct port is identified and listed. Once this com- munication path is correctly configured there is nothing else to prevent us running diagnostics with PC support, ( 09091 S) [ 1 ] www.elektor.com/090451 [2 1 www.elektor.com/090913 [3j www.elektor.com/030161 | 4 ) www.stang e-di st rihution.de (click on the Union Flag) [5], www.modfag.de/engSish/ m oby d i a g_ pro. h t m Figure 3. The PCB comes with the supply decoupling capacitors Figure 4. The latest firmware now has a Bluetooth option, and voltage regulator already mounted. elektor 04-2010 57 HOBBY Fun with Fireflies Grass-roots artificial intelligence By Abraham Vreugdenfiil (The Netherlands) * Communication is happening everywhere around £ us all the time. Between people, computers and also in nature we see communication among creatures. This communication can have many meanings, like indicating a source of food by ants and bees, the search for a suitable partner by other animals, or human beings simply being sociable. It is this communication, between 'fireflies* in particular, thafs being explored here in a fun way and on a shoestring budget. Fireflies flash their lower abdomens in an attempt to attract members of the opposite sex. In the dark these flashing fireflies form a fascinating spectacle. Searching, finding and communicating, that is the object in this case. This has strong similarities with all kinds of electronic applications. But to what extent can we mould this into a concept for an electronic firefly? The direction of the communication between different, small robotics circuits forms the basis of this idea* The objective here is for different robots to seek each other out and to recognise their response. For the sensors we use an infrared transmit- ter and receiver. A ring of eight bi-colour LEDs functions as the visible ‘memory 1 of our ‘Firefly" and indicates in which direction it has recognised a counterpart* The Firefly looks around with the aid of the servo on which it sits. All this is driven by a simple-to- program microcontroller type ATmega88. Operation The main objectives of the Firefly are orien- tation and communication. To do this you have the ability to communicate using an infrared (IR) signal. This is done with the circuit shown in Figure 1 . You use the serial output of the microcontroller, so that you can simply use the print x command in the software program. You then take a separate output of the processor and use It to gener- ate a 36-kHz square wave. You connect the IR transmitter diode between these two outputs. In this way you generate a serial RS-232 signal that Is modulated at 36 kHz. To be able to receive this signal you take a special IR-receiver, type SFH 5110. The spe- cial attribute of this receiver is that it has a 36-kHz filter built in, creating a nice RS- 232 signal that you can connect directly to the serial input of our microcontroller. If you use a somewhat slow communication speed (2400 baud in our case), then you can establish some very effective communica- tions between multiple robots. You can accomplish the orientation if the Firefly is able to look around. To do this, the robot is mounted on a modified servo. A normal servo rotates through an angle of only 270 degrees, but in this circuit a con- tinuously rotating servo Is used (see side- bar ‘Servo modification 1 ). In this way the Firefly can scan its surroundings with the IR-receiver. The first time it recognises a counterpart, a red LED will light up in the direction of where it found this counter- part. After it has been detected a second or third time the relevant bi-colour LED will light up orange and any subsequent detec- tions will result in a green glowing LED* When a counterpart is no longer detected (perhaps because it has turned away), the series reverses, so from green to red and eventually off. When the robot turns, the ring of LEDs on the robot also ‘turns 1 , so that those LEDs pointing in the direction of its counterparts always remain lit. In this case the 8 bi-col- our LEDs are connected in a matrix con- figuration to save I/O pins. Each column is switched by a transistor type BC547. When one of the outputs (PD4 through PD7) is pulled High, then the corresponding transis- tor will co nduct and one or more of the fou r outputs PCO through PC3 are pulled High, so that the corresponding LEDs will light up* A short time later another transistor is turned on allowing 4 other LEDs to come on also. Since this happens quite quickly there 5 * 04-2010 elektor HOBBY *5V 0 Ifil] Servo Tfl"n Tfl! Ifli 0|0| H i!^ ifflev |im Y m UHJtT fttl HI SPfi 1C I ^0 TSOP2236 O O- O Q- He Tci X R3I_ SCW. la 13 16 S FC5i; RESET. rcsyuxjiKLf PCR(M>C*SaA| 5 PC^|*PCP| PCI |AK1 PtJ [ADCii PCJ|i>i[K3| FapipcF 1 ) P.31.0CHI peii^siociei rejCiinsL-gcj-, peii.niwi IC1 P&E. i.scv;: poo ihm; £ poi it>:ji £ PDniNTD) £ PDllINTli I S I ATme'fl-aSS-IEPI KHpOWTflj WITH | PAT (Mil] fii t a A REF T C3 "p BC5*T IKKI4. II Figure 1 . The schematic for the Firefly is quite minima!. There is nevertheless a type of intelligent communication. is the impression that all! 6 LEDs are turned on simultaneously. In the programs slightly longer delay is used in order to obtain some- what of a slowly blinking effect, just as with real fireflies. When starting up there is the option of entering the calibration procedure for the servo. Pushbutton SI is used for this. A 22- k Q. pull-up resistor ensures that the cor- responding input of the microcontroller is High and only goes Low when the button is pushed. The calibration procedure is started when the signal at the input of the micro- controller (PEN ) is Low* For peripheral devices there are a light dependent resistor (LO R)„ a piezo trans- ducer and a voltage divider available. The LDR in our design is used to simulate ran- domness, to determine whether the servo is to turn to the left or to the right. A 1 0- bit ADC measurement is performed and the value of the least significant bit (bit 0 ) is used for certain decisions. The least sig- nificant bit (LSB) changes value frequently, particularly since this was made dependent on the ambient light. Very small changes in light level that are almost impossible to detect will result in a very rapidly changing value of the least significant bit. This creates a primitive but effective pseudo-random number generator. To drive the piezo-transducer a resistor of about 47 Q is required and a small electro- lytic capacitor of 10 pF, 16 volts w.v. When you buy the piezo transducer, do make sure that you get a transducer mounted in a housing. Without the housing you won't be able to hear much. Software The 'brains' of our Firefly is of course the software that runs in the ATmegaSB, The program, RreF/y_vT,bas 1 is a free down- load from the project web page [, L It basi- cally consists of a main loop, which repeat- edly sends the number ‘V by using the print } command. Subsequently, the Firefly will turn 45 degrees in a random direction depending on the servo_dir variables and a check is made whether a character has arrived at the serial input using the com- mand A = ischarwaitmg(). If this is the case then the variable Target is set. The 1 6-bit variable with the name Long Jed contains information about the state of the eight bi-colour LEDs. The lowest bit is the green LED! , the second bit is the red LED 1 , the third bit the is green LED2, the fourth bit Is the red LED2, etc. With the call to L_ led_bew(servo_dir_2 , Target) this variable is continually updated, based on the turn- ing direction of the servo (servojdirJ) and if something has been seen (Target). The interrupt service routine that runs in the background, continually jumps to the label Display Jed, Each time in that subroutine the next four bits of the variable Long_Led are copied to the correct positions of the eight bi-colour LEDs. In the main loop, based on the measurement of the LDR, a decision is made as to which direction the servo will turn. If the lowest bit is a ( T then the servo will turn to the left, if it is a 'O' then it will turn to the right i nstea d. Al I this wifi give the appearance that the Firefly- circuit lives a life of its own. There is a routine built into the software to deaf with servo specific tasks. Each type of servo requires a different amount of time to turn a specific amount. This is deter- Proarammina lanauaae The software for the Firefly is written in BASCOM AVR. This basic-compiler has been especially written for the Atmel AVR series of processors to which the ATmega 88 also belongs. Programming microcontrollers with BASCOM AVR represents a nice introduction to microcontrollers and robots. The compiler is well supported, has clear documentation with many examples and the demo version can compile a program of up to 4K. That's more than enough for many projects, including this one. The registered version has no limits in program size and is fully supported. In previous issues of Elektor (September 2008 through January 2009. among others) more detail is provided on BASCOM and you are kindly referred to those pages. The ATmegaSB is also very suitable for use with a so-called bootloader. That's a piece of software allowing the software to be programmed without using the ISP cable, but by using the ]R-connection instead. For this purpose you obtain a bootloader from the internet 14 and add the routine that generates the 3 6-kHz carrier signal. So now you can reprogram the Firefly with a new program using a USB -I R module, without needing a cable between the Firefly and the computer. Reprogram the Firefly on the fly, so to speak. elektor 04-2010 59 HOBBY Figure 2. Take care with the ATmega fuse bit settings! if you accidentally use the wrong settings it is possible that the controller cannot be programmed any more using ISP. mined by the subroutine ijkert: This routine is called when SI is pressed while the Fire- fly is switched on. At the end of the rou- tine the values are stored in the EEPROM of the microcontroller. If you start the Firefly without pushing then SI the microcontrol- ler retrieves this information from its FER- RO IV1. If there are no values stored in the The prototype may look somewhat ‘unfinished’* but that is why it is called a prototype. EEROM then an (erroneous) default value will be used and the Firefly will not operate properly. Programming With the aid of Bascom AVR and the Sam- ple Electronics ISP-programmer [2] (easy to make with the use of a cheap LPT periph- eral card in the PC and three resistors of around 300 to 500 O) you can program the ATmegaSS. The AtmegaSS has been factory preset to use the built in 8 -MHz oscillator and the divide-by-8 internal divider for the dock speed. These settings cause (timing) problems with the servo controller, so you have to change a Fuse-bit. The relevant Fuse- bit is C (see Figure 2). This is by default ena- bled and in your case it has to be changed to Disabled. Afterwards the program will run at 8 MHz instead of the default 1 MHz. By the way: When you're looking at the Fuse-bits you will notice that there are many different settings for all kinds of things. Dif- ferent clock speeds* internal clock, external clock, bootloader enable* far too many to mention. But be careful! If you accidentally select the bit for external clock* for exam pie, then the circuit will no longer work and you will not be able to get it going again with the ISP programmer. You will then require a ‘reap programmer capable of pulfing the reset pin to 1 2 V* which allows the proces- sor to be brought back to life. Alternatively you will need to connect an external clock from another* working processor. All annoy- ing and a hassle* so take care! When the software is programmed via the ISP into the controller* the EEPROM is also overwritten. Consequently the servo cali- bration procedure needs to be repeated every time the ATmega is reprogrammed via ISP. Getting started A printed circuit board was designed for this project* which is available from the Elektor Shop as item # 100014-1 . The board con- tains a few eye-catching features: the ring of eight bi-colour LEDs* the IR receiver, the IR transmitter, the connectors for the servo and the ISP programmer, the two contact pins for the ping-pong ball bracket and* of course, the microprocessor. Because the IR receiver can also sense the IR light that is transmitted by the IR LED on the board* you need to make a metal screen of 15x15x15 mm. Any light leaks 1 can be plugged with correction fluid (like Tipp-ex) or similar This is easy to use and once it has dried it blocks all light. Using 1 8 to 20 cm of spring steel wire (piano wire* 03 mm diameter), make a bracket to suspend the ping-pong ball In this ping-pong ball you melt two small holes to capture the spring steel wire. At both ends solder a push-on connector so that the ping-pong ball can be easily attached and removed. The ball is mounted directly above the IR LED, so that it becomes a diffused beacon* visible from all directions. The PC8 is attached to the servo. For the four cells you could use, for example* a 1x4 or 2x2 AAA battery holder. Either can be attached with a cable tie* Velcro or double- sided tape to the servo. The optional piezo transducer may be mounted to the side of the servo with some double-sided tape. The servo is attached to a base with its driv- ing wheel. This base consists of an old 3,5 S1 floppy disk, to emphasize that it is a true foundation in more ways than one. Drill a 2 to 3 mm hole and screw the disk directly to the servo wheel. Four rubber furniture felt pads can help to prevent the floppy disk from sliding around. Calibration Each type and brand of servo is slightly dif- ferent. As a consequence you have to cali- brate the servo. This is what the servo cali- bration program is about. When switch- ing the Firefly on (with 52), the controller checks whether 51 is pressed. When SI is pressed, the servo will turn increasingly slower When it stops you have to release SI, Press 51 again. The servo will start to turn again and slowly reduce its speed until it reaches standstill. Release SI again. The first time round is a coarse calibration, the second* a fine calibration. In this way the controller has learned' when the servo stops. Now you have to teach it how fast the servo turns around. Press 51 again* the motor will turn again and now release 51 after two full revolutions are completed. Repeat this once more (the motor will now 6o 04-2010 elektor HOBBY COMPONENT LIST Resistors R1 .R3.R5.R1 1 = 22 kO R2.R14,R15,R16,R17-4.7kft R4 = LDR, e.g. type A906Q, Conrad Electronics #. 145475 R6 - 470 R7,RS.R9 t R1G,R1 2 - 2200 R13 =470Q turn the other way} and the controller is able to calculate the amount of time required for a 45 degree turn. Current consumption The Firefly uses four AAA (LR03) batteries as its power source because of their versatility. The eight bbcolour LEDs together with the IR transmitter, IR transceiver the control- ler and not forgetting the servo use about 100 mA, The capacity of good alkaline AAA batteries is typically 900-1150 mAh. This allows the Firefly to operate for about ten Capacitors C1 S C6= IQjiF 16V radial C2.C3 = 22pF C4 = 4.7 nF C5,C7 - lOOnF Semiconductors D1 p D2,D3,D4,D5,P6,D7,D8 = bicolour LED. 5mm D9 = IR LED, 5 mm T1,T2.T3,T4 = BC547 IC1 - ATmegaSS, programmed hours on a set of fresh batteries. Recharge- able AAA cells can also be used, but when using these make very sure that there are no short circuits anywhere. With an alkaline battery the voltage drops quickly when the cu rrent i s too high, but with a recha rgea ble batter the voltage remains high, which can lead to charred, defective components. Experimenting The IR communication takes place via the 36-kHz modulation of the RS-232 signal at 2400 baud. This signal can easily be gen- Miscellaneous XI = 12MHz quartz crystal GZ1 = AC buzzer 51 = 5PNO pushbutton, Tyco Electronics type FSM4]H 52 = SPOT miniature switch. C&Ktype ET01MD1CBE K1 = 6-pin (2x3) pmheader PCB t order # 1 0001 4-1 , see www.elektor. com/ 1000 14 Servo motor Ping-Pong ball erated or detected with, for example, the US8-IR module that can be obtained from Conrad Electronics (part number 993137- 89), or an equivalent. With this you can verify whether the Firefly is transmitting IR ight and you can also send light, to which the Firefly will react. The piezo is not yet used in this program, but could be utilised, for example, to gener- ate a certain sound depending on how many ‘counterparts 1 the Firefly has detected. The resistive divider, comprising two 22-kD Advermemem M D Programming and Customizing the Propeller Microcontroller We are pleased to announce an exciting new Propeller micrconton- tr oiler book published by McGraw-Hill, It begins with an introduction to the Propeller chip's architecture and Spin programming language, debugging techniques, and sensor interfacing. The remainder of the book introduces eight diverse and powerful applications, ending with a speech synthesis demonstration written by the Propeller chip’s inventor, Chip Gracey. Numerous illustrations and example programs accompany each application. Example source code and other related resources are available for free download from ftp://ftp. propeller-chi p.co m/PC M Prop! * 9 authors, 12 chapters, 475 pages * Great reference source * Awesome applications Free shipping worldwide at bookdepository.com (ISBN 978007 1 664509} www.parallax.com Friendly microcontrollers f legendary resources. z n t/wi Milford Instruments www.milinst.com Spinvent wmv.spinventco.uk elektor 04-2010 61 HOBBY Servo modification A servo operates with an input signal of 1 to 2 ms that is repeated every 20 ms* A signal of 1 ms means that the servo is rotated completely in one direction, 1 .5 ms means the centre position and at 2 ms the servo rotates completely to the other direction. Servos normally rotate through an angle of about 270 degrees, but here we want to it to turn all the way around. We therefore have to modify the servo. The modification in principle comprises three things: removing the end-stop so that the me- chanics can rotate through a full 360 degrees, taking out the potentiometer and replacing it with two fixed resistors so that the electronics in the servo thinks that the potentiometer is al- ways in the centre position. First we disassemble the servo (Photo 1) and with a sharp knife remove the end-stop from the final gear (Photos 2 and 3). Now we will (partially) remove the potentiometer. There are two types of potentiometer. With cheaper servos, such as the Hitec-300 that we used here, the shaft of the potentiometer is the same as the shaft of the final gear in the servo. When we want to remove the potentiometer we will have a problem with the attachment of the final gear of the servo. If the servo has a separate bearing for the final gear, then we can simply take out the po- tentiometer. In the first case we have to modify the potentiometer instead of removing it. Open the potentiometer (Photo 4) and remove the wiper and that part that rotates inside the poten- tiometer and hits against the internal ridge with a small drill and a hobby knife (Photo 5), You don’t need the ‘lid* of the potentiometer (with the carbon track)* so leave that out. In place of the potentiometer you need to connect two resistors on the servo PCB, First check the resistance value of the potentiometer (usually 5k H) and take two resistors that together also have about this same value. Two resistors of 2.2kO or 2,7kn each are suitable in our case. Connect them to the servo PCB instead of the potentiometer (Photo 6). Make sure that you connect the resistors in such a way that it appears to the electronics that a potentiometer is connected and that it is always in the centre position. Before putting the servo back together, check that that all the parts of the servo are able to ro- tate around completely. Now you're ready to reassemble the servo (Photo 7) and check once more that the servo can rotate 360 degrees. The servo is now ready for use. resistors, is not yet used either. At the node between these two resistors you should be able to measure half the power supply voltage, with a resolution of 1 0 bits (1 024 steps from 0 to 5 volts). You could use this to measure the condition of the batteries quite accurately. In theory, the operation of the servo changes when the battery volt- age decreases. This changing characteris- tic could be compensated for, based on the measured voltage. The Firefly circuits are all identical. They all send the same message and all look for the same information. Whenever ‘something 5 arrives, they recognise that and respond to it. They could also each have their own identity or number. In this case each Fire- fly transmits a different message. The pro- gram could then be adapted so the Fireflies will recognise only certain counterparts before reacting. You are free to experiment with this circuit and there is no maximum number of Fireflies that can communicate with each other. The more the merrier... (100014-I) Internet Links m www.elektor.com/ 100014 (2] http://8051 help.mcseiec.com/index.htm l7sampleeiectronicslspprogramnier.htm (3) http://mcselec.com 62 04-2010 elektor DISTANCE LEARNING COURSE / | Programming Embedded PIC Microcontrollers using Assembly, C and Flowcode In this course you will learn how to program an embedded microcontroller. We will start with the absolute basics and we will go into a lot of detail. You cannot learn about software without understanding the hardware so we will also take a close look at the components and schematics. Special Introductory price for Elektor subscribers £40 1 $70 1 €50 DISCOUNT 'l.eiektor.conrldisunceiearnn^ At the end of the course you will be able to design your own embedded applications and write the appropriate Contents: Background Digital Ports Serial Communication (RS232) Analog Signals Pulse Width Modulation Timers/ Counters/lntermpts Memory LCD Display PC Communication SP1 Communication USB Communication Configuration (Fuses) Answers to the assignments Appendix {800 pages) * CD-ROM including software and example files ■ Application Board ■ Support at Elektor Forum • Elektor Certificate Price: £395.00 / S645.00 / €445.00 Please note: to be able to follow this course, £- blocks hardware is required which you may already have fin part). All relevant products are available individually but also as a set at a discounted price. Please chec k www.ef ektor.com fd I stan c elearninq for f urth er i nform ation . software for it. Your course package: * Courseware Ring Binder ACADEMY the school of electronics READERS CIRCUITS Burn or Turn? 1 * 1 * I _ _ By G, van Zeijts (The Netherlands} Has your hard drive crashed? Don’t throw it away! You can still use it in many interesting projects. As an example, the author has used the read/write arm to make an alternative motor that is controlled via the PC. No doubt some readers wilt have experienced this at some time: the hard drive in the PC has given up the ghost. This is very irritating, and even more so when you haven't made a backup of your data. The silver lining of this cloud is that inside every hard drive is an interesting part, which well make use of in this article. The online encyclopaedia Wikipedia refers to this part as an actuator ! 1 c The actuator moves the read /write arm of the hard drive, on which the magnetic read and write heads are mounted, to the correct position. The actuator is controlled via a clever bit of electronics, which is found inside every hard drive. The actuator itself is nothing more than a coil inside a very strong magnetic field. The nice thing is that the arm has quite a long throw and is com- paratively powerful. This article should motivate the real do-it-your- selfers amongst us to start experimenting with these actuators, it shouldn't be the end of the world If you don’t have a broken hard drive to hand. Since a fair number of hard drives crash you’ll find that every computer repair shop will have a few in their bin. if you ask nicely you may even get them free of charge. Actuator What exactly does one of these actuators look like? Once you’ve removed the cover and electronics from the old hard drive you’re Figure 1 , It makes it easier if we remove part of the aluminium plate (left) and connect the actuator coil to a terminal block (right). left with an aluminium plate with two motors: one to rotate the platters and one to position the read/write arm. The latter is the actuator that we Ye after. To ma ke it easier to work with, we ft rst remove some of the alumin- ium plate so that Just the actuator remains (see Figure 1 ). Be careful that you don’t cut through any of the steel parts, since the steel fil- ings will immediately fly to the magnets. They'll be very difficult to remove again, since those magnets are really powerful! At the end of the actuator arm are the read/write heads, but we have no use for these here. The interesting part for us is the coil that turns between the magnets. The two connections for this coil are made with two very thin wires that usually go to a multi-pole con- nector, We have to find these two connections and provide them with a separate connector. One possibility is to use a terminal block, as can be seen on the right in Figure 1 . The resistance of the coil is usually somewhere between B and 1 2 ohms, which makes it perfect for use with a 5 volt supply. The motor will obviously provide more power if you put 1 2 volt across it, but this can only be done for short periods! Otherwise the coil turns into a smalt heater (with a very limited lifespan)! Reversing the + and - causes the actuator to provide a force in the opposite direc- Figure 2 . The metal plate that moves through the two photo interrupters tells the PC what the position of the crankshaft is. 64 04-2010 elektor READERS CIRCUITS Figure 3. The outputs of the photointerrupters are connected to the parallel port of the PC, Figure 4. Three outputs from the parallel port (and a ground connection) are required to drive the HD1 motor tion. When a computer is used to control the actuator any real DIYer should be able to come up with various ideas to try out What can I do with it? An actuator normally doesn’t get much attention, but it should be ideal to drive ‘something’, considering the relatively large force it can provide. As an example, you should be able to make a rotat- ing motor, which works using the same principle as that used in a car engine. The back and forth motion of the actuator is converted into a rotary motion by the crankshaft. Since an actuator is used as the driving element, our project was given a suitable name; the HD motor, (Hard Disc motor) In this article we look at two types: * a single-cylinder motor, driven by 1 actuator (the HD1 motor) * a four-cylinder motor, driven by four actuators (the HD4 motor) * Since the HDI motor is more interesting as far as the control is con- cerned well look at this in more detail. The HDi motor The arm of the actuator has to be connected to a crankshaft. For this a read/write head from a broken video recorder was used. This part has very smoothly running bearings and it even has a small flywheel, which reduces the shocks in the rotating movement. The actuator is capable of pushing or pulling, depending on the polarity of the supply voltage applied to the coil. Since there is often a need to reverse the rotation of DC motors in various devices, ded- icated ICs have been developed for this purpose. This 1C also has a function built in for the control of the speed of the motor. The paragraph on The driver chip' explains the workings of this 3C in more detail. In order to determine when the actuator has to push or peril, a piece of metal has been mounted on the crankshaft, which rotates through two photo interrupters (see Figure 2), From these the com- puter can determine the position of the crankshaft and hence out- put the correct signal for the actuator to push or pull. The speed of the HDI motor can be controlled via the computer (see the para- graph The driver chip’). To see if the actuator is pushing or pull- ing, a red and green LED have been connected in parallel with the actuator. Connections to the PC The connections from the photointerrupters to the computer are shown in the circuit in Figure 3. All connections are made via the parallel port. Two inputs are used: one to indicate that the crank- shaft is in the left position and one for when It Is on the right. The type of photo! nterr it pter used Isn't important, just about anything should be suitable, A photointerrupter from an old printeroroutof a mouse can easily be used here, for example. Three outputs from the parallel port are used to drive the actuator. One to make the actuator push , one to make it pull and the last one is for speed control (enable) (see Figure 4). The driver chip The driver chip for controlling the actuator sits between the paral- lel port and the motor. For this we've chosen an 1C with the part number TPIC0298 (other numbers such as TLP298 or L298IM are also used for this 1C). This is a so-called Dual full H-Driver', obtainable from various sources. Further details on H-Drivers (also called an H- Brldge) can be found on the Internet, for example on izJ and hi. This 3C was originally designed to control a bi-directional step per- motor, but it can also be used to drive two DC motors independently and make them turn in either direction. The circuit «n Figure 4 shows the !C and the connections between elektor 04-2010 65 READERS CIRCUITS Figure 5. The completed HD1 motor. Admittedly, it’s a sizeable circuit. These days it could be made much smaller, but this way is more fun. Figure 6. A Tour-cylinder' version is constructed as a radial engine. the HD-motor and the computer To drive the HD motor we use only half of the 1C. Inside the 1C are four electronic switches that are con- trolled by the logic AND gates in such a way that the actuator pulls in one state (pin 2 high and pin 3 low) and pushes in the other state (pin 2 low and pin 3 high). One computer output is connected to the Enable input of the 1C and is used to control the speed of the HD motor using PWM (Pulse Width Modulation). The PWM works in both directions of the actua- tor and provides a smooth speed control. Four protection diodes have been added to the circuit to prevent damage to the 1C from back EM F surges. Software The program that drives the motor is written in Visual Basic under Windows XP and can be freely downloaded from the web page for this project under number 090120-1 1 . The program is quite simple and provides the following functions: * Determine the position of the crankshaft and control the actua- tor accordingly: “push 1 or ‘pull’ * Select clockwise or counter clockwise rotation * Control the speed using PWM * Measure and display the revs in rpm. * Where necessary, the program includes comments and it can of course be written in any computer language. It can however be possible that Windows throws a spanner in the works: * With Windows Vista Microsoft only permits you to access the USB ports; the program can therefore not be used under Vista * With Windows XP it is still possible to access the parallel port directly (using the dll 'inpout32.dll') * With Windows 98, 95 and older you can still play to your heart's content with all ports (parallel, serial, game and sound, using the dll ‘ports.dlT). The program available for download will therefore work under Win- dows versions up to XP, but not under Vista of Windows 7! The results The completed HD1 motor (Figure 5) turns at a maximum rate of about 1 000 rpm using a 5 volt supply and about 1 800 rpm using 1 2 volt. As already mentioned, the latter should only be tried for very short periods of time. Otherwise the coil will heat up rapidly due to the current that flows through it. The lowest speed at which the HD1 motor can run is about 200 rpm. As an aside: the efficiency of the complete system surrounding the HD1 motor is about 1%..., considering * estimated power consumption of the PC: 200 W, actuator: 12 W. • estimated mechanical power output: 2 W More cylinders? If you feel that a single cylinder is a bit frugal, by ail means add some morel Once the single cylinder motor worked well the author thought that it should also be possible to build 4, 6 or 8 cylinder ver- sions. It ended up as a four-cylinder version, which was christened the HD4. Since it is very complicated to make a crankshaft for a four-cylinder motor the actuators have been placed in such a way that we end up with a radial motor (see Figure 6 and ^ ! ), The four cylinders in a radial motor all drive the crankshaft on the same plane. They Ve been mounted on a square so they each take care of 90 degrees. This made it possible to mount everything on a single flat wooden board, as can be seen from the photo. To determine the position of the crankshaft four photointerrupters have been added. From these the computer can determine which actu- ator should be turned on. One thing that differs from the H D 1 motor is that the actuators are no longer driven by an (expensive) 1C Instead, a simple Darlington transistor is used per actuator. Because of this, each actuator can no longer push but only pull. However the four-cylinder motor can still rotate either clockwise or counter clockwise. (090120) Internet Links [1 j http://en.wikipedia.org/wiki/Actuator [2 ] http://en . wikiped ia.org/wiki/ H-bridge [ 3 1 www.discovercircult5.com/ H/hbridge.htm 1 4 j h ftp : // www. el ektor. co m / 09 0 1 2 0 1 5] http: / /en.wikipedia .org/wl kl /Radtal_engine 66 04-2010 el ektor ACCESS SYSTEMS Beep, beep... Sesame A musical electronic lock By Bernard Chabbert (France) A motorised gate is jolly useful, just so long as you don't forget the remote control or the key. Normally, the control system forthis type of gate makes provision to connect a push-button for opening or closing it without needing a remote control or key. This button must not be accessible from outside, whence the need for a more complex system. The code lock suggested here lets you control up to three such gates using push-buttons after entering a valid secret code Tec hnical * m * * digital keypad with sound effects * four codes with up to 15 digits * three individually-driven floating contact outputs * plays the March of the French Foreig n Legion * PIC16FS4 microcontroller - no critical components There's a digital keypad for entering the secret code* The device can store up to four different codes, each with a maximum of 1 5 digits, since each member of the fam- ily wifi find it easier to remember a code they've chosen themselves than one that’s imposed upon them* The holder of code #1 is the only person who can modify all four codes* For the security of the system, it's going to be constructed in two parts, since if every- thing is in a single external unit, all you'd need to do to open the gate would be to break open the case and short a contact. So the external part will only contain the keypad and a little speaker to give a sound when you press a key. Of course, this part will have to be protected from the rain, with a little roof or a door* The electronic part will be Installed somewhere inaccessible from outside — inside the house, for example* There is a beep every time you press a key t regardless of whether it's the right one or not. If you make a mistake, there is nothing to tell you th is until you get to the end of the code. The code (which mustn't start with an *} must end with a #, Then you choose the function: operate one of the three relays, or go into administration mode (see Table 1). When an incorrect code is entered, it counts as an error* After four errors, the keypad stops working for two minutes* There is another security feature: there must be less than two seconds between keystrokes, oth- erwise the current procedure Es abandoned* The end or abandon of a procedure is indi- cated by three high-pitched beeps* If a code is forgotten, only the adminlstra- elcktor 04-2010 67 ACCESS SYSTEMS +5V O K3 "1 JS7 DSP05-1 A72-12D v+ O K6 REJ K4 PI m ft 3 JT L,™ Ri mm | a J 2 _ C5 1«jt BC547 T C3 IMn 16 15 16 17 2* T“ C< iflOri 3 □ MCLR 1C 2 ton, TUT OSCI.'CLKIN RBI 05C2/CLK0UT R32 RB3 RAi'TOCKI RBi ™ PiC1&F84^P SZ RDb RA1 RB7 RAO to > OIP05-1 A72-1 20 3x DZV* 1N414S 06 to 16 H # to GC337 c □ l^IT" ij 11 U 10] fr H r ) which converts it to a hex file that can be loaded directly into the PIC using a suitable program and a programming device. The PCB doesn't make any provision for in-situ programming (ICSP). 081143-41 T1 ,T3 = BC337 T2 = BC547 Miscellaneous PI = 10kn horizontal multiturn trimpot RE1 ,RE2 - 5V SPNO relay, 500£2 coil, Meder type D1P05-1 A72-12D RE3 = 12V DPDT relay. Tyco type V23057-B002-A201 K1,K2,K3,K6 = 2-pin PCB screw terminal You can download the source program. Its flow diagram, and the hex file free from l 2 l Construction and testing You shouldn’t encounter any difficulties building this project (Figure 2). Relays RE1 and RE2 look symmetrical but in reality they aren't, due to the integrated diode: for RE3, follow the holes on the PCB, Where there are no holes, you'll need to cut off the pins that aren't required. Take care to get the microcontroller the right way round, as a wrongly-fitted PIC will be ruined for good! Connect up the keypad and speaker using a 10-core cable (including one forthe ground link). This may not be used If the case is plas- tic, but it must be there — it Is connected to the negative power rail and to the cable screen. Once you have finished construction and wiring up. apply power to the circuit. You'll hear three high-pitched beeps to tell you that the system is initialising. If you don't hear them, the circuit isn't working prop- erly! Turn off the power at once and investi- gate the cause. If you did hear the three beeps, press the key sequence # 1, Each press is followed block, lead pitch 0.2 inch (5,08 mm) l<4 - 2-pin pinheader, lead pitch 0,1 inch (2.54 mm), with jumper K5 = 1 0-pin pinheader, 1 0 contacts, lead pitch 0.1 inch (2.54 mm) Loudspeaker, 50H impedance Numerical keypad, 4x3 PCB, order code 08 1 1 43-1 , see Elektor S hop section or www.elektor.com / OS 1 1 43 by a beep and relay RE1 is activated for 2 s (easy enough to check with an ohmmeter}. You’ll also hear a beep indicating a correct code, a little 5-beep jingle that indicates the process has ended correctly, and! to end, the three high-pitched beeps that indicate the initialization of the microcontroller, after which it goes Into standby. Next, try out all the procedures in Table 1 before your final installation. Go on, have fun, you’ve earned it — press #7. Don’t forget to store at least secret code # 1 , (081143) internet Links [il www. microchi p.com / mpla b [2] www.elektor.com/QSn43 [3 1 http:/ / pagesperso-orange.fr/ Bernard. chabbert / elektor 04-2010 69 POWER SUPPLIES By Daniei Goss (Germany) These days many components and microcontrollers are designed for low-voltage operation and can be powered directly from a battery. For various reasons, however, it is often necessary to power them from 35V supply. Designing a high-efficiency supply is time-consuming, and so he we present a universal solution in the form of our 5 V power controller. Features - Input voltage range 2 V to 8 V {for example from two AA cells or two lithium-ion or lithium- polymer cells) * Power 35V circuit drawing up to 150 mA using two AA cells * Especially designed for 5 V microcontroller circuits * Efficiency: 75 % at 2 V and >76 % from 3 V to 8 V input voltage * Standard, readily available components - All connections on 2.54 mm pitch headers ■ Soft-off function under processor control ■ Power on button can also be used as general input button * Low current consumption in soft-off standby if a circuit can run on a wide range of power supply voltages it is easy to power it directly from a (rechargeable) battery. However, if we want to use components like LCD panels or sensors, it is often the case that a tight- tolerance supply is required. Many micro- controller application circuits still use a 5 V supply, and so there is a clear need for this versatile supply, capable of producing a stable 5 V at its output with an input volt- age anywhere from 2 V to 8 V. This means that the circuit can be pow- ered from two AA cells (2 V to 2 *4 V). two lithium-ion or lithium-polymer cells (about 7*2 V), or anything in between. The maxi- mum output current of 1 50 mA should be enough for most battery-operated circuits. Logic level control inputs allow the circuit to be started up, as well as to enter and exit a standby mode. The Idea In view of its voltage range and easy avail- ability we selected the Linear Technology LT13Q2, normally used as a boost-type switching converter. Here, however, we use it in a SEPIC (single-ended primary inductor converter) topology [1 1, effectively turning the device into a buck-boost converter |2J , This gives a wider input voltage range, as the converter operates in either step-up mode (with an input voltage below 5 V) or step-down mode {with an Input volt- age above 5 V) as appropriate. As a bonus we also get DC isolation between input and output when the circuit is disabled. The circuit (Figure 1) is constructed on a small printed circuit board using surface- mount components (Figure 2). The pins on the board are on a 2.54 mm pitch (Fig- ure 3) and so it can easily be mounted on prototyping board for experimentation. The battery is connected at K1 , and the output is present on K3. K2 is a test jumper. The minimum allowable input voitage of 2 V at K1 means that in practice two AA cells can be discharged to 1 V each before the circuit fails to operate. Pin 1 on K3 carries the regulated 5 V out- put* The other pins are BattSense, PowerOn, PowerHold and ground, BattSense allows a microcontroller with an analogue-to-digital converter to monitor the battery voltage, The other pins function as follows. If PowerOn is taken to ground the switching converter starts up and delivers 5 V at the output. The microcontroller can now take PowerHold to 5 V to keep the converter run- ning, if PowerOn is now released the circuit will continue to run as T1 remains turned on. The microcontroller can power itself down by taking PowerHold low* We will look at how to connect the circuit to a microcon- troller, as well as other applications, in the last part of this article* 7 t> 04-2010 clektor POWER SUPPLIES Figure 1 . Circuit diagram of the 5 V power controller using the Linear Technology LT 1302. Function Figure 4 shows a block diagram of the LT1 302, which is essential to understanding how the circuit works. Readers who would like to analyse the circuit in more detail are recommended to look at the free LTSplce i ]? simulation program. The free download accompanying this arti- cle |4i includes a few illustrative oscilloscope traces from the simulator., COMPONENT LIST Resistors (all SMD 0805, 1%) R1,R2.R4 = 10kO R3 - ion (see text) R5 = 100kn R6 = 560kQ R7 = 680kfi Capacitors Cl ,C6,C7 = 100pF 25V SMD(e,g. Fame!! # 1735335) C2.C8 = 1 0OnF 100V SMD (e.g. Reichett.de # SMD-1 81 2 100N, see text) C3 = 1 liF 25V SMD tantalum 0805 {e.g. Farnell #1135280) C4 = 1 0nF 1 00V SMD (e.g. Reichelt.de # SMD- 1812 10N, see text) C5 = 220pF 35V SMD (e.g. Farnell #9695877) In boost mode (step-up) operation a boost cycle starts with the switching transistor integrated into !C1 (Q4 in Figure 2) conduct- ing to ground, causing a current to flow in LI . C5 then discharges via L2, and the cur- rent in L2 increases. Figure 5 shows the cur- rent flows in LI and L2 when the transistor is conducting. The currents are in opposite directions but of approximately the same magnitude. Now IC1 turns the transistor off, C5 is no longer con nected to g round via Q4, Inductors LI .12 « 33mH, 2A, 0. 1 2Q SMD (e.g. Farnell # } 6 1 2699, Reichelt.de # L-PISM 33u) L3 = 27juH, 0.8A T 0,260, SMD (e.g. Farnell # \ 539570) Semiconductors (all SMD) D1 ,D2 - GAT 54$ (SOT-23. STM i c roe lectron its) D3 = MBR5340 (SMC, ON Semiconductor) T1 = BSS138N (SOT-23. Infineon) !C1 =111302(50 -8, Linear Technology) Miscellaneous K1JC2 * 2-pin pin header K3 = 5-pin pinheader PCB #090719, see Elektoi Shopoj www.ele- ktor.com/0907T9 PCB artwork download from www.elektor, com/0907 1 9 but to the input supply voltage further offset by the back e.m.f. of LI . L2 also tries to main- tain its current flow. In conjunction with C5, this causes a positive voltage to appear on D3 that is greater than the supply voltage to 1C1 (which is the input voltage to the circuit). Figure 6 shows the current flows when the transistor is not conducting. C5 and L2 thus together charge reservoir capacitor C6, This continues for around Figure 2, The printed circuit board is entirely populated with surface- mount devices. Because of the high temperatures used in reflow soldering with lead-free solder C2. C4, C8 and the headers are fitted manually. elektor 04-2010 71 POWER SUPPLIES Lab Notes By Ton Giesberts Here in the Elektor labs we made a few minor changes to the aut hor s original circuit Resistor R1 and dual diode D1 were added to protect the gate of T1 , and we felt that it would be a good idea to use pins on the board with a 0.1 -inch pitch to make it easier to use the circuit in prototypes. The fixing holes are noton this grid to allow the hoard to be slightly smaller. In any case, if the board is plugged or soldered into a prototyping board no fixing screws will be needed. from 3.5 V to 6,5 V. At higher input voltages the efficiency gradually falls off to 76,2 % at 8 V. The main advantage of the buck-boost principle is the wide range of acceptable input voltages. The disadvantage is the lower efficiency compared to the standard configuration of the LT ] 302 as a pure boost mode converter, where a maxim urn efficiency of 87 % can be achieved with a 3 V input and a 5 V output. Three of the surface-mount components are 1 8 1 2-outline film capacitors. These are MKT- type devices with a low equi- valent series resistance (ESR) and better dielectric properties than, for example, 0805-outline ceramic capacitors, However, it is doubtful whether the film capacitors can withstand reflow soldering with lead-free solder paste: Wima's 1812 film capaci- tors are rated up to 2 20 °C T and the datasheet gives 21 0 Q C as the maximum temperature for the core of the capacitor. The melting point of polyester is around 245 °C For our prototype we soldered all the components except for the headers and capacitors C2, C4 and C8 in the Elektor SMD oven using lead-free solder, with the temperature reaching 260 °C C2. C4. CS and the headers were soldered by hand. We measured the efficiency of the circuit with an output current of a little over 150 mA. using a 33 ft load resistor and fitting the test jum- per at K2. The efficiency depends on the input voltage, from a mini- mum of 74.8 % at 2 V to a maximum of nearly 77 % at input voltages The LT1 302 data sheet suggests that for input voltages over 5 V it is worth adding extra decou- pling on the 1C f s power supply consisting of a 10 ft resistor (mi- nimum 2 ft) and a 1 pF tantalum capacitor. For our experiments we used a 0 ft resistor for R3 and a 100 nF 0805-outline capaci- tor for C3. At input voltages in the 2 V range the voltage drop across R3 can mean that the supply voltage to the LT 1 302 falls too low. If, for example, the circuit is powered from two A A cells, R3 can be bridged and a tanta- lum electrolytic used for C3, When the SHDN signal is low the quiescent current varies from around 0,4 mA to 1 mA with input voltages from 2 V to 8 V. The 1C itself draws just 0.2 mA t and the rest is down to the current through pull-up resistor R2 when SHDN is low. The minimum shutdown voltage is 1 .8 V and the minimum bias current for the pin is 20 pA, and for this reason a value of 10 kft was chosen for R2. In practice a rather higher value will work perfectly well, which will improve the efficiency of the circuit at higher input voltages. When II is off (gate taken to ground) the circuit draws just 10 pA. 4.5 us, at which point IC1 turns Q4 on again. C5 Is discharged again via 12 and a current again begins to flow in LI . This alternating pattern continues until the voltage on FB (pin 4 of IC1 ) reaches 1 .245 V. When this happens, the LT1 302 switches off its inter- na! 220 kHz oscillator. Since current can no longer flow into C5, the output voltage starts to fall. When the voltage on FB falls below 1 ,24 V the oscillator starts up again. After four cycles or so the threshold volt- age is again reached and the oscillator stops once more. In buck mode (step-down) operation, at higher input voltages, one switching cycle is typically enough to bring the voltage on FB over the 1 .245 V threshold, and so the oscillator stops immediately. As the input is isolated from the output via C5, no further current can flow and the output voltage starts to fall. As soon as the voltage on FB falls below 1 .24 V another cycle starts. As a result of the way the converter works, the output voltage has rather a lot of ripple. To smooth out this ripple, C6 is followed by a filter comprising 13, C7 and C8, To ensure accurate regulation, the voltage divider used to generate the voltage on FB (R5, R6 and R7) is rather complex, R6 is responsible For 55 % of the feedback voltage and ensures a rapid response, while R7 helps compen- sate for the voltage drop across 13, A low level on the shutdown input (SHDN, pin 3) activates the LT1302; if the pin is pulled high (via R2) the device will remain in a standby state, T1 pulls SHDN low if the connected microcontroller drives its input high. R3 and C3 together provide a supply to the LT 1 302 relatively free of voltage variation and spikes. Use with a microcontroller The example circuit in Figure 7 shows how the circuit can be connected to an ATtiny24 7 Z 04-2010 elektor POWER SUPPLIES SfNSS V* SW Figure 4. Block diagram of the LT1302. Q4 switches the current through external inductors. Figure 3, The headers are on a 2.54 mm (.1 inch) pitch and so the board can easily be mounted on an ordinary prototyping board. microcontroller. The PowerOn and Power- Hold pins on K3 of the 5 V power controller board are connected to the microcontroller. It is important not to leave Power Hold open circuit, as then II will not turn completely off and the overall current consumption of the circuit will increase unnecessarily. Pushbutton SI can be read by the micro- controller as an ordinary input, using R1 as ms AVR 8' Bit Main PCB Board.', Ikf XGS Gamepad Controller, / ^i325+ Page Printed Manual!-- Jg^Atmel AVR ISP MKII Programmer. k\^C?JL9V Power Supply & A/V Cable. ^ jk. PC Serial Port to XGS Converter. DVD-ROM. 1GB Micro SD Card + Adapter! /Bonus: eBooks on Hardware, jGame Conso l e_Desi g n,_and Mo rej 1 Cff 1 K | ■ fei pVi Vn p [JiqJK \p] IMJ WWW. elektir. com Prototype & small series PCB specialists PCB proto STANDARD pool tech pool IMS pool On demand dedicated proi widest choice 1 8 100 pm technology metal-hocked PCQr. aH options up to Call us: 020 S816 7005 Entail; euro@eurocircuits.com New website - new services ALL Instant online pricing Instant online ordering Low pooling prices Deliveries from 2 days No tooling charges Stencil service www.eurocircuits.com elektor 04-2010 73 POWER SUPPLIES Figure 5, The pattern of current flow in LI Figure 6, Pattern of current flow when the and 12 when the transistor is conducting. transistor is not conducting. *sv FOwwOrt PtjtWHlrfff Figure 7. Example connection to a microcontroller. a pull-up resistor, Schottky diode D2 in the power supply circuit isolates it from the pull-up, and so the button can be used as a 'power on’ button for the supply. When the button is pressed the supply starts up and delivers 5 V to the microcontrol- ler. The microcontroller starts running its program, which can then take Power No Id high, FET T1 in the supply circuit now con- ducts and keeps the circuit active even if the button is released. The microcontrol- ler can subsequently switch off the power supply, for example after the user selects a certain menu item or after a certain period of inactivity, by taking PowerHold low. The whole circuit, including R1 and hence also the PowerHold signal, goes to ground potential, T1 turns off fully, and the current consumption of the power supply circuit drops to less than 20 jiA, The circuit can of course be used just to power individual parts of a larger circuit. In this case again the PowerHold signal is driven by the microcontroller in order to enable and disable the 5 V supply. Since the microcontrollerwill not be able to drive the PowerHold signal high while it is being programmed, we have provided an option to enable the supply permanently by fitting a jumper to K2, This allows for programming, debugging and testing of the system, including the supply itself, without needing to make any software modifications. if the BattSense pin is to be connected to an analogue-to-digital converter in the microcontroller, the input used should be as high impedance as possible. This pin is never isolated from the battery, even in standby mode, and this means that atten- tion must be paid to the current flowing through the voltage divider. Since the volt- age is present when the supply is off, it can be used to power a wake-up circuit or as a back-up supply to retain memory con- tents, although it is important to note that the voltage is neither regulated nor filtered. To make an accurate measurement of bat- tery voltage, a 100 nF smoothing capacitor can be added to the voltage divider: this will buffer the divider from glitches arising from the sample-and-hold capacitor at the input to the analogue-to-digital converter, allow- ing higher resistancesto be used in the volt- age divider. Observe also that the battery voltage will be present on the microcon- troller input even if the rest of the circuit is unpowered. Normally this will not cause any difficulty because of the high impedance of the voltage divider. ( 090719 ) About the author Daniel Goss is a qualified information technology and systems inte- gration specialist. He works as an IT consultant designing technical and security solutions with the largest IT services supplier in Ger- many. In his spare time he designs electronic circuits, mostly based around AVR microcontrollers, and writes Windows programs in C++ and in C#. E-mail address: flashback@flashsystems.de Home page with software and more projects: http://www.flas hsys- tems.de {in German} Internet Links 1 1 j http://en.wikipedia.org/wikl/SEPIC_converter (description of the SEPIC principle) \ 2 ] www.maxim-k.com/app-notes/index.mvp/id/ 1 05 1 (application note) [3] www.linear.com/designtools/software/ (free download of LTSpice) [41 www.elektor.com/09071 9 (project pages with Free downloads) 74 04-2010 elektor DESIGN TIPS A voltage booster using Arduino By Clemens Valens (Eiektor France Editorial) If your project needs a higher voltage rail than is already available in the circuit, you can use an off-the-shelf step-up device. But when you want a variable output voltage, it's less easy to find a ready- made 1C. However, it's not complicated to build such a circuit your- self, especially if you have a microcontroller board that’s as easy to program as the Arduino. And this also lets you experiment with the circuit so you can get a better understanding of how it works. No surprises in the circuit— a largely conventional boost convertor. The MOSFET is driven by a pulse width modulated (PWM) signal from the uC„ and the output voltage is measured by one of the pCs analogue inputs. The driver adjusts the PWM signal according to the difference between the output voltage measured and the voltage wanted. We don’t have enough space hereto go into details about how this circuit works, but it’s worth mentioning a few points of special inter- est. The small capacitor across the diode improves the efficiency of the circuit. The load is represented by R3. The components used make it possible to supply over 1 A (current limited bytheMSS126GT 683 M IB inductor from Colic raft), but maximum efficiency (89^) is at around 95 mA (at an output voltage of 1 0 V), To avoid damaging the controller's analogue input (<5 V), the output voltage may not exceed 24 V. For higher voltages, the values of resistors R1 and R 2 would need to be changed. The MOSFET is driven by the pC, which is nothing but a little Arduino board. The Ardulno’s default PWM signal frequency is around 500 Hz — too low for this application, which needs a frequency at least 1 00 times higher. So we can’t use the PWM functions offered by Arduino. But that’s no problem, as the Arduino can also be pro- Arduino \ DIGITAL .Flftl 11 y- 62.SkH7 ANALOG_FliTcTy Arduino V*T1 IRF644 +4V3...+24V -@v + fU ItHJu jV 090S49- It grarnmed in assembler, allowing a maximum frequency of 62.5 kHz (the pC runs at 1 6 MHz). To sample the output voltage, a frequency of 1 00 Hz is acceptable, which means we can use Arduino's standard timers and analogue functions. The Arduino serial port is very handy — we can use it for sending the output voltage set point (5-24 V) and for collecting certain information about the operation. Thanks to the Arduino environment, it only took about half an hour to program. You can download the software from !| . [ 1 1 www. eiektor. com/0908 94 (090894-1) UV light box By Cert Baars (The Netherlands) Fabricating printed circuit boards is not something that every elec- tronics hobbyist does for themselves. It is, however, not realty that difficult, The most important necessities are a PCB layout, a printer (or perhaps a copier), a light box, photo -sensitive PCB material, chemicals and an etching tray. It is often the light box that presents the most difficulties. The PCB layout can be copied (using a copier) from an existing design or you can design it yourself using a computer and suitable software. The layout needs to be printed onto a transparency (make sure that the transparency is suitable for use in laser or inkjet print- ers). The necessary chemicals (sodium hydroxide for the develop- ing and iron(lll)-chlonde or copper-chloride for the etching) are not difficult to obtain. It is not necessary either to etch using a foam- etching box, but this does etch much quicker. Etching can simply be done in a plastic tray, and etching with iron(lll)-chloride will be a little faster if the etchant is at about 40 °C As already mentioned, exposing the PCB is often the most diffi- cult part. In the past, the PCB with the layout in an exposing frame would sometimes be placed in the bright sun and it is also possible to expose the PCB using UV lamps. To make a real 1 light box yourself is not nearly as difficult as most people assume. The required items are a housing with a sheet of glass, UV fluo- rescent tubes and perhaps a timer. The latter is not really neces- sary when a clock or watch Es available. It therefore comes down to obtaining the UV fluorescent tubes with starters and ballast and a housing with a sheet of glass. There is a cheap solution for this. For the housing you can use a dis- carded sheet scanner with all the innards removed. The fluorescent tubes could come from a face tanning machine, for example. In the prototype' made by the author the frame complete with the fluo- rescent tubes was cut out. This could then be placed in its entirety into the housing for the scanner. The accompanying starters and ballast fitted elsewhere in the old scanner housing and after con- necting ail the wires everything immediately worked as it should. Because the layout has to be in good contact with the PCB to pre- vent shadowing, a sturdy piece of cardboard the same size as the glass was attached to the inside of the lid of the scanner. It is neces- sary to apply some pressure on the lid during the exposure, but a few books or fat catalogues on top of the fid is already sufficient. The exposure time for the best results with this construction appears to be about 2-3 minutes. (090088) eiektor 04-2010 75 INFOTAINMENT Hexadoku V 'i' i an Here's another fresh Hexadoku for everyone with a soft spot for puzzle solving. Our records indicate that Hexadoku has become popular with spouses of Elektor readers, too, and that’s a good sign. The more correct entries, the better! Send the hexadecimal numbers in the grey boxes to us and you automatically enter the prize draw for four Elektor Shop vouchers. Have fun! The instructions for this puzzle are straightforward. Fully geared to electronics fans and programmers, the Hexadoku puzzle employs the hexadecimal range 0 through F, in the diagram composed of 16 x 16 boxes, enter numbers such that all hexadecimal numbers 0 through F (that's 0-9 and A-F) occur once only in each row, once Solve Hexadoku and win! Correct solutions received from the entire Elektor readership automa- tically enter a prize draw for one Elektor Shop voucher worth £ 80.00 and three Elektor Shop Vouchers worth £ 40,00 each, which should encourage all Elektor readers to participate. in each column and in each of the 4><4 boxes (marked by the thicker black lines). A number of dues are given in the puzzle and these determine the start situation. Correct entries received enter a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. Before May 1,2010, send your solution (the nu mbers i n the g rey boxes) by email, fax or post to Elektor Hexadoku - 1 000, Great West Road - Brentford TW8 9HH United Kingdom. Fax (+44) 208 2614447 Email: hexadoku@elektorxom Prize winners The solution of the February 2010 Hexadoku is:95CD4. The £80.00 voucher has been awarded to: Alex Murphy (USA), The £40.00 vouchers have been awarded to: Edwin Velner (The Netherlands), Kaz Tchorzewski (UK) and Ludwing Sanchez Carrillo (Colombia). Congratulations everybody! 5 B D A C 2 3 0 1 2 4 8 0 9 3 F 1 5 8 D 7 2 0 1 E B 9 A 6 4 8 0 C 2 9 1 3 B 7 6 2 1 B 1 D C 0 5 3 A D 1 8 F 4 0 7 F 8 D C 9 A 3 1 9 4 A 8 5 6 8 6 5 7 E F A 8 7 3 5 1 2 9 5 A 0 F 6 7 4 2 5 7 9 D C A 0 1 F 1 C 0 8 D 4 B 6 A 3 8 0 C 7 9 E Cc| PZZL CCtn 1 2 C c D 3 B 8 E 4 5 9 7 A 6 F F 7 3 8 C E 4 9 G 1 6 A D 5 2 B E D 4 5 A F 6 G 7 B 2 3 1 C 8 9 6 9 B A 1 2 5 7 8 C D F 3 G E 4 C 3 8 B 7 1 9 5 C D 4 6 2 E F A 4 C 9 1 8 D E A F 7 B 2 G 3 5 6 5 E D F 3 6 C 2 9 8 aJ G 4 1 B 7 A 6 7 2 B 4 G F 1 E 3 5 8 9 C D 8 F A E 2 7 1 6 3 G 9 4 5 B D C D B 5 6 9 G 3 E A 2 C 7 F 4 1 8 7 C 1 3 F C D 4 5 6 8 B 9 2 A E 2 4 C 9 5 8 A B D f E 1 6 7 G 3j 3 1 [> 4 E B 2 D 6 5 7 C A 8 9 G 9 8 E 7 C A F C 2 3 1 D B 6 4 5 8 A 2 D 6 5 8 3 4 9 G E C F 7 1 C 5 6 C 4 9 7 1 B A F I 8 E D 3 2 The competition is not open to employees of Elektor International Media, its business partners diid/or associated publishing houses. 76 04-2010 elektor RETR0N1CS G4WIM 24cm ATV Transmitter (1994) By Jan Suiting, PEiCSI (Elektor UK/US Editorial) I n the ea rly 1 990s, activity in the 23 cm amateu r rad io ba nd ( 1 250- 1300 MHz) soared due to the arrival on the market of wideband RF power amp lifier mod tiles that a I lowed easy generation of tra ns- mitter power levels in the watts range. Most of these units were Motorola and Mitsubishi made and originally designed as drop-in power amps in base stations of 800/900 MHz cellphone networks which were rolled out at a terrific pace at that time. In the years before the modular RF power amp, hams on 23 cm had a choice of ( 1 ) being happy with a few milliwatts, ( 2 ) juggling with expensive transistors, or (3) going through immense trouble to build a high power amplifier using tubes (usually 2C39s). The 23 cm radio amateur band got its name from the section with most activity; 1 296-1 298 MHz where phone, CW (moonbounce) and SSB reigned. However In most 1ARU zones the band extends down to 1250 MHz offering plenty of space for "new* operating modes so wide they cannot be accommodated in any of the lower bands like 70 cms. 24 cms were "new pastures green" for amateur television (ATV) users. Finally these guys had a chance of using wide- band FM for their TV transmissions. Luckily, at the same time, ana- logue satellite TV receivers like the Amstrad were widely available, first at low prices and then free out of skips and trash cans. Then Mitsubishi stopped being fussy about supplying their M67xxxx RF power modules as one offs. A techie hotbed was created and the popular- ity of FM ATV of 24 cms was boosted further by many repeater stations installed at elevated posi- tions, all built, operated, maintained and paid for by kind souls. In February 1994 Tim For- tester G4WIM published a classic in the history of Ele- ktor: a compact PLL control- led ATV transmitter with 1,5 watts output power for use at 24 cms (1 250-1 270 MHz). The double sided high-qual- ity board and kit of hard-to-get parts supplied by Tim himself all added to an excellent repeatabil- ity factor. The project deservedly became popular and got built, cop- ied, extended, bashed, tweaked and improved by hams all over the world (what do you mean 'open-source’?). Including Dutch radio amateur Geert Jan de Groot PEI HZG who kindly supplied his ATVTX and spurred me on to write this instalment. Geert Jan's modifications to the original G4W3M/E!ektor design include an add-on board for 3-channel selection (instead of 2), PLL rewiring for operation at his favourite frequencies (1279/1265/1252 MHz) and combining "power on/off with the IX power level switch. A further switch allows the sound subcarrier to be switched off (useful for measurements). As recommended in the 1 994 article, the transmitter was built into a diecast enclosure with the heatsin k secu red to the bottom panel to help the M677 1 5 module keep its cook In the 24 cm band, whether using ATV or any other mode, every- thing depends on your antenna and its height. Low-loss coax cables rule, as well as parabolic dishes, G3JVL loop yagis and other direc- tional antennas preferably mounted at the top of a high mast. The G4W1M transmitter being such a compact design, 12 -volt powered and having enough output power to carry camera signals over a few miles to a base station, portable operation was within easy reach and "portacam ATV' was often used to amuse the gen- eral public at special events. With this in mind, and to keep the sta- tion cost down, Geert Jan built a double-quad antenna from 5/8- snch PVC conduit and a matching T junction box. A piece of dou- ble sided unetched circuit board acts as the reflector and a length of stiff copper-plated wire was bent into the well- known "quad 1 shape mounted at the front of the conduit. The yellow conduit can slide in the T piece — note the black marking to indicate the optimum distance between the quad and the reflector. Tim Forrester G4W1M also published an IMBFM transceiver in Elektor September 1992. At the time of writing he is still active as a radio amateur. ( 090882 ) Retronics is a monthly column covering vintage electronics including legendary Elektor design s. Contributions, suggestions and requests are welcomed: please send an email to editorQPelektoncom elektor 04-2010 77 ELEKTO ^SHOWCASE To book your showcase space contact Huson International Media Tel. 22 (0) 1932 564999 Fax 0044 (0) 1 932 564998 ARMAIDE www.armafde.com An integrated software development system targeting NXP LPC200Q-family microcontrollers. * Efficient native ARM7 code without C or assembler * Suits Pascal / Delphi programmers * IEEE Floating-point Real support Professional software at hobbyist prices. ATOMIC PROGRAMMING LTD www.atomicprogramming.com * AP-114 ISP/JTAG Programming System * JTAG Programming and Testing * Boundary Scan Testing * Universal In-System Programming * EEPRQM arid SPI Flash Out-of-Circuit Programming * Generic GDB Proxy Server M * Jennie JIM5148 ZigBee Development Applications * Training Platform available - X •- -Cj // * T AVIT RESEARCH www.avitresearchxo.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10,00. WC ran BETA LAYOUT www, pcb-poof.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer's prices. ByVac www.byvac.com • PIC32 With BASIC • ARM With Forth • USB to I2C • Serial Devices • VT100 LCD Displays DECIBIT C0.LTD www.deciblt.com • Development Kit 2.4 GHz • Transceiver nRF24L01 • AVR MCU ATmegalBB CEDA www.ceda.in ceda@vsnl.com e-learning $5 Hourly * PCB Layout @ S5 Hourly * Learn PCB Designing with Multimedia DVD in OrCAD, PADS & ALLEGRO * Seif or e- learning with support by email, phone & web-meeting DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services, • Marine (Security. Tracking. Monitoring & control} • Automotive (AV, Tracking, Gadget Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0) 845 5192306 BLACK ROBOTICS www.blackrabQtics.CQm 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 ISlH.nl | ic -.wl In vs- Hra-*l. nc ■ rl Ib-i EASYDAQ www.easydaq.biz • USB powered, 4 relays + 4 DIO channels • Will switch 24GVAC @ 10A • LabVIEW, VB, VC, C#, Java • Screw terminal access • Free shipping • From £38 Design & supply of USB. Wireless. LAN, internet & Serial Relay, DIO & DAG products. info@easydaq.biz EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com Europe's leading device programmers manufacturer: ^ V?* * reliable HW: 3 years warranty for most programmers * support over 52.000 devices * free SW updates * SW release: few times a week * excellent technical support: Algorithms On Request. On Demand SW * all products at stock / fast delivery First Technology Transfer Ltd * FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.CG.uk • Training and Consulting for IT, Embedded and Real Time Systems • Assembler C, C++ (ail levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas, II, Freescafe • CMX, uCQSli, FreeRTOS, Linux operating systems • Ethernet, CAN, USB r TCP/IP, Zigbee, Bluetooth programming FLEXIPANEL LTD www.flexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors Instruments A Rohde&Schwarz Company 0 Oscilloscopes 0 Power Supplies 0 Radio Frequency Measuring instruments Programmable Measuring Instruments 0 Great Value in Test & Measurement www.hamegxom 78 04-2010 eiektor products and services directory FUTURE TECHNOLOGY DEVICES http :// www.ftd ECh f p . co m FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB HEX WAX LTD www.hexwak.com Worfd leaders in Driver-Free USB JCs: * USB-UART/SPI/I2C bridges * TEAleaf-USB authentication dongles * expand 10- USB I/O USB expander * USB-RleSys flash drive with SPI interface * USB-DAQ data logging flash drive RFID COMPONENTS h ttp/w w w. a pdang i ia, org * u k For DIY, OEM's & Experimenters • EM41QQ 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's EM4095 - U2270B * microRFID module (similar to Core 1012) * Free Reader download - Technical pages Order online 24 hrs - Tel: 01244 520684 MQP ELECTRONICS www.mqp.com * Low cost USB Bus Analysers * High, Full or Low speed captures * Graphical analysis and filtering * Automatic speed detection * Bus powered from high speed PC * Capture buttons and feature connector * Optional analysis classes ROBOT ELECTRONICS http://www.robot-electranfes.co.iik Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers USB INSTRUMENTS http://www.usb-instrumenfs.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, WWW. elektor. com ROBOTIQ http://www.robotiq,co,uk Build your own Robot! Fun for the whole family! Now, available in time for X-mas * Arduino Starter Kits *NEW!3* * Lego NXT Mindstorms * Affordable Embedded Linux Boards * Vex Robotics (kits and components) * FOB Robots (kits and components) email: sal es@robotiq, co.uk Tel: 020 S669 0769 V1RT1NS TECHNOLOGY www.virtins,com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. SHOWCASE YOUR CO Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £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 — -| 1 wish to promote my company, please book my space: • Text insertion onl_\ for £242 + VAT * Text and photo for £363 + VAT NAME- ORGANISATION- I ~l I I ’!. > J i + P * r a *4 fen ttHri Hti PBB-BB-BB-BB-aB-B'Jpe-PB-P9-Pi + aB-i + P'P- + fi + P + i + B + Pafc!Pp!i»B-r* + B-PB-PB-rB + piri#fe + PB P •> v V. J ■* “b 1 li 'hj* J 1 * I ’■J ■ ” ■ ■■■ r a ■ a r a i ■■■■■ i ■■>■■■ i ■■■■■■■■■■ t i r ■ r ■■ j ■ i i j i j l ■ j XU [_j K J I + B4M MM P » ¥4 *4 M * * i + I + i + ■ + i + ■ + ■ t M fl + l + It I * it It P * M H P ■! ¥ 4 H M + l + l + H M MM H MH M H PI M + l PIPI + I + EIH PI Pi P * H * i Pa P a r a a- a r a r a r bib a a a ■ ■ a a a aa a a a aa aa aa aa a aa r ■ a a. ■ a ■ a ■ a a a ADDRFSS- J k 1 — p I / 3 \ I. j LJ a j" b ji ■ n ■ a a a ■ ■ lb ■ j ■ j lb La ■ a La i. a .l a a a a. a a _ > a a - i a a a, a i. a ai a a. a a b ■ l j b j b a a ■ bj bj lj La La La La l a .L a a - ■ l i bj b a La La La La La La lb La lb ■ a l a l a a lb lb lb lb lb l b l _ l _ i _ l . a - a s ... _ a _ .. .a _ - r _ aTaipa 1 - - pa aa Pa H H ra a a a a -a a pa pa ra pb r a i- a ■ a r b a a r b a a ■ a a pa pa pa pb pb r a a a aa ea pa r a a a a- a a a a aa-aaaa pa papa pa Pa pa ■ p a r a r a .p TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO OO-44-(0)l932 564998 rn M PA N Y N A M F V_- i Til r l! ’ 1 I " il L TP ■ a aa a pa Papa r a ra pa pa pa r a P a r P 4 p a P a H M ¥4 M + l P‘l + §*P*»#*-Pi + i + i'pl + pii M + + ■ P M p I * ■ % IP I » I + M MHH MH M p a -p a p WEB ADDRESS 30- WORD DESCRIPTION... ...aiBi.LLBL.ILa a + a aa a ■ aa LB LB LB LB.LBB b i PB-aa-Pa pa M M M M M P ■ i i i . i . i . i L IBBLBBBLBI .ILib iLli.l. lb lLILBL.IBLBILI.i J elektor 04-2010 79 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Going Strong A world of electronics from a single shop! articles included n^ore tnan Elektor Design Guides Application Notes Driver limited Period Offer for Subscribers’. £5 DISCOUNT www.elektor.com|L Elektor Designer’s Companion Tools I OpticTJ Sensors^ Thermal' 'Controller S&e the light on Solid State lighting DVD LED Toolbox This DVD-ROM contains carefully-sorted comprehensive technical documentation about and around LEDs. For standard models, and fora selection of LED modules, this Toolbox gathers to- gether data sheets from all the manufacturers, application notes, design guides, white papers and soon. It offers several hundred drivers for powering and controlling LEDs in different configura- tions, along with ready -to -use modules (power supply units, D MX controllers, dimmers, etc.). In addition to optical systems, light detectors, hardware, etc., this DVD also addresses the main shortcoming of power LEDs: heating. This DVD contains several Elektor articles (more than 100 } on the subject of LEDs. ISBN 978 90-5381-245-7 - £28.50 * US$46.00 Embedded USB Know How USB Toolbox This CD-ROM contains technical data about the USB interface. It also includes a large collection of data sheets for specific USB components from a wide range of manufacturers. There are two ways to in- corporate a USB interface in a microcon- troller circuit: add a USB controller to an existing circuit, or use a microcontroller with an integrated USB i interface. Both op- tions are available on this CD-ROM. Includ- ed on this CD-ROM areUSB Basic Facts, several useful design tools for hardware and software, and all Elektor articles on the subject of USB, ISBN 978-90-5381-21 2-9 £19,90 * US $32, 10 Software Tools & Hardware Tips Ethernet Toolbox This CD-ROM includes a collection of data sheets for dedicated Ethernet interface I Cs from many different manufacturers. It pro- vides a wealth of information about con- nectors and components for the physical layer (PHY) and specific software tools for use with the Ethernet (Software). To help you learn about the Ethernet interfaces, we have compiled a collection of all articles on this topic that have appeared in Elektor and complemented them with additional documentation and links to introductory articles on Ethernet interfaces. The docu- ments are PDF fifes. ISBN 978-90-5381-214-3 £19,50 * US $31 ,50 8o 04-2010 elektor Prices and item descriptions subject to change. E, & O.E A whole year of Etektor magazine onto a single disk DVD Elektor 2009 The year volume DVD/ CD- ROMs are among the most popular items in Elek- tor’s product range. This DVD-ROM con- tains ail editorial articles published in Volume 2009 of the English, American, Spanish, Dutch, French and German edi- tion s of Elektor Using the supplied Adobe Reader program, articles are presented in the same layout as originally found in the magazine. An extensive search machine is available to locate keywords in any arti- cle. With this DVD you can also produce hard copy of PCB layouts at printer reso- lution, adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other pro- grams. ISBN 97 8 '90 -53 81 *251-8 El 7.50 - US $28*30 1 1 0 issues, more than 2,100 articles DVD Elektor 1990 through 1999 This DVD-ROM contains the full range of 1990-1999 volumes (all 1 1 0 issues) of Elektor Electronics magazine (PDF). The more than 2,100 separate articles have been classified chronologically by their dates of pu bl ica tio n ( mo nth / yea r) t b ut a re also listed alphabetically by topic, A comprehensive index enables you to search the entire DVD. ISBN 978*0-905 705-76-7 £69.00 » US$111.30 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- taic a nd thermal solar technologies, 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 170 V DC bus, commercial solar charger design with detailed circuit explanations, wind generator electric machine electromechanical theory, wind converter design requirements and the series -L zero-current-switching converter and power supplies found inside loads connected to home power systems and their potential problems and conse- quences for inverters. 192 pages * (SBN 978 0-905705-83-5 £2490 * U5 $40.20 r ^ More information on the Elektor Website: www.elektor.com Elektor Reg us Brentford 1 000 Great West Road Brentford TW 8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Fmail: I ps@elektor.com r Home electric power Your own Eco-Electrical 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 or maintain a home electric system off the utility grid are presented in an easy-going style. This booklet will help you to safeg yard or de- velop your own home electricity supply. It conta in sstep - by -stepcalculations, practi- cal details, examples and much more. 96 pages * ISBN 978-0-905705-82-8 E 76-50 * US $26.70 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 PCs 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/RS232 converter com muni cation link 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 * ISSN 97 8 0-9 05795 -84- 2 £29.50 - U5 $47,60 elektor 04-2010 81 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Learn more about C# programming and .NET C# 2008and.NET programming This book is ai med at Eng ineers and Scien- tists who want to learn about the , N ET en- vironmentand C# programming or who have an interest in interfacing hardware to a PC. The book covers the Visual Studio 2008 development environment, the .NET framework and C# programming language from data types and program flow to more advanced concepts including object ori- ented programming. 240 pages * ISBN 978-0-905705-8 1-1 £20.50 * US 547.60 COMPUTE PRACTICAL MEASUREMENT SYSTEMS w mh -i" i 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 komputers running the Windows operating system. it f s use of modern techniques in detailed, numerous examples has been designed to s h o w c I ea rfy h ow strai g h tfo r wa rd i t ca n be to create the interfaces between digital and analog electronics, programming and Web-design. Readers are encouraged by examples to program with ease: the book p rovides c lea r g u idel i n es a s to th e appro p ri- ate programming techniques “on the fly". 292 pages * ISBN 978 0-905705-79-S £28,50 * US 546.00 v y (March 2010) Theexternal appearanceof this small mo- dule with an LC display almost belies what it has inside: a complete stereo preampli- fier and final amplifier with I R remote con- trol. adjustable tone, volume and signal levels, and an output power of 2 x 20 W (Class D), all with a single 1 2-V supply vol- tage. This ma kes it perfect for use in a car, boat or motor home. PCBs, SMD-populated, and all other components nAmp Contro (February 2010) A variety of remote control devices for Winamp and other PC-based media pla- yers have been available for a good wh I le. All of these systems have 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 sophistication as the virtual Winamp design, you need a physical progress bar. In this project 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 c □ m b i n ed I nd i ca to r a n d entry de v ice* Kit of parts, including PCB (December 2009) EEektoCs Software Defined Radio (SDR) is deservedly popular. The performance of a receiver depends to a large extent on its i nput filters, A selective input circuit i im- proves anten na matching and imm unity to i nterference from other strong signals. This preselector allows the use of up to f o u r f i I te rs , tu n ed u nd er soft wa re con tro 1 using varicap diodes. A tuned loop anten- na is also described that lets you use our SDR without an outdoor antenna. Kit of parts, contains partly populated hoard , coil formers, ferrite rod with coils (September 2009) The compact GBD2 Analyser in the June 2007 issue w r as an enormous success - not surprisi ng 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 Elek tor's standalone analysersets new standards for a DIY OBD2 project. The key advan- tage of this OBD2 Analyser NC is that it's self-contained and can plug into any OBD diagnostic port. Kit of parts including DXM Module, PCB 5/11 D-p refitted, case, mounting materials and cable 82 Prices and item descriptions subject to change. E. Sr O.E 04-2010 elektor April 201 0 (No. 400) £ USS Uni Lab 090786-1 Printed circuit board * 16,00. 26.00 090786-71 .... PCS and all components, less power transformer www.elektor.com Small is Beautiful: Minimodi 8 09077 3-4 1 „„ Pro gra mm e d co n trol ler wi th Bootloader pre-programmed 2 1.80. ......36.00 090773-91 .... PCB, populated and tested with Bootloader pie -p rogram med 56.00 .90 .00 Bluetooth forQBD-2 090918-71 PCB with SMOs fitted. BTM222 Bluetooth module..,.. 26.70. 43.00 Fun with Fireflies 100014-1 Printed circuit board 1 1.00., .....18.00 100014-41 .,.. Prog ram med cont ro 1 1 er. 1 1 .00, ..,.,.18.00 Beep. beep... Sesame 081 143-41 ....Programmed controller.... 15.50 25.00 5 V Power Controller 09071 9- 1 ...... Printed circuit board 8.90 1 4,50 March 2010 (No. 399) Reign with the Sceptre 090559-91 .... PC8, populated and tested, test software loaded „.. www.elektor.com Modulo 0 090563-71 .... PCB, SMD- populated, and all other components 69.90 1 1 2.80 February 2010 (No. 393} Battery Checker 071 131-41 ...,ATmega32-16PU. programmed,... 17,80 ,.28.80 071 131-71 .... Kit of parts, extl. enclosure.... 124,00 200-00 Winamp Controller 0 —1 0 531 1 Is 1 1 o 1 p arts . . . . . , . . . . . . . ........ , ....... ...... . ..... . .... . J . 0 0 ..... 1 1 3 . 6 L* The ATM 1 8 Radio Computer 090740-71 .... PCB with Si4734/35 radio 1C ready mounted and tested iitritritriiiitiiiiiiiiiititriiiiiTiiiiMirrimr 27.50 44.40 January 2010 (No, 397) USB Magic Eye 090788-1 Printed circuit board .. 090788-41 .... ATtiny23T3-20PU 1 programmed MIAC for Home Automation 090278-91 .... Populated PCB in enclosure Dimmer with a Micro 090315-41 PIC12F629A. programmed 0 ete m ber 2 009 ( N o, 396) Preselector for Elektor SDR 090615-7 1 ... Kit of parts, contains partly populated board ..9.90 16.00 ,.9.90 16.00 154.00 248.40 , I * B J I I J B B .1 a I. 7.60 b + 4 12.30 coil formers, ferrite rod with coils,,.,., 47,00,... ...75.90 Top -of-the- Bill Lights Sequencer 090125-1 ...... PCB, bare (master module) 10,80,,.. ...17,50 0901 25-2 PCB, bare (lamp module) 2,30.,.. 3,80 090125-41 Controller (PIG 8F255C) for main PCB, programmed 14.50.... ...23.40 090125-42 .... Controller (PIC1 2F508-I/5N) fo r lam p u n it, prog ram med 2 30 .... 3.80 The Vi kings Are Coming! 080948-71 .... Kit of parts: bare PCB and bluetooth module BTM222 23.70..,. .,.38.30 MfnimalisticTIme Switch 090823-41 .... PIC1 2F683-I/5N, programmed 6.50... ...10.50 November 2009 (No. 395) Solder Station ‘Plus' 090022-41 .... PIC1SIF45 20 .programmed 11,50 18,60 AVR-Max Chess Computer 081101-1 Printed circuit hoard 12.90 20.90 081101-41,.,, Prog ra mm ed co ntroller AT m ega8 8 „ . 1 1 , 50 h+ . . 1 8 .60 081101-71 Kit of parts inch PCB. programmed control ler and components. 29.90, + „.„48,30 Complete practical measurement using a PC ISBN! 978-0-905705-79-8.... £28.50 US $46-00 3 C# 2008 and .NET programming ISBN 978-0-905705-81-1 .... £29.50 US $47.60 Practical 4 5 1 2 3 4 5 1 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.... £16.50 US$26.70 DVD Elektor 2009 ISBN 978-90-5381-251 -8.... £1 7.50 US $28.30 DVD Elektor 1990 through 1999 ISBN 978-0-905705-76-7.... £69.00 ...US$11 1 .30 DVD LED Toolbox ISBN 978-90-5381-245-7.... £28.50 U5 $46.00 Ethernet Toolbox ISBN 978-90-5381 -21 4-3.... £19.50.... US$31.50 ECO 5 ISBN 978-90-5381-159-7.... £24.90 US$40.20 SDR Preselector Art. #09061 5-71 £47.00 US$75.90 2 3 4 5 WinAmp Controller Art. # 090531 -71 £85.00 ... US $ 1 43.60 R32C/111 Starterkit Art. #080928-91 £27.00 US$43.60 Modulo D Art. #090563-71 £69.90 ...US $1 1 2.80 Battery Checker Art. #071 131-71 £124.00 ...US $200.00/ www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH * United Kingdom TeL +44 20 82614509 Fax +44 20 82614447 Email: sates@elektor.com elektor 04-2010 S3 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR dsPIC Development Board Thb powerful control board with a i6-bit dsPIC3oFGoio offers plenty of application scope including motor control. The base board has interfaces for USB, RS232, CAN, PC and ICD2, There are also four DACs and all essentia! signals are bonded out to expansion connectors. The expansion board described in the same edition has even more connectivity to offer. Fast Responding C0 2 Meter A new CO. meter was specially developed by Elektor Labs for use in confined spaces like cars. Thanks to the use of a sensor based on CCh level detection by Infra red light the meter lias hardly any warm up time and should be ready to take measurements a minute or so after switch-on. Measured data are processed by an ATmega MCU that also takes care of driving a two-line LCD. Auto Balancer for liPo Battery Packs With lithium -polymer battery packs it's essential to keep a close watch on the charge distribution between cells to prevent one of these from being overcharged or deep dis- charged, Typically, special ICs are used for this purpose but this project shows that stand- ard components can do the job equally well. A single LM324 and some power Darlington transistors are sufficient for a battery pack with up to five cells. Article titles and magazine content s sohjcc i la change; phase check the Magazine tab on www.eiektor.com Eiektor UK/European edition: an sale April 22, 20 jo . Liektor USA edition: published April 15, w.elektor.com www.eIektor.com www.elektor.com www.elektor.com www.elektor.com 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. 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 0lektor Hlnftiiinf Etficp 84 □4-2010 elektor Description Price each Qty. Total Order Code DVD Elektor 2009 ffiga £17.50 PIC Cookbook for Virtual Instrumentation £29.50 Complete practical measurement systems using a PC £28,50 Practical Eco- Electrical Home Power Electronics £2a.90 Your own Eco-Electrical Home Power System eis.so Sub-totai Prices and item descriptions subject to change. The publishers reserve the right to change prices P&P without prior notification. Prices and item descriptions shown here supersede those in previous issues. E. & O.E, Total potd METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) i | Giro transfer □ ™ isT □ Expiry date: Verification code: Please send this order form to ' ( see reverse for conditions ) Elektor Regits Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Address + Post code Tel Email Date Signature ELG4 Tel.: +44 20 8261 4509 Fax: + 44 20 8261 4447 www.elektor.coin sales “'efektor.com USA and Canada residents should use S prices, and send the order form Lo: Elektor US PO Box 180 Vernon CT 06066 USA Phone: 860-875-2199 fax: 860 871 04(1 £ - ina 1 1 : sa les A l 1 I s: k to r. c um Yes, I am taking out an annual subscription I to Elektor and receive a free 2GB MP3 player* I would like: □ □ Standard Subscription (1 1 issues) Subscription-Plus (11 issues plus the Elektor Volume 2010 DVD-ROM + exclusive access to www.elektor-plus.com) Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject lo availability , Sec reverse for rotes and conditions. Name Address + Post code Tel. Email Date Signature METHOD OF PAYMENT (see reverse before ticking as appropriate) i Bank transfer | 1 Cheque (UK-resident customers ONLY) □ Giro transfer □ D tS T n Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Td.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektoi.com subscription s* elektor. com £L04 ORDERING INSTRUCTIONS, P&P CHARGES All orders, except for subscriptions (for which sec 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 £11 *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. IB AN: GB35 ABNA 4050 3040 2095 20, Bit: ABNAGB2L. Currency: sterling (UKP)* Please ensure your full name and address gets communicated to us* Cheque sent by post, made payable to Elektor Electronics* We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre* Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL- protected for your security, COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine* if difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran- tee this time scale for all orders. Returns Faulty goods or goods sent In error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK): 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 1 0% 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 privaLe and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of. or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. January 2010 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 See www.elektor.com fusa Canada £75*95 for specie! offers HOW TO PAY Bank transfer into account no. 40209520 held by Elektor Elec- tronics* with ABN-AMRO Bank, London. EBAN: GB35 ABNA 4050 3040 2095 20. BIC ABMACB2L 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-1 52-3801 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. 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 fora 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 £39.20, a Student Subscription -PI us costs £51 .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% (tw r enty-five per cent) of the full subscription price or £7.5G f whichever is the higher, plus the cost of any issues already dispatched. Subscriptions cannot be cancelled after they have run for six months or more. January 2019 DVD Elektor 2009 i=> A whole year of Elektor magazi onto a single disk aztne The year volume DVD/CD-ROMs are among the most popular items in Elector's product range. This DVD-ROM contains all editorial articles published in Volume 2009 of the English, American, Spanish, Dutch, French and German editions of Elektor. Using the supplied Adobe Reader program, articles are presented in the same layout as originally found in the maga- zine. An extensive search machine is available to locate keywords in any article. With this DVD you con also produce hard copy of PCS layouts at printer resolution, adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other programs. rag® Annuo' jobbers Anno* joorgnf^g Anuel lektor Elektor Reg us Brentford 1000 Great West Road Brentford TWS 9HH United Kingdom TeL +44208261 4509 L Further information and ordering atwww.elektor.com/shop Index of Advertisers Armyide, Showcase. . , APD. Showcase ...... Atomic Programming Lid. Showcase Avit Research, Showcase AxeMotion . Beijing Draco Electronics Ltd Beta Layout, Showcase Black Roomies. Showcase . . . . . . ByVac, Showcase ...... CEDA. Showcase. Deceit Co. Ltd, Showcase Designer Systems, Showcase EasyOAO. Showcase Easysync, Showcase Elnec, Showcase Euro circuits , First Technology Transfer Ltd. Showcase . . HexiPanel Lid. Showcase Fulufc Technology Devices. Showcase .... Hameg, Showcase www.amtaide.CQm . . . . .78 mm.apdanglia.Qrg.uk ... 79 www. atomieprogramming. com .... 78 www.avitreseaftti.coMk .... 78 mvw.axefnatinfi.com .... 31 ivww.ezpct.com . . , , 31 www.pcb-poot.com . 37. 78 www.btackrobotiCS.com .... 78 www.bywc. com ........ , . ... 78 www.ceda.tn, „ , .... 78 www.decibit.com .... 78 WWW. (Je$igner$ystems. co.uk .... 78 www.easydaq.biz . ... 78 wwwsasysync.co.uk .... 78 www.etnec. com . , . . ..78 www.eurocircoits.corn ,...73 WWW.ftLco.uk. . . , 78 www. f texipanet.com .,,.78 1 vww.ftdichip.com . . 2, 79 www.hameg.com 78 HexWax Ltd. Showcase Latic enter. ... MikroElektronika MOP Electronics, Showcase Nufve Networks Parallax ........ Peak Electronic Design. Pico. Quasar Electronics Robot Electronics, Showcase. Ro hotter Showcase Showcase USB Instruments, Showcase Vi r tins Technology. Showcase . www.hexwax.com 79 wwwJabcenter.com . . 88 mvsvmiikfoe.com 3 wmv.mqp.com. . . , 79 wmv.xgamcstetiOfi.cOfii 73 www.parattax. com ... 61 www.peakeiec.co.uk. ... 31 www.picotech.com/scopBiG63 . . 21 www.quasareIectrofitcs.com . . . . 47 www. robot-electronics, co. uk . . . . 79 www.robotiq.co.uk 79 f- « B- + 1 *■ + !■■■• + + 0 ■ 1 + #■ I 4 + 1 ii * + p * , . . . 73. 79 www.usb-instruments.com . .... . 79 vfww.virtins.com. ............. 79 - + ■ + § ■ + 1 P “ Advertising space for the issue 20 May 2010 may be reserved not later than 20 April 2010 with Huson International Media * Cambridge House - Gogmore Lane - Chertsey, Surrey KT16 9AP - England - Telephone 01932 564 999 - Fax 01 932 564 998 - e-mail ros.elgar@liusonmedia.com to whom all correspondence, copy instructions and artwork should be addressed, elektor 04-2010 s? 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 han ever to navigate and understand targe, multi-layer boards. PROTEUS DESIEN 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