September 2010 AUSS 13.90 - NZ$16.90 - SAR 99.95 £4.65 focus on circuit simulation www.elekt Digital M u It i - Effects Unit 1 5 configurable sound effects The Elektor DSP Radio (2) Antennas and PC Software Give your projects simple grace with the Elektor Project Case + Audio DSP Kickoff + Unilab V/l Display Vision System for small microcontrollers 9 770260 45115 9 R38 09 MULTIFUNCTIONAL, JUST AS IT IS fCTlUlTY COLOR DISPLAY TOUCH W SENSITIVE ACCEL ON-BOARD DEMO mtllfeklrimika miHrp mrew*oma ZlG&EE MODULI 10UCHSCRIIN SUPPOSED POWERED BY PIC32®MX460F512L PIC32MX4 MultiMedia Board PIC32®MX4 MultiMedia Board is a compact development system used for developing advanced embedded applications with Microchip's PIC32®MX4 devices. Numerous built-in modules such as TFT Color Display 320x240 with Touch Screen, Stereo Codec, Accelerometer, Serial Flash, Serial ROM and many others are provided on the board. AY TO CREATE YOUR OWN MULTIMEDIA DEVICE MK7 COMING SOON! NlikroElektronika ^ J DEVELOPMENT TOOLS I COMPILERS I BOOKS W £■ iV pi ■# ■ i» GET IT NOW www.mikroe.com ACKS The RS EDP. No other platform can make your concepts fly quicker. EMBEDDED DEVELOPMENT PLATFORM rswww.com/edp 08457 201201 Nl abV^v'v in the 2008 Summer Circuits edition. It turned ou: a massive success with thousands of readers participa- ting. In this September 2010 edition we once again roll out our unique sweepstake! The hidden number on the scraichcard on the opposite page may win you a HAME6 Elektor’s first scratch -and -win lottery was presented Hiviu;i524 uscmoscope + accessories worm ur a multimeter, a pipe & wire locator, or maybe one of the ten fantastic development kits from Microchip! Elektor editors have been on the phone with their con- tacts in the trade and industry to request sponsorship for this special event. The response was overwhelming. For example, National Instruments put a LabVIEW Base Development System worth £1,100 at our disposal while Glyn/Renesas came up with two RX/Carrera Evolution Starterkits and MikroElektronika with some awesome development systems. Pico obliged by allowing us to give away a PicoScope 2205 worth £290. Eiektor themselves added a little something to the stock of prizes: a complete Elektor Sceptre hardware bundle valued at £236! This bundle contains the 32-bit ARM7 fast prototyping system and the associated (nterSceptre extension board and Bluetooth module. What’s more, the R32C Web Server module is also in this package. Also from the publishers are packs of E-credits and a number of vouchers that allow you select your own prize from the Elektor Shop. ■ Ir lil lb I J "at.i ■■■ vr.rr* ■ p-*-, ifefe ■ -*-> - r»* ■» — Sr* re rsz ki - VGA - NX- The main prize Join in and win the award-winning HAMEG type HM03524 mixed-signal oscilloscope. This 4-channel digital oscilloscope has an input bandwidth of 350 MHz and a sampling rate of 4 Gsamples/s providing extensive trigger capabilities and very low noise A/D converters to meet the highest professional standards. Measured signals are displayed on a large and bright 6.5-inch colour TFT display with LED backlight and a VGA resolution of 640 x 480 pixels. The ‘scope comes with the HOOIO accessories bundle (l 2 C software, SRI, UART/RS-232 triggering and decoding) and H03516 (active 16-channel logic probe), which is normally available as an optional extra. Various Development Kits from Microchip with a total value of £725 (€ 860) I Nl LabVIEW Base Development System worth £1,100 (€ 1,300) PicoScope 2205 PC oscilloscope worth £290 (€ 345} 39 , 9.95 Everyone’s a winnc 1 0 E-credits awarded to each participant! oscope Winning was never easier. Before 30 September 2010, scratch to reveal your personal code and go to the Elektor website. On the website, answer the (very) simple question about electronics and then enter your code. Just four steps to a fantastic prize! Wain prizes worth in excess of £ 9,000 1. Scratch to reveal your personal code 2. Go to www.elektor.com/win 3. Answer a simple question 4. Enter your code and win Initial corcdilions for participation Sweepstake not open to employees of Elektor International Media, its business partners and/or associated publishing houses. No cash equivalent in lieu of prize(s). Legal action and correspondence barred. Lottery subject to acceptance of terms. Sweepstake closes on 30 September 2010. I RX- Carrera Evolution " I'* Various MikroElektronika AVR from Glyn/Renesas ‘ ’’ i and PIC Development Systems : £280 (€ 330) each ' v " ' ' '• i: ” •' ' j worth £92 (€110) each Digital Multimeter from Conrad worth £125 (€150) Bosch PDO Multi pipe & wire locator worth £75 (€ 90) a complete overview of the A bit more on simulation! In this edition, in accordance with our 2010 Publishing Plan, we pay special attention to the issue of electronics simulation. Simulation programs for the PC have been around for decades and in all that time they've become increas- ingly sophisticated and 'realistic'. But they're not the easiest programs to han- dle — you have to Invest quite some time before you feel confident using them at any level* That Is the main reason why many designers still seem to think "Ail that simulation takes too much time, 111 give it a quick try on the breadboard". But the time and effort in learning about simulation is really welt spent Once you have mastered a simulation program, you'll notice the ease of running such a simulation on a number of different options or settings in a thorough way, without any soldering to do or compo- nents to order by mail. Two articles in this edition approach Electronics simulation' from a different perspective* There is a hands-on article on the possibilities of the free program LTSpice* which is actually intended to develop switch-mode power supplies, but really has a much wider, largely undiscovered, application range. In ‘Vir- tual Measurements and Predictions’ a real-life case is presented of a simulation set up to compare the results of a simu- lation run against measurements carried out on the actual hardware thing* If you do not feel like doing any circuit simulation at all, no problem, there's a bunch of classic style projects in this edition to explore, assemble and use in practice* Like an advanced audio effects unit, a high voltage differential probe, a smart video detection system based on an inexpensive PIC microcontroller, and the second part of our beautiful DSP radio. If you haven't already spotted It on pages 4 and 5, we’re running a fantastic scrateh-and-win sweepstake again this year. There's a mass of prizes in stock, most of them kindly sponsored by our advertisers, including a stunning Hameg digital oscilloscope! Enjoy the read, the build*., and the scratch! Jan Buiting. Editor 4 Elektor Scratch-and-Win Sweepstake 8 Colophon Who's who at Elektor magazine* to News & New Products A monthly roundup of all the latest in electronics land. 14 Give your Projects Simple Grace Introducing Elektor's new Project Cases to house electronics projects 16 Build a Scrolling LED Message Board in One Day NXP’s mbed rapid prototyping platform put through its paces: and preparing for the NXP/ARM mbed design contest later this year. 20 Virtual Measurements and Predictions With the right software tools, it's feasible to know in advance if your design will function as intended* 24 Simulation Beats Trial and Error Showing how LTSpice can be used for circuit analysis with some surprising results. Digital MultbEffects Unit Reverb, chorus and flangerare just a few of the effects provided by this advanced 'box' designed around the FV-i effects chip. The Elektor DSP Radio (2) This month we cover antenna input selection and the PC software developed for the project Examined: Hameg HMO2524 Elektor’s lab guys got this pretty advanced 'scope to play with — and report on. of course* Know what you're measuring Some thoughts on measurement methods to determine the sound quality of capacitors. Can it be done easily? 6 09-2010 elektos CONTENTS Volume 36 September 2010 no. 405 20 Virtual Measurements and Predictions Computer programs enable you to know in advance if your design witl func- tion as intended. We compared the measurements made on a real hardware prototype with the simulated data produced by a leading program and drew our conclusions. 28 Digital Multi-Effects Unit -ee ,ve prove that it H s possible to generate a variety of effects digitally, indud- - 3 everb, chorus and Hanger effects, without having to work yourself to the bone with DSP programming. The circuit is built around a highly integrated ef- fects chip and features an intelligent user interface with an LCD. The result is a treat for the eye and the ear. 36 The Elektor DSP Radio (2) The operation of our famous DSP Radio can be optimized by modifying the an- tenna and front-end circuit configuration and by modifying the software. This creates various configurations ranging from a plain PC-controlled radio to a portable world receiver.. 48 Juggling Audio Bits Getting started with DSPs yourself requires a considerable depth of knowledge of this subject matter. With the modules from minfDSP you can easily realize all kinds of audio processing functions without the need to become intimately familiar with digital signal processing. 46 Tiny samples, big footprint A few chips was all we ordered and look what the mailman left on our doorstep. 46 And dropping by at Elektor... Multi media -savvy chips sets from TeleChips demoed at Elektor House (built 101692), 46 Useful spares or toxic waste? RoHS is viewed upon with horror by many hobbyists, but is not necessarily evil bureaucracy. 48 Juggling Audio Bits No better way of entering the world of digital audio processing than getting your hands on a mini DSP board, 54 Dual Voltage/Current Display The symmetrical version of the Lfnilab power supply is extended with a voltage and current (V/l) readout. 60 High-voltage Probe A special design is called for to measure small differences between high voltages. 66 Vision System for Small Microcontrollers Just accept slow, slow sampling speeds and even not-so-fast micros will be capable of seeing objects around them, 72 Bascom 8051 Math Routines Here's a versatile, advanced set of mathematical operations ready to compile and run on your 8051 m icrocontrol I er system , 76 Hexadoku Our monthly puzzle with an electronics touch, 77 Retronics: Delay-line Digital Memory (ca, 1968} Regular feature on electronics ‘odd & ancient 1 . Series Editor: Jan Buitang 84 Coming Attractions Next month in Elektor magazine. elektor 09-2010 7 elektor international media bv Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginnerto diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. + tocus on circuit simulation Digital Multi-Effects Unit 1 5 configurable sound effects The Elektor DSP Radio (2) Antennas and PC Software Cfv« your prcfecb simple grace with the Elektor Project < ast + Au dio DSP Kickoff £ + UnilabV/l Display M Vision System for small m I c roco ntro I lers ANALOGUE • DIGITAL w MICROCONTROLLERS & EMBEDDED AUDIO • TEST & MEASUREMENT 1 Volume 36, Number 405, September 501 0 ISSN 1757-0 875, Elektor aims at aspiring people tn master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Elektor International Media, Regus Brentford, loon Great West Road. Brentford TWS gHH, England, Tel. f+44) 208 261 4509, fax; (+44) 208 261 4447 www.efekto r.com The magazine is available Irom newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published ii times a year with a double issue for julyJi 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, Ifilrmstlonal Cditur. Wisse Kettinga (w.het tinga T elektor.nl) | an Uniting ( edit or^'elekt or.com)- Harry Baggen, Thijs Beckers, Eduardo Corral, Ernst Krempel sauer, Jens Nickel. Clemens Valens, Antoine Authier (Head}. Ton Gilberts, Luc Lem mens. Daniel Rodrigues, Jan Visser. Christian Vossen Id I if i r t; lil M d t Hedwig Hennekens (secretarial *el ektor.nl) Giel DoJs, Mart Schroijen PaulSndkkers Carlo van NistefrDoy Elektor International Media, Regus Brentford, iqoo Great West Road. Brentford IWB gHH. England. Tel. (+44) 7£)8 261 45og, fax: i+44} 208 261 4447 Inte met 1 w ww, elektor, co m ' 5 u bs 8 og -2010 elektor Z' DISTANCE LEARNING COURSE Programming Embedded PIC Microcontrollers c=> using Assemt Benefit now 1 . £ 40 1 S 70 1 € 50 DISCOUNT wW w.elektor.com|distancelearning In this course you will learn how to program an embedded microcontroller. We will start with the absolute basics and we will go into a lot of detail. You cannot learn about software without understanding the hardware so we will also take a close look at the components and schematics. At the end of the course you will be able to design your own embedded applications and write the appropriate software for it. Contents: * Background * Digftal Ports * Serial Communication (RS232) * Analog Signals * PuEse Width Modulation * Timers/CoLinters/Interrupts * Memory * LCD Display * l 2 C Communication * SPI Communication * USB Communication * Configuration (Fuses) * Answers to the assignments * Appendix Your course package: * Courseware Ring Binder (747 pages) * CD-ROM including software and example files * Application Board * Support at Elektor Forum * Elektor Certificate Price: £395.00 / $645.00 / €445.00 Please note: to be able to follow this course. E-blocks hardware is required which you may already have (in part). All relevant products are available individually but also as a set at a discounted price. Please check www.de ktpr.co m/d i'stan celearning for further information. V-n.*'su> v ,r - \ fB W Further information and ordering at www.elektor.com/distancelearning \ / Em ai I : subs c ri p£ i □ n I ek to r.c am Rates and terms are given on the Subscription Order Form. Elektor International Media b.v. P.O. Box it N L- 6114-2 G Susteren The Netherlands Telephone; ^+31)46 4389444, Fax; (+31) 46 4370161 Seymour, 2 East Poultry Street, London ECiA. England Tele phone: +44 207 429 4073 Kuson International Media, Cambridge House, Coymore Lane, Chertsey, Surrey KT16 9AP, England. Telephone: +44 1935 564959, Fax; +441932 564998 Email: r.el gar@hu50nmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. The circuits described in this magazine- are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks. CD-KOMs, software carriers and article texts published in our books and magazines (otlier than third-party advertisements)! are copyright F.lektor 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 Pubfi slier. Such written permission must also be obtained before any part of this publication is stored in a retrieval system ol any nature. Patent protection may exist in respect oF circuits, devices, components etc, described in this magazine. The Publisher does not accept responsibility lor Sailing to identify such pater>t($) 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, Prices and descriptions of publication -related items subject to change. Errors and omissions excluded. < El€ , ktgf)nterri4tion;i! Media b.v. I0t0 Primed in Use Netherlands. elektor og-2010 9 NEWS & NEW PRODUCTS Cypress and Future introduce PSoc 3 Development Board Cypress Semiconductor Corp. and Future Electronics recently intro- duced a low-cost development board demonstrating the ease-of-use of Cypress’s new PSoC® 3 archi- tecture* The Future Electronics PSoC 3 Development Board shows how devel- opers can leverage the flexible PSoC 3 architecture and the revolutionary PSoC Creator™ Integrated Development Environment (IDE) to streamline designs. The Future Electronics PSoC 3 Development Board features: • On-Board Debug/Programmer • CapSense® Touch Pad Interface * Tricolor — Red/Green/Blue LEDs • User USB Interface • Power through USB Ports • Two Connectors for I/Os and Expansion Boards. • Optional CAN Oscillator The two Expansion Board Kit (EBK) connectors on the board enable It to work with a growing ecosystem of solution- based expansion kits that Cypress is developing, including segment LCD, CAN and more. Future will also be developing an expansion board for the new Sharp Pixel in Memory LCD with power consumption 130 times lower than standard LCDs of comparable size. More information on the Future PSoC 3 board is available at www.FutureElectronics.com/cypress, The compa- nies also announced that interested parties can request free onsite introductory dem- onstrations of the new development board or half-day, hands-on workshops by visiting www.cypre$s*com/go/FEtraining or by contacting your local Future account manager* PSoC 3 and PSoC 5 devices extend the world’s only programmable analog and digital embed- ded design platform, delivering unmatched time-to-market, integration, and flexibility across S-, 1 6-, and 32-bit applications. PSoC 3 and PSoC 5 offer high-precision programmable analog including 12- to 20-bit delta-sigma ADCs, digital logic libraries full of dozens of drop-in periph- erals, best-in-class power management and rich connectivity resources. The PSoC Creator IDE introduces a unique schematic- based design methodology along with fully tested, pre- packaged analog and digital peripherals easily customizable through user intuitive wizards and APIs to meet specific design requirements. More Information and free downloads of PSoC C rea to r a re a va i I a bl e at www, cy p re s$*co m / g o/ psocc reator* The free onsite demonstration introduces the PSoC 3 and PSoC 5 architectures and fea- tures, shows applications development using PSoC Creator software and the Future Elec- tronics PSoC 3 Development Board, and includes a short lab. The free half-day work- shop gives participants hands-on experience using and developing PSoC 3 applications through the PSoC Creator IDE and the CY8CKIT-0O1 PSoC Development Kit, Attendees will learn how to easily implement high-performance, low-power 8-bit or 32-bit mixed- signal applications with an architecture integrating powerful and programmable analog and digital resources. Interested parties can request introductory demonstrations or workshops by visiting: www.cypress.com/go/FEtraining. The Cypress CY8CK1T-0G1 PSoC Development Kit is priced at US $249 and is available from Future, www. Future Elec txonic^com/cy press www.cypress.cpm/psoc www.cypress.com/ psoc training (100555-1) Robust, easy-to- implement wireless connectivity for portable applications MK Consultants has introduced a new range of embedded Intelligent radio transceivers that operate in the UHF bands of 434, 457, 868 and 91 5 MHz with a VHF 169 MHz ver- sion also available. The iGenesis series oper- ates in narrow band 25 kHz channels pro- ducing adjustable RF power up to 15 mW coupled with a receiver sensitivity in excess of “120 dBm and best-fn-class blocking immunity against interference* Housed in a fully shielded SIL package with compact overall dimensions of just 44 mm x 1 5 mm x 5 mm, the IGenesis series is ideal for the growing number of portable elec- tronics products that require reliable, long range and repeatable wireless Interconnec- tivlty. Applications include M2M t Bluetooth and Zlgbee replacement for enhanced per- formance, automatic meter reading, home automation and wireless sensors. The new modules have a wide operating voltage range of 2*8 VDC to 6 VDC and can achieve a wireless range In excess of one kilometre. A comprehensive software serial data interface including user selectable parameters such as operating frequency, power, data rates, plus transparent or packet protocol selection, eases implemen- tation and allows designers to concentrate on the overall functionality of their products and potentially shorten time-to-market. iGenesis embedded radio modules have an operating temperature range of -20 to +60 °C and meet worldwide radio approval standards. For high volume applications, MK Consultants also offers the modules in a surface mount format suitable for SMD assembly processes* http://www*m kconsultants.eu (100555-i!) 10 09-2010 elektor NEWS & NEW PRODUCTS New PIC24 and dsPSC33 Development System: Easy24-33 v6 mikroEJektromka have introduced their new product called Easy24-33 v6 Develop- ment System, The new board is intended for developing and designing devices using 1 4-, 1 8-, 20-pin and 28-pin Microchip PIC24 and dsPIC33 microcontrollers* The system includes outstanding features such as USB 2.0 programmer with mikrolCD and many peripheral modules such as: Touch Sense, Serial RAM, Serial EE PROM, Piezzo Buzzer and many more* Each feature of the board is supported by practical examples written in mikroC, mi kro Pascal and mikro Basic PRO for dsPIC30/33 and PIC24 compilers. The new tool comes with comprehensive full colour printed documentation. www.mikroe.com (100555-111) Virtins RTA-168 PC based real time audio analyzer Virtins Technology have just launched their RTA-168, a PC based real time audio analyzer. It consists of a measurement microphone, an XLR-to-USB converter, and PC virtual instru- ment software Multi-Instrument, An audio test CD is also included. All the components of the RTA-168 can be packed into a small black soft pouch case provided and be car- ried together with your laptop or netbook. It is a handy tool for audio and acoustic meas- urements in both field and laboratory* Application examples are frequency response and distortion measurement of a loudspeaker, room/car/auditorium equali- zation, noise monitoring and analyzing, etc. Combined with the computing power of a modern PC and the powerful virtual instru- ment software ‘"Multi-Instrument”, RTA-1 68 provides unbeatable performance-to-pnce ratio compared with any other types of RTA. The main functions of RTA-168 includes: oscilloscope, spectrum analyzer, sound level meter, signal generator, 1/1, 1/3, 1/6, 1/12, 1 /24, 1 /48, 1 /96 octave analysis, equivalent continuous sound level (Leg) measurement, A, B, C, 1TU-R 268 frequency weighting, lin- ear and exponential time weighting, param- eter measurements (THD, THD+N, SINAD, SMPTE IMD, DIN IMD, CCIF IMD), etc. The RTA-168 has two standard configura- tions: RTA-168A (with Multi-Instrument Standard license) and RTA-168B (with Multi-Instrument Standard license). The RTA-1 68 A comes with an ECM999 measure- ment microphone with extremely flat fre- quency response within 20-20l35501. rj Figure 2. The timing diagram of the 32 line LED panel looks simple enough. However a subtlety is hidden in the four bit data word R1 / R2/G1/G2: Rl/Gl control the upper 16 lines of the panel, R2/G2 the lower 1 6 lines. Therefore this pattern has to be repeated only 16 times to draw all 32 lines. The EN signal controls the power to the LEDs, Activating it (logic Low) for a while after a line has been written gives nicer results than simply activating it all the time. have been chosen in such a way that all the peripherals integrated in the controller are accessible, but not all at the same time. If, for instance, you need three serial ports, you can't have an f 2 C bus as well. The power supply (0 V, 4,5 V to 14 Vin, US8 5 V out and 3,3 V out), the Ethernet interface and the USB port have dedicated pins, there Is a reset Input and two IF pins (these are for the USB port of the mbed interface, not the target processor and you are not sup- posed to use them}. The remaining 25 pins can be GPIO or allocated to some other function. dektor 09-2010 NXP CONTEST PRIMER tl 13 15 MQD1 +3V3 i +SV GND A GND H GND c EN a A1 G1 GND 1 * GND S GND to \2 U 16 PANEL Si MO 02 c i 1 b GND 2 _ YIN y a C b id il 12 13 14 15 X 16_ ir ia_ i^L 30 NEXT PAGE iH MBED vout vu IF- 1F+ HD- HDt TD- TO+ D- D* ID 39 35 37 36 _3S 34 33 32 31 30 29 JES 27 26 21 23 22 21 100501 ■ is Figure 3. The circuit diagram is really simple since no special parts are needed to control the LED panel* Note that in this basic setup the mbed module is powered from the USB bus, whereas the LED panel needs a separate supply because it needs more current than mbed can provide. Also note that even though the LED pane! is specified for 5 V, it will run from 3V3 without any problem. The panel at 5 V driven by a 3V3 mbed will work too* On to the application The goal of the project was to build a message board with an easy way to put, well, messages on it! Today's electronics often equates to USB and that's why I ended up using the mbed module. Since the module doubles as a 2 MB USB mass storage device it would be very easy to load message files on it produced on a computer with a proper text editor* That would be an intuitive and comfortable user interface that even non-electronics engineers can understand. The user manual of the LCD panel (DE-DP-DP029 '033_Verl .0_ EN.pdfP!) told me I had to do some bit-banging as its serial interface is not standard SPI or something similar* Figure 2 shows the timing diagram. The display has 32 rows of 64 two-colour LEDs, i.e. a grand total of 4096 LEDs! The addressing of the 64 rows (32 two-colour rows) is a bit strange because the address bus is only four bits wide and can thus only address 1 6 rows* This problem was solved by the manufacturer by breaking the display in two 1 6 row displays and using a 2-bit data bus. The two 1 G row displays are addressed in par- allel and the two data bits select the red and green LED for the row* The display has only enough memory for two rows* one upper row and one lower row. This means that the display has to be refreshed continuously In order to display a message or image* An advantage of this technique is that the display will not consume 40 amps or so when all the LEDs are on* After a line is written it should be activated using the EM signal. This signal determines the brightness of the display but as it does so, it also affects the refresh rate. This will in turn govern flickering as well as the scroll speed, since scrolling does not use a separate timer and depends directly on the refresh rate, m A little bit of hardware How I hooked up the display to the mbed module is shown in Fig- ure 3. Since most mbed pins can be GPIO, l simply started at the first available one (pin 5) and worked my way down* 1 later added a special feature pushbutton to pin 20 simply because it was nearest to the pushbutton. For compatibility reasons I ran the display from 3V3 (3.3 V) instead of the specified 5 V, because mbed is 3V3 and the display let me do it. Once I mastered the display 1 powered it from 5 V and that worked fine too, the advantage being a much higher brightness. The display was powered from a separate bench supply as it requires several amps when all the LEDs are on and the mbed module can- not provide this much. I powered the mbed module itself through the USB port I had a bit of a hard time implementing the not terribly complicated serial protocol for the simple reason that the user manual of the dis- play has an error. In the table on page S and 9 that 1 was using the pin numbers of the T and 'S' signals are swapped with respect to the connector pinout shown just above it* The sample code I had extracted from the document worked fine, but my own code didn't* Very frustrating. With this problem out of the way everything went smoothly and I was able to very quickly plot a pixel anywhere on the display in one of the four available colours (red, green, orange and black). it's interesting to note at this point that the mbed library has pin and bus functions* It seems logical to use the BusOut function for both the address and the data buses, but it turned out that the bus function is much slower than the pin function. I therefore ended up using four DigitalOut calls for the data bus and one BusOut call for the much slower address word. The reason for this performance dif- ference would probably be clear if only the source code of the mbed library had been published* Dots & fonts It was now time to start writing characters on the display. Charac- ters need a font and bitmapping a font is an intensely baring and tedious job. 1 n the spirit of letting other people do the hard work for you, I turned to the Internet. Many people have been busy over the years bitmapping fonts and writing utilities to do it automatically, so after some ten minutes I found myself playing with The Dot Fac- tory HI (Figure 4). This Windows utility makes it a snap to convert any font installed on your PC into C source and header files. Select the font, set some options and click the Generate button. The only weird thing is that you can't save the files; you have to copy and paste* That's a minor inconvenience though for a nice free tool, so I created the files without complaining and imported them into my mbed project. Adding the code to display the characters anywhere I wanted them was pretty straightforward too. Adding an INI file system The next step was adding a way of putting messages on the system* This was the main reason why I had opted for an mbed module: it has a USB interface and the mbed library provides a convenient file system* And convenient it was. All I had to do was to add 1 (say, one) line of code to my program to get it working: iK 09-2010 elektor NXP CONTEST PRIMER Local FileSystem local ( “ local" ) ; Now my program was able read the files that I copied to the MB ED mass storage device from my PC. I had decided to use an JIM I -type file for my message files, i wanted several pages, browsing through the pages would be possible thanks to the pushbutton. Every page would be a section in the INI file and it would be possible to specify, on a section by section basis, the text for each line. With my 8-point Arial font I had room for four lines per page without characters spilling into other lines. I turned again to the Internet to look for an easy INI file C-llbrary. There are many around and I picked one more or less randomly: inih IN it would be! This turned out to be a good choice as it's a remark- ably easy to use library and no more than five minutes were needed to integrate it into my project. Time to stop I had now come to a point where ‘features' started creeping in. First of course message scrolling: left, right and no scrolling. Then scroll- ing at any speed. Now that was a tough one. Not so much to imple- ment as it was to look at, because it resulted in pixel bleed. Char- acters became blurred and the display became uncomfortable to tea d . Th is featu re was therefore sera p ped , but a noth er one q uickly found: every line its own colour and its own (x,y) starting position, I tried many more things but finally settled for the features men- tioned above plus page skipping. Then I called it a day. Tool trouble Building this application took me about one day of work. I did not do it all in one go, but I could have If my agenda had let me. Using the mbed module instead of some other microcontroller board defi- nitely saved enormous amounts of time as did the mbed library. Not a single ARM register was inspected by me and I did not have to refer to the p rocessoCs datasheet or program mi ng manual at a 1 1 , The little mbed experience ! had before starting this project prob- ably helped a bit too, because I knew what I could expect from the mbed library. The only severe hindrance was the mbed server going down or off- line. This happened once during my project, wasting a couple of hours and it makes you feel silly. There you are happily program- ming away and suddenly: Bam! No more tools... And no one you can yell at (what was that mbed helpdesk phone number again?). Another Inconvenience is that the compiler or the server seems to get stuck every once in a while. This is rather annoying as It prob- ably means loss of those clever modifications you just added to your code. Exactly what happens I don't know, but you have to dose and then reopen the compiler window without being able to save your work. The mbed crew should add some temporary saving for recov- ery purposes to the environment as this happened to me several times. Note that you do not hove to use the online compiler. The executable that you download and program into the target is an ordinary binary, i.e. no proprietary file format. If you can produce such a file with a tool chain you already own you're good to use the mbed board too. Figure 4, The Dot Factory: Now why did theauthor(s) forget to implement file saving? The mbed library can also be used since the header files and a binary archive (,ar) can be downloaded. This is not the easy way however, and, understandably, not really supported by the mbed crew. How- ever. some people have found ways to mbed off Sine. Similarly you don't need an mbed board to run the executable. Any L PCI 768 board can be used, which means that you don’t have to design an mbed module into your product. Conclusion While working on the project ! was using the beta LPC2368 mbed, but for this article I had to use the IPC1768 mbed. Switching between the two modules turned out to be extremely easy; all I had to do was selecting the right mbed from a dropdown list on the compiler menu. The recompiled code then worked immediately without any modifications. AH in all I think mbed is pretty cool This project made very low demands on the power of mbed, the Ethernet interface is worth a try too. Although I would not recommend mbed for professional or consumer quality software development since you have little or no control of the tools and the library (what if ARM decides to pull the plug on m bed?) and there is no debugger, it is definitely a g reat tool for quickly putting a proof of concept together. It is also great for those one-off projects where you need just a little more processing power than you can squeeze from systems like an Arduino. Hats off to the mbed crew who have come up with a great tool! (100501) Internet Links & Literature 1 1 1 Easy (B)mbed, An Alternative Approach lo Embedded Program- ming , Tom Cantrell, Circuit Cellar #227, June 2009, pp 68-72. (Free download at www.clrcuitcelliir.corn/archives/ viewable/ CantrelT227.pdf). [2 1 mbed.org [3] FED panel: www,sureelectTonlcs,net/goods.php?id=7 1 8 |4| The Dot Factory: www.pavlus.net 1 5] INI Not Invented Here: code.google.com/p/imh/ [6j Software: www.elektor.com/ 100501 *9 elektor 09-2010 TEST AND MEASUREMENT Virtual Measurements and Predictions By Thijs Beckers (Elektor Netherlands Editorial) As an electronics enthusiast or engineer, you’ll know that the design of electronic circuits can be complex. These days, however, you can get help from computer programs, so you'll know in advance if your design will function as intended. Or perhaps you won’t? We compared the measurements made on a real hardware prototype with the simulated data produced by a leading program and drew our conclusions. "ii.nniiii These days the design of electronic cir- cuits happens on the PC. In a completely virtual environment the circuit diagram (‘schematic’) Is drawn, its operation is simulated and the circuit board layout is produced. The designer puts a lot of trust in the simulation results. To be completely sure, however, a (hardware) prototype is usually built that can then be used to con- firm that the circuit works as it should. But how good are those simulations really? We decided to try out Proteus, from Lab- center Electronics [1 ], a leading CAD pack- age for circuit drawings, PCB layouts and simulations. 20 og-2010 elektor TEST AND MEASUREMENT For the simulation we picked the circuit for the frequency shifter from the portable sound system with feedback suppression, which was published earlier this year in the February 2010 edition of Elektor. This circuit contains analogue as well as digital build- ing blocks, and it isn’t the easiest design to simulate, partly due to the high switching frequencies and phase shifts. We picked several interesting points In the circuit where we would like to see the wave- form of the signal; these are shown as A to F in the circuit diagram on the following page. The most interesting one is of course the output signal (F), but designers obviously also like to know what happens at interme- diate stages of the circuit, so that they can be sure that the circuit behaves as expected. CAD To simulate this circuit we’ll use the Pro- teus 7 Professional package from Labcenter Electronics. This package In fact consists of two programs: ISIS and ARES. ISIS is used to draw the circuit diagram and simulate it, whereas ARES is used to design the PCB layout. In this article we're not interested in the PCB layout so we’ll ignore the latter program. The Proteus Design Suite is specifically made to simulate embedded systems and has the facility to simulate microcontroller code in a mixed-mode SPICE environment Labcenter calls this VSM, Virtual System Modelling, Of course it can also cope with ‘normal’ SPICE models. We aren’t really ask- ing a lot of the simulation software with our frequency shifter, but the extensive func- tions of the software will be welcomed by many. Before you can start the simulation you have to input the circuit into ISIS, Unfortu- nately, this means that the schematic has to be completely redrawn. The various CAD packages on the market all have their own format for storing the drawings and gener- ally aren’t able to export or import other formats. Once the circuit has been drawn, you can add probes and measuring instruments to your hearts content. Theoretically, you could add a complete arsenal of measur- ing instruments to each point in the circuit, but this is of course not necessary. Having selected several interesting points in the circuit and put a virtual probe there, you are in a position to visualise the signal at those points. Simulation When the probes have been put in place, you can choose several virtual measur- ing Instruments, in this case three oscil- loscopes and an FFT analyser. For each of the virtual instruments you have to specify which probe they have to use. Next, you can start the SPICE simulation by hovering the mouse pointer above a measurement win- dow and pressing the space bar. Sometime later (depending on the processing power of the PC) the simulated voltage appears on the screen. Tips and tricks The opamp models chosen for the simula- tion were the Ideal’ opamp models, which reduces the number of required SPICE nodes from a hundred down to only a dozen per opamp. This speeds up the simulation significantly, but still offers sufficient accu- racy for this application. The simulation for the clock generator around the crystals has also been turned off at the component level. The SPICE model for the 4060 has a parameter (‘dock’) allow- ing the operating frequency of this compo- nent to be set, irrespective of the value of the clock signal at its clock inputs. You could even have chosen to replace the 4060 and 74HC74 flip-flops with a pulse generator that output the required clock pulses, but this would have deviated too much from the original circuit. These 'tricks’ are very useful to know and give speedy and good results. It’s therefore important that you know what simulation options there are and what settings give the best results. For other tips and tricks you can refer to the manual, the technical support department and last but not least, several forums where you can ask any ques- tions you may have. Results The details of the simulation results are shown in the spread on the following page. We were pleasantly surprised by the fan- tastic results. The measured and simulated values corresponded almost perfectly. The real-world measurements only devi- ated slightly from the ideal (simulated) val- ues. The slight mismatches were probably caused by component tolerances. Not only could differences be measured between a number of frequency shifters that had been buitt, but there was also an audible differ- ence. Some clearly sounded better than oth- ers did. Hats off for Proteus, which in our opinion passed the ‘test’ with flying colours. Not only is the end-result (signal F) amazingly correct, but all the intermediate points that have some rather ‘strange’ waveforms also correspond to the measured signals. No complaints here then. Do It Yourself On the web page created for this article [2] you can find the ISIS circuit including the virtual measuring instruments for you to download. A demo version of Proteus 7 Pro- fessional is available for download as well, so you can verify the results above and carry out further simulations if you want. The demo version of Proteus does not allow you to save your designs, nor create print lay- outs, nor create circuits containing micro- controllers, However, you are able to mod- ify the program code in existing (example) designs with microcontrollers. As an example, try to run a simulation of about 20 ms or more, where the input signal and the inverted output signal are shown in one graph. You should see that the signals have a slight difference in frequency and that one signal appears to 'overtake’ the other (double-clicking on the title of the scope image opens up the graph in a new window), (100359) elektor og-2010 21 TEST AND MEASUREMENT Hardware versus software On the left-hand page you can see the measurement results for the measur ements carried out on the real-life circuit, while the right- hand page shows the results of the simulations. On the circuit diagram a number of points (A to F) are indicated that we thought would be interesting to measure and compare with the simulation. The signals at points A and B should have a phase difference of 90 degrees [2] Signal at C and D At point C is the high frequency square-wave modulated signal. At point D is the filtered version of the signal at C Due to the small difference in the fundamental frequency and the first and subsequent harmonics there doesn't appear to be much difference between C and D. [1] Signal at A and B The signals at these points should be the same as the input signal, but with a phase difference of 90 degrees between them. That means that when the voltage of one of the signals is at zero, the voltage of the other signal should at its maximum or minimum (depending on the phase), This is more or less the case in the measurement; it isn't exactly 90 degrees, but it comes very close. [3] Signal at E and F At point E you can almost recognise the output signal (modulated by various mixer products). At point F all redundant RF signals have been removed from the signal and the result of the frequency shifter becomes apparent The output sine- wave is slightly distorted, which Is partly caused by the tolerances of the components used. [4] FFT output signal When we perform an FFT analysis on the input and output signals its easy to see the frequency shifting that has taken place. The original signal had a frequency of 1 kHz, whereas the output signal was about 1 .01 kHz, i.e, it has become 1 0 Hz higher, which was the intention of this ‘feedback-killer’, 22 og-zoio elektor TEST AND MEASUREMENT between them. C and D should be the modulated and the filtered, modulated signal respectively. At E is the output signal with a nasty looking RF signal superimposed on it and at F is the dean input signal, but with an increased frequency of about 1 0 Hz. (5} Signal at A and B In the simulation you can also see that the phase shift isn't exactly 90 degrees. It h s clear that the design for the phase shifter is a compromise; the bandwidth in which the circuit works ‘perfectly’ is limited. [6] Signal at C and D Despite the complex RF waveform of the signal, the SPICE simulator from Proteus keeps its cool and shows a very close resemblance to the measured signal from the actual hardware. Internet Links 1 1 ) www.labcenter.com [2] www.elektor.com/100359 [7] Signal at E and F There is not much to say about the signal at E and the filtered output signals. The only difference is that the hardware version has some distortion due to the component tolerances, which is something that the software hasn't taken into account in this case. JS] FFT output signal Even the simulation of the FFT of the output signal shows an exact 1 0 Hz frequency shift... What more could you ask for? :t — “ 5 * " - Lit ■ ii tufalaVI- *. r ~ “ ■ a il **■ ■ ■ » 1 - ■ — H 1“ elektor og-2oto 2 3 TEST & MEASUREMENT Simulation Beats Trial and Error By Dr Gunter Spanner (Germany) Simulation tools allow circuits to be tested and characterised even before the first components have been ordered* LTSpice is a powerful program and available free of charge. Here we use two examples to show how this program can be used for circuit analyst among its other features. Simulation programs have become indis- pensable for the commercial development of electronic products. The traditional development method for new products, consisting of building a tab prototype, designing an initial RGB layout and produc- ing a pilot series before final production release testing, became outdated a good while ago. Nowadays new circuit designs are thor- oughly tested before the first real com- ponents are ordered. In addition to basic circuit functionality, this covers the full allowable operating voltage range and beyond - which does not incur physical risks with a simulation. The worst case situ- ation in which the circuit must continue to operate reliably can be determined with a computer simulation by configuring a wide range of temperatures and highly improb- able component tolerances. Until a few years ago, usable simulator pro- grams were as dear as hen's teeth, with prices of full-function versions easily reach- ing the three-figure range. Today tools with outstanding features are available on the Web for free download. This makes circuit simulation extremely attractive even for non-professional users. In this article we describe the LTSpice sim- ulation program (previously known as SwitcherCAD), which is available free of charge from tinea r Technology [ 1 ] . The core of the program, which computes the actual simulation, is based on the well known Spice simulation program, but Linear Tech- nology has refined this program, in partic- ular to obtain better results for switching converters (which are after all their main products). A convenient user interface has also been wrapped around the simulation software to provide features such as visual schematic design and editing. For more KUTTT H 'ftT-, ■ >* L™ L** £ ^ W ‘T- f cj. ^ 4* ri- is E3 % % 1 M C A jJDtil; L, W * 137- m L: * w rata* ’ Cf7 ■» - 3. :r ElBpr *.**«*- C-hK- n»^ i - >r i ‘■ i-Hi a a* £ ■M. I" W Hi £T Pi ivarr Hi A*’ ■ F, 4* p J*4 — 1 L /- - < n Sr hip* h-n-l ig ris- h rwj< + *-■41 ( ■ i i'«J -h4bn ■ . lilt ll i I 10 M10V > o .Iran 0 50m 0 lOOu startup .include UA741,lib R1 Figure 1 , Convenient presentation of the schematic and the simulation results (example from the LTSpice installation package). Figure 2. A square wave generator. The opamp is simulated using a circuit not shown here; the circuit model is located in the UA741 Jib file. 24 09-2010 elektor TEST & MEASUREMENT y Figure 3. The waveforms at test points 'a\ *b“ and ‘out 1 (see Figure 2), information on Spice and a good introduc- tion to how simulation tools work, see the October 2006 issue of Elektor [2J. Schematic editor Installation of LTSpice is easy and does not require any explanation here. The imple- mentation of the schematic editor is quite nice and more than justifies the use of this program. In addition to basic compo- nent symbols, the program comes with an extensive component library. Most circuit symbols are US style; a European resistor symbol is available in the library under the ’Misc,' category. The individual components can be posi- tioned freely and interconnected easily (a few notes for users are provided in an extra file that can be downloaded from the Elektor website [3]}. All components can be rotated and flipped as necessary to pro- duce a readily understandable schematic diagram. There Is also a component edi- tor that allows users to generate their own component symbols. Semiconductor devices in particular are composed of a large number of internal components, so that their behaviour can be simulated as realistically as possible. These subcircuits are represented by Spice mod- els, and the necessary data can often be obtained free of charge from the manufac- turer or elsewhere on the Web. As a Spice derivative. LTSpice naturally supports inte- gration of these Spice models. Figure 1 shows a typical working environ- ment for circuit analysis. The schematic is shown in the bottom window, while the simulation results are displayed in the top window. The inverting voltage converter shown here is an example circuit included in the library of the installation package. To find out what this simulation program can do, we tested it with two relatively sim- ple example circuits. Example i: Square wave generator Our first example simulation is a simple square wave generator. The circuit shown in Figure 2 is built around a standard opamp and should be familiar to every electronics enthusiast. After the schematic is entered, the model for the operational amplifier (a 741 ), which can be found at various places on the Web including [4], must be saved in the ROOT:\ Program File$\LTC\LTspicelV\tib\sub folder. There it is available to all simulations. Alter- natively, you can select an opamp type available in the standard library. After you start the simulation, you can use a virtual probe to measure voltages, currents, power levels and other quantities at various points in the circuit. The corresponding waveforms are shown graphically. Figure 3 shows a virtual oscilloscope display of the signals at three test points: a: the inverting input of the opamp b: the non-inverting input of the opamp out: the output of the opamp From the measured output waveform, you can see right away that the 741 (as is well known) is not a rail-to-rail type; the output saturation voltage is around 20%]owerthan the supply voltage. In addition, the slew rate of 0.2 V/ps is depicted realistically. Test point 'a' shows the voltage on the 2.4-nF capacitor; it is a slightly bowed tri- angle waveform with alternating positive and negative slopes. A square wave signal can be seen attest point “b 1 (non-inverting input). Due to voltage divider R2/R3, its amplitude is exactly half that of the signal at the ‘out test point With the aid of this simulation, circuit operation can be explained to relatively inexperienced users. When the voltage on the capacitor rises above or falls below the reference voltage at the node of voltage divider R2/R3, the opamp output changes state (switches from the positive saturation level to the negative saturation level or vice versa). As a result, the capacitor is periodi- cally charged and discharged. Example 2: Percussion generator The behaviour of the second circuit (Fig- ure 4) is less obvious, even for experienced designers. The reverse feedback is provided by a network in this circuit. If you view the I-,...,,, ih 111 ikt up fiK "i .I. -D liWm 0 a. Ini n.mu|. ilk Figure 4. The behaviour of this circuit is not as obvious as that of the first example. elektor 09-2010 25 TEST & MEASUREMENT Figure 5. The attenuation of the oscillation waveform depends on the value of resistor R2 (see Figure 4)- Values below the critical value result in a waveform with increasing amplitude. Figures, A perfect fit: simulation result versus waveform measured with real hardware. simulation results, you can dearly see that this network has a rather unusual property. Two simulation results are shown in Fig- ure 5. For the upper curve, the value of resistor R2 was set above the critical value (around 17 kQ with the indicated com- ponent values). This circuit generates an exponentially decaying sine wave signal after the supply voltage is switched on. This also explains the name of the circuit: if the output signal is converted into an acoustic signal, it sounds like a light tap on a drum head. However, if the value of R2 is reduced below the critical value, the circuit produces an exponentially increasing sine wave sig- nal as shown m the lower curve, which Is ultimately limited by the maximum output voltage of the opamp. If the value of R2 could be set to exactly the critical value Rcrit, the circuit would gener- ate a sine wave signal with constant ampli- tude. However, this cannot be achieved in practice. Figure 6 shows a comparison between the simulation result and an oscilloscope signal recorded with an actual implementation of this circuit. These images demonstrate the outstanding quality of the simulation software. To further illustrate the extensive features of the simulation tool, a parametric plot is shown in Figure 7, It represents the output voltage versus the voltage at test point *b\ You can immediately recognise the phase shift between the two signals and the time decay of the signal amplitudes. Other useful functions In addition to transient analysis (time domain analysis), you can generate an AC analysis with tTSpice. This is useful for examining the frequency response of a network. For this analysis, a tuneable signal generator must be connected to the input of the net- work. Here again, test points can be defined with the virtual probe. Figure 8 shows the frequency response of the feedback net- work of the percussion generator circuit. The middle curve illustrates the situation 26 09 -2010 elektor TEST & MEASUREMENT when R2 has the critical value, which yields the narrow impedance notch clearly vis- ible here. The curves to the left and right illustrate the situations for oscillation with decaying or increasing amplitude. Even more complex circuits can be studied in detail with the aid of a simulation pro* gram such as LTSpice. The virtual meas- urement results are usually astonishingly close to the results measured with the real hardware. However, you should always be aware of the limitations of computer simulations. Although programs such as LTSpice have reached a high level of maturity, aberra- tions can always occur in practice. In par- ticular, it takes considerable effort to fully model ambient conditions such as electro- magnetic interference, radiated high fre- quency interference and noise components in simulations. Finally, you should always bear in mind that Murphy's Law also applies to simulations: a circuit that works perfectly as a simulation can always fail in practice. On the other hand, a circuit that doesn’t work properly as a simulation is unlikely to prove satisfactory in real hardware. (o8ioo6-f) Figure 7, A parametric plot of the output voltage versus the voltage at test point *b\ The phase shift is clearly visible here. Figure 8. LTSpice can also show the frequency response of a network (in this case the feedback network of the circuit In Figure 4). Internet Links | i | www.linear.com/designtools/softwdre/ Itspice.jsp [ 2 j w w w.e le k to r.co m / 0 6 02 0 7 [3 1 www.eiektor.com/Q602Q6 |4] http://focusTi.com/docs/prod/folders/ print/ua74 1 ,html#technicaldocuments Prototype & small series PCB specialists EURO PCB proto STANDARD pool TECH pool fi&J* IMS pool On demand dedicated prototype service widest choice 1-8 10D pm technology metal ’backed all options up to ALL SERVICES - Instant online pricing - Instant online ordering - Low pooling prices - Deliveries from 2 days - No tooling charges - Stencil service Call us: 020 8816 7005 Email: euro@eurodrcuits.com New website * new services www.eu rod rcu i ts.com elektor 09-2010 2 ? Bit r j v | k_ 1 m _ T 3 l fl ML JHj m • 1/1 H ■ ■ n 1 / w ■ Jr A m By Hubert Boliig (Germany) i jSSi DM p tn its aving fork \ roup fects chip » and teat *ry recording sounds better with the right sound effects. Here we prove that it's a variety of effects digitally, including teverb, chorus and flanger effects, without .el f to the bone with DSP programming. The circuit is built around a highly integrated the eye and the cell IUI Sound effects are what gives music that special touch. An effects generator Is an indispensable element of the kit of every modern musician, both professional and amateur In the mid- 1 980 s, the only com- ponents available to designers of effects units were bucket-brigade !Cs and opamps, but in the course of the digital revolution these components have increasingly been replaced by digital signal processor (DSP) ICs* The growing market presence of these 28 09-2010 elektor highly integrated ICs spelled an end to the DIY era for electronic enthusiasts with an interest in music, as the components and the necessary software simply became too complex. In addition, DSP !0s are not readily available and are almost impossible to sol- der by hand. Features * Multi-effect generator with 15 effect algorithms * Based on the FV-i effect processor 1 C * Frequency response 20 Hz to 15 kHz * Maximum delay time 700 ms * 64 memory locations for preset configuration profiles * Separate user interface - MIDI In port * Effect selection and parameter control via MID! port * Integrated ramp generator for producing attack/decay effects * Easy assembly using standard components {except the F\M 1 C) * Free assembler program for generating user-programmed effect algorithms Fortunately, this unsatisfactory situation has changed in the last few years. This prob- ably results from the fact that sound effect capability is being built into more and more mixing panels, stomp boxes and other musi- cal equipment. Application-specific ICs such as the FV-1 1C [1 ] from Spin Semiconductors [2] represent a relatively economical option for equipment manufacturers. All the components necessary for building an effects unit are already integrated in the 1C: high-quality audio A/D and D/A convert- ers, delay RAM (for delaying audio signals), four LFOs (two sine wave and two ramp), and three auxiliary audio inputs. As you can see from the block diagram (Figure 1 ), these components are grouped around a DSP core with a 24-bit ALU. The DSP does not require user programming, since seven algorithms (for corresponding effects - hall, chorus. Hanger, etc,} are stored in ROM by the man- ufacturer, Another eight effect algorithms can be held in an external EEPROM and input via the I2C port. Users can generate these algorithms themselves with the aid of a special assembler (SpinAsm) [3]. A devel- opment envi ronment and va rious exam pies can be downloaded free of charge. Now you may be thinking that such a special 1C is virtually impossible to obtain for per- sonal use, but that’s not the case. There are three sources that also sell to private par- ties: the online shops of Profusion PLC in the UK [4], Small Bear Electronics in the USA [5], and Das Musikding in Germany [6], Instead of spending several months wres- tling with DRAM timing, special setup reg- isters and so on, you can obtain the full functionality of an effects unit in the form of a single 1C This 1C is intended to be used with a user interface consisting of a rotary switch for selecting the effect algorithm and three potentiometers for adjusting the effect parameters. However, our aim here is to achieve more than the basic circuit has to offer. We want ou r effects unit to have the follow- ing convenience features: LCD display an EEPROM for holding eight supple- mentary effect algorithms (as previously mentioned) a ramp generator for attack and decay effects 64 preset profiles for user-defined effect settings and of course, a MIDI interface for musi- cians who shudder at the thought of buttons (which includes the author) For this reason, in our design a microcon- troller looks after the tasks that would oth- erwise be handled by a rotary switch and a set of three potentiometers. Digital selec- tion of the effect algorithm and generating the analogue voltages for configuring the effects are easy tasks for a microcontroller. For this job we chose an Atmel ATmegaS. ft has an integrated EEPROM, which is ide- ally suited to storing the preset configura- tion settings. The user interface with its LCD module and buttons is housed on a separate PCB, which provides several advantages. If you want to install the effects unit in an existing syn- thesizer or amplifier, it’s easy to fit the user Analog Left In Analog Left Out Analog Right In Analog Right Oul Potentiometer Inputs Program Select ROM/E EPROM Select EEPROM Interface XTAL Figure 1 , The FV-1 1C is sound effects processor featuring a DSP core, ADC, DAC and additional components. Seven predefined effect algorithms are stored in ROM. elektor 09-2010 29 090835 ’ 13 Figure 2. The ATmega microcontroller controls the effects processor 1C via four digital lines and three analogue lines. The user interface has its own microcontroller. any I/O pins left for the controls and indi- cators, so some form of ]/0 expansion was anyhow necessary. The end result is that the overall circuit offers maximum flexibil- ity for changes and extensions, and if you wish you can also use the user interface for other purposes. The EEPROM for the additional effects can also be seen in the block diagram of the cir- cuit (Figure 2). The block at the left in this diagram allows the original (dry) signal to be mixed with the signal emerging from the effects processor. In line with the design philosophy of the unit, dry/effect mixing is also controlled by the ATmega with the aid of two digital potentiometers. interface board in a separate enclosure. The connection in this case is provided by a three-way cable, and there's no need to disfigure the front panel of your sound gear. This approach also simplifies the layout of the main PCB, but the key consideration is that we gave the user interface its own intel- ligence in the form of an ATtiny microcon- troller, Here the author made a virtue out of a necessity: the ATmega did not have LCD! Figure 4. Schematic diagram of the user interface. The LCD module is operated in 4-bit mode, and connector K2 is connected to K3 on the main board. Armed with the previous description, it's fairly easy to understand the operation of the circuitry on the main board (Figure 3). The audio signals from the input connectors are fed directly to the inputs of the FV-1 1C via coupling capacitors, and to the inputs of the buffer amplifiers for dry/effect mix- ing (1C 1 a and IC1 b). The outputs of IC1 a and 1C 1b are fed to the inputs of the electronic potentiometers (X9C503). The output sig- nals of the effect processor are fed to the other inputs of the digital potentiometers. The signals from the potentiometers pass through buffer amplifiers on their way to the output connectors. The external circuitry of the FV-1 iC cor- responds to the recommend circuit of the manufacturer's data sheet. Capacitors C3 (100 nF) and Cl 7 (10 pF) must be located as dose as possible to corresponding pins of the fC. LED D2 is a dipping indicator, which lights up when the internal ADC or DAC is dose to saturation or in saturation [ 1 3 . It should also be mentioned that the DSP operates with a supply voltage of 3.3 V. The effect algorithm is selected by a 4-bit signal applied to pins TO and 50-52. The level on TO determines whether an internal effect algorithm (hard-coded in ROM) or an external algorithm (stored in the 24LC32) is to be used. Diodes D1 and D5-D7 together with resistors R7 and R19, R20, R21 are simple level converters from 5 V to 3.3 V, Diodes D9 and D1 0 are reserved for future 3 ° 09-2010 elektor extensions. The three analogue inputs POTO-PQT2 can be used to adjust the specific effect param- eters of each effect algorithm. The analogue voltages for POTO-POT2 are generated by the ATmega in the form of PWM signals. For this purpose, the 5-V PWM signals are first reduced to 3.3 V by voltage dividers (R9/ RIO, etc.) and then converted to DC volt- ages by low-pass filters. The effect type and effect parameter set- tings, along with the dry/effect mix set- ting, are combined to form a preset profile and stored in the internal EEPROM of the ATmegaB. The 51 2 bytes of EEPROM mem- ory provide exactly enough space for 64 preset profiles. JP2 is provided for write pro- tection (write protection is enabled when pin 7 is tied to VCC and disabled when pin 7 is nettled to VCC), There are two options for sending com- mands to the ATmega to select a preset profile; The serial port (K3) and associated user interface The MIDI port (K7) The implementation of the MIDI port with an optocoupler is standard. The only thing that should be mentioned here is that the optocoupler used for this (a 5H 1 39) is sim- pler and less expensive than the PC9G0 stip- ulated by the MIDI specification. The serial MIDI data is docked into the INTO input at 31,250 baud. The user interface is connected to the other serial port (RxD/TxD). Diodes D3 and D4 allow the main PCB and the user inter- face PCS to be powered from separate sup- ply voltages. For example, the user inter- face may operate under battery power. Of course, it Is also possible to power the user Interface from the main PCB. The circuit of the user interface is straight- forward. The LCD module is operated in 4-bit mode. The input components consist of four buttons and a rotary encoder, which is connected to K1 , Pay careful attention to Figure 3. Schematic diagram of the main board, with the buffer amplifiers for the signal inputs and outputs and the digital potentiometers for dry/effect mixing shown on the left. The three resistor/capacitor networks in the middle of the diagram convert 5-V PWM signals into DC control voltages with a range of 0 to 3.3 V. elektor 09-2010 3 1 figure 5. Component layout of the main board. The FV-1 1C is the only SMD component. Figure 6, User interface PCB. COM PO WENT LISTS Main Board Resistors R1 § R1 1 .R24.R30 = 1 kfi R2,F15,R7,R1G,I?1 8,R19,R20 t R21 ,R 23,R25,R29,R31 = 22kQ R3,R8 1 R1 2.R14X26.R32 - 10kQ R4.R9.RI3 = 8.2kQ R6 t R1 0 ( R 1 5 = 1 7,4kO ( 1 %, 250 mW) R17.R22 = 1 OOi 2 R27 = 2.2kfl R28 = 22012 R33,R34 P R35,R36 = 1MQ Capacitors Cl,C4,C5,Cl0X14,a6,C23,C24,C 30.C31 = 2,2pF 16V C2X1lX28X33 = lnF400V C3,C6 P C7.C8,C9,C12.C1 3X19X21 X22X29X37X38X39X40 C41 = TGOnF, ceramic 07X20 = 10j_lF 16V 05 = 47nF 0 8 = 1 nF, ceramic) C25,C32 = 3.3uF 1GV C26,C27 = 22pF C34X35X36 = 47pF 1 6V Semiconductors 01,03,04,05X6X7,08 = 1 N414S 02 = LED, 3mm, low current 09, DIO - BATS5 IC1,IC6 -TS912, dual opamp, rail to rail (ST Microelectronics T5912IN) IC2 = AT megaS- 1 6PU, pro- grammed, Elektor order # 090835-41 [Sj IC3 = 5PN1001-FV1, Spin Semiconductor IC4JC7 = X9C503 electronic po- tentiometer (Xicor X9C503P, Parnell: 179485) IC5 = 24LC32 (Microchip 241X32 A- 1/ P) . programmed, order # 090835-31 [S] ICS = 6N1 39 Optocoupler (Vishay Semiconductor) 0 = 7805 IC10 = LF33CV (ST Microelectronics) Miscellaneous XI = 32,68kHz quartz crystal X2 = 8MHz quartz crystal K 1 f K2, K4, K6 = 2-way screw term i - nal block, PCB mount K3 = 3-pin pinheader, lead pitch 0,1 in. I<5 = 6-pin (2x3) pinheader, lead pitch 0.1 in. K7 h K8 = 2-pin ptnheader, lead pitch 0.1 in, JP1 JP3.JP4 = 2-pin prnheader, lead pitch 0.1 in., with jumper JP2 = 3-pin pmheader, lead pitch 0,1 in. p with jumper % 32 og- 20 io elektor RGB # 090835-1. see [8] or Kit of parts # 090835-71 , contains a 1 1 f compo- nents including boards and programmed mi- crocontrollers, EEPROM, see [8] User Interface Resistors R1 = Ikfl R2 = 10kn R3 = 5.6Q PI = 1 0kI2 tnmpot Capacitors C1,C2,C5>C6- l OOnF C3 f C4 = 22pF Semiconductors D1 = LED. 3mm Jow current 1C 1 = ATtiny23l3-20PU I programmed, Elektor order #090835-42 [8] IC2 f 7805 Miscellaneous XI - 8MHz quartz crystal K1 = Rotary encoder, e,g, Alps type EG1 IE! 5204a E K2 = 3-pin pinheader, lead pitch 0.1 in. K4 = 2-pin pinheader, lead pitch QJ in* SI ,52 r S3,S4 = pushbutton, Multimec type 3FTL6 LCD1 = LCD 2x16 characters, Displaytech type 1G2C PCB. order# 090835-2, see [8|) or Kit of parts # 090835-71 „ contains aLtl com- ponents including boards and programmed microcontrollers, EEPROM, see [8] the required pin assignments when select- ing a component for this (check the data sheet). To simplify assembly, a kit with all the nec- essary components (including the RGBs, pre-programmed microcontrollers and a programmed EEPROM) is availabfe from the Elektor Shop. The RGBs (Figures 5 and 6), the pre-programmed microcontrollers and the programmed EEPROM are also available separately from the Elektor Shop. All components except the FV-1 IG are leaded types. The only SMD is the effects processor* but it is relatively easy to solder by hand since the pin spacing is 1 .27 mm. If you ca n not fi nd 1 7.4 kft resistors fo r R6 , R1 0 and R1 5, you can use 1 5 kQ and 2.2 kQ resistors connected in series. The source and hex files for programming the microcontrollers and the hex files for programming the EEPROMs (external and internal to the ATmega) are available on the web page for this article [8]. The EEPROM file for the ATmega contains ini- tialisation values for 63 preset profiles. As downloading program code to the flash memory of the ATmega also erases the internal EEPROM, the EEPROM must be pro- grammed last. The flash memories of the AVR microcon- trollers can be programmed with an STK500 development board (among other options), which can also be used for writing data to Bet* LAYOUT Now available: Tools and accessories for prototype PCB assembly fRfctl J , > ■ t 14JJ Supported File Formats ’ , ' r " £ lit Vt' I QfCiptli&rJ* PULSONIK — s- PRflTR' P'COp 20 O£ Easy- PC m 6 ' t*r i elektor og- 20 io 33 A total of 1 5 effect algorithms (effect types) are available. The name of the currently selected effect algorithm is shown on the first display page. Each effect algorithm has three specific effect parameters, which are combined to form a preset profile. The unit can store up to 64 preset profiles in memory. The dry/ effect mix ratio and ramp generator setting are also stored in each preset profile. The manual included in the download fife [8| contains a table of aft effect algo- rithms and their configurable parameters. After the unit is switched on, profile 000' is loaded and shown in the first line of the display. The currently selected effect algorithm is shown in the second line of the display. The next or previous preset profile can be selected by pressing the *+* and buttons. The Bypass (BP) button takes the effect unit out of the audio signal path. The rotary encoder can be used to adjust the parameter values. The currently selected parameter is indicated on the display by a blinking cursor. Clockwise rotation increases the parameter value, while anticlockwise rotation reduces the value. Press the Edit button to jump to the next parameter page or select the next parameter. If you have already reached the final parameter, pressing the Edit button takes you back to the first display page. To save a preset profile, first press and hold the Edit button and them press the H +‘ button. If you do not wish to save a setting, simply press the '+' or ‘- p button. Any changes you have made to the profile up to this point will be lost. The downloadable manual also includes information on controlling the unit via the MIDI interface. dwn tu up id the internal EEPRGM. An ISP port (l<5) is also provided for the ATmega to enable in-circuit programming and downloading of firmware updates, jumper jPI must be removed in order to program the microcontroller via the ISP port. You need an EEPROM programmer for the external EEPROM, but you can also man- age with a bit of supplementary hardware and the Pony Prog program [9], The Pony- Prog website has a design for a simple par- allel port to I2C adapter circuit, which can easily be assembled on a piece of prototyp- ing board. Incidentally, this handy program is also suitable for programming the AVR microcontrollers. The zip file, which (as usual with Elektor pro- jects) can be downloaded free of charge, also includes a Read Me file with informa- tion to help you sort out the hex files, as well as several screen shots showing the correct fuse settings. As usual, you should power up the circuit for the first time with the 1C sockets empty. Check the supply voltages (5 V and 3.3 V) at the 1C sockets. Next, fit the ICs in their sockets and connect the user interface to the main board. The welcome message should appear on the LCD module after power is switched on. Press the Edit but- ton to navigate to the settings screen for the first parameter. Measure the voltage on the POTO terminal. It should be possible to adjust It over the range of 0 to 3.3 V with the rotary encoder. It should never exceed 3.5 V under any conditions. The Clip LED (D2) should light up briefly when power is switched on. The circuit is now ready for use, and you can connect a line level signal to its input. The operating instructions are summarised in the inset. A detailed user guide (in Ger- man) is included in the download file [S], (090835-I) m www.spl nsemi.com/ Produc ts/ datasheets/spnl 00 1 /EV- 1 .pdf [2 j www.spinsemixom [3 ] www.spi nsem i .com/ Prod nets/ datasheets/spnl 001 -dev/ 5PINAsmUserManuai.pdf 1 4] wwwcprofLisionpk.com [ 5 1 www, sinal I bearelec.co m/home. html [6 J www.musikdtng.de/ (7) http://ww1 .microchip.com/downloads/ en/Devicedoc/2 1 71 3g.pdf J 8 j http:/ /www. elektor. com/ 09083 5 |91 www. la ncos.com/ prog . htm I 34 09-2010 elektor QUASAR electronics ftecfrofrte JOT SfrectafJsh STnce TP93 Quasar Electro nics Limited PO Box 6935, Bishops Stortford CM23 4WP, United Kingdom Tel: 01279 467799 Fax: 01279 267799 E-mail: sales@quasarelectronics.com Web: www.quasarelectronic5.com Postage & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7 Day Delivery - £4.95; UK Mainland Next Day Delivery - £11 95 Europe {EU) - El 1,96; Rest of World £12.95 (up to Q.5Kg) ’Order online for reduced price UK Postage! We accept all major credit/debit cards. Make cheques/PO's payable to Quasar Electronics, Prices include 17.5% VAT, Please visit our online shop now for details of over 500 kits, projects, modules and publications. Discounts for bulk quantities. Ct-KtlW Computer Controlled / Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vde 5, 6 or 8 -lead unipolar stepper motor rated up to 6 Amps, Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode for CNC use. Connect up to six 3179 driver boards to a single parallel port. Board supply: 9Vdc. PCB 80x50mm, Kit Order Code: 3179KT - £15.95 Assembled Order Code: AS3179 - £22.95 Computer Controlled Bi-Polar Stepper Motor Driver Drive any 5-50Vdc, 5 Amp bi-polar stepper motor us- ing externally supplied 5V levels for STEP and DI- RECTION control Opto- isolated inputs make it ideal for CNC applica- tions using a PC running suitable software. Board supply: 8-30Vdc PCB: 75x85mm, Kit Order Code: 3153KT - £23.95 Assembled Order Code: AS3158 - £33,95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32Vdc, 10A) in both the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 31 66v2KT - £22,95 Assembled Order Code: AS3166v2 - £32,95 DC Motor Speed Controller (10OV/7.5A) Control the speed of afmosl any common DC motor rated up to 1QEM7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15Vdc Box supplied Dimensions (mm): 6QWx1Q0Lx60H Kit Order Code: 3067KT - £18,95 Assembled Order Code: AS3Q67 - £26,95 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay outputs. 4 isolated digital inputs. Useful in a variety of control and ^ sensing applications. Con- trolled via serial port for programming (using our new Windows interface, terminal emula- tor or batch fites). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 31G8KT - £69.95 Assembled Order Code: AS3108 - £84,95 Computer Temperature Data Logger 4- channel temperature log- ger for serial port. °C or C, F, V P| Continuously logs up to 4 separate sensors located ^ 20Om+ from board. Wide range of tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one OS1820 sensor. Kit Order Code: 3145KT - £1 9.95 Assembled Order Code: AS3145 - £26,95 Additional OS 1820 Sensors -£3.95 each Rolling Code 4-Channel UHF Remote Siate-of-the-Ari. High security 4 channels. Momentary or latching relay output Range up to 40m. Up to 15 Tx s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately), 4 indicator LED s. Rx: PCB 77x85mm, 1 2Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 313QKT - £49.95 Assembled Order Code: AS318G - £59.95 DTMF Telephone Relay Switcher Cafi your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on toff any of the 4 relays as de- sired. User settable Security Password Anti- Tamper, Rings to Answer. Auto Hang-up and Lockout, includes plastic case. Not BT ap- proved 130x110x30mm Power: 12Vdc. Kit Order Code: 3140KT - £74.95 Assembled Order Code: AS3140 - £89.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m+ range. 112x122mm Supply: 12Vdc/Q.5A Kit Order Code: 3142KT - £59.95 Assembled Order Code: AS3142 - £69.95 New! 4-Channel Serial Port Temperature Monitor & Controller Relay Board 4 channel computer serial port temperature monitor and relay con- troller with four inputs for Dallas DS18S20 or DS18B20 digital ther- mometer sensors (£3.95 each). Four 5A rated relay channels provide output control. Relays are independent of sensor channels, allowing flexibility to setup the linkage in any way you choose. Commands for reading temperature and relay control sent via the RS232 interface using simple text strings Control using a simple terminal / oomms program (Windows HyperTermina!) or our free Windows application software. Kit Order Code: 3190KT - £69.95 USB & Serial Port PIC Programmer USB/Serial connection Header cable for ICSP. Free Windows XP software. Wide range of supported PICs - see website for complete listing ZIP Socket/USB lead not included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £49.95 Assembled Order Code AS3149E - £59.95 USB 'All-Flash' PIC Programmer USB PIC programmer for all Flash devices No external power supply making it truly portable Supplied with box and Windows Software. ZIF Socket and USB lead not included. As s em b led Ord er C ode AS 3 1 28 - £49.9 5 See website for full range of PfC & ATM EL Programmers and development tools. PIC & ATMEL Programmers We have a wide range of low cost PIC and ATMEL Programmers, Complete range and documentation available from our web site. Programmer Accessories; 40-pin Wide ZIF socket (ZIF40W) £14.95 18Vdc Power supply (PSU120) £19.95 Leads: Serial (LDC441) £3.95 / USB (LDC644) £2.95 , v. • l ,*. .w. Irl*. i, j '-! '.'.vv. - ' V.- J -J 1 . No.1 S KITS • « - ■ j_r ’ 1 p L? * -ff f ff f f A MI m A . *- * >, f.L JU -LL, , j,._ . s. . : | 1 j- 1 1 ; ' M,* - j- Secure Online Ordering Facilities • Full Product Listing, Descriptions & Photos • Kit Documentation & Software Downloads Motor Drivers/Controllers v.'] j : Here are just a few of our controller and driver modules for AC, DC, Unipoiar/Bipolar stepper motors and servo motors. See website for full range and details. Controllers & Loggers Here are just a few of the controller and data acquisition and control units we have. See website for full details Suitable PSU for all units: Order Code PSU445 £7.95 Most items are available in kit form (KT suffix) or assembled and ready for use (AS prefix). RF The Elektor DSP Radio (2) By Burkhard Kainka (Germany) C15C1^ V ** V £5 f > C">» L2 L3 L5 An important advantage of the Elektor DSP radio over other world receivers is the flexibility the user has to change its characteristics, both by modifying the antenna and front-end circuit configuration and by modifying the software. The unit can be used in its various configurations as a PC-controlled radio or as a portable world receiver. '■r LEO display C7 o H ve it* 3 & s I s s s C22 ->C21 ^ Cc> Elektor rh 1001 26- 1 U1.2 Hi R2 ^ -ci n 1 ' The circuit diagrams shown here illustrate the input circuit of the receiver we pub- lished in the first article in this series. For each possible antenna configuration the relevant jumper settings appear in red and the connected antennas and their accompa- nying coils appear in green. Figure 1 shows the standard configuration of the front-end circuit, with all jumpers in their default positions. Switching diodes D6 and 07 are represented symbolically as shortwave and mediumwave switches. You can see from the diagram how in each case a part of the inductance in the circuit Is shorted. A common antenna is used for all frequency ranges: one example of a suit- able design is a 50 cm whip. Another pos- sibility is to use an outdoor antenna: the author has successfully used a 10 m long- wire antenna connected via 30 m of coax- ial cable. Although this antenna is not ideal for FM reception, it nevertheless gave good results over all frequency bands from long- wave to FM. !f separate antennas are to be used for FM and AM reception, JP1 can be fitted to take the bottom of FM coil L2 to ground. The open pin at jPl (connected to 13 and CIS) then forms the new AM antenna input for long-, medium- and shortwave (Figure 2). For indoor operation on long- and medium- wave ferrite antennas are often better than wire antennas as they have greater immu- nity to the types of electric field interfer- ence often found inside houses. Figure 3 and Figure 4 show two alternative possi- bilities. In the first example the coils on the ferrite rod form an additional part of the receiver circuit, while in the second exam- ple they replace the fixed inductors on the receiver board, which are taken out of cir- cuit by removing jumpers JP2, |P3 and JP4, The suggested turn counts given are suit- able for use with a 10 mm diameter fer- rite rod with a length of between 9 cm and 1 5 cm. The automatic tuning function of the receiver means that the exact induct- ance value is not critical. Experiments show that the ferrite rod provides good signal amplitude and interference rejection at fre- quencies of up to 10 MHz, and this is why both circuit variations also include a short- wave coil on the ferrite rod. A further interesting option is the tuned loop antenna shown In Figure 5. A wire loop with a total length of 4 m takes the place of JP2. It is possible to make the loop smaller, and the wire length and shape can also be varied. Again, because of the automatic tuning, high signal levels can be achieved, approaching the performance possible with longwire antennas. The radio’s display will show' the capacitance in the tuned circuit: 36 09-2010 elektor Figure 1 . Standard configuration of the front-end circuit. Figure 2. Separate connection of FM and AM antennas. Figure 3, Connecting a ferrite rod antenna for use up to Figure 4. In this variation the coils on the ferrite rod antenna around 1 0 MHz, replace the inductors on the receiver board. as long as this remains between 10 pF and 500 pF the antenna will operate optimally. It is worth noting that the same antenna can be pressed Into service for medium- and longwave reception, in each case forming a part of the total inductance in the tuned circuit. Finally, Figure 6 shows a possibility for shortwave DXing. Jumpers JP2 to JP4 are not fitted and instead we fit a small trans- former at the AM input. The turn counts given are intended for use with a 5 mm for- mer with a tuning slug suitable for opera- tion up to 15 MHz. The same coil was used in the ‘Preselector for Elektor SDR' article in the December 2009 issue of Elektor and is available from Conrad Electronics (order code 516651) orfrom ModulBus (RF coil kit T1 .4) [ 1 ], The input coil replaces the inductor in the tuned circuit on the receiver board, and opens up the possibility of changing the turn count on the antenna side to optimise matching to the antenna. For example, a small coupling winding as shown, consist- ing of just one turn, will give good matching to a 50 Q antenna, PC control PC control opens up a whole new dimen- sion of possibilities to the Elektor DSP radio beyond its use as a portable receiver. The radio can be controlled over a USB interface using a specially-developed program called ElektorDSPl, written in Visual Basic. The program, including source code, is availa- ble for free download from the Elektor web pages accompanying this article [ 2 ], The first step on starting the program is to establish which COM port is to be used: the dcfau I 1 is COM 1 . 1 f, for exa m pie, COM4 is to be used, edit the "COM’ text box in the user interface (Figure 7) appropriately and click on ‘Open*, When the program is closed the COM port setting is saved in the file COM, ini, and the value will be restored when the program is next started. All frequencies and station names are stored in the file DSPfreq. ini, and these are also loaded when the pro- gram starts. The program allows the user to choose a frequency from 20 presets for the FM band and a further 20 presets for the AM bands. The frequencies can be edited individu- ally. For each preset a station name can be given for reference: in the case of an FM preset this string will be shown on the PCs screen, but the display on the receiver will show the station name as transmitted by RDS, In the case of AM presets the station names are sent to the receiver along with the frequency data, and the receiver will dis- play this string when the preset is selected elektor 09-2010 37 RF Figure 5. Connecting a loop antenna for AM, Figure 6. Antenna coupling using an input coil foi DX reception. (by pressing S5 for longer than 0,5 s), This makes tuning to AM presets a little more user-friendly. The settings can be stored in the receiver as power-up defaults by pressing S5 for more than two seconds. All settings, including any changes to the various parameters described below, will then be copied into EEPROM. To erase all these stored settings, hold down 55 when turning the receiver on: everything will then be reset to stand- ard values. The 5 i4735 device in the DSP radio can be configured in a wide variety of ways that determine its reception characteristics. At power-up all these parameters are set to sensible default values, but it is possible to a I ter their values to su it particular reception requirements or conditions. This possibil- ity was kept in mind when developing the embedded software for the radio, and it is possible to control eight important param- eters for AM and FM reception from the PC. If desired, it is possible to set up the receiver with an entirely fresh batch of settings and then save them for when the radio is used as a portable receiver, FM parameters In the interests of reducing noise, FM trans- mitters add ‘emphasis’ (boost of high fre- quencies) to the signal. This must be com- pensated for in the receiver (‘de-emphasis’}* The $14735 features a switdiable de-empha- sis filter. When signal strength is low many FM receiv- ers produce a poor stereo output with con- siderable interference: some radios auto- matically switch to mono mode in these conditions* The DSP radio offers a better solution, smoothly and almost impercepti- bly tr ansitioning between stereo and mono modes. The upper and lower signal strength limits for the transition are adjustable* In very weak signal conditions the DSP radio chip uses a ‘soft mute’ function rather than the sudden muting provided in some receiv- ers, gently attenuating the output and thus also the noise. The parameters control- ling this are the 'mute rate' (speed of vol- ume change), the maximum attenuation (’mute max’) and the SNR (signal-to-noise Table 1. FM properties Property Valid range Effect j De-emphasis Gto2 Treble cut 1 S to ret > 0 to SO dBuV Stereo mode above this signal strength Mono 0 to BO dBpV Mono mode below this signal strength Mute rate 0 to IGOdB/s 3 oft m u te i a t e r > f v c > I 1 u m e chan g e Mute max 0 to 32 c!B Soft mute maximum attenuation Mute SNR 0 to 25 dB Soft mute SNR threshold Seek SNR 0 to 20 dB Automat ic search SNR threshold Seek RSSI 0 to 60 cIBuV Automatic search signal si rengl li threshold Table 2 . AM properties Property Valid range Effect De-emphasis 0 10 1 Treble cut Filter 1 to 6 kHz f dter bandwidth Mute rate 0 1 0 lOHdB/s Soft mute rale of volume c Ivinge Mute slope 0 to 1 GO dB/s Soft mule attenuation function slope Mute max 0 to 32 dB St >f t m u l e m a x t m u mat te 11 ij at ton Mute 1 SNR 0 lo 25 dB Soft mute SNR threshold Seek SNR 0 to 20 dB Au I omatk se.rn h $ N R thi eshold Seek RSSI U l 0 bO dBu V 1 : Automatic search signal strength threshold 3 ® 09-2010 elektor RF ratio) threshold below which muting is trig- gered. It is worth experimenting with these parameters, especially when tuning in to weak stations. The ‘seek SNR' and ‘seek RSSI' parameters affect the behaviour of the automatic sta- tion search function. Stations will only be found if they exceed the specified signal strength (RSSI) and SNR thresholds. Table 1 gives an overview of the FM parameters. AM parameters The parameters governing AM reception (Table 2) are similar to those for FM. An extra is that the bandwidth of the receiver is adjustable to one of a number of prede- fined values. The parameter can take on the value 0 (6 kHz), I (4 kHz), 2 (3 kHz), 3 (2 kHz) or 4 (1 kHz), Here *2 kHz' (the default value) means that the will accept signals out to 2 kHz away from the tuned frequency on either side, and thus corre- sponds to an actual IF filter bandwidth of 4 kHz. For strong stations, using a wider bandwidth can improve audio quality, while for DX reception a narrower bandwidth will help reduce interference. The de- emphasis control has a simi- lar effect, and can be used as a crude treble control. In AM mode there are four parameters that control the soft mute function. The highly effective automatic level control in the receiver 1C increases gain when the signal level falls, which as a consequence also increases noise. If the input level falls below a preset threshold, how- ever, the volu me wi 1 1 be red creed in proportion. The signal level threshold, the slope of the mut- ing function, the speed with which the function acts and the maximum degree of muting are all adjustable. The default values are designed to work well when BSEil Vat 1 | 59 dLi FM AM 1 89300 kHz DKULTIH 1 153 Mr DLF 2 38800 Mr won 5 Mr DLF 3 S6100 Me WDH 3 3 648 Mr BBCWS 4 86509 Me BF85 4 720 lifer WDR2 5 89200 Mr WDH 2 5 ssss kHz RHW G 191300 Mr WOH 4 & 6075 Mr DW 7 102200 Mr E n=n 7 kHz 9 i 02800 Mr DLF 8 Mr H 103390 Me TunklMut 9 kHz 10 105000 Mr E [ten 10 Mz 11 106790 kHz llrvC 11 Mz 12 Mr 12 Mr 13 Me 13 Mr U Me 14 kHz IS Mr 15 kHz IS Mr IE Mr 17 Mr 17 Mz 18 Mz 10 Mz 18 Mr 18 Mz 20 Mr 29 Mr MrUHjtfr Uemaif Dtenphitit < it. * □ * 9 Sl«w « > 49 dflyV Flo 4 l i J 2 kHz Norm 4 * 39rtuV Mule Hale 4 1 64 dC/t M Utr 4 [ 2 dB/i Mule Slope 1 1 1 Zrw/mi Mjh 4 1 > IS dB Mule Max 1 16 dB Mute SNR 4 ► Milo SNR i 5dB Seek SNH < » 3 dB Seek SNA 4 J 1 Seek RSSI 4 > 20 cffiirV Seek RSSI 4 1 25 dtfuV COM4 Optfl | Figure 7. The user interface presented by the ElektorDSPI program. Listinq 1 low-level subroutines Declare Sub Get__int_status ( ) Declare Sub Rxvolume ( ) Declare Sub Power down ( ) Declare Sub Init_am ( ) Declare Sub Init_fm { ) Declare Sub Am tune freq() Declare Sub Fm_tune_f req ( ) Declare Sub Fm seek freq up ( ) Declare Sub Fm_see]c_£req_down { ) Declare Sub Am_seek_f req_up [ ) Declare Sub Am_seek_f re q_ down ( ) Declare Sub Fm tune status () Declare Sub Fm rsq status () Declare Sub Am_tune status { ) Declare Sub Am tune status stop ( ) Declare Sub Amrsq status ( ) Declare Sub Fm start ( ) Declare Sub Am_start ( ) Declare Sub AmseekstepSkhz ( ) Declare 1 Sub Am seek step 5khz ( ) Declare Sub Am_seek_step_lkhz ( ) Declare Sub lnit_rds ( ) Declare Sub Fm rds status ( ) Declare l Sub Rds ( ) 1 Listinq 2 AM tuning and band switching Sub Am_tune_f req [ ) If Fam > 500 Then If Fam > 2000 Then Portb . 0 =1 'SW Porte .3=0 Else Portb .O-O 'MW Porto. 3 = 1 End If Else Portb , 0 = 0 1 LW Porte. 3 = 0 End If I2cstart IZcwbyte 34 I2cwbyte &H4G I2cwbyte &H00 H = High { fam) L = Low (fam) I2cwbyte H I2cw r byte L I2cwbyte &H0Q I 2 estop End Sub elektor 09-2010 39 RF Listing 3 Decoding serial commands $baud = 33400 ' ************ RS232 control ********************* D = Inkey (#1) If D — 102 Then F control 'f , Freq If D 109 Then Mamcontrol 'tn ( Memory AM If D — 110 Then M f m_c ont ro 1 'n # Memory FM If D = 112 Then Proper ! ies Property If D — 105 Then Pc control 12c 'i, I2C command If D — 106 Then Rdsout = 1 ' j s RDS Output If D 107 Then Rdsout *= 0 1 k : RDS output off If D ss 114 Then Print Rssi 1 r : RSSI If D = 115 Then Print Snr ' s ; SNR receiving strong stations. The volume is attenuated by a maximum of 16 dB when the input signal level falls below 1 0 dBj.iV. DXerswill likely not find this behaviour ideal as weak stations will fluctuate unnecessar- ily in volume. So, decide whether the pri- Listing 5 Adjustable properties Sub Properties Print “Property" Input D If D = 1 Then Prop ^ kHUGQ If D = 2 Then Prop - &H1105 If D = 3 Then Prop = &H1106 If D = 4 Then Prop = &H1300 If D = 5 Then Prop = &H13Q2 ' FM_SO FT J4UTE_MAX_ ATTENUATION If D - 6 Then Prop = &H1303 * FM _ S 0 FT_MUT E_S NR _ TH R E SHOLD If D = 7 Then Prop - &H14Q3 ' FM_SEEK_TUNE_SNR_THRESHOLD If D - 8 Then Prop = &H1404 ’ FN_SEEK_TUNE_RSS I THRESHOLD If D - 9 Then Prop - &H3100 If D - 10 Then Prop ^ &H3102 If D = 11 Then Prop = &H3300 If D = 12 Then Prop = &H3301 If D = 13 Then Prop = &H3302 1 AM_SOFTMUTE_MAX_ATTENUAT I ON If D = 14 Then Prop = &H3303 ' AM_SQFT_MUTE_SNR_TH RESHOLD If D - 15 Then Prop = &H3403 If N - 16 Then Prop = &H34G4 If N = 0 Then Prop = &H4Q-0G Input Dat Property End Sub mary purpose of the receiver is to listen to stronger stations or DX reception, and set the parameters accordingly. Many DXers will want to disable the soft mute function entirely: the simplest way to do this is to set ‘mute max' to zero. ' FMDEEMPHASIS 1 FM_BLEND_STEREQ_THRESHOLD ' FM_BLENDMONO_THRE S HOLD ' FM SOFT MUTE RATE ' AMDEEMPHAS I S ' AM_CHANNEL_FILTER ' AM_SOFT_MUTE_RATE 'AM SOFT MUTE SLOPE ' AM_S EE K_SNR_THR ESHQLD 1 AM_SEEK_RSSI_THRESHOLO 'Volume P r og ra m-it-you rse I f The firmware in the DSP radio was devel- oped using Bascom, and the source code is available, along with a hex file, for free download at [3], The DSP radio printed cir- cuit board has an in-system programming connector for the AT megal 68, which allows you to modify the firmware in the radio to your heart s content. If low-level program- ming is not your cup of tea, the ElektorDSPI PC control software described above allows you to customise the receiver without writ- ing a line of code. Furthermore, it is possi- ble to use the USB interface to communi- cate directly with the firmware and alter the receiver’s behaviour. In most cases a simple terminal program is all you need, although it is of course possible to develop programs on the PC to control the radio in specific ways. The Bascom software runs to over a thou- sand lines of source code, too much to describe in detail here. However, the pro- gram includes a large number of ready- made subroutines with self-explanatory names that control some of the basic func- tions listed in the S14735 datasheet (see Listing 1). The subroutine Am_tune_freq (Listing 2) is worth a closer look. It shows how a com- mand is typically constructed for trans- mission to the Si4735 over the I2C bus: the device responds to address 34, In this instance the command code is &H40. After that come four bytes of parameters, includ- ing the frequency in kilohertz as a more-sig- nificant and a less-significant byte. The AM tuning command also selects the required band via the switching diodes connected to ports B.D and C.3. Another aspect of the software worth a look from the point of view of developing spe- cial software for manipulating the receiv- er’s parameters is the way the serial port is handled. The interface runs at 38,4 kbaud and appears to the PC as a virtual COM port (see Listing 3). Each command is headed by a single character. For example, a lower- case T results in the subroutine F^control being called, which sets a new frequency. Commands ’rrf and ’n’ allow the preset go og -2010 elektor memory to be programmed. The ‘p‘ com- mand gives access to the various ‘proper- ties' or ‘parameters' of the DSP fC and the T command gives direct fow-levef access to the SI4735 via the subroutine Pc_controi_ i2c. Read commands are also available. For example, it is possible to read the current signal strength orsignai-to-nolse ratio, and to gain access to the RD5 data. Listing 4 shows how a frequency is set. A frequency in the AM band is set by a com- mand such as *f5955 t : you can try this out using a simple terminal program. In this example, the receiver is tuned to 5955 kHz. FM band frequencies are also given in kilohertz, such as Tl02800 s for 102.8 MHz. The firmware carries out appropriate initialisations when switching between FM and AM modes. After a fre- quency command the unit returns to nor- mal manual operation mode, and so PC commands and manual commands can be executed alternately. The source code of the ElektorPSPI program gives an example of how to control the receiver in this way using Visual Basic. Listing 5 shows the range of functions available via the ‘p* command. A total of sixteen different receiver properties can be adjusted. For example, to increase the receiver bandwidth, use a terminal to send the sequence ‘p102‘. To dis- able the soft mute function, adjust prop- erty number 13 {AM_SOFT_MUTE_MAX_ ATTENUATION) by sending the sequence ‘pi 30\ Even the overall vol- ume can be adjusted in this way, using prop- erty number 0. For maximum volume send *p063\ Listing 6 shows how to access the low-level features of the Si4735* Each command is introduced by the lower-case letter 1’. For I2C data transfer the next character (which specifies the subcommand) should be H C\ The following bytes are transferred as raw binary values. The first two bytes are counts of the number of bytes to be sent and received respectively, and the follow- ing bytes are then sent verbatim in the nat- ural order. The microcontrol ler takes care of prefixing the bytes on the J2C bus with the ftera® jf * am mmt XGS AVR 8 -Bit Main PCB Board! M XGS Gamepad Controller. / 1^25 + Page Printed ManuaiV-^ -jr v pg&Atmel AVR ISP MKli Programmer. Power Supply & A/v Cabfe. = PC Serial Port to XGS Converter DVD-ROM. ^ IGB Micro SD Card + Adapter 4 Bonus: eBooks on Hardware, Game Consol e De si gn , _a nd M ore [ The Most complete: Atmel mega avr Dfv k it Available! WWW. “Continual Development PEAK - making the best, even better. » T~Jg± electronic design ltd NEW MODEL The New Atlas ESR Plus, Model ESR70 S3* *=1 L 1 k‘ a \ k m m New 2mm Probe Connections! This net* model Ql ihi? ramouB Attas ESR offers, .1 1 ihf- gri!.nl teaEuros ch Iho ESRCO but with e a tandf (i rrtftOMimmafll range and audible alt»Ms This is the Atlas ESR Plus' I CapeatSrtCH from HiH to SZOOOuF ■ Equivataeil Senes R«istwice t'ain 0 01 ct-ms JO ohms 1 rex ESR .VKt low rests lance meHynmiflb (iftort tracings i AuSomalK; airufcllod discharge fundigntor yoyr chfli^ec caps 1 Aud-r.'e Alerti i ler good E SR nudr E SR . .‘pen c icui! an- 60000 Then Power-down Wait ms 10 Am = 0 Fm_start Waitrns 100 i End If End I f If Am = 0 Then If Fin < 60000 Then Power_down Wait ms 10 Am ^ 1 Amstart Waitrns 100 End If End If If Am = 1 Then Fam - Fin Am_ t unef r e q Waitrns 250 Am_tune_status End If If Am = 0 Then Fin = Fin / 10 I Ffm = Fin Fm_tune_f req Waitrns 250 Fm_tune_status End If End Sub Listing 6 Direct I 2 C bus access '*** pc 12 c commands **** Sub Pc_control_i2c Print 41 # " 1 2 C " Do Get #1 , Command 'X2C write and read to Si4735 If Command = 67 Then ,,f C" Get #1 , Bytesout Get #1 , Bytes in For N = 1 To Bytesout Get #1 f Di2c (n) Next N I 2 cstart I2cwbyte 34 For N = 1 To Bytesout I2cwbyte Di2ctn) Next N I2cstop If Bytesin > 0 Then I 2 cstart I2cwbyte 35 While Bytesin > 1 Bytesin = Bytesin - 1 I 2 or byte D , Ack Put #1 , D Wend I2crbyte D , Nack Put #1 , D 1 2 c s t op End If End If If Command = 65 Then 'LCD Line 1 Input #1 , Textl Locate 1 , 1 Led Textl End If If Command ^66 Then 1 LCD Line 2 Input #1 , Text! Locate 2 , 1 Led Text! End If Loop End Sub start command and the device address. The receiver 1C is then addressed again in read mode. The requested number of bytes is then read and passed back to the host PC. The ‘A' and ‘B 1 subcommands of the T com- mand are used to send text to be shown on the receiver's LCD panel: the two com- mands allow the two lines of the display to be written independently. The receiver does not automatically return to manual mode after the T command is completed: instead, the device remains under PC control. In summary, the Elektor DSP radio offers a wide range of options, well beyond those offered by a conventional world receiver In particular, it offers an unprecedented array of customisation possibilities. We hope that many readers will build the receiver and exchange their experiences on the forum on the Elektor website, and we fee! sure that you will come up with ideas far in advance of anything we have thought of! (100193) Internet Links 1 1 1 www,ak-mod li l-hus.de {site only available in German: search for Tlf Spufen Bausatz T 1 .4') 1 2 1 www . el ek t o r. c 0 m / 1 ( HI ) 93 (web pages accompanying this art ide) 1 3 j w ww - e l e k l or, c om / 10012 6 (first ar \ ide in ’ hh set ies) 45 09-2010 elektor uwmjinninnw ■IHLirJUNHKKfB Examined HM02524 By Harry Baggen and ^ ■ Ton Giesberts (Elektor jg???rj .'?T5gai Netherlands Editorial / To an electronics designer — — — — — an oscilloscope is some- “i;-“ ~ thing like an extension of his brain. As soon as anv r trifling bit of hardware has — — J * j L I 1 *- ^Li-rw h * I I I a I ,■ , (71 nMp ’ V* * ; been slapped it needs to be checked. An oscillo- scope is then an indispen- l sable tool (in addition to a tt^alWMKIgsasgaaMdli the equally indispen- mj sable multimeter, of mj course). You use it to whether and oscillator is working properly or whether there is a signal at a certain place in the circuit. Alternatively you can use it to make more accurate measurements of more complex waveforms. Nowadays, all kinds of bus signals from microcontroller circuits B was left in the hands of The name Hameg con- jures up fond memories for many electronics 1 engineers. This Ger- I man company was fl one of the first com- I panfes to make afford- able and usable oscil- loscopes available, long before China and other Asian countries started to compete with their prod- ucts. The prices were such that even for hobby use it became interesting to pur- chase such a scope, in the meantime the company has specialised in products with a very good price/quality ratio and a high reliability. That the products made by Hameg have a good reputation is also shown by the fact that the renowned test equipment manufacturer Rohde & Schwarz a scope which can cope with both analogue and digital signals are added to that too. You could use a special logic ana lyser for this, or a scope which can cope with both analogue and digital signals. Some time ago, Hameg made an offer to Elektor, for us to try out one of their new oscilloscopes for a while. Now, the EJek- ^ j tor lab is always keen j [ , , * , , to do that. Especially - = the more expensive products produced by Mr. Grimm, he arrived a few weeks later at Elektor House with a ^ brand new scope and Ml' - the necessary accesso- ries. He gave an elabi)- Hp rate demonstration of the capabilities of this “ bought the company in 2005 to expand their product range at the bottom end. And we probably won't have to tell Elektor readers about the quality (and also the price) of R&S gear, these are at the top of the range! In recent years Hameg has expanded their - product range at the •j ■ top end with more 1 • ncrf Ay expensive and more U| powerful models. One / j.. del of the reasons is a bet- ter fi t with the products its big brother R&S j^\) has to offer. And it is I W j f allowed to test drive for p a while: the HMO 2524. ||Hp / t fl This is a powerful, dig- yl L # ital, 4-channel scope with an ana ^°9 ue hand- j width of 250 MHz and / I if a real-time sampling- elektor 06-2010 L. n -1 j 1 «*i *’■ ■ j *i\ E-LABs INSIDE E-LABs INSIDE rate of 2.5 GSamples/s (when operating in 2-channel mode). The price of the base version of this scope is around 3300 Euros (exd. VAT), The scope can also be used as a 16-channel logic analyser. Additional software options are available to test buses with protocols such as I2C, SPI and RS-232, Of course, for our practical test we had several 'pods' (adaptors to make the digital connections) available to us and the required soft- ware options were also activated in the scope. Various types of probes were obviously present as well and we also had an active probe with an input capacitance of only 0.9 pF (suitable for measurements up to 1 GHz). The first thing you notice when switching the scope on is the bright and dear display, which has a resokition of 640 x 480 pixels and an LED backlight, it is a pleasure to look atl In the lab we have several digital 'all-round' scopes in the price range from 1000 to 3000 Euros and none of those comes even dose to competing with this. The number of options is overwhelming, you will have to invest quite a bit of time before becoming familiar with all the niceties. However, the user-friendliness does suffer a little as a result, because of all these options and with only occasional use, even the most simple settings can be a chore to find in the menus. During our first measuring attempts, Ton, who has more than 20 years experience in the lab and has worked with many differ- ent scopes, did need quite some time to dig through a number of menus to finally find the appropriate settings to give a dear test signal on the screen. The quality of the displayed signal, after some effort, is outstanding however. Moreover, the scope reacts quickly to changes in settings, something that is regret- tably not the case with many digital scopes. But a scope with this many options forces you to have a good read of the user manual (something that our designers — just like other users of complex equipment “ do only rarely and then reluctantly). So the number of features is extremely large. There are numer- ous trigger modes, there is a sizeable buffer of 4 MSamples where you can search for signals in various ways, there is a very usable FFT-f unction and there are many cursor measure- ments as well as mathematical functions that you can program yourself. What's more, we haven't even mentioned the digital sig- nal measurements yet. This gives you the ability of meas- uring 16 digital signals simultaneously, at a rate of up to 1 ,25 GSamples/s, also with very extensive trigger options. This does, however, require special pods to connect the digital sig- nals under test to the connections on the scope. Depending in the type of bus you want to look at you may have to install addi- tional software (available for I2C, SPI, UART/RS232). With this many signals displayed on the screen at the*same time, it can become very cluttered. To keep everything welt- organised, Ha meg have made a very handy scroll function that allows you to move through a virtual screen which is a lot bigger than the real screen. We like it a lot! This new series of oscilloscopes From Harneg, which are, consid- ering the price, above their existing range of analogue/digftal equipment, can easily compete on capabilities and features with comparable products from other scope manufacturers such as Agilent, LeCroy and Tektronix. The HM02524 is an excellent and reliable test instrument for both analogue and digital measure- ments, But if you are considering purchasing such an instru- ment you should have the applications to put its many abilities to good use and you will have to invest the time to become pro- ficient with all its features (but this is equally true for any scope in this price range). Unfortunately the scope had to go back to Ha meg. We will especially miss that crisp and bright screen. Is it really not pos- sible to swap it for a few of those other oscilloscopes that we have sitting around here? (100420-1) Internet Link: www.hameg.com Know what you’re measuring By Thijs Beckers (Elektor Netherlands Editorial) At our editorial offices we receive quite a few submissions describing ideas and designs for electronic circuits from read- ers and authors. All submissions are looked at and receive a cur- sory assessment as to their usefulness and correct operation, as part of an initial sorting procedure, before putting some serious effort into it. This also applied to a submission for sorting the best (audio) capacitor from a cof lection of capacitors. At first glance the described method showed much promise: without special (expensive) test equipmen t it would be possible to com- pare the quality of capacitors with each other and select the better one(s). This looked like a very interesting design to us. The measuring method is described below. 06-2010 elektor The figures show the test arrangement. The top circuit is used fortesting bipolarcapacitors* The bottom circuit provides polar- ised electrolytic capacitors with a bias voltage fortesting those types. In each case the bottom capacitor (C2 and C4 respec- tively) is the ‘reference capacitor' and the top capacitor (Cl and C3 respectively) is the ‘CUT* (Capacitor Under Test), The idea behind measuring with a bias voltage is that a polarised electrolytic capacitor will distort (even) more when the voltage across the capacitor is allowed to become negative, which Is potentially the case with an audio signal. By giving the electro- lytic capacitor a sufficiently high bias voltage, a negative voltage across its terminals can be prevented* The oscillator generates a square wave* which is then divided across both capacitors. The voltage across both capacitors is then visualised using an oscilloscope. By operating the oscillo- scope in X-Y mode* specific figures are created which depend on the differences between the capacitors. A ‘perfect 1 diagonal line means that both capacitors are exactly identical, meaning the CUT is oft he same quality as the 'reference capacitor*. Any deviation from the diagonal, such as hysteresis, asymmetry or non-linearity means that the CUT is different from the refer- ence capacitor. These differences could conceivably be a larger series resistance, dielectric absorption and other non-linearities* Within this context, it*s obvious that the reference capacitor And because we were also unable to find a way, without using expensive equipment, to establish whether the difference was caused be a difference in capacitance, we regrettably had to reject this article proposal. The problem with this circuit is that you do not really know what you are measuring exactly. That makes the proposed method unsuitable for detecting quality differences between various types of capacitor. it is not possible to establish the quality of a capacitor with ‘cheap’ equipment needs to be a specimen of high quality. During our measurements in our test set-up the idea looked promising, it was indeed possible to clearly see the differences between different types of capacitors. There was an obvious non-linear distortion of the diagonal when a tantalum capaci- torwascompared to an MKT type, and the difference between an MKT and MKP device was clearly smaller than tantalum MKT. but still dearly visible. What we also experienced during these measurements, is that a difference in capacitance also resulted in an alleged (qual- ity) deviation. When comparing a 4,7 uF Wima MKP-capaci- tor (the reference) with a 4,7 uF MKT capacitor the difference became smaller (the 'eye 1 of the diagonal became narrower) when a 100 nF capacitor was connected in parallel with the MKT device... even when an electrolytic capacitor of 1 uF was connected in parallel with the MKT, the difference from the ref- erence capacitor became smaller* And when making the meas- urement using a square wave at high frequency (several hun- dred kHz) very strange things started happening on the scope screen; at both ends of the diagonal there were strange peaks which could not be explained by any differences between the capacitors and which are potentially caused by parasitic induct- ances in the test set-up. A (small) difference in capacitance results in such a large devia- tion that we were unable to establish whether we were deal- ing with a bad capacitor or just a difference in capacitance* Unfortunately we have to conclude that for the time being it is not possible to establish the quality of a capacitor with cheap' equipment. But we fortunately still have our ears, which we can use to test the capacitors in the signal path for what is still the most important characteristic in audio circuits: the sound quality. (100482) elektor 09 -2010 45 E-LABs INSIDE rial, two more boxes in which were nestled some 50 cm long plastic tubes containing the miniscule samples. The total volume of the chips themselves can hardly be more than 1 cubic centimetre! We are slowly becoming more aware of our impact on the environmental and car- bon footprint but something happened in the lab the other week that made us smile: for an upcoming project one of our team, Clemens Valens ordered four 1C samples from the chip manufacturer Analog Devices. One week later the editor of our French edition of Elek- tor took delivery of a surpris- ingly large (at least 30 litre) parcel. The complete par- cel weighed-in at 1 .3 kg and on opening he found, sur- rounded by packing mate- From the labels on the box the package began its jour- ney to France in the Philip- pines. Needless to say* Cle- mens was relieved he wasn't paying for the samples or the post and packing on that one! (100240) And dropping by at Elektor erful boards look interesting but the Codecs are protected by strict licences so we are unlikely to see them making an appearance in an Elektor multimedia player in the near future but stay tuned - we're working on it... (090928) Useful spares or toxic waste? few exceptions we use RoHS compliant components and lead- free solder. For purely personal use however there is no reason why you cannot mix RoHS with non-RoHS in the same design although the aim of course is to reduce hazardous substances in the environment". Antoine also recommends using lead-tin solder; it's easier to make a clean joint Lead-free solder has a higher melting point so we can assume that RoHS compliant components are designed to tolerate the hig her temperature encountered during the solder- ing phase but sadly this is not always the case and we still occa- sionally get problems! On the workbench at home the average hobbyist isn't able to control the temperature and recommended soldering time to the same degree. In general the older non-RoHS component types that soldered without trouble are likewise in their RoHS variant also likely to be fairly trouble-free. (100220) The Feedback form on the Elektor website is the first place to go if you have a question about any of our projects or produc ts (as well as giving us feedback on any article that caught your eye). Gen- eral technical questions can best be posted on the reader's forum on our website. There are exceptions though. Unable to find an answer in the forums a reader wrote to us recently with a ques- tion that's been bothering him: *1 am sure I am not alone in hav- ing a large box of old components lying around under my bench. Is it possible to mix newer RoHS compliant components with older non-RoHS components? Any tips from the Elektor lab?” We put the question to Antoine Authier* head of the laboratory here at Elektor: “It depends entirely on whether the components are fitted to equipment which will then go on to be sold commercially. Here in the Elektor labs our production facilities conform to the current regulations for commercial production. With very 09-2010 elektor 50 PIC Microcontroller projects A laser alarm, USB teasing mouse, soundswitch and much more This book contains 50 fun and exciting projects for PIC microcontrollers such as a laser alarm, USB teasing mouse, eggtimer, youth repellent, soundswitch, capacitive liquid level gauge, "finger in the water 1 ' sensor, guarding a room using a camera, mains light dimmer (1 1 0-240 volts), talking microcontroller and much more. Several different techniques are discussed such as relay, alternating current control including mains, 32C, SPJ. R5232, USB. pulse width modulation, rotary encoder interrupts, infrared, analog-digital conversion (and the otherway around), 7-segment display and even CAN bus. Three PIC microcontrollers are used in this book, the 16f877A, 1 8f4455 and 1 8f4S85. It is also discussed how you can migrate your project from one microcontroller to another - 15 types are supported - including two example projects. 440 pages - ISBN 978-0-905705 88 -Q £36.00 * US $58*10 Elektor Regus Brentford 1 0 0 0 C rest West Roa d Brentford TW8 9HM United Kingdom TeL +44 208261 4509 Further information and ordering at www.elektor.com/shop 1ft „ elektor 09-2010 47 REVIEW: AUDIO DSP By Harry Baggen (Elektor Netherlands Editorial) Audio hobbyists usually confine th6ir hobby to the ana log U6 domain, since the opportunities fordoing your own experimenting in the digital domain are very limited. There is very little affoidable equipment available that allows a multitude of digital-audio processing operations and getting started with DSPs yourself requires a considerable depth of knowledge of this subject matter. With the modules from miniDSP you can easily realise al! kinds of audio processing functions without the need to become intimately familiar with digital signal processing. In the audio world, DIV is most certainly not dead yet There are still plenty of people who design/build amplifiers and speaker boxes or modify existing equipment. Despite the fact that the soui ce mate- rial (the music) and the playback equipment are usually digital, there are stilt sufficient opportunities for tinkering to your heart's content with the analogue stages that follow. Nevertheless, you will have noticed that more and more audio processing is taking place in the digital domain, ranging from signal processors to digital power amplifiers. This is quite a complicated world for the average audio hobbyist, where there are now few or no opportunities for doing anything yourself. Still, it ts becoming increasingly interesting to familiarise yourself with the possibilities that these digital tech- nologies have to offer, A digital crossover filter for an active loud- speaker system comes to mind, which would allow easy adjustment of the crossover frequency, slope, filter type and delay between the drivers. It is true that there are a few systems on the market which offer you the possibility of experimenting yourself (for example the ampli- fier module AS2.100 from Hypex. which contains two digital power stages and a DSP for filtering and equalisation, or the semi-profes- sional DCX2496), but overall the choice is very limited. The young company miniDSP, established in Hong Kong, comprises several engineers who came up with the idea of marketing flexible and affordable digital audio products for both hobbyists and pro- fessional audio equipment manufacturers. The objective here was to keep the programmability of these products as simple as pos- sible. In practice this means that you buy a board with a DSP on ft and then you choose the required functionality from the soft- ware applications that they offer. This software is configured using a comfortable user-interface on your PC. So you only have to type in a crossover frequency and a slope for the filter and the DSP will do exactly what you have asked it to do. There is no need for exten- sive knowledge of DSPs and programming, and (almost) none for digital audio technology. The basis of the entire system is the miniDSP board, a printed circuit board measuring 7.5 by 7.5 cm, which contains a DSP and a number of connectors. To this you can add an l/Oboard, which has a num- ber of digital Inputs and outputs (minlDlGI) and a board with four digital power stages (miniAMP). All boards have identical dimen- sions and can easily be stacked together and interconnected. Using the so-called audio plug-ins you can determine the functionality of the DSP board, that is, the software you put into the DSP. At the moment, plug-ins are available for 2- and 4-way crossover filters with equaliser (in simple and advanced implementations) and a mixer with 31 -band graphic equaliser. Work is in progress for other plug-ins. The plug-ins work in combination with Adobe Air, which you have to install on your computer beforehand. Double-clicking the down- loaded plug-in is then sufficient to install it. Figure 1 . The miniDSP board has two analogue Inputs and four outputs. 48 09-2010 elektor R W: AUDIO D: takes care of the communications between the com- putei and DSP, using a USB-interface. The board can be easily connected to other audio components using the RCA connectors (2 Inputs, 4 outputs). The board uses audiophile quality electrolytic capacitors from Nichi- con for a minimal influence on the analogue signals* On each side of the board there is a header for inter- connecting all the relevant signals to other miniDSP boards. There is also the option of connecting a potentiometer, which can be used to control the volume in the DSP, If you require digital inputs or outputs (for example, because you want to go directly from a CD player, or you want to connect the processed signal in digital form to some other equip- ment), then your needs are met with the miniDICI board (Figure 2). Here you will find two coaxial and two digital inputs and a coaxial and optical output. This board is available with and without trans- formers for galvanic isolation of the coax connections. The heart of this board consists of a sample- rate converter (SRC43 821 from Tf) which will convert all sample rates up to 216 kHz to 48 kHz, which is the operating sample rate of the DSP. Using a jumper you can select which of the 4 inputs is used and another jumper is used to select which signal is routed to the digital outputs (for example the input signal or the DSP processed signal). The board can also be used to de-jitter an S/PDIF-input signal. The last of the currently available boards is the miniAMP (Figure 3). This board contains First, let's take a look at the hardware. At the core of the miniDSP board (Figure 1 ) is a ADAU1 701 from Analog Devices. This processor was developer specifically for audio applications. Most of the calcu- lations are carried out In 56-bit double precision mode for an accu- rate result. The 1C, in addition to the DSP, also contains 24-bit A/D- and D/A-converters which operate according to the sigma-delta principle, which ensures a large dynamic range. The program for the DSP Is automatically read from the serial EEPROM on the board when the power supply it turned on. In addition to the DSP and EEPROM the miniDSP board also contains a PICT 8F1 4K50, which Figure 2. The miniDICI board contains a sample rate converter and Figure 3. The third board, the miniAMP, contains a class-D offers a substantial number of inputs and outputs, amplifier-IC with four output channels, which can also be bridge connected* elektor 09-2010 49 REVIEW: AUDIO DSP Figure 4. The design of the software. From this overview you can select each function block. Figure 5. Here we can see the part for the crossover filter. You can select the crossover frequency, type of filter and slope. At the same time you can choose a band -pass filter. four digital amplifiers, which can be bridge-connected for a stereo version with a higher output power The power amplifier 1C on this board is a TAS5704 (also from II). This can generate an audio power of 4 x 10 W into 4 fi or 2 x 20 W into 8 Q in bridge configuration. Thanks to the class-D design of this amplifier it has a high efficiency (90%) and a small heatsink mounted directly on the PCB suffices for the cooling. The electrolytic capacitors are made by Michicon, but these capacitors are not necessary in bridge configuration and can be linked out using jumpers. The TAS5704 is presented with the audio signal in digital form, so the D/A converters of the DSP are therefore not used. Although the output power of this board is not all that high, it is ideal for experimenting because you have 4 power amplifiers at your disposal, just connect the drivers via a few cables to the screw terminals and you can immediately evaluate the effect on the sound of any of the DSP settings that you make. The printed circuit boards all have identical dimensions and can be assembled one on top of the other with stand-offs. Short ribbon- cable interconnects are supplied to make the connections between the boards. The power supply for the miniDSP board an be provided by the USB connector mounted on the board. The miniDIGI board and miniAMP board both contain a standard DC power supply jack for connecting a mains power supply. The power supply voltage may range from 4.5 to 24 V for the miniDSP and miniDIGI, the min- iAMP board requires 12 to 24 V. Connecting and testing For this test we received a complete set, comprising a miniDSP, miniDIGI and miniAMP. We selected a miniDSP version with an input range of 2 V, so that you can directly connect the output from a CD player to it (there is also a version with a 0.9 V sensitivity avail- able, to which you could easily add a voltage divider, if need be), 1 he boards are connected together using very short interconnecting cables (see opening photo). There are plenty of possibilities with this complete set of boards, but in practice you would only buy those boards that you need for your particular application. If, for example, you want to add a digital crossover filter to a loudspeaker box with analogue inputs and use existing power amplifiers then you will only need to buy a miniDSP board. If you would like digital inputs with that then you will also have to buy the miniDIGI board. And should you want to experiment regularly with several differ- ent loudspeaker boxes, then the miniAMP board could be a very handy accessory. The boards are supplied completely assembled. You effectively only have to connect a power supply and you are ready to get started. Well, that is after you have set all the jumpers on all the boards appropriately. In particular the miniDIGI board contains a large number of jumper settings, among others, for the correct intercon- nections of the I2S signals between the boards. 1 his can be quite confusing initially. Fortunately the miniDSP website contains docu- mentation with various example configurations, which show exactly which jumpers have to be placed where for a certain combination of boards or application. In addition, the developers have advised us that they are continually busy with further improvements and expansion of the documentation. Even during the time we were doing our evaluation there appeared several updates to the soft- ware and documentation. For the software-example for this test we choose a two-way filter with built-in parametric equalisers. This is an excellent test project for such a system. In the first instance we connected the entire module to our Audio Precision System II to check the operation and perform a few meas- urements. The module was powered from a large regulated mains power supply (power supply voltage was 24 V). To get a feeling for the affect that the DSP has on the a nalogue audio signal, all the filters in the software were set to ‘straight through' and we supplied a digital signal via the miniDIGI board. We then measured the distortion of all the analogue outputs of the DSP, These were very low, about 0.005% at 1 kHz at nearly 1 00% signal level. This value changed very little when we switched to the ana- logue Inputs of the DSP. that is, the A/D converters are now also 50 09-2010 elektor PARAMRBC FOu*i ■!« MfnJl C 1* i;?jf i £Q lJinCi niitrjUPH •re. Mvq.EI PtJ ‘-■M.ii © HI '■■«, u fff ’riq 33 H> r, w Ki US* rr n M riJC Hf | B JL ' * MEMORY RESOLUTION PRICES Latest Software Updates: PC & CAN bus decoding, mask limit testing, advanced triggers, digital low pass filtering, rapid triggering www.picoauto.com/scope2018 elektor 09-2010 REVIEW: AUDIO DSP Figure 7, MLS- measurement where the time delay between woofer and tweeter was changed in small steps until the response around the crossover frequency and time delay was measured, Red = no time delay, blue = 0.2 ms time delay, about 7 cm. crossover plug-in you can select in the first block the attenuation of the input signal. This is followed by a parametric equaliser for each channel with up to 6 configuration settings. Subsequently we arrive at the crossover part where for each driver you can select the crossover frequency, type of filter and the filter slope. The available filter types are Bessel, Li nkwitz- Riley (12, 24 and 48 dB/ octave) and Butterworth {6 to 48 dB/octave), You can also expand each filter to a band-pass type, for example to protect a small woofer from frequencies that are too low or to combine a two-way system with an already existing active sub-woofer. This section is then followed by the 6-band parametric equaliser, which allows individual correc- tions to be made for each driver. In the final block you can set the attenuation and time delay for each driver. The latter Is particularly important with the Linkwitz-Riley filter type because the woofer and tweeter need to have their acoustic centres perfectly above each other. The correction has quite a wide range, up to 7.5 ms, that is equivalent to more than 2,5 m. Once all the necessary settings have been made you can dick the green 'Synchronize' button and the software will make the connec- tion with the (via the USB-cable connected) mini DSP board. The set- tings you made are then sent to and stored on the miniDSP board. The firmware for the DSP is also automatically updated, if that is necessary. The green button disappears after synchronising, which appears a little strange at first. Is no further synchronisation pos- sible? There is. After synchronising, all the changes you now make are immediately transmitted to the mini DSP board, in other words, you have a 'live' connection. So you can experiment to your heart’s content and change all kinds of things. You can, for example, con- nect a music signal and hear immediately what the effect of each individual change is on the sound image. So while experimenting with our two-way speaker box we could very easily change the level of the tweeter while listening to it and even play with the time delay between woofer and tweeter. A fantastic opportunity for experi- menting with D!Y loudspeaker systems! When the program on the PC Is closed the last settings are automatically stored in the memory on the mini DSP board. When you’re done experimenting, you can mount all the boards in the loudspeaker enclosure, together with a suitable power sup- ply and power amplifier. As already mentioned, the miniAMP Is very handy for experiments, but for a final loudspeaker system it would be better to choose a few bigger (and better quality) power amplifiers. Verv handy With the miniDSP-system you can in a very simple manner and a very short time assemble an audio circuit which would be much more difficult to realise using analogue components. Consider an active crossover filter with delay time correction and a few fre- quency corrections. With this system it is done in the blink of an eye. You do not require any knowledge of DSPs, but you will need, of course, knowledge and experience in the area of filter and loud- speaker technology. But this you will need anyway, if you are going to develop your own loudspeaker systems. The method of directly changing the settings from your computer works really well and even encourages you try out many more things than you were per- haps originally planning to do. After all the experimenting you can simply build a final version by building the miniDSP board with power supply and suitable power amplifiers in a loudspeaker box. And, if after a while you decide that these settings are not quite ideal, then it is very quick to connect a PC and make the necessary corrections. Despite the extensive capabilities of the miniDSP system it is very affordable. For most applications you will only need the miniDSP board and you’re done for $99 plus $10 for the plug-in. One board on its own is capable of driving two two-way speaker boxes. How- ever in most cases it will be more convenient to build a miniDSP board into each speaker box, in addition, the board has sufficient computing power to implement a four-way filter. The audio quality of the miniDSP board is quite good, but we can imagine that some audio enthusiasts are not satisfied with this and would prefer to use other A/D- and D/A-converters than those that are built into the DSP. This is also a possibility with this board, by using the l2S4n- and outputs on the miniDSP board. And there are many more adjustments and options. The most important thing is that with these boards you can very easily make a start with digital audio processing. And all that for a very attractive price! (100453-I) Internet Link www. mini d sp .com miniDSP. rev A (0,9 V) of rev B (2,0 V): $99.00 min DIG I rev A (less 5/PDIF-trabsformers): $55.00 minDIGI rev A (met S/PDIF-trafo’s): $60,00 miniAMP: $60.00 Audio plug-ins; $10.00 each Kits of various combinations of boards are available as well. 52 09-2010 eiektor Subscribe now to the leading American trade journal in the field of microcontrollers and embedded applications! Tho A-Vo.JtJ-mfc CuttotA Loop, p. \ VftflM* a Pro r * t'ottroftta' P Embedded Safety and failure NVode Analysts How to Measure a Crystal's Properties \ advanced features i\ oi USB Explained i\ “iasSfe Select your personal subscription at www.cc-access.com/subs 12 editions per year for just Print: $63 Digital: $38 Print + Digital: $90 CIRCUIT CELLAR |!IL MAGAZINE- KlIH COMPUTER API’UC MlONS UNILAB DISPLAY Dual Voltage/Current Display By Ton Giesberts (Elektor Labs) The Unilab power supply module described in the April 2010 edition is a compact, adjustable switch-mode power supply unit that is very well suited to building a single or dual lab power supply. For this application, we have developed a special meter circuit in the Elektor Labs with a four-line display that shows the output voltages and currents of a symmetrical configuration with two Unilab circuit boards. If you wish to build your own lab power supply, it's only natural to want to equip it with separate meters for voltage and cur- rent. With a symmetrical power supply, this amounts to two sets of two meters. Although a variety of small, ready-made display modules with LCD or LED readout are commercially available, they have two drawbacks. The first is that they aren’t espe- PCO (ADCO) | C3 pci (ADC 1 j ATmega163 PC2 (ADC2) PC 3 (ADC 3} PC i (ADC^SDA) PC5(ADC5/SCLJ PDO(ftXD) PD1 (TXB| f>D2 (INTO) PD3 (INTI) PDA (XCK/T5) PD5 (T1) PD6 (AINO) PD7 (AINIf .L- HI it 4 ► — 5 6 11 u 12 1 13 n COMMON MODE ADJUST Cl 5 220m Ml 25V Cl 6 220u 25V 4 — * 100166-11 09-2010 elektor 54 UNILAB DISPLAY LCD1 4x20 Figure 1. Schematic diagram of the dual voltage/current meter for a Unilab power supply. Naturally, it can also be used for other applications. dally cheap, which means you're looking at a tidy sum if you need four of them. The sec- ond is that connecting modules of this sort to a power supply is always difficult. The amplitude and polarity of all of the meas- ured quantities must be adapted to obtain optimal resolution with the selected mod- ules, and in many cases it T s necessary to make certain measurements with the meter floating relative to the actual power supply. As the Unilab module is highly suitable for putting together a symmetrical DIY lab power supply, we decided to develop a sepa- rate display unit for this purpose with a large LCD module that shows the voltage and cur- rent of both halves of the supply, along with the temperature inside the enclosure. All in all, this solution is certainly no more expen- sive than four separate modules, and what's more it is much more attractive and guar- anteed to work properly. The latter reason is probably the best argument for building your own display module. Design Before we explain how the circuit works in detail, it's a good idea to describe the over- all design (Figure 1). The 'core intelligence' of the circuit is provided by an ATmegal 68, an Atmel microcontroller with (among other things) six A/D converters. Here we use four of them to measure the two load currents and the two output voltages. The clock signal for the microcontroller is gen- erated using an external 10-IVfHz crystal The portion of the circuit around opamps IC1 a-ICI d provides signal conditioning for the current and voltage sense signals before they are fed to the A/D converter inputs of Features * Readings shown on a large backlit LCD module with 4 fines of 20 characters * Voltage and current of each supply output (positive and negative) displayed * Internal temperature of PS enclosure also displayed ■ Selectable C or : 'F temperature indication * Signal conditioning circuitry specifically designed fora dual Unilab power supply * Software-aided calibration procedure * Powered by a separate transformer (2 * 8 V / 3.3 VA) O (ADCG-ADC3). This portion is discussed separately below. Resistors R17-R20 and diodes D1-D4 protect the A/D converter inputs of the microcontroller against nega- tive voltages. Only the positive inputs need to be protected against excessive positive voltages, since the other measurement sig- nals never exceed +5 V. The LCD module that displays all the read- ings has 4 lines of 20 characters and is driven directly by the microcontroller. The con- trast can be adjusted using P4. Transistor T] (which is driven by port PB1) allows the brightness of the backlight to be adjusted or switched off. The software causes the back- light to blink if the power supply is over- loaded (output current greater than 3 A). The supply voltage fine to the LCD module is strongly decoupled by R14, C7 and C8 to avoid any interference on the A/D inputs. As a bonus, we included an LM35 (IC2) that can be used to monitor the temperature inside the power supply enclosure. The tem- perature sensor provides an output voltage of 1 0 mV/K and is powered from the +5 V rail Jf you want to have the temperature displayed in degrees Fahrenheit, simply fit jumper J1. In this case the 'Con the display is replaced by l F T and the Celsius tempera- ture signal from the LM35 is converted to Fahrenheit using the formula T [ Q Fj = T [°C] x 9/S + 32, K3 is the ISP connector. This is handy if you want to modify the software to suit your own wishes. K4 is a debug connector. An Elektor USB/TTL adapter cabfe (# 080213- 71 ) can be connected directly to K4, elektor 09-2010 55 UNILAB DISPLAY COMPONENT LIST Resistors (0.25 W unless indicated otherwise) R1 -499U 1%0.6W R2- I.OOkn 1% D.6W R3.Rl5.R21,R22,R23-10kn5% R4.R6 = 1 OOkfl 5% R5.R16 - 68 kll 5% R7-3.3kn, 5% R 8 = 47kn 5 % R9 - 12kH 5% R10-45.3kft 1%0.GW R1 1 ,RI2 -24.0kH 1% 0,5W R13.R14 = 6.81kfl HS0.6W R17*R18.R19,R20-100i2 5X R24-4.7D 5% R25 = 470n 5% R26 * 1 5il 5 % PI - 2000 trim pot, e.g. Vishay Spectral type M64W201KB4Q P2 - Ska trimpot, e.g. Vishay Spectrol type M64W502KB40 P3 = 5000 trimpot, e g. Vishay Spectrol type M64W5Q1KB40 P4 = 10kQ trimpot, e.g. Pi her type PT 1 QLV1 0- 1 03A202G Capacitors C 1 X4X5X6X8X9X1 0X1 3X 14 - 1 QGnF ce- ramic, lead pitch 5 mm C2 P C3 = 1 5pF 2%, ceramic, lead pitch 5mm C7 - 1 OOljF 25V, radial, lead pitch 2,5mm Cl 1 .Cl 2 - lOuF 63V, radial Jead pitch 2.5mm Cl 5 .C 1 6 = 220 jiF 25V, radial, lead pitch 3.5 mm C17.C18X 19X20 = 47nF, ceramic, lead pitch 5mm nductor LI = 10pH 10%. axial, Rs -0.29H, eg, Epcos type B78108S1 1 03 K Halfgeieiders: D1,D2,D3.D4*D5 - BAT85 T] = BC639 1C 1 = LMC6464BIN IC2 = LM35CZ O - ATmegalSS ^OPU, programmed, con- tained in kit # 1001 66-7 1 IC4 = 7805 1C5-79L05 B1 - BOV, 1.5 A bridge rectifier (pinout ™ “ e.g. Semikron SKBB80C1 500L5B Miscellaneous K1.K2.K3 - 6-pin (2x3) pin header, lead pitch 0.1 in. (2,54mm) K4 = 6-pin pin header, lead pitch 0.1 in, (2.54mm) K5.K6 -= 2 -way PCB terminal block* lead pitch 5mm J1.S1 « 2-pin pinheader, lead pitch 0,1 in, (2.54mm) LC01 * 1 6-pin pinheader. lead pitch 0.1 in. (2.54mm) LCD1 - 16-pin SIL connector for display, lead pitch 0.1 in. (2.54mm) XI = 10MHz quartz crystal, HG49/S, 50ppm, C L " 12pF LCD, 4x20 characters with background light- ing. dim 60 x 98 mm, e.g. HTDI5PLAV HC20040 1 C-YF62 L-VA PCB# 100166-1 Software en PCB design files: free download Kit of parts inch PCB. programmed controller and LCD: Elektor order # 1001 66-71 Details at www.elektor.com/ 100166 Figure 2. The double-sided PCB is exactly the same size as the display module. Tweaking and shifting To build a symmetrical lab power supply, you connect two Unilab power supply mod- ules (# 090786-1 or 090786-71 ) in series* with the junction of the plus output of the one module and the minus output of the other module forming the neutral terminal of the overall power supply. Unfortunately, this makes it difficult to measure the out- put current of the negative supply* since the sense resistor for current measurement Is located in the negative output line of the power supply module. This means that the voltage on the sense resistor floats on top of the output voltage. Consequently, the out- put voltage must be suppressed in order to measure the voltage across the sense resistor. The Unilab circuit board has a connector (K1 on PCB # 090786-1) that makes it easier to measure the current and voltage. With the positive supply module, the voltage and current can be measured using pins 1 and 4 of this connector. Pin 2 is connected to the minus output terminal on the PCB and thus serves as the ground connection point (the neutral terminal of the symmetrical power supply) for the display PCB. With the nega- tive supply module, pins 2 and 4 are used to measure the voltage and current, respec- tively. Here pin 2 is connected directly to the negative output voltage* and the volt- age between pin 2 and pin 4 is proportional to the voltage across the sense resistor. In order to allow the various quantities to be measured accurately using the interna! A/D converters of the microcontroller, the full range of the voltage or current sense signal must lie within the full-scale range oi the A/D converter. Here we use the internal voltage reference, so the full-scale range of the 10-bit converters is 1.1 V. This means that it is not possible to measure negative voltages. Measurement setup for the positive supply As the positive output voltage can range from 0 V to approximately 30 V, all we need in order to measure this voltage is a voltage divider. It is located on the power supply board (R1 5 and P7), but it must first be adapted to our requirements. By reduc- ing the value of R1 5 on the positive supply module board to 5.6 kO (preferably using a 0.6-watt metal film resistor), we can use P7 to adjust the voltage on pin 26 of the micro- controller to less than 1 .1 V at the maximum no-load output voltage. The exact value is not especial ly i important, since everyth ing is sorted out by the calibration procedure. Measuring the current is a bit more compli- 56 09-2010 elektor UNILAB DISPLAY cated. On the power supply board, the volt- age across the sense resistor is first fed to amplifier ( IC3a) with a gain of a pproxi ma tely 4. The output signal from this stage is avail- able directly on pin 4 of connector K3 of the power supply module. Due to the design of the Unilab module, the output voltage of this amplifier stage is negative, but it has the same slope as the voltage across the sense resistor. If the voltage across the sense resistor increases, the output volt- age of the amplifier becomes less negative. This means that we need a circuit on the dis- play board to shift the voltage into the input range of the A/D converter and amplify it a bit more to obtain maximum precision. This task is handled by opamp ICIa, with an additional gain of 1.68. With the gain of IC3a in the power supply module and a maximum signal level of 1 50 mV across the sense resistor, this yields a voltage of approximately 0.97 V at the A/D converter input. As the 0 A setting can be adjusted reasonably dose to 0 V with PI , the circuit also has some headroom to display higher currents (due to supply overloading), up to a maximum of around 3.4 A. The -5 V sup- ply rail is used as the reference voltage for voltage divider R1 /R2/P1 . Measurement setup for the negative supply The only thing we need to measure the negative power supply output voltage Is an inverting amplifier (ICId), which atten- uates the output voltage (maximum value 30 V or more) to match the input range of the A/D converter. An output voltage range of 0-33 V can be measured with the speci- fied values of R6 and R7 (-3,3 V + 1 00 x -33 = 1.089 V). In order to convert the voltage on pin 4 of K2 into a usable current reading, we need a bit more than what we use for other sig- nal processing stages. Although the current sense signal has the same form as the sig- nal for the positive output voltage, here it floats on top of the output voltage. Since we’re already sensing the output voltage, we can use a differential amplifier (1C 1c) to suppress this voltage as a common -mode signal. Here we implement a classic differ- ential amplifier using only one opamp. As Test Circuit Vve designed a simple current source (see the schematic diagram) to help you align the signal conditioning circuitry around 1C 1 and perform the subsequent calibration. To allow this test circuit to operate at the lowest possible voltage, it must have its own source of 5 V power. We assume that everyone will have a suitable supply available. This is a conventional current source design using an opamp that compares the voltage across the emitter resistor of a transistor with a set value, which in this case is taken from the wiper of PL Here the transistor consists of two devices connected in parallel (T1 and 12). which can jointly handle a substantial current. This approach also distributes the heal load more evenly over the heat sink. If you use three standard 0,25 -watl resistors with a value of 0,1 5 0 for the emitter re- sistor, this circuit can easily supply currents as high as 4 A. The usual practice when transistors are connected in parallel is to provide each transistor with its own emitter resistor. This is not possible here, and a specific voltage drop across each emitter resistor is also necessary for proper operation. To nevertheless ensure a reasonable degree of current sharing, we use individual base resistors here. However, ! his only works well if the gains of the transistors are roughly the same, so you must pay attention to this. C3 and R2 stabilise the feedback loop. The maximum amount of power that must be dissipated is 1 20 watts (for example, 15 A ■ 34 V). This is rather a lot and calls Fci a substantial heat sink. We solved this problem by using a fairly small heatsink together with a hefty fan to provide strong forced-air cooling. The transistors are ST types in a TG-220 package. We chose the TS921 IN rail-to-rail device for the opamp. It can supply enough current (80 mA) to drive t he two transistor s. In theory, it should be possible to set the current to just under 4 A with voltage divider P] /R I, but the tolerance of the potentiometer may cause the actual value to vary considerably. If the maximum current is insufficient, you can increase the supply voltage a bit (but do nol exceed 12 V) or adjust the value of RL we need to be able to handle voltages up to more than 30 V and the 1C supply voltages are only ±5 V. this stage also attenuates the signal. This avoids applying voltages to the 1C that exceed its input voltage range. Component dimensioning around 1C 1 c requires careful attention. For example, we must bear in mind that the voltage may be as high as 33 V. At 33 V, the voltage divider formed by R1 0, R1 1 * R1 2 and P2 causes the voltage at the inputs of !C1c to be slightly less than -4 V, To allow the signal level to be adjusted by P3 in the following stage (IC1 b) so it lies within the allowable range, this stage inverts the output of the differ- ential amplifier. This means that the volt- age across the sense resistor must also be elektor 09-2010 57 UNILAB DISPLAY Figure 3, The fully assembled prototype. It is fitted with the trimpots specified in the components list, but there is enough space available to fit other types. inverted by the differential amplifier, so the signal from pin 4 of K2 is fed to the invert- ing input of 1C 1 c* The voltage divider ratio (which can be adjusted with P2) must match the ratio of R9and R8, For the opamp, we chose a National Semi- conductor micropower CMOS device with rail-to-rail input and output capability. The supply current, speed and bandwidth are not important here because we are only processing DC signals* However, the rail- to-rail properties are important, along with the low bias current (typically 1 50 fA, so extra compensation is not necessary) and the excellent temperature coefficient of the input offsets (only 1 .5 pV/°C). The various input offsets (a few millivolts) are compen- sated by the calibration procedure* Power supply it’s a good idea to galvanically isolate the power supply of the display board from the Unilab modules in order to eliminate poten- tial ground loops. The implementation here is straightforward* A transformer with sym- metrical secondary windings, a bridge recti- fier and smoothing capacitors form the basis for the symmetrical 5-V supply for the dis- play board* We use a standard 7805 for the +5 V supply voltage. To improve heat dissi- pation, th is voi tage regu fator Es fitted flat on the PCB without any insulation (the PCS has copper planes on both sides). Note that the +5 V supply must also provide the current for the backlight of the LCD module, which can draw more than 1 00 mA (47 mA in our prototype). The analogue supply voltage for the microcontroller is separately decoupled by a choke and a capacitor (LI and C5). All we need for the - 5 V supply is a 79L05, since it only has to power the analogue circuitry of the input stage. The current consumption on this supply rail is quite low. A standard short-circuit proof transformer rated at 3,3 VA is a reasonable choice for the supply transformer, preferably a type with dual 8-V secondary windings (or alternatively dual 9-V windings). How- ever, we took a different approach for our prototype. The transformer for the two Unilab modules Is a toroidal type, and it’s easy to add a new winding to it* To deter- mine how many turns are needed, you first have to make a winding with a few turns (such as 5 or 10) and then meas- ure the voltage. After this you can sim- ply calculate the number of turns needed for 8 V, since the transformer has a uni- form magnetic field. You can calculate how much wire you need by measuring the circumference of the core and adding some more for the leads to the PCB. For our prototype, we needed approximately 5*5 metres (18.5 feet) of wire for each winding (32 turns}* We used bi filar wind- ing (two wires together) to obtain two identical windings. Use relatively thick stranded wire with robust plastic insula- tion for the windings. Assembly Assembling the double-sided PCB shown in Figure 2 should not present any problems, since only standard components are used (i.e* no SMDs). As already mentioned, the 7805 is mounted flat on the PCB and secured by a screw. With this arrangement, the PCB provides adequate cooling* You can choose from various types of trimpots here, either horizontal or vertical* Figure 3 shows the prototype board fitted with the types speci- fied in the components list. The 1 6-way head- ers are fitted on the back of the PCB. The display module has a 16-pin connector on the back of its circuit board, and it can be plugged into the header of the assem- bled PCB. The two boards can be fastened securely together using standoffs (1 2 mm height). Suitable software must be loaded into the microcontroller before the board is put into service. You can do this yourself by using the ISP port to download the software (the C source code and hex file are available free of charge on the Elektor website under product # 1 001 66-1 1 ). or you can order a pre-programmed mierocontrollei from the Elektor Shop (# 100166-41)* When fitting the two Unilab modules and the display board in an enclosure, be careful to ensure that the plus terminal of connec- tor K2 on the negative power supply board is connected to the minus terminal of con- nector K2 on the positive power supply board by a thick wire. This connection forms the ground reference for the display board. Be sure to replace R1 5 on the positive Uni- lab board by a 5,6-kO resistor. In addition, connector K3 on each Unilab board must be connected to connector K1 or K2 (respec- tively) on the display board using individual 6-way [DC connectors and 6-way flat cable* Be sure to get the connections right! With regard to the remaining wiring of the Unilab supply modules, we suggest that you con- sult the article in the April 2010 edition. The only other thing you need to do is to connect the two 8-V supply inputs of the display board to the supplementary power transformer or the additional windings on the main transformer (100166-!) 58 09-2010 elektor UNILAB DISPLAY Alianment and calibration After assembling the boards and fitting them in the enclosure, you can start the alignment pr >- cedure for trim pots PI to P3* Set the positive Uni lab module to its maximum output voltage and measure the voltage on one of the leads of R20 of the display board. Adjust P7 to obtain a reading less than 1 .1 V (you may be able to simply leave P7 at its maximum setting). The next task is to align the current siqnal con- ditioning stage. Adjust the output of the posi- tive Unilab supply to exactly 0 V and ensure that no load is connected. Adjust PI to obtain i voltage of exactly 0 V (or slightly higher) at the output of ICTa. Then check whether the voltage on R19 is less than 1,1V when the output current is 3 A. This does no! have to be done at the maximum output voltage: it can be checked just as well at an output level of a few volts* This way you can use a relatively small load resistor, such as l Q / 1 0 W wit h an output voltage of 3 V. No alignment is necessary foi the negative output voltage. Unfortunately, the align- ment of the signal conditioning circuitry for the negative output current is distinctly more complex* First the effect of the negative output voltage must be suppressed. This is adjusted with P2. In order to do this properly, we recommend that you build the current source described in the inset (tit also comes in handy during the sub- sequent software calibration procedure). Now connect an ammeter (with a range of 10 A or so) in series with the current source and con- nect this arrangement to the negative Umlab output to serve as a load. Set the current to exactly 3 A and vary the output voltage back and forth over the range of 2 V to 25 V. If eve- rything is OK, the current through the current source will remain constant. In this case you can disconnect the meter and then use it as a voltmeter. Measure the voltage at the out- put of 1C 1 b or 1C 1 c. Adjust P2 until this voltage remains constant when the output voltage is varied. Bear in mind that the signal is filtered by Oa in the power supply module, so you must always wait a lew seconds (or longer) af- ter each change to allow the voltage to stabi- lise, Disconnect the load. With the current now zero* adjust P3 so the voltage on R 1 8 is 0 V (or slightly higher). After this you can perform the calibration procedure. The calibration routine allows for three pos- sible situations when the supply voltage is switched on; 1 An Elektor -programmed microcontroller by is fitted in the circuit. 2. A user-prog rammed microcontroller is fitted in the circuit. 3, Calibration has already been performed. In the first case, provisional parameter values have already been stored in the E EPROM mem- ory by Elektor* but calibration is still neces- sary. In this case, a message requesting you to press SI is displayed for 5 seconds after power is switched on* If this time expires without S 1 being pressed, the display will show the volt- ages and currents, but the readings may not be correct* As a reminder of this, '(uncal)’ is shown at the start of the bottom line. This re- minder disappears after calibration has been performed. If you programmed the microcontroller your- self using the ISP port, data is also stored in the EE PROM (this is part of the available download) and the same course of events occurs as in the first situation. However, if you programmed the microcontroller in some other manner, there is probably no data in the EE PROM In this case the display indicates that calibration is neces- sary after the unit is switched on, since the dis- play cannot present meaningful readings with- out calibration data* If calibration has been performed* the display shows the correct readings after first present- ing a welcome message. Calibration Button Si is used lor the calibration procedure. It is not present on the PCB; you must connect an external pushbutton for this purpose* After SI is pressed once, the voltage, current and temperature screen is replaced by the mes- sage screen for the first step of the calibration procedure: CALIBRATION STEP 1 set outputs to QV then press SI Pressing SI stores the values of the first our pa- rameters, which are used to determine the four zero levels* They are labelled UTL. II L U2L and 121 in the software, where ' U 1 " lepresents the negative supply module. Press SI again to display the message screen u >t step 2 of the calibration procedure: CALIBRATION STEP 2 set outputs to 25V draw 3A from -PSU then press Si The second step determines the values of the two parameters (U1 H and U2H) for the maxi- mum output voltages that the supply modules must be able to deliver (25 V max.) and the pa- rameter (11 H) for the maximum specified out- put current (3 A). If you have built the current source described in the inset* you can put it to good use here. Otherwise you must provide the right load resistance (such as twelve 1 QU-Q, 1 G-W resistors connected in parallel) to draw a current of 3 A from the negative supply output To ensure that the output voltage is still exactly 25 V P measure it once again with the load con- nected before pressing S 1 again. Pressing SI now takes you to the third and final step of the calibration procedure: CALIBRATION STEP 3 draw 3 A from +PSU then press SI In this step you determine the value of the eighth and final parameter (I2H) by connect- ing a 3 A load to the positive supply output. The output voltage does not matter as long as the output current is 3 A* if you use the current source* always set the current to 0 A before connecting it to the supply or disconnecting it (Le. do not make or break the connection at 3 A). Thanks to this third step, only one multi- meter and one current source or load resistor are necessary for the calibration procedure. Press 51 again to save t his parameter value. The following message screen is displayed to conclude the calibration procedure: CALIBRATION DONE! press SI After you press 51 the Iasi time, the microcon- troller executes a restart and then presents the calibrated readings on I he display. You can check them with a multimeter. We recommend that you check the readings after the modules have been fitted in the enclosure and repeat the calibration procedure if necessary. After calibration has been completed, the dis- play shows the following message lor one sec ond after the power supply is switched on: £3MP£j display Vl * 0 * 0 Note that the actual version number may be different. elektor og- 20^0 59 TEST & MEASUREMENT By Alfred Hesener (Germany) -A Measuring small differences between high voltages normally calls for special ‘differential’ test probes, which do not come cheap. But you won t bust your budget on expensive components building the D1Y solution described below and you'll pick up plenty of practical know-how in the process. Many circuits employ high voltages. The two best-known examples are switch-mode power supplies and vacuum tube circuitry, A relatively new application is found in hybrid and electric automobiles, which operate with high battery voltages (and danger- ously high currents) in order to reduce volt- age drop and the cross-sectional diameter of cabling. Whilst any decent multimeter is adequate for measuring high voltages, it s not so handy for measuring small fluctuations in high DC or AC voltages overlaid on these. Frequently, moreover, we are not interested so much in the absolute value of a high volt- age as much as in the difference between two separate high-voltage levels, such as (for example) the differing anode volt- ages of a push-pull amplifier or at switch- ing nodes in a phase shift full-bridge topol- ogy transformer (within high output level switch-mode power supplies). Starting point One solution would be to use two standard high-voltage test probes (not too expen- sive, with serviceable characteristics) together with a digital oscilloscope so as to calculate the signal difference using math- ematical functions. This method has three disadvantages: 1, This means using two channels of the oscilloscope,, which makes It harder to observe several signals simultaneously. 2. Both signals are digitised at the resolu- tion of the oscilloscope (generally 8 bits maximum), so that errors add up* Subtract- ing two large, almost identical voltage val- ues is always problematic, increasing the risk of measurement errors* 3. Since the timing correlation between the two measurement channels is related to factors such as cabling and earth (ground) loops and mathematical functions within the oscilloscopes can throw up random and deterministic fluctuations, the timing Infor- mation of the signal is not very trustworthy, particularly at higher signal frequencies. Remedy can be found in the so-called ‘high-voltage differential test probe 1 . This is a probe set enhanced with a differential amplifier able to accept very high voltages on its inputs and amplify only the voltage 6o 09-2010 elektor i ESI & MEASUREMENT Characteristics * Differential attenuation switchable in two stages [-20 dR/-40 dB) * Bandwidth % MHz, switchable limit at 500 kHz * Maximum input voltage ±1000 V (peak value) ■ Maximum output voltage ±io V (at min, terminating impedance 1 k$i) * Common-mode suppression 55 dB at 6 kHz, 35 .dB at 600 kHz difference between the two input connec- tions, whilst at the same time suppressing common-mode signals (signals of exactly the same level on each input). It might sound as if a simple differential amplifier with voltage dividers on its inputs could do this job but life is seldom this sim- ple. For proof just see how expensive com- mercial differential test probes are for this kind of measurement task. A good example is the Tektronix P52Q0. On the Tek website : youll find an extremely readable applica- tion note 121 on using high-voltage probes. The maximum input voltage differential is given in the data sheet as ±1 300 V and the bandwidth as 25 MHz, Digging deeper into the data, a value of particular interest is the CMRR or Common-Mode Rejection Ratio, which is the ability of a differential ampli- fier to reject the portion of the signal com- mon to both the + and - inputs. The impres- sive value of 80 dB at 60 Hz drops off rapidly at higher frequencies, for instance to 50 dB at 100 kHz, which is pretty good neverthe- less, A small differential signal becomes progressively more difficult to measure as the frequency of the common-mode signal rises, A frequency sweep of the common- mode signal will indicate that the output signal increases with the frequency of the common-mode signal but this is an Illusion. At higher frequencies a greater part of the common-mode signal reaches the output by means of (parasitic) capacitive coupling, making it very difficult to improve the CMRR for high frequencies. Test probes and oscilloscopes Although the oscilloscope is a very handy instrument for taking measurements, it can easily lead you astray when you mis- interpret what’s indicated on the display, A whole load of measurement errors can also occur, so using a differential test probe means keeping your wits about you. The specification of our low cost, easy- to-build differential test probe is shown in the panel 'Characteristics'. The switch- able attenuation feature is a boon when the differential signal being measured is small and the common-mode signal is very large. Here we need to ensure that the test probe remains operating linearly and is not overdriven. An overload indicator of the kind provided with commercial differen- tial test probes was omitted for reasons of simplicity. Bandwidth limitation is important for meas- urements with spurious high-frequency sig- nals, as in switch-mode power supplies. The frequency sweeps are shown in Figure 1. The upper of the two curves indicates the output signal at - 20 dB attenuation both with (in orange) and without (in green) bandwidth limiting. The blue line is the -40 dB setting with the 500 kHz filter switched in. As expected, the frequency response is very linear, with a maximum cut-off fre- quency of approx. 1 MHz. The red line shows the common-mode output signal relative to the frequency. By calculation this gives a CMRR of about 55 dB at low frequen- cies, which fails to about 35 dB at higher fre- quencies. This fatl-off starts at around 6 kHz and is caused mainly by parasitic coupling inside the test probe. It is further influenced at higher frequencies by parasitic coupling within the op-amp. The maximum input voltage of about ±1 000 V was soak-tested in the lab with constant voltage over an extended period. BNC connectors and suitable HV cables are specified for these tests. The input imped- ance of the circuit must likewise be laid out for high voltages. The resistors used (R1 in Figure 3) should be rated for 1 600 V {stand- ard resistors are usable up to only 250 V). Alternatively you can wire several resistors of lower voltage rating in series to divide the voltage (assuming all of these resistors have the same value). One more tip concerning the measurement cables: the cabling on the two differential inputs should be as far identical as possible, since any disparity will unbalance the setup and cause measurement errors. For our pro- totype we cut a short coaxial test lead with BMC connectors Into two halves of equal length, with insulated croc clips fixed to the free ends and the transition insulated with heatshrmk tubing (see Figure 2). Because these cables represent a capacitive load to the measurement setup, they need to be as short as practically possible. Figure 1 . Frequency response at both amplification settings, each with and without the 500 kHz filter. The lower curve indicates the common mode suppression. elektor 09-2010 6i TEST & MEASUREMENT Figure 2. Measurement cable with fully insulated croc clips. Caution: lethal voltages! Handling high voltages demands setting up properly, proceeding with caution and taking all necessary safety precautions — even if you re in a rush and it seems too much of a hassle* Your life is worth more than rapid results* Before testing a circuit with the type of high- voltage test probe shown here make sure you are familiar with the safety regulations. For devices operating at voltages above SO VAC or 120 VDC testing live circuitry is allowed only if there are valid reasons why the power cannot be turned off (such as lor taking voltage measurements). Under German law these operations may only be carried out by qualified electrical technicians, not by trainees and apprentices. Cpar It f ni t *- U,i o* [>c^ F12 0 Tf 5k FI F2 ♦ *" 'Tr u N2 I i _ _ I i : : r i It ^Piir pa- o j2 09054&- U Figure 3. Block diagram with input attenuator (left) and instrumentation amplifier (right). Input voltage division ratio: DR L1 R 2 R ] + /? : Output voltage (first opainp): U\ - ( 1 + a + /?) x U inX x DR y Output voltage (second opamp): U 1 - (I + a + fi) x U ml x DAN Output voltage (test probe): = {U { - U 2 ) x 7 Circuitry and input design The circuit (Figure 3) is basically a differen- tial amplifier using three op-amps, some- times described in the literature as instru- mentation amplifiers. A1 and A2 act as high-impedance inputs and amplify differ- entially* whilst A3 is an actual (classic) differ- ential amplifier Our circuit offers an inter- esting advantage over the classic differen- tial amplifier* however: whilst the CIVtRR in a simple differential amplifier depends on the matching of the resistors Z2* it is here greater by the factor yx (l + a + R) This, however creates amplification and consequently the danger of overload when a large common-mode signal is present. For this reason we must configure the amplifi- cation and input voltage divider to pro- duce maximum CMRR in the linear operat- ing range of the op-amp. In the circuit we selected 1 for the value of and fe* whilst in the two attenuator stages is 0.657 (at -40 dB) and 6,57 (at -20 dB). Z1 and Z2 are set relatively low at 1 k£l but with the advantage that the influence of parasitic capacitance in the circuit is reduced* The formulae for calculating the values ore set out in the panel ' Formulae for Figure 3\ In your calculations ensure that the op-amp out- put voltages remain in the range ±12V. R] and R2 form the input voltage divider, R 1 must have high resistance for a high input voltage range and low loading on the signal under measurement. Because the parasitic capacitance C reduces the division ratio at high frequencies, a trimmer capacitor is fit- ted in parallel to R2 for compensation, We selected 10 MH for R1 and 51 kn for R2, allowing a 5-30 pF trimmer to provide com- pensation. The division ratio is around 1 98. Alignment of the trimmers is the same procedure as for other test probes* apply- ing a square-wave signal and obtaining the optimum curve shape. Many oscilloscopes have a square-wave generator built-in for this purpose. Construction Figure 4 shows the construction of the input stage. The two input resistors (for minimising leakage currents) should be 62 09-2010 elektor TEST & MEASUREMENT insulated with heatshrink tubing. Additional ceramic capacitors are wired in parallel with the two trim-caps, to extend the compen- sation range. The complete circuit (apart from the two 10 Mn input resistors) is shown in Fig- ure 5. On the left-hand side the two extra ceramic capacitors can be seen in parallel with the trimmers, also the second divider resistor. The diodes at the inputs ( D T 1/12 and D21/22) are for over-voltage protec- tion; they operate much faster than Zener diodes and their capacity is far lower. The high input resistors (10 MQ) reliably clip any over-voltages from the diodes plus any current leakage from the power supply. For good frequency response it is vital to mini- mise parasitic capacitance at nodes in the layout. The differential amplifier formed by U31 A follows after the amplifiers U1 1 A and U 1 1 B with their negative feedback resistors. To achieve the best match between amplifi- cation and CMRR, the negative feedback Figure 4, Constructing the input stage. resistors for U31 A take the form of precision trimpots, The output is terminated with a 50 Q resistor. Switch 51 enables the amplification factor and the attenuation of the test probe to be toggled. S2 switches the bandwidth limiting using a 330 pF capacitor in parallel with the negative feedback resistors in the first stage. The only special feature of the power sup- ply using voltage regulators U1 and U2 is the little module using Q1 and LED LI for monitoring the two voltages. Close to the Calibration Calibration is carried out as follows: 1, Connect power supply, observe red LED is lit. Check operating voltages (±15 V) and op-amp output voltages {a lew mV). 2, Connect oscilloscope to the output (nut- put terminated in 50 0), 3, Set R 3 1 a nd R3 1 b in the middle of their range and connect a t -kl f/ square-wave signal with an amplitude of around 10 to one of Uit* two inputs - the exact value is not so important. The square-wave signal should be visible on the oscilloscope. Adjust the trimmer capaci- tor on the relevant input for best square- wave curve shape. The best method is to apply the square-wave signal to trigger the second channel of the oscilloscope and use this for comparison, if the adjustment range is too small you can Conner t some more small ceramic capacitors in parallel with the trimmer capacitor. If the trimmer capaci- tor is too large and the input voltage divider behaves like a low-pass filter, you can give the voltage divider a lower impedance (e.g, using 3,3 for R 1 and 16 k£l for R2). If you find it impossible to achieve a proper square-wave signal you will need to change the physical construction (the parasitic ca- pacity is too large). 4. Adjust the second input in the same way (square-wave signal on this input only). 5, Now adjust R31 and R3 1 b so that the output voltage corresponds exactly to the input voltage attenuated by the factor you have set. For an input signal of 10 V i the output signal should be exactly 1 ,0 V with SI set for -20 dB and 100 mV in the -40 dB setting. 6. Now apply t he same signal to both in- puts and adjust R32 and R32b to make the output signal as small as possible (the smaller the better). 7. Repeat steps 5 and 6 several times, as they are mutually interactive. Take care to achieve maximum common-mode suppres- sion with R32/R 32b — this is more impor- tant than producing the precise attenuation preset by R3 1 and R 3 1 b. It is important to complete steps 3 and 4 accurately before proceeding with the re- maining alignment. Without good frequen- cy response at the input voltage divider stage all the following steps are meaning- less. Signal measurement first on one and then on both inputs should be carried out repeatedly at various frequencies from DC to HF. This will also give you a good under- standing of how the test probe behaves with differing signals. elektor 09-2010 63 TEST & MEASUREMENT -f O+ISV ■Q -15V 09Q549 - 12 Figure 5, Full circuit (omitting the two 1 0 M Q input resistors). op-amps the voltages are decoupled once more using 10 Hand 100 nR The PCB layout can be downloaded from the El ektor website, where you will also find the component list. Fig ure 6 shows how the circuitry is con- structed on a PCB built into a diecast alu- minium box. The input stage (left) has cop- per foil laid below it and shielded from the main differential amplifier on the right, so as to minimise capacitive coupling. The copper strips are soldered to the PCB using earth- ing (grounding) pins. Take care around the inputs to provide adequate insulation and space between the high voltage conduc- tors, For this reason the 10 MQ input resis- tors and their connecting leads should be made safe with heat-shrink tubing. The two switches are mounted on the underside of the PCB and are operated from the lower side of the case housing. At the upper right-hand corner of the PCB are the power supply components and on the right the BMC output socket and power supply connector (around ±1 8 to ±20 V). Parasitic capacitance and inductance are 64 09-2010 elektor TEST & MEASUREMENT Figure 6. Completed circuitry with the printed circuit board inside the diecast aluminium box. minimised by the use of surface mount (SMD) resistors and capacitors. The disad- vantage of the wider tolerances is offset by precise adjustment of the trimmers. Our lab sample, using 5 % tolerance compo- nents, was successfully aligned to a CMRR of more than 60 dB at low frequencies, which corresponds to a resistor tolerance of below 0.1 %. Applications and options Commissioning and calibration are explained step by step in the panel ‘Calibra- tion'. Remember constantly when taking measurements that high voltages are lethal! Before altering or touching anything on the test bench, switch off the volts and make sure everything is completely dead (capaci- tors can retain their charge fora long time!). Always work using one hand alone (keep the other one in your trouser pocket!). The high input impedance simplifies use of the test probe and minimises signal load- ing at the point of measurement. Signal level readings taken from the oscilloscope display should always take into account the attenuation level selected (-20 or -40 dB). The selected bandwidth (0.5 or 1 MHz) determines the extent to which high fre- quency oscillations will be visible on the oscilloscope. The input capacity of the test probe is certainly small but can neverthe- less, like any capacity, lead to signal deg- radation or even oscillation at particularly critical points in a circuit. Should the signal under measurement appear to be flattened or smoothed off above and below, you need to check whether the test probe is still operating lin- early or is already being overdriven, because the attenuation is inadequate and/or the input signal is too large. Meaningful meas- urement is Impossible with overloading. The effective range of the differential test probe can be adjusted by altering the divi- sion ratio, for instance to ±1 00 V for lower voltages. For higher voltages the mechani- cal design must be changed and the insu- lation improved (e.g. voltage rating of the input connectors). With a capacitor in series with R14 and R24 the DC component of the signal is removed entirely, which would enable greater ampli- fication for measuring small signals over- laid on high DC voltages. Capacitors at this stage influence the CMRR very little. You can also add capacitors between the input divider node points and the op-amp inputs but then you will need an additional resistor to ground at the op-amp input for the bias current, which increases the outlay and worsens the CMRR. A ca pacitor i n series with the 1 0 MH i n put resisto r must possess adequate high-voltage rating, which means bulky form factor and large inductance. Overall this differential test probe is straightforward to construct and produces a cost-effective alternative to expensive com- mercial products that will serve you well at frequencies up to 1 MHz. The test probe finds regular use in the author's lab and is particularly useful for audio applications. (090549) |1| www.tek.com 1 2 1 www2.tek.com/cmswpt/tidetails. lotr?ct=TI&cs-apn&d = 2343BJc~EN The author Alfred Hesener is a chartered engineer employed by Fairchild Semiconductor as Application and Marketing Director for the European market. elektor og-20TO By Andre Thiriot (France) t/i Hpn i m ' ' 4 1 1 * ' — 1 • it 1 ^ fcy I 1 1 1 I w systerr I i T * 1 £ | ! J 1 v U U 1 1 U t hn c I n vAf c 31 m 11 in 1 j } j | V V J V I 1 1 Pljrlll r The circuit combines a microcontroller and a miniature b!atk-&-white video camera, and acquires and processes very low reso- lution video images in real time. This char- acteristic makes it possible to use a cheap microcontroller. Very low image resolution doesn't mean mediocre performance, and in fact proves amply sufficient in applica- tionssuch as: monitoring the presence of an object by comparing an image with a reference image stored in EEPRQM in mil fl diral detecting movement by comparing two successive images stored ian RAM recognition of simple shapes by correla- tion with images stored in EEPROM determining the co-ordinates of a bright spot (sorting and selection of the bright- est group of pixels) for system position steering or servo-control etc. The video camera is a sensor that breaks the image down into 625 lines, or to be precise. into two i nterlaced fields of 3 1 2 . 5 li nes each - an arrangement that helps reduce image fl icker on the screen. Each line is scanned by an electronic 'paintbrush' that modu- lates the amplitude of a voltage depending on the brightness. Synchronizing signals are added to indicate the start of a new field and the start of scanning a new line (Figure 1). The amplitude of the video signal is 1 V. The voltage range between 0 and 0.3 V is reserved for coding the synchroniz- es 09-2010 elektor mg signals (line and field sync). The range between 03 V and 1 V allows coding of the brightness level; a voltage of 03 V corre- sponds to black, while a voltage of 1 V cor- responds to white. The usable line scan dura- tion is 52 (is, to which must be added the 5 ps duration of the line sync pulse and the durations of the front and back porches (5 ps and 2 ps) which frame the usable sig- nal and make it possible to delimit each line. Hence the total duration of one line is 64 ps. A succession of lines, sepa- rated by their synchroniz- ing signals, form the fields, themselves separated by field synchronizing signals. These field synchronizing signals comprise a succes- sion of line sync pulses, with the special feature of having a different mark/space ratio, making it possi- ble to differentiate them (Figure 2), Out of each 31 2.5-line field, only 288 lines are usable (lines 23-310 for odd fields and lines 336-623 for even fields), the other lines being used for encoding the field sync pulses. A few calculations before ejettinej started The operation of acquiring an image con- sists of sampling the video signal, with the sampling sequence synchronized to the field and line syncs. Acquiring, storing, and processing video images require substantial resources. Let's take as an example a VGA standard image (480 lines of 640 pixels) produced from a video signal. Capturing 640 pixels in 52 ps implies a sampling frequency of 640 / 52 ps, or over 12 MHz. Storing a 1 6-colour VGA image coded using 4 bits requires memory space of 640 x 480 * 4 - 1 228800 bits, or 1 53,600 bytes. Technical Characteristics * PIC16F690 microcontroller * 18 x 16 pixel B&W video image * 4 grey levels * LED illumination * Relay control * Image comparison - Movement detection * Serial link ■ Constructional difficulty: medium And finally, digital image processing in real time requires a high calculation speed. Thus, in order to perform a simple compar- ison between two VGA images (pixel-wise subtraction), we need to carry out 640 * 480 = 307,200 operations. If we want to perform this processing in less than 10 ms, for example, this implies a basic calculation speed of 10ms/ 307,200, or 33 ns An image processing system normally requires resources that a simple microcon- troller is unable to offer. However, if we can make do with lower performance, a micro- controller like the PIC16F690 will do. Run- ning at 8 MHz, it offers an instruction cycle time of 0.5 ps, and can perform an A/D con- version in 24 ps. It has 256 bytes of RAM, 256 bytes of E EPROM, and 4,096 words of 1 jr\ v \ 090334 - 13 odd # raster T 3 I 4 I 5 I 6 7 A. start of even ft raster even # raster \ \ u r it nr 11 n iTuixjJUinnnnnnrnrni 3GS I 309 319 311 312 313 314 315 I 316 I 317 3tB 319 320 osem ii Figure 2. The difference between two lines. elektor 09-2010 67 16 17 i& >9 SYNC BLANKING I 1 » 1 TiT n !U hi JMAGE c 1 f Jl2 S 1 13 1 14 ! =1 EOL ■ 6 15 d M5 ie 17 16 [47 ' (46 ReT; |M 1 jUS[ 61 152 [63 000134 - 15 Figure 3. Sampling timing diagram. Each cell corresponds to one of the points in the image. The light blue cells symbolize the duration of the analogue/digital conversion and thus represent the minimum time to be left between two successive samples. The under-sampled arid that wilt form the very low resolution image can be made out. GND GNG GND 090334 - 1 1 Figure 4. The circuit diagram of the project. A few suitable ICs and there you have it! 68 og-2010 elektor flash memory. Given these characteristics, we can see that the images are going to have to be of modest size for us to be able to process them using this microcontroller. The 24 ps conversion time means sampling at a frequency of 12 MHz is not possible. However, this time is of the same order of magnitude as the 64 ps line period* So out of this simple observation comes the idea of acquiring only a single point per line, regularly offsetting the sampling moment with respect to the start of the line. This under- sampling then makes it possible to form a very low resolution image, com- patibte with the resources available to the microcontroller. Sampling one point per line implies a num- ber of points in the image less than or equal to the number of lines, Le, 288 pixels. An image of 18 lines of 16 points (18x16 = 288) lets us maintain roughly the same pro- portions between image width and height (Figure 3). The memory space required to store the image depends on the number of pixels, and also on the pixel brightness resolu- tion. Using 2 bits to code the brightness level allows us to distinguish four grey lev- els, which are enough for the applications considered* Thus an image will occupy 2 x 288 = 576 bits, i*e. 72 bytes. I I This small size allows three images to be stored in the RAM memory and another three in the EEPROM* i i i f I id 1 1 nt"inn - M v U 1 lb VI V 3 V I i p v I vy I l The circuit (Figure 4} is based around the PIC16F690 microcontroller (ICS) from Microchip [2], chosen for its low cost and the very affordable price of the Starter Kit PICkit 2 (or 3) used for developing the soft- ware. The 6 - way connector K3 is provided for connecting up the development or microcontroller programming tool* Diode D3 protects the circuit against the program- ming voftage Vpp of 1 3 V. Before connect- ing up the programmer, uncheck the 'Power target circuit from MPLA 8 ICD 2 1 option (Figure 5) in the programmer configuration. This lets you power the circuit normally and use the programmer at the same time. The image detector iC2 is a miniature B&W CMOS camera, powered from 5 V. The sig- nal produced conforms to the description given above. Video signal acquisition is per- formed by the mlcrocontro tier’s internal ADC via pin 16 (AN4). Jumper JP1 lets us enable gamma correc- tion, while JP2 Jets us select the camera's image amplification gain. The phono socket (K2) lets us connect a video monitor so as to display the image produced by the camera, or to connect an external camera: this latter option makes it possible to evaluate the circuit very cheaply, by saving the cost of the CMOS camera, which in this case will not be fitted to the PCB. When K2 is not used, JP3 must be fit- ted in order to load the camera video out- put with a 75 LI resistor. IC3, a classic LM 1881 [3], in conjunction with the network R2 / C 8 , has the task of extracting the field (VS) and line (CS) syncs from the video signal, along with the par- ity signal (O/E OUT) used by the microcon- troller to synchronize the sampling data of the video image. These signals are con- nected to microcontroller ports RA2, RA5, and RB 6 respectively. LEDs D6-D9. driven by port RC7 (if JP5 is fitted), make it possi- ble to illuminate the zone where the image is taken. Advantage is taken of the asynchronous series interface available in the microcon- troller to send the image information via a serial link. IC4 takes care of the electrical conversion to the RS-232 standard. Relay RE1 offers the possibility of control- ling an external system — for example, an alarm* It is driven by port RC5. LED D1 0 tells us if the relay is energized or not. The circuit is powered from a mains power supply (9-15 V / 200 mA), connected to connector K1* The power from the PSU Is Figure 5. The programmer parameters* Uncheck the ‘Power target circuit from MPLAB ICD T box. smoothed then regulated by linear voltage regulator IC 1 * Using a microcontroller means there's bound to be software. For performance reasons, the software has been written in assembler throughout* The detail of the functions (parameters and procedures) is given in the program source code, which contains plentiful comments, available for free download from [I]. The main functions of the software are broken down into macros and subrou- tines: the use of subroutines was favoured in order to save program memory, but the use of macros (see Table 1) proved neces- sary where the execution time turned out to be critical, in particular during the image acquisition phase, where the grey level cod- ing steps take a bit of time* The video signal sampling and pixel grey level coding steps have been optimized: the grey levei of each pixel is coded while the ADC is converting the next pixel, which saves the 24 ps wait time of the conversion operation. The basic software illustrates the possibili- elektor 09-2010 69 Table i* List of functions available for managing the vision system* Type Name Function Macro MACROJJneSync Wait for line sync Macro MACRO_DPixelAcquisitlon2Bits Launches acquisition of pixel n and grey-level conversion of pixel ml Function Start Main program comprising the initialization phase and the primary loop Function BinASCII Decimal to ASCII conversion: returns the ASCII codes of the three digits of the decimal value to be converted (hundreds, tens, units) Function Bin2Colour2Bits Converts a grey level {0—3) into the ASCII code used to represent it (32. 1 76, 1 77. 1 78) Function CharTrans Transmits a character over the serial link Function Pictu reRamToEeprom Copies the Image stored in RAM to the EEPROM Function Pictui eEepromToRam Copies the image stored in EEPROM to the RAM Function PictureCompare Compares the two images stored In RAM and in EEPROM Function PixelGroupDistCale Calculates the distance (absolute value of difference in brightness level) between four groups of two pixels Function Pictu re Acquisition Acquires an image of 288 points organized as 1 3 lines of 1 6 pixels coded using four grey levels Function DecimalValueTransmission Transmits the three ASCII codes representing the three digits of a decimal value over the serial 1 link Function PictureTransmission B 1 T Transmits the image stored in RAM over the serial link, with each pixel represented by the ASCII cha racter correspond ing to its g rey level, \ COMPONENT LIST Resistors ( 5 %, o.ssW) R1 =7 5ft R2 = 6S0kft R3 t R4,R5 = 4.7k ft R6 = 10kQ R7. R 8 t R17 = 1 kft R9-R1 2 = 4700 R1 3-68011 RRRT 6 = 47k ft R15 = l.Skfl Capacitors Cl = 47DpF 25V radial electrolytic, 10mm diam, C2,C3,C5“C!0 = lOOnF, polyester (MKT), lead pitch 0,2 In, Cl! -Cl 5^ 1 liF 16 V, radial electrolytic. 5mm diam, C4 = 220uF 25V, radial electrolytic, 8 mm diam. Semiconductor Dl , D2 - 1 1M4004 D3 = BAT48, Schottky diode, DO-35 case D4 = LEO, red. low current, 3mm D5 = LED, green, low current, 3mm Dl 0 - LED, yel low, low cu rrent, 3 mm D6-D9 - infrared LED, QED222 (e.g. Farnell # 1652526} Dll = 1M4148 IC1 =7805. 10-220 case IC2 = C MOS IR camera module (CCIR ) e.g, Conrad Electronics # OCam-Ol 1 50001 IC3 = LM 1 S3 IN/ NO PB. DIP-S case (e.g, Farnell #1564700) IC4 - MAX232N, PDIP-16 case ICS = PIC16F690-I/P. DIP-20 case {e.g. Farnell # 1103406) Miscellaneous RE1 = Relay, Multicomp type HRM1-SDC5V (e.g, Farnell #9479937) JPI-JP5 = 2 -pin pin header with jumper, 0,1 in, lead pitch K 1 = power supply connector, 2,1 mm, hori- zontal, PCB mount l<2 = RCA (phono) connector. PCB mount K 3 = 6 -pin pinheader. 0,1 in, lead pitch K4, K5 - 3-way PCB screw terminal block, 5mm lead pitch K 6 = 9 way sub-D socket (female), horizontal, PCB mount 51 ,S2 = pushbutton, e.g. Tyco Electronics type FSM4JH (Farnell# 1555982) Sockets for IC3, IC4 and ICS { 8 -pin, 1 6-pin, 20- pin respectively) PCB, Elektor ft 090334-1 (see [1 ]) ‘ substitute NTSC version where applicable. 70 09-2010 elektor ties offered by the vision system* This soft- ware performs the following operations; acquires and stores a 288-prxel image in RAM transmits the image in ASCII format over the serial Jink compares the image stored in RAM with the image stored in EEPROM sends back the result of the image com- parison over the serial link controls the lighting LEDs The two images stored in RAM and in EEPROM are compared pixel by pixel* The comparison method used consists in accu- mulating the differences in the pixel bright- ness values. The sum total of these differ- ences is then compared with a threshold in order to decide whether to set off an alarm or not. The image is sent back over the serial link in ASCII format (19,200 baud* 1 start bit T 8 data bits, no parity, 1 stop bit) so that a simple terminal (like a HyperTerminal) can be used to view the image (Figure 6 ). The four grey levels that each pixel can have are coded using the four extended ASCII codes Despite its modest features, this circuit opens the door to a great deal of experi- mentation and even practical applications. For example, the author experimented with the object presence detecting soft- ware while looking for a way of detect- ing the presence of letters and packets in a letter-box, rather than the event of their being put into the box. To achieve this, a patterned background (checkerboard or concentric squares) is placed at the back of the letter-box, monitored at regular inter- vals by the vision system mounted in the top of the box. The image is compared with a reference image stored in EEPROM when the system is installed, There’s no daylight in the fetter-box, so the inside is illuminated by the circuit's LEDs while a new image is being acquired, inserting a letter or packet modifies the image seen by the system, set- ting off an alarm which continues for as long as the object inserted remains in the box. This alarm goes off when the post is col- lected and the box is empty again. Now it's your turn to dream up other appli- cations, which you can share with Elektor readers! >090334 Vision - HyperTerminal Fierier Eilfion Affichago Appeter Transf&t ? □ (3 B 0E9 an Threeshold - 050 Score = 114 Status : ALARM I V 00:04:29 connect Wtet. auto E920QS-N1 Figure 6 . The video image in HyperTerminal. Can you guess what it's of? (■rjjenbs jd&jej e umiiw aienbs hplus y ) with values 32, 1 76, 1 77, and 1 78. Pressing button 52 lets us store the latest image acquired and stored in RAM into the EEPROM; \ pressing button 51 lets us send the image stored in EEPROM back up the serial link. LED D5 flashes whenever either of the buttons is pressed, LED D4 indi- cates the start and end of image acquisition. DIO fights when the relay is energized, JP4 allows the software to use the light- ing LEDs. JP5 allows the hardware to use the lighting LEDs — the difference Is a sub- tle one. ( 090334 ) Internet Links [ 1 ] www.elektor,com/090334 [ 2 ] wwl .microchtp,com/downloads/en/ DeviceDoc/41 262E.pdf [3 1 wwwJiationaLcom/ds/LM/LMI 881 .pdf elektor 09-2010 7 1 MICROCONTROLLERS Bascom 8051 Math Routines By Darren Hey wood (United Kingdom) There are various ways to implement math on a given processor, some processors are optimised for math usage by way of their particular hardware design. For example, CORDIC methods are optimised for specific hardware. However when implemented on the good old ‘jack of all trades* 8051 microcontroller one finds the CORDIC math algorithms are slow with little to no gain in accuracy. Help is on the way! The routines presented here use the Pade algorithm and depending on what routine is utilised or run, the Newton/ Rah pson root finder is sometimes implemented in a feedback loop* Some readers may never have heard of the Pade algorithm, it's the same idea as Taylor's expansion except Pade produces a quotient polynomial equivalent approximation of a math transcendental function which, as it turns out, is more accurate than Taylor's polynomial expansion. Both CORDIC and Pade algorithms work over a small range only - various software tricks have to be implemented to expand the ranges to a maximum. In this case, the math routines discussed here are limited only by the architecture of the IEEE 32-bit float* Using the math routines The general idea is to cherry pick the routines. The way to do this is to initially define an 8051 .dat file with plenty of program code room, i,e., preferably 32 K or 64 l< space, use the 8051 math routines as an initial template or platform to develop an application and then later on. remove the surplus math routines that are not required thereby releasing extra program code space. Care needs to be exercised here though because some routines are nested for example, cos(x) routine calls sin(x) routine, so the particular user application software may not need a result from sin(x) but requires cos(x) only* in which case sin(x) routine must remain an integral part of the application, similarly* tan(x) utilises both sin(x) and cos(x). Therefore, to use tan(x) both sin(x) and cos(x) routines must be included. It is up to the end user to check for nested routines by skimming through a particular routine, which is easily identifiable by having the call statement embedded in the code routine. There are two main variables used throughout, these have the variable names Argl and Arg2. If is compiled and executed then Argl value or contents will be passed to the sinx routine as an argument and upon execution the answer will be returned in Argl . All trig functions use radians only. Due to the interconnectivity nature of math transcendental functions in general, some routines are nested. Two software stacks have been implemented in software for Arg 1 and Arg2 and each can go four deep and are common or global to all routines* Bascom-8051 math routine function list There are two main variables used with these routines these are Argl and Arg 2. when calling a single function, such as Sinx. Argl would be preload with a radian number, the user then calls the routine and the result is returned in Arg 1 , Below is a lull list of functions which is typically what you find on any scientific calculator. Call Square Argl ; returns the square In Argl, Call Sqrx Argl ; returns the square root in Argl . Call Mag Argl, Arg2 : returns the square root of Argl ft 2+Arg A 2 in Arg 1 , Call Rect2polar Argl * Arg2 ; converts a rectangular to polar x- Argl and jy= Arg 2 Result returned In Argl and angle in Arg2 in degrees. Call Polar2recE Argl * Arg2 ; converts a polar to rectangular form, magnitude in Argl and angle in Arg 2 in degrees, returns x+jy as Argl+jArg2. Calf Cubr Arg 1 ; returns the cube root in Arg 1 . Call Expx Argl ; returns the natural anti log, base e* in Argl * Call Inx Argl ; returns natural log , base e, in Argl* Call Alog Argl ; returns the anti log , base 10* in Argl , Call log Argl : returns the log* base 1 0* in Argl . Trig functions Call Sinx Argl ; returns the sine of a radian number in Argl* Call Asin Argl : returns the arcsine of a number in Argl , Call SIn_2pTx'Arg1 ; returns the sine of a number with 2.pi.x, where Argl — x f and has the range 0„to..l to complete 360 deg or 2. pi radians. Call 5in_a2pix Argl ; same as above except variable 'a' is used to denote harmonic number, wave number and is also known as sine circles* 72 og-2010 elektor MICROCONTROLLERS These math routines do not require or use any external hardware (except the LCD) and therefore all routines can run in the BASCOM simulator, the answers or results can be checked very easily either by directing Argl to the LCD screen simulator or by typing in the variable name (Argl) as is allowed in the simulator, then verify or check the result is correct with a scientific calculator. Examples — simple to complex The majority of the routines are very easy to use, it’s a simple case of using the BASCOM Call command, here are a few examples: Tall sinx Argl, calls the sinx routine whereby Argl already contains the argument (pre-loaded) and on execution, returns the result in Argl. Tall cos x pi / 4 1 calls cosx routine, in this case, BASCOM automatically sets Argl -pi/4 and returns result in Argl. Led Argl, displays or prints Argl on LC display, useful for real hardware and the BASCOM simulator As can be seen, to use a particular math routine from your program code involves first pre-loading Argl with an argument and then simply calling the routine as shown above, after compilation and execution, the answer will be returned in Argl, in some cases, depending which math routine is in usage, Arg2 as well. When the routines are loaded into the BASCOM IDE system for the fist time, skim down to line 173, it can be seen that the command: Call poX:ar2rect 5, 53.13010235 converts a complex number represented in polar form with a modulus of 5 (Argl) and the angle of 53.13010235 degrees. As with all of the routines, the results or answers are returned In Argl and Arg2 or just Argl .In this particular case the result is returned in rectangular form, i.e., Argl+j.Arg2. just so the user can get the initial hang of things, compile the code exactly as it stands, invoke the simulator including the LCD and execute the code using the Call Cosx Argl ; returns the cosine of a radian number in Arg I . Call Acosx Argl ; returns the arccosine of a number in Argl . Call Cos_2pix Argl ; returns the cosine of number with 2. pi. x where Argl “x and has range Q..to_.l to complete 360 deg. or 2 pi radians. Call Cos„a2pix Argl ; same as above except variable 'a' is used to denote harmonic number, wave number and is an integer. Call Tanx Argl : returns I he tangent of a radian number in Argl. Call Atanx Argl ; returns the arctangent of a number in Argl . Call A2tanx Argl I, Arg2 ; returns the arctangent of numbers in Argl =x and Arg2=y then arctangent(y/x) and returns result in Argl . Hyperbolic trig functions Call sinhx Argl ; returns the hyperbolic sine of a radian number in Argl , Call coshx Argl ; returns the hyperbolic cosine of a radian number in Argl, Call tanhx Argl ; returns the hyperbolic tangent of a radian number in Arg 1 , Call Asinhx Argl ; returns the arc hyperbolic sine of a radian number in Argl. Caff Acoshx Argl ; returns the arc hyperbolic cosine of a radian number in Argl , Call Atanhx Argl ; returns the arc hyperbolic tangent of a radian number in Argl . Numerical differentiation and integration The routines below are capable of performing bot h integration and differentiation numerically. The algorithm used for numerical integration Is Simpson's rule. Call DerivfunO , func_I, mv, Argl : will find the derivative at the point specified in Argl, numerical dy/dx is returned in Argl . Call Simpson funO , func__2 P mv, fo, hi, strip^count ; will perform numerical integration and can Sind the area under a curve where hi and lo specify the integral limits and strip_count specifies how many strips to use. efektor og-acio 73 MICROCONTROLLERS simulator. The top line of the LCD should be 3.0000007 (Argl ) and the lower LCD line should be 4.0000000, note the acceptable error in Argl , the 7 th digit should be zero. If Argl and Arg2 are preloaded with values, then we can use the command: Call polar2rect Argl, Arg2 assuming Argl *5 and Arg2=53.1 301 0235 degrees will result in the same answer as before. The command: Call Simpson { f unci , funcj, product /quotient , Lo integration limit, Hi integration limit, Number of strips) applies Simpson's rule, well known in mathematical text as a numerical method for performing integration, to two independent math functions selectable as a products or quotient^! with Lo and Hi integration limits, the number of strips must be specified 1 to 255. Each independent math function is assigned a specific number which can easily be looked up, there is a range for FuncJ (code start line 1 80) and the other range Func J(code start line 212). Here's an example: To find the area under a single function Inx curve between integral limits x = 1 and 2, with 10 strips. First find Inx from the list of functions under funcj starting at code line 180. so funcj = 3 =lnx, next find funcj and because it is a single function, func J= 1=1. The overall command structure becomes: Call Simpson ( 3 , 1, 1 , 1, 2, 10) note the product/quotient bit can be set either 0 means product or 1 means quotient, in this specific case, since Inx ' 1 =inx or Inx / 1 =Inx. The above shows an example of finding the area under a Inx curve for single function between the integral limits 1 to 2 , however, because the command allows product/quotient of two functions but more specif cal ly, a product of two functions means that some complex math can be computed such as the Fourier series (as just one example), which is essentially the integration of two functions multiplied together between two limits. Obviously, having integration, numerical derivative which can f nd any two function product or quotient is available, the command: Call Deriv ( f unc_l , f unc_2 , product /quotient bit 0/1, X gradient position point) Example: fnd the gradient of f(x)=x A 2 when x=2* call Deriv (23 , l , 0 , 2 ) , here we have funcj =23^x A 2 and funcj = 1 = 1 which means x A 2 * 1 =x A 2 a! so x A 2 / 1 =x A 2 Is a single function as before, product/ quotient bit set to 0 means 1 *x A 2 but If this bit was 0 it would also be correct as x A 2/1=x A 2. Next 2 means, what Is the gradient of x A 2 when x=2, the answer is 4. There are some functions which maybe confusing like Call Sin_2pix Argl or Call Cos_a2pix Argl. When working with some areas of mathematics it better to represent or define Sinx with Sinjpix which simply means 2 pi x, so x can take on the values between 0 and 1 , where 1 will represent one complete cycle i,e, 2, pi Cos_a2pix=CQS_a*2*prx s where ‘a' takes on integer values like 1 ,2,3 and 'a' can be any harmonic number. Example: Find the average DC value of a half rectified cosine wave whose peak amplitude is 4 volts. To do this, we need to fnd the area under one half of a cosine wave and then divide the calculated area by length of base which will result tn the average value for a half wave unity amplitude cosine wave. All that remains is to multiply the result by 4 for a final answer. Proceed with the command: Call Simpson { 1 8 ,1,0, ‘0,2'5 f 0,25 , 16) Here we have func J = 1 8=Gos Jpix Argl, funcj=1 = 1, we are working with a single function and the bit inv=Q so funcj * funcj. The integration limits are from -0.25 to 0.25 representing !4 cosine wave exactly and lastly, 1 6 strips are used. The result is returned in Arg 1 (as always) as 0,3 1 S3 1 so divided by length of base which in this case - 1 , the peak of the cosine wave is 4 so finally: Vave = 4*0.3 1 83 1 =1 .27324 volts. Supposing, the user wants to find the derivative of function which is not available from given list of common transcendental functions, equations such as unique polynomials might be of interest. Consider, as an example, f(x) = (1 +x A ( 2 ))/(x- 2 ), There are two routines made available called FractJ and Fract_2, FractJ contains the equation for (1+(Arg1) A 2) and FractJ contains (Argl -2). So to find the numerical derivative of f(x) at point x=-1 .25 proceed as follows: Call Deriv (27 , 25 , 1 , -1.25) As explained elsewhere, funcj =27 = FractJ and f u ncj =25 - FractJ. The inv bit is set to 1 which tells the Deriv routine that f(x)= FractJ / Fract J (a quotient) and finally what is the derivative at point x=-1 .25? Run this routine to find the derivative at point -1,25, the answer should be 0,5266. Where can 1 get this The full set of Bascom math routines is available as a single .bas file for free downloading from the Elektor website P 1. (100143) Internet Link 1 1 1 www.elektorxom/ 100143 74 og-2010 elektor Electronics at all the right levels OB D 2 Simulator ..uihnli «r ^■lUrt , ln Advantages to subscribers PrcMtjramnriablP DIVRHD v' hr*"* InterSteptre tension Board \ect Y° ur ^script* 011 ,.ele^pr,co “Elektor? Prescribed reading for our R&D staff because that’s when we need professional guidance for microcontroller technology.” - Frank Hawkes, 39, development engineer - Cloud Altimeter Cheaper than 1 1 issues from the newsstand With every issue subscribers get up to 40% discount on selected Elektor products Free welcome gift of your choice with an annual subscription No queues, travelling, parking fees or 'sold out’; Elektor is supplied to your doorstep every month Always up to date - read your copy before everyone else www.elektor.com/subs ■ Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. INFOTAINMENT Hexadoku No matter if your summer was hot and dry. a cool head is required to solve this new edition of our monthly brain teaser. Enter the right numbers in the puzzle, send the ones in the grey boxes to us and you automatically enter the prize draw for four Elektor Shop vouchers. Have fun! The instructions for this puzzle are straightforward. Fully geared to electronics fans and programmers, the Hexadoku puzzle employs the hexadecimal range 0 through F. In the diagram composed of 16 x 16 boxes, enter numbers such that all hexadecimal numbers 0 through F (that's 0-9 and A-F) occur once only in each row, once Solve Hexadoku and win! Correct solutions received from the entire Elektor readership automati- cally enter a prize d raw for one Elektor Shop voucher worth £ 80. OQ and three Elektor Shop Vouchers worth £ 40,00 each, which should encourage all Eiektor readeis to participate. in each column and in each of the 4*4 boxes (marked by the thicker black lines)* A number of dues are given In the puzzle and these determine the start situation. Correct entries received enter a draw fora main prize and three lesser prizes* Alt you need to do is send us the numbers in the grey boxes. Participate! Before October 1 , 201 0, send your solution (the numbers in the grey boxes) by email* fax or post to Elektor Hexadoku - 1000, Great West Road - Brentford TW 8 9HH United Kingdom. Fax (+44) 208 2614447 Email: hexadoku@elektoncom Prize winners The solution of the June 20 1 0 Hexadoku is: 6B31 0. The £80.00 voucher has been awarded to: Zigor Gomez Arias (Spain). The £40.00 vouchers have been awarded to: Erik Jansen (NL), Taina Paavilainen (NL) and William Fackrell (USA). Congratulations everyone! F ' 8 ' 4 C ’ 0 D 5 6 A 6 D 9 7 3 B C 1 8 2 6 9 3 E _3_ _F_ _4_ _8_ _D_ 77 6 0 B 4 F 1 9 1 0 C 4 B D 2 3 A 8 7 8 C F B 4 2 A E 1 _0_ _D_ 1 T B 3 5 7 3 A C 4 F 7 5 6 9 0 0 C 5 F 3 1 8 D 4 E A 2 |5_ 4 _ _C_ _E_ _B_ 4 "a T 1 C F F 1 5 3 8 8 2 D 7 3 9 A B E 4 1 1 _0_ 8 7 2 6 A _9_ PZZL cam [5 E 7 4 8 1 F D 0 b! 2 3 A 6 C 9 8 C 2 A B 3 5 6 9 7 F E 4 0 1 D F 9 3 D 0 2 A 4 C 5 6 1 B 8 E 7 |o_ 1 B 6 E C 7 jd _8_ _D_ _4_ A_ _5_ _ 2 _ _3_ _F_ |b 3 9 F 2 4 C If] D 0 5_ 8 7 A 6 1 p 8 1 2 7 F 0 A 4 E 9 6 C B 5 3 c A 6 0 D 5 9 3 B F 1 7 8 E 2 4 7 ’4 5 |E_ 6 8 B jl A 3 _C_ |2_ _F_ _9_ _D_ _0_ pT 5 8 7 F D 6 "b1 [7 1 0 C E 4 9 2 2 B lE 9 1 7 3 c 6 4 D F 0 5 8 A 6 D 0 3 A E 4 5 2 8 7 9 1 F B C Li. F 4 C 9 0 2 _8_ l_E_ _A_ B _5_ _D_ _3_ 7 _ _ 6 _ [T 6 A 8 3 B D 7 [7 9 E 0 2 C F 5 3 7 C B 4 9 8 F 5 2 A D 6 1 0 E 9 0 D 1 5 6 E 2 F C 8 4 3 7 A B [ e _ 2 F _5 C A 1 0 [_7_ 6 3 B 9 _D 4 8 The competition it not open to employe of Elektor International Media* its busing partners and,'or associated publishing houses. 76 09-2010 eiektor RETRONICS Delay-line Digital Memory (ca. 1968) By jean Herman (Belgium) In November 1968. the Belgian company MBLE (Manufacture Beige de Lampes et de Mate- riel Electronique) published an article in its "Special new tech- niques" magazine presenting a new device: a delay line capable of memorizing digital informa- tion for logic and calculation. The device was similar to the delay lines used in TV colour decod- ers, but complete with all the electronics needed to make it work. This was not a new discov- ery, as digital computers were already using bulky delay lines that employed a column of mer- cury or any other substance intended to delay infor- mation. But MBLE' s innovation was to have made it into a reliable, stable, and quite accurate device. In a standard, interchangeable module. Three mod- ules were available: the GDM1 1 with a capacity of 256 bits, a binary data rate of 0.5 MHz and a delay of 515 ps; the GDM12 (256 bits, 0.5 or 4 MHz, 515 or 64.5 ps); and the GDM21 (256 bits, 4 MHz, 64.5 ps). The GDM1 1 and GDM21 modules were master mod- ules, the CDM12 was a slave module. To increase mem- ory capacity, several modules could be used in series. This was the simplest solution, but in practice, one soon found oneself limited by the accuracy of each delay fine. In series, the delay time error is cumulative. So the commonest method was to use the modules in parallel, where there is no limit to the capac- ity. To achieve perfect synchronization of the modules, they used a common dock pulse from the single master module, making it pos- sible to use just one bit-rate frequency converter for all the modules. This type of memory has been used in calculating machines or small computers, as an analogue/digital converter buffer, in digital machine tools, as a screen memory for CRT displays, etc. The materia! used for transmitting and holding the information is «£/* a special type of glass that has a high lead content, to obtain the lowest possible acoustic (ultrasonic) propagation speed. Two ultrasonic transducers are bonded to the same 40 mm end of an 80 *40 * 8 mm oblong slab of glass. Under the transducers, the glass Is angled at 7.5° so that the transducers are perpendicu- lar to the reflection paths. One piezoelectric transducer emits pulses and the other receives them. Internal reflection takes place between the two 40 mm ends of the slab of glass, so the dis- tance between the transducers is 2 x 80 mm = 160 mm. An ultra- sonic bit travels this distance in 64.5 gs. Calculating back from this, the sound waves travel at a speed of 0. 16 m/64.5 ps- 2,480.6 m/s. Obviously, the long 1 60 mm path through the glass attenuates the signals. The voltage attenuation measured between the piezo transducers is around 6 dB. A BSX20 transistor amplifies the echo received and brings it up to TTL level. The 256-bit word is continuously re-injected into the glass and is controlled by memory management logic. The signal attenu- ation is an advantage, since the initial pulse is propagated in several ways throughout the whole of the glass slab, but is no longer of sufficient amplitude to interfere with the working of the system. In reality, the emit- ting transducer generates a longitudinal wave perpendicular to the transducer, but also a transverse wave at a differ- ent speed (around half the speed) which might interfere with the main wave. in 1968, one had to be very sparing with the precious memory capacity. I have worked with large computers that managed a whole great roiling mill and yet only used 16 l<8 of memory! I have also had occasion to repair Schneider calculating machines that used this delay line. (100081 -I) Retronic s is a monthly column covering vintage electronic s including legendary Elektor designs , Contribution s. suggestions and requests are welcomed; please send an email to editor@eiektor. corn elektor 09-20^0 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 564999 Fax 0044 (0) 1932 564998 ASTROBE V3.0 www. astrobe.com Windows Development System for LPC2000 microcontrollers. * Develop highland low-level software without C or assembler * Generate fast 32-bit native ARM code * No special programming hardware required * Personal, Standard and Professional Editions ATOMIC PROGRAMMING LTD www.atomicprogramming.com * AP-114 ISP/JTAG Programming System * JTAG Programming and Testing * Boundary Scan Testing * Universal In-System Programming * EEPROM and SPi Flash Out-of- Circuit Programming * Generic GDB Proxy Server ' . » Jennie JN51 48 ZigBee Development Applications * Training Platform available AVIT RESEARCH www, avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award - winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. BLACK ROBOTICS www. b I a c kro bo t i cs, co m Robot platforms and brains for research, hobby and education. • Make your robot talk! • TalkBotBrain Is open-source • Free robot speech software • Robot humanisation technology • Mandibot Gripper Robot ByVac www.bvrac.cnm • PIC32 With BASIC • ARM With Forth • USB to I2C • Serial Devices • VT1QQ LCD Displays CEDA www.ceda.ln ceda@vsnl.com learning $5 Hourly PCB Layout @ S5 Hourly Learn PCB Designing with Multimedia DVD in Or CAD, PADS & ALLEGRO Self or e-learning with support by email, phone & web -meeting DESIGNER SYSTEMS http://www.designersystems.cQ.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD) DVD accessories 8r controllers) Tel: +44 (0) 845 5192306 EASYSYNC http ://www. easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC vmelnec.com Europe's leading device programmers manufacturer: • reliable HW: 3 years warranty for ^ most programmers • support over 56.000 devices • free SW updates • SW release: few times a week • excellent technical support: Algorithms On Request, On Demand • all products at stock / fast delivery SW EMBEDDED ADVENTURES www. em bed d e d ad ve ntu res . co m From news and tutorials to modules, components and kits, we have everything for your next microcontroller based project Your embedded adventure starts here. embedded adventures^ FIRST TECHNOLOGY TRANSFER LTD. http://www.ftLco.uk * Training and Consulting first tor IT, Embedded and U|3 Technology Rea! Time Systems Transfer Ltc * Assembler, C, C+ + (all levels) » 8, 16 and 32 bit microcontrollers * Microchip, ARM, Renesas.TI, Freescale * CMX, uCOSIl, FreeRTOS. Linux operating systems * Ethernet, CAN, USB, TCP/IP, Zigbee, Bluetooth programming FLEXIPANEL LTD www.iiexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: * Per-copy firmware sales * Firmware programming & archiving * !n-the-field firmware updates * Protection from design theft by subcontractors FUTURE TECHNOLOGY DEVICES http ;// www. fid ich ip.co m FTDI designs and sells USB-UART and USB-FIFQ interface i.e.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB 0 Oscilloscopes 0 Power Supplies 0 Spectrum Analyzers 0 RF Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hamegxom 78 09-2010 elektor products and services directory HEXWAX LTD www.hexwax.com World leaders in Driver-Free USB ICs; * USB-UART/SPI/I2C bridges * TEAleaf-USB authentication dongles * expandfQ-USB I/O USB expander * USB-FileSys flash drive with SPI interface * USB-DAQ data logging flash drive — = = = Z 180 pages of tech audio articles U near Audio Self ' L “' Corde "'. passa '°’ your lech audio resource WWW.Itt} €QTQUQ10. net MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes /m. 3 kt T. ROBOT ELECTRONICS I ittp ://w w w. rob ot-e I ectro nlcsxo m k Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ■BHHiEnp: c: ! f B i a ROBOTIQ http HJ www, robotiq.co.uk Build your own Robot! fun for the whole family! Now, available in time for X-mas * Arduino Starter Kits *NEW!!* * Lego NXT Mindstorms * Affordable Embedded Linux Boards * Vex Robotics (kits and components) * POB Robots (kits and components) email: sale$@robotiq, co.uk Tel: 020 8669 0769 STEORN SKDB LITE Join the SKDB Lite, the place to understand, discuss and experiment with magnetics, • Learn more about magnetics and electromagnetics • Participate in developer forums and discussion surrounding magnetics and related topics. For FREE access to SKDB Lite: https://kdb.steom.cam/ref25 USB INSTRUMENTS http://www,usb-instruments.aom USB instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB VIRTINS TECHNOLOGY www.virtlns.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter Free to download and try. SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help uusio m ers p ro m ot e their bust ne ss , Showcase - a permanent feature of the magazine where you will be able to showcase v o it r pro duets a nd s erv i ce s . e rr, For just £242 + VAT (£22 per issue for leven issues) Elektor will publish your company name* website address and a 30- word description For £363 + VAT For the year { £33 per issue for eleven issues) we will publish the above plus run a 3 cm deep full colour image - e.g. a product shot, a screen shot from your site* a company logo - your choice Places are limited and spaces will go on a strictly first come, fust served basis. So-please fax back your order today ! I wish to promote my company, please * Text insertion only for £242 + VAT book my space: * Text and photo for £363 + VAT n J * ^ | l_. . .. .. .. .. a................... .... .... , . ■ . . . . .. . . .. . a .. .. . . . . r. .. ......... .... .#.4.4 .4. O ^ J ■" ^ l ^ l ^ 1 4- ■ 4 .4.4“ , ■ 44 4 , 4 1 4 L 4 44 4 14 1 4" 4" 4" 4.414. 4.4.4...— ■“ .10 13 TITLE r#444>4I444l414I4l4.4l4.414.414.4.4l4.. ...... A ID 13 k. l vS S ....................................... . i r ■ ■ ■ • l r i p a p 4 - - r - p - a a 9 mm ■■ Pi P 9 p -1 P 9 P 9 P 9 p 9 - - P - ¥ - ► 4 -a a ■ bp a pa r a 9- 99-9 9 a r ■ papa r a r a r 9 9 p - p - p 9 + - a - - a » ■ J a -p a 9 a 9- a -r ara 9 -B-PB + B*e 4 -i--p-f- 9 P 9 MHM + i r a + i + a+'fl + i + H P 9 -P 9 pbi B 9 -B 9 b 9 - p 9 p + r 9 + 4 + i a 9 a 4 + * + 4 a ■ + ■ TEL 9 9P 9 p 9B a P 9 - 9 b # l! < s * > a . ,, - a - - 4 . . . s. . . i, a .1. J s. a a a I. . I . r - j. _ i. a 1 a a a a a a a a aa a a a a a a aa a ■ aa aa aa r a aa a 9 pa a 9 r 9 p 9 a a p a -p a * 9 + 9 + S a f + ■ * a * « * *- ■ j U - a egaaa ji iaaa aaaaaif aaa*a PLEASE COMPLETE COUPON BELOW AND PAX BACK TO 00-44- (0)1 932 564998 COM PA N 3 K A M E # * , * . + . + 1 . - * - Vv E B A 13 D R ES 5 4 .< - . . ..... - k * . H ... H .. tH h h . 30 WORD DESCRIPTION ■ fP 9 PBiiP 9 M^HHH«»i a 4 - -fc + S + ■ 4 - £ 4 « 4 - i 4 a + a a a a ■ »a “ a aa aa aaaaaaaai P 9 P 9 p 9 p 9 P 9 t 9 p 9 P 9 p a #■ a + M a HI a a. a a a a a 1 p 9 p 9 ' a- a a M s 11 f < * I t 1 a 9 p 9 p 9 H + i+ i + H «+■+■*■* a a. a a a pa r 9 1 9 P 9 P 9 pip- p 9 pa + aa-aa a aa a a aa aa aa aa aa aa aa a a .a a j. a a a 1 a 9 ■ a i t • t r fi 1 a P9 + 9 + ia.a + s + aa.a p p 9- a 9- p 9 - a M 1-4 M a a a a a a a a a a aa aa aaaa aa a a "V 99 atBTa»a , fk + Mi#’*H M aa a a a. a a a ■ a'B 9 P 9 P 9 'P 9 P 9'-9 a 4 - + ■ + - a a a a a a a ■ a a -a a .« ■ TiTiTeTi + i + 1 + ltltIHf" aa aa ■ i p 9- 9 9 9 p 9 + a a. a a. a a pa pa p 9 pb 19 p 9 » a + S f s + f M + M ■ 4 - i + a a -a a M M'M-M aa a 4 a a .a a aa a 4 a a pa aaa a a. a 4 a 41 a ■ a a p a an a p a p a p a p a a -p a 9- 9 + 9 + a r 9 ■*. a a a a a a L p a 1 b i b i p 9 a 9 p 9 p + 9 + 8 + i # B 4 ¥ 4 a a a a a a. a a ■ ■ 4 a 4 ■ 1 a la is r a p a * 9 4 p 4 p 9 a 4 p 4 - a 4 * a aa a pa-PB 9 " 9 -i*B 9 99 p + 9 + 9 -pp 4 M a a aaaa aa ■ J elektor og-2010 79 SHOP BOOKS, CD-ROMs, DVDs. KITS & MODULES ;d Period Offer Subscribers'. discount elektor.com | September SMITH AUfiEL * T9 ft A A 7 Vs 6 AU-001-t* S R\1 ifltttf - — ■ lektor Use only free or open source software! ARM Microcontroller Interfacing Learn to interface and program hardware devices in a wide range of useful applications, using ARM? microcontrollers and the C programming language. Examples covered in full detail include a simple LED to a multi-megabyte SD card running the FAT file system. Interface to LEDs, transis- tors. optocouplers, relays, solenoids, switches, keypads, LCD displays, seven segment displays, DC motors, stepper motors, external analogue signals using the ADC. RS-232. RS-485, TWI, USB, SPI and SD memory cards. Also covered are methods to write programs to operate externally inter- faced hardware devices, using timers and interrupts, porting FAT file system code for use with an SD memory card, programming the PWM to produce an audio sine wave, programming the PWM to speed control a DC motor a nd more. A chapter on more advanced ARM microcontrollers is in- cluded with an overview of some of the newest ARM microcontrollers and their features. 250 pages * ISBW 978 O 905705-91 0 - £29,50 * US 547,60 For beginners and experts 50 PIC Microcontroller projects This book contains 50 projects for PIC mi- crocontrollers such as a laser alarm. USB teasing mouse, egg timer, guarding a room using a camera, mains light dimmer, talking microcontroller and much more. You can use this book to build the projects foryour own use, but also as a studybook or refer- ence guide. Several different techniques are discussed such as relay, R5232, USB, pulse width modulation, rotary encoder, interrupts, infrared, analog-digital conver- sion (and the other way around) . 7 -segment display and even CAN bus. 440 pages - ISBN 978 0-905705-88-0 06.00 * US S58,10 Several case studies included PIC Cookbook for Virtual Instrumentation The software simulation of gauges, con- trol-knobs, meters and indicators which behave just like real hardware components on a PCs screen is known as virtual instru- mentation. In this book, the Delphi pro- gram is used to create these mimics and PIC based external sensors are connected via a USB/RS232 converter communication link to a PC. 264 pages ■ tSBN 978 -0-905705-84-2 £29.50 ■ US 547,60 Bo Prices and item descriptions subject to change. E, &O.E 09-2010 elektor / Get started quickly and proceed rapidly Python Programming and GUIs Principles, Application and Design Power Electronics in Motor Drives This book is aimed at people who want to interface PCs with hardware projects us- ing graphic user interfaces. The program- ming language used is Python, an object-oriented scripting language. The book guides you through starting with Linux by way of a free downloadable, live bootable distribution that can be ported around different computers without re- quiring hard drive Installation. Practical demonstration circuits and downloadable, full software examples are presented that can be the basis for further projects. 224 pages - ISBN 9 78-0-90S705-S7 3 £29.50 ■ US $47,60 Learn more about C# programming and .NET C# 2008 and .NET programming This book Is aimed at Engineers and Scien- tists who want to learn about the .NET en- vironment a nd C# programming or who have an interest in interfacing hardware to a PC, The book covers the Visual Studio 2008 development environment, the .MET framework and C# programming language from data types and program flow to more advanced concepts including object orien- ted programming. 240 pages ■ I5BN978-Q-905705-BM £29.50 * US 547,60 This book is aimed at people who want to understand how AC inverter drives work and how they are used in industry. The book is much more about the practical de- sign and application oFdrivesthan about the mathematical principles behind them. T he key pri n c ip I es of po wer ele ctron i cs a re described and presented In a simple way. The detailed electronics of DC and AC drive are explained, together with the theoretical background and the practical design issues such as cooling and protec- tion. An important part of the bookgives d eta 1 1 s of the f eatu res a n d f u nctio ns of ten found In At drives, and gives practical advice on how and where to use these. A wide range of drive applications are described from fresh water pumping to baggage handling systems. Anyone who uses or installs drives, or is just interested in how these powerful electronic products operate and control modern industry will find this book fascinating and infor- mative, 240 pages * ISBN 978 0-905705-89 7 * 09.50 • US S47.G0 V_ More information on the Elektor Website: www.elektor.com Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH Untied Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@efektor.com ektor 75 Audio designs for home construction dvd The Audio Collection 3 A unique DVD for the true audio lover, containing more than 75 different audio circuits from the volumes 2002-2008 of Elektor. The articles on the DVD-ROM cover Amplifiers, Digital Audio, Loud- speakers. PC Audio, Test fir Measurement and Valves. Highlights include the ClariTy 2x300 W Class-T amplifier, High-End Power Amp, Digital VU Meter, Valve Sound Converter, paX Power Amplifier, Active Loudspeaker System, MPT preamp and much more. Using the included Adobe Reader you a re able to browse the articles on your computer, as well as print texts, circuit diagrams and PCS layouts. ISBN 97E-9Q-53&1 -263-1 £17,90 * US $28.90 A must-have for audiophiles dvd Masterclass High- End Valve Amplifiers In this Masterclass Mennovander Veen will exa m ine th e pre d ic ta b i I ity a nd pe rceptl bi I- ity of the specifications of valve amplifiers. The DVD represents 3.5 hours of video ma- terial. Bonus elements on the DVD include the complete PowerPoint presentation (74 slides), scanned overhead sheets (22 pcs), AES Publications mentioned during the Masterclass. Not forgetting the bombshell; 2 5 Elektor publications about valves. ISBN 978-0-905705- 86-6 £24.90 * US$40.20 k J elektor 09-2010 81 SHOP BOOKS, CD-ROMs, DVDs, KITS & See the light on Solid State Lighting dvd LED Toolbox This DVD-ROM contains carefully-sorted comprehensive technical documentation about and around LEDs. For standard mod- els, and for a selection of LED modules, this Toolbox gathers together data sheets from all the manufacturers, application notes, design guides, white papers and so on. tt of- fers several hundred drivers for powering a nd co ntro II ing LEDs in di ffe rent con figura- tions, along with ready-to-use modules (power supply units. DMX controllers, dim- mers). In addition to optical systems, light detec tors, ha rd ware , etc . . thi s DVD a Iso a d - dresses the main shortcoming of power LE Ds: h eati ng . Th is DVD cental ns mo re th a n 1 00 articles on the subject of LEDs, ISBM 978-90-5381-245-7 E2S.5Q * US 546.00 11 0 issues, more than 2.1 00 articles dvd Elektor 1990 through 1999 This DVD-ROM contains the full range of 1990-1999 volumes (all 110 issues) of Elektor Electronics magazine (PDF), The more than 2,100 separate articles have been classified chronologically by their dates of publication (month/year), but are also listed alphabetically by topic, A comprehensive index enables you to sea rch the entire DVD. ISBN 978-0-905705-76-7 MODULES _ I (July/ August 2010) Many radio amateurs in practice use two receivers, one portable and the other a fixed receiver with a PC control facility. The Elektor DSP radio can operate in ei- ther capacity, with a USB interface giving the option of PC control. An additional feature of the USB interface is that it can be used asthe source of power for the re- ceiver, the audio output being connected to the PC's powered speakers. To allow portables V battery operation the circuit also provides for an audio amplifier with one or two loudspeakers. PCB, oisembfed and tested (June 2010) In our March issue, we introduced Sceptre, a fast prototyping system fitted with a 32- bit microcontroller. Even on its own, this board will let you produce some great re- sults, but if we add an extension board to make it easier to access all its peripherals, the Sceptre platform becomes downright powerful. What's more, if you fit this extension board into a suitable case, you 1 II be able right from the start to develop a prototype that you can use 'properly' in a installation, with no trailing wires or bits of sticky tape holding everything together. Now that's what you call fast, convenient prototyping! Kit of parts, contains PCS and components £69.00 ■ US 5100,00 (May 2010) This control board has been designed for incorporation into typical industrial elec- tronics applications like controlling mo- tors or adjustment of static up- or down-converters. The objectives were to obtain a board with a large number of pul- sewidth modulation (PWM) generators, which enables us to control several mo- tors and static converters at the same time. The cost of the control board nee- ded to be as low as possible too. In addi- tion, it must be possible to construct the board using a soldering iron, without re- gum ng use of a reflow oven. PCS, populated and tested (March 2010) This open-source & open-hardware pro- ject aims to be more than just a little board with a big microcontroller and a few use- ful peripherals - it seeks to be a fast pro- totyping system. To justify this title, in addition to a very useful little board t we also need user-friendly development tools and libraries that allow fast implementa- tion of the board's peripherals. Ambitio- us? Maybe, but nothing should deter you from becoming Master of Embedded Sys- tems Universe with the help of the Elektor Sceptre. PCS., populated ond fested, test software loaded (excluding Bluetooth module} 82 Prices and item descriptions subject to change. E. & Q.E 09-2010 elektor September 2010 (No, 405) £ us$ Elektor Project Case 1 00500-7 1 .... Predrilled Lexan sheets with standoffs 14.90... 24.10 Di g ita E Mu Iti- E f fee ts U nit FFPRfiM 741 C37 V J VU J J — r 1 in. L L 1 'XV.' 1 1 1 u ' L ■ 1 ■ ■ ii ■ 1 a ii ■ mi ■ 1 ■■ ■ ■■ ■ ■ 1 a bi ■ ■■■ ii ■ ii b ■ ri ■ 1 a ii a n a ia ■ 1 1 -.4,00.., 6.50 090835-41 ....ATmegaS-lGPU... ..8.30... ....13.40 nq DR 3 S-47 ATlT ni/7 717-7 DPI 1 8.30... .,..13.40 09 083 5-71.,.. Kit of parts including PCBs . p ro gra mm e d controllers and EE PROM www.dektor.com Dual Voltage/Current Display 100166-71 .... Kit of parts End PCS. item -41 , LCD .* 62.00 100.00 july/August 201 Q {No. 403/404) The Elektor DSP radio 100126-41 .„.A7mega168PU *,.*.,„ 12.50 20.20 100126-91 .... PCB. assembled and tested 149 >00,-, .240*40 Daggerboard Position Detector 080307-41 .... PIC16F628A-DIH 8, programmed .,* * 8*GQ, f *„**12*9Q PIC R>45 Cable Tester 090643-41 PEG 6 F72, programmed * „*.**., 8.00 ......12.90 30 LED Pyramid 090940-41 .... ATtiny23 1 3-205 U, programmed 8.00....... 12.90 Digital Thumbwheel Switch 090538-41 .„.ATtlny2313dip20. programmed 8.00 12.90 W hi s tie r : E lect ro ni c Tra in er/ Coac h 1 00203-41 „„ PIG 6FS8 DIP 1 8. programmed 8.00 1 2.90 Solar Cell Battery Charger/MonEtor 090544-41 .... PIG 6F877A. programmed. — 16.50 26,70 Universal Timer with Zero Standby Current 090534-41 .... ATTiny2 31 3. programmed 8 . 00 ....... 1 2.90 Tiny Timer 091044-41 „„ATkiny23 13. programmed 8 .00 ..12.90 Universal PWM Driver 090856-41 .... PIG 6F628-1/P. programmed 8.00 12.90 Binary Clock 090187-41 .... PIG 65F877-20/PD1P40, programmed 18.50, .*....29.90 USB Tilt Sensor 070829-41 .... ATmega8-16AU(TQFP), programmed..... 8 .00,.,.... 1 2.90 090645-91 ....MMA7620 breakout board 8.50....... 13.80 Bench PSU for PC 090863-41 .... PIG 6F61 6-1/P, programmed 8.00 12.90 Sa i Tor’s B atte ry Meter 090117-41 .... PIC16F690DIP, programmed „..*.„ 8.00 ..12.90 Tiny Pulser 090444-41 .... ATTINV1 3-20P4, programmed 8.00.....,, 1 2,90 Micro Minimal Thermometer 090634-41 , t „ ATTINV1 3{A)dtp8. programmed..., 8,00 12,90 Waterproof Bathroom Switch 090537-41 .... ATtinyl3A, programmed ,*, * 8,00 ,12.90 lights Control for Model Cars 090834-41 Programmed controller ATtiny45 DIP-8 8.00 12,90 Modeller’s Clock 090023-41 PIC1 SLF1320 I/P DILI 8, programmed 8,00 ,12.90 Astrolamp 090550-41 ,..,ATTiny45 D I L8, programmed ATM1 8-DIPATM 1 8-DIP 090896-1 Printed circuit board... ...... U nd erflo o r heat in g cont roller 1 0031 8-41 .... ATtiny25-20p4DUO8, programmed ... RGB Synchronizing Fireflies 100358-41 .. ., AT Tl N V 1 3 ( V ) , prog ram med Scope Text 1 00327 -41 .... Attiny23 1 3 DJ L2 0* p rogra mmed., *.8,00 12, 90 Thermometer with Four-Digit LED Display 080536-41 ....AT89C2051 DIL-20, programmed 8.00 12,90 b PI IM - P-i PI- imiM rH P p. b H fi p-i p p-i « M an a H i- ! - i 1-4 ■ p 4 a #4 a fc + a t -4 a a + a «#fi + a-a n a a p t a aa-a ►+§ t-a-a a • a a-* a *■*» u a .8.00, ...... 12.90 .9.90 16.00 B.OQ ,.12.90 B.OO 12.90 Power Electronics in Motor Drives ISBN 978-0-905705-89-7.... £29.50 US $47.60 3 4 Python Programming and GUIs ISBN 978-0-905705-87-3*... £29.50 .....US S47.60 PIC Cookbook for Virtual Instrumentation ISBN 978-0-905705-84-2**.* £29*50 US $47*60 C# 2008 and .NET programming ISBN 978-0-905705-8 1-1 .... £29.50 US $47.60 1 3 4 [Masterclass DVD High-End Valve Amplifiers ISBN 978-0-905705-86-6.... £24.90 .... US $40.20 DVD LED Toolbox ISBN 978-90-5381 -245-7 .... £28.50 US $46.00 DVD Elektor 2009 ISBN 978-90-5381-251-8.... £17.50 US $28.30 DVD El ektor 1990 thro ugh 1999 ISBN 978-0-905705-76-7.... £69.00 ...US SI 00.00 v ' ■ ■ "* '3/ ISBN 978-90-5381-1 59-7 .... £24.90 US $40.20 Reign with the Sceptre Art. #090559-91 £89.00 ...US $1 43.60 ElektorDSP radio Art. #100126-91 £149.00 US $240.40 InterSceptre Art. # 100174-71 £1 16.00 ...US $187.10 dsPIC Control Board Art. #090073-91 £140.00 US$225.90 UniLab Art. #090786-71 £64.00 US $103.30/ r ^ Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1 000 Great West Road Brentford TW 8 9HH * United Kingdom Tel +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales^elektor.com elektor 09-2010 83 OWING ATTRACTIONS NEXT MONTH IN F 1 EKT 0 R Current Clamps Compared Although a multimeter is an extremely useful and versatile instrument, the range of the ammeter section usually ends at about 10 A. For larger currents you should use a so-called clamp that can easily handleiooAorevemooo A. In the October 2010 edition we describe our experiences with twenty current damp meters from different price ranges, varying from tens of pounds to about 500 pounds. Photo Timer Many modern digital cameras allow all features to be controlled remotely. Using the extensive photo timer published in the October 2010 edition, accurately timed photos can be made with Canon EOS or compatible cameras. A 4-line display shows all settings, which are also stored in an EEPROM. Optional pre-focusing is available and sound effects announce the actual ’shot'. NE5532 Power Amplifier In this article Elektor’s ‘off the beaten track’ approach to electronics flourishes. Sure, the NE5532 opamp is widely used in audio applications but it's less well known that an inter- esting power amplifier can be made by connecting enough of them in parallel. For this project 32 NE5532S are bundled to make a quality amplifier with an output power of about 15 watts into 8 ohms. The first instalment of the article describes the design philosophy and the schematics of this remarkable audio power amp. Article tides and magazine contents subjet t to change; please check the Magazine tub on www.elektor.com Elektor UK/ European edition: on sate September jj, jo to, Elektor USA edition: published September to, jo to. W\fl WW fw.elektor.com www.elektor.com www.elektor.conr Elektor on the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you’ll find all other products sold by the publishers, like CD-ROMs, DVDs, kits, modules, equipment, tools and books. A powerful search function allows you to search for items and references across the entire website. Clektor .m SMjp Siibttntif nr.« Ftfvni :0 brlEr ‘■ v.-.-.J ttflrx K< Mhn n EZ- 0 TT«1 tcmru v * f i TriwJJ**** rr» r :®*«r twiirclflp ■j *»? 0*1 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 wciwOrt>«iH* D ■ mi-* finfw v* k i im« r c * ■.# 1 ili .- »?* r r.o DlACOuhT Programming Embedded PlC Microconj rollers pflfibr £*«&£■ ¥ O Kit Of parti ElektorWhc^e ■i' f’mi tii 1*-r •ird -> *in-rr- ' l I r r?r trtrn-wmitr » -y •'& 0 Entir nw 1 Iri.-Ti" 1** q.r1-r» *| Ifi |^C p^>fl r * m * n,rT S irHh I - Fir r : And t*eR [iwi CO "£>*; I. P*BTf Tsk ’ irtl i** S' t ". j»: -jt ILK] 'LITE 84 09-2010 elektor Description Price each Qty. Total Order Code DVD The Audio Collection 3 r^Jl £ 12.90 ARM Microcontroller Interfacing £29.50 Power Electronics In Motor Drives £2930 50 PIC Microcontroller projects rMdJjjl £36. oo Python Programming and GUIs £29.50 DVD Masterclass High-End Valve Amplifiers £24.90 Subtotal Prices and item descriptions subject to change, PSP 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, & Q.E. Name Address + Post code Tel. Email Date Signature ELQ9 Yes, t 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: n ^ Standard Subscription (11 issues) Q Subscription-Plus (11 issues plus the Elektor Volume 2010 DVD-ROM ^ , + exclusive access to www. elektor-plus.com) Microcontroller Basics Offer available to Subscribers who have not held a subscription to Elektor during the last U months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email Date - - Signature EL09 METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer j ] Cheque (UK- resident customers ONLY) | | Caro transfer wsT □ Expiry date: Verification code: Please send this order form to' (see reverse for conditions) Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel j *44 20 826) 4509 Fax: +44 20 8261 4447 vuww.elektor.com sales £ elektor.com USA ,irrd Canjidii residents should use S prices, L md SL j nd tho order form to: Elektor US POBnx ISO Vernon CT 06066 USA Phone: 860 8 75-21 99 fax: 860 871 0411 _ E mall: sales-^ «.‘lt'kt ur.com ■ jC METHOD OF PAYMENT [see reverse before ticking as appropriate) Bank transfer | Cheque (UK-resident customers ONLY) j Giro transfer vIsT □ ju u i y imi i i ii i i i Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektQr.corn subscriptions^eiektor.com ORDERING INSTRUCTIONS, P&P CHARGES AH 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: 66.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £1 LOO (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. IBAM: GB96ABMA 4050 3040 2702 1 L B1C: ABNAGB2L. Currency: sterling (UKP), Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no, 34-1 52-3801. held by Elektor International Media BV. Please do not send giro transfer/ deposit forms directly to us. but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web. fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the sourte(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 ail 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 10% 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 ol 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, ^ p p p - - * ■ ■ P B . - - B + P ■! 4 - ■ ‘ SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom & Ireland £49,00 £61 >50 Surface Marl Rest of the World £63.00 £75.50 Airmail Rest of the World £79.00 £91 .50 USA £64*95 See www.efektor.com fusa Canada £75.95 for special offers HOW TO PAY Bank transfer into account no. 402702 1 1 held by Elektor International Media BVwith The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BIG: 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. Giro transfer into accounL no. 34-1 52-3801 , held by Elektor international Media BV. Please do not send giro transfer/deposit forms directly to us. but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our webstte 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 £39.20, a Student Subscription-Plus costs £51 .70 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (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 alter they have run for six m o nth s or more. January 2010 Order custom-designed boards from the Elektor PCB Service The advantages at a glance * Professional quality PCBs. • No film charges or start-up charges. ■ No minimum order quantity or charge for this service. ' Available to private and commercial customers. 1 Design check applied to all entries. We'll let you know within 4 hours! ■ Two PCBs supplied - three produced. if the thud board is also okay, you receive it as well - free of charge! Quick, cheap and secure www.elektorpcbservice.com Index of Advertisers Astrobe. Showcase Atomic Programming Ltd. Showcase . Avii Research. Showcase Beta Layout. Showcase Black Robotics, Showcase. ByVac, Showcase . . . . CEDA. Showcase ... Designer Systems. Showcase Easysync. Showcase Elriec. Showcase ....... ... Embedded Adventures, Showcase .... Eurocircuits First Technology Transfer Ltd. Showcase FlexiPanel Ltd. Showcase. Future Technology Devices Showcase Ha meg. Showcase Hex Wax Ltc Showcase Labcenjer . Linear Audio Showcase - ... www, astrobe. com — . , .73 www aiomtcprogfarnming.com .78 www.avifrcsearch. co.uk ■ t > 73 mvw.pcb' pQQi.com 33 , 78 www.biackQbotics.com , , . . + + ■ 78 www. by vac. com 78 www. ceda.in + , r ■ * .78 www. (fesignersystems .co.uk 78 www.oasysynC.coMk ............ .78 wwwelnec.com .78 Lvww.eiOhcddedadverUures. com , .78 mvw.eurotircuits.CQm ...... ■ § ► .27 www.ftt co.uk I ■ T 78 wwwJiexfpanel.com . . . ... . * * . 73 www.ftdrchip.com « + -o- .78 wwwdameg.com + P * .78 wwwMemax.com, * ¥ ■ 79 www. Iabcenter.com + r i ,88 haw/ ttnesraudio her , , . - . . .79 MikroElektronika. MQR Electronics. Showcase Ntitve Networks .... NXP Contest Peak Electrons Design Pirn I E u LJ . .. . _ ■ a «. a i . b ■ *. j -b a j- I. b _ a. J b m J i. Ouasar Electronics. Robot Efectroriics. Showcase . . . Robotiq. Showcase RS Components. Showcase .............. Steorn SKDB Lite. Showcase USB Instruments, Showcase . . . Un tins Technology, Showcase . , www.mikroe. com , . 2 WWW.nitjp.com . ...... x 79 www. xgamestatian. com .41 mvw.ctrciMceffar.com/fmmtecfdesignchd/longef .15 www.peakolBc.coMk .... ....... .41 www. ptcotech. com/scope201S . . , 51 www.quasaretectrowc5.com . ... 35 www, robot-eteCtroniCSCO- oA ... . . 79 www. robotiq.CO.uk , 79 www. rswww.com/6dp 3 7f3 79 www.kdh.steorn.com/ref25. .79 www, u$b - in st ruments . com . . ... 79 www.vif1ios.com 79 Advertising space for the issue 21 October 2010 may be reserved not later than 21 September 2010 wifi Hu son International Media - Cambridge House - Gtsgmore Lane - Chertsey. Surrey KT16 9AP - England - Telephone 01932 564 999 - Fax 01932 564 998 - e-mail: ros.elgar@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed elektor 09-20" a 87 PRE-PRODUCTION CHECK Board Edge Defined - CHECK Ail Components Placed - CHECK All Connections Routed - CHECK Power Planes Generated - CHECK l\ln Design Rule Violations - CHECK Design with Confidence: - T 1 + % - _ The latest version of the Proteus PCB Design Software provides a multi- stage Pfe^Production Check which will detect and prevent a variety of common mistakes prior to your boards being sent for manufacture. PROTEUS DESIGN SUITE Features! ■ Hardware Accelerated Performance. * . Unique Thru-View™ Board Transparency. . Over 35k Schematic & PCB library parts. . Integrated Shape Based- Auto-router. ■ Flexible Design f^ul&jyianagement. • Polygonal and Split Power Plane Support. Board Autoplacement & Gateswap Optimiser, Direct CADCAM, ODB++, IDF & PDF Output. Integrated 3D Viewer with 3DS and PXF export. ■ Mixed Mode SPICE Simulation Engine. Co-Simulation of PIC, AVR, 8051 and ARM7. Direct Technical Support at no additional cost. of the Proteus Design Suite include a world class, fully integrated shape-based at no additional cost • prices start from just £150 exc. VAT & delivery www.labcenter.com Visit aur website ar phone 01756 753440 -Electronics ” i Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. fflf f|jQfQ details Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com ■I'lPf