electronics & microcontrollers l/ Hearing treshold tester R43 10 9 9 770268 45115 Mixed Signal Oscilloscopes BitScope Analog + Digital Digital Storage Oscilloscope Dual Channel Digital Scope with industry standard probes or POD connected analog inputs. Fully electrically isolated from PC. Mixed Signal Waveform Analyzer Capture and display analog and logic signals together with sophisticated cross-triggers for precise waveform timing measurement. Instant Replay Signal Generator Built-in synchronized waveform generator. Synthesize arbitrary waveforms or replay captured analog or logic signals instantly. Multi-band Spectrum Analyzer Display analog waveforms and their spectra simultaneously in real-time. Baseband or RF signals with variable bandwidth control. Integrated Waveform Data Recorder Record to disk anything BitScope can capture. Allows off-line replay and waveform analysis. Export captured waveforms and logic signals. Multi-platform & user programmable Supports Windows, Linux and Mac OSX. USB and Ethernet models with user programming libraries, drivers and customizable software. Logic/Timing Analyzer Probes BitScope Software and Libraries BitScope 325 includes DSO, an intuitive test and measurement software application for your PC. The integrated test instruments include a digital storage oscilloscope, spectrum analyzer, logic state and mixed signal timing analyzer and an arbitrary waveform generator in one package. DSO is fast, with display rates up to 50Hz and deep, with capture up to 512kS per frame. Also included is a built-in data recorder to share captured signals with colleagues or customers via data export and real-time offline analysis. If you also need programmability, BitScope 325 comes with the BitLib application programming library for custom software applications or full integration with existing third party tools. BitScope is built tough to last a lifetime. Enclosed in a new low profile solid extruded aluminium case BitScope 325 can handle the harshest working environments. Its full metal jacket and electrically isolated design means that unlike cheap plastic alternatives it is also highly noise immune for the most sensitive mixed signal measurement applications. On the road or in the lab, BitScope is the ideal choice! Industry Standard Scope Probes Software Included Windows, Linux or Mac Ethernet or USB www . bitscope . com dLllUJOULl HA? 5* » RA 3 3 PA4 tc a HCLfl »* C 3 * SNO lc a RBQ n E-» CANCEL mikTOmraniKfl DEVELOPMENT TOOLS fO? EMBEDDED WORLD A* S POWGP r a. _ RfiD , Hfl nj.» sas cia □f> T (Pi [ "tlo cikL’I" 3 J3i ihtrfc l i i i i R ft * " jBfl 3 - r- t • • . Rftfi , fli Si Bi R USB LINK * PR 3/ICQ USB PROG USB COMM ADC INPUT ii”«5 SS'-jSS sH*H4-i-i ; jS 3 £ . 3 2 . 0 6 - ■ RBS , flB? USB ITliKro ICO & r on I !3H D Te SP 'm-32 CQG-D4 RBI CQG -05 ,il a 1 - 3 RC 2 Ifm-H-trl H ■- t.-. 5 or. ■ RCfi « «’ ^ ^ ■' RD2 limii l ^ CTS 2 0 S-B ? 5 »n- RDo £T!S E,Dfi-S TiHLi PG 7 o WC RC£ - 0 BC 2 ARoHS prig RAU BBS TOUCHPflHEL EXAMPLE I iO « tl D illS 1 SB 111 o^’W h-pu? Si il £3 EJB PORT EXPANDER M M KROELE TROIKA Vj 1 1 DEVELOPMENT TOOL JUST THE WRY YOU LIKE IT Everything you’ve always wanted from a development tool Experience the ease of creating your own electronic devices! Thanks to many new features, you can start creating your own devices immediately. EasyPIC6 supports 8-, 14-, 18-, 20-, 28- and 40- pin PIC microcontrollers. The mikrolCD (Hardware In-circuit Debugger) enables very efficient step by step debugging. Examples in C, BASIC and Pascal are provided with the board. r MR m INI DEI *■ — — CIRCUIT: BUGGER Hardware In-Circuit Debugger for step by step debugging at hardware level P o R T Z u X □ -+n PIC DEVELOPMENT BOARD Port Expander provides easy I/O expansion (2 additional ports) using serial interface Full-featured and user-friendly development board for PIC microcontrollers • ^ o *Q O* □ ° □ KEYPAD High-Performance USB 2.0 On-Board Programmer On-Board 2x16 Serial LCD Display Keypad enables easy and fast data entry Toad -free Find your distributor: ¥ RoHS http://wvm.inikroe.com/en/distributors/ 2O02J95/EC www.mikroe.com lektor electronics & microcontrollers Feedback is good! At social gatherings the conversation often comes round to what you do for a living. Editor sounds a bit exotic and the question then turns to what skills are needed for the job. Many years ago, a (very) senior editor divulged that you should be something of a craftsman. The analogy is not a bad one: to be successful you need a little bit of talent, loads of practice and a touch of artistic flair. I have to admit that our magazine is not always a master- piece but I never doubt the level of commitment of our team. I always look forward to the end of the month when we sit down with some pride (and relief) to thumb through the latest edition hot off the press. However the analogy breaks down here — unlike the tailor, carpenter or sculptor we never get to see the customer's face when they take ownership — or in our case read the magazine. Rarely do we get to know if our choice of an article was a good one, if the writing style is good or indeed what the overall impression was. It is a shame because we are continually asking questions: How many projects or articles on funda- mentals should we run? Do our soft/hardware descriptions have enough depth? Are readers interested in projects that don't include microcontrollers? Should the articles have a common layout or would it make a more attractive product if each article has a different layout? Raise that question at an editorial meeting and you are sure of a heated argument. It is interesting to see which work colleague takes which side in the debate. At the end of the day of course what we think is really not important, the customer is king! We really do value your feedback. Whether you found something to be really interesting or a total turn-off, we don't mind criticism — in fact we encourage it! Maybe you would prefer to see the magazine concen- trate on different subject areas or you dislike the direction the magazine is taking. Whatever the case, let us know, we look forward to your views at editor@elektor.com, or by post. Jan Buiting Editor 1 4 Sound Sorcery The science of acoustics holds many surprises: sound can be focused into beams, noise can be cancelled out by more noise, and sound waves can be made to appear from nothing as if by magic. This article explains how the tricks are done. In this project a piezoresistive transducer measures the atmospheric pressure, enabling a PIC microcontroller to use the ISA model (with temperature compensation) to display your current height above sea level (ASL) on an LCD. CONTENTS Volume 35 October 2009 no. 394 Very few people realise how much portable music players like iPods and mp3 players can affect our hearing. The hearing threshold tester presented here has been designed to check the state your ears are in. projects Barometric Altimeter 26 Touch LEDs for Arduino 36 Car Tilt Alarm 48 Hearing Threshold Tester 54 Pocket Preamp 58 Getting Started with Em- bedded C (part 3, final) 66 Mini Preamplifier tech nolo Sound Sorcery E-labs inside In this article we take a look at a number of noise cancelling headphones, designed to reduce background noise using anti-sound. How do these devices perform, and what's the price tag? 43 Portable Solar Chargers 44 "Noise is not cool" 46 Review: PSoC kit with RF module info & market 6 Colophon 8 News & New Products High End Audio Amplifier Kits 58 The Sound of Silence 80 ElektorSHOP 84 Coming Attractions infotainment 74 Hexadoku 76 Retronics: Philbrick R2-W, the mother of all op amps) [TOR ELECTRONICS WORLDWIDE elektor international media Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. Co «frof/ ei lektor USB i.fl Super Speed m allthf wjiy EhujMmpfetfliijii Volume 35, Number 393, September 2009 ISSN 1 757-0875 Elektor aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 1 1 times a year with a double issue for July & August. Elektor is also published in French, Spanish, American English, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Hettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff: Harry Baggen, Thijs Beckers, Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Design sta Antoine Authier (Head), Ton Giesberts, Luc Lemmens, Daniel Rodrigues, Jan Visser, Christian Vossen Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DT Giel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing Carlo van Nistelrooy Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com/subs 6 elektor - 10/2009 Elektor PCB Service S Your professional PCBs and Prototypes Elektor PCB Service is a new service from Elektor. You can have your designs converted into a professional- quality PCBs via the www.elektorpcbservice.com website. Elektor PCB Service is intended for prototype builders and designers who want to have their PCBs made to professional standards, and for users who want customised versions of Elektor PCBs. If you need a couple of 'protos' with fast turnaround or a batch of 5 to 50 units, we can meet your needs at a favourable price. £ PCB ^-a.rvicc 0 VBPlri F PC6 Prp*qi srd*r t 4 r ww'MVl I .-n,rr, C (HFf b| I-*-* cm, ** imm# Jlw W.inbnrL IflfilMM PafAil#* f Lf] ij] L-j. - . .... —™ — . ■ * • X Mi TJ -*mm l-nrin |* * S ■ c m r frap - j 1 r Mlektor The advantages at a glance • The PCBs are professional quality. • No film charges or start-up charges. • There is no minimum order quantity or charge for this service. • Available to private and commercial customers. • We'll first check if your project is producible. We'll let you know within 4 hours! • In order to supply two PCBs, we make three. If the third board is also good, you receive it as well - free of charge. • You can use our online payment module to pay easily, quickly and securely with Visa or Master- Card. Procedure: 1 . 2 . 3. 4. 5. Create your account Place your order Your project is checked Payment Your order is shipped lektor PCB Service Now available for everybody at www.elektorpcbservice.jCom i»i Email: subscriptions@elektor.com Rates ond terms ore given on the Subscription Order Form. Head Office: Elektor International Media b.v. P.0. Box 1 1 NL-61 14-ZG Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Distribution: Seymour, 2 East Poultry Street, London EC1 A, England Telephoned 207 429 4073 UK Advertising Huson International Media, Cambridge House, Gogmore Lone, Chertsey, Surrey KT1 6 9AP, England. Telephone: +44 1932 564999, Fax: +44 1932 564998 Email: r.elgar@husonmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photo- graphs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Elektor International Media b.v. and may not be reproduced or transmitted in any form or by any means, including photocopy- ing, scanning an recording, in whole or in part without prior written permission from the Publisher. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may ex- ist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guarantee to return any mate- rial submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media b.v. 2009 Printed in the Netherlands 10/2009 - elektor 7 INFO & MARKET NEWS & NEW PRODUCTS Actel offers free reference designs for LCD applications Actel Corp. is offering five ref- erence designs, free of charge, which are implemented using the Igloo Video Demo Kit. The Igloo Video Demo Kit was jointly devel- oped by Actel, Attodyne, and Avnet Memec. It is available from Avnet Memec and can be ordered online or from any sales office. The available reference designs target the following applications: DVI input to LCD, upscaling, photo viewer, still and video cameras, and video MUXing. The IGLOO Video Demo Kit con- sists of two boards: a video demo board and an LCD adapter board. The IGLOO video demo board is fitted with low-power Igloo FPGA with Flash Freeze technology and features low static power with quick entry to and exit from Flash Freeze mode. Designers have a choice of sev- eral LCD adapter boards with LCD panels of different sizes and resolutions. Two plug-and-play display adapter board are avail- able, and they can be fitted with different LCDs, ranging from 5.5 " to 7" and resolutions from QVGA (320x240) to SVGA (800x480). You can also build your own customized LCD adapter board. The IGLOO video demo board has an IGLOO device that interfaces with several video/image sources, such as a digital visual interface (DVI) input and a CMOS sensor interface. In addition, off- chip memory is provided for data buffer and storage. www.actel.com/ products / solutions/ display/refdesign.aspx (090569-IX) A new name and new-generation products revitalize embedded software A change of name signals the dynamic, fresh approach Cross- hairs Embedded is bringing to revitalizing embedded software. The company offers customers invaluable insight through precise software solutions, with a new gen- eration of products that deliver on that promise. The change of name from Active DSP to Crosshairs Embedded reflects the company's focus on opti- mizing embedded systems for international markets. Leading Crosshair's next generation product lineup the new Functiona ing systems in real time while they're running, it reduces downtime, helps increase efficiency, and leads to greater profits. Businesses will quickly find that Functional Til l H i I N>* Wi >“« i H ► I 1 P IS Debugger Version 1.1. By enabling businesses to debug, monitor and optimize their operat- o- ■*-*>* h i I Prpvif* m i i Di i! Gontaclless Sensing Demo Panel 4 0 0 f-r lm **‘*"- . | -| hM VUma ***** * * ■2 4PIM* V-- rw> IJUni ■*- W i Debugger vl . 1 is reli- able and highly cost- effective. It's especially valuable for organi- zations with operat- ing systems deployed worldwide, since it allows seamless, remote non-intrusive testing and monitoring of embedded systems even at large distances. It's also easy to use and more depend- able and adaptable than home-brew software test- ing solutions. Functional Debug- ger vl . 1 was officially launched at the Embed- ded Systems Confer- ence (ESC) 2009 in Boston. The company's next new-generation product, the powerful Interface Designer, will follow shortly. www.CrosshairsEmbedded.com (090569-XIII) Paper-thin battery ETA scheduled for 2010 6 jJ lf tnsnji As researchers rush to develop commercial versions of printable batteries with structured organic semiconductors on paper-thin, flexible substrates, a German team claims to be on track for a 2010 product launch. Scientists at the Fraunhofer Research Institution for Electronic Nano Systems col- laborated on this project with col- leagues at Chemnitz University of Technology and Menippos GmbH (Chemnitz, Germany). They are targeting applications such as smart credit cards with battery-pow- ered displays that can display the card bal- ance and other account information. Fraunhofer's batteries use zinc anodes and manganese cathodes, which react with each another to produce electricity. These materi- als are gradually used up over the lifetime of the battery, making them suitable for short-term applica- tions like greeting cards with built- in music players. The researchers are aiming at a price point under 1 0 cents per card. The batteries are pro- duced using a screen printing technique in which a squeegee presses the organic semiconductor materials through a screen onto a flexible substrate. In a process resembling lithography, templates are used to 8 elektor - 10/2009 create successive layers of battery components, each about the thick- ness of a human hair, until enough bulk has been achieved for a par- ticular application. Printable batteries for smart cards would weight less than 1 gram and be less than 1 mm thick. The organic materials generate 1 .5 V per cell, like conventional batter- ies, and they are free of hazard- ous substances such as heavy met- als used in conventional recharge- able and alkaline batteries. Fraunhofer researchers said their battery is already working in the lab, and their industrial partners estimate that the first commercial models will be ready for beta test- ing later this year. www.fraunhofer.de /en/ press / research-news /2009 /july/printable- batteries.jsp (090569-X) KEF creates unique flagship speakers In loudspeaker engineering as in everything else, true innovation sometimes requires rethinking a problem from first principles. So when KEF set out to create the Concept Blade, a unique not-for- sale speaker system designed to showcase their speaker technol- ogy, the acoustic research depart- ment had complete freedom to explore radical new options, with no preconceptions or aesthetic restrictions, and no reliance on existing components. After three years of exhaustive test- ing and analysis of traditional as well as experimental approaches to loudspeaker design, they per- fected a combination of technolo- gies that generates an extraordi- narily pure sound. Concept Blade is forged from these technologies. Its exceptional acous- tic integrity derives from the fact that every element of the system has been conceived to perform as a single coherent unit with all parts working in flawless harmony. The highest quality components and advanced materials have been used in perfecting the design. While the technologies incorpo- rated into the design are often very complex, the focus has always been on simplicity. The drivers are specifically designed to behave with zero break-up or resonance over their frequency range, and the distinctive cabinet is carefully engineered not to interfere with the purity of their output. www2.kef.com /us/ conceptblade (090569-IV) DC source-measure instruments compatible with ACS basic edition software Keithley Instruments, Inc. has enhanced its popular ACS Basic Edition software, adding sup- port for a broader line of source- measure (SMU) instrumentation. With the introduction of Version 1.1, ACS Basic Edition, a mem- ber of Keithley's Automated Cha- racterization Suite (ACS) family, can now support a far broader range of DC voltage and current test capabilities. It's compatible with the company's full SMU offe- ring, the broadest array of choices in the industry. Depending on the SMU selected, ACS Basic Edition supports sourcing and measuring up to 5 A or 1 1 00V DC on indi- vidual channels. The newly expan- ded source and measure ranges are especially useful for tests on evolving photovol- taic panels/solar cells and high power electro- nics in research, failure analysis, and inspection applications. ACS Basic Edition now also supports com- bining different SMU models into a single test, allowing easier con- figuration, test creation, and test execution - with no need to write code. The software now supports com- bining hardware from any of Keithley's SMU families into a sin- gle test, including Series 2600 and 2600A System SourceMeter instru- ments, Series 2400 SourceMeter instruments, the Model 4200-SCS Semiconductor Characterization System, and the Model 237 High- Voltage SMU. www.keithley.com / products / semiconductor/?mn=ACSBasicEdition (0907 11 -IX) Orchid's new 48V 1,400 watts brushless DC motor controller The new low cost brushless DC motor controller board from Orchid Technologies Engineering and Consulting, Inc, packs enor- mous power into a tiny electron- ics package. Designed to drive 48-Volt brushless DC motors up to 1400 watts, this miniature control- ler may be the smallest in its class. Small physical sizes make it pos- sible to develop high torque and operating speeds when overall product size and weight are appli- cation limited. The new board combines cost- sensitive engineering with preci- sion power electronics to craft an efficient, high-performing, three- phase power-output stage. Orchid selected an ST7MC microcontroller as the brains of this brushless DC motor controller. The ST7MC's fea- ture-rich complement of flash pro- gram store, static RAM, Eeprom, patented motor controller, timers, analog-to-digital conversion cir- cuitry, and robust processor reli- ability controls make the ST7MC a perfect fit in the motor control marketplace. The ST7MC's patented motor con- trol subsystem provides a highly cost-effective method to control many different types of brushless DC motors. Sensor and sensorless motors, 1 20- and 60-degree styles are all supported. www.orchid-tech.com (090712-1) 10/2009 - elektor 9 INFO & MARKET NEWS & NEW PRODUCTS True-Touch the HD Brilliance on hot new Samsung 18910 phone Samsung Electronics Company Ltd. has selected the TrueTouch 1 ™ 1 solution from Cypress to imple- ment the touchscreen in the new 18910 mobile phone. The 18910, also known as the OMNIAHD, lets users 'Touch the HD Brilliance' of the world's first phone with 720P high-definition video recording and super vivid 3.7" AMOLED display. Samsung selected the TrueTouch solution based on its fast response time, gesture support and charac- ter recognition capabilities that enable the 1891 0's outstanding multimedia player and fast inter- net browsing. In addition to the TrueTouch touch- screen, the 18910 employs a Cypress MoBL ,R) dual-port as an interconnect between the appli- cation and baseband processors, increasing multimedia and comput- ing performance and lowering sys- tem power in the new phone. According to Samsung, Cypress's TrueTouch and MoBL dual-port solu- tions gave the company the ability to go beyond the competition with new features and functions that customers are excited to use. www.cypress.com / go /TrueTouch (090568-XI) Antero Standard Development Kit for ARM7 The Antero Single Board Computer (SBC) family is the newest series of products from Vesta Technol- ogy. The Antero Development Kit is optimised for embedded control applications and allows the SBC to be very configurable, making it the Swiss Army knife of SBC's. Based on the 32 bit ARM7 technology, the SBC offers high performance with low power consumption, and small form factor. Antero features a rich I/O set that includes CAN bus, USB, I 2 C, SPI, multiple Serial, PWM, Quadrature and digital. Antero is constructed in the Indus- try Pack form factor. The IP module version is compatible with Industry Pack carrier boards. The Antero SBC with its full devel- opment environment is being offered now at a special introduc- tory rate. The SBC comes with soft- ware tools, sample application pro- grams and RTOS. Antero is ideal for machine and industrial control, equipment monitoring, process control, instrumentation and many other applications. www.vestatech.com (090568-XII) New microchip technology performs 1,000 chemical reactions at once UCLA researchers have devel- oped technology to perform more than a thousand chemical reac- tions at once on a stamp-size, PC-controlled microchip, which could accelerate the identifica- tion of potential drug candidates for treating diseases like cancer. Their study appeared in the Aug. 2 1 , 2009 edition of the journal Lab on a Chip and is currently available online. A team of UCLA chemists, biol- ogists and engineers collabo- rated on the technology, which is based on microfluidics — the utilization of miniaturized devic- es to automatically handle and channel tiny amounts of liq- uids and chemicals invisible to the eye. The chemical reac- tions were performed using in situ click chemistry, a technique often used to identify potential drug molecules that bind tightly to protein enzymes to either acti- vate or inhibit an effect in a cell, and were analyzed using mass spectrometry. While traditionally only a few chemical reactions could be pro- duced on a chip, the research team pioneered a way to insti- gate multiple reactions, thus offering a new method to quickly screen which drug molecules may work most effectively with a targeted protein enzyme. In this study, scientists produced a chip capable of conducting 1,024 reactions simultaneously, which, in a test system, ably identified potent inhibitors to the enzyme bovine carbonic anhydrase. A thousand cycles of complex processes all took place on the microchip device and were com- pleted in just a few hours. At the moment, the UCLA team is restricted to analyzing the reac- tion results off-line, but in future, they intend to automate this aspect of the work as well. (090711-1) 10 elektor - 10/2009 Surface soldering the Propeller chip Parallax Inc., has partnered with SchmartBoard to create an easy Propeller prototyping system in the form of a kit. If you are new to surface solder- ing and don't know where to start, the P8X32A-Q44 SchmartBoard kit is a perfect starting point. The SchmartBoard technology makes surface mount soldering easy. Once completed, the board will host Parallax's most powerful microcontroller on this convenient development platform, allowing access to all 32 I/O pins of the multicore Propeller chip. The kit retails at $39.99 and includes sur- face-mount and through-hole pack- age types for some components, offering a soldering choice and challenge. www.Parallax.com (search "SchmartBoard or "27150") (090711-11) SchmartBoard: cheapest ever development board for Microchip 8-bit PICs in SOIC case Eight-bit PIC® microcontrollers in 8-, 14-, 1 8-, 20- and 28-pin SOIC packages are all sup- ported by the new PIC Develop- ment Board SchmartModule. A user simply hand solders a PIC® chip using SchmartBoard's 'EZ' solder technology, adds a row of headers (included), and then con- figures jumpers for the PIC type which was soldered onto the board. The 2" x 2.5" board has an onboard 5 V power regulator and reset button. It also supports optional external clock options, ICSP and RJ1 1 interfaces for programming. n m H * «R The new PIC development board is claimed to be the most flexible option on the market for PIC chip compatibility. If you use 8-bit PICs often, at $15, this inexpensive solution offers the opportunity to keep a number of development boards on hand and knowing they will work with any SOIC 8- bit PIC chip they use in the future. Also, a distributor can now stock board to support over 100 PICs as opposed to a variety of differ- ent boards to support the many 8-bit PIC options. SchmartBoard will follow this product up with an 8-bit PIC board for chips in a QFP form factor, boards for 16-bit PICs and some development boards for other microcontroller manufacturers. www.schmartboard.com (090711-V) Rapid prototyping of digital AV applications and ARM Cortex-M3 embedded systems Toshiba Electronics Europe (TEE) and Keil have announced a devel- opment kit that simplifies the design of digital AV applications and other embedded systems based on Toshiba's microcontrollers based on the ARM Cortex™-M3 proc- essor. The new MCBTMPM330 Starter Kit provides all of the hard- ware and software necessary for the rapid evaluation, prototyping and testing of applications based on the Toshiba TMPM330Fx range of devices. The new Starter Kit comprises the MCBTMPM330 Evaluation Board, a Keil™ ULINK-ME USB-JTAG adapter, an evaluation version of Keil's Microcontroller Development Kit (MDK-ARM), and a variety of example programs. All power for the evaluation board is provided by the host PC via the ULINK-ME. As well as the microcontroller, the evaluation board incorporates an adjustable analogue voltage source for testing the TMPM330Fx inte- grated ADC, JTAG and ETM con- nectors for enabling developers to debug and gather trace information from their applications. The board's MCU pinout area provides easy access to the device's peripherals. The MDK-ARM tools provide devel- opers with industry-standard com- pilation tools and sophisticated debugging support. It features the Keil pVision Integrated Develop- ment Environment (IDE), debug- ger and simulator, the ARM Com- pilation tools, and an RTX real- time kernel. Detailed startup code for the Toshiba microcontrollers, Flash programming algorithms for ULINK and extensive program examples all ensure that users can quickly begin developing their applications. The MCBTMPM330 Starter Kit is available now and is the first in a line of collaborative products from Toshiba and Keil. www.toshiba-components.com www.arm.com (090711 -IV) 10/2009 - elektor 11 INFO & MARKET NEWS & NEW PRODUCTS Pololu Jrk USB motor controller with feedback Pololu announces the release of the jrk line of USB motor control- lers: highly configurable, versatile devices that make it easy to add open- or closed-loop control of brushed DC motors to your com- puter- or microcontroller-based project. The jrk supports four inter- face modes — USB for PC-based control, logic-level (TTL) serial for use with embedded systems, ana- log voltage for simple potentiome- ters and joysticks, and RC pulse for radio control systems — and can perform open-loop speed control, closed-loop position control with analog voltage feedback to make your own servos, and closed-loop speed control with frequency feed- back from a tachometer. The jrk 21v3, the smaller of the two units currently available, has an operat- ing range of 5-28 V and can deliver 3 A continuous output (5 A peak). The jrk 1 2vl 2, the more powerful of the two, has an operating range of 6-16 V and can deliver a con- tinuous output of 1 2 A (30 A peak). Both devices can handle transients of up to 40 V. A free configuration program (Win- dows XP and Vista compatible) is available for calibrating your sys- tem. Real-time plots of variables such as control input, feedback, motor output, and current draw make it easy to fine-tune set- tings such as PID constants, accel- eration, and current limit for your application. The unit price is $49.95 for the jrk 21v3 (item #1392) and $99.95 for the jrk 1 2vl 2 (item #1393). All prices plus P&P. www.pololu.com (09071 l-VIII) Sparkfun s Holy Grail of new products Sparkfun's lively and fun approach to DIY electronics is once again demonstrated by a flurry of new products released on the market, a few of which are listed here — there's much more to marvel at on their website. Trackballer is a breakout board for the Blackberry Trackball. The board comes equipped with four hall-effect sensors, LEDs (RGBW), and the Blackberry Trackball. Check out the video! O-Clock, the AVR Oscilloscope Clock is back in a new all SMD version. It turns your X-Y analogue oscilloscope into 1 of 30 display combinations. Solar cell is Sparkfun's largest yet! It's rated for 8 V open voltage and 650 mA short circuit. The TFT-LCD ScreenKey is a tactile switch combined with a 128x128 TFT-LCD display that can gener- ate any text or graphics with up to 65,536 colour support. Why use just a button when you can display full colour images on one? New Arduino Shields include the Arduino Mega (ATMega 1 280), which now has its own prototyping shield and the WingShield Screw- Shield which extends all pins of the Arduino out to 3.5 mm pitch screw terminals. Both sides of the shield are broken out to the side of the Arduino, to allow access to everything on the main Arduino board. www.sparkfun.com (090711 -VI) better electronics from nanoelectronic transistors and a biological machine Lawrence Livermore National Lab- oratory (LLNL) researchers have devised a versatile hybrid platform that uses lipid-coated nanowires to build prototype bionanoelectronic devices. Mingling biological com- ponents in electronic circuits could enhance biosensing and diagnos- tic tools, advance neural prosthet- ics such as cochlear implants, and could even increase the efficiency of future computers. While modern communication devices rely on electric fields and currents to carry the flow of infor- mation, biological systems are much more complex. They use an arsenal of membrane receptors, channels and pumps to control sig- nal transduction that is unmatched by even the most powerful comput- ers. For example, conversion of sound waves into nerve impulses is a very complicated process, yet the human ear has no trouble per- forming it. To create the bionanoelectronic platform the LLNL team turned to lipid membranes, which are ubiqui- tous in biological cells. These mem- branes form a stable, self-healing, and virtually impenetrable barrier to ions and small molecules. The researchers incorporated lipid bilayer membranes into silicon nanowire transistors by covering the nanowire with a continuous lipid bilayer shell that forms a bar- rier between the nanowire surface and solution species. The team showed that by changing the gate voltage of the device, they can open and close the membrane pore electronically. https://www.llnl.gov/ (09071 l-III) 12 elektor - 10/2009 125nA Supervisory circuits extend battery life Maxim Integrated Products intro- duces the MAXI 605 6-MAX 1 6059, ultra-low-power microprocessor supervisory circuits that monitor a single system supply voltage. These devices consume an indus- try-low 125 nA supply current to extend battery life in power-sensi- tive applications. Additionally, the devices fea- ture capacitor-adjustable watch- dog (MAXI 6056/MAXI 6058) and reset timeouts to maximize design flexibility. This configura- bility makes it easy for designers to quickly change design param- eters, and enables the supervisors to be used in unique power-saving schemes. To minimize system power con- sumption in battery-powered applications, the MAXI 6056- MAX16059 can be used to peri- odically wake up the processor to complete its required duties, and then turn off the processor when those functions are complete. At a mere 125 nA, the operating sup- ply current of these supervisory circuits is much lower than the standby supply current of a typical microcontroller (> 1 microamp). The MAXI 6056-MAXI 6059 can monitor voltages from 1 .575 V to 4.625 V. These devices assert a reset signal whenever the Vcc supply voltage drops below the reset threshold, manual reset is pulled low, or the watchdog timer (MAXI 6056/MAXI 6058) runs out. The reset function fea- tures immunity to power-supply transients. http://www. maxim-ic.com/MAXl 6056 (09071 1-VII) Advertisement nnnnn A N T E X YJVJ\UVJVJ 60 + years of experience It may surprise you but buying an Antex soldering iron costs less than you think in the long run. British made to exacting standards, they last significantly longer than many imported brands. With a wide range of thermally balanced models, and temperature controlled irons too, you can always be sure to find an iron that meets your needs, A large range of replacement tips are available for most irons, and technical help is on hand from our offices in Devon UK. Buy Online Our new website has all of our irons, and soldering spares and accessories available 24hrs a day. Most items are shipped next day. Why not give antex.co.uk a try! Antex offer a wide choice of input voltages and bit profiles for our soldering iron range . * > » ■ k * www. a ntex .co.uk Antex Electronics Ltd 2 Westbridge Industrial Estate Tavistock, Devon PL19 8DE, UK Tel: +44(0)1822 613565 Fax: +44(0)1822 617598 Email: sales@antex.co.uk Web: www.antex.co.uk 10/2009 - elektor 13 TECHNOLOGY ACOUSTICS Sound Sorcery Sound projection, noise cancellation and wave field synthesis By Jens Nickel (Elektor Germany Editorial) Music, speech, noisy neighbours - sound is all around us. And yet the science of acoustics holds many surprises: sound can be focused into beams, noise can be cancelled out by more noise, and sound waves can be made to appear from nothing as if by magic. Here we explain how the tricks are done. The human sensory system has evolved over hundreds of thousands of years of hunting and gathering. From the rustle of a predator to the music of a flute, sounds are continuously bombarding us from all sides, and humans have acquired the essential survival skill of determining the direction from which a sound comes. So it seems like magic that it is possible to create a focused beam of sound: music or speech made clearly audible if you stand at just the right point, but take a step to the left or right and the sound disappears. Focused beams of sound can be used, for example, to link visual advertising with an audio track that can only be heard by a person standing directly in front of the relevant hoarding or dis- play. Museums, art installations and other exhibitions are all already making use of 'directed sound'. So how does it work? Even an ordinary loudspeaker is somewhat directional, but the beam is generally not nar- row enough for the applications mentioned above. This is because the wavelength of sound waves in the audi- ble range is large compared to the size of the transducer, which therefore behaves approximately as a point source. If we want to focus the sound into a narrower beam, it is necessary to make the transducer several metres across. We will look at three of the simpler techniques for mak- ing a focused beam of sound. The easiest to understand is the reflector method. Here the transducer is mounted backwards, pointing towards a spherical reflector. The sound waves emitted hit the reflector and are sent back in the desired direction (Figure 1). This creates a kind of focus where sound waves arrive with equal delays: this means that relative phase is preserved. We therefore have constructive interference (see the text box for more about interference). This method has not seen wide use, apart from in the 'Sound Dome' system by the American com- pany Brown Innovations [1]. Phase, delays and transducer arrays A similar effect can be achieved by using a large number of individual transducers, all fed with the same signal and arranged in a spherical pattern (Figure 1). It is also possible to use a flat array of loudspeakers, as long as we ensure that each loudspeaker is fed with a suitably-delayed sig- nal. The nearer a loudspeaker is to the middle of the array, the greater the delay required in the signal that is fed to it relative to the signal fed to the loudspeakers at the edge Figure 1. Reflector (left) and spherical loudspeaker array (centre): there is constructive interference at the focus. The same effect can be achieved with a planar array if the transducers are driven with suitably phase- shifted signals. 14 elektor - 10/2009 of the array. Usually a DSP device is used to generate the required signals, with an independent D/A converter and amplifier for each output transducer. An advantage of this digital beamforming technique, in contrast to the reflector-based techniques, is that both the direction and the width of the beam can be adjusted without making mechanical alterations to the system. The American com- pany Dakota Audio [2] makes loudspeaker arrays based on this technique, for use in advertising, exhibitions and other applications. The technique also has an interesting application in con- sumer electronics. The Japanese company Yamaha makes so-called digital sound projectors aimed at the home cin- ema and surround sound market (Figure 3). Forty small tweeters create several beams of sound in various direc- tions; the lower frequency components are handled by conventional mid-range and bass loudspeakers. An optional sub-woofer is also available [3]. The loudspeak- ers simultaneously generate a separate sound beam for each channel (front left and right, centre, rear left and right). The front and rear channels are emitted at preset angles to the left and right, to be reflected from the walls of the room (see Figure 4). The rear channels then appear to be coming from behind the listener. The designers seem to have been very successful in their work: both the spe- cialist press and customers have raved about the intensity of the surround effect, although it cannot match a care- fully-set-up high-end traditional surround sound system consisting of five separate loudspeakers. The sound pro- jector system is aimed at customers with limited space or whose aesthetic sensibilities rule out installing a full sur- round-sound system. The YSP-1100 model, which has a 40-speaker array, can be bought on-line for a little over £/€ 500. There are cheaper models with smaller arrays, as well as rather dearer models with various extra features. Not to be outdone. Pioneer introduced its digital sound projector PDSP-1 [4], a rather more complex device sport- ing an astonishing 254 transducers and 254 digital ampli- fiers (Figure 5). The device came on the market in 2003 for around £15000, but is no longer available. Jurgen Timm of Pioneer Germany says the "very expensive project" was discontinued when British start-up '1 Limited', on whose development work the sound projector was based, fell prey to "internal disputes". Ultrasound as a carrier A third technique for generating a beam of sound uses ultrasonics. Since ultrasound can have a wavelength of just a few millimetres, it is relatively easy to construct one suf- ficiently large transducer (or a dense array of smaller trans- ducers) which, rather than behaving as a point source, creates a plane wave (see text box). In order to generate frequencies in the audible range a technique called inter- modulation is used, where two powerful ultrasonic waves of different frequencies are overlaid. The ultrasonic waves affect the properties of the air through which they travel in such a way that non-linear effects cause them to combine to produce a wave at a new frequency. Many readers will be familiar with the way that mixture products are gener- ated when two radio frequency signals are combined in a non-linear circuit, and indeed the mathematics behind the two effects is the same [5]. If we simultaneously generate an ultrasound signal at 40 kHz and another at 41 kHz, an audible sound at the difference frequency of 1 kHz will be produced; and in general it is possible to modulate the ultrasound signals to create audible speech and music. The audible sound is not actually present at the source of the ultrasound: it is only created along the length of the emitted beam. The situation can be visual- ised as a string of 'virtual loudspeakers'. Since the ultrasound signals and the audible signal prop- agate with the same speed, there is strong constructive interfer- ence along the axis of the beam, and destruc- tive interference at var- ious angles off the axis Figure 2. This loudspeaker array by Dakota Audio is designed for ceiling mounting. The circumference is about 90 cm. Figure 3. The Yamaha 'Sound Projector' uses 40 tiny tweeters to create a surround sound effect without the need for additional speakers behind the listener. Figure 4. In sound projection systems a separate beam is produced for each channel (front left and right, centre, and rear left and right). The beams are simultaneously generated by the transducer array. (Graphic courtesy Pioneer) ooooopoooooooooooooo ooooooooooooooooooo ^OOOOOOOOOOOOOOOOOOO ooooooooooooooooooo >0000000000000000000 ooooooooooooooooooo ooooo o o O 0 0 o 0 oooooooo ooooooooooooooooooo OOOO 1 Figure 5. The Pioneer PDSP-1 digital sound projector sports 254 transducers (and 254 digital amplifiers), but unfortunately is no longer available. 10/2009 - elektor 15 TECHNOLOGY ACOUSTICS Figure 6. The Sennheiser 'AudioBeam' uses 150 piezoelectric transducers to generate a directional ultrasound field onto which the audio information is modulated. Figure 7. The 'HSS' system, made by American company ATC. One panel, including electronics, costs around US$ 1400. Figure 8. Hairdresser high-tech. In the ceiling there are panels that form part of the Audio Spotlight' system by American manufacturer Holosonics. The panels create an ultrasound field using a vibrating metal-polymer hybrid film. Figure 9. The LRAD (Long Range Acoustic Device) is the circular object towards the top right of the picture. The loudspeaker arrangement creates sound at levels of up to 150 dB, enough even to ward off pirates! of the beam. This kind of system can produce a beam that carries over a distance of more than ten metres, with an attenuation of 20 dB in signal level at an angle of 5 ° off- axis. Commercial products based on this principle, such as those made by Sennheiser [6] and the American com- panies Holotronics [7] and American Technology Corpora- tion (ATC) [8], consist of an ultrasound driver unit and an amplifier with the necessary modulation electronics (see Figure 6 and Figure 7). Using these devices it is possible to 'speak' to a chosen person in a crowd. Figure 8 shows another interesting possibility. Although the focusing effect is astonishingly sharp, the method does suffer from a disadvantage: it is only practical to generate frequencies above about 300 Hz. In contrast to this, phased array techniques are limited only by the capa- bility of the individual transducers used, easily reaching 70 Hz or even lower. Manufacturers are of course keen to point out the limi- tations of their competitors' approaches. Phased array enthusiasts Dakota Audio characterise the reproduction of natural sounds using ultrasonic systems as screechy or like breaking glass. Meanwhile, Dr Joseph Pompei, founder of Holosonics, stresses that driver area is the only thing that matters when trying to produce a focused beam of sound. He claims that it can be proved mathematically that any additional phasing or masking can only have an adverse effect on beam quality. As well as the HSS ultrasound system ATC also makes the LRAD (long range acoustic device), shown in Figure 9. This loudspeaker system is capable of transmitting acoustic messages or warning sounds over long distances, includ- ing over open sea. The most powerful model can even be used by a ship's crew to ward off pirates: according to ATC the sound pressure level can reach 152 dB, with levels of up to 90 dB at a distance of 300 m. Various US military organisations have already ordered LRAD devices, and so technical details are kept largely under wraps. Wikipedia claims that the system uses an array of tweeters driven in phase, giving a moderately narrow beam [9]. Wikipedia also has an entry on current research into so-called 'sonic weapons' [10], though of course publicly-available infor- mation is again rather thin on the ground. Anti-sound Now we turn to another counter-intuitive aspect of acoustics. The effects of long-term exposure to noise from machinery or vehicles can range from discomfort to seri- ous health problems. It is possible to reduce the noise level using passive damping, but an active technique is also available: anti-sound, or active noise cancellation. The technique uses the principle of destructive interfer- ence (see text box). It is easy to see that sound and anti- sound of the same frequency must have opposite phases, and the theory of this was worked out in the 1930s; the practice, however, has fallen somewhat behind and active noise cancellation is only really successful in certain spe- cial situations. If the source of unwanted noise acts (at least approxi- mately) as a point emitter, and remains fixed in position, then things are relatively straightforward. A microphone is placed between the noise source and the area where the noise is to be cancelled, arranged so as to pick up the sound. Some simple electronics shifts the phase of the sig- nal and outputs the result to a loudspeaker, which creates the wanted anti-sound. A suitable circuit can be built fairly easily using analogue components [11]. Alternatively it is possible to digitise the 16 elektor - 10/2009 noise signal, and use a DSP device to calculate the (dig- ital) anti-sound signal, which is then converted back to analogue form and amplified. There are also dedicated devices available [12] which additionally offer various fil- tering functions. As sound travels at about 340 m/s in air, it is necessary to calculate the anti-sound signal quickly: a delay of 1 ms corresponds to a distance of 34 cm. The method described above is known as the 'feedfor- ward' technique, where the system attempts to cancel the sound before it reaches the target area. An alternative is the 'feedback' technique, which works well in noise-cancel- ling headphones. Here a microphone is placed within each ear-cup of the headphones to measure the noise signal, and an algorithm is used to calculate the anti-sound sig- nal that should be added in to minimise the overall error from the wanted signal. Headphones like this (Figure 10) are aimed not only at the consumer audio market but also at aircraft pilots and call centre workers. The environment in which the system has to work is relatively friendly, in that the area over which cancellation must take place is very small, much smaller than the wavelength of the fre- quency components that are to be cancelled. This means that the sound pressure level is roughly constant over the whole of the inside of the headphone ear-cup. It is there- fore perhaps more appropriate to think of the system as regulating the pressure inside the ear-cup to the desired value at any given instant rather than as creating an anti- sound. The principle is particularly effective at lower fre- quencies, for example when cancelling the engine noise from a turbine helicopter. If we combine these active techniques with passive meas- ures that in practice work better at higher frequencies. Figure 10. Anti-sound headphones by Sennheiser. The 'NoiseGuard' range uses analogue circuitry, which the manufacturer claims has benefits in terms of cost and speed. noise-cancelling headphones can achieve an attenuation of 20 dB over the entire audio spectrum. There is a test of various headphones with active noise cancellation else- where in this issue. The road to peace For the reasons we mentioned the techniques above are particularly effective at combating noise from engines, fans and other machinery. The technical difficulties increase considerably, however, if it is desired to suppress noise that is complex in nature over a wide area, especially if the sources of the noise are not stationary. Analysing the entire sound field in terms of the amplitude and direction of the noise sources requires a spherical array of closely- Effects Interference Sound propagates through a medium, such as air, as a wave. The sound wave from a point source can be visu- alised as similar to the waves on the surface of the water when a stone is thrown into a lake, although in the case of the sound wave the motion of the particles involved in the wave is parallel to the direction of propagation rather than perpendicular to it. When a trough in a sound wave from one source meets a peak in the wave from another source, the waves cancel each other out: this phenome- non is called destructive interference. If two peaks meet one another, the result is constructive interference. Plane waves A so-called 'plane wave' is produced when several sources, all emitting the same sound signal, are arranged in a plane array. For clarity we show a one- dimensional arrangement here. A similar situation occurs when the diameter of the transducer is much larger than the wavelength of the sound. Virtual sound sources If the sources are arranged to emit signals with different pha- ses, it is possible to create curved wavefronts. If the transdu- cers are driven with the right signals it is possible to create a wavefront shape that matches exactly that which would be a produced by a single loudspea- ker acting as a point source. With a densely-packed spherical arrange- ment of loudspea- kers it is possible to simulate the effect of sound sources at any point outside (or even inside) the sphere. Using a circular array of loudspeakers it is possible to simulate closely the effect of a loudspeaker anywhere within the plane of the circle. The distance between adjacent trans- ducers in the circle should be less than half the wavelength of the highest frequency component to be generated. Sound field analysis The position of a sound source can be determined from the signals picked up by microphones arranged in a grid. A com- plete sphere of microphones is needed in order to identify sources located anywhere in the surrounding space. The sig- nals picked up determine the sound field at all points within the sphere. If all the sound sources to a good approximation lie in a sin- gle plane, a circular microphone array is sufficient. 10/2009 - elektor 17 TECHNOLOGY ACOUSTICS Figure 11. The electronics in the Wuppertal anti-sound system. The converter card has 24 analogue inputs and twelve analogue outputs. (Photograph courtesy WaveScape Technologies GmbH). packed microphones around the target area (see the text box on sound field analysis). Professor Detlef Krahe and his team at the Faculty of Electrical Engineering of the University of Wuppertal in Germany [13] has taken up this challenge. The long- term aim of the research is to create an affordable, weath- erproof system that can cancel street noise over the area of a balcony or patio. Since the vast majority of the rele- vant noise sources lie in a horizontal plane, the engineers can represent them using a two-dimensional model. A circular array of microphones is used, placed roughly at ear height around the area where the noise is to be can- celled. As Krahe explains, a microphone is needed every 35 cm (approx. 1 foot) in order to analyse frequencies up to 500 Hz adequately: this figure is derived using a spatial analogue of the Nyquist sampling theorem. In practice two microphones are used at each point so that both the sound pressure and its gradient can be measured. Within the ring of microphones is a ring of loudspeak- ers that creates an anti-sound field matching the noise sound field. The computation involved is 'simply' to cal- culate a suitable transfer function for each combination of one microphone and one loudspeaker. The calculation must be done within the 2 ms that it takes for an incom- ing sound wave to propagate from the microphone ring to the loudspeaker ring. According to Professor Krahe, with an array of 24 microphones and 12 loudspeakers the job is now within the capabilities of a single DSP device: an older version of his system required a network of four Texas Instruments TMS320C6713 processors, but the most recent version runs on a single TMS320C6455. This latter device, clocked at 1 GHz, is capable of performing eight billion multiply-accumulate operations per second. To min- imise the propagation delay through the electronics, spe- cial low-latency A/D and D/A converters are used. The A/D converter selected is a successive approximation type, the ADS8364 from Texas Instruments, with a conversion time of 4 /xs. D/A conversion is done by a Burr-Brown DAC7744, which has a conversion time of just 10 /xs. Figure 11 shows the main circuit board of the system with a daughter card carrying the converters for 24 analogue input channels and 12 analogue output channels. The system was demonstrated working in prototype form at the CeBit exhibition in 2002, but now, some years later, the system is still undergoing extensive adjustments and fine tuning. The demands on the system are enormous. The anti-sound signal must be matched to the incoming noise signal to within 1 dB of amplitude and to within 6 ° in phase over the entire frequency range to achieve a noise attenuation of 20 dB [14]. It's a beautiful noise At the Fraunhofer Institute for Digital Media Technology (IDMT) in Ilmenau, Germany, the concerns are rather different. Their aim is to reconstruct recorded sound sources as faithfully as possible using wave field synthesis (WFS) [15]. The German engineers have taken the theory, which was developed in the 1980s at the Technical Uni- versity of Delft in the Netherlands, and converted it into a market-ready product [16]. A WFS system can be used to play back ordinary audio material, such as a stereo or surround-sound signal. A circular formation comprising a large number of loudspeakers, all driven from a computer, can generate 'virtual loudspeakers' at any desired posi- tion outside the physical array. Each source channel can be assigned to a different virtual loudspeaker. Whereas a con- ventional system consisting of five or seven physical loud- speakers set around a living room always involves a com- promise to the quality of the sound stage, sound played through a WFS system has a very sharply defined aural image. Also the so-called 'sweet spot' (the listening area where the effect is most striking) is considerably enlarged, which increases the range of possible applications: for example, the 'Linden Lichtspiele' cinema in Ilmenau has been fitted with a WFS system by Fraunhofer IDMT (see Figure 12). The auditorium is surrounded by loudspeak- ers, arranged in panels each comprising eight mid-range devices and eight tweeters. Each panel also contains the amplification circuitry, and receives audio information over an AD AT lightpipe. As you might imagine, the computer power required to generate all these audio signals is considerable. Accord- ing to Dr Sandra Brix, an engineer at Fraunhofer IDMT, a modern PC (with four quad-core processors) is enough for a smaller system with twelve groups of eight channels. She adds that besides the audio rendering functions, the computer also performs filtering and delay interpolation functions for rapidly-moving sources. The system can also add room reflection and reverberation effects, for example to simulate a concert hall. Conventional multi-track audio material does not really challenge the WFS system. The system is most impressive Figure 12. A wave field synthesis system in the linden Lichtspiele 7 cinema in Ilmenau. The system has over 192 separate channels. (Photograph courtesy Fraunhofer IDMT/Ingo Herzog). 18 elektor - 10/2009 when the position of an audio source is known along with the signal it is producing. The MPEG-4 compression stand- ard supports 'audio objects', and the system can process up to 64 of these objects simultaneously in real time. Each can be independently positioned anywhere inside or outside the area covered by the system. The positions can even be changed dynamically during a performance. The audio objects might be the individual instruments of an orchestra or extra sounds added into a mix by a DJ during a live per- formance. Assuming the style (and volume) of the music doesn't put you off, you can experience the effect for your- self at the famous 'Tresor' club in Berlin, which is equipped with a WFS system made by Iosono GmbH [17], a spin-off company from Fraunhofer IDMT. The researchers are now working on a system aimed at the home user. The main problems to be tackled are the large number of loudspeakers required and the lack of a standardised distribution format. The first problem may be solved with the introduction of new flat loudspeakers. The second may be harder to overcome: the WFS system will only be able to be sold easily into home cinemas (and indeed, into full-scale commercial cinemas) when films exist with suitably-coded audio material, for example to allow the sound of a helicopter to roar through an audi- torium. However, such material will only be produced in reasonable quantities when there is enough compatible hardware in existence: a chicken-and-egg situation similar to the one experienced during the introduction of HDTV. Nevertheless, Sandra Brix is confident that there will be WFS systems in living rooms within five to ten years. ( 090558 - 1 ) Internet Links [1 ] www.browninnovations.com/sound_domes.html [2] www.dakotaaudio.com [3] www.yamaha.com/yec/soundprojectors/ [4] www.pioneer.eu/eur/content/press/news_20021010_PDSPl . html [5] http://en.wikipedia.org/wiki/lntermodulation [6] www.sennheiser.com/sennheiser/home_en.nsf/root/press_ar- chive_2_2001 _1 10aes_2 [7] www.holosonics.com [8] www.atcsd.com/site/ [9] http://en.wikipedia.org/wiki/Long_Range_Acoustic_Device [10] http://en.wikipedia.org/wiki/Sonic_weapon [1 1] http://www.headwize.com/projects/noise_prj.htm [12] http://www.austriamicrosystems.com/eng/Products/Audio/ Active-Noise-Cancellation/AS3501 [13] http://www.uni-wuppertal.de/index-en.html [14] http://deposit.ddb. de/cgi-bin/dokserv?idn = 9691 74241 &d ok_var=dl &dok_ext=pdf&filename = 9691 74241 .pdf (doc- toral thesis in German) [15] http://en.wikipedia.org/wiki/Wave_field_synthesis [16] www.idmt.fraunhofer.de/eng/research_topics/wave_field_ synthesis.htm [17] www.iosono-sound.com/ The new PicoScope 4000 Series high-resolution oscilloscopes ' r ^ -a T. % , — - II I > i_La_? Technology . . — . — .. ± * ^ The PicoScope 4224 and 4424 High Resolution Oscilloscopes have true 12-bit resolution inputs with a vertical accuracy of 1%. This latest generation of PicoScopes features a deep memory of 32 M samples. When combined with rapid trigger mode, this can capture up to 1000 trigger events at a rate of thousands of waveforms per second. • PC-based - capture, view and use the acquired waveform on your PC, right where you need it Software updates - free software updates for the life of the product USB powered and connected - perfect for use in the field or the lab Programmable - supplied with drivers and example code Resolution 12 bits (up to 16 bits with resolution enhancement) Bandwidth 20 MHz (for oscillscope and spectrum modes) Buffer Size 32 M samples shared between active channels Sample Rate 80 MS/s maximum Channels PicoScope 4224: 2 channels PicoScope 4424: 4 channels Connection USB 2.0 Trigger Types Rising edge, falling edge, edge with hysteresis, pulse width, runt pulse, drop out, windowed www.picotech.com/scope1036 01480 396395 10/2009 - elektor 19 TEST & MEASUREMENT In this project a piezoresistive transducer measures the atmospheric pressure, enabling a PIC microcontroller to use the ISA model (with temperature compensation) to display your current height above sea level (ASL) on an LCD. Whereas office managers typically associate ‘height’ with promotion, career building and a desk on the top floor, everyone else with a healthier mind will be looking up towards the skies, down into chasms or valleys, or for a safe place to land. When mountaineering, climbing, para-sailing, hang-gliding or flying ULs (ultralights), it’s plain essential to know your ‘ASL’: height above sea level. Pressure — in theory Since barometric pressure is closely approximated by the hydrostatic pres- sure caused by the weight of the air above you, your altitude on the planet above a reference level can be calcu- lated fairly easily and shown on a dis- play. The altimeter described here is calibrated to show your altitude above the mean sea level (MSL) based on a mathematical model called Interna- tional Standard Atmosphere (ISA). The ISA model describes the troposphere range with a linear temperature dis- tribution and although that’s unlikely to change with time, it does as a func- tion of temperature, with barometric pressure as an inherent dependency. Right, this project does take tempera- ture deviation into account to compen- sate the altitude reading! ISA rulez: the components... For accurate and reliable ASL readings a temperature measurement device has to be included in the project. So let’s list the crucial components: a PIC18F2423 microcontroller, an MPXHZ6115A pres- sure transducer and a digital tempera- ture sensor type TC77-5.0. Freescale’s MPXHZ6115A (Figures 1 and 2) is a monolithic, signal conditioned, silicon pressure sensor with an on-chip bipo- lar op amp circuit and thin film resis- tor networks to provide a high output signal and temperature compensation from -40°C to +125°C. A fluorosilicone gel isolates the die surface and wire bonds from the envi- ronment, while allowing the pressure signal to be transmitted to the silicon diaphragm. With a typical current con- sumption of 6 mA (at 5 V), it’s neces- sary to keep the sensor in the off state when not in use. Note that it requires about 20 ms to warm up, i.e. before taking any read- ing. Maximum error is 1.5% over 0° to 85 °C, and the component provides the transfer function 20 elektor - 10/2009 Specification and features • Altitude range: 0 to 1 1,000m A(M)SL • Compliant with ISA model, extended with temperature compensation • Barometer range: 15 kPa to 115 kPa • Resolution: 3 m. • Temperature range: -55 °C to +125 °C • Real Time Clock • Supply voltage: 6-1 5 VDC; • Current consumption - LCD backlight on: 18 mA; - LCD backlight off: 8 mA; - Standby: 20 juA • Menu controlled • Software: C for PIC V out = V s x (0.009 X P - 0.095) ±(PE XTFX 0.009 XV S ) [Eq. 1] where P is the applied pressure, V s is the supply voltage, PE is the pressure error and TF the temperature factor. The output from the pressure sensor is measured using the microcontroller’s internal ADC. Altitudes below 11,000 m (33,000 ft) can be calculated using the barometric formula: ; _(1-(P/P re/ ) 019026 X 288.15 0.0065 [Eq. 2] where P ref is the pressure at the base (i.e. at MSL), and h the altitude in metres. The TC77-5.0 temperature sensor from Microchip is a serially accessible dig- ital temperature sensor with a reso- lution of 0.0625 °C and a maximum accuracy of ± 1 °C within the +25 °C to +65 °C range. Temperature data is available as a 13-bit 2’s complement format, and covers a range of -55°C to + 125 °C. with a maximum accuracy of ±3 °C. A band-gap type tempera- ture sensor, a 12-bit plus sign (13-bit) Sigma-Delta ADC, an internal conver- sion oscillator (approx. 30 kHz) and an SPI-compatible serial input/output port — the works! ... and the software The ISA model is based on air pressure at sea level of 101.325 kPa and a tem- perature of +15 °C. The temperature at 11,000 m is taken to be -56.5 °C, so temperature decreases 6.5 °C for every 1,000 m, up to about 11,000 m. The actual atmospheric temperature can deviate considerably from this model, requiring a correction for altitude read- ings to be applied. The temperature correction can be cal- culated with help of Charles’s Law for ideal gases. It states that the volume of the gas is proportional to absolute temperature, or V IT = k [Eq. 3] where V = volume of gas; T = abso- lute temperature and k = constant. For a column of air with base area A and height h, the formula can be writ- ten as hxA/T — k [Eq. 4] Comparing standard atmosphere with actual conditions, k is still con- stant and for a column of air with the same base area A becomes a constant, too, and the variations are in h and T. Using index s from he ISA model and r for the real ambient air we can write h r /T r = h s /T s [Eq. 5] or h r =(h s /T s )XT a [Eq- 6] The software is written to calculate and solve the above equations and you need not worry about it! C code munch- ers delve into file 080444-11. zip avail- able free from the Elektor website! [1] QNH setting ‘QNH’ is a Q code rather than the lat- est PIC mnemonic. It is a pressure set- 10/2009 - elektor 21 TEST & MEASUREMENT Fluoro Silicone Figure 1. Internal structure of the MPXHZ61 15A pressure transducer, (source: Freescale) ting used by pilots, air traffic control- lers and weather beacons to enable altimeters to read altitude above MSL within a certain region. QNH is calcu- lated from the barometric pressure at ground level using ICAO STD atmos- phere for the part between the MSL and ground level. It’s essentially iden- tical to ISA, but extends the altitude coverage up to 80 km. You can set the QNH in this altimeter in two ways: either directly enter the QNH using the menu screen, or enter the known altitude for your location. Circuit description At the heart of the circuit shown in Figure 2 sits a Microchip PIC18F2423 nanowatt technology, flash microcon- troller with 12-bit ADC. The device also sports 16 K code space, 768 bytes of RAM, 256 bytes of EEPROM and an internal oscillator. Here a standard 32.768 kHz watch crystal (XI) with two 15 pF load capacitors are the hardware elements of the (otherwise invisible) real time clock. Since the pressure sensor, IC4, is ratio- Figure 2. Case shapes of the two pressure transducers that may be used on the Altimeter board, (source: Freescale) metric within the specified excitation range and supplied from the ADC ref- erence terminal, it is not necessary to use a precision reference voltage. The sensor is shut down and woken up using MOSFET T2 on port line RA5. IC1 MCP1703T-5002E/CB LCD1 PCI &— 6-15V PC2 S*- GND Cl 47 u 0 ♦ C2 lOOn C3 lOOn +5V -O C4 47 u 2x16 CO o |> co Q —i co IS >>>□£□£ 9 * Q Q OHNW'tiniflNlUlU f= C'i Q Q Q Q cli C +5V O +5V O ^lOOn LO IC2 TC77-5.0 VDD CS SCK Sl/O GND CM Vpp 13 3 14 i. — 15 K1 - 1 - +5V 18 1 ^Tc T1 FDV304P r**f nr Vdd O C\J C6 lOOn O CM © MCLR/Vpp RBO RC2 RBI SCK RB2 SDI IC3 RB3 SDO RB4 PIC18F2423 RB5 RAl RB6/PGC RA4 RB7/PGD RC6/TX/CK ANO RC7/RX/DT RA5 VREF+ OSC1 0 co VREF ' O O m d d m oo C7* Jnpo loop C8 NPO J 15p XI ifll a 32.768kHz C9 J NPO 15p 00 R5 21 22X 23 24 25 26 27 28 CIO 47 u R6 LO | 00 1 m \ s| X" CM CO Vdd Dl - D4 = 4x TS4148 SI I S2 I S3 I S4 ;n Jh Jh Jh T D l Td 2 I D 3 Jd 4 be 4 AVDD < 1 > < > < Cll C12 1 Id5 gS4148 10n lOOn IC4* 1 C13 47 u VDD VOUT GND +5V o Vpp K2 O ICSP C14 AGND AGND ^33 ^330n AGND 080444 - 11 Figure 3. Circuit diagram of the Barometric Altimeter. Note the difference between A(nalog)GND and digital ground. 22 elektor - 10/2009 The pressure sensor output is con- nected to the microcontroller’s ADC channel 0 (ANO) via an RC low-pass filter with cut-off frequency of about 650 Hz. The 750-Q resistor (R8) allows a low source impedance to be matched to the PIC’s on-chip ADC, thus mini- mising the offset voltage at the ana- logue input [2] [3]. The pressure sensor is supplied via an LC filter (LI, Cll, C12 and C13) where D5 is a free-wheel diode. The LCD is wired to the PIC micro in 4-bit mode, requiring data to be sent twice using the upper nibble of PORTB, with the port also doing the key scan- ning and multiplexing. Supply power to the LCD arrives via MOSFET Tl, which is controlled by port line RBI. Since the PIC has an SPI module, it is not too difficult to get it interfaced to the TC77-5.0 temperature sensor chip (IC2). The TC77-5.0 starts to send data when its CS input is pulled logic Low by port line RC2. The PIC micro may be programmed in-circuit via ICSP connector K2. Push buttons S1-S4 are read in multiplex fashion. Components R3 and C7 are not required with the supplied firmware, because the internal oscillator is being used. If you do not wish to use the LCD back- light, R9 should be omitted. The rest of the circuit is no more than the expected low-dropout power sup- ply (IC1) and an array of supply decou- pling caps at crucial locations (C1-C4, C5, C6, Cll, C12, C13). Software The program was written in C and compiled using Microchip’s C18 com- piler. The PIC can be programmed using simple homebrew programmers like the MultiPIC Programmer [4] and ICProg. Be sure to disconnect the LCD while ICSP-ing the PIC. All is revealed in the C source code file found in archive # 080444-11 supplied for the project. Timer 1 is initialised to 0x8000h, causing it to overflow every second. It continues operating in sleep mode (consuming a few microamps only) so it’s unnecessary to use an external RTCC chip for timekeeping. The altitude is determined by using Eq. [2] and is displayed along with the atmospheric pressure. The firmware uses 32-bit floating point arithmetic. The conversion starts when the ADGO bit is set, and is cleared after com- pletion of the conversion. After con- version, the result is available in the ADRESH:ADRESL register pair, and it is right-aligned (i.e. first four bits of ADRESH read as zeros). This 10- bit result can be directly converted to pressure by multiplying it with a con- stant and adding the pressure offset. The ADC acquisition times for the PIC The PCB accommodates SSOP cased pressure sensors like the MPXH- Z6115A6U used in our prototype, as well as UP (Unibody Package) through- hole devices like the MPX5100A. The PCB was designed with two ground planes: one for the analogue part of the circuit (comprising the sen- • r PCI PC2 6-15U0 (•;_!_ 0 Elektor 080444-1 Ul.l R8 u ■ □'•Li C8 C9 Mf* \o r\. o a. # C4 .][.Tci< a r lx # 05 T2f&- * I *. ■§„ 8 [ 1 R6 • •. 0) O' W I Cl o 1 1 1 1 1 Figure 4. Top side component mounting plan (double-sided board). Copper track layouts available free from www.elektor.com/080444. COMPONENTS LIST Resistors (1%, SMD 0805) R1 , R6 = 1 kQ R2 = 1 OOkQ R3 = not fitted (see text) R4 = 0Q R5 = 1 OkD R 7 = 4.7kQ R8 = 75 0Q R9 = 1 00D Capacitors Cl ,01 0 = 4 7yL/F /35V radial electrolytic, lead pitch 2.54mm (0.1") 02,03,05,06,012 = 1 OOnF 50V ceramic, X7R, SMD 0805 04,013 = 10jL/F 16V radial electrolytic, lead pitch 2.54mm (0.1") 07 = not fitted (see text) 08, 09 = 15pF ceramic, NP0, SMD 0805 Cll = 1 OnF 50V ceramic, X7R, SMD 0805 Cl 4 = 330nF ceramic, X7R, SMD 0805 Semiconductors D1-D5 = TS4148, SMD 0805 (Farnell # 8150206) IC1 = MCP1703T-5002E/CB, SOT-23, (Farnell # 1439519) IC2 = TC77-5.0, SOT-23 (Farnell # 1292291) 103 = PIC1 8F2423, SO-Wide, program- med, Elektor Shop # 080444-41 IC4 = MPXHZ61 15A6U or MPX5100A (Freescale), SSOP (see text) Tl ,T2 = FDV304F) SOT-23 (Farnell # 9846123) Miscellaneous K1 = 4-way SIL pinheader, right angled solder pins, lead pitch 2.54mm (0.1 ") K2 = 5-way SIL pinheader, right angled solder pins, lead pitch 2.54mm (0.1 ") LI = 10jL/H ferrite inductor, SMD 1812 (Farnell # 1 1 74073) LCD1 = 2x16, alphanumeric, DEMI 621 7 SYH-PY /V, e.g. Elektor Shop # 030451-72 PCI ,PC2 = solder pin, 1 mm diam. S1-S4 = switch, tactile, SPNO XI = 32.768kHz quartz crystal, cylindrical case 4 PCB supports, nylon, 12mm height, 4.6mm diam. (Farnell # 1325986) PCB, ref. 080444-1 from www.thepcbshop.com micro (i.e. the time required to charge C HO ld i n th e internal sample and hold circuit) is about 2.96 yL/s; this must also observed before taking readings. Construction A double-sided through-plated circuit board was designed for the project — see Figure 4 and pdf file 08044-1 from [1]. sor, RC low-pass filter and the sensor’s decoupling capacitors), and the other for the digital circuitry, i.e. the remain- ing part of the circuit. The PCB ground planes are intercon- nected at a single point only by means of zero-ohm resistor R4 (a wire link or a drop of solder is also an option). This bridge provides a single path for return currents. The only necessary trace 10/2009 - elektor 23 TEST & MEASUREMENT Figure 5. Finished board with MPXHZ61 15A SMD pressure sensor mounted at far left of the board. Figure 6. The Altimeter board and the LCD are connected by a 16-way SIL pinheader/socket combination. Send us photos of the readout at low-oxygen heights that’s routed from the digital to the analogue ground plane carries the sensor’s supply voltage and is intentionally routed underneath the bridge. This way we have two equal currents flowing in opposite directions causing the resulting electromagnetic fields to cancel out. Assuming you’ve some experience in soldering SMD parts whether reflow- style or manually, the critical ones are the PIC and the pressure sensor. The push buttons and the 16- way LCD con- nector are mounted at the top side of the board. Run a careful check on your solder- ing and component mounting before applying power for the first time. All in order and your mind at ease, apply power and check if the LCD contrast is as desired. If not, adjust the val- ues of resistors R5 and R6 until you’re happy. For construction standards, the pho- tographs in Figures 5 and 6 show the levels to match or surpass by your efforts. ( 080444 - 1 ) Acknowledgement The help of Prof. T. K. Mani, Principal College of Engineer- ing Cherthala, India, is gratefully acknowledged. Internet Links [1] www.elektor.com/080444 [2] http://www.freescale.com/files/sensors/ doc/app_note/ANl 646.pdf [3] http://www.microchip.com/wwwproducts/ Devices. aspx?dDocName=en026428 [4] www.hamradio.in/circuits/feng.php [5] http://wiki.motionbased.com/mb/ Barometric Altimeter Practical use Initially the EEPROM is programmed with typical values of the calibra- tion constants, so apart from the time there's nothing to set unless a solid reference is available for your current altitude. For the instrument to work correctly, a few calibration adjustments are required. A menu system is provided. Using the four buttons (top to bottom): Menu / Cursor position Up / Power On Down / Power Off Esc / Save you can easily set all calibration parameters correctly. The second function of each key is accessed if the key is held down for about one second. Enter the menu system by pressing and releasing the Menu button (SI ). The first menu item will be displayed on the LCD. To go to next menu, press Up (S2) or Down (S3). To enter the selected menu, press the Menu key again. The menu contains following items. Set Pressure: this screen is used to calibrate the pressure sensor. Set Altitude: this is the first method to set the pressure at MSL. The known value of altitude is entered here. Based on the ambient tem- perature and pressure, the software will find out the pressure at MSL and save it to memory. Set QNH: d irectly enter the pressure for MSL based on QNH information. Set Time: set / adjust time To change the value of the selected parameter(s), use the Up (in- crease) or Down key (decrease) to adjust the value. The underscoring cursor indicates the digit subject to changing, if necessary, by a short press of the Menu key. To exit from the selected menu press Esc (S4). The altimeter is turned off by keeping the Down key pressed for more than one second. This is actually the power-down mode, and the RTC will continue to keep the time. In this state the processor consumes only minimum power (approx. 20 /jA average for the whole circuit). Switch on again with the Up key. 24 elektor - 10/2009 The World's Lowest Sleep Current MCUs: PIC® MCUs with nanoWatt XLP Technology Microchip's PIC® Microcontrollers with nanoWatt XLP Technology offer the industry's lowest currents for sleep, where extreme low power applications spend up to 99% of their time. • Extend Battery Life - Sleep current down to 20 nA - Brown-out Reset down to 45 nA - Watchdog Timer down to 400 nA - Real time clock down to 500 nA • Extreme Flexibility - 5 different low power modes to improve power & performance in your application - Many low-power supervisors, alarms, and wake-up sources • Expanded Peripheral Set - Integrated USB, LCD, RTCC & touch sensing - Eliminates costly external components GET THE MOST FROM YOUR BATTERY IN YOUR NEXT DESIGN! 1. View the Low Power Comparison demo 2. View free Webinars and Application Notes 3. Download the Low Power Tips 'n Tricks 4. Order samples and development tools www.microchip.com/XLP Intelligent Electronics start with Microchip microchip I5ai RI www.m icroch ip.com/XLP www.microchipdiract.GDm & Microchip The Microchip name and logo, the Microchip logo and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks mentioned herein are property of their respective companies. © 2009, Microchip Technology Incorporated. All Rights Reserved. ME235Eng/08.09 Microcontrollers Digital Signal Analog Serial Controllers EEPROMs ARDUINO & MONOME Most of the projects published in Elektor simply provide a solution to a problem or fulfil a need. Even though their designers have often tried to propose an elegant circuit or design an attractive PCB, the aesthetic effect of the project itself, if there is one, usually takes second place. One exception is the Monome open source project, a USB luminous matrix keyboard that was designed to be good-looking. Here, it's the application that seems to have been relegated to second place. Main Specifications • 4x4 Monome shield for Arduino • Open source hardware • 16 push buttons • 16 LEDs • TLC5940NT LED controller • 12-bit LED brightness control Let’s make it clear right from the start: the project shown here is not espe- cially good-looking. It was inspired by the Monome project [2], which is attractive. Even if the design of a genu- ine Monome may not to your taste, it has to be admitted that the aesthetic aspect of the project is very important — you only have to visit the website to see for yourself. Exclusiveness seems to be one of the project’s other goals. Monomes are only produced in small runs and their prices are high (expect to pay €/£ 375 or $500 for a basic Monome) — espe- cially when you think that they are nothing more than simple USB keypads that don’t even work with MS Word! The aim of the project described here is to offer everyone the opportunity to produce their own Monome for a cost that is derisory compared with the price of a ‘real’ one. What’s more, our 26 elektor - 10/2009 Figure 1. Block diagram of our Monome. Here, 'Shield' doesn't mean screening, but indicates an extension card for Arduino. Monome can be used for any other pur- pose, since the software, like the hard- ware, is open and you can modify eve- rything. The brightness of each LED is 12-bit adjustable, thanks to the LED driver, and we can dream up all man- ner of fine, luminous objects. But just what is a Monome exactly? A Monome is a rather special USB key- pad. First of all, the keys, positioned on a grid (usually square, though not necessarily so), do not have predefined functions, and are all identical. In addi- tion, each key is fitted with an indica- tor that makes it light up. The Monome communicates with a computer via USB. When we press or release a key, the Monome sends the co-ordinates of the key and its status. The application running on the com- puter that receives the co-ordinates of the keys decides how to interpret them. And the application also drives the Monome’s lights. So the Monome does not control its own lights — it’s a bit like a keypad and a display built into the same housing. Even though a Monome is a USB key- pad, it doesn’t operate like a standard keyboard and can’t be used to replace one. This is because of the commu- nication protocol used by the Mon- ome, which is incompatible with nor- mal keyboards. And there are several different Monome protocols, which makes thinks even more complicated. Some Monomes include an accelerom- eter and the communication protocol allows analogue values to be sent to the computer. In fact, Monome is the name of the company that developed the keypad, which itself has names like 40h (8x8), two fifty six (16x16), one twenty eight (16x8) or sixty four (8x8). So the name indicates the number of keys. 40h is the hexadecimal value for 64, and so the Monome described in this article is called lOh, as it is based on the 40h, but only has 16 keys. For those people who like to know eve- rything, Monome is a company that sees itself as minimalist. Its name refers to the monomial matrix, a square matrix that only contains l’s and 0’s, with only a single 1 in any given row or column. The company is fairly envi- ronmentally-friendly, and its products are manufactured with minimum envi- ronmental impact. OK, I want one! Once you’ve understood the concept of the Monome, it’s easy to build your own version. All you have to do is assemble a lot of keys witches around a small microcontroller, and the job is done. This is when you realize that key- switches with built-in indicators are not very cheap, and that you’ll need 16 just for a little lOh Monome. The offi- cial Monomes use thermo-formed key- pads in transparent silicone. This type of cheap keypad is unfortunately not available to amateurs, who will have to make do with standard illuminated push-buttons at €/£ 3 each. That’s why the following project is interest- ing, because we’re going to explain how to make your own illuminated push-buttons for less than €/£ 1! If you are good at DIY and a shrewd buyer, it’s possible to build a lOh Monome r — — — — — — _____ — — — ____ — — — — ___ > Programming the FTDI chip MProg gives you access to the param- eters of the FTDI chip on the Arduino (or other) board, and as you can see, there are quite a few of them! If you're not careful, you risk disabling your USB in- terface, so don't change any parameters if you don't know what they're for. MProg can be a bit temperamental. Sometimes, it's impossible to change between editor and programmer modes. It seems that opening or saving a file should clear this blockage. The following procedure seems to work quite well: -Run MProg -Connect the Arduino board - Click Tools -> Read and Parse - Check the Use Fixed Serial Number box -Enter an 8-digit serial number starting with 'a40h-' — for example, a40h-001 -Save the configuration: File -> Save As ... - Click Device -> Program Everything hangs up for a couple of sec- onds, then the message Programmed Serial Number: a40h-00l ap- pears. Your Arduino is now Monome compatible! L J 10/2009 - elektor 27 ARDUINO & MONOME SI S2 T S3 T S4 y y y y y y y S6 y 7 sio y 7 S14 y 7 S7 V 7 sii y 7 SI 5 y 7 S8 V 7 S12 V 7 SI 6 V 7 17 18 19 20 23 28 26 5V AN5 AN4 3V3 AN3 AN2 AN1 VIN ANO RESET ARDUINO D7 AREF D6/PWM AGND D5/PWM D13 D4 D12 D3/PWM D2 D1/TX DO/RX D8 D9/PWM D10/PWM D11/PWM GND1 GND2 24 27 19 21 27 22 24 16 9 18 10 23 11 12 26 13 17 14 25 15 16 20 25 Cl lOOn R1 21 VCC DCPROG VPROG XLAT , C2 XERR GSCLK BLANK OUTO OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 SIN SOUT SCLK OUT8 OUT9 OUTIO OUT11 TLC5940NT OUT12 IREF OUT13 OUT14 OUT15 GND 28 LD1 ft LD5|t LD9|t 10 11 12 LD13f f 13 14 15 22 LD2ft LD6ft LDlOf ^ LD14^f LD3 |t LD7 tt LD11 tt LD15^4 LD4|t LD8tt LD12 f ^ LD16f f 090527 - 12 Figure 2. Monome circuit diagram. The Arduino board is based on an ATmega8 or ATmegal68, as the PWM function is not used. for less than €/£ 35. What’s more, the project can be used for other things, as it is just a simple display keypad. Let's get down to business! We are basing our design on an Arduino board [3] [4], which is inex- pensive and easy to program, but you can use a different controller board if you prefer. The only thing that really matters is the USB interface, which absolutely has to be a variant of the FT232R chip from FTDI, otherwise the communication software wouldn’t be able to detect your Monome. Because our Monome uses Arduino, it belongs to the family of Ardui- nomes, which is no pointless distinction, since it requires special software. You’ll find the block diagram of the project in Figure 1 and the circuit in Figure 2. As you can see, it’s quite simple, thanks to Arduino and the LED driver IC1. This IC contains 16 current sources for driving 16 LEDs. Each output is controlled by 12-bit PWM (pulse width mod- ulation), offering 4,096 bright- ness levels per LED. This device has a slightly special serial interface, not very well explained in the data sheet, but which only requires six Figure 3. How to construct a touch LED using an LED, a keyswitch, and a little bit of patience. controller pins. Broadly speaking, the interface is divided into two parts, one for the data transfer and the other for refreshing the LEDs. This interface can be optimised by combining certain sig- nals, but this has not been done here. If you are thinking of experimenting with this device, you may like to know that it lets you adjust the maximum current individually for each output, a nice option that could cause you to waste a lot of time. If you can no longer get one or more LEDs to light up, or if the brightness levels are no longer the same, it could be that you have inad- vertently modified the parameters of one or more outputs. In this case, disconnect the power to reinitialize the device — just resetting isn’t enough. R1 sets the maximum cur- rent for all the outputs, you can select this to increase or reduce the brightness of the Monome overall. So, these keys? Figure 4. Building the prototype. We’re going to construct the Monome keys using 10 mm LEDs and miniature push-but- tons (Figures 3 and 4). The idea is to use the LEDs to press the push-buttons. The LEDs are large enough to hide the push-buttons, and seen 28 elektor - 10/2009 from above, only the LEDs are visible. To obtain vertical-action keys, the LED leadouts have to be bent in such a way as to obtain a sort of ‘shock-absorber’. Then the push-button is slipped into the shock-absorber and the LED + but- ton assembly is fitted to the board. Concerning the LEDs, before you start making the keys, check that all the LEDS have the same brightness for a given current. It can vary from one LED to another, especially with cheap ones. Don’t skip this step, since once the keys have been fitted, it’s not easy to remove them again. Construction A PCB has been designed for this project [1], see Figure 5. In keeping with the ‘Open Source’ philosophy, you’ll find on the web page for this project the complete Eagle file (circuit and PCB) which you can modify as you wish. Take care not to route any tracks beneath the push-buttons on the com- ponent side, as the LED leadouts already pass through this space. Start by fitting Rl, Cl, and IC1. Then fit the keys, starting with the ones in the centre of the grid. Fit the push- buttons carefully horizontal, and try to keep a small space between the LED leadouts and the board to improve the vertical movement of the keys. This job requires a bit of patience and accuracy to end up with a satisfactory result. Finish the wiring with the pin head- ers that have to be fitted on the solder side of the board. Initial testing Two components have to be pro- grammed before the Monome will work: the microcontroller and, surprise, the USB interface! The microcontroller is programmed like an Arduino, since it is an Arduino, and this can be done from the Arduino environment [4], but if you prefer, you can flash the micro- controller directly with the HEX file. You’ll find all the source codes and the HEX file at [1]. If you’ve programmed your circuit with the software available in the article’s web page, your Monome now has a demonstration mode that lets us see if the board is working properly. Restart the circuit and watch the LEDs. You’ll see first of all that all the LEDs light up briefly: flash! Then the program goes into a loop which progressively increases the LED brightness from zero up to a certain maximum (not the max- COMPONENT LIST Resistors Rl = 3.3kD Capacitors Cl = lOOnF Semiconductors D1-D16 = LED, 10mm diam. IC1 = TLC5940NT Miscellaneous S1-S16 = miniature pushbutton, 6x6 mm, e.g. Omron type B3W-1000 2 pcs 6-way SIL pinheader, 0. 1 " (2.54mm) lead pitch 2 pcs 8-way SIL pinheader, 0.1" (2.54mm) lead pitch PCB # 090527-1 [1] Arduino board Figure 5. Component side of the PCB. imum) and then starts all over again. This loop lasts for around 40 seconds or so. If you press on an LED, the brightness of this LED is reset and it restarts its loop. In this way, you can create some hypnotic sequences. The first reception of a Monome command exits the demonstration mode. For the moment, your circuit still isn’t a real Monome, so it is unable to receive Monome commands — so let’s carry on getting it ready. As explained above, the FTDI chip also has to be programmed. You may not know it, but this device is programma- ble thanks to a small EEPROM mem- ory. FTDI provides the MProg tool for doing this [5]. This is necessary in order to make our Monome work with the driver on the computer. In their efforts to make it as simple as possible to use a Monome, the driver’s writers have opted for automatic detection of the Monome by interrogating the USB peripherals; it’s not possible to do this manually, which is a bit of a pity. In order to be recognized as a Mon- ome, the peripheral must have a serial number in the format a40h-xxx (xxx is for you to choose). We adopted a40h- 001. Refer to the box for details about programming the FTDI chip. On the computer side... To finish off our Monome, or rather the operational testing, there are two more pieces of software to be installed on the computer (Figure 6). The first piece of software, Arduinome Serial [6], is used to translate the Monome com- munication protocol into MIDI (Musi- cal Instrument Digital Interface [7], a language dating from the 80’ s, mainly used for synthesizers) or into OSC PC Figure 6. Arduinome Serial translates the data sent by the Monome into MIDI or Open Sound Control (OSC). The translated messages are sent to the Max/MSP application via the computer's internal network. 10/2009 - elektor 29 ARDUINO & MONOME Figure 7. Arduinome Serial detects the Monome automatically, and the default parameters are good enough for testing. Figure 8. The Monometest script for Max/MSP lets you check that a Monome is working properly. (Open Sound Control [8], a language that is more recent, more powerful, and more flexible than MIDI). Ardui- nome Serial has to be used for Mono- mes based on Arduino or, to be more precise, Monomes that use the FT232R chip for their USB interface. (For the others, there is Monome Serial.) The second piece of software to install is Max/MSP [9] (also see inset). This software is a powerful graphical pro- gramming environment for music, audio, and multimedia which is used for developing multimedia patches. The part of the environment that runs the patches (the runtime) is free, which lets you run them on any Mac- or Win- dows-compatible computer. So down- load and install just the Max/MSP runtime. On the Monome website there are some patches for Max/MSP that will enable you to check your Monome is working properly. Download the ‘Monome base’ package from [1] and unzip it onto your computer’s hard disk somewhere. Final testing Connect the Monome to the computer via a USB cable and run Arduinome Serial. If all is well, the software will find the Monome and display the serial number you’ve just programmed for it (Figure 7). There’s no need to mod- ify the parameters for our tests, the default values will do. Now run Max/MSP and load the Mon- ome_test.mxb patch, in the ‘Monome base’ package (don’t take any notice of the messages about matrixctrl). A second window opens with two grids in particular (Figure 8), one for the keys (‘keypads’) and the other for the LEDs (‘lights’). Click on the ‘/sys/pre- fix/test’ button and check that Ardui- nome Serial now displays ‘/test’ in the Address Pattern Prefix box. If so, the two pieces of software are managing Max, Pure Data, jMax Max/MSP is one of the pieces of music software most used by professional and amateur mu- sicians alike; it lets you synthesize sounds, analyse, and record, as well as controlling MIDI instruments. Originally called Patcher, Max was invented and developed by Miller Puckette at IRCAM in the mid 80's. The first commercial version was distributed by Opcode System in 1 990, and Cycling '74 [9] has been looking after its development since 1 999. In 1 996, Miller Puckette, working at San Diego University, created a free version called Pure Data, while IRCAM has developed a free version jMax in Java with a graphical interface. There's a substantial community of users and developers around Max/MSP, a collaboration that mainly consists of exchanging 'patches' and 'external' objects, and suggesting improvements to the software, [source Wikipedia] Here's what a PureData patch looks like for breaking down, modifying, and re-synthesising an audio signal using wavelets. The rectangles in the 'program' part are objects that contain sub-programs, the lines between the rectangles are the data flows. Other music programming languages, albeit without nice graphical interfaces, are, for ex- ample, Csound (www.csounds.com) and ChucK (http://chuck.cs.princeton.edu/). Pure Data: http://puredata.info/ jMax: http://freesoftware.ircam.fr/rubrique.php3?id_rubrique = 2 30 elektor - 10/2009 to communicate with each other. Then, in the Monome_test window, click the button next to the word ‘pair- ing’, just below the ‘keypads’ grid, and select ‘press’. If you click somewhere in the ‘keypads’ grid, the corresponding box in the ‘lights’ grid changes colour. Reboot the Monome. This is neces- sary because for some reason the automatic detection of the Monome by Arduinome Serial makes the serial link crash. Press the LEDs and you’ll see the corresponding boxes in the ‘keypads’ grid light up. If you have selected ‘press’, the LEDs will also light up. If you release an LED, it will go out. If you have selected ‘toggle’, the first press lights the LED, pressing a second time will extinguish it. You can also use the mouse to click in the ‘lights’ grid to light up or extinguish the LEDs without pressing any keys. If all this is working, you Monome is operational (at last!) Just to finish off... If your computer has a sound card, the Monome_midi_64.mxb patch will let you do a test that’s a bit more fun. Open the file and click the focus prefix button in the Monome_midi_64 win- dow to change the Arduinome Serial Address Pattern Prefix to . If you press an LED, you’ll hear a sound and you’ll be able to play a tune. You can change the sound (the default is piano) and the note values by clicking and moving the mouse around in the matrix. You’ll probably have noticed that the boxes in the ‘keypads’ grid that light up when you press the LEDs are some- where in the middle of the grid, and the orientation is not the same as on the Monome. This is due to the Mon- ome software, which doesn’t com- pletely follow the convention. Ardui- nome Serial has a ‘Cable Orientation’ box that lets you choose between ‘up’, ‘down’, ‘left’, and ‘right’ — see Figure 6. This box is used to orient the Monome with respect to its USB cable. So if you’re holding the Mon- ome in your hand with the USB cable coming out downwards, you’ll need to choose the ‘down’ option. It’s up to you to modify the quite simple Mon- ome software to sort everything out, as the options provided by Arduinome Serial aren’t enough. Now it’s over to you... ( 090527 - 1 ) Internet Links [1] www.elektor. com/09052 7 [2] www.monome.org [3] www.arduino.ee [4] www.elektor. com/080931 [5] www.ftdichip.com/Resources/Utilities.htm [6] www.sourceforge.net/project/show- files.php?group_id = 235473&package_ id = 285957 [7] www.midi.org/ [8] www.opensoundcontrol.org/ [9] www.cycling74.com [1 0] www.Monome.org/data/app/base Advertisement Propehr P8X32A— Q44 ScnmaraxMPdi Medris New Products from Parallax! Development boards and accessories to enhance your microntroller projects. P8X32A-Q44 Schmartboard Kit (#27 1 50) An easy Propeller prototyping system in kit form. Learn surface-mount soldering and then program on this convenient development platform. PA=Ml±AXZ www.parallax.com Friendly microcontrollers , legendary resources. Milford Instruments www.milinst.com Spinvent www.spinvent.co.uk Propeller Servo Controller USB (#28830) Control up to 16 servos with this network-ready module. Say It Module (#30080) Provides voice recognition for built-in pre- programmed commands and up to 32 user defined commands! Good for robots, home automation, and more. 10/2009 - elektor 31 INFO & MARKET DIY VALVE AMPLIFIERS By Harry Baggen (Elektor Netherlands Editorial) In the midst of all the surround-sound and multimedia hype, more and more people are discovering (or rediscovering) the value of a good audio system. This is an area where there is still plenty of room to build your own equipment, including amplifiers and loudspeakers. To make things easier for DIY enthusiasts with limited experience, Amplimo offers high- quality construction kits for a valve preamplifier and power amplifier. It appears that the interest in good audio reproduction has declined dramatically in recent years. Flashy sound effects seem to have won out over natural stereo reproduction, and everyone is happy with the quality of their MP3 play- ers with their obligatory ear pods, most of which are mis- erable. What else can you expect when most people are easily satisfied? Fortunately, we are again seeing a growing interest in high- quality sound reproduction. Unfortunately, the downside is that the necessary equipment is usually rather pricey, but the upside is that you can do a lot yourself in this area. Espe- cially in the high-end realm, people are more inclined to look for refinement in the details than in complex circuitry, which encourages others to make their own modifications or even build (or copy) complete amplifiers. Flowever, not everyone is able to do this. If you enjoy the idea of building your own high-quality amplifier without and saving a pot of money at the same time, you should certainly have a look at the preamplifier and power amplifier kits described here. These are valve amplifier designs from the hand of Menno van der Veen, which are sold in kit form by Amplimo. In the audio world, Menno van der Veen is primarily known as a specialist on the subject of output transformers and valve amplifiers, he also conducts workshops and master classes on valve ampli- fier design. A few years ago he developed a valve ampli- fier for DIY construction, which since then has established a good reputation among hi-fi enthusiasts. There was also a version of this amplifier as a pure power amplifier, without a volume control or selectable inputs. Naturally, a power amplifier of this sort needs a matching preamplifier, and it also appeared recently. This was sufficient reason for us to have a closer look at the combination of the MCML05 and UL40S2P units. Complete kits The kits for these two amplifiers include all of the necessary parts, nicely sorted and packaged in several bags: PCBs, components, connectors, screws, wires, and even cable ties and safety labels. The valves (some of them selected) are packaged separately and numbered. Each kit also includes a machined enclosure with pre-fitted threaded bushes and a 32 elektor - 10/2009 separate front panel (plastic or metal). The detailed assem- bly instructions (around 65 pages for the preamplifier and 40 pages for the power amplifier) are located in a folder. The construction of each amplifier is described step by step, and the approach is so clear that it's practically impossible to go wrong. Of course, you do need to have some techni- cal knowledge and know how to use a soldering iron. Each project begins with the assembly of the circuit boards. All of the components of a particular type are fitted in each step, such the solder lugs, followed by the resistors, then the diodes, and so on. The instructions explain what these components look like, how to make sure that you get the polarity right, and the value marked on each component. For anyone who's an old hand at electronics this is all a matter of course, but there's many an audio enthusiast who knows little or nothing about electronics. After all the PCBs are assembled, the next task is the mechanical assembly, such as fitting the circuit boards in the enclosure and connecting the wiring. Here again the instructions are very detailed; every length of wire and piece of heat-shrink tubing is described and shown in a drawing. After this is finished, you can start the process of testing and adjusting the amplifier. In each of the instruction manuals, Menno van der Veen provides suitable explanations of the design and design philosophy of the amplifier. In the case of the preamplifier, there is also an extensive discussion of how to use the input transformers with a moving-coil (MC) cartridge. There are also various suggestions for modifica- tions to the preamplifier and the power amplifier. MCML05 preamplifier design When developing the concept for the preamplifier, Menno van der Veen was clearly more interested in sound quality than technical perfection (i.e. minimal distortion). The sig- nal path of the MCML05 is very simple and consists of a volume control and a balance control (both from Alps) fol- lowed by a buffer stage consisting of two triodes in a sort of SRPP configuration. Clearly a minimalist design, intended to have minimum effect on the signal passing through. This preamplifier is perfect for vinyl enthusiasts, since the MCML05 includes a two-stage MD preamplifier with a pas- sive RIAA compensation network (see Figure 1 ). To allow it to be used with moving-coil (MC) cartridges, there are two special step-up transformers (also designed by Menno) to boost the weak MC signal by a factor of 1 0 before it goes to the input of the phono stage. The power supply is built entirely using semiconductor devices and has a switch-on delay to ensure that the fil- ament voltage first builds up slowly over an interval of 15 seconds. After this, the high voltage is switched on and reaches it maximum value after around 30 seconds. The power supply board also hosts a headphone amplifier built around a TL072 dual opamp. Figure 2 shows the interior view of a fully assembled preamplifier. UL40S2P power amplifier design In the preamplifier, the circuitry is spread over five PCBs, but in the power amplifier it is all located on a single, rela- tively large circuit board. The mechanical layout is tradi- tional, with the valves and transformers fitted on top of the enclosure (see Figure 3). For safety, they are covered by a protective hood. Figure 1. Interior view of the MCML05 preamplifier. The special MC transformers can be seen at the rear, next to the input connectors. Figure 2. Schematic diagram of the phono preamp. The RIAA compensation network is entirely passive. 10/2009 - elektor 33 INFO & MARKET DIY VALVE AMPLIFIERS Figure 3. The UL40S2P power amplifier with its protective cover removed. Figure 4. Bottom view of the power amplifier. All of the circuitry, including the valve sockets, is located on a single PCB. Just like the preamplifier, the power amplifier has been kept strictly minimalist and does not employ any overall negative feedback (see Figure 4). The circuit consists of a phase splitter built around a 6922 and a balanced output stage with a pair of EL34s (6CA7s), which are connected to a special toroidal Vanderveen output transformer. The power transformer is also a toroidal type. The amplifier can be wired in various configurations (triode, ultralinear and pentode), which gives enthusiasts extensive opportunities for experimentation. The UL40S2P delivers approximately 30 W per channel in the pentode or ultralinear configuration The output power in the triode configuration is half this value. The power amplifier has a standby switch so the high volt- age can be switched off while leaving the filament voltage on. This dramatically reduces the aging of the output valves and allows the amplifier to be used immediately at any time without a long warm-up interval. In addition to the various output stage configurations, with this amplifier you can experiment with other types of driver valves and output valves. There is an optional output trans- former with windings made from silver wire, although this represents a considerable investment in comparison with the overall price of the kit. Measured results Despite the fact that sound quality ultimately plays a greater role than technical specifications in the concept of these amplifiers, as engineers we could not resist the desire to connect them to our Audio Precision System II analyser and have a look at the figures. Here we describe some of the results, with comments. The distortion of the preamplifier and the power amplifier is not especially low, but you can hardly expect low distortion from a valve amplifier without negative feedback. Figure 6 shows the distortion spectrum of the power amplifier at an output level of 1 watt into an 8 Q load. Here the THD plus noise is approximately 0.4%. This is an acceptable value for an amplifier design of this sort without negative feed- back. Some mains hum from the power rail can be seen at the bottom end. With our unit, the maximum output power was 23 W per channel into 4 Q, with a distortion level of 3%. However, in this connection we should note that the mains voltage in the lab of our castle is on the low side, so the figure will probably be higher in most home settings. The bandwidth of the power amplifier is decently large at around 85 kHz, with the lower 3-dB point well below 1 0 Hz. All of these results were measured in the ultralinear configuration. The damping factor of the power amplifier is only 5 (with an 8-Q load), which is fairly low. This is primarily due to the designer's resolution not to use overall negative feed- back in the amplifier. Although this is a noble aim that can certainly benefit the sound quality of the amplifier, it can also create difficulties when driving loudspeakers because they generally have very complex impedance characteris- tics. In combination with the output transformer, the speaker impedance yields a curve such as that shown in Figure 7. In practice, this means that the frequency response of the speaker is affected by the impedance curve, which can lead to deviations of up to several decibels. The resulting sound image is entirely different from that of an amplifier with a higher damping factor, but this ultimately has noth- ing to do with Valve sound'. Consequently, it is advisable to use the UL40S2P with loudspeaker systems that have a flat impedance curve or loudspeakers equipped with imped- ance correction networks. The rated sensitivity of the preamplifier is 220 mV for a 1- V output signal, which is the signal level necessary to drive the power amplifier to its maximum output power. The dis- tortion is 0.3% with an output level of 1 V and decreases to approximately 0.1% with the volume control set to an overall gain of 1 . The accuracy of the phono stage is very precise. The deviation from the standard RIAA characteristic is less than 0.2 dB between 50 Hz and 10 kHz, and less than 0.7 dB over the range of 20 Hz to 20 kHz. The signal to noise ratio and hum from the line inputs of the preampli- fier are both at a nice level of -76 dB (lin.). The sensitivity of the MD input is 7.6 mV, while the sensitivity of the MC input is 720 (j V (both for 1 V out). Especially for the MC input, it is best to choose an MC cartridge with a relatively high output voltage for use with the MCML05. Listening results After a few days of playing with the various options, we listened to the combination of the two amplifiers along with a Sony SADC player and a set of B&W 803 speakers. The spaciousness of the reproduced music was striking with this combination. The overall sound image proved to be a good deal further away from the listener, being located more 34 elektor - 10/2009 behind the loudspeakers than with the transistor amplifier we normally use in this system. Remarkably, we found that the treble reproduction had slightly more presence than with the transistor amplifier, which is the opposite of what you would expect. This resulted in increased detailing in the reproduction. The bass reproduction remained controlled under all condi- tions; apparently the low damping factor does not have any adverse effect in this regard. However, this can vary from one loudspeaker to the next. At higher volume levels, the transistor amplifier delivered distinctly more pressure in the bass region, but this difference may be due to the modest output level of the Amplimo power amplifier. All in all, we can say that the MCML05 and UL40S2P form a combination that can give audio enthusiasts a whole lot of listening pleasure, in part due to the many configuration and tuning options. Conclusion The design and construction of both of these amplifiers are well conceived. We can recommend these kits without res- ervation to serious audio enthusiasts who want to try a valve system. Menno van der Veen has devoted a lot of time not only to the technical development of these ampli- fiers, but also to optimising their sound quality. This can be seen in the choice of components, the layouts of the circuit boards, and the quality of the connecting cables. The kits even include silver solder for the solder joints. Neither of the kits can be regarded as inexpensive, but this will certainly not form a hindrance for serious audio enthu- siasts - especially when you consider that a ready-made valve combo (preamplifier and final amplifier) of this quality costs at least twice as much. ( 081035 - 1 ) Additional information: www.amplimo.nl www.mennovanderveen.nl +0 -10 -20 -30 -40 -50 -60 d B -70 r -80 A -90 -100 -110 -120 -130 -140 -150 20 50 100 200 500 Ik 2k 5k 10k 20k 50k 100k Hz 081035 - 13 Vanderveen MCML05 preamplifier: kit price € 1 245 (approx. £ 1 080). Vanderveen UL40S2P power amplifier: standard kit price € 1 295 (approx. £ 1 1 20). Figure 5. Schematic diagram of the power amplifier, which can be wired in various configurations (triode, ultralinear or pentode) by making small modifications. Figure 6. FFT distortion analysis at 1 kHz with 1 W into 8 Q. Figure 7. Frequency response of the power amplifier. The upper curve shows the frequency response with the amplifier connected to a real loudspeaker. 10/2009 - elektor 35 MICROCONTROLLERS Car Tilt Alarm Protect your alloy wheels By Mickael Bulet (France) This project is aimed at all those who have fine alloy wheels on their car and are worried about finding it propped up on bricks. Whether you already have a car alarm or not, this project could be used in conjunction with that, or stand alone. This alarm has been designed to be adapted to your needs and is easy to use thanks to the built-in installation aid. The car alarm described here detects changes in the tilt angle of the vehi- cle in which the alarm is installed. It is set off when the change in the angle exceeds a threshold (adjustable) for too long (5 seconds). Short of cutting the power to it, the only way to stop the alarm is to put the car back to its initial angle. The change in angle to which the alarm is sensitive can be adjusted from 0 to 25°. Hardware The alarm is built around a PIC16F877 microcontroller (Figure 1). A dual-axis accelerometer connected to the con- troller’s port -A analog input is used as a tilt angle detector. In a static situa- tion, it will output a DC voltage on the X and Y axes depending on the angle it is at with respect to the horizontal. The accelerometer is an ADXL322 [1] from Analog Devices, pre-fitted to a small board, as the device is tricky to solder by hand. The alarm is configured using jumpers on three 2 x 4-contact pinheaders and four switches connected to the con- troller’s port B. The headers are OR-ed together via the diodes (D2-D9 and D12-D15) and require only four inputs. They are multi- plexed using three outputs from port C. Four other outputs from port C are used to drive three LEDs and a relay, buff- ered by a ULN2803, powered from 12 V to avoid excessive loading on the 5 V rail. The ULN2803 works out cheaper and above all less cumbersome than a solution using transistors. The LED driven by RC3 shows if the system is armed, the other two LEDs are used by the installation aid for leveling. Pin PC 7 is used as an input for arming the system. This input is opto-isolated and filtered by R7 and C7; R5 limits the current in the opto-isolator’s LED. In this way, a permanent +12 V available in the passenger compartment can be used, and only one wire to the alarm is needed, instead of two wires if the 5 V rail were used, with a greater risk of interference too. The other PIC ports are not used. While developing the program, port D was used for dis- playing parameters with the help of an EasyPIC4 board from Mikroelektronika [2]. The power for the alarm is taken from the vehicle, either from a permanent + rail, or directly from the battery. Don’t forget to include an in-line fuse to pro- tect the circuit. A quick-blow 100 mA fuse will be enough if the circuit doesn’t have its own siren, but if used as a stand-alone alarm, you’ll need to allow for the extra current drawn by the siren. The 5 V supply is perfectly standard, with D1 protecting the regulator from reverse current when the system is shut down completely. Software The firmware was written in mikroBa- sic [2] and is small enough to be com- Disturbing the peace Alarms have a tendency to go off at random both day and night, with no thought for the neighbours. In some countries, this type of sound nuisance is punishable under laws addressing disturbances of the peace at night. In a few coun- tries, car alarms with sirens are even prohibited. Consult your local legislation. 36 elektor - 10/2009 Technical Specifications • trigger angle: 0-25° • operating time adjustable 0-165 s; • two activation modes: intermittent @ 0.5 Hz or continuous • built-in installation aid. 1 i 1 i 1 i i i JP1 JP2 JP3 JP4 JP5 JP6 JP7 JP8 JP9 JP10 JP11 JP12 VDD O VDD O tol*10 pulse/cont cal. SI ilium i mum » llllllll I mirni i 33 34 35 36 37 38 39 40 T C6 lOOn 1 Dll Tdio » K1 +12V x=° WZ Y=0 o | R2 |R3 RE1 Q □ > MCLR/VPP RAO/ANO RA1/AN1 RA2/AN2/VREF- RA3/AN3/VREF+ RA4/T0CKI RA5/AN4/SS o Q > RCO/TIOSO/TICKI RC1/T10SI/CCP2 RC2/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SD0 RC6/TX/CK RC7/RX/DT LED ARM GND IC1 RBO/INT RBI RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD in m > RE0/RD/AN5 RE1/WR/AN6 RE2/CS/AN7 PIC1 6F877-20/P RDO/PSPO RD1/PSP1 RD2/PSP2 RD3/PSP3 RD4/PSP4 RD5/PSP5 RD6/PSP6 _i o o m o Z3 o CN o in o RD7/PSP7 — in in > oicoNtDin-^ntN mm R1 8x 4k7 CO X 1 1 1 , CO C4 15p ' 1 8M 1 ' Hz C5 15p X 080064 - 1 1 Figure 1. Alarm circuit diagram. 10/2009 - elektor 37 MICROCONTROLLERS piled using the demo version of the compiler. The software consists of two sub-pro- grams: the vehicle installation aid and the alarm proper. The choice between the two programs is made using switch SI 3-6 on the RB6 line. The installation aid is enabled when RB6 sees a logic High. Figure 2 shows the flow diagram of the program. In normal mode (alarm), the settings on the headers are read at the start of the program. To read a header, the cor- responding output of port C must be taken High and the hex-coded data is input to port B. The other port C out- puts connected to the other headers must remain low. By way of an exam- ple, here’s how the alarm triggering time is read: Reading the units - RCO to 1, RC1 and RC2 to 0 - delay of a few milliseconds for the values to stabilize - data read at port B - four MSBs suppressed - data obtained stored in memory Reading the tens - RC1 to 1, RCO and RC2 to 0 - delay - port B read - four MSBs suppressed Trigger time = 10 X tens + units This process makes it possible to read four headers using one 8-bit port: the four MSBs as an Enable output for the headers and the four LSBs for read- ing the data. Masking via an AND will suppress the four MSBs from the read data. After reading the operating parame- ters, the program waits in a loop for RC7 to be taken to 1 before going into ‘armed’ mode. Once armed, the ‘real’ surveillance will only start after a 10- second delay — the time to get out of the vehicle and allow it to stabilize. The current angular position of the vehicle is then stored in memory and the alarm trigger values are calculated. In this way, you can leave the vehicle at any angle, and when the alarm is armed, the current value will be taken as the reference for the calculations. The trigger thresholds (lower and upper) depend on jumpers JP9-JP12 for angles from 0 to 15° and switch SI 1-8 which lets you add another 10°. Hence we get an adjustment range from 0 to 25°. Now the program goes into a loop, from which the only way out is when one of the two thresholds is exceeded, or the system is put into standby mode. If one of the two thresholds is exceeded for some reason, the software will wait 5 seconds before confirming the threshold is still being exceeded. This 38 elektor - 10/2009 precaution will avoid unwanted trig- gering caused by a slight impact, a gust of wind, or a passing truck. Even in Formula 1, five seconds is a bit short for lifting up the car, removing the four wheels, and putting the car back into its original position! If the second tilt check confirms that the angle of the vehicle is out of limits, the alarm goes off. There are two options for operating the output relay (SI 2-7): continuous oper- ation throughout the time programmed by the jumpers, or intermittent oper- ation (0.5 Hz) for the programmed time. Once an alarm cycle has been com- pleted, the program goes back to the first tilt checking loop. If in the mean- time the car has returned to its original position, the alarm will stop. Of course, the system can be put into standby at any time, even while the relay is operating. Table 1. How to set the jumpers to obtain specific values. JP4, JP8, JP12 JP3, JP7, JP1 1 JP2, JP6, JP10 JP1, JP5, JP9 Value — — — — 0 — — — fitted 1 — — fitted — 2 — — fitted fitted 3 — fitted — — 4 — fitted — fitted 5 — fitted fitted — 6 — fitted fitted fitted 7 fitted — — — 8 fitted — — fitted 9 fitted — fitted — 10 fitted — fitted fitted 1 1 fitted fitted — — 12 fitted fitted — fitted 13 fitted fitted fitted — 14 fitted fitted fitted fitted 15 Construction You can build this project in your usual manner. Note that the accelerometer will need to be fixed in such a way that it doesn’t vibrate while the car is mov- ing. To achieve this, one pad has been Table 2. Functions of the SI switches. Switch Open Closed SI 1-8 threshold +0° threshold + 1 0° SI 2-7 intermittent alarm continuous alarm SI 3-6 normal mode installation aid mode SI 4-5 — — 10/2009 - elektor 39 MICROCONTROLLERS Adjustments Note that changes in the jumper or switch positions must be validated by resetting the circuit, which means cutting the power for a few sec- onds, as there is no reset button. See Tables 1 and 2 for how to posi- tion the jumpers and switches. Setting the trigger threshold The trigger threshold is set by jumpers JP9-JP1 2 for angles from 0 to 1 5° and switch SI 1 -8 which lets you add another 1 0°. Hence the threshold can be set between 0 and 25°, though it's better not to go below 2°, as possible drifts in the accelerometer or PIC's analog/digi- tal convertor voltages could result in unwanted triggering. Setting the alarm time The alarm time is set by JP1-JP4 ('units' 0-1 5) and JP5-JP8 ('tens' 0-1 5) from 0 to 165 s, i.e. 2 min 45 s, which seems to be more than enough, given that the alert is continued (after around 5 s) if the ve- hicle fails to return to its original position. When using this circuit in conjunction with an existing alarm, select 1 s maximum. This is more than enough for it to be detected by a alarm. Setting the relay operating mode Use SI 2-7 to select the relay operating mode: continuous or intermit- tent. This choice will be determined by the type of wiring and the siren you are planning to use. For a siren with a modulated output, choose continuous mode. Use continuous mode when using this circuit in conjunction with an existing alarm. provided on one end of the accelerom- eter (opposite the row of contacts) for soldering a loop the end of a piece of stiff wire. This can then be connected to the accelerometer board. The two large filter capacitors (Cl and C2) should be soldered as close as pos- sible to the PCB, and if necessary held in place with a big blob of hot-melt glue. All this is intended to protect against vibration, which might break the soldered connections and cause false contacts. Bolt the regulator IC2 onto the PCB. Installation The alarm must be powered from a per- manent + 12 V supply via an in-line car fuse (so that the device can be turned off externally, to save having a master switch, and to protect against possible shorts) and a ground connection made to the chassis or a grounding point on the car. All wires should be at least AWG17 c.s.a. and should be run inside plas- tic sleeving (you may be able to use domestic 6.25 inch diameter flexi- Connections This alarm was designed to be used either in conjunction with an existing system that already monitors the opening of the bonnet, the boot (trunk), breaking into the passenger compartment, or engine starting, or on its own, with the addition of a simply 1 2 V siren. Wiring as an auxiliary to an existing alarm The unit will be armed either by a separate switch concealed in the passenger compartment, or by the main alarm itself. To achieve this, most alarms have a contact that makes when they are armed, for connecting a relay to cut the power to the fuel pump (immobilizer!) Our circuit's input draws very little current, just for the opto-isola- tor LED. So it can be connected directly to the coil of this relay (the + side, of course!) In order to set off the original alarm from our circuit, you'll need to connect the common of the unit's relay to ground and the make (or N/O) contact to a boot or bonnet microswitch. In this way, our cir- cuit will simulate the opening of one or other of these elements by grounding the monitoring contact. Standalone wiring Here, the alarm will have to be armed using a concealed switch. For the alarm signal, we'll use a 12 V siren hidden within the engine com- partment. The + 1 2 V will go to the relay common contact and the make (N/O) contact will be connected to the siren, then the siren to ground (there are enough ways on the connecting terminal block to make these bridges internally). We strongly recommend you do not use the car horn as the warning system by simply connecting it in parallel. If it is driven by a transis- tor in the car's electronics unit, this will be destroyed at the first alarm. What's more, any intruder won't necessarily be expecting there to be a second siren. to boot/trunk contact A from alarm or independent switch ground permanent +V from battery I B activation switch ground B © permanent +V from battery 080064 - 14 40 elektor - 10/2009 ble plastic conduit). Never allow any wire to be in contact with a metal part (bodywork, engine components, etc.), in case one day you end up with a short (or even a fire!) caused by the insulation wearing through because of the vibration when the car is being driven. The alarm can be fitted anywhere, as long as it can be fixed in a horizon- tal position (see Figure 3). Provide a warning LED on the dash if you want to see if the circuit is armed or not. To adjust the level, proceed as follows: • Park the vehicle in a spot where it is level; • Cut the power to the alarm (remove the fuse from its holder); • Set switch SI 3-6 (installation aid) to ON; X screw to secure bracket to vehicle 080064 - 13 Figure 3. One option for mechanically mounting the alarm horizontally. • Power the circuit back up again (refit the fuse); • Tilt the alarm very gently in both axes until the X and Y LEDs both come on, indicating that it is hori- zontal. This adjustment is very sen- sitive and can be quite tricky to get just right. It doesn’t matter if you can’t manage it, as the alarm will still work in relative mode, i.e. it will be triggered according to the cur- rent angle of the car. But properly horizontal installation offers the best performance in all situations; • Tighten the fixing screws firmly, using shakeproof washers, Nylock ® nuts, or thread locking compound to avoid loosening over time caused by vibration. • Cut the power; • Set SI 3-6 back to OFF; • Apply power to the alarm again, and it’s ready for use! ( 080064 - 1 ) Internet Links [1 ] www.analog.com/en/mems-and-sensors/ imems-accelerometers/adxl322/products/ product.html [2] www.mikroe.com [3] www.elektor-usa. com/080064 COMPONENT LIST Resistors R1 = SIL array 8x 4.7kD R2 / R3 / R4 = IkQ R5 = 330D R6 = 4.7kD R7 = 1 OkQ Capacitors Cl = 470jL/F 25V axial electrolytic C2 = 100jL/F 25V axial electrolytic C3 # C6 = lOOnF C4, C5 = 15pF ceramic Semiconductors IC1 = PIC1 6F877-20/P, programmed IC2 = 7805 IC3 = ULN2803A IC4 = 4N25 or equivalent D1 = 1N4001 D2-D9, D12-D15 = 1N4148 D10, D1 1 = LED, 3mm Miscellaneous XI = 8MHz quartz crystal, low profile JP1-JP4, JP5-JP8, JP9-JP1 2 : 8-way (2x4) DIL pinheader with jumpers SI = 4-way DIP switch block RE1 = relay, 12V coil, miniature, 2RT K1,K2,K5,K6 = 3-way SIL pinheader, lead pitch 2.54mm (0. 1 ") Support for on/off LED, color and diameter to personal requirements 2-axis accelerometer module with ADXL322 (Lextronic France # ADXL322) Fuse and in-line fuseholder for vehicles Standoffs, screws, case, etc. JP 2 [IB JP 3 fjj JP 4 fflll JP 5 fpQ JP 6 fjj JP 7 JP 8 jp 9 r«o JPlOfiB JP 11 JP 12 o O ■ S a> o QfTi O 10/2009 - elektor 41 Don 't just test it,,, ...Anaiuse it! Special Offer prices for limited period or while stocks last! electronic design ltd The New Atlas ESR Plus , Model ESR70 This new model of the famous Atlas ESR offers all the great features of the ESR60 but with extended measurement range and audible alerts. This is the Atlas ESR Plus'. • Capacitance from luF to 22,000uF. • ESR from 0.01 ohms to 40 ohms. • Great for ESR and low resistance measurements (short tracing etc). • Automatic controlled discharge. • Audible Alerts (for good ESR, poor ESR, open circuit and more). • Gold plated croc clips. Atlas SCR - Model SCR100 Connect Triacs or Thyristors any way round. Auto part+pinout identification Check gate lOOuAto 100mA. Measures gate voltage drop. Regulated load test conditions Atlas IT -Model UTP05 Identify network cabling type. Identify many fault types. Tests sockets and cables. Complete with all this: .00+VAT) Atlas ESR - Model ESR60 Capacitance and ESR! Capacitance luF to 22,000uF ESR 0.01 ohms to 20 ohms Gold plated croc cli £75.00 inc (£65.21 Atlas DCA - Model DCA55 The famous Peak Atlas! Now with premium probes. Connect any way round to identify semiconductor type, pinout and lots of parameters Transistors Darlingtons Diodes LEDs and more. £53.83 i (£46.81 Atlas LCR - Model LCR40 Passive component analyser. Identify inductors, capacitors and resistors. Auto frequency selection. Removable probes. IpF - 10,000uF 1 Ohm - 2M|[ £77.31 inc VAT (E67.23+VAT) Atlas Star Pack (LCR/DCA) Includes the Atlas LCR, Atlas DCA and a premium padded carry case. spare battery. Peak Electronic Design Ltd, West Road House, West Road, UK: Please add £2.00 p&p per order. Buxton, Derbyshire, SKI 7 6HF. Prices include UK VAT. tel. 01298 70012 www.peakelec.co.uk sales@peakelec.co.uk See website for overseas prices. Take out a free subscription to E-weekly now Do you want to stay up to date with electronics and computer technology? Always looking for useful hints, tips and interesting offers? Subscribe now to E-weekly, the free Elektor Newsletter. Your benefits: * The latest news on electronics in your own mailbox each Friday * Free access to the News Archive on the Elektor website * You’re authorized to post replies and new topics in our forum ■ Lj : 'I >cu .-.M - ' ni'-c lur fc'rci. r aidi’il n*t : miUrCuroiui ru aralcin at ef|e>i fs.ssrtKrJH * w huh “ n::a. sudfirr . s i '!2sg '■ .' 'A’Aie M'n uf iS'iiiici'duV.';' i Jaruar v 2CDS t-Hterfrita Vcria ZBBIU mere n-uMcfi v. la'.rtfta m -;L’ "a amaai i' U r^ - [“1. I nil JQII3 Fvrvji lr thi Cs-.vc i TRIXX presents'; build your owti circuits and hnve Ei its! ^i'r yu» Ertmlirr rtith i Tkt>K* 11;,^ frrr r .r.ry Ihq ^ i ri ■ i — b tWti»r , iha aiaer-msi rrartHy, « cufclthtd a vary Yiadnardir. i-TftlJtt Miked wtU* ftfeYvJ Arid All !al*i! fin Sht «r'«# i j ^ i r* 1 1' - y . !!■■ f-fr* Afe.a iC'jprt Limplp tuC umU cr cuts i*:- r ccr^trucKr EJaktcrs bfMrfl'Hjhl titwCO-ROM- luc usc'._ o«ui r .s ra ramn canEruuicii c.ie«..C' s 3 Register today on www.elektor.com/newsletter ElektorWheelie Elektor's DIY self-balancing vehicle Everyone agrees; the internal combustion engine is coming to the end of its life cycle. However you don't need to go to the expense of a Prius or Tesla to experience the future of transportation devices. If you would prefer something more personal (and don't mind turning a few heads) why not build the astonishing ElektorWheelie? First take two electric motors, two rechargeable batteries and two sensors, now add two microcontrollers and the ElektorWheelie is ready to transport you in style to your destination. Mlektor L~shop Characteristics Two 500 W DC drive motors Two 1 2 V lead-acid AGM batteries, 9 Ah Two sixteen-inch wheels with pneumatic tyres H-bridge PWM motor control up to 25 A Automatic power off on dismount Maximum speed approx. 1 1 mph (1 8 km/h) Range approximately 5 miles (8 km) Weight approximately 35 kg The kit comprises two 500-watt DC drive motors, two 1 2-V lead-acid AGM batteries, two 1 6-inch ABS wheels, casing, control lever and assembled and tested control board with sensor board fitted on top. Art.# 090248-71 • £1380.00 • € 1599.00 • US$2275.00* Ind. VAT, exd. shipping costs. Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel. +44 20 82614509 Further information and ordering at www.elektor.com/wheelie 42 elektor - 10/2009 Portable solar battery chargers By Thijs Beckers (Elektor Netherlands Editorial) For the solar panel test, which was published in the July 2009 issue, we also asked for a number of smaller solar panels. These small panels are invariably intended to be used as battery chargers when on the road. However, at that time they had to give way to the large number of more interesting and bigger panels. We nevertheless were still keen to take a closer look at these mini panels. Elektor Lab worker designer Ton Giesberts carried out an evaluation of these panels. The charging current was measured using the supplied batter- ies. When no batteries were supplied we used our own. Here are the results! The does not supply any voltage unless the batteries are connected. The charging current can easily reach 92 mA, charging two cells at the same time. This does require sufficient sunlight of course (which is also true for the other charg- ers). The charger is fitted with an indicator LED, a clip which functions both as a belt clip as well as a stand for fixed mounting and a USB connection for charging devices using a USB cable. The latter is also possible when there is no light on the panel. With a set of fully charged batteries the charger can therefore also be used for charging a USB device that is suitable for this. Various adaptor plugs for mobile phones and USB are supplied. Two 1 300 mAh NiMH-batteries are also supplied, which can be charged simultaneously. The (unbranded) supplies and open circuit voltage of 6.1 V. The measured charg ing current amounts to about 93 mA. The charger is suitable for three AA batteries. Also supplied are an adaptor cable with a multiplug, two clips for attaching to a belt and a stand for optimal positioning when placed in a fixed location. The battery holder is sepa rate from the charger. The does not supply any voltage when no batter ies are connected. The charging current amounts to a respectable 440 mA, which can be used to charge two or four AA cells. Two indicator LEDs are built in. Unfortunately there are no adapter plugs and no USB connection option. Compared to the other panels the from was somewhat less sensi- tive to its orientation towards the sun. The measured charging current was 293 mA (420 mA according to the specifications). The charger does not supply any voltage when no batteries are connected; it is provided with an indicator LED and a USB connection and comes with a variety of adaptor plugs and a cable. It is suitable for two AA cells, which are also supplied in the form of two 2300 mAh NiMH batteries. The supplied a charging current of only 1 60 mA (the specification is 420 mA). This charger does not supply an output voltage either when there are no batter ies in the holder and therefore cannot be used as a standalone power supply. The charger is fitted with an indicator LED, a belt clip and a USB connection. The latter can also charge USB devices from the batteries without (sun) light. The charger can charge one or two AAA cells simultaneously. Two 700 mAh AAA NiMH batteries are supplied. Unfortunately there are no adaptor cable or plugs to be found anywhere in the packaging. The tests were carried out on a very sunny day, outdoors, at Elektor House in Limbricht, the Netherlands. It is of course very conceivable that the chargers will perform differently when you take them on your sun-seeking holiday or on a trip to the Antarctic. The big- gest difference however is still the total surface area of the solar cells. In this respect: the bigger, the better. (090605-1) elektor - 10/2009 43 E-LABS INSIDE E-LABS INSIDE “Noise is By Ton Giesberts (Elektor Labs) For the last few years we haven’t worried too much about noise in audio any more. In the past, and we mean the pre-CD era, the noise from a cassette player, record player or an FM radio was something we had to learn to live with. You had HiFi and all was well. Now that nearly everything is digital, even the picture and sound on the TV, it appears that noise for most audio designs is no longer a problem. Is noise out of fashion? In other areas of electronics noise will continue to be a design con- sideration. Take the accurate conversion of a sensor signal which still requires analogue amplification, conversion and filtering, be- fore it can be digitised. With microphone signals, hum, noise and other interference sig- nals are the criteria that will receive the most attention in studi- os or live performances. Once the recording is in a digital format the greatest problems are overcome. The problem of noise is then moved to sample frequency, the number of bits, digital operations and mixing. With the arrival of the CD and the digital age the problems have become more complex and are harder to understand. For exam- ple, take the perennial discussion as to whether an LP sounds more faithful than a CD. The specifications of the noise in an analogue system are more informative to most people than the specifica- tions of a digital linear phase filter. The noise of the latter is gener- ally so low that most people will have difficulty comprehending it. The dynamic range of most modern codecs is greater than that of human hearing. Reproducing the sound pressure of a Saturn rocket at take-off (about 1 95 dB) is not required in our living room. You would think that the boundary of what is necessary and useful has now been reached. In Elektor magazine, audio circuits have ac- quired a different position in recent years. The world of electronics these days revolves around microprocessors, FPGAs and so forth. With the exception of the revival of the LP and of valve amplifiers there seems to be little merit to be had from the familiar discrete stereo power- and pre-amplifiers from the good old days. Surround sound systems cost almost nothing nowadays and have more bells and whistles than you could ever need. In addition, most people are happy listening through cheap headphones (at levels that are much too loud) to the heavily compromised MP3 files. But nevertheless there appears to be a revival of the ordinary ster- eo and so the story of noise reappears. Noise of the oldies.. The vintage Elektor projects where a special effort was made to control the noise were mainly high end MD and MC amplifiers for record players. We also published discrete radio receivers where the noise characteristics are very important. But here too there are changes happening. Recently we published a small FM receiver (Mini FM receiver, January 2009) where the entire receiver is inte- grated into a single 1C. With RF designs it is sometimes difficult to justify a discrete design, certainly since everything can be made so small now. The advantage of a discrete design is that there is no need to compromise on any part of the circuit — at most the total cost will be more of a determinant of the final design. An example of the latter is the MC amplifier from March 1992. Here a dual PNP transistor was used for the input stage (lower LF noise than a NPN version) to obtain as low an input noise as was possible. We now use an ordinary opamp for that (for example the TL071 ). To avoid any other compromises, the small capacitors that were used for the correction network were not standard polyester devices but expensive ‘styroflex’ types with polystyrene as the dielectric. For the larger values ‘MKP’ types with a polypropylene dielectric were used. The larger value polystyrene capacitors were also made by Siemens, but production has been stopped since. Or take the symmetrical microphone amplifier from November 1 997. For optimal quality the phantom voltage has to be free of ripple and the amplifier has to have low noise. At the heart of the circuit was a symmetrical audio amplifier in an 8-pin DIP package from Analog Devices (there are now pin-compatible successors such as the SSM201 9 and INA21 7). With 1 nV/VHz input noise (at 1 000x) this is difficult to equal with a discrete design taking up the same amount of space. In the meantime even better versions have appeared. In the datasheet for the SSM201 9 you can find a nice application where the noise of the microphone amplifier is cal- culated based on the individual noise sources: source impedance of the microphone, current noise and voltage noise of the inputs. The influence of the current noise is frequently overlooked, be- cause it is not often found in the datasheets. Because the individual noise sources are not correlated they cannot be simply summed together but you need to take the square root of the sum of the squares. If you would like to know more about different types of noise we can recommend the article by Hameg at www.hameg. com: “What is noise?”. The real work From the well-known formula for noise V(4l 67799 led rtford m Fax: 01279 267799 E-mail: sales@quasarele Web: www.quasarelectro ctronics.com nics.com 01279 Postag^ 3-7 Day Europe SOrder We acc to Quas Please 95 & Packing Op Delivery - £4 (EU) - £8.95; R4 online for reduc ^pt all major cr ar Electronics. Visit our online projects, modules and £ ions (Up to 0.5 UK Mainland st of World - ed price UK Pc Vdit/debit cards Prices include shop now for publications. Credit Card .5K' : UK Standard r ^ry - £9.95; 9) VISA r assembled and ready for kit form (KT suffix) use (AS prefix). 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 files). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £64.95 Assembled Order Code: AS3108 - £79.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located 200m+ from board. Wide range ot tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £19.95 Assembled Order Code: AS3145 - £26.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £49.95 Assembled Order Code: AS3180 - £59.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. 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/0.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 / comms program (Windows HyperTerminal) or our free Windows application software. Kit Order Code: 3190KT - £69.95 PIC & ATMEL Programmers We have a wide ijange of low ATMEL Programmers. Comply documentation available from socket (ZIF40W) £14.95 Programmer Accessories: 40-pin Wide ZIF 18Vac Power su| Leads: Serial (Lf)C441) £3.9$ / USB (LDC644) £2.95 pply (PSU12 cost PIC and te range ancj bur web site. 0) £19.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. ZIF 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. Assembled Order Code: AS3128 - £49.95 See website for full range of PIC & ATMEL Programmers and development tools. PI T. it | 1 1 1 a 1 1 1 i 1 i mud FtP WW w.qi £ 0 . 0 ) 8 <0 CO CD nics. coffljjjijl ® Se cure Online O rdering Facilit ies • Full Proc Juct Listing, D escriptions & Photos • Kit [ Jocumentatior l & Software C lownloads AUDIO By Jan Breemer (The Netherlands) These days nearly everybody has a portable music player (iPod, mp3 player, etc.). But very few people realise how much these devices can affect our hearing. The hearing threshold tester presented here has been designed to check the state your ears are in. L - The hardware and software presented here is meant to be used to easily test your hearing. It is possible to determine your hearing threshold and you can perform an A-B-X test [1] to see what differences there are in sound quality between, for example, an MP3 file and a WAV file. With future enhancements of the software (which you could eas- ily write yourself) you can carry out a number of other tests and gain a bet- ter understanding how your ears work and what you can and cannot hear. The procedure for measuring your hear- ing threshold is actually very simple: The system produces pure tones at various frequencies (generated by the PC or laptop) and with various ampli- tudes (determined by the attenuator box); an LED is used to indicate that a tone is being played and that you can use the push buttons to tell whether you heard the sound or not. In this way you can find out what the quiet- est sound is that you can just about hear. The results are shown in a graph and the whole process can be stored in a log file. In the program you can specify the lowest and highest test frequencies as well as the number of spot frequen- cies in between. The frequency scale is logarithmic. Calibration To make somewhat accurate measure- ments you need to carry out two cal- ibrations. The first is to find out the relationship between the digital values sent to the sound card and the voltage of its output signal. The second is to determine the sensitivity of the head- phones used. There is an automatic procedure for the The circuit described here is for educational use only as it gives only gives rough results. If you suspect that you have any hearing problems you should always consult your GP and/or an audiology specialist. 48 elektor - 10/2009 About your hearing When measuring sounds and how our ears react to them, two of the most important factors are the Sound Pressure Level (SPL) and the Loudness. SPL is an objective physical quantity that that indicates what acoustic power density is associated with certain sounds. It is usually (the Sone is a somewhat older, non-logarithmic unit). For example, to perceive a loudness of 40 Phon at 1 kHz you need a sound pressure of 40 dB. However, at 20 Hz you would need more than 90 dB to per- ceive the same loudness. When hearing problems are diagnosed, a lot of attention is paid to Pressure (Pascal) Speed (m/s) Intensity (W/m2) SPL (dB) Notes 200 5 x 10- 1 100 140 rifle shot at 1 m, above the threshold of pain 20 5x10-2 1 120 possible hearing damage during brief exposure 2 5xl0- 3 10-2 100 electric drill at 1 m distance 2 x 1 0 1 5 x 1 0- 4 TO' 4 80 motorway at 1 0 m distance 2xl0- 2 5xl0- 5 10-8 60 TV at 1 m distance 2x10-3 5xl0- 6 10-8 40 normal conversation at 1 m distance 2xl0- 4 5xl0- 7 10-io 20 a quiet room 2xl0 5 5xl0- 8 10- 12 0 human hearing threshold given in dB where 0 dB corresponds to a sound pressure of 20 micro- Pascal. This is just about the quietest sound that can be perceived by human hearing at 2-4 kHz. (1 Pascal = 1 Newton/m 2 ). The relationship between the SPL and the actual sound pressure in Pascal is exponential. There is also another factor involved, which is the speed at which the air particles move due to the differences in pressure. The acoustic power density is the product of this pressure and this speed. The speed is directly proportional to the actual sound pressure, because the relationship between them, the acoustic imped- ance, is constant for air at atmospheric pressure. Sound pressure, speed and SPL are always given as RMS values. The table shows how the units relate to each other. Loudness is a subjective measure of the sound intensity, which de- pends very much on the frequency of the sound. The relationship be- tween the SPL and the loudness as a function of frequency for human hearing is given by the Fletcher-Munson graphs (see Figure). These graphs have been compiled using measurements on a very large number of test subjects. These graphs show that when the frequency moves away from 1 kHz the subjective perception deviates significant- ly. The sensitivity deteriorates quickly at lower frequencies, and even more so at lower sound levels. The bottom line of the Fletcher-Munson curves corresponds to the hearing threshold. This is the lowest sound level that can just be heard in extremely quiet surroundings. The wavy lines show the sound pres- sure (SPL) required to obtain a certain loudness in Phons or Sones the hearing threshold. An increase at certain frequencies is an indica- tion of some measure of hearing loss. Audiologists will pay particular attention to hearing loss within the frequency band that is important for the understanding of speech, since that has the most far-reach- ing social consequences. The frequency range for this is about 200 to 8000 Hz. 20 100 1000 f (Hz) 5000 10000 090351 - 56 first. The microprocessor in the atten- uator box has an on-board A/D con- verter that can be used to measure the input signal. The software has a calibration procedure that determines the relation between the digital values and the output voltage. During this procedure the sound card produces a 3 kHz tone at a certain amplitude for 1 s. The peak-to-peak value is meas- ured by the A/D converter. With this value the program works out how to make the sound card generate a sig- nal of 1 V RMS . The calibration for the sensitivity of the headphones is more complicated. There are a few ways of doing this: - The program has the facility to use the details from the frequency response in dB/V for the calibration. - When only the sensitivity in dB/mW is available, you will have to trust that the frequency response of the head- phones is fairly flat. When you use this value you will also need the imped- ance of the headphones (for the calcu- lations, see [2]). When you use figures in dB/V the impedance isn’t required. How does it work? In this design the tones are produced by the sound hardware inside the PC or laptop. Two further requirements are a pair of headphones and a quiet room. The attenuator box is the only item that you have to build yourself for this project. The attenuator unit is a straight- forward circuit (see Figure 1). The actual attenuation is carried out by a PGA2311 made by Texas Instruments. This is driven by a Freescale microproc- essor of the same type as described in the SpYder project in Elektor March 2007. An FT232 chip is used to inter- face the circuit with the PC. The sup- ply is taken from the USB connection. As an aside: an attenuator unit was used in this circuit because it has more flexibility and a greater range. Also, when you’re carrying out A-B-X tests with music samples it becomes impractical to control the volume accu- rately, especially if you want to intro- duce differences to the left/right chan- nels. And controlling all those different sound cards directly via their drivers wouldn’t be practical either. 10/2009 - elektor 49 AUDIO +5V © LED1 C4 lOOu 16V FC LV IC4 c+ OUT MAX660 C- OSC +5V © RIO R25 USB B J1 o a o o LI 3 wdg. R7 R2 H 27R h R1 H 27R h ci 100n 15 14 30 R3 i 32 C7 lOOn 13 26 VCC1 VCIO VCC2 RESET 3V30UT PWREN SLEEP PWRCTL TXDEN AVCC DSR RSTOUT RTS IC2 RXLED TXLED DCD USBDP CTS FT232BM DTR USBDM Rl TXD EECS RXD EESK TEST EEDATA AGND GND1 XIN XOUT GND2 C2 27 p 27 XI I I 6MHz 28 6 _10 16 _20 23 11 12 J 9 _ 22 21 _18 25 24 31 29 LED2 geel R8 R8 n cs £ cb 00 JfJ lOOu I 16V 12 11 17 C3 27p +5V © ^C6 ^00n 8 Dl DO IC1 SK PRE 93-C46BSM cs PE R4 LJ R14 VDD RST PTAO BKGD |q 5 PTA1 PTA2 PTA3 MC9S08QG8 RXD TXD PTB7 PTB6 PTB5 PTB2 PTB3 PTB4 VSS 16 15 14 13 10 9 8 H 10k I H 10k \ R11 I C13 lOOu 16V ^^6 R18 \ 680R h 3x BS170 R12 R13 12 C11 n 100n 13 VA+ VD+ VA- ZCEN AOUTL MUTE IC3 AOUTR PGA2311PA CS SDATAI SCLK SDATAO AINL AINR DGND AGNDL AGNDR 15 100i^6V 14 11 16 R21 10 H 2k0 I — < > J4 R22 R24 r H 2k0 | — ' R23 0 -* ♦ TV J3 0 tv +5V © J2 +5V 1 LED L LED M LED R BT L BT M 6 BT R GND 8 090351 - 11 Figure 1. In the circuit diagram we recognise a few "old favourites': the processor from the SpYder kit, an FT232 USB to serial converter and the PGA231 1 that was previously used in the April 2004 High End Preamp. Circuit Diagram At the centre of the circuit is the micro- controller, which is responsible for con- trolling IC3, the communications with the PC/laptop via IC2, driving the LEDs and monitoring the push buttons. The original audio signal is fed to an ana- logue input of the microprocessor via Cll (necessary for the calibration). The DC offset of this input is kept at half the 3.3 V supply voltage by resistors R9 and R10/R25. Series resistor R14 prevents the IC input from being over- driven when the input signal exceeds 3.3 V pp . At the right of the controller we find the audio signal attenuator, IC3. It has a range from -95.5 dB to +31.5 dB, in steps of 0.5 dB. The input sig- nal has already been attenuated by 10 dB (by R21 to R24), so the effective range starts at -105 dB (and ends at + 21.5 dB). IC2 takes care of the USB communica- tions. This is a USB to serial converter. Using a suitable driver, the PC program can communicate with the attenuator as if it was on a serial port. The VID, PID and USB configuration are stored in a small EEPROM chip, IC1. R1 and R2 provide the correct impedance for the USB signal connection. R3 is a pull- up that signals to the USB host what type of USB device is connected (here it is version 2.0, full speed). R4 and R5 are pull-ups for the bi-directional data connection to the EEPROM. The LEDs in the switch box are driven by three MOSFETs, T1 to T3. The exact type isn’t that important. The current through the LEDs is determined by R18 to R20. Try to use LEDs with a higher efficiency and increase the values of the resistors accordingly. We can only take a maximum of 100 mA from the USB connection. The push button signals are fed to the microcontroller via filters (Rll to R13/C8 to CIO). R15 to R17 are used as pull-ups. The negative supply voltage required by IC3 is generated by IC4. A number of decoupling capacitors have also been added. LI Cl, C6 and C13 form a filter to keep interference outside and/ or inside. D1 shows when the supply voltage is present, while D2 lights up when communications with the PC take place. The construction isn’t very difficult. Most of the components used are through-hole types. Start with the smallest components, in this case the SMD ICs and finish with the largest. The trickiest will be IC2. A good tech- nique is to place a blob of solder on the 50 elektor - 10/2009 Figure 2. The attenuator unit. From left to right: the yellow LED indicates when communication with the PC takes place, the green LED shows when the supply voltage is present. Next to that is the USB connector, the RJ45 connector for the push button box, the signal input and finally the connector for the headphones. solder pads, solder the IC and remove any excess solder using a desoldering braid. The PCB layout (which can be down- loaded from [3]) has been designed such that all components are on one side. This makes it easy to mount the board into a box. If you are absolutely certain that the distance between your PC or laptop and the quiet room will never need more than 5 m of USB cable, you can mount the LEDs and push buttons into the same box. In that case the RJ45 connector is no longer needed. If you need more than 5 m youTl have to mount the LEDs and push buttons into a separate box, which is then connected to the attenu- ator box using Cat5 cable and an RJ45- 8 plug. As with the headphone cable, this cable can be several tens of metres long without any problems. Software and hardware channel, bass boost, echo or reverb effects, etc. The volume should be at its maximum setting. Turn off any other programs that (may) use the sound card. The ideal headphone is a closed one that fits completely over your ears. Unfortunately, good-quality closed headphones are mainly made for the professional market and have a price tag to match. Low impedance head- phones (<300 Ohm) aren’t preferred for this project. Apart from the serial communications, the firmware for the HCS09 microcon- troller also takes care of the LEDs and the scanning of the push buttons. The programming of the controller is made easy when you use the USB SpYder stick and its development software [4]. The PC software, which can be down- loaded from [3], does not have to be installed. Extract the files onto your computer and place them in a suitable folder, such as C:\Program Files\Hear- ingTestV You do need to have the Visual Basic 6 Run-time envi- ronment installed (can be down- loaded from [5]). The hearing threshold tester makes use of a virtual COM port via USB. To make this work, you’ll need to have a driver installed on the PC for a virtual USB COM port. The driver found at [6] has been fully tested by the author and works well. In theory any sound card should be suitable. Connect the attenuator unit to the line output or the headphone socket. Don’t use an output meant to drive loudspeakers. You should also turn off any special effect on the sound card. This means no (pseudo) multi- Test Your Ears -System- Language *J hti'bo* iij8 I I C:\Documents and Settings\thijsb\Mijn documented. r Make Logfile Communication Comport no mm SSr^i [7 Show Attenuator Panel Sound Device Sample Rate 441G0 48000 96000 1920O H eadphones S ensitivity (*‘ Fixed 1 90 C Use Calibration File dGV Calibrate 1 Volt RMS 1 29652 Cal Units T ype of test " Hardware (* Hearing Threshold r A-B-X-T est f Attenuator Communication Panel w 1° CornrnF'ort pj dB |Mute Left r f r s r c ^ Off Middle — Right r f r s r c F Off r f r s r c Off Clear Button History Peak Value Clr Peak Hearing Threshold E3 Start Frequency po - P Stop Frequency 1 20000 # Frequencies (* Left T Both Go Hz Hz Sound Time Pause Time Margin [iooo 1000 w ms ms dB P Flight Current T estvalues Test Number Frequency Upper Level Lower Level T est Level Hz dB dB dB r Display P White Back w Show T hr ■ P Show Calibi Save Select Directory Figure 3. The program displays a main window ("System 7 ) and a number of sub-windows depending on the type of test. 10/2009 - elektor 51 AUDIO 090351 - 55 Figure 4. The result gives a clear overview of the hearing threshold. The blue line is the normal hearing threshold for young, healthy ears, measured in a perfectly quiet room. Operation We’ll start with a hearing threshold test. Connect the attenuator unit to the PC with a USB cable and connect the audio input to the line -out of the sound card (see Figure 2). If all is well, the computer will find a USB Serial Port. Take a look via the Device Manager (in WinXP: Start -> Control Panel -> Sys- tem -> Hardware tab -> Device Man- ager) which COM port number has been assigned to the unit. Now start the program (TestYourEars.exe) and select your required language (see Fig- ure 3). From the main window, enter the correct COM port number and tick the box if you’d like to see the attenu- ation panel in the future. Usually this isn’t required. Indicate whether you want to use a single, fixed number for the calibration of the headphones, or if you have a calibration file. Next let the program calibrate a 1V RMS signal. In the box ‘Calibrate 1 Vrms’ you can see the peak value required to output a 1 V RMS from the sound card. You should expect a figure somewhere between about 10000 and 32000. Now choose the hearing threshold test. If needed, change any settings in the hearing threshold window and click on Begin to start the test. Next, take the switch box to an extremely quiet area (a large wardrobe full of clothes works well) and put on the headphones. The (middle) red LED lights up whenever a tone is reproduced via the headphones. If you weren’t sure if you heard it, or were disturbed by another noise, you can press the middle button to repeat the same tone at the same loudness. The left and right LEDs indicate that you should press one of the appropri- ate buttons. The left button is used to tell the system that you heard the tone. If you didn’t hear the tone you should press the right button. The same tone will then be played again, but louder if you didn’t hear the previous one, or softer if you did hear it. Once the differ- ence in loudness has become less than the setting in ‘Margin’, the same pro- cedure will be followed with the next higher frequency. In this way the system interactively determines the lowest level at which you can hear a frequency and then moves on to the next frequency. The results are shown immediately on a graph on the screen. Once the test has completed the red LED flashes quickly and the results can be inspected on the screen. The green line represents the lowest level that could still be heard and the red line is the highest level that could no longer be heard. The results can be saved as a bitmap or as a comma-separated-variables text-file. In the ‘Display’ section you can change a few things regarding the graph. A white background is usually much better when you want to print the graph. ‘Show Threshold’ displays the standard hearing threshold for people. ‘Show Calibration’ displays the calibration curve for the headphones, if it’s used. Enhancements Enhancements for this program seem to present themselves naturally. In the first instance you can determine the hearing threshold as a function of fre- quency. This is the most important cri- terion if you are looking for hearing loss as a result of nights out in the disco or the use of portable music players. This hardware offers many more possibili- ties though. With additions to the software you can investigate masking effects, for example: - Pure harmonics; what percentage harmonic distortion can you detect? - Nearby frequencies; how weak should a tone that is close to another be before you can no longer hear it? - Distant frequencies; how soft does a tone with a clearly different frequency have to be before it can no longer be heard? - Noise; how loud should a tone be for it to be heard above white noise? The noise can also be narrowband, cover- ing an octave or less. The tone can be inside or outside the noise band. All these tests can be carried out on one or two ears. The hardware can also be used to carry out A-B-X tests on, for example, music samples. You could write a program that could add a certain amount of distortion to music samples and then test to see how much distortion can be noticed with which type of music. The interface details can be found on the author’s website [2]. The PCB art- work files (Eagle format, including schematic) and the component list for this project may be found at [3]. ( 090351 - 1 ) Internet Links [1 ] http://en.wikipedia.org/wiki/ABX_test [2] http://www.breem.nl/TyE [3] www.elektor.com/090351 [4] www.elektor.com/shop, search for 'spyder' or / 060296-91 / [5] http://support.microsoft.com/kb/290887 [6] http://www.ftdichip.com/Drivers/VCRhtm 52 elektor - 10/2009 /O O' PCBCORE China PCB Supplier (Prototype thru Production) / 1 -layer up to 30-layer ✓ Cost and quality / On time delivery / Dedicated service / Instant Online Quote & Order Day and Night No minimum quantity - 1 piece is welcome Check our low price and save big $$$... 86(571 )86795686 sales@pcbcore.com www.pcbcore.com Schaeffer Customized front panels can be designed effortlessly with the Front Panel Designer. The Front Panel Designer is available free on the Internet or on CD. automatic price calculation delivery in 5-8 days 24- Hour-Service if required FRONT PANELS & HOUSINGS Cost-effective single units and small production runs Sample price: 32,50€ plus VAT/shipping Schaeffer AG • Nahmitzer Damm 32 • D-12277 Berlin • Tel +49 (0)30 8058695-0 Fax +49 (0)30 8058695-33 • Web info@schaeffer-ag.de • www.schaeffer-ag.de Design We add value to PCBs when others just sell it. Prototype Production Mi *] One Stop Manufacturing Service $10 ea. for 5pcs 4"x4" 2L Free Solder Mask & Silkscreeni Designing Service 3D Enclosure Designing Virtual Assembfa PCB Design - Free Components. - Free Assembly Assembly Components Pcbs Enclosules Fpcs Keypads www.EzPCB.com Email: sales@ezpcb.com Please Visit www.machinepier.com For Machining 10/2009 - elektor 53 MINI PROJECT Pocket Preamp Part 2: a simple preamplifier with tone controf By Ton Giesberts (Elektor Labs) The PWM power stage discussed in the previous instalment (June 2009) can be used perfectly well on its own. But a matching preamplifier with power supply would complete this amplifier nicely. That is why this month's Mini Project presents the sequel: the Pocket Preamp. In the June 2009 instalment of this series of articles we described a small PWM amplifier. What is missing from this are tone and volume controls. Since most people are spoilt these days with surround sound systems equipped with an equalizer as an absolute mini- mum, we made this preamp with a 3- way tone control, instead of the more customary bass/treble control. Tone control The tone control has an adjustment range of ±12 dB for the low and high frequencies and ±9 dB for the mid frequencies. The latter is more than enough, because our ears are more sensitive to mid-range frequencies. The circuit will also remain reasonably straightforward with these values. If these adjustment ranges are too small then there is very likely something wrong with the loudspeakers. Main Specifications • 3-band tone control • Symmetrical supply • Compact • Connector layout matched to associated boards A control range of 12 dB means that, because of the relatively limited power of the output stage, there is an immi- nent danger of overdriving it, particu- larly for the low and middle frequen- cies. After all, an increase of 12 dB implies an increase in power by a fac- tor of 16! The circuit The volume control (PI) is connected directly tot the input of the preamplifier (see Figure 1). This is the best place to prevent the tone control stage from being overdriven. The first amplifier stage (ICla) is non-inverting and has a gain of 4 times as calculated from R3/R2 + 1 At a supply voltage of ± 9 V, a signal of more than 1 V (i.e. a little over 1.2 V eff ) can be processed without distortion, when the tone controls are in their centre positions. It will be obvious that when either the high or the low tone control is at its maximum value, the maximum permissible input signal is a lot smaller at only 300 mV (for the applicable frequencies, of course). At this point the output of the tone control is just below the point of being over- driven (but it will already overdrive the power amp, so take care!). The operation of the tone controller is not all difficult to understand. The part 54 elektor - 10/2009 around IClb is an inverting amplifier with three feedback circuits connected in parallel for the tone control. Resis- tor R12 ensures that the output cannot swing to the power supply rail in the event of contact bounce by the wiper of P2. Incidentally, R1 functions in a similar way for volume control PI. C8 and Cl suppress RF (high frequency) interference. P2 is the bass control. C2 determines the frequency range that will be con- trolled. Simply put, at higher frequen- cies, C2 effectively shorts out P2. The amplification is then determined by the ratio of R5 and R4. The ratios of P2 to R4 and R5 determine the minimum and maximum control range respec- tively. The maximum gain for exam- ple is (P2+R5) / R4 and amounts to about 5.5 times (15 dB, DC). R6 is necessary so that the other frequencies can be adjusted with P3 and P4. C7 primarily determines from which frequency the high tone control operates. C5 and C6 ensure that the tone control has a steeper response. Components R9 and C4 have the same functions for the mid frequency control as R6 and C7 for the low and high con- trols. C3 has the same function as C2, but filters the high frequencies much later. Together with C4 it sets the range of the mid control. In the end, the control ranges of the mid and high adjustments are not only determined by, for example, the ratio of P3 to R7 and R8, but the other components in the feedback circuit also play a role. That is why the ratios between P3 and P4 to R7/R8 and R10/R11 are greater than would be expected from the actual control ranges. The low tone control has quite a wide bandwidth, because we assume that small loudspeakers will be used. If this tone control is going to be used with a larger amplifier and ditto speakers a larger value for C2 may result in a better sound. Output resistor R13 pre- vents problems in the event an exces- sive capacitive load is connected. Power supply The power supply is symmetrical. This way we can avoid relatively large cou- pling capacitors and their detrimental effects on sound quality. The disadvan- tage is that a negative supply voltage Cl C2 Figure 1. The preamplifier is quite straightforward for a volume control with triple-band tone control. is required. The easiest solution is a circuit that inverts the positive power supply. We selected a DC/DC converter from Maxim, the ICL7662 (see Figure 2). This IC works as a charge pump and can operate with voltages up to 20 V. Pin-wise and functionally the IC is compatible with the more common ICL7660, which can operate up to 10 V (the A version can handle voltages up to 12 V). These parts can also be used here without any problems. The big- gest advantage of this is the simplic- ity; only two external capacitors are required. A small disadvantage is that the output voltage is not regulated. The unloaded output voltage is equal to the input voltage, but negative. As the output current increases the out- put voltage will reduce however. To increase the stability of the output voltage two ICs are connected in par- allel. If you load a single IC powered at 9 V with a resistance of 100 Q, the out- put voltage drops to about -4.6 V. With two ICs in parallel this drops to only Figure 2. A voltage converter is used to convert a single power supply voltage into a symmetrical power supply. 10/2009 - elektor 55 MINI PROJECT COMPONENT LIST Preamplifier board Resistors R1 = 220 1<^ R2 = 3.3kf2 R3 = 1 0k£2 R4,R5 = 2.2kf2 R6 = 1 5kf2 R7,R8 = 1.5kQ R9 = 4.7kf2 R1 0,R1 1 = lkQ R12 = 1MQ R13 = 1 00£2 PI = 10kf2 potentiometer, logarithmic P2,P3,P4 = 1 0k£2 potentiometer, linear Capacitors (lead pitch 5mm / 0.2") C1,C8 = 68pF ceramic C2 = 180nF polyester/ MKT C3 = 4.7nF polyester/ MKT C4,C5,C6 = 27nF polyester/ MKT C 7 = 6.8nF polyester/ MKT C9,C10 = lOOnF polyester/ MKT Semiconductors IC1 = NE5532 (DIP-8) Miscellaneous PCB, # 080278-1, from www.thepcbshop.com -6.3 V. With your preamplifier as a load the output voltage drops only 0.35 V (the NE5532 draws about 7.5 mA). You could also use other opamps that have a lower current consumption, but their quality is often inferior; the NE5532 is an excellent audio opamp. In our prototype we initially connected four ICs in parallel, but with three or four not much more is gained. There was however a strange effect: the rip- ple in J the output was found to vary slowly between a minimum and a maximum value. This was caused by the asynchronous oper- ation of the internal oscillators. In addi- tion, the frequency of this power supply ripple was 10 kHz so it could become audible. That’s why the ICs are driven with an external clock furnished by a 555 IC. The frequency of the 555 is set to 40 kHz, so that the ripple at 20 kHz is just outside the audible range. An advantage is that the inductor in the output filter can be much smaller, amount of the switching frequency of the power amplifier can be seen. Test results The most interesting test results for the tone controller are of course the individual frequency response curves for the tone adjustments. Figure 3 shows the maximum, minimum and neutral positions (the positions of the bass and treble controls remain inputs of the two converters, each via a 1 kQ resistor, to pre- vent potential problems at power-on (risk of latch-up). The ripple across the filter capacitors C7 and C8, which are connected in parallel for a lower series resistance, is almost completely removed by output filter L2/C10/C12. On an oscilloscope only a very small which results in a much smaller resist- ance loss for this coil. The inductor we used for L2 has a rated series resist- ance of 12 Q. LI and L2 are standard axial noise suppression chokes, which are fitted upright here. The latter is also true for the four resistors in the circuit; this saves space. We won't dwell on the circuit around the 555. It is the standard astable configura- tion. IC1 drives unchanged). In the neutral position a slight attenuation of less than 1 dB at 20 kHz can be seen. This is mainly caused by RF suppression capacitors Cl and C8. At 20 Hz the variation in gain is ±14 dB (±12 dB at 40 Hz) and at 20 kHz it is about ±12 dB. The distortion with an input signal COMPONENT LIST Power supply board Resistors R1,R2 = lOOkQ R3,R4 = 1 kQ Capacitors Cl ,C5,C6,C1 1 ,C1 2 = 1 OOnF ceramic, lead pitch 5mm (0.2") C2 = lOOpF, lead pitch 5mm (0.2") C3,C4,C9,C10 = 1 0yL/F 63V radial electro- lytic, lead pitch 2.5mm (0.1") C7,C8 = 4.7/iF 63V radial electrolytic, lead pitch 5mm (0.2") Inductors LI = 1 0jL/H axial (vertical mounting) L2 = 1 mH axial (vertical mounting) Semiconductors IC1 = TLC555 (DIP-8) IC2,IC3 = ICL7662CPA+ (DIP-8) (Maxim IC) Miscellaneous 56 elektor - 10/2009 of 0.5 V is less than 0.005 % (1 kHz, 22 kHz bandwidth, volume control to maximum, tone controls to neutral). The current consumption of the entire circuit is 56 mA at 9 V, 12 mA up on the PWM amplifier by itself. With an 8 Q loudspeaker and the amplifier over- driven slightly, the current consump- tion peaks at about 162 mA. This really is too much for a 9 V battery. With mul- tiple channels we therefore recommend that you use an AC power adapter. During the tests we didn’t actually use potentiometers for the tone con- trols, but instead went for rotary switches and resistors. This is because the interest is mainly in the performance at the neutral positions and at the upper and lower limits. So, Construction of the three boards The connections for the three boards have been placed in the same posi- tions as much as possible. The output of the preamplifier is in the same cor- ner as the input to the power ampli- fier. The power supply connections of the preamplifier are in the same place as the power supply outputs of the power supply board. The 9-V input of the power supply board is looped directly to the two connections for the power amplifier. The position of these corresponds to the power supply con- nections of the power amplifier. On the power amplifier, next to the power supply connections, there are also the connections for the power supply switch (SI). This is only for the power Figure 3. The curves show the effects of the different maximum settings of the tone control. each potentiometer is reduced to two resistors and a rotary switch. The tol- erance of pots is usually quite large; ±20 % is typical, and inevitably has an effect on the frequency ranges and maximum and minimum gains. With multiple channels the individ- ual deviations can result in audible differences. If you have the opportu- nity to check whether the individual channels of stereo potentiometers are matched then it is certainly recom- mended that you do this. With more than two channels, the use of rotary switches with multiple poles may be considered, but this is an expensive solution. amplifier. It is better to insert a switch in series with the input to the power supply board. You can then short out the connections for SI. Mounting holes were deliberately not included on all three of the boards so that everything is as compact as poss- ible. For a reliable mounting option you could consider a couple of plastic sup- ports with slots. The boards can then be mounted one above the other. The best order is the power supply board at the bottom, the tone control above that and the power amplifier at the top. ( 080278 - 1 ) Kit set As indicated in the parts list, you can order the bare printed circuit boards for this project from www.thepcbshop. com. However, a complete kit set is also offered in the Elektor web shop, which comprises the printed circuit boards and all necessary parts, see www.elektor. com/080278. 10/2009 - elektor 57 / A performance test off 10 noise cancelling i headphones / Sound of ence By Harry Baggen (Elektor Netherlands Editorial) Background noise can be very irritating while you are listening to music. Fortunately we can get round this these days by using headphones that reduce background noise using anti-sound. In this article we'll take a look at a number of these so-called noise cancelling headphones. elektor - 10/2009 Figure 1. Diagram (a) shows the effect of the passive suppression caused by the earcups of the headphones. When an active NC system is added the lower frequencies are suppressed as well (b). They're becoming more and more common: people on the street, bus, train and plane wearing headphones or ear- phones, enjoying their favourite music. Unfortunately, the 'enjoyment' has to be taken with a pinch of salt. If it's not the lack of quality of the headphones, then the background noise will introduce a measure of interference. Listening to music can be particularly relaxing when you're travelling for hours on the train or plane. But in these situa- tions there will be a continuous rumble in the background, caused by the wheels on the rails or the jet engines of the plane. Fortunately we can do something about this with the help of so-called antisound, so you can relax in (artificially generated) peaceful surroundings and enjoy your music. Theory There are two ways in which unwanted sounds can be reduced. The first is really very simple: sealed headphones that have earcups covering the whole of the ears will pas- sively reduce the noise. This type of ear-protection is used widely within the construction industry. However, they're usually not very comfortable. Furthermore, such passive systems predominately suppress middle and high frequen- cies, whereas train and plane noise is generally in the lower frequency band (Figure la). In the second method electronics gives us a helping hand. The background noise is picked up using a microphone, amplified, shifted 180° out of phase and finally mixed with the music signal. In this way the interference signal is removed. Any changes in the background noise are imme- diately picked up and effectively suppressed. In Figure 2 you can see the principles involved. Such an active system lends itself particularly well to the suppression of noise with lower frequencies. When this is combined with passive suppression it results in good sup- pression across the whole audio spectrum (Figure lb). Practice Such noise cancelling headphones are made by many manufacturers. There are special types designed to be used by e.g. pilots, but these days there are also many head- phones available for general music playback on the bus, train, plane, or even at home. It is the last category that we've explored in this article. Noise cancelling headphones for general consumer use can be roughly divided into three groups. There are purely passive types, where the mechanical con- struction of the earcups or earbuds provides a reduction of background noise. Examples of this are the SE420 and SE530 made by Shure. These are in-ear types, where the ** anti-noise sum of both waves 045124 - 12 Figure 2. Removing noise: The interference is measured, its phase inverted and mixed with the original signal. Audio In Digital processing system /■ \ System controller A/D converter ▲ ▼ DSP (Digital Signal Processor) o Digital equalizer DNC software engine A - B -+ C — O e to jo A/D D/A converter converter Microphone amplifier / \ fo V I© Headphone amplifier Detection microphone Driver unit 081085 - 11 Figure 3. In a digital NC system a DSP removes the background noise. 10/2009 - elektor 59 INFO & MARKET NC HEADPHONES REVIEW earbud is pushed into the ear canal. Despite its passive construction there is a good amount of suppression. With active noise cancelling (from now on abbreviated to NC in this article) headphones we can differentiate between analogue and digital types. With analogue types the inverted signal that's mixed with the original audio sig- nal is generated by a microphone in conjunction with a small audio amplifier. This is the system that can be found in most NC headphones. The results can be quite good, but are dependent on the technical design of the control system. With digital types (generally the more expensive ones) a DSP is used to intelligently remove interfering sounds. With these the microphone signal and the audio input are first digitised before being fed to a DSP, which compares them and performs some calculations on them. The resulting dig- ital signal is then converted back into analogue and fed to the earcups via an amplifier. An example of this can be seen in Figure 3, which Sony uses in its more expensive models. In the most recent versions the composition of the background noise is analysed and the result is used by the DSP to choose a filter pattern that is most effective at removing the noise. Effective? For this article we've asked virtually all well-known manu- facturers of headphones to supply us with several samples so we could get an impression of the effectiveness of the built-in suppression electronics and, of course, the eventual sound quality of these headphones. The price range is from about £35 (€40) to £350 (€400), which leaves something for everybody. Most samples were supplied with a set of accessories, such as a travel case, cables and converter plugs, and in one case it included a charger for the built-in rechargeable batteries. Since it would be very difficult to directly measure the effec- tiveness of these NC headphones (mainly due to the differ- ent types in our test set, like in-ear and sealed types), we decided to use subjective judgments for the effectiveness of the noise suppression and the sound quality. The noise suppression is tested in several realistic environ- ments, such as traffic noise, a server room with air condi- tioning, and in a noisy office. In other words, in places that most of us experience on a regular basis. We also noted how comfortable they are to wear, which isn't an insignificant point when they're worn for hours on end. On the basis of these criteria you should be able to pick your favourite, depending on what's most important to you. Some other criteria that could affect your choice: How much are you prepared to pay for such NC headphones? How often would you use them and how important is the sound quality? The ratings given to the products are on a scale of 1 0. Prices approximate and subject to trade discounts. Products tested may not be available in all countries. Audio Technica ATH-ANC7 These on-ear headphones are finished to a high stand- ard. They come with a strong travel case, plane adapter and a 6.3 mm in-line adapter. All plugs and adapters are gold-plated. The power is supplied by an AAA battery, which should last about 30 hours according to the manual. Plus point: The headphones also work when the battery is empty, although they sound a bit quieter. The earcups are fairly small, so they rest on the ears. They don't exert that much pressure, so the comfort level with longer use is reasonable. The sound quality of these AT headphones is quite good, with a balanced mid-range and high frequency response, and a solid bass response. With the NC system turned on, there is a slight noise noticeable from one earcup, but this all but disappears when music is played. When the NC system is turned off the response becomes a bit flatter. The active NC system suppresses low-frequency noises very well, and voices are barely noticeable in the background. Sound quality: 7 Noise suppression: 8 Comfort level: 6 Retail price: approx. £175 (€200) Bose QuietComfort 3 These are well-designed on-ear headphones. The earpads are a bit smaller than those of the AT, but they're very soft and hardly press on the ears. This makes the comfort level very good. A wide range of accessories is included, such as a plane adapter and 6.3 mm in-line adapter, an extension cable (nearly all plugs are gold-plated), a charge adapter for the two special batteries with several types of mains plug for world-wide use, and a sturdy travel case. The QuietComfort 3 can only work with the NC system turned on, so always make sure that you take a spare, fully charged battery with you (a spare battery is included in the box of accessories). The noise generated by the electronics is barely noticeable. The Bose has a very good sound quality with a well-defined mid-range, but a slightly limited top range and a very pow- erful bass, which could have been a bit quieter, although 60 elektor - 10/2009 sure on the ears, which results in less acoustic isolation. you get used to this after listening for a while. The noise suppression is very good and particularly effec- tive at lower frequencies. Voices come through a bit stronger than with the AT, but apart from that, all noise is suppressed very well. Sound quality: 8 Noise suppression: 8 Comfort level: 7 Retail price: approx. £350 (€400) JVC HA-NC250 These relatively small and lightweight on-ear headphones also come with a travel case, connection cable, and sev- eral gold-plated in-line adapters. The HA-NC250 needs a single AAA battery and also functions with the NC system turned off. The earcups are not very big and therefore rest on the ears. They exert very little pressure on the ears, so are hardly noticeable. When you move your head the ear- cups stay in place very well. The HA-NC250 has an agreeable and somewhat neu- tral response with a good definition in the mid and high ranges. The bass response is perhaps not as powerful as with some other models, but still fits in well with the rest of the frequency response. The noise suppression system works best at lower frequen- cies and functions quiet well. Voices are quite noticeable, but that is also due to the small earcups and the light pres- Sound quality: 7 Noise suppression: 6 Comfort level: 7 Retail price: approx. £175 (€200) JVC HA-NCX77 These in-ear headphones have earbuds with an angled sec- tion onto which the rubber end-plugs fit, making it easier to put them into the ear canal. The electronics have been put inside a separate little box, which also contains the energy source (one AAA battery). This box also has a volume control, an on/off switch for the NC system and a monitor switch to temporarily turn off the music when you suddenly want to talk to somebody. Everything can be stored in an accompanying case. The sound quality of these earbuds is quite disappointing when compared with the on-ear types. The sound appears quite tight and there is only a limited bass response. We should point out that with earbuds the sound quality depends very much on how they're placed in the ears and how well they fit, and this is something that can be differ- ent for different people. The noise suppression of the HA-NCX77 is only moder- ate. This is also affected by how well the earbuds fit, and this too depends very much on the individual. This is also the reason why no scores have been given for the comfort level of earbuds. Some people don't have any problems with earbuds, whereas others can't seem to stand having them in their ears. Sound quality: 5 Noise suppression: 4 Comfort level: not assessed Retail price: approx. £70 (€80) Philips SHN2500 The cheapest set of earbuds with an active NC system in this test is the SHN2500. This time there is no carry-case, but you do get two in-line adapters. The earbuds have the same shape and dimensions as most normal earbuds. As far as we can tell, the microphone has been placed at 10/2009 - elektor 61 INFO & MARKET NC HEADPHONES REVIEW The NC system manages to remove a fairly large amount of low-frequency noise from the signal, on top of the reduc- tion caused by the acoustic isolation of the earbuds. This is quite a performance from a system costing £85! Sound quality: 6.5 Noise suppression: 6 Comfort level: not assessed Retail price: approx. £85 (€100) the back. The NC electronics have been put in a simple external case, which also contains an AAA battery for the power. A slide-switch is used to turn the NC system on or off. With the NC system on there is some quiet background noise, although it isn't disturbing. After choosing the right size of silicone end-plugs the ear- buds fitted quite well in the tester's ears despite the straight shape, and also closed off the ear canal very well. The sound quality is quite acceptable, especially at this price. The mid-range seemed somewhat limited, which is some- thing that many cheap in-ear headphones suffer from. The noise suppression manages to reduce some of the low- frequency noise, but most of the suppression is a result of the acoustic isolation caused by the earbuds themselves. But this is certainly not a bad thing. Sound quality: 6 Noise suppression: 5 Comfort level: not assessed Retail price: approx. £35 (€40) Philips SHN7500 These deluxe in-ear headphones made by Philips have ear- buds that are somewhat more ergonomically shaped. The microphones on this model are found on the sides. The SHN7500 comes with a storage case, several adapters and of course three different sizes of silicone end-plugs (just like all other in-ear models in this test). The NC system has also been put in an external box here, and works off an AAA battery. It has a switch for the noise suppression sys- tem and a linear volume control. The travel of the latter is very short, making it difficult to find the right volume level. The cabling runs partially along a strap that's mounted to the box, so you can wear the box from your neck and there won't be any other trailing cables. After picking the right size of silicone end-plugs the SHN7500 produces a surprisingly good sound that comes close to that from some larger on-ear headphones. A fairly balanced response and a strong bass response result in an enjoyable listening experience. Sennheiser PXC 300 These are light-weight on-ear headphones that can be folded into a fairly small package. A carry case, plane adapter and 6.3 mm in-line adapter are all included. The NC electronics are housed inside a tubular box that is pow- ered by 2 AAA batteries. This box can be clipped onto a shirt or suit. The headphones also work when the NC sys- tem has been turned off. The PXC300 fits well on the ears and exerts little pres- sure. Thanks to its light weight the earpads stay in place during head movements. Some noise can be heard when the NC system is turned on (the NoiseGard Advance sys- tem by Sennheiser). Music reproduction is clear with a lit- tle too much emphasis on the mid and high ranges. This makes the bass response seem a bit flat, but it is still well defined. The noise suppression performs reasonably well. Although low-frequency noises are suppressed by the NoiseGard system, voices still come through due to the small (and somewhat loose) earcups. The separate box housing the electronics isn't really con- venient, but it does have the advantage that it keeps the headphones themselves very light. Sound quality: 6 Noise suppression: 6 Comfort level: 8 Retail price: approx. £175 (€200) Sennheiser PXC 450 These are large, sturdy on-ear headphones finished to a high standard, which use the digital NoiseGard 2 system 62 elektor - 10/2009 by Sennheiser. This luxurious system comes with a sturdy carry case, plane adapter and 6.3 mm in-line adapter. All plugs have been gold-plated. The PXC 450 needs a single AAA battery. The noise generated by the NC system is min- imal. On the headphones are an on/off switch, a volume control with two push buttons and a talk-switch for when you need to talk to someone for a moment. There is also a bypass switch for when you want to use the headphones without the NC electronics. The large earcups completely cover the ears and form a good seal. According to Sennheiser they can even be used as passive ear protectors when the cable is removed. The earcups press somewhat hard against your head, and therefore aren't that comfortable if you wear the head- phones for a long time. The sound reproduction of this top-model is very balanced, with a tight and deep bass response, but it all sounds a bit too flat to really make the music come alive. The (digital) NC system is extremely effective and manages to strongly suppress background noise, even at higher fre- quencies up to 1 kHz. Most of the other types have to rely on the passive suppression caused by the earcups at this frequency. Sound quality: 8 Noise suppression: 9 Comfort level: 7 Retail price: approx. £300 (€350) Shure SE530 The SE530 is the only passive NC headphone in this test. Shure doesn't actually use the term NC, but calls them 'Sound Isolating Earphones'. It was interesting to see how these passive headphones compare with the active versions. The SE530 is the most expensive type from the SE series and is delivered in a deluxe case, which contains the ear- buds (it almost sounds disrespectful at this price), a storage case, connecting cable with an in-line volume control, sev- Advertisement See your project in print! Elektor magazine is looking for Technical Authors/Design Engineers If you have ^ an innovative or original project you'd like to share with Elektor's 140 k+ readership and the electronics community s/ above average skills in designing electronic circuits experience in writing electronics-related software ^ basic skills in complementing your hardware or software with explanatory text ^ a PC, email and Internet access for efficient communications with Elektor's centrally located team of editors and technicians then don't hesitate to contact us for exciting opportunities to get your project or feature article published . Our Author Guidelines are at: www.elektor.com/authors. Elektor Jan Buiting MA, Editor Regus Brentford \ 1000 Great West Road, Brentford TW8 9HH , United Kingdom Email: editor@elektor.com 10/2009 - elektor 63 INFO & MARKET NC HEADPHONES REVIEW eral in-line adapters, eight sets of end-plugs and a special cleaning tool. The way these earbuds are worn differs from all the other types. The connecting cable points upwards, and this initially takes some getting used to. It takes some time to pick out those end-plugs that fit, since a large number of them are included, but it is very impor- tant that you select the ones that fit well in your ears and hence seal them as well as possible. Once you've succeeded, the SE530 produces a very good, neutral sound, which no other headphones in this test come close to. Voices sound as if they're next to you, the high fre- quency response is clear and very detailed, and the bass response is deep and powerful, without being overpower- ing. We couldn't give it full marks (i.e. 1 0/1 0), otherwise that wouldn't leave room for improvement. As for the noise suppression, the SE530 doesn't score very high. Just like the other in-ear headphones, it provides rea- sonable suppression of the mid and high range, but for a good suppression of the lower frequencies an active system really is essential. Sound quality: 9 Noise suppression: 4 Comfort level: not assessed Retail price: approx. £435 (€500) Sony MDR-NC500D This highest priced on-ear-model made by Sony is made from magnesium and aluminium and uses a Li-ion battery for power. The well-designed headphones are delivered with a strong case, universal charger, connecting cables and several (gold-plated) plugs. There is even a separate battery holder that can be used when the internal battery runs out. This is just as well, since the headphones cannot be used without the NC system. The MDR-NC500D uses a DSP for the noise suppression. An automatic setup system analyses the background noise and uses the results to select the optimum frequency band for the suppression of noise. There is a button on the ear- cup that can be used to start this test again at any time. The earcups are just a little bit too small to cover the ears completely, but with a bit of wriggling it could just be done. The headphones felt quite comfortable and hardly pressed against the head. The sound quality of the MDR-NC500D is excellent. The reproduction is very balanced and gives a spacious feel. The quality of the bass response was only bettered by the Sennheiser PXC 450, but according to our ears, these are overall the best sounding headphones in this test. The noise suppression system is very intelligent and figures out the best noise suppression to use in various situations, particularly with lower frequencies. Higher frequencies are suppressed somewhat less, possibly because the earpads aren't pressing that hard against the ears. Sound quality: 9 Noise suppression: 9 Comfort level: 8 Retail price: approx. £350 (€400) Conclusions After listening to a number of these special NC headphones we can certainly conclude that most of them are effective, albeit at a cost. Nearly all of the headphones tested here cost £175 (€200) or more, due to the extra electronics. However, if you travel a lot by public transport or by air and want to enjoy your favourite music with the minimum of disturbance, it would be worthwhile to acquire some NC headphones. When using these headphones the sound quality is just as important as the level of noise suppression. What's the point in having an effective noise cancelling system if the sound quality is abysmal? The comfort level plays a role too. We've also made an assessment on this, but it is some- thing that is best judged by yourself before you buy a pair of headphones. The on-ear types appeared to give the best results in this test, partially because their construction provides them with better acoustic isolation. Usually they also sound better than their in-ear compatriots, but it should be pointed out that three of the four in-ear types tested here are signifi- cantly cheaper than the others. And the winner is... The best headphones appear to be the Sony MDR-NC500D. This is the only one that offers both an excellent sound quality and a very effective NC system. As far as the noise suppression is concerned, the Sennheiser PXC 450 was similar, but we weren't quite as impressed by its tonal qualities. In the category 'Best price/quality ratio' the Philips SHN7500 comes out ahead. It offers reasonable sound quality and quite effective noise suppression, as long as you don't mind wearing earbuds in your ears. At a cost of £85 (€100) Philips has placed a good product in the market. All of the headphones covered should be available, or can be ordered, from audio/video stores as well as online retailers. ( 090577 - 1 ) 64 elektor - 10/2009 2M EGA MEMORY BUtLT-tN Discover Deep Memory Performance. Due to memory constraints, traditional digital storage oscilloscopes do not have the capability of displaying a complete electronic signal at a high sample rate. The GDS-100QA Series uses MemoryPrime technology to overcome the problems associated with memory constraints. By displaying complete signals with greater detail, the GDS-1000A Series can maintain a high sample rate over a wider horizontal range, without affecting performance. Challenge yourself to go deeper, GDS-1000A ! CDS-1000A Series Digital Storage Oscilloscope * 150/100/60 MHz Bandwidth, 2 Input Channels * Sample Rates up to IGSa/s Real-Time Maximum, 25Gsa/s Equivalent-Time * 2M Points Record Length Maximum * 2mV-10V Vertical Scale, 1 ns-50s Horizontal Range * Up to 27 Automatic Measurements * USB and SD Interface Supported For more information about the advantages of MemoryPrime technology, visit our website at www.memory-prime.com or consult your local distributor. Buy CDS-Series get a limited lifetime warranty El a complimentary SD card reader GOOD WILL INSTRUMENT CO. f LTD. No. 7-1, jhongsing Road, Tuoheng City, Taipei County 236, Taiwan T +S86-2 2268 -0389 F +886-2-2268-0639 E-mail: marketing@goodwill.com.tw GU> IflSTEK Made to Measure since 1975 www.gwinstek.com READERS' CIRCUITS By Paul van der Vleuten (Belgium) This small pre-amp has both a good sound quality and a simple and flexible control interface thanks to the use of an ATmega8 microcontroller. Two digital potentiometers are used to control the volume, and a two-line backlit LCD displays the volume and input source settings. After listening to an expensive audio system a few times the author wanted to buy a pair of Dynaudio loudspeakers. However, they were quite expensive at the time. Thinking of the expression “the best things come to those who wait”, the author eventually managed to buy them at a discounted price. But a pair of speakers on their own doesn’t make a good audio system; at the very least you’ll need a good amplifier as well. Unfortunately, the budget was (almost) spent. That left the DIY route. First the power amplifier had to be built. Since the lady of the house wanted everything as compact as possible, it would have to be based on an integrated power amplifier. The most important criteria that had to be met by the power ampli- fier (apart from a good sound quality), were a robust protection against a DC offset at the outputs and absolutely no clicks or pops should be heard when it was turned on or off. In the end the author choose an LM4780 made by National Semiconductor in combination with an NTE7100 (/-/PC1237) protec- tion IC. The latter provides a switch- on delay, the detection of any DC offset at the output and it also turns off the speakers when the mains voltage is present at the transformer side. Along with the protection circuits inside the LM4780, this pair makes a well-pro- tected power amplifier that can be built in a very compact form. But this isn’t what this article is about. In it we’ll concentrate how to select the input source and the volume con- trol that precedes such an amplifier. In other words: a preamp. And this has to be compact as well, of course! So what’s the most important com- ponent in a preamp — obviously the potentiometer! But what type should be used, a normal one or some exotic, expensive version? The latter was rejected due to the abovementioned criteria and an ordinary potentiometer would not satisfy the quality require- ments. After some research it was decided to use a digital potentiometer, the AD5290 made by Analog Devices. This device has 256 steps, which is suf- ficient for a volume control. And a THD of only 0.006% isn’t bad either. Fine, but it’s the symmetrical supply voltage of ±4.5 to ±15 V that makes this device attractive as allows the AD5290 to be 66 elektor - 10/2009 easily added to opamp circuits using symmetrical power supplies. The dig- ital potentiometer is controlled via a 3-wire SPI. When a byte is clocked in (MSB first), the ‘wiper’ of the AD5290 is set to the corresponding position. The AD5290 used here is a 100 kQ type. With this value no switching clicks could be heard. Controlling this potentiometer is quite straightforward with the help of an AVR micro and Bascom. The author chose an ATmega8 as the microcon- troller. And since we’re working with a microcontroller we may as well add some bells and whistles, such as: • Input selection using relays. • Volume control using a rotary encoder. • Display the name of the input source on the LCD. • Select the names for the input source from a predefined list. LCD1 jpi +5V © C6 lOOn C5 lOOn MUTE ON/OFF SETUP 18 20 29 19_ 22_ 30 31 32 bT nr nT id no Ho Ho f'lo INPUT4 INPUT3 INPUT2 INPUT1 ENCODER \ LC DISPLAY 2 x 16 V J « o O « l< > > > DC IE 1U OT-cMfO'fintoh- C0Q3C0C0C0C0C0C0 QQQQQQQQ<^! / AVCC AREF PC6(RESET) ADC6 ADC7 PDO(RXD) PDI(TXD) PD2(INT0) PD3(INT1) VCC VCC PCO(ADCO) PCI(ADCI) PC2(ADC2) PC3(ADC3) PC4(ADC4/SDA) PC5(ADC5/SCL) IC1 PD4(T0/XCK) PD5(T1) PD6(AIN0) PD7(AIN1) ATMEGA8-AU PB6(XTAL1/TOSC1) PBO(ICPI) 090plfe1|(ofc1lA) PB2(SS/OC1B) PB3(MOSI/OC2) PB7(XTAL2/TOSC2) PB4(MISO) AGND PB5(SCK) GND GND V TR1 10k 23 24 6 7 8 9 10 25 11 26 12 27 13 28 14 15 16 Up +5V 10 ii 12 13 14 15 16 17 J1 +5V © J2 J3 SV4 o o o J4 CO D Lil --o o- o o- o o- o o o o- mi? 10 R6 7 SV2 o SLAVE12V+ SLAVE0 0 ov L© BS170 --V0-0 O IRIN + ^y irvs ©— 0 IRGND 1 +5V © P SLAVE5V+ SLAVE5V-0 0 -12 V K2 PS710B-1 A 090241 - 1 1 Figure 1. The controller board contains the ATmega8, the display, all controls and the voltage regulators. 10/2009 - elektor 67 READERS' CIRCUITS Figure 2. On the analogue board you'll find all analogue inputs and outputs, the digital potentiometers and a number of buffer stages. • The facility to adjust the volume slightly for each input, compen- sating for any differences in input levels. • Remote control using an RC5 com- patible remote control. The preamp reacts to address 16 for HIFI. • A mute function that works by briefly pressing the volume control (encoder knob with a built-in push button). • And last but not least, the facility to turn everything on and off by press- ing the volume control for 3 sec- onds. That way there is no need to add an on/off switch to the (small) front panel. Two-part circuit The circuit consists of two parts: 1. The controller board with an ATmega8, a 2x16 LCD display, the encoder control, the input selectors, the voltage regu- lators and slave outputs. 2. The ana- logue board with four input relays, two AD5290-100Ks and all the opamps. Controller section If we look at the circuit diagram for the controller section (Figure 1), we’ll see an ATmega8 at the heart of the circuit. This employs an internal RC oscillator as the clock. Make sure that this is set to 8 MHz in the fuse-bit settings. At the top is the LCD display that is driven in 4-bit mode by pins PCO to 68 elektor - 10/2009 PC5. Preset TR1 is used to adjust the contrast of the LCD (positive volt- age contrast). R1 is the current lim- iting resistor for the backlight LEDs (note that the value of this resistor is dependent on the type of LCD used). The input selection happens via push buttons INPUT 1 to 4. These pull PDO to PD3 to ground respectively. The inter- nal pull-up resistors of the ATmega8 have been activated in the code so these pins are normally high. In order to save on the number of I/O pins, the Setup button is connected to Input buttons 1 and 3 via two diodes. When the Setup button is pressed it results in both PD1 and PD3 being pulled low. This condition signals to the code that it should jump to the Setup label (If Pind.l = 0 And Pind.3 = 0 Then Goto Setup). The same principle is used for the MUTEONOFF push button. The name MUTEONOFF refers to the fact that this button has two functions: a short press = mute, a press for more than 3 s = on/off. We now come to pins PD4 to PD7. These drive the input relays via BS170 MOSFETs. Four LEDs (LED 1 to 4) give a visual indication of the input selected. The value of the current lim- iting resistor (R6) is dependent on the type of LED used. When selecting the resistor you have to make sure that the maximum source current of the ATmega8 (20 mA) isn’t exceeded. A value of lk5 works well with low-cur- rent LEDs taking 2 mA. Several pins from Port B are used to create the control signals for the two digital potentiometers on the analogue board. These are Data out (PB1), Clock (PB2) and chip selects CS1 & CS2 (PB3 and PB4). It would have been possible to use only one chip select signal since the AD5290s can be daisy-chained and the data could be sent as 16 bits. How- ever, it was decided to keep them sep- arate as that would make it possible to add a balance control to the software (at this point in time it hasn’t been added yet). The ISP connector also connects to port B, but this shouldn’t require any further explanation. Connectors SV4 and SV2 carry all connections between the two boards. From the circuit diagram can be seen that the rotary encoder is connected to PB6 and PB7. The author used a SW-ROT-02 made by Voti, which has a built-in push button that is used here for the MUTEONOFF function. If you decide to use a different type of encoder you should make sure that it is connected according to the example circuit given with Bascom (this is found in the Help file under ‘encoder’). When the circuit is switched on, port PBO puts aBS170(Ql) into conduction. This then pulls the cathode of the LCD backlight to ground, as well as the cathodes of the two NEC PS710B-1A solid-state relays. In this way the sym- metrical supply is turned on for the analogue board. In the circuit there are also several slave connections for both 12 V as well as 5 V (note that for the 5 V the ground connection is switched!). These connections are used by the author to drive relays, which turn on a power amplifier and an optional A/D converter. A standard IR receiver takes care of the reception of infrared signals. It is connected to pins IRIN, IRVS and IRGND. The IR data goes to PB5 of the ATmega. The voltage regulators for the sym- metrical supply are also on this board. They consist of an LM317 and a 7912. With the use of preset TR2 the +12 V line can be adjusted, making the sup- ply exactly symmetrical. There is also a separate 5 V regulator for the con- troller and the LCD. If there is a jumper across JP1 the voltage for the 7805 will be derived from the LM317. In that case there will be a voltage drop of 7 V across the 7805 and this would have to dissipate a lot of heat. A good heat- sink is therefore a must. It is also pos- sible to connect the 7805 to a separate 9 V supply via pin 2 of JP1. This supply would have to be on at all times, other- wise the preamp couldn’t be turned on or off via the remote control. Should, for some reason or other, the supply fail then all settings will be saved in the internal NVRAM of the ATmega (Bas- com: ERAM). As you can see, there are many options for the power supply. The two NEC PS710B-1A relays aren’t strictly neces- sary (they can be left out and replaced by a wire link across pins 4 and 6), but then the 12 V slave function will no longer be available. For the power supply a small mains transformer with a secondary of 2x12 V/7 VA is sufficient, along with a bridge rectifier and a few electrolytic capacitors. The source code is, as mentioned earlier, written in Bascom and can be freely downloaded from the Ele- ktor website as file # 090241-11. zip. r — — — — — — — - - - — — — — - - - — - n i p s : • Display lighting: For standard i green backlights the voltage drop across ( i the LEDs is about 4 V. For white back- i lights this is significantly lower at about i 3.2 V. Refer to the datasheet to find the i 1 exact voltage and adapt the value of R1 1 accordingly. • LED drivers: If you prefer to use i LEDs that require a larger current you'll i 1 find that connections have been made 1 available for this on the analogue i board. In this case they're driven by a i BS1 70, along with the associated relay i (max. 500 mA). ( • Take care that the AD5290 100K i digi-pots get the correct supply voltages, i They are extremely sensitive to this! It will i be catastrophic if one side of the sym- | 1 metrical supply isn't connected! 1 i • If you make IC4 and IC5 amplify, i remember that you may have to add i a small capacitor across the feedback i 1 loop to prevent oscillations. 1 1 • You should also bear in mind that not > all types of opamp remain stable i when configured as voltage followers i 1 (such as the well-known OPA627). In 1 that case you will need to add a com- i pensation capacitor, or you could make i the opamp amplify the signal a little bit. 1 • Programming: The ATmega8 has a 1 i fairly large number of fuse-bits. If you're i not fully familiar with these, it would be i a good idea to program the chip first in i a separate programmer with a TQFP32 | 1 adapter and only then solder it onto the 1 board. • If you do want to program the AT- i mega8 on-board, remember that the i 1 IR receiver and the connections to the 1 analogue board use the same pins as i the ISP, so should not yet be connected. i i • From the Bascom source code can be i 1 seen that the code for the mute com- 1 mand from the remote control is set i to 5 instead of the usual 1 3. This was i done because the author's universal re- i mote control didn't have a mute function | 1 in hifi mode. To get round this, the but- 1 ton for input-5 was redefined as a mute i button. i i • Compiling the program yourself | 1 has the advantage that you can customi- 1 se the names of the inputs to your own i liking. This also applies to the sensitivity i of the rotary encoder in relation to the i volume. L__ __ __ __ __ _J 10/2009 - elektor 69 READERS' CIRCUITS Figure 3. An example of an A/D board with a CS8416, which provides three digital inputs. It’s extensively documented by the author, which should make the code easy to follow. The code is too big for it to be compiled with the freeware ver- sion of Bascom, but this shouldn’t be a problem considering the low cost of a licence. Analogue section Everything needed to process the audio signals can be found on the ana- logue board. At the right of the circuit diagram (Figure 2) you can see the four stereo inputs along with the relays used to select them. At the centre are the two digital potentiometers made by Analog Devices. ICla and IC2a are both configured as voltage followers and are used to buffer the chosen input before it goes to the input of the de digital potentiometer. The input impedance of all inputs is set to 47 kQ with the help of a number of resistors connected directly to the inputs (R1 to R8). R9 and RIO on the non-invert- ing inputs of ICla and IC2a have been Figure 4. Several examples of the display output: a. set the name of an input b. preset the volume for an input c. show the volume level. added to prevent drift. There are no decoupling capacitors anywhere in the signal path. In the prototype wire links have been used for C13 to C20, but these can be replaced by capacitors if you do not need DC coupling (this also depends on the output configuration of the connected audio equipment). The selected input signal also goes to buffers IClb and IC2b. The output signal of these opamps can be used to drive a headphone amplifier or to pass the audio signals to another room. These outputs could also be used as a Record Out, but this function will rarely be used these days. The 100 Q resistors (R19 and R20, as well as R22 and R23) are compensation resistors for longer cables. They also protect the opamps against momentary shorts on the outputs. IC4 and IC5 buffer and amplify the out- put signals from the digital potentiom- eters, from where it goes to the power amplifier. There are a number of resis- tors (R15/R17/R13, R16/R18/R14) in the circuit that can be used to make the opamps amplify the signal, but in the original configuration this option wasn’t used (wire links for R15 to R18, R13 and R14 are left out). The total volt- age gain of the preamp is then 0 dB, which is a good value for use with modern audio signal sources. The types of opamp used are OPA604 and OPA2604 (since the author had some available), which provide good quality audio signals. It is of course possible to use other (pin-compatible) types. All inputs work at line levels. If you want to connect a record player you’ll need an extra phono preamp, but that should be fairly obvious. Analogue and digital inputs Since the author regularly thinks of modifications and enhancements for his designs, he has added a number of headers and jumpers to the circuit to permit various configurations and expansion options. The settings are as follows: Input 1 is always an analogue input and can’t be changed. If you require 4 analogue inputs you should use the following jumper settings: JPIN2-1, JPIN2-2, JPIN2-3 = short pins 1&2 JPIN3-1, JPIN3-2, JPIN3-3 = short pins 1&2 If you also want a digital input you can add a DAC board and connect its outputs to input 4 (connector JPDAC). 70 elektor - 10/2009 You’ll then have three analogue inputs and one digital input available. But this can be taken one stage fur- ther. With a CS8416 digital audio inter- face receiver it is possible to set it to hardware mode and use the RXSELO and RXSEL1 pins to drive the internal S/PDIF input multiplexer. In this way you can select one of the four digital inputs (RXPO to RXP3). (Refer to the JPIN3-3. When input 3 is selected, RXSELO = 0 and RXSEL1 = 1. And when input 4 is selected, only K4 turns on and RXSELO = 1, RXSEL1 = 1. In that case input RXP3 of the CS8416 is selected. Bear in mind that analogue inputs 2, 3 and 4 are no longer availa- ble in this configuration, since they’ve been ‘replaced’ by the digital inputs of the CS 84 16 in Figure 3. front panel for the buttons, display and IR receiver. The board with the analogue circuit is mounted at the back of the case, so that the phono sockets poke through holes in the back. You can use rib- bon cable for the wiring between the boards, since no audio signals are car- ried across them. v r.ur iq * | 00 12/0 Kf rl a £ a - £i - GMifrw wcm hVF FJ4 M “ • 1 ‘ 5 * 4 1 “ * | i - .*• ^ V " j . M i nt_ * ** r ■ 'ia M ■- I ;i[" i .. r > a. ‘ 0012/Q2CS Priifspg. 5000V i H 09-05 5- V cz -■ 4 0 -4 0 CI C4 TD ) y ) > V ! Figure 5. A quick look at the prototype. At the back on the right is a small D/A converter made by AMB (Y1 DAC, see www.amb.org). example of such a circuit in Figure 3.) If we now move the jumpers on JPIN2- 1, JPIN2-2 and JPIN2-3 such that pins 2&3 are connected, the switch signal for input 2 will be connected via D6 to relay 4. This means that when input 2 is selected it will drive both relay 2 as well as relay 4. The audio output of the DAC will then be connected to ICla and IC2a via K4 and K2 ensures that the RXSEL1 pin of the CS8416 is pulled low via JPIN2-3. The result: RXSELO = 1, RXSEL1 = 0 and the respective dig- ital input in Figure 3 is selected. The same applies to JPIN3-1, JPIN3-2 and Practical construction The author has designed PCBs for both circuits, which can be downloaded from the Elektor website (Eagle format, file # 090241-1. zip). The construction of the preamp is quite straightforward, and the photos of the prototype can be used as guidelines. The enclosure for the circuit can be fairly small. The controller board is mounted behind the front panel, where the rotary encoder, the setup switch, the four input selec- tion buttons and the display are. You will need to make suitable holes in the In the middle of the case there should be room to mount a mains power sup- ply, which could easily fit on an experi- menter’s board. Do make sure that you keep a sufficient isolation clearance between the primary and secondary sides! ( 090241 - 1 ) 10/2009 - elektor 71 The upgraded Elektor- PLUS subscription Elektor PLUS advantages o All 1 1 issues including the Summer Circuits edition O Included in your PLUS subscription: Annual DVD 2009 o 20% cheaper than normal retail price Welcome gift worth £25 o Up to 40% discount on selected Elektor products o Elektor is delivered to your doorstep every month Read your copy before everyone else NEW: On your personalized Elektor PLUS website, you have permanent access to the three latest issues of the magazine in PDF format, as well as to a fast Elektor search engine! www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 Online instant access to the recent three editions o Extensive searching in all editions o Extra articles and free E-books ✓ ■trKTQl'fWf.raH - HkJshi*. U mn iwi C ■' U-j «** H^r.y >^1^ r3lektor-plus k ftJHenwK 1 Aiwvm jmi HOW, THERE'S EVEN MORE TO DISCOVER. Eiltfd 'fir HiSB Ui* 4 cdm la E iiUar FilrM ■aVB^ir^nau^hln-.nUl. w %«l n> nuf rskJ «r> »Wi PUA SuMOT draft. C W H ■»« MW.N i* -4 Lfi m n m hrt i "ufuc h>j» I#rr mal* k MAI Hi *lAfl wwipi m T’#-’ ir ■ II U •¥ P» Th* P4Uw I Pip-f AvtrCh 12 fMr* Ct#hl«f «»!.»•_ I * (HOT *- ISr A HGH I UWM F W^TT Ml ! BT - if ... soon to come: more extras, offers and bombshells ■ ‘—»wi!irs Nh ncni ■ J wwsrf Ufa’ %. fH r -i*l 4M *V 3d« Mlb t*f *** KLTb h.M -'U-i UWV M *W*NI ■*«'> n b “*b ■■P 1 i i i -in i **k»w rH % I lii i lh H-r* b^t- a When taking out an Elektor PLUS subscription you get exclusive access to the new website www.elektor-plus.com where the three latest editions of Elektor magazine are available in the form of pdf files (i.e. the current issue and the two preceding ones). With a simple click you download the com- plete issue (front to back!) or any single article, www.elektor-plus.com also supplies the most exten- sive Elektor search engine found on the web. However the upgraded PLUS subscription offers many more interesting extras like free E-books and supplementary articles. Or use the subscription order form near the end of the magazine. INFOTAINMENT PUZZLE MayaHakm p™*!® wi* m* I lVyA WvJUr\L4 electronics touch As usual, "towards the back of the magazine" we present a new instalment of our popular Hexadoku puzzle. Put electronics formulas out of your mind for a change and take on a different challenge. Send your solution to Elektor and enter a prize draw for an E-blocks Starter Kit Professional and three Elektor Shop vouchers. Have fun! The instructions for this puzzle are straightforward. In the diagram composed of 1 6 x 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 in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle and these determine the start situation. All correct entries received for each month's puzzle go into a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. The puzzle is also available as a free download from the Elektor website SOLVE HEXADOKU AND WIN! Correct solutions received from the entire Elektor readership automatically enter a prize draw for an E-blocks Starter Kit Professional worth £300 and three Elektor SHOP Vouchers worth £40.00 each. We believe these prizes should encourage all our readers to participate! The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses. PARTICIPATE! Please send your solution (the numbers in the grey boxes) by email to: hexadoku@elektor.com - Subject: hexadoku 10-2009 (please copy exactly). Note: new email address as of this month! Include with your solution: full name and street address. Alternatively, by fax or post to: Elektor Hexadoku Regus Brentford - 1 000 Great West Road - Brentford TW8 9HH United Kingdom - Fax (+44) 208 2614447 The closing date is 1 November 2009. PRIZE WINNERS The solution of the July/August 2009 Hexamurai is: BCE56. The E-blocks Starter Kit Professional goes to: Arwin J.Vosselman (Netherlands). An Elektor SHOP voucher worth £40.00 goes to: Dominik Johe (Germany), Gareth Hayes (United Kingdom) en Michel-Hugues Michel (France). Congratulations everybody! 1 2 B A 8 C F E 6 3 E B F D 5 7 9 0 D 4 5 A 6 8 F 2 3 C 9 E 4 B 9 F 3 6 8 0 B 1 C E 9 1 D 7 4 E 6 C 0 7 A 2 B F 9 C 0 1 7 E A F 8 6 1 8 D 4 1 5 2 0 B F A 7 9 6 8 4 6 F 1 B 4 0 A 7 0 A 6 2 9 4 B 3 B 4 3 7 8 D 1 6 8 0 3 9 5 3 7 8 5 A E D 2 0 (c) PZZL.com 6 7 4 D 9 B 0 1 5 3 A E 8 F C 2 5 6 7 0 A 9 E 3 Q 1 B D C A F E 9 2 0 E 3 A 8 4 D C F 7 5 1 B 6 2 8 4 E D 7 C F O 3 A 9 5 8 6 1 A C 1 B 5 F 2 7 9 4 8 6 0 E D 3 F 9 1 A 2 5 B QcQ 8 6 2 B D 0 F 3 5 CO O g D 6 1 2 B 0 A 9 7 4 B 3 D C 0 6 8 i F 5 E 2 3 7 9 4 2 E D 7 1 0 3 8 F A C B 9 4 6 5 3 2 B 8 1 C F A 7 E D 0 9 5 A 2 C 9 6 0 F 5 7 A 8 D 3 4 B 2 E 1 D F C 9 7 3 0 8 A 6 5 4 F C 3 B 1 B F A D c 4 E 6 5 2 9 7 8 0 A 4 E 6 9 D 5 B 2 F 1 C 8 0 4 7 5 8 3 4 6 2 9 B 7 0 E 1 D F A 1 0 5 7 4 E 2 6 3 B 9 8 1 _6_ E D 4 F E 6 8 7 A D 3 9 C 2 5 B E D 6 1 F A 7 9 8 4 C 3 : 0 2 5 7 5 2 C B 4 1 9 E 6 3 D 9 5 8 B 6 2 4 C E 0 7 1 3 F D A B A 8 1 0 3 C 2 4 F 5 D E 6 9 7 4 C 2 EIH 8 1 0 D A F B 6 E 9 7 0 D 9 3 E 6 F 5 2 B 7 A 1 _8_ 4 C 7 A oQB B _3_ D _9_ 2 _6_ _5_ 8 4 1 C 8 0 7 9 A D 5 3 C 1 6 F 4 B 2 E 8 B □□ 0 5 3 6 D 7 A 2 C F E 6 C 5 4 8 B 0 A 7 9 2 3 D 1 F 2 F A 7 C E D 8 B 1 9 4 0 6 5 3 3 4 A F 2 1 E C B 8 D 5 6 7 0 9 5 6 3 9 2 4 B F A C 0 7 8 1 D 1 B 2 7 9 6 F 0 E 4 3 C 5 A 8 C 0 1 D 3 6 A 7 5 8 2 F 4 9 E B B 3 C A 9 D F 2 6 7 5 0 E 1 4 8 D 4 F 5 0 3 8 6 1 E A 2 7 C B 9 1 E 7 2 B C 5 A 4 3 8 9 F D 6 0 6 8 9 0 7 1 E 4 F D B C 5 3 A 2 3 7 B 8 4 0 C E 2 5 1 D 9 A F 6 F 1 4 E A 5 2 B 7 9 3 6 C 8 0 D A 9 5 C D 7 6 1 0 F E 8 2 B 3 4 0 2 D 6 8 F 9 3 C B 4 A 1 5 7 E _F 6 C 1 B_ DEI 987 B 3 9 5 6 D E A 2 C 7 4 0 F 74 elektor - 10/2009 Prototype & small series PCB specialists CIRCUITS Instant online pricing and ordering Low order-pooling prices - 1-8 layers Full options service On demand - 1-16 layers Deliveries from 2 days Stencil service I Learn today. Design tomorrow Stand 430 Farnborough * October 6 - 8, 2009 FIVE International Show Centre UK - 2 boards in 2, 3 or 5 days - No tooling charge - Low PCB-Proto prices E.g. 2 x 100 x 80 mm: 2 layers 38.12C each* 4 layers 77.23C each* - Immediate online ordering - No minimum order charge *excluding transport and VAT www.eurocircuits.com Call us: 020 8816 7005 Email: euro@eurocircuits.com Tel: 01635 40347 Newbury Electronics Ltd Fax : 0l 635 361 43 Faraday Road Newburv Eerks RGl & 2A0 e-mail: circuits@riGwbury.tcQm.co.uk www.nGwburyelGctrcTiies.CD.uk smom nurve neTiuoncs i_t_c X.CSSBEffl XGS Gamepad Controller. 325+ Page Printed Manual.^ Atmel AVR ISP MKII Programmer 9V Power Supply & A/V Cable, ^ PC Serial Port to XGS Converter. \PC DVD-ROM. ( 1GB Micro 5D Card + Adapter. Sonus; eBooks on Hardware, " Game. Con so leDes i g n ,_a n d M ore j The Most Complete Atmel MEGA AVR Dev Kit Available! WWW. X G A M E STAXLO N .O □ M ■a 10/2009 - elektor 75 INFOTAINMENT RETRONICS Philbrick K2-W, the mother of all op amps GAP/R vintage K2-W, K2-X and K2-P op amps. (Author's collection) Embree Electronics C/50 op amp (opened up for curiosity), GAP/R 'Computor' tube and GAP/R 'Airpax' A-175 DC-to-AC chopper. (Author's collection) By Jan Didden (The Netherlands) One popular belief among the all-transistor generation of elec- tronics enthusiasts is that opera- tional amplifiers (op amps) came after engineers learned to put many transistors on a chip car- rier. In fact, op amps are much older. As with many technologies, the development of op amps was initially strongly driven by mili- tary requirements. World War 2 saw developments in largely mechanical contraptions for mathematical problems like aiming anti-aircraft guns and calculating the optimum point to release bombs over enemy tar- gets. Functionally, the devices consisted mostly of amplifiers, integrators and differentiators; very complex instruments com- prising, for instance, gear wheels with logarithmically-arranged cogs. These were phased out gradually and replaced with electronic function blocks called operational amplifiers: amplifier blocks that could be configured to perform an operation: ampli- fication, summing, differentiation and integration to name just the simplest ones. The first op amp type circuit design published was probably by Lovell and Par- kinson of Bell Labs for the M 9 anti-aircraft gun director built by Western Electric. Later on, Loebe Julie at Columbia University con- sulted for the George A Philbrick Researches company (GAP/R), to develop the electronic mod- ule for a bombing simulator which GAP/R was developing for the US Armed Forces. It was Philbrick who saw the commer- cial potential, and from 1952 GAP/R offered its op amps for commercial use as well. The first device was the K2-W shown in Figure 1 . To this day the circuit configuration is the basis of many high-gain, balanced-input circuits including the balanced differen- tial stage, cathode-coupled with a large cathode resistor acting as a current source. A differen- tial-input signal unbalances the differential pair and causes a differential output signal at the anodes. The second pair buffers this signal with cathode-follow- ers and provides a single-ended output. Later circuits improved on this with, for instance, a real current source to bias the input pair (which came to be known as a 'long-tailed pair') and differ- ential outputs, see Figure 2. For amusement only, if you compare this to the circuit in Figure 3 of an NE5532 op amp, the pedi- gree is clear. The K2-W used bipolar sup- plies of ±300 V. The output could swing about ±50V peak, and in this spec at least mod- ern op amps are a big step backwards! Other specs were not so hot. The bandwidth was about 100 kHz with a 2 ps rise time, and an open-loop gain of 15,000. R out was specified as about 1 kOhms. But the specs itself were of lesser importance compared to the concept behind these units. K2- W's were built as plug-in units that could be configured for a specific function by the user: real operational amplifiers! They were generally not supposed to be used open-loop, but with a feedback circuit to obtain the desired transfer function. Just like today's op amps, several dif- ferent versions were developed Fig 1. GAP/R K2-W opamp schematic diagram. You could easily build this yourself. 76 elektor - 10/2009 that had slightly different specs for different tradeoffs in the final product: after the K2-W came the K2-X, K2-XA and the K2-P. The K2-XA had double the speed, double the bandwidth, double the output swing and double the gain of the K2-W. These op amps all shared the same base socket connections and could be freely interchanged, similar to today's 'universal' op amp pinouts. The tubes used in the Philbrick units were dual triodes of the 1 2AX7, 12AU7 12AT7 (ECC83, ECC82, ECC81) family. There were also some specialised plug-in units like mechanical choppers that could take the place of the first double triode to make the unit into a DC amplifier. Philbrick also selected tubes for tighter specs and these were stamped with the company name and the indication 'Computor Tube'. GAP/R consequently used 'com- putor' in these days, not 'compu- ter'. A wealth of information on these and other Philbrick prod- ucts may be found at Joe Sou- sa's site [2]. With the success of these op amps, competitors tried to jump the bandwagon, of course. One outfit, Embree Electronics Corp. offered the C/50/BP, very similar to the Philbrick units, except that mechanically it was different, and it could be opened up for repair if necessary. Philbrick's units could not; apparently they had enough trust in their products to believe that repair would not be necessary over the lifetime of the unit, or maybe the price was low enough (for the military) to treat it as a consumable rather than a repairable item. Another similar- ity to modern 1C op amps. GAP/R took the concept one step further and developed a sort of universal unit that would take up to three op amp plug-ins plus an additional tube, the K3. This unit offered a higher level of integra- tion and was actually called an 'analog computor', see [1]. With the development of the op amp, application notes and books on how to use them started to appear as well. One early GAP/R engineer, Bob Pease who until recently worked at National +300 Figure 2. Tube-based 'long tailed pair'. Figure 3. Internal schematic of the industry standard NE5532 monolithic opamp. Figure 4. Using op amps to obtain the logarithmic of an input signal. Semiconductor, wrote Philbrick's very first application note num- bered 'R1 '. Bob's stories about his early years at GAP/R can be found at [3]. Capt. Clarence L Johnson, an engineer with the US Air Force and Professor at the Depart- ment of Mathematics at the Air Force Institute of Technology, wrote "Analog Computer Tech- niques", published in 1956. This book gives a fascinating insight into the use of op amps to actu- ally 'simulate' (as it was called) electromechanical problems, as well as their use in complex con- stellations of electromechanical servos and electronic op amps. Figure 4 shows a simple cir- cuit to generate a logarithmic function. While the military prompted the developments of tube op amps, they could also be relied on to keep using them for a long, long time. The Nike anti-aircraft mis- sile system used tube op amps and wasn't scrapped from NATO inventory until the late 1990s. I found some NOS K2-W's gath- ering dust at a military depot/ repair unit that finally got rid of their stock in 2003. We often see the monolithic opamp as a revolution in elec- tronics. But with the concept of operational amplifiers firmly rooted in vacuum tube technol- ogy on the one hand, and the rapid development of the tran- sistor and the integrated circuit on the other, monolithic op amps were just the next logical step in a technological evolution, and perhaps less than a conceptual breakthrough. ( 090276 - 1 ) Internet Links m www.philbrickarchive.org/ k3_series_components.htm [2] www.philbrickarchive.org/ [3] www.national.com/rap/ Author email: jandiddenOl @gmail.com Further Reading Analog Computer Techniques, Clarence L Johnson, McGraw-Hill, 1 956 Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are welcomed; please send an email to editor@elektor.com 10/2009 - elektor 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 564999 Fax 0044 (0) 1 932 564998 AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BLACK ROBOTICS www.blackrobotics.com Robot platforms and brains for research, hobby and education. • Make your robot talk! • TalkBotBrain is open-source • Free robot speech software • Robot humanisation technology • Mandibot Gripper Robot ByVac www.byvac.com • PIC32 With BASIC • ARM With Forth • USB to I2C • Serial Devices • VT100 LCD Displays DECIBIT CO.LTD, www.decibit.com • Development Kit 2.4 GHz • Transceiver nRF24L01 • AVR MCU ATmega168 DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0)1872 223306 EASYDAQ www.easydaq.biz • USB powered, 4 relays + 4 DIO channels MM! pnldmiK hM »IL |M> • Will switch 240VAC @ 1 0 a • Screw terminal access • LabVIEW, VB, VC • Free shipping • From £38 Design & supply of USB, USB Wireless, Ethernet & Serial, DAQ, Relay & DIO card products. info@easydaq.biz EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • device programmer manufacturer • selling through contracted distributors all over the world • universal and dedicated device programmers • excellent support and after sale support • free SW updates • reliable HW • once a months new SW release • three years warranty for most programmers FIRST TECHNOLOGY TRANSFER LTD. FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB HRMEB Instruments A Rohde & Schwarz Company 0 Oscilloscopes 0 Power Supplies 0 Radio Frequency Measuring Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com HEXWAX LTD www.hexwax.com World leaders in Driver-Free USB ICs: • USB-UART/SPI/I2C bridges • TEAleaf-USB authentication dongles • expandlO-USB I/O USB expander • USB-FileSys flash drive with SPI interface • USB-DAQ data logging flash drive http://www.ftt.co.uk • Training and Consulting for IT, Embedded and Real Time Systems • Assembler, C, C++ (all levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas,TI, Freescale • CMX, uCOSII, FreeRTOS, Linux operating systems • Ethernet, CAN, USB, TCP/IP, Zigbee, Bluetooth programming 9 First Technology Transfer ltd. LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and GCEs). Also Technical Management and Languages. IIE FLEXIPANEL LTD www.flexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors LCDMOD KIT http://www.lcdmodkit.com Worldwide On-line retailer • Electronics components • SMT chip components • USB interface LCD • Kits & Accessories • PC modding parts • LCD modules *** U2&WC-.TL 20 CQlufert# s 4 *■ r±J ^ -'USB Ki*ri ID a I 78 elektor - 10/2009 products and services directory www. elektor. com MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes RFID COMPONENTS http/www.apdanglia.org.uk For DIY, OEM's & Experimenters • EM4100 Cards .99 p (Prices inc vat) • Keyfobs £1 .09 • R/W Keyfobs £1 .65 • RFID Coils £2.95 • RFID PCB with RS232 port • RFID IC’s EM4095 - U2270B • microRFID module (similar to Core ID12) • Free Reader download - Technical pages Order online 24 hrs - Tel: 01 244 520684 ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! • MeccanoTM Compatible • Computer Control • Radio Control • Tank Treads • Hydraulics Internet Technical Bookshop, 1-3 Fairlands House, North Street, Carshalton, Surrey SM5 2HW email: sales@robotiq.co.uk Tel: 020 8669 0769 www. elektor. com USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. CANDO - CAN BUS ANALYSER http://www.cananalyser.co.uk • USB to CAN bus interface • USB powered • FREE CAN bus analyser • Receive, transmit & log. CAN messages • IS011898 & CAN 2.0a/2.0b compliant • Rugged IP67 version available 0ne.ronics SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £242 + VAT (£22 per issue for eleven issues) Elektor will publish your company name, website address and a 30- word description For £363 + VAT for the year (£33 per issue for eleven issues) we will publish the above plus run a 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, first served basis. So-please fax back your order today! _ I wish to promote my company, please book my space: • Text insertion only for £242 + VAT • Text and photo for £363 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION 10/2009 - elektor 79 BOOKS, CD-ROMs, DVDs, KITS & MODULES A world of electronics from a single shop! Look into the electronics of eco-power Practical Eco-Electrical Home Power Electronics This book "opens the hood" and looks into the electronics of eco-power. Explained from circuit dia- grams of commercially-available products are the electronics of affordable eco-electrical power components such as solar chargers, battery inverters, and off-line chargers. Not only are circuits analysed in detail, design modifications are presented, and basic design principles applied so that you can do your own improvements and achieve high performance at low cost. The effects of vari- ous kinds of loads on the power distribution lines reveal potential problems and insights. Included are power circuits useful to homesteaders, such as LED and fluorescentlamp drivers, optimal wind converters, and improved system-level architecture for eco-power. The book ends with an alterna- tive solar power technique based on thermal instead of photovoltaic conversion, using thermoelec- tric modules, and storing energy in a tank instead of batteries. 192 pages • ISBN 978-0-905705-83-5 • £24.90 • US$39.90 0tektor Home electric power Your own Eco-Electrical Home Power System This book provides the semi-technical, power-conscious homeowner a place to begin in the quest for home electric power. Both the essential principles and detailed information on howto build or maintain a home electric system off the utility grid are presented in an easy-going style. This booklet will help you to safeguard or develop your own home electricity supply. It contains step-by-step calculations, prac- tical details, examples, electric system problems with emedies and much more. 96 pages ' ISBN 978-0-905705-82-8 £16.50* US$26.00 Bring your microcontroller to life Artificial Intelligence This book contains 23 special and exciting artificial intelligence machine-learning projects, for microcontroller and PC. Learn howto set up a neural network in a micro- controller, and how to make the network self-learning. Or discover how changing a fitness function results in a totally different behavior. Several artificial intelligence tech- niques are discussed: expert system, neural network, subsumption, emerging behav- ior, genetic algorithm, cellular automata, roulette brains etc. 256 pages • ISBN 978-0-905705-77-4 £32.00 • US $46.00 v J V J Prices and item descriptions subject to change. E. & O.E 80 elektor - 10/2009 Learn by doing C Programming for Embedded Microcontrollers If you would like to learn the C Program- ming language to program microcon- trollers, then this book is for you. No pro- gramming experience is necessary! You'll start learning to program from the very first chapter with simple programs and slowly build from there. Initially, you pro- gram on the PC only, so no need for de- dicated hardware. This book uses only free or open source software and sample pro- grams and exercises can be downloaded from the Internet. 324 pages • ISBN 978-0-905705-80-4 £32.50 • US $52.00 310 Circuits Creative solutions for all areas of electronics 310 Circuits 310 Circuits, tips and design ideas in one book form a treasure trove for every area of electronics: audio and video, hobby and modelling, RF techniques, home and garden, test and measurement, microcon- trollers, computer hardware and software, power supplies and chargers - plus of course everything else that does not seem to belong in any of these categories. 3 1 0 Circuits contains many complete solutions as well as useful starting points for your own projects. 544 pages • ISBN 978-0-905705-78-1 £29.90 • US $45.00 Learn more about C# programming and .NET C# 2008 and .NET programming for Electronic Engineers This book is aimed at Engineers and Scientists who want to learn about the .NET environment and C# programming or who have an interest in interfacing hardware to a PC. The book covers the Visual Studio 2008 development environ- ment, the .NET framework and C# pro- gramming language from data types and program flow to more advanced concepts including object oriented programming. It continues with program debugging, file handling, databases, internet communi- cation and plotting before moving to hard- ware interfacing using serial and parallel ports and the USB port. It includes a hard- ware design for a simple oscilloscope us- ing a parallel port and interfacing to analogue and digital I/O using the USB port. This book is complete with many pro- gram examples, self assessment exercises and references to supporting videos. 240 pages • ISBN 978-0-905705-81-1 £29.50 • US $44.50 V J More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com 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 models, and for a selection of LED mod- ules, this Toolbox gathers together data sheets from all the manufacturers, appli- cation notes, design guides, white papers and so on. It offers several hundred dri- vers for powering and controlling LEDs in different configurations, along with ready-to-use modules (power supply units, DMX controllers, dimmers, etc.). In addition to optical systems, light detec- tors, hardware, etc., this DVD also ad- dresses the main shortcoming of power LEDs: heating. Of course, this DVD con- tains several Elektor articles (more than 1 00) on the subject of LEDs. ISBN 978-90-5381-245-7 • £28.50 • US$54.00 All articles published in 2008 DVD Elektor 2008 This DVD-ROM contains all editorial arti- cles published in Volume 2008 of the English, Spanish, Dutch, French and Ger- man editions of Elektor magazine. Using Adobe Reader, articles are presented in the same layout as originally found in the magazine. The DVD is packed with features including a powerful search en- gine and the possibility to edit PCB layouts with a graphics program, or printing hard copy at printer resolution. ISBN 978-90-5381-235-8 • £17.50 • US $35.00 81 10/2009 - elektor BOOKS, CD-ROMs, DVDs, KITS & MODULES DVD i-TRIXX Freeware Collection 2009 This DVD contains 100 nifty freeware applications, tools and utilities for the Win- dows PC. And as a free extra, it contains the full and searchable (!) i-TRIXX archive, with all the editions up until week 8 of 2009 from i-TRIXX, the e-magazine pub- lished by Elektor. Do you feel the need for a decent and reliable antivirus program? A bandwidth monitor which keeps track of your current up and download rate? An application for recording, editing and con- verting video to any conceivable format? Anonymous surfing from any internet access point from a USB stick? Checking, optimizing and cleaning up your com- puter? Keeping track of your privacy? You can expect that and much more in the i-TRIXX Freeware Collection 2009. 0BD Analyser NG (September 2009) The compact OBD2 Analyser in the June 2007 issue was an enormous success - not surprising for an affordable handheld onboard diagnostics device with automa- tic protocol recognition and error codes explained in plain language. Now enhan- ced with a graphical display, Cortex M3 processor and an Open Source user inter- face, the next generation of Elektor's stan- dalone analyser sets new standards for a DIY OBD2 project. The key advantage of this OBD2 Analyser NG is that it's self- contained and can plug into any OBD diagnostic port. Kit of parts including DXM Module , PCB SMD-prefitted , case , mounting materials and cable ISBN 978-90-538 1-244-0 • £27.50 • US $39.50 Completely updated Elektor's Components Database 5 The program package consists of eight databanks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. A further eleven applications cover the calculation of, forex- ample, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A colour band decoder is included for determining resistor and inductor val- ues. ECD 4 gives instant access to data on more than 69,000 components. All data- bank applications are fully interactive, al- lowing the user to add, edit and complete component data. This CD-ROM is a must- have for all electronics enthusiasts. Art.# 090451-71 • £84.00 • US$135.00 Experimenting with the MSP430 (May 2009) All the big electronics manufacturers su- pply microcontrollers offering a wide ran- ge of functions. Texas Instruments supplies handy USB evaluation sticks with related software for its low-cost MSP430 contro- llers. Unfortunately the I/O facilities are somewhat limited. These can be substan- tially enhanced with the help of the Elektor MSP430 board. PCB, populated and tested Art.# 080558-91 • £35.00 • US $55.00 Tl eZ430-F20 1 3 Evaluation Kit ISBN 978-90-5381-159-7 • £24.90 • US $39.50 Art.# 080558-91 • £24.50 • US $35.00 V V \ v Prices and item descriptions subject to change. E. & O.E The 32-bit Machine (April 2009) With this attractively priced starter kit you get everything you need for your first hands- on experiments with the new R32C/ 1 1 1 32-bit microcontroller. The power sup- ply is drawn from your computer via the USB connection, which simplifies things rather nicely. The starter kit consists of an R32C carrier board (a microcontroller module equipped with the R32C/1 1 1 chip) and a software CD-ROM containing the necessary development tools. As with the earlier R8C/1 3 Tom Thumb' project in Elektor Electronics (November 2005 through March 2006), the R32C carrier board is an in-house-development of Glyn, an authorised distributor for Renesas in Germany. R32C/1 1 1 Starterkit (32-bit-Controller- board & CD-ROM) Art.# 080928-91 • £27.00 • US$42.50 Automotive CAN controller (April 2009) Since cars contain an ever increasing amount of electronics, students learning about motor vehicle technology also need to know more about electronics and mi- crocontrollers. In collaboration with the Timloto o.s. Foundation in the Nether- lands, Elektor designed a special control- ler PCB, which will be used in schools in several countries for teaching students about automotive technologies. But it can also be used for other applications, of course. The heart of this board is an Atmel AT90CAN32 with a fast RISC core. Kit of parts, incl. PCB with SMDs p refitted Art.# 080671-91 • £52.00 • US $79.00 v y 82 elektor - 10/2009 A October 2009 (No. 394) £ US $ + + + Product Shortlist October: See www.elektor.com + + + September 2009 (No. 393) R32C Application Board 080082-71 .... Kit of parts including Application Board with SMD parts prefitted, plus all other components see www.elektor.com 080928-91 .... R32C Starterkit: Processor board populated and tested, Toolchain on CD 27.00 42.50 OBD Analyser NG 090451 -71 .... Kit of parts including DXM Module, PCB SMD-prefitted, case, mounting materials and cable 84.00 135.00 Battery Monitor 030451 -72 ....LC display 11.00 15.00 080824-1 Printed circuit board 1 2.90 1 8.75 080824-41 ....Programmed controller LPC21 03 16.50 24.00 July/August 2009 (No. 391/392) Luxeon Logic 081159-41 ....Programmed controller ATtiny25 6.40 10.50 Programmable Nokia RTTTL Player 090243-41 .... Programmed Attinyl 3 6.40 1 0.50 Breadboard/Perfboard Combo 080937-1 Printed circuit board 25.50 42.00 Annoy-a-Tron 090084-41 .... Programmed controller ATtinyl 3 6.40 1 0.50 Fan Speed Controller 070579-41 .... Programmed controller ATtinyl 3 7.70 1 2.60 Floating Message 080441 -41 .... Programmed controller PIC1 6F61 6 6.40 1 0.50 Pulse Clock Driver with DCF Synchronisation 090035-41 ....Programmed PIC16F648A 7.70 12.60 Frequency and Time Reference with ATtiny2313 080754-41 ....Programmed ATtiny2313, 20 MHz configuration 7.70 12.60 PIC Detects Rotation Direction 081164-41 ....Programmed PIC12F509A 6.40 10.50 Simple Temperature Measurement and Control 090204-41 ....Programmed controller ATmega48 7.70 12.60 Two-button Digital Lock 0901 27-41 .... Programmed ATtiny231 3 7.70 1 2.60 Full-colour Night-flight Illumination 080060-41 .... Programmed controller PIC1 2F675 6.40 1 0.50 Chill Out Loud 080700-41 ....Programmed controller PIC12F629 6.40 10.50 USB Radio Terminal 071 1 25-71 .... 868 MHz assembled and tested module 7.30 1 1 .90 080068-91 ....Assembled and tested R8C Board with USB 55.00 82.50 Digital Sweep and Sinewave Generator 080577-41 .... Programmed AT mega48-20PV 6.40 1 0.50 June 2009 (No. 390) Campsite AC Monitor 06031 6-1 Printed circuit board 21 .50 30.00 ATM18 = RFID Savvy 080910-91 ....PCB, partly populated PCB populated with all SMDs 16.50 26.00 May 2009 (No. 389) Experimenting with the MSP430 080558-91 .... PCB, populated and tested 35.00 55.00 080558-92 ....Tl eZ430-F201 3 Evaluation Kit 24.50 35.00 RGB LED Driver 080178-41 ....Programmed controller 8.90 13.75 April 2009 (No. 388) The 32-bit Machine 080928-91 .... R32C/1 11 Starterkit (32-bit-Controllerboard & CD-ROM) 27.00 42.50 Bestsellers 310 Circuits ISBN 978-0-905705-78-1 £29.90. US $45.00 n C# 2008 and .NET programming ISBN 978-0-905705-81-1 £29.50. US $44.50 3 Elektor Personal Organizer 2010 ISBN 978-90-5381-247-1 E24.90.....US $41.90 C Programming for Embedded Microcontrollers ISBN 978-0-905705-80-4 £32.50. US $52.00 Artificial Intelligence ISBN 978-0-905705-77-4.... £32.00. US $46.00 )VD LED Toolbox ISBN 978-90-5381-245-7 £28.50. US $54.00 ECD 5 ISBN 978-90-5381-159-7. £24.90. US$39.50 VD Elektor 1990 through 11999 ISBN 978-0-905705-76-7 E69.00.....US $99.00 DVD Elektor 2008 ISBN 978-90-5381-235-8 £17.50. US $35.00 DVD i-TRIXX Freeware Collection ISBN 978-90-5381-244-0 £27.50. US $39.50 MSP430 : PCB, populated and tested Art. # 080558-91 £35.00 .....US $55.00 USB Radio Terminal Art. # 071 1 25-71 £7.20. US $1 1 .50 MSP430 : Tl eZ430-F2013 Evaluation Kit Art. # 080558-92 E24.50.....US $35.00 ElektorWheelie Art. # 090248-71 E1380.00.US $2275.00 The 32-bit Machine Art. # 080928-91 E27.00.....US $42.50 Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! lektor SHOP Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH * United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com 10/2009 - elektor 83 INFO & MARKET COMING ATTRACTIONS NEXT MONTH IN ELEKTOR Blue LEDs fight winter blues During the wintertime many people suffer from tiredness and a general lack of energy. The effect is caused by lack of sunlight, among others. Recent studies indicate that these negative effects can be largely prevented by a controlled, daily dose of blue light. Our winter blues fighter circuit contains no fewer than 84 LEDs capable of emitting a considerable amount of blue light. Half an hour's exposure on a daily basis should be sufficient to make you feel better and fitter. The circuit contains a PWM system for the brightness control, as well as a programmable timer with a range of 4 to 30 minutes, not forgetting a display showing the remaining 'on' time. Soldering station with measurement function This project shows that it's still economical to retro-fit a simple temperature control to a common 30-watt solder iron. The core of the circuit is a PIC1 8F4520 microcontroller employing pulsewidth modulation to regulate the energy supply to the solder iron. Settings are shown on a two-line LC display. An additional feature of the circuit is its two measurement inputs allowing two direct voltages to be measured (0-10 V and 0-40 V) and of course displayed. These channels employ the PIC's internal A/D converters. R32C Webserver As promised in the September 2009 issue we'll present a small module for the R32C experimenter's board that's sure to extend the CPU's communicative skills considerably. We're talking about an Ethernet network module comprising a hard-wired TCP/IP chip with a 1 0/1 00 Mbit/s interface, a network connector with a transformer and status LEDs. The project enables a Webserver or another Internet application to be implemented without bothering about details like the TCP/IP protocol. Article titles and magazine contents subject to change, please check 'Magazine' on www.elektor.com The November 2009 issue comes on sale on Thursday, October 22, 2009 (UK distribution only). UK mainland subscribers will receive the issue between October 1 7 and 20, 2009. w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elek Elektor on the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you'll find all other products sold by the publishers, like CD-ROMs, kits and books. A powerful search function allows you to search for items and references across the entire website. Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact i ES * • Chop*. »r> option %| Informative «* Project. Ifcouki u ayovo-ftOMt v Kill A Mad ii tot y r-Norki y PCI* y CdrttrOii+rt y w Uektor Crtdtl a iutwcription. Or.e recorders capture road accident images Download rour Svemcr Circuits 2009 edition S J ^ « (l-TRIXX) The (lernal MS Dota logger feature, milion-erem stcrage capacity E cna free SMT Tool* wltfi «v«y ot«o Vi.lt China nWi Elektor Study trip to China 7-16 Noycmber 2009 Kit of parts ElektorWhee le t Inter y«ur (-mail addre... My Cl«!cter KUfctor PCS Sarvica Professional PCO. and Prototype. Irder yaur own deegn at the A •liking ga4ga* a Profiler I > to dd to a PRO nrWltr>g i A & Jh 84 elektor - 10/2009 Description Price each Qty. Total Order Code Practical Eco-Electrical Home Power System -wifll £24.90 Your own Eco-Electrical ^ Home Power System jtTI £i6.so Elektor Personal Organizer 2010 i^rgjni £24.90 310 Circuits £29.90 C# 2008 and .NET programming for Electronic Engineers £29.50 DVD LED Toolbox £28.50 Free Elektor Catalogue 2009 Sub-total Prices and item descriptions subject to change. The publishers reserve the right to change prices P&P without prior notification. Prices and item descriptions shown here supersede those in previous issues. E. & O.E. Total paid Name Address + Post code Tel. Email Date - - Signature ELIO Yes, I am taking out an annual subscription to Elektor and receive a free 2GB MP3 player*. I would like: I I Standard Subscription (11 issues) [ Subscription-Plus (11 issues plus the Elektor Volume 2009 CD-ROM ' — + exclusive access to www.elektor-plus.com) * Otter available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email Date - - Signature METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) □ Giro transfer □ test □ EUROCARD MasterCard 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.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com sales@elektor.com *USA and Canada residents should use $ prices, and send the order form to: Elektor US PO Box 876 Peterborough NH 03458-0876 Phone: 603-924-9464 Fax: 603-924-9467 E-mail: custservus@elektor.com METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) □ Giro transfer □ tst □ EUROCAR □ MasterCard 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.elektor.com subscriptions@elektor.com ELIO ORDERING INSTRUCTIONS, P&P CHARGES All orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. Online ordering: www.elektor.com/shop Readers in the USA and Canada should send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Elektor US for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £11.00 (Priority) HOWTO 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. 40209520 held by Elektor Electronics with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics. 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 source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 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 responsibility 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 advertisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. January 2009 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £49.00 £61.50 Surface Mail Rest of the World £63.00 £75.50 Airmail Rest of the World £79.00 £91 .50 USA £64.95 See www.elektor-usa.com Canada £75.95 for special offers HOWTO PAY Bank transfer into account no. 40209520 held by Elektor Electronics, with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics 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. 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 stu- dentship 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 after they have run for six months or more. January 2009 r Visit China with Elektor combine electronics and culture Elektor's next Study Trip to China is planned for \ Programme: - A visit to the China Electronics Fair in Shanghai - Shopping in electronics department stores - Company visits - Conference about doing business in China - Culture: The Great Wall, The Temple of Heaven, The Forbidden City, Tiananmen square and The Shanghai TV tower - A cycling tour through Beijing 7-16 November 2009. And you can join us! Check your diary today and visit the Elektor website for more detailed information. Further information at www.elektor.com/china Index of Advertisers Antex Electronics Ltd www.antex.co.uk. 13 APD, Showcase www.apdanglia.org.uk . 79 Avit Research, Showcase www.avitresearch.co.uk 78 Beijing Draco Electronics Ltd www.ezpcb.com 53 Bitscope Designs www.bitscope.com 2 Black Robotics, Showcase www.blackrobotics.com 78 ByVac, Showcase www.byvac.com 78 Decibit Co. Ltd, Showcase www.decibit.com 78 Designer Systems, Showcase www.designersystems.co.uk 78 EasyDAQ, Showcase www.easydaq.biz 78 Easysync, Showcase www.easysync.co.uk. 78 Elnec, Showcase www.elnec.com 78 Euro circuits www.eurocircuits.com 75 First Technology Transfer Ltd, Showcase . . www.ftt.co.uk 78 FlexiPanel Ltd, Showcase www.flexipanel.com 78 Future Technology Devices, Showcase. . . . www.ftdichip.com 78 Good Will Instruments www.gwinstek.com . 65 Flameg, Showcase www.hameg.com 78 FlexWax Ltd, Showcase www.hexwax.com 78 Labcenter www.labcenter.com. 88 Lcdmod Kit, Showcase www.lcdmodkit.com 78 London Electronics College, Showcase . . . www.lec.org.uk 78 Microchip MikroElektronika MQP Electronics, Showcase. . Netronics, Showcase Newbury Electronics Nurve Networks Parallax PCBCORE Peak Electronic Design Pico Quasar Electronics Robot Electronics, Showcase. Robotiq, Showcase Showcase Schaeffer AG USB Instruments, Showcase . Virtins Technology, Showcase www.microchip.com/8bit www.mikroe.com I/1X1/1/I/I/. /7?grp. COA77 www. cananalyser. co.uk www.newburyelectronics.co.uk . . . www.xgamestation.com www. parallax, com www.pcbcore.com www. peake lec. co.uk www.picotech.com/scope1 036 . . . www.quasarelectronics.com www. robot-electronics, co.uk www.robotiq.co.uk www.schaeffer-ag.de www. usb-instruments. com www.virtins.com . . .25 . . . .3 . . .79 . . .79 . . .75 . . .75 . . .31 . . .53 . . .42 . . .19 . . .47 . . .79 . . .79 78, 79 . . .53 . . .79 . . .79 Advertising space for the issue 19 November 2009 may be reserved not later than 20 October 2009 with Fluson International Media - Cambridge House - Gogmore 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. The latest version of the Proteus Design Suite harnesses the power of your computer’s graphics card to provide lightning fast performance. Together with unique transparency options it’s now easier than ever to navigate and understand large, multi-layer boards. PROTEUS DESIGN SUITE ■ Hardware Accelerated Performance. ■ Unique Thru-View™ Board Transparency. ■ Over 35k Schematic & PCB library parts. ■ Integrated Shape Based Auto-router. ■ Flexible Design Rule Management. ■ Polygonal and Split Power Plane Support. ■ Board Autoplacement & Gateswap Optimiser. ■ Direct CADCAM, ODB++ & PDF Output. ■ Integrated 3D Viewer with 3DS and DXF export. ■ Mixed Mode SPICE Simulation Engine. ■ Co-Simulation of PIC, AVR, 8051 and ARM7. ■ Direct Technical Support at no additional cost. All levels of the Proteus Design Suite include a world class, fully integrated shape-based autorouter at no additional cost - prices start from just £150 exc. VAT & delivery www. labcenter. cam Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com Visit our website or phone 01756 753440 for more details