January 2012 AUS$ 14.90 - NZ$17.90 - SAR105.95 - NOK102 £4.90 New course: Electronics for Starters Wideband L‘ambdalProbe Interface l O » j m ' - 1 I If Tiny fluctuations evidenced by LEDs Wavelet Analysis On a PIC32 development system Ultra accurate & DSP based www.elektor.com I Colette, Annette, Babette, Georgette ' Tubed portable radios from the 1950s 770268 451 73 DesignSpark chipKIT" Challenge The DesignSpark chipKIT™ Challenge is well under way! Have you registered at www.chipkitchallenge.com yet? Hurry over and get involved in the DesignSpark community today. By submitting your proposal for an energy-efficient design solution, you will automatically be considered for a chipKIT™ Community Choice Award*. At the end of January, one lucky participant will be rewarded for having the most creative project proposal. Awarded by the DesignSpark team, the winner of this sub-challenge will receive a $100 voucher for RS Components/Allie Electronics and a free digital subscription to Circuit Cellar and Elektor magazines! Register your project today! Visit www.chipkitchallenge.com to participate. I ■£ JS £l — — w* -i" '^Isss* & 5 K ? * tonnUNitfl chipKIl J, . .1] n r : w « ir :,t ^ WWTIfc - . *&:. Max 32 ™ n a . ihi . ANALOG IN t &© r % i i f nn i s 1 1 15U * 7 731 * S 3 3 8 v * J! CU LUJlifCJOH for complete rules and details. * Participation in the Community Choice Awards does not increase your chances of winning the Grand Prize with your Final Project(s) submission. The deadline for Final Project submissions is March 27, 2012. See website for more information. IN ASSOCIATION WITH: 0lektor ^ ^ Microchip m CIRCUIT CELLAR i-ir(PF:fr _ MWt5 DIGILENT bETOND fHEiiOK'r chipKIT™ is a registered trademark of Microchip Technology Inc. Max32™ is a registered trademark of Digilent, Inc. f f mikro iYlBUS JUST PLUG IN ONE OF YOUR CLICK BOARD™, AND IT'S READY TO WORK. SPECIALIZED MIKROBUS™ COMMUNICATION INTERFACE MAKES YOUR DEVELOPMENT EASIER, AND ALLOWS SIMPLE, YET HIGHLY EFFECTIVE CONNECTIVITY. EVERYTHING IS NOW JUST A CLICK AWAY! Best selling PIC development board in the world enters it's 7th generation of development. It is state of the art in design, functionality and quality. With 4 connectors for each port EasyPIC v7 has amazing POWERFUL ON-BOARD MIKROPROG PROGRAMMER AND IN-CIRCUIT DEBUGGER CAN PROGRAM ALL PICIO, PIC12, PIC16 AND PIC18 MICROCONTROLLERS. OUTSTANDING PERFORMANCE AND EASY OPERATION WILL BLOW YOUR MIND. YOU WILL NEED IT, WHETHER YOU ARE A PROFESSIONAL OR A BEGINNER. connectivity. Ports are logically grouped with their corresponding LEDs and Buttons. Powerful on-board mikroProg In-Circuit Debugger and programmer supports over 250, both 3.3V and 5V devices. Three types of displays, Serial EEPROM, two temperature sensors, Piezo Buzzer, USB connector, RS-232 and FTDI, Oscilloscope GND pins, as well as mikroBus support make this board an irreplaceable PIC development station. Mikrollektronika get it now DEVELOPMENT TOOLS I COMPILERS I BOOKS WWW.mikrOe.COm DUAL POWGR SUPPLY EASYPIC V7 IS THE ONLY DEVELOPMENT BOARD IN THE WORLD TO SUPPORT BOTH 3.3V AND 5V MICROCONTROLLERS. REVOLUTIONARY ENGINEERING ALLOWED US TO SUPPORT OVER 250 MICROCONTROLLERS IN A SINGLE BOARD. IT'S LIKE HAVING TWO BOARDS INSTEAD OF ONE! What’s for starters? LEDs and micros! Electronics is becoming increasingly complex and difficult to grasp in all its enormity. At least, that’s what we are told occasionally by our readers, usually in personal conversations like phone calls or with a cup of coffee at shows. Over the past 50 years, electronics has evolved, grown, expanded — whatever you want call it — at a terrific speed, resulting in a constant need for training and refresher courses, just to stay up to date. Over the years electronic circuits have grown in size and complexity. If many moons ago you could produce a project with a handful of transistors and gates, today you resort to some special 1C that requires a pile of datasheets to be read before you can even get started. Still, that does not appear the main reason for many electronics fans, especially the older ones, for feeling lost in the prover- bial woods. In reality the biggest stumbling block appears to be the acute combination of hardware and software. Many electron- ics engineers, from the very beginning, have difficulty with programming and prefer to work with components only. For the younger generation, the oppo- site applies: they are totally at ease with programming, but find hardware design a difficult affair to say the least. Not surprisingly, today’s electronic circuits invariably seem to combine software and hardware, forcing you to be well versed in both disciplines! To suit both newcomers and old hands, old and young, subscribers and non-sub- scribers, this month we kick off a course in basic electronics that goes back to the roots. Like: howto dimension simple basic circuits; or how do certain com- ponents work? Furthermore, in each instalment we show a piece of software that allows the subject discussed to be put into practice using a microcontroller rather than discrete parts. Hopefully the LEDs covered this month go down well “for starters”. 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 DesignSpark chipKIT™ Design Chal- lenge A new global electronics design competition brought to you by Circuit Cellar, Elektor ands RS Components. 16 Wideband Lambda Probe Interface Link a lambda probe interface 1C with a microcontroller and you have a stand- alone oxygen level meter for exhaust gases. 24 Audio DSP Course (7) This month we use our knowledge and hardware to build a digital peak level meter with some pretty advanced features. 32 Grid Frequency Monitor The frequency of the AC power grid is usually assumed to be very accurate and stable, but is it? Let’s find out. 36 Scilab Introducing numerical calculation software for engineers into simulation and modelling. 43 E-Labs Inside: Bat— batter— best! The operation of the Elektor Bat Detector can be substantially improved by using directive microphones. 44 E-Labs Inside: Radiation Meter: mounting the sensor Here we elaborate on methods and materials to ensure the best operation of the meter for alpha, beta and gamma radiation. 4 01-2012 elektor Volume 38 January 2012 no. 421 46 E-Labs Inside: Debugging the debugger There’s an issue with the Microchip ICD3 In Circuit Debugger 3 (ICD3). Here’s how we fixed it. 48 Ultra-accurate DSP-based DCF77 Timecode Receiver This project uses DSP algorithms running on a dsPIC33 micro to extract time signals with extreme accuracy. 54 Here comes the Bus! (11) This month we discuss new PC software that simulates up to three freely programmable bus nodes. 60 Electronics for Starters (1) Welcome to our new course! We kick off with LEDs and diodes. 64 Wavelet Analysis Here we examine how Mikroelektronika’s PIC32 development system can be used to 48 Ultra-accurate DSP-based DCF77 Timecode Receiver To extract the highest possible accuracy from the German DCF 77.5 kHz time- code broadcast this project uses DSP algorithms running on a low-cost dsPIC33 microcontroller to filter and demodulate both the AM and phase modulated signals, while also producing a very stable 10 Hz carrier-locked reference clock output. 60 Electronics for Starters (1) In this series we get back to basics, and in electronics the basics are undisput- edly analogue. However, we realise that many beginners are interested in digi- tal technology too, so a microcontroller circuit is also included in the course material. We kick off with LEDs and diodes. analyse wavelet files. 70 Time/Interval Meter with ATtiny Very little is required in terms of hardware to make an accurate time/interval meter. 73 Hexadoku Elektor’s monthly puzzle with an electronics touch. 74 Retronics: Philips ‘Colette’ Portable Radio (1956) Series Editor: Jan Buiting 77 Gerard’s Columns: Product Development From our monthly columnist Gerard Fonte. 84 Coming Attractions Next month in Elektor magazine. CONTENTS 16 Wideband Lambda Probe Interface This design marries a lambda probe interface 1 C with a microcontroller to pro- duce a stand-alone lambda measurement device. Built-in self calibration gives hassle-free setup and ensures measurement accuracy. This flexible unit out- puts the lambda value both as an analogue voltage level and as digital values using a standard serial interface. 32 Grid Frequency Monitor The monitoring device described here detects tiny deviations infrequency with a range of just ±0.2 Hz, allowing you to keep an eye on the load on the AC power grid from any convenient socket. An array of LEDs is used for the readout. elektor 01-2012 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. Grid Frequency Monito Tiny fluctuations evidenced by UEQs I Wavetet Analysis * On a PiC32 development s ys tern DCF77 Timecode Ultra Accurate DSP bawd i Colette, Annette, Bahettei Georgette 1 ' rtrlb^dportotferat/jas/rom the T950s ANALOGUE • DIGITAL _ MICROCONTROLLERS & EMBEDDED AUDIO TEST & MEASUREMENTS hr'K » Volume38, Number 421, January20i2 ISSN 1757-0875 Elektor aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+ 44 ) 208 261 4509, fax: (+ 44 ) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 11 times a year with a double issue for July & August. Elektor is also published in French, Spanish, American English, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Hettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial stafl Harry Baggen, Thijs Beckers, Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Design stafl Christian Vossen (Head), Thijs Beckers, Ton Ciesberts, Luc Lemmens, Raymond Vermeulen, Jan Visser. Editorial secretariat: Hedwig Hennekens (secretariat@elektor.com) Graphic design / DTP: Giel Dols, Mart Schroijen Managing Director / Publisher: Don Akkermans Marketing: Carlo van Nistelrooy Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com/subs 6 01-2012 elektor Elektor eC-reflow-mate Professional SMT reflow oven with unique features r 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 compartment, 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. 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 hotair • 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: 400x285 mm • Temperature sensors: 2 internal and 1 external (included) V. Price: £21 70.00 / € 2495.00 / US$3495.00 (plus VAT and Shipping) Further information and ordering at www.elektor.com/reflow-mate Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form. Head Office: Elektor International Media b.v. P.O.Box ii NL-6114-ZC Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Distribution: Seymour, 2 East Poultry Street, London ECiA, England Telephone:+44 207 429 4073 UK Advertising: Elektor International Media b.v. P.O.Box 11 NL-6114-ZG Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Email: t.vanhoesel@elektor.com Internet: 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 any part of this publication is stored in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guaran- tee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media b.v. 2012 Printed in the Netherlands elektor 01-2012 7 NEWS & NEW PRODUCTS Embedded motor control Cerebot™ MC7 Development Kit for academia and hobbyists Microchip Technology Inc., announced the availability of a Microchip dsPIC33 Digital Signal Controller (DSC)-based development kit. The Digilent® Cerebot™ MC7 Develop- ment Kit addresses the growing interest in embedded motor control from the aca- demic and hobbyist markets, and is ideal for learning about microcontrollers and solving real problems. The kit includes a demon- stration board that provides four half-bridge circuits, eight RC servo motor connectors, the ability to use Digilent Pmod™ peripheral modules, and an integrated programming/ debugging circuit that is compatible with the free MPLAB® IDE. Example applications include university embedded-systems and communications classes, senior capstone « E t. e ■ ■ m ■ m ™ If Mamma* | -rn 'I'Nl't ini » *1!” I«li T» * . I r I4U IMP ' I- 11, 1 ,u £ Digilent' Cerebot' NIC 7 Development Kit IP art # TDGL007) projects, and numerous other academic and hobbyist projects. A video demo of the kit can be viewed on YouTube (link below). The Cerebot MC7 board features four half- bridge circuits that are rated for 24 V at up to 5 A. These half bridges can be used to control two Brushed DC motors, two bi- polar stepper motors, one brushless DC motor, and one uni-polar stepper motor. An onboard 5 V, 4 A switching regulator with an input voltage up to 24 V simpli- fies operation of the board, enabling it to operate from a single power supply in embedded applications such as robotics. The onboard dsPIC33 DSC features 1 28 KB internal Flash program memory and 1 6 KB internal SRAM, as well as numerous on-chip peripherals, including an advanced 8-chan- nel motor-control PWM unit, an enhanced CAN controller, two Serial Peripheral Inter- faces (SPIs), timer/counters, serial-interface controllers, an Analog-to-Digital Converter (ADC), and more. The Cerebot MC7 board combines two push buttons and four LEDs for user I/O, as well as connections for two I2c™ busses, one of which contains an inte- grated serial EEPROM device. Video: http://www.microchip.com/get/8HF8 Buy: http://www.microchip.com/get/DUMT (110698-VIII) Low-power RF Transceiver for cost-sensitive consumer applications Atmel® Corporation’s new AT86RF232 RF transceiver supports the high-volume con- sumer markets in the 2.4GHz ISM (Indus- trial, Scientific and Medical) band. The Atmel AT86RF232 transceiver includes all the necessary features to support the latest wireless applications in the consumer seg- ment including excellent RF performance, lower power consumption, high-link budget and antenna diversity. The new devices also support ZigBee® RF4CE, a specification designed to control a wide range of wire- less consumer products including remote controls for home entertainment devices, human interface devices such as mice and keyboards, and 3D glasses. Applications in the high-volume portable consumer segment, including key fobs, remote controls for toys and game con- soles, require very low-power transceiv- ers to extend the overall battery life of the device. The Atmel AT86RF232 trans- ceiver offers 50 percent lower power than the competition. The Atmel transceiver supports automatic antenna diversity to improve RF performance and link reliabil- ity. Additionally, the transceiver includes onboard AES encryption for secure wireless end-to-end communication. The new Atmel transceiver offers a voltage range of 1 .8 V to 3.6 V, -1 00 dBm in sen- sitivity and an output power of 3dBm for extended battery life in various applica- tions. The device also offers a receiver cur- rent consumption of 1 1 .8 mA, transceiver current consumption of 13.8mA, antenna diversity and AES encryption. All these fea- tures are important to offer a robust wire- less transceiver for high-volume consumer applications. The Atmel AT86RF232 transceiver is avail- able with the REB232ED-EK evaluation kit which includes two AT86RF232 radio evalu- ation boards, combined with an Atmel ATX- mega256A3 microcontroller. These boards come with free downloadable evaluation software on the Atmel website. These eval- uation boards and transceiver are also ideal for designers moving towards ZigBee RF4CE and ZigBee Remote Control profiles. www.atmel.com/AT86RF232 (110698X-IX) RF6555 2.0 V to 3.6 V, 2.4 GHz front end module RFMD’s new RF6555 integrates a complete solu- tion in a single Front End Module (FEM) for ZigBee® and Wi-Fi applica- tions in the 2.4GHz to 2.5GHz band. This FEM integrates the PA plus har- monic filter in the transmit path and an internally inte- grated LNA with bypass mode. The RF6555 provides a single balanced TDD access for Rx and Tx paths along with two ports on the output for connecting a diver- sity solution or a test port. The RF6555 also has current consumption for ZigBee appli- cations enabling extended battery life with only 70mA at rated power. Applications include ZigBee® 802.15.4 Based Systems for remote monitoring and control, AA cell battery operated equip- ment, and Wi-Fi 802.1 1 b/g. www.rfmd.com (120031-I) 8 01-2012 elektor NEWS & NEW PRODUCTS New ezLCD smart touch LCD for 5.6” embedded display applications EarthLCD.com, recently announced their new ezLCD-005 graphic display module. Its all-in-one design unites a color LCD, touch- screen, control electronics, memory and I/O, with an easy to use, command driven programmable firmware environment. Helping engineers minimize development time and reduce hardware costs, while speeding time to market for applications requiring a color touchscreen display, the ezLCD-005 proves to be an effective solu- tion as a graphical user interface (GUI). The ezLCD-005 features: • 5.6 Inch colorTFT LCD with LED Backlight • 320 x 234 resolution, supporting 65,536 colors • 330 Nit brightness • 300 to 1 contrast ratio • Integrated 4 wire resistive touchscreen • Intelligent control Module with 32 Bit ARM microprocessor • 1 Mbyte serial flash memory • SD/MMC card slot for memory expansion up to 4 GB • USB, SPI, and RS232/TTL interfaces • +5.0V supply voltage • 0 to 60°C operating temperature • Command driven programmable firm- ware environment • EarthSEMPL (simple embedded macro programming language) • Works with any microcontroller The ezLCD-005 is claimed to be the OEM’s fastest way to integrate a 5.6 inch color LCD with touchscreen into their new or existing embedded application, allowing engineers to focus on interfacing the ezLCD-005 into their product design instead of sourcing all the individual components necessary to accomplish their goal. Plus, not having to manage the supply chain for all those Pololu: dual VNH5019 motor driver shield for Arduino Pololu announces the release of the dual VNH501 9 motor driver shield for Arduino, an easy way to control up to two high-power DC motors with an Arduino or Arduino-compatible device. The shield’s twin robust VNH501 9 motor drivers operate over a wide 5.5 to 24 V range and can each deliver a continu- ous 1 2 A (30 A peak) to an independently controlled motor, or the driver outputs can be combined to deliver a continuous 24 A (60 A peak) to a single motor. The motor drivers also offer current-sense feedback and accept ultrasonic PWM fre- quencies for quiet operation. This motor driver is intended for a wide range of users, from beginners who just want a plug-and-play motor control solution for their Arduinos (and don’t mind a little solder- ing) to experts who want to directly interface with ST’s motor driver ICs. The Arduino pin mappings can all be customized if the defaults are not convenient, and the VNH501 9 control lines are broken out along the left side of the board for general-purpose use with- out an Arduino. This versatility, along with an option to power the Arduino directly from the shield, sets this board apart from similar competing motor shields. The shield (item #2502) is available for $59.95. For more information, including a detailed user’s guide and an Arduino library for this shield, please visit the url below. www.pololu.com/catalog/product/2502 (120031-II) unique parts saves them time, money and reduces time to market. The ezLCD-005 was developed for industries such as Industrial Control, Instrumentation, Test Equipment, Kiosk, Point of Sale, Medi- cal, Automotive, and others where products might require a color LCD with touchscreen to be utilized as a user interface. Pricing for the ezLCD-005 starts at $330.00 ea. store.earthlcd.com/ezLCD-005 (120031-III) Oscium mixed signal oscilloscope for iPad adds FFT, data logging, and config saving Oscium yet again enhances the iMSO app, unlocking additional value for customers. Since releasing iMSO-1 04 in the Apple App Store, the following have been added: • Ability to save configurations - FAE’s and on-the-go engineers can now save their configurations • Data Logging - record and export history via *.csv for post-processing • FFT - enables a different view of the sig- nal, a view from the frequency domain Today’s release marks another level of con- tinuing upgrades to the iMSO interface. The performance of FFT has been improved by increasing the resolution of the FFT display, providing an even clearer diagnostic pic- ture. The performance of rolling mode has also been improved with better resolution in time scales greater than 40 ms. iMSO version 2.1.0 is available to down- load free in the Apple App Store. The iMSO app is compatible with all generations of iPhone, iPod touch, and iPad devices run- ning iOS version 3.1 .3 or higher. It is made for: iPod touch (1 st, 2nd, 3rd, and 4th gen- eration), iPhone 4S, iPhone 4, iPhone 3GS, iPhone 3G, iPhone, iPad 2, and iPad. iMSO- 1 04 hardware can be purchased for $297.99 from Oscium directly or from one of their partners. www.osdum.com (120031-V) elektor 01-2012 9 NEWS & NEW PRODUCTS Cypress’s PSoC® 3 device powers hot new Guitarjack Model 2 Cypress Semiconductor Corp. (announced that Sonoma Wire Works has selected the PSoC® 3 programmable system-on- chip for its new Guitarjack Model 2. The Guitarjack Model 2 is a digital audio interface accessory product that connects a musical instrument, microphone, or audio hardware with iPod touch, iPhone or iPad. The PSoC 3 device in the Guitarjack seamlessly manages the digital audio interface and handles Apple’s proprietary MFi protocol to communicate with iOS devices. Guitarjack Model 2 is optimally designed to work with Son- oma Wire Works iOS apps including GuitarTone, FourTrack, Stu- dioTrack, and TaylorEQ, as well as Apple’s GarageBand. It streams digital audio out of and into Apple’s latest iOS devices, including iPad 2, iPad, iPhone 4, and iPod touch (2nd, 3rd, and 4th gen- eration). It offers stereo recording and simultaneous voice and instrument recording via Apple’s proprietary connector. Since Guitarjack Model 2 is fully synchronous between iOS and PSoC 3, it maintains high quality audio streaming with no dropped audio packets. It can be powered directly by the iOS device and does not need its own power supply or batteries. More information is available at the Sonoma Wire Works website. The PSoC 3 device manages the interface between Guitarjack Model 2 and any iOS device via Apple’s proprietary dock connec- tor. With Cypress’s patent-pending clock synchronization and recovery scheme, PSoC 3 also delivers the highest quality digi- tal audio with minimal external components while supporting multiple audio sample rates. Details on Cypress’s MFi (Made for iPod, iPhone and iPad) solution offering are available at www. cypress.com/go/MFi. More information about Cypress’s clock syn- chronization and recovery scheme is available at www.cypress. com/?doclD=25374. “It’s an exciting time for the music creation and instruments market,” said Leon Tan, marketing manager for Cypress’s MFi solutions. “With a large installed base of iOS devices in the market today, and growing at an unprecedented rate, Sonoma Wire Works is able to quickly capitalize on that with its unique ability to create high-quality hard- ware and software audio products that the music industry demands. We’re excited that the PSoC 3 technology advan- tages are well suited for this market.” “PSoC 3’s unique, patent-pending technology enables digitally streaming audio between iOS devices and connected accesso- ries,” said Gahan Richardson, vice president of PSoC platform products for Cypress. “This enables Sonoma Wire Works to deliver an exciting, versatile product with great sound for music enthusiasts.” “PSoC 3’s low power; flexible architecture; and high-quality USB audio solution helped Sonoma Wire Works upgrade Guitarjack from its predecessor (Model 1 to Model 2),” said Douglas Wright, Founder and President of Sonoma Wire Works. “Together with GuitarTone, Model 2 provides the complete package for musi- cians to create music here, there and everywhere.” www.sonomawireworks.com/guitarjack www.cypress.com/psoc www.cypress.com/psoctraining (120031-IV) HADES hi-temp hi-rel isolated gate driver for high density power converters CISSOID launched HADES, claiming it’s the first isolated gate driver solution designed to drive high temperature power transis- tors, specifically (but not exclusively) Sili- con carbide (SiC) and Gallium nitride (GaN) fast-switching devices. With HADES®, system engineers can develop power converters that are 5 times smaller and lighter than before, with bet- ter efficiency. They will also get power con- verters able to operate in high temperature ambiance if required. No matter what the ambient temperature is, the lifetime of the system will be an order of magnitude longer than traditional solutions. HADES has been designed to drive seam- lessly Silicon Carbide (SiC) power tran- sistors, which have low switching losses. HADES can switch them at high frequencies, which means smaller and lighter passive and magnetic components. Furthermore, thanks to its ability to sustain high temper- atures, HADES can be located next to the power transistors which reduces parasitic capacitances and inductances, and that further improves the associated losses and delays in the system. HADES is a reference design and an Evalu- ation Board delivered with full documen- tation. It can drive two SiC MOSFET power switches on a DC bus voltage up to 1 200 V. The Reference design is scalable up to ±20 A gate current, while the Evaluation Board features ±4 A. A specific board flavor for normally-On JEFTs will also be available, and other types of switching devices (nor- mally-On/Off JFETs, BJTs and IGBTs) can be supported with minor changes. As an example, HADES operation and perfor- mances were demonstrated in a 3 kW Buck DC-DC converter, driving SiC MOSFETs, at 175°C ambient and switching at 150 kHz, with rise times of less than 25 ns. In these operating conditions, HADES, which has been designed for high dV/dt immunity (50 kV/ps) and 1C junction temperatures up to 225°C, runs with comfortable safety margins. In terms of efficiency, the combination of HADES with the newest SiC switches in advanced power converter topologies will bring efficiencies in excess of 98%, even at 10 01-2012 elektor NEWS & NEW PRODUCTS switching frequencies above 1 00 kHz. HADES™ gate driver is the ideal solution for high-power converters such as motor drives, battery chargers and power distri- bution used in applications like railway, aircrafts, renewable energies and hybrid / electric vehicles. It delivers high power den- sity, simplified cooling and high reliability. The fast-switching ability of HADES™ plus the fact it can operate reliably at the same temperature as the switches (200°C junc- tion and above) makes it a solution of choice for the new generation of Intelligent Power Modules (IPM). www.cissoid.com (120031-VI) New range of high specification AT-cut crystals IQD Frequency Products’ new range of high specification crystals is aimed at specialist applications such as military, radar and pag- ers. Manufactured at its IQD FOQ division in Germany, the crystals are available in a vari- ety of package styles including UM1 , HC49, HC43CW (T08) and HC45CW. Forthe high- est possible ‘Q’ factor, customers should specify the Cold Weld (CW) packages. The ‘Q’ factor is a measurement of the loss of energy within the quartz. This is effected by the quality of the blank, surface finish (lap- ping), mounting technique and sealing. The higher the ‘Q’ factor the better the crystal. The higher the frequency the more impor- tant the ‘Q’ factor is to the design engineer. The maximum attainable shortterm stabil- ity of a crystal also depends on the ‘Q’ value. A wide frequency range is available includ- ing 10 to 42MHz at fundamental mode, 1 0 to 1 25 MHz at 3rd Overtone and 70 to 175 MHz at 5th Overtone. This is pushing the design limits of quartz crystals due to the thinness of the blank that becomes unworkable beyond this. The new range offers exceptionally low aging down to 0.1 ppm per year and tight frequency tolerance @ 25 degrees C down to ±3 ppm. This compares to standard crys- tals where typical figures would be 3 ppm per year aging and ±10 ppm frequency tolerance. Temperature stabilities down to 4 ppm @ 0 to 70 degrees C and 1 2 ppm @ -40 to 85 degrees C can be specified depending upon customers applications. Phase noise is critical in many applica- tions and these high specification crystals offer excellent performance in this respect, including at high frequencies up to 1 00 MHz at 5th overtone. IQD offer an express manufacturing service for these parts as short as 3 days dependent upon the specification required. www.iqdfrequencyproducts.com (120031-VII) ‘Mini8’ Ballast Control 1C International Rectifier’s new IRS2526DS ‘Mini8’ is a compact fluorescent lamp (CFL) ballast control 1C that offers full program- mability and a high degree of accuracy and control for all lamp types. Available in an 8-pin SO-8 package, the new feature-rich 1C reduces component count, simplifies circuit design and increases efficiency in a compact footprint. The IRS2526DS features a 600 V half-bridge control circuit working at 50 percent duty- cycle and variable frequency for driving the resonant mode lamp output circuit. The high accuracy oscillator is controlled by a single analog-to-frequency input pin used to set the different operating frequencies of the ballast. Complete fault protection circuitry is also included for protection against such conditions as mains interrupt or brown-out, lamp non-strike, lamp fila- ment failure and end-of-life. The new device also incorporates an internal frequency dither to reduce conducted EMI, ignition control to reduce inductor size, and end- of-life detection. The IRS2526DS is the third generation ballast 1C from IR and utilizes the proven technology also featured in the previously released IRS2580DS ‘Combo8’ that com- bines a full featured fluorescent ballast with power factor correction (PFC) control- ler in a compact 8-pin package. The new IRS2526DS is targeted at applications that do not require PFC or utilize an external PFC controller. A datasheet and application note are avail- able on the International Rectifier web- site. A reference design, the IRPLMB7E 220VAC/50Hz, 18 W TCL lamp, featuring the IRS2526DS and Ballast Design Assistant (BDA) V5.0 design software are available on request. The new devices are lead free and RoHS compliant. www.irf.com (120031-VIII) DC-DC switching charger ICs for single cell Li-Ion batteries in mobile devices austriamicrosystems has announced two new battery charger ICs for Li-Ion bat- teries in mobile devices. The AS361 0/1 1 step-down DC-DC chargers offer fast and highly efficient charging of Li-Ion batteries in mobile devices with up to 1 .25 A output Advertisement PCBs Muuuuch Cheape f. No-frills policy 16.94 EURO" 5 pcbs, 100 mm k 100 mm *per piece, incl. DAT (21%) + shipping costs e. g. Germang 1 0.71 EURO * JaCCaltac LULuiu.jackaltac.com elektor 01-2012 11 NEWS & NEW PRODUCTS Under £350 USB mixed-signal oscilloscope The PicoScope 2205 MSO gives you a two-channel oscilloscope combined with a 16 channel logic analyzer, all in one com- pact, portable USB instru- ment. Now you can view analog waveforms and digital data on the same screen with the efficient and easy-to-use Pico- Scope software. The analog bandwidth is 25 MHz and the digital channels can accept signals as fast as 1 00 MHz. Maximum sampling rate is 200 MS/s. The PicoScope 2205 MSO is suitable for general-purpose analog and digital circuit design, testing and troubleshooting. As it’s USB-powered, there is no AC adapter to carry: just plug it into your PC or laptop and start the software. The 48k-sample buffer is large enough to store multiple captures in rapid sequence as little as 2 microseconds apart. The PicoScope software, included, delivers a high-resolution, uncluttered display and a range of advanced signal processing features: spectrum analyzer, automatic measure- ments with statistics, channel math, reference waveforms, multiple scope and spec- trum views, l 2 C, UART, SPI and CAN bus serial decoding, XY mode, advanced triggers, mask limit testing, and color persistence display modes. The 1 6 digital inputs can be displayed individually or in arbitrary groups labeled with binary, decimal or hexadecimal values. A separate logic threshold from -5 V to +5 V can be defined for each 8-bit input port. The digital trigger can be activated by any bit pat- tern combined with an optional transition on any input. Finally, analog and digital trig- gers can be combined using Boolean logic to enable complex mixed-signal triggering. The Software Development Kit (SDK), also included, allows you to control the new scopes using your own software. The SDK and PicoScope are compatible with Microsoft Win- dows XP, Vista and Windows 7. Example programs in C, Excel and LabVieware included. The new PicoScope 2205 MSO is available now, priced at only £349 for the oscilloscope alone or £399 as a kit with two passive xl /x 1 0 probes, a logic cable and test hooks. A generous 5-year warranty is included. http://www.picotech.com/mixed-signal-oscilloscope.html (120031-XII) current. The ICs include numerous safety and protection features, internal current measurement, and USB Host/OTG (on the go) boost mode operation. The AS3610 DC-DC charger provides an l 2 C interface for external control and the AS361 1 operates independently. The performance and features of the AS361 0/1 1 make the charger ICs very well suited for applications that are powered by AS3610 1 .25A DC-DC Charger 1C Safe & Cool Charging austrfBfnfcrasysi&ms OTG Bnnst *K -m 22V 0VP one Li-Ion battery. Such applications include high-end blood glucose meters, remote controls, GPS outdoor navigation or track- ing equipment, mobile phones, e-dictionar- ies and e-book readers. The AS361 0/1 1 switching charger ICs were designed with inputs from the handset and portable markets to use a high efficiency switch mode charger with minimum ripple. Implementation is simplified with most options and features controlled by pin strapping or OTP. These features include current limit set, charging current, OTG boost, and more. The AS361 0 step-down charger also supports 900mA input current limitation for USB 3.0. Other features austriamicrosystems’ AS361 0/1 1 switching chargers include: 22 V over-voltage protection; reverse polarity protection; chip and battery temperature supervision, and charger time-out supervi- sion. The AS361 0/1 1 is available in a small 3x3 mm MLPD14 package, and operates from a supply of 2.7 V to 5.5 V over a tem- perature range of -40 9 C to 85 9 C. A WL-CSP package option is available for PCB space- critical applications. The AS361 0/1 1 switch mode chargers are available now and are priced at $1.20 in 1 000-piece quantities. A demo board is also available to reduce development time. www.austriamicrosystems.com (120031-X) Low-Speed CAN and LIN interfaces for Nl CompactDAQ National Instruments has introduced the C Series Nl 9861 CAN interface and Nl 9866 LIN interface, the newest modules in the NI-XNET family of products and the first low-speed CAN and LIN modules that integrate with the entire Nl CompactDAQ platform. As part of the NI-XNET family, the new modules provide engineers with productivity advantages such as hard- ware-accelerated messaging and onboard processing. The single-port, low-speed C Series Nl 9861 CAN interface module fea- tures integrated CAN database support for importing, editing and using signals from FIBEX, .DBC and .NCD files. It is capable of 1 00% bus load communication up to 1 25 kbit/s without dropping any frames. The Nl 9866 LIN module is also a single-port inter- face with integrated support for import- ing and using signals from LDF databases along with master/slave support and hard- ware-timed scheduling for master tasks. It is capable of 100% bus load communica- tion up to 20 kbit/s without dropping any frames. Engineers can use the new CAN and LIN modules with the same Nl LabVIEW or ANSI C/C++ software code on a variety of plat- forms including Nl CompactDAQ, Compac- tRIO, PXI and PCI. Project reuse saves time as the same applications can be used, for example, in labs with PCI; in manufactur- ing end-of-line tests with PXI; in portable in-vehicle communication settings with Nl CompactDAQ; and in headless in-vehicle logging with CompactRIO. With native support in Nl VeriStand real- time test development software, the new modules are ideal for real-time automotive testing applications, including hardware- in-the-loop simulation and test cell appli- 12 01-2012 elektor NEWS & NEW PRODUCTS cations. Both modules support synchro- nization and triggering with other Com- pactRIO and Nl CompactDAQ modules. Nl CompactDAQ offers a platform for porta- ble in-vehicle network communication, in- vehicle logging and basic automotive elec- tronics communication in a USB, Wi-Fi or Ethernet form factor. The NI-XNET family provides a common programming interface for multiple auto- motive networks such as CAN, LIN and FlexRay. With NI-XNET interfaces, engin- eers can develop applications for prototyp- ing, simulating and testing these networks faster and more easily in LabVIEW and Lab- VIEW Real-Time software as well as ANSI C/C++. The interfaces combine the perfor- mance and flexibility of low-level micro- controller interfaces with the speed and power of Windows and LabVIEW Real-Time OS development. Engineers can easily inte- grate them with desktop real-time PCs and real-time PXI systems. www.ni.com/can www.ni.com/lin (120031-XVI) First ARM-Cortex™ microcontrollers with on- board 10/100 Ethernet, CAN2.oBand USB Toshiba Electronics Europe’s next series of high-performance, low-power 32-bit ARM Cortex™-M3 microcontrollers reportedly are the first to combine Ethernet, CAN and USB Host and Device connectivity in a single 1C. Potential applications for the highly integrated TMPM369Fxxx family include industrial control systems, bar- code readers, motion control, home appli- ances and solar inverters. Based around an ARM Cortex-M3 core run- ning at 80 MHz, the four microcontrollers in the TMPM369Fxxx series integrate sin- gle-channel CAN2.0B, a full-speed USB Host controller, a full-speed USB device controller and a 1 0/1 OOBASE single-channel Ethernet MAC. Two independent analogue-to-digital converters (ADCs) with conversion times of 1 ps - or 0.5 ps in interleaved mode — meet the requirements of barcode readers and other applications requiring ultra-fast con- version. In addition, each of the devices fea- tures a special Multi-Purpose Timer (MPT). This MPT combines three-phase PWM con- trol with an ADC trigger making the new devices ideal for motor control applications. The TMPM369Fxxx series offers on-board ROM options of either 512 Kbyte or 256 Kbyte using Toshiba’s NANO FLASH technology, which runs at 80 MHz without wait states and allows for very high-speed programming. Integrated RAM of up to 128Kbyte provides significant on-board capacity for key IP, while an industry-lead- ing 32-channel DMA controller increases the overall system performance dramatically. All of the new microcontrollers feature two 1 0-bit digital-to-analogue converter (DAC) channels and a 2-channel encoder signal input for motor control. Also on-board are a Real Time Clock and an Oscillation Frequency Detector (OFD). The latter pro- vides hardware monitoring of the CPU clock in accordance with the IEC60730 (Class B) safety standard for home appliances. Power on Reset (PoR) functionality is provided as standard. Featuring on-chip regulators, TMPM- 369Fxxx microcontrollers are designed for operation from a single 2.7 V to 3.6 V power supply — or 3.0 V to 3.6 V when USB is in operation. Clock gearing functionality and ‘IDLE’, ‘STOP1’ and ‘STOP2’ standby modes help to keep power consumption to a minimum. As well as the CAN, USB and Ethernet func- tionality the new microcontrollers also have a variety of other interfaces to further speed embedded system design and reduce appli- cation component count. These include a 3-channel synchronous serial interface (SSP), 6-channel UART/general-purpose serial I/O (SIO) and three l 2 C channels. The availability of various Starter Kits and Soft- ware packages supports a fast prototyping. Toshiba’s TMPM369Fxxx microcontrollers are available in LQFP-144 and FBGA-176 package options. www.toshiba-components.com (120031-IX) ‘Electric Sheep’ Android app development kit SparkFun Electronics’ new product, aptly named the Electric Sheep, is designed to take advantage of the Android system’s open accessory protocol. By communicating via USB, Electric Sheep gives users complete dynamic access to the phone’s systems and enables the easy creation of custom applications and accessories such as controls for an autonomous vehicle or coupling your phone with a microcontroller such as an Arduino. These boards are not restricted to only Android phones, but can be used on any platform with the Android operating system and a USB port. “The Electric Sheep is a product we are really excited to announce,” said SparkFun Director of Marketing AnnDrea Boe. “This product represents months of prototyping and design by the SparkFun engineers and will give its users free reign to create acces- sories for the Android system.” On the technical side, the Electric Sheep is based on the ATMega2560 microcontroller and bootloader and features a USB-host connector on-board for quick connection to Android devices. The board allows forthe creation of accessories for Android using the Arduino IDEA and HandBag and is Arduino-shield compatible. Even if you don’t have an Android device, the Electric Sheep can double as a devel- opment platform with all the functionality of the host micro- controller and a USB shield. The Electric Sheep is priced at $79.95 and is now available on SparkFun’s website. www.sparkfun.com (120031-XIII) elektor 01-2012 13 INFO & MARKET DesignSpark chipKIT™ Design Challenge DesignSpark chipKIT™ Challenge Apply the chipKIT™ Max32™ development kit and the award-winning DesignSpark PCB software tool to create environmentally friendly applications By Ian Bromley (UK) Towards the end of 201 1 , the world’s population passed the seven billion mark and UN estimates are that it could be closer to nine billion within a few decades. Add to that the increasing energy demands to meet growth required by major emerging economies, and there is no doubt that meeting the world’s energy needs while also looking after our environment is one of the great challenges of our time. In the drive to achieve greater energy sustainability, clearly the development of innovative new solutions are required, and I believe embedded electronics can make a contribution to meet this global challenge. It isn’t just about developing ultra low power electronic devices — in fact, arguably more important is increasing the energy efficiency of electronic systems. Maximizing power output and delivering the required performance while reducing the environmental and energy footprint is becoming a highly significant ratio. For example, in the embedded world, a 32-bit microcontroller is most likely to consume more power than an 8-bit device, but it also has the ability to perform very fast calculations and process algorithms that can significantly increase energy efficiency in motor-control applications. So, when we were approached last year by Elektor and Circuit Cellar to participate in a worldwide design competition, the choice was an easy one: it had to be about energy efficiency. Officially launched in late November at Elektor Live! and offering total cash prizes of $10,000, including a first prize of $5,000, the DesignSpark chipKIT™ challenge is all about encouraging engineers, students and hobbyists to think about the use of power and develop solutions that will increase energy efficiency while also maintaining an eco-friendly footprint. The prize-winning application can be anything that reduces the energy footprint of a system. For example, it could be an energy-efficient battery charger, a controller for a windmill, or perhaps an energy-usage management device for use in the home. Competition entrants are now developing energy-efficient and environmentally friendly applications based on the chipKIT™ Max32™development platform from Digilent, which feature Microchip’s 32-bit PIC32 microcontroller. The first 1 ,000 registered entrants have already received a complimentary chipKIT™ Max32™ development board. The chipKIT™ Max32™ development platform is a 32-bit Arduino- compatible solution that enables engineers, students and enthusiasts to easily and inexpensively integrate electronics into their projects. The chipKIT™ hardware is compatible with existing Arduino shields and applications, and can be developed using a modified version of the Arduino IDE and existing Arduino resources, such as code examples, libraries, references and tutorials. The chipKIT™ Basic I/O Shield is compatible with the chipKIT™ Max32™ board, and offers users simple pushbuttons, switches, LEDs, l 2 C EEPROM, l 2 C temperature sensor, and a 1 28 x 32 pixel organic-LED graphic display. All entries must include an extension card developed using RS’ free- of-charge DesignSpark PCB software tool with code compiled using Digilent’s MPIDE software. The DesignSpark PCB software tool is unique in the industry, and since its launch in July 201 0, more than 1 00,000 users have downloaded DesignSpark PCB, RS’ professional- standard PCB design software, which has proven to be one of the most popular free PCB design software packages available. Thousands of users have contributed suggestions for its continued development via the DesignSpark community, which is available at www.designspark.com. During the competition, which finishes at the end of March 2012, entrants are being strongly encouraged to engage and interact with other members of the online DesignSpark community by posting information on their projects, providing updates on progress, and sharing comments and ideas on their respective designs. Participants will automatically qualify for entry into bonus Community Choice Awards, in addition to admission into spot prize draws for the best collaboration to win vouchers exchangeable for products ordered from RS Components/Allied Electronics. The competition entries will be judged on the level of energy efficiency and the quality of the extension card’s PCB design. Entries are due on March 28, 2012 and the winners will be announced in April 201 2. (120020) Further details and registra- tion for the DesignSpark chip- KIT™ challenge are available at: chipkitchallenge.com. Ian Bromley is a Technical Marketing Engineer at RS Components and the Project Manager for the DesignSpark PCB software tool. Prior to working for RS, Ian worked for many years as a design support consultant with Texas Instruments, in addition to working as a field applications engineer immediately following his graduation in 1 994 with an honours degree in microelectronic engineering. M 01-2012 elektor QUASAR 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 01279 All prices INCLUDE 20.0% VAT. Postage & Packing Options (Up to IKg gross weight): UK Standard 3-7 Day Delivery - £4.95; UK Mainland Next Day Delivery - £1 1 .95; Europe (EU) - £1 0.95; Rest of World - £1 2.95 (up to 0.5Kg). lOrder online for reduced price UK Postage! Payment: We accept all major credit/debit cards. Make cheques/PO’s payable to Quasar Electronics. Please visit our online shop now for full details of over 500 kits, projects, modules and publications. Discounts for bulk quantities. Credit Card 467799 electronics ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ We have some fantastic gift ideas for yofiffig (and old) enq t's way |ut 30 in ONE -£19.95 Order Code EPL030KT 130 in ONE -£59.95 Order Code EPL130KT 300 in ONE -£79.95 Order Code EPL300KT 500 in ONE -£179.95 Order Code EPL500KT Robot Sensor - £21 .95 Order Code EPLR20KT Digital Recording Laboratory - £34.95 Order Code EPLDRKT AM/FM Radio Kit -£11.95 Order Code ERKAFKT Shortwave Kit -£11.95 Order Code ERKSWKT Crystal Radio Kit - £8.95 Order Code ERKCKT Electronic Bell -£8.95 Order Code EAKEBKT Electronic Motor - £8.95 Order Code EAKEMKT Generator - £8.95 Order Code EAKEGKT Room Alarm - £4.95 Order Code EAKRAKT Hand Held Metal Detector - £9.95 Order Code ELMDX7 Metal Detector - £9.95 Order Code ELMDKT Robotic Arm - £49.95 Order Code C9895 Tyrannomech -£14.95 Order Code C21-601KT Running Microbug - £12.95 Order Code MK127KT Trainmech — £14.95 Order Code C21-606KT Crawling Bug with Case - £21.95 -Order Code MK1 65 Riding Santa - £17.95 Order Code MK116KT 60 LED Multi-Effect LED Star - £17.95 Order Code MK170KT Musical LED Jingle Bells -£21.95 Order Code 1176KT Flashing LED Christ- mas Tree - £7.95 Order Code MK100KT See our website for special offers and even more great gift ideas! Secure Online Ordering Facilities • Full Product Listing, Descriptions & Photos • Kit Documentation & Software Downloads TEST AND MEASUREMENT Wideband Lambda Probe Interface Test exhaust oxygen levels By Sebastian Knodler (Germany) The price of fuel only ever seems to go in one direction so it is important not to waste it. The use of a wideband lambda sensor to analyse the combustion gases from a vehicle engine or heating boiler will indicate how efficiently fuel is burnt. The interface to such a sensor can however be quite complex. This design marries a lambda probe interface 1C with a microcontroller to produce a stand-alone lambda measurement device. Built-in self calibration gives hassle-free setup and ensures measurement accuracy. This flexible unit outputs the lambda value both as an analogue voltage level and as digital values using a standard serial interface. Measuring the amount of oxygen in exhaust gases gives an indication of how complete the combustion process proceeded. From the oxygen content the so-called lambda value can be calculated. Lambda is a ratio of the actual induced air mass divided by the theoretical air requirement. A lambda read- ing of 1 .0 therefore indicates optimal com- bustion conditions where the air content (oxygen in the volume of air) of the fuel / air mixture matches the requirements. A reading of X > 1 indicates a ‘lean’ burn (i.e. too much air in the mixture) while a lambda reading of less than 1.0 indicates a ‘rich’ burn (too little air in the mixture). A lean mixture condition has more oxygen available than is required by the combustion process giving rise to molecular oxygen in the exhaust gas. This combustion condition is of primary interest for operators of diesel motors and heating boilers (e.g. wood pel- let or oil-fired) which do not operate cor- rectly when the mixture is too rich. A rich mixture has too little air to allow all the fuel to be burnt so the excess unburnt fuel remains in the exhaust gas where it can be detected. Elektor Products & Services • PCB: #110363-1 • Programmed controller: #110363-41 • PCB artwork, PDF, free download: 110363-1.zip • Project software, free download: 110363-11.zip All products accessible via www.elektor.com/ 1 1 0363 16 01-2012 elektor TEST AND MEASUREMENT Features • Interface for wideband lambda probe. • Output of lambda value and operational • Suitable for wide range of Lambda status. values. • Analogue output 0 to 4 V. • Fault evaluation via diagnostics register. • Automatic calibration. • Digital output with RS232 interface. pump cell / _ ] 1 1 0 2 o 2 -| jo 2 - (*> 1 o 2 f Oo 1 ° 2 r™J ($> ! T‘ measurement cell j u 2 110363 - 12 heater Figure 1 . The wideband lambda probe uses two ceramic chambers; one is the pump cell and the other the monitor cell. Petrol engines operate most efficiently when they run on a slightly lean mixture (k = 1 . 1 to 1 .25), whilst for maximum power a slightly rich mixture (k = 0.9 to 0.95) is required. A rich mixture also provides some degree of ‘inner cooling’ to the engine parts (unburnt fuel cools the combustion cham- ber, valves and other internal components). The earlier narrow-band or two-state sen- sors are only able to indicate a lambda value in the region of k = 1 , they effectively oper- ate as a switch, indicating if the lambda value is either greater than or less than 1. By contrast the more recent wide-band lambda sensors give a continuous reading of values in the range of 0.65 to oo (= fresh air). Their increasing use by automobile manufactur- ers has resulted in price falls over the last few years so that they could now be con- sidered for use in such applications as heat- ing boiler exhaust monitoring and general measurement of combustion products. First principles The wide-band lambda sensor uses the same type of Nernst cell as the simpler two-state sensor. The Nernst cell consists of a sensing cell made of Zirconium diox- ide (Zr0 2 ) ceramic material with two elec- trodes. At temperatures above approx- imately 300 °C the ceramic material becomes conductive to negatively charged oxygen ions but not for electrons, atoms or ions of any other gas. A galvanic poten- tial is generated between two electrodes when there is a difference in the oxygen concentration in the gases on either side of the ceramic cell. This is the case when there is fresh air (oxygen rich) on one side of the cell and exhaust gases (oxygen poor) on the other. The voltage produced is dependant on the difference in the oxy- gen partial pressure of the two gasses. The wideband lambda probe is an expansion of this basic principle with the addition a sec- ond chamber called a ‘pump cell’ together with the monitoring or ‘measurement cell’ (Figure 1 ). A diffusion gap exists between the pump cell and monitoring cell and the pump cell is positioned between the flow of exhaust gasses and the diffusion gap. The diffusion gap links the pump cell to the exhaust gases (shown in light green in Fig- ure 1 ). The monitoring cell has the diffusion gap on one side and oxygen reference gas (fresh air) on the other side. The monitoring cell (Nernst cell) of a sim- ple narrow-band probe has the electrical characteristics shown in Figure 2. It simply detects the lambda value around k = 1 when the curve passes through 450 mV. The trick with the wide-band probe is that current through the pump cell is regulated so that the lambda value of the gas in the monitor- ing cell is maintained at k = 1 . The pump cell is composed of the same material as the monitoring cell (zirconium dioxide ceramic stabilised with Yttrium oxide) and acts as a membrane through which its permeability to oxygen ions is con- Figure 2 . The Nernst cell in a wideband probe has the same characteristics as a narrow band probe. trolled by the application of a current (the ‘pump current’). The monitoring chamber has a passage to the exhaust gases via the pump cell. The pump cell’s job is to main- tain the fuel/air mix in the monitoring chamber constant with a lambda value of 1 (450 mV at the monitoring cell). The pump cell reacts to a lean gas mix by discharging oxygen from the diffusion gap to the out- side and conversely responds to a rich gas mix by changing the pump current to pump oxygen from the exhaust gas into the dif- fusion gap. The value of current through the pump cell required to keep the lambda value equal to 1 is an indication of lambda value of the gas since it changes almost line- arly with the exhaust gas lambda value (see Figure 3). Figure 3 . Current flowthrough the pump cell in the wideband probe is proportional to the lambda value of the gas. elektor 01-2012 17 TEST AND MEASUREMENT TXD RXD GND Figure 4. The circuit consists of the CJ1 25 lambda probe interface chip and a microcontroller which allows operation in stand-alone mode orvia an RS232 data link. Operation Pump cell current is governed not only by the oxygen content of the exhaust gas but also temperature of the probe ceramic material. It begins to conduct oxygen ions at about 300 °C but has a more usable lower resistance when it is operating at around 750 °C. The probe has a built-in heater to help reduce the effects of temperature varia- tions on measurements. The temperature dependant internal resistance of the moni- toring cell (Nernst cell) is used as a sensor to regulate the energy to the built-in heater. Different types of probe have different val- ues of resistance at the operating tempera- ture. A wide-band Bosch type LSU4.2 has a resistance of 82.5 Q at the desired temper- ature while the more recent LSU4.9 has a resistance of 300 Q. When the probe resist- ance is lowerthan this value it indicates that the probe is running too hot so the heater current is reduced. Starting with a cold sen- sor (immediately after a cold start for exam- 18 01-2012 elektor TEST AND MEASUREMENT pie) it is necessary to gently ramp-up the heat to the ceramic element. The wideband lambda sensor interface requires a minimum of two regulation cir- cuits; one controls the pump current and the other controls current to the heating element. When Bosch introduced the CJ1 1 0 it was the first lambda probe interface 1C, the CJ1 25 that we use here is a more recent incarnation. Its successor, the CJ135 has been announced but at the time of writing is not widely available. The CJ125 provides all the most important functions necessary to interface to a wide- band lambda probe of the LSU4.X series: • Pump current regulation • An output signal proportional to pump current. • Selectable amplification of the pump current signal (8 or 17). • Measurement of Nernst cell internal resistance ( R j) for temperature control. • Control signal O/P for probe tempera- ture regulation. • Comprehensive fault diagnostics. • Calibration functions for internal resist- ance and pump current. • Reference current function for the LSU4.9 probe. The measured values of pump current and probe internal resistance are output as ana- logue values. Settings such as the calibra- tion functions, amplification setting, fault and diagnostic registers are written and read via the SPI interface. A somewhat simplified block diagram of the C J 1 2 5 ’ s complex internal structure is included in the data [1]. The circuit The circuit shown in Figure 4 consists of a CJ125 lambda probe interface chip and a microcontroller which allows the design to operate in stand alone mode or via an RS232 serial data link to an external PC. The addition of an RS232/USB adapter would allow connection to a PC’s USB port. The use of the CJ125 here is based upon the application suggestion outlined in the Bosch data sheet for this device (Figure 5). A simple block diagram of the wide-band 110363 - 15 Figure 5. The data sheet application suggestion for the CJ125 includes a block diagram of the wide-band probe. probe (LSU4. 2/4.9) is also shown. An over- view of the CJ1 25 interface signals are given below (Components are shown in the circuit diagram Figure 4): • U b (pin 1 ): filtered U batt (vehicle battery supply 12 to 15 V). • V cc , V C cs (pin 1 7): regulated 5 V supply. • GND, GNDS (pin 24): circuit ground. • l A (pin 4): output of the pump current regulator. Pump current flows from IA through the shunt resistor R8 and the pump cell in the lambda probe and back to the VM pin (18). • l P (pin 3): inverted input of the pump current amplifier which gives the volt- age drop across the shunt resistor R8. • V M (pin 1 8) is the virtual ground point for the pump current regulator and the X probe. The virtual ground point is at half the operating voltage i.e. 2.5 V. • U s (pin 1 9): Nernst cell reference volt- age (450 mV), also via R7 to the current regulator input UN. • Up (pin 20): non-inverted input to the pump current regulator. • U N (pin 2): The inverted input to the pump current regulator and also an input/output for measurement of the Nernst cell’s internal resistance (Rj). • R s : calibration input/output for Rj (Nernst cell). • RM/CM (pin 1 0/1 1 ): values of R3 and Cl 0 define the Rj measurement current (AC current). • CF/RF (pin 22/23): R14 and C13 form a low pass filter for the analogue Lambda signal (between the pump current amplifier and the Lambda signal output buffer). • U A (pin 21): analogue lambda output (voltage proportional to the lambda value). • U R (pin 1 2): analogue Rj output (voltage proportional to the Nernst cell Rj). • DIAHG and DIAHD (pins 6/7): Diagnos- tic input for probe heater supervision (connects to the gate and drain respec- tively of the external power FET Q2 which switches current to the heating element). • SCK/SO/SI/SS (pins 13/14/1 5/16): SPI interface to jiC. • / RST (pin 8): power-up reset using R1 2/ C14. • OSC (pin 5): external 1 0 k£l resis- tor to ground for the internal 192 kHz oscillator. The pump current control is performed wholly by the CJ1 25 but the probe heater requires an external temperature regulator device and driver. To perform this function in the design we have used an ATmega8 microcontroller ( I C 1 ) together with a power FET. In operation the CJ125 outputs an analogue level representing the Nernst cell temperature at U R (pin 1 2) but during power-up calibration it outputs the desired value of optimum probe temperature from elektor 01-2012 19 TEST AND MEASUREMENT COMPONENTLIST Resistors R8 = 62Q (SMD1 206) RIO* = 82.5£2 (SMD1206) R2 = 100^ (SMD0603) R1 8,R1 9 = 470£2 (SMD0603) R9,R1 5,R1 6,R20 = 1 kQ (SMD0603) R21 ,R7 = 4.7l<£2 (SMD0603) R17 = 6.8kn (SMD0603) R1,R3*,R6,R11,R12,R13,R24 = 10kfl (SMD0603) R22.R23 = 39ka (SMD0603) R5.R14 = 100k£2 (SMD0603) R4 = 470kn(SMD0603) * For LSU4.9: R3 =31. 6ly thn- European Reg onn De-dX'ineii Fund unck?! v. Cpe-M - . oua Pruyw ne nm.iliv* re,? :i\ 9 innovative If ECONOMY >•* i ■ PARP^i I ll-MI'l ElWKM<«S0wiL DEHLDftWI f Iff! Siliconltay Online Electronics Store Add to carl Acfd to cart Adc to Adc to can Simplify your electronics projects by visiting http://www.siliconray.com ******** Free Phone UK: 0800 389 8560 sales@pcb-pool.com m Hftfc ***** te Gr-cipJ-ilCndc PHffTFI 5 N..MI.M.I ih’, ni'.jMiwri RS- 274 -X www.beta-layout.com Eaav-PCg fa tal* ! 3 elektor 01-2012 23 registered brands remain the registered trademarks of the respective manufacturer ! DSP COURSE Audio DSP Course (7) Digital peak level meter In professional recording situations a peak level meter is an indispensable weapon in one’s arsenal of equipment. It can be used to ensure that sound levels are within the dynamic range of electro-acoustic components and thus help in minimising distortion. It can assist in keeping noise to a minimum while avoiding clipping. This article describes a digital peak level meter built using the DSP board that accompanies this course along with a separate LED display. By Alexander Potchinkov (Germany) When recording music it is important to keep levels in the signal chain as high as pos- sible to minimise the effect of the noise and interference that will inevitably be encoun- tered; on the other hand it is essential to avoid clipping at all costs, as this can lead to unacceptable distortion. Although a little distortion might go unnoticed in a loud rock music passage, it can rapidly become excru- ciating when it occurs on an (unprocessed) human voice or on a woodwind instrument such as an oboe. To achieve the best com- promise between these two antagonistic goals we need a peak level meter to deter- mine the minimum acceptable level above the noise while simultaneously not exceed- ing the clipping threshold. An audio level meter will typically display not only the peak signal level encountered, but also the RMS (root mean square) level. Formerly mechanical moving-pointer instruments (with inherent inertia) were used to display audio level, with mirror galvanometers used in professional appli- cations. Nowadays inertia-free indicators such as LED bar graphs or plasma, fluores- cent or liquid crystal displays are used. How- ever, inertia was a valuable feature of the older instruments, and so in more modern devices it is simulated using (perhaps digi- tal) signal processing. Our design in its basic form has a dual LED bar graph comprising two rows of forty LEDs each. The LEDs are inexpensive and easy to obtain and it is a simple matter to extend the display by add- ing more: the design allows for extension to eighty or even 1 20 LEDs per row. Although this might seem excessive, it is worth not- ing that in professional equipment the bar graphs often have at least 100 elements each. The display is constructed on a sepa- rate board. Peak level meters are defined by the type of rectification used, their display resolution and their so-called ‘ballistic’ properties. In the United States the term ‘VU meter’ is common, whereas in Europe ‘peak pro- gramme meter’ is preferred. Displays vary in the range of levels that can be displayed (the ‘modulation range’ for normal audio and the ‘headroom’ to accommodate overdriven audio). The ballistic properties describe how the meter imitates the iner- tia of its mechanical ancestor, and include the ‘attack time’ or ‘integration time’, and the ‘fallback time’, ‘release time’ or ‘decay time’. The ballistic properties can bethought of as being characteristics of the rectifier stage in the meter. In an analogue peak level meter this stage is followed by a level converter and a display, and our design is just the same. The desirable ballistic properties are dif- ferent in analogue recording and digital recording applications, as in digital record- ing it is even more important to avoid clip- ping than in analogue recording. It is there- fore desirable to provide a simple parame- terisation of the signal processing code. We will now go on to describe the signal processing stages and the DSP program that implements them, and after that we will describe the circuit of the display unit. Signal processing The digital signal processing steps involved in the operation of the peak level meter can be divided into the four blocks shown in Figure 1. 1 . Peak value rectifier with time constants (‘ballistic rectifier’) 2. Level calculation 3. Level quantisation and scaling 4. LED driver 24 01-2012 elektor DSP COURSE ll A ‘peak value recti- fier with time con- stants’ is a combi- nation of an ordi- nary rectifier with a hold circuit and adjustable attack and decay time characteristics. Since our digital implementation of this unit is intended to be a direct replacement for the corresponding analogue circuit, it makes sense to look first at how the func- tion is achieved in analogue electronics: see Figure 2. The circuit has two operat- ing modes: attack mode, when U in >U 0Ut , in which capacitor C is charged with time constant = CR 1 R 2 /(Ri + R 2 ), and decay mode, when U E LLI _l / |LU lo CLK 1 loos 7 SDI SDO LE LE OE OE CLK CLK +3V3 O CLK LE RX4 23 © OUTO SDI OUT1 SDO 0UT2 OUT3 CLK IC4 OUT4 LE(EDI) 0UT5 0E(ED2) OUT6 OUT7 OUT8 TLC5926 OUT9 OUTIO 0UT11 0UT12 OUT13 R-EXT OUT14 OUT15 T 5 L8 6 L9 7 L10 8 L11 9 L12 10 L13 11 L14 12 L15 13 R8 14 R9 15 R10 16 R11 17 R12 18 R13 19 R14 20 R15 SDI +3V3 O K13 CLK LE OE RX5 23 L39 1 © OUTO SDI OUT1 SDO 0UT2 OUT3 CLK IC5 0UT4 LE(EDI) 0UT5 0E(ED2) out6 OUT7 TLC5926 .... OUTS 0UT9 OUTIO OUT11 OUT12 0UT13 R-EXT OUT14 OUT15 I 5 L0 6 LI 7 L2 % / ~S / 8 L3 9 L4 10 L5 “\ z' 11 L6 12 L7 13 R0 14 R1 15 R2 16 R3 17 R4 18 R5 19 R6 20 R7 6 0 0 0 OOOO C13 470u 25V X K1 C6 1 0On JP2 IC6 LM317 0 ♦ ADJ C7 lOOOu 25 V +3VL Q C8 T 47u 25V C9 lOu 63V +3VL +3VR Q K6 Q IC7 LM317 0 ♦ ADJ CIO lOOn +3VR O RIO C11 T Jk 47u 25V C12 lOu 63 V L38 3 L37 5 L36 7 L35 9 L34 11 L33 13 L32 15 L31 17 L30 19 O O <5 O -O O O O -O O O O <5 O O O -O O -O O 2 R39 K12 L29 1 L28 3 L27 5 L26 7 L25 9 L24 11 L23 13 L22 15 L21 17 L20 19 <5 O -O O -O O O O -O O -O O -O O -o o ■o o <5 O K11 LI 9 1 v LI 8 3 s LI 7 5 . LI 6 7 v LI 5 9 v L14 11 , LI 3 13 N L12 15 v L11 17 . L10 19 sL9 sL8 3 sL7 5 s L6 7 sL5 9 sL4 11 sL3 13 sL2 15 sLI 17 19 K10 4 R38 6 R37' 8 R36 ' 10 R35 ' 12 R34' 14 R33 ' 16 R32 ' 18 R31 ' 20 R30 ' s R29 4 R28 ' 6 R27 ' 8 R26' 10 R25 ' 12 R24' 14 R23 ' 16 R22' 18 R21 ' 20 R20 ' S R19, 4 R1S, 6 R17 / 8 R16 z 10 R15z 12 R14 z 14 R13 z 16 R12z 18 Ril z 20 RIOz R9 z 4 R8 z 6 R7, 8 R6 z 10 R5 z 12 R4z 14 R3 z 16 R2z 18 R1 z 20 RO 110002 - 11 +3VL' O K14 +3VR' O K15 K16 Figure 8. Circuit diagram of driver and display. elektor 01-2012 29 DSP COURSE removed the display remains dark. Trim- mer PI is used to adjust the brightness of the display. It is important to bear in mind that if each LED draws a current of 1 0 mA then the total current for the board will be up to 800 mA if all LEDs are lit. In this case the voltage regulator will need to be fitted with a small heatsink. The display proper has its own board, designed to accept the 1 0- or 20-LED bar graph arrays that are available in a range of colours from several different manufactur- ers. We recommend using high-efficiency red LEDs as these can be operated at lower currents. The display board is mounted per- pendicularto the driver board: this requires a certain amount of dexterity with the large number of connectors. The simplest approach is to lay the display board hori- zontally on the bench and carefully push the driver board vertically down onto it. The DSP is capable of driving its SPI port at over 10 Mbit/s, and the LED driver 1C can accept data at up to 30 MHz. This means that whether we have one, two or sev- eral display modules in a cascade, the dis- play can still be updated far faster than the human eye can see. We have also created a test program for the display module, called tst led . asm. It includes two of the components of the peak level meter program: the decoder rou- tine and the data transfer routine. The test causes 23 of the LEDs in one row to light and 27 in the other. The file tst led . asm is the only one required for this program. ( 110391 ) Display board The two-part printed circuit board for the display module is available with the SMDs al- ready fitted. The order code is 1 1 0002-71 (de- tails at www.elektor.com/ 1 10391). Calculating the number of active LEDs from scaled level values The decibel level P x corresponding to a sample value x, in this case an output sample from the rectifier, is given by P x = 20 log 10 (x),x>0 where the useful range is -1 1 0

