v*°! ^ 1 >? October 2011 alogue Audio Digital Test & Measurement AUS$ 14.50 - NZ$17.50 - SAR 102.95 ‘ NOK99 £4.80 + Time Domain Reflectometry www.elektor.com Analogue computing rediscovered JTAG Interface Testing look, no test pins! ^ 1 2.4 GHz Transmitter & Receiver for Model Aeroplanes The Dream of Electric Flight silent, pollution-free flying multifunctional circuit for microcontroller applications 770268 4511 66 * R42 1 0 '?c::cac accccccc cceccccc 3tcc:cce cccc'cccc » * ’ \4 333CCC3 •CCCCCC 333330C3 3C3CC3CC CCiiJCJS 03C33CCC ektQSj*?? Dcktarl Confident reading: on paper • Tv * £?,*** Jfr eentemporary & innovatiS gn PC, 3 3 0 3 3 333 Read Elektor with the cut-rate PLUS subscription! Subscribe now or upgrade: www.elektor.com/subs the best place for microcontroller community projects and libraries fl PLHCE FQR CODE" DOWNLORD FREE PROJECTS RND LIBS Get all kinds of cool ideas. Download free, functional and working libraries and projects, including schematics, documents and tutorials, and install them with a single click. Everything you need is in one place. SHARE YOUR CODE WITH THE COMMUNITY Do you want to share your work with the rest of the world, and get community feedback on your projects? This website gives you the best infrastructure a programmer can have for sharing the code. IT’S R FRCEBOOK FOR CODERS With personalized accounts, you can connect with other progra- mmers, share experiences, and learn more about yourself too. Social interaction brings a new dimension to the world of programming. mfcroC PRO tor dsPIC mikroC PRO (or A's/R RLL COMPILERS SUPPORTED mikroC, mikroBasic and mikroPascal for PIC, dsPIC, PIC32, AVR and 8051 are all natively supported by Libstock. PRCKRGE MRNRGER SOFTWARE With free Package Manager software, you can make one-dick extractable packages of your libraries and projects. EXCLUSIVE MIKROE LIBRARIES TCP/IP stack, FAT16 and FAT32 are just part of the libraries that mikroElektronika will exclusively share only on Libstock website. Mikrollektronika DEVELOPMENT TOOLS I COMPILERS I BOOKS www. I i bstock. com c^£)mmunity Beyond printed matter Many of you will associate Elektorwith the printed magazine of which the British English edition has been on circulation in newsstands, bookshops and in electron- ics retail stores since December 1974. In fact you are reading issue #418 right now — on paper, and we intend to print quite a few more editions for you to browse, read, dog ear or blemish with the solder iron. However over past few years Elektor has developed a number of activities that do not involve paper anymore, although we consider them part and parcel of our publishing activities in general. Apart from the blatantly obvious elektor.com website some of these activities may be unknown to you so I'll mention a few. To start with, there are ourPCBs, DVDs, books, special editions, kits and modules. Elektor’s PCBs — renowned for their q uality — have been on sale since issue #1 but kits and mod- ules are relatively recent additions and particularly useful to those of you dying to build our more ambitious projects but afraid or unable to source or handle the components used. Our first ‘module* was the legendary GBDSO. Some of our recent kits are ‘hybrids’ meaning they come with the SMD components premounted on the board. From reader feedback we learned that many of you still enjoy soldering through-hole parts, so we decided to su pply them separately with the kit for an hour or so of wielding the old soldering iron (low-power, mind you). Elektor is also strengthening its ‘e-vents’ portfolio by staging webinars on successful publications. Our partners are companies as well as authors recognized as authori- ties in their field. Our webmasters Patrick and Denis have created an Elektor channel on YouTube, www.youtube.com/elektorim. We have discovered that short movies (no matter how primitively made) on our techno stuff area great way of pulling in not only new- comers of the MTV generation but also those now enjoying retirement and having rediscovered Elektor through successful Googling. Everyone’s more than welcome, hopefully there’s something to delight you from our widening range of products either of the paper or the non -pa per variety. Enjoy reading this edition. Jan Buiting, Editor 6 Colophon Who’s who at Elektor. 8 News & New Products A monthly roundup of all the latest in electronics land. 14 Versatile Board for AVR Microcontroller Circuits An uncommon encounter, if only visually, with Platino, a “board that came with a circuit". 20 The Dream of Electric Flight Is it true that we’ve come a long way from the electric airship (1884) to the Green Flight Challenge (2011)? 28 Testing using the JTAG Interface How to check interconnections on complex boards... without test pins! 32 Time Domain Reflectometry Here’s a beginners guide to locating shorts and opens in long cables, complete with a circuit diagram for a simple pulse generator. 36 2.4 GHz Transmitter and Receiver Drop the old VHF radio system! Zigbee 2.4 GHz technology can now be applied to remote controlled models. 43 E-Labs Inside: Mixed results A short report by two students attempting to design an audio mixer as part of their electronics education. 44 E-Labs Inside: Verification of radiation meter Elektor’s low-cost gamma ray meter got put through its paces in a professional nuclear laboratory. 46 E-Labs Inside: Very handy, this display Tired of breaking those fragile glass LCDs? 46 E-Labs Inside: Recalcitrant little bits The taming and tweaking of a PIC baudrate generator. 4 10-20TI elektor CONTENTS Volume 37 October 2011 no. 418 14 Platino - a Versatile Board for AVR Microcontroller Circuits Platino was bom on November 20, 2010 in the Netherlands; he’s a versatile cir- cuit board for circuits based on an 8-bit AVR controller. After several months of preparation this little brother of the J 2 B met his first AVR microcontroller in June 2011. Because he did notyetfeel properly preparedto brave the electronics jun- gle. he decided to optimise himself by taking his idol Arduino as an example. 32 Time Domain Reflectometry ! ■ Sure, an ohmmeter is a handy instrument for checking wires and cables for ■ opens and shorts. But finding an open or short is not easy when the cable is ■ long, or if the fault is hidden inside a wall or under a street. Finding partial ■ opens or shorts, or just bad connections, is sometimes even tougher. That’s ■ where TDR comes in useful. 36 2.4 GHz Transmitter and Receiver With telemetry rarely or not permitted in the 27 MHz, 35 MHz, 41 MHz or other bands allocated for radio remote-control we decided to expand a lower VHF system with 2.4 GHz SHF technology. Because this is a fully open system, it can, to a large extent, be adapted to suit your own needs. 72 Retronics: The Chaos Machine (2) The analogue computer we set out to describe in the previous instalment was constructed from separate computation modules for multiplication, integration, summation and scaling, combined to represent the Lorenz 1963 equation sys- tem. In practice, it can do more than just generate the iconic Lorenz butterfly. 48 Audio DSP Course (4) This month we get to testing the hardware with the help of a few small DSP programs. 56 Audio Guide The first application of the Elektor Platino board is an RFID triggered rMP3 (no typo) player for use as a personal guide in museums. 60 Here comes the Bus! (8) A few simple components linked to the ElektorBus enable us to look at the protocol for a real control application. 65 Fan-Flash Alternative Old School digital logic mimics a stroboscope that makes the blades of your PC’s ventilator appear to stand still. 68 Sinewave Inverter with Power Factor Correction A Readers Project describing a 24-VDC to 230-VAC inverter optimized for driving Osram energy saving lamps up to 100 watts. 71 FET driver for Microcontrollers Circuit configurations for microcontrollers having to drive relatively heavy loads through their port lines. 72 Retronics: The Chaos Machine (2) In this second and closing instalment the chaos machine gets built— with bizarre results! 76 Gerard’s Columns: Trusting your Instruments This month we welcome Elektor columnist Gerard Fonte from the USA. 77 Hexadoku Elektor’s monthly puzzle with an electronics touch. 84 Coming Attractions Next month in Elektor magazine. elektor 10-2011 5 elektor international media bv Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. Vtiw vmmm Mb it* ♦ Time Domain Reflet to me try ektor Analogue computing rediscovered achine [TAC Interface Testing look, no twt pim! 2.4 GHr Trammfttw & Receiver I oc MocMAwopUrm The Dream of Electric Flight silent, poflution-free flying P'S / V i Platino multifunctional circuit for microcontroller applications ^ANALOGUE • DIGITAL MICROCONTROLLERS & EMBEDDED AUDIO • TEST & MEASUREMENT 4 Volime37, Number 418. October 20m ISSN T757-0875 Elektor alms 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 gHH, England. Tel. (+44) 208 261 4509. foe (+44) 208 261 4447 www.etektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published -n times a yearwith a double Issuefor July &AugusL Elektor is also published in Erench, Spanish. American English. German and Dutch. Together with franchised editions the magazine Is on circulation in more than 50 countries. International Editor. Wlsse Hettinga (w.hettinga@elektor.nl) Editor: jan Butting (editor@elektor.com) International editorial staff: Harry Baggen.ThiJs Beckers. Eduardo Corral, Ernst Krempeisauer, Jens Nickel, Clemens Valens. Design staff Christian Vossen( Head). Thijs Beckers, Ton Ciesberts, Luc Lem mens, Raymond Vermeulen , Jan Vlsser. Editorial secretariat Hedwkj Hennekens (secretariaat@elektor.nl) Graphic design / DTP: Glel Dots, Mart Schroijen Managing Director / Publisher: Dan Akkarmans Marl -ting Carlo van Nistelrooy Subscriptions: Elektor International Media, Regus Brentford. 1000 Great West Road. Brentford TW8 gHH, England. Tel. (-*-44) 208 261 4509. fax: (-*-44) 208 261 4447 Internet www.elektor.com/subs 6 10-20TI elektor Elektor eC-reflow-mate \ Professional SMT reflow oven with unique features The eC-reflow-mate is ideal for assembling prototypes and small production batches of PCBs with SMD components. This SMT oven has a very large heating compa rtment, which provides plenty of space for several PCBs. The accompanying PC software allows you to monitor the temperature curves of all sensors precisely during the soldering process, and it enables you to modify existing temperature/time profiles or create new ones. r Special features: • Optimal temperature distribution thanks to special IR lamps • Drawer opens automatically at end of soldering process • Glass front for easy viewing Technical specifications: • Supply voltage: 230 V/ 50 Hz only • Power 3500 W • Weight: approx. 29 kg • Dimensions: 620 x 245 x 520 mm (W x H x D) • Heating method: Combined IR radiation and hot air • Operation: Directly using menu buttons and LCD on oven • Remotely using PC software and USB connection • Temperature range: 25 to 300 °C • Maximum PCB size: 400 x 285 mm • Temperature sensors: 2 internal and 1 external (included) Price: £21 70.00 / € 2495.00 / US$3495.00 (plus VAT and Shipping) Further information and ordering at www.elektor.com/reflow-mate Email: subscr 1 ptions@elektor.com Rates and terms areglven on the Subscription Order Form. He j 1 1 tic Elektor International Media b.v. P.O.Box ii NL-6114-ZG Susteren The Netherlands Telephone: (+31) 464389444. Fax: (+31)46 4370161 Distribution: Seymour. 2 East Pou toy Street, London ECi A. Engla nd Telephone:+44 207 429 4073 UK Advertising: Elektor International Media b.v. P.O.Box 11 NL-6114-ZG Susteren The Netherlands Telephone: (+31) 464389444. Fax: (+31)46 4370161 Email: t.vanhoesel@elektor.com Intern^:: www.elektor.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 ary 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 10-2011 7 MEWS & NEW PRODUCTS Get ready for the ‘Elektor Academy Webinar Series in partnership with element^’ In response to requests from many enthusiastic readers out there, Elektor Academy and element14, the industry’s leading online technology portal, have teamed up to bring you a series of five exclusive webinars (web seminars) covering blockbuster projects from recent editions of Elektor magazine. In an Elektor Academy/element14 webinar, those who have registered to attend our online sessions not only get to see and hear leading authors and project designers exploring, discussing and elaborating on their projects, but also have an opportunity to enter into a debate on design and other technical aspects during the live Question & Answer (Q&A) slot after each presentation. Plus, every attendee receives an exclusive 1 0% discount off their next purchase with Farnelll The first Elektor Academy/element14 webinar is titled 'Platino - an ultra-versatile platform for AVR microcontroller circuits' and will take place on 13 th October at 15.00 GMT, live on element 14. Participation in these webinars is completely free! All you need to do is register via www.elektor.com/webinars to reserve your space. Places are limited so book soon to make sure you don’t miss out Our future Elektor/elementl 4 Webinar Series topics and times will be announced through Elektor’s e-weekly newsletter as well as in our monthly publications and online so watch out for the next exciting episode! wvwv .elektor.com/webi na rs (n 0604-VI 1 1 ) elektor n v* J ACADEMY the school of electronics elements Wireless networking solution powered with energy harvesting system Silicon Laboratories Inc. recently introduced the industry’s most energy-efficientwireless sensor node solution powered by a solar energy harvesting source. The new turnkey energy harvesting reference design enables developers to implement self-sustaining, ultra-low-power wireless sensor networks for home and building automation, security systems, industrial control applications, medical monitoring devices, asset tracking systems and infrastructure and agricultural monitoring systems. Complete Energy Harvesting Wireless Sensor Solution The market for energy harvesting devices is poised to grow exponentially this decade. IDTechEx forecasts that more than ten billion energy harvesting deviceswill ship by 2019— a 20x increase over the roughly 500 million units that shipped in 2009. Although systems powered by harvested energy sources have existed for many years, developers have been challenged to implement wireless sensor nodes within very low power budgets. Silicon Labs has met this design challenge by creating a wireless energy harvesting system based on its Si lOxx wireless microcontroller (MCU) family. The industry’s most power-efficient, single-chip MCU and wireless transceiver solution, the SilOxx can perform control and wireless interface functions at ultra- low power levels. In addition to being environmentally friendly and virtually inexhaustible, harvested energy provides a cost-effective, convenient alternative to batteries in many applications such as wireless networking systems. Batteries can be costly and inconvenient to replace, especially in large- scale wireless sensor node applications, and they are unreliable in extreme temperature conditions. Wireless sensor nodes often use batteries because they are placed in locations where it is not possible or convenient to run mains power. Energy harvesting simplifies these applications by eliminating the inconvenience of replacing batteries in inaccessible locations, while also reducing the quantity of depleted batteries for recycling or dumped in landfills. The new energy harvesting reference design includes wireless network and USB software and a complete circuit design with RF layout, bill of materials (BOM), schematics and Gerber files. The design consists of three components: - A solar-powered wireless sensor node that measures temperature, light level and charge level, using an SilOxx wireless MCU to control the sensor system and transmit data wirelessly and a thin-film battery to store harvested energy. - A wireless USB adapter that connects the wireless sensor node to a PC for displaying sensor data; the adapter features Silicon Labs' Si4431 EZRadioPRO® transceiver with an MCU running USB-HID class software and EZMac® wireless software stack. - A wireless sensor network GUI that displays data from up to four sensor nodes. The thin film battery used in the energy harvesting reference design has a capacity of 0.7 mAh. In direct sunlight, the battery can be recharged fully in only two hours. While in sleep mode, the wireless sensor node will retain a charge for 7,000 hours. If the wireless system is transmitting continuously, it will operate non-stop for about three hours, although it is designed to constantly recharge itself at an appropriate level to keep the thin-film battery from completely discharging. 8 09-2011 elektor NEWS & NEW PRODUCTS Silicon Labs’ energy harvesting reference design accommodates a wide range of harvested energy sources. An on-board bypass connector gives developers the flexibility to bypass the solar cell and tap other energy harvesting sources such as vibration (piezoelectric), thermal and RF. The system is available and priced at $45.00. www.silabs.com/pr/energyharvesting (110582-IX) Class-G headphone and Class-D speaker amplifiers balance audio power versus battery life Designers of mobile devices, such as smartphones, tablets/multimedia internet devices (MID), and portable media players, are faced with the challenge of making the small speakers in their devices sound louder and better, while minimizing impact on battery life. To meet this challenge, Fairchild Semiconductor developed the FAB1200 stereo Class-G ground-referenced headphone amplifier with integrated buck converter, as well as the FAB2200 audio subsystem with stereo Class-G headphone amplifier and 1 .2 W Class-D mono speaker amplifier. The FAB1 200 features a charge pump which generates a negative supply voltage that allows the headphone output to be ground- centred and capacitor-free, eliminating up to two external capacitors. An integrated inductive buck regulator provides direct battery connection and adjusts the supply voltage between two different levels based on the output signal level resulting in reduced power consumption. The result of these features is reduced systems cost and extended battery runtime, while maintaining a high level of audio quality. The device, available in a 1 6-bump, 0.4 mm pitch, 1 .56 mm x 1 .56 mm WLCSP package, offers excellent audio performance for better sounding audio headsets and is ideal for mobile handsets, tablets/MIDs, MP3 and portable media players. The FAB2200 is an audio subsystem that combines a capacitor-free stereo Class-G headphone amplifier with a Class-D speaker amplifier. A proprietary integrated charge pump generates multiple supply rails for a ground-centred Class-G headphone output significantly reducing power dissipation when compared to Class-AB design implementations, while offering high power supply rejection ratio. The filterless Class-D amplifier can be connected directly to a speaker without the need for two external filter networks, reducing the overall solution systems cost. The device also features Automatic Gain Control which limits the maximum speaker output levels to protect speakers without introducing distortion. It can also dynamically limit clipping as the battery voltage falls. The FAB1200 and FAB2200 mobile audio ICs make handsets, tablets/MIDs, and other portable audio applications sound louder and better while reducing overall systems cost and minimizing the impact on battery runtime. The FAB2200, available in a 25-bump, 0.4mm pitch, WLCSP package, is ideal for cellular handsets, notebook computers and tablets. www.fairchildsemi.com/ds/FA/FAB1200.pdf www.fairchildsemi.com/ds/FA/FAB2200.pdf (110582-XII) OC series antenna delivers higher gain Antenna Factor is pleased to introduce the OC Series antenna. The 1 /2-wave dipole antenna delivers higher gain than a standard whip antenna, increasing the range and reliability of wireless links. Using loaded coil technology, the OC Series antenna minimizes the length that would typically be required to achieve omnidirectional gain. Its articulating base tilts 90 degrees and rotates 360 degrees. The antenna’s internal counterpoise eliminates the need for an external ground plane and maximizes performance. Available in 91 6 MHz and 2.4 GHz, the OC Series antenna attaches with a standard SMA or Part 1 5 compliant RP-SMA connector. The antenna costs less than $7.00 in production quantities. Custom colours and logo options are available for volume OEMs. www.antennafactor.com (110582-XIV) Lightweight Fanuc M-i/a compact robot Q Corporation, a leading global supplier of SMT production solutions, debuts the new Fanuc M-7/o Robot. The M-7/o is a lightweight, compact robot designed for small part handling, high-speed picking and assembly applications. The unique parallel-link structure of the M-7/o provides higher speeds and accuracy compared to traditional assembly robots. The system is available in two models (4- or 6-axis) for various applications and can be installed in multiple orientations. Additionally, the system is available in three configurations including robot only (no stand), desktop mount with stand, and ceiling and angle mounting. The system also can be mounted to Q Corporation’s taping equipment for fast, accurate component placement. The M-I/A 4-axis design enables part feeding from the sides of a work zone, increasing the useable workspace. The elektor og-2011 9 NEWS & NEW PRODUCTS powerful R-30/A Mate rack-style controller provides intelligent robot functions with a compact controller footprint. Additionally, the detachable colour-graphic /Pendant or monochrome pendant can be shared between multiple robots on the same assembly line. www.qcorporation.com (110582-XV) New enhanced AVR XMEGA family Atmel® Corporation (NASDAQ: ATML), a leader in microcontroller and touch solutions, today announced additional unique features to the already-successful 8/1 6-bit AVR XMEGA microcontroller (MCU) family with the industry’s lowest power consumption of 1 00 nA with 5pS wake-up time. The new Atmel AVR® XMEGA® family includes full-speed USB, the fastest and highest-precision analog systems, a Direct Memory Access (DMA) controller and the innovative event system that maximize real-time performance and throughput while reducing CPU load. This new family lowers overall system cost through higher integration, capacitive touch support, and ultra-low power consumption. The AVR XMEGA microcontrollers are designed for applications in the industrial, consumer, metering and medical segments. The new AVR XMEGA MCUs integrate full-speed USB connectivity with unique functions that reduce overhead and provide higher data rates. Using the high-precision internal oscillator in the AVR XMEGA, designers can lower the system cost by eliminating the crystal oscillator traditionally required for full- speed USB. Atmel provides free software A digital oscilloscope for the analog world The new PicoScope 4262 from Pico Technology is a 2-channel, 16-bit very-high- resolution oscilloscope (VHRO) with a built-in low-distortion signal generator. With its 5 MHz bandwidth, it can easily analyze audio, ultrasonic and vibration signals, characterize noise in switched mode power supplies, measure distortion, and perform a wide range of precision measurement tasks. The PicoScope 4262 is a full-featured oscilloscope, with a function generator and arbitrary waveform generator that includes a sweep function to enable frequency response analysis. It also offers mask limit testing, math and reference channels, advanced triggering, serial decoding, automatic measurements and color persistence display. When used in spectrum analyzer mode, the scope provides a menu of eleven automatic frequency-domain measurements such as IMD, THD, SFDR and SNR. Its performance is so good that it rivals many dedicated audio analyzers and dynamic signal analyzers costing several times the price. The PicoScope 4262 connects to any Windows XP, Vista or Windows 7 computer with a USB 2.0 port. You can use it with a PC to save space on your workbench, or connect it to a laptop to create a portable instrument that’s perfect for field servicing and on-site work. As it is USB-powered, there is no need to carry a separate AC adapter. If you want to write you r own application to control the scope or use it as a digitizer, Pico provides a software development kit, including example code, free of charge. The PicoScope 4262 oscilloscope is on sale now, priced at only £750 including two probes, a carry case and a 5-year parts and labor warranty. Order from your local distributor or visit the Picotech website. www.picotech.com (110604-II) for all common USB device classes in the AVR Software Framework, which is a complete software package that includes drivers and communication stacks for AVR microcontrollers. The AVR XMEGA family has unique high- precision analogue functions. The family includes two 12-bit analogue-to-digital converters (ADCs) with programmable gain stages that remove the need for external amplifiers. The ADCs operate down to 1 .6V operating voltage, and have a combined sample rate up to 4MSPS. The two 1 2-bit digital-to-analog converters (DACs) also support systems that need fast and high- precision analog output. The DACs can drive high loads to reduce external driver component costs, while built-in current outputs enable embedded applications to remove external resistors or other constant current sources. The Atmel AVR XMEGA family is the only 8/16-bit MCU in the market with DMA, Controller and Event System. Peripherals and communication modules can utilize the DMA system to move data so the AVR XMEGA CPU has more idle time to save power or to perform other tasks. The innovative event system enables direct inter-peripheral signalling for short and 100% predictable response time without interrupt and CPU usage. Designers can now develop a solution with predictable real-time performance and data throughput even under a high system load. Other functions such as hardware AES and DES encryption and decryption ensure fast and low-power secure communication. Cryptography protects important intellectual software 10 09-2011 elektor NEWS & NEW PRODUCTS property during remote programming and firmware distribution. Atmel AVR XMEGA can also easily realize robust touch sensing interfaces through the Atmel QTouch® Library, enabling buttons, sliders, wheels or proximity for user interfaces. All devices include the Atmel picoPower ultra-low power technology with true 1 .6 V operation, accurate real time clock (RTC) operation and full data retention at the industry-leading current consumption of 500 nA. www.atmel.com (110582-XVl) BASIC ON BOARD - programming - quick and easy BASIC ON BOARD from Atria Technologies is a Basic interpreter that is pre-programmed on many of the ForeRunner microcontroller modules from ATRIA Technologies. BASIC ON BOARD is a derivative of the popular StickOS™ Basic developed by the talented software engineer Richard Testardi. BASIC ON BOARD is the perfect tool to learn programming, explore microcontrollers, design prototypes, build home projects and even small products. To get started all you need is a terminal emulator. BASIC ON BOARD enables access to many of the features of a microcontroller using built in commands, pin and register variables. • Write text to a display: led 1 , "Hello World" Read a 4x4 keypad: on keychar do go sub KYPD • Create a timer interrupt: on timer 1 do gosub clock • Write to an IIC device: i2c start 0x68, i2c write t, i2c stop Common features such as console 10 and string handling are available. With the popular HD44780 interface, a character LCD can be directly controlled with a single command. A 4 x 4 keypad may be read as an interrupt. ForeRunner microcontroller modules with BASIC ON BOARD start at $24. wwwAtriaTechnologies.com (110604-I) It’s a facebook for coders Libstockis a community website created by mikroElektronika, allowing users to share their projects and libraries. It was created to provide the community with the right and necessary infrastructure. Libstock is a powerful concept, encapsulating many useful features for easier navigation, flexibility in code presentation, and mechanisms to getting what you are seeking for, using categories, search, sorting and filters. Libstock allows you to stay in touch with your fellow contributors, to be notified of code changes, to discuss code implementation, but also express your wishes for future development. Libstock is far more comprehensive and user-friendly than any other embedded community website. It’s the best place for codel Libstock allows sharing of three major code types: Libraries, Projects and Visual TFT/GLCD projects. But within those types, we have allowed you to share whatever is necessary. or whatever you find suitable and helpful to the end user. For example, if you want to share your library, you can also provide examples, connections schematics, help files, datasheets, additional documentation, and even PCB designs if you like. But Libstock is much more than that. It’s like Facebook for coders! We can have our own profiles where we can put information about ourselves we find relevant, and which may boost confidence of others in our code. It will bring a face and personality to our communication. www.libstock.com (110604-lil) Zphono-USB preamplifier The Parasound Zphono-USB is a premium phono preamplifier with an A-D converter to translate vinyl LPs into digital audio for your Mac or PC via USB. RIAA EQ defeat capability for the USB output enables users to apply of more precise software-based equalization in their selected recording software. The Zphono-USB also provides two pairs of line level inputs. Zphono-USB is a compact preamplifier for moving coil and moving magnet (MC / MM) phonograph cartridges and line-level analog sources. For new media applications, Zphono-USB also adds an analog-to-digital (A-D) converter with a USB port to transfer Advertisement ubsiucA n* 0 v* PCBs Muuuuch Cheape (?£L * * W No-frills policy 16,94 EURO 5 pebs, 1 08 mm h 1 00 mm *per piece, incl. URT (21%) + shipping costs e. g. Germany * Jatfaltaci EURO ujiiiiu.jackaltac.com elektor 09-2011 n NEWS & NEW PRODUCTS media. Zphono-USB is the newest of the company’s Z-Series family of half-rack- width components. First of all, the Parasound Zphono-USB is a high-quality analog phono preamplifier engineered for the optimum in playback quality for vinyl LPs. Like its predecessor, the Zphono analog phono preamplifier, which continues in the line, Zphono-USB uses high quality parts and precision RIAA equalization to achieve extremely low levels of noise and distortion, and accurate frequency response. For the digital realm, the Parasound Zphono-USB also includes an adjustable USB gain control and defeatable RIAA equalization to improve the quality of audio transfers from LPs to digital media. The USB gain control and USB clipping indicator are used to optimize the digital record-output levels for the optimum signal-to-noise ratio with all recording software programs. For those using sophisticated digital music software in their PCs or Macs, the rear-panel RIAA defeat switch allows users to bypass the internal hardware-based RIAA phono equalization in favor of software-based digital equalization. These capabilities are provided only for the rear panel USB digital output. The Parasound Zphono-USB has a stereo input for an MC or MM phonograph cartridge, and two stereo line-level inputs to facilitate digital transfers of analog sources such as a tuner, CD player or tape deck. Rear-panel settings for MM-47 k, MC-47 k or MC-1 00 ca rtridges allow the user to select the ideal impedance matching for their phono cartridge. Front panel rumble- filter and mono/stereo switches are also available to refine the quality of phono playback for older LPs and mono LPs. There is a single pair of fixed-level line- level outputs and a headphone output. The Zphono-USB has dual power transformers and analog power supplies to minimize noise and an AC polarity reverse switch to combat hum issues related to power line polarity. The Parasound Zphono-USB is the newest of many Z-Series components, each of which is one rack-space high and only one half rack-space wide. These Z-Series products are popular as stand-alone components and they can be easily rack-mounted using optional inexpensive adaptors. The Parasound Zphono-USB will be available in the first week of September with a manufacturer’s suggested retail price of $350. Parasound’s products are available from quality audio/video retailers, and select custom installation specialists. www.parasound.com (110604-V) Powerful multichannel audio signal processor Signal Wizard 3.0 is a very powerful audio signal processor that features multichannel synchronous processing. It can mix, amplify, filter, delay and adjust the phase of individual input signals, selected by using the included intuitive PC software. Signal Wizard 3.0 features a 24-bit, 96 kHz codec with six analog input and eight analog output channels, and an internal DSP processing speed of 0.6 GMACs. Signal Wizard 3.0 also incorporates two digital audio (S/PDIF) inputs and outputs. Uke its two channel equivalent Signal Wizard 2.5, the software requires no knowledge of mathematics or programming. Signal Wizard 3.0 includes very powerful mixer functions - any channel can be blended with any or all of the other channels in any proportion, since the system incorporates mixer units at the input and output signal stages. Signal Wizard 3.0’s unique filter design engine enables standard filter types to be created using the easy-to-use graphical software, but it also allows completely arbitrary frequency responses, both in amplitude and phase, to be realized via a simple text file import. The Signal Wizard 3.0 design features six analog and two digital (S/PDIF) audio input channels, a first stage flexible 8x8 mixer unit, a multichannel gain stage, a multichannel filter/ phase stage, a multichannel delay, a final stage flexible 8x8 mixer unit, and eight analog and two digital audio output channels. Sample rates are selectable from 96 kHz down to 3 kHz. Also included are USB, parallel and JTAG interfaces, enabling Signal Wizard 3.0 to be programmed in native DSP assembly code or high level languages such as C++ using third party compilers. Performing up to 588 million multiplications and additions per second, Signal Wizard 3.0*s high quality analog signal conditioning with stereo 24-bit resolution is sufficient for the most demanding applications. Signal Wizard 3.0 brings the power of digital signal processing to any audio-bandwidth domain that requires electronic signal filtering. Originally developed for teaching environments covering DSP principles and practical applications, Signal Wizard products are suitable for a wider range of engineering uses. Applications include: audio and sensor signal processing and conditioning, signal analysis, vibration analysis, education and research in electrical, electronic and other physical sciences, multichannel filtering, crossover networks, surround sound processing, adaptive filtering, inverse filters, echo, real-time gain control, mixing, phase delays, time delays, sound focusing and beam forming, real-time FFT and waveform capture, Hilbert transform, quadrature signal processing, envelope detection, etc. Designed and developed by Signal Wizard Systems at the University of Manchester (UK), Signal Wizard 3.0 is priced at $1 199.00 but is available now at an introductory price of $999.00 from Saelig Company, Inc. www.saelig.com (110604-IV) 12 09-20T1 elektor QUASAR electronics Softjfiant far Horne, Uucuti bn A fncksshy Since f993 Quasar Electronics Limited PO Box 6935, Bishops Stortford CM23 4WP. United Kingdom Tel: 01279 467799 Fax: 01279 267799 E-mail: sales@quasarelectronics.com Web: www.quasarelectronics.com All prices INCLUDE 20.0% VAT. I Postage & Packing Options (Up to 0 5Kg gross weight): UK Standard 3-7 Day Delivery - £4.95; UK Mainland Next Day Delivery - £1 1 .95; Europe (EU) - * £12.95; Rest of World - £14 95 (up to 0.5Kg). Order online for reduced price Postage (from just £1) Payment We accept all major credit/debit cards. Make PO’s payable to Quasar Electronics. Please v sit our online shop now for full details of over 500 electronic kits, projects modules and publications. Discounts for bulk quantities. VISA VfSA Electron M&esire SOLO PIC & ATMEL Programmers We have a wide range of low cost PIC and ATMEL Programmers. Complete range and documentation available from our web site. Programmer Accessories: 40-pin Wide ZIF socket (ZIF40W) £14.95 18Vdc Power supply (PSU121) £24.95 Leads: Parallel (LDC136) £3.95 / Serial (LDC441) £3.95 / USB (LDC644) £2.95 USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP soft- ware. See website for PICs supported. ZIF Socket and USB lead extra. 18Vdc. Kit Order Code: 3149EKT - £49.95 Assembled Order Code: AS3149E - £59.95 Assembled with ZIF socket Order Code: AS3149EZIF- £74.95 USB Flash/OTP PIC Programmer USB PIC programmer for a wide USB^ range of Flash & OTP devices — see website for details. Free Win- dows Software. ZIF Socket and USB lead not included. Supply: 16-18Vdc. Assembled Order Code: AS3150 - £49.95 Assembled with ZIF socket Order Code: AS3150ZIF -£64.95 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. 4 LED’s display the status. ZIF sockets not included. Supply: 16Vdc. Kit Order Code: 3123KT - £28.95 Assembled Order Code: AS3123 - £39.95 Introduction to PIC Programming Go from complete beginner to burning a PIC and writing code in no time! Includes 49 page step-by-step PDF Tutorial Manual, Program- ming Hardware (with LED test section), Win 3.11 — XP Programming Software (Program, Read, Verify & Erase), and 1 rewritable PIC16F84A that you can use with different code (4 detailed examples pro- vided for you to leam from). PC parallel port. Kit Order Code: 3081 KT - £16.95 Assembled Order Code: AS3081 - £24.95 PIC Programmer Board Low cost PIC program- mer board supporting a wide range of Micro- chip© PIC™ microcon- trollers. Requires PC serial port. Windows interface supplied. Kit Order Code: K8076KT - £39.95 PIC Programmer & Experimenter Board The PIC Programmer & Experimenter Board with test buttons and LED indi- cators to carry out educa- tional experiments, such as the supplied programming examples. In- cludes a 16F627 Flash Microcontroller that can be reprogrammed up to 1000 times for experimenting at will. Software to compile and program your source code is included. Kit Order Code: K8048KT - £39.95 Assembled Order Code: VM1 1 1 - £59.95 4-Ch DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. 130 x 110 x 30mm. Power: 12Vdc. Kit Order Code: 3140KT - £79.95 Assembled Order Code: AS3140 - £94.95 Controllers & Loggers Here are just a few of the controller and data acquisition and control units we have. See website for full details. 12Vdc PSU for all units: Order Code PSU303 £9.95 USB Experiment Interface Board 5 digital input chan- nels and 8 digital out- put channels plus two analogue inputs and two analogue outputs with 8 bit resolution. Kit Order Code: K8055KT - £39.95 Assembled Order Code: VM1 10 - £64.95 Rolling Code 4-Channel UHF Remote State-of-the-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two Elektor 2011 10k A P07 PCS P03 Ft)4 ,| ® GjS • M 1g PAt RA2 RA3 PA4 PAS PAS PAI PCI PCS -J I m m i — i ■ AR£F^ A — /V — /N — — /s — /v J • ■ITriB E3E§ 1 1 a » ff I S e 1 g i 3 £ • !■ C6 1 /c n. If A N M * A o I u ■ a: ISP I I I K3 z • IC1 I \n -t > CMn) rst PBi5LP;«T13l PBB0HISOC*fTH) PAKALCAPCINTI) pC4(moiPcanai PAKAOCWCWrq PCS(TT*PC KT2!) PAfl(ADCWPCISfrB» PCSfTDSClfCfnTZ) PAflAUCTiPCIHTT) pcmoscapcArmi JP8 dDD- 1 P90 2 PBt > i pea'' 4 to’' 5 PB4 H 6 Ptt > 7 FBB S 8 to’' 22 \ PCD 23 pcP U PC2 S 25 PCl'' ZB pc* S Z7 pcs'' 1 &L P90 TO HK TO TO PBS K2 VCC © 21 JS Jo. frs 8U_ 10DR RHP pom PTOAtt OH o FTDI 11 A VCC VCC AREF PBoncpiajaypcmiTB) PB1(0C1M>dNTH PB2fSSAXlB'PaNTZl PU«KSX)C2MCMT9 TOMSOPCMrTO PWXTALI/niSCVPCMTl to on AL2n asa'P a«rt7i K2 PCOiADCW>aNTI| PCI(AOCVPCHTB) 1 1 M Kfi 1 1 ran J 1 1 ! PCT row* i 2 r\ 21 pa ^ 1 3 3 ! PC2 S | 4 n V-r O 4 4 PC3 ^ 'fW * 5 S ! PC4 N '\Kb ! B fit PCS ^ ^FDi 1 7 ^TO | B 1 A 1 rv 10 PCS MEGAISUStf&WlZM P01(TXDOPCWT2E) ptcmTawovpcsras P0B«miD15>C*fT27) P04tDC1BrtCK VPQKT25) PtKOCIA PONT 2® Pt>«CPVaC2B/PCNT3q| PO7(0C2A PCMTOD GMO CTALI m L2 OK) 10C89C 11 18 10-20T1 elektor MICROCONTROLLERS Platino to star in Elektor/element-14 webinar The family Platino does not deny his heritage and proudly shows his descent from the ATM 1 8 BASCOM-AVR/AVR-GCC lineage. When Platino provides accommodation to a 28-pin microprocessor, he does not have the use of the AD6and AD7 signals that his little nephew the ATM! 8 [4] has, so they are not completely compatible. But if these signals are indispensable for a par- ticular application then it is sufficient to replace the microprocessor with a type that has 40 pins. It is probably necessary to reconfigure a few ports or move a few wires because the vast majority of microprocessors has a port A, which the little micropro- cessor does not have. In honour of a distant family member of the extended AVR microprocessor family of development boards, Platino has ensured that the control of the LCD is compat- ible with the Mikroelektronika libraries, which uses port D by default in 4-bit mode. In spite of a few exceptions, Platino is a practical, modest and approachable cir- cuit board who would love nothing more than to serve a broad audience. That is why everybody adores him. Internet Links [1 ] Platino: www.elektor.com/ 1 00892 [2] J 2 B: www.elektor.com/ 1 10274 [4] ATM 1 8: www.elektor.com/atm18 [3] Arduino : www.elektor.com/080931 Function jumper My choice Buzzer BUZ1 on PB4 or PC4 jpi □ PC4 DPB4 Selection of power supply voltage from an Arduino shield : 5V or 3.3V. JP2 □3.3V D5V Controlling the backlightvia PB5 or PC5 Note: choosing PB5 here prevents the choice via JP14 . JP3 □ PB5 DPC5 SI connected to PBO or PCO JP4 □ PBO DPCO S2 connected to PB1 or PCI ]P5 □ PCI DPB1 S3 connected to PB2 or PC2 JPG □ PC2 OPB2 S4 connected to PB3 or PC3 JP7 □ PB3 OPC3 Approval to connect PC6 of 1C2 (DIL28) to /Reset. JP8 □PC6 Approval to connect PB7 of IC2 (DIL28) to the crystal. Always use in combination with JP1 0. JP9 □PB7 Approval to connect PB6 of IC2 (DIL28) to the crystal. Always use in combination with JP9. JPI 0 □PB6 Connected with PB5 when using IC2 Connected with PB7 when using IC1 JP11 □PB5 DPB7 Connected with PB4when using IC2 Connected with PB6 when using IC1 JPI 2 □ PB4 DPB6 MOSI-ISP: Connected with PB3when using IC2 Connected with PB5 when using IC1 JPI 3 □ PB3 OPB5 Connect with PB5 for ’’Arduino” compatibility (see also JP3), otherwise with PC7. JP14 □ PB5 DPC7 elektor 10-2011 19 ELECTRIC PROPULSION The Dream of E lectric From the electric airship (1884) to the Green Flight Challenge (2011) The dream of silent, pollution-free flying is now a reality. The first type-certificated aircraft with electric propulsion has been in production now since 2004 and the Airbus parent company EADS has recently tabled a radical design concept for future commercial airliners powered by electricity. We take a look at the emerging technology and the NASA-funded (now also Google) ‘Green Flight Challenge’ eco-aircraft competition, with prize money of 1.65 million dollars up for grabs it promises to be the most rewarding aviation contest yet devised. The fossil fuel debate invariably focuses on the motor car because this is where the biggest differences can be made. Up in the sky however there is also a quiet revolution going on. Electrically pro- pelled flight actually predates (by almost 20 years) the Wright Figure 1 . Pure innovation: The airship ‘La France’ in 1 884, it was the first steerable airship, the first to have electric drive and the first to use Redox flow Batteries. Image: Wikimedia Commons/Photo (1885), 2001 National Air and Space Museum, Smithsonian Institution. brothers first heavier-than-air flight. Back in 1 884 the airship ‘La France’ lumbered through the sky propelled and steered by an elec- tric motor driven by a battery. From electric airship to electric flight The airship ‘La France’ that Charles Renard and Arthur Krebs built close to Paris (Figure 1) was powered by a 5.6 kW (later 6.3 kW) DC-Motor [1 ] from energy stored in a 435 kg zinc/chlorine flow bat- tery. The battery which Renard invented was the first example of a ‘Redox flow battery’ [2] and was to be reinvented in the 1950s. It is still in use today to smooth demand peaks in power networks. After ‘La France’ made its last voyage the electric motor as a primary means of propulsion made an exit from our skies and 70 (noisy) years passed before it reappeared. The model aircraft designer Fred Militky made many attempts to build electrically powered models before his ‘Silentius’ [3] was intro- duced in kit-form in 1960 byGraupner. The power to swing the large folding propeller was provided by a 2 to 4 V coreless motor-gearbox (Micro T 03/1 5) from Faulhaber drawing a current of 1 .5 A, i.e. little 20 10-2011 elektor ELECTRIC PROPULSION Flight more than 5 W with an efficiency of just 70 %. Energy came from two sealed 2 V lead/acid batteries from Rulag. The 1 40 gram model can still be built from the plan and after 51 years the original motor is listed in the current Graupner catalogue! [4] We need to wait now until 1 973 to witness the first ‘heavier than air’ manned electric flight; again the initiative came from Fred Militky. E-Motorglider In October 1 973 Fred Militky became the first to pilot an electrically powered aircraft [5]. The flight took place in Weis (Austria) using a motorglider type HB-3 airframe (designed by Heino Brditschka). A 1 0 Kw Bosch DC motor [6] was shoehorned into the space nor- mally filled by a four-stroke VW engine. Power came from a bank of VARTA NiCd rechargeable batteries weighing 125 Kg, giving suf- ficient energy to lift the aircraft up to 1 500 feet for the 25 minute flight. This achievement was not matched until 1 981 when a team working with the pedal powered Gossamer Condor covered one of the flimsy aircraft with solar cells to produce a craft powered by solar energy. While electric drive using power derived purely from solar cells is still experimental, in combination with today’s rechargeable cell technology it is a good solution for some applications. In particu- lar together with a retractable motor/propeller it provides gliders with a self-launch capability, attaining sufficient altitude to allow several hours soaring. In addition it can be deployed to provide a boost between thermals and to assist the homeward leg to the air- field. Conventionally a small, low power (1 5 to 50 kW) two-stroke orWankel motor with a tiny fuel tank would be used but the electric motor has a number of advantages: reduced noise and vibration, more reliable engine starting and running, no requirement for com- plex systems such as an electric starter, propeller brake or parking system to ensure the propeller retracts into the fuselage. For sure an electric motor provides a more elegant solution here. This is how- ever not true of the energy storage system: a full 20 litre petrol tank stores enough energy to supply 1 75 kWh, a similar volume Li-Ion battery pack can only store around 5 kWh and is also much heav- ier. A modern motor and regulator unit can however achieve over 90 % efficiency and this, despite the relatively poor energy density of rechargeable cells is sufficient for the needs of a glider. Given the advantages of electric drive its success will depend on cost. The first commercial electric motorglider (the AE-1 Silent) with retractable propeller built by Air Energy [7] of Aachen (Germany) began development in 1 991 and made its maiden flight in 1 997. In 1 998 it became the first electric aircraft to gain type certification (with 1 2 m span and 1 95 kg empty weight it qualifies in the ultra light category). The motor produces 1 3 kW and weighs 8.5 kg, The Li-Ion batteries weigh 35 kg and store 4.1 kWh. The first high power electric glider was the ‘Anta res’ from Lange Avi- ation [8], which was also employed by DLR as a test bed (Figure 2) for their research into fuel cell technology [9]. The Antares has been in production since 2004 and was the first to use the EM42 electric motor developed by EASA (at the time it was the only one available). The EM42 is a brushless DC motor with a rotating outer casing. It Figure 2. The Antares 20E from Lange Aviation — shown is the DLR- Version with hydrogen tank and fuel cell in pods slung beneath the wing. Image: DLR. measures 25 cm in diameter and 27 cm long, operating from 1 90 to 288 V producing 42 kW (peak) and drawing 1 60 A. Weighing in at 29 kg (plus around 10 kg for the control electronics installed in the fuselage) the production version operates at an efficiency of over 90% giving a maximum torque of 21 6 Nm. The motor and electron- ics [1 0] were developed at the HTA (University) in Biel Switzerland (now renamed BFH Tl Bern) between 1 996 and 1 998. A useful fea- ture of the stepper motor operation is that it allows the prop to be exactly positioned before the unit is retracted. Energy is stored in 72 type VL41 M Li-Ion cells made by SAFT [1 1 ]. Each individual cell is rated at 44 Ah at 3.7 V; in series they pro- duce 266 V and 1 2 kWh. With this amount of power on tap the Antares climbs to 1 000 m in around four minutes and after 1 3 min- utes has reached its maximum of 3000 m! Assuming no assistance from any thermals, this altitude is sufficient for over 1 .5 hours fly- ing time covering a distance of 1 50 km. The electronic system pro- vides motor control, battery supervision (including telemetry via GSM modem) and a built-in battery charger (nine hour recharge cycle from 230 VAC or 1 1 5 VAC). The SAFT cells are good for over 3000 cycles and can be expected to last around 20 years at 20 °C. The batteries have a guaranteed availability up until 2031 . This power drive technology from Lange has also been used to pro- vide a self-launch capability for the high-performance two-seater Arcus sailplane designated the Arcus-E and produced by the Ger- man company Schempp-Hirth Flugzeugbau [12], its first flight was in 2010. The prize for the first two-seater electric aircraft must however go to the Taurus Electro from Pipistrel [13]. Based in Slovenia the com- pany first flew this craft in 2007. The production version has been flying this year and is provisionally classed as an ultralight aircraft. elektor 10-2011 21 ELECTRIC PROPULSION Flvina with a fuel cell Around ten years ago two teams, one from NASA and the other from Boeing set out to develop an aircraft electrically powered by fuel cells. At the Aero 2003 event held in Fried richshafen, Germany the motorglider Super Dimona was presented as a test bed for Boeing fuel cell with a test flight programmed for the 17th December 2003 (100th anniversary of powered flight). In fact it wasn’t until March 2008 that the first manned flight powered by a fuel cell occurred. The available power was an issue with the design and meant that the craft could only sustain level flight. A Li-Ion battery pack was added to provide the extra power necessary for take-off. A complete flight powered by a fuel cell alone was not achieved until July 2009 with an A ntares-E- motorglider described in this article, Provided by the com- pany DLR as a research platform the aircraft was designated Antares DLR-H2 [27] featuring an external hydrogen tank and 25 kW fuel cell unit slung beneath the wings in two pods. The Antares DLR-H2 achieved a speed of 170 km/h and 750 km range during a five hour flight when it set a new altitude record of 2558 metres. Since 2010 work has progressed with its successor the DLR-H3 [28]. The drive system uses an external rotor motor providing 40 kW start and 30 kW continuous power. The battery pack contains 128 or optionally 192 LiPo 10 Ah cells giving 4.75 kWh or 7.1 kWh (bat- tery weight 42 kg or 55.6 kg). The Taurus will form the basis for Pip- istrel’s entry into the ‘Green Flight Challenge* aircraft competition. Experimental From the motor assisted parachute to the electric helicopter from Sikorsky we have witnessed a leap of interest in electrically powered aircraft over the last ten years mainly brought about by the intro- duction of novel new materials and improved motor/battery tech- nology. Many of the designs are a result of ‘electrifying’ an exist- ing aircraft, mostly either amateur or ultralight aircraft. A team from Turin university took a two seater ultralight aircraft type Alpi 300 and fitted it with a 62 kW electric motor and managed to seta world speed record for electrically powered craft of 250 km/h [14] which still stands today. Flight times are however limited to just 1 5 minutes. The helicopter manufacturer Sikorsky have an ongo- ing project Firefly [15] where the conventional power plant of a (Hughes/ Schweizer 300) helicopter has been replaced by a 1 40 kW Figure 3. The Yuneec E430 is the first electric aircraft from China developed by a model aircraft manufacturer. Image: Yuneec. This is again based on the Antares-E and features 4 wing pods and a non- re tractable tail-mounted pusher prop. With its 23 m wing span this new design promises a range of around 6000 km and a flying time of 50 hours with a 200 kg payload. (Image: DLR). electric motor. Power is supplied from a bank of Li-Ion rechargea- bles. Cessna have collaborated on a conversion of one of their Cl 7 2 (the most produced four seater aircraft in the world) light aircraft to demonstrate electric flight possibilities (at least for a few minutes anyway) [16]. There have also been a number of new designs specifically intended for electric flight: the two-seater Yuneec E430 [17] from China (Figure 3) and the single seat Elektra One (Figure 4) from the Ger- man design company PC-Aero [18]. While the Yuneec is designed as a passenger motorglider, the Elektra One is more compact and employs efficient aerodynamics to conserve energy. See Table 1 to compare their specifications. Tian Yu the founder of Yuneec has for many years specialised in the supply of electric model aircraft and their components. Only recently has he branched out into full-scale versions. Green Flight Challenge To encourage teams working on sustainable flight technologies NASA (and now Google) are sponsoring to the tune of 1 .65 million dollars the Green Flight Challenge (GFC). The contest designed by Figure 4. Elektra One from PC-Aero for the Green Flight Challenge (GFC). Uses solar panels on the hangar roof to recharge. Image: PC-Aero, Copyright Shahn Sederberg. 22 10-20TI elektor ELECTRIC PROPULSION CAFE (Comparative Aircraft Flight Efficiency Foundation) [19] will take place from the 25 th September until the 3 rd October 201 1 in Santa Rosa California. The competition rules do not stipulate any particular method of pro- pulsion. Team aircraft must fly 200 miles (322 km) in less than two hours using the energy equivalent or less than 1 gallon of petrol or 33.7 kWh (the equivalent energy) per occupant. Everyone seated in the aircraft counts as a passenger so for a two-seater the upper limit of fuel consumption is 2.36 1/100 km while a single-seater is allowed just 1.18 1/100 km! The equivalents for electric aircraft are 21 kWh for a two-seater and 1 0.5 kWh per 1 00 km for a single-seater. Thirteen teams have qualified for the competition (Table 2), dem- Table i. Comparison of Elektra One and Yuneec E 430 Elektra One Yuneec 430 Number of seats 1 2 Wing span 8.6 m 13.8 m Empty weight (no batteries) 1 00 kg 171.5 kg Battery weight 1 00 kg max 83.5 kg Empty weight (incl. batteries) 200 kg max 255 kg Payload 1 00 kg 175 kg Max. weight 300 kg 430 kg Max. power 1 6 kW (22 HP) 40 l 3 h ca. 2 h* Operating range 500 km max ca. 1 90 km* * Provisional figure Table 2 . The Green Flight Challenge Teams and aircraft No. Team Aircraft (name) No of seats Wingspan Max power Power source 1 Einar Enevoldson PC Aero (Germany) Elektra 1 1 8.6 m (28.2 ft) 16 l90% Cruising speed 140 to 235 km/h Max. climb rate at 850 kg 4.5 m/s Flight duration 4 h approx Range >400 km ers and motorised parachutes [22] a practical proposition. With further development like the E-Genius and the Elektra 1 it is likely that a market will open up for passenger motorgliders and ultra- lights. Linked together with solar PV modules fitted to the aircraft hanger (PC-Aero/SolarWorld), transport trailer (Taurus-G2/Pipistrel) or a wind turbine (Arcus-E/Windreich) to charge the batteries. The dream of emission-free flying using totally renewable resources is now reality. An aircraft using hybrid technology is also conceivable such as the design proposal by Flight Design [23] and EADS/Siemens/Diamond- Aircraft [24] which have already been demonstrated. The next step can only come when improvements to battery tech- nology make it possible. The Slovenian manufacturer Pipistrel has the vision and faith to have designed not only a hybrid passenger aircraft but also a pure electric version called the Panther [25]. The Figure 8. Originally the ‘Hydrogenius’ this fuel cell concept e-Genius from Stuttgart University is a very efficient electric flyer competing in the GFC contest. Image: e-Genius-Team, IFB University Stuttgart. water-cooled 1 45 kW electric motor is already used in the GFC Tau- rus-G4 (Figure 7). Scaling things up a bit the Airbus mother concern EADS has pro- posed an electric ducted fan unit to power future commercial air- craft. This VoltAir concept [26] published in May gives a optimistic glimpse into what may be the future for air travel. The design envi- sions a system using easily interchangeable Lithium/air batteries with an energy density of 1 000 Wh/kg. The electric engine employs super-conducting materials cooled with liquid nitrogen (Figure 9). With a projected 7-8 kW/kg the power plant would have a better power to weight ratio than contemporary turbo prop designs. It could be within the next 25 years that we at last realise the dream of quiet, emission-free, economical and more comfortable long- haul flying compared to the ecological nightmare of our present day technology. (110496) Figure 9. A look into the future according to EADS (Airbus parent company). Using superconducting materials, liquid nitrogen and (much) better batteries, condensation trails will be just a faint memory. Image: EADS. 26 10-2011 elektor Take out a free subscription to E-weekly now Do you want to stay up to date with electronics and computer technology? Always looking for useful hints, tips and interesting offers? Subscribe now to E-weekly, the free Elektor Newsletter. Your benefits: • The latest news on electronics in your own mailbox each friday • Free access to the News Archive on the Elektor website • You're authorized to post replies and new topics in our forum Register today on www.elektor.com/newsletter THE ORICINAi SINCE i?‘ii PCB-Pnni FITS-0R-N0T! Hands-on collision check! assembly service! From as little as one component r- cool! Alu-Core IMS PCBs ? The Elektor Electronic Toolbox Elektor now offers an App you cannot afford to miss on your iPhone, iPod Touch or iPad. The Elektor Electronic Toolbox is a collection of no fewer than 28 electronic tools that can be picked from a comprehensive set of icons! Highlights: - Databases for Transistors, FETs, Triacs, Thyristors, Diodes and ICs - NE555 circuit design - An Ohms Law calculator - Schematic Diagrams - Number base converter - LED/ resistor calculation - R/L and BJT calculations - And more Now available from Apple ilimes Store (or just S 5.9S| €4.99. Further information at www.elektor.com/.app . til k 1 elektor 10-2011 27 JTAG INTERFACE Testing using the JTAG Interface By Rob Staals, JTAG Technologies (The Netherlands) Testing printed circuit boards by hand is difficult, if not impossible, when using complex ICs and multilayer printed circuit boards. Fortunately most of these ICs now contain special logic which allows extensive testing of the chip’s internal connections and the interconnections on the circuit board. This is achieved by using the internationally standardised JTAG-interface. Once the assembly of a prototype or final product is complete, you want to know as quickly as possible whether the circuit is working correctly. The power supply is connected and you wait with sus- pense what is going to happen. A prototype usually does not work the first time or perhaps works only partially. Where is the problem, is it the design or is it because a few parts aren’t mounted correctly? Quite quickly you will reach for an oscilloscope or multimeter to verify whether the signals are correct or to check the connections between parts. These days, with multilayer boards containing fine- pitch and/or BGA components this is practically impossible how- ever. So how can you test these boards? A frequently used method is a functional test. Using special soft- ware test-routines the functionality of the board is examined. An important prerequisite of this is that the core of the circuit is func- tional; if it is not, then you cannot proceed with a functional test. Diagnosing the actual fault using a functional test can be difficult. For example, the test may indicate that there is a problem with the memory section, but you don’t know which pin specifically is caus- ing the problem. You can also choose to do a structural test. If all the components on the circuit board are correctly intercon- nected, then the circuit has to work, unless there is a fault in the design. This approach makes the assumption that all the compo- nents used are okay. In other words: the objective is to demonstrate that all components are soldered correctly. The simplest method is to use a multimeter to carry out a continuity test between all com- ponents (see Figure 1 ). The main advantage of such a structural test is that the exact loca- tion of the problem will be known. A pin that’s not soldered properly or is shorted to another pin is immediately discovered. In order to obtain substantial test coverage and to be able to arrive at the cor- rect diagnosis it is necessary to test a large number of points. For this purpose, test pads are often added to the board. However, test pads cost money and require space. So modern designs with high component density have an immedi- ate problem. On a multilayer-board with fine-pitch or BGA compo- nents there is no room for test pins. Even worse, test pins can easily create a short between component pins (Figure 2). To solve this problem, during the eighties, the Boundary Scan (Bscan) technique was developed. The Boundary Scan architecture Take a microcontroller as an example. In addition to the core, which provides the actual functionality of the chip, the silicon also accom- modates the necessary hardware for Bscan. This additional hard- 28 10-2011 elektor I TAG INTERFACE ware consists of, among others, a Bypass, an Instruction and a Boundary Scan register and a controller. The Bscan register (BSR) is formed from transparent cells sitting between the connection pins and the core. There are also a few additional pins: TDI (Test Data In), TDO (Test Data Out), TCK (Test Clock), TMS (Test Mode Select) and optionally TRST (Test Reset ), see Figure 3. Synchronous with the clock on TCK, bits can be shifted in via TDI and bits then exit via TDO. The actual path that these bits take is determined by clocking a specific command into the controller via TMS. There are commands to insert the Bypass-, Instruction- or BSR register in the TDI— >TDO path. The TDI-, TDO-, TMS-, TCK- and TRST-pins collectively form the Test Access Port (TAP), known to many as the JTAG interface. A large number of components already contains this JTAG interface and is by default suitable for the application of Bscan. r How does Boundary Scan work? By inserting the BSR into the TDI-VTDO path, any arbitrary bit pattern can be shifted into the Bscan cells via the TDI pin. By issu- ing an ‘Update’ the data in the BSR is copied to the connection pins. In the opposite manner, the ‘Capture’ instruction reads the data at the connection pins and copies it into the BSR. The contents of the BSR can then be shifted out via TDO. These two actions of ‘driving’ and ‘sensing’ are used to test the connections between components. Example 1 By connecting the TDI of one Bscan chip to the TDO of a nother one, a Bscan chain is formed. To ensure correct synchronisation the TCK- and TMS signals of the TAP are directly connected to each chip indi- vidually (see Figure 4). In principle, an unlimited number of Bscan components can be joined to form the chain. However, for practi- cal reasons this is usually limited to about 1 0 Bscan components. Figure 4 makes the assumption of a chain of two Bscan compo- nents, a microcontroller and an FPGA. This chain comprises the Bscan cells of IC1 plus the Bscan cells of IC2. According to the sche- matic, IC1 and IC2 are connected to each other via interconnects Net_1 through Net_5. The question is to verify whether this factu- ally the case on the circuit board. In other words: we have to check whether the connecting pins of IC1 and IC2 are soldered correctly and that there are no open circuits or short circuits between them. Behind each pin that is connected to Net_1 - Net_5 there is a cor- responding Bscan cell. These are the cells that will be used to test the connections. The first step is to put the combined chain in the TDI-»TDO path. After that, an appropriate vector is shifted into the BSR so that the Bscan cells of IC1 that belong to Net_1-Net_5 contain logic ones. Note that while the shifting is taking place the actual state of the pins does not change. Only the moment after an ‘Update’ is this data in the Bscan cells applied to the connecting pins. The vector Figure 1 . The simplest method to check whether components are correctly connected to each other is to carry out a continuity test with a multimeter. Where to contact ? BGA BGA A loon; 12 Figure 2. On a multilayer board with fine-pitch or BGA components there is no room for test pins. * 1 1 1 11 * is now on Net_1 -Net_5 (Figure 5). The next step is to read the vector which is on Net_1 -Net_5 into the corresponding Bscan cells of IC2 using a ‘Capture’ (Figure 6). After reading the vector, the entire contents of the BSR is shifted Bypass ID Register TDO 100012 - 13 Test Clock (TCK) Test Mode Select (TMS) Test Reset (TRST) optional Boundary -scan cells form BSR register Instruction Reg. | Controller Figure 3. Additional hardware is integrated into a Bscan chip. This comprises, among others, an Instruction- and a Boundary Scan register and a controller. elektor 10-2011 29 JTAC INTERFACE Shit Util -*70l | Instruction Reg, | IP Hflj lUEf | Jinrm tck • Shift 1 TUS t —0—4 Ml 1 . A i i MM ! rsrn a Mil 1 i— 3 4 _ MM* J a * 1 | ft I Fj * ft i j Core | Inttructioo Reg, | 1b IWgjnei | r^n TDD Figure 4. Here two Bscan components are interconnected, a microcontroller and an FPGA. ici TDI— ♦ Core ♦4- Bypre | Inwrucfloo O ID Aharon □ USMTTTulla nnnnrLTCK Update' TIE IC2 ■i — 0" Core | Insmicttoo Beg. tDftgtfggf | TOO Figure 5. The vector '1 11 1 ’ is placed on the interconnects Net_1 through Net_5. ICI IC2 Figure 6. By using a ‘Capture’, the vector on Net_l - Net_5 is read into the corresponding Bscan cells of IC2. out. Software is then used to compare the vector obtained with the vector that was expected. The latter has to be ‘1 1 1 1 1 \ however the vector read back is ‘1 1011*. The bit that was read for Net_3 is a ‘O’, while a *1 ’ was expected. This indicates that there is a problem with Net_3. By using a number of clever test vectors it is possible to diagnose that there is an open circuit under the connecting pin of IC2. In this manner it is possible to quickly locate open circuits, short circuits between individual nets and short circuits to Vcc or Gnd. In this example we assume only five connections, in practice there will easily be several tens to hundreds of connections that can be tested in this way. This example explained how the connections between Bscan com- ponents can be tested. In this framework it is important to note that this method a Iso works with components that comply with the IEEE1 19.1 Boundary-scan standard (Bscan compliant). The average board, in addition to one or more Bscan compliant chips also contains a large number of other components such as resistors, RAM, flash memory, I/O, connectors, etc. It is possible to use Bscan for these as well. Example 2 In Figure 7 is a circuit board which contains a pC, FPGA, RAM, flash memory and I/O. Only the pC and FPGA are Bscan compliant. For clarity, the Bscan chain is symbolically indicated with a thick line through these components. The Bscan chain has direct access to the I/O pins of the pC and the FPGA and therefore also to the bus, which contains the address-, data- and control lines. Using theJTAG interface, there is therefore direct access to the connecting pins of, for example, the RAM. To test whether the RAM is connected correctly, special test pat- terns are shifted into the BSR via the JTAG interface. These test patterns consist of address-, data- and control bits. By choosing appropriate data patterns, data can be written to RAM and it can subsequently be read back. Based on these results it is possible to determine whether all the pins of the memory chip are connected properly and in the case of a fault, which pin is causing the problem. In a similar manner, it is also possible to program the flash memory. The data which has to be programmed into flash is integrated into the patterns which are shifted into the BSR. For the testing of the I/O and the connectors this example uses and external Bscan module with a large number of I/O pins. These pins are connected to the connectors on the board. The BSR of the I/O module is connected in series with the chain on the board (Fig- ure 8). In this way the Bscan has complete access to the connec- tors and the I/O block on the circuit board and these can be included in the test. After the board has been tested for any potential manufacturing defects, the JTAG interface is then used to program the software into the internal flash of the pC and to configure the FPGA. Conclusion Boundary scan is eminently suitable testing and on-board program- ming of digital circuit boards. Bscan can also be used in conjunc- tion with non-Bscan components. Since many designs already use Bscan-compliant pCs and CPLD/FPGAs the number of test pads can be greatly reduced. As a consequence, expensive test fixtures 30 io- 2 on elektor £ -5 Figure 7. Here we have a circuit board which contains a jiC, FPGA, RAM, flash memory and I/O. Only the |iC and the FPGA are Bscan compliant. become unnecessary or can be greatly simplified. Thanks to a good diagnosis a problem can be located quickly. Many designers and manufacturing companies recognise these examples and already use Bscan successfully. (100912-1) Internet Link: www.jtag.com Author Contact: robstaals@jtag.com Figure 8. To test the I/O and the connectors we use here an external Bscan module with a large number of l/O-pins. These pins are connected to the connectors on the board. TO CELEBRATE OUR 20TH YEAR, PICO TECHNOLOGY ANNOUNCE... THE 500 MHz PICOSCOPE 6404 I 1 -joii YEARS a. O U l/V O' y a. 500 MHz BANDWIDTH 5 GS/s SAMPLING 1 GS MEMORY BUILT-IN AWG XI 00,000,000 ZOOM ADVANCED TRIGGERS rp TE*R WAHKANri ej x * •if* • /jfigglCTS C L=Z • j i . - . • • - - « NO NEED FOR EXPENSIVE OPTIONAL EXTRAS. INCLUDES: SERIAL DECODING • MASK LIMIT TESTING • SEGMENTED MEMORY... NNV Technology www.picotech.com/scope31 1 1 elektor 10-2011 3i TEST & MEASUREMENT Time Domain Reflectometry Beginner’s guide to locating shorts and opens in long cables Sure, an ohmmeter is a handy instrument for checking wires and cables for opens and shorts. But finding an open or short is not easy when the cable is long, or if the fault is hidden inside a wall or under a street. Finding partial opens or shorts, or just bad connections, is sometimes even tougher. That’s where TDR comes in useful. By Peter A. Stark (USA) TDR stands for two things — the process of Time Domain Reflectometry, or the device that does it, called a Time Domain Reflec- tometer. There is also OTDR, which is Opti- cal TDR for optical fibers. The basic idea is to send a signal, usually a pulse, into the cable or optical fiber, and then see whether a problem in the cable reflects some or all of that pulse back to the input. The nature of that reflection gives us an idea of what the problem is, and the time it takes for the reflection to get back to the input tells us how far away the problem is located. TDR test instruments are generally quite expensive, and not found in the typical enthusiast’s workshop. Even many com- mercial labs can’t afford one. But if you’re willing to make do, you can make useful TDR measurements with just a pulse gen- erator and an oscilloscope. A useful pulse generator can be easily built with little effort, and the oscilloscope need not be expensive. Obviously the better it is, the better your results will be, but even a 1 5-year-old 1 0 MHz scope is good enough — that’s what we used for the photos in this article. Transients and steady-state The circuit in Figure 1 is simple — with the switch open, there’s no current. But close the switch, and Ohm’s Law says that a cur- rent of 0.1 ampere (10 volts divided by 100 ohms) flows in the circuit. But let’s make the circuit a bit more inter- esting: let’s make the wires from the switch to the resistor very long — for instance 186,000 miles long. To keep things sim- ple, assume the wire is perfect and has zero resistance. Now what? Ohm’s Law doesn’t care how long the wire is — it says that / = V/R, so the current is still 0.1 A. But there is more to the story! The reason we picked 1 86,000 miles for the wire is that light travels 1 86,000 miles per second. If we’re at the switch with a tele- scope, looking at the resistor, it takes the light 1 second to reach us. What we see is not what’s there right now, but what was there 1 second ago. When we close the switch, we can’t even be sure that that resis- tor is still there! Suppose there was some practical joker out there who swapped out that resistor for some other value, or even disconnected it, just before we closed the switch? We won’t know until a second later. So how can we know (or better yet, how can the battery know) that it’s supposed to send exactly one-tenth of an ampere down the line to the resistor when you close the switch? The answer is that it doesn’t. The cur- rent that starts down the wire depends on the wire, not the load. Even though we’re assuming that the wire has no resistance, it does still have some inductance (even though it isn’t wound into a coil) and some capacitance between the two wires. This inductance and capacitance limits the inrush current to some value. In our case, it will take that current somewhere over one second to get to the resistor (because cur- rent in wires travels slower than the speed of light), but if the cable happened to be infinitely long, that current would continue going in forever. Knowing the voltage and current, we could calculate an equivalent resistance which would cause the same current to flow. That value is what we call the characteristic impedance of the cable. The symbol for that is Z 0 . (We call it an impedance, even though it behaves like a resistance, just to be more general.) For instance, the coaxial cable used for many antennas has a characteristic imped- 32 10-2011 elektor TEST & MEASUREMENT Pulse „ , Generator H l Oscilloscope 1 S s iWWoog § mi oodi mm oca-. £ Zo 3 : 110235 - 12 Figure 2. Circuit for sending pulses into a cable. Figure 1 . A simple DC circuit ... or is it? anceZ 0 of 50 £2. so if we connected an infi- nitely long length of that cable to our 1 0-V battery, the current going into the cable (still using Ohm’s Law) would be / = V/Z o = 10 V / 5012=0.2 A or 200 mA. OK, let’s assume we’re using something like that coax (but made of perfect wire with zero resistance) between the battery and our 100-£2 resistor in Figure 1. The battery has no way of knowing how long the cable really is, so it starts pumping in 200 mA just in case. I n a bit over one second, that 1 0 volts and 200 milliamperes hits the resistor. At this point, the 1 00-12 resistor raises an objection: “You’ve got either too much current or too little voltage! If you insist on 1 0 V, then I want 0.1 A or 100 mA. But if you give me 200 mA, then the correct voltage is 20 V (V equals / times R). Fix it!” The cable then comes back with, “Let’s compromise. Let’s raise the volt- age a bit and drop the current by the same percentage." So they do a quick calculation and decide to change by 1/3: they will raise the voltage by 1/3 to 13.3 V, and drop the current by the same 1/3 to 133 mA. Now the resistor is happy because /=V/f? = 13.3V/ 10012=0.133 A. which for sure is 1 33 mA. But now there’s a new problem — the volt- age and current at the right end of the cable is different from the left end. So the new voltage and current start traveling back toward the battery. Let’s just consider the voltage: 10 V is traveling left-to-right, but one-third of that (3.3 V) is being reflected back from right to left About a second later, it gets back to the battery, but now the battery says, “Noway, $%& I want 1 0 V!" So it forces the voltage back to 10 V, which also happens to reduce the current. Another second or so later, the resistor... Well, you see what’s happening. The bat- tery keeps dropping the voltage, the resis- tor keeps trying to raise it, and all this time the current is slowly dropping. Eventually things will settle down to 10 V and 0.1 A you would expect, but it takes a while. That ini- tial set of compromises is called a transient ; the eventual settling down to a steady value is called steady state. This interplay between voltage and current happens no matter how long the cable is, but if the cable is very short, it happens very fast. As a rough value, electric signals in a cable travel a bout eight inches per nanosec- ond (which is a billionth of a second), so if the wire from the battery to the resistor is only a foot or two, then the whole thing is over in a few nanoseconds. Before you blink an eye, the voltage and current have settled down to their steady- state values, and nobody ever realizes that a transient ever occurred. You’d need an extremely fast storage oscilloscope to even see it happen. On the other hand, if you have a long enough cable, then even a mod- erately decent scope can see the transient. That’s what TDR or Time Domain Reflectom - etry is all about. The Reflection Coefficient How did the cable and resistor decide that 1/3 or 33% would be a good value to compromise by? They used the following equation: Reflection coefficient = (Z L - Z 0 ) / (Z L + Z 0 ) where Z L is the resistance of the load, and Z 0 is the characteristic impedance of the cable. (As before, they are usually resistive, but engineers use Z for impedance ... just in case.) With our numbers, we have the reflection coefficient = (100*2-5012)/ (100*2 + 50) = 50*2 / 1 50*2 = 0.333= 1/3. This is called the reflection coefficient because it tells us what fraction of the outgoing signal gets reflected back to the beginning. The reflection coefficient can be positive, as here, or negative (if Z 0 - Z L is negative) or even zero (if Z L equals Z 0 ), so the reflection can be positive, negative, or zero. Pulses are better Suppose that, instead of closing the switch and leaving it closed, we close it for just an instant and then immediately open it again. The 10 V will be just a short pulse travelling right; the reflection of 3.3 V will also be just a short pulse coming back a while later. Since there is just one pulse going down and one back, we’d need a storage scope to cap- ture it, so let’s repeat the pulses at a high rate with a pulse generator, connected as in Figure 2. (If possible, use a 1 0: 1 probe on the scope.) Although the diagram shows a elektor 10-2011 33 TEST & MEASUREMENT Figure 3. Pulse generator output. Figure 4. Pulses reflecting from a 100-ft resistor. Figure 5. Reflection from a short circuit. coaxial cable, any kind of cable would do. Figure 3 shows the generator’s output when fed directly into a scope and no cable. The scope was set to a vertical sen- sitivity of 5 volts per division, and a hori- zontal sweep speed of 0.1 ps per division, so the pulses are about 0.1 ps wide, and about 0.9 ps apart. Let’s now connect 1 00 feet of RG-58U 50-ft coax cable, with the 1 00-ft resistor at the far end, which gives us Figure 4. We see two things: our original pulses have gotten smaller because the cable’s characteristic impedance is loading down the generator, and there is now a small third pulse in the photo. That new pulse (second from the left in the photo) is the reflection of the first pulse from the open end of the cable. It took the pulse about 1 50 ns to travel to the far end of the cable, and another 1 50 ns to return to the scope, so the total delay is about 300 ns or 0.3 ps. So the reflected pulse shows up about 3 divisions to the right of the outgo- ing pulse. (If the scope screen was wider, we could see a reflected pulse to the right of every outgoing pulse.) Since we calcu- lated the reflection coefficient as 1/3, the reflected pulse is about 1/3 the height of the outgoing pulse. There is some loss in the cable, so the returning pulse will generally be a bit smaller than you’d expect. Let’s look at the delay a bit closer. The scope was set to 0.1 ps per division, and the dis- tance between the two pulses is about 3 divisions, so the round-trip time was about 0.3 ps, which translates to 300 ns. To know whether this is right, we need to know how fast electric signals travel in that particular cable (the speed depends on the cable). Looking up the specs for normal RG-58U coaxial cable, we see a parameter called the velocity factor of 0.66. This means that signals in this particular cable travel at 0.66 times the speed of light. Since the speed of light in a vacuum is 1 86,000 miles per second, this translates to 1 86,000 times 0.66, or about 1 23,000 miles per second. We multiply by 5280 to convert miles to feet, which gives us about 648,000,000 feet per second. This works out to about 648 feet per ps, or 0.648 foot (about 7.8 inches) per ns. Therefore the 300 ns delay in Figure 4 works out to 300 times 0.648 feet, or about 194.4 feet. Remember — that’s the round-trip length, which is about right for a 1 00-foot cable. If we could meas- ure the delay more accurately on the scope, we could use this method to measure the length of the cable quite accurately without ever unrolling it off its spool. There’s a catch, of course — we need a good calibrated scope, and we also need to know the exact value of the velocity factor. But a commercial TDR instrument can still do a fairly accurate job at it. What about other loads? Besides the 100-ohm resistor, there are another three values that are of interest — a short (0 ohms), an open (infinity ohms) and a resistor exactly equal to the cable’s characteristic impedance (i.e., Z L =Z 0 ). Let’s take a look at those three cases: A. If the end of the cable is shorted, Z L is 0, and so the reflection coefficient is (Z[_ - Z 0 ) / (Z L + Z 0 ) = (Oft - 50ft) I (0 £1 + 50ft) = 0ft/50ft = -1 This means that 1 00% of the outgoing pulse is reflected, but the voltage is negative so the polarity is reversed. This is shown in Figure 5. B. If the end is open, Z L is infinite, and soZ 0 is so tiny in comparison with the huge Z L that we might as well forget it: (Z L - 50ft) / (Z L + 50ft) - Z L / Z L = +1 The reflection coefficient is plus 1, which means that the entire pulse is again reflected, but this time the polarity is the same. This is shown in Figure 6. C. Finally, suppose the resistor at the end of the cable is equal to the characteristic impedance. Now we have (Z L - Z 0 ) / (Z L + Z 0 ) = (50ft - 50ft) / (50ft + 50ft) = 0/100 = 0 This time the reflection coefficient is 0, so there is no reflection at all. This case is shown in Figure 7, where I put a 51 -ohm resistor at the end of the 50-ohm cable. (There is a slight bump after the outgoing pulse, caused by my 1 00-foot cable actually consisting of two 50-foot lengths coupled 34 10-2011 elektor TEST & MEASUREMENT Figure 6. Pulses bouncing off an open circuit are positive. together. This shows a slight reflection from the point where they connect.) Making the load resistor equal to the char- acteristic impedance of the cable avoids reflections, and is called properly terminat- ing the cable. So here we have an easy way of finding the characteristic impedance of a cable — try putting different value resistors at the end of the cable until there is no reflection, and thenZ 0 is equal to the load resistor value. So all we need is a pulse generator If you happen to have one on your work- bench, youTe all set. But if not, you can build one for less than five dollars. Figure 8 shows a simple schematic to work from. Nothing but a 555 timer which provides very short negative pulses at a rate of about 1 MHz (the exact frequency isn't important, and will vary because of tolerances), fol- lowed by an amplifier to drive the cable. Six digital inverters in parallel invert the pulse to make it positive, and also provide suf- ficient output power. The 33 -Cl resistor at the output increases the output resistance to prevent returning pulses from bouncing off the inverters and going back into the cable a second time. Despite the apparent simplicity of the cir- cuit you need to select our parts carefully. Normal 555 timer ICs don't like to oper- ate at the fast speeds needed, so the best choice is a TLC555 CMOS timer from Texas Instruments. Fortunately, Radio Shack car- ries it as their part number 276-1718. For Figure 7. There is no reflection when correctly terminated. the inverters, a 4069 CMOS hex inverter 1C is recommended mainly because it can be operated at 9 V, so the entire genera- tor can be powered from a 9-volt battery. A TTL 7404 or any of the 74xx04 chips would be pin-compatible, but then you’d need to power both the 555 and the inverter from a 5-volt supply, which increases the com- plexity. The circuit should be simple to con- struct on a small piece of perfboard, or, if you want, a purpose designed printed cir- cuit board. (110235) Figure 8. Pulse generator schematic diagram. Flomeworl<4 U Once you get your pulse generator work- ing, here are some simple experiments you can try. You may need to play with the scope sweep settings to get a steady display: 1 . Get 50 or 1 00 feet of some cable, stretch it out, and ask a friend to con- nect something to the far end. Practice yourTDR techniques with the pulse generator and scope to try to guess what is connected there. The type of cable is not important. 2. See whether it makes much differ- ence whether the cable is stretched straight, or rolled up. 3. Measure the actual length ofthe cable, see how long it takes a pulse to make the round trip, and calculate the veloc- ity factor. 4. See how short the cable can be before the outgoing pulse and the returning pulse blend into each other so you can no longer see them as separate pulses. If the cable is short enough, you may see the two pulses add together to make a pulse of double the voltage. 5. Take some unknown cable, such as ei- ther speaker cable or the zip-cord that is used fortable lamp wiring, and mea- sure its characteristic impedance. 6. Connect two different cables end-to- end. If their characteristic impedances are different enough, you should be able to see a reflection from the con- nection where the two different wires join. 7. Using a resistor equal to Z Q of the cable, connect it to the end of the cable with very short leads. You should see no reflection. Now connect it to the same cable but with 1- or 2-foot clipleads. You will probably see some small but clear reflections — what’s happening? Do the clipleads make a difference? 8. Spend some time thinking about this: Suppose that the signal going into the cable was a sine wave ratherthan pulses. What would happen? elektor 10-2011 35 ZIGBEE TRANSMITTER/RECEIVER 2.4 GHz Transmitter and Receiver for Model Aeroplanes ZigBee technology for model construction By Michel Kuenemann (France) Fora number of years now, remote radio control systems for models that operate in the 2.4 GHz band have been available. This technology is highly robust against interference and offers the option of telemetry which was not permitted with the older technology which, depending on the country, uses the low VHF 27 MFIz, 35 MFIz, 41 MFIz or other allocated bands. The project described here offers the option of effortlessly expanding a lower VFIF system with 2.4 GHz SHF technology. Because this is a fully open system, it can, to a large extent, be adapted to suit your own needs. Figure 1 shows the block diagram of the system. Transmitters for remote model control have a connector which includes the standard- ised PPM-signal (Pulse Position Modulation), which contains the information about the channels that are being controlled by the transmitter. This connector is normally used when training new pilots or for connection to a flight simulator on a PC. In our appli- cation this signal is connected to a sepa- rate enclosure which contains a 2.4 GHz transmitter. This enclosure also contains a battery and an LCD, which turns it into an autonomous subsystem. In this design the pilot can continue to use the transmitter for 35/41 MHz with older model aeroplanes but also have the option of switching to 2.4 GHz operation quickly and easily. The receiver built into the model aeroplane consists of a circuit board to which are con- nected one or two receiver batteries and the servos. An important advantage of the 2.4 GHz technology is that the relatively long wire antenna, which was often a source of problems with model aeroplanes, is no longer necessary. This project is an open, experimental system which includes the following communication interfaces: serial (UART), CAN-bus and l 2 C-bus. Technology The design and implementation of a well- performing transmitter- and receiver-mod- ule operating at 2.4 GHz is unfortunately outside the reach of most enthusiasts and even many professional electronics engin- eers. Fortunately, a large number of mod- ules are available commercially, which makes this 2.4 GHz technology readily accessible. We chose the recently intro- duced module MRF24J40MB made by Microchip [2]. This standardised module is compact, generates enough RF power and, moreover, is affordable. It is therefore an ideal choice for our project. A PIC1 8LF2685 microcontroller, clocked at 24 MHz, pro- vides effortless control of the various peripherals. To simplify the realisation of this project, the design decision was made to use only one PCB and one program for both the transmitter and the receiver. By fitting a jumper, the board is configured to operate as a transmitter. Without this jumper the board functions as a receiver. The schematic The PCB contains all the power supplies that are necessary to satisfy the various require- ments of both the transmitter as well as the receiver (Figure 2). The transmitter is powered from a sepa- rate lithium-polymer (LiPo) battery. For 36 10-2011 elektor ZIGBEE TRANSMITTER/RECEIVER A few remarks and warnings This system has been tested successfully by the author over a pe- riod of many months and in different model aeroplanes, both with electric motors and with combustion motors. The transmitter range in the open field was measured at more than 1 km. There was no in- terference observed with other radio systems and with other model fliers at 41 MHz or 2.4 GHz. This is however still an experimental project, where you yourself have to carry the responsibility for the implementation and use. The MRF24J40MB radio module from Microchip is officially approved in Europe (ETSI), the US (FCC) and Canada (1C). The RF output power is 1 00 mW. With this system the use of LiPo batteries is recommended. Note that these can explode or cause fire when subjected to excessive me- chanical force or when exposed to excessive currents. If you prefer not to use this type of battery then there is absolutely no problem to power the transmitter from three R 6 size NiMH cells, and the receiv- erfrom NiMH battery packs of fourorfive cells, which are available from model hobby shops. Ground equipment Single ceil Lipo battery (3.7 V) PPMskjial ("learn" connector) Unmodified 35/40/41 MHz RC transmitter Equipment In model TWo-way link at 2.4GHz Range > 1 km Dual cell Dual cell Lipo battery Lipo battery (7.4 V) (7.4 V) Receiver board Up to 1 8 servos £ o a re O S E E 8 5 o r— - 9 11 0109-1 2UK Figure 1. Design of the system. this purpose the board contains a charger, which charges the battery with a con- stant current of about 200 mA, without ever exceeding the maximum voltage of 4.2 V. The circuit for the charger is built around an LM317 (U4), where a BC848 (T3) together with shunt resistor R20 take care of the current control. This module can charge a 1000 mAh battery in a few hours. The on/off-switch of the transmit- ter connects the battery with the charger when the transmitter is switched off. The charging circuit is compatible with any mains adapter that can supply at least 9 Vdc at 250 mA. Using a battery with a capacity of 1000 mAh the transmitter can be operated for more than 1 5 hours continuously. The power supply for the receiver has the unusual feature of being redundant with the use of two separate batteries. This means that if during the flight there is a defect in one of the batteries the receiver will continue Technical characteristics • Transmission of 8 proportional channels • PPM-modulation, compatible with all transmitters for 35 / 40/41 MHz • Existing transmitter does not have to be modified • Receiver with dual power supply and linear regulator for one or two LiPo batteries • Remote voltage measu rement of the receiver batteries • Receiver compatible with BEC power supply • Remote signal strength measurement of the receiver (RSSI) • Remote current measurement of the receiver with calculated energy use in mAh • LC-display at the transmitter for indicating the parameters • Audible alarm signal at the transmitter • Open communication interfaces: UART, CAN, l 2 C • Zig Bee technology • Range of more than 1 km in the open field, verified by the author • Reaction delay 20 ms elektor 10-2011 37 ZIGBEE TRANSMITTER/RECEIVER to operate without any noticeable interrup- tion. This ‘switch-over’ between the two bat- teries is done simply with two diodes. This type of circuit is often used in fault-tolerant systems (aviation) and is very reliable. This high reliability level can only be reached if the voltage supplied by both batteries is checked before the flight Otherwise a latent defect in a battery will inevitably lead to a crash of the aeroplane if the second power source runs flat or becomes faulty during the flight The use of two receiver batteries is not mandatory, but is certainly strongly recom- mended when flying one of the more expen- sive model aeroplanes. The measurement interfaces for the battery voltage are made from two voltage divid- ers R21-R22 (battery A) and R29-R31 (bat- tery B). In the schematic you can also see that voltage divider R21-R22 is also used for measuring the voltage of the transmit- ter battery. The linear regulator MC33375 (U6_1 ) sup- plies the voltage of 3.3 V, which is neces- sary for the microcontroller and the 2.4 GHz module, as we will see later on. The charge pump ICL7660 (U5) inverts the 3.3 V voltage rail and turns it into a negative voltage, which is necessary for the proper operation of the LCD-module that is used in the transmitter. The LT1 764A linear regulator supplies a voltage of 6 V at up to 3 A for pow- ering the servos of the aeroplane. A shunt of 1 0 mft (R23) together with amplifier LTC61 06 (U7 ) form the measuring interface for the cur- rent that the servos draw during the flight The power supply line VCAN, which is pro- tected by a fuse, supplies the power for any optional expansion boards. In models with an electric motor drive, the energy for powering the receiver and the servos is generally supplied by the elec- tronic speed controller for the drive motor, via a circuit which is called the BEC ( Battery Eliminator Circuit). Compatibility with a BEC power supply is obtained with the aid of a BAT54J diode (D4), which passes the power supply voltage for the servos to the 3.3 V regulator. Connector CN1 4 is intended for the connec- tion of the on/off-switch for the radio in the model aeroplane. This switch works oppo- site compared to a standard power supply switch: the receiver is powered when the switch is open. Because the unintentional closing of a switch is much more unusual compared to the unintentional opening of it, this circuit actively contributes to the reli- able operation of the model. The PIC1 8LF2685 microcontroller (U2) is, with its 96 KB flash memory, 3 KB RAM and CAN-bus a heavyweight within the range of microcontrollers in 28-pin packages. The microcontroller is clocked with the aid of a 24 MHz crystal, which makes a short soft- ware loop time possible, as well as accurate timing for the control pulses to the servos. Ports RAO to RA3 are configured as ana- logue inputs and are used for measuring the battery voltages, the VCAN voltage and the current consumption of the servos. The MAX3054 1C (U1) is a fault- tolerant CAN transceiver with a maximum speed of 250 Kbits/s. This part is optional and you only need to fit it if you intend to use this interface. Connector CN2 is for connecting the CAN-bus and also contains the power supply voltage VCAN which allows multiple expansion cards to be connected in a daisy chain configuration. Connectors CN3 and CN4 are available for your own expansion circuits. Whether a jumper is fitted on CN5 determines the functionality of the board: no jumper = receiver; with jumper = transmitter. Ports RC1 and RC2 are used for the l 2 C- bus, which in the receiver mode are used to control the servos and in transmit mode to drive the LCD. Both these ports and the 3.3-V power supply voltage are connected to CN6 and J1 . Connector J1 is compatible with the pocket terminal from the April 2009 issue of Elektor [3], RC6 and RC7 are used for the serial connec- tion (UART) with a signal level of 3.3 V. This Open project Even if you are not interested in model construction, you are free to ‘hack’ this project for home-automation or robotics applications which are based in ZigBee ora CAN- or PC bus. The generously sized program memory of the microcontroller offers space for the most complex algorithms. Creative model builders can use this project as the basis for experimenting with an automatic pilot or for exotic air- craft such is multi-rotor helicopters. 3 » io-2on elektor ZIGBEE TRANSMITTER/RECEIVER ♦3V3 © 10 cs lOQn I 101b MRF24JMM6 1 CLKOrr CS UJ p ,^Toi SDO sx WAKE SO pest irr GK) OIO GNO 4— < - n Mrcroc/i Transmitter ftise bttrlace cm *KF CS SPI MBCl SPI SCL* 91 MOSI «KF INI CN1 CS P LCD Nmg Afphmzjmancal LCD 4 Lines z 20 Chars s S o g ■ a s b a a s i e s ^ >>^crC£ujaQ QCia*=*oo— j-j e 7 8 9 Ml 11 12 II 14 IS K ID od>d>d>o 12VES MtAS 6 AT I DS 1 12CWO03 wist S JIAEA5 BUT I I MIAS 8 at; I S jytEA£ C«JEH < yMKF CS «y9Q VTC MURVPP/REJ PHV WHMAM10 RBI fWITMIC D2 Rfe4K PCM PEC HB7MBI3PCO P*;iBLFK85 Rcamosoracn Rf i'aot ncvnoa RA4TO1EK) WS 09CI R05CW3CI QC46DV5DA RCVSOO os/iwcm hctmott osc vss 0 » 81 10 < C4 H h , a ■ TiBUr ■ Ji h- it a 24 ii MDF WT POC V® UU; CAP / SCL SOft jwjcn SPI MISP^ SM *Q5l^ n BUI CM) CM3 044 It H PB EXT 'CM CAN UmDri - © CONFIG +€V © ICC CM BAFT fre RH m TJD CAN! Dffi MAX 3064 MM RTW BRT me GUO Fi Li S I 14 f Cl L 04 "Ik 12 CM CK2 II CAW ni CM BAT54J son UMT jg / V»£. x/jft V5L +SV © +3V3 © [rib 0 048 LCODtSptMy | OOOOOOOOO Q~1 10b 20 1ST Ml wo UB SQA sa M CP? 30 08 M A1 A I GPU GP1 GPZ GPS GW GPS GW GP7 VSS +3V3 ©- 1 ©■ 3V3 s 14 n 4X* CM C11 CtZ CM CM CIS C^CI 470,, 470p <7 Op CT7 «Jp*P Servo & LCD kttrtmx MC33J75 CMCff C3) lOu IW £"7 sT^ +3V3 -© US osc vain 4CL7GCO GMO ItfS 3V3 -Q sn so STl ST4 ST5 Sl» ST? STM C22 T" I 10 1041 itw n 04 -W- BAT54J * ^ » LT17B4A *» *r (S3 -y€™k: [] 3ft F SENSE R27 "CAN ■© +6V © C2C 3 (7u 0 IT L— ■ C25 -H, J! rn* Sv m 0 3 ^ T 1 J T"~ LTCC1I Figure 2. The electronic schematic for the transmitter/receiver module. Board layout and software can be downloaded from [1 ]. 117 ‘‘‘i ’i TL Ti B3D HCftS CKJR J t w r~t InB J? S^o_ +3V3 © fc □ SS2 ii RJ-T1 l*C nones 11 elektor 10-2011 39 ZIGBEE TRANSMITTER/RECEIVER communications port, together with the 5 V power supply voltage, is present on con- nector CN7. The MCP23008 1C (U8) contains an 8-bit port expansion for l 2 C. In the receiver mode this part can be used to drive up to eight servos directly, which are connected to eight connectors ST1 to ST8. In the trans- mitter mode this part forms the interface to a standard LCD module with 4 lines of 20 characters each. The MRF24J40MB module (U3) provides for ‘radio wave’ transmitting and receiving of the command frames. This module is fitted with a standard SPI interface and is powered from 3.3 V. The output power of 1 00 mW is in harmony with regulations set in most countries, but check foryours. The buzzer, driven by T2, is mainly intended in receiver mode to alert the pilot that one of the measured values is outside its adjust- able limit. In the receive module you can replace the buzzer with LED! . Transistor T1 is the interface for the PPM signal from the transmitter, which enters on connector CN9. The software The embedded software is written in C, the complete source code of which you can download from the Elektor website [1], Its most important characteristic is that it is ‘real-time*. It is called this because there is a strict synchronisation with the received PPM frames supplied by the transmitter. These frames follow each other at a high rate of about fifty per second. This imme- diate ability to respond is always present to give the pilot a good feeling of control. In practice, this system has a delay of less than 4 ms between the end of the PPM frame and the beginning of the command to the first servo in the aeroplane by the receiver. Figure 3 shows the most important ele- ments of the programs which are used in the transmitter and the receiver. For the interested reader, we make the addi- tional remark that the program uses a mul- Figure 3. Overview of the different software modules. titasking kernel, which was written by the PPM frame supplied by transmitter approx, every 20 ms on learn' connector Transmitter battery Hardware Analogue processing Read transmitter battery * 2,4 GUI tmnsmMa software 1 Up to 8 Servos Receiver batteries 1101 09-1 3UK 40 io-2on elektor ZIGBEE TRANSMITTER/RECEIVER Table 1: Overview of the measured quantities and their characteristics. Display line Measured quantity Measuring range Measuring resolution Unit Alarm threshold 1 Tx Batt. 0-12.65 10 mV V < 3.8 V 1 Tx RSSI 0-99 1 % Not applicable 2 Rx Batt. A 0-12.65 10 mV V < 7.6 V 2 Rx Batt. B 0-12.65 10 mV V < 7.6 V 2 Rx RSSI 0-99 1 0 / 7o Not applicable 3 Rx current 0-3300 3 mA mA Not applicable 3 Rx usage 0-9999 1 mAh mAh Not applicable 4 Batt. drive voltage (future expansion) 0-25.00 10 mV V TBD 4 Batt Drive current (fu- ture expansion) 0-200 1 A Not applicable 4 Batt. Drive usage (future expansion) 0-9999 1 mAh Not applicable author. This part of the software is essen- tial for obtaining the ‘flow’ and reaction speed that is required for this application. The kernel and accompanying services are described in a (French language) file that is included with the software package. Construction and test You have to work carefully when soldering the MCP23008 and the LTC6106, because these have a pin pitch of only 0.635 mm. The LCD-module in the transmitter is con- nected via 10 wires to CN8. If your micro- controller is not already programmed then you can do this via the ICSP-interface (CN1 ) and a programmer from Microchip or one that is compatible with it (ICD2, PICKit or similar). Resistor R1 3 determines the contrast of the display. The value depends on the exact type of LCD that is used. Once everything is mounted, visually check the quality of the soldering, put jumper CN5 on the board and connect a power supply voltage 4.2 V to pins 1 and 2 of CN1 1 . LED HL1 will now light-up briefly and the current consumption has to be around 60 mA. The buzzer will initially sound two short beeps and a welcome message appears on the dis- play. Check whether the power supply volt- age is correctly indicated on the first line of Tx : 4. ; 2 V < 8 6 X } s ' 99 ^ Rx : 8. .40 8.4S s *• 9 9 X Rx: 6 3 m R 2 3 mAh Figure 4. This is what the display shows when powering the transmitter from 4.2 V and the receiver from two 8.4 V batteries. Figure 5. Author’s prototype connected to four servos and two LiPo batteries. the display. Now lower the power supply voltage to 3.8 V. After about 20 seconds the buzzer will sound about 20 short beeps and on the fourth line of the display there will be the message ‘No PPM signal’. Con- nect the trainings connector of your trans- mitter to connector CN9, switch the trans- mitter on and check that the error message goes away. The only thing left to test is the battery charger. Connect a voltage of 9 V to CN1 0 and limit the current to 1 A. Check whether the voltage on pin 3 of CN1 1 does not go above 4.2 V. Connect pin 3 of CN1 1 to ground and check that the current drawn by the circuit does not exceed 250 mA. At this stage a large number of the vital components of your transmitter have been tested. The 2.4 GHz module will be tested in the next step. In the same manner, assemble and test a second board, where you replace the buzzer with LED1 . You can also omit the compo- nents for the battery charger. First test the board in transmitter mode. Then remove the LCD module, remove the configuration jumper CN5 and connect a power supply voltage of 8.4 V, first via CN12 and then via CN13. After the power supply is attached, elektor 10-2011 4i ZIGBEE TRANSMITTER/RECEIVER Figure 6. The built-in receiver. LED1 will begin to flash excitedly (at about 20 Hz) at the beat of the reception of the command frames. The display should now look like that shown in Figure 4. Table 1 shows an overview of the measured quan- tities and their characteristics. The fourth line of the display, which is not used at the moment, is intended for telem- etry information from the main drive bat- tery of an electric model. But this may be a subject for a future article in Elektor. If you power the receiver from just one battery then you can ignore the voltage reading from the battery which is not con- nected. Check that the receiver switches off when connector CN1 4 is shorted. For both batteries check also that the alarm sounds when the battery voltage drops below 7.6 V. Check that the measured values for the volt- age and current from the receiver are cor- rect and then connect a few servos to the receiver (Figure 5). Move the control levers on the transmitter and check the move- ment of the servos. The transmitter board, the display and the battery now need to be mounted in a non- screening plastic enclosure that you can attach to your transmitter in a clever way. Provide a switch with a mechanical latch (for safety) and a charging connector. If you would like to attach a small whip antenna to your transmitter housing then you can replace the MRF24J40MB module with an MRF24J40MC. Before you build the system into a model aeroplane (Figures 6 & 7), take the time to once more carefully check all solder con- nections and all power supply voltages. If you have even only the slightest amount of doubt then make sure that it is removed before you take off. (110109-I) Internet Links [1] www.elektor.com/ 1 10109 [2] 2.4 GHz modules from Microchip: www.microchip.com/wwwproducts/ Devices. aspx?dDocName=en027752 [3] www.elektor.nl/080253 [4] ZigBee network analyser - ZENA: www.microchip.com/stellent/ idcplg?ldcService=SS_GET_PAGE&nodel d=1406&dDocl\lame=en520682 [5] Website of the author: http://breakinbench.free.fr/ ure 7. The author’s Christen Eagle with 2.4 GHz receiver built in. 42 10-2011 elektor Mixed results By Koen Beckers (trainee, Elektor Labs) & Jesper Raemaekers Koen Beckers, a trainee at Elektor Labs told us about a project he carried out along with fellow student Jesper Raemaekers while studying Electrical Engineering at Leeuwenborgh College in Sittard, the Netherlands. “At school we had to carry out a project that let us put theory into practice and which would prepare us for all those things that you can’t learn from theory alone. We were allowed to choose the subject ourselves. Because both of us were involved with audio as a hobby, we decided to design a four-channel mixer. We’ve used an LM1036 to process each audio channel. This is an 1C that has a tone control, balance and a volume control built in. This replaces a large amount of analogue electronics that would otherwise be required and the 1C is very easy to drive using four control voltages. Three of those voltages are generated by three potentiometers that are connected to the internal voltage regulator of the LM 1 036. The fourth voltage is taken from a DAC (MCP4921 ) followed by an opamp that increases the voltage to the right level. This was necessary because the maximum output voltage of the DAC was 5 V and the LM1036 required a voltage of 5.4 V to be fully driven. The signal level is shown on a row of LEDs that are driven by an LM3914, which is connected to the output signal of the DAC. The image at the top shows one of the first drawings we made when we started this project. We calculated that we would use something in the order of 1 00 LEDs which means that the supply should be able to source at least 2 A (20 mA per LED). We considered using a 78S05, but the temperature of the regulator could end up very high. A minimum of (7 V-5 V) x 2A = 4 W will be generated inside the 1C. When the voltage at the input of the regulator isn’t 7 V but becomes 1 5 V, which is desirable for opamps, it could well mean the end of this 1C! In order to get round the heat problems we could have changed to a switch mode supply. However, this was something we wanted to avoid since the design of a good switch mode supply for audio applications was beyond our abilities, and a ‘bad’, simple switch mode supply was likely to cause too much noise and interference. The best solution for us was to use a linear regulator after all, and to make sure that the current was kept within certain limits. During several tests it became apparent that we would never require the full 2 A since not all LEDs would ever light up together. Because of this, it was possible to use a standard 7805. As we progressed with the design of the printed circuit board (using Cadsoft Eagle), and we wanted to design a compact board for each channel, we found out that we wouldn’t be able to make (etch) these at school. We therefore asked (and obtained) permission for the boards to be made by the Elektor PCB Service. Once the design of the printed circuit board was complete we had it produced and then populated it. Unfortunately, the board wouldn’t work at our first attempt. We found out that the symbol that we used for an opamp in Eagle didn’t make it dear which connection was for V cc and which was for ground. Because of this, we blew up four opamps before we discovered what exactly was happening. An incorrect connection of the supply isn’t the first thing you’d think of when you’ve just checked that the supply voltage has the correct value. The photograph shows the completed prototype. The black plastic panel is a laptop stand that was for sale very cheaply at IKEA and which was perfectly suited for our project. The original intention was to build a four- channel mixer where all the possible settings of the LM1036 were controlled using a DAC and rotary encoder (with the current settings shown on 7-segment displays) and using motorised slide potentiometers for the volume control. Unfortunately, this didn’t come within our budget and we had to scale down the design to one DAC, which was driven by a rotary encoder with the help of an ATmega 88 . The college originally gave us a budget of € 1 00. We exceeded this monumentally despite scaling back the design on a regular basis. All in all this project gave us some good experience and we learnt a few things about electronics and programming whilst working on something that we enjoyed.” ( 110601 ) elektor 10-2011 43 E-LABs INSIDE E-LABs INSIDE Verification of radiation meter By Thijs Beckers (Editor, Elektor Netherlands) Prompted by the design of the radiation detector in the June 201 1 edition (‘Measure Gamma Rays with a Photo Diode’, [1]) we were invited to test our sensor in the Nuclear Physics Labo- ratory at the University of Namen in Belgium, not too far from Elektor Labs. Research & development engineer Aurelien Nonet had sent us an enthusiastic email about the article in which a cheap sensor was used (at the university they usually work with sensors which, together with the necessary accessories, cost around €200,000 a piece). Aurelien had offered us to test our sensor with calibrated radioactive samples and possibly also compare it with their conventional detectors. So on July 12, there I was, together with author Burkhard Kainka and his measuring circuit, on the steps of the Laboratoire d’Analyses par Reactions Nucleates [2]. After a warm welcome we were given an extensive tour of the partly underground lab — where to my amazement a complete 2-GeV particle acceler- ator was installed: the Altai's (Accelerateur Lineaire Tandetron pour I’Analyse et I’lmplantation des Solides). With this particle accelerator, atoms are shot at samples so that materials can be tested. For example, nitrogen atoms are fired at samples. Dur- ing the collision various types of radiation are released (mainly X-rays and gamma radiation) which are accurately measured. From this you can then obtain information about the material shot at. But the accelerator is also used for medical research (the fight against cancer). And now some measuring! After the tour, a few calibrated radioactive materials were retrieved from the vault to see what our (ridiculously!) cheap sensor would be capable of. Initially things weren’t going so well with the measurements. But after some more experiment- ing and using different samples we were making progress. The counter in the circuit was incrementing, a sign that radiation was being measured. The sensitivity of the sensor proved to be not particularly high (something we, incidentally, already knew). Only when using samples with a sufficiently high energy (expressed in electronvolt, eV) did our circuit react. To enable the sensor to measure radiation, it has to be com- pletely shielded from any form of light. A tin that used to con- tain hand lotion worked extremely well. The plate containing the radioactive material was fastened with a little putty and the lid was put back on the tin to create a completely dark meas- uring environment. The first tests were positive, although the professional sensors costing tenths of thousands of euros are (of course) much more sensitive. For this occasion or circuit was provided with a coax output, which made the (amplified) signals from the sensor available to the outside world. Using this coax output the circuit could be connected to the measuring equipment in the nuclear physics lab. After some adjusting and twirling of knobs (the output volt- age from the professional sensor with amplifier is much higher) we did succeed in getting a picture on the PC. The professional software running on the PC translated the sensor signals in readable measurement values and charts showing the radiation characteristics of the radioactive material in front of the sensor. Everybody was enthusiastic. The cheap sensor really does work! An example of a measuring result: Measurement of gamma radiation using a BPW34 as a sensor. Sample: 137 Cs (Caesium), 661 keV Comma. Result: Good sensitivity for gamma radiation, also through the alu- minium shell around it. There is no dear energy spectrum because the blocking layer in the diode is too small. Only a small part of the energy is absorbed in the blocking layer, the remainder of the radia- tion exits on the opposite side. With this the direction depends on the distance traversed through the sensor. Conclusion: The BPW34 is very suitable for use in counter applications for gamma radiation. A second sensor Because the response to the June 201 1 article had been so great, Burkhard continued his experiments and he had a sec- ond type of sensor with him. This one was based on the BPX61 . Using this sensor he succeeded in measuring the weaker alpha radiation also. Our visit to the university was of course an excel- 44 !Xii *hi- f,u • Mi NOW ’*) Vh» |U» EOtATiO** Wm* ** «■ ^ lORLtySSOViRCt^ORtlAEtDOeD^CWJHVCaEHGW DMA. ACQU\Stt\OU Build an MCU -Based Battery Atnatyzer Unit eDASH Vehicle Date Acquisition Syst® jr Svweep-f tet t ue ^ c X Generator Desra Enter the Software W u. Design Phase ^ W Select your personal subscription at www.elektor.com/cc-subs current A >H_V a.«“s£ , s K£ 50 ^. 12 editions per year for just Digital: $38 Print: $63 Digital + Print: $90 CIRCUIT CELLAR Till MAGAZINE FOR CXJMI’L'TER AITLICATON* DSP COURSE In the previous instalments of this series we have got to know the DSP as a specialist device for processing audio signals digitally. We have also looked at software development environments and their functions and introduced the DSP board that accompanies this course. Now we will install the development software and test the hardware. We have a choice between a traditional development toolchain built from separate components, including two different debuggers, and an integrated development environment. To test the hardware we will use a few small DSP programs, which we have of course made freely available to readers, Audio DSP Course (4) Part 4: testing the hardware By Alexander Potchinkov (Germany) Two software development environments (SDEs) are available to us: Suite56 and Sym- phony Studio. We need to make a decision between them as they employ different adaptors to connect the DSP device to the debugger software. They also differ con- siderably in the range of facilities offered and in complexity, with corresponding dif- ferences in the time it takes to get to know them. Rest assured that the programs in this course and all programs developed by read- ers can equally well be assembled and used in conjunction with either of the two SDEs. Programs that appear as separate entities in Suite56 appear as plug-ins in Symphony Studio, and so the differences between the two SDEs are more in terms of how they are used than in terms of what they can actu- ally do: many of the underlying programs are the same. One significant distinction (though not important for the purposes of this course) is how the DSP5672x fam- ily of dual-core DSPs are handled: in Sym- phony Studio these are supported directly. Below we will look at both of the SDEs and illustrate their use with the help of our first test program, whose source code is in the file tst_dsp . asm. We will look at how the program is assembled and how it is loaded into the DSP. The remainder of the article will examine this test program and four oth- ers in more detail. If you do not decide to plump immediately for the more modern Symphony Studio environment, it is possible to practice edit- ing, assembling, simulating and (to a lim- ited extent) debugging code using both systems without using an adaptor. You can then decide which environment you pre- fer and only then obtain the corresponding adaptor. Suite56 The Suite56 software comes in the form of a self-extracting file DSP563000_ TOOLS . exe of about 8.9 MB. It comprises a number of rather elderly components: the assembler asm56300 . exe, the simu- lator s im56300 . exe (or gds56300 . exe in the Windows version) and the debugger gu i 56300 . exe, which works in conjunc- tion with a parallel port adaptor. If you do not have a parallel port adaptor, a different debugger must be used in place of the one provided in Suite56. One attractive pos- sibility with an ‘intuitive* user interface is evm30xw . exe (which works with a USB adaptor) made by Domaintec rather than Freescale. It can be extracted from a com- pressed file available from the Domaintec download area [1]. From now on we will assume that you will be using the Suite56 assembler and simulator and the Domaintec debugger. The advantages of this combina- tion are its transparency and that it is easy to learn; the disadvantages are that the pro- grams are, as mentioned above, showing their age, and that the debugger appears not to run under 64-bit operating systems. The author uses these separate software tools, however, as he has found that they make for quicker development. Once the software has been obtained from Freescale and from Domaintec, installation is a simple and quick process. The Domain- tec debugger is called with the option -cx, where x is the number of the (virtual) COM port assigned by the Windows operating system to the adaptor when it is connected. If no DSP system is connected, the software can be run in ‘demonstration mode* (using the -D option) for evaluation purposes. The first step is to assemble the test program by entering the command asm56300 -a -b - 1 tst_dsp into the command window. This generates the ‘dd* file t s t_dsp . c 1 d, which contains the object code, and the (often extremely useful) listing file called 48 10-2011 elektor DSP COURSE t s t _ d s p . 1st, which is in plain text. Warn- ings emitted by during the assembly process can be ignored: they are mostly caused by instruction pipeline timing conflicts detected by the assembler. The conflicts are removed by the addition of no-opera- tion instructions to the program, which the assembler will do automatically. When you become a more experienced hand at DSP programming, you will want to reorgan- ise the program so that the no-operation instructions are replaced wherever possi- ble by instructions that do useful work. The object code file contains everything the DSP device needs to run. The debugger is now started up and the following sequence of commands given. force r (force reset of the DSP) load tstdsp.cld (load the object code into the DSP) [VM-Stoft COM3 r*t fi:pi JtttW ,5^3 Wjidsw Orta . nla r. m r : '.'1 f' ! H: c'li ii i p r L-.p n i m r : »££tiB 02 l».RB ■ >£lini£r 4 l ,M .Kt ■ki.vm Ml'.M.H -YT.V&.D Kl.n B .¥ : FDHSE IP HWO-BtSPULT k : S t 1IH>BISPLM y:j;pip run* i_U *1 |I HI n* ii n i riHUi PPR tcfe: PBR[ DiflnnfiG PFRC: rDHU;:flflBUBB i -i'L': I'DHJ : U«U L'0P> i'»HL : hpM onQDW UFA*; ■ill: i: jOi 1 IlfiD Ilf Cl; ipo nfliin irn maoan peti eofl-sun i'liH [ Ol I D fill LI PERU BBDtlM n H! 40D49D NbH aantan fern JFiFfr naiinsa B0BDGB DKI&00B Mfiijnfli? n«[FD«a v . piiic n .1 v.u-iujj u ** V’ : ItBfl? U m- V i 0 iibtfni; «.£ue*ai« fl.TiriH^ Mi 'ni • a.v&MntR; U.-J'i'iTi'iV *. lflllUbJtfU D.aafrHi'IB ii.*s-ii 7 ?n-fl i.iHMDBa-. -u.Adnidu fl.51i3«a tf.blWitrX -1.41*^14 [I.57J37F3 a,*?7 0W4i -M7WI3 V ' ll.'.- I I 4,31 4* lilt a.m^TBRIi -B,l|A71^& L *;«!>?■& m i flan? aii •; : «i ai ia ^Giiui'lu Ji;«aD9ll, I jcabrjib | POLITIC 1 S : BBIIfH II Ji.-IIL' i!:*,IBIi??P; h.ibbabiu. Ul.|l|B7?1? ■B. 3^70112 9.l2*01*il U.SaidJB p.bsb&hb B.3-1T0S43 |J . 3 f‘j.2 1 in - (1^33751 7 -b 4 i«^h -b. 7,4*»3?5- B_ a Ui '7 7 B 7 B. 4 - 2*13 h?fl B.dPIHBtB B.d-32ii!llU7 Ll.fcSMSL'AH a r W??3H t. strum ii.anfliaB* n.^tigflfill -O0S17I1 -(.24l0-B1B» i. 1 . H '-u ■} i } I t.-UtMi'? • -797^7 ■ 1.&UIBU1 O.agBr^flFH :°1* 0. 1 n#|n'i*ji|n7 235^* 4 ,1 4*P , M* i All; h..7VM*gM fl.7fl*ilDP-l Y-n: .! :,.rtoi*ii^:i*^.y,;' i 111 iF-ixvvm nriBUtfO H1:*etCMI H*:0flBBIIB D«a;--4B rL' BDnilDII Pill rflFflf ilnv7 iJi’ mi vDtinuti m :FMfFF 4P«4B« n->-rrmr VBUBUtl tKrfniff mi [?[iiiLjinj p.vfFFrrr Bngni'iA «F^:rrFFFF BD4BD4 - FFFFFF M hi q«ag«* n? UtJBIIHO M'i □«i4a«* h'; : D4BD4I HI. UDftlDD • ■M-',-. ~ 1 -itfiip.clil Figure 1 . User interface presented by the Domaintec debugger. go 0 (run the program start- ing from address 0) force b (put the DSP into the debug state) disp x : $ 2 00 (display the content of X memory starting at address $200) disp y : $ 2 00 (display the content of Y memory starting at address $200) And that’s all there is to it! Figure 1 shows how the debugger user interface looks after the last of these commands is executed. The left-hand part shows the DSP program, the debugger commands and the DSP I/O registers; the right-hand part displays the selected areas of X and Y memory and the contents of the DSP’s registers. We have selected fractional display mode (‘[FRA]’) for the values in the memory and register displays: alternatively, the values can be shown in decimal, hexadecimal or binary, or in graphical form. It is possible to make the DSP switch to the debug state to allow access by the debug- ger from within the program itself, using the assembler instruction debug. This has the same effect as issuing the command force b from within the debugger as shown above. Symphony Studio Symphony Studio integrates an assembler, a simulator and a debugger along with a C compiler and more besides. It is based on the open-source integrated development environment Eclipse, which was originally developed for writing Java programs. It is a considerably more modern-looking product than Suite56. Eclipse is used as the basis for many other professional development envi- ronments for other processors: it is clearly highly worthwhile to learn how to use this system, which is on the way to becoming an industry standard. The biggest advantage offered by Symphony Studio is its support for team working, including file synchroni- sation and version control. It also works per- fectly well on 64-bit versions of Windows. On the downside the user interface is com- plex and there is a large number of configu- ration settings. If, because of a bad configu- ration setting, the program does not react to a command quite as you expect, it can be very difficult to work out what is wrong. Also, many operations are not particularly intuitive. The Eclipse interface is based around spe- cific components, views, editors and per- spectives. Wikipedia contains an informa- tive description, from which we have sum- marised some of the information below, adapted where necessary to the particular configuration used by Symphony Studio. A ‘view’ is a small window dedicated to a particular function. Examples of views in Symphony Studio are the ‘navigator’ and the project directory structure display. These views can be rearranged at will by dragging: they can be arranged in the form of tabs, activated by a click of the mouse, in the form of permanently displayed win- elektor 10-2011 49 DSP COURSE Symphfl-ny Slifdu Sf*[ii|i Chgo» Destination Location Wbfcto shtnid Syntdhgny Studo be irts*aftedr $eU# wil iruFal Symphony $ iydw *i 'the Jotoviing folds T o irtslaJ Id tin* fc-kjef. dick Maid. To ristel to a drleienJ, tokJw. dick Blow* and s*kd anetinei fck>er WARNING; PfcM* Carrel | Figure 2. Installation path. Figure 3. Installation options. dows, or as ‘fast views’, which appear as icons on bars that can be placed almost anywhere. Clicking on the icon makes the view appear. ‘Editors’ are used to display source code, with syntax highlighting. A ‘perspective’ is a complete arrangement of menus, icon bars, views and editors. The arrangement is highly configurable, and user-defined perspectives can be saved and loaded. Symphony Studio includes two per- spectives, the ‘C/C++’ perspective for set- ting up and working on projects and for assembling source code, and the ‘Debug’ perspective in which the simulator and the debugger can be used. The user can switch between the two perspectives using a ‘tog- gle switch’ in the upper right corner of the user interface. The simulator and debugger are both considered as debug tools, differ- ing essentially only in whether they require the presence of a DSP board. This is a sensi- ble decision, and a consequence of it is that the simulator does not have a perspective to itself. We will now look at how to install Sym- phony Studio and run it on a small exam- ple program. The steps given are by way of example only: there are other ways to achieve the same effects, and it will prob- ably take you a little while to find the workflow that you find most comfort- able. Freescale offers a manual [2] and application notes [3] with more detailed information. One step at a time After registering on the Freescale web- site the Symphony Studio software (S Y M- PHONY_STUDI 0_l DE. zi p, approxi- mately 55 MB) can be downloaded and then installed. Since it uses the Eclipse environ- Figure 4. Starting a new project. Figure 5. Giving the project a name. 50 10-2011 elektor DSP COURSE ment, the Java Runtime Environment (JRE), version 1 .5 or later, is also required. If the JRE is not already installed it can be obtained from [4]. Figure 2 and Figure 3 show two dialogue boxes from the installation pro- cess. Note in particular that the FTDI driver must be installed (do not untick the check box in the dialogue shown in Figure 3!) as it is needed to use the USB adaptor. When first run the welcome screen appears: click on the ‘workbench’ icon on the right-hand edge. In the window that now appears click on ‘Open Perspective’ towards the top right and then select ‘C/C++ Perspective’. In Eclipse software is always developed in the form of ‘projects’. We can create and initialise a new project by clicking on File -> New -> Project -> Managed Make ASM Pro- ject. Figure 4 shows the ‘New Project’ win- dow. Give the project a name, for example the name of the test program, as shown in Figure 5. We now need to specify the type of project: Figure 6 shows the settings that we need. The project is set up in ‘build auto- matically’ mode, which means that when- ever the source code is changed and the edits confirmed by a ' Save’ command, the assembler will automatically be invoked. The next step is to specify the directory for the source code, by clicking on File -> New -> Source Folder. Figure 7 shows the how the project subdirectory is entered: we have simply called it s r c . The subdirec- tory is now set up, and we can use Windows Explorer to copy the source code file t s t d s p . asm and paste it into the prepared subdirectory . . . \ tst_dsp\src in the ‘Project’ window (‘View Project’). We can open the source code file using ‘Open File’ in an editor. Under ‘File’ click on ‘Refresh’, which will cause the assembler to be run on our source code. Alternatively, we can make a trivial change to the source code and then the assembler will be invoked when we tell the editor to save the file. The assembler will produce a listing file, which we can load into an editor from the ‘Project View’. Figure 8 shows the appearance of the C/C++ per- spective with the program source code dis- played, including colour highlighting of key- words, along with the listing file t s t _ d s p . I s t . On the left-hand side in the ‘Project View’ we can see the directory structure of the project, including a subdirectory called ‘debug’, about which more later. Debug perspective is used for simulation, loading code into the DSP, and debugging. In the SDE plug-ins such as the simulator and debugger are called ‘External Tools’, which reflects the fact that they are sepa- rate programs independent of the Eclipse environment. In order to use one of the external tools, a connection must be estab- lished to it. This gives a way for data to be transferred to and from it, and for it to be configured. In this case data communica- tion is done over a TCP/IP port. Configura- tion depends on the hardware that is con- nected: Symphony Studio knows about the Freescale Soundbite board, the special-pur- pose DSP56371 signal processor, and the DSP56300 family, to which our DSP56374 belongs. To configure the debugger for our hardware take the following steps. • Switch to the Debug perspective (upper right corner of the window) and click on the drop-down menu item Run -> Exter- nal Tools -> External Tools. • Select the external tool ‘OpenOCD GDB Server’. • Press the ‘New Launch Configuration’ button, which looks like a piece of paper / New Source Folder Source folder 0 To avo*d overlapping. She easting project source folder entry mil be replaced. Project name: [tstjdip” Browse.,, Folder name: fsTc| Browse... f~ Update exclusion filters zn other source fckiers to solve nesting. ® | Frusfr Caned Figure 6. Selecting the project type. The Figure 7. Adding a source directory to the project. elektor 10-2011 51 DSP COURSE 3 9 n K ■ ' dill TI_-XT » S T* Di touj ‘ i,-> wi Ml* >1 *1 l»< I - ftllUJ falu : :.4 x Jj- t : ± int pscix v *1 31 T CH-f.-M- t iLti ij'. r -ax-* r p ■ xr.EE ■ r> i IS,. " J-. 3 J.I-Li, i -4, m . - i-i-.vs, * J.44' Mta «t> II-KliJ ■rtti rjj I Tflrt nj-j t}M 10 i *4 4 I 4. S-i Ltaii * t j-. 4.; Iil1> I'M 4,1 ■ ujlb ij: 'S.l Erg i:nn da in«l ■ tro dp «rg- *n Of JITOIe* !Mf B 4 lr« yl 11 It ll il ■ p 72 ;; is li 71 7f IT 16 tfi 31 3 = If cowai i .v-WC-Wt TT71 Z.« 0 {K 4 £-Hi LfKSKl EH31 1 a« 42 fi» X4&M31B KiWK >3 X4*H»3 Xiimm flt 4 M 94 £ ¥i«flaea T i : 342i3 lull **r-j *3f-J FtTJ •q-j ■=xa *X ctd 4P CM 44 eufl 5 340 a DS toOdtDJ “■ ; E>.iS t.3 D.4 set*? a M^i MJb yanri S«^i y=w*s« l£jfc4 b +t * * g +J tel ■ rsl -E 5 I * — \m iv^pi mr- H^r^jnr hrxa Id i< it IT tl >4 ti +! ll • isi'j-K'i (IU44H (ltHlti | : r i mi: 53 ClK-JIGI IJ4441M ritMlSt U 4 H 14 ! ■ i^-t^m-ni iM-warn I14441U * iSMitt ns3-J:^b r;ri:5 i&OJM nr*** 540341 uriM (44:31 £1*444 £l*lt l 4 M 0 C 1 inn-n !((!»’ 44444 4 «4i« e*4 sig CZVf fill *~m | ■, f-h:-:- Wjv« "ti 1 H£.‘ TV p«r :ec kS-V'l.fc In : ■ , rO t r mxfc J r( = , ft ■Hrtliii HP 11 4 I ■ Hfr »i«il 1*11 JH*II|V 4 f l !*-iJ-VS l^ynTlfc ‘tT A -I Figure 8. Project, source code and listing views in the C/C++ perspective. with a yellow plus sign. Alternatively, the same effect can be achieved with a dou- ble click on ‘OpenOCD GDB Server’. • Select ‘DSP56300’ from the device list and ‘soundbite’ from the dongle selec- tion list. • Connect the hardware to the PC via the adaptor. Windows will take a few moments to find and load the correct driver. • When the hardware has been recog- nised and is ready, press the ‘Run’ but- ton to open the debugger. If this is suc- cessful the status line should give the message ‘Info: openocd.c:82 main(): Open On-Chip Debugger’ and there should be no error messages. If an error does occur, it is usually best to go back to step 1 and try to establish connection again from scratch. • Before beginning the debugging session we have to select the project that we wish to debug. Go to the C/C++ perspec- tive and click on the project directory t s t d s p . A blue background confirms the selection. • Return to the Debug perspective. • To start debugging click on the Run -> Debug menu item. As before select ‘Freescale 563xx’ for processor and cre- ate a new debug configuration using the ‘New Launch Configuration’ but- ton (piece of paper with a yellow plus sign). Alternatively, the same effect can be achieved with a double click on ‘Freescale 563xx’. • A new debug configuration bearing the name of the current project will be created. • As the error message ‘Program not specified’ under the heading ‘Create, manage and run configurations’ indi- cates, we have still not yet indicated what program we want to load into the DSP. Locate the object code file t s t _ d s p . cl d on the machine using the ‘Browse’ button or more simply use ‘Search Project’. • Click on ‘Apply’ to store the configura- tion settings and then ‘Debug’ to run the debugger. • In the Debug view the program can be started and stopped using Run -> Resume and Run -> Suspend. Break- points can be set and cleared by double- clicking in the left edge of the disassem- bly view. The view showing the proces- sor’s registers is the most important debugging tool. Clicking on the plus symbols allows particular groups of reg- isters to be displayed. • Using Run -> Step Into (or just pressing function key F5) single-steps the DSP program. This allows the effect of each instruction on the contents of all the registers to be examined. Less than satisfactory is the way that the register group display closes after each instruction is executed. With multiple mouse clicks on the register view it is possi- ble to move it so that it remains open. 52 10-2011 elektor Figure 9. Configuring the debugger. If debugging is to be repeated then the stored ‘External Tools’ and ‘Debug’ config- urations can be recalled. These configura- tions are available from the ‘External Tools’ and ‘Debug’ menu items and icons. When a debugging session is complete the OpenOCD connection must be shut down properly, or it will not be possible to estab- lish the connection again when restarting the debugger: click on ‘Terminate’. To run the simulator take the following steps. • Switch to the Debug perspective (upper right corner of the window) and select the drop-down menu item Run -> Exter- nal Tools -> External Tools. • Select the external tool ‘Simapi GDB Server’. • Press the ‘New Launch Configuration’ button (piece of paper with a yellow plus sign). Alternatively, the same effect can be achieved with a double click on ‘Simapi GDB Server’. • Click on ‘Run’. • In the Console view the title ‘DSP56720 Simulator [SIMAPI GDB Server]’ should appear, along with a path, and a red ‘stop’ button which is used to stop the simulator server. To use the simulator follow the same steps (from step 7) as for the debugger given above. Adaptor for Elektor readers The term ‘dongle’ used in Symphony Stu- dio corresponds to our use of ‘adaptor’. The selection of ‘soundbite’ in the fourth step of the debugger instructions given above is also the correct choice when using the author’s USB adaptor. Care will need to be taken if a different adap- tor is used: suitable alternatives were dis- cussed in the second article in this series. The author uses two USB adaptors that he designed himself, one for Suite56 with the Domaintec debugger and one for Sym- phony Studio, which appears as a ‘sound- bite dongle’. The author’s Suite56/Domaintec adaptor consists of an OTP (one-time program- mable) 68HC05-family microcontroller and an FTDI device to convert the USB signals to a serial form compatible with the microcontroller. The unit converts between RS-232 format communica- tions on the PC side and the five signals for the synchronous serial ONCE port on the DSP side. The FTDI FT232BL appears on the PC as a virtual COM port operat- ing over USB. If the operating system does not already have a suitable driver avail- able, the VCP (virtual COM port) driver must be downloaded from the manufac- turer’s website [5] and installed. Since the author cannot accurately estimate the demand from Elektor readers for the adaptor, he has arranged only to make a small number of printed circuit boards and programmed microcontrollers avail- able. Should demand be sufficient, it will elektor 10-2011 53 DSP COURSE i Analog Gill hDgital Out Figure 1 0. Audio signal paths. 0® 50 W -100 W -iM® -2 DO 00 ■A '1$ ty/f# K V i...* i ■ * - \f\ r, V ^ 4 1 Y| i « { h r 'f'f * W i^T, i k a ■ OOGhfc MOO® ICWO® 1 OTXHB 20000 ® 24000 ,® Figure 1 1 . Spectrum of the digital output in test 5. be possible to arrange for assembled units to be made available. The Symphony Studio adaptor uses an FTDI USB-to-parallel converter without a micro- controller. This makes the unit simpler, since only a few additional components around the FTDI device are required. The author has had a number of these adaptors made and can supply them to Elektor readers. Readers interested in one or both of the adaptors should contact the author at [6]. As mentioned in the second article in this series, adaptors are also available from several different manufacturers. Even the old-school parallel port adaptor, which is easy enough to make yourself, can be installed and used in conjunction with Symphony Studio. It is worth noting that although the USB-to-parallel port con- verters that are used as a substitute for the bidirectional parallel ports that used to be common on PCs are ideal for inter- facing to older printers, they are not suit- able for use as a programming and debug- ging adaptor. Finally, please note that an OnCE/JTAG interface developed by Elektor will appear in a future edition. This interface can be used in conjunction with Symphony Stu- dio for programming the DSP board. Like the DSP board, the interface will be sup- plied ready-assembled. Testing the hardware With the board assembled and the power supplies working properly (the current con- sumption is a little over 130 mA) we need to test the various parts of the circuit in the signal processing chain. These are the ADC and the DAC along with their support components on the analogue side, and the SRC and the DSP on the digital side. The DSP is hard-wired as the master controller for all parts of the circuit: this simplifies the design and programming, but it does mean that nothing on the board can work without code running in the DSP. This goes for test- ing the hardware too, of course, and so we have written a suite of five test programs. The numbering of the programs indicates a sensible order in which they can be run, but sticking to this order is not compulsory. The ideal instrument for testing the hard- ware is an audio analyser with analogue and digital interfaces. However, it is likely that very few Elektor readers will have such a unit lying idly around, and so we propose a simpler (although admittedly less accurate and reliable) approach employing the PC that we already have to hand. The follow- ing lists what is required. A CD or DVD player to be used as an ana- logue and digital signal source. We mainly need sine waves with various (but known) amplitudes: WAV files containing suitable test signals can be downloaded from the internet and burned onto a CD or DVD, or waveforms can be created using an audio editor. We can feed these signals into the ADC in analogue form or into the SRC in digital form. A waveform editor. Wavelab is profes- sional commercial software for this task, or free software such as Audacity can be used. The editor will be used as an ana- logue or digital oscilloscope to display signals in the time domain (as a wave- form) or in the frequency domain (using FFT analysis). Wavelab can perform these functions ‘online’; other editors may have to be operated in ‘offline’ mode, whereby a WAV file is captured and subsequently analysed. Alternatively, an internet search will turn up free audio oscilloscope pro- grams that use the sound card in a PC. A conventional oscilloscope can also be used fortesting the DAC, although (unless it is a digital instrument with an FFT fea- ture) it is practically impossible to see small distortions in this way. A simple USB sound card. These are avail- able very cheaply and can also be used to generate test signals. For testing the SRC it is useful to be able to generate a test signal with a sample rate different from the 48 kHz used by the DSP test program. It is for this reason that we prefer to suggest using a CD or DVD player as an asynchronous sig- nal source. The test programs (see Table 1 ) are avail- able for download along with their associ- ated files from the Elektor website [7]. The extra files include program code such as the interrupt service routines that drive the audio interfaces, useful definitions, byte sequences for configuring the SRC and the sine wave signals fortest programs 2 and 4. Test program 1 , tst_dsp.asm: test the DSP This test program computes the product of two complex numbers a*b=c, where a=0.1+0.2i, b=0.3+0.4i and hence c=- 0.05+0.1 i. We will hold the values of a, b and c in consecutive memory locations $200, $201 and $202, with the real parts in X RAM and the imaginary parts in Y RAM. When the test completes and the DSP enters the debug state we can look at the DSP’s registers and memory areas using the debugger and check that the values are as follows: x0=0.3; xl =0.1 ; y0=0.4; yl =0.2; a=-0.04999...; b=0. 1 000...; r0 = $200; rl =$202; r4=$201 ; X:$200=$0CCCCD (rep- resenting 0.1); X:$201 =$266666 (repre- senting 0.3); X:$202=$F9999A (represent- 54 10-2011 elektor DSP COURSE Table 1 . Additional files used by the test programs. s r c 4 3 9 2 . tab Byte sequence for configuring the SRC si n 1 k 1 9 2 . t ab, si n 2 k 1 9 2 . tab Sine wave signals, 1 kHz and 2 kHz, 192 kHz sample rate i vt . as m Entries in the interrupt vector table: audio interrupts esai 4 r 2 1 . asm Audio interrupt service routine: 4 input channels, 2 output channels mi 0 e q u . asm More readable names for the DSP’s I/O addresses Figure 1 2. Spectrum of the analogue output in test 5. ing -0.05); Y:$200=$1 9999A (representing 0.2); Y:$201 =$333333 (representing 0.4); Y:$202=$0CCCCD (representing 0.1). Test program 2, tst_dac.asm: test the DACs This test program works with switch set- ting 3 in Figure 1 0 and generates two sine waves: one at a frequency of 1 kHz on the left channel, and the other at a frequency of 2 kHz on the right channel. In each case the amplitude of the wave is 0.5 FS. At higher output levels the DAC introduces noticeable distortion. Both sine waves should be checked at the analogue out- put using either an oscilloscope or head- ph ones. If using headphones they should have as high an impedance as possible, and a series resistor should be used to limit the output volume. To assemble this program some changes to the project settings must be made because of the include files it uses. A ded- icated directory in the project for all the required include files makes things tidier, and naturally enough we call this direc- tory i n c I u d e . This can be done in Win- dows Explorer, or it can be done in the same way as we did for the s r c direc- tory above. We now copy the relevant files into this new directory (see Table 1 ). The new directory has to be added into the project, which can be done using the ‘Refresh’ command. Any error messages that appear in the console can be ignored. In the tab ‘C/C++ Projects’ (in the C/C++ perspective) find the subdirectory s r c and click with the right button on t e s t d a c . asm. Then click the right button on ‘Properties’ and select ‘C/C++ Build’. Then in the ‘Tool Settings’ tab select ‘Options’ and scroll down to ‘Include File (-1)’. Click on the small green plus sign and then find the right directory using ‘File System’. Now the three asm files must be excluded from the assembly process. Go to each of these files in turn in the i n c I u d e subdi- rectory (still under the ‘C/C++ Projects’ tab) and click on it with the right mouse button. Again select ‘Properties’ and then ‘C/C++ Build’. Under ‘Active Resource Configuration’ tick the check box labelled ‘Exclude from build’. When this has been done for all three asm files you should see in the console that the assembly process has been successful and that the file t s t d a c . cl d has been created. Test program 3, tst_adc.asm: test the ADCs Now that we have verified the operation of the DACs using test program 2, we can move on to testing the ADCs. This test pro- gram works with switch setting 1 in Fig- ure 10, which loops the signal from the ADCs directly into the DACs. A signal fed into the analogue input port, for exam- ple from a signal generator, should also be found at the analogue output port. Test program 4, tst_src1 .asm: test the SRC, input side Next we can test the SRC, which is in charge of both the digital audio interfaces. This test program works with switch set- ting 3 in Figure 1 0 and generates two sine waves: one at a frequency of 1 kHz on the left channel, and the other at a frequency of 2 kHz on the right channel. In each case the amplitude of the wave is 0.5 FS. The test program first resets the SRC and then configures it. The two sine waves gener- ated by the DSP should be found on both the analogue and the digital outputs. To test the digital output interface we recom- mend using a PC with a (USB) sound card that has a digital input. Test program 5, tst_src2.asm: test the SRC, input and output sides This test program works with switch set- ting 2 in Figure 10, which causes the digi- tal input signal to be routed to the digital outputs and to the DAC. Any digital source signal, for example from a CD player, con- nected to the input should be found on both the analogue and digital outputs. Fig- ure 1 1 and Figure 1 2 were obtained using an audio analyser (a Prism Sound dScope Series III) and show the spectra at the digital and audio outputs when a 2 kHz sine wave is applied to the digital input. If you choose not to store the test program files and the other auxiliary files listed in the table in their own directory, the ‘include’ directives in the DSP program must be suit- ably amended. Once all five tests have been successfully carried out, we can proceed to writing our own programs. (110004) Internet Links [1] www.domaintec.com/ftp/domtech/ e30x_331.zip [2] www.freescale.com/files/dsp/doc/ user_guide/DSPSTUDIOUG.pdf [3] http://cache.freescale.com/files/dsp/ doc/app_note/AN3754.pdf [4] www.oracle.com/technetwork/java/ javase/downloads/index.html [5] www.ftdichip.com/Drivers/VCP.htm [6] signum.dsp@gmx.de [7] www.elektor.com/ 1 1 0004 elektor 10-2011 55 MICROCONTROLLERS Audio Guide First steps with Platino ■ Audio guides can be borrowed or rented in many museums: devices containing spoken information about the objects in the exhibition. In this article we describe such an audio guide, but this is a very special one: it detects the object using RFID. The wearer only needs to come in the vicinity of the object and will then automatically hear the correct details and explanation regarding the work (of art). By Clemens Valens and Gregory Ester (France) Here, we use two ready-made boards: a Pla- tino [3], which forms the brains of this cir- cuit, and an rMP3-module [2], which takes care of the sound. With the latter you can playback audio files that you have recorded beforehand on a memory card. An rMP3 supports SD-, SDHC- and MMC-cards from 8 MB to 32 GB. You can see the design of the whole unit in the block diagram of Figure 1 . The Platino and the rMP3 communicate with each other via the serial TTL-connec- tion. The method has some similarities to when sounds are produced from a mobile phone or a PC: when a certain event occurs we play back a certain sound (file). The event, in this case, is when the antenna [6] of the RFID-reader [4] inside the Audio Guide comes in the vicinity of a certain object — a painting, or whatever. Inside or nearby that object is a transponder [5], also known as RFID tag . This tag contains a unique identification code which is picked up wirelessly by the RFID reader. Based on this code the software retrieves the corre- sponding audio file from the database and automatically plays it back. Reading MP3S The rMP3-module is a so-called Arduino- shield, a board that you select as a ‘shield* in the headers of an Arduino and is there- fore also completely compatible with it. The rMP3 has a holder for an SD-card. You can play back MP3s stored on this card, but a few common WAV-formats are also supported. The module obeys commands which are sent to it via an asynchronous serial connection. With these commands you can read MP3-files, queuing the next file, fast forward, pause playback, adjust the volume, etcetera. You can of course also use the memory card as a storage unit. The possibilities are endless! We also (heart- ily) recommend that you read the online documentation provided by the manufac- turer [7]. The rMP3 is fitted with a 3.5-mm socket for headphones or a set of speakers of at least 16 n Get cracking! While the rMP3 has been designed to be plugged straight into an Arduino (or the Platino, which is compatible with that), you nevertheless have to make a small modification before you do that. That’s because we are driving the sound module from USARTO, one of the two serial ports on board of the ATmega1284Pon the Platino. That’s why RXDO and TXDO have to be rerouted toTX and RX respectively of the rMP3. In Figure 2 you can see the two pins which have been cut off; the orange wire connects leg 0/R (RXDO) to pin 6 (TX on the rMP3); the yellow wire connects 1/T (TXDO) to pin 7 (Rx-MP3). If necessary, begin by formatting the SD- card as FAT32. In the root directory of the 56 10-20TI elektor MICROCONTROLLERS SD-card you have to make a directory audio- guide. Choose a nice MP3 from your collection, store it in this directory and rename it 'music. mp3’. Now plug the SD card into the appropriate socket on the rMP3-mod- ule and connect a 4 x 20 LCD to K9 of the Platino. You can now fit the rMP3 in place on I the Platino. It is now time to load the soft- ware. The hex code to be loaded is called 1 10544-Laudioguide_ test_rmp3jcd.hex and can be downloaded from [1 ]. The test consists of reading the music file, and on the display appears something resembling that shown in Figure 3. On the top line will be the heading ‘rMP3 and Platino', with the version of the firmware below that, followed by a serial number. The third line shows that the left and right volume are equal to 1 6, which corresponds to -0.5 x 1 6 = -8 dB. On the bottom line, from left to right, we can see the number of seconds the music has been playing (here 2), the sample frequency is 44.1 kHz and the bit rate is 1 28 kbits/s. The parameter ‘J* indicates that the MP3-file is a encoded in a mixed (stereo/mono) format. At this stage we know for sure that the rMP3 module is working as it should. Identification with RFID-i We have already discussed the RFID reader for this project in an earlier issue of Elektor [8]. It comprises a motherboard with an EM4095 chip and an antenna. The EM4095 is designed for frequencies ranging from 1 00 kHz to 1 50 kHz. This is the reason we selected a family of passive RFID transpond- ers [5] that operate at 1 25 kHz. The maximum reading range is about 1 2 cm when using an antenna with a diameter of 53 mm. If we use an antenna of 25 mm then the reading range becomes 6 cm. Connecting the RFID module is a piece of cake: the card has five lines called +5 V, SHD, DEMOD OUT, MOD and GND; these we con- nect to +5 V, 8, 1 0, 9 and GND respectively Figure 1. Block diagram of the Audio Guide. Figure 2. Platino and rMP3: a successful partnership. — rMP3 and Platino — 108.01 SN: RMP1-0EM Uolune : 16 16 2 44 128 J Figure 3. Fortunately there is still something to do to the rMP3. of the female connectors on the rMP3, which we’ve just plugged into the Platino. Preparing the Platino The Audio Guide is provided with two oper- ating devices: a pushbutton and a rotary button, or more accurately, a rotary encoder. These are both soldered onto the copper side of the Platino circuit board. The push- button is connected to S4C and the encoder to S5C. This requires that you make a few links on the Platino as is shown in Figures 4 and 5. For an overview we again refer you to the block diagram of Figure 1. The links are solder bridges: no more than a drop of sol- der across both pads. At JP7, S4 (S4C in the block diagram) has to be connected to PC3; signal B of the encoder (S5C) goes to PC0 via SI of JP4; signal A from S5C arrives at PCI of the microcontroller via S2 of JP5. In addi- tion to turning, the user can also push the rotary button, to confirm a selection, for example. Translated into hardware this is a drop of solder on JP6 across S3 and PC2, which allows the state of the pushbutton to be read by PC2 of the microcontroller. We've used a green LED as an indicator, con- nected via JP1 4 to PC7 of the controller. You can limit the current through the LED with a resistor of 470 Cl in the location of R8. The backlight for the LCD is not used. We do, however, need a piezo buzzer. That’s BUZ1 on the Platino, connected to PB4 via JP1 , again with a solder bridge. The controller that we use here is an ATmega1284P, in a 40-pin DIP package. It can be programmed in-circuit (ISP, for In System Programming ) via a synchronous serial connection. An external programmer elektor 10-2011 57 MICROCONTROLLERS PLATINO i 3 tfflC i- V, 1 flv flW JP2 K^e *■ /-v^*v-v*v~\ rv— v* 1 J D2 Figure 4. Solder bridges on the copper side of the Platino.. Figure 5. .. and one more on the other side. [9] is connected via K3, a 6-pin HE10 con- nector. The lines MOSI, MISO and SCK that arrive at that connector have to routed to PB5, PB6and PB7 respectively via jumpers JP1 3, JP1 2 and JP1 1. The power supply voltage for the entire assembly is connected with the ground to K9-1 and the positive to K8-3. The rMP3 gets +5 volts, which is configured with a solder bridge at J PI 4 for the positive. Everything working together Every individual object that needs to be recognised has to be fitted with a unique transponder. When the Audio Guide comes in the vicinity the transponder, the cor- responding audio file will be played back through the headphones or speakers. The green LED lights up and the buzzer sounds the moment the RFID-card has been recog- nised. With the program ‘1 1 0544-l_audi- oguide_firmware_v1.2.bas’ belongs an ASCII-file called ‘tags.txt’. This contains the identification number, the title and the RUDIQGUIDE ID1 «U30 LOST: 01075677 1E/ID0 Figure 6. “ID=0” means that this transponder has not yet been registered. Figure 7. A handy little aid: PaMus MP3 Recorder. creator of the object as it will appear on the LCD, see Listing 1 . These codes are included during compilation thanks to the instruc- tion $include tags.txt. The corresponding MP3 sound files on the SD-card have to be named IDx.mp3, where x is the index num- ber (the number in brackets) in tags.txt. For example, the file ID4.mp3 belongs with the painting The first steps’ by Vincent van Gogh. Note that the file names are not case sensitive. The sound volume is adjustable from 0 to 1 00 in steps of 5 with the use of the rotary button. The rotary button does not only operate in the two rotary directions, clock- wise (CW) and counterclockwise (CCW), but you can also push it, which is equivalent to the closing of S4C. This is used to stop the playback. Pushing it again will start the play- back. The file that will play, is the one that corresponds to the ID number that is shown on the first line at that time. As soon as the playback starts, the title and creator appear on the display. In this way you can also listen to the narration without having to be in the vicinity of the corresponding object, or you can repeat certain parts of the text. The transponder that is stored in the first position (under RFID(1)) starts the file ID1. Listing i. The file tags.txt contains all the information that has to appear on the LCD. The titles (Title(x)) and the name of the creators (Artist(x)) are not allowed to be longer than twenty characters. const maxi = 6 Dim Rfid(maxi) As String * 10 Dim Title (maxi) As String * 20 Dim Art ist (maxi) As String * 20 Rfid(l) = «0107567708» Title(l) = ^VOLUME SETTING» Art ist (1) = « MARCUS MILLER/POWER» Rf id (2) = «0107567790» T i t le (2) = Artist (2) Rf id (3) = T i t le (3) = Artist (3) Rfid(4) = T i t le (4) = Ar t i st (4) Rf id (5) = T i t le (5) ■ Artist (5) Rf id (6) = T i t le (6) = Artist (6) ■ «LA GI0C0NDA» = «LE0NARD0 DA VINCI» «01075677B4» = « STARRY NIGHT » = «VINCENT VAN GOGH» <<01075677 AE» ■ «FIRST STEPS » = «VINCENT VAN G0GH» «010756785E» ■ «FR0NT C0VER» = «ELEKT0R 1978» «01075676E6» = «THE LAST SUPPER» = «LE0NARD DE VINCI » 58 10-2011 elektor mp3. You can use this one to adjust the sound volume with the aid of the rotary button. You can use any music file of your liking. We assume that by now you have already loaded the SD-card with MP3s with ID 1 though 6. When you now load the firmware (1 1 0544-l_audioguide_firmware_v1 .2.hex) for the first time then the Audio Guide only operates under manual control. Even though the system can pick up the transponder codes, it does not know which index nu mber belongs with which transponder — from the software’s perspective all transponders still have IDO. Now it is very handy that, as a prepa ration step, you give each tran- sponder a sequence number and arrange them side by side and in order. Now open the file tags.txt in a text editor, for example Notepad. Now hold the RFID antenna near the first transponder and copy the hex ID on the display into tags.txt. Repeat this for all the transponders. Save tags.txt and then compile and download the firmware again. The Audio Guide is now ready for use, which you can check by passing the antenna over each transponder in turn. The firmware has space for up to 96 transponders, in the code, the constant maxi has to indicate the correct number. You can see the const maxi = 6 for the six tags in our example. MP3 Recorder The author uses the program PaMus MP3 recorder [1 0] to record spoken text directly from a microphone into an MP3-file. This is very easy to use, just like a tape recorder (Figure 7). You can choose from three levels of sound quality, files are automatically generated and you can rename or erase them from within the program. If you rather not work with French-language software then you can choose something else yourself from the countless other options available on the internet. Search for ‘mp3 recorder open source’ for free software. (110544-I) Internet Links [1] www.elektor.com/110544 [2] www.lextronic.fr/ PI 8805-module-de-restitution-rmp3-pour-arduino.html [3] www.elektor.com/ 100892 [4] www.elektor.com/products/kits-modules/ modules/ 08091 0-91 -rfid-sawy.9251 92.lynkx [5] www.lextronic.fr/P1 503-carte-transpondeur-rfid-cardl .html [6] www.lextronic.fr/P1478-antenne-rfid-125-khz-ant-rfid2.html [7] www.roguerobotics.com/wikidocs/rmp3/start [8] www.elektor.com/080910 [9] www.elektor.com/080083 [10] http://papiermusique.fr/dossier03.php Advertisement Elektor Academy Webinars in partnership with element14 Webinar #1: Platino - an ultra-versatile platform for AVR microcontroller circuits Date: October 13, 2011 Time: 15:00 GMT (16:00 CET) ^ Presenter: Clemens Valens (Elektor Editor and designer of the Platino board) Many microcontroller applications share a common architecture: an LCD, a few pushbuttons and some interface circuitry to talk to the real world. Platino offers a flexible through-hole design for such systems based on the popular AVR microcontrollers from Atmel. Platino supports all 28 and 40 pin AVR devices, several types of LCD and has a flexible pushbutton and/or rotary encoder configuration. Add-on cards in the form of Arduino type shields or custom boards are fully sup- ported. Platino is compatible with the Arduino IDE and with many other popular development systems. Register now! -'•t n r I m elektor ACADEMY th* t - elements www.elementl 4.com Register now at www.elektor.com/webin elektor 10-2011 59 MICROCONTROLLERS Here comes the Bus! (8) Measurement and control „ In the previous instalment in this series we looked at a simple protocol for communicating the results of measurements. Now we look at how the protocol can be used in a control application. To this end we will add a couple of simple components to the experimental board: a light-dependent resistor and a relay. Many readers will probably already have suitable devices in their junk box. However, the flexibility of the sensor node should not be underestimated: it can output values in a variety of different units and autonomously check readings against pre-set thresholds. By Jens Nickel (Elektor Germany Editorial) Readers who have been following this series for a while will know that we start each instalment with a quick round-up of what we discussed in the previous one. In the September issue we described a simple protocol specifying how the eight payload bytes within each sixteen-byte message are used. This ensures that the various nodes (sensors, actuators and controllers) can all understand what the others are saying. A bus participant can use the eight bytes to communicate up to four values at a time. So, for example, a node could be equipped with four temperature sensors. Conversely, values could be sent to up to four actuators using a single message. Which bytes within the message belong to which sub-module within the node is determined simply by their position: we call bytes 6 and 7 ‘channel O’, bytes 8 and 9 ‘channel 1 ’, and so on: see Figure 1 . Each of these channels can carry a ten-bit quantity, along with a sign bit: Figure 2 shows how the data bits are laid out. Bit xH.5 indicates whether the quantity in question is a meas- ured value or a setting (0 for a measured value, 1 fora setting), while bitxH.4 is used to distinguish between an acknowledge message (bit set) and the original message (bit clear). We have already said that we would add an BYTE 0 1 2 3 4 5 6 7 8 9 A B C D E F BIT 7 6 5 MODE 00 4 3 2 1 0 10 10 10 10 00000000 ADDRESS RECEIVER ADDRESS SENDER PI-IANNPI ft vilnliliLLV PHANISIPI 1 vUnlillLL 1 riiAMMn 0 rUANNPI ? vUnll (ilLJ rpr vi\u = 00 hex ID 0H 0L 1H 1L 2H 2t 3H 3L 110428-13 Figure 1. In ‘two byte mode’ the eight payload bytes are divided into four pairs. Values for four channels (individual sensors or actuators attached to a node) can be communicated in one go. extra mode using four bytes per channel (‘four byte mode’), allowing for the com- munication of more precise values or spe- cial commands. We distinguish between ‘two byte mode’ and ‘four byte mode* using bit 6 of the first byte: set for two bytes per channel and clear for four by tes per channel. There will be a fair amount more bit-twid- dling like this in what follows. We under- stand this is not everyone’s cup of tea, so for easy reference we have gathered together the most important decimal equivalents of binary and hex values in Table 1 . The first sensor In order to demonstrate measuring a real- world quantity we use the ultra-simple cir- cuit shown in Figure 3. K1 connects directly to the expansion header K4 on the experi- mental node board [1 ]. We assembled the circuit on a small piece of prototyping board and rustled up a suitable ribbon cable: we only use one row of the 2-by-8 insulation displacement connector. This cable will come in handy frequently in the future. If you have already programmed the firm- ware from the last instalment into the nodes, you can start to test the system as soon as you have assembled the hardware. Elektor Products & Services ♦ Experimental node (printed circuit board, #110258-1 or set of three boards,# 11 0258-1C3) • USB-to-RS485 converter (ready assembled and tested, # 110258-91) • Free software download (microcontroller firmware and PC software, file# n0258-11.zip) All products and downloads available via www.elektor.com/ 1 10428 60 10-2011 elektor K1 Figure 3. Our first sensor. K1 is connected directly to header K4 on the experimental node. The node with the light-dependent resis- tor attached should be configured with bus address 02 and device mode 01 . This is done by programming EEPROM addresses 002 and 006 respectively with those val- ues. The value 01 should be programmed at address 004 (corresponding to the variable ‘Scheduled’ in the code) so that the node knows that it will be regularly interrogated by the scheduler running on the PC. The PC software and the firmware from the previ- ous instalment can be found on the project web pages [ 2 ]. When the scheduler software is started on the PC the relevant ADC conversion results are transferred from node 2 to the PC at reg- ular intervals using channel 0 (that is, using the first two payload bytes). The ADC value displayed in the text box is then a measure of the light level on the light-dependent resistor. From a technical point of view it is Table 1: Bit-twiddling made easy Representing values from -1023 to +1023 SIGN = 8 for negative values, 0 otherwise LOW = lower seven bits of magnitude (in BASCOM: Lew = Value And 127) HIGH = upper three bits of magnitude (in BASCOM: Shift Value, Right, 7 : High = Value) Byte 1 Byte 2 Transmit reading 64 + SIGN + HIGH LOW Set value 96 + SIGN + HIGH LOW Switch on 96 1 Switch off 96 0 Acknowledgement from receiver: original byte 1 value plus 16 Quantity, units and scaling CH = channel number POT = exponent (‘power of ten’) absolute value PSIGN = 1 6 for negative exponent, 0 otherwise Byte 1 Byte 2 Byte 3 Byte 4 Set 40 + CH 193 see Table 2 PSIGN + POT Voltage in V 40 + CH 193 16 0 Voltage in mV 40 + CH 193 16 19 Current in mA 40 + CH 193 17 19 Trigger transmission of preset quantity and units from sensor: byte 1 = 8 + CH Thresholds and alarm CH = channel number Bytel Byte 2 Set lower threshold 1 04 + CH 209 Set upper th reshold 104 + CH 210 Alarm: value below threshold 72 + CH 209 Alarm: value above threshold 72 + CH 210 Value between thresholds 72 + CH 208 Acknowledgement from receiver, original byte 1 value plus 16 elektor 10-2011 61 MICROCONTROLLERS Table 2 : Physical quantities Byte (hex) Byte (decimal) Quantity 01 1 Raw ADC value 10 16 Voltage 11 17 Current 1 12 18 Resistance i 14 20 Power 1 21 33 Temperature j 22 34 Humidity i 24 36 Pressure BIT BYTE 7 6 5 4 3 2 1 0 0 0 SET 1 0 1 C2 Cl CO CHANNEL Address 1 1 0 0 0 0 0 1 Command 0 PHYSICAL QUANTITY First 0 UNIT + S3 S2 SI SCALE SO Second 110420 15 Figure 4. A total of four bytes is required to set the quantity, units and scaling factor for an intelligent sensor. ik sc tr «x Figure 5. The user interface of our simple master controller. interesting to know the actual resistance of the sensor: given the fixed resistor value in the sensor circuit, the resolution of the ADC and the reference voltage (5 V in this case), it is of course possible to calculate the sensor resistance on the PC from the ADC reading. But for the moment let us imagine that we are presented with the sensor as a black box (that we cannot get openl): it would be nice if the sensor node were more intelligent and could be instructed to trans- mit the resistance value rather than the raw ADC conversion result on the bus. Other units The application protocol can provide for exactly this possibility. We define a sequence of exactly four consecutive bytes, called ‘address’, ‘command’, ‘first’ and ‘sec- ond’, as shown in Figure 4. The protocol does not prescribe where these four bytes occur within a message: we could, for exam- ple, use the first four bytes of the payload, or we could equally well use the second half of the payload. The latter option would allow us also to communicate values to two actuators (using channel 0 and channel 1 ) at the same time. All special functions are identified by a ‘1 * in the most significant position in the sec- ond byte. This is exceptional in our protocol: the most significant bit is otherwise always zero in the payload bytes. Recall that we do this because we want to preclude the pos- sibility of the byte value AA hex (170 deci- mal) occurring in the payload: this value is reserved for use as the start byte of each message. We therefore choose to use the fixed value Cl he x ( 1 93 decimal) as the com- mand byte to indicate ‘quantity, units and scaling’ data. Turning to the first byte of the four-byte sequence, the value of ‘SetBit’ should be 1 as we are writing rather than reading data. The bits labelled CO to C2 give the channel address (that is, the sensor number): we are no longer able to encode which sensor is meant by the position of the bytes within the payload. Since our light sensor is con- nected to channel 0 these three bits are all set to zero. Bit 3 of the first byte is always set to one in ‘four byte mode*: this simple trick ensures that any four-byte data packet will always start with a byte having a value greater than zero, and the receiver can then reliably use the presence of a zero byte to detect that no data packet is included in this part of the payload. Putting all the bits from this example together, we see that to set the quantity, units and scaling for a sensor on channel 0 we must send the byte 28 hex followed by Cl hex . The third and fourth bytes are simpler to explain. The third byte specifies what physi- cal quantity is being communicated: an out- line proposal is given in Table 2. For some types of quantity (such as temperature) where various units are possible, which unit is used is encoded in the last byte. For SI units such as the volt, ohm or ampere, these bits are set to zero. The remaining five bits BIT 7 6 5 4 3 2 1 0 0 „ 8FTLMT 1 ALAMO 0 1 C2 Cl CO C HANNEL 1 1 0 1 0 0 im UMir i o o 1 UPPER LiiT LOWER UMrr BYTE Address Command 110428-16 Figure 6. Setting bit 5 of the first byte instructs the sensor to store the current reading as the upper or lower threshold value. The two bytes sent by the sensor to indicate a threshold alarm are almost identical: the difference is that bit 5 of the first byte is clear. 62 10-20TI elektor MICROCONTROLLERS Floating-point numbers BIT 7 Even measurements of electrical quanti- ties often require precision spanning a range of several orders of magnitude. Our two byte mode, with just ten bits (plus sign) available, cannot cope with such a high dynamic range. For such cases we can use four bytes to repre- sent a reading or setting. The figure shows how an individual sensor or ac- tuator attached to a node is addressed using the channel bits C2--C0 in the first byte, as described in the text. The bytes labelled ‘High’, ‘Middle’ and ‘Low’ carry the actual 0 0 SET CURRENT MX 0RKL 1 C2 Cl I CO CHANNEL 0 HXW — MSIGN M3 M2 Ml M0 NO FLOW + D18 D17 D16 D15 D14 0 D13 D12 Dll D10 D9 D8 D7 0 D6 D5 D4 D3 D2 D1 DO value. High . 6 is set to indicate that the bytes represent a floating-point value; High. 5 gives the sign of the mantissa. MSIGN, M3, M2, Ml and MO give the ex- ponent (as a power of ten), and the re- maining fourteen bits (D1 3 down to DO) give the magnitude of the mantissa. The largest number that can be represented (without using the scaling feature) is +16383*10+15. If High . 6 is clear, 1 9 bits are available to represent a value directly. BYTE Address High Middle Lew 110428-18 of the last byte indicate the scaling factor. Bits SO to S3 specify the exponent (power of 1 0) used: with the addition of the sign bit we cover the range from 10~ 15 to 10+ 15 . We suspect this might be enough for most applications our readers can dream up! In our example, where we send a resistance value measured in ohms, the table tells us that the third and fourth bytes should be 1 2hex and 00h GX * The whole command is thus 28-C1-12-00 hex . Demonstration software As usual, we have prepared some demon- stration software which can be downloaded for free from the web pages accompanying this article [3]. In contrast to earlier ver- sions of the software, the master control- ler node, at address 10, is responsible for a larger number of messages: previously it was only responsible for sending acknowl- edge messages. This node is therefore also now prompted to transmit data by the scheduler at regular intervals. In the inter- ests of simplicity the command that trig- gers the master node to send its messages is simply placed inside the scheduler loop in the code running on the PC. This is clearly not the ‘right* way to do it, since it treats the scheduler and master as bus nodes inde- pendent of one another. However, the trick saves us from some fiddly thread program- ming and timing adjustments. When the appropriate check box in the user interface is ticked (see screenshot in Fig- ure 5), the master controller node sends the byte sequence 28-C1 -1 2-00hex to the sensor node and then receives a readings from the sensor node expressed in ohms. The byte sequence 28-C1-12-00 hex resets the node to sending raw data. The BASCOM firm- ware calculates the resistance of the light- dependent resistor without using floating- point arithmetic, which helps keep the code size down. The value of the fixed resistor is specified in the line that starts ‘Resistor =*. Unfortunately, resistance values of greater than 1 023 ohms cannot be communicated. Two-byte mode cannot really offer the pos- sibility of floating-point values (as on an autoranging multimeter, for example). However, it is in principle feasible in four- byte mode: the text box gives some ideas, but we will not pursue them further in this article. Everything under control At the beginning of this article I promised that we would be looking at a real control application. How about a simple security light that is automatically turned on when the ambient light level falls below a speci- fied value? The comparison against the threshold value could in principle be done in the master controller, but here we choose a better approach, making the sensor into a slightly more intelligent device. At some point as evening draws in we take the cur- rent reading and program it back in to the sensor as a threshold value. From then on the sensor will emit a special ‘alarm* mes- sage when the ambient light level falls below this lower threshold, and a further special message in the morning when the ambient light level rises above an upper threshold. Figure 6 shows the format of these mes- sages. Two bytes are needed, and as with all special functions these two bytes can appear at any position within the payload. The sensor that is reporting the threshold alarm must include the relevant channel number in the first of the bytes (in bits Cl and C2). The values that can occur in the second byte are D1 ^ to indicate that the reading is below the lower threshold, D2 hex to indicate that the reading is above the upper threshold, and D0 hex to indicate that the reading is in the ‘comfort zone* between the two thresholds. The same message format is used by the master controller to instruct a sensor to store the current reading as a lower or upper threshold value for future use: in this case ‘SetBit* equal to 1 to indicates that this is a control value rather than a reading. In our example, setting a lower threshold on channel 0, the alarm message comprises the bytes 48-D1hex and the command to set the threshold value is 68-D1 hex . In the interests of reliability the master controller acknowledges the alarm with the sequence 58-D1 hex , and the sensor acknowledges the setting of its threshold with 78-D1 hex (the acknowledge bit being set in both cases). As one of the first reader applications has shown, this feature can come in very handy: see the text box. In the next part of this series we will look at how thresholds can be defined freely, rather than by simply storing the current reading. The first actuator The demonstration PC software reports the crossing of the lower threshold by dis- playing the work ‘Alarm!* in a text box. The threshold itself ca n be set by clicking on the ‘Set Limit* button, and the current thresh- old value is shown in another text box. How- ever, this does not yet amount to a control system. The next step is to connect the simple cir- cuit shown in Figure 7 to node 1 . Pin ADC0 / PC0 on the header is used to drive a small 5 V relay via a transistor. Figure 8 shows an overview of the system configuration. The same firmware is used in nodes 1 and 2, the variable ‘Devicemode* (programmed into the EEPROM at address 006) determining elektor 10-2011 63 MICROCONTROLLERS The bus in use Elektor reader Andre Goldberg writes to tell me of the first practical appl ication for the bus: a level monitor for a water storage tank. In such an application we would of course not want to keep a PC running all the time, and so the scheduler has to run on a microcontroller. He therefore implemented a simple version of the scheduler using a timer in BA5COM. After I had given him an advance preview of the protocol and demonstration software developed for this instalment in the series, Andre immediately developed a controller to refill the tank automatically. Unfortunately he discovered that if an alarm message is only sent once it does not always reliably arrive at the receiver: shortage of time prevented us from getting to the bottom of this problem. For critical applications the protocol therefore includes the possibility for such messages to be acknowledged by the receiver. The transmitter must then keep repeating the alarm message until it receives the ‘acknowledge message’ (a copy of the transmitted bytes, but with the ‘acknowledge bit* set). This feature is included in the demonstration software accompanying this article. The variable ‘Sendalarmflag’ is set in the microcontroller firmware when the threshold is passed and resetwhen confirmation of reception of the alarm message is received from the master controller. The sensor node is interrogated periodically and itwill thus repeat the alarm message for as long as the flag remains set. If, meanwhile, the value goes below the lowerthreshold, the alarm is cancelled: ‘Sendalarmflag’ is cleared, and ‘Sendresetalarmflag’ is set. The same happens, mutatis mutandis, when the situation is reversed. On the PC side there are two integer state variables, 'intSetAlarmstatus' and 'intResetAlarmstatus*. In these variables the value ‘ 2 ’ means that the alarm message has been received and the relay is to be driven: the value * 1 * means that the alarm message from the sensor needs to be acknowledged; and the value ‘ 0 ’ means that no more messages need to be sent. The sequence of states is ‘O’, ‘2’, ‘V, ‘O’, and so on. The message to the relay is sent first to minimise delay. Note that an alarm message that sets intSetAlarmstatus to 2 must simultaneously clear intResetAlarmstatus to 0 (and vice versa): otherwise an undefined state could be reached after a rapid sequence of events. Andre is now experimenting with a web server module designed by Ulrich Radig, with the idea of using it to allow readings to be displayed in a browser. More on this interesting development in the next instalment of this series. Figure 7. The relay driver circuit can be built on a small piece of prototyping board. whether the node is behaving as an actua- tor (with the relay connected) or a sensor (with the light-dependent resistor con- nected). Pin ADC0/PC0 is correspondingly configured either as an analogue input or as a digital output. When the master controller receives a threshold alarm from node 2 it sends the byte sequence 60-01 hex to node 1 , which prompts it to set PCO high, pulling in the relay. If node 2 should now report that the alarm is no longer set, the master controller sends the sequence 60-00 hex to node 1 : this takes PCO low again and the relay drops out. As on-the-ball readers will have realised, the value 60hex arises from bit 6 (‘two byte mode’) and ‘SetBit* both being set. Once a threshold value has been set (and assuming everything has been properly soldered together, programmed and wired up!) you should find that a security light connected to the relay will be switched on whenever the a mbient light level at the sen- sor goes low enough. Voila ! ( 110428 ) What do you think? Feel free to write to us with your opinions and ideas. Internet Links [1] www.elektor.com/110258 [2] www.elektor.com/110382 [3] www.elektor.com/110428 K1 PCQ/ADCO +5V GND o- o-- o-- o- ta 1N4148 BC547B K2 -Ol -0 11042B - 12 ELEKTOR BUS — DOMOUCS MASTER Q SCHEDULER © rT=r"SJ""| USB RS485 CONVERTER NODE® NODE© — a — — SS — l— SS— 110428 ■ 19 Figure 8. An overview of the simple application. The PC simultaneously takes on the roles of bus scheduler (address 0) and master controller (address 1 0). 64 10-2011 elektor COMPUTERS Fan-Flash Alternative Stroboscope effects with Old-School digital logic This project is based on the ‘Fan-Flash’ published in the December issue of 2010 [1], a circuit that gives the illusion of stopping the blades of a running fan in a PC by using a flashing light. Prompted by a number of remarks that the educational value of this project would be much higher if the circuit was implemented without a microcontroller, we hereby present a circuit with almost the same functionality, but built using digital logic only. By Raymond Vermeulen (Elektor Labs) The principle of the circuit has remained the same: we give (a number of) LED(s) a num- ber of pulses for each revolution of the fan, which corresponds to the number of fan blades. The schematic describes our circuit, which was designed for a fan with a rota- tion speed of 750 revolutions per minute (rpm) and nine blades. If you want to use a fan with a different number of blades then a few things will have to be changed. LEDs Take into account the amount of current you are going to run through the LED(s). Choose a suitable value for R1 (see Fig- ure 1 ) based on the desired current. A good rule-of-thumb for ‘ordinary LEDs’ is 20 mA continuously or a maximum of 500 mA per pulse. For the forward voltage drop we assume a value of 3.5 V. This calculation is done for the fan that we used and using four white, 5-mm LEDs, which are connected in parallel as follows: The total current through the LEDs amounts to (12 V-3.5 V) / 1 2 Q = 0.708 A. During a pulse there is therefore 0.177 A through each LED. The fan rotates at 750 rpm = 12.5 Hz, and with nine (number of blades) pulses per revolution. From this follows that there are 12.5 x9 = 1 12.5 pulses per second. One single pulse is 0.1 1 ms wide (see section ‘The NE555’), so that the total pulse-width per second amounts to 1 1 2.5 x 0.1 1 ms = 1 2.38 ms. This estab- lishes the duty-cycle as 1 .238 %. The aver- age current that each LED has to handle comes to 177 mA x 0.01238 = 2.19 mA. Both current values therefore fall well within the maximum current ratings. The type of LED that you can use is, just as in the original article, entirely up to you. The circuit is easily adapted for either power LEDs or for a pair of 5-mm diameter LEDs connected in parallel. Note that in the latter case these LEDs must all of the same type and preferably all from the same batch, oth- erwise there is the risk that the current does not divide nicely (equally) across all the LEDs and that some LEDs will be brighter and others dimmer. MOSFET From the schematic you can see clearly that the part that carries the high currents is mostly the same. The differences are that a different MOSFET was selected and that the 3-pin fan connector is not connected to the motherboard but connected directly to the circuit. For this purpose there is a pull- up resistor between the tacho-signal and the 12-Vline. The MOSFET does not necessarily need to be an IRF3704 either. If you choose some- thing else, note that it has to be an N-chan- nel type and which can be properly turned with a signal of 4 V. A V th of, for example, less than 2.5 V will work well. A tip: Look in the datasheet for the graph with V ds on the hori- zontal axis and l d on the vertical axis. Choose the 4-V line (or the line closest to it), follow elektor 10-2011 65 COMPUTERS Figure 1 . In this schematic we hail the ‘old-fashioned* design of a digital circuit. this to V ds = 1 2 V and read the corresponding value of l d . The curve has to be flat and l d has to be greater than the peak current which we intend the run through the LED(s). Allow plenty of margin just to be sure. Also note whether the rise and fal I times are adequate. Typically accept a value of less than 1 0% of the pulse time, so that the pulse shape is preserved nicely. Most MOSFETS will have absolutely no problem with this. Digital logic Now continuing with ‘the brains’ of this cir- cuit. To tune the frequency of the flashing LED(s) to the rotational speed of the fan, as measured with the tacho signal, we use the services of a PLL (Phase Locked Loop), the 4046 (IC3). This 1C compares the frequen- cies of the signals at pin 3 (CIN) and pin 14 (SIGN) and subsequently adjusts the fre- quency of its output signal on pin 4 (VCO) until there is no difference between both these input signals. By using a frequency divider (IC1 together with IC5) in a feedback loop, we actually make a frequency multi- plier. This works as follows: Assume that a signal of 1 Hz arrives at pin 1 4. At this time there is not yet a sig- nal at pin 3 (frequency is 0 Hz). The output (pin 4) attempts to correct this difference and begins, for example, to generate a sig- nal of 1 Hz. This frequency is then divided by a certain number (in our case that is 1 8) by the counter and flip-flop. The differ- ence with the frequency at the input sig- nal on pin 1 4 has become smaller, but it is still not 0. So the frequency at the output increases some more. This continues until the frequency on both inputs is the same. Since the counter and flip-flop divide the output signal by 1 8, at the output of the PLL is a signal that is 1 8 times the frequency of the input signal at pin 14. So we now have adjusted the pulse frequency to the fan that we used. Incidentally, the flip-flop (IC5A) is necessary because there are short pulses at the out- put of IC2B (because of the way the feed- back works to the reset of the counter with IC2B). The flip-flop turns this back into a sig- nal with a duty-cycle of 50 % (and divides the pulse frequency by two). IC2B adds an additional delay to ensure that IC1 is not reset too quickly. At the tacho-input D-flip-flop IC7 halves the pulse frequency of the tacho-signal. This is necessary because IC1 can only divide the frequency by a whole number. Because IC5A halves the ‘reference frequency’, this is therefore also done at the input (with IC7B). At 750 revolutions per minute the tacho- signal from the PC fan gives 1500 pulses per minute. The tacho-signal therefore has a frequency of 25 Hz. This is divided by 4 and then multiplied by 1 8, so that at pin 4 of IC3 we have a frequency of 1 1 2.5 Hz. The NE555 This frequency we then convert into a pulsewidth modulated signal for driving the LED(s). We use the celebrated 555 (IC4) for this, which has been configured as a mono- stable for this purpose. The pu Ise at the trig- ger input is not allowed to be wider than the pulse that the 555 is to generate. As a consequence of the low frequency and the 50 % duty cycle the 1 1 2.5 Hz signal has to be capacitively coupled (Cl 1 ). The result is a spike at every falling edge, which is small enough for the trigger input of the 555. The 66 10-20TI elektor COMPUTERS pulsewidth of the signal generated by the 555 is determined according to the follow- ing formula: T = 1 .1 x R2 x C8 [s]. Using the values indicated results in pulses with a duration of 0. 1 1 ms at the output (pin 3). The purpose of Cl 2 is to prevent the collapse of the 5-V rail, when the 555 generates a pulse. Cl 0 and R7 determine the ‘capture range* i.e. the range within which the PLL can ‘lock*. This is approximated by the formula: 2*fc = fmax=1/(0.5xR7xC10). With the prescribed component values this results in a range of 0 to 244 Hz. The fre- quency used — 1 1 2.5 Hz — falls nicely in this range. If higher frequencies are required then Cl 0 can be replaced with a capacitor with a lower value. The low-pass filter formed by R6 and C9 determines the frequency range over which the input remains locked. This is expressed by the following formula: f|ockrange=0/^) x >/(2icf c )/(R6xC9), which with the components used creates a range of 44.3 Hz. Because of this it can appear that the fan is rocking back and forth while in use. By changing the value of these components different effects can be created. The circuit is powered from the 1 2-V power supply which is normally readily available in a PC. A 7805 turns this into a regulated 5 Volts required by the ICs. Additional tips If you are using a fan with a different num- ber of blades, then you can adapt the circuit by correspondingly changing the connec- tions from the outputs of counters IC1 to IC2A (we are now dividing by nine because the fan we used has nine blades). The BAT42 in the schematic may be replaced with, for example, a BAT48 or a BAT43. The 1N4004 may be replaced with, for example, a 1N4007. IC5B is not used. It is recommended prac- tice to connect the inputs of unused com- ponents to ground. If the 3-pin fan connector proves hard to find you can also use a simple header instead. The pitch of these is equal to 2.54 mm just as the special Molex connector. (110458-I) Internet Link [ 1 ] www.elektor.com /100127 Advertisement EURO CIRCUITS he European reference for PCB prototypes & small series www.eu roci rcu its.com elektor 10-2011 67 READERS PROJECTS Sinewave Inverter with Power Factor Correction By Michael Kiwanuka (UK) Power inverters are used to generate AC powerline voltages like 230 VAC or 1 1 5 VAC in the field, using high capacity 1 2 V or 24 V vehicle batteries. They come in a wide vari- ety of output powers (anything between 1 5 and 1 ,000 watts) and quality of the AC output voltage (anything from abominable to pure sinewave). Some models even have output voltage regulation. Few however combine power factor correction (PFC)with ‘pure-sine-wave-out*, hence a suggested design appears in this article, along with a light theoretical background. Into the circuit With reference to circuit diagram in Fig- ure 1 , IC2 and crystal Q1 form a 4.096 MHz high frequency clock. The Type CD4060 14-stage binary divider together with IC3, a Type CD401 7 Johnson counter, scale down the basic clock frequency to a 50 Hz square wave. For 60 Hz output, the quartz crystal frequency has to be changed accordingly. The clock signal is then processed by IC5 and IC6.A which with their associated net- works that together form a soft start unit. IC6.B with its twin-T filter network selects the 50 Hz (or 60 Hz) fundamental fre- quency which by Fourier analysis is a pure sinewave. The next component in the chain, IC6.C, acts as Schmitt trigger transforming the basic high frequency unipolar signal into a symmetrical square wave signal. This is inte- grated and mixed with the 50 Hz sine wave from the notch by IC6.D. IC1 3 and associated components is a com- parator which compares a DC signal with the output of the comparator to give a pulsewidth modulated signal which in turn drives IC1 4, a Type IR21 04 half bridge driver. The half bridge proper consists of power FETs T2-T3 and T4-T5, the latter being optional for higher output powers when required. The half bridge topology drives the primary of a 9 V 1 6 A power transformer to give a 230 V (or 1 1 5 V) rms output voltage with a rated power of 1 00 VA. A 100 pH inductor (Bourns 23000L; for vertical mounting) is inserted in series with the primary. Capaci- tors Cl 1 and C25 are connected across the secondary of the transformer to filter out the high switching frequency. Note that we call the 9-V winding 'the primary* and the 230-V (1 15-V) winding ‘the secondary’ and not the other way around as is customary with AC power transformers. The secondary’s inductance of the trans- former doubles as a power factor correction (PFC) element when driving energy saving lamps, which tend to have a leading power factor (see inset). In terms of additional components seen in the circuit, IC1 6 is used as a level detecting network for the batteries. IC17A, IC17Band FETsT6-T7 form a battery charger with an Power factor correction and the Osram lam The power factor of a typical Osram energy saving lamp is 0.6 ca- pacitive (i.e. leading). Fora 21 -watt lamp, the I/P power SI =21/0.6 = 35 W. The ‘VA* value Q1 can be calculated vectorially as: Q1 * V(35 2 - 21 2 ) = 28 VA Let the power factor = 0.9 after correction, then S2 = 21 / 0.9= 23.3 VA Q2 = V(23.3 2 - 21 2 ) = 10.1 VA Hence Q a (amount to be corrected) = 17.9VA leading Now, for the transformer’s secondary inductance, L 5 = V2/(27tx50* 17.9) = 9.45 H From measurements, L p = 1 2.32 mH. L s = n*L p = 9.49 H, for n of 28 as deduced from knowledge of the number of turns on the transformer. Hence the inverter transformer provides a PF correction of 0.9. Note. Readers’ Projects are reproduced based on information supplied by the author(s) only. The use ofElektor style schematics and other illustrations in this artide does not imply the project having passed El ektor Labs for replication to verify claimed operation. 68 io- 2 on elektor READERS PROJECTS 100 watts, 24 VDC to 230 VAC rms pure sine wave out BZ304C13 IC16.C O SPr ♦ SP- o cmvuy 1 401 7N EM ITS cnm ♦ ci < 4QE <11: ■H +1W cw ♦wut LT102C icur -16V 1DDC77 11 I ;«'i. C14 IM» CIS IBM LTO, U COM ©+15V in ICC = LTl2i2N 0-1SV +12V m: LM317L IC1 5 IC15A IC1S.B H. 1C 16 LTC1440 HVW mon •Cl 7 = LT1211 ici7* :s 7 ooo BT ■ I 1 ioft> 1 M Figure 1 . The circuit diagram of the power inverter is rather elaborate due to the use of standard integrated circuits and transistors (from Farnell) rather than dedicated converter ICs. elektor 10-2011 69 READERS PROJECTS The output filter The output filter is configured to pass a band of frequencies beyond which the signal is greatly attenuated. This may be achieved by connecting a capacitor across the secondary winding as shown in the circuit diagram. It can be shown that the input impedance looking into the primary terminals is given by: a - 2 + / ^ = 0 *2 = ( (oM ) 2 ,, (co 2 M 2 ) 2 2X\ ±l A. xl -4R$ But X\ = Xi(N\!N£p and remembering the expression for (?a swell as noting L 1 /L 2 = (N\!N^ 2 % we have (for At a second resonance ( [coMfX2 R$ + X* or Rpk 2 Q or X 2 =k 2 R 2 Q Thus at a second transition, substituting X 2 and noting that the im- aginary part is zero Z\-R\ + (coM ) 2 /? 2 x(l + *V) Therefore I^ ’is roughly proportional to 1/co 2 forco»co 0 , which is very desirable. output voltage of 25-26 V. IC1 1 and IC1 2 form a ±1 5 V symmetrical supply for the operational amplifiers, and IC1 is a stand- ard 5 V regulator for the logic. Schmitt trig- ger gates IC1 5A and IC1 5 B form a power on reset (POR). Capacitors CA and CB are ‘off board* parts because of their size — their value has to be established experimentally. The prototype of the inverter worked best using two Evox/Rifa 22,000 pF, 25 V electro- lytic, aluminium can capacitors with stud / nut mounting. The thicker lines in the circuit diagram indi- cate PCB tracks, pads and connectors suit- able for carrying DC currents up to 32 A. Practical matters The introductory photo shows an early pro- totype of the inverter, which is being devel- oped further aiming to go into actual pro- duction. The power FETs in the bridge are secured to a Type SFP1 00 heatsink which acts as the top side of the case. Two nuts on the side panel secure the large electro- lytes CA and CB, which are electrically iso- lated using special materials the author is willing to share. A circuit board was designed by the author and the artwork files (silk screen and cop- per track) may be downloaded from [1], along with tooling data for a Type KOH1 0- KOR2-160-ME-SL enclosure from Fischer Elektronik (UK distributor: Dau Components Ltd.). PCB tracks carrying high current (refer to circuit diagram) should be strength- ened by soldering 1.5 mm 2 c.s.a. (approx. 1 6 AWG) massive copper wire along their paths. (100677) Internet Link [1 ] www.elektor.com/ 100677 (PCB design and case drilling data) 70 10-2011 elektor MICROCONTROLLERS FET Driver for Microprocessors Modern microprocessors can deliver respectable currents from their I/O pins. Usually they can source (i.e., deliver from the power supply) or sink (i.e. con- duct to ground) up to 20 mA without any problems. This allows the direct drive of LEDs and even power FETs. It is suffi- cient to connect the gate to the output of the mP (see Figure 1 ). Driving a FET from a weaker driver (such as the standard 4000 series) is not recommended. The FET would switch very slowly. That is because power FETs have sev- eral nF of input capacitance, and this input capacitance has to be charged or discharged by the mP (microprocessor) output. To get an idea of what we’re talking about: the charge- or discharge time is roughly equal to VxC//or 5 V x 2x1 0-9/ (20x1 0 - 3 ) = 0.5 ms. Not all that fast, but still an acceptable switching time for a FET. However... Not every FET is suitable for this. Most FETs can switch only a few amps with a voltage of only 5 V at their gate. The so-called logic FETs do better. They operate well at lower gate voltages. So take note of this when selecting a FET. To make matters worse, many modern mP systems run at 3.3 V and even a logic FET doesn’t really work properly any more. The solution is obviously to apply a higher gate voltage. This requires a little bit of external hardware, as is shown in Figure 2, for example. The mP drives T1 via a resistor, which limits the base current T1 will conduct and forms via D1 a very low imped- ance path to ground that quickly discharges the gate. When T1 is off, the collector voltage will rise quickly to 12 V, because D1 is blocking and the capacitance of the gate does not affect this process. However, the gate is connected to this point via emitter follower T2. T2 ensures that the gate is connected quickly and through a low impedance to (nearly) 12 V. In the example a voltage of 1 2 V is used, but this could easily be dif- ferent. Note that if you’re intend- ing to use the circuit with 24 V, for example, that most FETs can toler- ate only 1 5 or 20 V of gate voltage at most. It is therefore better not to use the driver with voltages above 1 5-V. We briefly mentioned the 4000 series a little earlier on. There are two exceptions: the 4049 and 4050 from this series are so-called buf- fers, which are able to deliver a higher current (source about 4 mA and sink about 1 6 mA). In addition this series can operate from volt- ages up to 18 V. This is the reason that a few of these gates connected in parallel will also form an excellent FET-drive (see Figure 3). When you connect all 6 gates (from the same 1C!) in parallel, you can easily obtain 20 mA of driving current. This looks like an ideal solution, but unfortunately there is a catch. Ide- ally, these gates require a voltage of 2/ 3 of the power supply voltage at the input to recognize a logic one. In practice it is not quite that bad. A 5 V microprocessor system will certainly be able to drive a 4049 at 9 V. But at 1 2 V things become a bit marginal! (060036-1) elektor 10-2011 71 RETRONICS XL The Chaos Machine Analogue Computing Rediscovered (2) By Maarten H. P. Ambaum and R. Giles Harrison (Department of Meteorology, University of Reading, UK), Jan Buiting and Thijs Beckers (Elektor Labs) The analogue computer we set out to describe in the previous instalment was constructed from separate computation modules for multiplication, integration, summation and scaling, combined to represent the Lorenz 1 963 equation system (ref. part 1 ). The circuits for the modules are largely based on suggestions in Peyton and Walsh, Analog Electronics with Op Amps: A Source Book of Practical Circuits , where more details on their functionality can be found. We found the use of breadboards very suitable for this project but have also made a soldered version that travels better. Modular approach to Chaos Figure 1 provides an overview of how the computational modules are combined, in terms of the signal paths and Figures 2a through 2g provide individual circuit schematics for each of the computational modules required. A summary of their function is given below, but first the Block diagram (Figure 1). This figure shows the combination of computation modules required for the complete analogue computer. Triangles represent function modules, each with a set of inputs and a single output. ^-0 20 s ®>> — ^1 0 — 0^— G-0 "-O^r v f y G-« noMi 11 Figure 1 . Block diagram of the Chaos Machine. Each function shown corresponds to one of seven basic circuits from Figures 2a through 2g, solving the Lorenz equations. Symbols (+) and (-) are used to denote non-inverting and inverting inputs, and (x) multiplication. A thin rectangle on the input side of the triangle denotes an integrator. The gain-8 scaling amplifiers (ident: ‘D’) are included to ensure that the voltages in each wire do not exceed the stated maximum amplitude of ±10 V in any of the op amp input stages and the multiplier chip. Output voltages are available at the three nodes marked V x , V, V, for use with an oscilloscope having an ‘xy’-display mode and ‘z’ axis (intensity) modulation. This model has a control (in module ‘A’) to vary the Prandtl number (parameter a in the Lorenz equations) between 0 and 20, to display the different regimes of the Lorenz equations. A: Differential Amplifier (Figure 2a). Input voltages V 1 and V 2 are buffered by dual op amp stage A1 , subtracted in op amp stage A2.A, and then amplified by an inverting amplifier stage A2.B with gain G (up to x -20). Function: V out = G (V, - V 2 ). B: Inverting Integrator (Figure 2b). Input voltage V v referred to the signal ground, is buffered by op amp stage A2.A, and then integrated by stage A2.B. A dual op amp package provides both amplifiers. Function: V out = J dt/(3.3x lO^s) C: Inverting Scaling Amplifier (Figure 2c). Input voltage V v referred to the signal ground, is buffered, and applied to an inverting amplifier stage with variable gain G (up to x -5) set by the 1 00 k Cl potentiometer. Function: = -GV y Top C: G = -3.5; bottom C:G=-2.7. D: Non-inverting Scaling Amplifier (Figure 2d). Input voltage V v referred to the signal ground, is buffered, and amplified by a non- inverting stage with a fixed gain of 8. Function: V out = 8V r E: Inverting Summer Amplifier (Figure 2e). Input voltages V, and V 2 are buffered, and added in the third, inverting, stage. A dual op amp package provides both input amplifiers, and a further package, the summation stage. Function: V out = -(V, + V 2 ). F: Non-inverting Summer Amplifier (Figure 2f). Each of the three input voltages V,, V 2 , and V 2 are buffered, and then added in a summation stage. Two dual op amp packages can be used. Function: V = V, + V + V_. out 12 3 G: Multiplier (Figure 2g). A function chip (type AD633) is used to determine the product of two input voltages, with a further non- inverting stage contributing a gain of xi 0 to establish a scaling voltage V 0 of 1 V. Function: V oA PADS | OfCAD | PCB layout ^ -learning 3R0 $5 Hourly PCB Layout & library service @$5 Hourly PCB Reverse Engg, MCU Code/ckt Extraction service Leam 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 LTD. www.easysync-ltd.com/ Supplier of communications and instrumentation products with specialist expertise in serial connectivity solutions based on USB, CAN and RS232/RS422/ RS485 interfaces. • USB to Serial RS232/RS422/RS485 converter cables. • CANbus solutions • Ethernet to Serial Adapters or to USB hubs. • USB based Logic Analysers, Oscilloscopes & Data Loggers. • OEM & ODM design services. ELNEC www.elnec.com Europe's leading device programmers manufacturer: • reliable HW: 3 years warranty for most programmers • support over 58.000 devices • free SW updates • SW release: few times a week • excellent technical support: Algorithms On Request, On Demand SW • all products at stock / fast delivery - FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk Wf5t • Training and Consulting Technology for IT, Embedded and Transfer Ltd Real Time Systems • Assembler, C, C++ (all levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas, Tl, Freescale • CMX, uCOSII, FreeRTOS, Linux operating systems • Ethernet, CAN, USB, TCP/IP, Zigbee, Bluetooth programming FLEXIPANEL LTD www.flexipanel.com TEAdippers - 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 HEXWAX LTD www.hexwax.com World leaders in Driver-Free USB ICs: • USB-UART/SPI/12C bridges • TEAleaf-USB authentication dongles • expandlO-USB I/O USB expander • USB-RleSys flash drive with SPI interface • USB-DAQ data logging flash drive SCOPES and more Instruments A Rohde & Schwarz Company www.hameg.com Great Value in TEST & MEASUREMENT satisfy your inner geek minty geek a fresh approach FUTURE TECHNOLOGY DEVICES INTERNATIONAL LTD. www.ftdichip.com FTDI specialise in USB silicon, hardware and software solutions. • USB WHQL complaint drivers. • USB host and slave solutions. • Free firmware development tools, • USB IC's, modules, cables and turnkey custom solutions. ^ • World renowned FOC application support. USB MADE EASY Cool portable electronic projects and kits www.mintygeek.com WWW. elektor. com 78 10-2011 elektor products and services directory MaxSonar Ultrasonic Range Finder XL-MaxSonar-EZ * Beam pattern choice • High acoustic power * Real-time calibration • 39.95USD / unit MaxSonar-WRC ip$7 • Compact packaging • Quality narrow beam •99.95USD/ unit www.active-robot.co.uk www.coolcomponents.co.uk www.oceancontrols.com.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 *NEWM* • Lego NXT Mindstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • POB Robots (kits and components) email: sales@robotiq.co.ukTel: 020 8669 0769 tyder BBH ww http://www.tyder.com • ONEoverT Digital Filter Design Software (Full version for only £30) • Design FIRs, HRs, NCOs, FFs for DSPs and FPGAs • VHDL Code Generators • Makes DSP design simple • Download demos from website WWW. elektor. com 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. TO BOOK YOUR SHOWCASE SPACE CONTACT: ELEKTOR INTERNATIONAL MEDIA Tel. 0031 (0) 46 4389444 Fax 0031 (0) 46 43701 61 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! 1 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 0031(0)46 4370161 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION elektor 10-2011 79 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES A world of electronics from a single shop! PC Voice Control ! Limited Period w for Elektor Subsci iber 13% DISCOUNT www.elektor.com! vcs lektor User “Computer, turn on hall lights” - Computer: ”Hall lights on” Design your own PC Voice Control System Don’t you feel it’s just about time we could simply talk with computers and get them to handle some of the everyday house automation tasks - lights, doors, gates, curtains, televisions, music and other domestic appliances? Oreven make the information super-highway slicker by talking wit h y o u and te II i ng y o u about the i nformat ion you req uested to be retrieved from the web? Th ink of all the time and inconvenience you could save - no more need to install yourself at a desk and fumble about with keyboard and mouse. Well now you can! This book guides you through practical speech recognition, speech annunciation and control of really useful peripherals. It details a project which will enable you to instruct your computer using your voice and get it to control electrical devices, tellyou the time, checkyour share values, gettheweatherforecast, etc. and speak it all back to you in a natural human voice. If you are interested in the practical techno- logy of interfacing with machines using voice, such as talking with your own PC, then this book is your guide! Approx. 21 6 pages • ISBN 978-1 -907920-07-3 • £29.50 • US$47.60 Introduction to Control Engineering » 0l#fctor Solutions for control system applications Introduction to Control Engineering This book is intended as a source of refe- rence for hardware and software associ- ated with instrumentation and control eng ineering. Exa mples are presented from a range of industries and applications. Throughout the book, circuit diagrams and software listings are described, typical of many measurement and control appli- cations. The hardware and software de- signs may be used as a basis for application by the reader. The book conta in s exa mples of PIC, PLC, PACand PC programming. 164 pages • ISBN 978-0-905705-99-6 £27.50 * US $44.40 Mastering the l 2 C Bus 1 QNMor LabWorX 1 LabWorX: Straight from the Lab to your Brain Mastering the l 2 C Bus Mastering the l 2 C Bus is the first book in the LabWorX collection. It takes you on an exploratory journey of the l 2 C Bus and its applications. Besides the Bus protocol plenty of attention is given to the practical applications and designing a solid system. The most common l 2 C compatible chip classes are covered in detail. Two experi- mentation boards are available thatallow for rapid prototype development. These are completed by a USB to l 2 C probe and a software framework to control l 2 C devices f rom y o u r co mputer. 248 pages • ISBN 978-0-905705-98-9 £29.50 • US $47.60 8o Prices and item descriptions subject to change. E. & O.E io- 2 on elektor Controller Area Network Projects f 41 i yli • «T ♦ il . * r _ • i i */ l*V.-! Vf-' *-• kirk tor Bestseller’. Free mikroC compiler CD-ROM included Controller Area Network Projects The aim of the book is to teach you the basic principles of CAN networks and in addition the development of microcon- troller based projects using the CAN bus. You will learn howto design microcon- troller based CAN bus nodes, build a CAN bus, develop high-level programs, and then exchange data in real-time over the bus. You will also learn how to build mi- crocontroller hardware and interface it to LEDs, LCDs, and A/D converters. 260 pages • ISBN 978-1 -907920-04-2 £29.50 • US $47.60 A highly -practical guide Linux - PC -based Measurement Electronics If you want to learn how to quickly build Linux-based applications able to collect, process and display data on a PC from va- rious analog and digital sensors, how to control circuitry attached to a computer, then even how to pass data via a network or control your embedded system wire- lessly and more - then this is the book for you I The book covers both hardware and software aspects of designing typical em- bedded systems using schematics, code listings and full descriptions. 264 pages • ISBN 978-1-907920-03-5 £29.50 • US $47.60 Design your own Enhanced second edition: 180 new pages Design your own Embedded Linux Control Centre on a PC The main system described in this book re- uses an old PC, a wireless mains outlet with three switches and one controller, and a US B webca m. All tHis is li nked together by Linux. This book will serve up the basics of settin g u p a Li nux environ ment - i ncludi ng a software development environ ment - so it can be used as a control centre. The book will also guide you through the necessary setup and configuration of a Webserver, which will be the interface to your very own home control centre. New edition en hance- ments indude details of extending the ca- pabilities of your control center with ports for a mobile phone (for SMS messaging) and the Elektor “thermo snake" for low- cost networked real-time thermal moni- toring ofyour house and outbuildings. Now you can additionally also send all kinds of usefu I temperatu re and sensor warnings to a mobile phone. All software needed will be available at the Elektor website. 416 pages* ISBN 978-1 -907920-02-8 £34.50 • US $55.70 V J r 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: order@elektor.com ektor Circuits, ideas, tips and tricks from Elektor cd 1001 Circuits This CD-ROM contai ns more than 1 000 ci r- cuits, ideas, tips and tricks from the Sum- mer Curcuits issues 2001-201 0 of Elektor, supplemented with various other small projects, including all circuit diagrams, descriptions, component lists and full- sized layouts. The articles are grouped alphabetically in nine different sections: audio & video, computer 8 < microcontrol- ler, hobby & modelling, home 8 < garden, high frequency, power supply, robotics, test 8 < measurement and of course a sec- tion miscellaneous for everything that didn’t fit in one of the other sections. Texts and component li sts may be searched with the search function of Adobe Reader. ISBN 978-1 -907920-06-6 £34.50 * US$55.70 More than 70,000 components cd Elektor’s Components Database 6 This CD-ROM givesyou easy access to de- sign data for over 7,800 ICs, more than 35,600 transistors, FETs, thyristors and tri- acs, just under 25,000 diodes and 1 ,800 op- tocou piers. The program package consists of eight databanks covering ICs, transistors, diodes and optocou piers. A further el even appl ications cover the calculate on of, for ex- am pie, zener di ode series resistors, voltage regulators, voltage dividers and AMV’s. A colour band decoder is included for deter- mining resistorand inductorvalues. All da- tabank applications are fully interactive, allowing the usertoadd, edit and complete component data. ISBN 978-90-5381 -258-7 £24.90 • US $40.20 V. J elektor 10-2011 81 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Morethan 25 projects based on the Elektor ATM18 board cd ATM1 8 Collection This CD-ROM contains all articles from the popular ATM1 8-CC2 series published in Elektor magazine. From RFID Reader and Bluetooth linking right upto a chess com- puter! Project software and PCB layouts in PDF format are included. What’s more, this CD also contains a Bascom AVR program- ming course and helpful supplementary documentation. ISBN 978-0-905705-92-7 £24.50 • US$39.60 All articles in Elektor Volume 201 0 dvd Elektor 2010 This DVD-ROM contains all editorial arti- cles published in Volume 2010 of the English, Spanish, Dutch, French and Ger- man editions of Elektor. Usingthe supplied Adobe Reader program, articles are pre- sented in the same layout as originally found in the magazine. An extensive search machine is available to locate keywords in any article. With this DVD you can also produce hard copy of PCB layouts at printer resolution, adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other programs. ISBN 978-90-5381-267-9 £23.50 • US$37.90 USB Long-Term Weather Logger (September201 1 ) This stand-alone data logger displays pressure, temperature and humidity rea- dings generated by l 2 C bus sensors on an LCD panel, and can run for six to eight weeks on three AA batteries. The stored readings can be read out over USB and plotted on a PC using gnuplot. Digital sensor modules keep the hardware sim- ple and no calibration is required. Kit of parts incl. PCB, controller, humidity sensor and air pressure sensor modules Art.# 100888-73 - £31.10 • US$50.20 Wireless OBD-II (April 2011) The cheapest way to diagnose faults on a modern car is to connect its OBD-II interface to a (notebook) PC running suitable diagnostics software. However, a wired connection is not always the most suitable, and selfcontained OBD testers are a rather expensive and less flexible alternative to using a PC. An interesting option is a wireless OBD interface with a radio interface to a PC: this homebrew solution all owsthe choice of using either Bluetooth orZigBee. OBD2-Zigbee or Bluetooth interface kit with all parts and enclosure Art.# 100872-71 £111.00 • US $179.10 (Zig bee) Art# 100872-72 £111.00* US $179. 10 (Bluetooth) Pico C Meter (April 2011) RF and radio repairfans probably do need to be told, but when it comes to measu- rements below 200 pF or so, modem DMMs will produce coarse if not ridiculo- us results. Elektor’s purpose-designed Pico C does a far better job. Beating many DMMs hands down, this little instrument easily and accurately measures capaci- tances down to fractions of a picofarad! Kit of parts incl. Elektor Project Case, programmed microcontroller, LCD and PCB Art.# 100823-71 • £73.40 • US$1 18.40 V J NetWorker (December 201 0) An Internet connection would be a valua- ble addition to marry projects, but often designers are put off by the complexities invo Ived . The * NetWorker’ , whi ch consi sts of a small printed circuit board, a free soft- ware library and a ready-to-use microcon- troller-based web server, solves these problems and allows beginners to add In- ternet connectivity to their projects. More experi enced users wi 1 1 benefit fro m feat u- res such as SPI communications, power over Ethernet (PoE) and more. Module, ready assembled and tested Art# 100552-91 • £53.00 • US$85.50 V 82 Prices and item descriptions subject to change. E. & O.E 10-20TI elektor October 2011 (No. 41 8) £ US$ + + + Product Shortlist October: See www.elektor.com + + + September 2011 (No.417) eC-Reflow-Mate 100447-91 .... Professional SMT reflow oven 2170.00...3495.00 USB Long-Term Weather Logger 100888-1 Printed circuit board ....16.00. 25.90 100888-41 .... Programmed controller ATMEGA88-20PU 8.85 . 14.30 100888-71 .... HH10D humidity sensor module 7.10.. 11.50 100888-72 .... HP03SAair pressure sensor module 5.75.. 9.30 100888-73.... Kit of parts incl. PCB, controller, humidity sensor and air pressure sensor modules .... 31.10.. 50.20 PC Sensors 100888-71 .... HH10D humidity sensor module 7.10.. 11.50 100888-72.... HP03SA air pressure sensor module 5.75.. 9.30 E- Blocks go IWitter EB003 E-blocks Sensor board ....21.60.. 34.90 EB005 E-blocks LCD board .... 24.00.. 38.80 EB006 E-blocks PIC Multiprogrammer .... 72.00.. ...116.20 EB007 E-Wodcs Switch board ....14.40.. 23.30 EB059 E-blocks Servo board ....14.40.. 23.30 EB069 E-Wocks Wireless LAN board .. 132.00.. ...212.90 TEDSSI4 Flowcode 4 for dsPIC/P1C24 ..178.80.. ...288.40 FT232R USB/Serial Bridge/BOB 110553-91 .... PCB. assembled and tested .... 12.90. 20.90 Here Comes the Bu si (7 ) 110258-1 Experimental Node board, bare 5.30.. 8.60 110258-1 C3 .. 3 x Experimental Node board, bare ....11.50.. 18.60 110258-91 .... USB/RS485 Converter, ready made module .... 22.20.. 35.90 J2B: Universal MMI Module using ARM Cortex-M3 050176-74.... Enclosure Bopla Unimas 1 60 8.85.. 14.30 110274-71 .... Tested PCB with LPC1 343 microcontroller, aystal, 3V3 voltage regulator, LCD interface & USB interface mounted. LED and headers www.elektor.com 110274-72 .... LC-display 4x20 characters (HD44780 compatible) www.elektor.com july/August 201 1 (No. 41 5/41 6) 2/4/6-hourTimer 11 02 1 9-41 .... Programmed controller PIC1 2F675 DIL8 Morse dock 8.85... ....14.30 110170-41 .... Programmed controller ATTiny4520-PU dip 8 Return of the Elex Prototyping Board 8.85... ....14.30 ELEX-1 Printed circuit board Universal exp. board ELEX-2 Printed circuit board Double version universal 4.90... 7.90 exp. board ELEX-4 Printed circuit board Quadruple 8.85... ....14.25 version universal exp. board Arc Welding Effect for Model Railway Layouts .... 16.00... ....25.80 110085-41 ....Programmed controller PIC1 0F200-I/P (DIP8) Slave Flash for Underwater Camera 8.85... ....14.30 100584-41 .... Programmed controller PIC12F675i/pDIL8 WAV Doorbell 8.85... ....14.30 110080-41 ....Programmed controller ATmega328pDIL28 RGB Solar Lamp ....11.55... ....18.60 1 0058 1 -41 .... Prog ra mmed controller ATTiny 1 3 DIL8 Jogging Timer 8.85... ....14.30 110160-41 .... Programmed controllerATtiny44-20PU dip 14 Battery Charge Monitor 8.85... ....14.30 1101 54-41 .... Programmed controller PIC16F873A Roadwork Traffic Signals for Modellers .... 12.50... ....20.10 110203-41 .... Programmed controllerATTiny13 (8-pen DIP) Ma ke You r R8C / 1 3 Speak CAN 8.8... ....14.30 050179-91 .... 16-bit R8C microcontroller board ....10.90... ....17.60 Mastering the PC Bus ISBN 978-0-905705-98-9.... £29.50 US $47.60 3 4 5 Linux - PC-based measurement electronics ISBN 978-1 -907920-03-5.... £29.50 US S47.60 Introduction to Control Engineering ISBN 978-0-905705-99-6.... £27.50 US S44.40 Design your own Embedded Linux Control Centre on a PC ISBN 978-1 -907920-02-8.... £34.50 US S55.70 01 Circuits ISBN 978-1 -907920-06-6.... £34.50 US S55.70 DVD Elektor 2010 ISBN 978-90-5381 -267-9.... £23.50 US S37.90 CD Elektor’s Components Database 6 ISBN 978-90-5381 -258-7 .... £24.90 US S40.20 D Q U DVD Elektor 1 990 through 1 999 ISBN 978-0-905705-76-7 .... £69.00 ...US S 1 1 1 .30 CD ATM1 8 Collection ISBN 978-0-905705-92-7.... £24.50 US S39.60 USB Long-Term Weather Logger Art. # 1 00888-73 £31 .1 0 US S50.20 Here comes the Bus) Art. # 1 1 0258-91 £22.20 US S35.70 Pico C Meter Art. # 1 00823-71 £73.40 ...US S 1 1 8.40 MPyl Wireless OBD-il Art. # 1 00872-71/72 £1 1 1 .00 ...US SI 79. 10 NetWorker Art. #100552-91 £53.00 US S85.5Q / Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH • United Kingdom Tel. +44 20 8261 4509 Fax +44 20 82614447 Email: order@elektor.com elektor 10-2011 83 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR OnCE / JTAG Interface For the DSP Programming Course, Elektor Labs developed a DSP board built around a Freescale DSP56374 chip. A JTAG interface is available on the PCB to allow DSP program- ming and debugging. For this, Freescale provides its own 14-pin connector, called OnCE (On-Chip Emulation). For easy connection to PC a small USB-to-OnCE/JTAG-interface was created, designed around a Hi-Speed Dual USB UART / FIFO 1 C from FTDI. The interface is also useful for other DSPs from Freescale and acts as a Symphony Soundbite adapter. Low-cost Bat Detector Unfortunately we did not have a PCB ready in time in support of the annual European Bat Night on Friday August 26, 2011, but that should not affect the general appeal of the cir- cuit. We’re talking about a simple frequency changer employing division to shiftthe ultra- sonic sounds emitted by bats into the audible range for us humans to hear. The circuit is all built from standard components and can easily be mounted inside a piece of PVC pipe. RGB - YPbPr Converter Many satellite or Internet television receivers and/or decoders still don’t have HDMI outputs, but do offer a good old SCART socket. Besides, the majority of high-definition flat-screen TVs, as well as high-quality video projectors, are fitted with inputs referred to as ‘component’ or more appropriately YPbPr (sometimes incorrectly called YUV). But although the SCART socket is often able to supply the video signals for the three primary colours red, green, and blue these can’t unfortunately be fed directly to the Y/Pb/Prinputs of TVs and video projectors. We decided to solve this problem with a DIY circuit. Article titles and magazine contents subject to change; please check the Magazine tab on www.elektor.com Elektor UK/European November 2011 edition: on sale October 20, 2011. Elektor USA November 2011 edition: published October 17, 2011. w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor.com wv Elektor on the web All magazine articles back to volume 2000 are available individually in pdf format against e-credits. Article summaries and parts list s(if applicable) can be instantly viewed to help you positively identify an article. Article related items and resources are also shown, including software downloads, hyperlinks, circuit boards, programmed ICs and corrections and updates if applicable. In the Elektor Shop you’ll find all other products sold by the publishers, like CD-ROMs, DVDs, kits, modules, equipment, tools and books. A powerful search function allows you to ith earn if-Tlg i mi si Fn r_ m search for items and references across the entire website. Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Time limited offers • FAQ, Author Guidelines and Contact PlE'lV KIXM rm.-Ti. T i a - d rn-* r - ElcJUs* -fubt Controller Area Network Projects 50 % DISCOUNT on selected |w *m __ __ j nkrifel . eDsmiDVDs!; - ^ _ iv V . 1 - r * m*Upr Wl Ft l An l f pur ICE m ul m n n Elektor T yw bn ■ iMJHa. r pr-jnnn-i WMcrtj** Mta -J rc pisuau ltd KS^LlftTl 84 io-20iie lektor Description Price each Qty. Total Order Code 1 CD 1001 Circuits £34.50 Design your own PC Voice Control System Controller Area Network Projects £29.50 LabWorX - Mastering the l 2 C Bus £29.50 Lin ux - PC-based Measurement Electronics £29.50 CD Elektor's Components Database 6 £24.90 DVD Elektor 2010 £23.50 Sub- toted P&P Prices and item descriptions subject to change. The publishers reserve the rightto change prices without prior notification. FYices and item descriptions Totol paid shown here supersede those in previous issues. E. & O.L Name Address + Post code Tel. Email Date - - Signature ELIO METHOD OF PAYMENT (see reverse before ticking as appropriate) | Bank transfer | Cheque (UK-resident customers ONLY) □ WSA Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.eiektor.com order@elektor.com *USA and Canada residents should use $ prices, and send the order form to: Elektor US POBox ISO Vernon CT 06066 USA Phone: 860-875-2199 Fax: 860-871-0411 E-mail: orderSelektor.com Yes, I am taking out an annual subscription to Elektor and receive the E-book Standard Subscription (11 issues) I I Subscription-Plus (11 issues plus the Elektor Volume 2011 DVD-ROM + exclusive access to www.elektor-plus.com ) Microcontroller Basics totally free!" (Please fill in your emailaddress below) I would like: * Offer available to Subscribers who have not held a subscription to Elektor during the last 1 2 months. Offer subject to avaHabtiity. See reverse for rates and conditions. Name Address + Postcode Email Date Signature ELIO METHOD OF PAYMENT (see reverse before ticking as appropriate) | Bank transfer Cheque (UK-resident customers ONLY) n visa □ Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com service@elektor.com ORDERING INSTRUCTIONS, P&P CHARGES All orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. Online ordering: www.elektor.com/shop Readers in the USA and Canada should send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Elektor US for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £1 1.00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40270211 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BlC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. GCredit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran- tee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 1 0-days (UK); 1 4-days (Europe) or 2 1 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 1 0% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsi- bility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party adver- tisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed -a rcu it boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. January 2011 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION United Kingdom & Ireland Standard £51.00 Plus £63.50 Surface Mail Rest of the World £65.00 £77.50 Airmail Rest of the World £82.00 £94.50 USA & Canada | Seemvw.elektor.com/usafor special offers | HOW TO PAY Bank transfer into account no. 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BlC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident cus- tomers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a permanent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of stud entsh ip signed by the head of the college, school or university faculty. A standard Student Subscription costs £40.80, a Student Subscription-Plus costs £53.30 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twenty-five per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 201 1 Create complex electronic systems in minutes using Flowcode 4 FLOW CODE MO CODING, NO LIMITS... Design - Simulate - Download Flowcode is one of the World’s most advanced graphical programming languages for micro- controllers (PIC, AVR, ARM and, brandnew, dsPIC/PIC24). The great advantage of Flowcode is that it allows those with little experience to create complex electronic systems in minutes. Flowcode’s graphical development interface allows users to construct a complete electronic system on-screen, develop a program based on standard flow charts, simulate the system and then produce hex code for PIC, AVR and ARM microcontrollers. Convince yourself. Demo version, further information and ordering at www.elektor.com/flowcode Index of Advertisers BAEC. Showcase Beta Layout CEDA, Showcase Designer Systems, Showcase Easysync, Showcase Qnec, Showcase Eurocircuits EzPCB/Beljing Draco Electronics Ltd First Technology Transfer Ltd, Showcase . . . RexlPanel Ltd, Showcase Future Technology Devices, Showcase Hameg, Showcase HexWax Ltd, Showcase Jackaltac http-J/baec. tripod, com / 78 www.pcb-pool.com 27 www.ceda.tn 78 www.designersystems.co.uk . . www. easysync -ltd. com 78 www.einec.com 78 www.eurodrcuits.com 67 www.v-moduie.com 27 www.ftt.co.uk •••••••«••« www.ftexipanel.com 78 www.ftdichlp.com 78 www.hameg.com 78 www.hexwaxcom 78 www.facka1tac.com 11 Labcenter. Maxhotix, Showcase Minty Geek, Showcase MikroElektronika. FNco Technology Quasar Electronics Robot Electronics, Showcase. Rohotiq, Showcase Showcase TVder, Showcase Vlrtlns Technology, Showcase www.laticenter.com 88 wwwjnaxtJotix.com 79 wwwjnlntygeek.com 78 www.llbstock.com 3 www.pfcotech.com/scope3111 31 www. quasarelectronlcs. com 13 www.robot-efectronics.co.uk 79 www.robotiq.co.uk 79 78, 79 www, tyder.com 79 www.vlrtins.com 79 Advertising space for the Issue 15 November 2011 may be reserved not later than 18 October 2011 with Elektor International Media - Allee 1 , 6141 AV Limbricht, the Netherlands Telephone 0031 (0) 46 4389444 - Fax 0031 (0) 46 4370161 - e-mail: advertenties@elektor.com to whom all correspondence, copy instructions and artwork should be addressed. elektor 10-2011 87 PRE-PRODUCTION CHECK CHECK CHECK All Connections Routed - CHECK Power Planes Generated - CHECK l\lo Design Rule Violations - CHECK Design with Confidence: The latest version of the Proteus PCB Design Software provides a multi- stage Pre-Production Check which will detect and prevent a variety of common mistakes prior to your boards being sent for manufacture. PROTEUS DESIGN SUITE Features: ■ Hardware Accelerated Performance. ■ Board Autoplacement & Gateswap Optimiser. ■ Unique Thru-View™ Board Transparency. ■ Direct CADCAM, ODB++, IDF & PDF Output. ■ Over 35k Schematic & PCB library parts. ■ Integrated 3D Viewer with 3DS and DXF export. ■ Integrated Shape Based Auto-router. ■ Mixed Mode SPICE Simulation Engine. ■ Flexible Design Rule Management. ■ Co-Simulation of PIC, AVR, 8051 and ARM7. ■ Polygonal and Split Power Plane Support. ■ Direct Technical Support at no additional cost. All levels of the Proteus Design Suite include a world class, fully integrated shape-based autorouter at no additional cost - prices start from just £150 exc. VAT & delivery Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com Visit our website or phone 01 756 753440 for more details