July/August 2011 AUS$ 20.70 - NZ$27.50 - SAR 134.50 - NOK140 £7.20 Project Generator compendium of small lesion ideas, trivia & ti circuits www.elektor.com IM* T t 5 / n “3 “7 n ^ ✓ n / r rv a n • Lead-times from 8hrs • 1mm Prototyping service Low Cost - High Quality PCB Prototypes Easy Online Ordering • Full DRC included Optional Chemical Tin finish no extra cost Email: sale5@pcb-pool.com Free Phone UK: 0800 389 8560 www.pcb-pool.com Simply send your files & order ONLINE ■can 2006 Attaint @ I J >Wr\ I Earns INSTRUMENTS PULSGNIK Nc EccidVtluJ THE ORIGINAL SINCE 1994 ServicindyoUr complete PCB prototype nfeeds: Whatever project you decide to go for, you don't ever have to change your favorite compiler. The same comfortable and intuitive IDE will always be with you across different microcontroller architectures. We have been carefully planning backward compatibility for over 500 of our library functions, so you will be able to literally copy-paste your existing codes and build them with just a few adjustments. DEVELOPMENT TOOLS COMPILERS BOOKS www.mikroe.com Pages that generate projects Here you are — Elektor’s annual compilation of small pro- jects, ideas and designs tips, to which I’ve added “trivia” for the first time this year. The edition was formerly known as “Summer Circuits” and renamed “Project Generator” last year. If this is the first time you see this format of Elektor, rest assured that it’s been around since 1976 without so much as an attempt at imitation by any of our competitors. Yes, it’s unusual not just in terms of spanning two months (July and August), but also in size (120 pages instead of 88) and coverage (lots of projects in the making instead of all neatly finished and ready to replicate). Come to think of it, the grand total of items published in all of Elektor’s July / August editions should be of the order of 3,500. And there you have it: Elektor’s best selling edition of the year and a treasure trove for all of you stuck for ideas when it comes to designing-in, modifying or researching certain parts of a circuit, or just catching up on design approaches of the Third Kind (i.e. off the beaten track). Each small item between pages 16 and 90 is just begging for you to improve on, redesign, incorporate or analyse — helping you to generate your own project and perhaps get it published in Elektor. Like every year, our lab and editorial staff burned their midnight oil to get everything ready in time, but ultimately succeeded. A number of full-size articles were added to complement the compendium of small items. The Project Generator edition has traditionally been the place where readers have an opportunity to present their small projects (mostly in their own words) to members of the electronics community, cheerfully alongside some contributions from Elektor’s lab staff. In recent years contributors who actually make it to publication qualify for a small present. This year everyone got an LPCXpresso microcontroller development board kindly sponso- red by NXP. The very first Project Generator article on page 16 describes how to get started with this powerful development platform based on an ARM processor. Enjoy reading this extra-thick edition and let me know how many projects it was successful or unsuccessful in genera- ting for you. Jan Buiting, Editor Regulars & Full-size Articles Colophon 6 NXP mbed Design Challenge Winners 8 Hexley Ball wins first ever mbed competition 1 4 Pictures for the Masses 92 1 00 Mbit/s over Copper Wire 96 Rabbit RCM5600W Development Kit for Wi-Fi 1 00 There’s More than Sand in the Valley 1 02 Hexamurai Puzzle 1 08 Elektor Shop pages 112 Coming Attractions 116 PROJECT GENERATOR COMPENDIUM 201 1 Audio, Video & Photograph Audio Level Adapter 27 Electric Guitar Preamp, Mixer and Line Driver 87 Equalising HEXFETs 58 Sixties-style 40 W Audio Amplifier 42 Slave Flash for Underwater Camera 35 Video Switch for Intercom System 29 Voltage Limiter for Guitar Amplifiers 41 Computers, Software & Internet MicroSD Card Connectors 32 Repeatable COM Port Enumeration 60 Upgrade your USB Hub 17 Hobby, Games & Modellin Arc Welding Effect for Model Railway Layouts 32 Arduino Nano Robot Controller 25 Flat Battery Indicator 30 Jogging Timer 57 Morse Clock 19 RGB Solar Lamp 46 Roadwork Traffic Signals for Modellers 83 Tachometer Pulse Divider 29 Timer for Very Long Periods 22 Wire Loop Game 43 Zero-IC 24-LED Pulsed Light Cycle Light 88 CONTENTS Volume 37 July & August 2011 no. 415/416 Home & Garden 2/4/6-hour Timer 18 Automatic AC Power Switch for the Holiday Home 68 Cheapest Ever Motion Sensor 60 Protecting PE Water Pipes against Frost 89 Pump Controller with Liquid Level Detection 20 Small Lamp — Huge Bill 51 Tandem Doorbell 27 Twilight Switch 77 Water Level Detector 79 WAV Doorbell 38 Microcontrollers Arduino Shields 31 ATM18andThree 1 -Wire Thermometers 18 ATM1 8 Youth Repellent 40 Extra Port Connections for the R8C/1 3 26 Getting Started with your Free LPCXpresso Board 1 6 I2C User Interface 54 LED Chase 78 Make Your R8C/1 3 Speak CAN 86 MHz Oscillator using an ATtinyl 5 21 Mini Experimental Board for ATtiny45 75 Reanimating Probe for AVR \xC 69 RS-232 Level Shifter with Isolation 24 ‘SCAP’ AVR Programmer 34 Sceptre: Driving a Touch Screen Arduino-style 62 Time Transporter 47 Power Supplies, Batteries & Charqers Adjustable Low-Dropout Voltage Regulator 84 Constant Current Source 79 Current Source for Grounded Load 31 DC-DC Converter using LT1 376 63 Floating Supply for Panel Meters 76 High Voltage Generator 28 LM2931-5.0 is a Random Noise Generator too 22 Power Controller for Electric Convector Heaters 45 Power Supply with High Voltage Isolation 52 Regulator for Three-Phase Generator 56 Router UPS 49 USB Charger using Pedal Power 39 Emitter Follower Audion 77 Minimalist Dip Meter 70 Wideband Receiver for Spark Transmissions 59 Test & Measurement Battery Charge Monitor 66 Belgian Earth Fault Detector 43 I R Tester 51 Laser Level Detector 82 Measurement Filter for Class D 36 Oil Temperature Gauge for 1 25cc Scooter 71 Simple Low Cost Square Wave Generator & Tester 33 Triangular Wave Generator 58 Universal Tester for 3-pin Devices 90 Variable Voltage Injector 70 Miscellaneous Electronics & Design Ideas 70 A Solid-state Starter Relay 72 Analogue LED Chaser Light 53 Breakout Board for PIC1 0F2xx (SOT23-6) 56 Chaos Generator 44 Debouncer for 12V Contacts 82 Dog Whistle for Ronja 50 Experimental Hall Sensor 68 A Few DC Solid-state Relays 48 LED Multi-Flasher 46 Low-cost Wire Stripper 76 Maglev Demo 74 Make Your Own Solder Mask Overlays 64 Mini Flasher 67 NPN Relaxation Oscillators 80 OBD Vehicle Protection 1 7 Return of the Elex Prototyping Board 23 Ring Oscillator 61 Universal 3-wire Flasher Unit for Scooters 55 elektor international media bv Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. -v -KVJMi ■ L^vl- ua.ii- I U* 70+ page compendium of small circuits, design ideas, trivia & ANALOGUE • DIGITAL _ MICROCONTROLLERS & EMBEDDED AUDIO • TEST & MEASUREMENT Volume 37, Number 415/416, July/ August 2011 ISSN 1757-0875 Elektor aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+ 44 ) 208 261 4509, fax: (+ 44 ) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 11 times a yearwith a double issue forjuly & August. Elektor is also published in French, Spanish, American English, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Hettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff; Harry Baggen, Thijs Beckers, Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Design staff Christian Vossen (Head), Thijs Beckers, Ton Ciesberts, Luc Lemmens, Jan Visser. Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DTP: Ciel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com/subs 6 7/8-2011 elektor Elektor Proton Robot A versatile platform for learning and experimenting The Proton Robot from Elektor is a versatile platform that’s suitable for students, enthusiasts and professionals alike. The robot can operate with a variety of microcontroller families, and it supports a broad spectrum of sensors and actuators. What’s more, this robot can easily be extended in all sorts of ways! r Characteristics Ultrasonic distance sensor 8 LEDs in the mouth 8 LEDs in the body Piezoelectric speaker 3 infrared distance sensors Motor drive module 3 line detectors LED eyes 2 phototransistors 2 servomotors LCD Red and black buttons Audio module Gripper Ordering You can order the robot ready assembled and tested but also as a complete kit for DIY assembly. Complete kit : Body, head, audio, gripperand PIC or AVR control board to choose £1085 /US $1745 /€1249 Ready assembled and tested robot: Body, head, audio, gripperand PIC or AVR control board to choose £1475 /US $2375 /€1699 Further information, demovideo and ordering at www.elektor.com/Droton r Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form. Head Office: Elektor International Media b.v. P. 0 . Boxn NL-6114-ZC Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Distribution: Seymour, 2 East Poultry Street, London ECiA, England Telephone:+44 207 429 4073 UK Advertising: Elektor International Media b.v. P. 0 . Boxn NL-6114-ZC Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Email: t.vanhoesel@elektor.com Internet: www.elektor.com Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Elektor International Media b.v. and may not be reproduced or transmit- ted in any form or by any means, including photocopying, scan- ning an recording, in whole or in part without prior written per- mission from the Publisher. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guaran- tee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media b.v. 2010 Printed in the Netherlands elektor 7/8-2011 7 NP mbed DESIGN WINNERS Many design challenges ask participants to toss together some parts, blink a few LEDs, and write a bit of code for a shot at a prize. The NXP mbed Design Challenge 2010 published by Elektor and Circuit Cellar was different. It was administered for the higher purpose of encouraging designers around the world to help make embedded design a more accessible, productive, and community-oriented endeavor. The rapid prototyping revolution began back in September 201 0 when designers from such diverse locations as the United States, Germany, Australia, India, and Taiwan started working with their mbed NXP LPC1768 prototyping boards. The challenge was to use the board, the mbed online ‘Cloud’ compiler, and the mbed community resources to develop an innovative hardware- or software-based application. The project submission period ended February 28, 201 1 . Soon thereafter, the judges began scoring the projects on their technical merit, originality, usefulness, cost-effectiveness, and design optimization. Officially announced at the 201 1 Embedded Systems Conference in Silicon Valley, the judges’ results are final. Congratulations to all of the winners! (Vl)sualizer: A Smart Electronic Load The innovative mbed-based (Vl)sualizer is a lab instrument for profiling solar, chemical, and grid-powered energy delivery devices. The design enables you to examine an energy source’s voltage (V) and current (I) delivery ability. You can use it for a variety of other reasons as well: to calculate the load resistance into which a solar cell delivers maximum power; to measure and capture a battery’s amp-hour capacity; or, using pulsatile loads, to test conventional power supply voltage regulation accuracy. The mbed module in the design accepts input data from local and remote interfaces, commands the desired load current, and monitors operating conditions. Hexley Ball United States of America hexleyball@gmail.com For complete project entries visit: www.circuitcellar.com/nxpmbeddesignchallenge 8 7/8-2011 elektor NXP MBED DESIGN CHALLENGE WINNERS mbos: A Real-Time Operating System for mbed The purpose of this interesting project was to enhance the mbed environment with a real-time operating system. Designed especially for mbed, the ‘mbos* is a true preemptive multitasking RTOS that’s scalable to support virtually any project developed on the LPC1 768 platform. This fast RTOS enables you to streamline the development of both simple and complex applications. For example, it’s simple enough for a one- or two-task application but can also support as many as 1 00 tasks. Andrew Levido Australia andrew.levido@gmail.com mbo i urS i i)rtt nlfwi-U, uni nrpi-hjrcti-a ■ trcNte- "DJI ttjtd . mq Sinri uHm . jij'l mbei vad ■' rrjitjiljili i...rmaii.r urrpu-.srt’jv uhm atacLv" '.Bdr'bvi.r’ifii CteaIe 13 nui tul tunl Fsfi i! i .m i Cel ihft rj ar Itir rairrenr liial wiJ S?lPr urriy fuml uivrt? Sri Ihn pi 1 1 J y ii 1 r! ? n- r .ii it - ! Lnl- ur! C-BiPiisiier-^vsti:; Gil iJn pw tr -i I lln cuirsiiL la»> ■•Ml • , -i-r upivrfMH I'm ;r iv mil ur>:« 3 ;< l..m a' "tuik mm;rto j J ir i.L-i j*>y iLcjIta Uib i tK-; unp-hrlj lu Uib tuhiu IilL lidl i k ■ 3 pur :± i uni "m'i tfhainer araiourt** )oclt< er *ei, wlfnHfl h Half jrl r 1 1 . .'--c i;- | - — i _ tii rt-Ktnce ■ ■ wi a rt-K^ ra | i H ] .rtiijurct i-tf -fihirt-i I - * ui-; Eiak'i flpal c^crtt For complete project entries visit: www.circuitcellar.com/nxpmbeddesignchallenge CNC Panel Cutter You can use an mbed-based system to control a three- axis milling machine for cutting panels for electronic equipment. A smart alternative to a PC program, the self-contained controller enables you to run a milling machine either manually or automatically (following a script) without having to clutter your workspace with a computer. The design controls three stepping motors. Inside the controller are a power supply and a PCB, which carries the NXP mbed module plus the necessary interface circuitry and a socket for an SD card. James Koehler Canada jark@shaw.ca elektor 7/8-2011 9 NXP MBED DESIGN CHALLENGE WINNERS For complete project entries visit: www.circuitcellar.com/nxpmbeddesignchallenge QRSS Grabber QRSS is used by radio amateurs for transmitting slow Morse code from low-power transmitters and receiving them on special ‘grabbers’. This creative project features an mbed at the core of a QRSS receiver, which is an RF receiver that can digitize a small bandwidth of RF signals and send them to a server for processing into a spectrum image for real-time display on a website. Clayton Gumbrell Australia clayton@gumbrell.net IS AC Tester Safety is a top priority when working with electronics and circuits. The AC Tester is an isolated variable voltage power source that includes an electronic circuit breaker for testing and debugging equipment. An mbed controller displays voltage and current, and it controls the breaker’s trip point and response time. The inventive design also can display power factor, VA, and VAR. Kevin Gorga United States kgorga@stny.rr.com 10 7/8-2011 elektor NXP MBED DESIGN CHALLENGE WINNERS STN LCD Controller Library When rapid prototyping is a requirement, integrating a graphic LCD in a design can be problematic. It can cost time and money, especially because quality software libraries are scarce. This helpful project solves this problem by eliminating the need for an external LCD controller by implementing the control routine in software. The mbed communicates directly with the LCD driver ICs and handles refreshing the image at 60 Hz or more. The library supports monochrome and color LCDs and also includes experimental support for dual scan displays. Matt Bommicino United States of America matt@cafelogic.com menbed: A Universal Menu System Library The ‘menbed* is a universal menu system library for the mbed prototyping board. It enables you to quickly develop an easy-to-use menu system to interact with any other application software executing on the mbed. Helpful interactions include observing internal state variables or analog values, changing program parameters, and calling arbitrary functions. The menu hierarchy is fully customizable and can even be changed dynamically. Kyle Gilpin United States of America kwgilpin@gmail.com mbed Net Meter: A Wall Clock Display of Real-Time Network Traffic You can monitor network data with the mbed-based Net Meter. The clever wall clock-style design displays real-time Ethernet traffic data with three easy-to-read analog dials. The meter shows inbound and outbound data rates, as well as network bandwidth quota usage. The update rate for the ‘in’ and ‘out* meters is twice per second. The ‘quota* meter’s update rate is once every 8 seconds. Bruce Lightner United States of America lightner@lightner.net elektor 7/8-2011 11 ...for electronics ...for industrial control E-Blocks are small circuit boards each of which contains a block of electronics that you would typically find in an electronic or embedded system. There are more than 40 separate circuit boards in the range; from simple LED boards to more complex boards like device program- mers, Bluetooth and TCP/IP. E-blocks can be snapped together to form a wide variety of systems that can be used for teaching/learning electronics and for the rapid prototyping of complex electronic systems. Separate ranges of complementary software, curriculum, sensors and applications information are available. MIAC (Matrix Industrial Automotive Controller) is an industrial grade control unit which can be used to control a wide range of different electronic systems including sensing, monitoring and automotive. Internally the MIAC is powered by a powerful 18 series PICmicro device which connects directly to the USB port and can be programmed with Flowcode, C or assembly. Flowcode 4 is supplied with the unit. MIAC is supplied with an industrial standard CAN bus interface which allows MIACs to be networked together. Flowcode 4 is one of the world’s most advanced graphical programming languages for microcontrollers (PIC, AVR, ARM and, brandnew, dsPIC/ PIC24). The great advantage of Flow- code is that it allows those with little to no programming experience to create complex electronic systems in minutes. www.elektor.com/flowcode FLOWCODE NO CODING, NO LIMITS... L2 PLQWi lT tf Pi Flowkit provides In Circuit Debugging for a range of Flowcode applications for PIC and AVR projects: • Start, stop, pause and step your Flowcode programs in real time • Monitor state of variables in your program • Alter variable values • In circuit debug your Formula Flowcode, ECIO and MIAC projects 9 ■*. U I V; r T ■ ■ k .5 111 Tl * ,m_l ' ,Bt h'“ ji„, * « DDDD DOBS DBBO DQDQ iPkck Edited Karin ■ B I k 1 JiJlLi-L "1 irnni ■ j'5+ ^LiU ■ =nrM* - hB.nnii - |.«q|B * M* tl >**- New features in Flowcode 4 Flowcode 4 is packed with new features that make development easier including: • Panel Creator • Additional string functions • In Circuit Debug • Watchdog timer support • Virtual networks • New user interface • C Code customization • New components • Switch Icon • Fast USB development • Floating point Iraq I? Auto ^ t**k fljin T \ - \ ■ , i irv. *tmm III for robotics Formula Flowcode is a low cost robot vehicle which is used to teach and learn robotics, and to provide a platform for competing in robotics events. The specification of the Formula Flowcode buggy is high with direct USB program- ming, line following sensors, distance sensors, 8 onboard LEDs, sound sensor, speaker and an E-blocks expansion port. The buggy is suitable for a wide range of robotics exercises from simple line following through to complete maze solving. E-blocks expansion allows you to add displays, connection with Bluetooth orZigbee, and GPS. for USB projects ECIO devices are powerful USB programmable microcontrollers with either 28 or 40 pin standard DIL (0.6”) footprints. They are based on the PIC 18 series and ARM 7 series microcontrollers. ECIO is perfect for student use at home, project work and building fully integrated embedded systems. ECIO can be programmed with Flowcode, C or Assembly and new USB routines in Flowcode allow ultra rapid development of USB projects inclu- ding USB HID, USB slave, and USB serial bus (PIC only). ECIO can be incorporated into your own circuit boards to give your projects USB reprogrammability. More information and products at: www.elektor.com/eblocks NXP MBED DESIGN CHALLENGE Hexley Ball wins first ever mbed competition By Simon Ford (UK) As you have probably seen by now, the winning entry was an intelligent electronic load; an unassuming name for an engineering feat. The finished product is an eclectic mix of digital and analogue electronics, mechanical design and web design, all packaged to provide a totally professional and innovative product. Not to mention the comprehensive write-up that was submitted with it; very important to Circuit Cellar/Elektor as joint publishers. A real example of how it should be done. I was lucky enough to meet Hexley at ESC Silicon Valley 2011, where the results were announced and NXP had invited him to show off his design. It was wonderful to have the creator there in person to take me though all the features of what really is an impressive bit of kit; it uses just about every interface on the mbed to provide amazing levels of functionality. With every feature, my appreciation of quite how much engineering had gone in to this grew, as did my surprise to how it could all be hidden behind the title of “electronic load”. This was apparently the biggest response Circuit Cellar/Elektor have ever had to a hardware-supported and sponsored design competition, so well done to everyone who took part! I thought we might see a few good projects, but certainly wasn’t expecting quite the volume or diversity. From CNC machine controllers to Ham Radio tools, iPod controllers to iPhone controlled homes, robot controllers to robotic injections, realtime audio filters to bat detectors, this was quite a mix. I look forward to seeing some of the write-ups appearing in future Circuit Cellar/Elektor articles and on the mbed website, inspiring others and helping them benefit from all the hard work you put in! I’ve also had the pleasure during the last few months to bump in to some of you at shows, who were exposed to mbed through this competition. Welcome to mbed! Whilst a fair few discussions started “I was going to enter, but didn’t get around to writing anything up”, the conversations still highlighted how many new things were being built, new ideas being explored, and the general enthusiasm for using this modern microcontroller technology. It is wonderful to see such a skilled and innovative crowd building in the mbed community, and we’ll be working hard to make sure you can be even more productive. After a long ESC show, I was offered a lift back to the airport by Hexley; a great opportunity to chat. I think in that 45 minute drive we may have planned some form of workshop tour of the US! If we manage to put that together, maybe we’ll see some of you there! Congratulations again and thank you to everyone who entered. I hope you enjoyed the challenge. (110477) Simon Ford, co-creator of mbed, is a lifelong electronics and computer en- gineer. He works at ARM, and before starting mbed was technical lead for the ARMv 7 /NEON architecture now found in most new smartphones. www.drcuitcellar.com/nxpmbeddesignchallenge 14 7/8-2011 elektor QUASAR electronics Quasar Electronics Limit PO Box 6935, Bishops Stc CM23 4WP, Tel: 01279 4 United Kingdp 67799 Fax: 01279 267799 E-mail: sales@quasarele Web: www.quasarelectrc ed rtford m ctronics.com nics.com fli ifd Postage 3-7 Day Europe SOrder We acc Quasar Please 9 $; & Packing Op Delivery - £4. (EU) -£12.95; inline for redud ^pt all major cr Electronics. Pr| visit our online projects, modules and ions (Up to 0.5 UK Mainland est of World - ; ed price UK Pc ddit/debit cards ces include 20 shop now for publications. C Credit Card : UK Standard ery -£11.95; 5Kg) |r assembled and ready for l^it 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 - £74.95 Assembled Order Code: AS3108 - £89.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 or Tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £24.95 Assembled Order Code: AS3145 - £31.95 Additional DS1820 Sensors - £4.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 - £54.95 Assembled Order Code: AS3180 - £64.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 - £79.95 Assembled Order Code: AS3140 - £94.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 - £64.95 Assembled Order Code: AS3142 - £74.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 - £84.95 USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows 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 Flash/OTP PIC Programmer USB PIC programmer for a wide tfS#* range of Flash & OTP devices — see website for details. Free Windows Software. ZIF Socket and USB lead not included. Supply: 16-18Vdc. Assembled Order Code: AS3150 - £49.95 See website for full range of PIC & ATMEL Programmers and development tools. Getting Started with your Free LPCXpresso Board By Clemens Valens (France) If you are among the authors having made it into this edition of Elektor with one or more articles, besides a trivial amount of old fashioned money you have been (or will be) rewarded with a small but rather powerful gift kindly offered to you by NXP. 3i*i;!(prti;5n1TH_Min*tyJncini|i*.j.c EPCXpre-tu [S](5T|| hk Elk '+T-.^r Pji -r Hrtr ™ Hi - 3 ■ T s ■ "" Is* < k lil . , iLL .V ,f ISJ ^ » S' ‘ 4M sr»[ r ,Z£tM - ■ '■ n % 4- »>• tp m . t+JH jjT 5 r UtSlvrJjti "i . (ItyGSUl lfeSt| A - fc tf" t - htriH -4 lH ■ ' l .-3Jili*i iHrLL.E li / rt/ k n i*_t* i t I’rWr- Lm ■ r ' r mtriMdljOJM t . ' UFOtlllHlIlUrtA ■M.H.U it MU \\ hw “ n . [:- l.-*t ■LWfe vyyitPryfx-wric 1 1 M lf.bUY.Bj J1D,WH L».W1 r:hprlS C rn-j.rFr - (Jj ! I ti.il! If cnofc-Jc 11 tElf LiJ -- ' ! ti - c t ; r l E-i-t LSI bp •*. *j‘. p*.-L fliWcbElrr :it_PC*T ( LIt_l!T, 1 J| '+ dill (E] L=j[ E«rtv:r V ft LtC' 1 « rii. Jsc Jpr. h* I ■!- yt-rr.r-J it [ i i.-i u ie ifcMji ] «&_H?Pr. US_HT. Y J Q< 4 rt«k : hMM Olw> ■ ■ a <3 |P lPOM+ki I H.sW ■ 0 *jbL-:«m HOJ feekiewj D ■ -o' tJUFO^ « »'i JC fue 1 1 liJbW I* '* s I'J-rKii So what exactly is this gift and what can you do with it? LPCXpresso — a joint development by NXP (they came up with it) [1], Embedded Artists (hardware) [2] and Code Red Technologies (software) [3] — is a cheap prototyping platform for the new ARM Cortex-MO and -M3 microcontrollers from NXP. Although quite tiny, these are pretty powerful ICs containing 32-bit processors with flash memory and RAM besides many useful peripherals. The controller is mounted on one half of a blue, long and slim PCB together with a crystal and an LED, with space available for ( mbed compatible!) extension connectors and even a modest prototyping area. The other half of the board, actually a little less, is a programmer/debugger pod that connects to the PC through a mini USB connector. The pod can be separated from the controller once your application is ready by cutting the PCB in two (which is far from easy — been there, done that!). Several models of these PCBs exist that differ only in respect of the microcontroller mounted. Elektor are handing out boards that have an LPC1114 Cortex-MO device with 32 KB flash memory, 8 KB RAM, UART, SPI, l 2 C, ADC & timers. Note that the UART is RS-485 capable which makes this board very useful for ElektorBus applications. However, LPCXpresso is more than just a slim blue PCB, because it includes free software development tools for Linux and Windows (‘include’ is not really the right term to use since you have to download it all yourself from the Internet). The software tools come as a nicely packaged Eclipse-based integrated development environment with its powerful editor and the GCC compiler, linker and debugger suite for ARM. Simply run the downloaded executable to install the tools. This will also install many code examples that you can try out. You will have to create an account before downloading, as well as register the software after installation, but once you’ve entered the serial numbers you received by email, you are ready to go. The registration process survives upgrades so you only have to go through it once. The LPCXpresso takes a while to start, but when it is finally ready it offers a quick access menu named ‘Start here’ containing the most important functions (and some more) that you will use often like new project, build & debug. Here you will also find an option to import example projects. Click this link to open the Import dialogue, then click Browse... and navigate to the LPCXpresso1114.zip archive in the folder examples/NXP/LPCI 000/ LPXIIxx. Select the zip file and click Open followed by Next. Now tick the examples that you want to import (I suggest to tick ‘em all) and click Finish. If you did not untick it, you will now have a project called LPCXpresso1114_blinky. This is the easiest one to try out and to see if everything works fine. If you select it, you can build it from the ‘Start here’ menu. You can also build all the projects with one single click, but that takes a bit more time. Build the project and observe the messages that scroll through the Console window; there should not be any errors or warnings. If for some reason you do have an error or a warning, click on the Problems tab to get more information. Double clicking a line in this window will take you to the offending code. After a successful build you can run the program on your LPCXpresso board. Connect the board to the PC and click Debug ‘LPCXpresso1114_blinky’. Note that for this to work you should have installed the LPC- Link drivers first (located in the Drivers\LPC- Linl<\ subfolder of the LPCXpresso installation folder). The IDE will now start the LPC-Link driver, load the executable to the board and jump to the first statement of ‘main’. The C-source file containing this statement is automatically opened in the IDE. Click the Resume button (the little green triangle or press F 8 or from the Run menu) to allow the program to run. The little red 16 7 / 8-2011 elektor LED close to the processor will start blinking at a rate of 1 Hz. If you get this far without problems — and honestly I don’t see why you shouldn’t — then you are up and running. You can now start writing your own applications! If you come up with an interesting project, please do not hesitate to send it to us, we will be happy to evaluate and publish it in Elektor. (And maybe you will get another LPCXpresso, By Kurt Bohnen (Germany) Problems can arise with USB hubs that are powered from a PC when gadgets plugged into them draw too much current. This is often the case with devices fitted with USB cables that are too long or too thin, causing voltage drop. There’s no need to scrap your old USB hub, however, if you upgrade it using this little cir- cuit and an external power supply. Just cut the 5 -V power wire of the USB cable inside By Florian Schaffer (Germany) Vehicle immobilisers are fitted as standard to modern cars and heavy goods vehicles. Anti- theft mechanisms have become more sophis- ticated but so have the methods employed by crooks. Nowadays once the thief has gained access to a vehicle they will most likely use an electronic deactivation tool which seeks to disable the immobiliser, once this has been accomplished a blank transponder key/card can be used to start the engine. In many cases communication with the immobiliser is made using the OBD-II diagnostic connector. Although the OBD-II protocol itself does not support the immobiliser, the vehicle manu- facturer is free to use the interface as neces- sary for communication, either the standard OBD-II signals or unused pins in the OBD-II connector (i.e. those undefined in the OBD- II standard). Using one of these pathways etc. etc., which reminds me that I didn’t get a board even though I wrote this article...) For those of you not having made it to the free LPCXpresso board, you can buy one from most major component suppliers or directly from [2]. (110448) the hub and solder a diode (D 1 ) in the pass- through direction. Now connect the 5 V wire from the external power supply to the cath- ode of this diode. D 1 prevents any current from the power supply from flowing back into the PC. (100474) the immobiliser can usually be electronically disabled. This may be unsettling news for owners of expensive vehicles but when professional Internet Links [1 ] http://ics.nxp.com/lpcxpresso/ [2] www.embeddedartists.com/products/ Ipcxpresso / [ 3 ] http://lpcxpresso.code-red-tech.com/ LPCXpresso/Home [ 4 ] http://elektorembedded.blogspot.com 3 +5V US b di +5V hub 3 car-thieves call, armed with the latest OBD-II hacking equipment this simple low-cost low- tech solution may be all that you need. The idea is very simple: if all connections to the OBD-II connector are disconnected there is no possibility for any equipment, no matter how sophisticated to gain access via the vehi- cle’s wiring. The OBD-II connector is usually located underneath the dashboard on the passenger side; once its wiring loom has been identified a switch can be inserted in line with the wires. The switch should be hidden away some- where that is not obvious. In normal opera- tion you will be protected if the vehicle is run with the wires to the socket disconnected. Make sure however that you throw the switch reconnecting the socket before you next take the vehicle along to a garage for servicing or fault diagnosis. Upgrade your USB Hub OBD Vehicle Protection elektor 7/8-2011 17 The diagram shows the ISO l< and ISO L wires switched. To cover all bases it is wise for every wire to the socket is made switchable except the two earth connections on pins 4 and 5 and the supply voltage on pin 16. Almost every vehicle manufacturer has their own method of vehicle immobilisation, by dis- connecting every wire it ensures that no com- munication is possible (even over the CAN bus). Now the innermost workings of your vehicle will be safe from prying eyes. When a hacker plugs in a deactivation tool it will power up as normal but probably report something like ‘protocol unrecognised’ when any communication with the OBD port is attempted. (110287) 2/4/6-hour Timer By Philippe Schmied (Switzerland) Here’s an easy-to-build circuit to drive a solid-state relay for a period that can be selected as two, four, or six hours. This device forms part of a project by the author to control a heating system remotely by telephone (for a holiday home). The aim of the circuit is to avoid the risk of the heating’s running for more than a certain time if, in the event of a problem, there is no-one to stop it or put it into frost protection position. K1 D a « — SI ON CONTROL R1 R4 -© V CC VDD GP1/AN1/VREF IC1 GP2/T0CKI/INT/AN2 GPO/ANO GP3/MCLR PIC12F675 VSS GP5/OSC1 GP4/OSC2 R5 8 Cl XI I I R2 K 330R D-i. K2 R3 -| 330R |- C2 4MHz ISpT TlSp o ♦ RELAY 110219 - 11 A pulse of one second or longer on pin 6 of the microcontroller sets off the timer and the output is energized. Once the chosen time has elapsed, the microcontroller deactivates the output. The duration is selected via the DIP switches connected to ports GP2 and GP3: When choosing a relay to use with this circuit, remember the maximum current the microcontroller output can source is 25 mA. Preferably choose a solid-state relay — you’ll find several examples in this issue. GP2 GP3 Duration 0 0 Ohr 0 1 2 hr 1 0 4 hr 1 1 6 hr The software has been written in E-Blocks Flowcode and the project is available from [1], For those who don’t have Flowcode, the project also includes a file in C and in assembler language, as well as a HEX file. The pre- programmed microcontroller (PIC12F675 in 8 -pin DIL package) is available from the Elektor online store as part number 110219-41 [1]. (110219) Internet Link [1 ] www.elektor.com/ 1 10219 ATM1 8 and Three 1 -Wire Thermometers By Gregory Ester (France) In this circuit, the Elektor ATM18 [1] is in charge of communications and represents the master unit, while the DS18S20 sensors are the slave units. The DS18S20s respond to the orders from the master by sending back to it the temperature they are measuring. Our circuit makes it possible to measure tem- peratures from -55 °C to +125 °C (-67 °F to 257 °F) with 9-bit resolution and an accuracy of ±0.5 °Cfrom -10 °Cto +85 °C (14 °Fto 185 °F). However, the resolution can be improved by using a calculation discussed later, and which is implemented in the firmware writ- ten in BASCOM-AVR [2]. The sensors draw their power from the bus (‘parasite power’ mode, up to a few mA) by exploiting the numerous moments when the bus is at logic high. Given that most of them consume less than 100 pA, we just need to keep an eye on the total number of devices present on this bus. However, it’s still possi- ble to power certain Dallas devices locally by feeding a constant voltage of 3-5.5 V. Each 1-Wire component has a unique 64-bit 18 7 / 8-2011 elektor HYPERTERMINAL GND RX +5V DQ key to identify it. The eight LSBs of this key contain the family identifier. The code 1 0 h corresponds to the DS18S20 family of sen- sors, making it possible to distinguish between 1 -wire sensor types from different families that may exist on the same bus. The DS18S20 has an internal memory (scratchpad) containing the data that are going to help you calculate the temperature measured. Initially, the program calculates the number of sensors present on the bus and stores in a memory table the unique identifiers that are sent from MSB to LSB to the hyperterminal. The commands CCh + 44h are then executed, ordering all the sensors to perform the tem- perature conversion; in this way the scratch- pads are automatically updated with the new values, a total of nine bytes per scratchpad. You now call up each sensor individually by using its unique identifier followed by the command BEh. In this way, each time you can store in a table the contents of the nine scratchpad bytes of the sensor concerned. The temperature may be negative, and this Morse Clock By Ralf Beesner (Germany) Now this is what we call style: the clock cir- cuit described here doesn’t just announce the time in Morse code, but the whole user inter- face is in Morse! The design even includes an alarm function. When designing this circuit it became appar- ent that it would not be essential to use a 32 kHz watch crystal in conjunction with the special low-power mode of an ATmega microcontroller. The current consumption of an ATtiny45 in idle mode, running from a standard 3.6864 MHz crystal, can be kept low enough to allow acceptable operation from a battery. In normal operation the consumption is about 0.2 mA, which corresponds to about 1.8 Ah per year. The crystal must be connected to inputs PB3 and PB4 of the ATtiny45 microcontroller. The buzzer is connected to PBO, leaving PB1 and PB2 available for the dash and dot con- is where two’s complement comes in, to express the result in the sensor memory. The ninth bit corresponds to the tenths. A tem- perature with higher than 9-bit resolution can be calculated by using the ‘count remain’ and ‘count per C’ data, bytes 6 and 7 of the scratchpad. The ‘count per C’ value is fac- tory set to 16 (1 Oh). The value ‘temp read’ is obtained by truncating the 0.5 °C bit (bit 0 of the LSB). The temperature in degrees Celsius can then be calculated accurately using the equation: tacts. Besides the microcontroller, crystal, buzzer and the two buttons the only com- ponents required are a decoupling capacitor across the power supply and a volume con- trol potentiometer. The quartz crystal is used without the load capacitors recommended in the datasheet (12 pFto22 pF). It nevertheless oscillates reliably, but at a frequency perhaps T = temp read - 0.25 + (‘count perC’ - ‘count remain’) / ‘count per C’ This is the value that is calculated and sent to the hyperterminal for each of the three sensors. (110398) Internet Links [1] www.elektor.com/071035 [ 2 ] www.elektor.com/ 1 1 0398 a couple of hundred Hertz too high. This is deliberate: it means that the clock normally runs a little fast, and this is corrected in soft- ware by the addition of a small delay to cali- brate its overall timekeeping. The circuit should rarely need resetting. A reset button was included in the author’s prototype, but in the circuit diagram and sug- elektor 7 / 8-2011 19 gested printed circuit board layout [ 1 ] just a couple of pads are provided. The supply voltage is 3 V, provided by two AA cells. The printed circuit board is dimen- sioned so that it can be attached to the back of a dual AA battery holder using two screws. The clock is entirely controlled by commands in Morse. When the batteries are first fitted, it announces the time as 0000. The quarter- hourly chime (referred to as ‘gong’ below) is enabled. The following commands, each consisting of a single character, are available: ? List commands Z Set time T Announce time G Gong (chime function) on/off C Check: announce gong status, alarm sta- tus and so on M Set Morse speed W Set wake time A Alarm on/off E Alarm stop (a single press of the ‘dot’ button) l< Set calibration delay (1 s to 9 s) (slows clock down) The commands that set a time expect a four- digit number, entered without spacing or By Guntram Liebsch (Germany) The circuit described here lets you control a cellar drainage pump so that it turns on when a preset liquid level is reached and turns off again when a different preset level is reached. The author investigated several approaches to the problem. Commercially available pumps equipped with float switches are not suitable as they are sometimes so power- ful that there is a danger that their suction can start to cause movement in the ground beneath the building. A more reliable approach is used here. A sim- ple circuit determines the level of water using a pair of suitably-spaced electrodes and then pumps out a preset quantity of water. The author has used this circuit over a period of ten years in a sump (a pit dug in the cellar) to detect the presence of any groundwater less punctuation. The on/off commands expect a zero or a one, and the Morse speed com- mand expects a two-digit number. As soon as a sequence of digits has been entered, the clock repeats them back for confirmation. If a non-digit character is entered, the clock will reply with ‘RPT’ (for ‘repeat’). If too few dig- its are entered, then after a short delay the clock will again reply ‘RPT’. In both cases the clock returns to idle mode, and so the com- mand letter must be repeated before enter- ing the digits again. The Morse speed setting routine will check whetherthe requested speed lies in a reason- able range (between 10 wpm and 30 wpm). If this is not the case, the clock will reply ‘RPT’ and set the speed to 20 wpm, ensuring that it still remains usable. In the current version of the software the checking of time values is incomplete. The clock will accept times such as ‘1299’: it is up to the user to check that the value is reason- able when it is repeated back in confirmation. The clock will, however, reject times greater than ‘2359’ with the ‘RPT’ message. As always the source code for the software is available for free download from the Elek- tor website [1]. The most important subrou- tine is the interrupt service routine, which is than a set level below the cellar floor. The circuit can be used in two situations. 1. It can be installed in a sump to keep the groundwater level more than a set distance belowthe cellar floor. In this case a pumping cycle can be designed to reduce the level by say an inch (perhaps a gallon). Because of the small change in level there is no risk of causing movement of the ground belowthe building. 2. When the heating orthe boiler in the cel- lar must be emptied, for example to replace the sacrificial anode, the water can be drained into a tank and pumped from there to the gar- den: using this pump control circuit means that the process does not have to be closely monitored. triggered once per second by the timer. The routine counts the seconds and maintains the time of day, expressed in minutes since midnight. When a complete day has elapsed (1440 minutes) the time is reset to zero in the main code. The main code simply performs the time cal- culation and checks the button status before returning to idle mode to wait for the next interrupt. To ensure that the clock responds immediately when a button is pressed, PB1 and PB2 are configured to generate ‘pin change interrupts’. Unfortunately we cannot take advantage of the microcontroller’s power-down mode, where almost all of its functional blocks are switched off with a single register setting, as we need to keep the crystal running. How- ever, we can use idle mode, where most of the functional blocks still draw some current: we need to switch them off individually. The author has used registers PRR and DIDR0 for this purpose; there may be further options available for saving even more power. ( 110170 ) [i] www.elektor.com/ 1 1 01 70 3 The circuit has been kept very simple, in the interests of giving good reliability. Gates IC2.A and IC2.B form a bistable flip-flop whose state is flipped by the two electrodes: and this is all done using a single, low-cost, CMOS 1C. Power switching is done by a relay, which can equally well be used with either 12 V or conventional 230 V / 115 V pumps. The author uses both types: a 12 V marine pump as the primary pump and, as a backup in case of failure, a conventional pump. The latter is only activated when the water level reaches a higher threshold, which does not occur unless the primary pump has failed. The 12 V system is powered from a car bat- tery (12 V, 70 Ah) which is trickle-charged. Two relays are shown in the circuit diagram, corresponding to two positions for relays on the printed circuit board with different pin Pump Controller with Liquid Level Detection 20 7 / 8-2011 elektor configurations. Only one of the two possi- bilities is fitted. The three electrodes are made from solid copper wire with a cross-section of 1 .5 mm to 2 mm with the PVC insulation stripped back at the ends. Electrode ELI acts as ground, EL2 sets the switch-off level and EL3 sets the level at which pumping is triggered. The circuit changes state when a current flows between these electrodes, which happens when water comes into contact with them. These currents, although tiny, lead to elec- trolysis of the electrode material, and so the electrodes have to be replaced every year or so. The amount of exposed copper on ELI (the ground electrode) should be twice as long as that on the other two electrodes. If an AC powered (115 V or 230 V) pump is used particular attention must be paid to the galvanic isolation of the power supply, to the selection of an appropriate relay, and to the insulation of all wires carrying live volt- ages. Circuits at live potential should only be installed by suitably qualified personnel. (100673) MHz Oscillator using an ATtinyl 5 By Andreas Grun (Germany) Most engineers will recognise the problem: Your circuit needs a stable 1 or 2 MHz clock generator (in the author’s case it was for a Pong game using an old AY3-8500). A suitable crystal is not to hand so you cobble together an RC oscillator (there are plenty of circuits for such a design). Now it turns out that you don’t have exactly the right capacitor so a preset pot is added to allow some adjustment. Before you know it the clock circuit is taking up more space on the board than you had hoped. +5V <±> TT PB5 vcc PB4 PB2 ATTinyl5 PB3 PB1 GND PB0 ® 110365 - 11 Providing the application does not demand a precise clock source a tiny 8 -pin microcontroller may offer a better solution to the problem. It needs no additional external components and an old ATtinyl 5 can be found quite cheaply. Another advantage of the solution is that clock frequency adjustment does not involve changing external components and is not subject to component tolerances. The microcontroller’s internal RC oscillator is already accurately calibrated to 1 .6 MHz. With its inbuilt PLL, internal Timer 1 can achieve up to 25.6 MHz [2]. By configuring internal dividers the timer can output a frequency in range of roughly 50 kHz up to 12 MHz from an output pin. The difference between calculated and the actual output frequency increases at higherfrequencies. A meaningful upper limit of about 2 MHz is a practical value and even at this frequency the deviation from the calculated value is about 15 %. The circuit diagram could hardly be simpler, aside from the power supply connections the output signal on pin 6 (PB1) is the only other connection necessary. The example program, written in Assembler is just 15 lines long! With a program this short comments are almost superfluous but are included for clarity. The code can be downloaded from the Elektor website [1]. The program only needs to initialise the timer which then runs independently of processor control to output the clock signal. The processor can then be put into sleep mode to conserve power. With only 1 % of the program elektor 7 / 8-2011 21 memory used up the remaining 99 % is free for use for other tasks if required. The OSCCAL register contains a calibration byte which allows some adjustment of the CPU clock. This gives a certain degree of fine tuning of the output frequency. A recommendation in the Atmel data sheet indicates that the CPU clock frequency should not be greater than 1.75 MHz otherwise timer operation cannot be guaranteed. The more recent ATtiny45 can be substituted for the ATtiny15. In this case the CKSEL fuses should be set to put the chip’s Timer 1 into ATtiny15-compatible mode [3]. After adjustment to the program it will now be possible to obtain a higher (or more exact) frequency from the timer, the ATtiny45’s PLL can operate up to 64 MHz. (110365) [1] www.elektor.com/ 1 1 0365 [2] www.atmel.com/dyn/resources/prod_ documents/docl 1 87.pdf [3] www.atmel.com/dyn/resources/prod_ documents/doc2586.pdf Timer for Very Long Periods By Dirk Visser (Netherlands) Simple mechanical timers, which you can buy for a couple of pounds in every home improvement centre, are suitable for switching something on and off one or more times per day. They can be used to control a wide variety of devices, such as lamps inside or outside the house, lighting for bird cages and aquariums, sump pumps, battery chargers, etc. If you need to control something over a longer period than the standard 24 hours, you can use two timers with the second one plugged into the first one (see photos). To determine what you can do with this arrangement, you first need to determine how often the load needs to be switched. For example, if the first timer has 48 tabs the shortest ‘on’ time is 30 minutes in 24 hours. This means that the second timer will run for 30 minutes every 24 hours, so the maximum duration of a full cycle is 48 days. A device such as a charger for diving torches can be connected to the sec- ond timer. To prevent the ‘on’ time of the second timer from exceeding 24 hours, it is essential to keep the ‘on’ time of the second timer shorter 30 min <<1 -a 24h ► ^ 110200 - 11 than that of the first timer. If a maximum cycle time of 48 days is too short, you can also con- nect a third timer. With three timers, the maximum cycle time is 2304 days (one ‘on’ time in approximately 6.5 years). As you can see from the photos, the second ! timer may interfere with the tabs of the first timer if they are plugged together with one on top of the other. This can be avoided by turning the second timer by 180 degrees rel- ative to the first one. (110200-1) LM2931 -5.0 is a Random Noise Generator too [y By Petre Tzvetanov Petrov (Bulgaria) The low dropout voltage regulators from the LM2931 series are not just useful for power- ing microcontroller systems — they can also act as a low-frequency (practically) random noise generator. The random noise could be used in the system for making an ADC (ana- logue-to-digital converter) produce random numbers, or a digital port purposely ‘go hay- wire’ depending on the noise level applied to it, or for other purposes you clever program- mers may have in mind. The output voltage of an LM2931A-5.0 is between 5.19 V and 4.81 V. The same param- eter for the LM2931 -5.0 is specified as 4.75 V to 5.25 V. The ‘Z’ suffix indicates a TO-92 22 7/8-2011 elektor Vdc (±> 0 (2> package. Both ICs also supply typically 0.5 mV rms worth of out- put noise across a 100 pF capac- itor within the frequency range from 10 Hz to 100 kHz. When amplified more than 200 times, a noise voltage of typically 100 mV can be obtained, which should be enough to randomly toggle a few bits in a 10-bit ADC with a least significant bit (LSB) equivalentto 0.5 mV. These bits could be used individually or collectively to ‘con- struct’ larger random numbers. The schematic shows a power supply providing an output volt- age between 4.5 V and 5.5 V and a maximum output current of 80 to 1 00 mA. Diode D2 lifts the out- put voltage of the LM2931Z-5.0 1C by 0.6 to 0.7 V. Diode D3 elim- inates (approximately) the volt- age lift produced by D2. Still on diodes, D1 protects the regulator from reverse voltage. The output noise of the regulator 1C is branched off via C7 and R2 and amplified more than 200 times by T1 and T2. The out- D1 -M- 1N4004 IC1 LM2931Z-5.0 0 * R1 Cl 150n D2 I X 1N4004 X C3 D3 1N4004 -►h C4 □ C2 □ 22u 16V 22u 16V J1 6 22u 16V J2 6 3LS C5 f \ C6 ■ l l 150n 220u 16V C7 □ 22u 16V [r3 ~ R2 T2 Vcc ♦ <2> T1 H © EM) 2x BC549C R7 -| 680k F C8 Vnoise Vni - 0 | VN2 W o R6 22u 16V < 2 ) 100826 - 11 of the transistorised amplifier may be changed to requirement chiefly with resistor R3. Components D3, C5 and C6 reduce the impact of the load (typically a microcontroller sys- tem) on the noise seen by the amplifier input. JumpersJI and J2 select the min- imum load capacitance between D3 and the regulator output, to strike a compromise between sta- ble operation of the regulator on the one hand and maximum noise output voltage on the other. The jumpers are set or soldered at the final stage when the equipment is tested. Although the circuit will also work with other voltage regulators like the 78L05, it should be remem- bered that much lower noise levels may be available, forcing the amplifier gain to be raised put resistance of the amplifier is relatively considerably, low and the output signal could be used to directly drive the input of an ADCs. The gain (100826) Return of the Elex Prototyping Board By Luc Lemmens (Elektor Labs) The magazine Elex, a sort of little brother of Elektor, was published in Dutch only from 1983 to 1993. It specialised in presenting electron- ics in an easy, fun manner. Many cur- rent Dutch readers of Elektor started out with Elex, and articles from the magazine are still in demand — the compilation DVD of Elex articles is still available. Although the magazine ceased publication 18 years ago, its leg- acy is still alive: one small product of Elex has refused to die and con- tinues to make life easier for elec- tronics enthusiasts. The Elex pro- totyping boards were introduced with the first edition of the maga- zine in the Netherlands. The mission of Elex was to present lots of small Signal in/out I/O Signal in/out Supply (4x) Ground perimeter I/O 110446 - 11 circuits with a low entry threshold. Ready-made PCBs did not fit in this picture, since they are expensive and readers would have to buy a new board for each project. The solution to this difficulty was to develop a general-purpose bread- board PCB. It drew its basic inspira- tion from the well-known Vero pro- totyping boards, which are PCBs in Eurocard format (100 x 160 mm) with parallel copper strips running the length of the board. Elektor lab staff at the time thought this could be improved on — the boards should be smaller to make them less expensive, and some of the strips, such as supply voltage and ground strips, should be predefined for use as ‘rails’. As you can see from the illustration, elektor 7/8-2011 23 only two small jumpers are necessary to con- nect an 1C to the supply and ground rails. There are also two strips that run underneath each 1C. They are intended to be used as input and output signal lines, but they are also suit- able for use as supply lines. The various strips — ground, supply voltage, spare supply volt- age and signal — can be connected as desired to the I/O sections at each end of the board, which can optionally be fitted with connec- tors. Naturally, these prototyping boards are also suitable for designs using good old dis- crete components and transistors. These handy boards are still available in the Elektor Shop under the name ‘Elex’ (Elex-1, Elex-2 and Elex-4 for single, dual and quad versions respectively). To show how easy it is to put together a small circuit on an Elex board some of the projects in this very edi- tion include a photo of a prototype assembled on an Elex board. (110446-1) RS-232 Level Shifter with Isolation [3 vcc By Uwe Hunstock (Germany) This circuit converts between the TTL volt- age levels on a UART to the correct levels for an RS-232 interface, with the two sides of the circuit being galvanically isolated from one another. Although ICs are available to do this from manufacturers such as Maxim, they are rather pricey. In principle the circuit is capable of work- ing at a maximum speed of 4800 baud, but in the lab we only managed speeds of up to about 2800 baud. The reason behind this is the switching time of the optocoupler, which, according to its datasheet, is 15 jlls (T on ) or 30 ills (T off ). Some experimenting with the value of R4 may be worthwhile. The presence of the optocoupler means that the circuit naturally falls into two iso- lated, externally powered, halves. The right- hand part of the circuit is powered from the DTR and DSR signals on the RS-232 interface (pin 7 and pin 2 of l<1). These handshake sig- nals must therefore not be used by the con- nected device, and must be held permanently at +1 2 V. However, since we will be generating negative signalling voltages on this side of the circuit, a simple positive supply is not enough. The trick used here is to tap off the TXD sig- nal on the RS-232 interface via diode D2: in the quiescent state the connected device will be holding this signal at -12 V. Of course, the TXD signal will occasionally go high when the device is transmitting, and so we need Cl to provide a smoothed negative supply. When something is transmitted to the RS-232 interface, the TXD signal on pin 5 of K1 drives the diode in the optocoupler directly via series resistor R1. However, when pin 5 is at -1 2 V we must ensure that the reverse voltage across D1 is limited: according to the data- sheet the maximum permitted is 6 V. When a transmission originates on the TTL- level side, the receiver transistor in the opto- coupler drives a buffer implemented here using four NAND gates. Each gate is wired as an inverter, and it is easy to see from the circuit how overall inversion of the signal is avoided. Three of the gates are wired in par- allel to increase the available output drive. IC1 is powered from a ±12 V supply and so a CMOS device capable of operating at these voltages must be used. Other logic functions besides NAND could be used, as long as the gates can be wired together to make a driver. Individual CMOS gates such as the TC4S81 could also be used, although these are less likely to be found in the average experiment- er’s junk box than the 4011 shown. The 5x2 header K1 can be connected directly to a 9-way insulation displacement D-sub socket using a flat cable. The wiring is as follows. Ki SUB-Dg Signal 1 1 DCD (=High) 2 6 DSR (= High) 3 2 RXD 4 7 RTS (not used) 5 3 TXD 6 8 CTS (not used) 7 4 DTR (=High) 8 9 not used 9 5 GND 10 not used ( 100704 ) 24 7 / 8-2011 elektor Arduino Nano Robot Controller By Francois Auger (France) This circuit is intended to be fitted onto the front of the BOE-Bot mobile robot described in [1]. Although there’s nothing to stop you using this circuit with any microcontroller, it has been designed for connecting to the Arduino Nano support board [2]. This support board is a suitable size for fitting to this robot and can be connected to two servomotors driving the robot by way of connectors that have been provided for this purpose. The circuit shown here allows a mobile robot to detect information about its immediate surroundings by means of two microswitches (end-of-travel detectors), two photoresistors, and three infra-red proximity detectors. All this will enable the microcontroller to steer the robot correctly by sending appropriate commands to the servomotors. The interface circuit for the three infra-red detectors is standard, and has already been used in [3]. Potentiometers PI, P2, and P3 let you adjust the current drive to the transmit- ting diodes, and hence the maximum distance at which the detector will be able to detect the presence of an obstacle. The 2.2 k £1 resis- tors protect the microcontroller against the accidental short-circuits that might occur if the microcontroller pin is configured as an output and generates a logic level different from that generated by the detector. The microswitches make it possible to detect the presence of an obstacle on the route and thus avoid collisions. They force the micro- controller’s input pin low. The two photoresistors make it possible to follow a reflective track, so the robot can fol- low a path marked out on the ground. They are connected in such a way as to allow us to measure their resistances using just a single logic input/output: at the outset, the micro- controller pin is configured as an output and set high to discharge the capacitor. Then the pin is configured as an input, which puts it into high impedance. The capacitor charges via the photoresistor, so the pin goes from logic 1 to logic 0 after a time that is propor- tional to the time constant RC. Hence by measuring the time it takes the pin to go from 1 to 0, we can measure the value of the photoresistor, and thus the intensity of the light falling on it. An additional expansion board that includes a quick prototyping area make it easier to con- nect the Arduino Nano support board with additional circuits (electronic compass, real- time clock, maths co-processor, accelerome- ter used as an inclinometer, and so on). On the web page forthe article [4] you’ll find a few test ‘sketches’ along with the PCB design forthe additional expansion board. (100395) Internet links [1] Basic Stamp Programming Course, Elek- tor, September-December 1999. [2] www.elektor.com/ 100396 [3] Basic Buggy, Elektor, April 1 999. [4] www.elektor.com/ 100395 elektor 7/8-2011 25 Extra Port Connections for the R8C/1 3 RXD o- +5V ©1^ PC< BC547 TXD R1 27k GND O- x% ^ R2 0 J SI H I — , RESET M0D1 O -|o +5V (+J +5V WR RD CS I A1 10 AO o o o o o o o o o o 12 o o 14 4o o 16 o o 1 Pl.7^ 8 3 P1.6 9 5 P1.5 10 7 P1.4 11 9 P1.3 12 11 P1.2 13 13 Pl.l 14 15 P1.0 15 16 K1 RXD1 TXD1 CNVSS P0.1 RESET P0.2 XOUT P0.3 VSS MODE XIN P0.4 VCC P0.5 PI. 7 P0.6 R8C/13 pi.6 P0.7 rxdo/pi.5 IVCC txdo/pi.4 P3.0 pi.3 AVSS pi.2 P3.1 pi.i A VCC Pl.O P3.2 P4.5 P3.3 o- - o- - o 30 29 28 o - 27 26 25 24 O - 23 22 o- - 21 20 O - 19 18 17 +5V (+) [r4 IC3 = 74HC14 IC3.A 1 +5V © K2 WR RD CS I 8 A1 10 AO 12 14 16 o o o a o o o o o a o a o a 1 DOy 3 py 5_D2y 7 03^ J_D4/ 11 D5 / 13 D6 y +5V © Cl □ lu 16V 35 R1 DO 34 \D1 33 D2 32 S. D3 31 D4 30 D5 29 ^D6 28 ^D7 27 IC3.C 1 IC3.D 1 IC3.E 1 36 +5V © [ R3 26 VC :c PA0 RESET PAl PA2 PA3 PA4 PA5 PA6 DO ipi IUi PA7 D1 D2 PB0 D3 PB1 n/i DDO 82C55 D5 PB3 D6 PB4 D7 PB5 PB6 PB7 PC0 PCI WR PC2 RD PC3 CS PC4 A1 PC5 A0 PC6 PC7 Gr JD 4_ 3_ 2 _ J_ 40_ 39_ 38_ 37_ 18_ _19_ 20 _ 21 22 _ 23_ 24 25_ _14_ 15_ 16_ 17_ 13_ 12 _ n_ 10 ©1 IC3.B 1 BC557 ]_R5 C2 □ lu 16V 35 R2 36 S2 MODE V +5V © \ DO 34 s D1 33 \ D2 32 s D3 31 \ D4 30 \ D5 29 s D6 28 k. D7 27 26 VC :c PA0 RESET PAl PA2 PA3 PA4 PA5 PA6 DO 1 po PA7 D1 D2 PB0 D3 PB1 n/i DDO 82C55 D5 PB3 D6 PB4 D7 PB5 PB6 PB7 PC0 PCI WR PC2 RD PC3 CS PC4 A1 PC5 A0 PC6 PC7 Gr JD 110301 - 11 4_ 3_ 2 _ J_ 40_ 39_ 38_ 37_ 18_ 19_ 20 _ 21_ 22 _ 23_ 24 25_ ii il 16_ 17_ 13_ 12 _ n_ 10 By Hermann Nieder (Germany) The well-known R8C processor module from Elektor’s blockbuster R8C Project [1], [2] is easy to program and can be used to control an extremely wide range of applications. Now and again, however, some additional port connections would be handy in larger appli- cations. For this reason we have come up with a simple port expander that uses two 82C55 port modules. Overall this now puts six ports each with eight pins at ourdisposal and these ports can be used either as inputs or outputs as required. For RS-232 communication with a PC we shall use the ‘minimal’ system described in Elektor for December 2005 [1]. In principle, however, you could also make use of the practical USB/ TTL cable [3], which would avoid the need for transistors T1 and T2 as well as the wiring for these. Pins P1.0 through to PI. 7 of the R8C/13 are linked to the data inputs of the modules men- tioned above. P3.0 and P3.1 serve to address each of the ports. Pin P3.2 allows one of the modules to be selected with the Chip Select line / CS. The signal forthis appears unaltered on the first port module and inverted on the second one. Communication between PC and R8C (at 9600 Baud) is coded as follows. The first byte determines whether data on a port is to be written or read (1 for writing, 2 for reading). The second byte is the port address, in which the first module responds to addresses 0 to 3 and the second to addresses 4 to 7. Control bytes to the port expanders are transmitted using addresses 3 and 7 (see the data sheet [4] for further details). During write operations the third byte is the bit pattern for positioning the port pins. During read operations this bit pattern is sent from the R8C to the PC. Communication between a PC and the cir- cuitry described can be performed using a terminal program for example. A more con- venient solution is the author’s PC program (in Visual Basic 5), which uses Burkhard Kain- ka’s functions library RSCOM.DLL, which can be downloaded from his website [5]. As ever, the PC software and the firmware for the controller can be found on the Elektor web- site [6]. To simplify the software, ports A, B and C of IC1 are used always as output ports and ports A, B and C of the second port module as input ports. At power-up both port modules receive a reset pulse and their ports are all defined as inputs. After opening a COM interface you need to press the button ‘8255_1 und 8255_2 vor- bereiten’ (Prepare 8255_1 and 8255_2) in the PC program. The PC now sends bytes 1 , 3 and 128 to the R8C/13, which in turn redefines all ports as outputs. Now we can use the eight check boxes per port to define which of the individual bits on 26 7/8-2011 elektor the outputs of ports A, B or C as appropri- ate are to be set or rest. Each time the corre- sponding decimal value of the bit pattern is indicated nearby. After this pressing one of the ‘Send’ buttons to transmit the relevant bytes to the micro- controller, which in turn controls IC1 . The PC program polls the input pins (Ports A, B and C) of IC2 continuously. The status of the pins is indicated on screen by coloured shapes, with the corresponding decimal value shown alongside. The PC software is naturally just a starting point and all sorts of upgrades and modifica- tions are possible! (1103m) [1] www.elektor.com/0501 79-2 [2] www.elektor.com/r8c [3] www.elektor.com/080213 [4] www.intersil.com/data/fn/fn2969.pdf [5] www.b-kainka.de/pcmessfaq.htm (in German; use Google’s translator facility to read in English) [6] www.elektor.com/ 1 10301 Tandem Doorbell By A. Rene Bosch (Netherlands) The author had a problem: the neighbours had exactly the same type of doorbell as he did (actually a 50 Hz buzzer), so it wasn’t always clear who needed to answer the door. To avoid confusion, the author augmented the existing doorbell with a wireless model — a reasonably inexpensive option at current prices. All that was necessary for this was to arrange for the existing button and wiring to also actuate the wireless doorbell. a The author opened up the button enclosure of the wireless doorbell and used a multim- eter to find out which set of contacts were closed when the button was pressed. This is where the relay output should be connected (see the schematic diagram). The circuit is virtually self-explanatory: when the exist- ing doorbell button is pressed to actuate the buzzer, the voltage is rectified by the bridge rectifier and regulated at 5 V by the 7805. This voltage drives the relay directly, causing the switch in the wireless doorbell button to be shorted. As a result, along with the buzzer a sizeable Big Ben chime indicates that some- one is at the door. Nowthe author just hopes that his neighbour doesn’t copy his idea. (100415-1) Audio Level Adapter Byjorg Ehrig (Germany) The problem that this circuit is designed to solve appeared when the author was install- ing a new radio in his Audi A3. The new radio had four outputs for loudspeakers and a line- level output for a subwoofer. However, the A3 as delivered from the fac- tory already has an amplifier for the rear loudspeakers, as well as the pre-installed subwoofer, in the boot space. The origi- nal Audi radio therefore has only line-level outputs for the rear loudspeakers. So, to replace the original radio without making other changes to the installed amplification system, he needed to convert the outputs of the new radio corresponding to the rear loudspeakers into line level outputs. Most of the commercially-available adapt- ers to do this job contain small transformers for galvanic isolation. These introduce phase shifts and create a certain amount of distor- tion, which the author was keen to minimise. The result is this simple adapter circuit that does not employ a transformer. The outputs of most radios available today have a differential (bridge-type) push-pull output stage. There is thus no ground out- put, just two outputs per channel with a 180 0 phase difference between them. If the outputs are each connected to a com- mon point via a 100 £1 resistor, that point becomes a virtual ground. The ground is rel- atively stable as (in the stereo case) it has an impedance of 25 £ 1 . Each output driver is seeing a 200 £1 load: if the amplifier is rated for 50 W output into a 4 £1 load this means that each resistor will dissipate less elektor 7/8-2011 27 than 0.5 W. Hence 1 W rated resistors will be more than adequate, especially in view of the fact that typical music has a crest fac- tor of at least five. Even a small DC offset from the virtual ground is not a problem, as most modern amplifiers feature differential inputs or at least allow the ground connec- tion of an input to float. To reduce the signals to line level, each has to be connected to a potential divider: a multi-turn preset potentiometer is ideal. The author used a linear 10 k £1 trimmer to reduce the output voltage level from up to about 12 V pp to around 2 V to 3 V. This lat- ter level is suitable for the input to a power amplifier. An appropriate trimmer setting can be found by ear, adjusting the volume of the rear speakers for the desired balance. There is no need for a printed circuit board for this project. The 1 W resistors can be soldered directly to the connections of the multi-turn presets, and so the whole thing can be assem- bled ‘in the air’ and shrouded in heat-shrink tubing. The circuit can then be tucked away in the space behind the radio itself. ( 110304 ) High Voltage Generator with the aim of testing the electrical break- down protection used on the railways. These protection measures are used to ensure that any external metal parts will never be at a high voltage. If that were about to happen, a very large current would flow (in the order of kilo-amps), which causes the protection to operate, creating a short circuit to ground the overhead line (or their supports) on the railways. This generator generates a high voltage of 1 ,000 V, but with an output current that is lim- ited to few milliamps. This permits the electri- cal breakdown protection to be tested with- out it going into a short circuit state. bipolar switching transistors, a simple 1 .4 VA mains transformer and a discrete voltage mul- tiplier. PI is used to set the maximum current and P2 sets the output voltage. The use of a voltage multiplier has the advan- tage that the working voltage of the smooth- ing capacitors can be lower, which makes 28 7 / 8-2011 elektor them easier to obtain. The TL494 was chosen because it can still operate at a voltage of about 7 V, which means it can keep on work- ing even when the batteries are nearly empty. The power is provided by six C-type batter- ies, which keeps the total weight at a reason- able level. The 2x4 V secondary of AC power transformer (Trl) is used back to front. It does mean that the 4 V winding has double the rated voltage across it, but that is acceptable because the frequency is a lot higher (several kilo-Hertz) than the 50 Hz (60 Hz) the transformer is designed for. The final version also includes a display of the output voltage so that the breakdown volt- age can be read. From a historical perspective there follows a bit of background information. In the past a different system was worked out. Every high-voltage support post has a protection system, and it isn’t clear when the protection had operated and went into a short-circuit state due to a large current discharge. Since very large currents were involved, a cer- tain Mr. Van Ark figured out a solution for this. He used a glass tube filled with a liquid con- taining a red pigment and a metal ball. When a large current discharge occurred the metal ball shot up due to the strong magnetic field, which caused the pigment to mix with the liq- uid. This could be seen for a good 24 hours after the event. After a thunder storm it was easy to see where a discharge current took place: one only had to walk past the tubes and have a good look at them. Unfortunately, things didn’t work out as expected. Since it often took a very long time before a discharge occurred, the pig- ment settled down too much. When a dis- charge finally did occur the pigment no longer mixed with the liquid and nothing was visible. This system was therefore sidelined, but it found its place in the (railway) history books as the ‘balls of Van Ark’. (110438) Tachometer Pulse Divider By Sjabbo van Timmeren (Netherlands) The author is a motorbike racer in the Clas- sics class of a Dutch Motorcyclists Associa- tion. He recently replaced the contact points on the engine of his motorbike (a 500-cc BSA Goldstar with a single-cylinder four-stroke motor) by an electronic ignition. The new ignition system produces a spark for every rotation of the motor, compared with a spark for every two rotations with the con- tact points, so there are twice as many spark pulses. As a result, the tachometer indica- tion was no longer correct. A new tachometer suitable for use with an electronic ignition (such as a Krober unit) +6V...+12V is rather pricey at around € 175. Accord- ingly, the author first looked through past Elektor July & August issues for a suitable divider circuit — after all, it should be possible to solve this problem with a bit of electronics. It didn’t take long to find something suitable in the form of a mon- ostable multivibrator. The circuit shown here required only a couple of changes to the original design, and now the original tachometer again shows the right motor speed. Final tally: problem solved for € 5; €170 saved, and the priceless pleasure of setting the bike right yourself. (100312-1) Video Switch for Intercom System By Jacob Gestman Geradts (France) Nowadays a lot of intercom units are equipped with video cameras so that you can see as well as hear who is at the door. Unfor- tunately, the camera lens is perfectly placed to serve as a sort of support point for people during the conversation, with the result that there’s hardly anything left see in the video imagery. One way to solve this problem is to install two cameras on the street side instead only one, preferably some distance apart. If you display the imagery from the two cameras alternately, then at least half of the time you will be able to see what is happening in front of the door. Thanks to the video switch module described here, which should be installed on the street side not too far away from the two cameras, you need only one monitor inside the house and you don’t need to install any additional video cables. Along with a video switch, the circuit includes a video amplifier that has been used with good results in many other Elektor projects, which allows the brightness and the contrast to be adjusted separately. This amplifier is included because the distance between the street and the house may be rather large, so elektor 7 / 8-2011 29 +12V it is helpful to be able to compensate for cable attenuation in this manner. The switch stage is built around the well known 4060 1C, in which switches IC2a and IC2d alternately pass one of the two signals to the output. They are driven by switches IC2b and IC2c, which generate control signals that are 180 degrees out of phase. The switching rate for the video signals is determined by a clock signal from an ‘old standby’ 555 1C, which causes the signals to swap every 2 seconds with the specified com- ponent values. Naturally, this circuit can also used in many other situations, such as where two cameras are needed for surveillance but only one video cable is available. (100587-1) Flat Battery Indicator Vcc By Wolfgang Fritz (Germany) This small circuit was developed to monitor the battery in a model hovercraft. The lift in the model is produced by an electric motor driving a fan. To avoid the possi- bility of discharging the recharge- able battery pack too deeply, the design lights a conspicuous LED mounted on the model when a pre- set threshold voltage is reached. The circuit only uses a few compo- nents, which helps keep the total weight of the model down. The circuit connects to the model only across the two points where the voltage to be monitored can be measured. These also supply power to the circuit. The best place to connect the circuit is not at the battery terminals, but rather at the motor connections. The circuit is suitable for use with nominal battery voltages of 4.8 V to 9.6 V (four to eight 1.2 V cells). For example, if there are six cells in the battery, its nominal terminal voltage will be 7.2 V. A discharge threshold voltage of around 1 V per cell is appropriate, which means that for six cells the threshold is 6 V. We now need to set the volt- age U z across the adjustable Zener diode D1 (an LM431) to about 0.5 V less than the threshold voltage at which we want LED D2 to light. This voltage is controlled by the choice of the value of resistor R1. As indicated in the circuit diagram, this is done with the help of a trim- mer potentiometer (R1.A) with a fixed resistor (R1.B) in series. Using the suggested values (10 k the amount of hysteresis can be varied. The current drawn by the circuit itself is less than 5 mA (as measured with a battery volt- age of 7.2 V). When the LED lights an addi- tional 10 mA (the LED current) is drawn, for a total of around 15 mA. The adjustable Zener diode can be replaced by a fixed Zener with a voltage 0.5 V less than the desired threshold. Resistors R1 and R2 can then be dispensed with. A flashing LED can be used for D2 (without series resistor R7). An acoustic alarm can be provided by replacing D2 and R7 by a DC buzzer with a suitable operating voltage. ( 100330 ) 3 Rl Current Source for Grounded Load By Stephen Bernhoeft (UK) Creating a current source (as opposed to current sink) for driving a grounded load can be a bit awkward. Admittedly the suggested circuit cheats a little in that the load is tied to virtual ground; still it is potentially useful. at virtual earth and A2 sets a current / = -V^ /Rl , which also flows through the load R L . (100934) Arduino Shields By Michael Gaus (Germany) The Arduino microcontroller platform is rather popular. One significant reason for this is the wide availability of a range of daughter boards (which are called ‘shields’ in Arduino terminology) containing additional items of hardware, which can quickly and easily be plugged into and unplugged from the mother board. elektor 7/8-2011 3i It is easy enough to make a shield board your- self. The relevant header sockets are always found in the same place across the Arduino ‘Uno’, ‘Duemilanove’ and ‘Diecimila’ board versions and all have the same pinouts, which means that a DIY shield can be used in con- junction with any of these three boards. For hardware all we need is a standard piece of perforated prototyping board and headers with a 0.1 inch (2.54 mm) pitch. The correct position for the headers can be obtained from the drawing (which is viewed from the under- side of the board). for Model Railway Layouts By Erhard Stark (Germany) Now and again modellers looking to add something special and individual to their lay- out will want a miniature arc welding simula- tor. This project demonstrates that you need barely anything more than a microcontroller and the right software. The circuit shown here uses a PIC10F200 microcontrollerto illuminate LEDs D1 and D2 with differing frequencies and time lags. To ensure the effect produces the characteristic By Albert Bitzer (Germany) A large number of microcontroller circuits make use of SD memory cards. At the same time the Internet contains many program libraries and countless sample applications. In many projects — with scale models for instance — an SD card is simply not com- pact enough. One solution is the significantly smaller MicroSD card [1]. The firm Hirose [2] has a corresponding card socket in its portfolio, which can be bought from Farnell [3] or Digikey [4]. The easiest way to start is first to plug the headers directly into the sockets on the Arduino motherboard. Then fit the proto- typing board over the headers. Leave a small gap between the underside of the prototyp- ing board and the plastic carrier of the header in each case to allow for soldering there later. Unfortunately the distance between the sock- ets on the Arduino boards is not an integer multiple of 0.1 inch, and so it is necessary to bend the headers slightly to make them fit. Turn the Arduino printed circuit board over and then attach the headers to the prototyp- ing board with solder joints on its underside. The photograph shows an example Arduino shield constructed in this way. The compo- nents of the expansion circuit can be mounted on the top side of the prototyping board and soldered on its underside. Ordinary wire can be used to connect between the components and the header pins. ( 110092 ) 3 flashes of arc welding the two LEDs should be fixed as close together as possible. The inser- tion and removal of the welding electrode is represented by short breaks in the flickering. To cut off the welding light the circuit we must either remove the supply voltage or else ground pin 8 (GP3). J1 provides an elegant approach to the latter solution. The welding effect is active with the jumper removed. The software for the microcontroller can be downloaded free from the web at [1]. The configuration of the PIC is included in the ASM file but can also be carried out by setting all configuration bits to zero manually. (110085) [1 ] www.elektor.com/ 1 1 0085 3 Arc Welding Effect MicroSD Card Connectors 32 7 / 8-2011 elektor Type DM3 is available in three versions: as push-push type DM3A, as the hinged variant DM3C and as the push-pull connector DM3D. These connectors can be soldered simply with a normal soldering iron. To make things easier for miniature-minded enthusiasts the author has compiled a small Eagle library covering all three types. This can be downloaded as a zip-archive from the Ele- ktor website [5]. Also covered there is an experimenter/ adapter board on which the connections of the card connector DM3A are taken out to connector strips in order to simplify connec- tion to a microcontroller (possibly mounted on perfboard or breadboard (Veroboard or Vector Board). (110044) [1] www.sdcard.org/developers/tech/ sdcard#microsd [2] www.hiroseeurope.com/ [3] www.farnell.com [4] http://dkc1 .digikey.com/se/en/tod/Hi- rose/DM3/DM3.html [5] www.elektor.com/ 1 1 0044 Simple Low Cost Square Wave Generator & Tester By Petre Tzvetanov Petrov (Bulgaria) This square wave generator and tester is based on audio amplifier chip type TBA820M. It is presented as a design idea for further refinement and optimizing of component val- ues by way of experiment. The circuit has five frequency ranges cover- ing <0.1 Hz to >70 kHz. It will be found use- ful fortesting cables, communication equip- ment, electrical interfaces, loudspeakers, headphones, electrical bulbs, transformers, LEDs, couplers, inductors, buzzers, ultrasonic equipment, etc. or wherever you need a sig- nal in the range from below 0.1 Hz to 25 kHz and up with controlled frequency, amplitude and drive capacity. For example, driving heavy capacitive or inductive loads is no problem, nor supplying up to one watt of output power. The generator’s frequency ranges are selected with switches S1-S4. To be able to use a DIP switch with four positions the smallest capac- itor, Cl , is always connected but there’s no objection against adding a fifth switch. With Cl at around 10 nF and a total resistance of 1 5 kn between pins 5 and 3 of the TBA820M 1C the maximum output frequency is of the order of 70-1 00 kHz. However with reproducibility in mind it is recommended to limit the frequency to below 50 kHz. D5 and R11 provide a discharge path and a protection resistor for the larger capacitors. Switch S5 allows the DC component from the TBA820M to be blocked or passed to the generator outputs. S6 should be closed when driving heavy reactive loads to elimi- nate undesired high frequency oscillations. Potentiometer PI controls the frequency of the output signal. OUT1 is the main output protected with stop- per resistor R9. It is used to test unknown cir- cuits where large capacitance or inductances could be present, or circuits presenting a few volts themselves. R9 may be dimensioned to suit the application and can take a value between 22 to 100 ohms at a dissipation of 0.5 to 2 watts. OUT2 is the direct output from the integrated circuit. It’s used to test loudspeakers, trans- formers, lines sure to have no voltage on them, etc. The output power depends on the supply voltage and is around 2 W into 8 £1 at V EE = 1 2 V. The load does affect the OUT2 sig- nal frequency and amplitude to a small extent but that’s not an issue in most applications. OUT3 is a level controlled output using poten- tiometer P2. This output is protected by R12 taking a value from 22 to 220 £1 depending on the application. The output is used to test headphones, audio lines, small loudspeakers, transformers, amplifiers, buzzers, LEDs, etc. OUT4and OUT5 are used mainly to test ampli- fiers, lines and headphones but will find many other applications. The amplitude on OUT4 is one tenth of OUT2 and the amplitude on OUT5 is 1 /1 00th. All outputs are protected against short circuit to the ground. Diodes D2 and D3 afford some under voltage and overvoltage protection on every output. The slew rate of the output signal of the gen- erator with no additional load is more than 20 V/jlis and depends slightly on the brand of TBA802M used and the method of wiring it (PCB or free wired). elektor 7/8-2011 33 R2 and PI together present a resistance range of 15 kQ. to about 250 l. Although the gen- erator will work with a 1 M£1 pot there is a lit- tle benefit to be gained due to the higher par- asitic capacitance, inductance and noise. On the other hand, an additional linear potenti- By Michael Gaus (Germany) Many newcomers to AVR programming would love to build their own low-cost programming device, but they face a chicken-and-egg prob- lem: many of the designs themselves use an AVR microcontroller; this needs to be pro- grammed, and so they first need to make a programmer... This is where the SCAP (Serial Cheap AVR Pro- grammer) can come in handy. It is a very sim- ple programming device using a minimum of components, and it can be connected either directly to a PC’s RS-232 interface or to a USB interface via a USB-to-RS232 converter. The circuit includes a nine-way D-sub socket (K1) which can be connected to the PC’s serial port or to the USB-to-RS232 con- verter. The circuit takes advantage of the internal protection diodes on the AVR’s I/O pins to V cc and GND, and the two series resistors R1 and R2 are thus needed to limit the current flowing through these diodes. The values are chosen to keep this current below 1 mA. The RS-232 interface can be as high as ±15 V. At -15 V the AVR’s internal protection diode to GND limits the voltage on the I/O pin to a minimum value of -0.7 V, while at +15 V the protection diode to V cc limits the pin voltage to a maximum value of V cc +0.7 V. Now, because the val- ues of the series resistors R1 and R2 are relatively high, the charging and discharg- ing of the AVR’s input capacitance is con- siderably slower than if it had been driven directly by a push-pull stage, and this lim- its the maximum permissible frequency on SCK for reliable operation. The wiring of l<2 corresponds to the standard six-way Atmel ISP connector. ometer with a value equivalent to 5-10% of that of PI could be included in series with PI to achieve better accuracy of the frequency adjustment. The generator’s supply voltage range is rela- The well-known open source program AVR- DUDE is an essentially universal programming tool that can very easily be configured to work with SCAP: see [1] and [2]. The configuration file avrdude.conf needs to have the following section added to it: This adds a new programmer called ‘scap’, which can then be selected as the device to be used for programming using the command- line option ‘-cscap’. Even though the reset pin of the microcon- troller is tied permanently to GND in the cir- cuit, it must still be defined for AVRDUDE. If AVRDUDE fails to establish a connection with the AVR device to be programmed, the power to the device must be interrupted briefly to cause it to perform a power-on reset. Here is a sample command to invoke AVR- DUDE. We have assumed that SCAP is con- nected to COM1 with an ATmega8 as the tar- tively wide at 4-1 6 VDC (V EE connection). The unit is particularly suitable for operation from a 12 volts car battery with a typical voltage of around 13.2 V. (100763) 3 get device (this corresponds to the command- line option ‘-p m8’) and that the hex file to be programmed istest.hex. avrdude -P coml -p m8 -c scap -i 300 -U f lash : w : test . hex : i The instruction to slow down SCK is specified by the command-line option ‘-i 300’, which gives a delay of 300 jlis. This makes the pro- gramming operation rather slow. Depending on the type of interface used (normal RS-232 or a USB-to-RS-232 converter) it may be possi- ble to reduce the delay value to as little as 50, which will make programming faster. If SCAP is being used just to solve the chicken-and- egg problem mentioned at the start of this article, then programming speed will not be of any great concern. (110087) Internet Links [1] AVRDUDE: www.nongnu.org/avrdude/ [2] AVRDUDE version for Windows: www.mikrocontroller.net/ attachment/69851 /avrdude-5.1 0.zip ‘SCAP’ AVR Programmer # # Serial Cheap AVR Programmer (SCAP) # reset=rts sck=dtr mosi=txd miso=dcd programmer id = "scap"; desc = "Serial Cheap AVR Programmer, reset=rts sck=dtr mosi=txd miso=dcd" ; type = serbb; reset = 7; sck = 4; mosi = 3; mi so = 1; r # 34 7/8-2011 elektor Slave Flash for Underwater Camera r By Daniel Savel (France) The flash module in this circuit comes from a Fuji disposable camera. The author’s design is based on various ideas on this subject that can be found on the Web. The guide number [1] of the flash is approximately 14 in the air and close to 6 underwater. The flash intensity is not adjustable. This flash unit is primar- ily intended to be used for underwater pho- tography, which is why the author fitted it in a case originally used for a Nikon Coolpix 7900. Of course, it can also be used for dry-land photography. The flash module is powered by a 1.5-V battery, which must supply approxi- mately 30 to 40 mA to charge the capaci- tor. The control por- tion is built around a PIC12F675, which is powered by a 3-V button cell. Its current con- sumption is practically negligible— just a few milliamperes while the flash is active and only 600 nA the rest of the time, when the micro- controller is in the standby state. For this rea- son, the unit does not have an on/off button. The flash from the Fuji camera is triggered by a mechanical contact that is actuated at the same time as the camera shutter. Here this contact is replaced by an MCR-100-8 thyris- tor with a 1 -l<£2 resistor in series with the gate. These two components are fitted directly on the Fuji flash module. There are many different types of disposable camera, each with its own type of flash mod- ule. However, these modules are all similar, so you can easily adapt the design described here to whatever type you can put your hands on. Pay attention to the voltages, and don’t forget to connect the grounds of the flash PCB and the logic circuitry together. Sche- matics for many of these flash modules are often available on the Web, so it shouldn’t be difficult to find something close to what you actually have. The firmware [2] has three operating modes: manual, pseudo-TTL (through the lens, which means that the light level is measured through the lens) and sleep. In manual mode the flash it triggered when you press the shut- ter button. In pseudo-TTL mode there are a few short flashes before the main flash (com- monly used for red-eye reduction). The num- ber of pre-flashes varies from one camera to the next, and even from one shot to the next. In pseudo-TTL mode, the firmware gets around this problem by waiting for 100 ms after the first flash before it tries to detect the exposure flash. LED D1 lights up if the pre- flash has been detected but the main flash has not been detected after the 100-ms delay. The contribution of the slave flash to the expo- sure of the subject is not included in the meas- urement made by the camera, but instead simply adds to the light from the master flash - hence the designation ‘pseudo-TTL’. Although the author considered the option of a true TTL design, or at least adjustable flash intensity, this requires a very specific transistor (25AAJ8 or equivalent) that is very difficult to obtain. (100584-1) Internet Links [1 ] http://en.wikipedia.org/wiki/ Guide_number [2] www.elektor.com/ 1 00584 elektor 7/8-2011 35 Measurement Filter for Class D Ton Giesberts (Elektor Labs) This filter is an improved version of a filter published six years ago in Elektor (Passive 9 th Order Elliptical Filter, July/August 2005, [1]). At the time, this filter was designed for carry out measurements on a Class T power ampli- fier (Elektor ClariTy, June 2004, [2]). The accu- racy of our measuring equipment was found to get worse when the frequency compo- nents above 200 kHz became too strong, hence the need to remove these with a very steep filter. The aim of the present design is to create a filter that has less distortion at 20 kHz and which can cope with higher voltages, so that it also becomes suitable for more power- ful Class D power amplifiers. The theoretical values have remained the same as those in the original circuit, and the circuit itself has hardly changed. The biggest improvement is in the way the inductors are made. These are now substantially larger and have an air-gap, which reduces the distortion. The number of turns for each coil was derived using the stated value of the inductivity factor of the core material (A L ). If you have an accu- rate inductance meter, you could measure the coil before soldering it onto the PCB. It won’t always be possible to obtain the exact values for the coils because the smallest change in the winding is halfa turn. Measure the wound coil and calculate the real A L value using the formula: A l = L//V 2 where L is the measured inductance and N is the number of windings. You can then recal- culate the number of turns using the new A L value, which should give you a more accurate number. Should fewerturns be required, you can simply remove them from the coil. Should you need more, you can add a new wind- ing to a connection and connect the end to a third pin. Look carefully at the PCB layout (can be downloaded freely from [3]) to find out between which pins the coils have to be connected. On either side of the coil former is a row of six +3 + 0 -3 -6 -9 -12 d - 15 B -18 r -21 A -24 -27 -30 -33 -36 -39 Ap) \ \ -4 i. 20 50 100 200 500 lk 2k 5k 10k 20k 50k 100k 200k HZ 100540-12 36 7 / 8-2011 elektor connection pins. Three pins on one side are always connected to three pins on the other side. The most practical approach is to con- nect the ends of the coil to the two pins at the front, pin 1 and pin 12. When the induct- ance value has to be corrected and some turns have to be added, the extra winding can be connected to the first and second (or eleventh and twelfth) pins. The first (twelfth) pin, to which the coil was originally con- nected should then be cut back to the for- mer, so that it can no longer make any con- tact with the PCB. With the coils that we made for our proto- type we had to adjust three of the four in this way. The measured values for LI through L4 in our case were: 1.16 mH, 689 pH, 555 pH and 816 pH. The frequency response of the passband can be seen in Figure A. The amplitude at 20 kHz is attenuated by only 0.17 dB (compared with 1 kHz) and 39 dB at 204 kHz. When we com- pare the response with frequency response B from the July/August 2005 article, you can see that there is less ripple up to 1 80 kHz. The rea- son for this can be found in the lower Q fac- tor of the coils now used, which makes the graph deviate slightly from the theoretical ripple that is common to elliptical filters. The frequency response of the passband and the stopband can be seen in Figure B. The frequencies in the stopband are, apart from a little bump around 800 kHz, attenu- ated by more than 60 dB. The bump is caused by the various component tolerances, includ- ing those of the 1 % capacitors. We tested the filter with the maximum out- put voltage of our analyser, which is 13 V. COMPONENT LIST Resistors R1 ,R3 = 1 k£l, 5%, 7 W (Tyco Electronics ER581K0JT) R2 = 59£1, 1%, 0.6W* PI = 1 00£2, 1 0 %, 0.5W, 24 turn trimpot (Vishay Spectrol M64W1 01 KB40) Capacitors C1,C14,C18 = not used C2,C5,C1 1 ,C1 3 = 1 nF, 1 %, 500V, silver mica (Cornell Dubilier CD1 9FD1 02FO3F) C3,C8,C1 2 = 1 20pF, 1 %, 500V, silver mica (Cornell Dubilier CD1 5FD1 21 F03F) C4 = 6 . 8 pF, 1 %, 500V, silver mica (Cornell Dubilier CD1 5CD(6.8)D03F) C6,C1 5 = 270pF, 1 %, 500 V, silver mica (Cornell Dubilier CD1 5FD271 F03F) C7,C9,C1 7 = 680pF, 1 %, 500V, silver mica (Cornell Dubilier CD19FD681F03F) Cl 0 = 1 80pF, 1 %, 500V, silver mica (Cornell Dubilier CD15FD181F03F) Cl 6 = 220pF, 1 %, 500V, silver mica (Cornell Dubilier CD1 5FD221 F03F) Cl 9 = 5-57pF PTFE trimmer, 250V, (Vishay BCcomponents BFC2 809 08003) Inductors (incl. materials) LI = 1 .1 5mH, 85 turns 0.8 mm enamelled copper wire* L2 = 689pH, 65.5 turns 0.8 mm enamelled copper wire* L3 = 557pH, 59 turns 0.8 mm enamelled copper wire* L4 = 802pH, 71 turns 0.8 mm enamelled copper wire* L1-L4 core = RM14 core set, 160nH (A L ) N41 (Epcos B65887E160A41), e.g. RS Components #212-6772 RM14 1 2-pin coil former (Epcos B65888C1 51 2T1 ), e.g. RS #212-6839 RM 14 clamp, stainless steel spring (Epcos B65888A2002X, 2 per coil), e.g. RS Components #647-9323 RM 14 isolation washer, base (Epcos B65888B2005X), e.g. RS Components #1 80- 121 0.8 mm enamelled copper wire (Pro Power ECW0.80). Nearest US equivalent: AWG20 Miscellaneous K1 ,l<2 = BNC socket, PSB mount, angled, 75£2 (Tyco Electronics 1-1478032-0) Locking washer, BNC/TNC (Tyco Electronics 1-1634817-0) Nut, BNC/TNC (Tyco Electronics 1 -1 634816-0) * see text elektor 7 / 8-2011 37 10 5 2 1 0.5 0.2 0.1 0.05 % 0.02 0.01 0.005 0.002 0.001 0.0005 0.0002 U.UUU1 20 50 100 200 500 lk 2k 5k 10k 20k |_| z 100540 - 14 C The distortion caused by the fil- ter at this voltage can be seen in Figure C. The graph is just about the same as the bottom meas- urement limit of our analyser. At some point in the future we’d like to develop a separate ampli- fier that is able to output 70 V rms at 20 kHz with an extremely low distortion figure. We’ll then be back with a graph that shows the input voltage against dis- tortion. The distortion at 1 kHz and a bandwidth of 22 kHz is less than 0.00018%. With a band- width of 80 kHz the distortion plus noise (THD+N) increases slightly to about 0.00028%. The distortion at 20 kHz and a bandwidth of 80 kHz is about 0.0004%. Since the filter was designed to cope with higher voltages we had to use power resis- tors. With a voltage of 70 V rms across 1 k £1 the power is about 5 watts; the recommended resistors in the parts list are rated at 7 watts. The input resistor is a combination of a power resistor and a smaller resistor. We suggest that you measure the value of R1 and then cal- culate the value for R2. The sum of their val- ues should be 1060 £ 1 . In our prototype we had to replace R2 with a resistor of 73.2 £1, to compensate for the tolerance of R1 . At the output of the circuit, multiturn trimpot PI can be used to set an attenuation of 2 at 1 kHz. Capacitor C19 can be used to compen- sate forthe parasitic capacitance of the cable and the input of the analyser, although this has more of a theoretical benefit than a practical one. When you build this filter you have to make sure that you buy the correct set of cores (see the part numbers in the parts list). There are other cores with dif- ferent sizes of the air gap and there some without an air gap at all. We have chosen the big- gest air gap (smallest A L value). This means that more turns have to be wound, with the result that the coil can be wound closer to the required theoretical induct- ance. Another advantage of the air gap is that the tolerance in the inductivity factor (A l ) is only ±3%. Without the air gap it’s stated as +30/— 20% ! (100540) Internet Links [1] www.elektor.com/ 044042 [ 2 ] www.elektor.com/030217 [3] www.elektor.com/ 1 00540 WAV Doorbell by Michael Gaus (Germany) This electronic doorbell is essentially a small WAV file player based around an ATmega328P. When a guest presses the bellpush the device is activated and plays out a short WAV file using its built-in PWM module. This means that you can customise the sound of your doorbell in just the same way as you can the ringtone on your mobile phone. What’s more, you can load any sound you like into the device. The WAV file is stored in the on- chip flash memory in the microcontroller: no external storage is necessary. To keep the number of components to a mini- mum, we have dispensed with the sort of low- pass filter that would normally be required on the PWM output of the AVR microcontroller. Instead we simply connect to a small loud- speaker via just an electrolytic and a series resistor. Note that it would not be appropri- ate to connect the PWM signal directly to an amplifier or to powered speakers without a proper low-pass filter, as distortion can result. When power is applied the unit immediately LP2950CZ-5.0 BT1 £ 9V 5 +5V © C2 □ lu 16V C3 14 15 16 17 18 19 lOOn - 20 AVCC PBO(ICPl) PBI(OCIA) PB2(SS/OClB) PB3(MOSI/OC2) PB4(MISO) IC1 PB5(SCK) VCC PC6(RESET) PDO(RXD) PDl(TXD) PD2(INT0) ATMEGA328P pd3(inti) PCO(ADCO) PCl(ADCl) PC2(ADC2) PC3(ADC3) PC4(ADC4/SDA) PC5(ADC5/SCL) GND XTAL1 (DIP) PD4(XCK/T0) PD5(T1) PD6(AIN0) PD7(AIN1) XTAL2 AREF GND 22 10 8 5 6 11 12 13 21 PI V100R Cl ] lOOu 16V LSI 1 SI / N a 8Q 110080 - 11 38 7 / 8-2011 elektor plays the stored doorbell sound, and the AVR microcontroller then enters a low-power standby mode. Pressing the bellpush button causes the microcontroller to leave standby mode and play the WAV file again. The WAV file must have the following char- acteristics: ‘RIFF WAVE’ format, 8 bits per sample, mono, and a sample rate of 8 kHz. The ATmega328P has a total of 32 Kbytes of flash memory, of which 1 Kbyte is reserved for the firmware. This leaves 31744 bytes for the WAV file, enough for an audio file with a length of nearly four seconds. The firmware occupies the address range from 0x0000 to 0x03FF, and the WAV data start at 0x0400. If the audio file is not available in the PCM WAV format described above, the freeware tool Audacity [1] can be used to convert it. Open the original file in Audacity and set the ‘project rate’ to 8000 Hz in the bottom left- hand corner of the window. It is also possible to select parts of the waveform (such as peri- ods of silence at the start or end) and delete them. To convert from stereo format to mono, click on the small arrow in the box con- taining the file name and select ‘Split stereo track’. Then the right channel can for example be deleted with a click on the ‘X’ and the left channel can be converted to mono by click- ing on the small ‘Mono’ arrow. Under ‘Edit > Preferences’ the export file format must be set to ‘WAV (Microsoft 8-bit PCM)’, which is uncompressed. To save the file, select the desired region and click on ‘Export as WAV’ in the ‘File’ menu. This should result in a suit- able file. To confirm this, right-click on the file in Windows Explorer and check the format in the file information under ‘Properties’. The tool ‘hex2bin’ [2] is used to convert the WAV file into a hex file suitable for program- ming into the ATmega328P. The tool takes the binary WAV-format file, changes it to Intel hex format, and inserts the result into the hex file that contains the AVR code. The output of the tool is thus a single hex file that contains both the firmware and the WAV file information that need to be programmed into the ATmega328P. The whole conversion process can be set in train using the ‘convert, bat’ batch file. The firmware determines the length of the WAV file from its header information and uses this to play out the contents of the file for the correct duration. A ready-made hex file, called ‘tuergong.hex’, comprising both the firmware and a WAV file making a ‘ding-dong’ sound is available free in the ZIP archive accompanying this project. This hex file can be programmed directly into the ATmega328P. The hex file ‘code. hex’ in the directory ‘firmware/default’ contains just the firmware, with no built-in WAV file. This is the place to start if you want to incorporate your own WAV file, combining it with this hex file using the batch script mentioned above. The code for the ATmega328P was developed in AVR Studio using the free WinAVR C com- piler. The complete project, including the hex file, can be found in the ‘firmware’ direc- tory in the ZIP archive, which in turn can be downloaded at [3]. The fuse bits in the AVR must be programmed as follows: low fuse byte: 0xE2; high fuse byte: 0xD9; extended fuse byte: OxFF. (110080) Internet Links [1 ] http://audacity.sourceforge.net/ [2] http://hex2bin.sourceforge.net/ [3] www.elektor.com/ 1 1 0080 USB Charger using Pedal Power By Werner Wille (Germany) Keen cyclists will no doubt have sometimes thought that it would be nice to have some kind of on-board power supply to charge a mobile device such as a phone or a satnav while on the road. The circuit described here shows to how this can be achieved quite sim- ply, using power from the bicycle’s dynamo and a switching regulator. The alternating voltage delivered by the bicy- cle’s dynamo is converted to DC using a full- wave rectifier (comprising diodes D1 to D4) and a smoothing electrolytic (Cl). We have chosen Schottky diodes for the bridge recti- fier as their forward voltage drop is only about half that of normal silicon diodes (approxi- mately 0.3 V rather than 0.75 V per diode at 1 A). This is all the more important because the LT1076-CT5 switching regulator requires an input voltage of at least about 8 V to pro- ering or charging mobile devices using their charged up to the peak value of the alternat- videa regulated 5 V output suitable for pow- USB connector. Smoothing capacitor Cl is ing voltage delivered by the dynamo; for most i K1 G1 6V/3W <> IC1 ^ LT1076-CT5 FB L C Cl □ lOOOu 35V + UuSB © R1 D5 ^33 C2 33n D1...D5 = SB540 C3 470u 16V I K2 O +5V O D- D + O gnd USB-A 100676 - 11 elektor 7/8-2011 39 hub dynamos the typical peak output voltage is in excess of 1 0 V. Under load the typical volt- age is of course lower, but still enough for the LT1076-CT5 as long as Schottky diodes are used and Cl has a value of at least 1 000 pF. The LT1076-CT5 is an integrated 2 A step- down converter whose output voltage is automatically fixed at 5 V if the feedback connection FB (pin 1 on the 1C) is connected directly to the output voltage at electrolytic C3. As with all switching regulator designs, C3 should have a low ESR (equivalent series resistance): the Panasonic FC series of capac- itors is suitable. The circuit arrangement generally reflects the recommendations in the Linear Technology datasheet [1]. The 100 pH inductor used for LI should be rated for a DC current of at least 1 A (DC resistance less than 0.3 £ 2 ). The circuit can easily be constructed on per- forated prototyping board. The USB out- put cable can be fashioned by cutting a USB extension cable in two and soldering the bare ends of the part with the USB socket to the output terminals on the board. It is of course important to observe correct polarity! To protect the circuit against the elements it is a good idea to pot the whole thing in resin once the USB cable has been soldered and secured using a strain relief. ( 100676 ) Internet Link [i] www.linear.com/product/LT1 076-5 ATM1 8 Youth Repellent By Gregory Ester (France) From what’s written on the cover of Bert van Dam’s book entitled “50 New Applications for PIC Microcon- trollers” [ 1 ], some ofyou mightthink that the projects, which address pro- gramming 16/18 PICs in JAL in a well- paced and very detailed way, are not really compatible with your favour- ite processor and programming lan- guage. But then again, maybe you’d like to produce all these applications without diving into a new language and without investing in a new pro- grammer. So, why not draw inspira- tion from the author’s ideas, while still remaining faithful to your usual s/w tools and h/w bits? It would be a shame to pass up on a good, appeal- ing project. The description of the youth repel- lent circuit described here begins with these words: “Have you ever dreamt of a non-violent way of driving away those groups of noisy indolent youngsters who are always hanging about under you peaceful windows? [...] If you are an adoles- cent, this project will enable you to produce a secret signal, inaudible to adults!” The very high-pitched sound at 16 kHz that generated by this project will be unpleasant above all for adolescents and young children whose hearing is still unimpaired. The princi- pal ingredients are an ATM18 board [2] and a sounder connected to PC0 on the ATM18 in series with a 100 £1 resistor. Sprinkle the TimerO is used to produce a square- wave signal at a defined frequency. The timer is incremented each time a pulse is received, and an interrupt is triggered when the register over- flows. The register containing the state of the counter is write-acces- sible, so it is possible to set an ini- tial preloaded value that will mod- ify the overload frequency. Since the overflow resets the counter to zero, the interrupt routine will need to load the register each time with the starting value. The 16 MHz quartz crystal clock frequency requires the use of a prescaler. Pre-dividing by 8 , and if PC0 is inverted each time timerO overflows, the formula f = 1 6 x 1 o 6 / 8 / preload_value / 2 whole thing with a little firmware writ- ten in BASCOM-AVR and we get our ‘youth repellent’. The piezoelectric sounder has a diaphragm connected to a crystal. Here one pin of the microcontroller is employed to make this diaphragm vibrate at a certain frequency and thus emit a sound that we’re going to arrange to make unbearable. will enable you to directly obtain the sound frequency as a function of preload_value. In theory, a value of 62 will allow generation of a fre- quency of 16.1 kHz. However, the tasks inherent to the operation of the take a certain amount of time, leading to a differ- ence between the theory and reality. So in practice, you need to use a preload_value of 55 to arrive at a frequency of 1 6.1 kHz. If you are an adult over 30, your hearing is liable to not be sensitive to the sound emit- ted, so how to go about testing this circuit? Well, by using a software spectrum analyser 40 7 / 8-2011 elektor offered free by Bert van Dam. The circuit suggested by Bert lets you reduce the sound card’s maximum microphone input voltage from 5 to around 0.9 V. Take care, a wiring error here could cause irreparable damage to your PC. After downloading and unzipping the file (available free from [ 1 ]), copy/paste the file VBRUN300.DLL from the ‘Signal Generator’ folder into the ‘Frequency Analyser’ folder. Your PC’s microphone must be enabled and the volume control set to maximum. Before powering up the whole assembly, set potentiometer PI of the protection interface to zero. Double-click on the executable file Analyser.exe, then click on ‘Run’ to start the program. Turn the potentiometer until a peak appears in the signal. Click with your mouse near the peak to move the blue line. The lit- tle red line shown in the screen shot will look for the strongest signal in the vicinity of the blue line. The values are visible at the bottom right, next to the ‘Stop’ button. Once this project is finished, do like Bert, wait until your children come to visit you in your study, innocently power up the circuit, and wait... You won’t have to wait long for their reactions and there’s no appeal against the verdict: your repellent works! (110397) Note: the use of this sort of device is prohib- ited in certain countries. Internet Links [1] www.elektor.com/products/books/ microcontrollers/50-pic-microcontroller- projects. 1350471 .lynkx [2] ww.elektor.com/071035 [3] www.elektor.com/ 1 10397 Voltage Limiter for Guitar Amplifiers By Alfred Rosenkranzer (Germany) Guitar amplifiers using output devices such as the TDA7293 (100 W) or LM3886 (68 W) are surprisingly often damaged as a result of excessive supply voltage in the quiescent state. The transformers are often used so close to their specification that this problem can even be caused by a high mains input volt- age. In most countries the domestic AC outlet voltage is permitted to rise as high 1 0 % above the nominal (published) value. Since replacing the transformer is not an attractive proposition, the author developed a relatively simple electronic solution to the overvoltage problem: a voltage limiter for the symmetric supply to the amplifier. The circuit is based on the classical voltage regulator arrangement of a Zener diode con- nected to the base of a pass transistor. How- ever, in this version we replace the conven- tional bipolartransistor with a power MOSFET. The circuit is symmetrical with respect to the negative and positive supplies, and so we shall only describe the positive half. The input voltage (at most 50 V) supplies the chain of Zener diodes D1, D2 and D3 via resis- tor R3. The resistor limits the current through the Zener diodes to about 5 mA. The series connection of Zener diodes has the advantage that their dissipation is divided among them, as well as giving more options for the total voltage drop by judicious selec- tion of individual components. The sum of the diode voltages (39 V with the values given) must be greaterthan the desired limiting out- put voltage by the gate-source voltage of the MOSFET. Cl smooths the voltage across the Zener diode chain. The circuit therefore not only limits the voltage, but also reduces the ripple (hum component) on the supply. The gate of the HEXFET is driven via R1. In con- junction with C4, this prevents the FET from oscillating. Without any load the output voltage is rather higherthan expected. With a small load, such as that presented by the output stage in its quiescent state, it falls to the desired value. The circuit then does not provide regulation of the output voltage, but rather a stabilisa- tion function. The operation of the negative half of the cir- cuit is identical to that of the positive half apart from the polarity of the voltages, and hence a P-channel MOSFET must be used there. It is worth noting that there is a relatively large degree of variation (up to a few volts) in the gate-source voltage of the HEXFETs used. This can be compensated for by select- ing the Zener diodes in the chain and the cur- rent through them, but for most applications the exact voltage at which limiting begins to occur will not be critical. The HEXFETs must be provided with adequate cooling. If possible, they can be attached to +V|N 0 0 -V|N IRFP240 R3 — | 2k2 \ D1 BZX84-12, D2 BZX84-12 . D3 BZX84-15, Cl □ X D6 BZX84-15 D5 BZX84-12 D4 BZX84-12 lOu C3 □ — | 2k2 \ R4 lOu +V0UT -0 C4 lOOn 0 C2 lOOn IRFP9240 0 -VOUT 110083 - 11 the heatsink already present in the ampli- fier; otherwise, a separate heatsink will be required. A thermal rating of 2.5 K/W will be suitable. ( 110083 ) elektor 7 / 8-2011 4i Sixties-style 40 W Audio Amplifier By Joseph Kreutz (Germany) In the early 1960s RCA brought out a transis- tor that was to become truly legendary: the 2N3055. With a pair of these devices, you could put together an audio power amplifier that could deliver a healthy 40 W into 8 £ 1 . The circuit described here is fully in tune with the spirit of that era. For example, there are only seven active components in each channel, which reflects the design simplicity typical of that era (and actually a timeless quality). This ‘retro’ power amplifier pumps 45 W into 8 £1 with an input signal level of 0.5 V rms . It works as follows: the input signal is applied to the base of T1, while negative feedback from the output, attenuated by voltage divider R5/R6, is applied to the emitter of T1. The collector current of T1, which is propor- tional to the difference between the input and feedback signals, is fed to the base of T2. This transistor draws its operating cur- rent through R8 and R9 and provides voltage gain. Capacitor C6 is a bootstrap capacitor that hold the voltage across R9 nearly con- stant, so that the current through R9 is inde- pendent of the amplifier output signal level in the audio band. Transistors T4-T7 form a quasi-complemen- tary push-pull output stage. In the early 1960s, there simply wasn’t any PNP transis- tor available that was truly complementary to the 2N3055. Designers came up with an ingenious way to get round this problem, which was to use a complementary Darling- ton pair consisting of a PNP driver transistor and an NPN power transistor. The schematic diagram clearly illustrates what is meant by a quasi-complementary push-pull out- put stage. Diode D1 provides balanced bias- ing for the output stage, which helps reduce distortion. The operating point of the output stage is set and stabilised by transistor T3, which for this reason should be thermally coupled to the output transistors. The amplifier is powered from a single supply voltage at approximately 65 V, which is also ‘typical sixties’. Capacitor Cl, with a value of 4700 jliF, transfers the sig- nal from the output stage to the load and provides a bit of protection for the speaker in case one of the transistors fails. The amplifier does not have output current limiting. Although this is not a critical short- coming, a certain amount of caution is advis- able. The only protection in this regard is pro- vided by a slow-acting 1 .6-A fuse in the supply FI VPP VPP Performance figures with an 8.2 £1 resistive load (indicative values) THD 0.08%; third harmonic at 1400 Hz; output level 3 V Bandwith 29 Hz (-3 dB) to over 100 kHz (-0.5 dB) at an output level of 3 Vrms -3 dB at 100 kHz referred to 18 Vat 1.0 kHz Maximum output voltage 19.5 V atthe saturation threshold line, which is intended to limit the damage if anything goes wrong. The power supply consists of a transformer, a bridge rectifier, four small capacitors and a 4700 juF electrolytic capacitor. This is enough to power a two-channel stereo amplifier. The LED is a power-on indicator and is intended to be fitted on the front panel. Assembling the circuit is very straightfor- ward. Transistors T3, T4 and T5 should be fit- ted with heat sinks suitable for a T0126 pack- age and with a thermal resistance less than 20 K/W. Transistors T2, T6 and T7 should all be fitted on a single heat sink with a thermal 42 7/8-2011 elektor resistance of 2 K/W or less, using insulating washers and thermal paste. Before applying power to the circuit for the first time, set P2 to its maximum value, tem- porarily replace the fuse with a 47 £2, 5 W resistor, and connect a voltmeter across R17. Then switch on the power. The voltmeter should indicate 0 V. Now care- fully adjust P2 until the voltmeter reads 1 5 mV, which corresponds to a quiescent cur- rent of 50 mA. Then switch off the power and install the fuse in place of the power resistor. Afterthis, check the voltage across R17 again (with the power on) and if necessary adjust it to 1 5 mV. This is fun DIY project, cheap and unpreten- tious. Nevertheless, the sound quality of this amplifier is respectable. The distortion level gives no grounds for complaint. Of course, it’s not a figure with an incredible number of zeros afterthe decimal point, but the idea here is to brush up on sixties technology. The author has designed two PCB layouts: one forthe amplifier and one forthe power supply. The layouts can be downloaded from [1] in PDF, Gerber and/or Easy-PC CAD format. (110332-1) Internet Link [i] www.elektor.coml/ 1 1 0332 Belgian Earth Fault Detector By Marc Mertz (Belgium) Having been affected by earth fault accidents, the author put together this little circuit. It consist of just three elements: the neon with its original resistor — for example, salvaged from the switch on an AC power bar — and a small capacitor (class Y) salvaged from the electron- ics of a low-consumption lamp. A larger capac- itance makes the neon glow brighter. All this for no money at all. The neon lights only when there is an efficient Earth present. This works well at the author’s home, with Live or Neu- tral either way round. In the Elektor labora- tory based in The Netherlands, some concerns were expressed as described in the June 2011 issue [1 ], as the circuit was sensitive to the rel- ative positions of the Live and Neutral. So the Earth fault detector can also be used as a Phase detector, but probably in Belgium only. The whole thing can easily be incorporated into a power socket; the author used a small transparent cover to protect the neon. (110218) Note. As opposed to the UK and the US, some AC poweroutlets in Belgium — and all inThe Netherlands — are not polarized, i.e. AC power plugs (both earthed and non-earthed) can be inserted either way around. Internet link [1 ] www.elektor.com/ 1 1 0396 Wire Loop Game By Andreas Binner (Germany) In the ‘Wire Loop Game’, a test of dexterity, the player has to pass a metal hoop along a twisted piece of wire without letting the hoop touch the wire. Usually all the associated elec- tronics does is ring a bell to indicate when the player has lost. The version described here has a few extra features to make things a bit more exciting, adding a time limit to the game and a ticking sound during play. Two 555 timer ICs are used to provide these functions. IC1 is configured as a monosta- ble which controls the time allowed for the game, adjustable using potentiometer PI . IC2 is a multivibrator to provide the ticking and the continuous buzz that indicates when the player has touched the wire with the hoop. When the monostable is in its steady state, the output of IC1 (pin 3) is low. T1 acts as an inverter, and D2 is thus forward biased. R 8 and R4 are therefore effectively in paral- lel, with the result that IC2 produces a low elektor 7 / 8-2011 43 audible tone. The value of R4 is considerably greater than that of R 8 , and so the frequency of the buzz generated by IC2 is chiefly deter- mined by the value of R 8 . When the monostable is triggered, the high level at the output of IC1 is again inverted by T1 . D2 is reverse biased and so R 8 is effec- tively removed from the circuit. The fre- quency of IC2 is now largely determined by the value of R4. The ratio of R4 to R5 and the value of C4 affect the mark and space peri- ods for the multivibrator: for a satisfactory ticking sound short pulses with long gaps between work well. Whether a sound is produced also depends on the voltage on pin 4 of IC2. When the 9 V supply is connected the monostable is ini- tially inactive and there is no voltage across Cl . Pin 4 (reset) on IC2 is thus low and no tone is produced. IC1 is activated by a brief press of SI , which generates a low-going trigger signal on pin 2 to start the game. Cl now charges via D1 and IC2 is allowed to oscillate, generating the ticking sound. The pulse width of the monostable sets the game duration, and can be adjusted using PI. If the allowed time expires, or if the reset inputto IC1 is taken low (which happens when By Lars Keuninckx (Free University of Brussels, Belgium) The circuit described here is a chaotic ver- sion of a conventional phase shift oscillator. The nice thing about it is that it is simple and cheap. In addition, it operates from a single supply voltage and none of the component values are especially critical. Without the components inside the dashed out- (iff J J) // \ 1 // ] / If // 11 1 m, | | i 05* 02* H“V the hoop touches the wire), the monostable returns to the quiescent state. This causes IC2 to generate the low buzz sound. D1 is now reverse biased and Cl discharges through the relatively high-valued resistor R9. After a few seconds the voltage across Cl falls sufficiently that the buzz stops and the circuit is ready for the next player. The circuit can be built first on a breadboard, so that the component values can easily be line, the circuit oscillates stably with a distorted sine-wave signal on the collector of T1. The three RC networks produce a net phase shift of 1 80 degrees at the operating frequency, which combines with the phase shift (signal inversion) of transistorTI to maintain oscillation. Adding the components inside the dashed outline results in a quite different situation. The amplitude rises while the oscillator is starting up, and at certain level this causes T2 to go into conduction. This in turn causes resistor R 6 to be included in the feedback path, which disturbs the phase relationship and forces the circuit to try to find a different stable operating point. Under the right conditions this can lead to chaotic operation, in which the circuit does not reach a stable state but instead passes through a succession of closely spaced unsta- ble states. These paths form what is called an changed to suit particular preferences for game duration and buzz pitch. When suitable values have been selected the circuit can be built more permanently on a printed circuit board. The author used a sheet of plywood to form a base for the game, the twisted wire being fixed to the board and wired to the elec- tronics mounted below it. ( 110100 ) 3 Chaos Generator 44 7 / 8-2011 elektor ‘attractor’, which can be readily displayed on an oscilloscope operating in X/Y mode with the following settings: Channel 1: X, AC, 0.5 V/div Channel 2: Y, AC, 20 mV/div V cc : 6 to 1 6 V By playing with the setting of potentiometer PI and the value of the supply voltage, you can force the circuit to depart from stable oscilla- tion and enter chaotic mode at half the previ- ous frequency. This causes very interesting pat- terns on the oscilloscope (see photo). You can strongly influence the shape of the attractor by adjusting the values of PI , R6, C5 and the sup- ply voltage. The circuit has four components that are able to store energy, which makes its phase space four-dimensional. What you see on the oscil- loscope screen is a two-dimensional pro- jection of an attractor in four-dimensional phase space. Other dimensions can be made visible by connecting the probes to other points, such as Y and Z instead of X and Y. (110107-1) Power Controller for Electric Convector Heaters 110185 - 11 By Gerard Guiheneuf (France) In Autumn or Spring, the weather may be warm enough that we’d like to save money by shutting down the main heating system in our home and just use supplementary heat- ing based on one or more electric convector heaters. Even though these convectors are quite heavy consumers of electricity, this can be reduced by fitting a power controller between the heaters and the AC power outlet, which will affect the effective power consumption of the convectors. The circuit diagram is based around the use of the emblematic NE555 1C, used here as an astable multivibrator with variable duty cycle (D = t high / T), but at a fixed operating frequency, given by: f= 1 / (0.693 x Pi x C6) = 0.0654 Hz The duty cycle D of the signal at the output (pin 3) of IC2 will change depending on the position of the wiper of potentiometer PI : • If the wiper is at mid-travel, the duty cycle D will be 0.5; • If the wiper is at the +12 V end, the IC2 output signal is zero and hence D = 0; • If the wiper position takes it down to the voltage on C6, IC2’s output supplies a constant voltage of around 11 V and D = 1. By way of transistor T1, IC2 drives two MOC3021 phototriacs (IC3 & IC4) which provide the isolation between the circuit’s ‘driver’ section and the ‘power’ section, which is directly connected to the AC powerlines. Each phototriac drives a power triac (TRI1 & TRI2). These two triacs are fitted in parallel and share the task of supplying the convector (/? L ): one triac supplies the positive half-cycle while the other triac supplies the negative half-cycle. The over-rating of the triacs (high rms current rating: 1 6 A) combined with their use in parallel and the alternating switching is elektor 7/8-2011 45 aimed at reducing heating in the two compo- nents and reducing the bulk of the heatsinks employed. Experimentally, this solution gives rise to low heating of the heatsinks when the controller is powering a 2 kW-rated convector constantly (duty cycle D = 1). The power consumed by the convector with controller is easy to calculate from the sim- ple formula RGB Solar Lamp By Marcel Ochsendorf (Germany) This deluxe solar-powered light uses a battery and solar cells sal- vaged from a solar lamp with a four- cell battery (4.8 V nominal terminal voltage). The circuit can operate from any DC voltage around this value and its current consumption, at 20 mA, is low. This means that the battery can give up to five days of operation. The circuit consists of an Atmel ATtiny microcontroller which drives a red, a green and a blue LED directly from three port pins. Series resis- tors are of course included to limit the LED current. The microcontroller drives the LEDs in sequence to produce an RGB running light effect. The microcontroller is also responsible for ensuring that the light By Burkhard Kainka (Germany) The first circuit in Figure 1 shows a particularly simple LED flasher for AC power operation with six channels. All six LEDs flash entirely at ran- dom (not synchronised), producing a totally chaotic display. This must be the ultimate low energy lamp bulb, consuming a mere 0.2 watts or so. To see it in action take a look at my short video [1] on the Internet. The project employs my NPN multivibrator cir- W= PxtxD where W= power consumed in watt-hours (Wh); P = rated convector power in watts (W); T = operating time of the convector/controller unit in hours (h); D = duty cycle set by potentiometer PI . automatically switches on when it gets dark and off when it is light. The light sensor is made from one of the solar cells from a bro- cuit described elsewhere in this issue. Each of the six NPN multivibrator circuits (connected here in series) draws the same loading current. By varying the value of the electrolytic capaci- tors you can change the flashing frequency and brightness. You can make the circuit flash more slowly if you select a value higher than 100 k L 100938 - 11 o C> +12V 5V...24V — a |~R4~ R2 100R I — * -| 220R | — D1 t z 47 u 35V 5V0 IC1 i 4N28 R3 tU -t*— i — T — r - ®^ pJLL n? C3 02 lOOn = X IR5 T1 3 © 2N2222 P600D Rl ©^ C2 □ D3 9 9 P600D 470u 25V © 100938 - 12 PI U r Rl IC1.A IC1.B 14 JT & ci 2u2 16V Si JT & si IC1.C JT & Vl0 IC1.D 12 13 JT & si! ICl = 4093 12 T1 f ( + +12V © D2 C2 X s P600D C3 D1 i x 100n P600D 470u 25V ■o<> L <► — © when dropping about 1 cm. Constructing is easy. Cut off a piece of about 10 mm of copper tubing. Take a piece of con- ductive foam, the kind used to protect inte- grated circuits. Cut a rectangular piece of 10 x 50 mm. Roll up firmly until it can be push- fitted securely into the copper cylinder. Then insert a conductive wire through the centre of the cylinder, bend it and (optionally) add pro- tective plastic sleeving to each side. This is the first contact. Finally, solder a thin wire to the copper cylinder. This is the second contact. The foam resistance is pressure depend- ent. Consequently, when the device moves due to an external force, the inertia of the cylinder causes varying pressure in the foam, resulting in a small change of resist- ance between the inner conductor and the cylinder. Because of that, it’s impor- tant to ensure the cylinder vibration is not CK 8 § CO R2 Cl HI 10n R1 R2 R3 J-X Vcc <±) D1 ^^5 ICl cr l 5 0 / 0 V8/ Hr < 2 > 100588 - 11 restricted in anyway by the connecting wire or the PCB. The comparator circuit shown here is capa- ble of resolving the resistance change of the proposed foam/wire/copper sensor, allowing it to detect the motion of a vehicle for alarm or other purposes. (100588) Repeatable COM Port Enumeration By Michael Gaus (Germany) The popular FTDI FT232R USB UART con- verter chip is used in many projects where a USB interface is required. However, there is an unfortunate effect that occurs if you use many peripherals with this device in them on one computer simultaneously. When the computer enumerates its USB peripherals it assigns COM port numbers to the devices in ascending order as it detects them: this means that the COM port number of each board needs to be set manually each time in the corresponding software. It would be much more convenient if each physical USB port on the PC always corresponded to the same COM port number. Luckily, there is a way to do this. During manufacture the USB converter chip is programmed not only with a vendor ID (VID) and a product ID (PID) but also a unique serial number in its on-chip EEPROM [1]. When Win- dows detects a device with a new VID, PID and 60 7 / 8-2011 elektor serial number it kicks off the familiar ‘new hardware found’ process and automatically allocates a new COM port number. The handy tool ‘FT_Prog’ (available for free download from the manufacturer’s web- site [2]) allows the FT232R to be reconfig- ured in a simple way to avoid the serial num- ber being taken into account during enumer- ation [3]. The procedure is as follows. 1 . Connect the FT232R to the USB port. Since in a factory-fresh FT232R the serial num- ber is still ‘enabled’, the device will as usual be allocated the next available COM port number. 2. Start up the ‘FT_Prog’ tool. Make sure that the virtual COM port allocated to the FT232R device in question is not being kept open by a terminal program or other application software. 3. Under ‘Devices’ click on ‘Scan and Parse’. 4. Click on ‘USB String Descriptors’ and remove the tick by ‘Serial Number Enabled’. 5. Under ‘File’ click on ‘Save As Template’: this stores the configuration. 6. Under ‘Devices’ click on ‘Program’, and then once more on ‘Program’. Once the programming process is complete it is essential to click on ‘Cycle Ports’, which will enumerate the FT232R devices afresh. The FT232R will now be allocated a COM port number that corresponds to the physi- cal USB port. A disadvantage of this process is that each factory-fresh FT232R device that is to be pro- grammed will initially be assigned a new COM port number when it is first connected. If you have a large number of FT232Rs to program on the same PC, you may run out of available ports. This can be circumvented by adding a new entry to the Windows registry (although this is not a job for the faint-hearted!). In the registry under HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Control\UsbFlags\ make a REG_BINARY entry called ‘Ignore- HWSerNum04036001 ’ and set its value to 01. Now all new FT232Rs will also be assigned a (virtual) COM port number based on the physical USB port to which they are connected. ( 110207 ) Internet Links [1] www.ftdichip.com/Documents/ AppNotes/AN_1 23 _How%20COM%20 Ports_Are%20Allocated%20on%20Dri- ver_lnstallation.pdf [2] www.ftdichip.com/Support/Utilities. htm [3] www.ftdichip.com/Support/Docu- ments/AppNotes/AN_1 24_User_Guide_ For_FT_PROG.pdf Ring Oscillator By Burkhard Kainka (Germany) The ring oscillator comprises a number of inverting transistor amplifier stages connected in series, in which the output of the final stage is connected to the input of the first stage. You have the choice of using three, five, seven or nine stages. The only condition is that the number must be odd, not even. A feature of this circuit is that no capaci- tors are required. Oscillators of this kind are used widely in inte- grated circuits, for instance in microcontrollers. In principle we are dealing with an amplifier with negative feedback that reaches oscillation as a result of the high total amplification. In the circuit shown in Figure 1 five stages are employed. To avoid affecting the ring a buffer stage is used for uncoupling the oscilla- A CN Js CN < € +Ub R1 T1 ) % BC548A JjR2 CM CNJ O T2 r BC548A C ( 1 R3 \J NJ > T3 ) BC548/ ^1 CN Jx CN i c \ R4 T4 BC548 € A [R5 CM CM > 0 CM CM T5 r J. CNJ CNJ 0 R6 ] -€ \ R7 ^ -o| T6 ) BC548A 1 110192 - 11 M lonn loUU — 1 1 /inn isi 14UU V” lonn , 1^-UU a mnn A 1UUU onn ouu cnn ouu Ann 2 HfUU onn LUU n_ 0 2 4 6 > U b [V] 110192 12 tor signal. All resistors in the circuit have a value of 2.2 l and all tran- sistors are type BC548A. The oscillator produces a fre- quency upwards of 1 MHz, which is somewhat dependant on the power supply voltage (see Fig- ure 2). An average maximum fre- quency of 1650 kHz is produced with an operating voltage of 3 V. The ring oscillator can be viewed in its broadest sense as a run-time oscillator. The signal run-time of all five stages amounts to half the oscillation period, in other words exactly 300 ns at 1.65 MHz. Every individual stage then has a run- time of 60 ns. At higher operating voltages the delay introduced by each stage increases somewhat, because the transistors are driven heavily into saturation. (110192) elektor 7/8-2011 61 Sceptre: Driving a Touch Screen Arduino-style 3 By Clemens Valens (France) It’s not hard to find inexpensive replacement resistive touch screens for the Nintendo DS games console on the Internet. When the Sceptre was being designed, the idea of using it with this type of touch screen had already been considered — indeed, that’s why a space was left between connectors l<6 and l<7 (to run the connecting wires). When designing a board, lots of things are often planned for, but not necessarily all implemented. Thus one of the things planned was a library for programming the Sceptre like Arduino, i.e. using a ‘sketch’, a ‘loop’, and X and Y are all it takes to find the position (x,y) where it is being pressed. In practice, each potentiometer actually has a pair of wipers, which are the contacts of the other potenti- ometer. When a voltage is applied to the X potentiometer, the voltage is read off one of the two Y potentiometer contacts, and vice versa. Thus when driving this type of screen, the ports driving the X and Y potentiometers are constantly changing roles: at one moment they act as outputs to apply a voltage to the potentiometer, and the next moment they act as analogue inputs to measure the wiper voltage. varnish at the point where this flexible PCB is at its widest. Now let’s turn to programming Arduino-style. To start off, we have renamed the Sceptre’s usable ports to obtain a total of 45 ‘pins’. Then, a table was drawn up showing these pins and the corresponding possible func- tions they can have, which enables us to find out if a certain pin can be used for a certain function. PIN4 for example can be used as a digital input, digital output, analogue out- put (a real one!), and an analogue input. Now, in the software, we can declare a digi- tal output like this pinMode (PIN37, OUTPUT) GND 1 DPOS 2 DNEG 3 5V 4 PIN1 5 PIN2 6 PIN3 7 PIN4 8 PIN5 9 PIN6 10 PIN7 11 3V3 12 PIN8 13 PIN9 14 GND 15 PIN10 16 PIN11 17 PIN12 18 PIN13 19 PIN14 20 PIN15 21 PIN16 22 PIN17 23 PIN18 24 PIN19 25 PIN20 26 PIN21 27 PIN22 28 59 60 GND DPOS GND P1.19/TRACEPKT3 DNEG 3V3 MODI +5V P0.21/PWM5/AD1.6/CAP1.3 VREF P0.22/AD1.7/CAP0.0/MAT0.0 P1.27/TDO P1.18/TRACEPKT2 P1.28/TDI P0.25/AD0.4/AOUT P0.23/VBUS P1.17/TRACEPKT1 RESET P0.28/AD0.1/CAP0.2/MAT0.2 P1.29/TCK P0.29/AD0.2/CAP0.3/MAT0.3 P0.20/MAT1.3/SSEL1/EINT3 3V3 P0.19/MAT1.2/MOSI1/CAP1.2 P0.30/AD0.3/EINT3/CAP0.0 P0.18/CAP1.3/MISO1/MAT1.3 P1.16/TRACEPKT0 P1.30/TMS SCEPTRE GND pi.20/tracesync P0.31/UP LED/CONNECT P0.17/CAP1.2/SCK1/MAT1.2 P0.0/TXD0/PWM1 P0.16/EINT0/MAT0.2/CAP0.2 P1.31/TRST P0.15/RI1/EINT2/AD1.5 P0.1/RXD0/PWM3/EINT0 P1.21/PIPESTAT0 P0.2/SCL0/CAP0.0 P0.14/DCD1/EINT1/SDA1 P1.26/RTCK P1.22/PIPESTAT1 P0.3/SDA0/MAT0.0/EINT1 P0.13/DTR1/MAT1.1/AD1.4 P0.4/SCK0/CAP0.1/AD0.6 P0.12/DSR1/MAT1.0/AD1.3 P1.25/EXTIN0 P0.11/CTS1/CAP1.1/SCL1 P0.5/MISO0/MAT0.1/AD0.7 P1.23/PIPESTAT2 P0.6/MOSI0/CAP0.2/AD1.0 P0.10/RTS1/CAP1.0/AD1.2 P0.7/SSEL0/PWM2/EINT2 P0.9/RXD1/PWM6/EINT3 P1.24/TRACECLK P0.8/TXD1/PWM4/AD1.1 PWRSWC VBAT PWRSWH GND 55 GND R1 54 PIN45 -| 150R | 53 3V3 52 VREF 51 PIN44 50 PIN43 49 PIN42 48 RESET 47 PIN41 46 PIN40 45 PIN39 44 PIN38 43 PIN37 42 PIN36 D1 H H 41 PIN35 40 PIN34 39 PIN33 38 PIN32 37 PIN31 36 PIN30 35 PIN29 34 PIN28 33 PIN27 32 PIN26 31 PIN25 30 PIN24 29 PIN23 56 57 Y1 XI | Y0 | X0 | MOD 2 Nintendo DS touchpad 100609 - 11 a number of reconfigurable (input/output) ‘pins’. So why not drive the touch screen in this Arduino manner — thereby killing two birds with one stone? Well, that’s just what we’re going to do here. A resistive touch screen is nothing more nor less than two X and Y potentiometers whose wiper positions are determined by the posi- tion where you press on the screen. The potentiometers are powered in turn and the wiper voltages measured. Two measurements So to drive a resistive touch screen with only four ports, the ports need to be reconfigura- ble. On the Sceptre, the plan was to use ports P0.13, P0.15, P0.21 , and P0.22 (which also offer ADCs ADI .4-AD1 .7) for driving a touch screen. It’s not hard to connect up the screen to the Sceptre. You can use the special min- iature Nintendo DS connector (which can be found on the Internet), but you can also just solder the wires directly onto the screen’s flexible PCB, after scratching off a bit of the and if PIN37 is capable of fulfilling this function, it will be a digital output. The digit alWr it e (PIN3 7,HIGH) function then allows us to set a high on PIN37; the digitalWrite (PIN37,L0W) function sets it low. For the analogue side of things, just as in Arduino, a pin becomes an analogue input (output) (if this is possible, of course) as soon as we go and read from it (write to it). Driving the touch screen now becomes simple: 62 7/8-2011 elektor pinMode (PIN2, INPUT) ; pinMode (PIN1, OUTPUT) ; pinMode (PIN2 9, OUTPUT) ; digitalWrite (PIN29,HIGH) ; digitalWrite ( PIN1 , LOW) ; value= analogRead (PIN33 ) ; // YO digital input // XO digital output // XI digital output // XI high // XO -> low // Read voltage on "wiper" Y1 Then repeat these instructions, but changing PIN1 to PIN2 and PIN29 to PIN33 to obtain the other co-ordinate. Note that even when reading only one ana- logue input (Y1), the potentiometer’s other pin (YO) must be disconnected from the screen in order to avoid the measurement’s being influenced. This is why is has been declared as a digital input. A number of Arduino-style analogue outputs, i.e. 490 Hz PWM outputs, have also been implemented. In order to communicate with a computer like an Arduino, the functions Serial _ begin, Serial _ write and Serial _ write int are available. The difference in the nota- tion compared with Arduino is simply due to the fact that the Arduino library for the Scep- tre is programmed in C and not C++. In order to simulate an Arduino ‘sketch’, we first call the setup function from main, then main will periodically call the loop func- tion from an endless loop. Take a look at the sketch, c file [ 1 ] to see just how close the result is to a real Arduino sketch. The source codes (app _ touchpad) and the updated Sceptre library are available from [ 1 ]. (100609) Internet Link [1 ] www.elektor.com/ 1 00609 DC/DC Converter using LT1376 D3 SS25 +5V By Albert Bitzer (Germany) A switching regulator with an adjustable out- put voltage is a handy weapon in the battle to reduce heat dissipation in circuits. The step- down converter described here can be used with input voltages from 7.5 V up to 25 V and can deliver an output current of up to 1 .5 A. At its minimum output voltage of 3.3 V the cir- cuit can even operate from a 5 V input. The circuit is built around a Linear Technol- ogy LT1376 and is mostly based on the design given in the device’s datasheet [1]. The mini- mum inductance and current rating of choke LI depend on the maximum output current desired from the circuit. For example, at 0.6 A an inductance value of 5 pH is suitable; at 1 A the minimum value is 10 pH; and at 1.5 A a 20 pH inductor is required. In the circuit dia- gram we show a value of 22 pH. The maximum possible output voltage obtainable depends on the input voltage available and the required output current: the datasheet contains all the relevant informa- tion. The adjustment range of R2 should be sufficiently large in all cases to allow output voltages from 3.3 V to 14.5 V to be obtained. With the component values shown the expected typical characteristics of the circuit are as follows. U|N Uqut ^OUT ( max ) 5 V 3.3 V 1.5 A 8 V to 1 0 V 5 V 1.4 A 12 V to 18 V 10 V 1.3 A The maximum available output current is also highly dependent on the quality of choke LI and electrolytic capacitor C5. For the induc- tor, the DC current and resistance ratings are critical in addition to its inductance. The cur- rent rating should be at least double the maxi- mum desired output current of the circuit and the DC resistance as low as possible. For the capacitor, a low ESR is essential. The author has designed a small printed cir- cuit board (measuring 31 mm by 52 mm) for assembling the circuit: the board also has space for a protection fuse. The layout and schematic files are available for free down- load in Eagle format at [2]. ( 110286 ) Internet Links [1] www.linear.com/product/LT1376 (datasheet) [ 2 ] www.elektor.com/ 1 1 0286 (downloads) elektor 7 / 8-2011 63 Make Your Own Solder Mask Overlays by Uwe Hofmann (Germany) The use of solder-resist lacquer or film gives a printed circuit board (PCB) not only a professional appearance but also prevents unwanted solder bridges causing circuit malfunctions. This article demon- strates how you can add the protection of a solder mask to home-made PCBs with- out the need for specialist equipment. A laminating machine that can reach a tem- perature of around 130°C is the only addi- tional item to the equipment required in any case for making PCBs. The only con- dition is that you must have an ultravio- let (UV) exposure device and transparent artwork for the PCB tracks. For the latter you must either have developed the PCB yourself with a layout program or possess the relevant router files. The solder mask artwork that you print will display only the solder pads that need to be left clear. For double-sided boards you will need to print out both sides. After etching the PCB you need to remove all remaining photo-resist and other resi- dues to make it totally clean. Grease-free cleaner (household detergent) and a wash- ing-up sponge are the best tools for this job. Use thin vinyl or rubber gloves after this; avoid touching the copper surface with yourfingers! The now clean and dry PCB needs to be placed in the solder bath that you switched on previously. After around three minutes tinning of the board will be complete and you can rinse and dry the PCB again. The next task is to pass the tinned circuit board two or three times through the pre- heated laminatorto remove any final traces of moisture. This is vital to prevent any sub- sequent blistering of the overlay. Now you cut a piece of photosensitive lam- inate to the exact dimensions of the PCB and remove the lower of the two protec- tive films. As this is rather fiddly you’re allowed to use a couple of small pieces of adhesive tape for getting more hold on the laminate. Don’t worry: only the lower pro- tective film will release itself! Next gradually press the photosensitive laminate onto the upper side of the PCB, at the same time using a piece of paper to separate the laminate from the rest of the board to avoid it covering the whole area at once (see photo). Without this precaution creases can arise in the overlay. When you insert the PCB in the laminator, hold the paper sufficiently tight that it con- tinues to separate the photosensitive film of the part of the PCB that is not yet cov- ered (see picture). The board needs to pass through the lami- nator two or three times more to ensure the laminate adheres firmly. It is now time to fix the solder mask proper. It needs to be aligned precisely over the PCB and fixed with adhesive tape. The exposure time is about half that normally used with the exact same UV exposure equipment for positive photo-resist (you may need to make a few trials first). Leave the PCB for at least 30 minutes after expo- sure, to give the laminate time to polymer- ise. After this time place the board in the developer that you use normally use to make PCBs. A cheaper alternative is nor- mal washing soda from a hardware store or supermarket (chemically this is none other than sodium hydroxide). The devel- oping bath should be set up according to the instructions and the temperature set to around 35°C. Before developing, remember to remove the upper protective film from the pho- tosensitive laminate (this time you won’t need the trick with adhesive tape). Developing the laminate should be com- plete in two to three minutes. During the developing process you can help it along if you wish, using a soft artist’s paint brush to loosen (very carefully) the laminate from the solder pads as it dissolves. This acceler- ates the process and gives you better con- trol of the entire operation. Once devel- oping is complete rinse the PCB and dry it with a tea towel. At this stage the fresh layer of laminate is still soft and needs to harden off. To stabilise it leave it in the UV exposer for about 45 minutes and to finish off place it for another 45 minutes in a fan- assisted oven. After all this you’re ready to trim and drill the PCB. With double-sided boards complete the laminate overlay, developing and UV hard- ening operation first for one side and then for the other. Only after this should you harden it off in the oven. A source in Germany forthe chemicals and materials recommended by the author is the online shop of Octamex (www. octamex.de). (110217-1) 64 7/8-2011 elektor Integrate Touch Sensing Quickly and Easily With Microchip's Range of Low Power, Low Cost Solutions Microchip Solutions mTouch TM Microchip's mTouch™ Sensing Solutions allow designers to integrate touch sensing with application code in a single microcontroller, reducing total system cost. Microchip offers a broad portfolio of low power, low cost & flexible solutions for keys/sliders and touch screen controllers. Get to market faster using our easy GUI-based tools, free source code and low-cost development tools. GET STARTED IN 3 EASY STEPS - Learn moreatwww.microchip.com/mtouch - Download App Notes & royalty-free source code - Order a development tool Capacitive Touch Keys and Sliders • Extend battery life with extreme Low Power MCUs - Proximity sensing in less than 1 pA • High noise immunity and low emissions • Broad portfolio of MCUs lowers system cost - 8, 16 & 32-bit PIC® MCUs for Capacitive Touch - Integrated USB, Graphics, LCD, IrDA, CAN - No external components • With Metal Over Cap technology you can: - Use polished or brushed metal surfaces including stainless steel and aluminium - Sense through gloves - Create waterproof designs - Deploy Braille-friendly interfaces Touch Screen Controllers • Fully processed touch coordinates • Projected Capacitive technology - Multi-touch enabling gestures - Low cost MCU implementation - Wide operating voltage: 1.8-5.5V - Low operating current 1.5 mA at 5V typical • Analog Resistive technology - Lowest system cost, easy integration - Universal 4, 5 & 8-wire solution with on-chip calibration - I 2 C™, SPI, UART or USB interfaces - Low power "touch to wake-up" feature Analog Resistive Touch Screen Development Kit - DV102011 Intelligent Electronics start with Microchip microchip OIR1 www.microchip.com/mtouch www.inicrochEpdlrQCt.CDm & Microchip The Microchip name and logo, the Microchip logo and PIC are registered trademarks and mTouch is a trademark of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks mentioned herein are property of their Microcontrollers Digital Signal Analog Memory Controllers Battery Charge Monitor LCD1 By Dieter Kohtz (Germany) The circuit described here provides monitor- ing of the charge status of a battery by the continuous measurement of charge and dis- charge currents. The battery current is inte- grated over time (respecting its sign), and net consumption is shown on a display. The charge stored in the battery can be calcu- lated as a result of this process, and this cal- culation does not involve the battery’s termi- nal voltage. The current flowing out of or into the battery is passed through a 0.4 m£2 series resistor in the circuit. Power for the circuit is drawn from the battery under test. The TLC271 operational amplifier, wired as a differential amplifier, requires a symmetrical supply in this application, and for this reason a diode pump circuit driven by a 7555 CMOS timer 1C acting as an astable multivibrator is included to generate a negative voltage. The ±5 V sup- plies for the opamp are then derived using positive and negative fixed voltage regula- tors. The +5 V supply also powers the rest of the circuit, including the LCD panel. The current sense amplifier is designed to pro- duce a signal suitable for subsequent digital processing as follows. A current of between +150 A and -150 A produces a voltage drop across the shunt of between +60 mV and -60 mV. The gain of the amplifier is chosen that a current of ±150 A corresponds to a range of ±300 LSBs in the output of the ten- bit ADC inside the microcontroller. With a reference voltage of 5.00 V this in turn cor- responds to a voltage range of ±1.466 V. The required gain is thus 1466/60= 24.43. Metal film resistors are used to set the gain with suf- ficient accuracy. The LM336 voltage reference at the output of the opamp offsets the output voltage by 2.5 V, half the reference voltage of the ADC. Small errors in this voltage can be compensated for by adjusting the offset volt- age of the opamp. To measure the battery voltage, whose nomi- nal value is 12 V, it is connected to the second ADC input via a voltage divider. If there is 1 5 V across the battery the divider is designed to produce an output voltage of 4.888 V, which corresponds to 1000 LSBs at the ADC out- put. Again, the voltage divider can be con- structed with sufficient accuracy using metal film resistors. The measurement results are shown on a one- line LCD panel. The firmware running in the PIC16F873A microcontroller provides the fol- lowing functions. 1. Measurement of voltage and current at regular intervals. 66 7 / 8-2011 elektor 2. Integration of current values (respect- ing sign) over time to measure total net consumption. 3. Storage of calculated net consumption val- ues in internal EEPROM. 4. Selectable display of current, voltage and net consumption. The program is written in assembler and the main part consists of four loops with execu- tion times of 45 ms, 225 ms, 1125 ms and 72 s. The processor is idle within the 45 ms loop, whose timing is controlled by TMRO: the purpose of the loop is solely to make overall timing precise. Every 225 ms the button is polled, to see if the user wishes to cycle the display through current, voltage and consumption readings. In the third loop, every 1125 ms, voltage and current read- ings are taken. After each ADC conversion result is fetched it is converted into a format suitable for display. Each current reading is added into an accumulator, taking account Mini Flasher Frank de Leuw (Germany) This LED flasher is made up from just five com- ponents and is an ideal circuit for novices to experiment with. Operation of the circuit is quite easy to understand. With a battery connected to the circuit capacitor Cl is charged through the 1 M£2 resistor R1 . The capacitor is connected to the emitter of the PNP transistor (BC557). This transistor’s base junction is connected to the positive 9 V supply via an LED. So the poten- tial at the base junction will be equal to the supply voltage minus the forward voltage drop of the LED. A red LED will give a forward voltage drop of around 1.6 V so the voltage level on this transistor’s base junction will be 9 V - 1 .6 V = 7.4 V. When the rising voltage on the capacitor reaches a level to forward bias the base-emit- ter junction of the PNP transistor current will start to flow through its emitter-collector junction. The current flow causes the base-emitter junction of the NPN transistor to become for- ward biased, switching it on. Now it’s con- ducting its collector will be close to ground of its sign. The 1125 ms loop is executed 64 times, so that over a period of 72 s a total of 64 current readings are summed. After 72 s have elapsed a mean current is calcu- lated by dividing this sum by 64. The reason behind using a 72 s averaging period is that the main purpose of the circuit is to inte- grate current over time. In a digital system this cannot be done continuously: the read- ings have to be sampled. In the conversion results for the current readings, 1 LSB corre- sponds to 0.5 A, and averaging these values over 72 s = 0.02 h means that one LSB in the final result neatly corresponds to a consump- tion of 0.01 Ah. The program takes account of the fact that when charging not all the current flowing into the battery ends up as stored charge: a mul- tiplicative correction factor of 0.7 is applied. The prototype of the circuit was constructed on a piece of perforated stripboard. First PI is used to adjust the contrast of the LCD. Then potential, pulling both the LED cathode and the PNP transistors base to ground, reinforc- ing the ON condition of the PNP transistor and causing a relatively high current to pass through the LED to emit a flash. When the capacitor is discharged the tran- sistors turn off again and the process is repeated. The values given in the circuit dia- gram (Cl = 1 pF, R1 = 1 W\Q) will make the LED flash briefly once every two seconds. offset potentiometer P2 is set by putting the unit into current display mode with no bat- tery connected (and hence with 0 V across the current sense resistor), and adjusting for a zero reading. This compensates for any off- set error in IC2 as well as for the tolerance in the 2.5 V reference IC3. The software for the microcontroller (hex file and source code) is available for download free of charge from the Elektor website [1]. One further note: the first six entries in the PIC’s EEPROM are set to zero when it is pro- grammed. This is necessary because the pro- gram reads these entries to initialise its con- sumption counter at power-up. ( 110154 ) Internet Link [i] www.elektor.com/ 1 1 01 54 (free software download) 3 110213 - 12 The circuit will still run with a battery voltage as low as 2 V and uses so little current that a new 9 V battery will keep the circuit flashing for many months in continuous operation. Even old 9 V batteries with too little charge left to power other applications could be used to power the circuit. The second circuit diagram shows that the basic circuit can be simply modified to make a metronome or tone generator. A low-power elektor 7 / 8-2011 67 8 £1 loudspeaker is now connected in series with the LED. The sound produced by the loudspeaker will either be a repetitive click or a tone depending on the values of capacitor Cl and resistor R1. Reducing the values of R1 and Cl will make the circuit oscillate more quickly. The second circuit uses values of 22 k £1 for R1 und 1 00 nF for Cl. (110213) Automatic AC Power Switch for the Holiday Home By Stefan Hoffmann (Germany) Electrical appliances accidentally left on in (holiday) homes left unoccupied for a short or a long period consume power unnecessarily and can present a fire haz- ard. Everyone will be familiar with those nagging thoughts, a few miles down the road from the house: “Did I remember to switch off the coffee machine? The lights? The oven?” Hotel rooms are often equipped with a switch near the main door which ena- bles the power supply to everything in the room only when the plastic card (which might contain a chip or have a magnetic strip or a pattern of holes) that serves as the room key is inserted. The circuit idea given here to switch off lights and other appliances is along the same lines. The solution is surpris- ingly simple. A reed contact is fitted to the frame of the main entrance door, and a matching magnet is attached to the door itself such that when the door is closed the reed contact is also closed. To enable power to the house, press SI briefly. Relay RE1 will pull in and complete the circuit for all the AC powered appliances in the house. The relay will be held in even after the button is released via the second relay contact and the reed contact (‘latching’ function). As soon as the main entrance door is opened, the reed contact will also open. This in turn releases the latch circuit and consequently the relay drops out. The various connected appliances will thus automatically and inevitably be switched off as soon as the house is left. The circuit is principally designed for small holiday homes, where this mode of operation is particularly practical. Of course, for any circuit that deals in AC powerline voltages, we must mention the following caution. Caution: shock hazard! Construction and connection of this circuit should only be carried out by suitably-qualified personnel, and all applicable electrical safety regulations must be observed. In particular, it is essential to ensure that the relay chosen is appropriate for use at domestic AC grid volt- ages and is suitably rated to carry the required current. ( 110157 ) Experimental Hall Sensor By Burkhard Kainka (Germany) Hall sensors can of course be purchased but making them yourself is far more interesting (and satisfying)! According to the theory the crucial thing is to use a touch layer that’s as thin as possible; the length and width are unimportant. An ‘obvi- ous’ starting point for our trials would be cop- per, which in the form of printed circuit board material is easy to find and handle. Copper- clad board may be obvious but not ideal, because it has a very weak Hall constant. Nev- ertheless we should be able to use it to dem- onstrate the Hall effect by using very power- ful magnets in our sensor. To achieve detection we need the highest possible level of amplification. In the circuit shown here the voltage amplification is set by the relationship of the two feedback resis- tors of the first op-amp. With the values given (2.2 M£2 and 330 £2) produce a gain of 6,667. This also creates a convenient bridge connec- tion for taking measurements. The trimmer potentiometer allows fine adjustment. With zero setting that’s accurate to within mil- livolts we could use this test point to meas- ure Hall voltages of well below a microvolt. Finally in this way we could also measure the flux density of a magnet. 68 7 / 8-2011 elektor Copper has a Hall constant of A H = —5.3*1 0" 11 m 3 /C. The thickness of the copper layer is d = 35 pm. The Hall voltage then amounts to: V H = A h x / x B I d When the field 6=1 T and current / = 1 A a Hall voltage of V H = 1 .5 pV is produced. The 6,667-fold gain then achieves a figure of 10 mV. The circuit thus has a sensitivity of 1 0 mV per Tesla. That said, adjusting the zero point with PI is not particularly easy. The amplifier has a separate power supply in the form of a 9 V battery (BT1). To take measurements we connect a lab power supply with adjustable output current (BT2) to the Hall sensor (the copper surface) and set the current flowing through the sensor to exactly 1 A. Then the zero point must be adjusted afresh. Next we place a strong Neodymium magnet below the sensor. The output voltage of the circuit should now vary effectively by several millivolts. Note that there are several effects that can influence the measurements we take. Every displacement of the magnet will produce an induction voltage in the power feed wires that is significantly greater than the Hall voltage itself. Every time you move the magnetyou must wait a while to give the measurements time to stabilise. With such small voltage measurements problems can also arise with thermal voltages due to tem- perature variations. It’s best not to move and inch — and to hold your breath as long as possible! (110196) Reanimating Probe for AVR uC By P. Rondane (France) “AVR device not responding” When this dis- couraging message appears while you’re pro- gramming your Atmel microcontroller, that’s where the problems really begin! The problem is often due to incorrect programming of the fuse bits. This is where the unblocking probe comes into play... Once the whole thing is pow- ered up, all you have to is use one hand to apply the tip of the probe to the microcontroller’s XTAL1 input and then use your other hand to go ahead and program it with your favour- ite software. And there, your microcontroller is saved! The electronics are as sim- ple as can be, the aim being to design something cheap and easy to reproduce. It con- sists of an oscillator generating a rectan- gular wave at around 500 kHz, built using a 74HC04. This circuit will also work with a 74HC14, but depending on the make of 1C, the frequency of around 500 kHz may vary by around ±50 kHz. This doesn’t affect the oper- ation of the probe. The unblocking board is connected using a elektor 7/8-2011 69 ribbon cable, terminated with two female HE10/10 connectors. The pinout of the HE10/10 connector is the same as used in the majority of circuits, but of course it can be adapted for an HE1 0/06 connector. The first connector is connected to the board to be unblocked, which allows powering of the electronics. The second connector is connected to the ISP programmer (STK200 compatible). The contact at the crystal is made using a needle, to ensure contact even through a board that has been varnished. There’s no need to unsolder the crystal for this operation. The PCB design in Eagle format is available from [ 1 ]. (110374) Internet Link [1 ] www.elektor.com/ 1 1 0374 Minimalist Dip Meter By Burkhard Kainka (Germany) In days gone by a radio amateur always had a dip meter close to hand in his ‘shack’. Now that people can afford oscilloscopes, the poor old dip meter has lost its importance and is frequently no longer to be seen. Actually this is a shame because many tasks are much easier to carry out with a dip meter. Anyone who’s interested (perhaps the second time around) can easily build one rapidly with this very simple but adequate circuit. The interest- ing question is namely what do you actually need from a dip meter? • A visual display of the dip? Nope, the ‘scope can handle that task. • A large frequency scale? Not necessary, as you can connect a frequency counter for this. • A selection of coils? We don’t need these because we can use a jumper to change range (no coils to lose any more!). The sensor coil LI has ten turns and is wound using an AA-size battery as a former. This coil will allow us to over the range from 6 MHz to 30 MHz. With jumper JP1 open an additional fixed inductance of 1 0 jliH comes into circuit. The frequency measurement range is then from 2.5 MHz to 10 MHz. The switch may be replaced by a jumper. To take measurements you hold a resonant circuit close to the sensor coil. Tune the rotary capacitor Cl slowly to and fro in orderto find the resonant frequency, at which the oscil- lator amplitude decreases somewhat. The frequency can then be read directly off the oscilloscope. To obtain a very accurate measurement you can additionally connect your frequency counter to the second output. (110198) Variable Voltage Injector By Gerd Haller and Michael Gaus (Germany) When testing circuits and fault finding there is often a need to inject a defined DC voltage level at some point on the circuit. It may, for example be necessary to apply a logic level on the input of a digital gate or a reference volt- age level on the input of an analogue circuit. With this handy piece of kit you can select one of five fixed voltage levels of 0 V, 2.5 V, 3.3 V, 4.096 V or 5 V. In addition the output can sup- ply a variable voltage in the range of 2.9 V to 7.3 V adjustable via a pot. A stable 2.5 V reference voltage is sourced from a REF192 low voltage reference chip. This level is then multiplied by the gain of an opamp with switchable DC gain to produce the output voltage levels. A ten stage Johnson counter type 4017 selects the amp’s gain setting. A pushbut- ton provides the clock signal to the coun- ter. An RC filter followed by Schmitt trig- ger IC2.A suppresses unwanted signal tran- sitions generated by pushbutton contact bounce. A Johnson counter only ever has one output high at any one time so each press of the button advances this high to 70 7 / 8-2011 elektor the next output. The outputs switch FETs which in turn connect the voltage divider networks to ground to produce the differ- ent gain settings. The outputs also have LEDs, giving a visual indication of the out- put voltage level setting. Counter output 6 is connected back to the reset input so that after the sixth output the for 1 25 cc Scooter By Georges Treels (France) Lots of Far-Eastern scooters are fitted with GY 6 engines. These already elderly units are sturdy and economical, but if you want to “push” the power a bit (so-called ‘Racing’ kits, better handling of the advance, etc.), you soon find yourself faced with the problem of the engine temperature, and it becomes counter is reset to the beginning again. To produce a 0 V output level the voltage ref- erence chip is switched into sleep mode and the 1 KQ resistor R4 ensures a 0 V output. Power supply for the circuit is provided by a standard or rechargeable 9 V battery. To make the design easy to use it can be essential to fit a heatsink (often wrongly referred to as a ‘radiator’) on the oil circuit. Even so, in these circumstances, it’s more than reassuring for the user to have a con- stant clear indication of the oil temperature. Here are the specifications we set for the tem- perature gauge we wanted to build: • no moving parts (so not meter move- ment), as scooters vibrate a lot!; • as cheap as possible (around £ 12 ); • robust measuring transducer (avoid NTC thermistors and other ‘exotic’ sensors); mounted in a plastic casing to fit comforta- bly in the hand. The output signal can then be connected to a test probe extending from the case. An earth connection is also neces- sary and can take the form of a flying lead terminated in a croc clip for connection to the test circuit earth. (110342) 3 • temperature range 50-140 °C. (122 -291 °F); • audible and visual warning in case of dan- gerous temperature; • compact; • waterproof. Let’s start by the sensor. This is a type-K ther- mocouple, as regularly used by multimeter manufacturers. Readily available and fairly cheap, these are robust and have excellent linearity over the measurement range we’re interested in here. The range extends from Oil Temperature Gauge elektor 7 / 8-2011 7i IC2 2 mV to 5.7 mV for ten measurement points. The positive output from the thermocouple is applied to the non-inverting input of IC3.A, wired as a non-inverting amplifier. Its gain of 221 is determined by R1 and R2. IC3 is an LM358, chosen for its favourable characteris- tics when run from a single-rail supply. IC3.B is wired as a follower, just to avoid leaving it powered with its pins floating. IC3.B output is connected to pin 5 of IC1, an LM3914. This very common 1C is an LED dis- play driver. We can choose ‘point’ or ‘bar’ mode operation, according to how pin 9 is connected. Connected as here to the + rail, the display will be in ‘bar’ mode. Pin 8, con- nected to ground, sets the full scale to 1 .25 V. R3 sets the average LED current. Pin 4, via the potential divider R7/R8+R9, sets the offset to 0.35 V. Using R8 and R9 in series like this avoids the need for precision resistors. As per the LM3914 application sheet, R4-R5-R6 and C5 will make the whole display flash as soon as DIO lights (130 °C = 226 °F). Simultaneously, via RIO and T1, the (active) sounder will warn the user of overheating. Capacitor C6 avoids undesirable variations in the reference voltage in ‘flashing’ mode. IC2 is a conventional 7808 regulator and C1- C4 filter the supply rails. Do not leave these out! D1 protects the circuit against reverse polarity. The author has designed two PCBs to be fit- ted as a ‘sandwich’ (CAD file downloadable from [1]). In the download you’ll also find a document with a few photos of the pro- ject. You’ll note the ultimate weapon in on- board electronics: hot-melt glue. Better than epoxy (undoable!) and quite effective against vibration. (100940) Internet Link [i] www.elektor.com/ 1 00940 70 A Solid-state Starter Relay By Georges Treels (France) Overall, electro-mechanical scooter starter solenoids are cheap enough — but the down- side is that they’re not very reliable. The con- tact resistance increases overtime, the coil can be open-circuited due to the vibration, and sometimes the power contacts weld up. One solution is to replace them with a solid- state relay. In DC mode, we’ll need to use a MOSFET transistor. As is often the case in automotive systems, the supply negative is connected to the chassis ground, which means we’ll need to use a P-channel MOSFET. The current to be switched is relatively high, between 55 and 100 A (depending on engine capacity and compression), so we need a transistor with a very low /? DS(on) capable of carrying a large / DS . Since the starter is a DC motor with brushes, it +BATT -© P600D D1 lOOOu 20V P600D 100941 - 11 r 72 7/8-2011 elektor generates considerable voltage spikes that are quite destructive for the driving device, whence the need to protect everything very well. A look at the wiring diagrams for various scooters reveals that the safety switch on the brake (which has to be applied first) supplies +1 2 V, but the starter button (to be operated next) connects to ground. One simple solu- tion is to use an opto-isolator. While we’re on the subject, let’s just note that this technique means this circuit can be used for many other applications too. And finally, the circuit must be ‘Plug-n- Play’, i.e. usable with the original connector, thereby limiting the circuit dimensions to 50 x 50 mm. Building a PCB capable of handling a current of 70 A needs a few calculations. The resist- ance Rj of a copper track with thickness E of 35 pm (0.035 mm) with length L and width W is calculated from /? r = 1 .7 x 1 0' 5 x L / (E x I/I/) [Q] where E, L, and W are in mm, and T= 25 °C). The component positions mean our tracks can be 15.25 x 44 mm, thus each track rep- resents 1.4 m El, or 0.7 rr\Q if we use a dou- ble-sided board. At 75 A, the total voltage drop will be around 100 mV and the power dissipated 7.5 watts. The SUP75P03-07-E3 MOSFET from Vishay Siliconix (Farnell part no. 1 794812) offers an /? DS(on) of 7 mil at 75 A, i.e. 3.5 m El if we put two in parallel. In this case, the voltage drop is 0.263 V and the power dis- sipated in each transistor is around 1 0 watts. The end result is that we get an overall volt- age drop of around 360 mV and a total dissi- pation of around 27.5 watts. Let’s take a look now at the circuit diagram. On the left, everything within the dashed rectangle corresponds to the original wiring of the major- ity of Chinese scooters. R1 sets the current in the 4N28 opto-isolator LED to around 25 mA and R2 biases the base of the phototransis- tor. The phototransistor collector is connected directly to the gates of the two MOSFETs T1 wired in parallel. At rest, the MOSFETs are held off by R3, but start to conduct when both con- tacts SI and S2 are made, thanks to D3 and the low impedance of the starter motor. Once the starter turns, the charge on C2 ensures that the circuit will continue to function. Components Cl , D1 , C2, D2, and D3 protect the circuit against the interference produced by a load that is anything but purely resistive. Tests and measurements have been carried out on a scooter using a GY 6 engine type CJ12M. The average consumption was 53 A: 49 A at bottom dead centre (minimum com- pression) as against 57 A at top dead centre (maximum compression). The voltage drop measured at the circuit terminals was strictly identical to the theoretical value. After three hours’ testing, at a rate of one start every five minutes, no heating was detected. (100941) Internet Link [1 ] www.elektor.com/ 1 00941 Advertisement Elektor App for iPhone and iPad <=> The Elektor Electronic Toolbox Elektor now offers an App you cannot afford to miss on your iPhone, iPod Touch or iPad. The Elektor Electronic Toolbox is a collection of no fewer than 28 electronic tools that can be picked from a comprehensive set of icons! Highlights: - Databases for Transistors, FETs, Triacs, Thyristors, Diodes and ICs - NE555 circuit design - An Ohms Law calculator - Schematic Diagrams - Number base converter - LED / resistor calculation - R/Land BJT calculations - And more Cost-effective single units and small production runs Customized front panels can be designed effortlessly with the Front Panel Designer. The Front Panel Designer is available free on the Internet or on C D. ■ automatic price calculation ■ deliveryin 5 -8days ■ 24- Flour-Serviceif required Sample price: 34,93€ plus VAT/shipping Further information at www.elektor.com/.app Schaeffer AG ■ Nahmitzer Damm 32 ■ D-12277 Berlin ■ Tel +49 (0)30 80586 95-0 Fax +49 (0)30 8058695-33 ■ Web info@schaeffer-ag.de ■ www.schaeffer-ag.de elektor 7 / 8-2011 73 Maglev Demo By G. van Zeijts (The Netherlands) After reading a Wikipedia article on mag- lev trains [ 1 ], the author — like anyone fasci- nated by technology — was curious to know how they work. He discovered that they use a rather sophisticated system consisting of lots of magnets and coils along with controllers, which lifts and propels the train. However, the basic principle is very simple and consists of coils that attract or repel metal objects or other coils, thereby causing something to move. He thought it would be fun to build a device that demonstrates this principle. The mechanical part of the author’s device consists of length of transparent tubing with an internal diameter of 10 mm, which is bent into a closed oval shape and joined smoothly by a coupling. The oval tube is clamped in a slanted position, with the upper part up to 30 mm higher than the lower part. A steel ball with a diameter of 8 mm, taken from a ball bearing, is located inside the tube. A coil called the ‘holding coil’ is located nearthe lowest portion of the tube, with additional coils (LI to L5) positioned nearthe holding coil in sequential order. Before the ball is put into motion, the holding coil is energised to capture the ball in order to give it a well-defined starting position. After the ball comes to rest, the holding coil is de- energised and LI is energised briefly, caus- ing the ball to move fairly quickly towards LI . After this, coils L2 to L5 are energised briefly at the right times to cause the ball to acceler- ate and roll all the way around the oval loop. The results depend on the times when the coils are switched on and off, and the main challenge in this project is to determine the right timing for energising the coils. The schematic diagram of the control cir- cuitry is very simple. It consists of a set of NPN Darlington transistors - one for each coil - connected between the pins of a PC paral- lel port connector and the coils. The author used quad Darlington ICs (type MP4101) for this purpose. These quad power drivers were commonly used in dot-matrix printers, which are now obsolete and have been (or are being) discarded in large quantities at municipal waste collection centres. Some examples of well-known quad drivers are the STA401A, STA405A, MP4101 and MP41 05. These quad Darlington drivers are especially easy to use because they require very few external com- ponents. However, discrete Darlington pairs would work just as well. All of the coils used in the author’s device (heavy-duty relay coils) have a resistance of 12 £1 and operate from a 12 V DC supply volt- age. The indicator LEDs have 270-£l series resistors and operate from 5 V. They light up when the associated coils are energised. The PC software is written in Visual Basic 5 and works fine under Windows XP. It can be download free of charge from the Elek- tor website [2]. The code is extensive com- mented. The coils are driven from the paral- lel port using a simple interface. The module lnpoutV4.bas must be included in the project. It allows the parallel port to be used under Windows XP for controlling external devices with Visual Basic code. The file lnpout32.dll should be placed in the folder C:\Windows\ System32. The program displays two windows after it is launched: • ‘For Operation’ This is intended for normal use. It allows the user to use various numbers of coils, as desired. • ‘For Adjustments’ This can be used to experimentally deter- mine the values of the timing parameters, 12Vdc 74 7 / 8-2011 elektor which depend on the speed of the com- puter and the construction of the demo device. The time when each coil is energised must be determined. The previous coil is automat- ically de-energised at the same time. The timing is implemented in the program using a simple counting routine. Of course, timers could have been used instead. With both methods, Windows makes it dif- ficult to maintain constant timing because it repeatedly ‘steals’ brief time intervals while a user program is running in orderto han- dle other tasks, such as managing the key- board interface. Under Windows 95 and 98, the modules Ports. bas and Ports.dll allowed Visual Basic to use the Real Time command (with the parameter ‘true’ or ‘false’) to pre- vent this from happening while a user pro- gram was running. This made it much easier to get the timing right, since Windows was prevented from doing its own thing(s). Unfortunately this is can’t be done under Windows XP, since Microsoft is making direct access to the ports increasingly difficult for users. (100336-1) Internet Links [1 ] http://en.wikipedia.org/wiki/ Maglev_(transport) [2] www.elektor.com/ 1 00336 Mini Experimental Board for ATtiny45 By Claude Frayssinet, F6HYT (France) This very simple little development board was designed for carrying out tests on the 8-pin AVR microcontrollers from Atmel. Any 8-pin 1C with power on pins 8 (+5 V) and 4 (0 V) can be used, checking of course that the program- ming pins are the same as on the ATtiny45 for which this board was made. The IC’s eight pins are brought out onto two rows of PCB pins and two screw termi- nal blocks (K1 and l<2) with a 0.2” (5.08 mm) pitch. There are three possible ways to power the board: from an external 8-12 V (15 V) PSU via a standard power socket; from a 5 V rail via the programmer’s ISP connection (if the jumper is fitted); or by three 1 .5 V cells via a switch. If batteries are not being used, a pro- totyping area with solder pads is available. There’s an LED to indicate the presence of power. For experimenting, there are three tools on the board. First of all, a simple logic probe with an LED and its current-limiting resistor, then a potentiometer adjustable between V cc and ground, which gives us a variable voltage for the A/D converters, and lastly a pushbut- ton which makes to ground when pushed. Although SPI access connector l<4 is shown as 6-pin in the circuit diagram, a 10-pin HE10 connector is actually used on the circuit board. Two 18 pF SMD capacitors are provided for a crystal oscillator. These don’t interfere with operation even if a crystal is not used. Their rather unorthodox connection (one to ground, the other to +5 V) has made it possi- ble to simplify the PCB layout slightly. The 1N4007 diodes can be either conven- tional or SMD types, as can the resistors and certain of the decoupling capacitors. Printing the component layout onto glossy photo paper using an inkjet printer gives a very clean finish that is also extremely robust (even against alcohol). The PCB design, component overlay, and a few photos are available on [1]. (110034) Internet Link [i] www.elektor.com/ 1 1 0034 elektor 7/8-2011 75 Low-cost Wire Stripper By Luc Lemmens (Elektor Labs) There are already lots of tools and methods available for stripping insulation from wire. Some people do this with their teeth, and stripping pliers are available in all sorts and sizes. In many cases you can also use scissors, cutting pliers or a sharp knife. However, most tools do not work well with very fine wire — either the insulation is simply stretched a bit or the wire itself is damaged so much that you have to cut it shorter and try again. The need for wire strippers for fine wire, as well as the solution, both came from an unu- sual source. In the world of doll houses and miniatures, tiny incandescent lamps with very thin, flexible leads are used for lighting. The vendor of these lamps also sells what they call a ‘stripping tool’ forthem, which is sim- ply an ordinary alligator clip of the sort com- monly used on the test bench for connecting test leads or as a clamp in ‘third hand’ devices. Quite inexpensive sets of test leads with alli- gator clips on each end are also available. It turns out that these clips, without any sort of modification, are very suitable for strip- ping insulation without damaging the wire. In fact, the cheapest types give the best results because the spring force should preferably be as low as possible. However, the teeth of the jaws must mesh nicely together, as otherwise the clip is not suitable for use with thin wire. It takes a certain amount of dexterity to use this tool. Place the wire neatly between the jaws and then apply just enough force with your thumb and index finger to cut through the insula- tion. After this you can pull off the insulation. Depending on the type of wire and the thick- ness of the insulation, it may take a few tries to get this right, but anyone with a feel for the task will soon be turning out good results. Pleased with our new tool, we immediately set about trying it out on other difficult insu- lation stripping tasks. Our first test was with flat cable — an obvious choice — and we found that the individual wires could be stripped clean in a jiffy with no significant effort. Next came battery holders: the leads of some 9 V battery holders are rather stiff and the insu- lation is thick relative to the wire diameter, which makes stripping them a tricky task with ordinary wire strippers. Here again the alliga- tor clip did an excellent job. Even if it isn’t designed as a wire stripper, it works very well in practice. (110283-1) Floating Supply for Panel Meters By Georges Treels (France) There are a lot of digital voltmeter modules on the market today at advantageous prices. Apart from their very high input impedance, they have the advantages of being accurate, versatile, compact, and also quite elegant. The flip side of the coin, however, is that they usually exist in two versions: • The ‘really cheap’ which require isola- tion between their supply voltage and the voltage being measured. • The ‘more expensive’ (expect double!) which accept a common ground. Considering the low power consumption of these modules (around 1 mA), it is simple and worthwhile to design a little circuit that will allow isolation for this type of equipment. 76 7/8-2011 elektor IC1 is a 40106 CMOS hex Schmitt inverter. Its first gate IC1 .A is wired as an oscillator by way of R1 and Cl, at a frequency of around 10 kHz. IC1 .B inverts the signal, so that gates IC1 .C / IC1.D and IC1.E / IC1.F can be driven in anti- phase. The signal is output via C2 and C3, rec- tified by a diode bridge, filtered by C4 and C5, and stabilized by IC2 and C5 to a value of 8 V. The input supply voltage, decoupled by C7, is not very critical, somewhere between 10 and 15 V. It would be hard to make it simpler... The whole of the circuit fits onto a single- sided PCB 24.3 x 27.94 mm, easy to fit behind most display modules. The PCB design is available from [1]. (110402) Internet Link [i] www.elektor.com/ 1 1 0402 Twilight Switch By Theo de Wijs (Thailand) Although ready-made twilight switches for exterior lights are available in every home improvement shop, any self-respecting elec- tronics enthusiast would rather put together something from a few components that hap- pen to be lying around. The circuit described here does not require an AC power transformer. Instead, the volt- age is reduced by series capacitor (Cl) con- nected directly to the mains voltage via a current-limiting resistor. The AC voltage is rectified by D1 -D4, and the resulting DC volt- age is limited by D1 and smoothed by C2. An LDR (R3) is used to detect the light level. The resistance of the LDR is high when there is lit- tle or no light. The resulting voltage on the base of T1 is very low, cutting off the transis- tor. This causes T2 to be driven into conduc- tion by the current through R4, thereby ener- gising the relay so that the exterior light con- nected to it is lit. When sufficient light falls on the LDR, the voltage on the base of T1 rises and it is driven into conduction. This diverts the base cur- rent away from T2, with the result that the relay drops out. The switching level can be adjusted with the potentiometer. Capacitor C4 provides a bit of hysteresis to prevent the circuit from jittering near the threshold level. The entire circuit should be fitted in an insu- lated enclosure, since it is connected directly to the AC powerlines. The component values are not especially critical. However, the coil of relay Rel must be have a low operating cur- rent (no more than a few dozen milliamperes). The author used a type JJM1-12V relay from Panasonic in the prototype. (110063-1) Emitter-Follower Audion By Burkhard Kainka (Germany) A shortwave audion receiver using only two transistors and a single 1.5 V battery — that must be the ideal entry level into shortwave receiver technology. Just add an active PC loudspeaker for very convincing performance. A special feature is the audion circuitry that uses a BC558C PNP transistor working in emitter follower mode. This function works thanks to the few picofarads of internal capacity between the transistor’s base and emitter. This produces a capacitive voltage divider, enabling the transistor to operate as a three-point oscillator, also known as a Hartley oscillator. Only a minute amount of emitter current is required to go into oscilla- tion. The trimpot (trimmer potentiometer) is used to adjust the audion for AM reception so that it does not quite oscillate (immediately before oscillation sets in), forCW (telegraphy with keyed carrier) and SSB (single-sideband) reception it is set slightly higher. Decoupling and amplification of the audio signal is handled by the second transistor. The signal on the output connector K1 is at line level, with an output impedance of about 1 l<£2. elektor 7/8-2011 77 Either of the two antenna connections ANTI and ANT2 can be used. A good ground (earth) connection is essential for this circuit, in which case a short indoor wire antenna of less than a meter in length connected to ANTI will be sufficient to pull in countless broad- cast stations. For DX (long distance) recep- tion an external antenna is better, for exam- ple an aerial ‘long wire’ of around ten meters (30 ft.) length. In this case the ANT2 connec- tion must be used. The coupling to this input is slightly weaker in orderto reduce resonance and offset any reaction (feedback). As a gen- eral rule, the longerthe antenna, the smaller the value of coupling capacitor Cl. (110199) LED Chase By Alexander, Friedrich and Klaus ten Hagen (Germany) LED Chase is a game that flashes one of eight LEDs randomly, the LEDs being arranged in a row. If the LED on the extreme right or left lights and the corresponding button (L or R) is pushed at the same time, a sound is generated. Next, the LEDs light up individ- ually in sequence and then start ‘hopping’ faster. Wrong pushes of the Left or Right button cause a low sound to be generated. The ‘wrong’ LED flashes rapidly and the LED- hopping is slowed down for a new round. If no button is pushed for 60 seconds the LED Chase game will automatically power down. A video showing the game in use, and the rules explained by one of the authors, is available on Youtube [1]. The LED Chase electronics consist of an ATtiny2313 microcontroller, a buzzer, two buttons (L and R), eight LEDs and a 3 V lith- ium button cell. I<1 is the debugWIRE con- nector which according to Atmel allows “full debugging on the finished product [in com- bination with AVR Studio]”. The buzzer is driven in a bridge configuration to achieve a 3 usable sound level. The four diodes D9-D12 are necessary to avoid spurious restarts if a buzzer with a good amount of inductance is used. You may also consider using a small high impedance (>32 £ 1 ) loudspeaker instead of the buzzer. LED Chase uses the ATtiny’s 16-bit timer to generate a timeout that activates the micro’s ‘sleep’ mode with a quiescent current of only 200 nA. The project was designed using C in +Vcc © Dll D12 D9...D12 = 1N4148 BZ1 D9 DIO A 3E SI N 11 20 vcc IC1 (RESET\dW)PA2 PA1(XTAL2) PAO(XTALl) (AINOIPCINTO)PBO PDO(RXD) (AIN1/PCINT1)PB1 PDl(TXD) (OCOA/PCINT2)PB2 PD2(CKOUT/XCK/INT (0C1A/PCINT3)PB3 PD3(INT1) (0C1B/PCINT4)PB4 PD4(T0) (MOSI/DI/SDA/PCINT5)PB5 PD5(OCBO/T1) (MISO/DO/PCINT6)PB6 PD6(ICP) (UCSK/SCL/PCINT7)PB7 ATTINY2313 GND S2 H Ln 12 13 14 15 16 17 18 19 10 K1 D1 D2 BT1 £ 3V CR2430 D3 D4 D5 D6 D7 D8 110336 - 11 78 7/8-2011 elektor AVRstudio4, LabCenter Proteus VSM and Ares for the PCB. The project software is a free download from [2]. The authors’ PCB pictured here was designed single-sided to keep the cost down. The PCB design file is on the Elektor web page for the project [2]. A cover was designed for the underside of the board to prevent moist (sweaty!) fingers causing false contacts. You can have the cover produced at www.shape- ways.com using the free Google Sketchllp file also found in archive 1 1 0336-1 .zip at [2]. In terms of bells & whistles, the authors plan to expand the game with a RingTone (RTTTL) interpreter. This will enable nice jingles to be played, for example, to celebrate a cor- rect button push or to increase the beats- per-minute as the user reaches higher play levels. Unfortunately the larger software needed exceeds the 2 l< flash capacity of the ATtiny2313 and an ATtiny4313 will be needed to upgrade the game using the same PCB. (110336) [1] www.youtube.com/ watch?v=P2D1VtV8NhY [2] www.elektor.com/ 1 10336 Constant Current Source Adjustable Down to 0 mA by Jurgen Okroy (Germany) The simplest way to make an adjustable constant current source is to use a voltage regulator in a suitable configuration: an example of what is needed is given in the LM317 datasheet. However, this design does not allow the current to be adjusted down to zero. The design given here gets around that limitation. Simply use two separate fixed voltage regulators with different output voltages to ensure that the opamp is always operated within its specification. The first voltage regulator provides 1 5 V both as a power supply to the opamp and as a voltage reference for the voltage divider formed by R3-P1-R4. PI is used to adjust the reference voltage that appears on the non-inverting input to the opamp (pin 3 of IC3). The opamp now adjusts via T1 the current at the output of the circuit (i.e., from the collector of T1 to ground) in such a way that the voltage at the emitter of T1 (the instantaneous voltage) is maintained equal to the voltage at the wiper of PI (the reference voltage). For all this to work it is of course necessary that a load is connected at the output of the circuit, so that a current can flow to ground. The voltage range offered by adjusting PI is determined by the resistances in the voltage divider comprising R3-P1 -R4. With the voltage on the wiper of PI at a minimum the maximum possible output current flows: this maximum current in turn depends on the value of resistor R2. The values shown give an available current range of 0 mA to 1 00 mA with R2 = 1 00 £2 and a range of 0 mA to 30 mA with R2 = 330 £2. The calculations are as follows: we need a voltage range at the wiper of PI from 2 V or less (at maximum current, with 1 0 V or more across R2) to at least 12 V (at minimum current, with 0 V across R2). To enable you to achieve this range while still allowing for a small tolerance in the track resistance of the potentiometer, a value of 1 .5 l is used for R3 and R4, thus increasing the actual voltage range to 1.73 V to 13.27 V. Since the circuit provides a constant output current rather than output voltage, the actual voltage at the output will naturally vary. As the output current / rises the voltage drop across R2 (/ x R2) also rises and so the output voltage correspondingly falls. ( 100935 ) Water Level Detector By Andre Thiriot (France) To monitorthe filling of a bath, a water-tank, or a swimming pool, or to warn when a gully is overflowing, here’s a very simple water level detector built around a CD4011 CMOS quad NANDchip. Gates IC1.A and IC1.B are wired as an asta- ble multivibrator. The oscillator frequency is determined by Cl , R2 and preset PI . When quiescent, resistor R1 pulls the input to gate IC1 .A down to logic low, which there- fore by default blocks the operation of the oscillator in the absence of water. When water is present between the e+ and e- electrodes, I Cl .A is taken high, enabling elektor 7/8-2011 79 SI £ © TR1 IC1 = CD4011 IC1 e+ < l — e- 2 T1 IC1.A 14 BT1 ■ 4x 1V5 IC1 © 5 R1 & V3 <►6 IC1.B IC1.C 8 IC1.D & M R2 X \ & & vlO 12 <>13 & Bzl m < > PKM28 .11 IRF530 Pi 47k Cl lOn 110037 - 11 the oscillator. The output signal from gate IC1.B is shaped by IC1.C to obtain a rectan- gular waveform. Gate IC1 .D inverts the sig- nal so that transistor T1 is held off in the absence of water, which avoids current flow- ing in the primary of transformer TR1 when the system is at rest. TR1 is a 1 2 V 1 .5 VA AC power transformer wired as a step-up trans- former i.e. with the low-voltage winding connected to T1 . The transformer’s step up ratio affords ‘passive’ amplification of the signal present at the drain of T1. The trans- former’s high voltage winding is connected to piezo sounder BZ1 (e.g. Murata; the ‘28’ indicates the diameter) which produces the audible warning. In order to optimise the sound output of the unit, you’ll need to adjust PI so as to set the oscillator frequency to the resonant fre- quency of the piezo transducer; this setting can be done by ear. The electronics and batteries can be housed into a salvaged case (for example, the kind of oval box found inside giant chocolate ‘sur- prise’ eggs). The electrodes, formed from simple rigid copper wires, pass out through the case; the join is made watertight using epoxy adhesive. (110037) Internet Link [1 ] www.elektor.com/ 1 1 0037 NPN Relaxation Oscillators By Burkhard Kainka (Germany) If you’ve read old textbooks on electronics basics you may recall how it’s possible to cre- ate a multivibrator from just a neon lamp and a capacitor. The circuit of the simple multivi- brator shown in Figure 1 works in exactly the same way but using an NPN transistor instead of a neon lamp and at a much lower voltage. Anyone can check this out because the func- tion is so basic. But why? The author explains the circuit function like this: In inverse operation (emitter positive with respect to the collector) the NPN transistor has a negative characteristic (which can easily be checked) between its emitter and collec- tor. At around 9 V the base-emitter diode dis- plays the well known avalanche effect. When this occurs the charge carriers in the junction (barrier) layer are so thick and fast that they release further charge carriers. The number of charge carriers grows just like an avalanche and with them so does the current. This cor- responds exactly to the same effect in a 9 V Zener diode. The internal resistance of this diode remains positive, however. The inverse transistor now adds to this effect. The emitter and collector do indeed exchange roles but the symmetrical principle of its con- struction means that the transistor functions equally in inverse operation. We can measure a slight current gain from about 3 to 10. The transistor still functions due to fact that the charge carriers pass through the thin base layer to reach the junction barrier. And now comes the salient point: it’s precisely in this barrier layer that the avalanche effect takes place. There are still more charge carriers, which liberate yet more of them, producing an avalanche squared (so to speak). Once this avalanche is triggered, a weaker voltage is all that’s necessary to maintain the effect. The 3 collector current thus amplifies the avalanche effect and assures the negative characteristic. The strength of the discharge current is suf- ficient to drive an LED (see Figure 2). For this we need nevertheless a voltage greater than 9 V. The circuit functions adequately with two almost dead (discharged) 9 V batteries. The LED will still flash for a long time, right until the very last drop of energy in the batteries. The flashing frequency will slow down as the battery runs down. For mechanical reasons and to simplify construction, the charge resistor is fitted between the batteries. (110195) 80 7 / 8-2011 elektor dady's cool new toy Our mikromedia boards are packed with fantastic multimedia modules, such as TFT with Touch Panel, MP3 codec. Serial Flash, Accelerometer, Battery Charger, microSD card slot and much more. Create games, MP3 and movie players or home automation devices. You are only limited with your imagination. Easily create graphical user interfaces with Visual TFT software, and write user code in programming language you love the most: mikroC, mikroBasic or mikroPascal. Programming is easy. Each board comes preprogrammed with fast bootloader. Boards are available for PIC18FJ, dsPIC33, PIC24, PIC32 and XMEGA microcontrollers. r." |— - Mikrollektronika DEVELOPMENT TOOLS I COMPILERS I BOOKS www.visualtft.com www.mikroe.com Laser Level Detector +Vbatt By Cyriel Mabilde (Belgium) Rotating laser levels, which are very handy for setting objects in a room or garden at the same height, are available at prices of a few dozen pounds. At relatively large distances and for outdoor use, the light from the rotat- ing laser beam is often not easy to see, and the laser beam detector described here can be useful in such situations. The detector works well at distances up to 50 metres (1 50 feet) and consists entirely of standard compo- nents. The detector is housed in a plastic case that can be fixed to an object (such as a post ora beam). It has three LEDs and a beeper that indicate whether the object should be raised or lowered. LEDs with a transparent package and inte- grated lens (round surface) are used as sen- sors. The top and bottom detection zones each have five LEDs and two opamps (ICIa & ICIb or ICIc & ICId), which drive the ‘Move Up’ and ‘Move Down’ indicator LEDs. The mid- dle sensor LED drives the ‘OK’ indicator LED via two opamps (IC2a & IC2b). The rising edges of the opamp output signals trigger three separate monostable multivi- brators (type CD4047). If desired, the circuit shown inside the dashed outline (one gate of a CD4044 quad RS latch) can be used in place of each of the monostable multivibrators. In this case the output signal has the opposite polar- ity, so the BS170 N-channel MOSFET must be replaced by a P-channel type. The monostable time of the middle retrig- gerable MMV should be longerthan the rota- tion period of the laser (e.g. with a 2 rpm laser it should be longer than 500 ms) so that the beeper will emit a continuous tone. Most rotating laser levels have variable speed, so this can also be achieved by adjusting the speed if necessary. The monostable times of the upper and lower MMVs are dimensioned to generate clearly distinguishable short and long beeps, respectively. The three MOSFETs (T1, T2 and T3) are configured as a wired-OR gate to drive the shared beeper. The fourth MOSFET (T4) drives the ‘OK’ LED. The circuit can be housed in an enclosure together with three penlight cells. (110284-1) Debouncer for 1 2 V Contacts by Jurgen Okroy (Gemany) Usually some effort is required if it is desired to use the positive edge of a switched 12 V signal (for example from a 12 V horn relay in a car) in a digital system. Digital systems place particular requirements on the signals they use, and the RS flip-flop often used for debouncing purposes does not provide a complete guarantee against interference. If, furthermore, there is no auxiliary 5 V supply available for the debounce circuit, we must 82 7 / 8-2011 elektor turn to a device such as the 555 timer 1C to clean up the signal. The circuit shown suppresses any bounces during a brief initial period that starts from the first rising edge of the signal. This period has a duration of a few milliseconds, and is determined by the value of capacitor Cl: if Cl =1 pF the period lasts about 2 ms and if Cl = 2.2 pF it lasts about 4 ms. Furthermore, when the signal returns to 0 V the circuit sharpens up this falling edge, mak- ing the resulting output signal closer in form to the ideal rectangular pulse. (100252) Roadwork Traffic Signals for Modellers by Michael Gaus (Germany) Anyone looking to add more activity to the highways in a min- iature landscape should welcome this project for controlling tem- porary traffic signals. Just a few components are needed to con- trol two traffic signals realistically. +5V Each traffic signal comprises three LEDs (red, yellow and green), each of which has its anode connected to the others. The signals can either be home-made or bought ready-made, for example [1 ]. Con- trol of the light aspects (phases) is handled by an AVR microcon- troller type ATtiny13. Since the software for the two signals is sequential and involves multi- plexing, this circuit provides a total of three series resistors for the LEDs and five inputs to the microcontroller. The traffic lights can be operated in two dif- ferent modes. With jumper JP1 inserted the control includes a combined red+yellow phase, as used for example in Germany and Great Britain. Remove JP1 and this phase is suppressed and the lights change direct from red to green (as in France and the USA for instance). This enables two different col- our sequences to be followed. For the clock source we use the internal oscillator of the ATtiny13 with a divide-by-8 prescaler to achieve a clock frequency of 1.2 MHz. The software handles the mul- tiplexing by a timer whose interrupt rou- tine is called up every 5 ms and instructs the current colour to be displayed alternately to one or other of the two signals. The manufacturer’s settings for the fuse bits in the ATtiny13 are fine for this circuit, meaning they do not need to be recon- figured. The software for the microcontroller is already avail- able to download from [2]. The source code was produced with the evaluation version of AVR’s CodeVision C compiler, which is free for private, non-commercial use. Although code length is lim- ited to 4 KB, this is perfectly ade- quate for this application [3]. (110203) Internet Links [1 ] http://shop.conrad-uk.eom/1 / 2-a2- ul<0241272 busch-hO-2-traffic-signal- additional-set-5901-.html?q=Ho%20 model [2] www.elektor.com/ 1 1 0203 [3] www.hpinfotech.ro/html/download.htm elektor 7/8-2011 83 Adjustable Low-Dropout Voltage Regulator By Michel Defrance (France) in the form of Cl and C4. The PCB design [1 ] is double-sided. All of the SMDs are fitted on one side, and the BD136 is fit- ted on the other side (the copper side). If desired, the power transistor may be fitted with a heat sink and insulating washer. However, the low-drop design makes a heat sink largely unneces- sary. The small PCB can be fitted in place of a conventional voltage regulator 1C, since JP1 is pin-compatible. Setup is very sim- ple: remove JP2, con- nect a voltmeter to pin JP2-2, and adjust PI to obtain the desired voltage at the output. Now replace JP2, and you’re done. Bear in mind that the input voltage must be at least 1 V higher than the output voltage. The transistor types are not critical; any pin- compatible equivalent type can be used. You could even use leaded types instead of SMDs — for example, BC547sforthe NPN transistors and a BC557forT2, which is the only PNPtran- sistor other than the power transistor. The table shows several readings measured with an output voltage of 7.39 V, which was used to drive two white LEDs connected in series. V IN = 9 V,V INmin = 8.20 V. (110288-1) Internet Links [1] www.elektor.coml/110288 This circuit is based on a design for a low- dropout voltage regulator in the book 303 Circuits (published by Elektor in 1998). The author adapted the design to make the out- put voltage adjustable, and he designed a new PCB for SMDs. However, the power tran- sistor is still an ‘old-fashioned’ type. The following changes were made to the orig- inal design: • The 4.7-V Zener diode is replaced by a TL431 shunt regulator, which has good stability and generates an output voltage that can be varied with a 5-l<£2 potentiom- eter, which allows the output voltage to be adjusted over the range of 5 to 1 6 V. • The 390 £1 is replaced by a current mir- ror consisting of transistors T5 and T6. The operating point of the current mirror is set by R3 and the TL431 . The stability of the out- put voltage depends on the cathode current of the TL431 . The data sheet specifies a mini- mum value of 1 mA for good regulation, so with 1 .7 mA at an output voltage of 5 V the margin is more than adequate. • The output stage consists of two transis- tors (T1 and T2) in a Darlington configura- tion. Resistor R9 ensures that the base- emitter voltage of T1 is always sufficient to keep T1 conducting, even at very low output current levels. • D1 was an AA119 germanium diode; it is replaced by an MELF4148. • To ensure that the regulator starts up properly, the value of R8 is reduced from 100 k£2 to 3.9 k£2. • Output filtering is integrated on the board Load [£2] Vqut [V] Error [V] 1 [mA] 680 7.39 0 10 390 7.37 0.02 18.8 220 7.37 0.02 33.5 100 7.35 0.04 73.5 33 7.31 0.08 220 10 7.20 0.19 720 84 7/8-2011 elektor Driving your loudspeakers to a higher end morel I' m * / i ' Visit our website for more details on our new program EUROPEAN DISTRIBUTOR info@moreleurope.com riTiu tel. +3 1 (0)595 49 1 7 48 ^ 1 h\mA LJDt www.moreleurope.com MHA2015 Make Qesign Easier v-mopgue DC/DC Converlers High McifrQ. No Heat Slink Evaluation Boards Low Cost. Read* -lo-Use Fill Audio Trim sun iters Hill Sound Qua lih e Consumer q Auto accessories c Instruments 6 Industry e Toys c Communication Equipments 0 And many menu e< A integrated do sign c Ultfa compel e Alrnosl no external parts c Sol de rod r>y SMT or by hand o Lew cost G High Reliability c Many ready-to-us# EVS r Dealer Wanted! Class I> Audio Amplifiers llifti Quality, J I i p.h ElTetiency YEAR WARRANTY ej Technology PicoSoop# 3000 Series iTHE HIGHEST-PERFORMANCE USB-POWERED OSCILLOSCOPES AVAILABLE C(L LLJ l/) O O O no LU CL O u l/) O U Power and portability. W hy compromise? LU 200 MHz bandwidth HUGE128MS buffer size 500 M S/s real-time sampling 10 GS/s repetitive sampling Advanced digital triggers 200 MHz spectrum analyzer Built-in function generator/AW G U SB-connected and powered LU I h 128 M Sample buffer memory ■ ■ . 200 MHz spectrum analyzer A rj - k— * jl 11 ’ - , E-jS s at Serial decoding j uy Arbitrary waveform generator } H igh-end features as standard. W hy compromise? Serial decoding Mask limit testing Segmented memory www.picotech.com/scope3l05 elektor 07/8-2011 85 Make Your R8C/1 3 Speak CAN [3 RXD o- +5V ®~1“ PC< BC547 GND o- R2 I +5V@ si M RESET n L +5V WR Cl RD CS ALE 10 RST 12 14 16 O O o o o a o a o o a o a o o K1 MODI 1 Pl.7^ 8 3 P1.6 9 5 P1.5 10 7 P1.4 11 9 P1.3 12 11 P1.2 13 13 Pl.l 14 15 P1.0 15 16 RXD1 TXD1 CNVSS P0.1 RESET P0.2 XOUT P0.3 VSS MODE XIN P0.4 VCC P0.5 P1.7 R8C/13 P0.6 pi.6 P0.7 rxdo/pi.5 IVCC txdo/pi.4 P3.0 pi.3 AVSS pi.2 P3.1 pi.i AVCC Pl.O P3.2 P4.5 P3.3 31 _30 _29 28 BC557 ]_R5 27 _26 25 _24 23 22 _2i 20 S2 MODE 7 _ 19 18 17 110302 - 11 By Hermann Nieder (Germany) This little processor board from the big Elek- tor R8C Project has certainly attracted some attention over time [1], [2]. And with good reason, as it’s so easy to incorporate into your own microcontroller applications. This article explains howto hook it up to CAN bus [8], [9]. In Elektor for December 2005 [1] we demon- strated a ‘minimalist’ system that enabled the controllerto be programmed using a RS-232 interface. The same minimal hookup is used this time around, together with the same programming (with help from the bootloa- der included in the R8C) and communication with a PC using RS-232. The combination uses a USB/TTL cable, which obviates the need for transistors T1 and T2 orthe wiring for them. For CAN communication we can use the CAN interface board out of the Novenber 1999 edition of Elektor[3]. Also used is the SJA1 000 CAN controller from Philips together with a PCA82C250 CAN transceiver. The 2x8-pin contact strip shown in the circuit diagram is linked direct to plug-in connector l<3 of the CAN bus interface. With a bit of skill and a short length of flat cable you can also make up an adapter for the very similar ‘CAN bus interface for PCs’ (Elektor June 2000), which is equipped with a 25-pin SUB-D plug- in connector [4]. The CAN controller can access 32 registers [5]. To define a register of the SJA1000 from the R8C we first output an address on port PI . Then ALE is set and reset to accept this byte. Following this the data byte is output over port PI. Finally /WR is changed from 1 to 0 in order to transfer the data byte into the regis- ter selected previously. When reading a register the address must first be transferred to the CAN controller as descri- bed above. Next we need to prepare port PI of the R8C for the read operation. A set and reset of /RD will read the byte out of the selec- ted register address. The author has written a PC program in Visual Basic 5 for receiving and composing CAN mes- sages. The program uses Burkhard Kainka’s functions library RSCOM.DLL von, which can be downloaded from his website [6]. The firm- ware forthe controller relies in part upon the R8C routines already published in Elektor, since it would be a shame to have to rein- vent the wheel afresh. As always, the PC soft- ware and the firmware for the controller can be downloaded for nothing from the Elektor website [7]. The RS-232 communication between PC and R8C operates at 9600 Baud. For CAN com- munication you have a choice of transmis- sion rates: either 20 kbit/s or 50 kbit/s. This value is set at initialisation time by pressing the corresponding radio button in the Visual Basic schedule. During initialisation the contents of registers 0 to 31 of the SJA1 000 are set out sequentially in a list box. When a data packet is received labels appear to the right of the list box for the two registers 20 and 21 (the first two bytes of the receive buffer). Also indicated there is the identifier of the packet as well as the RTR bit that sepa- rates CAN-Remote frames from data frames. To identify the sender you enter a value in the text field provided for this purpose. There is also a check box for the RTR bit that can be set or unset. These inputs are handled by the radio button marked ‘Identifier’. In addition there are labels on the right that identify the contents of registers 1 0 and 1 1 (the first two bytes of the send buffer) together with the status of the RTR bit. Pressing the radio but- ton to refresh the register display will assure you whether the desired alterations have been made. In the same way the individual register con- tents can also be changed directly. Sepa- rate buttons are provided for selecting each of the two reset modes of the SJA1000. A further button triggers the CAN controller to start transmitting. Another button clears the receive buffer. The author has already carried out quite a number of experiments along these lines. If you have two R8C/13 boards and two CAN bus interfaces available and launch the PC program twice (or run it on two PCs), you can hold ‘conversations’ across the CAN bus, which the software visualises rather well. (110302) Internet Links and References [1] www.elektor.com/0501 79-2 [2] www.elektor.com/r8c [3] Controller Area Network (CAN), Elektor November 1 999 [4] www.elektor.com/000039 [5] www.nxp.com/documents/data_sheet/ SJA1000.pdf [6] www.b-kainka.de/pcmessfaq.htm (in German; use Google’s translator facility to read in English) [7] www.elektor.com/ 1 1 0302 [8] http://en.wikipedia.org/wiki/ Controller_area_networl< [9] http://www.canbuskit.com/what.php 86 7/8-2011 elektor Electric Guitar Preamp, Mixer and Line Driver [y By Petre Tzvetanov Petrov (Bulgaria) Depending on its design an electric guitar may have anything from one to six pickup elements. Classic (acoustic) guitars could also benefit from one or more retro-fitted pickups. Each pickup has a specific sound depending on the type of sensor and the location on the instrument. When a guitar has more than one pickup these can be connected together with or without additional components. However it is preferable for each pickup signal to be buff- ered individually. These buffered and possi- bly amplified signals should be level-adjusted in order to produce the desirable effect (or ‘sound’). After that they are mixed and sent to the next stage of the audio processing equipment. Most guitarists agree that pickup elements cannot drive cables longer than about 6 feet without risking significant signal degradation. Guitar pickups typically require a load resis- tance above 50 k £1 and sometimes higher than 200 k £1, hence a preamplifier/buffer is often inserted, whose main function is not high gain but to enable cables between 10 and 30 feet to be connected representing a capacitance between 90 and 180 pF/m. In the circuit shown here, each pickup has its own input buffer with a transistor configured as an emitter follower. Each stage has a gain slightly lower than unity. This is not an issue because most pickups provide significant sig- nal levels, typically well over 200 mV pp . The input resistance of the first stage exceeds 200 kCl, which is appropriate for most induc- tive pickups on the market. If higher input resistance is needed the 1-M£2 resistors marked with asterisks could be omitted, and the 720-l<£2 ones may be increased to 1.2 - 1.5 M£2. This will raise the stage’s input resistance to around 500 k £1. To ensure the highest possible undistorted signal can be developed at the output of the first stages, the collector-emitter voltage (V CE ) of T1-T4 should be about half the supply voltage. It is important for the first transistor in the buffer to have low noise and high DC gain. The types BC549C and BC550C and the venerable BC109C are perfectly suitable in this respect while the BC546C, BC547C and BC548C may also be considered. The buffered signal from each pickup is adjusted with a potentiometer and sent to the summing circuit of the mixer. The next active element is an audio operational ampli- fiertype NE5534 or NE5534A (IC1), which pro- vides the required amount of signal buffering. The 5534(A) has low noise, low distortion and high gain. It can drive a 600 £1 line when nec- essary, but the preferred load is above 2 k £1. Its amplification is adjustable between 3 and 10 with feedback potentiometer P5. At higher values of the gain some limiting and distortion of the output signal is ‘achieved’, which may well be a desirable side effect. The maximum undistorted amplitude of the out- put signal depends on the supply voltage. If higher gain is needed the value of P5 may be increased to 470 k £1. Output l<7 has a volume control potentiome- ter (P6), which could be omitted if not used or required. Both outputs l<6 and l<7 are capable of driving 600 £1 loads including high-imped- ance headphones. The circuit is simple to test and adjust, as follows: 1 . check that V CE on T1 -T4 is approximately halfthe supply voltage; 2. with no input signal, adjust trimpot P7 for about halfthe supply voltage at the output of IC1. If precise regulation of the opamp’s output offset is not required P7 may be omitted and R17 connected to the junc- tion of R18 and R19. The supply voltage is between 12 V and 24 V. It is possible to run the unit off a 9 V power supply but the lower supply voltage will limit the output amplitude and gain. The current consumption from a 9 V battery is typically 10 mA. Two 9 V batteries connected in series is the preferred solution. The undistorted output amplitude is up to 6 V pp at a 12 V supply with 2 k£l loads at the outputs. The unit’s frequency band exceeds 20 Hz - 20 kHz. Distortion and noise were found to be negligible in view of the application. (110307) elektor 7/8-2011 87 Zero-IC 24-LED Pulsed Cycle Light By Ian Field (UK) Cyclists’ pulsing LED lights are eye catching and much more conspicuous than a steady light, so it was decided to make provision for the other half who don’t have one. The aim was to use cheap, recycled components only. At £3.99 the most expensive bit was the 24-LED worklight with magnet and retract- able hook. The DB3 diac could be less easy to find; one was liberated from an 18-watt Philips CFL. Don’t buy the lower wattage types as you’ll find that the Philips 8 W and 1 1 W versions normally don’t have a DB3 diac. The prototype was originally built with a 2SD1266 transistor which was replaced by the more common BD433, a T0126 device which should be cooled adequately. The part most likely to cause sourcing difficulties is the BD433 : W- 0 k * • 1 r m r - M P* *• r ■ fy * * # * • * • t n <9 O tt tt tt tt tt tt nmm 110164 - 11 ++ ++ ++ ++ ++ ++ 24 x LED ferrite toroid core. The one used has an inner and outer diameter of 9.16 mm and 17.76 mm respectively and a thickness of 6.63 mm. It was liberated from a scrap PC motherboard — ask the local computer shop for an old dead motherboard to salvage components. Electrically the circuit has been made as sim- ple as it can possibly be — a bog standard blocking oscillator. The downside is you have to wind 60 turns of very thin wire on a toroid! The winding wire was liberated from a 6 -volt power adapter. Put the two 12 turn windings on first (0.5 mm/AWG24). The 60 turn wind- ing is easier if you wind half one way then half the other. Cut about one metre (just over three feet) of the thin wire (0.1 mm/AWG38) and feed it through the toroid, then hold the two ends and let the weight of the core find the middle. Hold the first start (middle) and wind 30 turns (tape the loose end to an AA battery and let it hang to one side so it doesn’t get caught up in the end you’re winding); when you’ve wound 30 turns, free up the other end and feed that through 30 times to make a total of 60 turns. For the collector & base windings, the easiest way to avoid phasing the windings is to wind on the first 12 turns, then pull out a loop and tightly twist it back to the core before put- ting on the second lot of 12 turns. The cen- tre tap is the +1 .5 V power connection and as the two windings are identical either end can be collector or base — that only leaves phas- ing the secondary. If the circuit only flashes a few times a minute, reverse the leads and it will flash from about normal for a cycle light or you can turn the 470 £1 pot until it flashes dizzyingly fast. The 1 80 £1 resistor is to protect the transistor from excessive base current. On the secondary side, the pulses are recti- fied by a UF4007 diode to charge an electro- lytic capacitor. Every time the voltage on the capacitor reaches about 32 V the diac triggers and dumps the charge into the 24 parallel connected LEDs. The DB3 diac carries pulses of 2 A which is plenty to flash the LEDs. The 47 jllF electrolytic was selected empirically for a good pulse brightness, bumping this up to 1 00 jllF would make the pulses really intense — but for how long! As an afterthought, while the pulsing light is very conspicuous to other road users on well lit roads, it’s not so good for actually seeing where you’re going on unlit cycleways away from the main roads and street lamps. The obvious solution is a second flash rate pot and a changeover switch. The unit as is can be adjusted to a flash rate not that far short of persistence of vision. A switch to change over to the maximum flash rate would make it easy to navigate an unlit cycleway in total darkness. Along with the usual reminder about type approval and road legality in some countries, readers should be advised that the most rapid flash rate can be irritating (even confusing!) to drivers and should only be used in unlit areas away from the road. It is also worth point- ing out that the maximum flash rate puts a greater strain on the components — espe- cially the battery. (110164) 88 7 / 8-2011 elektor Protecting PE Water Pipes against Frost using Electric Fence Tape By Pierre Vignisse (France) Tapes for electric fences are available in vari- ous qualities and forms, with differing charac- teristics. They are usually made by interweav- ing threads in polyethylene, nylon, or some other synthetic material with several strands of wire in stainless-steel, copper, or some other conductor, of relatively small diam- eter (from one to several tenths of a mm in diameter). For information, a 1 m-long stainless wire has a resistance of around 23 £2 for a diameter of 0.2 mm, and hence 5.75 £1 for a diameter of 0.4 mm. Thus a tape’s linear resistance may vary from a few milliohms to sev- eral ohms per metre, depending on the number of strands, their diameters, and the nature of the conductors. But don’t worry, you won’t have to calculate it, just measure it — assuming it isn’t spec- ified by the manufacturer. Some rudimentary tests show that a 2 £2/ m tape carrying a current of 1 A raises the temperature (inside foam pipe insulation) by around 15 °C. Thus in theory, to withstand temperatures down to -1 5 °C (5 °F), it would be neces- sary to dissipate 2 W/m inside foam pipe insulation. Thus even with just a simple 50 VA transformer, it is possible to per- fectly simply cover 25 m of PE piping (polyethylene, and hence insulating). Since we have a choice of linear resist- TAL < 50 V AC , then R < 1250 / L 2 [£2/m] and we need / > L / 25 [A]. Knowing that for 2 W/m, V = V(2R) and / = V(2//?), we can work out everything. However, we do need to take care not to use a current likely to upset the temperature meas- urement — excessive heating of the driver transistors could disturb the operation of the circuit. The example below will cope with 2 A without any problems. Construction is based, on the one hand, on the use of two IRFR3607 power MOSFETs ( R DS(on) 9 ^DS(max) = 75 V ) and on the other, on the LT 1172, a thermostat operat- ing at 0 °C (push-pull output, 2 °C hysteresis, ultra-low power consumption of 40 |iiA max- imum @ 5 V, SOT223 package). An LED will indicate that power is present, and another H T1 IRFR3607 marily with respect to the C| SS of the MOSFETs — it must be enough to maintain the charge on them without significant loss of gate volt- age (5 V here). On the PCB [1], the sensor has been kept apart in orderto avoid its operation being disturbed by the 0.6 watts dissipated in R2-R5 and the power dissipated by the transistors. The cop- per planes even out the temperature around the sensor. The board should be pseudo-trop- icalized with four coats of transparent varnish, as it is going to be mounted outdoors. The tape has to be prepared, and this is perhaps the most tedious part of the job. Normally, the installation will require a current return con- ductor — unless you decide to use tape for both feed and return, either doubling the power, or reducing the current by a factor of V2 to com- pensate. However, you are going to have to unravel the ends of the tape in order to make positive, reliable connections. The tape used is 2 cm (0.8 inch) wide, so you can fix the return wire and insu- late it completely where it passes metal elbows and tees using 5 cm (2 inch) wide adhesive ‘duct’ tape, available in any DIY store. A more expensive solution is to use heat-shrink sleeving. To complete the connections, all you need is a soldering iron and some ring terminals and terminal blocks. Then, you still have to attach the tape to the piping... If you’re using auto- matic drinking troughs, you may need to make a loop under the trough to heat that too; don’t forget to reposi- tion the foam pipe insulation properly. Lastly, position your board outdoors, ance, we can produce a heating tape of a given length while powering it from a safety voltage (less than 50 V AC ) with no danger for either us or for animals. So we have P=V 2 1 R = Rx I 2 = 2 with P in W/m, R in £2/m and V in V/m. If L is the total length in metres, and since \Z T0 . could be put in parallel with the tape. Resistors R2-R5 (SMD 1206 shape) have been used in order to be able to handle the dissi- pation for the proposed voltage range while ensuring 3 mA in the zener diode, but if the voltage is reduced, the number of resistors can be reduced proportionately. The HYST pin of the LM26 is returned to the 5 V rail in order to select hysteresis of 2 °C. Cl is chosen pri- high up (2 m / 7 ft.) and preferably horizontal for greater effectiveness. Going about it this way, the piping will be heated up before it is affected by freezing. (110189) Internet Link [1 ] www.elektor.com/ 1 10189 elektor 7/8-2011 89 Universal Tester for 3-pin Devices By Georges Treels (France) Most 3-terminal active components can be tested statically using just an ohmmeter. But when you have a lot of these devices to test, the procedure soon becomes boring. That’s where the idea came from to combine fast, easy testing for these types of device into a single instrument. The unit described here enables you to test NPN and PNP bipolartransistors, N- or P-chan- nel FETs or MOSFETs, UJTs, triacs, and thyris- tors. Regardless of the type of device, the tests are non-destructive. Universal connec- tors allow testing of all package types, includ- ing SMDs (up to a point). The unit lets you change from one type of device to another in a trice. It avoids using a multi-pole switch, as they’re too expensive and hard to find. Here’s how to build a versatile instrument at a ridiculously low cost. IC1 is a 4066 quad CMOS switch which will let us switch between bipolartransistors and FETs. LEDs D1-D4 tell us about the condition of the test device, when we press the ‘Test’ button. The 4066 can only handle a few milliamps, not enough for the other component types to be tested, hence the reason for using relay RE1 . This 12 V relay offers two NO contacts. The first applies power to the UJT test circuit, the second applies it to the triac and thyristor test circuit. Extensive testing has shown that the best way to test UJT transistors is to do so dynamically, with the help of a relaxation oscillator. Net- work R1 1 /Cl sets the oscillator frequency to around 2 Hz. On pin B1 of the UJT we find a nice sawtooth, which is not of much interest to us here. However, pin B2 gives good but very short pulses. IC2, wired as a monostable, lengthens these pulses so they can be clearly seen via LED D5. The relay’s second pole is going to drive the thyristor’s or triac’s trigger pin. The value of R18 is a good compromise with respect to the varying trigger currents for this type of device. Resistor R17 is important, as the hold- ing current must be high enough for a triac; 250 mA is a good compromise. LED D6 tells you if the device is in good condition or not; but watch out, the test result must be con- firmed by briefly cutting the power in order to reset the triac. On the web page for this article [1] you’ll find the author’s CAD files (PCB layout and front panel) along with some photos of his project. On the prototype, the LEDs and the ‘Test’ button were wired onto the copper side of the PCB. The six female connectors for the devices being tested were salvaged, but there are lots of models available on the market (the pitch is standard). The test cable crocodile clips must be as small as possible for testing SMD devices. (100942) Internet Link [i] www.elektor.com/ 1 00942 SI N TEST n 13 Tr4 R3 l IC1.A NPN R1 < >- | 10k | -Q- R2 l IC1.B R7 PNP R5 < >- | 10k | — Q I, IC1.C Tr9 12 10 l rh t o— - 11 ICl = 4066 ICl © C5 +12V -© C4 □ TrH |r!2 |r!5 UJT lOOn lOOOu 8 |4 ® R TR IC2 DIS OUT 555 THR CV C3 □ 4u7 C2 lOOn D5 R14 1 D6 R17 OC 5 I R 16 THYRISTOR T t TRIAC THl TRI1 R18 150R K> JL JF 100942 - 11 90 7 / 8-2011 elektor ^ ;V;,ephone.to-Vo,PAdapter TimeCHck Oil**®** TO DMtWBk The upgraded Elektor-PLUS subscription! o All 1 1 issues including the Summer Circuits edition ( Included in your PLUS subscription: Annual DVD 2011 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! When taking out an Elektor PLUS subscription you get exclusive access to www.elektor-plus.com where the three latest editions of Elektor magazine are available in the form of pdf files (i.e. the current issue and the two pre- ceding ones). With a simple click you download the complete issue (front to back!) or any single article. www.elektor-plus.com also sup- plies the most extensive Elektor search engine found on the web. However the upgraded PLUS subscription offers many more interesting extras like free E-books and supplementary articles. jr iMP3 player + Dev^l'-T 3 T 3L SoC, PSoC&Co ; 1 » l » JM rr^rrvy^Vft^l^rrriViJlii:. aLLAlU “■ www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. DISPLAYS Pictures for the Masses Big screen LED displays Rainer Bucken (Germany) Video screens for large audiences are now mostly made from LEDs. Here we take a look at lightweight LED tiles that fit together to make a seamless display covering hundreds of square metres, semi transparent and multiple HD resolution displays. It was back in 1 962 that General Electric introduced the first semi- conductor light source, it was red and it wasn’t very bright. It took another 20 years before a green LED appeared and then in 1 994 came the blue LED. Since that time the technology has not stood still. Manufacturers such as Nichia, Philips (who acquired Lumileds three years ago), Osram, Sharp and Mitsubishi have invested heav- ily in research and development. One focus of this on-going work is to improve efficiency; red and green LEDs achieve figures of around 60 to 80 Im/W while white and blue can manage just 40 Im/W. The goal is 300 Im/W! 30,000 Euros per square metre The vast majority of large screen displays produced today use LEDs — there is little other competing technology. The 40 by 25 m Jum- botron display first used by Sony at the science expo in Tsukuba 1 985 consists of a number of small black and white TVs mounted adjacently. Variants of this design are still in use today. Displays using 6 mm LEDs are some of the most common types sup- plied today. Costs for the display alone work out at around 30,000 euros per m 2 . In addition the display control computer will set you back a further 20,000 to 50,000 euros. Current trends indicate that you can expect these costs to fall by around 5 % per year. It is impractical to mount each individual LED in a large display. The display is instead made up from interconnecting modules or ‘tiles’ each containing a number of LEDs. To keep the image homogenous across the whole display area some of the most expensive displays use carefully matched LEDs. Another approach uses a Gaussian nor- mal distribution; each tile is mounted with LEDs selected at random from an entire batch. Variations in the characteristics are averaged- out across the whole display area. Modules fit together so that there is no visible frame. Displays with the smallest dot pitch use individual LEDs in SMD outline. Larger pixels or clusters are made from several LEDs building a node. The viewing distance dictates the dot pitch. At a distance of one metre the human eye can resolve two pixels separated by 0.3 mm. At a distance of 1 00 m the separation is 30 mm. A rough rule of thumb states that the dot pitch (in mm) should not be greater than the viewing distance (in metres). Indoor displays use pixels on a 3 mm to 6 mm pitch while outdoor installations generally use 8 mm to 48 mm pitch. For special cases the dot pitch can be up to 1 80 mm. Many of the module designs use a technique to generate ‘virtual’ pixels to improve perceived resolu- tion. The ‘DV8’ form Mitsubishi has a physical dot pitch of 1 6 mm but by using a dynamic pixel technique the perceived resolution is 8 mm (see www.diamond-vision.com/dynamic_pixel.asp). Europe’s biggest Nightscreen Europe’s biggest large screen installation was unveiled this year in Berlin, Germany. The upper third of a redundant gasometer in Ber- Figure 1 . The Berlin gasometer fitted with 660 square metres of LEDs (Picture: Stroer). 92 7/8-2011 elektor DISPLAYS lin-Schoneberg was fitted with a 33 by 1 9 m display to show adver- tising images. These (hopefully not too distracting) images can be seen from the Steglitz motorway (Figure 2 and 3). The operators are hoping to raise three million euros revenue from the site over the next five years to fund restoration of the gasometer. The nightscreen has a 16:9 aspect ratio and consists of 550 LED chains. The iColor Flex SLX chains are supplied by Color Kinetics, who in the last year has become part of the Philips concern. Each chain has 50 individually addressable LED nodes. These are 3 cm translucent spheres spaced at 15.6 cm and connected to each other by a three core cable supplying both 1 2 V power and display information. Each node has three red, two green and two blue LEDs together with a Cromacore controller chip. Control of the complete display takes place using Ethernet or DMX51 2. There are also a number of pre-programmed light effects. The highly integrated design of the display ensured that the team could begin testing just one month from the start date. The LEDs produce a luminosity of 3000 candela per square metre (= 3000 Nit), giving a display brightness roughly ten times greaterthan an average PC monitor. Maximum power consumption is 80 kW at peak white, each LED dissipating 2.9 W. Despite these power demands there is no need for any additional cooling. The screen undergoes maintenance checks every four weeks and is cleaned by a specialist company. Figure 2. For the best effect big LED displays need to be viewed from a distant. (Picture: Stroer). Five times HD resolution According to Thomas van Damme of Barco Media & Entertainment Division there is a wide choice of large screen display on the market “The smallest of our displays use 4 mm pitch LEDs giving a lumi- nance of 2000 Nit, while the largest on a 28 mm pitch produce 6000 Nit”. The smaller displays with 4 and 6 mm pitch are used for indoor installations while those of 1 0 mm and more are used for outdoor spaces. Here sunlight is the biggest enemy of display brightness. Year on year with every new improvement in the technology we see greater levels of luminosity for the same power consumption. Barco’s largest installation to date covers one side (750 m 2 ) of a sky- scraper in Beijing (Figure 4) but even this monster does not come close to the companies ambitions. “We can foresee indoor installa- tion sizes rising to 1 0,000 m 2 and for outdoor use we are looking to 30,000 m 2 and more” said the representative from Barco “In princi- ple there is no physical limit to the maximum screen size.” The highest resolution display wall built from 4 mm LEDs has been installed by Barco at the headquarters of the US cable concern Com- cast in Philadelphia. It is a seamless 25.4 m wide and 7.75 m high comprising 6771 NX-4 LED modules which amount to 1 0 million individual 4 mm LED pixels giving the screen five times the resolu- tion of HDTV. Image processing is handled by six DX-700 LED digit- isers, seven Encore Video processors and three MatrixPRO routers. The display wall is an unconventional shape and includes cut-outs to accommodate the entrances to three lift halls (see Figure 5). Power consumption works out at about 500 watts per square metre; the entire display can consume a maximum of 550 x 200 = 110 kW when displaying peak white. Typically consumption would be one third of this but the supply and component cooling must be dimen- sioned to cater for the worst case. LED longevity is compromised by high operating temperature so it is necessary to maintain the components below 40°C. According to Thomas van Damme “A life expectancy of at least 50,000 hr should not be a problem for most LEDs and by that time we can expect to see the display brightness reduced to about one half”. The Beijing Olympics was responsible for a big increase in large screen video installations in Beijing and around the world, many of which were supplied by Barco. In the ‘Bird’s Nest’ stadium itself Figure 3. Drivers get the best view at night. (Picture: Stroer). elektor 7/8-2011 93 DISPLAYS Figure 4. Barco’s biggest screen in Beijing took up the entire side of a skyscraper (Picture: Barco). Figure 5. The five-times FID resolution screen at Comcast. (Picture: Barco). a large area of the floor was carpeted with LED panels for use dur- ing the opening ceremony (Figure 6). The panel manufacturer and supplier were most probably Chinese but their name has not been revealed. It is estimated that four billion viewers worldwide wit- nessed the opening ceremony, 90,000 of which were in the stadium itself. With such a massive display area it was only to be expected that some of the LED modules would malfunction resulting in some dark fields (see Figure 7). These minor glitches did not detract from the spectacle and the overall effect was truly magical. In addition to these ‘direct emission’ types of display there were also some high intensity projectors in use. Creative Developments One of the biggest players in the supply of large screens for video production, trade shows, indoor/outdoor concerts and TV shows, is XL video. The company was formed in 1 996 and now has branches throughout the world. Any visitor to London during the Beijing Olympics could not fail to have noticed the 85 m 2 Lighthouse R7 LED screen close to Nelsons column in Trafalgar square installed by XL video UK. In Germany during the recent European football cham- pionship a large 60 m 2 spectator screen was installed by XL video in front of the Brandenburg gate (Figure 8). Denis Papin, the General Manager of XL video Germany, pointed out that from the installer’s point of view the big advantage of LED technology compared to the earlier ‘Jumbotron’ video walls is that they are only one third of the weight. The vast majority of today’s rock bands and solo artists (including such extremes as Massive Attack and Flerbert Gronemeier) would not even consider performing in concert without the backdrop of a video wall. A typical installation for such an event would use a 230 m 2 wall (24.5 m x 8.50 m) so that even fans in the cheap seats at large venues would not need binoculars to get a close-up of the artist’s dental work. The lead photo shows an installation made up from 24 horizontal by 1 1 vertical modules. The display weighs 21 .8 tonnes and consumes 237,000 W (peak white). The panels shown are Mitsubishi DV8 LEDs with a 1 6 mm physical pixel spac- ing (8 mm virtual). Considering the very good screen resolution, costs are relatively good and work out at around 1 2,000 to 1 3,000 euros per m 2 . The complete wall costs three million euros and the company charges 75,000 euros per week for hire. You can expect to pay a further 1 5 k Figure 6. At the opening ceremony in Beijing the floor was a gigantic LED ‘wall’. (Picture: Alexander Lepges/Audio Technica). Figure 7. There were one or two hiccups in the opening ceremony displays but it didn’t spoil the spectacle. (Picture: Private). 94 7/8-2011 elektor DISPLAYS The Olympic globe was also made from LED modules. (Picture: Alexander Lepges/Audio Technica). An example of a half transparent display from Procon, used at the 2008 Eurovision Song Contest in Belgrade (Picture: Procon). euros for transportation and installation costs. According to Denis Papin: “Three technicians with six helpers take about four hours to build the wall and another two hours at the end of the concert are needed to pack everything away.” New developments from Barco include the 4 cm x 4 cm modular pixel block MiPIX which is used to build large screens, wrapped around large 3D company logos or other shapes to display video content. From the same company is the MiSPHERE, a 60 mm diam- eter translucent LED ball which can be linked together with others to form a vertical string. Many adjacent strings can then be used to form a display area curtain giving a 360° viewing angle. Each MiS- PHERE is effectively a single pixel in the curtain on which the video content is shown. The MiSPHERE was developed by Barco for the ‘Vertigo’ tour of the band U2. Black LEDs The company Gahrens & Battermann were early users of HD reso- lution displays. They began in 2006 with 6 mm pixel designs and then later 3 mm pixels. Their managing director Andreas Pater explained that one of their recent successes has been the instal- lation a 40x1 2 m display at a racecourse. It has four times better resolution than a standard HD display. Nowadays a basic big screen video wall at the back of a stage is not enough, customers are now using transparent LED display curtains in front of the performers which can be rolled back when a band begin their set. In partnership with Mitsubishi, Gahrens & Battermann and Lang AG are offering ‘black LED’ displays. Normal LEDs are encapsulated in a clear plastic but black LEDS use a dark plastic. According to Mr Pater “The effect is to make black really black and not grey; it gives a noticeable increase in screen contrast”. In a completely dark environment the ‘ILite 6 BK’ black LED display from Barco achieves a contrast ratio of 3000:1 . As you would expect the trade-off here is a reduction in peak display luminance and with present-day technology it is difficult to achieve much beyond 2000 cd/m 2 without running into thermal problems. Colour processing is performed with 1 4-bit resolution. The Mitsubishi ‘Diamond Vision’ series uses a more detailed pixel shader design to avoid the colour shift that can occur with some other displays when the vertical viewing angle is changed. The black shader arrangement of the ‘black package’ models again gives enhanced contrast. Installed in 2004 midway between West 44 th and 45 th Street is the ‘MTV 441/2’, a Mitsubishi display which is currently the largest HD screen in Times Square. It shows music videos, News, Internet content and special events to the passers- by in New York. (070909-I) Figure 8. Courtesy XL Video, Euro2008 games were relayed to the masses at Berlin’s Brandenburg Gate. (Picture: XL Video). elektor 7/8-2011 95 COMMUNICATIONS 100 Mbit/s over Copper Wire How VDSI_2 works By Stefan Tauschek (Germany) In the battle for the ‘last mile’, twisted-pair copper wire appeared to be yielding the field to newer technologies such as glass fibre and Wi Max. A few years ago, the situation changed with the release of the VDSL2 standard, which enabled data rates of 100 Mbit/s or more over short distances. There emerged ‘triple play’ solutions using the tried and true telephone lines: simultaneous telephony, fast web surfing, and multi- channel audio/video streaming. Here we look at the technology ands some of the history of VDSL2. The essential reason for VDSL2 (VDSL stands for ‘very high bit rate digital subscriber line’) is that it offers the prospect of providing profitable services, such as Internet television (IPTV), over a wide- bandwidth ‘last mile’. It’s even better if this can be done using the existing infrastructure of cables that has been installed over the course of many decades. VDSL2 promises a maximum data rate of more than 100 Mbit/s (downstream). With modern compression methods such as H.264 (MPEG4 AVC), this is enough for the simul- taneous transmission of several television channels. In addition, it supports fast web surfing and, of course, multiple telephone conver- sations in parallel. If you need even higher data rates, you can utilise ‘bonding’ to combine several VDSL2 connections into a single logi- cal channel with a corresponding increase in capacity. The standard The first efforts to develop a standardised VDSL protocol began as early as 1995 under the direction of British Telecom. However, no agreement on the modulation method could be achieved at that time. In 2003, a consortium of semiconductor manufacturers lent their support to the discrete multi-tone (DMT) method (see below) and thus cleared they way for ratification of VDSL(i) by the Interna- tional Telecommunication Union (ITU) in the form of the G. 993.1 standard. Development of the VDSL2 standard (G.993.2) [1] was initiated by the ITU in 2004. The participants also included the American National Standards Institute (ANSI) and the European Tel- ecommunication Standardization Institute (ENSI). Definitive agree- ment on VDSL2 was obtained in May 2006. The DMT modulation scheme is the same as for ADSL and ADSL2+, which enables spec- trum compatibility. The line In technical terms, the subscriber line is an unshielded twisted-pair cable with AWG 24 conductors (‘AWG’ stands for American Wire Gauge, and an AWG 24 conductor has a diameter of approximately 0.5 mm). This cable is similar to UTP Cat-i cable, which means it does not have guaranteed impedance characteristics. For compari- son, the minimum cable requirement for Fast Ethernet transmission (100 Mbit/s) is UTP Cat-5, and for Gigabit Ethernet it is Cat 7 (with a maximum segment length of 100 metres). The original requirement for telephone lines was a transmission bandwidth of slightly less than 4 kHz. With the introduction of ISDN in the early 1990s (with a data rate of 128 kbit/s), it appeared that the last ounce of bandwidth had been wrung out of the medium. The attenuation curve also gave little hope of higher transmission rates, since a signal attenuation of at least 30 dB can be expected at frequencies above 10 MHz at a distance of 500 m. Twisted-pair cable is also a rather difficult medium. Any transmis- sion technology that is used must be able to cope with a variety of impedance and attenuation characteristics that depend on the length and nature of the installed line. One approach, which had already been attempted with success for ADSL, is to divide the overall frequency band into a large number of sections. In each of these sections, a portion of the data stream is transmitted as a QAM signal [2]. 4096 modems... You can picture this as a bank of individual modems operating at dif- ferent carrier frequencies, with the net result that the available spec- trum is utilised uniformly (see Figure 1 ). These frequency sections are called ‘tones’, which gives the method its name: discrete multi- tone modulation (DMT). With VDSL2, up to 4096 discrete tones can be used. The spacing of these subcarriers depends on the profile that is used and is typically 4.3125 kHz. Profile 30a is an exception; it has a spacing of 8.625 kHz. DMT is essentially a form of orthogonal frequency-division multi- plexing (OFDM) [3] [4], but with the decisive difference that each tone is individually adapted to the line characteristics. As a result, the tones can have different ‘bit loading’ values (information-bear- ing capacity). Under the most favourable transmission conditions, 15 bits can be modulated onto a single subcarrier, with succes- sively fewer bits under increasingly unfavourable conditions — all the way down to a i-bit constellation. The modems independently determine the line quality by conducting test sequences during initialisation. OFDM methods have been used successfully for many years in wire- less data transmission protocols such as WLAN (802.11), digital tel- evision transmission (DVB-T), and WiMAX (802.16). This technology has also been implemented in silicon in many different forms, with correspondingly mature expertise among the manufacturers of rel- evant key components. 96 7/8-2011 elektor COMMUNICATIONS one very high speed many lower speed data stream data sub-streams one very high speed many lower speed data stream data sub-streams FEC Decoder Bit Insertion Freq. Domain Equalizer (FEQ) D Cyclic Time Digital A Analog T ◄- Extension ◄- Front 4 - D Front 4^ F Removal End C End (TEQ) 070639-13 Figure 1 : The basic principle of DMT modulation: dividing the spectrum between numerous subcarriers (source: [ 14 ]). Figure 2 : High-level block diagram of a VDSL modem (source: [ 14 ]). ...in a single 1C Although the advantages of DMT appear impressive, they are of lit- tle practical significance if they cannot be implemented in suitable components at reasonable expense. The straightforward approach of providing a modulatable PLL for each subcarrier and summing their outputs is impractical due to the large number of ‘integrated modems’ that would be necessary. However, numerical mathemat- ics offers a solution to this problem in the form of rules for trans- formations between the time and frequency domains, such as the discrete Fourier transform (DFT) and its opposite, the inverse DFT (IDFT). In the frequency domain, the individual subcarriers can be calculated quite conveniently as complex quantities with specific magnitude and phase, after which they can be converted to the time domain by applying an IDFT. Suitable algorithms for use in DSPs are available, and the only challenge to the manufacturers is to provide devices with sufficient performance. Figure 2 shows the block diagram of a DMT modem in the trans- mit and receive directions. At the transmit end, the data (in the form of a serial data stream) is first passed through a high-perfor- mance error correction stage that add error correction codes to the data (such as Reed-Solomon ECCs [5]), after which it is converted by a serial-to-parallel converter into a number of substreams cor- responding to the necessary number of tones. Each of these sub- streams is modulated using QAM, with the constellation number of each QAM modulator determined by the bit loading. In this way the substreams generate subcarriers in the frequency domain, and finally (after the IDFT) subcarriers in the time domain. However, the signals are still in the digital domain at this point, so they must pass through a D/A converter and a filter. After this, the signals can be fed into the telephone line. As an option, a ‘cyclic extension’ function can be used to add supple- mentary redundant samples at the start and end of the digital DMT symbols in the time domain, in order to reduce the transmission error rate. This reflects the unfortunate fact that channel dispersion in the transmission path causes ‘time smearing’ of the signals, which can lead to problems with a rapidly changing sequence of symbols. Spectral cooperation Thanks to DSP technology, it is possible to specify any desired num- ber and arrangement of subcarriers for DMT. Each subcarrier can have a different payload data burden, and the signal level (and thus the transmit power) of each subcarrier can be set independently. This enables DMT to cope with a wide range of line conditions and EMC regulations. For example, it is possible (and in fact required) to block out the ham radio (amateur radio) bands (Figure 3). This benefits both parties, since neither web surfers nor radio amateurs want to make life miserable for the other party (although it should be noted that the maximum transmit power with VDSL2 is fairly low: 20 dBm, which is equivalent to 100 mW). The VDSL equipment at both ends of the line (terminal equipment and distribution equipment) must be able to adjust the transmit power of each tone in order to adapt to line-specific changes in sig- nal levels. As the essential quantity used in this connection is the power spectral density in dBm/Hz, this process is also called ‘PSD shaping’, which means shaping the envelope of the power curve over the frequency band. PSD shaping is a basic tool of statistical spectrum management, which is used to ensure the lowest possible level of interference between the large number of subscriber lines in a telephone distribution cable. Along with the dismal attenuation curve of twisted-pair telephone lines, this crosstalk in the cable path is one of the main challenges facing any attempt to achieve high data transmission rates. Signal coupling between two adjacent lines in a cable is currently one of the most significant limitations to the performance of DSL. Static spectrum management using defined spectral-power masks ensures that the individual lines do not interfere with each other even under the worst imaginable conditions. A consequence of this rather conservative approach is that it elevates the worst case to the status of the reference standard, which prevents exploitation of the full potential of the technology. It’s thus a natural idea to continually adapt the spectral masks of the individual lines to the current traffic volume, which is called ‘dynamic spectral management’ (DSM) [6][7]. The potential gains that can be achieved with clever algorithms are fairly considerable. It is estimated that the net data transmission rate of a multi-line cable can be doubled or even tripled [8]. New features The VDSL2 standard also brings a number of attractive new features. For example, the capacity can be increased by combining several elektor 7/8-2011 97 COMMUNICATIONS PSD [dBm/Hz] POTS, ADSL HDSL / ADSL ISDN upstream SDSL downstream VDSL Boost 0 < 0.12 0.2 1.1 20 30 1, practical VDSL frequency range r 070639-14 Figure 3 : Frequency band used by various standards and blocked regions of the frequency band to avoid interference to amateur radio (source: [ 15 ]). DSL lines to form a single logical transmission channel, which is called ‘channel bonding’. Quality of service (QoS) [g] is supported at the protocol level, which is especially helpful for video transmis- sion and VoIP applications. Thanks to techniques such as echo cancellation and time-domain equalisation, the long-range version of VDSL2 can transport data at rates up to 4 Mbit/s over a line length of 5 km. The data rate increases gradually as the distance is reduced, without any need for further adjustment (see Figure 4). Due to the use of DMT modulation and a functional scope similar to that of ADSL, VDSL2 has all the technical characteristics necessary to make it backward compatible with existing ADSL systems. This means that infrastructure providers can convert their customers incrementally without writing off the value of existing investments. Chipsets and equipment Currently at least four semiconductor manufacturers have launched VDSL2 1 C implementations: Broadcom [10] with the BCM6306 and BCM6369 1 C duo, Conexant [11] with the Accelity CPE family, Infineon [12] with its Vinax PEB83000 chipset, and Ikanos [13] with its Fusiv/Vxi8o components. Texas Instruments also had a suita- ble product with its UR8 platform, but this technology was sold to Infineon in June 2007. However, Tl still offers analogue front ends for VDSL2 applications, such as the THS6204 line driver. The situa- tion with Centillium is similar — its Palladia VDSL2 chip family was sold to Ikanos in July 2008. Internet Links [1] www.itu.int/rec/T-REC-G.993. 2 [2] http://en.wikipedia.org/wiki/QAM [3] http://en.wikipedia.org/wiki/Discrete_multitone_modulation [4] http://en.wikipedia.org/wiki/OFDM [5] http://en.wikipedia.org/wiki/ Reed%E2%80%93Solomon_error_correction [6] www-isl.stanford.edu/~cioffi/dsm [7] wwwl .alcatel-lucent.com/com/en/appcontent/apl/T0605_ DSM_ed02-EN_tcm172-282671635.pdf Figure 4 : Maximum transmission rate versus transmission distance. A rate of more than 1 00 Mbit/s can be achieved at distances less than 500 metres. Users in Germany are most likely to encounter the Infineon compo- nents, since they are used in T-Home’s Speedport units and AVM’s VDSL2 FritzIBox products. In fact, the Speedport W920V (Figure 5) is amazingly similar to the FritzIBox 7570. Information on how to ‘fritz’ a Speedport, which means downloading the FritzIBox firm- ware to a Speedport, can be found on various forums that address this area. In Germany, Deutsche Telekom offers an extensive range of suitable hardware components and triple-play packages under the brand name ‘T-Home Entertain’. The market response after the launch in late 2006 was initially disappointing, with only 120,000 customers signed up by 2007. However, the demand picked up nicely after this. The customer volume rose to 500,000 during 2008, and was seen to double to 1 million in the following years. There is no doubt that VDSL2 represents a breakthrough in copper- based data transmission, and potential providers with other infra- structures, such as wideband cable, satellite links and so on, will find it difficult to establish their products on the market. However, glass fibre will not become redundant, because it the medium that transports the data to the grey distribution boxes along the roadside and in the cellars of large blocks of flats. This is where VDSL shows its colours and pushes the bits down the tel- ephone lines. (070639-I) [8] http://funkschau.biz/heftarchiv/pdf/2005/fs1 5 / f s_0 5 1 5_s51 .pdf [9] http://en.wikipedia.org/wiki/Quality_of_Service [10] www.broadcom.com/products/DSL/xDSL-CPE-Solutions [1 1 ] www.conexant.com/products/entry.jsp?id=376 [12] www.ikanos.com [13] www.infineon.com/cms/en/product/channel.html7channehdb3 a30431 2c4633901 1 2d7c2aa2a001 a [14] http://ikanos.welcomm.com/lib/assets/pdfs/solutions/dmt_be- nefits_oct02.pdf [1 5] http://xdsl.teleconnect.de/xDSL_germ/PDF/dslReview2005_31 .pdf 98 7/8-2011 elektor Subscribe now to the leading US-based computer applications magazine specializing in embedded systems and design! f\n N\Cti & Conlvo( DELSilQhl'. C-bxIh iU ",iiJt Mtim JflM LUCAIVDF4 Biax.i fAGt- :* (jUjQWS^liCTi Tii*i GMi M * 1 i,.i 3CAT '£** UH*M Wrtn PUTtf . M yyCH.TlO^ trirn “ Build a Custom RF® Checkout System Hardware Deve\opreer\t with a USB MR & CPUJ Bectron'cs System Sa5 ' Therwa' fcaatysjsT'Ps Select your personal subscription at www.elektor.com/cc-subs ,r^* 12 editions per year for just Digital: $38 Print: $63 Digital + Print: $90 CIRCUIT CELLAR THE MAGAZDH FOR COMPUTER APPLICATIONS DEVELOPMENT SYSTEMS Rabbit RCM5600W Development Kit for Wi-Fi _BAEB1X5( SETTING STAR TED MiniCore RCM5600W By Clemens Valens (Elektor France) Lots of manufacturers make microcontrollers. Some of them have developed their own microcontrollers, others have based themselves on someone else’s design. That’s how we come to find, for example, thousands of variants on the theme of the MCS-51 from Intel. For its part, Rabbit (for a few years now, a sub-brand of Digi Interna- tional) has been marketing since 1 999 several families of pC based on another great 8-bit classic: the Z80. The Z80’s core has been brought up to date, new instructions added, others, deemed not very useful, simply removed, and the clock frequency increased. However, the root data (sometimes also called page zero memory) has been kept — an area of memory that can be accessed faster thanks to a short-addressing mode. And since we’re talking microcontrollers, they also include peripherals and memory. The latest addition to the family, and the highest-perform- ing, is the Rabbit 6000, clocked at 200 MHz and with 1 Mbit of RAM and a wireless Wi-Fi function! What makes Rabbit microcontrollers different from others is their communication facilities. All the models have six serial ports, apart from the elderly 2000 which only has four. The 5000, the one fitted to my test platform, also includes a MAC (Media Access Control), Ethernet, and a wireless system compatible with the 802.1 1 b & g standards (i.e. Wi-Fi). From the outset, Rabbit realized that the best way to sell its pro- cessors was to make life as easy as possible for potential custom- ers. So the microcontrollers were fitted into small matchbox-sized modules, the RabbitCores, with a certain amount of Flash memory and, a brilliant idea, fitted with an Ethernet port, including the RJ45 socket. The manufacturer was thus one of the first to market a sim- ple, cheap solution for adding a network connection to an embed- ded application. What’s more, the modules are easy to program in situ via an ordinary serial port. A processor without software isn’t much use, so the manufacturer has developed all the tools needed to program its microcontrollers and modules conveniently in C. The Dynamic C development envi- ronment (IDE) is free and comes with an impressive collection of libraries, including TCP/IP, with the source code. The Dynamic C language is a dialect of C, extended with multi-tasking functions, among others. The IDE includes a debugger and a programmer — in short, everything has been done to make the developer’s life as easy as possible. In the past, I had enjoyed working with modules using Rabbit 2000 and 3000 processors. So when I learned, at least two and a half years ago, about the existence of a new module with built-in Wi-Fi, I was obviously interested. Unfortunately, I had to wait until late 2010 to at last get hold of an evaluation kit. Two and a half years is a long time to wait! Long enough even sometimes to see the prod- uct become obsolete. But not in this case — microcontrollers with built-in Wi-Fi are still not something you come across every day. Perhaps to make up for my long wait, Rabbit sent me the RCM5600W Deluxe development kit. In this kit, we find among otherthings an RCM5600W MiniCore module with 2.4 GHz antenna, a motherboard, three expansion boards, a CD-ROM with Dynamic C 1 0.64, and a quick start guide. There is also an RCM5650W MiniCore module that’s slightly dearer, but has 4 MB of Flash memory instead of 1 MB. Why didn’t they put this one in the Deluxe kit? The MiniCore modules are fitted with a PCI Express connector, something you don’t find everyday, so a motherboard is jolly help- ful. Rabbit also offer similar RabbitCore modules (RCM5400W and RCM4550W) with more, let’s say, ‘conventional’ connec- tors (2 x 25 pins on a 1 .27 mm [0.05”] pitch). The motherboard, to which the antenna can be fitted, also carries the PSU and a USB serial port (FTDI). This board also carries a 2 x 25 pin connector (on a 2.54 mm [0.1 ”] pitch this time) that lets us stack daughter boards a la PC/1 04, each daughter board allowing you to add another, just 100 7/8-2011 elektor DEVELOPMENT SYSTEMS The Dynamic C IDE after running the wif iscan . c sample program. like in Lego®. The expansion boards in the kit are only part-wired. Only two ports are fitted to the RS -232 board, there’s enough space left for two more plus an RS -485 port. The same goes for the digital in/out board, on which you can still add four push-buttons and a number of jumpers. The prototyping board offers holes and pads for SMD components on both sides. All the boards have a power indicator. The quick start guide explains how to insert the MiniCore into the PCI Express connector on the motherboard, and how to fit the antenna to it. It also explains how to go about installing the driv- ers for the USB serial port, in case they aren’t already installed; but the guide doesn’t explain how to install the IDE. Fortunately, installing Dynamic C is fairly simple — the hardest thing is open- ing the CD-ROM case. During installation, the message “Serial/ USB ports not found.” may appear. This doesn’t matter, you can choose which serial port to use for loading software into the mod- ule later, in the IDE. With the drivers installed and the MiniCore connected to the com- puter via the motherboard, run Dynamic C. The window may display a not-very-understandable message, but this too can be ignored What’s in the kit? • MiniCore RCM5600W module • Motherboard with PSU and USB port • Prototyping expansion board • RS-232 expansion board * • Digital In/Out expansion board * • Antenna + cable + mount • USB cable • RS-232 cable (DBg to HE10) * • 5 V mains adaptor * • jumpers and spacers • CD-ROM with Dynamic C 10.64 • Documentation • Quick reference poster * • Deluxe kit only Price of kit shown (Deluxe): $249 Price of standard kit: $149 Price of RCM5600W module: $69 each (RCM5650W: $75) More details: www.rabbit.com — just click “Yes”. Before trying out a sample program, you need to configure the Dynamic C a bit, in particular, the serial port to be used. The quick start guide explains all this in detail. This guide also suggests loading the sample wif iscan . c which is in the samples\wif i directory. This sample lets you look for Wi-Fi networks that the module can ‘see’. When you press the F 9 key or click the button with the little green triangle, the sample is compiled and loaded into the module’s RAM, then run. During com- pilation I got a warning about the definition of ifc wifi ssid, but that doesn’t seem to affect proper running of the programme, which ends normally. If everything has gone OK, a window stdio opens in which are displayed the results of the Wi-Fi network search. In my case, the results were unreadable — all I could see were little black squares and rectangles. The solution can be found in the Options - > Environment Options -> Debug Windows menu, where you need to change the font. When I selected ‘Courier New’, I was able to read the search results: it had worked, the MiniCore had detected my Wi-Fi network! (100806) Advertisement Muuuuch Cheape w No-frills policy 16,94 EURO 5 pcbs, 1 00 mm x 1 00 mm *per piece, incl. UHT (2 1 %) + shipping costs e. g. Germany 1 0,71 EURO * JacYaltac LULUiu.jackaltac.com elektor 7/8-2011 101 INFOTAINMENT There’s more than sand in The Valley a history of Silicon Valley, without most of the silicon By Vincent Himpe (USA) The San Francisco bay area and its surrounds have always been a hotbed of innovation and technology. Even before the “valley of heart’s delight” became known in the 70’s as ‘Silicon Valley’ a number of new technologies were pioneered here. Some of these remarkable events go as far back as the turn of the 20th century. In this article we’ll take you on a trip through history and highlight some inter- esting developments, many of which still have remnants today, in and around Sili- con Valley. Some of these go far beyond mere ‘sand’. That is, the sand of which sili- con is made. 1853 Levi Strauss arrives in San Francisco and sets up a wholesale dry goods business. In 1870 Jacob Davis starts making pants using materials bought from Levi Strauss stores. On May 20 1873 Strauss and Davis receive US patent # 139121 on the usage of copper rivets to strengthen the pockets of denim pants. They incorporate as Levi Strauss & Co and begin marketing the first ‘waist overalls’ or blue jeans. Lot #501 became the most pop- ular jeans and is still manufactured today. 1876 At the request of James Lick construction is begun of an observatory at the top of Mount Hamilton in San Jose. First light was seen through the then largest telescope in the world, on January 1888. The station is still in operation today and is the world’s oldest permanent observatory. Several moons of Jupiter were discovered with this telescope as well as multiple extra-solar planets. www.ucolick.org 1885 Stanford University, named after its founder former California governor Leland Stanford, is founded in Palo Alto. It would become one of the world’s leading universities and generate more successful graduates than any other university. The university started a technology grant that would be a highly successful incubator hatching the techno- logical avalanche that would turn the Palo Alto to San Jose Valley into the technology hotbed it is today. Under impulse of Pro- fessor Frederic Terman, the Dean of Engi- neering the Stanford Research Park was launched in 1935. The idea was to stimu- late local economical growth by keeping the graduates close by. SRP would thus become essentially the first venture capi- talist company, www. stanford.edu 1906 Lee deForest (1873-1961) further develops the basic electron-valve made by Ambrose Fleming by adding a grid to it. This grid effectively con- trols the flow of electrons through the valve. A signal applied to this grid effectively allows the current through the valve to be controlled, thus creating the first amplifier element. Lee deFor- est called his invention the Audion. It would later be known under its more common name: theTriode. www.leedeforst.org. 1909 Pioneer Electronics Research Lab is estab- lished at the corner of Channing Avenue and Emerson Street in Palo Alto. Here Lee Defor- est would go on and develop the first practical application of his Audion as an amplifier and oscillator. 910 Emerson Street, Palo Alto. Cyril Ewell starts the Federal Telegraph Com- pany after having acquired the rights to the Poulsen Arc Transmitter from Valdemar Poulsen. The first wireless telegraph station was built on 48 th Avenue between Noriega and Ortega Street in San Francisco. In 1912 a second ground station was built at Point San Bruno, just south of San Francisco. At its con- struction it had the world’s largest antenna towers, rising up to 440 feet. The antenna itself contained 35,000 feet of wire. Charles D. Herrold creates the world’s first radio broadcast station, KQW (later KCBS), in the Garden City Bank building in down- town San Jose (today’s capital of Silicon Val- ley). To date a broadcast studio is in opera- tion in the building at the southwest corner of First and San Fernando, www.kcbs.com 1927 Philo Taylor Farnsworth invented and pat- ented the first all-electronic television sys- 102 7/8-2011 elektor tern. Farnsworth had his ‘lab’ in a cellar on 202 Green Street, San Francisco. In Septem- ber of that year he successfully transmitted the first all-electronic television image. 1935 William Hewlett and David Packard gradu- ate from Stanford University and decided to start their own test equipment company. Spurred on by a grant from Frederic Ter- man, professor at Stanford University, they set up shop in one of their parents’ garage in Palo Alto. The first successful product was an audio oscillator that was used by Disney Studios to produce audio for the movie Fantasia. HP quickly went on to develop a wide range of test equipments. The emerging micro- computer industry proved a new stomping ground for the corporation, which quickly developed scientific computers to control test equipment and crunch numbers. After the acquisition of Apollo and Compaq in 1999 the company decided to focus on com- puter and peripheral systems and spin off its test and measurement and semiconductor division as Agilent Technologies. The origi- nal garage and house at 367 Addison Ave, Palo Alto is a state protected monument. It was bought by the Hewlett-Packard Corpora- tion and restored to its former look in 2005. 1939 The Ames Research Center was founded as a laboratory for aeronautics applications in Sunnyvale. Initially under the control of National Advisory Committee of Aviation (NACA) it moved to the National Aeronaut- ics and space Administration (NASA) in 1958. Amongst the most notable projects run from this site are the Pioneer space- craft, of which Pioneer 10 an 11 are the first manmade objects to leave our solar system, The Pioneer craft that landed on Venus, the Lunar Prospector, the Kepler observatory and SOFIA, a modified Boeing 747 carrying a telescope. NASA Ames was instrumen- tal in the flight software for Space Shut- tle, the International Space Station and the software that controls the two Mars rovers Spirit and Opportunity. It also hosts some of the most powerful computers currently in existence such as the Columbia supercom- puter and the Pleiades system. Moffet Blvd., Mountain View. 1944 Alexander M. Poniatoff starts AMPEX in Redwood City. Initially a manufacturer of small electric motors and generators, they ventured off in the audio, and later video, recording and playback technology. AMPEX became the de-facto standard for studio and broadcast registration and playback equip- ment. 500 Broadway Street. Redwood City. 1948 The brothers Varian (Russell and Sigurd) , and associates start Varian Associates in San Carlos, just south of San Francisco, to develop and sell the Klystron tube and other high frequency components. They would move to Palo Alto in the early 50’s to occupy a building in the then new Stanford Industrial Park. Originally focusing on the klystron and its applications like radar and TV transmission tubes, Varian Associates would also enter other fields such as parti- cle accelerators for medical purposes, radia- tion equipment and x-ray equipment. When the semiconductor boom began, Varian was heavily involved in the development of the first ion-implantation equipment that today is crucial for semiconductor manufacturing. 1952 IBM opens a laboratory at 99 Notre Dame Avenue in San Jose. The fundamental research done in this lab culminated in the development of the hard disk drive. 1954 The Berkeley National Lab begins operat- ing the Bevatron Particle accelerator, then the largest particle accelerator in the world. This synchrotron allowed elementary parti- cles to be accelerated to very high speeds, and then smash them into each other, elektor 7/8-2011 103 allowing the study of the fundamental building blocks. Many a discovery was done here, amongst which the anti-proton, and the research done with this machine yielded four Nobel prizes. The machine was decom- missioned in the 1990’s and is currently being dismantled. William Shockley, co-inventor of the transis- tor, sets up shop as Shockley semiconduc- tor Laboratory in a former produce store building at 391 San Antonio Road, Moun- tain view. The building still exists today and is once again a vegetable store. 1955 1956 IBM sets up a brand new plant at 5600 Cot- tle Road in San Jose and starts mass produc- ing the first commercial hard disk drive. 1957 FIRST COMMERCIALLY PRACTICABLE INTEGRATED CIRCUIT *■ ■ mi e - in [ii bk hop.i p r »iOFCt n< rK.ncwLb ••UK 1 , 1 ? : :R CBUhafiAl >iH 5 r ik fL&H* IB Dn- :iiT HUM CO JI n tf t. ' • ' ■ -! .■ •. I '■ ' i ' ' ' ’• ! ■' ‘ '■ Fair ■ i r*«c- •'• i.t,i r. « : iwt'i (w a • mfueii electronic tiRcu > iNyci * ina*. l IILIC-Qrj till® II ■ INNGVAI ’IJ HLLP IP I ■ ‘.□LUUCi'H-JE ■'lil-ICQ* I t Vi ‘ *.LmiCO J - 1 cqh i- u i : r h s* :: im- BlJSt&Y. ATILI ft.RG'JHih-l FFOF ■f PI -='l I rVFPTVUIlPHL qywi: mANGE TCJtHE (.iVti Prc-’-Tini mil lRCLUt n* T HL VT II 1 _ i liiplfi ft >iii- l|Cl ICWv JiL I ■' H*>ruiNr I I. JlTi- IN IF ' r CM Eight of Shockley’s associates break away after Shockley decided to give up on silicon and pursue only germanium. The rebels Robert Noyce and Gordon Moore start up Fairchild Semiconductor in Mountain View and alter set up offices in Palo Alto. Even though the integrated circuit was invented by Jack Kilby at Texas instruments, it was Gordon Moore from Fairchild semiconduc- tors in the building at 844 Charleston Road that made the first mass producible inte- grated circuit. The device would be the basis of the flight computer for the Apollo missions and ulti- mate moon landing. 1958 The Cold War era prompts the US Air force to set up an early warning radar system on top of mount Umunhum on the southern edge of Los Gatos. Its powerful radar could oversee all of northern California’s airspace. It was decommissioned in 1984 and demol- ished. The only visible remnants is the radar antenna pedestal on top of the 3486 feet tall mountain that’s clearly visible from ground level in San Jose and Campbell. 1962 Stanford University decides to develop and build a linear particle accelerator for funda- mental physics research. The Stanford Lin- ear Accelerator Center, commonly referred to as SLAC, houses an immense machine that is buried about 10 meters underground and runs over a total length of roughly 2 miles through the Californian country. It is so long, a tunnel had to be built to allow it to pass underneath highway 280. Its structure can be seen from various points in the valley. This remarkable machine has yielded some very impressive results. Not the least of which are four Nobel prizes. It was instru- mental in the development of many a technology required for these machines. Amongst these spin-off technologies is the Klystron, in essence a high power micro- wave amplifier tube. As an aside: The computer center associated with SLAC hosted the first www server out- side of Europe. While working at Stanford research Insti- tute, Douglas Engelbart and Bill English apply for a patent on a wooden box with two metal wheels and described as an ‘x-y position indicator for a display system’. 104 7/8-2011 elektor This device would revolutionize computer input and later be known to the world as the ‘mouse’. Douglas had a lot of other ideas like hypertext, networked computers and graphical user interface. His fundamental work would culminate in the NLS or on-line system. 1968 Robert Noyce and Gordon Moore leave Fairchild to set up their own company: Integrated Electronics or Intel for short, in Santa Clara. This is where the first true boom of the semiconductor technology happens. After the first single chip proces- sor Intel went on the develop many com- puter related technologies such as DRAM, bubble memory, EPROM , EEPPROM, flash and many more. It would grow to be the almost unbeatable no. 1 in semiconductor manufacturing. During the Fall Joint Computer Conference at the convention center in San Francisco a demonstration is given of the NLS system including the use of a computer mouse, live video broadcast and hyperlinked docu- ments. This would essentially become the world’s first ‘netmeeting’ in which two peo- ple could see and talk to each other and share information using a computer ter- minal with a graphical user interface under control of a mouse. Nobody had even imag- ined such a system let alone envisioned how to build one. At the end of the 90 minute demo the audience gave Douglas Engelbart and his team a standing ovation. This was truly a marvel of modern engineering and would open limitless possibilities in collabo- rative work. This event was truly the mother of all computer demos. 1969 The world’s first electronic computer net- work ARPANET goes live with the estab- lishment of a link between the Stanford Research institute, UCLA, UC Santa Barbara and the University of Utah. They use Doug- las Englebart’s NLS system, an early form of hypertext. The first email was sent on this system in 1971, and by 1973 the first file transfer took place using FTP. 1970 Xerox Corporation opens a new research center in Palo Alto: The Xerox PARC (Palo- Alto Research Centre). Many notable inven- tions and developments can be traced down to this site. Amongst the most notable are the laser printer, the computer mouse, the first Wysiwyg user interface, bitmap graph- ics, the Alto Computer, Ethernet, LCD dis- plays, optical disc technology and the Small- talk language. 3333 Coyote Hill Rd. Palo Alto 1971 Nolan Bushnell and Ted Dabney found an engineering firm at 2962 Scott Blvd in Santa Clara that would get world renowned status as ATARI. 1972 Although not inside the Bay area, but really close, Gary Kildall begins experimenting in Monterey with early Intel microprocessors and writes the first optimizing high level programming language for microproces- sors: PL/M (programming Language for Microprocessors). Using this PL/M language Gary goes on to develop the CP/M disk operating system. He founded the Digital Research Company and started producing and marketing what would become the first popular operating system for microcom- puters. Later on Gary would also develop, amongst others, the Logo computer lan- guage the GEM graphic desktop system and the file system for CD-ROM. 1973 The Xerox Palo Alto Research Centre (PARC) develops and patents Ethernet: a multipoint data communication system. This would go on and become the backbone of many com- puter networks worldwide. 1975 Start of the ‘Homebrew Computer Club’. This hobbyists club was founded by enthu- siastic members that wanted to experiment with a budding new technology called the microprocessor. Notable members include Adam Osbourne who would start Osbourne Computers, and Steve Jobs and Steve Wozniak wha later founded Apple Com- puter. The main focus of the group was to help each other build computer systems so they could experiment with this new tech- nology at home. IMSAI incorporates in the city of Fremont and starts producing the first do-it-your- self kit for a computer system. Essentially a cloned and heavily improved MITS Altair, this machine had the capability to drive a video display and run the CP/M operat- ing system. One of these IMSAI machines was immortalized as the computer used by Mathew Broderick in the 1983 movie Wargames. In a nod to Silicon Valley, the video game company in the movie was purportedly located at a fictional address in Sunnyvale. DARPA, the government’s founder of Arpanet, Xerox PARC and Stanford Univer- sity come up with a new set of protocols for data transfer over networks: TCP/IP. This is today still the ‘glue’ that holds the Internet together. elektor 7/8-2011 105 1976 The first national computer retail store ‘ComputerLand’ opens its doors in Hay- ward. Sprouted from the mind of William H Mallard this was the first company that would offer full service to early computer adepts. It would soon have franchises all over the US. Steve Jobs and Steve Wozniak set up camp in Mountain View as Apple Computers to sell their build-it-yourself computer kit. After a rework of the Apple-i into the Apple II, Steve jobs sees the Xerox Alto graphi- cal user interface at work and decides that is the way forward. The Apple Lisa is the world’s first commercially available machine with a graphical interface. Fairly unsuccessful due to the hefty price tag the machine is re-engineered and becomes the Macintosh. The rest ... is history. 1979 Alan Shugart and Finis Conner set up Shu- gart Technology. Having both worked on hard disk drive technology. Alan Shugart having worked on the IBM RAMAC drive and the floppy disk, and Finis Conner having worked for Memorex on magnetic record- ing technology, the duo formed a formida- ble alliance. The company changed name the same year and sold the ST-506 drive under the name Seagate Technology. 1980 Quantum Corporation is founded in San Jose. As an early manufacturer of hard disk drives, tape drive and duplication equip- ment this company has made several major breakthroughs in data storage technology. 1981 Jim Clark and Abbey Silverstone found Silicon graphics in Sunnyvale. SGI capi- talized on technology developed at Stan- ford University to produce the world’s first high performance 3D workstations and operating systems. SGI went on to develop their own processor architecture (MIPS) that today lives on in many graph- ics intensive systems such as DVD, Blu- ray and navigation systems, and graph- ics rendering library (OpenGL). SGI later on also acquired the assets of Cray com- puters, Intergraph and notable software companies like Alias and Wavefront. SGI systems were instrumental in the making of the first computer generated animation movies and special effects. 1982 Another set of students from Stanford Uni- versity decide to start their own company. Andy Bechtolsheim is joined by Vinod Khosla and Scott McNealy to start SUN Microsystems, SUN itself standing for Stan- ford University Network. The company was almost immediately profitable and pro- duced a wide line of powerful workstations and servers for the high-tech industry. Ini- tially running on Motorola 68K processors and a port of the BSD operating system, they quickly developed their own processor architecture, dubbed SPARC, and operating system called Solaris. The development of the Java programming language catapulted Sun to become a household name. James McCoy, Jack Swartz and Raymond Niedzwiecki set up Maxtor in Milpitas to design and develop hard disk drives. The company was later acquired by Seagate. 1984 Len Boasck and Sandy Lerner found Cisco systems together with Richard Troiano. Their first product was a multiprotocol net- work router. Cisco would go on to become the largest networking hardware company in the world. It has multiple sites spread across San Jose, Santa Clara and Sunnyvale. 1985 The Fry brothers open the first computer and electronics megastore in Sunnyvale. Still in operation today these stores sell anything from resistors, IC’s, test equip- ment like oscilloscopes, computer parts to kitchen appliances and TV, video and audio equipment. 1992 Jeff Hawkins, Donna Dubinsky and Ed Colli- gan set up Palm Computing to launch a per- sonal digital assistant (PDA). They set up the company in Sunnyvale California. The com- pany today still designs and markets a line of smartphones. 1994 Jerry Yang and David Filo build Jerry and David’s Guide to the World Wide Web, 106 7/8-2011 elektor while graduate students in Electrical Engi- neering at Stanford University. A couple of months later they renamed the site to Yahoo. By the end of that year they had over a million page hits. 1995 Pierre Omidyar founds an on-line auction website then known as Auctionweb in Campbell. A year later they changed name to become eBay. The original building at the intersection of Hamilton and Bascom is still in use by eBay although its headquar- ters have now moved to North First Street in San Jose. 1996 Larry page and Sergei Brin develop a data sorting and indexing algorithm as stu- dents of computer science at Stanford University. In 1998 they would incorpo- rate Google that would go on to become the world’s no. 1 search engine. From its humble beginnings in a garage in Menlo Park they soon moved in to the now empty buildings of Silicon Graphics in Mountain View. The first Google server is on display in the Computer Museum. 1999 At the same time that Agilent technologies is spun out of Hewlett Packard the new cor- poration sets up a partnership with Philips Lighting to further develop the LED technol- ogy that the former semiconductor group from Hewlett-Packard developed. This cul- minated in the Luxeon series high power LED’s. Eventually the company spun off from Agilent and became Philips Lumileds Corporation. It is located off of First Street in San Jose. 2000 PayPal is founded as a merger between two leading online payment companies. The companies were located on Univer- sity Avenue in Palo Alto. In 2002 PayPal was acquired by eBay and moved to the big eBay campus at North First Street in San Jose. 2002 Nanosolar Corporation is incorporated in San Jose. The company has a unique tech- nology in the sense that it can screen print the solar panels, thus sidestepping the expensive silicon based panel technology. They use a special kind of ‘ink’ that contains copper indium gallium deselenide. This material achieves an average 15% effi- ciency and can be printed using an inkjet- like technology on a backing material. Its plant cranks out enough solar panels a year to produce 430 Megawatts. This plant tri- pled the annual solar cell productions of the entire US in one shot. A second factory is planned in Germany. 2004 Martin Eberhard, Marc Tarpenning and Ian Wright incorporate Tesla Motors, the world’s first manufacturer of high perfor- mance all-electric vehicles. A mass produc- tion plant is being constructed in San Jose. The main showroom of Tesla Motors resides in Palo Alto. 2005 Stanford University’s ‘Stanley’ would become the first fully robotized, driverless car, to finish a 136-mile dash across a desert obstacle course, snatching up the 2 million dollar from the DARPA research grant. Besides the locations mentioned here it is also worth stopping at the truly incred- ible Computer History Museum in Moun- tain View which besides fantastic ‘live’ and ‘interactive’ equipment restoration demos, has an early Elektor computer adjunct on display, and the Intel Museum in Santa Clara where you can look at a 4004, 8008 and experience the joys of wearing a clean room suit. Check out their websites for opening hours and locations. Admission is free! (090776-I) elektor 7/8-2011 107 INFOTAINMENT Hexamurai Came designer: Claude Chyselen (France) Brain teaser for the electronics minded Following our usual tradition, we’re offering you an outsize game in this double edition. This time you’re faced with a Flexadoku Samurai, or Flexamurai for short, a five-grid supersize conundrum that’s sure to exert your brain a bit more than a regular Flexadoku. Can you put the right numbers 0-9 and letters A-F in the right cells? Then send us your solution and enter the prize draw for one of four Elektor vouchers. Like Hexadoku, Hexamurai uses the figures of the hexadecimal system, namely 0 to F. The puzzle consists of four ordinary Hexa- doku grids. One 4x4 corner of a grid over- laps with a corner of the fifth Hexadoku in the centre. Unlike a normal Samurai game, the Hexamurai doesn’t let you solve each of the grids separately — you have to solve them all together, obeying the Hexadoku rules for each grid in turn. Fill in the grid in such a way that all the hexadecimal figures from 0 to F (0-9 and A-F) are used once and only once in each row of 1 6 cells, each column of 1 6 cells ad each square of 4x4 cells, within each square of 1 6 x 1 6 cells. Certain figures are already entered into the grid, defining the starting point for you. If you can solve this puzzle, there are some nice prizes to be won. All you have to do is send us the six numbers/letters in the grey boxes. The puzzle is also available as a free down- load from the Elektor website. Solve Flexamurai and win! Correct solutions received from the entire Elektor readership automatically enter a prize d raw for an Elektor Shop voucher worth £80 / €100 and three Elektor Electronics Shop Vouchers worth £40.00 / €50.00. We believe these prizes should encourage all our readers to participate! Prize winners The solution of the May 201 1 Hexadoku is: CD604 The Elektor £80 Shop voucher goes to: Vladimir Keyashko (Russia). The Elektor £40 Shop vouchers go to: R Fleischmann (USA); Peter van Dijk (Netherlands); Michael Reimann (Germany). Congratulations everybody! F 0 1 7 E B 2 C 6 D 9 4 8 A 3 5 3 C D 6 0 4 7 8 1 2 5 A F B 9 E 4 2 E 5 9 3 A D 7 8 B F 6 C 1 0 8 9 A B F 5 1 6 C E 3 0 4 7 D 2 0 3 5 C 1 6 B E 8 4 7 D 2 9 A F 6 4 9 F 7 8 5 0 E B A 2 3 D C 1 D 1 7 8 A 2 C 3 F 9 6 5 E 0 4 B A B 2 E D F 4 9 3 0 C 1 5 6 7 8 B 5 C 1 8 A D 2 9 3 F 7 0 E 6 4 7 8 4 2 3 C E 1 A 5 0 6 9 F B D 9 F 3 A B 0 6 4 D C 8 E 1 5 2 7 E 6 0 D 5 7 9 F 2 1 4 B A 3 8 C 5 D B 3 2 E F A 4 6 1 C 7 8 0 9 C 7 F 9 4 1 3 5 0 A D 8 B 2 E 6 1 E 6 0 C 9 8 B 5 7 2 3 D 4 F A 2 A 8 4 6 D 0 7 B F E 9 C 1 5 3 108 7/8-2011 elektor INFOTAINMENT Participate! Please send your solution (the numbers in the grey boxes) by email to hexadoku@elektor.com Subject: hexamurai 201 1 (please copy exactly). Include with your solution: full name and street address. Alternatively, by fax or post to: Elektor Hexadoku c/o Reg us Brentford 1 000, Great West Road Brentford TW8 9HH United Kingdom. Fax (+44) 208 261 4447 The closing date is: September 1 , 201 1 . 0 1 7 2 1 3 5 B 4 0 2 4 5 9 A 1 E 3 C 1 6 5 4 0 1 2 3 6 9 0 4 2 5 2 5 7 0 3 D 1 5 2 0 3 A B 0 3 7 6 4 8 1 9 E 4 2 0 6 3 7 4 F 5 0 9 7 2 8 E 1 4 6 0 C 3 6 7 0 5 3 2 1 A 1 4 6 3 7 A D 4 8 E 5 B 9 5 A 8 5 2 6 F 8 2 1 4 3 5 F 3 9 1 B E D 3 0 E 2 3 1 7 B 5 2 B 6 4 C 4 B 9 4 0 1 7 8 2 8 C 1 3 5 0 0 4 7 5 6 5 1 3 0 3 6 4 1 E A 6 7 3 9 1 2 8 4 9 6 A 3 2 4 5 0 4 5 1 7 3 1 5 6 5 8 9 1 8 5 0 3 9 0 2 5 8 0 4 2 6 3 E 7 5 3 2 7 C 4 0 6 5 3 4 0 7 2 9 A 1 7 1 6 3 4 B 0 0 2 elektor 7/8-2011 The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses. log ELEKTOR SHOWCASE To book your showcase space contact Elektor International Media Tel. 0031 (0) 46 4389444 ATOMIC PROGRAMMING LTD www.atomicprogramming.com • AP-114 ISP/JTAG Programming System • JTAG Programming and Testing • Boundary Scan Testing • Universal In-System Programming • EEPROM and SPI Flash Out-of-Circuit Programming • Generic GDB Proxy Server • Jennie JN5148 ZigBee Development Applications • Training Platform available AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BRITISH AMATEUR ELECTRONICS CLUB ARCHIVE http://baec.tripod.com/ The British Amateur Electronics Club Archive Website. Archives from 1 40+ Newsletters from 1966-2002. Currently have interesting and useful selected articles from 21 Newsletters. Also a section about built electronics projects with schematics and photos. Plus useful info., downloads and links. NO ADVERTS! TO BOOK YOUR SHOWCASE SPACE CONTACT ELEKTOR INTERNATIONAL MEDIA Tel. 0031 (0) 46 4389444 Fax 0031 (0) 46 43701 61 www. elektor. com CEDA www.ceda.in ceda@vsnl.com f ! [ ;i )/\ PADS I OrCA £ PCB layout ^ -learning i prim $5 Hourty • PCB Layout & library service @$5 Hourly • PCB Reverse Engg, MCU Code/ckt. Extraction service • Learn Signal Integrity with Hyperlynx, PCB Design with PADS & Allegro. Support by email & web meeting DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (A V, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0) 845 5192306 EASYSYNC LTD. www.easysync-ltd.com/ Supplier of communications and instrumentation products with specialist expertise in serial connectivity solutions based on USB, CAN and RS232/RS422/ RS485 interfaces. • USB to Serial RS232/RS422/RS485 converter cables. • CANbus solutions • Ethernet to Serial Adapters or to USB hubs. • USB based Logic Analysers, Oscilloscopes & Data Loggers. • OEM & ODM design services. ELNEC www.elnec.com Europe’s leading device programmers manufacturer: • reliable HW: 3 years warranty for most programmers • support over 58.000 devices • free SW updates • SW release: few times a week • excellent technical support: Algorithms On Request, On Demand SW • all products at stock / fast delivery EMBEDDED ADVENTURES www.embeddedadventures.com From news and tutorials to modules, components and kits, we have everything for your next microcontroller based project. Your embedded adventure starts here. .embedded adventures 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 ft t . '■ /. 'WflE v j f, + ' fku TTTF FUTURE TECHNOLOGY DEVICES INTERNATIONAL LTD. www.ftdichip.com FTDI specialise in USB silicon, hardware and software solutions. • USB WHQL complaint drivers. • USB host and slave solutions. • Free firmware development tools. & • USB IC’s, modules, cables and _ turnkey custom solutions. • World renowned FOC application support. USB MADE EASY SCOPES and more Instruments A Rohde &Schwarz Company Great Value in TEST & MEASUREMENT — = = = ™ 160 pages of tech audio articles Linear Audio SelUinkwitz.Cordell.Passa.o. your tech audio resource WWW»lin60tQU(llO»n6t 110 07/8-2011 elektor products and services directory ITtifnh/ satisf y your I I III 1 l W inner geek geek a fresh approach Cool portable electronic projects and kits www.mintygeek.com MaxSonar Ultrasonic Range Finder XL-MaxSonar-EZ * Beam pattern choice * High acoustic power * Real-time calibration * 39.35USD t unit MaxSonar-WRC IP67 * Compact packaging * Quality narrow beam ■9995USD/umt www .active-ro bot co. u k www.cootcomponents.co.uk www .ocean control s. co m au www.maxbotix.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 ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! Now, available in time for X-mas • Arduino Starter Kits *NEW!!* • Lego NXT Mindstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • POB Robots (kits and components) email: sales@robotiq.co.uk Tel: 020 8669 0769 STEORN SKDB LITE Join the SKDB Lite, the place to understand, discuss and experiment with magnetics. • Learn more about magnetics and electromagnetics • Participate in developer forums and discussion surrounding magnetics and related topics. For FREE access to SKDB Lite: https://kdb.steorn.com/ref25 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. WWW. elektor. com 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 0031(0)46 4370161 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION elektor 07/8-2011 111 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Going Strong A world of electronics from a single shop! LabWorX: Straight from the Lab to your Brain TMektor Mastering the l 2 C Bus LabWorX is a new collection of books, each handling a particular topic in the field of electronics. Each volume condenses all the information, applications and notes collected during hands on work with the covered technology, all into one book. Besides the basics of the technology, in depth examples and applications are given as well as troubleshooting tips on how to proceed if the initial implementation fails. Mastering the l 2 C Bus is the first book in the LabWorX collection. It takes you on an exploratory journey of the PC Bus and its applications. Besides the Bus proto- col plenty of attention is given to the practical applications and designing a solid system. The most common PC compatible chip classes are covered in detail. Two experimentation boards are available that allow for rapid prototype development. These are completed by a USB to PC probe and a software framework to control PC devices from your computer. All samples programs can be downloaded from the www.elektor.com/labworx support page. 248 pages • ISBN 978-0-905705-98-9 • £29.50 • US $47.60 Introduction to Control r I— u Engineering "\ Solutions for control system applications Introduction to Control Engineering This book is intended as a source of refer- ence for hardware and software associated with instrumentation and control engi- neering. Examples are presented from a range of industries and applications. Throughout the book, circuit diagrams and software listings are described, typical of many measurement and control appli- cations. The hardware and software de- signs maybe used as a basisfor application by the reader. The book contains examples of PIC, PLC, PACand PC programming. 164 pages • ISBN 978-0-905705-99-6 £27.50 • US $44.40 Visual Studio C# 201 0 Programming and PC interfacing This book is aimed at anyone who wants to learn about C# programming and interfac- ing to a PC. It covers programming concepts from the basics to object oriented program- ming, displaying graphs, threading and databases. The book is complete with many full program examples, self assessment exercises and links to supporting videos. All code examples used are available - free of charge - from a special support website. 306 pages • ISBN 978-0-905705-95-8 £29.50 • US $47.60 112 Prices and item descriptions subject to change. E. & O.E 07/08-2011 elektor Analogue Video Design your own EmEEDLEE v! I I-'/ .. . . Us- Technalogir al evolution plus 01 ¥ circuits An^Sa Li {pin* E 1 cklor ktor Technological evolution plus DIY circuits Analogue Video This book is intended for electronics enthu- siasts and professionals alike, who want a much deeper understanding of the incre- dible technology conquests over the pre- digital decades that created video. It details evolution of analogue video electronics and technologyfromthefirst electro-mechani- cal television, through advancements in Cathode Ray Tubes, transistor circuits and signal processing, uptothe latest analogue, colour-rich TV, entertainment devices and calibration equipment. 222 pages • ISBN 978-0-905705-96-5 £26.50 • US $42.80 Linux PC-bawd Measurement Electronic* i I * A highly-practical guide Linux - PC -based Measurement Electronics If you want to learn howto quickly build Linux-based applications able to collect, process and display data on a PC from var- ious analog and digital sensors, how to control circuitry attached to a computer, then even howto pass data via a network or control your embedded system wire- lessly and more -then this isthe bookfor you! The book covers both hardware and software aspects of designing typical em- bedded systems using schematics, code listings and full descriptions. 264 pages • ISBN 978-1-907920-03-5 £29.50 • US $47.60 Enhanced second edition: 180 new pages Design your own Embedded Linux Control Centre on a PC The main system described in this book re- uses an old PC, a wireless mains outlet with three switches and one controller, and a USB webcam. All this is linked together by Linux. This book will serve up the basics of setting up a Linux environment - including a software development environment - so it can be used as a control centre. The book will also guide you through the necessary setup and configuration of a Webserver, which will be the interface to your very own home control centre. Newedition enhance- ments include details of extending the ca- pabilities of your control center with ports fora mobile phone (for SMS messaging) and the Elektor “thermo snake” for low- cost networked real-time thermal moni- toring of your house and outbuildings. Now you can additionally also send all kinds of useful temperature and sensor warnings to a mobile phone. All software needed will be available atthe Elektor website. 41 6 pages • ISBN 978-1 -907920-02-8 £34.50 • US $55.70 ' More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com A More than 70,000 components cd Elektor’s Components Database 6 This CD-ROM gives you easy access to design data for over 7,800 ICs, more than 35,600 transistors, FETs, thyristors and triacs, just under 25,000 diodes and 1 ,800 optocouplers. The program package con- sists of eight databanks covering ICs, tran- sistors, diodes and optocouplers. Afurther eleven applications cover the calculation of, for example, zener diode series resis- tors, voltage regulators, voltage dividers and AMV’s. A colour band decoder is included for determining resistor and in- ductor values. All databank applications are fully interactive, allowing the user to add, edit and complete component data. This CD-ROM is a must-have for all elec- tronics enthusiasts! ISBN 978-90-5381 -258-7 £24.90 • US$40.20 More than 25 projects based on the Elektor ATM18 board cd ATM1 8 Collection This CD-ROM contains all articles from the popular ATM1 8-CC2 series published in Elektor magazine. From RFID Reader and Bluetooth linking right up to a chess com- puter! Project software and PCB layouts in PDFformatare included. What’s more, this CD also contains a Bascom AVR program- ming course and helpful supplementary documentation. ISBN 978-0-905705-92-7 £24.50 • US$39.60 elektor 07 / 08-2011 113 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES All articles in Elektor Volume 201 0 dvd Elektor 2010 This DVD-ROM contains all editorial articles published in Volume 201 0 of the English, Spanish, Dutch, French and German edi- tions of Elektor. Using the supplied Adobe Reader program, articles are presented in the same layout as originally found in the magazine. An extensive search machine is available to locate keywords in any article. With this DVD you can also produce hard copy of PCB layouts at printer resolution, adapt PCB layouts using your favourite graphics program, zoom in / out on selec- ted PCB areas and export circuit diagrams and illustrations to other programs. ISBN 978-90-5381-267-9 £23.50 • US $37.90 RFID, NFC, Zigbee, GPS and more dvd Wireless Toolbox On this DVD-ROM you’ll find a number of documents and tools that will enable you to add wireless data exchange to your elec- tronics systems. In accordance with the principle of our Toolbox series, we’ve broughttogethertechnical documentation (spec, sheets, application notes, userguides, etc.) on various devices according to the frequency and/or protocol used. All of the documents are PDF files (in English). Brow- sing around the DVD is made easy by an HTML menu. Finally, this Wireless Toolbox DVD contains a collection of articles on this topic (RFID, xBee, DCF77, GPS, infrared, etc.) that have appeared in Elektor magazine. ISBN 978-90-5381-268-6 £28.50 • US $46.00 V J Wireless OBD-II (April 2011) The cheapest way to diagnose faults on a modern car is to connect its OBD-II interface to a (notebook) PC running suitable diagnostics software. However, a wired connection is not always the most suitable, and selfcontained OBD testers are a rather expensive and less flexible alternative to using a PC. An interesting option is a wireless OBD interface with a radio interface to a PC: this homebrew solution allows the choice of using either Bluetooth orZigBee. OBD2- Zigbee or Bluetooth interface kit with all parts and enclosure SatFinder (March 2011) Those of you who regularly need to realign a satellite TV dish will find this gadget extremely valuable. Caravan owners and campers on long journeys who crave their home TV channels can now keep up with developments in sports, news and the soaps back home with the help of the SatFinder. This GPS based design includes a database con- taining positional information of a num- ber of popularTV satellites. With the help of GPS data it calculates the precise angles to find the satellite first time! Art.# 100872-71 £111.00 • US $179.10 (Zigbee) Art.# 100872-72 £111.00 • US $179.10 (Bluetooth) Kit of parts including Controller ; display and PCB (European Version) Art.# 100699-71 • £71.20 • US$114.90 Elektor f i co C Cx- 1 . 4f F Pico C Meter (April 2011) RF and radio repairfans probably do need to be told, but when it comes to measu- rements below 200 pF or so, modern DMMs will produce coarse if not ridiculo- us results. Elektor’s purpose-designed Pico C does a far better job. Beating many DMMs hands down, this little instrument easily and accurately measures capaci- tances down to fractions of a picofarad! Kit of parts inch Elektor Project Case, programmed microcontroller, LCD and PCB NetWorker (December 2010) An Internet connection would be a valua- ble addition to many projects, but often designers are put off by the complexities involved. The ‘NetWorker’, which consists of a small printed circuit board, a free soft- ware library and a ready-to-use microcon- troller-based web server, solves these problems and allows beginners to add In- ternet connectivity to their projects. More experienced users will benefit from featu- res such as SPI communications, power over Ethernet (PoE) and more. Module , ready assembled and tested Art.# 100823-71 • £73.40 • US$118.40 Art.# 100552-91 • £53.00 • US$85.50 114 Prices and item descriptions subject to change. E. & O.E 07 / 08-2011 elektor "\ July 2011 (No. 41 5/41 6) L + + + Product Shortlist June: See www.elektor.com + + + June 2011 (No.414) ElektorOSPVI 110320-91 .. ..Kit 975.00...1 570.00 Geolocation with the ATM1 8 071035-91 .. .. ATM1 8 Controller module, partly populated 9.50... 15.40 071035-92.. .. ATM 1 8 Testboard, partly populated 29.90... 48.30 071035-93 .. .. LCD board, SMD populated incl. pinheaders 23.00... 37.10 Here comes the Bus! (6) 110258-91 .. .. USB/RS485 Converter, ready made module 22.20... 35.70 E-blocks: Flowcode RC5 EB007 .. E-block Switch Bboard 14.40... 23.90 EB058 .. E-block Color Graphics Display 66.10... ..109.60 EB060 .. E-block RC5 Infrared Board 30.00... 49.80 EB064 .. E-block dsPIC/PIC24 Multiprogrammer 96.00... ..159.40 May 2011 (No. 41 3) Microphone Conferencing System 100465-1 Printed circuit board 8.85 14.30 Elektor Proton Robot 110263-71 .. .. Kit of parts All Inclusive (Body + Head + Audio + Gripper + PIC Add-on) 1085. 00. ..1745. 00 110263-72.. .. Kit of parts All Inclusive (Body + Head + Audio + Gripper + AVR Add-on) .... 1085.00.. .1745.00 110263-78.. .. Ready assembled and tested, PIC Add-on ....34.00.. 55.00 110263-79.. .. Ready assembled and tested, AVR Add-on ....34.00.. .... 55.00 110263-91 .. .. Ready assembled and tested, PIC version 0 0 lti i"" .2375.00 110263-92.. .. Ready assembled and tested, AVR version 1475.00.. .2375.00 1 -Channel DMX51 2 Light Dimmer EB006 E-block PIC MultiProgrammer ....75.00.. ...121.00 TEFLCST4 .. E-block Flowcode 4 for PICmicro ....45.90.. 74.10 Mobile, Text, CallerlD 071035-72 .... Relay board with all parts and relays ....36.90.. 73.80 071035-91 .. .. PCB, partly populated, ATM1 8 Controller module 9.50.. 15.40 071035-92.. .. PCB, partly populated ATM1 8 Test board ....29.90.. 48.30 071035-93.. .. LCD board, SMD populated incl. pinheaders ....23.00.. 37.10 071035-95.. .. Port extension board, SMD populated ....13.40.. 26.80 April 2011 (No. 41 2) PicoC 1 00823-1 Printed circuit board 8.85 14.30 1 00823-41 .... Programmed controller ATTINY231 3-20PU 8.85 1 4.30 100823-71 .... Kit of parts incl. Elektor Project Case, programmed microcontroller and PCB 73.40 1 1 8.40 Wireless OBD-II 1 00872-71 .... OBD2-Zigbee interface kit incl. Zigbee-USB stick, all parts and enclosure 111.00.. ..179.10 100872-72... . OBD2-Bluetooth interface kit with all parts and enclosure 111.00.. ..179.10 Asteroids & E-Blocks EB014 . Keypad (E- block) 18.00.. ....29.10 EB058 . Color graphics display (E-block) 74,99.. ..121.00 EB655SI4 . dsPIC bundle (E-block) 299.00.. ..482.30 TEDSSI4 . Flowcode for dsPIC Pro 175.00.. ..282.30 Guitar Input for Multi-Effects Unit 100923-1 . Printed circuit board 7.10.. ....11.50 Altimeter for Micro-Rockets 100418-41 ... . PIC1 6F88-E/SO (SOIC-1 8), programmed 8.85.. ....14.30 GPIB-to-USB Converter 080068-91 ... . Controller board, populated and tested 55.00.. ....88.80 ATM1 8 Catches the RS-485 Bus 071035-72... . Relay board with all parts and relays 36.90.. ....59.60 071035-91 ... . ATM1 8 Controller module 9.50.. ....15.40 071035-92... .ATM 18 test board 29.90.. ....48.30 071035-93... . LCD board, SMD populated incl. pinheaders 23.00.. ....37.10 071035-95... . Port extension board, SMD populated 13.40.. ....21.70 080213-71 ... .TTL-232R5V cable 17.50.. ....28.30 v V O O CD 0 O' 1 O Q Q U od CO W O Bestsellers Linux - PC-based measurement electronics ISBN 978-1 -907920-03-5 .... £29.50 US $47.60 issembly Language Essentials ISBN 978-0-96301 33-2-3 .... £29.50 US $47.60 Design your own Embedded Linux Control Centre on a PC ISBN 978-1 -907920-02-8.... £34.50 US $55.70 Introduction to Control Engineering ISBN 978-0-905705-99-6.... £27.50 US $44.40 C# 201 0 Programming and PC interfacing ISBN 978-0-905705-95-8.... £29.50 US $47.60 CD Elektor’s Components Database 6 ISBN 978-90-5381-258-7.... £24.90 US $40.20 DVD Elektor 201 0 ISBN 978-90-5381 -267-9.... £23.50 US $37.90 CD ATM1 8 Collection ISBN 978-0-905705-92-7.... £24.50 US $39.60 DVD Elektor 1 990 through 1 999 ISBN 978-0-905705-76-7 .... £69.00 ...US $1 1 1 .30 DVD Wireless Toolbox ISBN 978-90-5381-268-6.... £28.50 US $46.00 o o Pico C Meter Art. #1 00823-71 £73.40 ...US $1 1 8.40 NetWorker Art. # 1 00552-91 £53.00 US $85.50 Wireless OBD-II Art. # 1 00872-71 /72 £1 1 1 .00 ...US $1 79.1 0 MIAC-PLC Art. # MI0235 £1 54.00 ...US $248.40 SatFinder Art. #1 00699-71 £71 .20 ...US $1 1 4.90 Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH • United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com elektor 07/08-2011 115 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR Data Logger This circuit was originally developed for long term weather data recording including tem- perature, humidity and air pressure. Consequently the circuit is provided with the neces- sary sensors. Thanks to its universal design, this logger can also be used for many other measurements. Using a USB cable it can be connected to a PC logger for sending stored data as well as to perform various settings. DSP Experimenter’s Board In the September 2011 edition we’ll present the hardware that’s part of the DSP course launched in the May 2011 edition of the magazine. At the heart of the universal experi- menting board sits a Freescale DSP56374 chip. The hardware devices on the board include A/D and D/A converters, a sample-rate converter and optical inputs and outputs. This board can be used not just for the example projects described later on in the course, but also for your own experiments and design initiatives. 2.4 GHz Radio Control for Model Aircraft This transmitter and receiver system for model aircraft uses the 2.4 GHz ISM radio band and ZigBee technology. If offers eight proportional channels and a range in excess of one kilometre. The system allows for battery voltage(s) and power consumption to be requested from the model ‘over the air’. All parameters are clearly displayed on a screen and there are also several communication ports available (UART, CAN, PC). Article titles and magazine contents subject to change; please check the Magazine tab on www.elektor.com Elektor UK/European September 2011 edition: on sale August 18, 2011. ElektorUSA September 2011 edition: published August 75, 20 n. w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor.com wv Elektor on the web funjiii All magazine articles backto volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you’ll find all other products sold by the publishers, like CD-ROMs, DVDs, kits, modules, equipment, \ m 1 wr* prototypes ontwikkll^j tools and books. A powerful search function allows you to Glektor 5 ubl£ lifer search for items and references across the entire website. ■ i..roon ji ffJir mzimf prtAff cir wifr EE - ir. wbsfi ■ Micmsemi Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Time limited offers • FAQ, Author Guidelines and Contact A tufe I Ml mr.ju-jip A. 1.1. i r.i.y.t ir.i yruc L ■. is BLfTUUn Ml ■ ’-E.H Dw.aart mrH ifcppny far Z ■* j “ z-r ni^inip luaccrisvn. Fundamental Amplifier Technique's ".'lUi f- * I (fitf Pi 4 i StracnM TO tnt ptKCK i-Q v-riri-jf. jK’ IKIi'uun' 1 ll’crlliilFMliTMMl - lM>hM * fur Pm in* .rafi 4 ■.* .m » : r r .. k "5 1 .1. tl« rrtlrr-piu- Iml ^nn Aa m ■ in In iha mfidm Etcktor A Mirrviiilr fpr ifud&rfcli. TAB' fi l ia l F-b&ifr 116 7/8-2011 elektor Description Price each Qty. Total Order Code LabWorx - Mastering the l 2 C Bus fTTSd £29,5 ° Linux - PC-based Measurement Electronics £29.50 Assembly Language Essentials £29.50 Design your own Embedded Linux Control Centre on a PC £34.50 CD Elektor's Components Database 6 £24.90 DVD Elektor 201 0 £23.50 Sub-total Prices and item descriptions subject to change. P&P The publishers reserve the right to change prices without prior notification. Prices and item descriptions Total paid shown here supersede those in previous issues. E. & O.E. Name METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) □ VISA □ EUROCARD MasterCard Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Address + Post code Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com order@elektor.com Email EL07/08 Date Signature *USA and Canada residents should use $ prices, and send the order form to: Elektor US PO Box 1 80 Vernon CT 06066 USA Phone: 860-875-2199 Fax: 860-871-0411 E-mail: order@elektor.com Yes, I am taking out an annual subscription to Elektor and receive the E-book * Microcontroller Basics Microcontroller Basics totally free! (Please fill in your emailaddress below) I would like: I— I Standard Subscription (11 issues) I— I Subscription-Plus (1 1 issues plus the Elektor Volume 201 1 DVD-ROM + exclusive access to www.elektor-plus.com ) * Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Date EL07/08 Email Signature METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) □ VISA □ EUROCARD MasterCard Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com service@elektor.com ORDERING INSTRUCTIONS, P&P CHARGES All orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. Online ordering: www.elektor.com/shop Readers in the USA and Canada should send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Elektor US for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £1 1 .00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BIC: ABNACB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. GCredit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran- tee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 1 0% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsi- bility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party adver- tisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. January 201 1 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION United Kingdom & Ireland Standard £51.00 Plus £63.50 Surface Mail Rest of the World £65.00 £77.50 Airmail Rest of the World £82.00 £94.50 USA & Canada | Seewww.elektor.com/usaforspecialoffers | HOW TO PAY Bank transfer into account no. 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident cus- tomers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a permanent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs £40.80, a Student Subscription-Plus costs £53.30 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twenty-five per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 201 1 Elektor OSPV 1 / Open Source Personal Vehicle Last year we launched the Elektor Wheelie, a self-balancing personal transport device. Our new Elektor OSPV is based on the same concept, but with the difference that it’s for indoors, it’s easy to steer, it’s light and foldable and.L it’s open source. You can configure or modify it to suit your wishes! The OSPV is primarily intended for moving people, but it doesn’t have to be limited to that. A variety of other uses are conceivable, ranging from an electric wheelbarrow to a handy motorised shopping cart. This is where the advantages of the open source approach come to the fore! Elektor Important specifications: Size: 1 20x47x47 cm / 47.2x1 8.5x1 8.5 inch (HxWxD) Weight: 25 kg (25lbs) Maximum load: 90 kg (200 lbs) Motors: DC 2 x 200 W Wheels: Polyurethane, 1 4 cm dia. (5.5 inch) Drive train: HDT toothed belt Max. speed: 1 5 km/h (9.3 mph) Range: 8 km (5 miles) The kit comprises two 200-watt DC drive motors, two 1 2-V lead-acid AGM batteries, battery charger, two wheels Polyurethane 1 4 cm wheels, casing, control leverand fully assembled and tested control board with sensor board. rt.# 11 0320-91 £975 / € 1 095 / US $1 570* *lnd. VAT, excl. shipping costs and introductory discount (until August 1,2011) No^ataspedaUntto^-VP*' 1 £9 0 1 <100 1 S1« DISCOUNT Order before August 1,2011^ Further information and ordering at www.elektor.com/ospv w Index of Advertisers Atomic Programming Ltd, Showcase . Avit Research, Showcase BAEC, Showcase Beta Layout CEDA, Showcase Designer Systems, Showcase Easysync, Showcase Elnec, Showcase Eltim Audio Embedded Adventures, Showcase . . . Eurocircuits EzPCB/Beijing Draco Electronics Ltd. . FlexiPanel Ltd, Showcase Future Technology Devices, Showcase Flameg, Showcase Jackaltac Labcenter Linear Audio, Showcase www.atomicprogramming.com 110 www.avitresearch.co.uk 110 http://baec. tripod, com/ 110 www.pcb-pool.com 2 www.ceda.in 110 www.designersystems.co.uk 110 www. easysync- ltd. com 110 www.elnec.com 110 www.moreleurope.com 85 www.embeddedadventures.com 110 www.eurocircuits.com 53 www.v-module.com 85 www.flexipanel.com 110 www. ftdichip. com 110 www.hameg.com 110 www. jackaltac. com 101 www.labcenter.com 120 www.linearaudio.net 110 Maxbotix, Showcase Minty Geek, Showcase Microchip MikroElektronika MQP Electronics, Showcase. . PICO Technology Quasar Electronics Robot Electronics, Showcase. Robotiq, Showcase Schaeffer AG Showcase Steorn SKDB Lite, Showcase . Virtins Technology, Showcase www.maxbotix.com Ill www.mintygeek.com Ill www.microchip.com/mtouch 65 www.mikroe.com 3, 81 www.mgp.com Ill www.picotech.com/scope31 05 85 www.guasarelectronics.com 15 www.robot-electronics.co.uk Ill www.robotig.co.uk Ill www.schaeffer-ag.de 73 110 , 111 www.kdb.steorn.com/ref25 Ill www. virtins. com Ill Advertising space for the issue 20 September 2011 may be reserved not later than 16 August 2011 with Elektor International Media - Allee 1, 6141 AV Limbricht, the Netherlands Telephone 0031 (0) 46 4389444 - Fax 0031 (0) 46 43701 61 - e-mail: advertenties@elektor.com to whom all correspondence, copy instructions and artwork should be addressed. elektor 07 / 8-2011 119 PRE-PRODUCTION CHECK . Board Edgo Defined - All Components Placed - All Connections Routed - Power Planes Generated - l\l o Design Rule Violations - Design with Confidence: The latest version of the Proteus PCB Design Software provides a multi- stage Pre-Production Check which will detect and prevent a variety of common mistakes prior to your boards being sent for manufacture. PROTEUS DESIGN SUITE Features: ■ Hardware Accelerated Performance. ■ ■ 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++, IDF & 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