resistor limits the current into or out of the pin to less than 1 mA. According to Atmel this is a reliable as well as a simple method of obtaining a square wave from an alternat- ing voltage: see [3]- The microcontroller derives its clock from the 1 2 MHz crystal, while R2 and C6 provide a power-on reset pulse. Port pins P1.0 to PI .7, P3.4, P3.5 and P3.7 directly drive the LEDs. Since only one LED lights at a time, a single common series current limiting resis- tor (R1 ) suffices. The brightness of the LED can be altered by changing the value of this resistor. You can of course use whatever colours of LEDs you like. In the interests of clarity we populated our prototype as shown in the circuit diagram: a green LED for the exact nominal value of 50 Hz, yellow for devia- tions of up to +0.2 Hz and red at the extrem- ities of the displayed range. The scaling used for the display includes a magnifying effect: the resolution for the nine innermost LEDs (green and yellow) is 0.025 Hz while the frequency step to the outer pair of red LEDs is 0.1 Hz (see Table 1). The software When power is applied each LED is turned on briefly: this provides a quick check that the microcontroller is running properly and that all the LEDs work. The firmware then drops into the measurement routine. The microcontroller carries out the fre- quency measurement by measuring the time interval between successive nega- tive-going edges on the INTO input. At the nominal 50 Hz frequency this period will be 34 01-2012 elektor TEST & MEASUREMENT Table 1 . The LED scale LED colour red yellow yellow yellow yellow green yellow yellow yellow yellow red Deviation from 50 Hz in mHz <-200 -100 -75 -50 -25 0 +25 +50 +75 +100 >+200 exactly 20 000 ps. With a crystal frequency of 1 2 MHz and reading the tinner ‘on the fly’ we can obtain a period resolution of ±1 jlxs, which corresponds to 2.5 mHz at 50 Hz. In order to avoid the effect of possible inter- ference on the AC powerline input we use two filters implemented in software. Fre- quency readings of less than 45 Hz or more than 55 Hz are ignored; and furthermore, an average is taken over fifty consecutive readings. This approach practically elimi- nates errors due to jitter. The LED display is updated once a second, and a brief pulse is emitted on port pin P3.3 each time the display is updated. If desired an LED can be attached to this pin also: it will flash once every 50 readings, that is, once per second. Construction and test The printed circuit board with component mounting plan shown in Figure 2 is free both of SMD components (hurray!) and of adjustments (cheers 4 that). Also, the total component cost has been kept low. To keep things simple, the microcontroller is avail- able from the Elektor Shop as a ready-pro- grammed device. It is best to use an 1C socket for the microcontroller and to test the circuit first with the device not fitted. It is of course essential to observe correct polarity when fit- ting the diodes and electrolytic capacitors. Using a board-mounted transformer keeps the AC power wiring simple. Before applying power to the circuit check it over carefully for mistakes. Check also the jumper positions: for 1 1 5 V operation fit both J1 and J3 but not J2 (otherwise a short circuit will be introduced), and for 230 V operation fit only J2. When using the cir- cuit with a 1 1 5 V/ 60 Hz input it is also nec- essary to program the microcontroller with the 60 Hz version of the firmware. When everything has been checked power can be applied. Since AC line voltages are present at the input to the board, this should only be attempted by a suitably- qualified technician. With AC power applied to the board a DC voltage of about 8.5 V should appear across C4, while the voltage across C5 should be very close to 5 V. Assuming this is the case, disconnect the circuit from the AC socket and fit the (programmed) microcontroller. When power is again applied the LEDs should light briefly and then the middle (green) LED should light, indicating an AC power frequency of 50 Hz (or 60 Hz in the case of the 60 Hz firmware version). If everything seems to be working the unit can be fitted into a fully-insulated plastic enclosure with a moulded-in AC line plug, of the type used for plug-in power supplies. It must be impossible to touch any part of the circuit from the outside. The result is a device that is both electrically safe and easy to use: simply plug it into an Ac power out- let and observe the reading on the LEDs. The unit in practice In normal situations it will be observed that the power grid frequency remains very sta- ble, deviating from its nominal value by only a few tens of millihertz. The green LED will therefore be on for a lot of the time. In gen- eral there will be certain regular fluctua- tions observed, recurring every morning and afternoon. As the proportion of energy generated from weather-dependent sources such as sun and wind increases, unpredictable shortfalls or excesses of supply are expected to occur more frequently. These in turn will lead to greater frequency fluctuations. As an interesting aside, it was the case in Germany until recently that solar panel installations taking advantage of a grid ‘feed-in’ tariff had to be designed to discon- nect themselves if they detected that the grid frequency was above a certain thresh- old. This gave rise to the so-called ‘50.2 Hz problem’ [4]: the sun comes out, several gigawatts of solar power are dumped into the grid, the frequency rises... and sud- denly all those gigawatts of power simul- taneously disconnect themselves from the grid! The back-up services cannot cope with such a large sudden loss of generation, and so the frequency falls sharply. The solar installations observe this fall, reconnect themselves (typically almost simultane- ously) and the cycle repeats. The problem is being solved by randomising the fre- quency thresholds for such generators, with a longer-term move towards having the units smoothly reduce their feed-in power as frequency rises. It is possible to guess at the degree of load fluctuation on the grid by observing fre- quency changes. You may also be able to observe sudden drops in supply, for exam- ple when a fault detected in a power station trips its connection to the grid. Real-time demand graphs can be found at [5], along with information about power transfers on the interconnectors between Northern Ire- land and Britain, between France and Brit- ain, and (due for completion in late 201 1 ) between the Netherlands and Britain. There is also a real-time frequency graph availa- ble that you can compare against the results from your meter. (110461) Internet Links [1 ] http://en.wikipedia.org/wiki/ Operating_reserve [2] http://en.wikipedia.org/wiki/ Mains_frequency [3] www.atmel.com/dyn/resources/prod_ documents/doc2508.pdf [4] www.vde.com/en/fnn/pages/50-2-hz- study.aspx [5] www.nationalgrid.com/uk/Electricity/ Data/Realtime/ elektor 01-2012 35 COMPUTERS, SOFTWARE & INTERNET Scilab #1 for Open Source Numerical Calculation By Vincent Couvert, Bruno Jofret, and Julie Paul (France) Numerical calculation software provides engineers with a collection of design and study tools and programmes for simulation and modelling. This software has become indispensable for industry, which employs simulation in the automotive, aeronautics, energy, chemistry, finance, and many other fields. It enables industry to reduce, indeed sometimes even avoid, expensive testing — which is moreover often difficult to perform in a real situation In order to remain in the race forever-greater competitiveness and respond to the widespread and growing drive to reduce costs, the industrial world is taking increasing interest in this software, which is proving a very seriously competitor for the proprietary soft- ware they have been in the habit of using. Today, opting for open source software is no longer something that concerns only the gen- eral public for Internet browsing or word processing; as an exam- ple, OpenOffice.org has been adopted by numerous French public administrative bodies, and now software for the world of industry is involved as well. Supported by a consortium of industrial users and already in use around the world, Scilab [1 ] now represents a credible alternative to Matlab [2]. Apart from the not-insignificant cost benefit, the access to and complete control over the source code often constitute a decisive argument in its being adopted by numerous users, includ- ing the strategic sectors of defence and aeronautics. The academic world and education have already widely adopted Scilab, which in June 201 1 was recognized as being of high educational value by the French Ministry of Education. The Scilab software in practice Scilab is a piece of freeware distributed under a CeCILL licence (GPL compatible). It is available for the commonest operating systems (Windows, Mac, and Linux) and can be downloaded free from [1 ]. Scilab is a complete environment, open and expandable, for calcu- lation and visualisation. Based on matrix calculation, the software incorporates hundreds of mathematical functions and a powerful programming language. It offers possibilities for connection with other programs written in various languages (C, C++, Java). Scilab’s syntax is comparable to that of Matlab on numerous points, though it’s not 1 00 % compatible. Its functional spectrum is also very large, and users can add numerous external modules to it for simulation, graphic visualization, optimization, statistics, R&D’ing systems and controls, signal processing, etc. Like much free software, Scilab is interoperable. Users can adapt it to their needs and augment its native functions. For example, the gateway between National Instruments’ LabVIEW [3] and Scilab allows comprehensive, high-performance data processing. Users write their Scilab scripts directly in LabVIEW and call Scilab for ana- lysing and visualizing their data. An integrated environment Scilab offers an ergonomic, integrated work environment that is easy to get to grips with and use. Its console makes for easy use, displaying command lines and results. Its text editor and advanced functions allow you to save your programs and then recover your working environment next time it is run. It also provides total inter- action with the console, for example, allowing users to execute all or part of a file while it is being edited. Advanced visualization functions 2D and 3D graphics functions are included for visualizing, anno- tating, and exporting data. These offer numerous ways to create and customize various types of plots and diagrams. In this way, the results calculated by the user in the Scilab console can be visualized interactively. 36 01-2012 elektor COMPUTERS, SOFTWARE & INTERNET Figure 1 . The input signal. Figure 2. The Fourier transform of the input signal shows that it contains noise at two distinct frequencies. To give a more detailed view of the software’s functions, we’re going to show you two examples of using it in the field of signal processing. Example i: Digital filtering using Scilab In this example, Scilab is used to filter a signal coming from a WAV sound file. All the tools required to perform this task are included within Scilab: file read/write, fast Fourier transform calculation, cal- culation and application of digital filters. The sound file, which we’ve placed in Scilab’s current directory (con- suitable and modifiable by calling Scilab’s cd function) and called “NoisySignal.wav” [4], is loaded using the function loadwave which returns the sound data in the form of a vector, together with some information about the file (sampling frequency, etc.) In the text editor, we enter the following lines and then execute them (‘Run’ menu — as far as the cursor with echo): stacksize ( "max" ) ; // Increase memory for Scilab [noisySignal , noisySignallnf o] = loadwave ( "NoisySignal . wav" ) ; sampleFrequency = inf osSignal ( 3 ) samples = inf osSignal ($ ) Which displays in the console: - - >sampleFrequency = noisySignallnf o (3 ) sampleFrequency 22050 . -->samples = noisySignallnf o ($ ) samples 373380 . The results obtained tell us that the signal has been sampled at a fre- quency of 22,050 Hz and that our signal contains 373,380 samples (values). The plot function lets us display this signal (Figure 1 ): plot (noisySignal) xtitle ( "Input signal with noise"); // Title of the graph In order to find out the frequencies that are masking the wanted signal, we calculate the Fourier Transform of the signal using the f f t function, then its modulus using the abs function: Fft Of NoisySignal = abs ( fft (noisySignal )) ; s c f ( ) ; // Open a new graphics window plot (Ff tOfNoisySignal ) ; xtitle ("FFT of input signal") Using the plot function , we obtain the graph in Figure 2. This shows that this symmetrical signal has noise at two distinct frequen- cies. Hence it is going to take two successive filterings to recover the wanted signal. Precise identification of the noise frequencies is made easier in Scilab with its numerous matrix calculation features: mathematical operations, identification of the maximum value and of its position within the data... Executing the following code from the text editor lets us define the frequency corresponding to the peak: // The FFT is symmetrical, we only keep the first half of the samples frequencies = sampleFrequency* ( 0 :( samples/2 )) / samples ; // Find the highest peak in the FFT to filter it out [peakValue, peakValuelndex] = max (Ff tOfNoisySignal ( 1 : size ( frequencies , "*"))); peakValuelndex elektor 01-2012 37 COMPUTERS, SOFTWARE & INTERNET —i i 1 1 l I Figure 3. The Bode diagram of the IR filter which will filter out the 1397 Hz signal. Figure 4. After filtering, the input signal now only has one interference signal. frequencies (peakValuelndex) Now let’s verify the results in the console: - - >peakValueIndex peakValuelndex 23657 . - - >f requencies (peakValuelndex) ans 1397 . 0079 The first peak represents noise at a frequency of 1 397.0079 Hz. A 3 rd -order Butterworth band-stop filter with a bandwidth of 200 Hz and centred on this frequency makes it possible to eliminate this noise. The transfer function of this filter is obtained using the func- tion iir: hz = iir (3, "sb", "butt", [frequencies (peakVal uelndex) -100 frequencies (peakValuelndex) +100] / sampleFrequency , [0 0] ) ; In order to display the filter’s Bode diagram simply, we use the func- tion bode (Figure 3). Now all we have to do is apply this filter to the noisy signal using a single line of code: // Filtering input signal f ilteredSignal = filter (hz . num, hz.den, f ilteredSignal ) ; The signal obtained still carries noise at the second frequency, as we see from the Fourier transform in Figure 4 (calculated using the same method as before). This graph confirms that the first peak has indeed been eliminated. Now we need to filter the second peak with the help of another band-stop filter (for example, a 3 rd -order type I Chebyshev filter) centred on the frequency corresponding to this peak, using the same technique as before: // Find the second peak in the FFT to filter it out [peakValue, peakValuelndex] = max (Ff tOfNoisySignal ( 1 : size ( frequencies , "*"))); peakValuelndex frequencies (peakValuelndex) ; // Calculate corresponding Chebyshev filter hzFiltre2 = iir (3, "sb" , "chebl" , [frequencies (pea kValuelndex) -100 frequencies (peakValuelndex) +100] / sampleFrequency, [0.01 0] ) ; // Filter the filtered input signal f ilteredSignal = filter (hz . num, hz.den, f ilteredSignal ) ; We display the result (Figure 5): scf ( ) ; plot ( f ilteredSignal ) xtitle ( "Input signal filtered twice") The original signal is now completely filtered and a final calculation of the Fourier transform of the signal shows that both noise fre- quencies that were present in our original signal have indeed dis- appeared (Figure 6): Ff tOf Fil teredSignal = abs (f ft (f ilteredSignal) ) ; scf ( ) ; plot (frequencies , Fft Of Fil teredSignal ( 1 : size ( f requenc ies , "*"))); xtitle ("FFT of input signal filtered twice") We save our result in a WAV file: savewave ( "SoundFiltered . wav" , f ilteredSignal ) Example 2 - Edge detection In the field of image processing, and more broadly computer vision, edge detection is one of the first steps required upstream of the more complex algorithms used for detecting objects, detecting faces (face tracking), and so on. All we have to do is represent the image in the form of a matrix of values (usually the grey levels) and to apply the desired processing to this matrix. Here, Scilab plays a dual role, as it lets us both display the image and the changes to it during the processing, as well as manipulate the data using the matrix calculation capabilities available. This example applies a first-order method (gradient) implemented using Prewitt, Sobel, and Scharr filters. 38 01-2012 elektor COMPUTERS, SOFTWARE & INTERNET Figure 5. The filtering has made it possible to eliminate both the interfering signals. Figure 6. The Fourier transform of the filtered input signal. The image in the PGM format (‘portable graymap’, a greyscale image) which we’ve named “Scilab.pgm” [4] is loaded using the function readimage [4]. This function will open the file, read the size of the image and then the grey levels associated with each pixel (values between 0 and 255), returning the image in the form of a matrix. stacksize ( "max" ) ; // Increase memory allocated to Scilab gray_m = readimage ( "Scilab . pgm" ) ; For simplicity, in the rest of this example, we’re going to use a func- tion showlmage to display all the future transformations in levels of grey. This function is based on one of Scilab’s native functions, Matplot [5], which allows a matrix to be displayed. By using the corresponding greyscale table, we can display the image: function [] =showImage ( imageMatrix) f = Figure ( ) ; f.color_map = graycolormap (255 ) ; f. background = -2; Matplot (imageMatrix) ; endf unction showlmage (gray_m) ; The image loaded into Scilab is displayed in a graphics window (Figure 7). Edge detection on a greyscale image is performed using calcula- tions on a 2D matrix. It is possible to work on /V-dimension matri- ces in order to represent colour images (RGB, RGBA, CMYK, HSV, etc.) The processing to be applied will be applied to each channel, or indeed combined between them to obtain other results. The next step in detecting edges consists in applying smoothing to reduce the noise in the original image and obtain better results in the final detection. Scilab lets us define the smoothing function by using a convolution product and a Gaussian 2D matrix. This takes as a parameter the matrix representing the image and returns another matrix representing the smoothed image. Two rows of pixels are artificially added around the edge of the image so as to be able to implement the convolution product with the help of the function sum and a product of matrices. These func- tions are optimized in Scilab and perform betterthan if each of the operations were performed element by element. function N=blurr(P) N = zeros ( P) ; P2 = [zeros (1, size (P, "c") ) ; zeros (1, size (P, "c") ) ; P; zeros (1, size (P ; "c") ) ; zeros (1, size (P , " c" )) ] P2 = [zeros ( size ( P2 , "r"), 1), zeros ( size ( P2 , "r"), 1), P2 , zeros ( size ( P2 , "r"), 1), zeros ( size ( P2 , V), 1)] K = 1/159 * [2 4 5 42 4 9 12 94 5 12 15 12 5 4 9 12 94 2 4 5 4 2]; for x=3 : ( size ( P2 , "r") - 2) for y=3 : ( size ( P2 , "c") - 2) r = 0 ; N(x-2,y-2) = sum(K .* P2(x-2:x+2, y-2 : y+2 ) ) ; end end endf unction A more naive implementation of the convolution product, such as exists in the literature, would make it possible to obtain numerically equivalent results, but with much longer calculation times. function N=dummy_blurr ( P) N = zeros ( P) ; K = 1/159 * [2 4 5 42 4 9 12 94 5 12 15 12 5 4 9 12 94 2 4 5 4 2]; for x=l:size(P, "r") for y=l:size(P, "c") r = 0 ; for i = -2:2 for j = -2:2 if (x + i > 0 & x + i <= size(P, "r") &y+ j > 0 &y+ j <= size(P, "c")) elektor 01-2012 39 COMPUTERS, SOFTWARE & INTERNET Figure 7. The original greyscale image. Figure 8. The original image smoothed to make it easier to detect the edges. r = r + K(i+3, j+3) * P(x+i, y+j ) end end end N(x,y) = r; end end endf unction The smoothed image thus obtained (Figure 8), which to the naked eye appears blurred, will be used for the gradient calculations which will bring out the edges in this image. For these gradient calculations, we are using Sobel (Figure 9) and Prewitt (Figure 1 0) filters. Both these filters are achieved by way of a convolution product used for calculating a gradient. function N=convol2d (K, P) N = zeros ( P) ; P2 = [zeros (1, size (P, "c") ) ; P; zeros (l,size(P / "c"))] P2 = [zeros ( size ( P2 , "r"), 1) , P2 , zeros ( size ( P2 , "r"), 1)] for x=2 : (size(P2, "r") - 1) for y=2 : ( size ( P2 , "c") - 1) r = 0 ; N(x-l,y-l) = sum(K .* P2(x-l:x+l, y- 1 : y+1 ) ) ; end end endf unction Scilab is not the only free, open source numerical calculation program Fiere are three other examples that deserve a mention: - Octave is a structured interpreted programming language like C that accepts numerous constructions from the standard C library. It can be extended to accept Unix functions and system calls, and functions written in C++ can be used. For the majority of commands, the syntax is the same as for MATLAB and careful programming makes it possible to run scripts under both Octave and MATLAB. (source: Wikipedia) www. gnu.org/ soft wa re / octave / - FreeMat is a computerized calculation environment and a pro- gramming language, in the form of free software, relatively compati- ble at source level with Matlab and Octave. It can be easily interfaced with external code in C, C++, and Fortran, it offers the possibility of developing parallel distributed algorithms, and it has some capabili- ties for volume rendering and 3D visualization. The current version 4.0 dates from October 2009. (source: Wikipedia) http://freemat.sourceforge.net -JMathLib is presented as a Java clone of Scilab, Octave, Freemat, and Matlab. Like Freemat, this project seems to be less active than Scilab and Octave. The current version 0.9.4 dates from February 2009. www.jmathlib.de/ 40 01-2012 elektor COMPUTERS, SOFTWARE & INTERNET ForSobel: GX = convol2d( [-101 ; -202 ; -101], gray_m) ; GY = convol2d( [-1-2-1 ; 000 ; 121], gray_m) ; contourSobel = sqrt (GX . ^2+GY . ^2 ) ; showlmage (contourSobel ) ; For Prewitt: GX = convol2d( [-1 0 1 ; -1 0 1 ; -1 0 1], gray_m) ; GY = convol2d( [-1 -1 -1 ; 0 0 0 ; 1 1 1], gray_m) ; contourPrewitt = sqrt (GX . ^2+GY . ^2 ) ; showlmage (contourPrewitt) ; Figure 9. The edges as revealed by the Sobel filter. Other formulae give more satisfactory results by using a different convolution model: Costella, Robert Cross, and Scharr. It’s easy to implement these in Scilab thanks to a language that is simple and fairly close to mathematics (no variable declaration, no typing, no memory allocation, etc.) For example, the Scharr filter (Figure 1 1 ) is implemented via the following lines: GX = convol2d( [3 0 -3 ; 10 0 -10 ; 3 0 -3], gray_m) ; GY = convol2d( [3 10 3 ; 0 0 0 ; -3 -10 -3], gray_m) ; contourScharr = sqrt (GX . ^2+GY . ^2 ) ; showlmage (contourScharr) ; This matrix may be used as the basis for other shape detection algo- rithms. This is just one initial step in processing the image. We can go further by performing additional filtering on threshold values. The most pronounced edges corresponding to the lightest areas would be retained and the others eliminated. The matrix thus obtained would contain only 0s and 1 s for each pixel recognized as being part of an edge. There are countless possible examples of the use of Scilab across very diverse fields of application. A forthcoming issue of Elektor will be carrying an article on Xcos, Scilab’s tool for modelling and simulating hybrid dynamic systems - the equivalent of Matlab’s Simulink. (110491) Internet Links [1] Scilab: www.scilab.org [2] Matlab: www.mathworks.com/matlab [3] LabVIEW: www.ni.com/labview [4] Files for the examples shown: www.elektor.com/ 1 1 0491 [5] Help with the Matplot function: http://help.scilab.org/docs/current/fr_FR/Matplot.html Figure 1 0. The edges found by the Prewitt filter. Figure 1 1 . The edges according to the Scharr filter. elektor 01-2012 41 Do your electronics speak to you? Are the words audio ' , "vacuum tubes" and "speaker technology" music to your ears? Then you should be reading audioXpress! Recently acquired by The Elektor Group, audioXpress has been providing engineers with incredible audio insight, inspiration and design ideas for over a decade. If you're an audio enthusiast who enjoys speaker building and amp design, or if you're interested in learning about tubes, driver testing, and vintage audio, then Choose from print delivery, digital or a combination of both for maximum accessibility. Subscribe to audioXpress at www.cc-webshop.com today! Audi | omotcil Tube, Solid State. Loudspeaker Tech V% 311(1 bettor lhan ™, this 7t ? vflfy: hirg you nwd tD ■ ^ ****** Thrs rm /£ rtr-. ! ■ n I WJ iJKSLCteS Kl ppo'j anaf • • •; :■ wu- yT hirg you necti to £* * i ;l iDplcf dfh : OUdSpeaker WOteJhd ■ esl i $ and c«osscver changes. 4 ■i Li^h moral Sr ipc complex v*rlh r:or1 Tuning ovs* lCQadclmnna f ;'j j it. ii sal or oudsooakor « A S3 9 vuluot What will you find in audioXpress ? • In-depth interviews with audio industry luminaries • Recurring columns by top experts on speaker building, driver testing, and amp construction Accessible engineering articles presenting inventive, real-world audio electronics applications and projects Thorough and honest reviews about products that will bring your audio experiences to new levels audioXpress is the magazine for you! Yours today for Just S' this honk, rwi mai batter By Thijs Beckers (Elektor UK Editorial/ Labs) Reader Matthias Schwarzwald (Germany) kindly sent us an interesting remark on the Simple Bat Detector published in the November 201 1 edition [1 ]. Although he really enjoyed the SMT-free circuit — many bat fans are not particularly educated in electronics — he feels some components should be of higher quality. “For instance, the 40 kHz ultrasonic sensor is only capable of detecting about half of the population of bats living in my country. There are many species ‘emitting’ at other frequencies, some as ‘low’ as 20 kHz. In this particular instance a suitable electret microphone capsule would be a better choice. When using an ultrasonic sensor I would recommend the use of a shielded version (not the cheapest one; manufacturing and testing an effective shielding is a real challenge to most manufacturers). It would be interesting to have a version with multiple microphones in order to expand the sensitivity (angular aperture, or directivity). Depending on the directivity of ^ the microphone the range would otherwise be reduced from the theoretical 30 meters (100 feet) ^ m to just a few meters (less than 10 feet). Bats transmit their sound bursts in a very specific \ a \ direction and fly an ever-changing trajectory during their hunt, which makes it practically impossible to point a microphone in an optimal direction.” We think Matthias has a point. During the prototyping phase fellow lab worker Ton Giesberts, who has been manoeuvring this project through our lab, had already thought about adding a resistor to the circuit to optionally supply an electret microphone with a bias voltage. Also, the use of multiple sensors had come to mind. The problem with using a ‘sensor array’ though, would be summing the signal correctly — without introducing phase problems. The wavelength of a 40 kHz signal is about 8.25 mm, so it is practically impossible elektor 01-2012 43 E-LABs INSIDE Radiation meter: By Thijs Beckers (Elektor UK Editorial / Labs) The article about the Improved Radiation Meter (Elektor November 201 1 , [1 ]) contains a basic description of how the sensor — type BPW34 — has to be shielded from ambient light. Having noticed some confusion among our readers we will explain it again with the aid of some photos. The BPW34, which is suitable for the measurement of gamma radiation, can be completely enclosed; gamma radiation is strong enough to pass through various materials and still be measurable afterwards. The shielding from ambient light can be done in several ways. We will show two here: 1 . Shielding with aluminium foil. The sensor is covered with a piece of kitchen aluminium foil. To prevent a short-circuit, we first put a piece of insulation tape on the circuit board at the location of the sensor (Photos 1 and 2). This has the added benefit of blocking the light that would oth- erwise pass through the board and onto the back of the sensor. Now we fit the sensor (Photo 3). Make sure you get the polar- ity correct (this is also indicated on the circuit board in the kit). The cathode on the BPW34 is indicated by a small tab on the pin, see Photo 4. You can now cover the sensor with a piece of aluminium foil. Use a piece of foil that’s large enough for it to be connected to the ground terminal on the circuit board. Make sure that the foil has no minuscule holes and that the foil is 1 00% light-proof. Also ensure that the space between the foil and the sensor is as small as possible. Otherwise the sensor will also react to loud sounds, and we want to avoid that of course (Photo 5). Finally you can cover the entire circuit board with aluminium foil, so you keep external influences out of the circuit as much as pos- sible (Photo 6). When doing so, make sure that you are not cre- ating a short-circuit somewhere! If you’ve worked carefully the sensor is ready for making measurements. 2. Shielding in a tin. In this case we place the entire amplifier board within a shield- ing and light-proof can (Photo 7). There are several options for this, consider a biscuit tin or the blue tin in which the hand lotion of a famous brand is sold. ‘Old-fashioned’ spice ortea and coffee tins are also a good choice. It is best to use a tin without a hinge, since these hinges will often allow light to enter the tin. Mount the circuit board in the tin and ensure that there is a good connection between ground on the circuit board and the tin. The wires connecting the amplifier board to the counter can exit between the top of the tin and under the lid. In this case there is no need to shield the sensor separately as well. In our experi- ments this option gave the best results and the least noise and interference. 44 01-2012 elektor mounting the sensor Alpha radiation is blocked much easier than gamma radiation; a sheet of paper is already a big obstacle for alpha radiation. As already discussed in the above-mentioned article, the BPW34 is not really suitable for measuring this type of radiation. The plas- tic package will (for the most part) already block the radiation. Wrapping it in aluminium foil is therefore entirely out of the question. A good alternative sensor for measuring alpha radia- tion is the type BPX61 (Photo 8). Although this photo diode is more expensive, it is supplied in a TO-39 package, which has a glass window on the light-sensitive side. If we now carefully remove this glass window, without dam- aging the sensor, then the light-sensitive layer is completely exposed and the radiation can reach the sensor surface com- pletely unimpeded (Photo 9). As already mentioned, alpha radiation is easily blocked. So the radioactive material that you are using in the test must not be too far from the sensor. Tests with this diode carried out at the University of Namen (Belgium) indicated that when using a 239 Pu-test radiator (about 5 MeV of alpha radiation) resulted in pulses of about 200 mV at the output of the measuring amplifier. In this way we have a very sensitive sensor in our hands that’s capable of measuring alpha radiation readily. There is no need to change eitherthe amplifier northe pulse counter. They both will operate with either sensor. A few ‘everyday’ sources of radioactive radiation are an ‘old’ watch with illuminated hands (mainly alpha radiation, so the glass has to be removed), a gas mantle intended for gas lamps, potassium chloride, WT20 weld- ing electrodes, a discarded smoke detector (when it indicates that 241 Am is being used) and pitchblende (of uraninite). Sending radioactive materials by mail is absolutely forbidden, but there is of course no problem if you take your radiation meter to a location where there are radioactive materials. For example, in a hospital. If you meet the right staff there then they will almost certainly be interested in the ‘sensor’ we use in this circuit, and perhaps can be persuaded to do a test cali- bration of your circuit. Incidentally, we are still experimenting ourselves with other ‘sensors’, such as the famous 2N3055 (Photo 10) and also the author of the article, Burkhard Kainka, has carried out a sub- stantial number of experiments [2]. We will of course not with- hold any good results and these may be published in a future article. (110709-1) Internet Links [1] www.elektor.com / 1 1 0538 [2] www.elektronik-labor.de/Projekte/Projekte.html elektor 01-2012 45 Debugging the debugger By Luc Lemmens (Elektor Labs) During the development of the USB-stick logger published in the September 201 1 edition of Elektor we couldn’t manage to get the communications going to the microcontroller via Microchip’s In Circuit Debugger 3 (ICD 3). We did manage to program the flash memory of the chip in the circuit, a PIC24FJ64, using the predecessor of the debugger, the ICD 2. However, as soon as the logger was connected to the newer version the development environment of Microchip stated that the target processor didn’t correspond with the type that was configured. It has to be said that an ID of ‘0000’ (the value returned in MPLAB) gave rise to the suspicion that there were communication problems. A quick search on Microchip’s website told us that there may be problems with the ICD 3 when the pull-up resistor connected to MCLR of the system is too strong. Our prototype indeed did have a value of just 1 kO, whereas Microchip warned that problems could occur with a pull-up resistor of 4.7 kO. The simplest solution to this problem was to increase the value of this resistor to 5.6 kO. m CD In the associated Engineering Technical Note (ETN#29, [1 ]) it’s mentioned that a resistor can be changed in the hardware of the ICD 3, which will prevent this problem from occurring in the future. A quick description of the procedure follows (also see the photo). Opening the ICD is very straightforward. The circuit board can then be removed from the case to replace the resistor, which is mounted on the underside of the board. The board itself is fixed to the bottom of the case with sticky feet; in our ICD 3 we could prise them off easily, without causing any damage. Resistor R61 (1 k^) should be replaced with one of 1 00 Q. This is easier said than done, since we have to deal with SMDs and the resistor has an outline of 0402, which is very small. Despite that, we don’t really need specialist tools for this single component. With a bit of courage and care it’s possible to do this with an ‘ordinary’ soldering iron. Desoldering the resistor turns out to be the more difficult task. Place the tip of the soldering iron on top of the resistor, preferably such that both metal ends of the component are heated at the same time. Tinning the tip of the soldering iron beforehand will improve the thermal contact with the resistor. Eventually it will come loose and it should stick to the tip of the soldering iron. ] R62MHW A QZ . — - , R59*mm e A small pair of tweezers will come in very useful to keep the new resistor in place when soldering it to the board. Once the resistor is positioned properly it doesn’t take much effort to solder both ends to the board. When the operation has been carried out successfully you should do the same for R62, since the V DD connection of the ICD 3 can suffer from the same (potential) problem. (120023) Internet Link [1 ] http://ww 1 .microchip.com/downloads/en/DeviceDoc/ ETN 29 _MPLAB_ICD% 20 _% 20 VPP_CURRENT_SINK.pdf 46 01-2012 elektor Subscribe now to the leading US-based computer applications magazine specializing in embedded systems and design! Select your personal subscription at www.elektor.com/cc-subs 12 editions per year for just Digital: $38 Print: $63 Digital + Print: $90 CIRCUIT CELLAR Trit MAGAZINE FOR COMPUTER APPLICATIONS READERS’ PROJECTS Ultra-accurate DSP-based DCF77 Timecode Receiver Beats commercially available demodulators hands down To extract the highest possible accuracy from the German DCF 77.5 kHz timecode broadcast this project uses DSP algorithms running on a low-cost dsPIC33 microcontroller to filter and demodulate both the AM and phase modulated signals, while also producing a very stable 10 Hz carrier-locked reference clock output. By Steve Marchant (United Kingdom) Whereas commercially available receivers / demodulators (e.g. from Galleon Systems or Conrad Electronics) work well and produce reliable time-code pulses, the exact timing of these pulses (with respect to a stable 1 Hz clock) have large amounts of jitter — of the order of tens of milliseconds. The reason for this is that they all rely on crystal filters to extract the carrier frequency — the ultra-low bandwidth of these filters seems ideal for the job but brings with it inherent timing issues for the demodulation stage. These low-cost commercial receivers also do not provide a carrier-locked reference frequency output nor do they decode DCF’s pseudo-random phase modulation scheme, which can provide an order of magnitude improvement in timing accuracy and operate much more robustly on low signal strengths. With good quality, low-jitter second mark- ers and a carrier-locked reference frequency it is possible to build a clock with sub-millisecond accuracy. Hardware The system consists of a receiver board and an active antenna board, which can be remotely located at the end of a length of coax cable — proper siting of the antenna well away from interference sources can greatly improve signal quality. The antenna is a commercially available ferrite coil and tuning capacitor assembly pre-tuned to Note. Readers’ Projects are reproduced based on information supplied by the author(s) only. The use ofElektor style schematics and other illustrations in this article does not imply the project having passed Elektor Labs for replication to verify claimed operation. 48 01-2012 elektor READERS’ PROJECTS 77.5 kHz. This is combined with an op-amp gain stage shown in Figure 1 to form the line-powered active antenna capable of driving a reasonable length of coax cable to the receiver board. Looking now at the receiver/ processor schematic in Figure 2, the first op-amp stage provides some more AC gain which drives into three further stages comprising a 6th order low-pass anti-aliasing filter with 1 dB flat pass-band to 78 KHz and -50dB stop-band from 232.5 kHz. Note that the signal is subsequently sampled at 310 kHz (fs = 4/c) for input to a DSP notch filter at 77.5 kHz so the first poten- Figure 1 . DCF77 antenna preamplifier circuit. The 3.3 V supply voltage arrives via the downlead coax cable. A3V3 Figure 2. The circuit diagram of the DCF signal processor is a mix of analogue electronics interfaced to a microcontroller. elektor 01-2012 49 READERS’ PROJECTS I/O Connectors Ji: Antenna header (3-pin) ji-1 GND J 1 -2 RF signal JI .3 GND J2: Power and output signals header (8-pin) J2.1 5 V in, approx. 1 00 mA J2.2 TEST output toggles whenever the main loop exceeds its al- located time J2.3 The VCXO PWM signal to the master oscillator J2.4 n/u J2.5 9600 baud serial out (TTL polarity, not RS232 polarity) J2.6 1 0 Hz reference output J2.7 DCF pulse output, clean & accurate leading negative edge J2.8 GND Note all outputs are open collector if a 74LS06 buffer is used at U3. Replace U3 with a 74HCT04 if totem pole outputs are preferred. J3: PIC in-system programming header (5-pin) J3.1 MCLR J3.2 3v3 J3.3 GND J3.4 ISP Data / GPS reference pulse input J3.5 ISP Clock Figure 3. Silk screen overlay (80% of real size) showing component placement on the receiver/processor board. The complete PCB design files are available free from [1 ]. tial alias we need to worry about is at 232.5 kHz. The analogue filter was designed using Microchip’s free FilterLab software and should be constructed with 1% components throughout as indicated. A fifth op-amp stage provides additional programmable AC voltage gain. All the op-amp stages have unity gain at DC and so the mid- rail bias voltage applied at the first stage simply propagates through to the last. The output of the fifth stage feeds directly into an ADC pin on the dsPIC33 where the signal is sampled at a rate of 31 0 kS/s. Note that the gain of the last stage of the circuit is optimised by software control to provide a roughly 3 V pp signal for the ADC. After demodulation by software (see below) the DCF time-code signal is buffered by an inverting, open-collector output driver. The pro- grammable gain stage makes use of an H1 1 FI opto-coupled bi-lat- eral FET — effectively a current-controlled isolated variable resistor — in the feedback path of an op-amp gain stage. The higher the current through the LED, the lower the resistance of the FET and the higherthe gain of the op-amp stage. The H1 1 FI ’s LED is driven by a voltage to current converter (implemented with a spare op- amp and a PNP transistor) driven by a filtered PWM output from the PIC, enabling software control of the overall RF gain. To provide the carrier frequency-locked clock source the master crystal oscillator circuit of the PIC is implemented with a voltage-controlled crystal oscillator to allow its precise tuning under software control. This is done using another RC filtered PWM output from the PIC. Software The dsPIC33 provides a 40 MIPs 16-bit DSP-capable core with RAM, Flash and a host of peripherals, most relevant of which is the 500 KS/s 1 2-bit ADC used to sample our RF signal at 310 kHz. The brilliantly designed ADC sub-system has a built-in buffer that can hold two pages of up to eight samples and flips from one to the other automatically setting a flag to tell the software when new samples are ready. The software processes four samples at a time in an endless loop that must complete each pass in less than 1 3 ps — the cycle time of the carrier frequency. In fact 40 MIPs is not adequate for this application and we have to over-clock the PIC to obtain enough CPU power. After obtaining our four samples (one cycle’s worth) the first job is to cross-correlate (multiply) them with a sine and a cosine waveform of the frequency we want to extract, f c . In the digital world that sim- ply consists of [0,1 ,0,-1 ] and [1 ,0,-1 ,0} respectively, the multipli- cations are trivial. Each of the four sine results are added together, as are each of the four cosine results, these totals then update two 1 20-entry ring buffers and a running total of each buffer is main- tained. These running totals can be vector-added using ^(siir+cos 2 ) to produce an amplitude result. The amplitude signal is filtered and buffered over a two second period to obtain maximum and mini- mum values from which are computed an upper and a lower thresh- old with which to demodulate the amplitude signal into binary. This binary signal is of course the raw time code signal and could be used as input to a suitable clock — but we can do much better, more of which later. In order to get this far though there are a few more things to con- sider, firstly the matter of the AGC. The software checks the four raw ADC samples to see if any are approaching either the upper or lower limit of the ADC’s input range, a simple control loop strives to keep just a handful of samples at the outer limits of the ADC’s range. If none or too few samples are pushing the limits the gain control is increased. If too many, the gain is decreased. The RF gain is pro- grammable in hardware and is controlled by a PWM output from the PIC, the software simply changes the PWM register to obtain a corresponding change in RF gain. 50 01-2012 elektor READERS’ PROJECTS The receiver was developed in West Yorkshire UK, some 850 km from the transmitter, consequently the signal strength was fairly low and significant RF gain was required, it may be that your receiver could benefit from some reduction of gain for use very much closer to Mainflingen, to this end reduce R8 or increase R1 0. Antenna orientation and location is also fairly critical in low signal strength areas, the ferrite rod should be broad-side on towards the direction of Mainflingen (50N, 9E) and away from low frequency interference sources such as computer monitors, switch-mode power supplies etc. Cheap LV lighting transformers are a particular problem and, rather inconveniently, having an ICD2 debugger connected also seriously compromises received signal quality. The serial debug output will not start up until the phase decoder is in lock, from power-up this can only happen once the master clock PLL locks and the LED has changed from red to green (this takes at least 1 0 seconds) then a clean AM signal is briefly required. The LED will clearly show if the AM signal is noisy. Once the serial data has started up there’s plenty of debug info available, signal strength should be >40 or so for reliable reception the AGC PWM value should not be stuck at either the zero or 1 023 extreme, the master clock PLL PWM signal should be relatively stable, not wildly fluctuating and not stuck at an extreme. Next is the matter of fine tuning the master oscillator, this is required in order to produce the phase-locked reference output and to make decoding the phase modulated signal much easier. Given the sine and cosine cross correlation data it’s a simple matter to calculate the relative phase of the signal with respect to the sam- ple rate; once you have a measure of the phase you can construct a phase-locked loop. Either the sin or the cos data, divided by the amplitude is a measure of phase; this is used both directly and via a software filter to control another PWM output from the PIC. After a little RC filtering in hardware this is fed to the voltage control input of the crystal oscillator, closing the control loop. With the phase- locked loop in operation the master oscillator becomes locked to a multiple of the carrier frequency and from this can be derived a 1 0 Hz reference output. The software must also detect the state of lock — should the loop go out of lock the 1 0 Hz signal is squelched until lock has once more been achieved. Finally we are in a position to consider decoding DCF’s pseudo-ran- dom sequence phase modulation. This is a sequence of 51 2 bits, each bit lasting 1 20 carrier cycles, used to modulate the phase of the carrier by ±1 3 degrees. The modulation starts 200 ms after the lead- ing edge of the AM time code, i.e. the second marker, and continues for approximately 793 ms. There are as many zeros as there are ones in the sequence and so the overall phase of the carrier is unaffected. The software already has a measure of carrier phase (stabilised by the action of the PLL) and you now see why a buffer length of 1 20 cycles was chosen above. The code implements another cross-corre- lator, a reference bit sequence (stored in code memory) is multiplied by the carrier phase measurement every 1 20 cycles and summed over 512 bits. The result is a measure of the correlation between reference and transmitted bit sequences and depends strongly on how well aligned the two sequences are. If we can get the reference sequences optimally aligned then we have a strong handle on the second marker timing. In fact DCF encodes one bit of time-code data on the bit sequence using either the true or complemented sense of the sequence accordingly. Con- sequently we get either a positive or negative correlation result depending on the data bit encoded. But how do we achieve good alignment? In a perfect world, with unlimited CPU power, we’d store all the phase data we get over the one second period (77,500 samples) and hunt for the peak correlation by re-sampling against our reference at different starting points within the data. In the real world we have only enough CPU power to do one set of correla- tions per second, so we have to pick a starting point and run with it. We need some way of knowing at the end whether we started too early or too late so that we can make an adjustment ready for the next second. To obtain this information we use yet another cross correlator run- ning half a bit-time out of phase with the first and using a differen- tial bit sequence derived from the main sequence. The result is a signal that (when corrected for encoded data polarity) is zero when the timing is perfectly aligned, negative when the starting point was too early and positive when the starting point was too late. We use this to constantly adjust the next starting point and to home in on the correct alignment, once good alignment is achieved we can start outputting second marker pulses with very much more accu- rate leading edges. One problem is choosing an initial starting point for the cross correlator, the correlation results explained above only work as long as we are within ±1 bit time i.e. 1 20 carrier cycles or 1 .5 ms of the optimum. To obtain our initial starting point we have to rely on the AM signal — the software looks for a clean negative edge and uses that as a reference point, under good signal condi- tions that’s usually ok but if the phase decoder fails to lock it has to go back for another try. However once the phase decoder is in lock it’s very robust and can survive periods of signal strength so low that the AM decoder fails to produce useful data. The source and object code files for the project are available free of charge from [1]. Serial data output The software makes the phase encoded time-code data bit, plus a collection of other debug data, available via a 9600 baud serial out- put — a packet of data is transmitted every second on the second with the first start-bit of the first character accurately aligned to the second marker. Note that serial output is only active when the phase decoder is running. The packet is of one of two formats: " ! LDsseeeeddddpppaaayy" or " : LDsseeeeddddpppaaayyooccrrrrrzzzzz" where ! = the phase decoder is transitioning between locked and unlocked. : = the phase decoder is stable. L = locked status of master clock PLL. 0 or 1 . D = phase decoder output i.e. time code bit from the previous second. ss = signal strength; <40 is poor, >1 00 is very good, max 1 60. eeee = main pseudo-random phase correlator output. * dddd = differential pseudo-random phase correlator output.* elektor 01-2012 5 i READERS’ PROJECTS Figure 4. The active antenna was built in experimental fashion on a breadboard. ppp = filtered PWM value to VCXO, the PLL control voltage 0 - 1 023. aaa = current AGC PWM value, the RF gain control voltage 0 - 1 023. yy = signal amplitude at the end of phase modulation. 0-160. oo = phase correlator happiness factor; -1 fail, 0 poor, 60 max. * cc = last adjustment made to the phase correlator starting point. * rrrrr = absolute phase of GPS reference input if present. 0 - 77499. zzzzz = absolute phase of second marker. 0 - 77499. All fields are expressed in hexadecimal notation. * means that the value can be negative, if its MSB is set then compliment the data, add one and interpret it as a negative number. The DCF output from the board is just the AM receiver pulse but with a phase decoder-disciplined leading edge. The clean leading edge lasts for 50 ms, after that the AM pulse shape takes over until 200 ms have elapsed, the section of pulse from 50 ms to 200 ms may therefore contain noise under low signal conditions. Also, in the case of second marker 59, which is omitted by DCF in AM, the 50 ms pulse is still output. If the pseudo-random phase decoder is not locked then no pulses are output. Note that the phase encoded data for seconds 59 to 9 are currently transmitted as all ones (this is not the case for the corresponding AM data bits) this can be used as a framing sequence. The LED (if it’s in the right way round) shows the raw AM pulse in green when the master clock PLL is locked or red at start-up and when the PLL is not locked. Construction The receiver / processor board is double-sided and contains a mix of through-hole and SMD parts. The component placement is shown in Figure 3; the full PCB artwork (top side and underside copper track layouts) as designed by the author is a free download from [1 ]. The antenna preamplifier was built experimentally like in Figure 4. No PCB was designed for it; if you can help other readers, let them know through the Elektor forum. Signal quality The DCF77 radio signal from Mainflingen has two routes to your receiver — the ground wave should provide useable signal levels up to 1 000 km (approx. 600 miles) or so from Mainflingen. Then there’s the ‘sky wave’, or propagated wave, which is a reflection of the trans- mitted signal via the ionosphere. This signal component is dependent on the state of the ionosphere at any given time and it varies hugely with both time of day and time of year. Usually it’s stronger at night and in the winter months. Unfortunately, since it has travelled a sig- nificantly longer distance to get to your receiver, its relative phase will vary with respect to that of the ground wave, this causes all kinds of drop-outs and signal phase-shifts. Thus with increasing distance from Mainflingen it becomes increasingly difficult to obtain reliably accu- rate timing from the signal during the night. During the day however, 10 am to 2 pm in winter for example the signal is good for reproduc- ibility in the region of ±250 ps; a figure supported by monitoring over a period of many months, see below. Accuracy To check the prototype receiver’s accuracy, provision was made to input a GPS timing pulse (positive going 3.3 V pulse on J3.4) and to report the phase of this pulse and that of the decoded second marker as part of the debug serial output stream. In my case for example, on a good day, I see an absolute GPS phase of typically 32547 and a decoded second marker phase of 32768; see the oscil- loscope screendump in Figure 5. The units are in carrier cycles so that’s a 221 cycle offset, corresponding neatly to the propagation delay due to the receiver’s 858 km distance from Mainflingen which works out at 2.86 ms or 221 .8 cycles. Long-term GPS-referenced monitoring results from a prototype receiver are available on-line, see Resources below. For optimum absolute accuracy, a calibration is required, in either the clock or the receiver, to compensate for the ground wave propa- Further software development Those wishing to dive in at the source code level or make a propagation delay adjustment are welcome to download the code and experiment with it as they wish but please make bug-fixes and improvements available to all. You’ll need Microchip’s MPLab IDE development software and C30 compiler, all free to download from the C30 web page. To program or re-program the dsPIC33 you’ll need a suitable in- circuit programmer, the cheapest unit supported by the MPLab environment is the PICI “a < Component dimensioning If you have measured the diode voltage and you know the battery voltage, you don’t need to measure the current. You can simply calculate it. This is because the voltage over the resistor is the dif- ference between the battery voltage and the LED voltage (e.g. 9 V - 1 .8 V = 7.2 V). With this information you can use Ohm’s law to determine the current: l = V I R I = 7.2 V / 470 Cl 1 = 0.0153 A = 15.3 mA If you instead want to calculate the value of the series resistor, you must specify the desired current value and know the values of the supply voltage and the LED voltage. For example, suppose you want to have a current of 20 mA flow through a green LED. For practical purposes, the voltage across the LED can be taken as 2.1 V. The bat- tery voltage is 9 V, so the resistor has to produce a voltage drop of 6.9 V (9 V - 2.1 V). The calculation yields a value of 345 f 2 , but this is not a standard resistor value. However, you may be able to find a 330 Q resistor or a 390 Q resistor in your parts box. It’s a good idea to choose the higher value, since this puts you on the safe side with regard to the amount of current. R = V/I R = 6.9 V/ 0.02 A R = 345 Q You should also experiment with this circuit with various resistors having much higher resistance values. In each case, measure the LED voltage and determine the current. Generally speaking, no matter whether you operate the LED at a current of 1 mA, 5 mA or 1 0 mA, the voltage across the LED is nearly the same. This is due to the exponential shape of the characteristic curve. Series circuit It’s often useful to connect two or more LEDs in series with a com- mon series resistor, as shown in Figure 5. In this situation the volt- age across the series resistor is lower because the voltages across the LEDs add together. This means that the resistance must be reduced in order to obtain the rated 20 mA current thorough the LEDs. Suppose you are using a red LED with a forward voltage of 1 .8 V and a green LED with a forward voltage of 2.2 V. This makes the voltage across the two series LEDs exactly 4 V, so the voltage across the series resistor is only 5 V. With a 470 Q resistor you will have a current of approximately 1 0 mA. If you connect two such resistors in parallel, the current doubles. If you check the calcula- tions, you should find that the current is 21 mA. ( 120001 - 1 ) 1 Ann nj?. I (i Digits THE NEW PICOSCOPE 2205 MSO MIXED SIGNAL OSCILLOSCOPE GREAT VALUE, PORTABLE, HIGH END FEATURES AS STANDARD AND EASY TO USE c or - j Channels Resolution G bit Bandwidth Analog 25 MHz, Digital frc^jL fcnCy Digital lOQMMz rom::int'd Sampling rote 2COMS/S Tr gger modes Edge, Window, Pu se width, Window pulse width. Dropout. Window dropout. 1 nerval, Runt pulse, Digital, Logt Price £34? www.picoscopemso.co elektor 01-2012 63 REVIEW Wavelet Analysis on MikroElektronika’s PIC32 platform By Clemens Valens (Elektor France Editor) MikroElektronika, the Serbian manufacturer of development tools for microcontrollers, offers everything a PIC32 developer needs: C, PASCAL, and BASIC compilers, debugger, programmer, prototyping boards, and even application boards with colour touch-screen display. One fine morning, I found all this lot stacked on my desk with a Post-It from Father Christmas stuck on it saying “Have fun!” Sometimes, I really like my job! There were too many items for me to eval- uate them all, so I confined myself to just the following products: the mikroC PRO for PIC32 (vl .80) tool chain with C compiler, the link editor, the debugger/simulator and the PIC32 programmer, the mikroMMB for PIC3 2 (vl.01) application board, the mikroProg programmer/debugger, and the Visual TFT (v2.01 ) MMI graphic design tool. I ‘subcon- tracted’ the evaluation of the LV32MX proto- typing board to a colleague; we’ll be coming back to tell you about that in another issue. Hardware The Microchip PIC32 at the heart of the MIPS MK4is less well known that its counter- parts with a Cortex-M3 ARM core, yet they are all playing in the rather crowded field of 32-bit microcontrollers (see also the ‘Super Arduino’ arti- cle in the November 201 1 issue [1 ]). This type of pro- cessor and their applica- tion boards have become so powerful that programming them is getting closer and closer to pure computing. Soon, software development will be done directly on the boards themselves, without having to use a computer alongside. The mikroMMB board ($ 99) is a lit- tle 8 x 6 cm board, one side of which is occupied by a 320 x 240 pixel TFT touch- screen display. On the other side we find a PIC32MX460F512L processor (80 MHz, 512 KB flash + 12 KB boot flash, 32 KB RAM, USB OTG device, 4 x DMA, 2 x SPI, 2 x l 2 C, 16x1 0-bit ADC @ 1 Msample/s etc.), a WM8731SEDS stereo audio codec, a microSD card connector, an M25P80 8 Mbit serial flash memory, a power supply, and a USB port. On the long sides of the board are rows of 26 holes giving direct access to the microcontroller ports. The mikroMMB is a smaller version of the MMB for PIC32MX7 ( MultiMedia Board , $ 149) board, which has in addition an Eth- ernet port, a USB host port, and a number of LEDs and push-buttons. Visual TFT I started my evaluation with the Visual TFT tool ($ 99) in order to define the man/ machine interface for my test application. After some consideration, I decided to con- fine myself to three screens: five panes of different sizes plus four buttons; four panes of the same size and one button; one large pane with one button. And to make it look attractive, I added a screen with the Elektor logo, which appears only at start-up. Once you’ve got your ideas clear in your head, designing the screens in Visual TFT (Figurel ) is fast — the tool is quite intui- tive, especially if you have a minimum of experience of Visual Basic or Visual Studio. The num- ber of predefined controls is limited to just three types of buttons (rectangular, round, or rectangular with rounded corners), one label, and one image. There are also four graphics objects: rectan- gle, circle, or rectangle with rounded corners, and line. This isn’t very much; if you want to create more compli- cated objects, you’ll have to construct them from these basic building-blocks. It is possible to design in several layers, but before you start, do be aware that they don’t exist in the code, they are merely used for organizing the design. Each object has several modifiable proper- ties that let you customize the object. Most of the objects accept events like ‘click’ or ‘press’ (a click is a short press) produced by the MMI engine that manages the touch panel. When you have finished designing the screens, press the Generate Code button to automatically produce the source code for Figure 1 . Visual TFT lets you produce a not-too-complicated MMI quickly. Here we see a project with four different screens. 64 01-2012 elektor REVIEW the MMI in C, PASCAL, or BASIC, according to your choice. It is also possible to run the compiler from within Visual TFT. The code produced and compiled works without modification, i.e. the first screen is displayed. Of course, you can’t yet navi- gate within your application, as the con- nections haven’t yet been put in place, but the initialization of the hardware has been done. What’s more, you have the option to include calibration of the touch panel when your soft- ware is run, which can be achieved by ticking the right box under Project Settings -> Advanced Settings -> Touch Panel -> Calibration. I found the quality of the C code produced by Visual TFT a little disappointing. A whole host of global variables are defined (including one named ‘i’!), H files are not protected against multiple inclusions, and compilation produces a large number of warnings of the type: “Implicit conver- sion of int to ptr” — all this is not very tidy! But the biggest drawback is that Visual TFT is unable to handle modifica- tions made directly in the source code. The moment a program is changed outside this tool, synchronization is lost with the Visual TFT project - so you’d best not touch it at all. Let’s end this paragraph on a positive note: it is possible to separate the graph- ics resources from the source code so as to store them in an external memory such as an SD card. In this way, the appearance of the MMI can be changed without touching the program. mikroC PRO After, or from, Visual TFT, you start the inte- grated development environment (IDE) for C, PASCAL, or BASIC in order to set about programming the application. Forthis arti- cle, I coded in C in mikroC PRO ($ 299). The IDE is user-friendly, thoughtfully designed, and includes much more than a compiler, a link editor, and a debugger. In point of fact, to make life easier for the firm- ware programmer, several tools are availa- ble, such as a terminal or a bitmap editor. The programming editor allows code fold- ing, underlines undefined (or badly-writ- ten) variables, attempts to complete your ‘phrases’ automatically, and offers so-called ‘active’ comments. This feature is interest- ing, as it makes it possible to provide good documentation for a project by includ- ing documents like data sheets, drawings, and photos. Clicking the active comment opens the file in question, or just hovering the mouse pointer over the link will bring up the illustration. These documents are cop- ied into the project, so the active comments aren’t affected if you move or modify the originals. Despite this well-thought- out appearance, you sense that the IDE is not a real IDE for C. For example, a new file is called ‘Unit’ as in PASCAL or Delphi (the IDE is written in Delphi) and compilation errors and warnings are sometimes a little odd. However, the greatest inconvenience is the way libraries are han- dled. In their efforts to simplify programming, the MikroElektronika developers have gone a bit too far in doing away with the notion of stand- ard C libraries. So writing #include pro- duces a compilation error! Instead of including a standard library, you have to tick a box in the Library Manager (Figure 2). Simple enough, it’s true - but it’s also totally incompatible with all C code that’s ever been written anywhere in the galaxy. No need to point out that MikroC PRO is not ANSI. Quite apart from the “genuine C” aspects, the editor is not mature and still has a large number of bugs. The code folding doesn’t Figure 2. Here’s the mikroC PRO IDE. On the right, the library manager which replaces the standard C libraries. elektor 01-2012 65 REVIEW mikroBootloader JL IMM JL. In V II Gum Jt 1 hrm r l*t— M J *IM Ulr *31 r£_. j -k j r< i j i ir rrftnftif 5 i In Jn PC | ■ J. 1 P | *| nAn>! cpJrirfKfi - X ip- ** v** "C1L fcfrr- It j ^^3 _ f taftchrittf nulMli vi i j«in fmi rr-H 4 ran ir^imr jlT" kits IIBtl fmfi ■ m Him Wm* 1 KCl IK* ^ Lint; H»T LjCt u-vi—c*.'.'* r v%. jtmtfri mm • eTrtn^ v i rr^ni \ i i own tlh «i.bq wnMd ptawi P5CJI an-. '--ifrsav i-jbW P^J-M-jiriH I'M- LWW W'li p .‘Ifc-rK i CLSDIMh i^i Prtrrwr UniMvrt Srfr*"!*"!! *riMji Gskjs4 k «r i ■ A*m iM r ini in hsq- m J1 Mil Vitf r lk*l BTI p»tc i_M »h1«M J 4 ukwV^| C-K->= r..iji . -? f I Crti •' T-HHE- 9 iVMlKfOE(8*tfOni»8 -J-l *■ T-^ 4 IP -_n*w Kuntfnkt i c€ asm = 5 rE?¥ VCs* T-Jf V KUlHn Flai4 Hpibmit. 1 i'i tin'll fra 1 * Hm-fipr Vi RAH. I V ItaV ruciBn i Mk. 4 FiJ Sr**# -bHr taOSCi i* H»_ #4 AH : Figure 4. The mikroProg Suite utility lets you program the microcontroller. It offers many more programming options than the bootloader. Figure 3. If there is a bootloader present in the microcontroller, the mikroBootloader makes it possible to load a new executable in record time. always work properly: after folding a func- tion, double-clicking on a word (to select it, for example) places the cursor at the place where the word used to be before folding. The automatic correction can be very irri- tating, especially since it is not possible to cancel using ‘undo’. When you’re moving around within the code, the cursor does not go back to the end of the line, despite turning off a well-hidden option (Tools -> Options -> Editor Settings -> click on Advanced editor options -> click on Options tab -> maintain caret column - yes, I did find it all by myself). On my computer (Windows XP, T4200 @ 2 GHz, 4 GB RAM), scrolling using the scroll bar is jerky, especially if you try to go quickly. The automatic completion recognizes structural element references by ‘dot’ (e.g. element . structure), but not by arrow (element- >structure). The under- lining for unknown names does not rec- ognize macros defined in another file. And there are certainly bound to be other bugs I haven’t found yet. Of course, I have reported all these prob- lems to MikroElektronika, who promised they will be corrected in future versions. The IDE also lets you debug the code with- out needing additional hardware, which is very handy. In fact, it uses a simulator, but it’s also possible to debug the software in situ, i.e. directly on the board. You select the debugger in the Project Settings window, which is not necessarily on the screen. To display it, don’t go via the Project menu - you get to it, surprisingly, via View. Select Software or mikrolCD as your debugger, and Release or ICD Debug as Build Type. The debugger seems by default to stay in assembler mode. You can force it into C mode (Run menu or Alt D), but as soon as you stop the debugger in mid-flight, it goes back to assembler mode if you are unlucky enough to interrupt it within a library func- tion. So make sure you memorize the Alt D key combination, you’ll be using it a lot. The simulator is especially handy for work- ing on an algorithm that does not use a hardware peripheral, as the simulator is more responsive than the in situ debugger. However, if you come across a hardware problem, you’d do better to use the in situ debugger so as to be sure of the state of the registers. Programming using a bootloader There are two methods available for load- ing the program into the processor’s flash memory: using a bootloader, or via an external programmer. The mikroMMB board is supplied with a factory-installed bootloader, there’s a little label stuck on the display to tell you. If your board doesn’t have the bootloader, you can load it your- self, it’s available free from the MikroEle- ktronika website. On the computer side, there’s a little free utility to run called mik- roBootloader (Figure 3). The bootloader uses a USB port and appears as an HID, which has the advantage of not requiring you to install a driver for the board, as Windows takes care of it all on its own. The first time you connect the board, Windows detects it and installs the driver. On my own computer, this didn’t happen quite as it was meant to, but that’s not a problem. By disconnecting the board and then reconnecting it, mikroBootloader did end up finding it, even though Windows asked me to reboot my computer (which I refused). Then the procedure is simple: first run the mikroBootloader utility on the computer, then connect the board and press its reset button. As soon as the USB icon alongside ‘1 Wait for USB link’ goes red, click but- ton ‘2 Connect’ just below. Then you can select the file to be loaded using button 3 and start the file transfer by clicking button 4. The transfer is quite fast, ending with a window saying that everything has gone alright. Click OK to end. Repeat this whole process each time you want to update your firmware. If you know me a bit by now, you’ll already have guessed that what bothers me here is that it takes too many clicks. When you’re in the middle of developing a piece of soft- ware, you often have to reprogram the microcontroller with the same file (but modified, of course), in which case you have to go through the whole sequence of reset 66 01-2012 elektor REVIEW - connect - select file - load - OK, which soon becomes trying. For your convenience, as well as my own, I’ve suggested to Mik- roElektronika that they should simplify the procedure, and they’ve promised to look into my reguest. Watch this space... Programming via an external programmer The bootloader does not allow you to debug the software, so it may be worthwhile using the mikroProg programmer/debug- ger ($ 99) instead of the bootloader. This programmer, housed in an attractive white case, is supported by the mikroProg Suite for PIC utility (v2.1 0, Figure 4), which also lets you modify lots of parameters that are not accessible via mikroBootloader. You can use this utility on its own, or run it directly from the IDE. If you click on the Build and Program button, you won’t have to do any- thing else. To my great surprise, loading my execut- able into the microcontroller using mikro- Prog took over five times longer than with the bootloader (32 s instead of 6 s) and I haven’t found any options for speeding this up. What’s more, by default it overwrites the bootloader, so remember to enable the Boot FLASH Write Protect option in mikro- Prog Suite if you want to keep this feature. Obviously, it is possible to reprogram the bootloader using mikroProg, but then you end up overwriting the program... The programmer can power the mikroMMB board, but only at 3.3 V. In this situation, it works, but the display isn’t very bright — it’s almost black, in fact. To get better bright- ness, you can power the board via its USB port. Conclusion MikroElektronika’s collection of PIC32 tools is very comprehensive. It includes several development boards, an integrated devel- opment environment (IDE), a number of software utilities, and an in situ hardware programmer/debugger. The IDE include a C, PASCAL, or BASIC compiler and a debug- ger/simulator. All these tool are available at very affordable prices, and if you already have one MikroElektronika development tool, you’re entitled to a reduction on cer- tain others. MikroElektronika does have the advantage of making PIC32 development relatively simple and user-friendly. I managed to pro- duce the whole of my application without once having to consult the data sheet for the microcontroller or display. Any imper- fections in my application are undoubtedly my own fault. Despite all the care the manufacturer has taken with them, these products are not perfect, the mikroC PRO editor in particu- lar leaving something to be desired. Other tools like Visual TFT or mikroBootloader still have some way to go before they can become really powerful and useful. These tools still don’t come up to professional standards - but fortunately the prices aren’t at professional levels either. Note that the MikroElektronika products are intended for use with Windows only. (110729) Internet Links [1] Super Arduino : www.elektor. com/1 10661 [2] Wavelets: www.polyvalens.com [3] Source code: www.elektor.com/ 1 1 0729 [4] MikroElektronika: www.mikroe.com Let’s produce somethinq oriqinal In order to assess a tool chain properly, we need to put it to work seriously, and the best way is produce a real application. With its audio input, the graphic touch screen, its calculating power, and direct memory access (DMA), the little mikroMMB board seems ideal for building a small oscilloscope, a spectrum analyser, or even both. But that’s rather lacking in originality, don’t you think? That’s why I decided to produce something never before seen (in Elektor): a wavelet analyser... and touch-sensitive to boot (Figure 5). So what are wavelets? Before we go on, a little warning: the following is an ‘extreme simplification’ which will probably make experienced mathemati- cians frown. If you’re one of those, then I’m sorry, but I only have a few lines available here... Faithful Elektor readers will certainly already have heard about Fourier analysis of a signal. Fourier analysis makes it possible to break a signal down into an (infinite) series of sinewave signals Figure 5. The mikroMMB board connected to the mikroMMB programmer. The display is showing the test application’s second screen. Note that the board is also connected to a USB port (on left) to obtain better brightness. elektor 01-2012 67 REVIEW at different frequencies, phases, and amplitudes. This analysis makes it possible, among other things, to determine the spec- trum of a signal. This analysis, also called Fourier transform, is performed on the whole of the signal which we first have to record, but it doesn’t tell us at which moment a given frequency was present. It merely allows us to confirm that such or such frequencies were present in the signal. Several techniques have been developed to improve the temporal resolution of Fourier analysis. The simplest method is to chop the signal up into several pieces and analyse these one by one. This works quite well, but the very act of chopping it up introduces some errors. To limit the dam- age, various techniques have seen the light of day for cut- ting the signal up, but they do complicate the analysis. In this case, we speak of short-term Fourier transform. The underlying reason for the lack of temporal resolution in Fourier analysis is the signal this technique is based upon: the sinewave. (The cosine wave is a sinewave with a 90° phase shift.) Sinewaves have an infinite duration — they are not limited in time. By using another basic signal that is time limited, it’s possible to obtain an analysis with tem- poral resolution. This is where wavelets come in. “Wavelet theory”, continuous wavelet transform (CWT) to be more exact, was formulated only around 30 years ago. It is very similar to the short-term Fourier transform, where it replaces the “Fourier” sine- wave by another function, the wavelet. This function is not precisely defined, but must satisfy a certain number of criteria. It would take too long to expand here on the maths behind the wavelet transform, but take my word for it, such a function resembles a little oscillation, a little wave or wavelet. Instead of varying the frequency of the sinewave in order to scan the whole spectrum of the signal to be analysed, as in Fourier analysis, the wavelets are translated and expanded to scan the duration and spectrum of the signal to be analysed. To make this explanation a little easier to grasp, compare the signal to a build- ing. The wavelet transform now makes it possible to break down this building into bricks of identical shape, but different sizes. This basic shape is the wavelet, the size of the brick corresponds to the expansion, and its position in the building, to the translation. To make it easier to rapidly cal- culate CWT by computer, the mathematicians have devel- oped the discrete wavelet transform (DWT). It can be demonstrated - a task I shall spare you - that this transfor- mation corresponds to pass- ing the signal through a bank of constant-Q filters. Remem- ber, the quality factor Q of a filter is the ratio of the filter centre frequency to its band- width. Think, for example, of an audio equalizer where the ratio between the setting cen- tre frequencies is an octave. Figure 6 attempts to sum up the principle graphically. Several algorithms exist for calculating the DWT, but to my way of thinking, one of the most elegant is Lifting. This algorithm makes it pos- sible to use any wavelet with- out modifying the heart of the transformation algorithm, and in addition, to re-use the same algorithm for the inverse transformation. Are you finding this all a bit abstract? Well, just remember thattheJPEG2000 image com- pression standard is based on wavelets and the Lifting algo- rithm. Wavelets are very effec- tive in data compression. The test application There, now you have a (vague) idea what a wavelet is, let’s move right along to the three- screen application that is going to let you find out a bit more about these mysterious functions. The first screen displays the input signal and the breakdown of it Figure 6. Graphical representation of one-dimensional discrete wavelet transform. The signals (with their labels) Signal and LI -L4 are reproduced on the test application screens. A: input signal; B: spectrum of the input signal; C: discrete wavelet transform visualized as an iterative bank of filters; D: spectrum of the constant-Q filter bank. 68 01-2012 elektor REVIEW into wavelets on four levels (see Figures 6 & 7). There are also four buttons that let us choose between four different wavelets. The screen title indicates the wavelet being used. When you press on one of the windows, you move on to another screen. Pressing on the Signal window opens the third screen where you can examine the signal more closely. Touching one of the bottom four windows opens the second screen. This second screen shows four windows. The top left-hand one shows the input signal, the bottom left-hand one displays the contents of the window that brought us to this screen (also shown in the screen title). The right- hand windows show the wave- let (top) and its scale function (bottom). These two graphs are obtained by calculating the inverse of the wavelet transfor- mation of a pulse. As you’ve understood everything just fine up till now, I’m sure you’ll have guessed that we’re in fact dealing here with the pulse responses of filters L4 and L3 (or L2 or LI , since they’re iden- tical) from Figure 6! Touching one of the four win- dows makes it possible to study the signal displayed in more detail on the third screen. The Back button takes you back to the first screen. And lastly, the third screen shows a single signal in close-up; the title gives its name. The Back button takes you back to the first screen. The input signal is a recording of an electrocardiogram found on the Internet. This type of signal if often analysed using wavelets. Producing a proper analogue input for capturing your own sig- nals - now there’s a good exercise that we’re going to leave up to the reader. Four wavelet are accessible via the four buttons on the first screen. In the source code, you’ll find other wavelets, in particu- lar, some variants on the Cohen - Daubechies - Feauveau (CDF) family. It’s easy to attach them to the buttons - see how to do this in the screen2.c file. The four wavelets I’ve chosen as defaults give a good illustration of the variations possible in the forms of the wavelets. Personally, I’m very keen on the Daubechies-4 (D4) for its irregular form. Note that this wavelet possesses fractal properties. As indicated above, the algo- rithm for calculating the wavelet transform is based on the Lifting technique. I don’t have enough space here to explain in detail how it works, but you can find fuller details from [2]. The special feature of Lifting is that if it is executed in reverse, it calculates the inverse wavelet transform. This makes it possible very simply to check the form of the wavelet (see above). The algorithm is implemented in the file fltw.c (Fast Lifting Wavelet Transform), the wavelets are in the wavelets.cfile. The test application source code is available from [3]. l D wawlct decomposition Signal L4 L3 L2 LI HikU CDf S/3 CDF 9/7 DD4 Figure 7. The correspondence between the signals in Figure 6 and the five window of the first screen (not counting the intro screen). Advertisement EURO CIRCUITS The European reference for PCB prototypes & small series www.eurocircuits.com elektor 01-2012 69 TEST & MEASUREMENT Time / Interval Meter with ATtiny ; Vladimir Mitrovic (Croatia) This project goes to show what little hard- ware is sufficient to build a versatile Time and Interval Meter with a user-friendly LCD readout. An AVR microcontroller type ATtiny2313 measures the time interval between two consecutive logic level tran- sitions of pulses applied to input pins PD2 and PD3. In the ps (microseconds) range, time intervals from 1 0 ps to 30 minutes (!) can be measured with a resolution of 1 ps. In the ms range, the available range is 1 ms to four hours at 1 ms resolution. In the circuit, DIP switch block S2 deter- mines the settings of the instrument, as follows: S2 1 -8: selects pulse edge (Rising or Falling) starting the measurement. S2 2-7: selects pulse edge (Rising or Falling) halting the measurement S2 3-6: measurement unit and resolution (psorms) S2 4-5: measurement mode (Continuous or Oneshot/Hold) See Table 1 fora detailed explanation of the configuration switch functions and options. The measured time is displayed on an LC display with two rows of 16 characters. The first row shows the selected time inter- val, the measuring unit and the measuring mode, the second, measured time. LED D4 is on during the measurement and off between two measuring intervals, as well as during the Hold period. Its main pur- pose is to show that ‘something is happen- ing’ during long meas- uring periods. If you want you can omit the LED and R5. In the ps range, the 8-bit Timer/ CounterO inside the ATtiny2313 is set to Normal mode with Compare Match out- put B activated, and counts the prescaled system clock pulses. As an 8-MHz quartz crystal is used and the prescaler divisor is set to 8, Timer/ CounterO increments by 1 each ps. Output Com- pare Register B is set to 255 which toggles the Output Compare pin (OCOB) every 256th pulse. OCOB pin is internally connected to the Timer/Counterl input, and the Timer/ Counterl counts these pulses on the OCOB pin in a 1 6-bit resolution. This way we get a 25-bit hardware counter (1 6-bit T/C1 +OCOB bit + 8-bit T/CO). An additional 6 bits worth of resolution is realised in software. During the measure- ment the program runs in a loop, waiting for the flag to stop the measurement and constantly pooling the Timer/Counterl Overflow Flag, TOV1. If TOV1 is set, the program increments the 6-bit SW counter by 1 and clears TOV1 . No interrupt is used here because it could delay the recognition of the Stop condition. A 31 -bit coun- ter can count up to 2,147,483,647 ps. For practical reasons, 1,800,000,000 ps (30 minutes) is taken as the maximum meas- uring time in the ps range. The ms range is realised in more or less the same way, except that the system clock is prescaled by the division fac- tor 8. After the measurement the result is divided by 1 25, giving the maximum value of 17,179,869 ms. For practical reasons, 1 4,400,000 ms (four hours) is taken as the maximum measuring time in the ms range. The measuring starts when a falling or rising edge is recognized at ATtiny pin PD2 (the triggering slope depends on the setting of S2 1-8), whereupon external interrupt vec- tor INTO is executed. The measuring stops when a falling or rising edge is recognised at pin PD3 (the triggering slope depending on the setting of S2 2-7) whereupon external interrupt vector INTI is executed. The program developed for the project is a free download from [1 ]. It is written in Bas- comAVR, with embedded assembler code for interrupt and other time-critical routines inserted. In the main loop, the program Table i. S21-8 S2 2-7 S2 3-6 S24-5 Measured time interval off off X X From falling edge to the next falling edge. off on X X From falling edge to rising edge (time interval between two positive pulses). on off X X From rising edge to falling edge (duration of positive pulse). on on X X From rising edge to the next rising edge. X X on X Measurement in ps (t(min)=1 Ops, t(max)=1 800s (30m)). X X off X Measurement in ms (t(min)=1 ms, t(max)=1 4400s (4h)). X X X off Measures continuously: when one measurement is finished and the result is displayed, a new measurement is started. X X X on Just one measurement: when one measurement is finished and the result displayed, the program holds. (x = don’t care) 70 01-2012 elektor TEST & MEASUREMENT LCD1 repeatedly monitors the switches in S2, initiates a measurement and displays the result. If any change in the switch settings compared to the previous reading occurs, the new measuring range, mode and/or starting/stopping slopes are determined and the first line on the display is updated. At the beginning of the measurement rou- tine, Timer/Counter counting registers and the software counting register (for bits 26-31) are cleared, OCOB bit is reset and the external interrupt INTO is enabled. After that, the program loops, waiting for the INTO interrupt to occur which will trig- ger the INTO interrupt routine. In this rou- tine, the Timer/CounterO is started, some counters are set to initial values, LED D3 is switched on, INTO interrupt is disabled to disable retriggering and INTI interrupt is enabled instead. The program continues to loop, waiting forthe INTI interruptto occur which will trigger the INTI interrupt rou- tine. In this routine, the Timer/CounterO is stopped and further external interrupts are disabled. Timer/Counterl is started at the beginning of the program and there is no need to stop and restart it during the program execu- tion: as it counts the pulses from the Timer/ CounterO, it will be started and stopped simultaneously. A measurement is finished when the meas- uring routine senses that both external interrupts are disabled. The result is col- lected from the hardware (HW) and soft- ware (SW) registers, LED D3 is switched off, some calculations are done and the meas- ured time interval is displayed on the lower display line. On accuracy, the HW part of the coun- ter counts the clock pulses and there is no possibility of false counting. The SW coun- ter extension counts the Timer/Counterl overflows with a few cycles delay. However, when the timers are stopped, the SW part of the counter is synchronised with its HW part. The INTO and INTI interrupt routines have been written very carefully, and there is exactly the same delay from the start of the routines to the instant Timer/Coun- terO is started in one, and stopped in the other routine. There is a small delay from the instant the external interrupt is trig- gered to the instant the interrupt routine starts to execute. The duration of this delay depends on the instruction that was execut- ing the moment the interrupt is triggered. Instructions execute in 1-4 clock cycles, so the difference can be up to 3 clock cycles. But, as Timer/CounterO counts the system clock divided by 8, this will cause a ±1 error on the last digit only in both ranges (ps and ms). So, the only factor that significantly influences the overall accuracy is the crys- tal accuracy - consider that when you see ‘t = 1 23456789 ps’ on the display. The second thing to be considered is meas- uring time, which can last for hours in the ms range. Therefore, a special SW counter is enabled during the waiting loops (there are two waiting loops during the measur- ing: wait for the Start signal and wait for the Stop signal). This counter counts up to the defined maximum measuring time and, if it elapses, stops further measuring and dis- plays ‘t > 1 4400000’. Initially, the maximum measuring times are set to maximum per- missible values, i.e. 30 minutes in the ps range and four hours in the ms range. Like the other switches, S2 4-5 is read before the measuring starts. However, the program acts in a different manner if this switch is closed (and the oneshot/hold mode is activated): The maximum measuring time counter is blocked while waiting for the Start signal, but it is enabled again while waiting forthe Stop signal (allowing indefinite waiting time for a non-repetitive pulse to occur, although the pulse duration is still limited to the max measuring time). When the result is displayed, the program waits in a loop, constantly monitoring S2 4-5 and continues as soon as the switch is opened. The program Tmeter_Elel FTDI specialise in USB silicon, hardware and software solutions. • USB WFIQL 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 s mirrh# satisfy your I I III IJ iy inner geek geek a fresh approach Cool portable electronic projects and kits TO BOOK YOUR SHOWCASE SPACE CONTACT ELEKTOR INTERNATIONAL MEDIA www.mintygeek.com WWW. elektor. Tel. 0031 (0) 46 4389444 Fax 0031 (0)46 4370161 com 78 01-2012 elektor products and services directory MaxSonar Ultrasonic Range Finder XL-MaxSona r-EZ * Beam pattern choice * High acoustic power * Real-time calibration * 39.95USD / unit MaxSonar-WRC IP67 * Compact packaging 4 Quality narrow beam * SSL95USD/ unit www .active-ro bot . co. u k www. cool com pon en ts .co .uk www .ocean control s. co m . au www. maxbotix .com WWW. elektor. com ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensoi • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers TO BOOK YOUR SHOWCASE SPACE CONTACT ELEKTOR INTERNATIONAL MEDIA Tel. 0031 (0) 46 4389444 Fax 0031 (0) 46 43701 61 ■X, St '■ff R0B0TIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! Now, available in time for X-mas • Arduino Starter Kits *NEW!!* • Lego NXT Mindstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • P0B Robots (kits and components) email: sales@robotiq.co.uk Tel: 020 8669 0769 TYDER http://www.tyder.com • ONEoverT Digital Filter Design Software (Full version for only £30) • Design FIRs, HRs, NCOs, FFTs for DSPs and FPGAs • VHDL Code Generators • Makes DSP design simple • Download demos from website dsPIC/PIC24-Bundle Advantageous hardware/software solution for rapid project development This solution is perfect for anyone wanting to develop systems based around Microchip’s powerful 16 bit core products. The pack is supplied with a dsPIC30F2011 device, and is fully compatible with the full range of E-block boards and accessories. Datasheets on each individual item are available separately. Contents: • Flowcode 4 for dsPIC/PIC24 (Professional Version) • USB dsPIC/PIC24 Microcontroller Multiprogrammer • LCD Board • LED Board m • Switch Board • Plug top power supply • USB cable Bundle Price: Only £299.00 Order now at www.elektor.com/dspic-bundle 15% DISCOUNT to the sum of the individual parts! elektor 01-2012 79 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Going Strong A world of electronics from a single shop! USB Long-Term Weather Logger (September 201 1) Tirne/C'iv lOOmsjlJ WWW ^Options View Hi* Transient Recorder jciHoscope /oits/Diy \ I [“ajMjL j 20mV \\ 1 '^'L. jrilV ^J __ - Position fiw* For alpha, beta and gamma radiation Improved Radiation Meter (November 201 1) This device can be used with different sensors to measure gamma and alpha radiation. It is par- ticularly suitable for long-term measurements and for examining weakly radioactive samples. The photodiode has a smaller sensitive area than a Geiger-Muller tube and so has a lower back- ground count rate, which in turn means that the radiation from a small sample is easier to detect against the background. A further advantage of a semiconductor sensor is that is offers the pos- sibility of measuring the energy of each particle, allowing a more detailed investigation of the characteristics of a sample. The optional PC-based software displays the energy spectrum, per- mitting a very detailed analysis to be carried out. Kit of parts incl. display and programmed controller Art.# 11 0538-71 • £35.50 • $57.30 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 Audio DSP Course (September 201 1) This DSP board is the platform for the applications described in our Audio DSP Course. It is also intended to enable you to develop your own initial digital audio signal processing applications. The DSP board can be used stand-alone as is, and even though it is an ideal learning plat- form, with its 24-bit signal processing capability for sampling rates up to 1 92 kHz and its high-performance inter- faces, it is also suitable for applications with very stringent quality requirements for both signal to noise ratio and DSP computing power. Populated and tested DSP board Art.# 11 0001 -91 • £115.70 • US$186.70 8o Prices and item descriptions subject to change. E. & O.E 01-2012 elektor 31 1 Circuits Creative solutions for all areas of electronics 31) Circuits 31 1 Circuits is the twelfth volume in Elek- tor’s renowned 30x series. This book con- tains circuits, design ideas, tips and tricks from all areas of electronics: audio & video, computers & microcontrollers, radio, hob- by & modelling, home & garden, power supplies & batteries, test & measurement, software, not forgetting a section ‘miscel- laneous’ for everything that doesn’t fit in one of the other categories. 31 1 Circuits of- fers many complete solutions as well as useful starting points for your own projects. 420 pages • ISBN 978-1-907920-08-0 £29.50 • US$47.60 Mastering the l 2 C Bus Vncinfc H-mp-a G3 lftlttw tab WotX 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 that allow 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 from your computer. 248 pages • ISBN 978-0-905705-98-9 £29.50 • US$47.60 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 USB webcam. All this is linked together by Linux. This book will serve up the basics of setting upa Linuxenvironment- including a software development environment - 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 enhance- ments include 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 of your house and outbuildings. Now you can additionally also send all kinds of useful temperature and sensor warnings to a mobile phone. All software needed will be available at the Elektor website. 41 6 pages • ISBN 978-1-907920-02-8 £34.50 • US$55.70 V J ' 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 A Controller Area Network — — Projects / *«> - I 4 «*P " _ •&i % 0 lector S 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 microcontrol- ler 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 howto build microcon- troller hardware and interface it to LEDs, LCDs, and A/D converters. 260 pages • ISBN 978-1-907920-04-2 £29.50 • US $47.60 Talk with your computer Design your own PC Voice Control System 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, tell you the time, checkyour share values, get the weather forecast, 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, then this book is your guide! 216 pages • ISBN 978-1-907920-07-3 £29.50 • US $47.60 elektor 01-2012 81 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES A highly-practical guide Linux - PC -based Measurement Electronics If you want to learn howto quickly build Linux-based applications able to collect, process and display data on a PC from va- rious analog and digital sensors, howto control circuitry attached to a computer, then even howto pass data via a network or control your embedded system wire- lessly and more -then this is the bookfor you! Circuits, ideas, tips and tricks from Elektor cd 1001 Circuits This CD-ROM contains more than 1 000 cir- cuits, ideas, tips and tricks from the Sum- mer Circuits 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 & microcontrol- ler, hobby & modelling, home & garden, high frequency, power supply, robotics, test & measurement and of course a sec- tion miscellaneous for everything that didn’t fit in one of the other sections. 264 pages • ISBN 978-1-907920-03-5 £29.50 • US $47.60 ISBN 978-1 -907920-06-6 £34.50 • US $55.70 Introduction to Engineering 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 engineering. Examples 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 contains examples of PIC, PLC, PACand PC programming. More than 70,000 components cd Elektor’s Components Database 6 This CD-ROM gives you easy access to de- sign data for over 7,800 ICs, more than 35,600 transistors, FETs, thyristors and tri- acs,justunder25,000diodesand 1,800op- tocouplers.The program package consists of eight databanks covering ICs, transistors, diodes and optocouplers. A further eleven applications cover the calculation of, forex- ample, zener diode series resistors, voltage regulators, voltage dividers and AMV’s. A colour band decoder is included for deter- mining resistor and inductorvalues. All da- tabank applications are fully interactive, allowing the user to add, edit and complete component data. 164 pages • ISBN 978-0-905705-99-6 £27.50 • US $44.40 ISBN 978-90-5381 -258-7 £24.90 • US $40.20 KFiu, NFL, zigbee, UPS and more dvd Wireless Toolbox On this DVD-ROM you’ll find a number of technical documents and tools that will en- able you to add wireless data exchange to your electronics systems. The choice of equipment depends on the transmission distance: a few centimetres using Near Field Communication (NFC) or Radio Frequency Identification (RFID), tens of metres with the Bluetooth, Wi-Fi orZigBee systems, or indeed thousands of kilometres using a module for receiving GPS data. The DVD contains technical documentation (spec, sheets, application notes, user guides, etc.) on various devices according to the frequency and/or protocol used. All of the documents are PDF files (in English). ISBN 978-90-5381 -268-6 £28.50 • US$46.00 1 1 0 issues, more than 2,1 00 articles dvd Elektor 1990 through 1999 This DVD-ROM contains the full range of 1990-1 999 volumes (all 1 10 issues) of Elek- tor Electronics magazine (PDF). The more than 2,1 00 separate articles have been clas- sified chronologically by their dates of pub- lication (month/year), but are also listed alphabetically by topic. A comprehensive in- dex enables you to search the entire DVD. ISBN 978-0-905705-76-7 £69.00 • US$111.30 82 Prices and item descriptions subject to change. E. &O.E 01-2012 elektor January 201 2 (No. 421 ) £ us$ + + + Product Shortlist January: See www.elektor.com + + + December 2011 (No. 420) Here comes the Bus! (1 0) 110258-1 Experimental Node board 5.30... 8.60 1 1 0258-1 C3 .. 3 pcs Experimental Node board ...11.50... ....18.60 1 1 0258-91 .... USB/RS485 Converter, ready made module ...22.20... ....35.90 USB Data Logger 110409-1 Printed circuit board 9.75... ....15.70 1 1 0409-41 .... Programmed controller PIC24FJ64GB002-l/sp dil-28s1 3.30... 21.40 November 2011 (No. 41 9) Improved Radiation Meter 110538-41 .... Programmed controller ATmega88PA-PU 9.35... 15.10 110538-71 .... Kit of parts incl. display and programmed controller ...35.50... ....57.30 Simple Bat Detector 110550-1 PCB, bare 8.85... ....14.30 OnCE/JTAG Interface 1 1 0534-91 .... Programmer board, assembled and tested ...35.60... 57.30 Here comes the Bus! (9) 110258-1 Experimental Node board 5.30... 8.60 1 1 0258-1 C3 .. Printed circuit board 3x print Experimental Node .. ...11.50... ....18.60 1 1 0258-91 .... USB/RS485 Converter, ready made module ...22.20... ....35.90 Dual Linear PSU for Model Aircraft 081064-1 Printed circuit board 14.50 23.80 October 2011 (No. 41 8) Versatile Board for AVR Microcontroller Circuits 1 00892-1 Printed circuit board 1 1 .55 1 8.70 Audio DSP Course (4) 1 1 0001-91 .... PCB, populated and tested DSP board 1 1 5.70 1 86.70 1 1 0001-92 .... Bundle DSP board (1 1 0001 -92) with Programmer (1 1 0534-91 ) 1 33.50 21 5.00 Here comes the Bus! (8) 1 1 0258-1 Experimental Node board 5.30 8.60 1 1 0258-1 C3 .. Printed circuit board Experimental Nodes (3 PCBs).... 1 1 .50 1 8.60 1 1 0258-91 .... USB/RS485 Converter, ready made module 22.20 35.90 September 2011 (No. 41 7) eC-Reflow-Mate 100447-91 .... Professional SMT reflow oven 2 170. 00. ..3495. 00 USB Long-Term Weather Logger 100888-1 .Printed circuit board ....16.00 100888-41 ... . Programmed controller ATMEGA88-20PU 8.85 100888-71 ... . HH10D humidity sensormodule 7.10 100888-72... . HP03SA air pressure sensor module 5.75 100888-73... . Kit of parts incl. PCB, controller, humidity sensor and air pressure sensor modules ....31.10 I 2 C Sensors 100888-71 ... . HH10D humidity sensormodule 7.10 100888-72... . HP03SA air pressure sensor module 5.75 E-Blocks go Twitter EB003 . E-blocks Sensor board ....21.60 EB005 .E-blocks LCD board ....24.00 EB006 . E-blocks PIC Multiprogrammer .... 72.00 EB007 . E-blocks Switch board ....14.40 EB059 . E-blocks Servo board ....14.40 EB069 . E-blocks Wireless LAN board ..132.00 TEDSSI4 . Flowcode4fordsPIC/PIC24 .. 178.80 FT232R USB/Serial Bridge/BOB 110553-91 ... . PCB, assembled and tested ....12.90 ..25.90 ..14.30 ..11.50 ....9.30 ..50.20 ..11.50 ....9.30 ..34.90 ..38.80 116.20 ..23.30 ..23.30 212.90 288.40 ..20.90 Here Comes the Bus! (7) 1 1 0258-1 Experimental Node board, bare 5.30.... 8.60 1 1 0258-1 C3 .. 3 x Experimental Node board, bare 11.50.... ....18.60 1 1 0258-91 .... USB/RS485 Converter, ready made module 22.20.... ....35.90 Bestsellers ^ 311 rimiifc ^ O o CO 0 Q£ 1 O Q Q U od V/) o 31 1 Circuits ISBN 978-1 -907920-08-0.... £29.50 US $47.60 Controller Area Network Projects ISBN 978-1 -907920-04-2 .... £29.50 US $47.60 Design your own PC Voice Control System ISBN 978-1 -907920-07-3 .... £29.50 US $47.60 Linux - PC-based measurement electronics ISBN 978-1 -907920-03-5 .... £29.50 US $47.60 Mastering the l 2 C Bus ISBN 978-0-905705-98-9.... £29.50 US $47.60 CD 1001 Circuits ISBN 978-1 -907920-06-6.... £34.50 US $55.70 DVD Elektor 1 990 through 1 999 ISBN 978-0-905705-76-7 .... £69.00 ...US $1 1 1 .30 CD Elektor’s Components Database 6 ISBN 978-90-5381 -258-7 .... £24.90 US $40.20 DVD Elektor 2010 ISBN 978-90-5381 -267-9.... £23.50 US $37.90 TM18 Collection ISBN 978-0-905705-92-7.... £24.50 US $39.60 Improved Radiation Meter Art. # 1 1 0538-71 £35.50 US $57.30 FT232R USB/Serial Bridge/BOB Art. # 1 1 0553-91 £1 2.90 US $20.90 USB Long-Term Weather Logger Art. # 1 00888-73 £31.10 US $50.20 Audio DSP Board + Programmer Art. # 1 1 0001 -92 £1 33.50 ...US $21 5.00 Pico C Meter Art. # 1 00823-71 £73.40 ...US $1 1 8.40^ Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH • United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: order@elektor.com elektor 01-2012 83 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR Sky Light Meter This project involves a sensor array with a dedicated data recording system, designed to measure sky light intensity in five directions. Although the device was originally designed to record celestial light at the time of eclipses, it should have wider application areas since temperature and humidity values are also measured. We used programmable light sen- sors type TSL230 cleverly controlled by a PIC controller type 18F4455. Enhanced Pico-C Meter Our Pico-C-Meter originally published in the April 2011 edition is a very handy and compact instrument capable of quickly and accurate capacitance measurements up to 2 nF with a resolution of 0.1 pF. Thanks to rewritten software it’s now possible to properly extend the range at both sides, now boasting 0.01 pF to 500 nF. Moreover, the circuit can double as a signal generator. With some modifications, it’s even possible to add an input for period and frequency measurements. For the latter version a new PCB layout was designed. Lambda Probe RS232 Interfacing The interface for broadband lambda probes described in this article enables accurate measurement of the oxygen content of combustion gases, all without any kind of adjust- ment. By way of an RS232 connection to the interface board, all the diagnostic capabilities of the CJ125 sensor are used, while all data and operating status information of the circuit can be read in detail. Next month we describe the RS232 commands that allow the various settings to be made. Article titles and magazine contents subject to change; please check the Magazine tab on www.elektor.com Elektor UK/European February 2012 edition: on sale January 79, 2077. Elektor USA February 2012 edition: published January 16, 2011. w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor.com wv Elektor on the web 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 S 4 l| All magazine articles back to volume 2000 are available individually in pdf format against e-credits. Article summaries and compo- nent lists (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 search for items and references across the entire website. EAGLE PCS Software ii'.'in a license JJt LJLP - eampfrtitinrt xhrlwK lump ynblKr-h* C'»h *"1 »;■ =■- ■ Pn. h.KV Jw .'SI J eftftUTCcfct iri iMf 1C L j-C-rd AuC#* ■W } ticUM ."i: r, P ,ti U*f UtfT 5 EULM* cvTvrr v ■ u U ETI U SB, 1J «“B1 m t-t a ti Xmujtca LuraJng I m ■ swc-r enet! 1 40 f ira /CW DKiDWJ'rr Pffligr Jiumlnij Eir bfdrffrd PIC MkMKBrrtwfltfs H’.'f O 3 riikiaf Product! Idr £44.00 *>KSu'ai ll» M m Z D B- u tub. JZi i-» g mi;jr w nn s-« gf fteciuMi, B-a fthhf ■'itO Cwmlnqi 11-4 DISCOUNT 'Iff LSH-J'I i’ti plailerm to r FREE rt EBIhfiP Lh-l'i build 1—1. . ^1 .-.-..t . >.4 84 oi-20i2e lektor Price each Qty. Total Order Code Description 31 1 Circuits £29.50 Design your own PC Voice Control System £29.50 Controller Area Network Projects £29.50 LabWorX - Mastering the PC Bus £29.50 Linux - PC-based Measurement Electronics £29.50 CD 1001 Circuits £34.50 Sub-total P&P Prices and item descriptions subject to change. The publishers reserve the right to change prices without prior notification. Prices and item descriptions Total paid shown here supersede those in previous issues. E. & O.E. METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) n visa □ EUROCARD MasterCard Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Reg us Brentford 1 000 Great West Road Name Address + Post code Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com order@elektor.com Tel. Email Date Signature EL01 *USA and Canada residents should use $ prices, and send the order form to: Elektor US PO Box 1 80 Vernon CT 06066 USA Phone: 860-875-2199 Fax: 860-871-0411 E-mail: order@elektor.com Yes, I am taking out an annual subscription to Elektor and receive the E-book Microcontroller Basics totally free! (Please fill in your emailaddress below) I would like: Standard Subscription (1 1 issues) I I Subscription-Plus (1 1 issues plus the Elektor Volume 201 1 DVD-ROM + exclusive access to www.elektor-plus.com ) * Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer j Cheque (UK-resident customers ONLY) n visa □ EUROCARD MasterCard Expiry date: Verification code: Please send this order form to 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. e I e kto r. co m 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. 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BIC: 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 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 1 0% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsi- bility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party adver- tisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for 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 2012 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION United Kingdom & Ireland Standard £54.00 Plus £66.50 Surface Mail Rest of the World £68.50 £81.00 Airmail Rest of the World £86.00 £98.50 USA & Canada | Seewww.elektor.com/usaforspecialoffers | 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 . BIC: 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 studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs £43.20, a Student Subscription-Plus costs £55.70 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twenty-five per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 2012 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 e weekly l*c^M i-ir- , Aslaj-: i traxUtNief. riHiwCit::' na ikif yf 1 1 ii I’drLi riS-~ r ■ rfci LL. s!J i ts_: i ■=! c:: c la: irarar "■r.ee,-; liTi^snin *x iifeiifrfi . aiii cpmplgBgf5.lt ns: ®idlr«Krw l mm video Eiipi: ciiaicCCcsi ‘ r *' #" 1 '"1 *- !■*•* SW I-"*- |fT* #■¥ ffc" I tW'V*-W *1 # 1 ^ 1 ' e-t rv^rT “cm pvt -.-i+ rnp r-n t“ ■F^-r^r- _,- i r'-si i - : nscratLc ss >«r dftausiE 'E*e a- b*e I 1 ** c* Efc rca^-a. f^E i.f^S fflWE f W e .m Jft is. M4P-I iV**- ■V^ M ‘-Ht Mkiw Ironi llrhlw; DVD ^udit? O^lctlk'ii. Vol, 2 ~of • "ini ” b«ih itr ijan i v’tjhf DM~ r -t— “ ' ip t-tj— I rp 1 ii Register today on www.elektor.com/newsletter Elektor App for iPhone and iPad 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 !Cs - NE 555 circuit design - An Ohms Law calculator - Schematic Diagrams - Number base converter - LED / resistor calculation - R/Land BJT calculations - And more Now available from the Apple ff unes store foriustSS. 991^991 Further information at www.elektor.com /.app Index of Advertisers AudioXpress BAEC, Showcase Beta Layout CS Technology, Showcase DesignSpark chipKIT™ Challenge Easysync, Showcase Elnec, Showcase Eurocircuits EzPCB/Beijing Draco Electronics Ltd First Technology Transfer Ltd, Showcase . . . FlexiPanel Ltd, Showcase Future Technology Devices, Showcase Flameg, Showcase FlexWax Ltd, Showcase Jackaltac www.cc-webshop.com 42 http://baec. tripod, com/ 78 www.pcb-pool.com 23 , 78 www.cstech.co.uk/picdemo 78 www.chipkitchallenge.com 2 www. easysync- ltd. com 78 www.elnec.com 78 www.eurocircuits.com 69 www.v-module.com 23 www.ftt.co.uk 78 www.flexipanel.com 78 www. ftdichip. com 78 www.hameg.com 78 i/i/i/i/i/i/./?exi/i/ax.com 78 www.jackaltac.com 11 Labcenter Maxbotix, Showcase MikroElektronika Minty Geek, Showcase Pico Technology Quasar Electronics Robot Electronics, Showcase Robotiq, Showcase Showcase Toroidy Tyder, Showcase www.labcenter.com 88 www.maxbotix.com 79 www.mikro.com 3 www.mintygeek.com 78 www.picotech.com 19 www.guasarelectronics.com 15 www.robot-electronics.co.uk 79 www.robotig.co.uk 79 78, 79 www.toroidy.pl 23 i/i/i/i/i/i/Tytfe/:com 79 Advertising space for the issue 21 February 2012 may be reserved not later than 24 January 2012 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 01-2012 87 WITH PROTEUS PCB DESIGN Our completely new manual router makes placing tracks quick and intuitive. During track placement the route will follow the mouse wherever possible and will intelligently move around obstacles while obeying the design rules. All versions of Proteus also include an integrated world class shape based auto-router as standard. PROTEUS DESIGIM 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. Prices start from just £150 exc. VAT & delivery www.labcenter.com 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 01756 753440 for more details