T rny. ■ -Uli llrC}}, f t, December 2010 AUS$ 13.90 - NZ$16.90 - SAR 99.95 £4.65 + Elektor DSP Radio Scanner EMBEDDED GUIDE 201 0 32 pages of microcontroller projects Elektor PCB Prototyper A professional PCB router with optional extensions / * d ®Wdt a *J Qn(t + 50-watt Power LED + Heating System Monitor + Stroboscopic PC Fan R51 1 2 t idit Sc r,*... "? -■■™*r.GL CD j 4a in 9 * Help B j «w fi g£ . I tUSiVjS I / Mgf l WbiaM / iRKuingf] ro J*cts', jj, ■ 249 x 128 events ■vttirri MikroElektronika DEVELOPMENT TOOLS I COMPILERS I BOOKS W 4 V^N. 4 V S'V'V' GET IT NOW www.visualglcd.com (i Visual GICD GUI design TOR WR IOOS n '™ ,N emb todeo C E °s F ^r|M-fH->.ki¥ri U il£l CC> I fH » m #-_tt £ Dj Ji Lfe I T. . nn I -r^k : M GLCD USART Terminal Ul .00 ■ I _*»>■' i i*m "ills' wriui tm r a tm »(■ WH¥' l t«IHif >H W|.*P ■ hi hHH in la i n «i>l in -*■ r-itasn' ™. ■ fcs Ml ■<■ M(ii,ni uji ui an i ii f *i* riajj. i^, pier* ipi tI iihi *i' NHX rii .1 I I i in ’" ; i a nil *ii HhK^iiui iiHiiaia .i raai ■ha TP! m* | |_ r ■ ■! _i n r ■*» l!l fcnrtRt i L-iOr Lv:i llrl -H:t nut fr ' t-r 1 ■ - n ' « < b rip ir^w^ UMKIIHI 3 rtlfFHi I # K*>l 1 41 HI i J j. i - -i ■ LJ a i .1 Pr - . . i F| . * r# B l l Pil' ! !■ M-LniBa-K-lHT*.: a-b-a-aL ** «****-•■■ Ua*-i.»rai| T tf (3 H K ir ii l " ■*- act |*£KT-ri’U ,4 UULU 1 KK|I PfeLflfiU Scrtaris 1 1 Se -*t i*ft3 V*ms — ST"* Com «j n efi ts B ^wca« sne ^pertieg * Cap«, 8r , T »B „ ' 1# ® ftnt * 4rtf W<| fr 3 C * 0 t/CA R e*ci< 0 Invert True ; IP SStt(7 BS sfi&g: h3 l j is J £-:/_• | r • • ; c ; ~ ***Ltnoth *onr FontCotor Vtgitif OrOJO nS SS., — ~~ ^ laqBi f 1 p‘'’*ffr ifi ii i 7 T~ — "— —— —J || rv- • rrTrf^Bpppi^ai^,^ S ^******Hui^.. ^ _ *' B -"'P, 1 -v 0 W H eatin cj System Mom to vM A ANALOGUE • DIGITAL MICROCONTROLLERS & EMBEDDED A AUDIO • TEST & MEASUREMENT^ If ¥* HI I Volume 36, Number 408, December 2010 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 Christian Vossen (Head), Ton Ciesberts, Luc Lemmens, Jan Visser. Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DTP: Ciel 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-2010 elektor Elektor Personal A#' Organizer 2011 ftBF \ Contents refill available separately The Elektor Personal Organizer 2011 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. ektor The Organizer 201 1 at a glance: • 2011 calendar (two pages per week) • Appointments calendar (with comer perforations) in six languages • 60 pages of technical information on electronics • Seven sections, separated by tab sheets • Alphabetic address and telephone book • Handy monthly planner • Lined pages foryour notes • Five credit-card pockets and a pocket for business cards • Push-button closure • Six-ring binder mechanism • Luxurious grey imitation-leather binding • Free pen and SMD Tool (with complete package only) Contents refill 201 1 If you purchased the Elektor Organizer last year, the content refill for 2011 can be ordered separately for £14.80 (US $23.90). ISBN 978-90-5381-259-4 • £24.90 • US $40.20 Contains 60 pages of technical information on Electronics'. Further information and ordering at www.elektor.com/organizer w 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-ZC 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. 2010 Printed in the Netherlands elektor 12-2010 7 NEWS & NEW PRODUCTS Fine-pitch SMT kit with lead-free option STI Electronics, Inc., a full service organi- zation providing training, electronic and industrial distribution, consulting, labora- tory analysis, prototyping, and small- to medium-volume PCB assembly, announces that its Fine-Pitch SMT Kit is now available in both lead-free and tin-lead versions. The lead-free component option is available with the ENIG board finish. Today’s SMT and lead-free processes pre- sent new challenges for employee skills and machine process capability. This kit allows users to develop critical skills and processes before they impact production. It is often used to determine overall produc- tion or machine process capability to meet the challenges of today’s fine-pitch compo- nent technologies. The Fine-Pitch SMT Kit offers guaranteed performance at a greatly reduced cost over operational assemblies. Select the kit with three popular component combinations, or create a customized component list and contact STI Electronics. www.stielectronicsinc.com (100708-IV) Class D amplifier brings affordable fidelity to consumer audio Silicon Laboratories Inc. recently introduced the industry’s first 5 watt stereo Class D amplifier that effectively mitigates elec- tromagnetic interference (EMI), bringing affordable fidelity to consumer audio elec- tronics. The first member of Silicon Labs’ Class D amplifier family, the new Si270x amplifier is ideal for use in a wide range of price- and noise-sensitive consumer audio products including smart phone docking stations, tabletop radios, TV sound bars and monitors, boom boxes and battery- powered radios. For years, consumer audio engineers have wanted to replace power-hungry analog Class A/B amplifiers with power-efficient digital Class D technology. Until now, two issues have impeded the adoption of Class D amplifiers: the high EMI emissions inher- ent to traditional Class D solutions, which interfere with AM/FM radio and smart phone operation, and the high cost of add- ing expensive filtering and shielding for EMI regulatory compliance. While other Class D suppliers have attempted some level of EMI protection, Silicon Labs’ Si270x changes the shape of the audio amplifier market with power-efficient Class D technology that substantially suppresses EMI emissions for operation with radios using inexpensive filters. The Si270x amplifier uses multi-layer EMI mitigation technology to suppress tradi- tional Class D interference at its source, ena- bling easier EMI compliance, AM/FM radio co-existence and smart phone compatibil- ity in consumer audio products. Compared to existing Class D solutions, the Si270x amplifier reduces radiated interference by iox in the EMI compliance band, by ioox in the FM radio band and by iooox across the AM band. Smart Phone-Friendly Digital Architecture Traditional Class D amplifiers emit large amounts of EMI radiation in the 900 MHz transmission and reception band, which undermines the over-the-air (OTA) trans- mission and reception quality of smart phones and docking stations. In addition, analog architectures employed by most docking platforms are highly susceptible to time division multiple access (TDMA) trans- mission noise pickup. The Si270x amplifi- er’s smart phone-friendly all-digital archi- tecture is inherently immune to radiated noise pickup, and Silicon Labs’ EMI mitiga- tion technology enhances OTA performance and compliance. The Si270x Class D amplifier can enable a 2.5X increase in play time over Class A/B- based systems while using only half the number of batteries (four instead of a typi- cal eight). For example, a consumer audio system based on the Si270x amplifier can provide up to 8.4 hours of play time using four AA alkaline batteries. The Si270x Class D amplifier is designed to be combined seamlessly with Silicon Labs’ popular Si473x AM/FM radio tuner products to enable complete consumer audio plat- form solutions. The latest Si473x devices offer a stereo analog input and internal analog-to-digital converters (ADCs) mul- tiplexed with the radio tuner front-end to support auxiliary analog system inputs without the need for additional external ADCs. The complementary Si270x and Si473x combination provides a cost-effec- tive platform solution for a wide range of consumer audio products such as tabletop radios, docking stations, boom boxes and mini-stereo systems. Samples and pre-production quantities of the Si270x Class D audio amplifiers are avail- able today in a 24-pin QFN package. Pric- ing in 10,000-unit quantities for the Si270x amplifiers begins at $1.17 (USD). To help accelerate application development, Silicon Labs offers audio engineers a full-featured Si270x-A-EVB evaluation board priced at $325 (USD). www.silabs.com/pr/ClassD (100708-V) Popular JJB now available in high temperature package The popular JJB series antenna is now avail- able in a high-temperature, reflow compat- ible housing: the JJB-HT. Designed for both hand and automated assembly, the anten- JJB SEMES HI-TEMP REFLOW COMPATIBLE ANTENNA 8 12-2010 elektor NEWS & NEW PRODUCTS New Tl Stellaris EVALBOT evaluation platform Delivering a fun plat- form for learning and evaluating real-time software and Stella- ris® microcontrollers (MCUs), Texas Instru- ments announced the availability of its new Robotic Evaluation Board (EVALBOT) for use with Micrium’s \xC / OS-Ill. The evaluation kit is a mini robot that allows developers to experience the Stellaris ARM® Cortex™-M3-based LM3S9B92 MCU in real-world applications that leverage the processor’s integrated 10/100 Ethernet MAC/PHY, USB On-The-Go, CAN, and motion control capabilities. Based on a complete analog and embedded processing signal chain from Tl, the kit includes all of the hardware and software required for quick assembly so that developers can begin evaluation in 10 minutes or less. The EVALBOT is available with a Stellaris-specific version of pC/OS-///: The Real-Time Kernel by Jean J. Labrosse, which reveals how a real-time kernel works using Micrium’s pC/OS-lll and the Stellaris EVALBOT as references. For more information, go to the first link below or for a video overview, go to the second link. Stellaris EVALBOT and book bundle features and benefits (EKB-UCOS3-BNDL) • 80 MHz Stellaris LM 3 S 9 B 92 MCU with 256 K flash, 96 KSRAM, Stel la risWa re® software in ROM, as well as integrated Ethernet, USB On-the-Go (OTG)/Host/Device and CAN • Two DC gear-motors that provide drive and steering, opto-sensors that detect wheel rotation with 45 ° resolution, and sensors for ‘bump’ detection • Tl motor drivers, voltage regulators, audio codec, interface and logic devices for easy evaluation of the complete signal chain • Bright 96 x 6 blue OLED display and on-board speaker • Integrated In-Circuit Debug Interface (ICDI) requires only a single (included) USB cable for software debugging, flash programming and serial port connectivity • Two 20 -pin headers enable future wireless communications using standardized Tl low-power embedded radio modules • Stellaris-specific version of \iC/OS-lll: The Real-Time Kernel includes example display, audio and motor control projects for EVALBOT, putting concepts into practice to expedite a user’s proficiency The Stellaris Robotic Evaluation Board plus Micrium’s pC/OS-lll book package is priced at US$199 and can be purchased at www.ti.com/evalbot-pr-es. The Stellaris Robotic Evaluation Board is priced at $149 US and can be purchased separately from the book at www.ti.com/evalbot-bot-pr-es. www.ti.com/evalbot-pr-tf www.ti.com/evalbot-pr-v (100725-II) nas are RoHS compliant and can withstand reflow processing temperatures of up to 26 o°C. These compact monopole anten- nas are an ideal solution for OEM applica- tions requiring a low-cost internal or exter- nal antenna solution. JJB-HT series antennas are supplied in tape and reel packaging. Each antenna costs less than $1.28 in pro- duction quantities. Custom colours and logo options are available for volume OEMs. www.antennafactor.com (100725-I) Semiconductor replication service Rochester Electronics is proving that the combination of semiconductor re-creation and continuing manufacturing is a cost- effective and time-saving alternative to system re-design when critical semiconduc- tors are no longer available from the origi- nal manufacturer. As the world’s largest authorized manufacturer of discontinued semiconductors, Rochester Electronics has established a process that provides custom- ers with a replica device that matches the original semiconductor’s physical features, layer-by-layer and pin-for-pin, and is guar- anteed to perform exactly as the original. Even when the IP is no longer available from the original manufacturer, Rochester’s experienced design engineers can decon- struct and electrically analyze a device, re- design it, and re-engineer it onto a matched mature foundry process. Rochester can then test all circuit parameters with a collection of custom developed tools to analyze device characterization. Rochester’s unique Semiconductor Replica- tion Process™ (SRP™) guarantees that rep- licated devices perform as effectively as the original semiconductor devices. Rochester has successfully completed 83 semiconduc- tor replication projects in the last 18 months and is currently engaged in more than 30 additional re-creation projects. Rochester recently did a successful re-crea- tion for a company that had previously con- tracted with two other companies for emu- lations that turned out to be unsuccessful because they were based on the compa- ny’s original intellectual property. Roches- ter’s SRP went beyond the IP, evaluated the actual device, and produced an exact rep- lica that worked exactly as the original on the first production run, thus avoiding any additional foundry costs. Rochester has agreements with most of the major semiconductor manufacturers and is proud to serve the industry as a reliable, long-term source for authorized, traceable, and quality end-of-life semiconductors. www.rocelec.com (100725-III) elektor 12-2010 9 NEWS & NEW PRODUCTS Compact high efficiency fully featured AC-DC supplies XP Power’s HCP series of single output compact bulk power AC-DC power supplies is aimed at process control, factory auto- mation and manufacturing equipment applications. These highly efficient units, typically up to 91%, comprise four output power models, a 650 W and 1 kW, which are both less than ill high, and a 1.5 kW and 3 kW. A single wire current share capability allows the configuration of multiple units to achieve a higher power output or to provide redundancy. All the popular nominal out- put voltages from + 12 to +48 VDC are avail- able across the range. To accommodate an even wider range of output voltage require- ments, an output voltage trim capability allows adjustment of 30 - 105% of nominal output voltage. A similar function provides adjustment of current output between 40 - 105% of maximum current. Both controls can be made by using either an external voltage input or by a variable resistor. A +5 VDC 0.5 A standby supply can be used to drive logic or control circuits without the need to design-in an additional voltage source or step down converters. These fan cooled units are ideal for custom- ers looking for a compact high efficiency power supply that has programmable fea- tures and monitoring signals. By varying the cooling fan speed depending on the output load fan noise is kept to a minimum. Monitor and control signals include DC OK, remote sense and remote on/off. A multi- function LED indicator gives a visual indi- cation of the power supply’s operational condition. The HCP series are available from stock and come with a 3 year warranty. www.xppower.com (100725-V) Pico Technology Test & Measurement catalogue The Pico Technology Test & Measurement Catalogue has been completely redesigned. It now contains more technical data on established and new products. The PicoScope section now also contains the new PicoScope 2200 Ultra-Compact scopes and the PicoScope 3425 Differential scope. A PicoScope 2200 scope is also avail- able in a new Education Kit designed for use in the classroom. The PicoScope 4000 Precision scopes, both with and without an arbitrary waveform generator, are now listed, as are the PicoScope 6000 High-Per- formance scopes with 350 MHz bandwidth and 5 GS/s real-time sampling rate. You will High-performance, cost-efficient RF ICs for car access systems Atmel® Corporation recently introduced the next generation of smart RF devices for the auto- motive and consumer markets, enabling RF systems with high per- formance and applica- tion simplification. Com- mitted to the automo- tive market, the Atmel ATA5830 and ATA5780 are the next generation of monolithic RF trans- ceiver and RF receiver devices with worldwide leading RF performance like sensitivity and power consumption. The multiband devices are designed for the ISM frequency bands in the ranges of 310 to 318 MHz, 418 to 477 MHz and 836 to 928 MHz, and are the ideal solutions for today’s demanding automotive remote keyless entry (RKE), remote start, passive entry go (PEG), and tire pressure monitoring (TPMS) systems. The monolithic devices combine a highly advanced RF receiver or transceiver block with a proven Atmel AVR® microcontroller core. This enables the devices to poll multiple application channels to support, for example, the RKE/PEG, Remote Start and TPMS system with a single 1 C instead of having multiple ICs, which results in a very cost effi- cient solution. The ATA5830 and ATA5780 are pin-compatible devices to ensure maximum reuse of development effort for i-way and 2-way systems. Based on this pin-compatibility fea- ture, the printed circuit board design can be the same for both the unidirectional and bidirectional car access system, which is a unique selling point in regards to variants, stock of replacement parts and cost savings. These products are ideal for all car access applications due to their excellent RF perfor- mance, high flexibility and modular concept. These benefits, combined with a very high integration level, result in the requirement for less than half of the external components of previous products on the market. The highly sensitive devices (typical -109 dBm, 10 kBps Manchester data rate, FSK mod- ulation with ±10 kHz frequency deviation, IF bandwidth 165 kHz) provide a high image rejection and excellent blocking performance (typical 64dBc atiMHz, IF bandwidth of 165 kHz) for the customer application. The transceiver’s maximum power-down cur- rent of 600 nA ensures that customers enjoy maximum battery life and battery size is kept to a minimum. http://www.atme!. com/dyn/products/product_card.asp?partJd=5004 http://www.atme!. com/dyn/products/product_card.asp?part_id=5005 (100725-IV) 10 12-2010 elektor also find the PicoScope 9000 12 GHz Sam- pling scopes, which use sequential sampling to analyse repetitive signals with a time res- olution of only 200 femtoseconds. The Accessories section introduces a range of new scope probes, including differential high-voltage types for measuring several kilovolts, and both active and passive types for bandwidths up to 1.5 GHz. In the PicoLog section you will find the new PicoLog 1000 Series 12-channel and 16-channel voltage data loggers, and the latest PT-104 4-chan- nel platinum resistance data logger with USB and Ethernet ports. mt'tt All Pico Technology products are backed up by a free parts-and-labour warranty of up to 5 years depending on the product type, free technical support from our specialists, and an international network of distributors. The Pico Technology 2010 Test & Measure- ment Catalogue is available to download now, free of charge, from the Pico Technol- ogy website at www.picotech.com. You can also request a printed copy by filling in the online form. www. picotech.com (100725-VI) T/R switches integrate clamping diodes to protect ultrasound imaging systems Maxim’s new transmit/receive switches integrate clamping diodes to cut solu- tion size by more than 50% while protect- ing high-performance ultrasound imaging systems. The new MAX4936/MAX4937 fully inte- grated octal high-voltage transmit/receive (T/R) switches integrate clamping diodes to isolate the low-voltage receive path from the high-voltage transmit path, thus protecting the receiver input from volt- Lost solar energy reclaimed by intelligent hotspot prevention STMicroelectronics reports an innovation for solar panels aimed at allowing more of the energy from each cell to reach the power grid. The innovation replaces the simple bypass diode with an intelligent device that enhances efficiency and offers the same package outline. The new device can deliver a fast Return- On-Investment, in terms of releasing additional energy for solar panel applications. ST’s new SPV1001 contains a low-loss power switch and a precision controller. Directly replacing bypass diodes, which are used to prevent hotspot effects, the SPV1001 pro- tects the energy normally lost in each diode. Compared to the use of diodes, the inte- grated power switch provides negligible leakage current when the photovoltaic (PV) panel is producing energy. ST’s BCD6 chip fabrication process provides the key to this advance by integrating highly efficient power components with logic control circuitry. In addition to package options enabling one-for-one replacement of bypass diodes in the solar panel’s junction box, the SPV1001 is available in an MLPD package that can be laminated directly into the panel, due to the device’s ultra-low-profile and minimal power losses. This will simplify electronic design and assembly while also boosting system reliability. Major features of the SPV1001: • BCD6 and EHD 5 power MOSFET processes • Low conduction losses when operating in bypass mode • Low leakage current minimizes losses in bypass stand-by mode • Lower operating temperature optimizes junction box design • High robustness to surge and lightning currents • Integration of power and control functions • TO -220 or D 2 PAK packages, pin- and outline-compatible with existing bypass diodes • Optional ultra-low-profile Power MLPD package for in-panel assembly The SPV1001 is in production now in the industry-standard TO-220 and ultra low-profile MLPD packages. www.st.com (100725-X) age spikes due to leakage currents flowing through the T/R switches. Maxim’s inte- grated solution uses > 50% less board space than discrete circuits while providing high bandwidth, low jitter, and low signal dis- tortion. The MAX4936/MAX4937 are ideal for use in ultrasound imaging and industrial flaw-detection probes, in which board space is at a premium. The MAX4936/MAX4937 feature eight indi- vidually programmable switches controlled through an SPI(TM) interface with a 12-bit shift register and transparent latch. These features simplify device operation when updating the states of the T/R switch; they ensure that all switches are off at power- on; and they reduce noise due to clock feedthrough. The MAX4936/MAX4937 T/R are based on the conventional diode topology, but include adjustable current biasing through the serial interface. The devices are speci- fied over the 0 degrees Celsius to +70 degrees Celsius commercial temperature range, and are packaged in a small, 5mm x 11mm, 56-pin TQFN. Prices start at $12.00 (1000-up, FOB USA). http://www.maxim-ic.com/MAX4936 (100725-VII) _ . . vVlvl XI vVl MAX4mMAX4$3? elektor 12-2010 11 NEWS & NEW PRODUCTS RS Essentials RS Components (RS) introduces its own range of products, ‘RS Essentials’, designed to deliver major cost reductions with- out ever compromising on quality. RS has always provided the widest range of prod- ucts, competitive pricing and industry- leading service. Now it has put all this into its own wide range of products across key technologies. ‘RS Essentials’ offers more choice with cost savings when compared to the leading brands. Over the years, RS has learned a lot from its customers and has built up a vast knowl- edge-base of what they need to operate efficiently and what they expect from the products they buy. It is this knowledge, together with keeping pace with techno- logical developments, which has enabled RS to create its huge own-brand range - ‘RS Essentials’ - combining best value with best quality. The ‘RS Essentials’ range now comprises over 30,000 products in such diverse areas as electronics and maintenance; cover- ing capacitors and diodes, through to LED replacement lamps and bearings, to screen cleaners and hand tools. ‘RS Essentials’ products provide real value for money. Prices are regularly checked so that they stay ahead, and in these dif- ficult times when margins are squeezed, choosing ‘RS Essentials’ will save custom- ers money. On average, ‘RS Essentials’ are 20% cheaper than manufacturer prices, although this varies across the range, with some items offering even greater savings. RS sources its ‘RS Essentials’ products both locally and globally. Once a potential sup- plier has been found, RS has an in-house team of specialist engineers who thor- oughly test the products for their quality, their ability to meet specifications and their compliance with regulations and guidelines. Alan Lund, Group Product Compliance Man- ager at RS, commented, “As a company, we’re focused on always offering the high- est quality products and there is a constant stream that needs to be checked for compli- ance, often down to component level. Our lab even carries out a range of specialist pro- cedures to check for BSI/RoHS compliance where appropriate. We also have advanced expertise across the full range of electrical testing procedures.” “Many vendors simply import and sell with- out product checks but this cannot be in the ultimate interests of anyone, particularly the customers’. When buying from the ‘RS Essentials’ range, customers can therefore be confident that they are getting outstand- ing quality and value.” RS has introduced flags to highlight the ‘RS Essentials’ products, both online and within the catalogue, making it easier for customers to identify the range and choice available. http://rswww.com (100725-IX) SMU Skunkworks — cell phone controlled vehicle Alibre, Inc. Developers affordable, profes- sional 3D design solutions, announced that it co-sponsored and participated in the non-profit TEDxSMU and TEDxKIDS 2010 events, bringing the best ideas of today’s minds together for two days of technologi- cal inspiration for the next generation of sci- entists, engineers, artists, doctors, market- ers, DIYers, inventors and entrepreneurs. Held in October in Dallas, Texas, TEDxSMU & TEDxKIDS merged interesting people from around the world in the areas of technol- ogy, entertainment and design, support- ing world-changing ideas with multiple initiatives. Short, exciting presentations by astounding thinkers on a broad array of topics, ranging from the science of yo-yos to space exploration, inspired both kids and adults alike. “We are honoured to be involved with TEDx and TEDxKIDS — prestigious events that take students out of their everyday class- room environments and bring them into a setting where their teachers are the people actually thinking and executing big ground- breaking ideas,” said J. Paul Grayson, CEO of Alibre Inc. Alibre Inc. helped bring the TEDxSMU event to Dallas through its key sponsorship, and provided two presenters with Alibre’s award winning design software, Alibre Design. One of the key TEDxSMU presenters, Nathan Huntoon, Director of the Innovation Gymna- sium, Southern Methodist University (SMU), showed a GPS controlled unmanned vehicle activated via a cell phone interface, which was created in the SMU SkunkWorks Lab by Huntoon’s students, including co-presenter Austin Hodges. The SkunkWorks Team used Alibre to design and place all the parts of their vehicle, before they ever built it. “What is amazing, is the students designed the vehicle in 3D first and when it came time to fit all the parts together, every piece fell in place perfectly,” said Huntoon. The unique vehicle can be seen live at TEDxSMU at: www.youtube.com/ watch?v=PvVoCnNgesA. www.alibre.com www.tedxsmu.org (100725-XII) New GammaSafe (TM) portable memory line The newGammaSafe™ memory token from Datakey Electronics is a non-volatile, repro- grammable, portable memory device that survives gamma sterilization with no loss of data. The GammaSafe data-carrier/ recep- tacle system allows medical device manu- facturers to easily add anti-counterfeit and limit-use capabilities to disposable attach- ments that are sterilized using gamma radiation. The SGT4l "O < extend the adjustment range of PI by modifying the time con- stants of the two gates. With the component values shown in the schematic diagram, the minimum current before the LED goes dark is approximately 1 50 mA. Power for IC1 is supplied by an 78L05. The maximum input volt- age of the control circuit is 30 V; Zener diode D4 ensures that it stays in bounds. The current consumption of the control circuit built around IC1 is so low that the power dissipation of IC2 does not increase significantly at high input voltages. Diode D3 limits any inductive voltages generated by parasitic inductances in the wiring. Toasty If you want to build the LED and power supply into a lighting fix- ture, you’ll have to devise something that allows sufficient cool- ing. The data sheet warns that the surface temperature of the LED can be as high as 1 50 °C, and that the aluminium mounting plate to which the LED is attached is far from adequate for dissipating the heat from the LED. The heat sink shown in Figure 5 is a bit exaggerated. The data sheet is not entirely clear on the amount of cooling required. It states for example that for use with horizontal orientation a sur- face area of 550 cm 2 is necessary for adequate cooling of the LED, but we wanted to be on the safe side during our experiments. The light output of the high-power 50 W LED is around twice that of a standard 1 00 W incandescent lamp (no longer available to consumers in most of Europe), with only half of the power con- sumption. When the LED is highly dimmed, you can see the indi- vidual points of light. It appears that Huey Jann Electronics con- structs the modules by placing four strings of LEDs side by side, with eight LEDs in each string. This is consistent with the voltage obtained by multiplying the average voltage over a white LED (3.3 V) by 8. The resulting value (26.4 V) is very close to the rated forward voltage of the power LED module (27 V). These LED modules are available from Reichelt in several colours, including warm, cool, natural and pure white. On the manufac- turer’s website and the data sheets you can see that the modules are also available in other colours, but at the time of writing they still haven’t found their way to the electronics retail market. Fin- gers crossed — eyes wide open. (100620-I) We wish to express our thanks to Reichelt Elektronik, Germany, for providing the power LEDs and the Mean Well power supply. Technology AFFORDABLE EXPERTISE THE PC OSCILLOSCOPE RANGE FROM PICO TECHNOLOGY BANDWIDTH 20 MHz to 12 GHz SAMPLING RATES 50 MS/s to 5 GS/s MEMORY 8 kS to 1 GS RESOLUTION 8 to 16 bits PRICES £125 to £6995 Latest Software Updates: l 2 C & CAN bus decoding, mask limit testing, advanced triggers, digital low pass filtering, rapid triggering Internet Links [1 ] www.reichelt.de [2] www.hueyjann.com.tw www.picotech.com/scope2026 elektor 12-2010 25 MICROCONTROLLERS NetWorker An advanced web server with a micro By Sven Sch lender (Germany) An Internet connection would be a valuable addition to many projects, but often designers are put off by the complexities involved. The ‘NetWorker’, which consists of a small printed circuit board, a free software library and a ready-to-use microcontroller-based web server, solves these problems and allows beginners to add Internet connectivity to their projects. More experienced users will benefit from features such as SPI communications, power over Ethernet (PoE) and more. There are three key elements in connect- ing a device to an Ethernet network: the Ethernet connection hardware itself, the software library (called the ‘stack’) respon- sible for handling the various protocol layers, and finally the top-level firmware functions. For example, to allow access to a device from anywhere in the world, it is possible to use a small web server running in a microcontroller. Compact ready-made modules are avail- able on the market to cover the first two of these elements. They allow you to con- nect a microcontroller to a network with- out having to get involved in the gritty details of its protocols. However, program- ming against the libraries provided can be a daunting task for the beginner; and more experienced users often find it necessary to ‘work around’ the firmware provided with the module to enhance or modify it. The solution provided here hides the com- plexity of the network protocols from the application programmer, and is simple to extend and very versatile. The circuit is based around a Microchip PIC1 8-family microcontroller which includes a built-in Ethernet transceiver. The author has added a few new functions to the free C software library available from the manufacturer that implements the TCP/IP stack. The final ele- ment of the project is a web server running on the microcontroller which can communi- cate with other hardware via the I/O pins of the device. Using this design it is possible to assemble a small system in just a few min- utes, capable of being controlled at will over the Internet. Beyond that, the module can be used as a ‘network modem’ for another microcontroller. Extra advanced features such as PoE round out the project. Printed circuit boards and ready-pro- grammed microcontrollers are available from Elektor, as well as the complete ready- made module. And of course the accom- panying software is also available as a free download from the Elektor website. Now let’s see what makes the module tick. The circuit Figure 1 shows the circuit of the mod- ule. At the heart of the unit is a Microchip PIC18F67J60. This device is one member of a range of microcontrollers that include a 10BASE-T Ethernet transceiver. Most of the circuitry required is provided in the device and only a few external components (including a connector!) are needed to con- nect to a network. The Ethernet PICs require a 2.5 V core volt- age supply, which can be derived from a higher voltage (3.3 V is recommended) using the voltage regulator included in the PIC. Pin ENVREG determines whether the voltage regulator is enabled. A 10 pF capacitor (Cl 12) provides smoothing and capacitors Cl 01 to Cl 06 positioned around the microcontroller decouple the supplies. A 25 MHz crystal (Q1 01 ) provides an external clock for the microcontroller, and the Ethernet transceiver clock is also derived from this source. The project includes a bootloader which allows new firmware to be uploaded over the Ethernet interface. Alternatively the device can be programmed via the solder pads MCLR, VCC, GND, PGD and PGC which form the standard Microchip in-circuit serial programming (ICSP) interface. This interface is needed for debugging soft- ware problems or if the module gets into a state where it no longer responds to being rebooted. A dedicated programmer (such as the ICD2) is required for debugging and programming over this interface. The reset circuit comprises R1 02, R1 03 and Cl 07. R102 is a pull-up resistor, and R103 and Cl 07 filter the reset signal to prevent spurious resets. Cl 07 can interfere with the operation of the ICSP interface, and so should be removed if it is to be used. The EEPROM stores configuration data. It also includes a 48-bit ID code, called the MAC address, required for Ethernet com- munication. The proprietary Microchip UNI/O bus protocol allows the EEPROM to be accessed over a single wire. Ethernet interface The connection to the Ethernet network comprises four signals, TPOUT+, TPOUT-, TPIN+ and TPIN-. These signals are passed via the Ethernet transformer TR1 , which gal- vanically isolates the main part of the circuit from the network. On the far side of the transformer is an RJ45 socket J1 , into which a standard Ethernet cable can be plugged. A special feature of the transformer we have chosen is its compatibility with the IEEE 802. 3af power over Ethernet (PoE) standard. Under this standard a 48 V sup- ply is provided on the network and a pow- ered device (PD) can draw current from this supply. There are two alternative arrange- ments possible: 1 . using the spare conductor pairs (on J1 these are pins 4 and 5 and pins 7 and 8); or 2. phantom supply over the signal pairs 26 12-2010 elektor MICROCONTROLLERS Figure 1 . Circuit diagram showing the PIC microcontroller, transformer and network socket. (pins 1 and 2 and pins 3 and 6). A PoE-standard device must support both possibilities. To take advantage of the phan- tom supply a special transformer is needed with centre taps to the windings on the net- work side. Implementing both power options means that a total of four wires have to be brought to headers JP1 and JP2, which form the user- side interface to the module. A suitable PoE regulator circuit can be connected to these headers to derive a supply for the module from the 48 V DC provided over the net- work (see below). Resistors R1 07 to R1 1 0 provide impedance matching, and Cl 08, Cl 09 and FE1 01 help reduce the effect of interference spikes on the network connections. R1 04 is a bias resistor that provides the Eth- ernet transceiver circuit with a known refer- ence current (hence its bizarre value). This in turn determines the signal amplitude on TPOUT+ and TPOUT-. There are two LEDs mounted inside the Eth- ernet socket. LED1 lights when the link is up (in other words, when there is a connection between the module and at least one other network device), and LED2 indicates net- work activity. The LEDs are driven from the PIC via series current-limiting resistors R1 05 and R106. elektor 12-2010 27 MICROCONTROLLERS Figure 2. The printed circuit board is also available ready-assembled. User-side interface The user-side interface consists of two 10-way 0.1 inch pitch headers. As well as carrying the PoE connections and the mod- ule’s power supply, the headers are also directly connected to certain pins on the microcontroller. On the author’s printed circuit board design (see Figure 2) the two headers are mounted 0.1 inch apart, which allows the module to be mounted easily on Power Class 1 : 0W44 < Pdevice - 3W84 RCLASS dL CZ co G > CO T VAl 1 VA2 2 VB1 3 VB2 4 9_ 5 AG9033-S +3V3 POE1 T VAl VA2 8 VCC 1 VB1 VB2 C= ADJ 7 GND 1 CPI CP2 CPOE 470u 100552 - 11 Figure 3. A PoE regulator can be used to provide power for the module. ordinary prototyping board. Pins VCC and GND form the power supply to the module. The supply voltage should be between 3.1 V and 3.6 V. Pins VA1 , VA2, VB1 and VB2 allow the mod- ule to be used in conjunction with a power over Ethernet regulator, sometimes called a ‘PD module’, such as the Silver Telecom Ag9000 series I 2 ]. Figure 3 shows an exam- ple circuit using the Ag9033, which provides a regulated 3.3 V output from the PoE DC supply. The active-low MCLR pin allows the module to be reset. It is also pulled low briefly when power is applied to the module. The other pins on the user-side interface are for use either to control external circuits or to sense their state, or for more general communications (by UART or SPI). Pins GPIOO to GPI02 can be configured as dig- ital inputs or outputs; those configured as inputs can be used to generate an interrupt to the microcontroller. Used as an output, each pin can sink or source up to 25 mA. Pin GPI03 is also configurable as a digital input or output, but can only sink or source up to 8 mA. A future software version may allow a PWM signal to be generated on this pin. GPI04 and GPI05 (which can be configured as inputs or outputs) can sink or source up to 2 mA. A future software version may allow these pins to be used as analogue inputs with 10 bit conversion resolution. Communications Pins TX and RX are connected to a UART that can support speeds of up to 1 1 5200 baud. Alternatively, these pins can be configured as ordinary digital inputs or outputs; as outputs, they can each sink or source up to 25 mA. An SPI interface is available on the pins with labels starting ‘SPI’. The interface can oper- ate in master mode or in slave mode, and the function of the pins depends on the mode selected. 1. In master mode SPI_I NT is not used, SPI_CLK is the clock output, SPI_MOSI the data output, SPI_MISO the data input. The active-low SPI_CS output is used to enable the connected slave device. 2. In slave mode SPIJNT is used to indicate when an event has occurred in the module that needs the attention of the SPI bus mas- ter. SPI_CLI< is the clock input, SPI_MOSI the data output, and SPI_MISO the data input. The active-low SPI_CS input is used to enable reception of a bus message by the module. Again, these pins can alternatively be con- figured as digital inputs or outputs. As an output, SPI_CS can sink or source up to 2 mA, while the other pins can each sink or source up to 25 mA. A future software version may allow SPI_ MISO and SPI_CLK to be used as an l 2 C interface. In this case SPI_MISO would be the SDA (data) signal and SPI_MOSI the SCL (clock) signal. Software library A ‘stack’ is a collection of software imple- mentations of protocols and drivers, usually arranged in a hierarchy of layers. At the bot- tom end of the stack are the hardware driv- ers which are responsible for getting data bits transferred onto the network wires. At the top end of the stack is a simple interface for data exchange. In theory, the layered protocol model makes it relatively easy to make modifications to one layer (such as the hardware driver) without affecting the others. In practice however, when implemented on a micro- controller, the hardware and the stack are very closely tied together, and lots of tricks need to be used to keep memory usage low. Nevertheless, TCP/IP stack implementations are available for a wide range of microcon- troller families, often for free and direct from the manufacturer. The author’s first tentative steps towards building a TCP/IP stack for a PIC micro- controller were in assembler. Over time, however, as the code grew, maintenance became harder and harder, and an alterna- tive solution was needed. Microchip offers a TCP/IP stack for its PIC1 8, PIC24, dsPIC and PIC32 microcontroller families written in ANSI C. It is free and can be extended and modified as long as it is only used in Microchip devices. It contains a rich collection of hardware drivers, low- level protocol implementations (ARP, IP, TCP and so on) and a couple of important appli- 28 12-2010 elektor MICROCONTROLLERS JXr.» jf tar rpwHJrtle nsMHfe* 0Wd trudjSf SrSrtM SIAEfc COMMON @PIQ BfcHRAL, Netzer Configuration TOrslQns 1 1 j id 201 0] mC Address: tt(J-U4-A2-fid-2Vt)U IK - r . J'j" t : ’■ 1 92 Ibd Uf « (rttfUT-iiie) rfi6s> JS5 255 2-55 0 1 - nl "way 1 N \ nftiTif- rvr114 7£liB laenl Nrtinr- Af;1lWfl N«!i*r tfPiQ only tfPlG Server connected wiih 192 ii*ii SJ.i ^nvanl K.HF¥rir Slappihd Flytrt t hfiwark — . inrtal ' 0 Hytrt irjiftl -. nHwan 0 RaieltoliiiMryseli.ngi b-errice WsDawrcd «. 00 M *1 DS P Aiklivia i « ih >■ & rAtrauM.i ^.ubipfpfciib 3*5 urt ?V5 0 3«tCOTI5 l« 1U 1 aipiR^ib kip* ■mg 4 .”.1.3 ii.i ji ■dins ■ A;hYf Mfl rwi nad# 9 ?1lp Mil I s C wHj It# 111 4! 4 SrfiiJ Snvr Star-piti ItltC Ml rrC-iTi -r Q dvbfci acetal — rwtwwip U E 533 I Figure 5. The home page forthe module’s web interface. The ‘Blinking’ button comes in useful when more than one module is used simultaneously. Figure 6. Using this web form you can (among other things) specify the ports on which the module will listen. Nefzer Conffg uratlon ■EVSH M ®T Af( Nun# in Siynii ii ir*ci la-n A £ 1 11 41 Um \ *J fe COMMON ti 0 Cii-tpiii Cfr - rat: P O i m - 1 C .: (■». «: r.niii # o O i a 1 C f...: P s-.fiu: 1? j i * ) ^ytoul L»U' ® fO , * * «r -.tpui •" -ipiii oO i W i i Ci.u-m * l r ipui O r O ■ • f K ft •" -.I fun P i-ipiii of 1 9 frK t ■ p ij 1 3 '■> i • SR_££ 3 C ■.rfi«.: P -i piii i a ¥PIJHT ■p Ovtoiri ^ » ipy! ® t a ■ * SPljCLK 10 C *.t pm P l-ipiii op 1 * SPfJUlijp 1 1 ■l-vU'ul * pii' * t o ■ * 1 2 ■: c-.ii - r -,-- f c & i S R# TiP-TkhAi an >.i Figure 7. The radio buttons indicate the state of each pin. ble via the web interface) called ‘GPIO Service’. Another device on the network can use this ser- vice to control and read the GPIO pins using a simple protocol (see below). As already alluded to, the unit includes serial interfaces. Data can be transferred from these ports to the network using a separate TCP connection, or in the opposite direction: more details later on. Initialisation and data handling are done in the Serial module. A further service (‘Serial Server’) is responsible for listening on a (configurable) port for requests and data. Using the module For first experiments with the module it should be connected to a PC using a crossover patch cable. When power is applied the appli- cation program starts up, with the link LED lighting and the network activity LED blinking irregularly. The module will first try to obtain an IP address. By default this hap- pens over DHCP, but if no DHCP server is found, AutolP is used (see glossary). If a network error should occur during this phase, the link LED will start to blink rapidly. How do we know what IP address the module has acquired? A sim- ple way to find out is to use Bon- jour, a program developed by Apple which is now also avail- able for Windows (most simply installed as a browser plug-in, for example for Firefox i 5 l). An mDNS service runs on the module, which advertises the device’s presence to the rest of the network. Bonjour scans the network for devices running this service and displays the results in the browser (see Figure 4, left- hand part of the screen image). One click later and the web server responds by sending its home page. This can all be done without the user having to know the IP address of the device. The web server can serve up a variety of pages. The main page gives information on the device itself (version, IP information, network name and so on). There are also buttons to reset the module, stop it, and reset its settings (Figure 5). Under the ‘General’ menu it is possible (among other things) to change the opera- tion mode of the module (Figure 6). GPIO mode In GPIO mode the pins listed above can be configured as inputs or outputs via a web page, with the default setting being ‘input’. Unconnected pins should be prevented from floating either using pull-up or pull-down resistors or by configuring them as outputs. When the GPIO web page is loaded the radio buttons indicate the state read from the GPIO pins (see Figure 7), and then when the form is submitted the values are sent to the GPIO module. If required, the initial val- ues of pins configured as outputs can be stored in the EEPROM. The GPIO server module is active inde- pendent of the operation mode chosen, and other devices on the network can con- nect to it at any time using its simple text- based protocol. A tool such as Hypertermi- nal can be used to communicate with the server (using a Winsock connection specify- ing the network name or IP address as the host, and port number as configured). The GPIO web page gives each pin an ID code: this code is used in commands to the server in the form ‘ID=value’, terminated by a char- acter code in the range from 0x00 to 0x20. The ‘value’ can be ‘O’, ‘1 ’ or *?’, the ques- tion mark representing a command to the server to request the status of a port pin. The server replies to requests and com- mands with a string of the form ‘ID=0’ or ‘ID=1 ’. The special wild-card ID ‘x’ indicates that all GPIO pins are to be read or written by the request or command. For example, a request of the form ‘x=?’ will receive a reply of the form ‘x=1 234’, where ‘1234’ is a hex- adecimal value in little-endian format, that is, to be interpreted as bits in ID code order from right to left. Write commands work in an analogous way. 30 12-2010 elektor MICROCONTROLLERS Serial modes In UART mode the TX and RX signals form an asynchronous serial interface and are thus not underthe control of the GPIO mod- ule; nevertheless, the GPIO module can still be used to read the state of these lines. The baud rate can be adjusted via the web page that is reached by clicking on the ‘Serial’ menu item (Figure 8). The asynchronous interface can, with suitable level conver- sion, be used to connect to devices with an RS232 port. The serial server is active in this mode. Characters can be sent to the device over the configured port, and these are echoed over the serial port in 8N1 format. Likewise, characters received over the serial port can be sent to another device on the network. SPI is an interface that can be used to con- nect to a wide range of storage, display and other devices. When a suitable net- work connection is established with the serial server data can be sent using TCP / IP to the unit. In this mode it acts as an SPI bus master, which means that it initiates all SPI communications. When data arrive, it asserts SPI_CS (in other words, takes the signal low). Each data byte is then sent out bitwise SPI_MOSI, accompanied by a clock on SPI_CLK. Data are read back from a con- nected slave over SPI_MISO using the same clock for synchronisation. Bytes read in are then sent out over the TCP/IP connection. A zero byte in the data stream is used as a terminator. When the terminator byte is received over TCP/IP, the unit deactivates SPI_CS (by taking it high); the terminator byte itself is not sent out over the SPI bus. A zero byte that is to be transmitted to the SPI slave must be escaped by prefixing it with a backslash character (‘\’); the back- slash character itself is represented by two backslashes. No special escaping is applied to zero bytes received from the SPI slave. The web page for the serial interface allows a choice of clock frequencies (650 Kbit/s, 2.5 Mbit/s and 10 Mbit/s) and of SPI clock polarity (Figure 9). When operated in slave mode, the unit can work as a network ‘modem’ for another microcontroller. This microcontroller can, with the help of the unit, create and destroy TCP/IP connections (as client or server) as well as transmit and receive data. Further details on the additional protocols required for operation in this mode can be found in a supplementary docu- ment downloadable from the Elektor website. (100552) Internet Links [1] www.elektor.com/ 1 00552 [2] www.silvertel.com [3] www.mobacon.de/eWicht [4] http://en.wikipedia.org/wiki/ Bonjour_%28software%29 [5] www. bo njo u rfoxy. n et Ideas for future expansion • Extensions to existing functionality • Changes to format and content of embedded web pages • Special functions for use in control applications • Contact the author: schlender@mobacon.de Metzer Configuration aV'HTEM STATE CPHHfrN *5P !& ■ul Hill gjfctr Ski. 1-14 ■jam ni u - 3 ik;i> C-3P--jr. iiiingi C »adf SFlHiittr Wl.rsga ■I t’KfilHVCy ■■ b ■*! ■ I 9!ID 0 :.JCI tin Iran* dim vm fcrjivii Law UillrHIllJHI i/w I-., hqll 1 mi ii nijn ■■ Irifti- iqcL'j-s 'rtin IBB LIBS* IL lE-hr ® IrunsMl dttvi 4 ft lrmad»cft k«ah !■ ftvr tap- >.msp> «c O 1 At wrtrik q 1 dkfi iprjput 4 Mm 4 UpuL Figure 8. Setting the UART’s baud rate. Metier Confi g lt r □ t E 0 n SYSTEM STATE U APT ^itia’l-JI tDHPCiM >1 apt frPlO C cnnari SH cviiirrjic - ¥1 -HIJ.I «•** ‘3 1 ii-fc-Lj.irir fi$iri r , jr. s--. fcjw. ibb Fiat'S s Igw P Iran ml Cirrijri Irwin nr linn Ipw rp nrjn. lof* 5 ft{dh 'P' lrmir i oi Irwinrir iiari lorr ~o r jn. ■ Old- Liai-c s P lr wins r-cciyi an Irwinwir n-ar. n -]r. i-i gw, IBP- liai-*- * Ta %Ti "S-H Waa'Br C l-3Ck 1 ne j Jl ran l ■5 kt r ii* m du h # Al 1 fM ir drift &uqxii Figure 9. SPI settings are also found underthe ‘Serial’ menu. COMPONENT LIST Resistors (SMD 0603) rioi = iw\a R102 = 4.7l<£2 R103 = 1 kCl R104 = 2.26kft R105,R106 = 560£} R107-R1 10 = 49.90(1%) Capacitors (SMD 0603): 001-009= lOOnF Cl 10,0 11 = 33pF Cl 12= IOjiF Inductors (SMD 0603): FE101 =1k@100MHz Semiconductors IC1 = PIC1 8F67J60 (TQFP64), programmed, Elektor #100552-41 [1] IC2= 1 1 AA02E48 (SOT23) TR1 =10/1 OOBase-TX transformer, Halo N5 (SMD), PoE to IEEE 802. 3af Miscellaneous J1 = 8+2+2 pin RJ45 socket, w. 2 integrated LEDs JP1 ,JP2 = 1 0-pin SIL pinheader (lead pitch 0.1 in.) Q1 01 = 25 MHz SMD quartz crystal, HC49UP case PCB, Elektor# 100552-11 [1] or NetWorker module, ready built and tested, Elektor# 100552-91 [1] elektor 12-2010 3i LIGHT MEASUREMENT LEDs and Illumination How much light does that LED give? By Harry Baggen (Elektor Netherlands Editorial) LEDs are used increasingly for lighting applications. The manufacturers of LEDs outdo each other every week with announcements of ever increasing light output or efficiency. What use are all these numbers in practice and how can you measure, using only simple means, the amount of light produced by an LED cheerfully connected to a power source you just developed? Figure 1 . This drawing shows the relationships between the various light units. Despite all that generated light the world of LEDs is not very transpar- ent. It is not at all easy to establish whether LED from brand X is really bet- ter than that from brand Y for a particular application. -Jr' 3 “*•? I . V l ‘ . vJfcj. t ‘ ' ' _*■ 1 r y-r ' -> For this you will have to look at a number of factors. When browsing the data sheets published by leading LED man- ufacturers, it appears that in particular the gen- erated spectrum (the colour temperature for white LEDs), the viewing angle and the efficiency are the most important characteristics. In this article we will limit ourselves to white LEDs only and clarify a few concepts which are commonly used in the world of lighting technology. Concepts Table 1 . Colour temperature of various light sources. 1 200 - 1 800 l< candle light 2000- 2500 l< sunrise / sunset 2800- 3000 l< incandescent lamp 3200 l< halogen lamp 3500K 1 hour after sunrise 5600K standard daylight 6000K sunlight without clouds 6500K neutral white (standard setting for a PC-monitor) 7000- 1 0.000 l< heavily overcast without direct sunlight The total amount of radiated light from a light source is expressed in lumen. One lumen is the luminous flux of a point light source of one candela across a solid angle of one steradian. Expressed as a formula: 1 Im = 1 cd sr. The luminous intensity, expressed in candela (cd), is the amount of radiated light in a particular direction (1 cd = 1 Im/sr). This value is particularly important with LEDs and halogen lamps, because those are often fitted with a reflector or lens. The number of candelas is egual to the number of lumens per steradian. When a light source is fitted with a lens with a smaller viewing angle, then the light inten- sity will increase considerably. The luminance is a measure for the brightness of an object (expressed in cd/m 2 ) and has nothing to do with the light source, but depends on the structure of the object that is illuminated. An object with a darker surface therefore has a lower luminance then one with a lighter surface. 32 12-2010 elektor LIGHT MEASUREMENT Figure 2. LED’s are available with different radiation patterns (here are a few examples from Luxeon Star LED’s, ill. Philips Lumileds). Finally, illuminance is an important value. This is expressed in lux and indi- cates how many lumens strike a partic- ular surface (1 lx = 1 lm/m 2 ). The light intensity is important in offices, schools and other places of work, because there are legal guidelines for the illumination of such spaces. For example, the light intensity of a work space has to be at least 500 lux. Figure 1 shows the relationships between these units based on a desk which is illuminated by an (LED) lamp. Another important consideration when selecting a light source is the colour temperature of the light that is produced. The col- our temperature has a real influence on the mood of a space. White light with a higher proportion of red appears warmer and white light with a larger proportion of blue feels colder. Warm-white gives a cosier (some say, homelier) ambience, while cool-white is more appropriate for office work. The colour temperature of a light source is determined by compar- ing it to a black (platinum) body at a certain temperature. The col- our temperature is expressed in kelvin (K). Table 1 shows the colour temperature of various light sources. When selecting a particular type of LED, the designer has to balance a number of different considerations. How big is the surface that has to be illuminated? What is the distance from the light source to the object to be lit? What is the minimum light intensity that is required? And what is the purpose of the light (mood or work light- ing)? Based on these considerations it is already possible to make a good choice. What has not yet been considered is the efficiency. But here applies in general: the higher, the better. However, cost will play an important role here. In addition, when using the selected LEDs, any appropriate cooling requirements will have to be taken into account. In particular with the power LEDs presently available, a sizeable heatsink is often required to ensure that the operating temperature remains within acceptable values (see also the article about the 50-watt LED). Measuring light intensity yourself To measure the light intensity it is best to use a so-called light inten- sity meter or lux meter. These are equipped with a sensor which measures incident light across a solid angle of nearly 1 80°. For this purpose the sensor is usually fitted with a milk-white spherical cap. The sensor is simply placed on the surface to be measured and the Figure 3. A lux meter measures the amount of incident light across a hemisphere, (photo: Testo). elektor 12-2010 33 LIGHT MEASUREMENT Table 2. Conversion from shutter speed / aperture value to lux (at ISO 1 00) Aperture value 1.4 2 2.8 4 5.6 8 11 16 22 LUX 1/2 1 2 4 8 15 30 60 120 10 1/4 1/2 1 2 4 8 15+ 30 60 20 1/8 1/4 1/2 1 2 4 8 15 30 40 1/15 1/8 1/4 1/2 1 2 4 8 15 80 1/30 1/15 1/8 1/4 1/2 1 2 4 8 160 1/60 1/30 1/15 1/8 1/4 1/2 1 2 4 300 1/125 1/60 1/30 1/15 1/8 1/4 1/2 1 2 650 1/250 1/125 1/60 1/30 1/15 1/8 1/4 1/2 1 1,300 1/500 1/250 1/125 1/60 1/30 1/15 1/8 1/4 1/2 2,600 1/1000 1/500 1/250 1/125 1/60 1/30 1/15 1/8 1/4 5,100 1/2000 1/1000 1/500 1/250 1/125 1/60 1/30 1/15 1/8 10,200 1 /4000 1/2000 1/1000 1/500 1/250 1/125 1/60 1/30 1/15 20,500 meter indicates the light intensity in lux at that location. Such a device is very handy to establish whether there is sufficient light at a work place, but also to find out how bright that DIY torch with that super-LED shines. It does not make a lot of sense to buy a special lux meter (such as in Figure 2) for this purpose if you’re only going to use it a couple of times a year. An alternative for such a lux meter is something almost everybody already owns, namely a digital camera. These have, after all, a light meter built in (a real light sensor in an SLR and the CCD sensor in a compact camera, which also makes the image). The light meter in that camera can also be ‘abused’ to measure the light intensity in a roundabout way. A prerequisite is that your cam- era allows you to set the sensitivity manually and that the camera displays the selected exposure time and aperture on the display or in the viewfinder. With the aid of a few formulas you can calculate a light intensity value (expressed in EV = exposure value) from the shutter time/ aperture combination and then convert that into a lux value. We have already done all this work for you in Table 2. Along the top row, look up the aperture value indicated by your camera, then go down the column to the measured shutter speed and you will see the corresponding lux value on the right. Figure 4. You can also approximate the light intensity with the aid of a digital camera and Table 2. For example, if you would like to measure the light intensity at your desk, then point the camera at the desk and look at the values indicated by the camera (don’t forget to fix the sensitivity to ISO 1 00, since with many cameras the sensitivity is often automatically changed depending on circumstances). Also make sure that you are not measuring a bright white surface on the desk, because a cam- era is calibrated for measuring a neutral grey level, which means that the object to be measured reflects about 1 8% of the incident light. In the past, photographers would use a so-called grey card. You could put this in place of the object to be photographed and note what the light meter indicates. Unfortunately grey cards are seldom used any more and are also no longer being made. If you ensure that there are several different types of objects in the field of view, without too much white paper then the measurement will be quite close. As we already noted, this measurement gives a good approximation but not an exact value, a real lux meter is required for this. But you will nevertheless get a good indication of the light intensity. And that is already very useful in many cases! (100621-1) Introduction photo: LUXEON Rebel from Philips Lumileds 34 12-2010 elektor PIC 32 USB Starter Kit II By Luc Lemmens (Elektor Labs) Starter kits come in all shapes and sizes, although in the last few years the boards have become quite small and are powered and programmed/debugged via a USB con- nection. As you may gather from the title, this board also falls into this category: a small and relatively simple microcontroller system with three pushbuttons and LEDs to help you create your first ‘Hello World’ experience. Apart from the microcontroller board the kit also contains a CD with all required documentation and PC software for the development of applications. However, we’d recommend that you download the most recent versions of MPLAB C32 and MPLAB IDE from Microchip’s website. The MPLAB development environment is the same for all Microchip microcontrollers, which makes the move from their 1 6-bit or even 8-bit families so much easier. There is a free version available of the above-mentioned C compiler, which remains At fully functional for 60 days. During this ^ \ period there are no \ restrictions on the I size of the code I you can develop. J After this period the compiler remains / fully functional / although several code jr optimisation routines are turned off. This may not sound very drastic, but it can PIC* flrfCU to tfce power Of There is one big difference that makes this kit stand out from its contemporaries: a 120-pin connector is provided to make this board function as a processor module with a debug interface in a larger system. Microchip itself offers various boards to expand their starter kits, such as the I/O Expansion Board and the Multimedia Expansion Board, which makes it possible for these small experimenter’s boards to offer much more than several happily flashing LEDs. Microchip w-h ifrtonv'P IC33 The PIC32 family is designed around a MIPS32 RISC core. After extensive analysis by Microchip this architecture was found to be the most suitable type of core for these 32-bit microcontrollers Etfwmrt MAC Direct Memory Access Controller, With Integrated CRC Module... Operates in Idle Mode 32-bit MIPS M4K® Core, Harvard Architecture, Single Cycle Hardware MAC, Fast Interrupts & Context Switch f= M4K 3-2-bit Core m iMHz, 1.5 uMIRaJMHi 5 Stag# Pipeline, ALU Integrated Connectivity Peripherals for fast cost effective operation: 1 0/1 00 Ethernet, 2x CAN, USB OTG H-tot MW NklWGlV instruction Compatible with Microchip Development Tools MPLAB® ICD 3, MPLAB REAL ICE™, PICkit™ 3, PM3 Bus Matrix h OonlroHr Peripheral Bus Single 2.3 to 3.6V Supply Power On Reset, Brown Out Reset, Low Voltage Detection 14$ CamwriLiSgri Rich Integrated Analog and Digital peripheral set, Compatible with 16-bit PIC® Microcontrollers High Throughput Bus Matrix, which Supports High Speed Concurrent Access to Memories and Peripherals 512KB 128-bit wide Self-programmable Flash, Predictive Instruction Pre-fetch 256 Byte Lockable Cache 128K RAM 16-bit Parallel Master Port, Connect SRAM, Flash, QVGA LCDs or other Peripherals Flitch Compare elektor 12-2010 35 E-LABs INSIDE E-LABs INSIDE have an enormous effect on the speed at which the compiled applications run. There are free C libraries available for all peripheral blocks, which are fully compatible with the libraries for the PIC24 and dsPIC33 families. Apart from the CD, the starter kit also includes two USB cables; microcontrollers in the PIC32 family support USB On-The-Go (abbreviated to USB OTG), which means that they can behave as a USB host as well as a slave. For example, as a host it can read and write information from/to a standard USB memory stick, which makes it possible to upgrade the firmware without the need for a programmer or computer. Hence the two cables: one is used to connect to the JTAG/debug interface and the other is used to connect USB slaves to the processor board. In the block diagram for the PIC32 you can see how extensive and powerful this microcontroller family is. There is a choice of several peripheral blocks, the amount of memory and the package. The 32-bit processors from Microchip are pin and software compatible with their 1 6-bit family, which makes the migration to these new microcontrollers very straightforward. The modest price of about $55 (approx. £37) for this starter kit certainly makes it worthwhile to give these 32-bitters a go. ( 100614 ) Internet Link www.microchip.com/stellent/idcplg?ldcService=SS_GET_PAGE& nodeld=261 5&dDocName=en535536 MAC Addresses By LucLemmens (Elektor Labs) Network interfaces all have a Media Access Control (MAC) address, a unique code which allows them to be recognised on the network. The MAC address is usually shown in hexadecimal form, for example 0A:1 2:50:E3:2F:E8. In this numbering system (MAC- 48), as defined by the IEEE-802 standard, there are 281, 474, 976, 71 0,656 (256 6 ) unique addresses. There is already a new standard because there is the expectation that sooner or later this series of unique numbers will run out. Originally it was the intention that this code would be unique and permanent for every interface, but these days it is usually possible to change the MAC address in firmware (so-called MAC spoofing). Although it is, in principle, very easy to use any arbitrary address, this is certainly not the intention and entirely inappropriate for applications outside a local network. The IEEE records and distributes these MAC addresses worldwide and in this way ensures that no two addresses are the same. The first three bytes of an address indicate the manufacturer of the interface, these bytes are called the Organisationally Unique Identifier (OUI). The remaining three (in the case of the MAC-48 and EUI-48) or five bytes (EUI-64) are unique serial numbers allocated by the manufacturer. If you ever design a device with a network interface then you are not allowed to just make up a MAC- address or ‘borrow’ one from another application. A company or organisation can purchase an OUI from the IEEE for $1650, but it can also be done for less money by requesting an Individual Address Block (IAB) for $500. In the latter case you will only have 4096 addresses at your disposal, instead of the 2 24 of an OUI. The allocation of OUls and lABs is public knowledge, which means that, based on the first three bytes, anyone can find out what company or organisation produced the device. lABs can also be anonymous, which means that the IEEE collects an additional $1000 per annum. For the network interface that presented elsewhere in this issue we used a much cheaper and simpler solution: a small EEPROM from Microchip, which already contains a MAC address, whereby the manufacturer passes all administration and rights to the end-user. These memories are extremely useful for both small as well as large production volumes. Finally, there are also Ethernet controllers available which already have their own MAC-address built in. (100719-1) More information: http://standards.ieee.org/regauth/index.htmliterature t 5MAC i.O Professional Edition - KLC Consultin-g.: www.klcconsijllinE.niet Fie View QptKTrs I Airlrui ■ ilBaw Mam iPAddraja QIiC'B Yes Y'es E-!u siooih Persona: He work Iron TOSHIBA C P C- D lnrel(P£ POO/Wireless 291 5 AEG Network Conne... 192.1610.11)7 VMwnn 1 VirlnAl £0iinni il AtfSplQr Inr VMhi :1ft 19? 1 Eft 1 ? 1 P" cihijw Drily Affcvt MijIWi Hk AdnpiOii:i New Spoofed MAC Address j qd -| id -[ fe “| ai -| ne -| ai 1 1 HGI I At EflUIPt.lf-Mi CXlRPClRAl ItlN |(1[llllP€] Updone MAC Reslen Adapter Random Reffesli Spoofed MAC Address |0tM 0-FE-S I -DM 1 Artivfl MAT: Address. do-ioct-cc-Dtr^ Niilwi irk tlj nr in CJ i On ^jocoJ Aaa Connection HnrrWim ID bluetoo(h\n001£I(JD7 Altai! MAC CD 1 D CE EE OB PE CD SO DSP? BD 23 nn-hii-hfi-tamii-iBi Remove MAC IFtdniiq MAC List dormer Use dhis program :t ycjr own risk. We ore not responsible for any damage fra* may occur to any system. A ns program is notto be used lor any illegal or unethical purpose, pp not use this program rl yon do not agree wrtli v 36 12-2010 elektor RS485 Interface Extension R3 By Jens Nickel (Elektor Germany Editorial) The central heating meter described elsewhere in this issue is a clever device that can help you keep on top of your fuel bills by measuring the number of kilowatt-hours actually delivered by the heating system. As described in the article, it does this using just four temperature sensors attached to the central heating pipework. The signal from the sensors is conditioned by an analogue circuit and then digitised using an A/D converter in a microcontroller; PC-based software then does the neces- sary calculations and provides a display of the instantaneous system heat output PI. It should go without saying that the wires from the tempera- ture sensors to the conditioning circuitry should be kept short. However, there could easily be a distance of up to several tens of metres separating the signal levels, not protocol details nor even a connector pinout.) This meant that there was still one piece missing: on the PC side some kind of adaptor was needed to take the RS485 sig- nal levels and convert them into bits to send over a USB inter- face. Good news, then, that this issue also happens to contain a USB to RS485 converter (see ‘USB to RS485/RS232 Converter’ and t 2 ])? Not so fast: it soon became apparent that the two cir- cuits were not compatible with one another. Juan Canton from Mexico, who designed the adaptor, had assumed that an RJ45-type cable would be used to carry the RS485 signals, and so equipped the device with a suitable socket. These cables have enough conductors in them to allow full-duplex communication using two transmitter pairs and two receiver pairs. Economising on the use of these pairs was not the designer’s primary concern. In contrast, the central heat- microcontroller from the host PC. Designer Falko Bilz there- fore decided to use an RS485 interface which, because of the symmetrical signal levels employed, enjoys particularly good noise immunity even at high data transfer rates. In addition, he implemented a digital protocol to allow tem- perature data to be sent over the cable to the PC at up to 1 1 5 kbaud and to allow the PC to send commands back to the temperature sensors. (The RS485 standard only specifies ing meter uses just two data lines which are used alter- nately to communicate tem- perature data and commands (half-duplex operation). Ele- ktor designer Ton Giesberts, who shepherded the pro- ject through our labs, faced a problem: how could he make the RS485 adaptor (for which a printed circuit board had already been prepared) sup- port half-duplex operation? Looking at the circuit diagram (see the ‘USB to RS485/RS232 Converter’ article to follow elektor 12-2010 37 E-LABs INSIDE E-LABs INSIDE for yourself), Ton realised that con- necting together the A and Y and the Z and B signals on the LTC1 535, the device in the adaptor responsible for sending and receiving RS485 data, should not cause any problems. Ton needed to add an RJ45 socket at the heating meter end anyway, so that he could use a standard cable (the circuit diagram and printed circuit board just provided for a simple pinheader), and so it would be easy to make the extra connections between the data lines at that point. This possibility is shown in the circuit diagram of the heating meter: the figure here shows the rel- evant part. However, this is not the complete solution. Somehow the LTC1535 needs to know whether data are being sent or received: the DE pin on the device must be taken high when transmitting Dl and low otherwise. Fortunately the other device in the circuit, an FT232R from Glasgow- based company FTDI, comes ready- equipped with a suitable output H. When the USB-TTL converter receives data from the PC to be passed on by the UART, it takes its TXDEN output high. In the device’s default configu- ration this function is on pin CBUS2. A few board modifications later (cut the track between VCC and DE on the LTC1 535, add a wire link from CBUS2 on the FT232R to that pin instead) and the USB serial converter works in half- duplex mode! The reply from Falko Bilz was, to put it mildly, surprising: for him, the two devices worked perfectly together. Were we looking at a timing prob- lem, which happened to have made itself known only in our lab? The FTDI chip takes the TXDEN pin high exactly one bit period before transmission starts, and according to the datasheet this tight timing is not configurable. Had we used the wrong FTDI driver software? In any case, the only way to proceed was to investigate the problem on Ton’s computer. Two days later the prototype and adapter were back in our hands. We connected everything together and again, on starting the PC software, no temperature graphs appeared on the screen. The next step was to check the situation with the FTDI driver. We called on our col- league Antoine Authier, connoisseur of all things Scottish from silicon to single malts, and with a few deft clicks of the mouse this possibility was elimi- nated. He then turned to testing the communications in more detail and fired up Tera Term, a terminal emu- lator program popular in our labs because of its robustness. In order to see anything, he needed to configure (virtual) COM port COM4, which Ton had selected for use with the heating meter, to run at 1 1 5 kbaud. And in another window, as if by magic, a temperature graph appeared! We have shown the modifications in blue in the circuit diagram. It is a pity that the board design for the converter had already been completed, or else we would have added a couple of jumpers (for the A-Y and Z-B connections too) to make it easy to switch between full- and half-duplex modes. Of course, we needed to test these modifications. Ton plugged in the cable, powered up the central heating meter, started up the PC software etvoila... nothing happened. What was wrong? Had we missed something or made a mistake in the configuration? The oscilloscope confirmed that commu- nication was going on in both directions, but nevertheless the heating meter software steadfastly refused to plot a tempera- ture graph. Antoine’s curiosity was piqued. He knows a bit of C++, and soon had the source code of the PC software up on the screen. It didn’t take long to find the problem: when changing the COM ports in the menu the program did not then call the function to initialise the settings for the new port: the settings were only initialised when the program started up, with the port set to its default value of COM1. And Falko Bilz had still been working on the software while we were running our tests, and had only used COM1 in his test environment. Sometimes life can be so simple! (100369) Time was pressing, as we were only three weeks before the copy deadline for this the December 201 0 edition. We quickly wrapped up the heating meter prototype and modified con- verter, put them into a box and sent them back to the designer in Falkensee, near Berlin. [1] www.elektor.com/090328 [2] www.elektor.com/ 1 00372 [3] cds.linear.com/docs/Datasheet/1 535fb.pdf [4] www.ftdichip.com/Support/Documents/DataSheets/ ICs/DS_FT232R.pdf 38 12-2010 elektor Subscribe now to the leading US-based computer applications magazine specializing in embedded systems and design! Bu'fUi an tocra'H fctfio Lng^kng p. 1%. H f Vm* fcW W*** 1 ■ P' — * CUtCWl ttVL® Tt*0* J IM.OG TORWWStS. N A. PVT>P Phased- Atra\ Analog P lont Pnd Smmd Generation vj'ith Three Basic Chips «S£SS3B« Diktat A» iio Svctuum ■\na\yxet «onaV GtottndVoS, 9T24 £ CCI Select your personal subscription at www.elektor.com/cc-subs 12 editions per year for just Print: $63 Digital: $38 Print + Digital: $90 CIRCUIT CELLAR J TE-LE MAOAZ1NE FOR COMPUTER APPLICATIONS HOME & GARDEN Heating System Monitor Add-on for thrifty consumers By Falko Bilz (Germany) Usually you can tell how much energy your heating system has consumed by checking your utilities bill, but what if you want to know how much heat it actually delivered? This clever design from one of our readers measures the actual heat output and doesn’t require any modifications to your central heating system. It also has a built-in control function for the circulation pump, which helps you reduce your environmental impact and keep your bank balance healthy. Heating bills often present unpleasant sur- prises. Despite your best efforts to econo- mise on heating, they list tidy sums for elec- tricity or gas consumption. In this article we describe a relatively easy way to check these values and monitor your consumption almost continuously. All you need in order to determine how much heat your system delivers is four temperature sensors, a bit of wiring, and a microcontroller. There’s no need to delve into the electrical or hydraulic components of your system or modify any ofthem. A bit of theory As many readers probably remember from their physics lessons, it’s easy to calculate the amount of heat transferred to a medium such as water. It is given by the product of the temperature change AT, the volume V of the medium, and the specific heat capac- ity C v of the medium. The power P, which is amount of energy transferred per unit time, is: P = ATxCyxV+At With a fluid medium, the term V+ At can be interpreted as a volumetric flow V/At. This value can be calculated directly from the flow velocity v of the medium and the inner diameter r of the pipe. In a central heating system, the temperature difference AT is simply the difference between the supply (S) and return (R) temperatures. This yields the formula: P= (T s - T R )xC v xvx7i;r 2 The temperatures can easily be measured with suitable sensors. Flow transducers are available for measuring the flow veloc- ity, but installing a flow transducer always requires drilling a hole in a pipe or opening up the piping to insert a fitting. Figure 1 . Signal level versus time for two temperature sensors mounted on the heating system supply line some distance apart. Measuring principle Here we used a different method to deter- mine the flow velocity. We make use of the fact that the supply and return tempera- tures always vary by at least one to two degrees due to the operation of the con- trol system. If pairs of temperature sensors separated by a few metres are mounted on the supply and return lines, the flow velocity can be determined from the time offset of the variations measured by the two sensors. Figure 1 illustrates the measuring principle, using a temperature increase as an example. As the water flows through the pipe with a Figure 2. Cable ties or other means can be used to attach the sensors to the heating system pipes. 40 12-2010 elektor HOME & GARDEN speed of only a few metres per second, the temperature at sensor position S2 rises somewhat later than the temperature at sen- sor position S, which is closer to the boiler. An ATmega microcontroller constantly acquires temperature data from the two sensors. The time delay between the sig- nals from a pair of sensors is determined by a correlation algorithm in the signal pro- cessing software, which shifts the signal waveforms from the two supply line sen- sors relative to each other until they virtu- ally overlap. The temperature signals from the sensors on the return line are correlated in the same manner, and ideally the time offsets obtained for the supply and return lines should be the same. To increase the sensitivity of the system, the return line sensor signals are applied to the inputs of a differential amplifier, and the resulting difference signal is amplified. This difference signal is also logged as a function of time. The area underthe curve of the dif- ference signal is a measure of the time off- set of the temperature variations. Various means can be used to attach the temperature sensors to the heating pipes (see the ‘Sensors’ inset), including cable ties (see Figure 2). The accuracy of the measurements can be improved by apply- ing some thermal paste between the sensor and the heating pipe. When you relocate, the system can be removed without leaving any traces behind. Hot water please If the heating system is also used to supply hot water for domestic use, additional pipes are used for this purpose. For this reason, the PCB designed by the author includes inputs for additional temperature sensors. It also has a switched output for driving a relay that can control a circulation pump. Under certain conditions, controlling the circulation pump can save you a lot of money and significantly reduce C0 2 emis- sions. This is because some systems have constant hot water circulation so users can draw hot water from the tap immediately. This costs electricity to power the pump, and energy is also lost through the pipe walls. This can be remedied by the author’s circuit, which switches on the circulation pump for only a short time after the hot water tap is opened. This is detected by the temperature difference between the hot water and cold water supply lines. Figure 3 shows where the six temperature sensors should be fitted. It is important to ensure that there are no active branches between sensors S and S2 on the supply line or between sensors R and R2 on the return line (German Rucldauf, RL). By contrast, three- way valves between the two sensor locations are not a problem as long as they are closed while measurements are being made. Circuit description The easiest way to understand the sche- matic diagram (Figure 4) is to follow the signal path. It starts at the temperature sen- sors connected to the circuit board, which are NTC silicon devices. Their resistance var- Sensors The sensors should have the smallest possible time constant so the temperature variations on the outside of the heating system pipes can be measured as accurately as possible. Several suitable sensor types are listed in the table. The stated time constants assume good thermal con- tact and indicate the time required for the sensor to reach the 63% level of a step change in temperature. Type Time constant Package KT130, KT230 1.0s SOT-23 KTY13, KTY23 1.0s SOT-23 KT110, KT210 1.5s T092-mini KTY1 1 , KTY21 1.5s T092-mini KTY 81-210 3.0 s T092 The sensor resistance should be as high as possible, since this allows the impedance of the voltage dividers to be kept high and thus reduces the self-heating of the sensors. All of the listed types have a resistance of around 2 l<£2 at 25 °C (77 °F). They are also less expensive than other varieties of sensors, such as Pt2000 platinum sensors, while offering comparable long-term stability (which is what matters here). The disadvantages of silicon temperature sensors - a nonlinear characteristic and an absolute error of up to 3% - can be circumvented by a one-time calibration process. The effects of all other non-varying sources of errors in the circuit are also eliminated by calibration. elektor 12-2010 4 i HOME & GARDEN Figure 4. Schematic diagram of the system. The opamps are used as comparators, impedance converters and differential amplifiers. 42 12-2010 elektor HOME & GARDEN Figure 5. The USB to RS485 converter described elsewhere in this edition can be used to connect the board to a PC. See the ‘E-Labs Inside’ section in this issue for information on converting the adapter to half-duplex mode. ies by around 0.7-0. 8% per degree K change in temperature. For example, the resistance of a KT1 1 0 sensor is approximately 1 .7 k£l at 5 °C and approximately 2.8 l<£2 at 70 °C. The sensor for supply temperature S (Ger- man: VL) forms a voltage divider with resis- tor R37. This is followed by a simple low- pass filter formed by R36 and C20, which filters out induced AC hum. U4a amplifies the sensor signal by a factor of approxi- mately 8. The TL2264 used here is a rail- to-rail opamp, so the output voltage can assume almost any value within the supply voltage range. This increases the absolute measurement accuracy, since the full out- put signal amplitude is used. U4a naturally needs a reference voltage on its inverting input. This is provided by the combination of R20, R26 and R27. U5b acts as an imped- ance converter to minimise the load on the voltage divider. The input stages for the other temperature sensors have a similar structure. The com- ponent values have been chosen to yield a measuring range of approximately 8 to 70 °C for five of the sensors. The reference voltage for the sixth sensor, which is attached to the cold domestic water line (cold-cold, CC), is somewhat lower and is buffered by U5a. The measuring range of this temperature sensor is approximately 2 to 70 °C. The analogue signals are fed to the A/D con- verter of the ATmega328. The converter’s reference input is connected internally to AVCC, which means that all analogue signals are reference directly to the supply voltage. Consequently, the supply voltage does not require elaborate stabilisation. If you want to know more about factors that may affect the measurement accuracy, you will find a work- sheet in the download file for this project. The R (German RL, Rucklauf) and R2 (Ger- man RL2, Rucl tzv- v-z dttrc - “ ■ z «■ ass -:r sv I-P P 8 # S. V *P*h mm w i- u f»# PM**** sm c* -a-jc D'i m“d 1. Otin c j-h, L p Immi, ■ ■ P I . ' H f -H PPPTPP Pf ■"-* - d^JLlocic.# Mrvi Irani fVkiflr: DVD Jimife rafenftm UnL T . Trf T ■«- *"• - --• trrr * ^ t T‘1 m i IffWt ■» U 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 WWW. elektor. com wm ratlin Thf ivIo^st Oompi rrr Atmti m IT Ga av« nrv k; it avah Am r! nurve naTtuorKS luc J k X .Hr WWW.XG AM E^IMLOMsADM elektor 12-2010 45 LED GADGETS 4 U As a special treat for this holiday season, we have made an overview of a number of useful, handy or just plain interesting gadgets, all if which make use of LEDs. Enjoy reading, wondering and finding out about them. And make sure you show these pages to family and friends, if you would really like to receive any of these items as a gift. Samurai watch You do not wear a watch just to know what the time is; it is also a piece of jewellery and a fashion accessory. If you are looking for a watch with an unusual shape then you have plenty of choice. But what do you think of J // LED vehicle lights LED replacements for incandescent lamps at home are already well known. But now there are also LED replacements for the light bulbs in your car. While these lights come in many different types and shapes, the manufacturers of LED replacements have been resourceful enough to figure out how to make a replacement for nearly all of them. Only for the headlights they haven’t (yet) succeeded. You just need to find the correct type and replace with an LED version that has the same terminals and equal light output. After that you will probably never have to replace any lights again, the life expectancy is given as 50,000 operating hours! More information: www.go-greener.eu/shop/index.php?main_page=index&cPath=1 6:H8 ' MfiS this sturdy watch that, according to the manufacturer, is made from the same steel as that used in Japan to make the legendary Samurai swords. Well, we probably should take that with a substantial pinch of salt, but it nevertheless looks quite nice! This watch indicates the time using red or blue LEDs, where the LED segments are hidden between the links. So it appears that you are just wearing a bracelet, that is until you press one of the buttons and the time or date appears. The watch is easily adapted to different wrist sizes by removing one or more links. More information: UK: www.chinavasion.com/product_info.php/pName/iron-samurai-japanese-inspired-red-led-watch/ More information: www.thinkgeek.com/homeoffice/lights/b25a/ Christmas boards Where did we see these before? Indeed, several years ago now, Elektor published a Christmas tree and other Christmas decorations using LEDs and even sold those as kit sets. It is still a very nice idea to put something together from a couple of circuit boards, which is decorative and gives off light. In this case it is a candle holder with 9 LEDs and a small Christmas tree with 1 6 flashing LEDs. Both are built from two pieces of (green) PCB material which are slotted together. A 9- volt-battery is inserted in the base and functions as the power supply and also gives it some additional mass for increased stability. With the candle holder you have a DIP-switch so you can set which LEDs are turned on. The Christmas tree is a little more expensive than the candle holder, but you do get a few more LEDs. Box shaped time There are unusual clocks, not only based on their shape and appearance, but also with regard to the manner in which they display the time. Digital clocks with numbers are nothing special, of course, but there are always the inventive types who forever dream up new methods of indicating time. This TIX LED-clock is not of the type that displays the time in binary code, but just uses the decimal system with the aid of a number of illuminated boxes (the photo shows 12:34). A nice feature is that the boxes will illuminate in a different pattern each time. In addition, we like the beautiful tight styling, a very nice present for the holidays! More information: www.thinkgeek.com/interests/giftsforher/7437/ 46 12-2010 elektor LED GADGETS 4 U Programmable jewellery More information: www.ilovepix.com/en/htm/main.htm The PIX is a type of pendant that can display various kinds of pictures and texts on an LED matrix consisting of 1 77 red LEDs. You can program the text and pictures yourself using a computer and also add various effects, you can even write messages in the air by swinging it. The programmed images can be uploaded to the PIX using a serial connection. The PIX is, however, more than just a little LED screen, you can even exchange information via an infra- red connection with friends and acguaintances who also have a PIX. There is now also a PIX Sports, specifically for the active types among you. L You have e-mail E-mail notifiers are handy programs which display an indicator in the system task bar or on the desktop when new mail has arrived for you. Nowthere’salsoa hardware version available, the USB Webmail Notifier, which makes it even more obvious that new electronic mail is waiting for you. The semi-transparent block in the shape of an envelope is connected to the PC via a USB cable and lights up when new mail has arrived. Depending on the type of mail you can make it turn blue, red or green. The gadget works with pop3 mail severs, Outlook, Outlook Express and web-based e-mail from Yahoo and Gmail. More information: UK: www.usbgeek.com/prod_detail. php?prod_id=0922 [ I Illuminated chess board Chess is of course the ultimate mind game. But you don’t necessarily have to be able to play chess to appreciate a nice chess board. There are elaborately decorated chess pieces and boards that could easily become a nice ornament in a room. The special feature of this handsome glass chess game are the LEDs that are housed inside the chess pieces and are illuminated when they are in the vicinity of the chess board. It’s very nice to look at, both during the day and at night. The board is powered from a mains adapter or four AA-batteries. More information: www.epartyunlimited.com/ led-glow-chess-set.html Smiley for car drivers Are there times when you would like to communicate with other motorists when you’re on the road? And no, we do not mean gesturing with a finger when something doesn’t quite go right... This is very easy with the Drivemocion and a lot more civilised. This LED-display can be attached to the rear window with a suction cup and using a wireless remote control you can select the desired symbol from the driver’s seat. No, everything remains quite clean. The adjacent photo shows the five symbols that can be displayed. The display is powered from batteries, so an additional power supply connection is therefore not required. Note: this unit may not be road legal in all countries. More information: UK: www.find-me-a-gift.co.uk/drivemocion-led-car-sign.html elektor 12-2010 47 RADIO Elektor DSP Radio Scanner Monitor, Log and Scan By Burkhard Kainka (Germany) Anyone with an interest in radio DX-ing whether it be long wave, VHF or anywhere in between are faced with the same questions: which aerial is best? What time of day can I best receive a particular broadcast station and where did all that noise come from? The versatile Elektor DSP radio is supremely suited to answer these questions especially with this new PC based scanning software. LEQ ■susiii'j w cqr 1 riil .*■ 1 J J p r £■*? n OO J ,_! j" y i_i j_j I (■if. IT 1 Kfjlfl Ul - IT* 1 m Table i. Band scan data: Frequency, signal strength (RSSI) and SNR. 11600 32 0 11605 28 0 11610 35 0 11615 60 25 11620 37 0 11625 28 0 11630 32 2 11635 28 0 11640 28 0 11645 34 2 11650 31 0 11655 42 11 11660 28 0 The successful DSP radio project featured in the July & August 201 0 edition of Elektor lends itself easily to adaptations of its oper- ating mode. The DSPscan software pre- sented here runs on a PC and controls the DSP radio, using it as the front end to a rudimentary RF spectrum analyser. It plots band occupancy showing received signal strength (RSSI) and signal to noise ratio (SNR) of signals in the band selected and can be pre-programmed to scan at sched- uled times. The scanned band width can be set at say 500 KHz or 3 to 23 MHz. Medium wave and VHF bands can also be scanned. The DSPscan program (Figure 1 ) writes the measurements to files (Table 1 ), which can then be archived. The information includes time, date and start frequency of the scan. The band start frequency can be entered by hand or press the appropriate band scan button. Although the band from 3 to 23 MHz can be scanned the process takes over an hour to run. It may be more conven- ient to set the scan width to just 500 KHz around an area of interest. Clicking on the ‘AutoScan SW’ button begins an automatic sequence of measurements on all bands from 75 to 1 6 m with the scans starting on the hour. The program can be set to run the whole day long if necessary so that later you can come back and analyse the captured data. Anyone there? Tuning in to shortwave broadcasts can at times be a little frustrating; often there is so much noise that hardly any stations are intelligible. At other times you can pick up stations loud and clear from the other side of the world. The variation can be enormous and it makes you wonder whether this is due to poor propagating conditions, aer- ial setup or your receiver. The Elektor DSP radio is helpful here because it shows the received signal strength and SNR along with the received station frequency. Don’t be too disappointed if when you first try out a new short wave receiver there is nothing but noise to hear. You may think that the receiver has really poor sensitivity but there may in fact simply be no transmit- ters active on that particular band at that time of day. Two factors are at work here; firstly the RF propagating conditions and noise levels in each band are different depending on the 48 12-2010 elektor RADIO time of day. Secondly the majority of sta- tions are programmed to transmit at spe- cific times on certain bands where experi- ence has shown that the propagating condi- tions will be favourable. There is little sense in pumping a 1 00 kW signal into the ether if it becomes so distorted and masked by noise that no one hears it. The radio stations forming the mainstay of short wave transmissions are mostly gov- ernment controlled. In countries receiv- ing these broadcasts they may be inter- preted as unwanted propaganda and in some cases the stations are subjected to electronic countermeasures (spot jam- ming). The authorities responsible for the broadcasts will stress that they offer an alternative interpretation of world events. If you do happen to tune in to a broadcast in some exotic language you can be fairly sure that its source is either the BBC World Service (UK), Deutsche Welle (Germany), CRI (China) ora station sponsored by either the US or Russia. In the current economic climate government departments are under ever more pressure to cut costs and this is likely to lead to fewer radio broadcasts and reduced schedules. The majority of shortwave activity takes place in the evening; this is when listeners are more likely to find spare time to listen in. The coverage that a transmitting station can expect to achieve depends to some extent on the wavelength of the broadcast signal. During daylight hours transmission on the higher freguency bands will achieve greater coverage, at night the lower fre- guency bands are better. RF noise is another important factor to consider; a large pro- portion of this is due to atmospheric noise and interference from unsuppressed elec- trical eguipment. Atmospheric noise is pri- marily a product of all the electrical storms occurring around the world. Satellite data suggests that globally there are on average at least 30 lightning discharges per second! This noise is dominant in the lower bands and is at a minimum around 20 MHz (Fig- ure 2). In the 49 m band a noise figure of 30 to 40 dBpV (up to 100 pV(!)) with AM broadcasts and using a long wire antenna is completely normal. The transmission - I Ichior Hadis SW Scan r _ C '* | 41 JluV a id . I .. L I . jj snr IE * 1 E Km 4k fm ...23 HHf £*»■*>! mi Ml, omm or.™i Figure 1 . Scanning the 31 m band. L ItidlsUiSi'^nV/U 3 7,^10 : ^.IkI W in 4 a a id 4 aiL 1 l ill. Jt it . 1 il ..It : ill* SNR uhmvnuiz )!■ 25. Urn Ih. Ih S«i ...23 HHx Shnr...23HHt Sew SJM 7*1 Mix Shin Ml 1 701 Ut± Vxjn OH UIlF Uwwll7>lMMIr ® O H1U* QOlUl Drum Figure 2. Antenna noise and wanted signal between 3.5 MHz and 23 MHz. a id 4 ! ' 1 SNR JfUB Q LihDWtftiUlZ Ki 4k tin Bin J "-J . 2 2m 19. 1 Em Slw.. 23 HHx S(mr...23MHt Swi Ml 1 7*1 Mix Shm Ml 1 mi Mix =*« ttjrim Mrx ©raut Otwi a amt Figure 3. The 1 6 m band at 1 6:00 Hrs. should produce a received signal strength of 60 dBpV (1 mV) for clear reception. The receiver performance can be assessed in a simple test with the DSP radio: Disconnect the aerial; the radio will indicate a received signal strength of 0 dBpV or 1 pV inherent noise or less for most freguencies. Now reconnect the aerial and tune to an unoccupied freguency. If the noise rises by more than 1 0 dB then the receiver has sufficient sensitivity and the antenna length is adequate. This is true for every radio however auto- matic gain control (AGC) makes it difficult to get a true measure- ment. Practically none of the mod- ern day receivers suffer from poor sensitivity. It is often difficult to separate the receiver performance from the received SNR. The advan- tage of the Elektor DSP Radio is that received signal strength is indicated on the display. Keep the noise down The value of received signal strength is not as important as the received signal to noise ratio. Tun- ing into the 1 6 m band (1 7.480- 17.900 kHz, Figure 3) during the day you will pick up quite a few stations which despite their low RSSI (30-40 dBpV using a long wire antenna) are still quite intelligible. The atmospheric noise on this band is distinctly lower. You will most likely find several China Radio International (CRI) stations trans- mitting on this band. On mainland China the higher frequency bands are used quite intensively because of their good propagation characteristics over long distances. The bands below 10 MHz are practically empty. In addition the upper bands suffer less fading. Medium wave reception can be afflicted by interference especially during daylight (Fig- ure 4) but at night things really liven up and you can pull in many distant stations with a good signal to noise ratio (Figure 5). Signals above 161 1 kHz are most likely to be pirate radio stations. A question often posed is why can’t we pick up Radio Luxembourg nowadays when in the 1 970s it was loud and clear? The most likely explanation is the rise in RF noise. The countless number of domestic energy saving lamps, switch mode regulators and digital electronics etc in the environment undoubtedly contribute to the levels of elektor 12-2010 49 RADIO Figure 4. The medium wave band at midday. Figure 5. The medium wave band after sundown. Figure 6 . An indoor scan of the VH F band. ■- T I f kl c r DSP H.tfliG V«l . FM 1 r~ (S> idcmi kHz 1 kHz U him 2 RflHU kHz wiph £ 3 35104 kHz won 4 4 atwn HI/ UMILTIPH 5 ■amo MHa WDH i & 101 MO kl l.i won 4 t iua™ Ml/ LlHfi D ir»un kHz OIF s 103344 kl 1 j lunhh-m in ilJbJJUC HI/ Lika II inti 7 no kHz IIIW IZ a?G44 kM» ilD-in-ftrl-jl 13 ilHNJH kllz Wuppeital H RTDOa Uh M'uMmim li 1 QG7GG kHt ObmfcMiin _ tft SHOTO kllz UiHitaiFjj 17 Rfcion kHj- TB LMG04 kkl* (Inshlwroh. r r'[x (PL# if AlH f HH !iH II .vin IPX | *44 HI* «il AM 1 IB kHz DUr 2 IHi ntF 3 ■Mi] kHz DDCW5 4 ■ kHz WUHZ 5 ROTH kHz nw E GQ44 kHz DU 7 baw kllz HHW 0 kHz 3 asHO kHz to ns so kHz a™ II M75 kHz IZ 3005 kHz IS b*ni kHz M fifMO kH t Urn, Pi GUM kHz IS kHz 17 J375 kHz Rt* rs kH? Thnnakinitu Figure 7. Logging the receive data. electrosmog. During the day it makes it practically impossible to pick up any distant stations unless you live on the top of a mountain, miles away from a connection to the national grid. Maybe that is a little bit of an exaggeration but often you can find around 10dB improvement by siting the receiver in a more rural location. Of neces- sity and comfort most people lis- ten-in in an urban environment, in this case the aerial of choice should be either a ferrite rod or loop antenna, both of which often have better noise rejection proper- ties compared to the alternatives. Try it atVHF Noise also plays a big part in FM reception. A band scan will give a good insight into what is actually going on in this band. Figure 6 shows that the antenna and the RF input stage are in resonance for the band because the background noise shows a maximum at around 100 MHz. With the antenna sited indoors the level of interference is generally too high to be able to receive many stations with an acceptable SNR. Out in the garden the same receiver and antenna will pull in weaker and more distant stations. The situation improves even more if you go further afield, away from buildings and habita- tion, and best of all at the top of a mountain. Here you get the chance to pick up really faint stations. Sen- sitivity should not be a problem. You can confirm this by trying out a short 1 0 cm stub antenna. As you might expect the received signal strength is lower but unwanted noise is also attenuated so overall the SNR does not really suffer. DSPscan The DSPscan program is a good tool to compare propagation conditions between receiver bands. It will not however show information about an individual station. The PC program written for the Elektor DSP radio (September 2010) has been modi- fied to simplify the transfer of received sig- nal station data. The new program is called ElektorDSP2 (Figure 7) and can be down- loaded for free from the project page on the Elektor website PI. Along the top margin of the program window we can see informa- tion indicating the frequency, station name, received signal strength and SNR of the sig- nal. A click on the ‘log’ button saves the dis- played data into the log.txt file (Table 2). This information can be automatically logged at intervals of 1 0 s or 60 s by click- ing on the appropriate button. The stored data can be useful to document received signal fading, see for example figures for the short wave station Deutsche Welle (DW) in Table 2 operating on 6075 kHz. ( 100706 ) Internet Link [1 ] www.elektor.com Table 2 . Data in log.txt 28.08.2010 19:21:57 6075 kHz DW 52 dBuV 15 dB SNR 28.08.2010 19:22:07 6075 kHz DW 49 dBuV 12 dB SNR 28.08.2010 19:22:17 6075 kHz DW 42 dBuV 3 dB SNR 28.08.2010 19:25:37 9420 kHz Thessaloniki 66 dBuV 25 dB SNR 28.08.2010 19:25:47 9420 kHz Thessaloniki 70 dBuV 25 dB SNR 28.08.2010 19:25:57 9420 kHz Thessaloniki 64 dBuV 25 dB SNR 50 12-2010 elektor TO DISCOVER. ^c^tor-_P^ no* them* EVtH more 10 {liSttWtft. *"1 + Low power tor LETTHE SCEPTRE RULE! A 32-bit ARM 7 tart prototyping iy£i«n design for AM R appitations + LED Mixer with DMX interface + Linux on a th'ip + parking Radar Ultra-compact ... modulod The upgraded Elektor-PLUS subscription! o All 1 1 issues including the Summer Circuits edition O Included in your PLUS subscription: Annual DVD 2010 o 20% cheaper than normal retail price ' NEW: When taking out an Elektor PLUS subscription you get exclusive access O O o o o Welcome gift worth £25 Up to 40% discount on selected Elektor products 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! to 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 pre- ceding ones). With a simple click you download the complete issue (front to back!) or any single article. www.elektor-plus.com also sup- plies the most extensive Elektor search engine found on the web. However the upgraded PLUS subscription offers many more interesting extras like free E-books and supplementary articles. www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. COMPUTERS Stroboscopic PC Fan No flash in the pan A PC case with a side window gives plenty of opportunities for pimping the machine out with visual effects. Stand out from the crowd with the fan stroboscope circuit described here: based on an Atmel microcontroller, it drives an LED in such a way as to make the vanes of the fan seem to stop, turn slowly backwards or forwards, or suddenly change position. By Martin Ossmann (Germany) The idea for the circuit came to the author when his son bought a new computer. The case had a window in the side through which the gleaming components could be admired, but something was missing. An eye-catching centrepiece to the machine was needed, and the idea soon evolved into a plan to illuminate the CPU fan with a stro- boscope using power LEDs. By flashing the LEDs with the right timing, it would be pos- sible to make the fan appear to stop or turn slowly backwards or forwards. The author’s YouTube channel has vid- eos showing how effective the illusion is: search for ‘Ossimodding’ PI. All about fans PC fans come in all shapes, sizes and col- ours. Figure 1 shows the construction of the simplest modern design. Drive is by a brushless DC motor with two windings controlled by a dedicated 1C. Typical driver ICs are the ES21 1 t 2 l and the US890 and US891 PI, which also include a Hall sensor to detect the position of the rotor. To get a proper stroboscopic effect, the flashes of light illuminating the fan must be synchronised with its rotation. For PC fans with a three-wire HI or four-wire t 5 l connec- tion, this is relatively easy, as they have a special output (called the ‘tacho’ output) that delivers typically two pulses per rev- olution. Some fans deviate from this ‘Intel 52 12-2010 elektor COMPUTERS PWM 0 Pulse 0 Pulse 0 + 12 V 0 + 12 V 0 GND 0 GND 0 100127 - 12 Figure 2. Pinouts of three- and four-pin fan connectors. Figure 1 . The secrets of a fan: two coils and a dedicated control 1C. standard’ and deliver three pulses per revo- lution; the necessary software modification to deal with this is given in the download for this project. Figure 2 shows the pinouts of the three- and four-pin connectors normally used, in each case an extension of the classical two- pin design providing just +1 2 V power and ground. The three-pin connector adds the tacho signal, which is an open-collector out- put from the fan. The PC motherboard will normally include a pull-up resistor to the +1 2 V rail, and this is taken into account in the design of our circuit. The four-pin connector adds a PWM input to the fan controller. A TTL-level PWM signal provided on this input, nominally at 25 kHz, allows the fan speed to be controlled. If the input is left open-circuit, a pull-up resistor inside the fan ensures that it will run at max- imum speed. The circuit Using a microcontroller we can read the tacho signal and use its timing to control one or more power LEDs accordingly. Driv- ing the LEDs is best done via a logic-level MOSFET. The whole circuit is shown in Figure 3. The clock for the microcontroller is pro- vided by a 20 MHz crystal. A row of nine jumpers (JP1) allows the various options offered by the software to be configured: see the Table. The first four jumpers (on port pins PB4 to PB7) are used to tell the microcontroller the number of blades on the fan, from Oto 15. The next three jump- ers (on port pins PBO, PB1 and PB3) select one of eight different modes of operation. The jumper on PD6 controls the amplitude of the apparent fan movements, and the jumper on PD3 their speed. Power is obtained from the +1 2 V line on the fan connector. The easiest way to con- nect the circuit to the fan is to make a small adaptor (Figure 4) which passes through the four fan signals and brings out the GND, +1 2 V and tacho wires for connection to K1 on our printed circuit board. Construction and LEDs Although the circuit only consists of a few components, we have designed a small printed circuit board (Figure 5) in the Elel<- tor lab for the project to make the project 100127 - 11 Figure 3. Circuit diagram: the jumpers allow various effects to be selected. elektor 12-2010 53 COMPUTERS Table: lumper settings (PB7) (PB6) (PB 5 ) (PB4) Blade count 1 1 1 1 0 1 1 1 0 1 1 1 0 1 2 1 1 0 0 3 • • • • • • • • • • • • • • • 0 0 0 0 15 (PB?) (PB6) (PB 5 ) Option N°. Function 1 1 1 0 Stationary 1 1 0 1 Combination of various movements 1 0 1 2 Oscillation 1 0 0 3 Forwards and backwards 0 1 1 4 Movements with pauses 0 1 0 5 Sudden movements 0 0 1 6 Slow movement 0 0 0 7 Stationary PD3 = select speed of effect PD6 = select amplitude of effect Figure 4. Adaptor for connecting to a fan cable. Software variants Version using ATtiny23i3: Version using ATtiny25/45: Source file: fan_flash_231 3_v01 .c Source file: fan_flash_45_v01 .c Compiler WINAVRGCC Compiler WINAVRGCC Compileroption: -02 Compileroption: -02 Fuses: external crystal Fuses: external crystal brown_out at 4.3 V brown_out at 4.3 V no CKDIV8 no CKDIV8 COMPONENT LIST Resistors JP1 = 1 8-pin (2x9) DIL pinheader with Jumper R 1 = see ^xt XI = 20MHz quartz crystal R2 = 100l<£} PCB# 1001 27-1 (www.elektor.com/100127) Capacitors Cl = lOOnF C2 = IOOOjiF 16V C3 = 1 OjlxF 1 0V C4,C5 = 22pF Semiconductors D1 = BAT43 D2 = 1 N4007 D3 = power LED (see text) IC1 = ATTiny2313-20PU, programmed, Elek- tor# 1001 27-41 IC2 = 78L05 T1 = IRLU120N (International Rectifier) Miscellaneous Figure 5. The printed circuit board K1 = 3 "P in pinheader designed in the Elektor lab. I<2 =4- pin pinheader easier for beginners to tackle. The software for the microcontroller (including source code) is available, as ever, for free download from the project web pages t 6 !. Compiler options and fuse settings are listed in the text box ‘Software variants’. If you are not able or not inclined to program the micro- controller yourself, ready-programmed microcontrollers can be purchased, again via the project web pages. The device then just needs to be plugged (the right way around!) into its socket on the board: see Figure 6. As shown in the circuit diagram, an LED is connected between pins 2 and 3 of l<2. The LED only lights very briefly, and so needs to be driven at a high current to give bright enough results. Power LEDs rated at up to 5 W are ideal. The value of series resistor R2 will depend on the type of LED chosen. In our prototype we used a value of 5 £l\ with a normal LED a value of 50 Q would be more suitable. It is also possible to wire several LEDs with individual current-limiting resis- tors in parallel, as the MOSFET has plenty of drive capability (/ Dma x = 1 0 A). Software The program running in the ATtiny2313 configures timer 0 so that it generates an interrupt every 200 clocks. The interrupt rate is thus 1 00 kHz, and all the important functions of the system are carried out in the service routine. The routine monitors 54 12-2010 elektor COMPUTERS Figure 6. The assembled prototype. the tacho signal from the fan to detect edges. Two rising edges correspond to one revolution of the fan. Figure 7 shows the timing of events during each revolution. The variable slowTimer is incremented by one on each interrupt and reset to 0 at the start of each complete revolution. The changing value of this variable can be thought of as a sawtooth wave synchronised with the rota- tion of the fan, and with a maximum value dependent on its speed. For example, if the fan is turning at 1 500 rpm each revolution takes 20 ms, or 2000 interrupts. For maxi- mum brightness, we would like to flash the LED once as each blade of the fan goes by, and to this end we generate another saw- tooth variable, called fastTimer. This vari- able is reset at the same time as slowTimer, but counts up only to a limit called fastPe- riod, which is equal to the maximum value reached by slowTimer divided by the num- ber of blades of the fan. The result is that fastTimer varies as a sawtooth synchronised with the blades of the fan. It is also necessary to be able to adjust the relative phase of the LED flash and the fan blade position, which is done using a fur- ther fan-blade-synchronous sawtooth var- iable called PLLtimer. The LED is flashed each time this variable is reset. The period of the variable is equal to that of fastTimer and a simple software PLL controls the phase shift between the two variables. On each falling edge of PLLtimer (at the time indicated by the dashed line) the value of fastTimer is compared against a reference value. If the edge is to the left or right of the desired position the phase of PLLtimer is corrected by slightly increasing or decreas- ing the length of its next period. The List- ing ‘PLL code’ shows the relevant part of the program. The period of PLLtimer at any time is given byfastPeriod plus PLLcontrol. Here fastPe- riod is the nominal period of the variable and PLLcontrol is the correction to cause a phase shift. When PLLtimer reaches its maximum value it is reset and the LED is Advertisement Prototype & small series PCB specialists EURO CIRCUITS PCB proto STANDARD pool TECH pool ^ 0 ^ IMS pool On demand dedicated prototype service widest choice 1-8 layers 100 pm technology metal-backed PCBs all options up to 16 layers Call us: +44 (0) 20 8816 8180 Email: euro@eurodrcuits.com Merry Christmas and a prosperous New ALL SERVICES Instant online pricing Instant online ordering Low pooling prices Deliveries from 2 days No tooling charges Stencil service www.eurocircuits.com elektor 12-2010 55 COMPUTERS Figure 7. Timing diagram forthe rotation of the fan. PB2, OCOA k PWM ri R2 DACout OO-GEH H 4k7 H -o* J Cl C2 ] lOn lOn 100127 - 14 Figure 8. Low-pass filter suitable for converting the PWM test signal output on PB2 of the microcontroller into a sawtooth wave. Figure 9. Oscilloscope traces showing the sawtooth waveform (filtered PWM signal) and the LED drive pulse. flashed. At the same time the phase differ- ence between wantedPhase and fastTimer is calculated in order to generate a new PLL- control value. Debugging If you are planning to make any modifica- tions to the software, it will be helpful to have a debugging facility: real-time debug- ging is a must, as most bugs will lead to timing errors. To simplify this, pin 14 of the ATtiny2313 (TP2) outputs the current fan position in the form of a PWM signal. This can be filtered using the low-pass circuit shown in Figure 8 and the result shown as a sawtooth signal on an oscilloscope. The second channel of the oscilloscope can be used to monitor the gate signal to the MOS- FET to see where the light pulses are being generated. Figure 9 shows a typical picture obtained using this set-up. (100127) Internet Links [1] www.youtube.com/user/ossimodding [2] www.eastera.com.cn/data/ES21 1- ENb_a.pdf [3] www.melexis.com/Assets/US890US891_ DataSheet_4851 .aspx [4] www.nidec.com/fanpdfs/t92t200901 .pdf [5] www. fo r m f a cto rs.org/ developer%5Cspecs%5C4_Wire_PWM_ Spec.pdf [6] www.elektor.com/ 1 001 27 r — — — — — — - — — 1 Listing: PLL code if (PLLtimer f astPeriodHalf ) { PLLcontrol -= fastPeriod ; } if (PLLcontrol < - f astPeriodHalf ) { PLLcontrol += fastPeriod ; } if (PLLcontrol > 100 ) { PLLcontrol = 100 ; } if (PLLcontrol < -100 ) { PLLcontrol = -100 ; } } L // period adjusted by PLLcontrol // count up // reset PLLtimer / start LED flash // get PLL phase-difference // adjust to the range // limit to -100.. 100 56 12-2010 elektor REMOTE CONTROL ARM Freephone Control Give your microcontroller orders over the phone By Bert van Dam (The Netherlands) With this circuit, you can use your mobile or landline phone to send commands to an ARM microcontroller connected to the public telephone network, free of charge. That’s handy when you want to close the curtains or switch on the heating while you’re away. Figure 1 . Schematic diagram of the hardware. This project is built around an ARM microcon- troller connected to the public telephone net- work. You can send commands to the micro- controller by allowing the phone to ring a specific number of times. With the design described here, a yellow LED lights up for 30 seconds after you let the phone ring three times and then four times on two successive calls. As the microcontroller doesn’t answer the phone, you can send commands to it from anywhere in the world, free of charge. Hardware and schematic diagram The ECRM40 module used here houses a fast AT91SAM7S128 ARM microcontroller with 128 KB of ROM, 32 KB of RAM and an inte- grated boot loader, fitted on a mini PCB. This means you don’t need a separate programmer; all that’s necessary is a simple program on your PC and a USB cable. The schematic diagram of the circuit (Fig- ure 1) is fairly simple, and it can easily be built on a breadboard (Figure 2). A DC volt- age of approximately 48 V is normally present on the phone line,* and the 0.1 -pF capacitor blocks this voltage. This means that no volt- age is applied to the rectifier when the line is in the idle state. When the phone number is dialled, a 20-V AC signal is superimposed on the existing DC voltage in order to ring the bell of the telephone normally connected to the line. The capacitor allows this AC signal to pass through to the rectifier, which converts it into a pulsating DC voltage. This voltage is fed to the LED in the optocou- pler via a 1 0-l<£2 resistor. The optocoupler provides galvanic isolation between the telephone line and the ARM microcontroller. According to its data sheet, this optocoupler (type 4N25) supplies 1.6 mAwith an LED current of 2 mA (80% of the LED current), which is more than enough for the microcontroller input. The 10-l<£2 resistor to ground prevents the microcontroller input from floating. The microcontroller portion of the circuit is powered from the USB port. If the circuit is used on its own, it should be powered by a well regulated 3.3-V power supply and the jumper on the rear of the ECRM40 module must be changed from ‘USB’ to ‘EXT’. The rest of the circuit is powered from the telephone line. Figure 2. The circuit assembled on a breadboard. Software and operation This circuit causes a yellow LED to light up after a caller first allows the phone to ring three times, hangs up, and then calls again and allows the phone to ring four times. If you use only command codes consisting of two numbers and keep the first number fairly small, you reduce the chance that someone else may send a command to the circuit by accident. The AC signal intended to ring the bell is rectified by the bridge rectifier but not smoothed. This results in a pulsating DC voltage. You won’t notice this if you connect an LED in place of the opto- elektor 12-2010 57 REMOTE CONTROL Lf»i^:Lj0X*yttl - 53 tinmutftwit > 0 ImmutiDnq >D uiriN - leuiiir +1 rmTiJitoiT- 1900 frimUbcnp ■ -Juuuu LEC^IQX^]) Figure 3. Flowchart of the loop for counting pulsating ring tone signals. coupler, but the microcontroller does notice this and registers it as a series of short pulses. The program (written in Flowcode) essentially consists of three counting loops with timeouts. As soon as the optocoupler outputs a signal, a timeout counter is started with an initial value of 50 and the green LED lights up (see Figure 3). This counter is decremented by 1 for each pass through the loop. The loop delay is 1 0 ms, so the total timeout is 500 ms. If a new pulse arrives within this interval, the timeout counter is reset. If a new pulse is not received, the time- out expires. The ring tone counter, which keeps track of how often the phone rings, is incremented by 1 when this happens, and the green LED goes dark. The microcontroller must wait a certain amount of time for another ring tone to not be received before it knows that the caller has hung up after letting the phone ring a certain number of times (three in this case). In the Netherlands, the duration of the ring tone is 1 sec- ond and the pause between ring tones is 4 seconds. To be on the safe side, the microcontroller waits a bit longer. If no new ring tone is detected after 1 0 seconds, the microcontroller knows exactly how many times the phone rang (three in this case). This is handled by the second counter loop, which use the variable timeoutshort. If caller does not intend to send a command code (after all, the phone line can also be used for normal purposes), the microcontroller shouldn’t have to wait forever for the second number of the code. Accordingly, a third loop is used to reset the program’s state machine after approximately 5 minutes. This loop uses the variable timeoutlong. If the phone starts ringing again before this timeout has expired, the ring tones are treated as the second number of the code. After the ring tones for this number have been counted, the received num- bers are compared with the possible command codes (see Figure 4). The present design has only one defined code (3 - 4), but it’s easy to add more. When the defined code is received, the LED lights up for 30 seconds. Using the circuit Connect the circuit to the USB port of a PC, or connect it to an exter- nal power supply with a well regulated 3.3 V output. Also connect it to the telephone line. Now dial the number belonging to this line. Figure 4. Flow chart for comparing the number of ring tones with the defined command code (3 - 4). Note that ‘First no / Second no’ should be taken to mean ‘First/Second ring count’. The green LED will light up each time the phone rings. Hang up after it rings three times and wait briefly (at least 1 0 seconds, at most 5 minutes). Then dial the number again and let the phone ring four times, then hang up. After approximately 1 0 seconds, the yellow LED will light up and remain lit for 30 seconds, which indicates that the microcontroller has recognised the command. If you do something wrong, the circuit resets automatically after approximately 5 minutes. If you don’t want to wait this long, press the reset button. The command code used here and the yellow LED are only exam- ples. You can define as many command codes as you wish and con- nect other devices, such as outdoor lighting, a coffee machine, or what have you. Bear in mind that the maximum output current of the microcontroller is 8 mA per pin and 1 50 mA in total, with a 3.3-V output level. If you need more current or a higher voltage, you should use a transistor, MOSFET or relay. The Flowcode software for the ARM microcontroller and ECRM40 module are available on the Elektor website. The source code for this project can be downloaded free of charge from the project page PI. ( 090530 -I) * With an ISDN line the voltage is usually around 90 to 1 00 V. For this reason, an electrolytic capacitor with a sufficiently high rated voltage is specified here. Internet Link [1 ] www. elektor. com/090530 About the author Bert van Dam writes articles and books on microcontroller pro- jects, including PIC Microcontrollers: 50 JAL Projects for Beginners and Experts ; Artificial Intelligence : 23 JAL Projects to Bring Your Mi- crocontroller to Life!; and Microcontroller Systems Engineering with Flowcode: 45 Flowcode Projects for PIC, AVR and ARM. 58 12-2010 elektor INFOTAINMENT Hexadoku Puzzle with an electronics touch At the time of writing obviously we’ve no way of telling what the weather will be like in December. For sure, however, this new Flexadoku puzzle will get you through a bad afternoon or two. So how hard is the puzzle this time? Try it out for yourself! Enter the right numbers in the puzzle, send the ones in the grey boxes to us and you automatically enter the prize draw for four Elektor Shop vouchers. Flave fun! The instructions for this puzzle are straightforward. Fully geared to electronics fans and programmers, the Hexadoku puzzle employs the hexadecimal range 0 through F. In the diagram composed of 16x16 boxes, enter numbers such that all hexadecimal numbers 0 through F (that’s 0-9 and A-F) occur once only in each row, once Correct solutions received from the entire Elektor readership automati- cally enter a prize draw for one Elektor Shop voucher worth £ 80.00 and three Elektor Shop Vouchers worth £ 40.00 each, which should encourage all Elektor readers to participate. Prize winners The solution of the October 201 0 Hexadoku is: 3F8B5. The £80.00 voucher has been awarded to: Gergely Szabolcsi (Hungary). The £40.00 vouchers have been awarded to: Cedric Chape (France), Antonios Chorevas (Greece) and Peter Hillen (The Netherlands). Congratulations everyone! Solve Hexadoku and win! in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle and these determine the start situation. Correct entries received enter a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. Participate! Before January 1 , 201 1 , send your solution (the numbers in the grey boxes) by email, fax or post to Elektor Hexadoku - 1000, Great West Road - Brentford TW8 9HH United Kingdom. Fax (+44) 208 2614447 Email: hexadoku@elektor.com 8 D 7 0 F 5 6 5 8 7 3 1 A 2 A 0 1 9 5 F B 3 4 F 2 A D E 1 9 3 E A 4 2 1 5 7 D 8 F 7 2 3 A C B 9 5 D 5 6 B 8 1 E 1 B 9 D 7 3 B C 4 8 0 F 8 A F E 9 1 E D 6 3 A 4 B 9 D 7 C B 1 4 2 E 6 C 8 0 7 9 D 2 3 4 9 6 A B 9 7 5 1 8 7 8 A F 4 (c) PZZL.com E 5 6 B 4 A C 0 1 9 2 3 F 8 7 D 0 A 9 8 1 2 D 6 7 F 4 E C 5 B 3 7 1 F 3 9 8 5 B 0 D C 6 E 2 4 A D 2 4 C E 7 3 F 8 B 5 A 9 0 1 6 5 9 D 6 8 4 0 7 F A 3 1 2 B C E A 3 E 2 D 5 B 1 C 4 0 8 7 F 6 9 C 7 B 1 6 F 2 3 9 E D 5 8 A 0 4 4 F 8 0 A 9 E C B 6 7 2 5 D 3 1 3 8 7 F B 1 A E D 5 6 C 0 4 9 2 1 6 A 9 3 0 4 D 2 8 F 7 B E 5 C B D 5 E 2 C 7 9 4 3 A 0 1 6 8 F 2 C 0 4 F 6 8 5 E 1 B 9 D 3 A 7 6 E 2 A 7 D 9 4 5 C 8 B 3 1 F 0 9 4 1 5 0 B 6 2 3 7 E F A C D 8 8 B 3 7 C E F A 6 0 1 D 4 9 2 5 F 0 C D 5 3 1 8 A 2 9 4 6 7 E B The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses. elektor 12-2010 59 RETRONICS EF50 - The Story The valve that helped win the war By Ronald Dekker (The Netherlands) A strangely tense mood prevailed in the Philips valve plant on the Emmasingel in Eindhoven (The Netherlands, a.k.a. Holland) on the evening of the May 9, 1 940. It was clear to everyone that, in addition to the fact that the Germans were set to invade the Netherlands at any moment, the Philips workers had an unusual job to do that evening. A total of 25,000 units of their newest radio valve, the EF50, and 250,000 components for this valve, all of which had been produced in a great hurry, were quickly loaded onto a waiting lorry. The lorry left the same evening for Vlissingen (Flushing) on its way to England. The news of the start of the invasion came even before the Stoomvaart Maatschappij Zeeland ferry had slipped its moorings. Although the ferry came under fire from a German fighter plane, it reached the coast of England safely. Its unusual cargo was to play an especially important role in one of the crucial battles of World War II: the Battle of Britain. Around five years earlier, on February 26, 1935 (the day when Hitler gave the order for the formation of the German Luftwaffe), an old lorry loaded with electronic equipment made its way to the small town of Weedon in Northamptonshire, England. It was clear at that time that a German invasion, should there be one, would be preceded by a decisive air battle for control of the British air space. The Royal Air Force (RAF) was weaker than the Luftwaffe, and for it to have a chance of winning the battle it was essential for the Air Command to be aware of approaching enemy aircraft as early as possible. The legendary inventor Watson- Watt had proposed that radio signals reflected from aircraft wings could be detected and used for this purpose. In order to convince British Air Commander Sir Hugh Dowding, an experiment was carried out. This involved radio signals broadcast by a BBC shortwave transmitter in Daventry, with the objective of using an improvised radio receiver in the lorry to detect these signals after reflection from an aircraft. The demonstration was so convincing that an order was issued to build a chain of radar stations along the English coast, called the ‘Chain Home’ system. The brilliant scientist ‘Taffy’ Bowen [1] was one of the first people involved in the design and construction of the Chain Home system (Figure 1). A wavelength of 50 metres was selected (6 MHz) because it yielded maximum signal reflection from aircraft with a wingspan of 25 metres. Construction of the system proceeded very propitiously, in part because the transmission frequency used in the system was a good match to the state of technology at that time. Near the end of 1936, when the construction of the Chain Home system was already quite advanced, there came a need for a radar system that was small enough to be installed in an aircraft. Although the Chain Home system could see a long way, its resolution was too coarse to allow individual fighter planes to be directed toward enemy aircraft at night when visual sighting was not possible. As there was no room in the small fighter planes for a large antenna, an airborne system of this sort would need to operate at a transmission frequency of around 200 MHz. This was an enormous challenge at that time. Building a 200-MHz transmitter proved to be not especially difficult, but the receiver caused a lot of problems. The only radio valves that could still provide sufficient gain at this relatively high frequency were the ‘acorn’ valves (Figure 2). They were very difficult to make and certainly not suitable for mass production. Just before the situation became truly pressing, Bowen received a golden tip from his former professor Edward Appleton: the electronics firm Pye had developed an extremely sensitive 45-MHz receiver for its new television sets [2] . The director and owner of Pye, the well-known and eccentric C.O. Stanley, was determined to make a major 60 12-2010 elektor RETRONICS commercial success of the new medium of television. At that time, the 45-MHz television transmitter at Alexandra Palace in London was the only television transmitter in England. To maximise the coverage area of the transmitter, and thus the number of people who could receive the signal, Stanley had asked his designers B.J. Edwards and Donald Jackson to develop a sensitive television receiver. As there was only one transmitter, they chose a tuned RF receiver design for operation at a single frequency: 45 MHz. A revolutionary new valve, the EF50, was developed in order achieve the necessary sensitivity, and it was supplied in England by Mullard, at that time a fully owned subsidiary of Philips (Figure 3). Bowen was delighted. With a modified version of the EF50 in the mixer stage and the 45-MHz ‘Pye strip’ for the IF stage, he had an excellent radar receiver, which moreover could be produced in large quantities (Figure 4). It came just in time: a few months later England declared war on Germany. What made the EF50 so special? Before the advent of the EF50, radio valves were made using the same method as incandescent lamps. The electrodes of the valve were assembled on wires passing through a small glass stem pinched off at the top. The relatively long lead wires passed from the electrodes through the pinch to the valve base. The parasitic capacitances and inductances of these lead wires made it impossible to produce good HF valves using this method. The pressed-glass base developed by the researchers Jonkers, Alma and Prakke at the Philips Physics Lab in Eindhoven was considerably better in this regard. With this approach the electrodes are mounted directly on a number of nickel-iron pins held in a pressed glass base, and these pins also act as the contact pins of the valve. The pins were originally bent so the valve could be rotated a bit to lock it in place after it was inserted in the socket (Figure 5). This system caused quite a few problems, so after a short time the bent pins were replaced by straight pins. A metal sleeve provided suitable shielding. At that time a major development effort was necessary to refine this method to the point that it was suitable for the automated production of millions of valves per year. Consequently, the EF50 valves that Mullard supplied to Pye were not manufactured by Mullard, but instead came directly from the Philips plant in Eindhoven. As the people at Mullard also had no idea that the EF50 valves were used in the top-secret radar project, this did not come to light until the spring of 1940. Understandably, this realisation led to a minor panic in the British military organisation, since The Netherlands were on the verge of being overrun by the Germans. As a result of a request at the government level, Theo Tromp, the energetic manager of the Philips valve factory, was summoned to London. There Watson-Watt asked him to produce and deliver as many EF50 valves as humanly possible without asking any questions, and to have copies of the production machines made so Mullard staff could take over production. Tromp realised that this involved something very important and did what he was asked. Working day and night, the machines in Eindhoven turned out as many valves as possible. The history and background of the EF50 is described in detail on the author’s website [3] , based on unique source material from the Philips company archive. The shipment from Eindhoven played a major role in the Battle of Britain. It is both impossible and unnecessary to estimate how important the EF50 was for the course of the war. Here it is sufficient to cite the words of Taffy Bowen: “Along with the magnetron, the EF50 was the most important valve in World Warll.” (100657-I) Internet Links and References [1] E.G. Bowen, Radar Days, Adam Hilger, Bristol 1987; ISBN 0-85274-590-7 [2] www.pyetelecomhistory.org/index.html [3] www.dos4ever.com/EF50/EF50.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-2010 61 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1932 564999 Fax 0044 (0) 1 932 564998 ASTROBE V3.0 www.astrobe.com Windows Development System for LPC2000 microcontrollers. • Develop high-and low-level software without C or assembler • Generate fast 32-bit native ARM code • No special programming hardware required • Personal, Standard and Professional Editions ATOMIC PROGRAMMING LTD www.atomicprogramming.com • AP-114 ISP/JTAG Programming System • JTAG Programming and Testing • Boundary Scan Testing • Universal In-System Programming • EEPROM and SPI Flash Out-of-Circuit Programming • Generic GDB Proxy Server • Jennie JN5148 ZigBee Development Applications • Training Platform available AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. 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 CEDA www.ceda.in ceda@vsnl.com ( .[ ; E )/ FADS|OrCADf PCB layout 2 i e-learning Allegro $5 Hourly • PCB Layout & library service @$5 Hourly • PCB Reverse Engg, MCU Code/ckt. Extraction service • Learn Signal Integrity with Hyperlynx, PCB Design with PADS & Allegro. Support by email & 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 EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com Europe’s leading device programmers manufacturer: • reliable HW: 3 years warranty for y * most programmers • support over 56.000 devices • free SW updates • SW release: few times a week • excellent technical support: Algorithms On Request, On Demand SW • all products at stock / fast delivery EMBEDDED ADVENTURES www.embeddedadventures.com From news and tutorials to modules, components and kits, we have everything for your next microcontroller based project. Your embedded adventure starts here. .embedded cadventures FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk • Training and Consulting First for IT, Embedded and I5S3 Technology Real Time Systems Transfer Ltd • 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.e.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB Instruments A Rohde & Schwarz Company 0 Oscilloscopes 0 Power Supplies 0 Spectrum Analyzers 0 RF Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com 62 12-2010 elektor products and services directory 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 MQP ELECTRONICS ^^0 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 — = = “160 pages of tech audio articles Linear Audio Self, Linkwitz, Cordell, Pass a.o. your tech audio resource WWW.IineCirCIUdlO.net MaxSonar Ultrasonic Range Finder X L-M a xS ona r-EZ * Beam pattern choice *High acoustic power * Real-time calibration * 39.0SUSD / unit MaxSonar-WRC ip&7 * Compact packaging 4 Quality narrow beam 99.95USD/ unit www .active-ro bot co. u k www.coolcomponents.co.uk www .ocean control s. co m .au www.maxbotix.com ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! 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 STEORN SKDB LITE Join the SKDB Lite, the place to understand, discuss and experiment with magnetics. • Learn more about magnetics and electromagnetics • Participate in developer forums and discussion surrounding magnetics and related topics. For FREE access to SKDB Lite: https://kdb.steorn.com/ref25 USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £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 12-2010 63 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Going Strong Burkhofd Koiftko LarS GolM* A world of electronics from a single shop! atP- Elektor 50-piece Starter Kit available at com I diaitalexperiments elektor WWW An introduction to digital control electronics Experiments with Digital Electronics The field of digital electronics is central to modern technology. This book presents fundamental circuits using gates, flip-flops and counters from the CMOS4000 Series. Learning these fundamen- tals is best done using practical experiments. Each of the 50 experiments presented in this book has a circuit diagram as well as a detailed illustration of the circuit’s construction on solderless breadboard. Building these digital circuits will improve your knowledge and will be fun to boot. Many of the circuits have practical real-life applications. With a good overview of the field, you’ll be well equipped to find simple and cost-effective solutions for any application. Tip: Also order the 50-piece Starter Kit and get started straight away with the experiments described in the book! See www.elektor.com/digitalexperiments. 176 pages • ISBN 978-0-905705-97-2 • £26.50 • US$42.80 ARM Microcontroller Interfacing ftwmii' A, 'Si-aifH 3.-TVT 1 i ^ "\ Use only free or open source software! ARM Microcontroller Interfacing Learn to interface and program hardware devices in a wide range of useful applica- tions, using ARM7 microcontrollers and the C programming language. Examples covered in full detail include a simple LED to a multi-megabyte SD card running the FAT file system. Interface to LEDs, transis- tors, optocouplers, relays, solenoids, switches, keypads, LCD displays, seven segment displays, DC motors, stepper mo- tors, external analogue signals using the ADC, RS-232, RS-485, TWI, USB, SPI and SD memory cards. 250 pages • ISBN 978-0-905705-91-0 £29.50 • US$47.60 Principles, Applicdtiun and Desiyn Power Electronics in Motor Drives This book is aimed at people who want to understand how AC inverter drives work and how they are used in industry. The book is much more about the practical design and application of drives than about the mathematical principles behind them. The detailed electronics of DC and AC drive are explained, together with the theore- tical background and the practical design issues such as cooling and protection. 240 pages • ISBN 978-0-905705-89-7 £29.50 • US$47.60 64 Prices and item descriptions subject to change. E. & O.E 12-2010 elektor Ai.uwanrf Visual Studio C# 201 0 Programming and PC interfacing This book is aimed at anyone who wants to learn about C# programming and interfac- ing to a PC. It covers programming concepts from the basics to object oriented program- ming, displaying graphs, threading and data- bases. The book is complete with many full program examples, self assessment exer- cises and links to supporting videos. All code examples used are available - free of charge -from a special support website. Professio- nal quality software tools are downloadable -also free of charge- from Microsoft. The Microsoft Visual Studio 201 0 environment is extensively covered with user controls and their properties, methods and events. Bestseller! 305 pages • ISBN 978-0-905705-95-8 £29.50 • US$47.60 1 yjzhM ysultjuiuihsi for Elec. trank Engineers Get started quickly and proceed rapidly Python Programming and GUIs This bookis aimed at people who want to in- terface PCs with hardware projects using graphic user interfaces. The programming language used is Python, an object-oriented scripting language. The book guides you through starting with Linux byway of a free downloadable, live bootable distribution that can be ported around different computers without requiring hard drive installation. 224 pages • ISBN 978-0-905705-87-3 £29.50 • US$47.60 New models and applications High-End Valve Amplifiers 2 Nobody has any doubt that valve ampli- fiers produce a remarkably beautiful sound. They have a lively, deep, clear, and expressive sound, and dynamically they do not appear to have any limitations. Menno van der Veen investigates, in a sys- tematic theoretical approach, the reasons for these beautiful properties. He devel- ops new models for power valves and transformers, thus enabling the designer to determine the properties of the ampli- fier during the design process. You will no- tice in this book that the author not only writes about amplifiertechnique, but tells about the way the development of valve amplifiers can have an influence on your daily life; even the usefulness of patents is discussed. Summarizing: new theories and solutions for perfect audio with valve amplifiers. Not only the professional and the DIY-er but everyone who wants to un- derstand valve amplifiers will read this bookwith much pleasure. 420 pages • ISBN 978-0-905705-90-3 £37.00 • US$59.70 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 More than 75 power supply designs cd The Power Supply Collection 1 This CD-ROM contains more than 75 dif- ferent power supply circuits from the volumes 2001-2005 of Elektor. High- lights include the Cuk Converter, Auto- matic Battery Switchover, Battery Voltage LED, Digital Benchtop Power Supply, Lithium-Ion Charger, Electronic Fuse, High Voltage Regulator, Power Supply for USB Devices, Step-up Conver- ter for White LEDs, Vehicle Adapter for Notebook PCs and much more. Using the included Adobe Reader you are able to browse the articles on your computer, as well as print texts, circuit diagrams and PCB layouts. ISBN 978-90-5381 -265-5 £17.90 • US$28.90 leKtor !3S*!£7 4C Vt "f-MI- ortre 1 V ■ E*»-p HW ft «*Tft Lt-Lf- yhliU V t "■siJri 4 l-toi VKIf C-nS la EPtildn-c* Lwnlnf Caune to* mi m ipraal palffl 1 40 ,« f 70 C SO C-ISCCiuniT Pnegr* iurrwng Imbedded Pit! Mkrocc itrolliT, Kit of part* Elekt iPownf Slnbil Fun 5 h*afrM.nSK 1W-1 te LNc ffifcHJdC rr , - f In rtw Prf «1 pi J«l .r A-.— : Kt.-kil 1 tMt* ydu 1 ' MPM: O UwqiM- EVKITOflKf Tailor Tto g«lcndr to pC pre^r# earning &"J