December 2009 AUS$ 13.90 - NZ$16.90 - SAR 99.95 www.elektor.com Preselector for Elektor SDR Here’s the automatic tuning upgrade! Energy Savings from Home Automation Standards compared Technology Projects Christmas Holidays Circuits r pages of beginner’s and junkbox projects I E L E K T 0 R F 0 U N D A T 1 0 N Elektor Foundation The Award follow the stor 770268 45115 fULMMIX Low Cost - High Qualify PCB Prototypes Easy Online Ordering Full DRC included Lead-times from Shrs Optional Chemical Tin finish no extra cost cm oil: sate 5 iff pcD-pooi.com Free Phone UK: 0300 389 8560 com Simply send your Files & order ONLINE / E tXJLl t > r r 7 ’ , 4-r- 1 _^!P “ I Hr | J J i >Jl"1 L L L^l p, c _ * ■, iP Jr Up g p%r | ■ J ■ > V *jiP HE JL” A'M p i r mm Jri 3 Ihbl » +± V a, p ■RBTkj + i ^ ii ' ■ i" llli: PB - i i ™ * DEVELOPMENT TOOL... Complete AVR development solution ...JUST THE WHY YOU LIKE IT III Speed up your prototype development with the EasyAVR6 Development System. The EasyAVR6 comes packed with examples that makes your AVR development fast and easy. Save time & money! Get extra value for your money with this first-class tool for AVR development solutions. Get into the AVR world faster and easier than ever before with the EasyAVR6 Development System. Designed to suit your needs Your development time can be considerably reduced, resulting in an early prototype design and fast time- to-market for your end product. Everything you’ve always wanted from a development tool Experience the ease of creating your own electronic devices! Thanks to many new features, you can start creating your own devices immediately. EasyAVR6 supports 8-, 14-, 20-, 28- and 40- pin AVR microcontrollers. The on-board USB 2.0 Programmer enables very efficient and fast AVR microcontroller programming. Examples in C, BASIC and Pascal are provided with the board. Connector for the JTAG Debugger is on-board and enables efficient debugging at hardware level Port Expander provides easy I/O expansion (2 additional ports) using serial interface Full-featured and user- friendly development board for AVR microcontrollers On-Board 2x16 Serial LCD Display Keypad enables easy and fast data entry Hig h- Perform a nee USB 2.0 On-Board Programmer L '.l 1 ' f ■ ■ Find your distributor: http://www.mikroe.com/en/distributors/ mikroilektronika SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD www.mikroe.com Goodbye Standby This piece is traditionally the last copy I have to hand to my colleague in the page layout department. Time flies — this December 2009 edition is the last of the decade, and although at the time of writing it’s early Autumn, January20io production isalready upon the entire Elektor team. This edition tackles issues that are sure to keep us busy and concerned over the next decade, with a prominent role for energy, natural resources and the environment — globally! The European Commission is dead serious about it all and with my sincere advice to our American readers that “it ain’t half bad if you see it coming”, they successfully pulled all incandescent lamps with a matt bulb and/or a wattage of more than 75 from active retail on September 1. That was just the start of it — more drastic measures will follow in the new year, so let’s see what’s cooking — on the EC’s electric hub, of course. From January 7, 2010, new household and office equipment is limited to a power con- sumption ofi (say, one) watt when switched off but in standby mode, or 2 watts when a display is still active (for example, a clock). From 2013, these limits will be tightened to 0.5 W and 1 W respectively. An EC ‘Eco-Design’ initiative rules that from April 27, 2010, “external power supplies” (a.k.a. wallwarts) are forced to behave sparingly, too. They are allowed to con- sume 0.5 watts of power under no-load conditions, dropping to 0.3 watts exactly one year later. The efficiency of equipment in actual use is also ‘regulated’ by Brussels and there we have no objection, in fact the article ‘Squeezing Out the Last Drop’ on page 31 not only reveals mediocre design of some power supplies in respect of effi- ciency, but also suggests rather simple ways of saving lots of kilowatt-hours on an annual basis. Back to the calendars, limiting values and deadlines have been set for lots of other electrical equipment like TV sets (Janu- ary 7, 2010), advertising signs (February 2, 2010), electromotors (June 16, 2011) and cir- culating pumps (January 1, 2013). Electricity metering will also be reviewed massively as a result of flexible rates and ‘smart meter- ing’, so the main two themes of this issue, energy saving and home automation, do go hand in hand. |an Buitinq Editor 6 Colophon Corporate information on Elektor magazine. 8 Mailbox / Corrections & Updates A compilation of letters to the Editor. 10 News & New Products A monthly roundup of all the latest in electronics land. 14 Home Automation Standards Roadmap or Tower of Babylon? 20 Open Standards for the Automated Home X10, KNEXand DigitalSTROMcompared. 26 Preselector for Elektor SDR The long awaited automatic tuning upgrade. 31 Squeezing Out the Last Drop How to make your electronics devices (even) more energy efficient 36 Top-of-the-Bill Lights Sequencer A highly original and challenging design for an Xmas rope light. 43 BLDC and PIM modules added to RS Components’ EDP New boards on the block! E-Labs report. 44 Elektor Developers’ Conference Edition 1 What’s brewing in the Elektor design department? 4 12-2009 elektor UUP CONTENTS Volume 35 December 2009 no. 396 20 Open Standards ] for the Automated Home There are lots of home automation standards around but just which ones are sufficiently open to allow DIY hardware to be developed, and have the advan- j tage of being supported by more than one manufacturer? We investigate. 48 Christmas Holidays Circuits Bat detector (48) Backdoor alarm (49) Poltergeist (50) Power cut alert (51) Mini radio gives maxi sound (53) Nostalgic tube sound from an 1C (54) A higher note. ..(55) Poor man’s metal detector (57) Efficient camping dimmer (58) Touchless switch (59) I i 26 Preselector for Elektor SDR Elektor’s Software Defined Radio (SDR) is deservedly popular. The preselector described here allows the use of up to four filters, tuned under software control using varicap diodes. A tuned loop antenna is also described that lets you use our SDR without an outdoor antenna. 62 The Vikings are Coming! Our ATM18 AVR board gets a Bluetooth extension. 68 Minimalistic Time Switch Smaller and cleverer than most commercial switching clocks. 31 Squeezing Out the Last Drop Your TV set is never in standby mode, and you’re giving serious consideration to having a solar panel installed on your roof. What else can you do to reduce your power bill without too much fuss and bother? 48 Christmas Holidays Circuits A compilation of circuits for the odd ‘learn-while-u-tinker’ hour you should be able to claim for yourself this December. Most of the parts used in the projects we reckon may be in your junkbox or hidden in a drawer. Good instructive stuff for the Christmas holidays period — have fun! 72 Another two NC Headphones An addendum to our October 2009 NC-Headphones review. 74 Hexadoku Our monthly puzzle with an electronics touch. 76 Retronics: TheZM55oM: an unusual counter valve Regular feature on electronics ‘odd & ancient’. 84 Coming Attractions Next month in Elektor magazine. elektor 12-2009 5 e ektor international media bv Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. llvfctor V VB" k P ANALOOG • DIGITAAL EMBEDDED & MICROCONTROLLERS AUDIO • TESTEN &METEN Volume 35, Number 395, November 2009 ISSN 1757-0875 Elektor aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+ 44 ) 208 261 4509, fax: (+44) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 11 times a year with a double issue forjuly& August. 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@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff Harry Baggen, Thijs Beckers, Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Design staff Antoine Authier (Head), Ton Giesberts, Luc Lemmens, Daniel Rodrigues, Jan Visser, Christian Vossen Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DTP: Giel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com/subs 6 12-2009 elektor E lektor PCB Service \ Your professional * PCBs and Prototypes Elektor PCB Service is intended for prototype builders and designers who want to have their PCBs made to professional standards, and for users who want customised versions of Elektor PCBs. If you need a couple of ‘protos’ with fast turnaround or a batch of 5 to 50 units, we can meet your needs at a favourable price. r The advantages at a glance • No film charges or start-up charges. • There is no minimum order quantity or charge forthis service. • Available to private and commercial customers. • We’ll first check if your project is producible. We’ll letyou knowwithin 4 hours! • In orderto supply two PCBs, we make three. If the third board is also good, you receive it as well - free of charge. • No surprises from the online price calculator • You can use our online payment module to pay easily, quickly and securely with Visa or MasterCard. Procedure: Create your account Place your order Your project is checked Payment Yourorder is shipped — — Now available for everybody at www.elektorpcbservice,.com Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form. Head Office: Elektor International Media b.v. P.O.Box 11 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 207 429 4073 UK Advertising: Huson International Media, Cambridge House, Cogmore Lane, Chertsey, Surrey KT16 9AP, England. Telephone: +44 1932 564999, Fax: +44 1932 564998 Email: r.elgar@husonmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Elektor International Media b.v. and may not be reproduced or transmit- ted in any form or by any means, including photocopying, scan- ning an recording, in whole or in part without prior written per- mission from the Publisher. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guaran- tee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media b.v. 2009 Printed in the Netherlands elektor 12-2009 7 MAILBOX Circuit suggestions for T-Reg T-Reg (‘A High-voltage Regulator for Valve Amps’), Elektor March 2009, article # 081089-I) A second criticism is the complexity of the circuit relative to what it does. I spent a bit of time developing a simplified circuit design based on the operating principle of the control amplifier (differential ampli- fier) used in the T-Reg, with the reference voltage provided by a pair of Zener diodes. The results of this effort are enclosed. The specified component values are chosen for an output voltage of 300 V. This design has the following advantages relative to the T-Reg design: 1 . Reduced circuit complexity and compo- nent count 2. No need for a second supply voltage 3. Comparable regulation performance, and in some regards even better (such as dynamic load regulation) 4. Use of commonly available components Dear Editor -- 1 read the T-Reg article with considerable interest, and I tried out the circuit right away. However, I replaced the two SC291 Os and the two SA1 208s with BF422s and BC327s, since the specified types are difficult to obtain in my country. The basic principle of this regulator is certainly clever, and the stabilisation characteristics of the circuit are very good. However, I simply could not manage to make the circuit work with a normal MOS- FET (such as the BUZ42 or BUZ90) instead of a valve as the pass regulator. There was absolutely nothing to be seen at the output of the circuit. I found this rather puzzling, but a bit of study of the theory clarified the situation. A valve is controlled by a grid voltage that is negative relative to the cathode, but a normal MOSFET only responds to a gate voltage that is positive relative to the source (which takes the place of the cathode). The T-Reg circuit is designed such that the voltage on the grid (or gate) can never be positive relative to the voltage on the cathode (or source). Accordingly, I began to have some slight doubt that the author actually managed to get the circuit to operate properly with a MOSFET. Perhaps the type of MOSFET used in the author’s design (a DN2540) actually has control characteristics similar to those of a valve. If that is so, it would be a service to the reader to point this out, since many readers are inclined to use better known or commonly available components in place of rare or uncommon components. It is actually possible to use any desired type of component with any desired power rating as the pass regulator. In addition to being quite amenable in this regard, the circuit can be built reliably by others. However, there is also a significant dis- advantage. With the T-Reg design, the stabilised output voltage can be adjusted relatively easily by changing the value of resistor R3. It can thus be used without overly much effort to build a bench supply for a hobby lab with an adjustable output voltage, which is admirable. By contrast, my proposed design has a fixed output voltage, although the actual the output voltage can be set over a wide range by selecting Zener diodes with suitable values. If I have aroused your interest in this circuit, on your request I would be pleased to provide a detailed circuit description and a table of component values for some commonly used voltages (200 V, 250 V, and 300 V). Please allow me to make two additional remarks. In my opinion, the question as to whether delayed switch-on of the anode voltage (as suggested by the author of the T-Reg article) is worthwhile with a valve ampli- fier is more of an academic question than a matter of practical benefit. I am not aware of any scientific or engineering treatise according to which it can be concluded that there are any significant disadvan- tages associated with applying the anode voltage without delay while the filaments are warming up. I am not aware of any circuit from the golden era of valves that has delayed anode voltage switch-on. The article in question also brings up another issue. To the dismay of users, authors often make use of unusual (‘rare’) components that cannot be found in regional electronics shops or in the stock lists of the usual postal order merchants. For future issues of Elektor, I would like to see authors mention alternative compo- nents (substitutes) in cases where they feel compelled to use uncommon compo- nents. Alexander Voigt, MD (Germany) We regard your comments as sufficiently inter- esting to publish them here. On request, we would be pleased to post the table ofcomponent values on the web page for the Mailbox section of this issue (www.elektor.com/0909l9). The T-Reg circuit does indeed work as described; after all, it was replicated and tested in the Elektor labs. The DN2540 MOSFET is what is called a depletion-mode MOSFET, which con- ducts with zero gate voltage. A negative gate voltage must be applied to this type of MOSFET to cut off the current, in which regard it does in fact behave the same way as a valve. It would have been a good idea to mention this in the article. However, this is a good example of the fact that in most cases designers use special or unusual components due to their specific character- istics. Consequently, it is often not possible to specify other components as alternatives or substitutes, since other components do not have these specific characteristics. Also, not everyone lives in the same country and may disagree with you on what‘s an ‘unusuaT com- ponent or a ‘ common ’ one. Delayed switch-on of the anode voltage unques- tionably has the advantage that the anode cur- rent can flow immediately after the voltage is applied. This direct application of the load to the power supply prevents the voltage on the filter or smoothing capacitors from rising to the much higher no-load value. As the anode voltage is usually not regulated, this would oth- erwise occur while the filaments were warm- ing up. You may have missed that practically all equipment from the ‘golden era of valves’ as you call it does have delayed switch-on of the HT rail — simply through the use of a valve rectifier. Another advantage of delayed HT is that the 8 12-2009 elektor MAILBOX voltage stress on the electrolytic capacitors is reduced. Of course, this is only true if the switch contact for delayed switch-on of the anode voltage is located ahead of these capacitors. This is not the case with the T-Reg circuit, so it is not a consideration here. A short literature study and some digging in the Philips Technical Review archive gives evidence that valves benefit from a reduced load on the cathodes during the warm-up phase (for exam- ple) by the fact that anode voltage switch-on is delayed during the warm-up phase in lots of Philips’ professional valve circuits. However, we are confident that some of our readers will have more to say about this and may be able to provide references. As usual, knowledgeable information is always welcome. R1,R2,R3 component values Valve MOSFET U E 350 V 250 V R1 wokn lOkCl R2 IkQ. woci R3 7 MCI 7 80 kCl Corrections & Updates Mini Preamplifier October 2009, p. 68-71, ref. 090241-I Regrettably a few errors have crept into the circuit diagram in Figures 1 and 2. In Figure 1 , components K1 and K2 are drawn incorrectly and an indictor is mis- sing between the analogue and digital ground lines. In Figure 2, the relay contacts are drawn incorrectly in their non- actuated state, which suggests all inputs are inter- connected. Also, two miniature chokes are mis- sing in the +12 V and -12 V supply lines. The corrected sections of the circuit diagrams are shown here. The electronic version (.pdf) of the article on the Elektor website contains the cor- rected diagrams. SMD soldering - double whammy Hi Jan — I just picked up my first issue of Elektor magazine and I was excited to see the article on double sided reflow solder- ing (E-Labs Inside, September 2009, Ed.) as that is exactly what I have been trying to figure out. I’ve a question for Antoine regarding his article and I looked for his email but wasn’t able to find it. I wanted to find what kind of glue you used to hold down the 1C chips. I have looked around a bit, but I am not sure what glue to use. Appreciate you sharing your experience. Aaron Moore (by email) Antoine Authier, head of Elektor Labs replies: It’s always a pleasure to share experiences, and here are two c(g)lues :) - ref. SMA10SL from Electrolube; - ref. CB8006-V91 from Loctite. We have actually experimented with both. Everything went well in both cases; the Loctite appears a bit more fluid, depending on your preferences, this may be a feature or a draw- back. Both come in a 10 cc (ml) syringe, the Electrolube came with a plastic needle and a plunger, we got a Loctite Bundle so really no idea if you can have it packaged with these two accessories too. Anyway, the plunger can be replaced by a small screwdriver, any kind of “Luer Lock” compatible needle will fit. When using a hypodermic needle, take care not to stick it into your finger. I believe that these two brands are widely avail- able and you won’t have difficulties to finding them. To conclude I guess any kind of “SMD Chip Bonder” (key word for your favourite search engine) will do the trick. Please do not hesitate to share your experience with us. Together with the members of the Elektor lab team I wish you a pleasant time reading the magazine and experimenting with your projects. MailBox Terms • Publication of reader’s orrespondence is at the discretion of the Editor. • Viewpoints expressed by correspondents are not necessarily those of the Editor or Publisher. • Correspondence may be translated or edited for length, clarity and style. • When replying to Mailbox correspondence, please quote Issue number. • Please send your MailBox correspondence to: editor@elektor.com or Elektor, The Editor, 1000 Great West Road, Brentford TW8 9HH, England. elektor 11-2009 9 THE AWARD - FOLLOW THE STORY E L E K T 0 R F 0 U N D A T 1 0 N Elektor Foundation Will this robot rescue the Flemish technical education? Bart Huyskens has been busy developing robots that can be used for educational purposes, and he’s noticed a significant increase of interest amongst students as a result of it. The number of students has doubled in schools where robots are being used in science and tech- nology classes, and the classrooms are filling up again! This is good news for the Flemish Ministry of Education. A few years ago they started putting up Regional Technical Centres where, with government fund- ing, education and companies work together on new initiatives, which are meant to attract students towards technical education. But it’s not just for students — teachers can get extracurricular classes on new technologies. Bart is pressed with developing the robots. With the help of sensors they can speak to students, follow a pattern across classrooms, and play and dance to music — all of which keeps the techno-hungry crowd pleased. Thanks to Technical Centre funding there are now 1 4 robots available for use to the stu- dents of St. Joseph Institute in Schoten, and two more will start touring with the TechnoTrailer vehicle. The students will be able to program the robots for different kinds of utilities. The robot itself runs on E-blocks technology and speaks Flowcode, but is fluent in Flemish as well. Bart’s enthusiasm has played a big part in the success of the robots. Over the past couple of years he has developed the concept, managed to sell it and make a full-fledged product. More importantly: he has managed to kindle an interest in electronics within new groups, and that’s certainly Worth an Award! Bart Huyskens is hereby nominated for the Elektor Foundation Award 2009. The award ceremony will take place during the Elektor Live! event on November 21 , 2009 in Eindhoven, The Netherlands. Radio to the rescue! Emergency services (such as the police force and fire brigade) know the vital importance of good communication. In order to avoid chaos and unnecessary casualties, it is essential to know where help is needed and what kind of help is needed. This is often easier said than done, as can be seen only too clearly from the situation with the C2000 emergency services radio sys- tem in the Netherlands. It works well in theory, but in practice it’s a different story. Emergency aid in event of a major disaster often requires creativity and unusual actions. In 1 953, the North Sea broke through the dikes and submerged large portions of the southern Netherlands. Nothing was spared: people, animals, and buildings all fell victim to the merciless flood waters. A certain Mr Hossfeld was caught in the middle of this catastrophe. Taking his son with him, he plunged into the ice- cold water, and fortunately they managed to swim to a house where they could enter through an open window and climb onto the roof. The next day they were brought to safety. After they reached dry land, they found that the emergency services were desperately short of communication equipment. Everything had literally been swept away, and the town of Zierikzee was totally cut off. Mr Hossfeld (now 83 years old) did what he could and must do: using a few radio valves (EL3, EL6 and 807) and some coils made by winding wire around a bottle, he put together a transmitter that could deliver 1 0 watts of power to a 1 5-metre longwire antenna. This was enough to make contact with the outside world (and in a manner of speaking, it was the spiritual ancestor of the C2000 system). For five days and nights, a team of four people constantly manned the PAoZRK transmitter to coordinate assistance activities for Zierikzee. Radio amateurs such as Mr Hossfeld played a vital role in the initial hours and days of the 1953 floods. Many lives were saved as a result of their efforts. Our objective with the Elektor Foundation Award is to pay tribute to events such as these: people who managed to make a difference with their knowledge and efforts. Mr Hossfeld is one of the candidates for this award. The award ceremony will take place during the Elektor Live! event on November 21 , 2009 in Eindhoven, The Netherlands. More information on the Elektor Foundation Award can be found at www.elektorfoundation.org 10 i2-20og elektor NEWS & NEW PRODUCTS World’s oldest, working computer to reboot after 48 years The historic Harwell computer, later known as the WITCH computer, came out of storage in early September 2009 to travel to The National Museum of Computing at Bletchley Park where it is planned to restore it to full working condition. Once restored by the volunteers at the Museum, it will be the oldest original functioning electronic stored program compu- ter in the world and will be housed alongside the rebuild of Colossus Mk II, the world’s first electronic computer. The National Museum of Computing TNMOC is inviting members of the public and industry to sponsor the restoration of the Harwell compu- ter by purchasing one of 25 shares at £4500 each. The funds will be used by TNMOC to undertake the restoration and extend the ever-expanding museum. Insight Soft- ware has become the first sponsor of the Har- well/WITCH computer restoration project. The Harwell Compu- ter dates back to 1949 when plans were drawn up for a machine to per- form calculations then done by a team of bright young graduates using mechanical calculators. The team’s work had been so tedious that mistakes were inevitable, so the aim was to automate the work. Simplicity, reliability and unattended operation were the design priori- ties. Speed was a lower priority concern. The machine first ran in 1951 . It was a relay-based computer using 900 Dekatron gas-filled tubes that could each hold a single digit in memory — similar to RAM in a modern computer— and paper tape for both input and program stor- age. The Dekatron was described in Elektor March 2008. The computer was operational at Harwell until 1 957, when it was offered in a competition for colleges to see who could make best use of it. Wolverhampton and Staffordshire Techni- cal College (later becoming Wolverhampton University) won and, then becoming known as the WITCH (Wolverhampton Instrument for Teaching Computing from Harwell), it was used in computer education until 1 973. After a period on display at Birmingham Science Museum, it was disassembled and put in storage at Birmingham City Council Museums’ Collection Centre. Their curatorial care and attention means it can still be made to work again. Its arrival at TNMOC on 3 September marked the first stage in an expected year-long resto- ration challenge. The restoration project is under the aegis of the Computer Conservation Society, who have a long history of successful similar projects. The current earliest functioning computer is the 1 956 Pegasus machine at The Science Museum in London. There are functioning rebuilds of earlier machines, including the Colos- sus Mk 2 at TNMOC/ Bletchley Park. http://tnmoc.org - www.insightsoftware.com - www.computerconservationsociety.org/witch.htm (090750-VIII) Photo credit: Wolverhampton Express and Star. The image shows Mr B.F.H. Coleman , lecturer in charge of digital computing at Wolverhampton College of Technology, checking a punched tape for the 1950s WITCH (Wolverhampton Instrument for Teaching Computing from Harwell) computer. The picture is believed to have been taken in June 1964. EasyDAC: USBi6PRMxN 8 channel relay + 8 relay or DIO card + 8 DIO The USB1 6PRMxN from EasyDAC is a low cost, general purpose, USB powered card offering 8 relays, 8 general purpose DIO channels and 8 channels that can be selected as either relay or DIO channels (via onboard links). Relays & PCB track- ing are designed to handle 240 VAC at 10 A. Suitable for a wide range of control and mains volt- age power switching, or sig- nal switching pur- poses, the new board also offers screw terminal access to the USB power connec- tions for possible onward powering/use in your target system. Relay & DIO control/activation is via sim- ple ASCII/Hex characters. The USB card appears as a ‘virtual com port’ when con- nected to your system. All relay contacts are connected to two-part screw terminal blocks along each side of the card. These allow rapid connect/ disconnect or swap- over in your target system. 5 VDC power connection is made via a 2 way screw ter- minal block or 2.1 mm jack socket. The card is stackable, via corner fixing holes. Available with a Perspex cover and DIN rail mount option if required. DIO channels are normal logic level sig- nals (+5 V max) and can supply up to 20 mA per channel. Access to all relay contacts and DIO channels is via 2 part (male/female) screw terminal block con- nectors positioned along two edges of the card. The board is compatible with Windows 98SE, ME, 2000, XP, Vista, Windows 7, Windows CE, MacOSX and Linux plat- forms. LabVIEW, VB, VC, C#, Java, VEE, & Delphi examples are available. http://www.easydag.biz/ (090750-XII) elektor 12-2009 11 NEWS & NEW PRODUCTS EasyPIC®6 Development System mikroElektronika recently introduced a new development tool for PIC® microcontrol- lers. The new EasyPIC®6 supports 8, 1 4, 1 8, 20, 28 and 40 pin (DIP package) PIC® micro- controllers. The EasyPIC®6 comes complete with everything you need to learn, experi- ment, design and program with PIC® micro- controller. This development tools contains new features such as: 4x4 Keypad, Menu Keypad, Port Expander, Serial COG Display and many more. Also EasyPIC®6 includes TouchPanel controller, so you can easily add additional input to prototype device. EasyPIC®6 has ultra fast on-board USB 2.0 programmer with MikrolCD (in-circuit debugger) support, so you can easily pro- gram and debug your application program. Each feature of the board is supported by example written in mikroC PRO, mikroPascal PRO and mikroBasic PRO compiler for PIC®. Also, EasyPIC®6 comes with the full colour printed documentation. The system price is US$139.00. EasyPIC®6 Board is available for purchase on the mikroElektronika website and through authorised distributors. www.mikroe.com Premier Farnell buys CADSoft Premier Farnell pic has acquired CadSoft Com- puter GmbH and its EAGLE™ brand of elec- tronic design engineer CAD software. This enhancement to Premier Farnell’s core strategy focuses on further meeting engi- neers needs for technology, information, tools and software, while internationalis- ing the company’s proposition and serv- (090832-XII) EAGLE Version 5 ices for the rapidly developing Asian mar- kets. This acquisition offers CadSoft’s cus- tomers - over 40,000 electronic design engineers throughout the USA and Europe - easy access to Premier Farnell’s growing range of product and technology. In addition, the group’s companies in the Asian region (Premier Electronics, Farnell Newark and Farnell) will be able to deliver this product to this fast growing, but relatively untapped region. The product’s distribution and licensing options via elementl 4 will allow engineers within these regions the needed access to the product. Premier Farnell plans to further extend the CAD software’s capabili- ties by linking it to their databases in a similar methodology to the DesignLink platform. EAGLE can be downloaded directly from the tools section of elementl 4 www.ele- ment-1 4. com; or indeed directly from the appropriate regional Premier Farnell com- pany website, where an appropriate license can be purchased. The Eagle Light edition is free of charge and is an ideal evaluation tool. It is limited to a useable board size of 100x80mm, allows only two signal layers and the schematic editor can create only one sheet, other than that however, it offers all the functionality of the full versions. There are currently 1 1 license options to address a wide range of customer needs, with prices ranging from $49 to $1 500. The purchased license simply unlocks the functionality from the freely downloaded software. The high-end version handles board sizes to 1 .6m x 1 .6m, resolution of 0.1 micron, 1 6 signal layers, 999 schematic sheets, and an Autorouter with a ,follow-me’ routing capa- bility that follows your mouse for semi-auto- matic routing. EAGLE supports many output file formats as Gerber, Excellon, Sieb&Meyer, Postscript, and its output can be customized to support any PCB house requirements. www.PremierFarnell.com - www.element-14.com (090832-II) Parallax: Stingray Robot based on Propeller The Stingray robot from Parallax Inc. pro- vides a mid-size platform for a wide range of robotics projects and experiments. The Propeller Robot Control Board is the brains of the system providing a multiprocessor control system capable of performing mul- tiple tasks at the same time. The Propel- ler chip provides eight 32-bit processors each with two counters, its own 2 KB local memory and 32 KB shared memory. This makes the Propeller a perfect choice for advanced robotics and the Stingray robot. Stingray’s features include: • Multicore Propeller chip based control board • Extra large EEPROM (64 KB) for storing additional data • On-board 3.3 V & 5V switching power supply • 5 V I/O translators to simplify interfacing to 5 V sensors/devices • Integrated dual full bridge driver • Two DC spur gear motors • Two-wheel differential drive system with rear omnidirectional wheel • Multiple mounting locations for sensors, add-ons, etc. • Free online Propeller Tool programming software for Windows and example Stingray source code (requires Win2l// f ► ... 1 tel i W J BitScope is built tough to last a lifetime. Enclosed in a new low profile solid extruded aluminium case BitScope 325 can handle the harshest working environments. Its full metal jacket and electrically isolated design means that unlike cheap plastic alternatives it is also highly noise immune for the most sensitive mixed signal measurement applications. On the road or in the lab, BitScope is the ideal choice! Logic/Timing Analyzer Probes Industry Standard Scope Probes Software Included BitScope Software and Libraries BitScope 325 includes DSO, an intuitive test and measurement software application for your PC. The integrated test instruments include a digital storage oscilloscope, spectrum analyzer, logic state and mixed signal timing analyzer and an arbitrary waveform generator in one package. DSO is fast, with display rates up to 50Hz and deep, with capture up to 512kS per frame. Also included is a built-in data recorder to share captured signals with colleagues or customers via data export and real-time offline analysis. If you also need programmability, BitScope 325 comes with the BitLib application programming library for custom software applications or full integration with existing third party tools. Windows, Linux or Mac Ethernet or USB La www . bitscope . com HOME AUTOMATION Open Standards for the Automated Home Xio, KNXand DigitalSTROM By Ernst Krempelsauer (Elektor Germany Editorial) As we describe in the overview article elsewhere in this issue, there are many different home automation systems available. A few of these are sufficiently open that it is possible to build DIY hardware; they also have the advantage of being supported by more than one manufacturer. There are essentially just three common standards for home automa- tion, although they could hardly be more different from one another: XI 0, KNX and DigitalSTROM. XI 0 was first on the scene, being devel- oped in the 1970s; KNX is based on EIB (European Installation Bus), which was developed at the end of the 1 980s, and DigitalSTROM is an initiative for a new open standard, which started in 2007. The markets of these three systems are also geographically rather disparate: XI 0 is chiefly found in the USA and fairly rare in Europe, whereas KNX is the clear market leader in Europe. It is hoped that the first DigitalSTROM products will come onto the market next year. Despite the age gap, XI 0 and DigitalSTROM are based on the same underlying communication method: both use PLC (Power Line Com- munication) and send their messages over existing power wiring. The KNX standard, in contrast, provides for four different ways of communicating data: ordinary twisted-pair wiring, as in the original EIB system, plus radio, PLC and Ethernet. Only KNX has so far been accorded official European (EN) and inter- national (ISO/IEC) standard status. Thirty years of Xio XI 0 was developed by the Scottish firm Pico Electronics Limited [1 ] in 1 976. For its time it was a revolutionary system, employing one 20 i2-20og elektor of the first ever application-specific ICs to keep costs down. Sold through Radio Shack and Sears from 1978 onwards, XI 0 soon became popular among more comfort-conscious American home- owners. In some European countries there is a certain cult follow- ing of XI 0 among DIY installers. Products are available from Mar- mitek in the Netherlands [2] and EuroXI O/CentralCasa in Portu- gal [3]; these companies have distributors in other countries. The XI 0 Wikipedia site [4] points to various XI 0 newsgroups, project pages and the like. Data, comprising addresses and commands, are transmitted on the live wire of the household AC power line wiring using a 1 20 kHz car- rier signal. A single bit is transmitted at each AC power line (50 Hz or 60 Hz) zero crossing. To send a logic one a 1 ms carrier burst is transmitted; for a logic zero, no carrier burst is transmitted (see Fig- ure 1 ). A consequence of the low data transmission rate of this sys- tem is that it only supports a maximum of 256 devices and a total of just 1 6 command codes. Transmitting one XI 0 data block, con- taining either one address or one command, takes a total of 22 zero crossings. Each data block is transmitted twice in the interests of improving reliability, followed by a gap of six zero crossings. Thus the simple job of switching on a light takes a total of 100 zero cross- ings: at an AC grid frequency of 50 Hz, this corresponds to a total transmission time of one second. Such a large delay can be annoy- ing to the user. A more serious problem with the standard XI 0 protocol is the lack of provision for acknowledgement messages. Communication is therefore not reliable. An extension to the XI 0 standard includes a status request facility, but this requires special devices. Reliability is improved, but the system is even slower. In summary, the XI 0 system looks rather antiquated today, but has the great advantages, particularly for private users, of simple instal- lation and relatively low cost. KNX - the multi-purpose standard The KNX standard is both international and highly versatile. Its design is the result of a lengthy development process based on experience from many thousands of buildings equipped with EIB, which has been expanded in an endeavour to include the features of the competing BatiBUSand EHS systems (see the text box ‘Story of a Standard’). The cooperation of well-known European manufacturers has resulted in the KNX standard offering some unique features: • internationally (ISO/IEC) standardised; • 1 74 participating companies in 29 countries; • over 7000 product groups; • four data transfer media options; • wide range of applications; • wide range of functions; • manufacturer-independent design and operation software; • three different configuration modes; • independent of particular choice of underlying hardware or operating system. Storv of a standard 1 980s Early bus systems for building automation 1 990 Foundation of the EIBA (European Installation Bus Association) 1991 First EIB products available 1 994 European standardisation (EN) of EIB 1 996 BatiBUS, EIB and EHS (European Home System) begin process of convergence towards a common standard 1999 Foundation of the Konnex Association as an organisa- tion to support the common standard (KNX) 2002 Publication of KNX specifications 2003 KNX becomes a European standard (EN 50090) 2006 KNX becomes an international standard (ISO/IEC 14543-3) KNX is suitable for all technologies found in buildings, such as serv- ices metering, energy management and appliance networking, and for use in any building, new or old, from the humblest of houses to the most extensive of exhibition centres. The standard is based on EIB (also known as ‘Instabus’), which uses ordinary twisted pair (TP) cable. KNX uses a four-conductor cable (called ‘TP-1 ’) for its bus wiring, with two of the conductors being reserved for future use. The data transfer rate is 9600 bit/s and a system can comprise as many as 65000 KNX devices. The majority of KNX systems installed to date use this TP1 wiring. There are two further variants of the KNX standard that use exist- ing power cables for data communication (‘power line’ or ‘PL’): these are called PL-110 and PL-132. PL-110 uses a 1 1 0 kHz signal with SFSK (spread frequency shift keying) modulation, running at 1200 bit/s. Communication is bidirectional (but half-duplex). The PL-1 10 protocol is also taken from the earlier EIB standard, Zero Crossing Figure 1 . In XI 0 a logic one is transmitted as a 1 20 kHz burst during the AC grid voltage zero crossing. elektor i 2 - 20 og 21 Figure 2. Layout of a house equipped with Siemens Synco Living, which uses KNX RF and KNXTP-1 buses. and although in principle it supports a range of topologies and a large number of devices, in practice the low data transfer rate and achievable communication quality are limiting factors. PL-132 dif- fers from PL-1 1 0 in its carrier frequency (132 kHz) and data rate (2400 bit/s). The 1 32 kHz carrier frequency is inherited from EHS, and protocol converters are available to interface EHS units to a KNX PL-1 32 system. KNX RF (radio frequency) operates on 868.3 MHz with a trans- mit power of 1 0 mW to 25 mW using FSK (frequency shift key- ing) modulation. Manchester coding is used and data blocks are protected using a CRC. The data rate is 1 6384 bit/s. KNX RF com- ponents are very energy efficient, some having a battery life of six years, and there are both uni- and bi-directional units avail- able. For example, a heating controller might be a bidirectional component, whereas a temperature sensor might be a unidirec- tional component. KNX RF and KNXTP-1 interfaces can be mixed in a single system, or even within a single component (see Fig- ure 2). The radio communications are also compatible with the M-BUS (‘meter bus’) standard for services metering, so that an an energy management system can take readings from M-BUS (so-called ‘smart’) meters. The KNX RF standard also provides for repeaters to extend the range of the system (see Figure 2). Although the standard allows the use of components from differ- ent manufacturers in the same system, in practice the only KNX RF systems available are the Siemens GAMMA Wave and Synco Living systems and the Hager Tebis KNX system [5]. There are other, non-KNX, radio-based home automation systems, which can be connected to a KNX system via a gateway. For example, Thermokon [6] offer an interface between the EnOcean radio sensors [7] and the EIB/KNX bus. Figure 3. User interface of the ETS3 KNX configuration software (starter and professional versions). Alongside these three communications media for connecting com- ponents, the KNX standard also provides for IP-based communica- tion, using technologies such as Ethernet, WLAN, FireWire and so on. KNXnet/IP defines two basic options: • IP tunnelling allows point-to-point transfer of KNX packets over an IP network. • IP routing allows the use of an IP network as a fast backbone for communicating between various groups of devices on a KNX network: see the description of the network structure below. KNX IP routers then do the job of line and area couplers in an ordinary KNX network, depending on their configuration. A significant aspect of the KNX standard is the use of configura- tion modes and manufacturer-independent ETS (engineering tool software) to design and configure a KNX system. There are three configuration modes: • S-mode: system mode, configured using KNX ETS • E-mode: simple mode, configured at each device or using a simple programming unit • A-mode: automatic configuration (‘plug and play’) 22 i2-20og elektor Standards of openness The most widespread components support either S-mode or both S-mode and E-mode. A-mode was intended for use by ‘intelligent’ household appliances and has not yet seen wide use. S-Mode is inherited from EIB, and requires the use of ETS (current version ETS3) on a PC. The ETS can configure all the KNX components, setting functions, parameters and group addresses. ETS can also be used (Figure 3) on an existing system at any time to modify it. For example, it is possible to change which light is operated by a particular switch entirely under software control, without needing to touch the wiring. Reconfiguration is also possible over the Inter- net using the iETS tool. There are many variants of E-mode which define how the settings of a component are configured either at the component itself or via Hager’s TX1 00B ‘configurator’ tool (Figure 4). KNX bus structure and hardware Each participating device in a two-wire bus (TP-1) system is con- nected to both bus lines (Figure 5). One cable with up to 64 (in the extended version, 256) connected devices forms a ‘line’, the smallest group in a system. Up to 1 6 lines can be joined together to form an ‘area’: thus an area can comprise up to 1 6 times 256, or 4096, individual KNX components. A KNX network (Figure 6) can contain up to 1 6 areas, allowing for a grand total of 4096 times 1 6, or 65536 components. The total length of cable involved can be up to 1024 km! Each line is connected to an area’s main line via a line coupler; like- wise, the area main lines are connected to the ‘backbone’ using area couplers. The two-wire bus not only carries data but also supplies power at a nominal 30 V DC. Each participating device is allowed to draw up to 1 2 mA from this supply. A KNX device that requires more power than this must have its own (‘external’) power supply. As Figure 5 shows, each line has a dedicated power supply, con- nected via a pair of chokes. The permissible bus voltage of this SELV (safety extra low voltage) supply is from 20 V to 32 V. The KNX TP-1 bus is specially designed to avoid the need for termina- tion resistors. It uses a CSMA/CA (carrier sense multiple access/colli- sion avoidance) protocol, and a participating device only transmits on the bus when it has data to send or if asked to send data. There is no regular cyclic polling by a bus master, which helps reduce the load on the bus and keep transmission delays short. Bus collisions are avoided using the following protocol: while a device is transmit- ting, it checks that the bus is free. Only logic zero is ‘actively’ trans- mitted; a logic one is indicated by no activity on the bus. A zero bit is sent by a device briefly applying an additional load to the bus, resulting in a brief dip in the supply voltage. The inductance of the series chokes means that when the additional load is released, the supply voltage briefly overshoots its original level, giving a typical behaviour like that shown in Figure 7. Whether a standard deserves to be called ‘open’ is a matter of definition. KNX and Digital STROM describe themselves as ‘open’; and XI 0 is regarded by its users as an ‘open industry standard’ but this is something of a special case as the patents dating back to the 1 970s have already expired. The definitions given at [1 7] and [1 8] for open standards largely apply, but this is not to say that access to the technologies involved is free of charge. KNX and DigitalSTROM both charge money for membership of their organisations, and the fees are greater for larger companies. Membership of the appropriate organisation is required in order to obtain support and the legal right to use the in- tellectual property for commercial purposes. However, once these fees are paid, companies are not required to pay further licensing charges. For KNX the documentation, being a European and inter- national standard, is also available from national standards bodies, and a considerable amount of KNX documentation is available on the Internet and from manufacturers. Universities and research institutes enjoy special terms: for example, they can join the KNX association for € 250 per year as a ‘scientific partner’ with access to software and the organisation’s FTP server. It is possible to register at digitalSTROM.org without charge as an ‘interested party’ and gain access to the organisation’s simulation software. Figure 4. TX100 Configurator for simple commissioning of KNX-TP and KNX Radio systems in E-mode. elektor i 2 - 20 og 23 Bus Device 1 Bus Device 2 Bus Device n Figure 5. KNX components wired to form a bus line. Each line has its own 30 V supply. Figure 6. A KNX network is divided into areas and lines, joined by line and area couplers (or KNX routers). Figure 7. A zero bit is transmitted on the TP-1 bus by a brief dip in the power supply voltage. Figure 8. Block diagram of a KNX/EIB lamp dimmer. The point of using an ‘active 0’ and a ‘pas- sive 1 ’ is that if two devices try to transmit a message on the bus at exactly the same time, a zero sent by one device will dominate a one sent by the other. The losing device can detect that a collision has occurred and can cease its transmission, while the winner continues to transmit. As a result the bus is never jammed, even under heavy load, and so transmission delays are kept low. Figure 8 shows a block diagram of the inter- nals of a KNX/EIB light dimmer, an example of a device with its own power supply. In the early days of EIB special bus interface transformers were used, but now special- purpose ICs and modules are available. A TP-UART is available from Siemens, as is the FZE1 066 integrated EIB twisted pair trans- ceiver. Also available is a KNX bus controller, which can be combined with the TP-UART to make a KNX chipset [8]. The controller is in fact a pPD78F053x microcontroller from NEC, programmed with KNX certified firmware (the KNX System 2.5 stack). KNX information and projects The authoritative website is that of the KNX Association [9], avail- able in 1 2 languages. A little judicious clicking and searching will give a good overview of the system and the activities of the asso- ciation. Some free documentation, a KNX Journal and KNX dem- onstration software can be downloaded. There are many links and indexes, leading to the websites of manufacturers, user groups and forums. The ‘official’ KNX user group can be found under ‘Part- ners’, as can a list of universities participating in KNX-related activ- ities, while clicking on ‘News & Press’ and then ‘Links’ brings up a list of forums in a range of countries and languages. Not listed is the site of the open source project ‘Freebus’ [10], which deals with DIY construction of KNX (EIB TP-1 ) compatible modules and which has already published a range of projects. Data sheets and software tools of interest to KNX developers are also available via Georg Luber’s website [1 1 ]. Also recommended is the KNX site run by the Vienna University of Technology [12] and Friedrich Praus’ graduation thesis [13] (in English), which gives a comprehensive introduction to KNX/EIB and describes a versatile microcontroller board for KNX/EIB applications. When searching for other KNX projects on the Internet, it is worth trying ‘EIB’ as an alternative keyword to ‘KNX’. EIBMARKT [14] gives information about and prices for KNX prod- ucts. For example, a KNX gateway, interfacing a PC to a KNX system via a RS232 or USB port, is available for under £ 1 50. DigitalSTROM This concept, in equal measures ambitious and fascinating, is a new twist on the old PLC idea. First, there is no high-frequency carrier, 0 3 * Q r * ( f 24 i2-20og elektor / \ »VtU ■ fei t< **■ FI 11 — p‘ Q O <3 G DO * > and no frequency modulation; and second, the hardware has been shrunk down to a single chip (the ‘dSChip’), which fits inside a chocolate block. Data transfer is performed, as in the XI 0 standard, during the zero cross- ings of the AC power line signal. There the similarity ends, however. A slave device transmits by slightly increas- ing or decreasing the (real) power consumption of the appliance for a few microseconds, whereas the bus master transmits by shorting the AC power line supply for a few microsec- onds. Since the AC power line voltage is near its zero crossing, very little cur- rent flows. Data bits are thus essentially car- ried in the modulation of a current. Each dSChip, like a 1-wire bus device or RFID tag, includes a unique assigned address. The chip itself dissipates just 300 mW and has over 60 functions built in: phase angle power control for appliances rated at up to 1 20 W (including low-energy light bulbs), appliance power consumption measure- ment, various interfaces and lots more besides. The device is not yet available to buy, but there is plenty to read about the develop- ment of the system at the homepageofdigitalSTROM.org [15] and on the website of the company developing the 1C, aizo AG [16]. And as soon as we can lay our hands on a working dSChip at the Elektor labs, we will be sure to report on it. (081062-I) Host Controller RxD TxD UART Receiver UART Transmitter 64-byte ‘telegram’ Tx buffer Digital Part Control Logic 1 Byte buffer EIB Transmitter State Byte (receive) ACK Flags EIB Receiver Filter EIB Transmit RxD3 EIB ReceiveTxD3 RESn Transmit Analog Part Power Supply 5 V Regulator Receive EIB _TSTIN_BDS (Baud rate) -> TSTout — Mode 0 — Mode 1 ■ 34 . 9152 MHz -^0.05 % Figure 9. Block diagram of the Siemens TP-UART 1C. Add a microcontroller, and you have a complete bus component. Figure 1 0. The printed circuit board carrying the DigitalSTROM chip is powered from the AC grid and fits inside a chocolate block. Image sources Flead illustration and Figure 4: Hager Tehalit Figure 2, Figure 5, Figure 9: Siemens AG Figure 3, Figure6, Figure 8: KNX Association Figure 7: Andreas Krebs, Freebus.org Figure 1 0: digitalSTROM.org Internet Links [1] www.xnumber.com/xnumber/microprocessor_history.htm [2] www.marmitek.com/ [3] www.euroxl O.com / [4] http://en.wikipedia.org/wiki/X1 0_(industry_standard) [5] www.hager.com/ [6] www.thermokon.com/ [7] www.enocean-alliance.org/ [8] www.opternus.com/en/siemens/knx-chipset.html [9] www.knx.org/ [10] www.freebus.org/ (in German) [11] www.knx-developer.com/ [12] www.auto.tuwien.ac.at/a-lab/knx-eib.html [13] www.praus.at/files/diplomarbeit_fpraus.pdf [14] www.eibmarkt.com/cgi-bin/eibmarkt.storefront/EN [15] digitalstrom.org/index.php?id=1 1 5&L=2 [16] www.aizo.com/en/ [17] www.itu.int/ITU-T/othergroups/ipr-adhoc/openstandards.html [18] http://en.wikipedia.org/wiki/Open_standar elektor i2-20og 25 RADIO Preselector for Elektor SDR Here’s the automatic tuning upgrade! By Burkhard Kainka (Germany) The performance of a receiver depends to a large extent on its input filters. A selective input circuit improves antenna matching and immunity to interference from other strong signals. The preselector described here allows the use of up to four filters, tuned under software control using varicap diodes. A tuned loop antenna is also described that lets you use the Elektor SDR receiver without an outdoor antenna. Almost three years since its publication, the Elektor Software Defined Radio (SDR) [1] is still a blockbuster project, and here at Elektor we were gratified by comments from the radio amateur community like ‘good value for money’ and ‘an excellent entry-level SDR’. The publication of the SDR hardware was also followed by a flurry of tuning and control software like Peter Carnegie’s ‘G8JCFSDR’. The SDR covers practically the whole of the radio frequency range up to 30 MHz. In the design, a 74HC4051 is used as an input multiplexer, offering a total of eight inputs AO to A7. Under software control it is possible to use the multiplexer to switch between a wideband input (AO, displayed as Ini by the software), a low-pass filter for medium wave (MW) reception (A1 , or In2), and a high-pass filter for shortwave (SW) reception (A2, or In3). Input A7 is used for a 5 MHz self-test input. There are thus four spare inputs to the multiplexer, and these can be used, for example, to connect ferrite Features • Four tuneable front-end circuits • Controlled by free SDR tuning software • l 2 C bus control • Long-, medium- and short wave reception • 500 pF varicap diodes • Suitable for use with a wire antenna, a loop antenna or a ferrite rod antennas or front-end circuits. The inputs have a high impedance and can therefore also be used to connect a tuned magnetic loop antenna, as shown in the examples in Figure 1 . An annoyance when using these circuits with a software controlled radio is that the variable capacitors have to be adjusted manually, which can be rather fid- dly. For this reason we have developed an automatically tuneable preselector, control- led over an l 2 C bus, using varicap (variable capacitance) diodes. Four front-ends The preselector circuit (Figure 2) sports four front-ends using 1SV149 varicap diodes. Depending on the tuning voltage, these devices have a capacitance that varies from around 20 pF to 500 pF. The tuning voltages are generated using a PCF8591 digital-to- analogue converter, which is controlled over an l 2 C bus. Since the Elektor SDR already incorporates an l 2 C bus, adding the facility 26 i2-20og elektor V SW coil PCI f— O ferrite rod antenna k A4 -o k Figure 1 . Simple front-end circuits, manually tuned using a variable capacitor, suitable for direct connection to the SDR board. for software tuning control to the preselec- tor is just a matter of making two additional connections (SDA and SCL). Each front-end circuit employs a coil (LI to L4) with four connections. Each output is coupled to one of the high-impedance inputs A3 to A6 (referred to as In4 to In7 in the software) of the SDR receiver’s input multiplexer via a 1 00 nF capacitor (C3 to C6), via an individual coupling winding. Alternatively ferrite antennas or loop anten- nas with just two connections may be used. The details of these choices are left to the reader, as is the choice of which frequency ranges each preselector channel will work with. Also, inputs AO to A2 (Ini to In3) of the SDR remain available for use. Construction matters Populating the printed circuit board (Fig- ure 3) should be straightforward. First mount all the semiconductors, resistors and capacitors, but leave the coils for now. The board is also available in this partially- assembled state from the Elektor Shop: the board comes with four suitable coil form- ers plus a ferrite rod with ready-wound coils suitable for long wave and medium wave use. You can wind the other coils to suit the particular frequency ranges you wish to use. Here are two suggestions: to receive the shortwave band from 2.2 MHz to 8 MHz via output OUT3, wind L3 with 40 turns between 3E1 and 3A1 plus a 2-turn antenna coupling winding between 3E2 and 3A2; to receive the shortwave band from 4.5 MHz to 1 6 MHz via output OUT4, wind L4 with 1 5 turns between 4E1 and 4A1 plus a 1 -turn antenna coupling winding between 4E2 and 4A2. The 10 mm by 90 mm ferrite rod is used to cover the lower frequency ranges: coils for MW and LW use can be mounted on the same rod. You can either use the ready- wound coils provided or wind your own using either litz wire or 0.2 mm enamelled copper wire. A high Q factor is not essential in this case as it will be used for relatively wideband reception. To receive longwave between 140 kHz and 450 kHz via output OUT1 , use 1 70 turns of litz wire or 0.2 mm enamelled copper wire on the ferrite rod, K1 +12V D1 1N4001 +12V © — IC1 78L05 0 t Cl lOOn SDA o*- SCL o*- C2 lOOn JcT - " ^^00n 11 10 4 3 2 1 12 +5V - 0 -® - 0 ~® GND VDD OSC VREF IC3 SDA AOUT SCL AIN3 AIN2 A2 AIN1 A1 AIN0 A0 PCF8591 EXT VSS AGND 14 15 13 C8 lOOn R3 ~| 100 k F R2 +12V © © IC2 © R1 H 100k h IC2 = LM358N OUT1 0 3 £ 1A1 C7 lOOn 1E1 0 ~ C3 lOOn OUT2 I |C4 lOOn £ 2A1 OUT3 0 2E1 0 - — 0 2A2 3A1 £ C5 lOOn 2E2 3E1 0 0 ~ D2 ... D5 = 1SV149 OUT4 0 £ 4A1 C6 lOOn 4E1 0 - 090615 - 11 Figure 2. The circuit of the ‘digital’ preselector with four front-ends tuneable over an l 2 C bus. elektor i2-20og 27 COMPONENT LIST Resistors R1 ,R2,R3 = 1 00k£l Alternatively, kit of parts # 09061 5-71 , con- tains partly populated board, coil formers, ferrite rod with coils Capacitors Cl ,C2,C3,C4,C5,C6,C7,C8,C9 = 1 0OnF ceramic Semiconductors IC1 = 78L05 IC2 = LM358N IC3 = PCF8591 P D1 = 1 N4001 D2-D5 = 1 SV1 49 (www.ak-modul-bus.de) Miscellaneous 4 inductors on former type T1 .4 (www.ak- modul-bus.de) DC power adaptor type NEB 21 R (Lumberg) PCB, ref. 09061 5-1 Figure 3. Printed circuit board for the preselector. All the coil connections are brought out to one edge of the board. between 1 El and 1 A1 ; to receive medium wave between 550 kHz and 1600 kHz via output OUT2, use 40 turns of litz wire or 0.2 mm enamelled copper wire on the fer- rite rod, between 2E1 and 2A1 . The two shortwave antenna coupling coils, between 4E2 and 4A2 and between 3E2 and 3A2, can be wired in series if desired and connected to the antenna cable without an earth, as illus- trated in Figure 4. This has the highly desirable feature of isolat- ing the PC ground (which con- nected to the ground of the cir- cuit) from the antenna ground, which can help reduce interfer- ence considerably. There are essentially no signal voltage losses incurred by this series con- nection, as the coils are only in resonance at their own selected frequency and otherwise present a low impedance. Mounting and wiring The fixing holes of the add-on board are placed so that it can be fitted directly over the SDR board using spacers. The neces- sary wires can then be added. Figure 5 shows the connection points on the SDR board; GND is connected to C21 . The +5 V sup- ply connection between R4 on the SDR board and the +5 V point on the preselector board should be omitted for now: see the section on the power supply below. The Figure 4. Antenna wiring for two short wave bands. Figure 5. The points on the SDR receiver board where the preselector is connected. PC bus connections SCL and SDA are soldered to R2 and R3. The outputs of the preselector board (OUT1 to OUT4) are taken from the points indicated in Figure 5 to inputs A3 to A6 of multiplexer IC6. In the software these are selected as In4 to In7 (see Figure 6). Software and operation The original tuning software for the Elektor SDR receiver has been extended with the necessary fea- tures to control the varicap diodes. The new version, ElektorSDRpre. exe, can be downloaded free of charge from [1] and [2]. As Fig- ure 6 shows, there is now an addi- tional slider that allows the input circuits to be tuned. The actual digital value sent, from 0 to 255, is displayed in a window. The D / A converter turns this into a volt- age from 0 V to 5 V. The voltage is doubled by IC2.A, and a tun- ing voltage of 0 V to 1 0 V appears across the varicap diodes. There are two modes of operation: man- ual (,Man‘) and automatic (,Auto‘). By default the software starts up in manual mode. Start the software up as usual, along with a decoder such as Dream, SoDiRa, G8JCFSDR or SDRadio. Now choose input Ini or In2 for medium wave, or In3 for shortwave. Connect the antenna to the ANT terminals of the SDR board. Set the frequency to that of a known station, for example in 28 i 2 - 20 og elektor the 49 m broadcast band. Now disconnect the antenna and recon- nect it to the preselector board. Switch to input In4 (second shortwave input). Adjust the position of the preselector tuning slider on the screen to obtain maximum signal strength. You should now see a stronger signal here than at the wideband input, as the tuned front-end circuit provides better matching to the antenna. Sensitivity is con- siderably improved, especially in the higher frequency bands, In the same way, test the first shortwave band using In5. A common problem when receiving lower-frequency shortwave sta- tions using the wideband antenna input is interference from stations at three and five times the frequency of the wanted station. The preselector considerably attenuates these images, giving access, for example, to many new stations in the 80 m amateur radio band. The improvement is even more pronounced when listening to long and medium wave stations using the ferrite rod antenna. The signal strength obtained is similar to that from a longwire antenna connected to the wideband input, but there is considerably less interference. This is due to the suppression of images from higher-fre- quency stations and to the fact that the ferrite antenna receives the magnetic com- ponent of the signal, which gives better immunity to the kinds of interference found in domestic environments. Automatic tuning In manual operation mode it is necessary to adjust the tuning of the front-end circuit when- ever you switch stations. This process can be automated, with the software calculating and setting the necessary tun- ing voltage. As the main tuning slider con- trol is moved, the preselector tuning control automatically moves in sympathy. The cal- culations are based on a precalculated table of reference values, and the software comes with a file lnitPreselector.txt which contains suitable settings for the recommended set of front-end coils. If you are winding your own coils or mak- ing other alterations to the circuit, you will need to edit the table using a text editor such as Notepad. The structure of the file must be carefully preserved. For each of the four input resonators there are exactly ten entries in the file: each entry consists of a frequency in kHz and the corresponding Lloktor SDK f unins E EPR 0 M ipkndFVW Freq to EEPBDM jj m 2MHt 61 55 kHz I kHz 3kHz 2kHz 0.4...1 .fc HHt j O.ft.iSHHl 5 kHz 2... 10 MHz Ullirt 4 ^ Q" J JtJ 1S U 10 MHz 10 kHz 4. ..20 MHz 25 fcHt 1EI 30 Mil? Piesifcctor ^ J i nl fr£ J 21 J Ini Man Atfa j M5 j tw7 j IrS ( 0 dE '10® -Hlffi Figure 6. The tuning software now also drives the preselector. Figure 7. The SDRadio software in action. tuning figure (in the range 0 to 255). The table is introduced by one comment line (saying ‘In4’, ‘In5’ etc.) and terminated by a blank line. The provided file InitPreselector. txt can be used as a starting point to create your own file. Proceed as follows to determine the cor- rect tuning values to enter into the file. Find ten stations in the required tuning range; tune to each in turn and manually find the optimum position for the front-end tun- ing slider. The spacing of the reference fre- quencies is up to you, but it is best if they are more closely spaced over any part of the tuning range where the front-end tuning value changes rapidly. It is also importantto sort the values so that the lowest frequency (tuning value 0) appears first and the high- est frequency (tuning value 255) last. Enter the values into the file and save it, preserv- ing the filename. When the software is next restarted it will read the table and use the values in it. For any given frequency the software calculates a suitable tuning value by interpolating between the two nearest reference frequencies on either side. The relationship between frequency and tuning value is highly non-linear, changing much more rapidly in the middle of the tuning range than at the ends. Tuned loop antennas If it is not feasible or desirable to use an out- door antenna, the best choice for long- or medium wave reception is the ferrite rod antenna. For short- wave reception, an alterna- tive solution is to use a tuned magnetic loop antenna. This can give reception almost as good indoors as a longwire antenna can outdoors. We therefore have the ability to receive the whole range of stations without an outdoor antenna. To use a shortwave loop antenna, omit coils L3 and L4 and replace the resona- tor coil with the wire of the antenna loop. A coupling coil is not required as the antenna is being connected to a high- impedance input. The diame- ter of the loop, the length of the wire, and the thickness of the wire jointly determine the inductance of the antenna and hence the operating frequency range. Web pages are available to help do the necessary calcu- lations: see, for example, [3]. One practical arrangement is to use two elektor i2-20og 29 The Elektor SDR The Elektor Software Defined Radio with USB interface was published in May 2007. Since then it has become one of the most widely-used SDR hardware projects. The SDR board can receive not only AM and DRM signals but also amateur radio (both SSB and CW), marine weather serv- ices, and stations from all over the world. SDR software is continuously being improved and new features added, also by members of the ham radio community all over the world. The project is an ideal low-cost introduction to SDR technology. The preselector circuit described here makes a big difference to the perform- ance of the receiver: RF preselection coupled with better antenna matching allow the radio to pick out a much greater range of stations. Fur- thermore, if it is not feasible or desirable to use an outdoor antenna, the preselector circuit can work as a tuned loop antenna. Further information and a free article download are available at www.elektor.com/070039. Figure 8. Construction of an antenna consisting of two loops mounted at right-angles to one another. metres of 0.75 mm 2 flexible (multi-stranded) power cord wire to make a circle of diam- eter 60 cm. The inductance of this loop will be around 2.5 jiH, which, in parallel with 500 pF, gives a resonant frequency of about 4.5 MHz. Empirically, a tuning range of 4 MHz to 1 2 MHz can be achieved. If you use the same length of wire to make a two-turn loop, the diameter will be halved, result- ing in a higher inductance. A two-turn loop with a diameter of 20 cm makes a useful short- wave antenna for the band from 3.5 MHz to 1 4 MHz. This can be used as an indoor antenna to receive DRM signals with com- parable quality to a longwire antenna. A good option is to construct an antenna from two 25 cm diameter loops mounted at right-angles to one another. One loop should consist of just one turn and covers higher-fre- quency shortwave reception up to 30 MHz, while the second consists of two turns and oper- ates from about 3 MHz (see Figure 8). The loops can be wired so as to replace coils L3 and L4 on the preselector board: the one-turn loop between 4E1 and 4A1 , and the two-turn loop between 3E1 and 3A1. The antenna is rather directional and it is therefore worth mounting it so that it can be rotated — in some cases, to kill interference! On power supplies The system uses two separate power sup- plies. The SDR receiver board takes a +5 V supply from the PC’s USB port, while the preselector board uses a 12 V mains adaptor, connected to K1. The 12 V supply is neces- sary because the varicap diodes require a drive voltage of up to 10 V to cover the full tun- ing range. A 5 V regulator on the preselector board provides power for the D/A converter. Depending on the PC or lap- top computer used the supply provided by the USB port can be noisy. This is particularly noticeable when a low interme- diate frequency (IF) is used, as there is considerable noise up to around 2 kHz. With an IF of 1 0 kHz to 1 5 kHz this interfer- ence does not normally cause any problems. However, with the addition of the preselector board, we have the opportunity to improve the power supply of the SDR receiver board by connecting the +5 V point on the preselec- tor board with the +5 V point on the receiver board as indicated in the figure. To ensure that the preselector board does not supply power back into the PC’s USB port, it is essential to replace LI on the SDR board with a diode (type 1 N4001 , cathode towards C2). The result will be that V cc on the receiver board will be supplied from the preselector’s power supply, much reducing interference at lower intermediate frequencies. Internet Links [1 ] www.elektor.com/070039 [2] www.elektor.com/09061 5 [3] www.technick.net/public/code/ cp_dpage.php?aiocp_dp=util_inductance_circle 30 i 2 - 20 og elektor HOME & GARDEN Squeezing Out the Last Drop How to make your electronic devices even more energy efficient By Fons Janssen and Mark Vermeulen (The Netherlands) You’ve replaced all your incandescent lamps with energy-saving lamps. Your TV set is never in standby mode, and you’re giving serious consideration to having a solar panel installed on your roof. What else can you do to reduce your power bill without too much fuss and bother? It’s not especially difficult to determine the standby power consumption of the electri- cal equipment in your house (see the arti- cle ‘Economical with Energy’ in the Janu- ary 2008 issue of Elektor), but even if you know that your WiFi router consumes a steady 6 watts, what can you do about it? Pulling the plug when you’re not actively online is rather impractical. Fortunately, there are several other approaches that electronics enthusiasts can use to reduce standby power consumption. What ends up where? In this article we concentrate on equip- ment that is normally left on 24 hours a day, 7 days a week. A good example is the previously mentioned WiFi router. This sort of equipment usually operates from a low voltage and is powered by an AC adapter. This is usually an off-the-shelf model, with the result that the adapter and the device it powers are not optimally matched. In addi- tion, many of these adaptors still use an inexpensive iron-core transformer, which is not especially efficient. As a practical example, let’s consider a WiFi router with the Sitecom brand name. It is powered by a 1 2-V AC adapter (‘wallwart’) included with the router. The power con- sumption measured using a power meter is 6.2 W, which yields an annual energy con- sumption of around 54 kWh. If you open up the router (Figure 1 ), you see that the 1 2-V input voltage from the adapter is immedi- ately reduced to 3.3 V by a buck converter built around an API 510. If you replace the elektor i2-20og 3i Figure 1 . A look inside the WiFi router. The external supply voltage is reduced to 3.3 V by a buck converter. The power consumption of the router can be reduced by around 1.4 W by replacing the AC adapter included with the router by an adapter with an electronic converter. Flowever, it should be noted that the phase factor of the electronic converter is somewhat lower, with the result that the reactive power of both adaptors is virtually the same. Of course, the kilowatt-hour meter in the meter cabinet registers only the real power. 3.3 V linear 2.5 V linear regulator regulator Figure 2. The motherboard of the printer server (bottom) and the included AC adapter (top). The output voltage of the adapter can be reduced from 5 V to 3.6 V by replacing the upper feedback resistor with a 2.2-k Q resistor. The motherboard has two linear voltage regulators that can operate perfectly well with an input voltage of 3.6 V. The USB bus voltage is also reduced to 3.6 V, but printers are generally not powered from the USB port, so this does not have any detrimental effect. adapter with a laboratory power supply, you can see that the current consumption is only 250 mA, which corresponds to 4 watts. This means that the adapter consumes around 2.3 watts of the total 6 watts you pay for. In addition, the adapter is distinctly heavy, which indicates that it uses an iron-core transformer instead of an electronic volt- age converter. A more economical adapter The first thing you can do to reduce the power consumption is to replace the adapter. As the input voltage range of the buck converter in the router is quite large (3.6 V to 23 V), nearly any adapter can be used. We chose an electronic adapter for a mobile telephone no longer in use. It sup- plies 5.7 V with a maximum output current of 800 mA, which is well over 4.5 W. If you switch on the router with this adapter, the power meter indicates a consumption of 4.8 W, which represents a savings of 1 .4 W. This may not seem like all that much, but on an annual basis it adds up to well over 1 2 kWh. In most countries that’s enough to run your clothes dry around twelve times. Voltage adjustment Unfortunately, using an electronic adapter is not the solution to every problem. For our second practical example, we examined a no-name USB printer server. You can use it to connect a printer directly to your network without using a PC as an intermediary. This by itself yields considerable savings, since you don’t have to leave your PC running 24 hours a day. The AC adapter included with the server looks perfectly fine at first glance. It is a lightweight model rated at 1 0 W out- put power, which unquestionably means that it uses an electronic converter. How- ever, if you look at what happens to the 5- V supply voltage from the adapter after it enters the server (Figure 2), you see that the power savings achieved by the electronic converter are all for naught: the 5-V supply voltage is reduced directly to 3.3 V and 2.5 V by a pair of linear voltage regulators. This means that a good deal of the power sup- plied by the adapter is dissipated as heat in the voltage regulator ICs. If you can reduce the output voltage of the adapter to 3.6 V (600 mV of headroom should be enough 32 i2-20og elektor for the linear voltage regulators), you can achieve considerable savings. Almost all power supplies use a voltage divider to set the output voltage, accord- ing to the formula K,ut=Ke,X(1 + R1/R2) This means that you only have to replace one resistor in order to reduce the output voltage of the adapter. If you open up the AC adapter here, you can see right away that it is an isolated resonant flyback converter. The voltage divider is present as expected, and it is used in combination with a shunt regulator (SE431) with a 2.5-V reference voltage. Here R1 and R2 have nearly the same values (4.9 l<£2 and 4.87 l<£2), so the output voltage is 5.05 V (2.5 V x (1 +1 .02)). To reduce the output voltage to 3.6 V, all you need to do is to reduce the value of R1 to 2.2 k£2. The result is exactly what you want. Before the modification, the meter indicates a power consumption of 4.3 W, and after the modification this drops to 2.7 W. This repre- sents a savings of an impressive 37%, which amounts to around 14 kWh on an annual basis. Can you take this even further? The answer is yes. In particular, it would be nice to be able to switch the device off entirely during idle periods. Of course, you could use a sim- ple timer switch for this, but it has the same switching times every day and does not take weekends into account, not to mention summer and winter time. In another arti- cle in this issue, we describe an intelligent timer switch that does take weekends and summer/wintertime into account and con- sumes almost no power. Thanks to its com- pact dimensions, it can even be built into the device it controls. ( 090650 -I) Fons Janssen is a Senior Field Applications Engineer at Mark Vermeulen is a Managing Director and founder of Maxim Benelux (www.maxim-ic.com) Smart Sustainable Electronics (www.s2e.nl) Advertisement P/R41+AXZ www.parallax.com Friendly microcontrollers 9 legendary resources . Milford Instruments www.milinst.com Spinvent www.spinvent.co.uk robot kit This sleek mid-sized robot sports a low-profile design, aluminum chassis with black-anodized finish, zippy 7.2 VDC motors, solid high-traction wheels, and multi-directional tail wheel. The included Propeller Robot Control Board features a built-in motor driver, 64 KB EEPROM, 3.3 and 5 VDC power taps, and Propeller P8X32A with 24 free I/O pins. The Propeller chip contains eight 32-bit processors each with two counters, its own 2 KB of local memory and 32 KB shared memory.The Propeller chip’s multiprocessing capability combined with the Stingray’s breadboard and chassis mounting slots make this powerful platform ready for your customization! Dimensions: 33 x 27.7 x 14 cm elektor 12-2009 33 NEW: exclusive access to w ww.elektor-plus.com. The upgraded Elektor- PLUS subscription Elektor PLUS advantages o All 1 1 issues including the Summer Circuits edition O Included in your PLUS subscription: Annual DVD 2009 20 % cheaper than normal retail price Welcome gift worth £25 O Up to 40 % on selected Elektor products O Elektor is delivered to your doorstep every month Read your copy before everyone else 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! www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 o Online instant access to the recent three editions o Extensive searching in all editions o Extra articles and free E-books ✓ pil I.Mkilll mm. tut nr* EYlfl TO A ' ... soon to come: more extras, offers and bombshells When taking out an Elektor PLUS subscription you get exclusive access to the new website www.elektor-plus.com where the three latest editions of Elektor magazine are available in the form of pdf files (i.e. the current issue and the two preceding ones). With a simple click you download the com- plete issue (front to back!) or any single article, www.elektor-plus.com also supplies the most exten- sive Elektor search engine found on the web. However the upgraded PLUS subscription offers many more interesting extras like free E-books and supplementary articles. Or use the subscription order form near the end of the magazine. HOME & GARDEN Top-of-the-Bill Lights Sequencer Programmable fairy lights By Boris Lecourt (France) As Christmas approaches, rope- lights and fairy-lights are starting to appear in supermarkets everywhere. They’re ridiculously cheap, it’s true — but don’t you think they’re a bit short on originality? The project described in this article attempts to put this right, admittedly at greater cost, but what fun to build your very own Christmas lights, entrancing and totally unique — and what a fine present they’d make, too! These lights let you produce the most dra- matic lighting effects, by altering the count- less available movement patterns (vari- able-speed chaser, random illumination, short or long flashes, etc.), and adjusting the colour (32 levels), saturation (16 levels, including white), and brightness (24 levels) — that means over 1 0,000 possible colour permutations! Broadly speaking, the system consists of a master module that drives from 1 to 62 slave modules, identical in all respects (the ‘lights’), with a 9 V PSU, supplying at least 2 A for 30 lights. The power supply is dis- tributed to the master and lights in parallel (Figure 1). The master drives all the lights over a single wire that carries a serial control signal. Dur- ing the initialization stage, a return signal allows it to count the number of lights, which is then stored in the PIC’s internal EEPROM. Thus this return signal is used only once in the fairy-lights’ lifetime, and can then be disconnected, meaning that only one end of the string of lights has to be connected to the master module. The master sends regular control signals to the lights to set the hue, brightness, and saturation for each light. The current master program runs through four types of multi- coloured chase sequences and random col- oured or white flashes, but it’s very easy to add others by programming the master’s microcontroller. The cost to build... ... is mainly affected by the price of the components forming the individual lights. By searching around on the Internet (for example, LEDs can be found on eBay for around 1 0 pounds for 50 pcs), the cost of each individual light can easily be brought below £2.50 (excluding PCB). Hardware The master module (Figure 2) consists of a 5 V regulator (IC1 ) and associated com- ponents, a PIC18F2550 microcontroller running at 20 MHz, and a reset circuit for the PIC (R7, D3, D4, and C9). It includes other sections for the extensions that are optional, and so not yet implemented: • visual indicators (D1 and D2) to indicate the status of the master; • a push-button (SI ) for changing the movement pattern; • a TTL-level serial port connector (l<7) for communicating with the PIC; • an EEPROM (IC2) for storing movement sequences; • an analogue input (K2) so the move- ment can follow the rhythm of the music — for example, by connecting a mic/amplifier circuit; • a USB connector (K6) so the fairy-lights can be driven from a computer. Only two pins of the PIC are needed to provide the interface with the individual lights. One pin configured as an output (CCP1 ) transmits the control signal to the first light via connector K4. One other pin configured as an input (CCP2) receives the 36 i2-20og elektor Figure 1 . Block diagram of the light string. You can connect up to 62 slave modules (individual lights). Figure 3. The circuit diagram for one of the lights. To be repeated 62 times, if you can afford it... K1 1st LED o- K4 Last LED a K5 C4 p00n K6^~ D- D+ GND USB-B VCC o D3 R7 R1 R6 1N4148 D4 — C9 1N4148 _[3J lOu 35V 11 K7 C7 lOOn 6 VCC VCC o C8 ^pOOn VDD MCLR/VPP IC3 RCO RC1/CCP2 RC2/CCP1 VUSB RC4/D- RC5/D+ RC6/TX/CK RC7/RX/DT VSS RBO/SDA RB1/SCL RB2/INT2 RB3 RB4 RB5 RB6/PGC RB7/PGD PIC18F2550 o c/> o o c n O VSS C5 22p XI \W\ 20MHz X C6 22p 090125 - 11 Figure 2. The master module circuit diagram. The EEPROM IC2 could be used for storing sequences. return signal from the last light via connec- tor l<5. These signals are pulled down to 0 V via resistors R1 and R6, for reasons which will be explained later. Connectors l<4 and l<5 convey the power rail to all the individual lights in the string. Circuit of the individual lights Each individual light (Figure 3) consists of a small 8-pin 12F508 PIC microcontroller (IC2), a 78L05 5 V regulator, two switching transistors (T1 and T2), and an RGB LED (D1 ) with current limiting resistors. For better colour rendering, you can matt the front of the LEDs using fine glass-paper, which helps improve the mixing of the R, G, and B colour components. All the input/output (I/O) pins of the PIC are used. Three pins GPO to GP2 are configured as outputs and are connected to the LED’s R, G, and B cathodes. A ‘0’ on these pins allows current to flow in the LED elements. One pin, GP5, also configured as an output, is used for controlling all three elements together. It drives the LED anode via tran- sistor T1 , allowing a current of 60 mA to be switched, greater than the PIC output alone could handle (20 mA). PWM (pulse width modulation) signals from these pins make it possible to adjust the brightness of each element, as well as the overall brightness of the LED triad as a whole. elektor i2-20og 37 Figure 4. Flow chart for the master program. Pin GP3, configured as an input, is devoted to receiving the drive signal from the pre- vious module (or from the master mod- ule, if this is the first module in the series). This signal is regenerated and inverted by transistor T2 before being passed on to the next module (see below). The collec- tor of this transistor is fed from pin GP4 of the PIC, configured as an output. The function of GP4 is to be able to inhibit the signal sent to the next module when it is taken to 0 V. This function is used in the counting stage when the fairy-lights are first initialized. The PIC and the LED are fed via the 5 V reg- ulator, which can supply up to 100 mA, enough to light all three LED elements con- tinuously at their maximum permitted cur- rent (20 mA each). This regulator is pow- ered from the 9 V rail that comes directly from the master module’s PSU. We have designed PCBs for the master and slave modules, available from the Elektor website [1] . Software The master module’s PIC program was produced in C with the help of the MPLAB MCC1 8 compiler^ (free version 3.21 ). The PIC program for the individual lights was produced in C using the CC5X com- piler^ (free version 3.3A) which generates simple optimized assembler code that is very close to the C code. The two pieces of software can be down- loaded from the web page for this article [1] . All the ingenuity in these fairy-lights lies in the software, so it’s considerably more complicated than the actual hardware itself. This software uses some interesting tech- niques that can be employed in other appli- cations. Even though all the individual lights contain the same software, each light can be addressed individually, without needing to be configured first. The individual lights can be interchanged, or a failed one can be replaced, without changing the behaviour of the string as a whole. We’re using this technique here to produce a string of fairy-lights, but by replacing the RGB LEDs with relays and using the appro- priate hardware (and modifying the soft- ware, of course), you could easily produce, for example, a modular garden watering and irrigation system — or a home auto- mation system for adjusting the lighting in the various rooms in your house. What’s more, the master module can be expanded using a USB port, for example, or an EEP- ROM. So there’s no shortage of potential applications. So, how does this software work? Well, take a look at Figures 4 and 5 for an over- view, and read the following description carefully. Initialising the light string When power is first applied, the master and the individual lights start a 3-stage initiali- sation process: 1. Polarity detection; 2. Frequency calibration; 3. Addressing and counting. Polarity detection This stage allows each individual light to determine if it is separated from the master by an odd or even number of other lights, in order to allow for the inversions caused by the T2 transistors in decoding the drive signals. At initialization, the master PIC outputs are at high impedance, and so resistor R1 pulls the CCP1 output down to 0 V. The second light and all the others in even positions now detect a ‘1 ’ on their GP3 inputs. Using a program variable that stores this polarity, these lights will from nowon invert the GP3 input before interpreting it. 38 i2-20og elektor 090125 - 16 Figure 5. Flowchart for the lights program. In the following explanations, we’ll use ‘N’ to describe a ‘0’ (0 V) and ‘P’ to describe a ‘1 ’ (5 V) on the GP3 inputs of the ‘odd’ lights (with no inversion of the CCP1 signal). The opposite applies to the even lights (with CCP1 inversion). Frequency calibration After detecting the polarity, each light waits for a P on its GP3 input. At this moment, the master starts transmitting a square-wave signal with a period of 200 ps for one sec- ond. At the same time, each light starts a process of measuring the period of the square-wave signal received on GP3 using the PIC’s TO timer register. Each time GP3 changes state, a measurement of the period is available to regulate the PIC’s clock rate. This is achieved by adjusting the OSCCAL register so as to get closer to the measured 200 ps period. The process stops when the measured difference falls below a certain threshold. Lastly, to end this stage, each light waits for the master to settle the GP3 signal at N for longer than 130 ps. Addressing and counting After completing the preceding step, the master generates a sequence of 64 cycles of a square-wave signal identical to the previ- ous one (Figure 6). The modules will then ‘collaborate’ so that each can determine its own address, in the following manner: 1 . wait for a P on GP3; 2. wait a few microseconds for all the lights to detect this P transition; 3. enable (goes to 0) the GP4 inhibit output (through T2, which forces the following module’s GP3 input to 0 V); 4. wait for two successive P/N transitions on GP3; 5. disable the GP4 inhibit output (goes to 5 V); 6. count the number of N/P transitions; 7. subtract this number from 63 to obtain the address. If the end-of-string connector is connected back to the master module, the master too can count the N/P transitions on its CCP2 pin and in this way count how many individ- ual lights the string has. It then stores this number in the PIC’s internal EEPROM and will use it to drive the light-string sequences correctly. If the connector is not connected, the master counts zero lights, and in this event uses the value stored in its EEPROM. Control signal After the string has been initialized, the mas- ter module starts the sequencing. As the master only has one wire to carry its quite complex control signals, the communica- tion protocol is also a little complicated. The master can transmit over 1 ,000 words a second to the lights. A word is coded using seven bits. The value of the first bit indicates if the following six bits are an address (bit 1 = 0) or a command (bit 1=1). Each word is separated from the previous one by an ‘End’ marker. This marker makes it possible to re- synchronise any lights that might have got out of sync with the control signal. Single-wire transmission is achieved by an asynchronous serial signal using a proprie- tary protocol. To transmit a ‘1 ’ bit, the mas- ter module sets the control signal to 0 V for 30 ps, then to 5 V for 58.3 ps. To transmit a ‘0’ bit, the master reverses these timings, setting the signal to 0 V for 58.3 ps, then to 5 V for 30 ps. To transmit the ‘End’ marker, the master sets the control signal to 0 V for 1 60 ps, then to 5 V for 20 ps. Hence the total period for transmission of an address or command word is 798 ps. In orderto decode this word, the individual light synchronise themselves by waiting for an N-to-P transition on their GP3 inputs. They then measure the duration of the P state using their TO timers and deduce from this whether the master sent a 0 or a 1 . Address word The A word (Address) enables the master to elektor i2-20og 39 Table 1 . Command word values and functions 5 4 3 2 1 0 Operation 0 0 0 0 0 0 Set the component read pointer to memory 0 0 0 0 0 0 1 Set the component write pointer to memory 0 0 0 0 0 1 0 Set the component read pointer to memory 2 0 0 0 0 1 1 Set the component write pointer to memory 2 0 0 0 1 0 0 Increment the component read pointer 0 0 0 1 0 1 Increment the component write pointer 0 0 13 12 11 10 (13 to 10 ) - 6 = overall intensity setting ( 0 - 9 ) 0 1 13 12 11 10 13 to 10 = red component intensity setting ( 0 - 1 5 ) 1 0 13 12 11 10 13 to 10 = green component intensity setting ( 0 - 1 5 ) 1 1 13 12 11 10 13 to 10 = blue component intensity setting ( 0 - 1 5 ) Figure 6. Timing diagram forthe counting stage that enables each light to determine its own address. address up to 62 individual lights. The first light connected directly to the master has the address 1 , the next has the address 2, and so on. Addresses 0 and 63 have special functions. Address 0 is used as a ‘neutral’ word that doesn’t change the state of the lights. This word enables the master to pro- vide a clock to the lights, which need this to be able to light up at the required bright- ness, even when there are no command or address words. Address 63 allows the mas- ter to address all the lights at the same time (this is a broadcast address). As soon as a light has decoded its own address, it ignores any other addresses that follow immediately, and then executes all command words that arrive until the next address word is received. Command words Each individual light has four memory loca- tions and two pointers that address them. Each memory location stores a set of four intensities, three forthe RGB components and one for the overall component. These locations are addressed by write and read pointers. The master can move these point- ers at will from one memory to the next, via six special commands (Table 1). Four other commands enable the master to write an intensity value (from 0 to 1 5) for the RGB components and an intensity value (from 0 to 9) for the overall compo- Table 2: R, G, or B component generation table. BRI COUNTER LEVEL 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0% 1 1 1 6% 2 1 1 1 9 % 3 1 1 1 1 13 % 4 1 1 1 1 1 16 % 5 1 1 1 1 1 1 19 % 6 1 1 1 1 1 1 1 22% 7 1 1 1 1 1 1 1 1 25 % 8 1 1 1 1 1 1 1 1 1 1 31 % 9 1 1 1 1 1 1 1 1 1 1 1 1 38 % 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 44 % 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 50 % 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 63 % 13 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 75 % 14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 84 % 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100% 40 i2-20og elektor nent into the memory addressed by the write pointer. The master moves the read pointer (‘read’ from the point of view of the individual lights) over a set of data it has previously written. In so doing, it selects this set as the illumination set-point for the light. By using the broadcast address 63, the master can change the illumination set-points of all the lights in the string at once, producing a simultaneous effect. For example, to make the lights all light up red at the same time, the master can send the following words one after the other (assuming that at the outset, the individual lights’ read and write pointers are at the first memory location 0): A-3F: address word 0x3F, 63 in decimal, broadcast address, C-05: command word, moves write point- ers to location 1 , C-OF: sets overall components to maxi- mum (9), C-1F: sets red (R) components to maxi- mum (15), C-20: sets green (G) components to 0 (unlit), C-30: sets blue (B) components to 0 (unlit), C-04: moves the read pointers to location 1 (illuminated red). Applying the illumination drives The individual light modules generate the illumination drives by altering the chosen lit/unlit duty cycles of the LED elements. This generation takes place periodically in two cycles: 1 . a 25.5 ms cycle for the RGB components and 2. a 798 ps cycle for the overall component. RGB component generation cycle Systematically every 798 ps, a light receives a command or address word from the mas- ter. Each time, it increases a counter that runs in a loop from 0 to 31 . This counter, with the intensity set-point to be applied, enables it to step through a component illu- mination table (Table 2). If the table con- tains a 1 , the light lights up the component by setting a 0 on the relevant GPO, GP1 , or GP2 output. If the table contains a 0, the light extinguishes the component by set- ting the output to 1. As this counter can take 32 values, the inten- sity set-point generation cycle has a period of 32 x 798 ps = 25.5 ms. As this duration is longer than the eye’s 20 ms persistence of vision, this could cause a slight impression of twinkling. A number of choices have been made to reduce this effect: • a minimum of two illuminations are car- ried out during the generation cycle and • these illuminations are positioned in a specific way within the cycle. You will notice that the intensity set-point is not exactly proportional to the element’s illumination level during the cycle. This lets us compensate for the Weber-Fechner law [4] (stating that “the sensation varies as the logarithm of the stimulus”) and allows our eyes to perceive an intensity that is substan- tially proportional to the set-point. Overall component generation cycle The successive operations (bit decoding, command execution) an individual light performs during the 798 ps word transmis- sion cycle are broken down into nine seg- ments by special processing devoted to gen- erating the intensity of the overall compo- nent (Figure 5). At the start of the cycle, the light resets a counter to 0. At each step of the processing, the light sets the PIC’s GP5 output to 0 (lit) if the counter value is lower than the intensity set-point, or 1 if it is higher. Each time, the light increments the counter by 1. Combining the components Combining the RGB and overall components lets us adjust the brightness over a wide range. This is particularly useful where a col- our is obtained from a mixture of two com- ponents, as in the case of orange, obtained by mixing the red and green components. A good orange colour is obtained by setting the RGB components to 1 5, 6, and 0 respec- Publicite Prototype & small series PCB specialists pCB P r ° se tM'ice CIRCUITS Instant online pricing and ordering Low order-pooling prices - 1-8 layers Full options service On demand - 1-16 layers Deliveries from 2 days Stencil service ROT' - 2 boards in 2, 3 or 5 days - No tooling charge - Low PCB-Proto prices E.g. 2 x 100 x 80 mm: 2 layers 38.12C each* 4 layers 77.23C each* - Immediate online ordering - No minimum order charge Call us: 020 8816 7005 Email: euro@eurocircuits.com www.eu rod rcu its.com elektor i2-20og 4i COMPONENT LIST Master module Resistors R1 = 1 ka R2,R3 = 2.2ka R4,R5 = 100£1 R6 = 22kn R7 = 1 0k£l l<6 = USB-B socket for 1C (see text) l<7 = 4-way SIL pinheader, lead pitch 5.08mm (0.2 in.) SI = pushbutton, 1 make contact (see text) XI = 20MHz quartz crystal, HC49/ U case PCB, ref. 0901 25-1 [1] Miniature lamp (each) Capacitors Cl = IOOOjiF 35V, radial, lead pitch 5.08mm (0.2 in.) C2,C3,C4,C7,C8 = lOOnF C5,C6 = 22pF C9 = IOjiF 35V, radial, lead pitch 5.08mm (0.2 in) Semiconductors D1 , D2 = LED, 3mm (see text) D3, D4 = 1 N4148 IC1 =7805 IC2 = 24FC1 025-l/P (Microchip) (see text) IC3 = PIC1 8F2550 (Microchip) Miscellaneous K1 = 2-way terminal block, lead pitch 5.08mm (0.2 in.) I<2, l<3 = 5-way SIL pinheader, lead pitch 5.08mm (0.2 in.) I<4, l<5 = 2-way terminal block, lead pitch 5.08mm (0.2 in.) Resistors (SMD1206) R1 = 2.2ka R2 = 1 00^ R3 = 4.7kn R4, R5 = 47 a R6 = 47 ka Capacitors Cl = 220pF 25V radial, lead pitch 2.54mm (0.1 in.) C2 = 1 0OnF (SMD 1 206) Semiconductors D1 = LED, RGB, common anode IC1 = TS78L05CX, SOT-23 case IC2 = PIC1 2F508-I/SN (Microchip, SOIC-1 50) T1 = BC857, SOT-23 case T2 = BC847, SOT-23 case Miscellaneous PCB, ref. 0901 25-2 [1] Master module component layout. Slave module layout, component side (left) and soldering side (right). tively. By reducing these values moderately and proportionately (for example, to 1 0, 4, and 0), we can obtain a lower intensity with- out changing the orange colour too much. However, it becomes hard to reduce the intensity still further, as this would lead to a more drastic change in the colour. The ratio between the perceived luminous intensities of the R and G components would depart too far from the initial value that gave us the orange colour. To obtain a greater intensity reduction, it’s better to act upon the overall component. Just to finish off... After reading the rather detailed description of the software, you may be feeling like a bit of a change. Well, make the most of that to wire up the lights — you’ve got another 62 to go! Warning: the master module soft- ware published on the site works fine with around 30 lights, but has not been tested with a greater number — the limit will be related to the maximum rate at which commands can be sent out from the mas- ter module. And while you’re trying to sol- der the SMD components, you’ll be able to have a think about other applications for this dynamically-addressed ‘single-wire’ network (using four wires). Send us your suggestions, and photos or videos of your fairy-lights, and we’ll publish the best of them in a future issue and/or on our website. Happy Christmas! (090125-I) Internet links nodeld=1 406&dDocName=en01 001 4 [1 ] www.elektor.com/0901 25 [3] www.bknd.com/cc5x/index.shtml [2] www.microchip.com/stellent/idcplg?ldcService=SS_GET_PAGE& [4] en.wikipedia.org/wiki/Weber%E2%80%93Fechner_law 42 12-2009 elektor BLDCand PIM modules added to RS Components* EDP By Luc Lemmens (Elektor Labs) In our earlier encounter with the Embedded Development Plat- form (EDP) from RS Components published in the December 2008 issue it was already mentioned that RS had more mod- ules in the pipeline for release in 2009. Two of these, the BLDC (brushless DC) motor controller and the PIM (plug-in module) adapter for Microchip MCUs recently arrived for review here at Elektor labs. Green boards this time, of solid build quality, ready to plug on to the ‘stations’ provided on the baseboard. The RS EDP is aimed at the professional market where hardware cost is not so much as an issue as the hours engineers have to spend on getting turnkey embedded systems up and running, based on industry-standard microcontroller platforms like the ST ARM9 and Infineon XC167. The new PIM board allows engineers to build industrial, motor control and auto- motive applications around Microchip’s PIC24, dsPIC33 and the latest PIC32MX devices — all of these are supported by vast amounts of ready to run code and in all honesty I would expect the Microchip MCUs to confine the ST and Infineon product to a back seat within the EDP. 1 5 » - Is z rm ™ a ttNKM i'-i ■!-*. .-[I rjm, jtlT| I U i ) I spj uij k ixbA i 1 '-j «u' >j .< cu ■: l> - *»• " b ' ■ !*■ CrrJl lp ViT ~ - >.►-/! MmlSiS!, ■ .. -.Of* *■■■-■ rr pi ' • ■ < . v. 1 _ -t - 4 r.a *rr : r.: n i ; - l « , J 1 ' P , 1 I * i- , IK I < I - The new BLDC module is capable of driv- ing two 24V 4 A motors or three brushed motors with the same rating. The problem with versatility Although the EDP is based on a sound design concept that should go a long way, its very versatility may well turn out to be a point of concern. The growing number of processor engines available requires many modules to be ‘rejumpered’, or even PCB tracks to be cut and rewired to other pads on the board. For example, the DI045 board (digital input/output) has no silk screen for the jumper configuration. If you want to do the ‘jump- ering’ with any level of confidence, the settings have to be duly noted from a (hard-copied) page found in the manual, also using a table that’s not at all simple to understand and interpret. From everyday experience I can vouch that this is fiddly work, fraught with pitfalls and mistakes are easily made, inevitably leading to tiresome faultfinding exercises or the odd whiff of PCB smoke if something is really amiss. Instructions for use The full documentation complement for the EDP is on a CD- ROM, which is not my favourite medium. The version number appears in small print; version 1.4 is the one describing the dsPIC and PIM adaptor. It appears however that the operation and use of modules has not been integrated into the system documentation (i.e. the base board and the plug-on peripheral modules). The CD-ROM contains MPLab V8.20, however this platform has been updated a few times since the release of EDP and is cur- rently at V8.36. Fortunately, the product is freely downloadable from the Microchip website. The installation of the IDE from the CD is not automatic — the software is in a .zip archive forcing a manual installation procedure. Enter PIM and BLDC The Command Module (PIM adaptor) is designed to enable Plug-In Modules to be connected to the base board. These are basi- cally boards with just a microcontroller and some connectors fitted, much like the ones > applied within Microchip’s Explorer-16 system (see Elektor January-April 2007). The Com- mand Module also has jumpers for hardware settings including the ADC reference voltage, the supply voltage and the CAN bus configuration. Surprisingly the newly added BLDC board is not found in the menu on the CD, which initially caused some concern. Fortu- nately, with some effort and using the Windows Explorer a folder called Microchip_BLDC was found that contains all rel- evant documentation and software to get started with brush- less motors. Conclusion Although RS have again underscored and extended the ver- satility of the EDP, the ‘logistics’ are not smooth and getting a brushless DC motor running using, say, the STR912 ARM9E CPU module and the Basic Communications module, is far more complex than the basic web server we succeeded in configuring in no time at all for the previous review using the launch version of the EDP. We are waiting with baited breath for yet more EDP modules like the NXP ARM Cortex, Bluetooth, WiFi and FireWire to see how easily these can be added to the system. ( 090800 -I) elektor - 12/2009 43 E-LABS INSIDE E-LABS INSIDE By Antoine Authier (Elektor Labs) & Clemens Valens (Elektor Editorial France) Elektor Developers’ supporters of SDR and Linux. Martin’s company distributes the Universal Software Radio Peripheral in Europe. The USRP is a hi- tech open project that makes it possible to receive any radio sig- nal between 0 and 6 GHz, depending on the baseband demod- ulator installed. Two models of USRP exist, able not only to receive several channels simultaneously, but also to transmit. The great advantage of SDR is the possibility of using the same equipment for all types of radio communication, since all the intelligence is in the software, and so it is programmable. An SDR lets you listen to the FM band, for example — but also to demodulate a cellphone or GPS signal. With SDR, you’re all set for the future: when a new communication technique comes along, all you’ll have to do to decode it is to load the appropriate software module. The tool that makes it possible to produce or modify the modules for SDR is GNU Radio, a powerful environ- ment with a user-friendly graphical editor. The power of USRPs combined with the flexibility of comput- ers makes some interesting experimentation possible. It is, for In line with its vocation as a platform for electronics technicians from all round the world, Elektor recently organised an inter- national conference for developers: for two days, DevConf #01 brought 20 or so people together at Elektor HQ to consider new projects to be developed by and in Elektor. Half of these partici- pants were external consultants or developers invited by the engineers of the Elektor laboratory. In a relaxed atmosphere, the group, which comprised no less than seven nationalities, watched presentations by the external developers of their individual projects and their current con- cerns and work in progress. Each presentation was followed by a discussion, allowing the group to go further into points of particular interest, clarify certain details, and address related subjects. GNU Radio Martin Dudok van Heel, from the Olifantasia company, assisted by radio amateur Pascal Schiks, presented his work on open- source Software Defined Radio: GNU Radio PI. Both are keen Improve the world * Bad guys * rdaid-Bki a'li GOtHI. n-HTis! arca fce race ipecirj^i * K«p PK p1 imi •imixiiiuira ees Prices iMIude Ui oritact us for overse . D. Web: vy u vj.u aa k e kip .cd.uk-- Em sase add £2.00 jovyardsUK postag , or order online. Pri ices t at till 3/UTgrlF, m P'iSSt^pHoO.Uk order. Christmas Holidays Circuits Nicely timed for the Festive Season we present a compilation of circuits that make excellent workbench projects for the odd ‘learn-while-U-tinker’ hours you should be able to claim for yourself this December. Most of the parts used in the project we reckon may be in your junkbox or hidden in a cupboard or in a box in the attic or cellar. Good instructive stuff for the Christmas holidays period. Have fun! Bat detector By Thomas Scarborough (South Africa) Bats are truly amazing creatures. Even in pitch-darkness they can still sense their surroundings by first producing a sound burst that’s inau- dible for humans and then listening to the reflections - a technique humans have mastered only relatively recently using electronic equip- ment called radar. The bat’s brain then forms a picture detailed enough to recognise any form of potential food. To gain a little insight into the life of a bat the author has developed a bat detector. It almost seems as if the bats thought being a flying mammal wasn’t enough to make them stand out. Their ability to ‘see’ with their ears works so accurately that it allows them to find their way in the dark of night and hunt for the tiniest of mosquitoes. As David Attenborough would say: stunning! As already mentioned we can’t hear the sounds produced by bats, since the frequency lies far above the upper limit for humans. A bat creates clicking sounds (burst) with a frequency between 1 2 and 1 50 kHz, in rapid succession with a rate between 20 to 1 00 times a second. The exact parameters depend on the species. To convert these clicking sounds into something audible, you’ll need a bat detector. In contrast to other designs, the project straightfor- ward and compact; nevertheless it works perfectly. When Thomas tested his detector for the first time, he was startled by the sheer volume these animals produce. It almost seems as if the bats were screaming their lungs out! Regardless of volume, this circuit itself can handle the full bat sound spectrum. The only limiting factor is the microphone, for which Tho- mas ‘misused’ a so-called ‘piezo-conetweeter’; a piezoelectric high- tone loudspeaker with a cone shaped membrane (as shown in the pic- ture). A similar loudspeaker can pick up sound waves with frequencies up to 50 kHz, which is adequate to detect most species of bats. You could also experiment with a common piezo buzzer (as shown in the picture of the pre-built prototype) or with a piezo-horn tweeter. It worked for Thomas, so it should be worth a try. Two methods exist to convert the ultrasonic bat sounds to some- thing audible. The first simply compresses the ultrasonic sound spectrum between 20 and 1 00 kHz to an audible range (for exam- 48 12-2009 elektor Bat ‘transmit’ frequencies pie, covering 2 to 1 0 kHz). In other words, it maps all the high fre- quencies to a range which is audible to humans. A less complicated method — from a technical point of view— in the present design relies on the interference patterns which appear after mixing a frequency generated by an oscillator with the frequencies emitted by the bats. The resulting signal is composed of frequencies of both the sum and difference of the two input waves, like in super- heterodyne receivers. So let’s assume we pick up a constant tone of, for example, 40 kHz while the oscillator is set to 35 kHz. The mixer output signal will be composed of two frequencies: 5 kHz (the dif- ference) and 75 kHz (the sum). The latter one is still inaudible, since it’s outside our hearing range, but we’ll hear the 5 kHz note without any problem. Using this approach, it’s essential to set the oscillator to a fixed value which produces audible sounds after the mixer. The circuit Now for a more detailed approach. First, the bat cries picked up by microphone XI (or, in our case, the piezoelectric tweeter), get substantially amplified by three opamps, IC1 B, IC1 C and IC1 D. The circuit gain is controlled by preset PI acting as a potential divider. The three opamps are all housed in the same 1C, the type TS924IN to be precise. This chip contains a total of four opamps. Since the fourth opamp (IC1 A) remains unused in this circuit, its two inputs are connected to ground to ensure the component stays inactive. After the amplification process, the signal gets fed through NAND gate IC2B, where it essentially gets NANDed with itself, the upshot being that it’s turned into a neat square wave. Next, the signal is mixed in NAND gate IC2C with the adjustable frequency generated by oscillator IC2A and its surrounding components. The NAND function of this gate causes the difference of the two frequencies to appear on the output, which is then fed to the earpiece (X2). Hopefully, this process has produced a frequency within the audible range. The remaining gate of the CMOS 1C 4093B, IC2D (which, again, con- tains four separate gates) is used fora nifty technical trick. The gate is used to invert the signal at the other side of the earpiece. This trick essentially doubles the sound volume, because it makes the mem- brane in the earpiece move both inward and outward relative to its quiescent state. Without this trick, the membrane would only move in one direction; either constantly to the inside, or constantly to the outside, depending on the polarity of the earpiece. The use of an earpiece like the one in the picture is highly recom- mended. The superheterodyne principle on which the circuit is based is quite sensitive to acoustic feedback between the micro- phone (XI ) and loudspeaker (X2), which could cause a character- istic screech in the sound. This sensitivity is mitigated by placing the sound source straight in to the ear (hence the name earpiece). Another way of reducing the feedback issue, is to increase R1 1 (which is used for current limitation) to 1 megohm or to place the microphone XI in a cylinder (a piece of PVC tubing for example). The latter solution even makes a kind of directional microphone! Calibration and practical use The calibration doesn’t necessarily require a bat as a test subject. Your own voice creates inaudible high frequencies (which can be Greater horseshoe bat 83 kHz Lesser horseshoe bat 95-1 25 kHz Whiskered bat 30-80 kHz Natterer’s bat 30-80 kHz Dauberton‘s Bat 30-80 kHz Greater mouse-eared bat 30-70 kHz Bechstein's Bat 30-80 kHz Common Pipistrelle 40-45 kHz Serotine bat 25-80 kHz Common Noctule 15-50 kHz Barbastelle 30-70 kHz Brown long-eared bat 15-50 kHz Grey long-eared bat 15-50 kHz heard by cats) whenever you produce a ‘sssssh’ (like in the word ‘shell’) or a ‘psssst sound. The higher harmonics which are then produced can be used for the calibration of the circuit when in a quiet environment. Even snapping your fingers or rubbing dry hands together produce ultrasonic waves! Connect the power supply, keeping in mind that the circuit requires approximately 1 0 mA, which can easily be supplied by a 9 volt bat- tery. Then insert the earplug in your ear. Make sure PI and P2 are set at maximum resistance, so both the volume and oscillator frequency are at their lowest. Now keep turning the sensitivity potentiometer PI until the higher harmonics (which can be produced as indicated above) can be heard clearly. This allows the bat detector to be calibrated with relative ease. Anyone who wants to go the extra mile can fine tune the circuit by holding it close to an old cathode ray tube TV. Parking radars on cars are also known to produce ultrasonic sounds. Now the hunt for bats can begin! But please bear in mind that bats aren’t the only creatures to emit ultrasonic sound bursts in nature. A wide variety of animals like birds or crickets also produce ultrasound waves. To make sure you’re really hearing a bat, you need to point the microphone at a flying bat. You should then hear a rattling or clicking noise. If the results are poor, potentiometer P2 might need some adjusting. It should be noted that bats are protected animals in most coun- tries, so never disturb them in their natural course of action! One last tip: the detector described here can be used to listen to many other sources of ultrasonic sound. For example, it can aid fix- ing a bicycle tyre by locating the leak! Gas escaping through a nar- row exit also produces ultrasonic sound. (i- 00553 ) Back door alarm By Ton Giesberts (Elektor Labs) Although common sense repeatedly tells us that inanimate objects can’t move by themselves, it sometimes sure seems like they do. No matter how sure you are that you closed the back door, it will always find a way to sneak back open and let the cold air in, which is unac- ceptable in wintertime considering the low temperatures outside and elektor 12-2009 49 Fv# energy prices. Not to mention the lengthy discussions arising from a simple question like “Honey? Did you close the back door?” Both rea- sons, and others, prompted the Elektor lab to find a solution. This sim- ple yet effective circuit solves all these problems with a mere four com- ponents (well five if you count the battery), as shown in the diagram. The circuit can be fitted in a small ABS casing, which would ideally contain a space for a 9 V battery, and should be located on the door frame. Next, you will need to attach a small but strong magnet to the door itself. The sensor of this circuit is based on a reed switch. That’s basically a switch which only conducts when placed within a sufficiently strong magnetic field. The presence of the magnetic field caused by the mag- net on the door is detected by the circuit, causing it to buzz or to remain silent. Although it will probably take some experimentation to get the magnet at the correct distance from the reed switch so that the alarm will go off if the door is even the slightest bit ajar, this is always possible. We selected a reed switch instead of a micro switch because the latter requires physical contact to influence current, while a reed switch doesn’t. As long as the door is closed, the magnetic field will cause the reed switch to conduct, which causes the base of the transistor to be connected to the negative pole of the battery. Con- sequently the Darlington transistor blocks all current through the buzzer causing it to remain totally silent. As soon as the door opens, the distance between the magnet and the reed switch becomes so large that the reed switch stops conducting, causing the base of the Darlington transistor to be effectively discon- nected from the negative pole. Even though R1 has a very high resist- ance, it nonetheless conducts enough current to activate T1 , causing it to conduct, which in turn causes the buzzer to emit sound. A Darlington transistor was selected for this circuit because of its ability to considerably amplify currents and because of the very small current it needs to start conducting. This allows R1 to have a BC517 / / / Reed switch + BT1 9V very large resistance so only a small amount of current is used when the door is closed (which means that SI conducts current). This can be proven using Ohm’s law: I = U / R = 9 V / 1 MO = 9 pA. The upshot is that a simple 9 V battery will last for months! We decided to use a 1 2 V piezo buzzer in this circuit (and, to be more precise, a CEP-2260a in our prototype), which emits a loud tone and seems to work fine at 9 V and below. You can basically use any buzzer which works at 9 V, provided it doesn’t consume too much current. Do not attempt to use a buzzer that draws more than a few milliamps. When the buzzer is activated, the current rises from 9 pA to approximately 4 mA. Due to the simplicity of this design, you could easily omit the pro- totype board altogether and just solder the components directly — although having a circuit board does look more professional. Technically speaking it doesn’t change the fact that this circuit will work like a charm. (i- 00656 ) Poltergeist By Ton Ciesberts (Elektor Labs) Sometimes, and luckily on the rarest of occasions, our in-house designers suddenly stop being serious and start mucking around a bit. The result, which always ends up on editors’ desks, is usually pretty neat, most of the time plain weird, hardly ever useful or even practical, but invariably fun to build. This Poltergeist is one of those projects. It’s the perfect circuit to give your roommates the payback they so justly deserve. The vast majority of modern remote controls for televisions employ an infrared signal (the versions which work with ultrasound have all but disappeared). The remote control normally contains an oscillator which produces a square wave (the carrier signal) with a frequency between 33 and 40 kHz. One commonly used standard is called RC5; this uses a 36 kHz carrier signal. Information is carried by switching this signal on and off in a predefined manner. This method of modu- lating information is called AM (Amplitude Modulation) and uses a ‘modulation depth’ of 1 00%. The resulting signal is used to pulse an infrared LED, which radiates the signal through space right up to the TV set. The television set contains an infrared detector which reacts to carrier signal so the information can be received and recovered. So, what if you create a circuit which constantly sends a signal with a frequency of 36 kHz, and point it in the direction of the IR detector on the front of the television set? Since the television is constantly receiving a signal, any signal sent by a real remote control will be jammed so it won’t show up! The decoder in the television won’t be able to differentiate between the two signals, causing it to stop reacting to the commands sent by the remote control. This is our Poltergeist’s evil master plan. The circuit is quite simple. Transistors T1 and T2 are part of a regular astable multivibrator. Its workings aren’t that hard to understand. If T1 is in its conducting state, the voltage on the collector drops to 0 V. This change in voltage is passed through Cl to the base of T2, causing this transistor to stop conducting. In this state, current 50 12-2009 elektor +3 V BC550C BC337-40 X flows to Cl through R3, eventually allowing the voltage across the capacitor to rise high enough to open up T2 again. This, in turn, causes the right side of C2 to be pulled down by T2, which causes T1 to block all current, allowing C2 to be charged by R2 until T1 starts conducting again, leaving the cycle right where it started. This goes on for all eternity. Well, at least until the battery dies... We chose a standard transistor, type BC550, for T1 . T2 is a slightly more powerful device type BC337, which can handle currents up to 500 mA (or 1 A for short periods of time) allowing it to switch the rela- tively high current (1 50 mA at 3 V) through the infrared LED D1 . The frequency of this simple oscillator can be calculated using the R- C time. If R2*C2 equals R3*C1 , the time the transistor conducts the- oretically equals RxCx|n2, where In2 is the natural logarithm of 2. A low battery voltage and the voltages at which the transistors switch can mess things up a little. This causes the frequency to vary with a changing voltage. The threshold voltage of D1 also exerts some effect, though this is more or less compensated by R5, which sits in parallel with D1 and improves the charging of C2. The following table gives an impression of the change in frequency in our prototype: 31.8 4 33.6 The required current is highly dependant on the supplied voltage, as can be seen in this table: Power source voltage U (V) Current 1 (mA) 0.8 7 1 10 1.5 23 2 47 3 97 4 147 When the voltage drops below 0.8 V, the oscillator becomes unsta- ble. We also recommend not using a voltage higher than 4 V. Two AA batteries are ideal, although a small wallwart (AC power adapter with DC output) could also be used. A circuit like this is very open to experimentation. By changing the value of C2 to 1 .5 nF, the frequency becomes exactly 36 kHz, when using a power source of 2.5 V. Furthermore, if Cl is changed to 18nF, the frequency becomes 40 kHz between 3 V and 4 V, which is exactly the frequency Sony uses in their remote controls. The current con- sumption can be limited by changing the ratio of the two capacitor values. If the ratio of Cl and C2 is increased, the pulse through D1 becomes shorter. In other words, the duty cycle is shortened. We tested this circuit in the lab at a frequency of 40 kHz. The Pol- tergeist was placed at a distance of 3 m (1 0 ft.) from the television set. The remote control didn’t show any sign of control when used at a distance greater than about two metres (7 ft.). This Poltergeist can be improved by using a higher voltage than 3 V, or by replacing the LD21 7 (D1 ) by an LD274. The latter creates a more focussed bundle of light, creating a more intense beam. The Poltergeist will need to be directed more accurately though. The construction of the circuit is pretty much self evident. The whole circuit can be built in half an hour on a piece of prototyping board, as is shown in the picture. Oh, and remember: a little teasing is fun, but don’t take it too far! (i-00683) Power cut alert Apart from the icecaps melting, the ozone layer vanishing and crazed meteors crashing into us, there’s still one thing you can rely on, at least in most countries: the national power grid. Or can you? Even in these days of technology, power cuts happen more often than most people realise. Depending on when you get round to fig- uring out what’s wrong, the consequences usually vary from finally getting a good night’s rest due to your alarm clock failing, to finding your prize turkey defrosted and dripping goo in the freezer. If you don’t like a good night’s rest or if you really like turkey, this circuit might be something for you. Whatever the case, you’ll always discover the truth too late (a state- ment which can be inferred from Murphy’s Law). To prevent prob- lems from occurring due to a power cut, this power cut alert has been made. The circuit continually keeps an eye on the AC grid volt- age and gives an acoustic alert when it drops below 50 V or so for more than a second roughly. The circuit is very simple. In fact, it actually isn’t more than a poten- tial divider connected to a buzzer. The divider, which consists of the resistors R1 , R2, R3 and R4, reduces the voltage from the AC grid to a voltage which can be handled by the rest of the electronics. The circuit is designed for 230 VAC, so readers on 1 1 0-1 20 V grids have to redimension the components accordingly. Diode D1 recti- fies half of the alternating current so the circuit is fed with a ‘kind- of’ DC signal (pulsing). Under normal circumstances, the voltage across R3 is high enough to keep T1 in conductance. The gate of T2 receives a too small volt- age to keep this MOSFET conducting so no current from the battery can flowthrough the buzzer, resulting in silence. As soon as the national (or state) AC grid voltage drops below 50 V, the voltage across R3 drops below the threshold needed to keep T1 in conductance. When this happens, the voltage at T2’s gate becomes high enough (through R5) to start conducting. Now a cur- rent can flowthrough the buzzer by way of T2, causing a loud tone, indicating that a power cut has occurred. The details We chose a value of 10 for the resistors of the potential divider (R1 , R2 and R4) because these are widely available. Make sure you get resistors which can be used at voltages of at least 350 V! With a total resistance of 30 M£2, the maximum current passing through these resistors is roughly 1 0pA, which is negligible. The value for R3 is 470 kQ so the circuit kicks in when the AC grid voltage drops below 50 V. Because the power coming from the grid is alternating current (AC), the voltage drops below the threshold 50 times (or 60 times) a second. We don’t want the circuit to respond to these perfectly normal dips, so that’s why Cl was added. This capacitor causes the circuit to react if the voltage has been low for longer than a second only. Keep in mind though, that this capacitor is also directly connected to the AC grid. Therefore, it must be capable of handling voltages of at least 400 V. T1 is a standard NPN transistor. For T2 we chose a MOSFET to allow R5 to have a high resistance (10 MO). The current which runs through the circuit in normal cir- cumstances (when T1 conducts) is just 1 pA, allowing the battery to stay good for years. It’s best to use a normal battery instead of a rechargeable one, since rechargeables are subject to much greater self discharging. If a normal BC547 would have been used forT2, the resistance of R5 would have needed to be lowered to about 47 kO, causing the reguired current to increase by 0.2 mA! The buzzer in our prototype is a CEP-2260A, which draws just 5 mA at 9 V. If we assume a battery capacity of 500 mAh, the circuit can buzz for four whole days. 1 2 V buzzers which draw 50 mA are also available, but the use of them is discouraged. The construction The circuit can be built on a piece of prototyping board of just a few square centimetres, but keep in mind that the whole circuit is at AC grid potential. Mistakes in the assembly could have life threatening consequences! At the very least, the circuit needs to be made safe to touch, by encas- ing it in a proper ABS housing. Furthermore, the AC power line con- nector may NOT be directly soldered to the circuit board. It needs to be connected through a terminal block, with a distance of at least 5 mm (0.2 inch) between the terminals. All the copper pads need to be removed around all pads which are connected to the AC grid voltage (and around the resistors R1 and R4) to ensure an uninterrupted elec- trical isolation distance of at least 3 mm (see the picture of bottom BC547B BS170 of the prototyping board). Here we should repeat that it is critical to use resistors which can handle voltages up to 350 V for R1 through R4, and a 400-V rated capacitor for position Cl . The power cut alert can be tested after construction by plugging it into the AC power outlet, and then by pulling the plug again. The buzzer should produce a loud noise. Remember: Never change the battery while the circuit is still con- nected to the AC power line! All now all that’s left is a good night’s rest, and a tasty turkey! (i- 00705 ) 52 12-2009 elektor Mini radio gives maxi sound By Thomas Scarborough (South Africa) The author was introduced to a very well kept secret, which he will pass on to you through this article... if you promise to keep quiet about it. The secret tells the story of certain audio ICs which dou- ble as excellent AM radio receivers. In the circuit we are about to show you, the author has (mis)used the well known amplifier 1C LM386N (although it’s perfectly reasonable to misuse the LM380N and CA3130E too) for this exact purpose, resulting in a simple, mini- malist AM radio receiver with an unexpectedly high sound quality. In principle, the only things you need to receive an AM radio station are an inductor, a variable capacitor (forthe tuning), a (germanium) diode and a crystal earpiece. The inductor and the capacitor create a resonant circuit which is set to the frequency you want to receive. The diode detects the presence of an audio signal, which is then made audible on the earpiece. The beauty of this design is that it allows you to receive two or three strong stations (if you’re lucky) with nothing but a long wire antenna and a decent earth connec- tion. You don’t even need any transistors or batteries! The drawback of this solution, however, is the very low sensitivity. Though this is nothing a little amplification won’t fix. Fortunately no special high frequency transistors or ICs are required to accom- plish this. All you need is a handful of parts available to almost every hobbyist to create a mini radio which produces enough sound to thoroughly annoy your neighbours... The heart of the receiver is easily recognisable in the left part of the schematic. The resonance loop is built from LI and Cl. The loop resonates to the tiny electric field which is picked up by the antenna, producing a small voltage. This voltage is fed into IC1 for further amplification. The combination of D1 , R3 and C6, which are connected on the output of IC1 , take care of the demodulation of the high frequency signal. Basically, the high frequency carrier wave on which the actual information (the audio signal) is modulated using a changing ampli- tude, is short circuited byC6, leaving nothing but the low frequency audio signal, which is what we want. Actually, D1 , R3 and C6 aren’t really necessary, since IC1 already achieves a certain amount of demodulation, although the extra parts do contribute to a notice- able higher quality of output signal. Because of the amplification in IC1 , you don’t need to use a diode with an extremely low volt- age drop (like the germanium diode). The LM386 amplifies the sig- nal enough to overcome the 0.7 V drop caused by a regular silicon diode. Although you could already connect a crystal earpiece (if you can find one) to the top of C6, we recommend using another LM386 for what it’s actually designed: audio amplification. This setup will produce enough power to drive a small speaker. Potentiometer PI controls the volume. A few details To increase the stability of both ICs, two RC networks (R1 in com- bination with C3 and R4 with C9) are connected on their outputs. The 47 pF capacitors (C2 and C8) attached to the bypass connec- tions of the ICs suppress the odd irregularity in the supply voltage. This becomes important when the battery runs flat and its internal resistance increases. Just to be safe, IC1 is decoupled with R2 and C5. Components C4 and Cl 1 add an extra high frequency decou- pling. Make sure to use ceramic capacitors and to fit them as close as possible to the 1C power pins. The tuned loop comprising of Cl and LI isopen to any experimenta- tion you like. You could use the antenna coil from an old AM radio, but you could also wind the inductor yourself. We tried both options in our lab, and they worked just fine. The first prototype was made from a ferrite rod 1 0 mm thick and 37 mm long, to which we added 1 00 turns of 0.3 mm enamelled (lac- quered) copper wire (CuL). This gave an inductance of 390 pH. The second version was made from 80 turns of 0.4 mm CuL on a ferrite rod 1 2 mm thick and 1 90 mm long, resulting in an inductance of 550 pH. With this information, it’s possible to calculate the value of the capacitor you need to be able to tune across the medium wave (MW) range. Capacitors with values between 200 pF and 500 pF are best, although it’s also possible to use a smaller variable capacitor and a fixed capacitor in parallel. Construction and operation Like most of our circuits, this design can be built on a piece of proto- typing board. Just keep in mind that this is an RF (radio frequency) circuit! This means that you need to take special care to place IC1 and its surrounding parts close together and maybe even to divide the high and low frequency parts with little metal screens. Special care needs to be taken with the soldering of the tuned circuit, since you are working with very low voltages and currents. Messy con- struction will guarantee a bad result. Preferably, the finished circuit should be built in to a metal casing (leave the ferrite rod outside the case), and take care that the metal frame and the axle of the tuning capacitor are properly grounded. The amplifier 1C type LM386N is available in four different flavours (LM386N-1 , -2, -3 and -4). The versions with suffixes -1 and -3 are best for IC1 . The rule of thumb for IC2 is: the higher the number, the more sound the speaker will produce. We advise the LM386N-3 device when using a 9 V power supply, because it can supply around 0.7 watts of audio power into an 8 Q speaker. Without an antenna and a proper earth connection, your radio elektor 12-2009 53 y . ^ , ..s' 7 mm won’t work as it should. A few meters of copper wire suspended across the ceiling should work as an antenna, and a connection with an unpainted metal central heating or water tube is enough for a good earthing. For safety reasons, it’s better not to use the ground connection in an AC power socket. Finally, the circuit works fine with a voltage between 9 and 1 2 V. A 9 V block battery is a fine power source for the radio, especially because the current consumption is just 1 0 mA (with the volume control closed). Happy building and have fun listening to your favourite AM radio station! Nostalgic tube sound from an 1C By Ton Ciesberts (Elektor Labs) Even now, the real audio ‘connoisseurs’ can’t agree on one basic thing (which incidentally says enough about the ‘connoisseurs’...): Which is ‘better’, an amplifier using vacuum tubes, or one using transistors? One will shout that the ‘warm’ nostalgic sound com- ing from tubes is ‘the best’, while the other points out the benefits of unnoticeable distortion coming from a well designed transistor amplifier. Happy to stay out of this discussion, we are still proud to present this experimental digital amplifier, which produces a sound which one could interpret as ‘tube-like’. A digital amplifier? The guys at the Elektor Labs must have had a drink too much, since amplifiers are clearly analogue circuits. Well, although this is usually the case, it isn’t strictly necessary, since if an amplifier is treated as a ‘ black box' which amplifies any given input signal, it doesn’t really matter what kind of electronics are inside. Strictly speaking, we’ve made an amplifier which no other self- respecting engineer would have made: our amplifier oscillates like a madman! This oscillation is caused by a self-oscillating pulsewidth modulator. Quite an impressive name for something as simple as an oscillator which merely produces square pulses with a width dependent on the input signal. The higher the voltage on the input, the wider the pulses will be on the output. To summarise, our ‘digital’ amplifier works as follows: The low fre- quency input signal modulates an oscillator circuit in such a way that the width of the produced pulses vary in the rhythm of the input signal. This results in a pulse-density modulated (PDM) signal which controls a few transistors which can supply enough current. A low- pass filter on the output restores the information with a low fre- quency which is then fed to the loudspeaker. The big advantage of this approach is the low power consumption. Only the final transis- tors need to switch between a fully conducting and a fully insulating state, so only a little bit of power is lost. The details The final amplification of the signal is taken care of by three small MOSFET’s (T1 , T2, T3) which can supply 0.5 A each. Because the types shown in the diagram have a high on-state resistance, which is 5 O for the BS1 70 and 1 4 O for the BS250 when using a 1 0 V power supply, we need to use two BS250s in parallel to be able to supply the loud- speaker with a symmetrical signal. Because of the two transistors in parallel, the on-state resistance is effectively halved to 7 Q. The circuit is powered by an asymmetrical 9 V power supply; in our case a simple 9 V battery. This calls for decoupling capacitors (Cl and C5) at the input and output. To correctly drive the transistors, a few buffers from the ‘4000’ CMOS logic series are used. Although these are extremely slow in comparison to the high-speed 74HC 54 12-2009 elektor series, the 4xxx series isn’t as picky as regards supply voltage, happily working at supply voltages ranging from 3 to 1 8 V. And this application doesn’t require the buffers to switch rapidly anyway. Of the six available buffers in IC1 (a 4050), two are placed in series to furnish adequate levels of amplification. The remaining four buff- ers are connected in parallel to the second buffer, which improves the way the tran- sistors are driven. Components LI , C3, C4 and R4 form a low- pass filter, which only allows frequencies humans can hear to reach the speaker. A standard choke can be used for LI , as long as it can handle at least 0.5 A. The ampli- fication of the circuit as a whole is deter- mined by the ratio of R2 and R3 and the impedance of the signal’s source. If the impedance is way lower than the resistance of R2 (10 k^), the amplification will be around unity (lx). Construction and specs This circuit is quite straightforward to build. There aren’t any com- ponents which need to be fitted at a critical location, nor any other serious design measures to be taken, as long as it’s built compactly on a piece of prototyping board. It’s also best to insert IC1 in a DIL socket. Keep in mind that pins 13 and 16 of the 1C should not be connected. Also, a metal casing should be used to prevent the high switching frequency of this circuit (approx. 900 kHz at 9 V) from interfering with other appliances. Running off a 9 V source, the amplifier can supply about 650 mW to an 8 Q loudspeaker, which can cause a whole lot of noise! The distortion is about 5%. When the circuit supplies just 1 mW, the distortion decreases to about 0.1 5%. Capacitor C5 determines the bandwidth. With C5 at 1 000 pF, the bandwidth is approximately 25 Hz to 22 kHz. Admittedly this little amplifier is a far cry from its high-end or hi-fi breth- ren. On the other hand, it is very useful to get some experience with the principles of PDM. And, of course, it’s great fun to watch what’s hap- pening at various points in the circuit with an oscilloscope. (i-00734) A higher note... By Ton Ciesberts (Elektor Labs) If as a child you are sent to the butchers to fetch an ounce of ham, you’ll no doubt have heard the good man saying “Does it matter if it’s a little more?” well after cutting the stuff. Likewise, the trigger to design a tone adjustment circuit was a question I recently over- heard within an all-technical environment: “Does it matter if the tone’s a little higher?” In the article on the tube sound mimicking amplifier elsewhere in this Xmas supplement, we mentioned on the side that the audio world can be divided in to two factions: the side containing vacuum tube enthusiasts and the side propagating transistors. This isn’t the full story though, since we can draw a line between two other groups: the purists and the relativationists. To the purists, ‘equalis- ing’ (or tone adjustment) is a very dirty word, and the ideal pream- plifier consists of nothing but a length of copper wire (preferably gold-plated), although they have been known to add a potentiom- eter here and there for volume control to keep the peace around the neighbourhood. The second group is less strict and doesn’t have a problem with amplifying or muffling pieces of a music signal to fit their liking. If you belong to the latter, this tone adjustment design is something you might be interested in The design of this equaliser could be classified as ‘classic’. Further- more, the circuit also amplifies the signal at least by 4 times, which elektor 12-2009 55 allows this circuit to bear the designation of ‘full-fledged pream- plifier. It is the ideal supplement to the above mentioned PWM amplifier, especially when you’re not using high-end speakers. The range of adjustment is approximately 1 4 dB (at 20 Hz and 20 kHz), so if this isn’t enough, there’s definitely something wrong with the speaker connected up! Looking at the circuit diagram from the left to the right, the first thing you see is potentiometer PI , which controls the volume. This is followed by the buffer/amplifier chip, IC1 a. This is a non-inverting amplifier which is configured to produce a gain of 4 times (R3/R2 + 1 ). At a ±1 5 V symmetrical power supply, this amplifier can easily process a 2 V signal from a MP3, CD or DVD player. Next comes IC1 b which takes care of the actual tone adjustment. This opamp is wired as an inverting amplifier with two negative feedback loops in parallel, one for the high frequencies, and one for the low ones. The workings of this part of the circuit aren’t hard to understand if we look at the two extreme ends of the frequency range: very high and very low. First, the very low frequencies. The capacitors C3, C4 and C5 create a high-pass filter which effectively hinders all low frequencies from being transferred, removing P3’s influence on the low frequencies. Capacitor C2 also blocks low frequencies, causing the amplification of the low frequencies to be determined by the setting of P2. The maximum amplification is (R5 + P2) / R4 = 5.5x and the minimum amplification is R5 / (R4 + P2) = 0.1 8x. Now for the very high frequencies. As opposed to the low frequen- cies, C2 short-circuits all high frequencies, removing P2’s influence on them. C3, C4 and C5 also have a very low resistance, which causes the high frequencies to be passed through P3, allowing them to be controlled. Superficially, one might say the range of amplification is between (R8+P3) / R7 = 1 1 x and R8 / (R7+P3) = 0.09x. In practice, the amplification is between 6.5x and 0.1 5x due to the fact that R4 through R6 are actually in parallel to the high-frequency circuit. In any case, P3 controls the high tones. Of course we’ve tested this equaliser in the lab, the results of which are shown in the graph. The green curve is the frequency distribu- tion when both potentiometers (P2 and P3) are set at their maxi- mum, and the yellow curve was measured with P2 and P3 at their minimum. The blue curve, which is actually a very neat straight line, was measured with P2 and P3 at their middle position. From this graph you can see the range is very wide! Volume control PI is at the input of the circuit instead of at the out- put to prevent the equalisation from being overdriven. The actual construction is fairly straightforward. Just like in the pic- ture, building the circuit is easy on a piece of prototyping board. Remember to solder neatly and to keep the wiring to the potenti- ometers as short as possible. We picked an NE5532 dual opamp to take care of the amplification, since it’s specially designed for audio signal processing. This opamp causes a distortion of just 0.002% at an output voltage of 1 V for fre- quencies up to 20 kHz. The drawback of this opamp is its relatively high power consumption (7.5 mA). If this is unacceptable, a ‘regular’ dual-opamp like the TL072 can also be used. This reduces the power consumption to approximately 3.8 mA, which allows the circuit to be powered by two 9 V batteries, instead of an AC power adapter. The distortion in the signal does increase to 0.007% at 20 kHz when using the TL072, which is still acceptable. R2 can be left out of the circuit if you feel that the first amplifica- tion of the signal in ICIa is a bit high. The buffer will then amplify just lx. The circuit was designed for use with small loudspeakers. When larger speakers are used, the value of C2 needs to be increased, which decreases the bandwidth. The range of adjustment can be decreased by decreasing the capacitance of C5 a little. Enjoy the build, and have fun using the circuit! (i-00740) 12-2009 elektor Poor man’s metal detector By Thomas Scarborough (South Africa) Imagine a pleasant stroll on the beach with your trusty old metal detector, when suddenly it gives off a loud tone. After digging for a few minutes you stumble upon a ceramic pot filled to the rim with antique coins and jewellery... Eternal fame and great wealth lie ahead of you (after the government has taken its fair share...)! Admittedly, these strokes of good fortune do no happen very often, but it’s still the dream of any treasure hunter. Bu then, once or twice a year there’s a short article in the paper about some lucky guy who finds a medieval or Roman treasure on a field or in his back yard. Are you the next one? One thing all commercial metal detectors have in common is their price within the range of ‘extremely high’ to ‘unaffordable’. Even kitted versions that need to be assembled at home are not really cheap, and often result in large amounts of stress during the construction. This situation was a big pain for the author. After some serious use of both the grey and white matter inside his skull, the following circuit took shape in his workshop: a cheap and extremely simple metal detector! The circuit of the poor man’s metal detector is built around one of the most trusted and familiar ICs in the world of electronics: the good old 555. Two resistors, two capacitors and a few pieces of 0.3 mm diameter enamelled copper wire complete the whole. Apart from that, you’ll also need a portable AM radio, which should lie somewhere in the junk box of any electronics enthusiast. If not, find one at the next car boor sale in your area. The 1C is used as an inverter in this particular circuit, which feeds back the voltage on pins 6 (threshold) and 7 (discharge) through the search head coil LI to the trigger input on pin 2. Due to the reactance (resistance for alternating current) of the inductor and the inevitable delay in the 1C, the circuit will start to oscillate with a frequency close to 80 kHz, resulting in a square wave with this fre- quency on pin 3 of the 1C. Now, a reasonably high frequency square wave isn’t very useful... yet. We found the following solution for that. Coil L2 is connected to the output of the 555, so it starts working as a transmitting antenna with a very small power output. If we place the transmitting antenna close to the antenna of the AM radio receiver, we’ll hear a ‘whistling’ tone on countless places within the range of the receiver. This is a beat frequency which comes about when one of the harmonics of our 80 kHz square wave (a square wave contains loads of harmon- ics) is close to the frequency to which the receiver is tuned. The workings of our circuit as a metal detector are now easily under- standable. Assume for a moment that you have tuned the receiver in such a way, that the beat frequency has just disappeared. Nor- mally, you won’t hear a thing from the loudspeaker or headphone. But when LI is placed in the vicinity of a piece of metal, the self- inductance (and therefore also the reactance) of the coil changes. This means that the frequency of the oscillator also changes, caus- ing the AM receiver to pick up a beat frequency again. That could be your pot of gold... Practical issues The circuit is built up in a no time at all on a piece of prototyping board (see picture). The biggest job is probably winding the coils, i.e. the search head coil LI and the transmitting coil L2, but this isn’t a complicated task. You’ll need a piece of PVC or cardboard tube with an outer diameter of approximately 120 mm (it doesn’t matter if it’s a bit more or less) to wind the search head coil LI on. Neatly wind between 50 and 70 coils of 0.3 mm enamelled copper wire on the tube and carefully shove the coil off its former. Secure the coils with four of five pieces of tape. Finally wrap the whole thing in a layer of insulation tape or something similar. The searching coil needs a ‘Faraday protection’, which is formed by a layer of aluminium foil. Keep in mind that a gap of about 1 0 mm wide needs to remain open. Do not cover the full circumference of the coil with foil. The protection needs to be connected to ground. This can be achieved by winding a piece of bare wire tightly around the foil and covering the whole with yet another layer of insulation tape. Nothing can really go wrong using the picture of our proto- +9. ..12V elektor 12-2009 type and the construction drawing. The connection wires of LI are sensitive to disturbances and need to be kept as short as possible. We recommend fitting the PCB with the electronics on it as close as possible to the search coil. The transmitter coil, L2, is made from 80 coils of the same copper wire around a short ferrite rod. This coil needs to be connected to the rest of the circuit through a piece of protected coaxial cable, as shown in the photo. Again, the protection needs to be connected to ground. As already noted, the antenna needs to be placed very close to the antenna of the AM radio. If the signal still is too weak, R2 can be lowered to 680 Q or even 560 Q. The best power supply for the circuit is a set of batteries supplying between 9 and 12 V. Because the TLC version of the 555 is used, the power consumption remains modest at around 1 0 mA so the bat- teries can be used for a long time. Although this is a very rudimentary design (so don’t quit your day- time job to search for treasures just yet!), the sensitivity is quite okay. Through air, a coin with a diameter of about 1 inch (25 mm) can be detected at a distance of 1 0 cm or more! (i- 00797 )) Efficient camping dimmer By Ton Ciesberts (Elektor Labs) Especially when you’re forced to be sparing with electric power, like for example when you’re camping and you’re depending upon the limited energy supply of your car battery to light up your lit- tle tent, it is really important to let as little energy as possible go to waste. For one, the lights don’t have to be on at full force all the time. Switching lamps all the time to adjust the lighting to the situ- ation, is just inconvenient. But if you wantto dim the lights, then do it in an energy-efficient way! Controlling the lights at home is usually a matter of using electronic dimmer circuits. The advantage of such a dimmer is that very little energy is lost as heat in the dimmer itself. However, to regulate the brightness of a lamp that’s connected to a direct current source (like a campsite or vehicle battery) these alternating current regulators aren’t suitable. With a handful of parts from the junk box you can build your own efficient dimmer for use on the campsite — next year. We do want to mention: this dimmer is only suited for 1 2 volt incandescent light bulbs. The principle of an energy efficient dimmer (also the alternating cur- rent type for use at home) is based on the complete turning on and off of a light bulb at a high frequency our eyes won’t be able to dis- cern. The slowness of the bulb makes extra sure that our eyes appear to perceive a steadily burning lamp instead of a flickering one. The fast turning on and off is done with an electronic switch. Theoreti- cally no energy is lost in the switch, because when it is closed there is no electrical voltage on it and when it is open, there is no current. The product of voltage and current(= power) is therefore is always zero watts. (Usually there is some residual voltage across the switch and on top of that the switch isn’t switching infinitely fast; so there is always some energy lost in the form of heat.) If you want the bulb to burn brighter, simply increase the time the switch is closed and shorten the time it is open. That way the fre- quency of switching will stay the same. This relation between closed (lamp on) and open (lamp off) is called the duty cycle, or, formally, the duty factor. In the accompanying schematic you can see the switch in the form of power MOSFET T1 . This electronic switch is controlled by the part of the circuit on the left of it. Around ICIAan oscillatorwas made that supplies a triangular output voltage. Sure, the shape of the triangle isn’t perfect, but that doesn’t matter in this particular case. This triangular voltage is compared to a reference level set on PI , by an opamp (IC1 B) wired up as a compara- tor. If the triangular voltage level is below this reference voltage, the output of the comparator swings to 1 2 volts. The MOSFET will now conduct fully and lets a current flow through the lamp. If the trian- gular voltage rises above the reference voltage, then the voltage on output IC1 B becomes zero volts, which causes the MOSFET to turn off. The current flowing through the lamp will now be interrupted. This switching goes on at an ‘invisible’ frequency of 1 2.5 kHz. 58 12-2009 elektor If we set a higher reference voltage with PI , a larger part of the triangular voltage will drop below this voltage and the MOSFET will therefore be conducting for a longer time (and blocking for a shorter time). The result is that the lamp burns brighter. With the given values of R5, R 6 , R7 and PI a regulation of 0-1 00% can be achieved. Mostly because of the tolerance of PI , in reality there is a chance that 1 00% span can’t be fully reached. If necessary, adjust IRFZ34N the values a little and make sure that the sum of PI and R 6 roughly equals R5+R7. In series with the lamp there is an inductor (good for at least 2 amperes) with a inductance of 80 millihenries or thereabouts, 60 or 1 00 is okay too. The function of this component is to limit the switch currents and to suppress the electromagnetic interference caused by the switching. If the dimmer is switched on, capacitor C2 ensures that the bright- ness of the lamp will slowly increase up to the value set with PI This will greatly improve the lifetime of your light bulb! Just a few more practical tips: Limit the power of the lamp to about 24 watts (with a battery voltage of 1 2 volts the maximum current will be about 2 amperes). For switch SI use a type that can handle at least 2 amperes and connect the circuit through a fuse (2 amperes time lag / slow-blow) to the battery just to be sure. If the lamp is dimmed to 0% the battery current will be about 4 mA; that may not be much, but shutting the dimmer off with switch SI will save you even that bit of energy. In our prototype (see picture) we used a preset; a potentiometer with a spindle and control knob would be way more practical of course. To make sure that after your day out camping your car will still be able to start, the next thing you’ll want to build is a battery moni- tor-suitable designs have been published in Elektor over the past few years, especially in the Summer Circuits editions, and of course the30x book series. (i- 00843 ) Touchless switch By Ton Ciesberts (Elektor Labs) To the untrained eye, it may seem like magic: an engineer makes rapid Harry Potteresque gestures through the air and suddenly the light goes on or music starts to play... Luckily for you, the Elektor electronics lab isn’t Hogwarts School of Witchcraft and Wizardry, even though it may seem so sometimes; everything conceived and built in our laboratory is firmly anchored in reality and can be under- stood and constructed by everyone! There are a few different approaches you can take when building a switch that’s operated without any physical contact. For example, you could brush up on Maxwell’s equations and go for a capacitive or inductive approach. Although switches have been made using those principles, such a solution would require more electronics than what you’re used to of i-TRIXX or Summer Circuits. That’s why the engineers at the Elektor lab chose to take a radically different direction. Their solution is, for the largest part, comprised of com- ponents which you’ll probably still have lying around. The principle is simple: An infrared LED transmits an invisible signal, which does not reach the infrared receiver in normal circumstances. As soon as you place your hand in the vicinity of the switch though, the signal gets reflected enough to activate the receiver, which in turn controls a relay used to switch something on or off. The circuit is comprised of two parts: the transmitter and the receiver. To keep the construction simple, a standard infrared receiver- module (IC2) is used, which is normally used in conjunction with infrared remote controls. This ‘three-pin device type SFH51 1 0- 36 contains just about everything you need to detect the presence of the signal, although there are a few peculiarities you’ll need to pay attention to. This 1C is probably one of the two components elektor 12-2009 59 you won’t have lying around on your workbench in the junkbox, or in a drawer. The core of the transmitter is formed by the fast HC version of the trusty old 4060 (IC1 ). This chip combines an oscillator circuit and a 1 4-stage binary counter (of which the highest ten are bonded out to pins) in a 1 6-pin package. To prevent calibration problems, we designed a crystal oscillator circuit using the oscillator section of IC1 and crystal XI. Because of the high frequency produced by XI (9.21 6 MHz), you really have to use the HC version of the 4060. On IC1 s output Q 8 (pin 1 4), you’ll find the oscillator frequency divided by 28 (256), which amounts to a signal of exactly 36 kHz. IC2, the receiver, is tuned to receive exactly that frequency. Bear in mind that the SFH51 10 is also available for use with otherfrequen- cies, so make sure you really get a hold of the SFH51 1 0-36. This fre- quency is used to make a normal infrared LED (D2) flash. Potentiom- eter PI is added to control the sensitivity of the circuit as a whole. This is done at the transmitter because SFH51 1 0 doesn’t contain any calibration options. Now the only unanswered question remaining is just what diode D1 is doing in the circuit. It connects the base of T1 to the output Q14 (pin 3) of the 4060. Well, this is where the peculiarity of IC2 comes in. Because the module was built to receive information from remote controls, it ignores continuous, unmodulated carrier waves. An unmodulated signal, which can not contain any infor- mation, is therefore interpreted as ‘no signal’ and gets dealt with accordingly. Thanks to D1 , T1 is switched on and off at the signal frequency at pin 3 of IC1 (which is 9.216 MHz divided by 214, or 562.5 Hz). This results in a perfect 50% modulated signal, which doesn’t get ignored, therefore allowing us to detect the presence of an infrared signal. As soon as the receiver module sees the reflected signal from D2, a square wave appears on its output with a frequency of approxi- mately 563 Hz. Components R 8 and C5 act as a filter and create a neat switching signal which drives the transistor T2 through the voltage divider R9/R1 0. The voltage divider prevents the cir- cuit from reacting too enthusiastically on signals from regular remote controls. A PNP transistor was chosen forT2, because the output of the infra- red module IC2 is high in quiescent state (when no infrared signal is received). When a signal is received, the transistor will conduct and switch on anything connected to its output. For testing purposes, you can wire up a low- current LED from the output of the circuit to ground through a 1 k£l resistor. If you want to control TTL or CMOS logic, you could con- nect T2’s collector to the ground through a 1 0 kQ. resistor and use the potential across the resistor to drive your circuit. A relay generally draws more current (20 to 30 mA) than T2 is able to supply, so you’ll need a buffer to get things working. Assembling the circuit won’t be a problem we reckon. It’s recommended to use a socket for IC1 and for XI if necessary. Make sure you mount all oscillator components as close together as possible. The infrared LED D2 and the receiver module IC2 should not be allowed to be in visual range of each other, so place a screen between the two. PI controls the range of the circuit. When using the indicated component values, it’s about 20 cm. If desired, the range can be increased by lowering the value of R4. Now all that’s left is to wish you a happy build! (i- 00870 ) 5V +5V O (±> C3 lOOn IC1 11 ci 33p R1 7m _9 10 R2 9.216MHz 12 C2 lOOp CT=0 R6 IR7 74HC4060 BC547B R4 D2 q — IC2 1 LD274 CM C5 lOu 63V RIO E€) R9 R8 BC557B a. C4 1o'up3V SFH51 10-36 74HC4060 BC547B BC557B 0 SFH51 1 0-36 o r*r \! 1 B dJ lb 1 2 3 60 12-2009 elektor Quasar Electronics Limited PO Box 6935 CM23 4WP, U Tel: 01279 46 Fax: 01279 2 E-mail: sales Bishops Stortfp nited Kingdom 7799 7799 quasarelectih omcs.com Web: www.qdasarelectronibs.com >rd 01279 Re All price Postage Delivery £9.95; lOrder o Payment payable Please Vi modules .5% ^ INCLUDE 17 & Packing Optio^i -£4.95; UK Main st of World - £1^ Inline for reduced We accept all to Quasar Electrb isit our online sh and publications ss weight): UK livery - £10.95; E Sta VAT. s (Up to IKg gro and Next Day D^ .95 (up to 0.5Kg). price UK Postage! lajor credit/debit nics. op now for full details of over 500 ndard 3-7 Day urope (EU) - Discounts for bulk quantities cards. Make chegues/PO’s kits, projects, Credit Card 467 VISA VISA Electron V SOLO 799 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ HdJtHo! Hot Chr stmas 2009 i§?on it's wa$ "■ V $UT QQN'T PANKg! * A W^have some fantastic gifrideas for young (and old) enquiring minds 1 ■■ V ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ ★★★★★★★ ★ ★★★★★★ Electronic Project Labs An electronics course in a box! All a irevious know ind require N See website details ssume no ledge O solder, for full 30 in ONE -£19.95 Order Code EPL030KT 130 in ONE -£44.95 Order Code EPL130KT 300 in ONE -£69.95 Order Code EPL300KT 500 in ONE -£179.95 Order Code EPL500KT Robot Sensor - £19.95 Order Code EPLR20KT Digital Recording Laboratory - £24.95 Order Code EPLDRKT Soiderless Electronic Project Kits AM-FM Radio Kit - £5.95 Order Code ERKAFKT Short Wave Kit - £5.95 Order Code ERKSWKT Crystal Radio Kit - £5.95 Order Code ERKCKT Room Alarm - £4.95 Order Code EAKRAKT Electronic Bell - £6.95 Order Code EAKEBKT Electronic Motor - £6.95 Order Code EAKEMKT Generator - £6.95 Order Code EAKEGKT Hand Held Metal Detector - £7.95 Order Code ELMDX7 Metal Detector - £7.95 Order Code ELMDKT Robot & Con- struction 1 i Kits Fi iture enginee ■rs can le am about the ? opera- tic }n of electror iics, robotics and transmis- sic Dns systems. Hyper Peppy - £28.95 Order Code 401 6KT Line Tracker - £39.95 Order Code 4021 KT Air Shooter - £33.95 Order Code 4025KT Hexapod - £19.95 Order Code C21-883KT T rainmech — £1 3.95 Order Code C21-606KT Tyrannomech - £12.95 Order Code C21-601KT Festive Electrc >nic Projec t Kits Musical LED Jingle Bells -£17.95 Order Code1176KT Flashing LED Christ- mas Tree - £7.95 Order Code MK100KT See our website for even more great gift ideas! |wwi /v.Qi jasa \rEie tetro nics .con n Ordering Facilil :ies • Full Proi :luct Listing, C lescriptions & Photos • Kit Documentatio n & Software I Downloads ATM1 8 SERIES The Vikings Are Coming! Bluetooth with the ATM1 8 By Wolfgang Rudolph and DetlevTietjen (Germany) Since its introduction in 2001 , Bluetooth has developed into an essential standard for wireless links between devices. Using an inexpensive serial module, we can add Bluetooth functionality to our ATM1 8 board. Naturally, the example software written in C can also be adapted for use with other ATmega boards. The unusual name ‘Bluetooth’ is a homage to the Danish Viking King Harald (in Dan- ish, Harald Blatand), who was born in 91 1 and died on 1 November 987. He united 960 large regions of Scandinavia, and he was known for his communication skills. Harald Blatand also introduced Christianity to the majority of Denmark. The choice of name is connected with the participation of Eric- sson in the development of the Bluetooth standard under the leadership of Dr Sven Mattisson, a Swede. As the objective of this 62 12-2009 elektor BTM-222 Bluetooth module features • Certified for Bluetooth Version 2.0 and EDR • Direct line-of-sight range with lambda/4 antenna (31 mm): 80-1 50 m (depending on weather conditions) • Transmit power (Class 1 ): 1 8 dBm max.(63.1 mW into 50 £2) • Low power consumption (hold, sniff, park, and deep sleep mode) • Supply voltage: 3. 0-3.6 V • Full Bluetooth data rate via UART • Supports up to seven ACL links and three SCO links • Supports enhanced data rate (EDR) for both modulation modes (2 Mbps and 3 Mbps) • SPP firmware with AT commands • Dimensions (mm): 28.2 x 1 5.0 x 2.8 Figure 1 . The Bluetooth logo consists of the runic symbols for ‘H’ and ‘B’ against a blue background. technology is to unite all modern devices and allow them to communicate with each other, the developers (including Professor Jaap Haartsen, a Dutchman) agreed on the name ‘Bluetooth’. The Bluetooth logo con- sists of the runic symbols for ‘H’ and ‘B’ on top of a blue background (Figure 1 ). In a project published in the January 2009 issue of Elelctor [1 ], we interfaced a radio mod- ule with the ATM1 8 board to give it wireless data communication capability. Although Bluetooth is also a wireless data transmission interface, it operates in a different ISM fre- quency band (2.4 GHz) and uses a consider- ably more complex protocol. The Bluetooth standard has been described extensively in an Elektor article [2], and of course you can find descriptions of this standard on many web- sites, so we do not need to describe it in detail here. With a Bluetooth interface, the ATM1 8 board can establish a connection not only to a PC or another ATM 18 board, but also to any other device equipped with a Bluetooth interface. To make this all possible, we first have to integrate a Bluetooth module with the ATM 18 board. Module selection Although commonly available Bluetooth adapters in the form of USB sticks have become exceptionally cheap now, they can only be used with a USB host device such as a PC. For connection to our microcon- troller board, we need a Bluetooth mod- ule with a serial interface. Serial Bluetooth adapters of this sort are used primarily in industrial applications, and unlike Blue- tooth USB sticks they are not consumer goods. Although quite a few types are avail- able, most of them are not cheap. We found a module from Rayson, with type number BTM-222 (Figure 2), that is fairly inex- pensive. It is a Class 1 device with an out- put power of 1 8 dBm. Class 1 devices (see Table 1 ) have the highest transmit power, with a range of more than 100 metres (300 ft.) in free space. The key features are listed in the ‘Module features’ inset. The data sheet is available on the Internet via a link on the Elektor web page for this article [3J. The module supports the Hayes modem command set, which makes it easy to operate from a PC with a terminal emu- lator program. After start-up, the module initially evaluates all characters received via the serial interface as commands. After a connection is established, the characters (data) are simply forwarded to the party at the other end. Bluetooth profile Profiles are used for data exchange over the Bluetooth interface. During link setup, the devices exchange information about their profiles and agree on the profile to be used. The BTM-222 module used here supports the serial port protocol (SPP). This means that the module acts like a COM port on one side and like a UART (with TxD and RxD signals) on the other side. This sort of con- nection is sometimes called a ‘virtual cable’. From the perspective of the application software and the connected hardware, this wireless link behaves the same way as a serial link using a cable. Bluetooth board The BTM-222 module consists of a small PCB fitted with SMD components and covered by a protective metal shell. With dimen- Figure 2. The BTM-222 Bluetooth wireless module transmits with high power (Class 1 ) and has a serial data interface. It is soldered to the PCB in Figure 4 like an SMD component. Table 1 . Bluetooth classes and operating ranges Class Max. power Max. power Free-air range 1 100 mW 20 dBm approx. 100 m 2 2.5 mW 4 dBm approx. 50 m 3 1 mW 0 dBm approx. 10 m elektor i 2 - 20 og 63 Figure 3. Circuit diagram of the Bluetooth PCB with the BTM-222 module. The components marked with an asterisk (*) are for the USB interface and are only necessary if the board is used with a BTM-220 module. sions of 28 x 1 5 mm, it looks a bit like an overgrown 38-pin DIL SMD 1C. It has stubby leads along the sides that can be used to solder the module to a circuit board in the COMPONENTS LIST Resistors R1 -R8 = 1 k£l SMD 0805 Capacitors Cl ,C3,C4 = 1 0OnF SMD 0805 C2 = 1 0jLtF 1 0V SMD 1 206 Semiconductors D1 = LED, red, SMD 0805 D2 = LED, green, SMD 0805 T1 -T4 = BC847, SMD (SOT-23) IC1 = BTM-222, Bluetooth module, from Ray- son Technology* IC2 = LF33C or LF33CDT, DPAK-case, (e.g. Far- nell # 10871 87) Miscellaneous K1 = 6-way socket strip, right angled JP1 = 3-pin header with jumper (or wire link) PCB# 080948-1 * * available from the Elektor Shop or www. elektor.com/080948 same way as an SMD device. A circuit (Fig- ure 3) and accompanying PCB (Figure 4) for the module have been designed in the Elektor labs. Figure 4. A few SMD components are fitted on the front side of the board, while only the BTM-222 module is fitted on the rear. The PCB is designed to accept the BTM- 222 module (serial interface) as well as the BTM-220 module, which has an additional USB port. We used only the BTM-222 for our Addiional parts if IC1 = BTM-220 instead of BTM-222 Resistors All SMD 0805 R9 = 47k£l R10 = 22I<£1 R11 =1.5kft R12,R13 = 27£l Capacitors C5,C6=100nF SMD 0805 Inductor LI = 2200^ @ 1 00MHz, e.g. Murata DL- W31 SN222SQ2L (Farnell #515599) Miscellaneous l<2 = USB plug, type A, SMD, e.g. Lumberg 241 0 07 (Farnell #1308875) 64 i 2 - 20 og elektor application with the ATM1 8, which means that the components on the schematic diagram inside the highlighted boxes with dashed outlines are not fitted. The compo- nents that are only necessary for the BTM- 220 are also shown separately in the com- ponents list. The operating circuit for the BTM- 222 module, as shown in Figure 3, consists of only a few components. K1 is a socket header for connec- tion to the serial port of the ATM 18 board. This connector in combina- tion with jumper JP1 (in position CC2) supplies the circuit with +5 V from the ATM 1 8 board. Voltage reg- ulator IC2 reduces this to the 3.3-V operating voltage of the wireless module. Level conversion for the serial interface (5 V <=> 3 V) is pro- vided by transistors T1 and T2 for TxD and transistors T3 and T4 for RxD. Two LEDs are also connected to the wireless module. Diode D1 blinks red while data is being trans- ferred over the serial interface, while D2 blinks green during wireless link setup and is constantly green while an active wireless link is present. When assembling the PCB, pay particular attention to the correct orientation of the Bluetooth mod- ule. The dot-shaped marking on the protective cover does not mark pin 1 . The correct orientation of the BTM-222 module is shown in Fig- ure 5, with the marking next to the antenna connection. Connection to the ATM 1 8 board The module requires a wire antenna with a length of 31 mm (a quarter-wave antenna at 2.4 GHz). It must be soldered to the connec- tion point marked ANTI on the same side of the board as the BTM-222 module (see Fig- ure 5). After this, you can plug the module board into connector l<5 (serial port) of the ATM1 8 board (see Figure 6 and the photos) with the component side facing up (mod- ule facing down) so you can see the LEDs. In addition, you must interconnect all three JP1 pins for supply voltage selection on the ATM1 8 board to provide a 5 V supply volt- age to the Bluetooth board via l<5. For test- ing, you can connect the Bluetooth board to a PC via a USB to serial interface adapter cable (such as item number 080313 in the Elektor Shop) and use a terminal emulator program to communicate with it. This can also be helpful if you have accidentally con- figured the module incorrectly, such as set- ting a data rate that is not supported by the ATM 18 board. Tricky communication One of the shortcomings of the BTM-222 module is that it does not have a buffer for incoming characters. Consequently, you always have to wait for each character to be echoed before sending the next charac- ter. This means that after you send a com- mand, you have to wait to see whether the module sends back ‘OK’ or ‘ERROR’, or perhaps doesn’t send back anything at all, and if an error does occur you may have to repeat the command. This task is handled by the btm222_sendcmd() function of the btm222.h/.c software module. The param- eter is the command, including the trailing . The return value is zero only if the module returns a response of ‘OK’, which indicates that it has accepted the command. A timeout ensures that the function will terminate even if no response is received from the module. The construction while(btm222_sendcmd()); ensures that the program waits until the module has accepted the com- mand before proceeding. Defensive programmers may want to insert an additional timer to prevent the pro- gram from hanging here, which is possible because the command syn- tax is inherently error-prone. Software module btm222.h/.c includes several other routines that make it easier to use the Bluetooth module. The btm222_setname() and btm222_setpin() routines con- struct the commands necessary to change the module’s name and PIN code. The btm222_seek_devices() function initiates a search for other Bluetooth devices within range of the module (including mobile phones). This search may last up to one minute. The return value, which is also entered in btm_n_o_devices, is the number of devices found. Their names and IDs can be found in the btm222_devices field, so you can use freely configurable names to iden- tify the other devices and are not forced to use their ID codes for this purpose. Here it should be noted that the names in this field are padded with blanks, so it is better to use the library function strstr() instead of strcmp() for comparisons. You can use the ATA command (where nr= 1...8) to establish a connec- tion to the corresponding device. After a connection is established, the link acts the same as an RS232 connection with a cable. This means that the application program should evaluate the CONNECT und DIS- Figure 5. Both sides of the assembled PCB. A length of wire is soldered to one side to act as an antenna. elektor i2-20og 65 Table 2. Principal AT commands supported by the BTM-222 module A (Establish connection) ATA establishes a connection to the device whose ID was previously set by an ATD= command. ATA establishes a connection to a device previously found in response to an ATF? command. D (Set remote address) ATD=<|D> specifies the device that the module may connect to. In master mode, a connection can be initiated after this by issuing an ATA command. In slave mode, this can be used to prevent an unauthorised master from es- tablishing a connection. The ATD0 command allows connection to all available devices. F (Search for Bluetooth devices) ATF? initiates a search for other accessible devices. The found devices are output in a table. Before a search can be performed, the module must be put in master mode and autoconnect must be disabled. N (Module name) ATN= sets the name used as the module identifier. The allowed characters are 0-9, a-z, A-Z, blank and hyphen, but blanks and hyphens are not allowed as initial or final characters of the name. The maximum allowable size of the name is sixteen characters. O (Autoconnect setting) Configures a setting that determines whether the module should automatically establish connections with other devi- ces. ATO0 configures the module to automatically connect to any suitable device that it finds. After an ATOI command, each connection must be explicitly initiated by an ATA command. P (Set PIN code) Can be used to change the module’s PIN code. Only modules with the same PIN code can connect to each other. This enhances security. The factory default PIN code is ‘1 234’. R (Master/slave) ATR0 configures the module as a master, while ATR1 configures it as a slave. Z (Warm start) ATZ0 restores the factory default settings.. However, this does not affect all the configuration settings. For instan- ce, the name remains unchanged. CONNECT messages sent by the Bluetooth module to report link connection and dis- connection, in order to avoid having the Bluetooth module interpret data intended for the other party as commands. Before you can utilise these functions, you have to send the module an ATR0 command to make it a master and an AT01 command to disable automatic connec- tion. However, this is only possible if no suitable party is in the vicinity, as otherwise a connection will be established immediately. The module configuration set- tings are retained after the supply voltage is removed, so you have to be careful with commands that change the serial interface settings. As you can see from the ATmega88 data sheet, the standard serial data rate of 57.6 kbps cannot be generated with adequate precision (error < 1%) with a 16-MHz system clock. If you configure the BTM-222 mod- ule for a higher rate, you effec- tively lock out the ATM 1 8. 1 = GND 2 = DQ 3 = V DD max. 4x DS1820 unn ii r ii i r PJIfllK 2 2 a * ? Rir" R6 • |* R5 I \f | D2T3 !I Z* 01 T2 L JL J— “ pgS I 7 • ICl <=>: co * 2 cn f • |IC2 2 § t ^ o a 3 i 080948 - 13 Figure 6. Several DS1 820 temperature sensors can be connected to the ATM1 8 board as shown here. The attached Bluetooth module can transmit the temperature measurements over distances up to 1 00 m in free space. The most important commands are listed in Table 2. The BTM- 222 module data sheet [3] pro- vides a more extensive list. Vari- ous undocumented commands can also be found on the Web, but they should be used with considerable caution, or better yet not at all, as you cannot be sure that they are supported by every version of the firmware. Master and slave We have programmed a sample application to illustrate what you can do with the BTM-222 module. It lets you use up to four DS1820 sensors (previ- ously discussed in the ATM18 project article ‘Another Brisk Day Today’ in the March 2009 issue of Elektor) to measure temperatures. Pins PD4 to PD7 are driven as outputs and can be used to control a heat- ing system or individual heat- ers, among other things. This arrangement could be used to implement remotely control- led temperature regulation. The sequence of the sensors is determined by their perma- 66 i 2 - 20 og elektor Figure 7. In each search cycle, the ATM1 8 board with attached Bluetooth module detects every Bluetooth device in its vicinity. nently configured ROM addresses. The sen- sors are powered ‘parasitically’ via PD3, as shown by the wiring diagram in Figure 6. The BTM-222 module is used here as a slave device. A new, not yet used module is most likely already configured as a slave, but to be on the safe side the ATM1 8 software first configures the module as a slave. This is nec- essary because the module retains its con- figuration settings after the supply voltage is removed, which means that it will still be a master if it was previously configured as a master for testing. As a precaution, the PIN code is also set to the default value (1234). If you plug a Bluetooth USB stick into your PC and run a terminal emulator program on the PC, you can now establish a connection to the ATM1 8 board with the temperature sensors. It reports its status regularly to its master by sending the message S . . . < output sxCR> The temperatures are coded as integers with a resolution of 0.01 °C. You can use l to query the current limits for all of the sensors, or L to adjust the limits in order to set the desired temperatures. These limits are also stored in the EEPROM of the microcontrol- ler, so they are directly available for use the next time. If you want to use this arrange- ment for a project such as monitoring and controlling temperatures in a greenhouse, you can add more sensors. Anything you can imagine, you can do! Board to board We also wrote a program to demonstrate a Bluetooth link between two ATM 18 boards. It displays the status messages of the slave device on the LCD module. This lets you see the best way to use the BTM-222 module. The program starts by sending the ‘set mas- ter’ and ‘disable automatic connection’ commands. They change the default config- uration of the module as described above, so that the ATM1 8 can actively establish a connection. To ensure that the BTM-222 module is awake and ready for operation, the program waits until the module has accepted these commands. The operation of the program is control- led by three buttons (SI, S2 and S3) on the ATM1 8 board. Via K8, SI is connected to PCI , S2 to PC2, and S3 to PC3. Pressing SI starts a search for all available Bluetooth devices in the vicinity. After the search is completed, you can press S2 to display the names and IDs of the located devices (see Figure 7). By default, a BTM-222 module is shown as ‘Serial Adaptor’. Press S3 to establish a connection, after which the temperatures measured by the individual sensors and the states of the cor- responding outputs will be displayed. Downloads The source text of the two programs has been written for use with the free GCC AV cross-compiler, which is available for many platforms. The software can be downloaded free of charge from the Elektor web page for the ATM18 Bluetooth project (www. elektor.com/080948). The PCB layout of the Bluetooth board is also available on the same page for free download. A list of all previously published articles on the CC2 ATM1 8 system is available at www.elektor. com/071 1 37. On the Elektor forum every- one’s invited to discuss the projects and articles published so far in the ATM1 8 / CC2 article series, as well as the closely related BASCOM AVR Course - see www.elektor. com/forum. (080948-1) References and Links [1] www.elektor.com/080852 [2] ‘Bluetooth: 2.4-GHz Data Radio instead of Computer Cables’, Elektor January 2000 [3] www.elektor.com/080948 elektor i 2 - 20 og 67 HOME & GARDEN Minimalistic Time Switch A lot of features in a small package By Fons Janssen and Mark Vermeulen (The Netherlands) A time switch lets you save a considerable amount of energy by switching off equipment when it is not being used. However, time clocks from building merchants tend to be bulky and not especially easy to use. The circuit described here provides a distinctly larger set of features and is very compact, so it can easily be built into an existing piece of equipment. The hardware (Figure 1) can certainly be dubbed ‘minimalistic’. The circuit consists of only 24 components, including the con- nectors and pushbutton switch. It is built around a Maxim DS1337 (IC2), which is a compact real-time clock 1C in an SOIC-18 package. This 1C is designed to work with a 32.768-kHz crystal (XI). However, crys- tals that operate at this frequency are avail- able in two different types. One type works with a 1 2.5-pF load capacitance, while the other works with a 6-pF load capacitance. The DS1337 only works properly with a 6-pF crystal. If a 1 2.5-pF type is used, the clock will be highly inaccurate. For the microcontroller we chose Micro- chip’s most powerful eight-pin type, the PIC12F683 (IC3), which also comes in an SOIC-8 package. Backup power in case of a power grid outage is provided by a 5.5- V GoldCap capacitor (C3), with a choice of capacitance values. Resistor R7 is included to keep the charging current of the capaci- tor within reasonable bounds. It ensures that the capacitor charging current never exceeds 30 mA, which is the maximum rated output current of the MAXI 61 5 volt- age regulator (IC1). In addition to these components, a small handful of SMD resis- tors and semiconductor devices are neces- sary for proper operation of the circuit. The circuit employs an extremely minimal- istic user interface in the form of a single pushbutton and a single 3-mm LED (D2). Nevertheless, the time clock is relatively easy to use. Setting the time and date is fairly intuitive, and programming the switching times for weekends and week- days are just as easy. A few extra components around the micro- controller are included to enable in-circuit programming. For instance, T1 and R5 are included to drive the LED. Here R5 provides sufficient isolation when pin 7 is used for the data signal during in-circuit programming. Resistor R6 is included for a similar reason; it allows the clock signal to be applied to pin 6 of IC3 during in-circuit programming. The programming voltage is supplied via the MCLR line (pin 4). Diode D1 allows power to be supplied to the microcontroller during in-circuit programming without powering the rest of the circuit at the same time. As the circuit must be able to switch a fairly significant load (for example, a WiFi router can easily draw 1 A), we chose a type PMV45EN in an SOT23 package for the FET switch (T2). This MOSFET can handle well over 5 A, and it has a low on resistance (Rdsoit)- It can effectively switch a continu- ous current of around 2 A, which is more than adequate for most applications. Minimalistic software Now let’s have a look at how the time clock works. Figure 1 . The entire circuit of the time clock consists of only 24 components, including the connectors and pushbutton switch. 68 i2-20og elektor Initial start-up When you start up the clock the first time, the time setting is of course incorrect. This is indicated by the rapid blinking of the LED. You can set the time by first pressing the button within 30 seconds. If you don’t do anything within this time, the clock auto- matically enters sleep mode. The only way to exit the sleep mode is to switch off power to the circuit. The circuit must be left with- out power for a few seconds to give the capacitors on the circuit board time to dis- charge, as otherwise the microcontroller will not reset. Setting the time is relatively easy, despite the single-button user interface. A number from 0 to 9 can be entered by briefly press- ing the button a corresponding number of times and then pressing it again for an extended length of time, which means hold- ing the button pressed until the LED goes on. For example, you can enter the number ‘4’ by pressing the button four times short and onetime long. The time clock expects you to enter ten numbers in the sequence DD-MM-YY-HH- MM (day, month, year, hours, minutes). After a valid date and time have been entered, the time clock automatically deter- mines the corresponding day of the week. This is important because you can set dif- ferent switching times for weekends (Sat- urday and Sunday) and weekdays (Monday through Friday). Although the DS1337 has a register to store the day of the week, it is not able to determine the day of the week from the date, so this task is handled by the software. The entered information is stored in the registers of the DS1 337. Normal start-up When the time clock starts up in normal use, it retrieves the date and time from the DS1 337. Using this data, the software deter- mines whether it is summer time or winter time. Based on the day of the week and the current time (both taken from the DS1 337) as well as the switching times for the cur- rent day (taken from the internal EEPROM of the microcontroller), the software sets the output to the desired state. In addition, the software stores the next switching time in the ALM1 register of the DS1337. Once all of this has been done, the LED blinks once to Features of the minimalistic time switch • ‘Fit and forget’ functionality - Automatic day of week determination - Automatic adjustment to summer and winter time - Long-term backup in case of power outage • Easy to use - Manual override for ‘always on’ and ‘always off (regardless of the programmed switching times) - Single-button user interface (with a single LED for feedback) for all operating functions - Different switching times for weekdays and weekends (individual day of week programming possible if desired) • Suitable for all DC-powered applications and battery-powered equipment - Input voltage range 6-28 Vdc - Very low current consumption (less than 1 0 pA) - Extremely compact design - Switches loads up to 2 A at 24 Vdc Backup time The circuit is designed to be used with a GoldCap capacitor rated at 1 F / 5.5 V. This capaci- tor must supply power to the DS1 337 in the event of a power outage. With a supercapac- itor of this type, the circuit can survive a power outage of more than three months. How- ever, other types of capacitors can also be used. If you use a normal electrolytic capacitor rated at 470 pF / 6.3 V, the circuit will be able to handle a power outage with a duration of one hour. Current consumption The current consumption of the time clock is very low. The microcontroller is constantly in sleep mode under normal conditions, with a current consumption of only 350 nA. The cor- responding current consumption of the DS1 337 is somewhat larger at 600 nA. However, the current consumption of these two components is negligible compared with the current consumption of the voltage regulator. The MAXI 61 5 used here has a maximum quiescent current of 8 pA, with the result that the maximum current consumption of the overall cir- cuit is less than 10 pA. indicate that the time clock has started up correctly and is ready for use. After this, the microcontroller enables an interrupt on a change of signal level on pin 6 (GP1 ) and enters sleep mode. The microcon- troller remains in this mode until the status of GP1 changes. When this happens, it car- ries on with execution of the program code. Consequently, there is no need for an inter- rupt service routine. Here the sleep mode is used as a low-power standby mode. There are three possible sources of an inter- rupt via GP1: a button press, an interrupt signal from ALM1 (used for the switching times), or an interrupt signal from ALM2 (used for switching back and forth between summertime and wintertime). As all three types of interrupts enter via GP1 , the soft- ware must first determine the cause of the interrupt. It does this by reading the alarm flags of the DS1 337. If one or both of the alarm flags is/are set, it or they is/are the cause of the interrupt. If no alarm flag is set, a button press is the cause of the interrupt. Here again, there are several options with the button: - A short button press activates the over- ride function. - A long button press causes the time clock to enter switching time entry mode. In this mode, the time clock expects to receive the following data in the order listed: HH-MM (switch-on time, weekend) HH-MM (switch-off time, weekend) HH-MM (switch-on time, weekday) HH-MM (switch-off time, weekday) The switching times are stored in the micro- controller’s EEPROM. The switching times are stored separately for each day of the week, starting with Saturday and proceed- ing until Friday. This means that you can elektor i 2 - 20 og 69 COMPONENT LIST Resistors all SMD 0805 R1 = 390£1 R2,R3,R4 = 4.7l Circuit desian and Droarammina in C# and Visual Basic 292 pages • ISBN 978-0-905705-79-8 £28.50 • US 546.00 Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel. +44 20 8261 4509 J Further information and ordering at www.elektor.com/shop This is a highly-practical guide for Hobbyists, Engineers and Scientists wishing to build measurement and control systems to be used in conjunction with a local or even remote Personal Computer. The book covers both hardware and software aspects of designing typical embedded systems based on personal computers running the Windows operating system. It’s use of modern techniques in detailed, numerous examples has been designed to show clearly how straightforward it can be to create the interfaces between digital and analog electronics, programming and Web-design. Hardware developers will discover how use of latest high-level language constructs overcomes the need for specialist programming skills. Software developers will appreciate how a better understanding of circuits will enable them to optimize related programs, including drivers. There is no need to buy special equipment or expensive software tools in order to create embedded projects covered in this book. [jjektor elektor i2-20og 7i REVIEW NC HEADPHONES Another two NC Headphones Testing models from Creative and Bose By Harry Baggen (Elektor Netherlands Editorial) After wrapping up last month’s tests we received another couple of very interesting NC (noise cancelling) headphones: a model made by Creative and a brand new specimen from Bose. Certainly worth the effort of conducting a follow-up mini test. The Creative Aurvana X-Fi headphones were originally requested for the test that was published in the previous issue, but it took quite a bit of effort to get the European head office of Creative to send a sample to us. When it did finally arrive at was too late as the article for the October 2009 issue was already finished. The second model that we describe here is the Bose QC1 5, and has only recently been introduced in Europe. We were allowed to test a sample even before it was officially introduced to the European press. Here follow our findings. Bose QuietComfort 15 These well-finished, on-ear headphones have bigger earcups than the QC3 model which we tested last month, these enclose the ears completely. The QC1 5 is supplied with a sturdy carrying case and several accessories such as an airline adaptor and a 6.3-mm adaptor plug. The power is supplied by a single AAA battery, so a special bat- tery is no longer required, unlike the QC3. This is perhaps also the reason why the QC1 5 is € 50 / £ 40 cheaper than the QC3 (which is supplied with two batteries and a charging adapter). The QuietComfort 1 5 sits comfortably on the head thanks to the large earcups and soft cushions, even after using them for an extended period of time you will hardly notice them. The earcups exert very little pressure on the head, but without immediately compromising the sound isolation. The connecting cable of the QC1 5 is easily removed so that you can use the headphones as a noise canceller only. The connecting plug of the cable also has a handy level switch built in, which can be used when the signal level of the source is too high. Unfortunately the QC1 5 (just as the QC3) produces sound only when a battery is fit- ted, you can therefore not use them passively. The sound quality of the QC1 5 is very good, the total sound image is somewhat more balanced than that of the QC3, with a well-defined mid and high reproduction and a robust, tight low. Here too, the bass reproduction is a little too strong, but not as exaggerated as with the QC3. Bose have used and entirely new system for the noise cancellation, where microphones are placed on the inside and on the outside of the earcups to generate the correction signals. This should result in a more effective noise cancellation than the QC3. In practice the cancellation of low frequencies was excellent, but because we did not have access to a QC3 any more we could not make a direct com- parison. Voices can still be heard reasonably well, perhaps because of the acoustic openings in the earcups. But the most important acoustic noises such as the rumbling of a noisy server or the drone of a bus are almost completely eliminated. Sound quality: 8.5 Noise cancellation: 8 Wear comfort: 8 RRP: about € 350 / £ 280 Creative Aurvana X-Fi These headphones are also well-finished but have somewhat bigger dimensions than the QC15. As a result the cushions of the earcups cover the ears easily. It is supplied with a carry case and the usual adaptors, with all the connectors gold plated. Power is provided by two AAA-batteries in the left earcup. In the right earcup there are the on/off switch, a volume control and three pushbuttons for acti- vating the NC-system, X-Fi Crystalizer and X-Fi CMSS-3D. The Aurvana X-Fi fits quite well, but the earcups press a little firmly against the head. While this provides very good acoustic damping it is not as comfortable as the QC1 5. The sound quality of the Aurvana X-Fi is rather dependent on the selected settings. With the electronics switched off the sound image is quite average. After switching it on everything sounds a lot better 72 12-2009 elektor and the bass response is much fuller. If you turn the NC-system off with the pushbutton than the bass level drops back somewhat. You can improve the sound reproduction a little more by turning on the X-Fi Crystalizer. This X-Fi Crystalizer was originally intended just to improve the play-back of MP3 files, but it functions with any input signal and acts as a kind of equaliser. The third button on the X-Fi CMSS-3D generates a spatial effect. This seems to work quite well with some types of music, but with other kinds of music it creates more of a bathroom acoustic. A potential negative point of these headphones is the fact that the headphones are not completely closed. A lot of sound leaks through the grills in the earcups so that a person sitting next to you can listen along quite well. This can be a drawback. The noise cancellation system of the Aurvana X-Fi functions — cer- tainly considering the price — very well. It is a fraction less than the QC1 5 from Bose, but the difference is minimal. The cancellation of low frequencies is also very good, but voice can still be perceived reasonably well. The difference between these two is too small to make a difference in the score for the noise cancellation function. Sound quality: 8 Noise cancellation: 8 Wear comfort: 7 RRP: about € 200 / £ 1 60 ektor See your project in print! Elektor magazine is looking for Technical Authors/ Design Engineers If you have ✓ an innovative or original project you ’d like to share with Elektor f s 140 1 <+ readership and the electronics community v* above average skills in designing electronic circuits ✓ experience in writing electronics-related software ✓ basic skills in complementing your hardware or software with explanatory text v' a PC, email and Internet access for efficient communications with Elektor’s centrally located team of editors and technicians then don't hesitate to contact us for exciting opportunities to get your project or feature article published . Conclusion Both of the headphones tested here provide good noise cancellation, where the Bose QC1 5 works a little bit more effective than the Aur- vana X-Fi. There is not much between them when it comes to sound quality either; the Bose supplies a little better illustrated bass and the Aurvana X-Fi is a little stronger in the reproduction of the mid range (with the correct settings). After an extended period of use, the Bose QC1 5 proves to be the more comfortable of these two. Choosing between these two is quite difficult. They both have attractive features, but in the end your own preferences and size of your wallet will be decisive — the price difference is substantial! (090809-I) Our Author Guidelines are at: www. elektor. com/ authors. Elektor Jan Buiting MA, Editor Regus Brentford, 1000 Great West Road, Brentford TW 8 gHH, United Kingdom Email: editor@elektor.com elektor 12-2009 73 INFOTAINMENT Hexadoku Puzzle with an electronics touch “Now does that A go into this box here or somewhere further down? No, that can’t be, then the column’s not right any more.” If you hear this you should know that one of your housemates has grabbed your new Elektor. No problem as puzzle fun is for everyone! Send the numbers in the grey boxes to Elektor and enter a prize draw for an E-blocks Starter Kit Professional and three Elektor Shop vouchers. Have fun! The instructions for this puzzle are straightforward. In the diagram composed of 1 6 x 1 6 boxes, enter numbers such that all hexadeci- mal numbers 0 through F (that’s 0-9 and A-F) occur once only in each row, once in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle Solve Hexadoku and win! Correct solutions received from the entire Elektor readership automati- cally enter a prize draw for an E-blocks Starter Kit Professional worth £ 300 / € 375 (rrp) and three Elektor Electronics SHOP Vouchers worth £ 40.00 / € 50.00. We believe these prizes should encourage all our readers to participate! and these determine the start situation. All correct entries received for each month’s puzzle go into a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. The puzzle is also available as a free download from the Elektor website. Participate! Please send your solution (the numbers in the grey boxes) by email to hexadoku@elektor.com - Subject: hexadoku 12-2009 (please copy exactly). Include with your solution: full name and street address. Alternatively, by fax or post to: Elektor Hexadoku 1000, Great West Road - Brentford TW8 9HH - United Kingdom. Fax (+44) 208 2614447 The closing date is 1 January 201 0. Prize winners The solution of the October 2009 Hexadoku is: DA2BF. The E-blocks Starter Kit Professional goes to: Kurt Kuehni (Switzerland). An Elektor SHOP voucher goes to: Primoz Presern (Slovenia), Long Yang (USA), Ria Van Broeck (Belgium). Congratulations everybody! 4 8 3 E 7 0 2 D C 6 F 7 A 3 1 0 6 F E 9 D 4 5 7 A 5 A E D 2 7 2 1 D C 3 5 0 D 3 1 C F 3 A 0 7 6 9 0 E F 6 1 A D A 6 F D C 0 2 7 C 0 E 6 5 8 A B 1 9 4 0 6 D 0 8 B 7 C 1 6 E 9 A 3 4 D 6 B 9 8 2 B 3 A 6 E F C 0 E 0 F 9 B 6 5 4 C D 4 0 3 5 F B 9 (c) PZZL.com 1 2 4 5 B D A 8 C 9 7 F E 6 3 0 E 8 A B 0 F 1 6 3 2 D 5 7 9 4 C C 0 D 9 7 4 5 3 E A 6 1 8 F 2 B F 6 3 7 C 9 2 E 4 0 8 B 5 1 D A 5 9 F 3 6 8 D 4 0 B 1 7 C E A 2 2 B 0 A 9 5 E 1 6 F 4 C D 3 7 8 4 1 E 6 3 C 0 7 8 D A 2 B 5 F 9 7 C 8 D A 2 B F 9 5 E 3 0 4 6 1 9 7 B 0 E A 4 2 F 8 C 6 3 D 1 5 8 D C 4 1 7 6 9 5 3 2 E A 0 B F A 3 2 E D 0 F 5 1 7 B 9 6 C 8 4 6 F 5 1 8 B 3 C D 4 0 A 2 7 9 E 0 A 6 F 2 E 9 D 7 1 5 8 4 B C 3 B 5 9 C 4 3 7 A 2 6 F 0 1 8 E D D E 1 2 F 6 8 0 B C 3 4 9 A 5 7 3 4 7 8 5 1 C B A E 9 D F 2 0 6 74 The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses. i 2 - 20 og elektor Dt'Sitjii We add value to PCBs when others just sell it. / ProdiKtlgn f ” Pg Designing Service One Stop Manufacturing f SJOea. for 5pcs 4 n x4 n 2L Free Solder Mask & Silkscrec - Free Component ice PCEPr^n - Free Assei Assembly Components Pcbs Bndosulcs Fpcs Keypads www.EiPCB.com Email: sales&Eipcb. Please Visil www.macJiin-ep ler, com Fot Mach mi ng Take out a free subscription to E-weekly now Do you want to stay up to date with electronics and computer technology? Always looking for useful hints, tips and interesting offers? Subscribe now to E-weekly, the free Elektor Newsletter. Your benefits: * The latest news on electronics in your own mailbox each friday * Free access to the News Archive on the Elektor website * You’re authorized to post replies and new topics in our forum Register today on www.elektor.com/newsletter Tel: 0163640347 h Emelin il:s Lid ri-j-TlEH ncj Tnh-J Vi- tit Art l 1 -c V.l - 511 h-l E I :i31XiiJaiHl!r.t-aE|f. XITUZl h KW. hV.1l l B Hl-l I Ml I-J 1 I ¥ elektor i2-20og 75 RETRONICS The Z550M: an unusual counter valve (ca. 1959) By Ronald Dekker (The Netherlands) The first version of the popular Nixie valves launched by Bur- roughs in 1954 had the disad- vantage that a transistor with a fairly high breakdown voltage was needed to drive the valve. Such transistors were very difficult to manufacture in the early day of transistor technology, when transistors were still made from ger- manium. To allow glow discharge valves to be operated directly by low-voltage transistor circuits, a pair of researchers at the Philips Research Lab, Theo Botden and Martinus van Tol, developed the Z550M around 1 959. A few examples with different markings are shown in Figure 1. The Z550M consists of a small disc-shaped plate - the anode - with cutouts for the numerals 0 to 9. A set of ten interconnected cath- odes is located behind the numerals. A starter electrode is located close to each cathode. A rectified AC voltage is applied between the anode and the cathodes (see the standard application diagram in Figure 2). It takes only 5 V on a starter electrode to initiate a glow discharge behind the desired numeral and cause the numeral to light up (Figure 3). In order to understand the operation of the Z550M, you first need to know something about the characteristics of glow discharge valves. A glow discharge valve has two electrodes, usually made from nickel or molybdenum, in an atmosphere of neon gas at a pressure of a few centimetres Hg. If the voltage between the two electrodes is less than the striking voltage, no current will flow. If the voltage is gradually increased, the gas will break down at a certain voltage. This striking voltage depends on many factors, such as the product of the pressure of the neon gas and the distance between the elec- trodes. The striking voltage is directly dependent on this product. Once the gas has broken down, a current will flow, and it is limited only by a resistor connected in series with the valve. As a result, the voltage across the valve decreases to the maintaining voltage. Z550M r D1 1N4003 SO RO • t Pf > c J SI S 8 S 9 VJ I run --- 330k --- R8 -j os run + 5 V O- Vdd 00 01 08 09 HEF4017 Gnd MR CP CP _TLTL 220 V If you ignore the starter electrodes in Figure 2, you can clearly see that if the supply voltage is gradually increased, at a certain point the gas between one of the cathodes and the anode will break down. The voltage across the valve will then drop immediately to the maintaining voltage, with the result that the other numerals remain dark. The numeral will remain lit until the next zero cross- ing of the supply voltage. The distance between the starter elec- trodes and the cathodes is much less than the distance between the cathodes and the anode, so the striking voltage of the starter elec- trodes is lower than the striking voltage between the cathodes and the anode. If a slightly elevated voltage (such as a voltage supplied by a transistor or a logic gate) is applied to one of the starter elec- trodes, the initial gas breakdown will occur there. The high resist- ance in series with the starter electrode limits the current that must be supplied by the drive circuit to a few tens of milliamperes. It turns out that this small discharge is able to initiate a larger discharge between the associated cathode and the anode. Obviously, this principle can only work if the striking voltages of the various starter electrodes differ by less than 5 V. This proved to be not so easy to achieve. Fortunately, experience gained from dec- ades of research on glow discharge valves at the Philips Research Lab came in handy here. An extensive research programme focussing on glow discharges was initiated immediately after the lab was founded in 1 91 4. Already before the Second World War, this resulted in sev- eral important new products such as fluorescent lamps, low-pres- sure sodium lamps for street lighting, and high-pressure mercury lamps for applications such as film projectors. The largest contribution to the development of a fundamental understanding of glow discharges was provided by Frans Penning. In his research, Penning noticed that the striking voltage was strongly dependent on the surface contamination of the cathode. He devel- oped a method for cleaning the cathode by operating the valve for a while with very high current density. The resulting bombardment 76 12-2009 elektor by gas ions cleaned the cathode in a process called ‘sputtering’. A supplementary benefit is that the metal ions released from the cath- ode in this process bind impurities in the gas, which is called ‘getter- ing’. Penning also discovered that if a tiny amount of argon is added to the neon gas, it is possible to not only reduce the striking volt- age but also produce an operating region within which the striking voltage is nearly independent of the gas pressure and the electrode separation. Both techniques were applied to the Z550M, and after a bit of experimenting the desired tolerance range was achieved. Figure 4 shows a picture of the electrode configuration ultimately determined in the lab. After the feasibility of the Z550M concept had been demonstrated, the project was handed over to a development team in order to make the valve ready for production. The valve was assigned its type number at this time. The development team decided on a some- what different construction with each starter electrode located in a small hole in the cathode. This made it easier to connect the starter electrodes to the pins of the valve (Figure 5). This arrangement also makes the average distance between the starter electrode and the cathode nearly independent of the exact positioning of the starter electrode, which further reduced the spread due to production tol- erances. Finally, a small amount of tritium was added to the gas mixture to ensure fast and reliable initiation of the glow discharge. The author’s website [1 ] provides extensive reading material on the history of the development of the Z550M and samples of original lab workbooks. During this time, Pierre van Vlodrop in the glow discharge valve application lab also got his hands on a few samples of the Z550M. He used the Z550M to build a rather remarkable ring counter in which the starters were used as anodes, as illustrated in Figure 6 [2]. Here he was able to make good use of the very well defined strik- ing and maintaining voltages (1 05 V and 85 V, respectively). The operating principle of the ring counter is simple. When the supply voltage is applied, one of the numerals will be triggered at random (for example, 0). The resulting current causes a voltage drop across R1 0 that is sufficient to keep the other numerals dark. This current also causes a voltage drop of around 1 0 V over R0, which causes CO to be charged to 1 0 V. A negative clock pulse on the base of T1 drives it into conduction, which pulls the supply voltage of the valve to zero and extinguishes the glow discharge. When the supply volt- age subsequently rises, starter 1 will have a bias of 1 0 V relative to the other starters because CO is the only capacitor with a charge, with the result that that a glow discharge will be initiated in the gas behind the ‘1 ’ numeral. With each successive clock pulse, the next number in series will light up - simple but effective. Despite the elegant principles underlying the design of this valve, it never achieved commercial success. Shortly after it was introduced, the BSX21 transistor was developed. With a breakdown voltage , fl-Aing YvmflgA Siu-i upf'i-r iiKfrnrfiK* Mf'p iw-ao '.J,W 7K'[h I J b j f-f 5 (BV ceo ) of 80 V, it could be used to drive a Nixie valve directly. In addition, the clockface display was regarded as inconvenient and outmoded, even inside Philips. The fact that Z550M valves can be found with Philips, Valvo and Mullard markings suggests that they were produced in large quanti- ties in several Philips plants. In fact, the quantities were so small that they were only made in the pilot production plant on the Emmasin- gel in Eindhoven. The Eindhoven plant simply put different markings on the valves according to the intended destination country in order to make them easier to sell. Pro Electron was founded in Brussels in 1 966 to coordinate the reg- istration of European valve and semiconductor type numbers. The Pro Electron organisation largely followed the Philips system, with the result that the Z550M was rechristened ZM 1 050. Now in 2009, the valves still work very well. However, they do not count as fast now, since the tritium added to the gas mixture to promote fast initiation of the glow discharge has a half-life of 12.5 years, and not much of it is left after 50 years. (090653-I) Internet Links [1 ] http://www.dos4ever.com/ring/Z550M.html [2] http://www.dos4ever.com/ring/ring.html Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and reguests are welcomed; please send an email to editor@elektor.com elektor 12-2009 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 564999 AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BLACK ROBOTICS www.blackrobotics.com Robot platforms and brains for research, hobby and education. • Make your robot talk! • TalkBotBrain is open-source • Free robot speech software • Robot humanisation technology • Mandibot Gripper Robot ByVac www.byvac.com • PIC32 With BASIC • ARM With Forth • USB to I2C • Serial Devices • VT100 LCD Displays DECIBIT CO.LTD www.decibit.com • Development Kit 2.4 GHz • Transceiver nRF24L01 • AVR MCU ATmega168 it CEDA www.ceda.in ceda@vsnl.com , SCUTI learning PCB layout 3 S5 Hourly • PCB Layout @ $5 Hourly • Learn PCB Designing with Multimedia DVD in OrCAD, PADS & ALLEGRO • Self 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 EASYDAQ www.easydaq.biz _______ J 1 I ■U'p.'.'L". L ... 1 J -L a . .J • USB powered, 4 relays + 4 DIO channels • Will switch 240VAC @ 10 amps • Screw terminal access • LabVIEW, VB, VC • Free shipping • From £38 Design & supply of USB, USB Wireless, Ethernet & Serial, DAQ, Relay & DIO card products. info@easydaq.biz EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • device programmer manufacturer x • selling through contracted distributors all over the world • universal and dedicated device programmers • excellent support and after sale support • free SW updates • reliable HW • once a months new SW release • three years warranty for most programmers FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk • Training and Consulting Knsf for IT, Embedded and fl||B ►' Real Time Systems • Assembler, C, C++ (all levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas,TI, Freescale • CMX, uCOSII, FreeRTOS, Linux operating systems • Ethernet, CAN, USB, 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 FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB 0 Oscilloscopes 0 Power Supplies 0 Radio Frequency Measuring Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com HEXWAX LTD www.hexwax.com World leaders in Driver-Free USB ICs: • USB-UART/SPI/I2C bridges • TEAleaf-USB authentication dongles • expandlO-USB I/O USB expander • USB-FileSys flash drive with SPI interface • USB-DAQ data logging flash drive LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and GCEs). Also Technical Management and Languages. |EC 78 12-2009 elektor products and services directory www. elektor. com 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 RFID COMPONENTS http/www.apdanglia.org.uk For DIY, OEM's & Experimenters • EM4100 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 ID12) • Free Reader download - Technical pages Order online 24 hrs - Tel: 01 244 520684 ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ** ft .... 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!!* • Lego NXT Mindstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • POB Robots (kits and components) email: sales@robotiq.co.uk Tel: 020 8669 0769 www. elektor. com USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. CANDO - CAN BUS ANALYSER http://www.cananalyser.co.uk • USB to CAN bus interface • USB powered • FREE CAN bus analyser • Receive, transmit & log. CAN messages • IS011898 & CAN 2.0a/2.0b compliant • Rugged IP67 version available SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £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 are limited and spaces will go on a strictly first come, first served basis. So-please fax back your order today! _ n I wish to promote my company, please book my space: • Text insertion only for £242 + VAT • Text and photo for £363 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION elektor i2-20og 79 Books SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES A world of electronics from a single shop! Specially designed for electronics enthusiasts, wywwlektor^^ Complete with a free pen and SMD-tool Elektor Personal Organizer 201 0 Do you already have a diary for the coming year? If you don’t, you can end your search now. We have exactly what you need: a diary specially designed for electronics enthusiasts. The Elektor Personal Organizer 201 0 makes planning your appointments a real pleasure, and you always have ready access to have handy information that everyone who works with electronics needs to know. In addition to the usual features such as an appointments calendar, address book and notes pages, this organizer has around 40 pages (in English) packed with useful information for you as an electronics specialist, both professionally and in your leisure time. For example, there is an extensive collection of formulas and tables for calculating current and voltage, component descriptions, physical constants, connec- tor pin assignments, and much more. This organizer also includes information on international trade fairs related to electronics and computertechnology. ISBN 978-90-5381-247-1 • £24.90 • US$41.90 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 personal computers running the Windows operating system. It’s use of modern techniques in detailed, numerous examples has been designed to show clearly how straightforward it can be to create the interfaces between digital and analog electronics, programming and Web-design. With an emphasis on learning by doing, readers are encouraged by exam- ples to program with ease; the book pro- vides clear guidelines as to the appropriate programming techniques “on the fly”. 292 pages • ISBN 978-0-905705-79-8 £28.50 • US $46.00 Learn more about C# programming and .NET C# 2008 and .NET programming This book is aimed at Engineers and Scien- tists who want to learn about the .NET en- vironment and C# programming or who have an interest in interfacing 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 flowto more advanced concepts including object ori- ented programming. 240 pages • ISBN 978-0-905705-81-1 £29.50 • US $44.50 V J 8o Prices and item descriptions subject to change. E. & O.E i 2 - 20 og elektor Home electric power Your own Eco-Electrical Home Power System This book provides the semi-technical, power-conscious homeowner a place to be- gin 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 book- let will help you to safeguard or develop your own home electricity supply. It con- tains step-by-step calculations, practical details, examples, electric system problems with emedies and much more. 96 pages • ISBN 978-0-905705-82-8 £16.50* US$26.00 310 CTmrfU 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 and thermal solartechnologies, wind power conversion, inverter circuits, and loads such as electronic lighting. Power electronics circuit theory is presented while analyzing commercial circuits, including little-known converters and subtleties such as snubbers and leakage inductance. The book also offers in-depth coverage of power system strategizing for optimal efficiency and utility, inclu- ding a 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 • ISBN 978-0-905705-83-5 £24.90 • US $39.90 Creative solutions for all areas of electronics 31 0 Circuits 31 0 Circuits, tips and design ideas in one book form a treasure trove for every area of electronics: audio and video, hobby and modelling, RF techniques, home and gar- den, test and measurement, microcontrol- lers, computer hardware and software, power supplies and chargers - plus of course everything else that does not seem to belong in any of these categories. 31 0 Circuits contains many complete solutions as well as useful starting points for your own projects. 544 pages • ISBN 978-0-905705-78-1 £29.90 • US $45.00 More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com A 110 issues, more than 2,100 articles DVD Elektor 1990 through 1999 This DVD-ROM contains the full range of 1 990-1 999 volumes (all 110 issues) of Elektor Electronics magazine (PDF). The more than 2,100 separate articles have been classified chronologically by their dates of publication (month/year), but are also listed alphabetically by topic. A comprehensive index enables you to search the entire DVD. ISBN 978-0-905705-76-7 £69.00 • US$99.00 See the light on Solid State Lighting DVD LED Toolbox This DVD-ROM contains carefully-sorted comprehensive technical documentation about and around LEDs. Forstandard mod- els, and for a selection of LED modules, this Tool box gathers together data sheets from all the manufacturers, application notes, design guides, white papers and so on. It offers several hundred drivers for power- ing and controlling LEDs in different con- figurations, along with ready-to-use modules (power supply units, DMX con- trollers, dimmers, etc.). In addition to opti- cal systems, light detectors, hardware, etc., this DVD also addresses the main shortcoming of power LEDs: heating. This DVD contains several Elektor articles (more than 1 00) on the subject of LEDs. ISBN 978-90-5381 -245-7 £28.50 • US$54.00 J elektor 12-2009 8i SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Software Tools & Hardware Tips Ethernet Toolbox This CD-ROM contains all essential infor- mation regarding Ethernet interfaces! Ethernet Toolbox includes a collection of datasheets for dedicated Ethernet inter- face ICs from many different manufactur- ers. It provides a wealth of information about connectors and components forthe physical layer (PHY) and specific software tools for use with the Ethernet (Software). To help you learn about the Ethernet in- terfaces, we have compiled a collection of all articles on this topic that have ap- peared in Elektor and complemented them with additional documentation and links to introductory articles on Ethernet interfaces. The documents are PDF files. ISBN 978-90-5381-214-3 £19.50 • US$39.00 Completely updated Elektor’s Components Database 5 The prog ram package consists of eight data- banks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. Afurther eleven applica- tions cover the calculation of, for example, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A colour band decoder is included for deter- mining resistor and inductor values. ECD5 gives instant access to data on more than 69,000 components. All databank applica- tions are fully interactive, allowing the user to add, edit and complete component data. ISBN 978-90-5381 -159-7 £24.90 • US $39.50 OBD Analyser NG (September 2009) The compact OBD2 Analyser in the June 2007 issue was an enormous success - not surprising for an affordable handheld onboard diagnostics device with auto- matic protocol recognition and error codes explained in plain language. Now enhanced with a graphical display, Cortex M3 processor and an Open Source user interface, the next generation of Elektor’s standalone analyser sets new standards for a DIY OBD2 project. The key advan- tage of this OBD2 Analyser NG is that it’s self-contained and can plug into any OBD diagnostic port. Kit of parts including DXM Module , PCB SMD-prefitted , case , mounting materials and cable Art.# 090451 -71 • £84.00 • US$135.00 R32C Application Board (September 2009) This R32C Application Board sports push- buttons, LEDs, an I2C interface, an OLED panel, an SD card interface and a socketfor an Ethernet module. There is plenty of spa- ce on the board for further expansion. Kit of parts incl. application board with SMD parts prefitted , plus all other components Art.# 080082-71 • £112.50 • US$185.00 Experimenting with the MSP430 (May 2009) All the big electronics manufacturers su- pply microcontrollers offering a wide range of functions. Texas Instruments supplies handy USB evaluation sticks with related software for its low-cost MSP430 control- lers. Unfortunately the I/O facilities are somewhat limited. These can be substan- tially enhanced with the help of the Elektor MSP430 board. PCB, populated and tested Art.# 080558-91 • £35.00 • US$55.00 Tl eZ430-F20 1 3 Evaluation Kit Art.# 080558-92 • £24.50 • US$35.00 Automotive CAN controller (April 2009) Since cars contain an ever increasing amount of electronics, students learning about motor vehicle technology also need to know more about electronics and mi- crocontrollers. In collaboration with the Timloto o.s. Foundation in the Nether- lands, Elektor designed a special controller PCB, which will be used in schools in sev- eral countries for teaching students about automotive technologies. But it can also be used for other applications, of course. The heart of this board is an Atmel AT- 90CAN32 with a fast RISC core. Kit of parts, incl. PCB with SMDs prefitted Art.# 080671 -91 • £52.00 • US$79.00 82 Prices and item descriptions subject to change. E. & O.E i 2 - 20 og elektor "\ December 2009 (No. 396) £ US$ + + + Product Shortlist December: See www.elektor.com + + + November 2009 (No. 395) Solder Station ‘Plus’ 090022-41 ...PIC18F4520, programmed 11.50 18.00 AVR-Max Chess Computer 081 1 01 -1 .... Printed circuit board 1 2.90 1 8.75 081 1 01 -41 ... Programmed controller ATmega88 1 1 .50 1 6.50 081101-71 ... Kit of parts incl. PCB, programmed controller and components 29.90 44.00 R32C Web Server 080082-71 ... Application Board with SMD parts prefitted, plus all other components 1 1 2.50 1 85.00 080928-91 ... R32C Starter Kit: processor board populated and tested, Toolchain on CD 27.00 42.50 090607-71 ... PCB, populated and tested WIZ81 2MJ module with W51 00 chip 18.00 25.00 October 2009 (No. 394) Pocket Preamp 080278-71 ... Kit of parts 65.00 95.00 Digital Barometric Altimeter 080444-41 ...PIC18F2423, programmed 15.00 24.00 September 2009 (No. 393) R32C Application Board 080082-71 ... Kit of parts including Application Board with v SMD parts prefitted, plus all other components ..112.50... ..185.00 080928-91 ... R32C Starterkit: Processor board populated and tested, Toolchain on CD ....27.00... 42.50 OBD Analyser NG 090451-71 ... Kit of parts including DXM Module, PCB SMD- prefitted, case, mounting materials and cable .... 84.00... ..135.00 Battery Monitor 030451-72 ...LC display ....11.00... 15.00 080824-1 .... Printed circuit board .... 12.90... 18.75 080824-41 ... Programmed controller LPC21 03 ....16.50... 24.00 July/August 2009 (No. 391 /392) Luxeon Logic 081 1 59-41 ... Programmed controller ATtiny25 6.40... 10.50 Programmable Nokia RTTTL Player 090243-41 ... Programmed Attinyl 3 6.40... 10.50 Breadboard/Perfboard Combo 080937-1 Printed circuit board ....25.50... 42.00 Annoy-a-Tron 090084-41 ... Programmed controller ATtinyl 3 6.40... 10.50 Fan Speed Controller 070579-41 ... Programmed controller ATtinyl 3 7.70... 12.60 Floating Message 080441 -41 ... Programmed controller PIC1 6F61 6 6.40... 10.50 Pulse Clock Driver with DCF Synchronisation 090035-41 ... Programmed PIC1 6F648A 7.70... 12.60 Frequency and Time Reference with ATtiny231 3 080754-41 ... Programmed ATtiny231 3, 20 MHz configuration ... 7.70... 12.60 PIC Detects Rotation Direction 081 1 64-41 ... Programmed PIC1 2F509A 6.40... 10.50 Simple Temperature Measurement and Control 090204-41 ... Programmed controller ATmega48 7.70... 12.60 Two-button Digital Lock 0901 27-41 ... Programmed ATtiny231 3 7.70... 12.60 Full-colour Night-flight Illumination 080060-41 ... Programmed controller PIC1 2F675 6.40... 10.50 Chill Out Loud 080700-41 ... Programmed controller PIC1 2F629 6.40... 10.50 USB Radio Terminal 071 1 25-71 ... 868 MHz assembled and tested module 7.30... ....11.90 080068-91 ... Assembled and tested R8C Board with USB .... 55.00... 82.50 Bestsellers ^ Practical A O O CO O o' I O > Q Q U o3 CO 1 Eco-Electrical Home Power Electronics ISBN 978-0-905705-83-5.... £24.90 US $39.90 Your own t Eco-Electrical Home Power System ISBN 978-0-905705-82-8.... £16.50 US $26.00 3 5 1 2 3 4 5 Complete practical measurement using a PC ISBN 978-0-905705-79-8.... £28.50 US $46.00 4 310 Circuits ISBN 978-0-905705-78-1 .... £29.90 .... .US$45.00 5 C# 2008 and .NET programming ISBN 978-0-905705-81 -1 .... £29.50 US $44.50 i0 DVD LED Toolbox ISBN 978-90-5381 -245-7 .... £28.50 .... .US$54.00 2 DVD Elektor 1990 through 1999 ISBN 978-0-905705-76-7.... £69.00 US $99.00 30 ECD5 ISBN 978-90-5381 -1 59-7 .... £24.90 .... .US$39.50 4 Ethernet Toolbox ISBN 978-90-5381 -214-3 .... £1 9.50 .... US $39.00 DVD i-TRIXX Freeware Collection ISBN 978-90-5381 -244-0.... £27.50 US $39.50 OBD Analyser NG Art. # 090451 -71 £84.00 ...US $1 35.00 USB Radio Terminal Art. # 071 1 25-71 £7.20 US $1 1 .50 R32C Application Board Art. # 080082-71 £1 1 2.50 ...US $1 85.00 R32C/1 1 1 Starterkit Art. # 080928-91 £27.00 US $42.50 ElektorWheelie Art. #090248-71 £1380.00 US$2275.00/ Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH • United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com elektor 12-2009 83 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR USB step by step Many designers with otherwise fine ideas about connecting stuff to their PC resent the virtual disappearance of the trusted RS232 and Centronics ports that were sooo easy to write software for. The successor port called USB is a massive success commercially but feared by many for its complexity when it comes to being used as a gateway to homebrew circuits. In next month’s article we present a step by step guide to getting USB-equip- ped peripherals to do the things you want to, guiding you through the hardware, a cheap Atmel AVR-USB development board, and software abstractions like libraries, DLLs and HIDs. For starters you will learn how to flash LEDs and read a miniature joystick, based on a library that’s free to use by everyone. Compact TTL-Bluetooth module Laptops, mobile phones and PDAs — you mention it, these days it’s bound to have a Blue- tooth interface. USB Bluetooth dongles are available at low prices, which opens the way to using these wireless devices to link your own circuits to a PC. To do so, all you need is the compact TTL-Bluetooth dongle we’ll describe in next month’s edition. Besides the LMX9838 chip with its integrated radio transceiver the board contains just a handful of parts, including a connector for audio applications. Microcontroller controlled dimmer This dimmer employs an unusual method for brightness adjustment. The dimmer may be programmed by switching the lamp on and then right off again, whereupon the bright- ness is increased in small steps. As soon as the desired brightness is achieved, you press the switch again. The next time the lamp is switched on it will light at the desired bright- ness. This solution is also suitable for dimming a lamp via two switches in a staircase configuration. The January 2010 issue comes on sale on Thursday, December iy, 20og (UK distribution only). UK mainland subscribers will receive the issue between December 12 and is, 2009. Article titles and magazine contents subject to change; please check the Magazine tab on www.elektor.com w.elektor.com www.elektor.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, kits and books. A powerful search function allows you to search for items and references across the entire website. 0lektor USB Data Acquisition 1 . limn Magazine Subscribe now forum Service Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact ■ Choose an opt* ^ IrHorrrJtr.* articles v Projects OM IEA SING A PC Supercendutbng sensor idenorea ligu>0» mapie tree u«p| .nt^r* world's smallest., AV« MKrOCOAtronert integral** M transnuwer funteenality IbH clams utia-tau opteai cemimascauon mot carbon enps Download Elektor ?: SKTOvan Vl« It China with ClaWor V CD.' DVD ROMs a* Klta A MOOuW* gCrWocks «K«» «a Controters a* Magarmo a# Offers as Flektor Credits as Subsc/iRbon* • tinkler Neanniber 7000 jOektor’s 2069 lao. cm her Issue [sen be downloaded' T*i« downloadable v«rt«n no! env saves you time and money but j so offers *uii teat search oebens gp«per LmI calif Study trip to Chino 7 16 November 5069 Cntc* your Em*l *