July/August 2010 AUS$ 19.95 ' NZ$24.50 - SAR 129.95 £6.95 (§Ml!J E C£-[LLIE4> 1 1 4. i. ,4-f) GCOO.G www.elektor.com A IL4 .t? «_«U| r - in ■ 1 L~ ! r —r* - V? 1 r*Tl^_-r-jU_ •' * p '> — 1 >a t-r5» iy "■ - jF 1 + *'■ Ip ■ 1 i r - ■ \ P mL. /[ j£r " r ‘’^Hv. Jt' r-.J T- . *, {s .4 k Jit 1 .^| *1 - 4 ni - ' ■* lL ^ i*IPi ' ” t?A. ] i]! 1 “| ^ "T r ^ 1 1 THE ORIGINAL SINCE 1994 ■ I Beta LAYOUT Servicing your complete PCB prototype pfeeds:j • Low Cost - High Quolii PCB Prototypes • Easy Online Ordering ) m Full DRC included • Lead-times from 8hrs • 1 mm Prototyping service Optional Chemical Tin finish no extra cost Email: sales@pcb-pool.com Free Phone UK: 0800 389 8560 www.Dcb-Dool.com The RS EDP. No other platform can make your concepts fly quicker. EMBEDDED DEVELOPMENT PLATFORM rswww.com/edp 08457 201201 @ Elektor Welcome to yet another Summer Circuits edition of Etektor — it's th e thirty- sixth for the UK edition, and the second for the fledgling US edition. This year, for the first time, if a PCS was designed for a specific project, the cop- per track and component mounting plan are no lon- ger printed on the page but available in a .pdf file on what we normally call the 'project page’ on our website. The file is both free and easy to find. On www.elektorxom, click on Magazines, then select July & August 2010, then the arti- cle title from the alphanumerical list. The same for the com- ponents list and any software if applicable for the article. As 3 shortcut, simply locate the article production number at the end of the text and affix it to: www.elektor.com/, for example, www,elektorxom/090944. December 2010: Embedded Guide to the Universe These past few weeks, the editorial teams, lab and DTP staff here at Elektor have been burning their midnight oil to get this Elektor double edition ready in time for mailing to you or to selected bookstores and other retail outlets. During one of our editorial meetings the idea was kicked around to compile 3 special edition for the Christmas Holidays period, focussing on microcontroller (embedded) designs, Ideas, software, cir- cuits, tips 8i tricks, projects — the works! As a matter of course, the team is open to suggestions from you, our readership, to fill this edition with projects and other state of the art stuff on bits and bytes. So, if you have anything to share, let Jan know on his email addresseditor@elektor.com. As usual, we've ‘fit- ting remuneration’ available for those of you actually making to publication. Elektor Foundation Award This year, second time around, we’re actively seeking nomi- nees for the Elektor Foundation Award. Please send us your re- commendations for persons out there with verifiable achie- vements in the field of electro- nics. This might cover a product development, a tailored pro- ject in electronics education, or even an electronics related company having gone through a development you think is remarkable in a positive way. Please send your suggestions to award2010@elektor.nl. E L E K T 0 R F 0 U N D A T 1 0 N Elektor Foundation It’s all happening*. .@Elektor. Wisse Hettinga, Editor in Chief Plus Colophon 6 The Elektor DSP Radio 10 Hexadocube Puzzle 60 Remote Control 106 Elektor SHOP 112 Coming Attractions 116 SUMMER CIRCUITS 2010 Colour of title indicates category. Bold type - PCB design available on Elektor website. Dynamic Limiter 96 Electret Mic Booster 65 Class Blower 87 Indicator for Dynamic Limiter 26 Line Input for Zoom H2 25 Mini Sixties Plus 85 No-C A3080 Guitar Compressor 84 Remote-controlled Preamp with Digital Pot 22 Reverse RIAA Adaptor 73 Computers, Software & Internet 3-Pin Fan in 4-Pin Socket 56 ‘Always on' for PCs 72 Network Wiring Tester 86 Hobby, Games & Modellin Bat 54 Car Radio Booster 72 Cheap Bicycle Alarm 31 Clock Pulse Generator 1 6 Daggerboard Position Detector 1 9 DIY Front Panels 39 Flashing Light for Planes and Helicopters 54 Front Panel Design Program 52 Front Panels the Mouse May Way 28 Green/Red Multiflasher 64 Lights Control for Model Cars 82 Modeller's Clock 88 Musical Horn for ATBs 41 Play ‘Simon' 33 Rapid Test and Measurement 27 CONTENTS Volume 36 July & August 2010 no. 403/404 Shunting Lights for DCC Locomotives Underfloor Heating Controller Whistler: Electronic Trainer/Coach 24 99 36 Home & Garden 1 2-volt Cellar Drain Pump 75 Analogue Electronic Key 93 Animal-Friendly Mousetrap 77 Astrolamp 90 Binary Clock 58 Intelligent AC Power Bar 17 Outdoor Lighting Controller 27 Phase Coupler for PLC or XI 0 Network 31 Power Saver 105 Powerline Voltmeter 44 Solar Cell Battery Charger /Monitor 38 Temperature Logger for the Fridge 18 Timer for Battery-Powered Tools 71 Touch-controlled Dimmer 89 Universal Timer with Zero Standby Current 43 Water Alarm 55 Waterproof Bathroom Switch 81 Wireless Alarm Tra nsmitter and Receiver 102 Microcontrollers ATM-18 DIP 92 Crystal Pulling 35 MCS08DZ60 Evaluation Board 76 PIC RJ-45 Cable Tester 29 PIC/C or VHDL/FPGA for RFM1 2 TX/RX 53 Quartz Clock Timebase 44 Tiny Pulser 78 Tiny Timer 46 USB/TTL Serial Cable: Extension & Supplement 98 Power Supplies, Batteries & Chargers Adjustable Low-voltage Power Supply 34 Bench PSU for PC 64 Deep Discharge Protection for 12 V Batteries 32 Discrete Low-drop Regulator 92 L20G Charger Circuit 40 The LM3410 LED Driver 68 Sailor's Battery Meter 70 Simple LED Constant Current Source 45 Universal PWM Driver 48 Virtual 9 V Battery 63 AM Receiver with Quadrature Mixer 40 Crystal Tester 18 Simple RF Noise Source 17 Variable Crystal Filter 67 Vest Pocket VHF FM Test Generator 90 Test & Measurement AC Power Indicator 74 Ground-free DVM Module Supply from 5 V 20 Ignition Timer 42 LED Tester 66 MtcroMinimal Thermometer 80 Petrol/Diesel Level Sensor 34 Sweep your Function Generator 91 Thermometer with Four-Digit LED Display 1 04 Universal IR Remote Control Tester 45 USB Tilt Sensor 62 Miscellaneous Electronics & Design Ideas 3D LED Pyramid 30 8-channel DTMF Link: Decoder 26 8-channel DTMF Link; Encoder 25 Automatic Rear Bicycle Light 67 Breadboard as Ft ot plate 55 Car Alarm Sound Booster 23 Digital Thumbwheel Switch 32 DIY SMD Adapter 94 Economical On/Off Power Switch 49 Emergency Stop 37 Fast Reliable Vias 50 Identifying Stepper Motors 50 LED Bicycle Light Revisited 94 Mobile Phone TX Demo 56 Pulse Receiver 74 RGB Synchronizing Fireflies 1 00 Scope Text 101 Six-way Switch 52 Voltage Difference Magnifier 66 Voltage Monitor 42 Zapperfor Electrotherapy 51 elektor international media bv Elektor International Media provides a multimedia and interactive platform fc r e . eryone interested in electronics. From professionals passionate about their work to enthusiasts v. ith professional ambitions. From beginner to diehard, from student to lecturer. Information, e:.. cation, inspiration and entertainment. Analogue and digital; practical and theoretical: sc ; :.-.rr and hardware. ANALOGUE • DIGITAL ^ * MICROCONTROLLERS & EMBEDDED, AUDIO • TEST & MEASUREMENT V * Volume 36, Number 403/404, July/ August 2010 ISSN 1757-0875 Elektor aims at inspiring people to master electronics at anv personal level by presenting construction projects and spotting developments in electronics and information technology. Elektor International Media, Reg us Brentford, 1000 Great West Road. Brentford TWS 9HH, England, TeL (+44) 208 261 4509, fax: (+44) 20S 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail out lets, or on subscription, Elektor is published 11 rimes a year with a double issue for July & August Elektor is also published in French , Sc a rnerfcan English. German and Dutch. Togethe- t~ ^-.i-’chised editions the magazine js nn ci'Ci. • - - than 50 countries. International Editor WissoHettinga (w.hettinya lelektor nl Jan Suiting {editor ! elektor.com 1 Harry Bag gen. Thijs Beckers. Eduardo Corral, Ernst Krempe! sauer. jc-ns s eke Cemens Valera. Antoine Authier (Head t r. esbciru. Luc Lemmens, Daniel Rodrigues, Jan , sse- Christian Vossen Edftuua Hedwig Henri-. - ■ Ca r : , Ei--* ' -- - - : i Reg us Brentford. ■ : : 1 -r 5. - j TVV8 tjHH, England TeL(+44) 206.26? ;= . _ . — - Internet: wwvv.e 6 elektor DISTANCE LEARNING COURSE Programming Embedded PIC Microcontrollers M F Specialintroductory pnce- £40 I $70 | € 50 DISCOUNT ^UJcomldistancelearning In this course you will learn how to program an embedded microcontroller. We will start with the absolute basics and we will go into a lot of detail. You cannot learn about software without understanding the hardware so we wifi a lso take a close look at the components and schematics. At the end of the course you will be able to design your own embedded applications and write the appropriate software for it. Contents: * Background * Digital Ports * Serial Communication (R5232) * Analog Signals * Pulse Width Modulation * Timers/ Counters/ Interrupts * Memory * LCD Display * f 2 C Communication * SPt Communication * USB Communication * Configuration (Fuses) * Answers to the assignments * Appendix e I e k ACADEMY tno school election ics Your course package: * Courseware Ring Binder (747 pages) * CD-ROM including software and example files * Application Board ■ SupportatElektorForum * Elektor Certificate Price: £395.00 / $645.00 / €445.00 * Please note: to be able to follow this course, E- blocks hardware is required which you may already have (in part). All relevant products are available individually but also as a set at a discounted price. Please check www.el ektor. com/d Istancelearn i ng for further Information. l* W : - \ < ai ' ,h i,v *w rr. \ Further information and ordering at www.elektor.com/distancelearning \ y Ema il: s u bscri pt tons eld ktor.co rn Rates and terms are given on the Subscription Order Form. Elektor International Media b.v, P.G, Boxii NL-6114-ZG Susteren The Netherlands, Telephone: ( *31) 46 4389444. Fax: (+31) 46 4370161 Divn 1 but ion; Seymour, 2 East Poultry Street, London ECiA. England Telephone;+44 207 429 4073 Huson international Media, Cambridge House, Gogmore Lane. Chertsey. Surrey KT16 gAP, England, Telephone: *44 1932 564999, Fax: +44 1932564998 Email: r.e I gap“' huso nmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. Copyright NoUce 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-parly advertisements) arc copyright Elektor International Media b.v, and may not be leptoduced or transmu- 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 permits on must also be obtained before any part of this publication n stored in a retrieval system qf any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher dues not accept responsibility for tailing to identify such patent(s}or otliei 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, fhc 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. Oeklor International Mudub-v. zong Printed in the Netherlands elektor 7/8*2010 7 ADVERTISEMENT YET POWERFUL mikroBASIC. mikroC and mikroPASCAL PRO COMPILERS 1 FREE LIFETIME 1 TECH SUPPORT i tlflKy/ - w/j - m o deadline, or when we ] us! won* to ask a simple, basic question, that's pulling us back for a while. We do understand how important this is to people and therefore our Support Department is one of the liars upon which our compa .u MikroElektronika offers Lifetime Tech Support - ri-. i t am lical Price of mikroC compiler is $249.00, but if you order it with one of our development boards if will cost you 20% less, so with the board price of the compiler will be ~ " ■ -l # ml r irforrm lance rati< mikroBosic t mikroPascal are even cheapei fhe price For them is $ 1 49,00 if purchased along with development boards and $ ] 99,00 without. / i ■ ■ kj |^i a PIC 6 P-BCM PZPH V * * * ,1 . J * * -I ■ I* » ■ ’ Shrt tw m #■ ‘ ' ■>rri r r *'**' If Mti .*'** * I 1 !■ 1 JL i i Him lilsPIC: lITTTTT /; nun 3 *1 ;AVR = :: 4 * IMII I .ii 1 1111 1 1 j i j r ■ ■ 1 « «£E - Ml * -EG B * > 4 ? Mi ■ UH5 =» tiffif* • ulS ? 5’i T - XS *4 «a**- ’ i* »lff^ a* *L£D »|[D IV ' rr " ; ■ thl *QMi Ri f— -T I 1 - T -* 13 i^® -,1 ■t£0 0* i'.K' 3 « * 95 • ifflOl • l££ * *' * ■ * , V t ® D j 1BD MjTiUiir UJJvt ' . . fed CfettlAJ.MSU art* p-‘fU T ■J, CM' I IB If 1 I sassw « a m ¥Mft w t s m 0 0 0 #*V-nr ^ O- m mi Rj-- » L-tl UT* *? O* 0 *», ■ .** as eur »; t C 3j ft t u * ■ Gcm | ' *Owo< ■ P * IE] I Of : 0*-=a C-srrtMit - f MdW' ■ '■’]»■ *■» * , Pl'«* -Ops* *Gftm i COG SOFTWARE SIMULATOR AND MIKROICD Compiler includes an excellent source-level debugger to help you troubleshoot and repair your application foster Debug your application using hardware mikrolCD [In-Circuit Debugger) that executes program in Real-Time on a hardware level. It's the best and most reliable way of finding errors. IMPLEMENTED TOOLS Lot of useful implemented tools will help you develop your application more quickly and comfortably. UART, HID and UDP Terminals, GLCD Bitmap Editor, mikro Bootloader, Seven Segment Editor, ASCII Chart, EE PROM editor, LCD Custom character tool and more. All will be in one place when you start developing! a STATISTICS Excellent statistics window, dear and rich with important information, shows complete statistic for your project, such as ROM and RAM used by each element along with percentages. Eleven different statistical overviews can provide much needed insight in your program's memory organization, t IDE - PURE JOY OF WORKING Integrated Development Environment - IDE - is a great place to be working all Easy and intuitive interface makes the programmer feel at home. Docking support makes it easy to organize your working environment. Code editor, Code explorer, Code Assistant, Project Manager, Library manager, Routine List Manager, Project Settings, Messages, Macros, Active Comments, Color Schemes, and much much more, will radically improve your programming experience. When we write our compilers, we don't just look at what others have to offer and only try to make a compiler that costs less.. What we do here is a product of great enthusiasm combined with sharp professional thought. We put ourselves in a position of ordinary people, people with less experience, who want to get the job done quickly and easily POWERFUL COMPILER Fast and efficent cade, stability and optimization are among the postulates of our compilers. We hove introduced sbit type, a clever approach that reduces code size over 20%, Fast code generation means no more waiting for long project compilation. Many useful linker directives give you powerfu control aver your code and program organization, LIBRARIES Compilers include a large set of different libraries intended to Facilitate application development: USB, SPI f Ethernet, UART, RS485, Soft Uart, CAN, CAN SPI, I2C, OneWire, Manchester, Touch Panel, GLCD, LCD, PWM, ANSI C libs, ADC, Sound, Compact Flash, MMC FAT 16, Flash, PS/2, EE PROM, Conversions and much more! x> T> HELP WITH EXAMPLES We understand that people need to have a source of information that is precise, clear, with demonstrations and examples that can be put in a context of projects in real life. This is why we are very patient when we write Help file, and we put a lot of effort to make it comprehensive and easy to use. WE RECOMMEND YOU THESE DEVELOPMENT SYSTEMS AS THE BEST SUPPORTED BY OUR COMPILERS Ea$yPIC6 LV24-33U6 Easy AVR 6 I Easy8051v6 $139.00 "! ■ ■ sTiJiTi " i T ■ 7 ■ 2 V £ ,i ■ ■ ■ + J ' n r 7 T , Cl . - ■ l b V '.k. t, : ■] $139.00 $139.00 $139.00 Mikrollektronika DEVELOPMENT TOOLS I COMPILERS I BOOKS LOCATE YOUR DISTRIBUTOR AT http:/ Vyvrw.mikrDe.com /eng/distributors BUY ONE OF OUR DEVELOPMENT SYSTEMS to get up to 30% discount ON THE COMPILER RF The Elektor DSP radio Burkhard Kainka (Germany) A world receiver that needs no set-up adjustments? It's possible using DSP technology. All the main functions are done in a S14735 DSP radio 1 C measuring just 3 mm by 3 mm, with the help of an LCD-based user interface, a stereo audio amplifier and an interface that allows the receiver optionally to be controlled from a PC. Many radio amateurs in practice use two receivers, one portable and the other a fixed receiver with a PC control facility* The Ele- ktor DSP radio can operate in either capac- ity, with a USB interface giving the option of PC control* An additional feature of the USB interface is that it can be used as the source of power for the receiver, the audio output being connected to the PC's powered speak- ers. To allow portable 6 V battery operation the circuit also provides for an audio ampli- fier with one or two loudspeakers* Features Any radio receiver worth its salt should of course offer high-quality FM reception, preferably in stereo and with RDS station information display* The proof of the radio is in the hearing, and this receiver will not disappoint; it has very high FM sensitivity and sound quality. The 514735 device that we use, unlike its less sophisticated sibling the Si4734, includes an RDS decoder* The 514734 has recently been finding its way into an increasing number of portable radios* The second requirement of a world receiver is that it should be able to tune in to distant 10 7/8-2010 elektor RF Features * no set-up adjustments required AM transmitters. Here the receiver is in a class of its own, offering excellent short- wave reception. In particular it has very good sensitivity in the presence of strong nearby interfering signals, which allows the use of longer antennas. A highly effec- tive automatic level control system brings the signal level into the optimal range, to the point where it can often be difficult to distinguish different antennas. Selectivity is also very high, and the receiver bandwidth can be adjusted in several steps, a feature previously reserved for only the most expen- sive equipment. The DSP radio is also capable of receiving medium wave and longwave signals, with the external antenna input allowing the connection of antennas for any frequency range. If a simple whip or other indoor antenna is used, it will often the the case that too much wtde-band interference will be picked up. An alternative is the (optional) connection of a ferrite antenna. SSB and DRM reception are, unfortunately, not possible. This is a result of the receiver structure. The radio 1C uses an homodyne (that is, zero intermediate frequency) JQ mixer with configurable DSP-based fil- ters and demodulator (Figure 1 ). For tun- ing a PLL is initially activated, and then the receiver locks on to the carrier of the AM signal. The circuit The circuit of the receiver (Figure 2) does not look, at first sight, much like a tradi- tional RF design. This is because all the important functions are integrated into the 514735. Only the antenna connection betrays the RF nature of the circuit: the antenna signal arrives at BNC socket l<4 or at screw terminals l<3 and passes through a diode limiter comprising D4 and D5. L2 is a n F M coi I with an i nducta nee of 0 . 1 pH. In normal operation jumper] PI is set to bridge pins 2 and 3, which connects the end of the FM coil to the AM input. What is not visible from the circuit diagram is that in FM mode the receiver sets its inter- nal AM 'variable capacitor' to 500 pF, which, as far as RF is concerned, shorts the end of * Si4735 DSP receiver 1C * ATmegaiGS microcontroller * USB interface using FT232R * backlit 2 x 16 LCD panel * battery voltage 4 .S to 6 V * current consumption approximately 50 mA * 3.3 V internal power supply * power from PC over USB interface * stereo audio output * stereo audio amplifier (2 XIM3S6) * R PS display * AM from 153 kHz to 21. S 5 MHz * automatic station search * antenna signal strengt h indication in dB,uV the FM coil to ground. In AM mode, how- ever, the signal from the antenna passes via L2, which now acts to increase the effective antenna length, to the AM resonant circuit comprising L3, 14, L5 and the automatically tuned ‘variable capacitor' inside the SS4735 at pin 4 (AMI). Which of the fixed induct- ances is actually used is determined by 1C 3 using the switching circuit comprising 1M4148 diodes D6and D7, which can effec- tively short a selected part of the induct- ance in the circuit to ground. In normal use jumpers JP2, jP3 and JP4 are closed; open- ing these jumpers allows the connection of alternative antenna input circuits or of a fer- rite antenna. For example, a mediumwave * signal st ren g th m e te r co n net l r on * diode switching of AM hand - automatic tuning of AM resonant circuit ■ switchabie AM bandwidth * optional PC control over USB * tuning using rotary encoder ■ lour control pushbuttons * station memory (30 AM presets and 30 FM presets) * open-source firmware (free download) * In -sy stem p rog rs m mm g i n te r fa ce * printed circuit board available ready- populated and tested H ' see http://www.e1ehtor.corn/100 1 2ft and the Eiektor shop pages a I the back of this issue ferrite antenna can be connected at JP3 or a shortwave loop antenna at JP2. If a whip antenna is to be used for FM reception only, set JP1 to bridge pins 1 and 2. The stereo audio output of the 5i4735 is taken to a stereo jack socket via C28 and C29, for connection to an external amplifier or powered speakers. The output is short- circuit proof, with an output impedance of 10 k H and an amplitude of about 80 mV eff . Two LM386 ICs are also provided as a power amplifier, with loudspeakers connected at K5. The maximum output power into 8 Q. is around 300 mW. Surprisingly there is no stereo volume control potentiometer in the MW/LW ANT 2.7 - 5.5 V VI0 1.5- 3.6 V % § 100126-12 Figure 1. Block diagram of the S14735 DSP radio 1C (courtesy http://www.silabs.com) elektor 7/8-2010 11 RF *< Figure 2, The only hint that this Es the circuit diagram of a radio receiver is the antenna input circuitry. 12 7/8-2010 elektor RF Figure 3. The printed circuit board is Eurocard-sized* All user controls are mounted on the top side of the board for convenience. Gegeniiberdem Labormusterauf den Fotos worden noth einige Bauteilpositionen geandert* circuit: this, and all other functions of the Si4735 are controlled by microcontroller IC3 (an ATmega168) in software over the SDA and SCI l 2 C bus signals. The microcon- troller reads a voltage from (linear) potenti- ometer PI using analogue input ADCO and translates this into the appropriate com- mands for the $14735. The tuning control is implemented as a rotary encoder (EMC1 ) connected to two port input bits. Pushbut- tons $2 to S5 comprise the remaining user controls: their function will be described in detail below. Finally, a PWM output is pro- vided for connection of a signal strength meter, taking the form of a 500 Hz square- wave with a variable mark-space ratio. The average output voltage varies between 0 V and 3.3 V, and almost any meter with a full- scale deflection of up to 1 mA can be con- nected using a suitable series resistor. The AT mega 168 is clocked at 8 MHz, This clock Is independent of the reference in the receiver which is derived from a dedicated 32.768 kHz watch crystal. There are three alternatives for powering the radio: over the USB connection, using Figure 4, The Si4735 module consists of a daughter board with the DSP 1C mounted on it. a 6 V mains adaptor, or from a four-cell bat- tery pack (4.8 V to 6 V). The voltage at V fN directly powers the two LM386 ICs and the LCD backlight, and also forms the input to voltage regulator 1C! (an LP2950-33) which provides the regulated 3.3 V supply for the radio 1C. the microcontroller and the LCD. Power switch SI only controls power from K1 (from a battery or mains adaptor): USB power is not switched. Power can be saved by removing J P5 , wh ich will turn off the LCD backlight: the display is perfectly legible in ambient light. The receiver will work with- out problems with a battery voltage as low as 4,0 V* This, together with the relatively low current consumption of 50 mA. means that the circuit will give good battery life. Populating the board The Eurocard format (100 mm by 160 mm) printed circuit board (Figure 3) is designed to be built into an enclosure along with loud- speaker and battery holder. All the controls are located on the top surface of the board. If it is important that no components hang over the edge of the board, do not fit BNC socket K4 and audio socket K6. The printed circuit board is available ready-assembled and tested in this form from the Eiektor shop (order code 1001 26-91 : see the pages at the back of this Issue)* The layout and parts list are available for download from the £/e- ktor web pages for this project [1], and the unpopulated board (order code 100126- eiektor 7/8-2010 RF Table i. The most Important terminal commands (38400 baud) f5955 fl O2S00 m5 6075 DW n395100 p9 I pi 0 0 plO 1 p10 2 p1G3 p104 p l 3 0 tune to 5955 kHz AM Lone to 102.8 MHz FM store AM preset 5: 6075 kHz, label DW' store FM preset 3: 95.1 MHz AM de-emphasis on set AM bandwidth to 6 kHz set AM bandwidth to 4 kHz set AM bandwidth to 3 kHz set AM bandwidth to 2 kHz set AM bandwidth to 1 kHz disable AM soft mute 1) can also be ordered on-line. Ready-pro- grammed microcontrollers (100126-41) and the Si4735 module shown in Figure 4 (090740-71) are also separately available From the E/eictorshop, and so if you wish you can populate the main board yourself. Start with IC2, the FT232RL a little experience in soldering SMD ICs will be useful here. Then fit the USB socket and connect the board to a PC for testing. If the USB interface 1C is recognised by the PC, then you have cleared the first hurdle. The two pin headers have to be soldered to the Si4735 module so that it can be fitted into a normal 1C socket. When assembling the LCD, note that the backlight board must first be soldered in under the LCD panel Itself. Then the assem- bled LCD module can be mounted in a header socket to increase its height above the main board. The other components should present no problems to anyone with a little experience with a soldering iron. It hardly needs saying that you must of course observe the correct polarity when fitting the electrolytic capaci- tors and diodes. Powering up If you have not previously used an FT232R with your PC T you will first need to install a driver. Run the program CDM_Setup. exe t part of the software download avail- able at [ 1 ] t and then connect the radio to the PC using a USB cable. When the radio is first connected the driver will be loaded and a COM port allocated. If a connection Ftqure 5 The display shows the currently tuned frequency, the signal strength at the antenna in dBpV, and the signal-to-noise ratio (SNR) in dB. When receiving an FM station the lower line of the display shows the RDS station identifier and time of day. has already been made several times with the same device, a high COM port number will be allocated, in this case it can be worth using the Windows device manager to change the port number, for example to COM2. To rename a port open the device properties with a double click on the rele- vant device; go to the ‘Port Setting’ tab, and then the COM port number will be found under the advanced settings. Change this to the desired value (even if marked as ‘in use") and then click on ‘OK' to put the new setting into effect. A warning may appear that the double allocation of the interface may lead to problems: confirm that you do indeed wish to use the new setting. The new COM port number will not immedi- ately appear in the device manager, but it will appear of you dose the device manager and then re-open it For the first test of the receiver you will need a short length of wire, about half a metre, to use as an antenna. After applying power (or plugging in the USB cable), the message ‘Elektor DSPradio' should appear on the upper line of the LCD panel, 1 he receiver will then automatically search for the first sta- tion in the FM band, starting at a frequency of 87.5 MHz. It is possible that a signal will be detected at 88,0 MHz, which Is the elev- enth harmonic of the microcontroller crystal frequency (eleven times 8 MHz), However, this will be rejected immediately, and the search will proceed to the next frequency. The display indicates the frequency of any station found in the format ‘88300’ (mean- ing 883 MHz); immediately next to the frequency the display (Figure 5 ) shows the signal strength at the antenna in dBuV and the slgnal-to-noise ratio, or SNR, in dB. The signal strength meter will also be driven: for testing purposes, a voltmeter can be con- nected at K2. The maximum input level of 80 dBpV will give an output voltage at K2 of 3.3 V, For permanent display connect an analogue voltmeter or a moving-coil meter with a suitable series resistor to K2. After a brief pause the lower row of the LCD panel will show the RDS station iden- tification string; shortly after that, the time of day as transmitted by the station. The potentiometer allows the output volume 14 7/8-2010 elektor RF to be adjusted, and the output is simulta- neously present on the audio jack socket and at the loudspeaker outputs. Turning the rotary encoder will tune the radio over the whole of the FM band to pick up other stations. The four buttons allow manual access to a range of functions such as sta- tion search, AM band selection and preset storage, DSPradio; a user's manual By default the radio starts up in the FM band. Using button S3 you can switch to the AM band, and S2 returns to the FM band. S4 starts an automatic station search, and finally S5 is used to store stations in the microcontroller's internal EEPROM, The radio uses standard predefined frequency bands, although with manual tuning orwith the automatic station search it is possible to tune to frequencies beyond the ranges nor- mally associated with these bands. The low- est frequency in each band is as follows: Longwave: 153 kHz Mediumwave: 549 kHz 75 m band: 3965 kHz 49 m band: 5800 kHz 41 m band: 7200 kHz 31 m band: 9400 kHz 25 m band: 11600 kHz 22 m band: 13550 kHz 19 m band: 151 50 kHz 16 m band: 17400 kHz FM: 87.5 MHz Firmware and PC control It is almost inevitable that when you have used a device for a while, there are things you wish you could change in its user inter- face. In this case it is possible: the underlying program, written using BA5COM, is avail- able in source code and as a hex file from the Eiektor pages for this project [1 ]. and there is a connector on the printed circuit board to allow in-circuit programming of the ATmegal68. So there is no reason why you should not modify the firmware your- self, If that is not your cup of tea, there is also a wide range of options for controlling the radio over Its USB port: in most cases al! you need is a simple terminal emulator pro- 52: Switch to FM band, 1 ' automatic search, A brief press starts an automatic station search with increasing frequency: a longer press (more than 0.5 seconds) starts a decreasing - frequency search. 53. Switch to AM mode and select between longwave and 1 6 m shortwave bands. In each case the radio tunes to the lowest frequency in the band. A brief press switches to the next higher band, while a longer press selec ts the next lower band. If 53 and S2 are used to switch between AM and FM, the previously-tuned station will be remembered and tuned to. This allows easy switching between a local FM broadcaster and a distant AM broadcaster. S4. AM automatic search. With a brief press, search in the direction of increasing frequency; with a longer press, In the direction of decreasing frequency. The automatic search will not stop at the end of a frequency band. The display is continuously updated with the current frequency: if a sufficiently strong station is found the search will slop, the dis- play showing the station frequency, signal strength and SNR. Also, the capacitance in the tuner circulL (in picofarads) will be shown in the upper right of the display. If no sta- tion is found, the search can be stopped by turning the rotary encoder (which switches to manual tuning) or by selecting a new AM band, S5: Station preset. Up to thirty FM presets and thirty AM station presets can be stored. A brief press of the button stores the currently-tuned station as a preset, and the num- ber of the new preset memory appears on the display, for example as 'M25 1 . A longer button press allows you to select which preset memory is to be recalled by turning the rotary encoder. Preset recall mode is exited by pressing 52, S3 or 54, or by a further press of S5* Avery long press (more than two seconds) transfers all preset stations to EEPROM, from where i hey can be reloaded at next power-up. After you have been using the radio for some time, it is possible that you will have accumulated a large number of presets, nor all of which will still he useful. The preset memory can be cleared by hol- ding down 55 for two seconds white power Is switched on to the radio. Using a terminal emulate! program you can associate a text label with each AM station, for example giving its name* that will be shown in the lower row of the display. gram, although you could also develop your own program on the PC side to interact with the radio in more sophisticated ways. Communication over the virtual COM port runs at 38.4 kbaud. Table 1 gives an over- view of the most important commands available for configuring and tuning the receiver from the PC. Among the options are configuring bandwidth, de -emphasis and soft muting, and storing frequencies and station names in the radio's preset memory. In the next issue we will look at more advanced antenna configurations and go into more detail regarding the features and subroutines in the radio's firmware, includ- ing suggestions for developing PC-based control software to gain access to the vari- ous features of the Si4735 as welt as direct control of the LCD panel. So, as you can see, the Eiektor DSP radio is no common-or-garden world receiver. Using PC-based software it is possible to add features that were not even thought of when the radio was designed, and, thanks to its open-source firmware and in-cir- cuit programming facility, any keen devel- oper can create his or her own style of user interface. (100126) 1 1 1 www. el e k to r. c o m / 1 0 0 1 2 6 (project pages inducting parts list, down- loads and other additional information) eiektor 7/8-2010 15 Clock Pulse Generator Ed Flier (The Netherlands) For many years the author has been approached by people who have managed to lay hands on an ‘antique' electric clock and need an alternating polarity pulse driver. This is immediately followed by the question whether an affordable circuit for this is avail- able. The design described here has been working very nicely for years in three of the author's docks. To keep the circuit simple and thus inexpensive, the author dispensed with automatic adjustment for summer and win- tertime, A 32,768 kHz oscillator is built around I CL XI is a crystal of the type that can be found in almost every digital watch, especially the cheaper ones. The frequency can be adjusted with trimmerCI if necessary. The dock signal is divided by IC1 and O to obtain a signal on CT=6 (pin 6) of IC2 with a frequency of one pulse per minute, 1C 3, A is wired as a divide-by-2 circuit to maintain a constant signal during each 1 -minute period. IC4.E and IC4.F buffer this signal, and IC4.D inverts the output of 1C4.F. When CT=6 of IC2 goes high, IC3.A receives a dock pulse and its Q output goes High, IC4.F and 1C4.D then charge C3 via R6 (1 MQ), and the output of IC4.C remains low forapproxb R2 Rt XI 32 768kHz 10 _9 'll 12 IS © CTR14 F 3 IC1 4 5 !G H X 6 CJt RCX + CT< 7 ;■ B 9 U 4060 12 1 -1 11 7_ 5_ 4_ 6_ U J1 _IS 10 %_ 2_ 3 16 © RCTR14 '0 3 IC2 4 CT=Q CT< >JT+ 4020 11 103 = 4013 IC4 = 40106 100301 11 16 7/8-2010 elektor mately 1 second. This drives T2 into conduc- tion, and with it T1 and T3, The resulting cur- rent through the clock coil causes the green LED to light up. When CT ^6 of IC2 goes high again after 1 minute, IC3.A receives a new dock pulse and its Q output goes Low. Now C4 is charged by IC4.E via R7 and the out- put of IC4.B is low for approximately 1 sec- ond, so the output of IC4.A is logic High. This drives T4 into conduction, and with it T5 and T 6 . The resulting current through the clock coil causes the red LED to light up. In this way By Fred Brand (Netherlands) A noise generator with a wideband output signal is always handy to have around when you're adjusting receivers and other types of HF equipment. The noise generator circuit described here uses the base-emitter junction of a transistor (in this case a BF199) operating under reverse bias. As a result, it acts as a Zener diode and generates a wideband noise signal. The noise signal passes through a 1-nF capacitor to the the clock is driven by pulses with alternating polarity. Diode D7 protects the circuit against reverse- polarity connection of the supply voltage. Diode D 8 is lit constantly when the supply voltage is present. Transistors T7 and IS pro- vide current limiting if a short circuit occurs in the dock mechanism. The peak pulse cur- rent can be increased by reducing the value of R16 (minimum value 22 ft). Diode D1 1 is a dual suppressor diode that clips any volt- age spikes that may occur This diode is fairly output connector (female BMC), which means that its low-frequency components do not appear at the output. The 47-Q resistor gives the noise generator an output impedance of nearly 50 Q. You can easily fit the entire noise generator in a small metal enclosure equipped with a BMC connector. The supply voltage is not critical; anything in the range of 8 to 15 V will do, mm-\) expensive, so it was omitted in the circuits actually built. This has not led to any prob- lems up to now, but it may be advisable with heavy-duty docks or multi-pulse docks. Note: this circuit Es only suitable for pulse- driven clocks that operate at 12 V. The circuit must be modified for models that operate at 24. 48 or 60 V. As these models are Jess com- mon, or In many cases ca n be converted to 1 2 V operation, this option Is not described here. (lOOJOVlJ a Simple RF Noise Source Intelligent AC Power Bar Ton Giesberts (Elektor Labs) This circuit is a modified version of the circuit found at f ! L The purpose of the circuit is to ensure that AC power is not supplied to devices connected to K3 unless the device connected to K2 is drawing sufficient power. Six power diodes connected in series with the load plugged into to K 2 generate a voltage drop of approx- imately 2 V if the load is switched on. This voltage drives a triac, which In turn supplies power to the load plugged Into l<3. CapacitorCl reduces the sensitivity of the circuit to spikes. To avoid premature switching due to power drawn by an AC line filter, stand-by operation or the like. R 1 can be used to raise the threshold level, ft will be approximately 10 watts with a 47 Q. resistor. 100390-11 but this is strongly dependent on the charac- teristics of the triac and the waveform of the load current. If the current is not sinusoidal or R1 is too small, the triac will trigger later and may not be able to supply sufficient power to K3, in which case the circuit will act as a sort of dimmer. Be careful when modifying the value of R1, Remember that the entire circuit is at AC line potential. Unplug everything before working on the circuit. The combination of C2, R3 and R4 forms a snubber network that sup- presses switching spikes, such as are produced by inductive loads. We selected an ST triac that can han- dle more current than the TIC225 used in the original circuit, but which still has a reasonably low trigger cur- rent. The BTA16-600SW is rated for 16 A con- tinuous or 160 A peak. Here the suffix *SW* is especially significant. This is what is called a logic level' triac, with a maximum trigger cur- rent requirement of only 10 mA, symmetric elektor 7 / 8-2010 17 in quadrants I and Ml. This is not true of the T1C225. If the trigger sensitivity is not the same in both quadrants and the trigger com dltions are marginal, the triac may trigger in only one quadrant. This results in rectifica- tion, which most equipment cannot handle. At minimum this will cause fuses to blow. The resistance of the snubber network con- sists of two resistors connected in series (R3 and R4). Standard resistors are often not suitable for use at AC grid voltages. Over the Crystal Tester Fred Brand (The Netherlands) This crystal tester is very straightforward. Fit- ting a crystal or switching on the supply volt- age generates a start pulse' resulting from the fact that the crystal briefly pulls the volt- age on the base of T1 low. This directly affects the operating point of the transistor via feed- back capacitor Cl . with the result that the transistorstarts oscillating. Resistor R2 limits the maximum operating current of the transistor, A 100-pF capacitor (C2) Is connected in parallel with R 2 for decou- pling, and capacitor C3 is used to prevent the longer term, spikes can also cause resistor fail- ure, which leads to triac failure. Pay attention to the maximum load cur- rent. The triac can handle around 1 A with- out cooling, but at this level it is actually too hot already. Fit a small heat sink if the current through the triac will be more than 0.5 A. The maximum allowable triac junction tem- perature is 125 C but in practice it’s better to work on the basis of 70 C T since high tern- DC voltage on the emitter from appearing at the output. An AC signal will therefore be present at the output if the crystal is OK. You can put together your own indicator circuit to make this visible, such as an HF probe connected to a meter or a transistor with an LED, Another tip: if you connect two LEDs in reverse parallel in series with the ground lead of the crystal, they will both light up when the crys- tal oscillates. (100332-u peratures shorten the life of semiconductor devices. The circuit is very compact and can probably be built into the power distribution bar, 1100390-!} [i] vvww. electronics wee k I y . c o m / b logs / gadget-freak /2 008/09 / flavio-plugs-into-smart-extens.html 3 +v Temperature Logger for the Fridge Temperature measured over 24 hours 10 2 15:00 13 00 21:00 00 00 03:00 06:00 09 00 12:00 15:00 Time [hh:mm] Fons Janssen (The Netherlands) Most National Health Departments and Coun- cils seem to agree that the recommended fridge temperature should be between 2 Q C and 7 C (35 ^F to 44 : F). The lower the tem- perature, the slower the growth of bacte- ria and the longer perishable foods will keep fresh. You can check the temperature with an ordinary thermometer, but that only tells you what the temperature is at that particular time. But what happens to the temperature during the whole day? To get a good idea of the temperature over a period of time the D51921Z made by Maxim comes in very handy. It Is an autonomous temperature logger in an i Button package Ml, This is a strong metal button the size of about four small coins put on top of one another. The DS1921Z hasan internal temperature sen- sor (range: -5 C to +26 1 C, accuracy: ±1 C), IS 7 / 8-2010 elektor 4 Kbit memory, a real-time clock and a bat- tery, which lasts between 2 and 10 years, depending on the log frequency. The iButton can log temperatures at a rate between once per minute up to once every 255 minutes. The memory has room for 2048 values, which means it's possible to store a measurement every minute fora full day (24*60=1440). The (free) 1-Wire viewer software makes It a piece of cake to configure the iButton and to read the results after the measurements are complete. Apart from the iButton you also need a USB dongle (the DS9490 made by Maxim) to connect the iButton to the PC. In the graph you can see the result of the measurements during a 24-hour period, where one IButton was placed in the door and another at the back of the bottom shelf. It is clear that there is a temperature variation of about 2 to 3 C in both places as a result of the thermostat in the fridge. Accord- ing to the advice of the Health Department the door wouldn't really be cold enough to store perishable items in this case, whereas it would be safe to store them at the back of the bottom shell (091091) Daggerboard Position Detector (Cl Hermann Sprenger (Germany) In sailing regattas it's handy to have a dag- gerboard that can be raised and lowered ver- tically. As the winding handle or positioning motor needs to rotate the spindle of the lift- ing device some 100 to 150 times throughout its full range it would be extremely handy to have a quick idea of its current position. An electronic count of the number of revolutions would be ideal Thank goodness most sailors now have a 12-V supply available! To get this to work you need to apply white a nd black markings to the spindle, each cov- ering half of the circumference. Next, mask off two electric eye devices (reflected light sensors) next to one another (approximately 10 mm apart). For secure detection both sensors should be positioned not more than 5 mm from the paint markings. The markings to be read by the sensor should be displaced laterally, so that the direction of rotation can be recognised in addition to the number of revolutions counted. At the heart of our circuit is a P1C16F628 from Microchip, which as usual can be bought ready programmed from Elektororyou can do this bit yourself by downloading free firmware (for details of both see l 1 !). At pins 1 of the two reflected light sensors IC3 and IC4 we need to ‘see’ more than 2,0 V from the white segment and less than 0.8 V from the black mark (with an operating volt- age between 4.5 and 5.5 V). The two signals detected are taken to plug connector along with the operating voltage and ground. It’s convenient if you also provide a connector from the microcontroller as well, so that the sensor and the controller board can be linked by a test lead. elektor 7/8-2010 19 The multiplexing of the three seven-segment displays is programmed at a rate of 1 00 Hz, Acceptable values for the revolution count are between 0 and 140. If the count exceeds or fails below these limits, then the counter is not incremented. The RESET key S2 sets the counter back to zero, jumper K 2 enables you to reverse the direction of counting. The Heinz Kutzer (Germany) The majority of hand-held digital volt meters use an LCD screen and are powered from a nine voit battery. Inside is most probably an 1CL71 06 chip (or something compatible). This takes care of measuring the input and driv- ing the LCD, This 1C is very popular and can be found in other laboratory and homebrew equipment where it offers a simple solution for both measuring current/voltage and driv- ing the display. So far so good, there is how- ever one Feature of this device which needs careful consideration. The power supply to the chip (both the positive and negative con- nection) must not have any direct connection to either of the two measuring input termi- nals. It requires floating supplies. This is not a problem for battery powered equipment but needs more thought when the ICL7106 is fit- ted into mains powered equipment. count is retained if the operating voltage is removed and is loaded again when next pow- ered up. The source code can also be downloaded from the website mentioned above, making it pos- sible (for instance) to define alternative coun- ter limit values (the maximum value is defined The simplest, most expensive solution is to use two independent power supplies in the equipment. A battery could also be used as an isolated supply but in a mains powered device it would seem a bit out of place and inconvenient. In this case the term 'floating supplies’ means that it is possible to have two separate DC lev- els, This level of isolation can be achieved with capacitors to separate the two DC supplies. Back in 2003 we published a circuit in the July / August edition of Elektor (circuit number 75) which used a NE555 It. Unfortunately this design required a supply voltage upwards of 10 V. If the DVM module is fitted to equip- ment which only uses a 5 V supply (as is often the case) the circuit will not be of much use. The author has solved the problem by mod- ifying the original circuit, using a hex Sch- in the line #define max 140). For compiling the code you can use the CC5X compiler, of which there is a free version (www.bknd. com/cc5x). [1] www, elektor.com/Q803O7 3 mitt trigger inverter type 74HC14N instead of the NE555. One of the inverters generates a sguare wave of about 75KHz. The remain- ing five inverters are wired in parallel to pro- vide more output drive current for the voltage multiplier stage, DC isolation is provided by capacitors C2 and C3, A classic voltage multiplier configuration is made up of capacitors and diodes. The cir- cuit generates an output of around 8,5 V at a load current of 1 mA, This is sufficient to power the DVM chip. The 5 V supply for the circuit must be stabilised. The values of the input voltage di vider resis- tors R2 and R3 are independent of the chip’s power supply and must be selected according to the desired measurement range. (ogo*74) Ground-free DVM Module Supply from 5 V IC1.F 20 7 / 8-2010 elektor rv S AVR 8 -Bit Main PCB Board: XGS Gamepad Controller /' l325+ Page Printed Manual. ^Atmel AVR ISP MKII Programmer. *£^_9V Power Supply & A/V Cable, jfe' - PC Serial Port to XGS Converter DVD-ROM * W { 1GB Micro SD Card + Adapter Bonus : eBooks on Hardware, Game ConsojeDes Ig n , and Mo re ! The: Most Complete Atmel MEGA AVR Dev Kit available! WWW.XG AM WWW. elektor. com Visit our website for more details on our new .program EUROPEAN DISTRIBUTOR wwwteltifn.eii PhfiW-MAWlU pi CO www-picotech.com/scope2012 THE HIGHEST PERFORMANCE PC OSCILLOSCOPE 4 Channel oscilloscope with spectrum analyzer Built-in arbitrary waveform generator CAN bus decoding Ad va need tr i gge r I ng Mask limit testing Full math and measurement functions High Speed USB connection Easy-to-use software SDK for major third party applications Five-year warranty All included, from only £2995 350 MHz BANDWIDTH 5 GS/s SAMPLING UP TO 1 GS MEMORY rca elektor 7/8-2010 21 Michael Hoelzl (Germany) This circuit is a simple but high-quality pream- plifier using a DS1882 digital potentiometer, a device specially designed for audio applica- tions, The potentiometer is controlled over an i 2 C interface by an R8C/13 microcontroller. The main features of the design are its remote control and lack of moving parts. The circuit is controlled by two buttons (vol- ume up and volume down) and an infrared receiver connected to the microcontroller. The software in the microcontroller, written in C. is designed to interpret RC5 codes and supports the following commands: 22 7/8-2010 elektor -volume up: - volume down; - mute. Other commands could of course be added. The audio signal arrives via phono sockets and is taken to the digital potentiometer via coupling capacitors. The potentiometers are configured as voltage dividers with an over- all resistance of 45 kfi. The wiper position is adjusted over the PC interface. At the output of the potentiometers there are two operational amplifiers in non- inverting configuration to buffer the high -impedance attenuated signal They provide a gain of 5.7. The capacitors in the feedback network are dimensioned to provide a signal bandwidth of around 150 kHz with unloaded output. The value of the output coupling capacitors depends on the input impedance R fn of the following power amplifier stage. As a rule of thumb a value of C=1/(T00R in ) is suitable, and so the value of 1 0 pF shown i n the ci rc u it dia- gram is easily large enough in most cases. In some situations St is useful to connect the outputs to ground via high-value resistors to provide a definite DC level. The ±5 V supply voltages for the opamps and the DS18S2 are decoupled using 100 nF capacitors. The lower- cost NE5532 opamp can be used instead of the specified device without noticeable signal degradation. All unused pins on the microcontroller are taken to ground. As has already been described in detai I i n Eie- ktor HI, the RSC includes a serial debugging interface and boot code that allows a pro- gram to be downloaded into its flash ROM. The serial connections are brought out at Kl. To connect to a PC an RS232~to -TIL level adaptor (typically incorporating a MAX232) is required: to connect via a USB port, use a USB-TTL cable l 2 l TxD from the PC should be connected to RXD1 on the R8C, and RxD on the PC should be connected to TxDI on the R8C.J2 must be fitted for programming, tak- ing pin 28 (MODE) on the R8C to ground. Then apply power to the circuit (for a power- on reset) or press reset button 54, The pro- gram FlashSTA can be used for program- ming: the web pages accompanying this article D1 have this software available for free download, along with the firmware for the microcontroller One possibility for expansion would be to add an input selection switch, which could be implemented using an analogue switch 1C. The 1C could also be controlled over the existing PC bus. The structure of the RC5 remote control code has been described previously in Eiektor: see the free 'RC5 Code' download at l 4 l The pro- tocol specifies a five-bit address for the type of device to be controlled remotely (such as a television or VCR). In the author's set-up the preamplifier was controlled using the remote control from a Hauppauge TV card, and so the firmware was configured to use the address reserved for TVs (*00000*). If a different remote control is to be used, the address In the firmware must be modified accordingly. The address appears in the file ‘preamp. h“ as Adeline IR_DEV_ADDRES5 34V, where the value 341 is the Manches- ter-coded form of the address ’00000', The coding procedure is relatively straightfor- ward: with the address written in binary, convert each zero Into *01 ’ and each one into HO'. For the address ‘00000 1 this results in *01010101011 For convenience the com- mands and addresses are converted into dec- imal, In this case giving 341, A timer module in the RSC is used for dock- ing out the RC5 signal, and the whole process is kicked off using an interrupt. It is worth noting that the infrared sensor does not work reliably if placed near to fluo- rescent or low-energy fight bulbs, as these emit a considerable amount of light in the infrared part of the spectrum. ( 090976 ) Car Alarm Sound Booster Hagay Ben-Elie (Israel) For car alarms, emphasis should be put on hearing the audible alert and identifying It as belonging to your ‘wheels'. Unfortunately, modern car alarm systems seem to have more or less the same alarm sound — especially if they are from the same brand. Also, to comply with legal noise restrictions, the alarm sound is not always loud enough to be heard if the car ls parked down the road. The circuit shown here Is designed to help boost the alarm sound by also activating the car’s horn(s) when the alarm goes off. Internally the car alarm system often provides a signal that activates the (optional) engine immobilizerand/or volume (ultrasound) sen- sors. This signal usually goes tow upon sys- tem triggering and high again when the alarm system is deactivated. The alarm activation signal is fed to the cir- cuit through D1, When in idle state, TVs gate is High and consequently the FET conducts. keeping power FET T2 firmly switched off. When the system gets an active low signal, T1 switches off allowing timing capacitor C2 to charge via R2. About 15 seconds later, when the voltage across G2 is high enough, T2 starts to conduct and relay RE1 is energized. This, in turn, provides the required path For the lights flashing’ signal to energize RE2 and feed battery power to the car s horn(s). When the alarm system is turned off the acti- vation signal returns to High* T1 starts to con- duct and rapidly discharges C2 via R3. T2 is then cut off and RE1 is de-energized. Diode D2 suppresses back EMF from REV eiektor 7/8-2010 23 The circuit draws less than 2 mA when idling. When activated the circuit's current con- sumption is virtually that of the RE1 coil RE1 is any simple SPST or SPOT relay, capable of switching about 0.5 A (at 12 V). The coil rat- ing is for 12 VDC and a current requirement as low as you can find. Fuse FI should be a slow blow type and rated about twice RE Vs coil current. The BS1 70 in position T2 can sink a continuous current of about 0.5 A. However, a value of 1*2 A pulsed is specified by Fairchild for their devices. To keep the FET’s d-s current due to C2 discharging within safe limits, R2 may be increased. C2 decreased and R3 increased, all proportionally. A factor of 2 will keep the FET out of harm s way with maybe a slight change in the 15-second delay and the sensitivity of the circuit. Cl is used as a smoothing capacitor and F2 should be rated in accordance with the horn(s) maximum current draw. Caution. The installation and use of this cir- cuit may be subject to legal restrictions in your country, state or area. Shunting Lights for DCC Locomotives I Dr Stefan Krauss (Germany) Digital decoders in model locomotives usually have two outputs for lighting functions. One switches the front lights for forward travel, and the other for reverse travel. If the loco- motive has red rear lights, they are also con- nected to the two outputs. Many digital decoders include function map- ping capability, which allows the switch func- tions to be assigned as desired. Forexample, with function mapping you can control the lighting not only for normal running, but also for shunting yard operations with the lights lit at both ends of the locomotive. However, m case of model locomotives fit- ted with rear marker lights it is necessary to switch off the red lights for shunting opera- tion. This can be done by connected the rear lights to their own, suitably programmed decoder outputs. Unfortunately, decoder out- puts are a scarce commodity that we would rather use for other tasks, such as switchabie cab lighting. The remedy here is a simple circuit that causes the red rear fights to be disabled when both light outputs are active (on). The circuit is inserted in the leads to the two sets of rear lights, and it essentially consists of a bit of logic circuitry formed from the four NAMD gates of a 74HC0Q, which drive the LEDs directly. Series resistors R6 and R7 as well as R1 are dimensioned fora current of somewhat more than 10 mA. Pull-up resis- tors R4 and R5 can be omitted if incandescent lamps are used for the rear lights, as indicated here. However, they are necessary when LEDs are used. The combination of Zener diode D1 and resistor R1 provides a 5-V supply voltage for the logic 1C, An alternative circuit with transistors T1 and T2 For driving incandescent lamps used as rear lights is also shown here. As the transis- tor stages act as inverters, with this version of 2 A 7/ B-2010 elektor the circuit a 74HC02 (quad NOR) must be used for IC1 instead of a 74HCGQ (quad NAND), The value of R1 can also be increased to 2.2 kft to reduce the power dissipation. Connect the front and rear (tail) marker lights as follows: Locomotive front marker fights: D 2 and 03 (LED version) or LA4 (incandescent lamp Berto Aussems (The Netherlands) The Zoom H2 is a popular portable audio recorder. This recorder can record four tracks simultaneously, but unfortunately this only applies to the signals from the four built-in microphones, The modification described here also lets you record four signals at line level. For this we add four phono sockets to the recorder, where the signals are attenuated by 40 dB via a resistor network. The capacitor blocks version). Locomotive tail marker lights: D4 and 05 (LED version) or LA3 (incandescent lamp version). The circuit can easily be builton a small piece of prototyping board and fitted in the loco- the supply voltage for the electret micro- phones, which would otherwise appear at the line inputs, which is obviously not desir- able. Two switches are used to select either the line input or microphone as the source. A short YouTube movie 14 shows all the steps required to modify the H2. (idoagg) motive. If you’re an old hand with a solder- ing iron, we suggest using an SMD device for ICl and making the connections with short pieces of enamelled copper wire; the entire assembly can then be packaged in a length of heat-shrink tubing. (090419-1) 8-channel DTMF Link: Encoder +5V Angelo La Spina (Italy) Generated millions of times every day by our telephone keypads, the eight DTMF frequen- cies were chosen so that the harmonics and intermodulation do not generate significant in-band signal levels. The signal is encoded as a pair of sine waves, ensuring that no fre- quency is a multiple of the other and the sum and difference between two frequencies does not match any single tone — and that's why DTMF sounds so ugly! The DTMF encoder circuit shown here is based on the HT920QB tone generator device produced by Holtek and distributed by Futurlec (www.futurlec.com) among others. The encoder is complemented by a decoder elsewhere in this publication* The HT2900B is supplied as a nice old fash- ioned 14-pin device* It can be instructed by a microcontroller to generate 16 dual tones and (in serial mode only) 8 single tones from the DTMF pin output, its S-pin ‘younger brother’ the HT9200A provides a serial mode only whereas the HT9200B contains a select- able seriaf/parallel mode interface for various applications such as security systems, home automation, remote control! through tele- phone lines, communication systems, etc. A 74HC148 S-to-3 priority encoder is used to convert the ’keypad’ information from S1-S8 into 3-bit tone selection words the HT9200B wants to see at its input. The ninth switch, S9. is connected to input D3 on the encoder chip. Pressing one of the switches SI-58 gen- erates a complementary 3- bit binary word at outputs A0 t A! . A2 of ICl , IC2 then generates the dual tones accordingly to these binary codes. Pressing SI -58 generates the dual tones for DTMF digits C. B. A, \ 0, 9 and 8. By press- elektor 7/8-2010 25 ing and holding down S9 the DTMF digits 7. 6. 5, 4, 3, 2, 1 and D are generated. To generate the eight single frequencies accu- rately a 3.58 MHz crystal quartz is connected to pin 2 and 3 of IC2. Pin 13 of the HT9200B supplies a DTMF signal of about 150 mV at a 5 K£l load. Pull-up resistor array R2 may be omitted it you substitute the 74HC148 with a 74L5148. R1 must be present in that case, othei wise it can be omitted. The circuit consumes about 2 mA from a regu- lated 5 V supply. It should be easy to build on a small piece of prototyping board. (090964} Ton Giesberts {Elektor Labs) The indicator described here is spe- cifically designed for adjusting the dynamic limiter described elsewhere in this edition and checking whether the maximum level of the reference voltage (PI) needs to be modified. Here we use a 4-to-16 decoder 1C (type 4514) to monitor the state of the four-bit up/down counter in the limiter circuit. This 1C can be powered from the ±8 V supply voltages of the limiter. The limiter board has a 6-way connector (K5) that provides access to the four counter outputs and the sup- ply voltages. Connector K1 of the indi- cator circuit can be connected to Kj on the limiter board. One output of the 4514 goes high for each unique 4-bit combination on its inputs, while the other outputs remain logic Low. A separate current-limiting resistor is connected in series with each LED, It was not possible to use a com- mon cathode resistor here because most LEDs have a maximum reverse blocking voltage of only 5 V. while the supply voltage here (16 V) is a good deal higher. The 16 LEDs arranged in a row provide a ‘fluid’ Indication of the control process. You can enhance the display by using dif- ferent colours for the first and last LEDs, such as red for D1 (maximum gain) and green for D16 (minimum gain), with yellow for the rest of the LEDs, While observing signals from various sources (TV set, DVD. media player, etc.), you can easily use the 16 LEDS to monitor the behaviour of the limiter and adjust the setting of potentiometer PI in the limiter circuit, it must be set such that D16 only lights up at the maximum sig- nal level. If this is not possible and D16 remains lit a good deal of the time regardless of the position of PI, It will be necessary to increase the value of PI . Of course, it is also possi- ble to adjust PI so the strongest sig- nal source extends slightly above the control range of the limiter. This circuit can easily be assembled on a small piece of prototyping board. The current consumption is around 4 mA, { 100354 - 1 ) 8-channel DTMF Link: Decoder Angelo La Spina (Italy) In the decoder designed for the DTMF Link project a Holtek HT9170B does the main job. The natural counterpart of the HT92G0B used in the associated encoder (described else- where in this publication), the HT9170B is a Dual Tone Multi Frequency (DTMF) receiver with an integrated digital decoder and band- split filter functions. Then 1C uses digital counting techniques by means of a 3.58 MHz crystal to detect and decode all the 16 DTMF tone pairs into 4-bit words. Highly accurate switched capacitor filters are employed to divide DTMF signals into low and high group Signals. A built-in dial tone rejection circuit is provided to eliminate the need for prefilter- ing. The HT9170B is pinto pin equivalent to the famous (and dearer) MT8870 from Mitel. Both DTMF decoder chips can be ordered from Futulec (www.futurlec.com). The table shows the correspondence between the frequency pairs and the 4-bits words obtained from the decoder output. in the circuit, a CD4099 acts as an 8-bit addressable latch. Data is held on the D input, and the address of the latch into which the data is to be entered is held on the AO, A1, and A2 inputs. When the Enable input is taken Low. the data is copied through to the addressed output. The data is stored when the Enable input transitions from logic Low to High. Ail unaddressed latches will remain unaffected. With Enable logic High, the device is deselected, and all latches remain in their previous state, unaffected by changes on the data or address inputs. To eliminate the pos- sibility of entering erroneous data into the latches, Enable should be held High (i.e. inac- tive) while the address lines are changing. When the DTMF decoder receives a valid tone pair, its STD output goes High; otherwise it remains Low. Since the Enable input of iatch IC2 needs a negative-going pulse for strob- ing’ an output, the logic condition has to be reversed by means of transistor T1. The state of the individual Q0-Q7 outputs 26 7/8-2010 elektor (brought out to pins on Kl) represents the active/inactive active state of pushbut- tons S1-S9. Only one of the Q0-Q7 outputs switches its logical state. Actually the corre- spondence is In reverse order, j.e. by pressing 51 on the encoderoutput Q7 will be affected 52 will affect Q6, S3, Q5 and so on until S8 which will control the QO output. The output signals on Kl have CMOS swing and the maximum output sink/source current specification oftheCD4099 must be observed - the specification will differ between man- ufacturers so find that datasheet in case of doubt. As examples that will work safely ln most cases . low-current LEDs with com- muned cathodes may be connected up to Kl via 2.2 kfi resistors. The same value for the LEDs in type riL199optocoupiers, while 470 a is recommended fora MOC3020M. Whatever you connect up to Kl, make sure the CD4099 outputs are not overloaded. Like the encoder, the decoder can be built on prototyping board, but feel free to desiqn your own PCB. The encoder/decoder combination may com- municate either via a 2- wire line (of consid- erable length), wirelessly using an approved audio transmitter and a receiver, or over AC powerlines using suitable interfaces. |T0007]j 10011 [>CHhS 3 I ?□ 3 11 5 12 7 12 9 14 11 T5 13 1 15 T0QO73- tt 1 209 Hz 1336 Hz 1477 Hz 1 633 Hz Rapid Test and Measurement Leo Szumylowyc^ (Germany) Pictures are worth a thousand words, so this will be the shortest ever article for an elec- tronics magazine. Recently our overweight cat decided to dive-bomb my carefully sorted tray of LEDs. The result was a thousand or more LEDs of 40 different varieties all mixed up together! The photo shows my quick and duty test setup, which you can use with a var- iable power supply with digital current and voltage displays. The paperclips are the standard size, nickel P ated {not plastic!). You can solder banana plugs or other connectors to the little test board's test leads. A nice refinement would be small rubber feet to avoid problems on a conductive work bench surface. (ogiagfig) Outdoor Lighting Controller Ha raid Schad (Germany) When you step out of your brightly-lit house mto the darkness, it takes a whi/e for your ■ iston to adjust. A solution to this problem s this outdoor light with automatic switch- - ; . As a bonus, it will also make it a little bit easier to find the keyhole when returninq ate at night. e sktor 7/8-2010 often no mains neutral connection is avail- able at the point where the switch-off timer is to be installed, which makes many circuit arrangements impractical. However, the cir- cuit here is designed to work in this situa- tion. The design eschews bulky components such as transformers and the whole unit can be built into a flush-mounted fitting. The 3 circuit also features low quiescent current consumption. The circuit is started by closing switch (or pushbutton) SI. The lamp then immediately receives power via the bridge rectifier. The drop across diodes D5 to DIO is 4.2 V, which provides the power supply for the delay cir- I 27 © — ♦ SI CQY80N N & R1 TRil !C1 f 5 6 m >:a IC2 DT A2 QTB16-6QGB 4V2 MOC3041M 01 ...DID = 1N5408 LAI Dll 6V2 R2 R3 F4 Cl ■170 li 10 V RESET 10 _9 11 C2 Zn2 12 R7 16 © CTRT4 3 IC3 4 5 C 4 1G fix 3 6 6 cx 7 J4 □/vy + CTi fl 13 9 1 5 Ui 1 CT=0 12 2 — 4fifin 13 3 *4. til t _ L^_r I ^03 ^oon li 13 BC547 1N5906G LAI ON: 50Hz 2fnJn73 SON? 2mfnie c200W 030633 - 11 cult itself, built around the CD4060 binary counter. When the switch is opened the lighting sup- ply current continues to flow through Tril. The NPN optocoupler in the triac drive cir- cuit detects when the triac is active, with antiparallel LED D1 keeping the drive sym- metrical, The MPN phototransistor inside the coupler creates a reset pulse via T1, driving pin 12 of the counter. This means that the full time period will run even if the circuit is retriggered. The CD4060 counts at the AC grid frequency. Pin 3 goes high after 2 13 clocks, which corre- sponds to about 2.5 minutes. If this is not long enough, a further CD4060 counter can be cas- caded. 12 then turns on and shorts the inter- nal LED of opto-triac IC2; this causes Tril to be deprived of its trigger current and the light goes out. The circuit remains without power until next triggered. The circuit is only suitable for use with resis- tive loads. With the components shown (in particular in the bridge rectifier and D 5 to DIO) the maximum total power of the con- nected bulb(s) is 200 watts. As is well known, the filament of the bulb is most likely to fail at the moment power is applied. There is lit- tle risk to Tril at this point as it is bridged by the switch. The most likely consequence of overload is that one of diodes D1 to D 6 will fail. In the prototype no fuse was used, as it would not in any case have been easy to change. However, that is not necessarily rec- ommended practice! Circuits at AC line potential should only be constructed by suitably experienced per- sons and all relevant safety precautions and applicable regulations must be observed during construction and installation, (090633) Front Panels the Kai Riedel (Germany) Putting professional-looking legends on front panels is a problem for many electronicists. Transparent plastic films ought to work but the high-gloss surface of most of the types available in shops make them unsuitable for our purposes. Ideally we want something with a textured finish on the top (front) surface, in order to avoid undesirable glints and reflec- tions. In professional circles a popular choice is the 'Autotex InkJet' film produced by Mac- Dermid 01 and if you click on the Where To Buy Mouse Mat Way RF-FreQuenc/counter D’SfJtoj Tinte PneSEakF Zero Lnvel - Lcwl * CaOtwalurt link there’s a contact form that will put you 3 In touch with a distributor. People looking for only small quantities will find the price rather high, however. A more attractive alternative Is mouse mat film, as used in the Fofex DIY mouse mat kit I 2 1), Using this special film (lightly textured on one side, A4 format) you can print your design with an inkjet printer to achieve excel- lent front panel overlays quite rapidly. To pro- duce the end product the author uses the fol- lowing process: * Design the fayout of the front panel in a 28 7 / 8-2010 elektor graphics program (e,g. Corel Draw). ♦ Print the mirror image of this design onto the reverse side of the special film. * Leave ink to dry 24 hours and spray the rear side with a light grey undercoat (universal primer in aerosol cans from DIY shops). • When the paint Is completely dry apply double-sided adhesive tape to the reverse side of the film. Conrad Electronics D1 order code 529478-62 Is Ideal. * Create cut-outs and holes for displays, switches and operating controls with a craft knife and hollow punches (achieved commercially with plotter or laser cutters). * Fix film to front panel. This method can also be used for making professional-looking front panel lettering on industrial prototypes. (090426) m www. macdermidautotype.com/auto- ty pe.nsf/webfa mi I ieseu rope/ AUTOT EX [ 2 ] www.amazon.co.uk/ and enter u Folex mouse mat kit" 13] www.conrad-uk.com PIC RJ-45 Cable Tester r il Vce Pascal Coulbeaux (France) This RJ-45 cable tester automatically checks cable continuity and tests the connection configuration. Each of the eight connections is checked independently and short-circuits are detected. The circuit can be built using either a PIC16C628 ora PIC16F72. This microcon- troller was chosen, as it has 22 input/output pins. Each Rj-45 socket uses eight input/out- put pins, i.e. 16 in all, plus two I/Os are used for two LEDs. The tester described Is built using the PIC16C62B. which can work with a supply voltage of 3 V, justifying the use of a power unit with two batteries. Unfortunately, this microcontroller can only be programmed once. It Is possible to use the PIC 1 6F72, which Is reprogrammable and pin-compatible, but you'll need to use a three-battery power unit to achieve a voltage of 4,5 V. The clock circuit is formed by Rl/Cl* a cheap solution, since we don’t need an accurate dock frequency. The circuit Is started using push-button ??BP t the power is maintained and controlled by transistors T3 and T2. It stops automatically* after a delay generated using TimerO, When TimerO overflows, an interrupt is produced which leads to pin RAO going low, and in this way transistor TQ 2 turns off, followed by T3. The LED bargraph allows us to follow the test- ing of each connection. The first LED (pin 1). controlled by RA2, lights if the cable is good. The second LED (pin 2), controlled by RA3, lights if the cable has a wiring or continuity fault. Both LEDs light if the cable has a short- circuit. The other eight LEDs show how the cable is connected. If the cable is all right, we see a left>nght chaser; but if the cable is crossed over* we get a back-and-forth chaser — just like Kltt in the cult TV series *KnightriderL The software in assembler Is available on I U www . e I e kt 0 r c:o m / 0 ■ > i * 64 3 (090643-1) elektor 7/8-2010 2ty 3D LED Pyramid Lothar Coede (Germany) The author H just wanted to do a bit of micro- controller programming'. However, the project rapidly grew into this impressive and visually attractive pyramid. The circuit con- sists essentially of a specially-sawn printed circuit board, 23 LEDs and a microcontroller. Despite the fact that the microcontroller is a rather modest Atmel ATtiny2313, the author nevertheless has found room in the 2 KB flash memory for 1 6 different light sequences. The 23 LEDs are divided into three groups. The lowerand middle sections consist of eight LEDs, while the upper section has just seven. The microcontroller has only 20 pins, and so it is not feasible to provide a direct individual drive for each LED, The mul tiplexingapproach adopted uses just eleven output port pins. Buffer transistors are used to increase the cur- rent drive capability of each output. The software was written in assembler and can, as usual, be downloaded from the Ele- ctor web pages accompanying this arti- cle I 1 ! as either source code or as a hex file. The printed circuit board layout files are also available from the same piace, as well as a link allowing purchase of ready-made boards and pre-programmed microcontrollers. Populating the printed circuit board is straightforward: there are some surface- mount components to be soldered, but 3 space is not tight. For best results, it is best to choose LEDs with the widest possible view- ing angle so that the pyramid looks its best even when seen from the side. The author 30 7 / 8-2010 elektor used type 10 1296 orange LEDs from Osram, which have a viewing angle of 160 A six- way connector fs provided to allow in-sys- tern programming (ISP) of the microcontrol- ler. The configuration fuses are set to enable use of the internal MHz clock source, which is divided down to 0,5 MHz by an internal divider. If the fuses are not correctly pro- grammed the light sequences wilt run too quickly, too slowly, or even not at all! When everything is working, take an 11 cm length and a 5,5 cm length of 1.5 mm 2 solid Gerard Seuren (The Netherlands) The author wanted a very cheap and simple alarm for some of his possessions, such as his electrically assisted bicycle. This alarm is based on a cheap window alarm, which has a time-switch added to it with a 1-minute time-out. The output pulse of the 555 replaces the reed switch in the win- dow alarm. The 555 is triggered by a sensor mounted near the front wheel. In combina- tion with a magnet that is mounted on the spokes. This sensor and the magnet were taken from a cheap bicycle computer. The front wheei of the bicycle is kept unlocked, so that the reed switch closes momentarily when the wheel turns. This triggers the 555, which in turn activates the window alarm. The circuit around the 555 takes very little current and can be powered by the batteries in the window alarm. There is just enough room feft copper wire and solder one end of the shorter piece to the middle of the longer piece to make a T shape. Pull the printed circuit board spiral apart so that the T-shaped wire assem- bly fits underneath, and then solder it to the two pads as shown in the photograph. Fine- bore brass tubing can also be used instead of sofid copper wire. As well as the ISP connector a US8 interface is provided, whose job is solely to provide a 5 V supply. An external 5 V mains adaptor would do the job equally well. Two jumpers affect inside the enclosure of the window alarm to mount the time-switch inside it The result is a very cheap, compact device, with only a single cable going to the reed switch on the front wheel. And the noise this thing produces is just unbelievable! After about one minute the noise stops and the alarm goes back into standby mode. The bicycle alarm should be mounted in an inconspicuous place, such as under neath the saddle, inside a (large) front light, in the battery compartment, etc. Hopefully the alarm scares any potential thief away, or at least it makes other members of the public aware that something isn't quite right, (100251) Caution, The installation and use of this cir- cuit may be subject to legal restrictions in your country, state or area. the behaviour of the fight pyramid: JP1 deter- mines whether the sixteen sequences follow one another in strict order or at random; and |P2 determines whetherthe light patterns are displayed or whether all LEDs will be con- tinuously lit, SI is a reset button, which will come in handy if you wish to experiment with modifying the software. ( 090940 ^ [ 1 ] www.elektor.com /090940 3 +4V5 Cheap Bicycle Alarm Phase Coupler for PLC or XI 0 Network Christian Tavernier (France) As long as the AC power grid does not carry too much interference, power line carrier communications (PLC) works very well in homes with single-phase AC. Unfortunately, this Is not the case with a 3-phase installation. If thetransmitterand receiverfind themselves on different phases, they cannot communi- cate, The only coupling between the phases is actually at the supply company’s transform- ers, and as the high-frequency signals used for the powerline carrier cannot travel beyond the user’s electricity meter, they never reach the coupling point and so no coupling takes place. In this event, it is necessary to use a coupler fitted before the meter \ Such a coupler is very easy to build; the cir- Phi FI cuit involves just four capacitors which form a high-frequency bridge between the phases. Construction is perfectly simple, but for safety reasons it is vital to use Class XI capacitors designed for use on 440 VAC grids (e.g. Farnell # 1 166428), In theory, the fuses are not strictly essential, but they do offer additional protec- tion in the event of a capacitor’s failing. The PCB I 1 ) fits into a case designed for use on DIN rail, which lets you install the circuit into any modern distribution box. The case to use is a 2-module wide Boss type BE350/605T (Farnell# 1171699), Take the usual precautions when connecting up to the AC grid — after being sure to turn off the main switch, of course! The circuit will work right away. The only problem that may arise is where the AC powerline carrier transmitter is connected to phase 3 in the dr- elektor 7/8-2010 31 cuit. Capacitor C3 then has an adverse effect on the high-frequency signals generated by the transmitter* as it will tend to short them out. In this situation, the simplest solution is to disconnect the coupler's neutral terminal connection, which removes this capacitor from the circuit. ( 061170 - 1 ) ' The installation of this circuit is restricted to qualified electrical engineers. The circuit may not work i n a 1 1 countries or a rea s . 1 1 1 www.elektor.com/081 1 70 Digital Thumbwheel Switch Per Stegelmann (Denmark) Thumbwheel switches are remarkably expen- sive and always playing hard to get. Here's a cheapen digital equivalent with the ability to remember the value it was set to, ft is program- mable to different modes such as inverted or non-inverted BCD code output, programma- ble READ pin active level, and the choice of hexadecimal or decimal BCD count The main elements in the circuit are an ATtiny2313 microcontroller with built-in RC oscillator, a 7-segment LED display (you choose the size and colour!) and two small pushbuttons. All functionafity of the circuit is within the firmware of the microcontroller. The project source code files may be down- loaded free from PL Examining the code youll discover the following functionality based on jumper settings. JP1 - on: READ input PD4 responds to active High. JP1 = low: READ input PD4 responds to active Low, When the thumbwheel value Is read, the UP/DOWN switches are effectively disabled* )P2 ~ on: inverted BCD code, JP2 = off: standard BCD code, JP3 = on: hexadecimal count (G-F) with auto rollover, JP3 = off: decimal count (0-9) with auto rollover, JP4 - on: decimal point ON. jP4 = off: decimal point OFF. When the thumbwheel switch value hasn't changed for a bout 1 0 seconds, the current value is stored into the microcontroller's internal EE PROM to be recovered at power-up. The BCD output pins are then changed to inputs and tri-stated when the READ input (PD4) is not active. This allows multiple out- puts of a number of these 'ersatz' circuits to be connected to the same 4 bit + bus\ By mul- tiplexing (using a 1-of-16 MUX 1C) one 'switch 1 can be selected at a time to read its value. In this way up to 16 switch circuits can be read by the same 8-bit microcontroller bus to mini- mise I/O count. When the EEPROM value is higher than the counter s maximum it will return to zero. This is to avoid problems when a value of 16 is loaded from EEPROM and the counter maxi- mum is 9 (decimal mode). ( 090538 ) [1 ] www.elektor,com/G90538 K1 Si M UP It n if S2 N OWN ii 1. f *§ I SO vcc PDO(nXD) POttTXD) PD211NTQ) PDSflNTM} POdiTDJ PD5rri} PDfi(ICP) PAQ PA1 IC1 ATTINY2313 .=■ n U,; A I N01 PBI(AINI) FBEiOCOAj p&afOCiA} PBJ(OCtB) PB5(MGS,I} PBG(MlSO) PB7(USCK) PA7 GND READ BCD OUTPUT MODE 12 R1 13 R2 U R3 15 16 RS 1 17 jg 10 270H J70B 27QR 270 R 070 R 270 R 270R JP3- MAX VALUE LDl 10 ^4 R0 CA CA :0 'LL 3 elektor 7 / 8-2010 35 int main (void) { DDRB|= ( 1<_|_|_ || = length of the string incl. CRC (+ offset of 32 to stay within ASCII range) _ = separator = field-value | - separator ~ units of the value = sum of the previous characters mod 256* The source and hex code files for this project are available free from the Elektor website as archive fie # 090544-11.zip. A programmed controlled is available under product number 090544-41, if 03} 63 9^6 DIY Front Panels Henk vanZwam (The Netherlands) This issue includes an article on a handy DIY front panel design pro- gram called Galva, Once your design is ready, the next question is how to convert it into a real front panel* One option for this is described here. There is material available that you can print using your own printer* It is called waterslide transfer paper or waterslide decal paper* and it is the same as the decaf material well known to many builders of model aeroplanes. You loosen the decals from the base material in water and then place them on the model aeroplane. The material looks the same as photo paper, and it is available in two types: one for laser printers (including colour printers), and the otherfor inkjet printers. Transparent sheets and sheets with a background colour are available in both types. The letter colour is determined by the printer. A lot of informa- 3 tion on this material, including demo videos, is available at a website we came across while researching this article if. It's just as easy to use as simply print- ing a normal sheet of paper* If you use a laser printer (colour or mon- ochrome), the toner is melted into the material and is therefore well bonded. If you use an inkjet printer, you need to f x the ink to the mate- rial after printing. Spray cans with a special fixing agent are available for this purpose* Now let’s examine the process of applying the materia I to the front panel. Af te r deg reasing the aluminium front panel* coat it with sev- eral layers of matt grey undercoating for car paint (applied with a spray can). Cut the let- elektor 7/8-2010 39 tering segments out of the printed sheet and immerse them in water, one at a time. After half a minute or so. depending on the water temperature, you can take the transfer out of the water and feel whether it slides around on the paper. If it does, you can place the transfer where it belongs on the panel. Using tweez- ers. hold the transfer in the proper place and wipe it carefully with a cotton bud to squeeze out the water underneath the transfer. After the front panel is finished and well dried, it's a good idea to use apply several thin coats of matt varnish to the surface of the panel (use a spray can for this). Let the front panel dry for half an hour after each coat before apply- ing the next one. Tips: 1. Use demineralised water if you have hard tap water. 2. Do not use dish detergent to break the sur- face tension of the water, since it causes soap spots. If you google "waterslide transfer" or “waterslide decal paper’ 1 , you wifi find a lot of information and locations where you can buy it. Some suppliers even sell transfer paper by the sheet, so it's worth looking. hoojSj-t} [i] www. pa p i I i o xo m / la ser% 2 Owa ter%2 0 s 1 1 d e % 20decal%20paper%20original%20pas.html L200 charger circuit Wolfgang Driehaus (Germany) This circuit came about as the result of an urgent need for a NiMH battery charger. No suitable dedicated 1C being immediately to hand, the author pressed an L200 regula- tor and a 4.7 kQ NIC thermistor into serv- ice. Those components were enough to form the basis of a charger with a cut-off condition based on cell temperature rise rather than relying on the more common negative delta- V detection. The circuit uses the 1200 with the thermis- tor in the feedback loop. When ‘cold’ the output voltage of the regulator is about 1 .55 V per cell; when 'warm 1 , at a cell tem- perature of about 35 °C to 40 °C, the out- put voltage is about 1.45 V per cell and the thermistor has a resistance of about 3.3 k£L This temperature sensing is enough to pre- vent the cells from being overcharged. PI adjusts the charging voltage, and R2 limits the charge current to 320 mA. The 1C is fit- ted with a small 20 K/W heatsink as ft dissi- pates around 1.2 watts in use. The charger circuit can be connected per- manently to the battery pack. Charging starts when a ‘wallwart’ adaptor is con- nected to the Input of the charger. The unregulated 12 V supply used by the author delivered an open-circuit voltage of IS V, dropping to 14 V under load. Even though the charge voltage is reduced when charg- ing Is complete, the cells should not be left permanently on charge. The author uses the circuit to charge the bat- tery I n a torch. After th ree years and some 1 50 charge cycles the cells are showing no signs of losing any capacity, 000140 ) AM Receiver with Quadrature Mixer Gert Baars (The Netherlands) This circuit is for a superheterodyne receiver where the image frequency is suppressed without the use of an input filter. Instead, it uses two NE(5A)612 type mixer Its that each work 90 out of phase. With a quadrature front-end, the image frequency is rejected and the noise associated with it disappears, fn theory, this increases the sensitivity of the receiver by 6 dB. The phase shift of the local oscillator (LO) is provided by two D-type flipflops configured as a ring counter. The outputs of the flipflops always change in the same order. The result is a frequency that is half that of the oscilla- tor, but with a 90 - phase shift between them. These signals are normally called *Q’ (quadra- ture) and T (in phase). Phase shifting of the output is provided by two simple RC networks. For the Q mixer the phase shift is set to -45 using a capaci- tor; for the 1 mixer it Is set to +45 using trim- mer (C 1 4). The total phase dif fere nee is t here- fore 90 . The signals are added very simply, using a preset (PI). In this configuration the input frequency Is equal to and the image frequency = f Q + f jF , where the latter is suppressed. With a low IF, such as used in Software Defined Radio, the phase shifting following the mixers has to cover a relatively wide band, because the IF frequency is low compared to the IF bandwidth. This is much easier to achieve using software rather than a complex phase shifting RC network. With this AM receiver the IF bandwidth is small compared to the centre IF frequency of 455 kHz and the maximum phase error is almost negligible even when a simple RC network is used. We’ve used a standard 1C for the demodu- lation: the TDATG72. To drive a loudspeaker 40 7/S-2010 elektor +12V...+15V we’ve added a simple amplifier stage using a pair of transistors (BC547 and BC557) along with a potentiometer (P2) for the volume control When setting Lip the recei ver the lowest fre- quency of the VCO can be configured such that DC can be received. This can be done by ear because the noise disappears and a 50 Hz hum becomes audible. Setting up the phase shifting can be done with the help of a station that’s on the same frequency as the image frequency. It could happen that the fixed phase shift at the output of the Q mixer isn’t exactly - 45 . but could be -43 , for example. If you now adjust the trimmer such that the phase shift becomes +47, the difference becomes 90 again. This is a matter of making small adjustments to the preset and trimmer alter- nately, while the suppression becomes pro- gressively better until the station is no longer audible due to the image rejection. (100155) Musical Horn for ATBs Christian Tavernier (France) If you are both an all-terrain biker and handy with a soldering iron, then we suggest you build this musical horn which, apart from the fact of having a much pleasanter sound than a sim- ple bell, will usually make passers- by turn to you with a broad smile, so surprised will they be to hear these few notes coming from an ATB or mountain -bike. To achieve this, we have repurposed the 5AE800 integrated circuit, which is theoretically designed for door- bells or musical chimes for houses. It takes only a very few external com- ponents and can run off any voltage between 2.8 and 18 V, So even with a seriously flat battery, it will go on working — though admittedly at the expense of sound volume. This is relatively high and can be adjusted, to a certain extent, £2 by potentiometer PI. Switch SI is only vital if you want to make the battery last as long as pos- sible, When the circuit is not acti- vated, i.e. when push-button S2 is not pressed, it goes automatically into standby-by mode, when it con- sumes only a measly 1 p A or so, IC1 produces three different sounds, depending on whether £1 or E2, or both together, are activated. This is what we’ve decided to do here using diodes D1 and D2, as this lets us obtain the most attractive sound, consisting of three notes at 440 Hz, 550 Hz, and 660 Hz, partly overlap- ping and of decreasing amplitude for around 7 s. Of course, there’s nothing to prevent you choosing a different option by fitting only D1 or D2 and leaving the unused input floating. elektor 7/8-2010 The project doesn’t present any specific dif- ficulties, but it will need to be fitted into a watertight plastic case, to protect it from rain. For the same reason, it would be wise to choose a loudspeaker with a Mylar (plas- tic) cone, because the traditional fibre cone Ignition Timer Philip Muylaert (B) This circuit is a tester for flywheel-based igni- tion systems in small aeroplane engines. Basi- cally the same ignition coils are also seen in other small combustion engines used in/on mopeds and lawn mowers — in brief, engines without a battery. The part to be tested comprises a primary coil in parallel with the contact breaker. The tim- ing of this contact breaker has to be adjusted correctly. Since the coil's primary has a very low resistance It is difficult to determine whether the contact breaker is open or closed. However, you can determ Ine that reliably with this circuit, using an LED and a beeper. I he cir- cuit Is implemented twice because aviation engines (Cessna, Piper and similar) always have two ignitions in parallel to increase reli- ability. For two-cylinder engines, well the pur- pose is obvious. The circuit consists of a 555 and a few transis- tors. The 555 supplies a square wave of about 3000 Hz. This signal goes to power transis- tors T1 and 12 ; these can supply quite a bit of power and are robust enough to withstand the voltage transients from the big coils. The test connection (K2 and K3 respectively) are connected in parallel with the contact breaker to be tested, which itself is in parallel with the ignition coil. The frequency of 3000 Hz is either short circuited by the contact breaker or — if the points are open — is amplified somewhat by the resonance of the coil itself. This allows you to reliably detect the differ- ence between a dosed and open contact breaker, despite the low resistance of the coil, which Is in parallel with it. When the contact Jurgen Okroy (Germany) This voltage monitor circuit is based on a n Ele- ktordesign with a 555 timer 1 C in the book 302 doesn’t get on very well with humidity. Switch SI. tf used, and push-button S2 will also need to be chosen to be relatively resist- ant to humidity. The types available with a small rubber boot’ are ideal. {0910701) breaker is open the amplified pulses will turn on T3 and T4 respectively, so that the relevant LEDs turn on and the buzzer will sound. The components are not critical, but do use a Circuits* which uses two LEDs (red and green) to indicate whether the voltage is within range (bad or good). However, in practice this circuit has some shortcomings because Caution. The installation and use of this cir- cuit may be subject to legal restrictions in your country, state or area. a sensitive type for the piezo buzzer. The power supply is 3 V (2 times AA or AAA batteries). ( 100300 - 1 ) 3 the change in the indicated colour when the voltage drops bel ow the thresho I d often goes unnoticed. The circuit described here is designed to mon- Voltage Monitor 42 7 / 8-2010 elektor + 12V itor a 12-V supply voltage (such as voltage of the electrical system in a car) and signals an undervoltage situation with a blinking green LED, which is more likely to be noticed. The small red LED also lights up in case of under- voltage to provide confirmation. The 556 1C used here contains two 555 tim- ers. One of them detects the switching threshold, and the other provides the blink- ing function. The threshold voltage for the undervoltage warning can be set to the desired value with potentiometerPI, The current consumption of the circuit depends on the type of LED used. If a low- current LED is used as the blinking indica- tor, the value of the series resistor (here 330 ohms) must be increased significantly. Universal Timer with Zero Standby Current 3 Jurgen Stannieder (Germany) This design came about when the author wanted better control of his 12 V solar- charged garden lighting installation. It is however a versatile circuit which can also be used to switch other types of equipment. Pressing pushbutton T1 energises the relay Kl connecting the supply to the circuit, pow- ering the 78L05 and generating a 5 V supply for the ATtiny2313 microcontroller. The out- put PD3 (pin 7} will now be switched High by the microcontroller to turn on the transistor and hold in the relay, keeping the lighting on fora pre-programmed length of time defined in firmware. A press of the same button can eitherturn off the lights orextend the light- ing period* Pushbutton T1 is connected via D3 to input PD2 (pin 6). A press of T1 (a minimum of three seconds after timer start) will stop the timer, turn the lights off and disconnect the circuit from the power supply. The on-time can also be extended: one minute before the timing period ends the LED on PD6 (pin 11) will light up, warning that the switched equipment (the garden lighting in +11 V. r *+14V @- 0 — t> D 1 H£1 x m IN 4148 02 1 N 40 C 1 - 0 -@ ♦ IC 1 78 L 05 A i V V 02 IDQn 51 in 44 1 W 4148 Cl 100m Jj R£ 0_ S_ 11 D4 Rl BD 139 20 — I pcK£) ^ JL ^^ODn VCC RESET 1C 2 PD0(RXD| PB7(SCK) P01(TXDJ P56EM1S0) PD2{II*TC) PB5(M0SI) PD3{INT1} PB4 PO4{T0) PB3(GC1) PD5(T1 ) PR 2 PDfi[lCP) PBI(AINI) PB > 5 tt III S 5 S 3 S £ h G □ +5V ( 5 > 6 7 a 4 10 11 12 13 14 Si START $2 M STOP S3 M in SJ *1 0 Q 11 20 vcc IC2 PAZ{R£5ET) PG7(USCX) PDD(RXD) PB6|MISQ| poirrxoh PB5 4 SCI HI Cl 33p 4.9152MHz 10 19 18 17 16 15 H 13 1 2 091644 - 11 START: Start timer for the preset period STOP: Stop timer, select menu for setting values and options PLUS: I nerement the selected va lue by 1 MINUS: Decrement the selected value by 1 The following values can be set; Menu 1: SET HOURS 00 Menu 2: SET MINUTES 00 Menu 3: SET SECONDS 00 Menu 4: SET DISPMQDE 0 Push buttons PLUS und MINUS alter the selected value and pressing them both simul- taneously resets the value to zero. A programmed controller is available from the Elektor shop under order code 091044- 41 (www.elektor.com/091044). If you enjoy doing the programming yourself, the fuses of the ATtiny2313 should be set as follows: EXT. byte: OxFF - (brown out det, off, no CKD1V8) HIGH byte: OxDF - (ext, crystal > 3 MHz) LOW byte: OxFD - (64ms start up) As usual the hex and source code can be downloaded free from the Elektor website (www.elektor.com/09 1 044) . {091044) 46 7/8-2010 elektor QUASAR electronics ?he t&ctrontc XU $wcta*tefi Sir ire 1993 Please visit our online shop now for details of over 500 Kite, projects, modules end publications. Discounts for bulk quantities Quasar Electronics Limited PO Box 6935, Brshops Stortford CM23 4W P. United Kingdom Tel: 01279 467799 Fax; 01279 267799 E-maM : sales@quasarelectromcs .com Web: www.quasarelectronics.com Postage & Packing Options {Up to 0 5Kg gross weight). UK Standard i j 3-7 Day Delivery - £4.95; UK Mainland Next Day Delivery - £9 35. Europe (EU) - £8 95; Rest of World * £1 2.95 (up to 0.5Kg) lOrder online for reduced price UK Postage! We accept all major credit/debit cards. Make cheques/ PO's payable to Quasar Electronics, Prices include 15.0% VAT. m i* ■+ ■ ****** ■ +* Uwsin) ;r Credit Card • r» Motor Drivers/Controllers Here are just a few of our controller and driver modules for AC. DC, Unipolar/Bipolar stepper motors and servo motors. See website for full range and details. Computer Controlled / Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vdc 5. 6 or ^ 8-1ead unipolar stepper motor rated up to 6 Amps. Provides speed and direc- tion control Operates in stand-alone or PC- controlled mode for CNG use. Connect up to six 3179 driver boards to a single parallel port. Board supply; 9Vdc. PGB; 80x50mm, Kit Order Code; 3179KT - £15.95 Assembled Order Code: AS3179 - £22,95 Computer Controlled Bi-Polar Stepper Motor Driver Drive any 5-50Vdc, 5 Amp bi-polar stepper motor us- ing externally supplied 5V levels for STEP and DI- RECTION control. Gpto- isolated inputs make it ideal for CNC applica- tions using a PC running suitable software. Board supply: 8-30Vdc. PCB: 75x85mm. Kit Order Code: 3158KT - £23.95 Assembled Order Code: AS3158 - £33.95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32Vdc, IGA) in both the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166v2KT - £22.95 Assembled Order Code: AS3l66v2 - £32.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 1Q0W7.5A. Pulse width modulation output for maximum motor torque at all speeds Supply: 5-15Vdc. Box supplied. Dimensions (mm): 60Wx1GOLx6QH. Kit Order Code; 3067KT - £1 7.95 Assembled Order Code: AS3067 - £24.95 Most items are available In kit form (KT suffix) or assembled and ready for use (AS prefix). Controllers & Loggers Here are just a few of the controller and data acquisition and control units we have. See website for full details. Suitable PSU for all units: Order Code PSU445 £7.95 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- ehannel 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 130x1 00x30mm. Power Supply: 12Vde/500mA Kit Order Code: 3108KT - £64.95 Assembled Order Code: AS3108 - £79.95 Computer Temperature Data Logger 4 -channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located 2Q0m+ from board. Wide range ot tree software applications for stor- ing/using data. PCB just 45x45mm, Powered by PC Includes one DS1820 sensor Kit Order Code; 3145KT - £19.95 Assembled Order Code: AS3145 - £26.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State of-the-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx f s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately), 4 indicator LED s Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £49.95 Assembled Order Code: AS318G - £59.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired User settable Security Password. Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. Not BT ap- proved . 1 3Gx 110x30mm Power: 1 2 Vd c . Kit Order Code: 3140KT - £74.95 Assembled Order Code: AS3140 - £89.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 DS18B2G 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 / com ms program (Windows HyperTerminal) or our free Windows application software Kit Order Code: 3190KT - £69,95 PIC & ATMEL Programmers We have a wide range of low cost PIC and ATMEL Programmers. Complete range and documentation available from our web site, Programm er A cces s ones : 40-pin Wide ZIF socket (ZIF40W) £14.95 18Vdc Power supply (PSU120) £19.95 Leads: Serial (LDC441) £3,95 1 USB (LDC644) £2.95 USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP, Free Windows XP software. Wide range of supported PlCs - see website for complete listing ZIF Socket/ USB lead not included. Supply; 16-18Vdc, Kit Order Code: 3149EKT - £49.95 Assembled Order Code: AS3149E - £59.95 USB 'All-Flash' PIC Programmer USB PIC programmer for all Flash 1 devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included, Assembled Order Code ASS 128 - £49. 95 See website for full range of PIC & ATMEL Programmers and development tools. Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit, Toggle or momentary. 15m+ range 112x122mm Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £59.95 Assembled Order Code: AS3142 - £69.95 WWW. Secure Online Ordering Facilities * Full Product Listing, Descriptions & Photos * Kit Documentation & Software Downloads Universal PWM Driver V+ ©- C7 G> V- 470u 25V C4 lOOn IC2 Cl 7S0S 0 » 0 ♦ 7915 47Qu 25V C3 lOOn C2 220y 10V +5V ©> C6 IDOn LC DISPLAY in □ m o O tn > > > (£ UJ DOOdOCLOO^^ 1 2 3 S |fi |7 8 9 | ID 11 12 13 14 i S 16 IC1 R1 K R2 Ik 4k7 rrp- ji MODE O El R9 R4 B A a K1 BAT81 04 O SI +5V © ^ToOn 17 15 15 16 D1 BAT81 h i 5 1 7 | 9 1 11 1 13 O O O O +SV 16 00000006 QQOOOOQO +5V O O O O 1 £ U ho 12 14 VI 3t> 1C 3 RAO/AN O RBO/INT RA1/AN1 RBt/fiX/DT RA2/AN2/REF RB2/TX/CK RA3/AN3/CMP1 RB3/CCP1 RA4/T0CUVCMP2 RB4/PGM RA5WCLR/VPP RB5 R A6/OSC 2/CL KO Uf RB E/T 1 GSO/T 1 C LK/P RA7/GSC 1/CL KIN RE7/T1 OSl/PC 0 PIC16F628 vss 5 G u /CSP H flESET I S A SB 3 C 10 It 12 13 K4 LCD 15 X LTJ 4 tfji h- X oc +5V -© K2 r o o ROTARY SW/TCH RIO <1- 4 47R R11 H 4?r © IMA OUTA IC4 MC34151 INB OBTB yy i si " ■ - 4 1 2x IRF9540 2x BVW32 PWlVt'2 o » PWM PWM-1 f-O 096056 - 1 1 Herbert Musser (Austria) and Alexander Ziemek (Germany) PWM drivers are used in analysing, testing, installing and powering all kinds of electronic and electrical devices. We have published a few designs in Elektor over the years: here we present a 'de luxe' version suitable for a very wide range of applications. As usual the soft- ware for the project (source code and hex file) can be downloaded for free from the accom- panying pages on the Elektor website HI, and ready- prog rammed microcontrollers are also available. Additionally, the authors' Eagle design files for the printed circuit board are available for download. The main user control, used for adjusting almost all the settings, is an Alps incremen- tal rotary encoder. This is accompanied by a mode switch used to select the operat- ing mode from among “off, 'PWM T and 'full power 1 : a three-position centre-off switch is suitable. The two controls are connected via headers (K2 and ]1), The current settings of the circuit are shown on a standard LCD panel with two rows of sixteen characters, which is connected to the PCB via a standard connector. At the heart of the circuit is a PIC16F628 micro- controller (a PIC16F628A may also be used). An output stage consisting of two power FETs wired in parallel, along with heavy-duty fly- back diodes, allows the circuit to drive DC motors at u p to 3 0 V a nd rated cu rre nts of up to 10 A directly and comfortably. The circuitry is capable of working at even higher currents, butthen careful attention must be paid to the cross-sectional area of the conductors: tin the current-carrying circuit board tracks, or add wires in parallel with them. The motor drive application was foremost in the authors 1 minds when designing the cir- cuit. A useful feature in this application is the 'boost function', which helps DC motors to start up reliably. The output is switched on at full power for the configured boost time, regardless of the PWM duty cycle setting in force. For reasons of safety, when the circuit is pow- ered up the output will remain off until the mode switch is set to ‘off and then to one of the 'on 1 settings. This means, for exam- ple, that a connected motor will not sud- 4S 7/8-2010 elektor denly start up when the electricity supply is restored after a power cut. In normal operation the display shows the current PWM frequency and the duty cycle (as a percentage). The duty cycle can be adjusted using the Incremental encoder The basic settings can be configured in the set-up menu. This menu is reached by setting the mode switch to “off 1 and pressing in the incremental encoder for a few seconds. The menu includes the following options: Boost: on / off Boost time: 1 second / 2 seconds / 5 seconds PWM Frequency: I kHz j 2 kHz / 5 kHz PWM step: 1 % j 2 % / 5 % / 10 % Choosing ‘exit’ leaves the set-up menu. The “PWM step' parameter determines the amount by which the duty cycle increases or decreases in PWM mode for each step of the rotary encoder. The settings are stored in the EEPROM of the P1C16F628 and so are not lost when power is removed. The authors' prototype of this circuit has given sterling service, outputting a dean and stable drive waveform even at a frequency of 5 kHz. ( 090856 ) [ 1 1 www.elektorxom 090856 Economical On/Off Power Switch 100299- II Joost Waegebaert (Belgium) Many appliances these days are switched on and off with the simple push of a “soft 1 on/off button. In the “off 1 position the appli- ance is merely in the sleep state and contin- ues to use a small amount of energy — and that is just “not done' nowadays. This circuit not only retains the feature of switching on and off with one simple pushbutton but also reduces the power consumption in the off- state to zero. When pushbutton SI is pressed, the circuit receives its power supply voltage via the capacitive voltage divider containing Cl, The rectified voltage across C2 energises the relay RE1.B via R3, LED D2 lights up. One set of the relay contacts is connected in parallel with SI, so that the relay will continue to be energised when SI Is released. The remainder of the cir- cuit has no effect during turn on. C3 ensures that T2 blocks and capacitor C4 is not charged yet. Both conditions ensure that T1 does not have any base current and is therefore off. The relay can now close and the mains volt- age across K 1 is switched through to K 2 . After power on, C4 will charge slowly. After about 0.25 sec the voltage is high enough to turn T3 on via zener diode D4. There is now a voltage at the emitter of 13. If SI is now pressed then T1 will receive base current via T3and the second contactof SI. T! conducts and shorts the voltage across RE1 which de-energises the relay. At the same time T2 ensures that the circuit latches: T1 provides base current, via R 6 , forT2. This will conduct and provide base current for T1 via R7. So II will continue to conduct, even after SI is released. C2 is discharged via R3. In this way the power supply voltage for latch T1-T2 will eventually disappear, so it will unlatch. Tim- ing capacitor C4 is also discharged, via D5, so that the circuit is now ready for the next start. The entire circuit is completely disconnected from the mains, the current consumption is literally zero! The value of capacitor Cl mainly depends on the relay that is used. As an example we are using an Omron MY4-24VDC f 1 !. The relay is a 24V-type which is happy with a coil current of 40 mA and has contacts that allow for a load of up to 5 A. At 24 V across the relay there is a current of about 10 m A through LED D2* The total current when switching on is therefore about 50 mA. The value of capacitor Cl is roughly determined as follows: X C1 - U C] jl a - (230 V - 24 V)/50 mA = 4.12 kQ Cf = l/2rrfX cl = 1 / (2 x 3.14 x 50 X 4120) = 773 nF We select the next bigger value: 820 nF, It is absolutely essential that this capacitor be suitable for at least 250 VAC and is prefer- ably a Class X2 type, For example one from the MKP 336 2 X2 series made by Vishay HI. The capacitor actually limits the total cur- rent that can Row through the circuit. When T1 conducts, Cl limits the current through T1 to about 50 mA + The magnitude of this cur- rent also gives an indication of the apparent power that the circuit draws: “ (Jx I = 230 V x 50 mA = 11.5 VA, The actual real power of the circuit is smaller than this value, since the cos tp of the circuit is certainly smaller than 1 , Resistor R2 discharges capacitor Cl after elektor 7 / 8-2010 43 switching off. This also has to be a type rated for 250 VAC (for example the MBE/SMA 0414 series Hi). Switch SI too needs to be appro- priate for 230 V operation. It is possible to replace R2 with two "ordinary 1 resistors of 470 kQ in series. Resistor R1 limits the switch- on current through SI when capacitor Cl is Kai Riedel (Germany) There are several techniques for providing lab-grade contacts from one track side to the other on DIY printed circuit boards. They range from thin wire or solder pins through pressed-in hollow rivets (e.g, from Bungard) and through-contact sleeves (e.g, from £LV) to through-contact rivets (e.g. LPKF 'EasyCon- tac'). These ‘vias’ can also be produced using electrical technigues or with solder paste. All these methods tend to be time consum- ing and prone to failure. Some of them also require special tools or employ expensive components. The author prefers the more wallet-friendly track pins made by Harwin in various sizes. Track pins type T1 559F46 HI are available from Parnell for instance (order code 1143874) at a discharged, ( 1002094 ] |1 ] wwwja.omron.com/data_pdf/ data-sheet/ my_dsheet_gwjl ] 1 -el -03.pdf price of £6.96 or €9.85 fora pack of 500). You just drill a hole of 0.8-mm diameter and then insert the pin. Harwin supplies a special Inser- tion tool (Parnell order code 145248, £162.97 or €224.98 ; data sheet at l 2 t). [2] www.vishay.com/docs/28120/ mkp3362.pdf ! 3 | www.vishay.com/docs/28767/28767.pdf 3 You can also insert these pins without special tools (hut not as reliably), A soldering iron with a wide tip will do! Pins heated in this way can be inserted into the PCB with light pres- sure and then soldered on both sides. The tight fit of the pin in the hole means it will not fall out during or after the insertion and sol- dering processes, unlike when using pieces of thin wire. Making via connections in this way is quick and easy. [1 ] www.harwin.com/search/ T 1 559F467ProductSearch-True [2] www. ha rwin.com/include/down loads/ tis / 15-06, PDF Fast Reliable Vias Identifying Stepper Motors W.G. Jansen (The Netherlands) There are many different types of stepper motor. Because there is no documentation available for stepper motors that have been removed from old equipment you have to ca rry out some measurements to identify the different wires. We only need three things for this: an ohm- meter. an AC voltmeter and a transformer with an output voltage between 2 and 6 V. The majority of stepper motors have either two or four stator coils, which are presented to the outside world via 4, 5, 6 or 8 different coloured wires, see Figure 1. Fora motor with 4 wires we have to find two wires that have a resistance between them. We then write down the value of the resistance and the colourof the wires. In this way, we can distinguish between the two stator coils and we know that this is a bipolar motor. Fora motor with 5 wires (unipolar) it is more 50 7/8-2010 elektor difficult to identify the four individual coils. . V start with the measurement o fCfte resr st- ance between all the differently coloured . ires and make a note of them in a list (see the example in Figure 2). Next, find all pairs of wires that have the lowest resistance between them and call those Rx ,.Al. The resistance values of the other combinations aren’t important. Measurements: yellow/red = Rx ...Q blue/red = Rx ...fi white/red = Rx ...fi brown/red = Rx ...Q From this example it appears that the red wire is the common one (COM). Two pairs of coils make up the A-B phase and the GD phase. To find out which ones belong together we com nect a small AC voltage to one of the coils, if need be via a series resistor to limit the cur- rent. In this example we chose yellow/red. Now use the AC voltmeter to measure the volt- age across the remaining coils. The coil where we measure the largest voltage will be the one that forms one phase in conjunction with the yellow/red coil It’s not important whether we cal] this the A-B phase or GD phase. Fora motor with 6 wires (both bipolar as well as unipolar devices) it is straightforward to CcenCCCy Che (ho mad a (cars, rtgam, we (Treas- ure the resistance between all coloured wires and put them in a list. Measurements: yellow/red = Rx ...Q red/ brown = Rx ...Cl blue/black = Rx black/white - Rx ...Q yellow/brown " 2Rx ...Q blue/white = 2Rx ...U We find a low resistance value (Rx ...ft) four times and a higher resistance (2Rx ...D) twice. There is no connection between the two phases (see Figure 3). From this it can be seen that yellow/red/brown is one phase with red as common, and blue/black/white is the sec- ond phase with black as common. For bipo- lar use the 2Rx connections are used and the common wire is left unconnected. For a motor with 8 wires (both bipolar as well as unipolar devices) it is quite difficult to determine the correct order of the fourcoils in the two phases. As for the other motors, we start with the resistance measurements and put them in a list, which will make clear what the individual coils are (see Figure 4). In order to connect the coils in pairs and in the correct phase, Che wmtffhg ofrecCfdn o teach coil has to be determined. To do this, con- nect the transformer to one of the coils and measure the voltage across the other coils with the AC voltmeter. The coil that shows the largest voltage will be the one that forms one phase in conjunction with the coil con- nected to the transformer. To find out if the coiis are connected in phase, the colls are connected in series and the transformer is connected across one coil. First measure the voltage across the powered coil and then across both coils in series. There are two possible outcomes: The volt- age across the series connection is about twice that across the single coil, or it's almost zero. The correct series connection is the one where the voltage is highest. For bipolar use you should connect the two coils for each phase in series or parallel, since that results in the maximum torque From the motor. (090420) Literature "Stepper Motors Uncovered', El ektor November & December 2003 Zapper for Electrotherapy jac Hettema (The Netherlands) A zapper is a device that is often used in alter- native medicine. This device is a so-called electronic bioresonance pulse generator. which generates a square wave at a partic- ular frequency. This signal Is applied to the human body via hand or wrist electrodes, causing a minute current to flow through the body. This is claimed to kill bacteria, viruses and other parasites in the body, and to boost the immune system. After reading the relevant parts in the hand- book for self-health by Dr. Hulda Clark and looking at the signal generated by such a elektor 7/S-2010 51 device, the author designed a cheap DIY ver- sion of such a zapper. This design is significantly cheaper than the commercially available devices. As far as its effectiveness is concerned, there are various claims and counter- da tins put forward, all for what it's worth, At least with this design you can try it for yourself at little cost, in any case a lot tess than if you decided to buy a ready- made zapper. This zapper outputs a square wave signal at the supply voltage of 9 V in series with a resistor of 1 kO, This means that the maxi- mum output current can never exceed 9 mA (when short-circuited), which keeps it safe to use. The frequency varies between about 2S kHz and 75 kHz, C3 is charged up via a con- stant current source so that the change in fre- quency is fairly linear. The LED used in the con- stant current circuit doubles as the 'on 1 indica- tor for the device. After about eight minutes the zapper turns itself off, since output Q9 (pin 14) of IC2 then goes high. This stops the base current in T1, which turns off the supply voltage to the circuit via T2. The ground and output connection (R14) of the circuit are connected to the body via two hand orwrist electrodes (in the simplest case these could be two pieces of bare wire). For safety reasons the circuit should only be pow- ered from a 9 V battery. (090030) Six-way Switch Kees van het Hoff (The Netherlands) The 40106 is a versatile CMOS 1C containing six Schmitt trigger inverters. It can be used to implement a set of alternating-action switches with hardware contact bounce suppression. Aside from one gate of the 1C. all you need for each switch is a pushbutton, a resistor and two capacitors. It works as follows. The 1 pF capacitor at the output is charged or dis- charged via a 1 MO resistor, depending on the output level of the inverter. Pressing the button causes the input level of the gate to change, which in turn causes the 3 output level to toggle. The 10 nF capacitor determines the output state after the supply voltage is switched on. You can connect it to the supply voltage rail or the ground rail as required. If you hold the button pressed, the output signal will be a square wave with a fre- quency determined by the RC time constant, which is approximately 1 second. You may experiment with the component val- ues if you wish. (100342-!) Front Panel Design Program Henk van Zwam (The Netherlands) Everybody who builds their own equipment will come across this problem at some stage: How can I create the layout for a decent front panel? Plain text can be positioned in the right place using a word processor, but scales for potentiometers, rotary switches and variable ca pa cito rs a re a d ifferent m atter. For several years there has been a great pro- gram that can solve these problems: Calva (version 1 .85), It is freeware and originates from France, but also offers an English lan- guage user interface. It also has an extensive help section. The design can be printed on any printer, using paper or a transparency, depending on the printer used. The program is really a type of programming environment: The user writes a number of commands with parameters that result in the drawing when the F4 key is pressed. The pro- gram has two windows: a graphical window for t he drawing and a text window where the commands are typed in. It doesn’t have the usual graphical interface that we expect with most drawing programs. However, it doesn't take long to learn how to use this program because you know the reasons for issuing a specific command. Logos (signs) etc can be imported and all fonts and symbols present In Windows can be used. It almost goes with- out saying that colours can be used. 5 2 7/8*2010 elektor he results are amazing: scale division lines can be positioned to within a fraction of a degree, positioning of components can be done to a tenth of a millimetre. The learning curve is quite short because you can study the included examples and use them as the basis for your own designs. You can quickly see h3C the Possibilities are when you change sorr e of the parameters in the examples r he program is suitable for use in a large number of projects to create scales and front oufvis, but it can also be used to create milli- mc,tre Daper ’ logarithmic paper, nomograms, logarithmic tables and such like. Galva can be downloaded from the (French) website at PI. You'll find the program in the Electronique’ section, in .. I'WM 1 1J www.radioamateur.org/down/oad/ PIC/C or VHDL/FPCA for RFM12 TX/RX By Bojan Jovanovlc and Milun Jevtic (Serbia) The use of the low-cost RFM12 868 MHz (US: 915 MHz) ISM (licence-free) radio module with microcontrollers like the ATmega and t he R8C1 3 is straightforward once you've read some relevant Elektor publications im[3j. Here, the use of the RFM12-434-D DIP type transceiver module for 434 MHz (US: 315 MHz) 41 ,s Proposed instead of the RFM12-868-S which is an SMD type. Of course, the antenna length has to be changed to 17 cm to suit the lower frequency. The authors used a PiC16F73A to control the RFM12A transceiver module. The firmware for the micro was written in C using an EasyPIC4 development board and mikro C PRO For Pic, both from Mikroelektronika. As a quasi parallel activity, software was developed in VHDL for the FPGA Cyclone II family. For this. :he Aitera DE2 board and Quartusll software were used. The communication protocol governing the transmitter and receiver algorithms for the C- coded PIC16F73 are shown here. The supply voltage and logic ‘1 ’ voltage are both + 5 V. In the PIC application, the serial SPI commu- nication interface is realized in software. Data rate and frequency deviation are 4.8 kbps and ■ 90 kHz respectively. During data transmis- sion, the microcontroller monitors the SDO pin to check whether the Tx register is ready (SDO high) or not to receive the next byte. 1 his byte is transferred serially, MSB first. When receiving data, the receiver generates an interrupt request by pulling the nIRQ pin low when the FIFO register has received data. These data bits are transferred serially, again MSB first, to the microcontroller Slightly different algorithms and communica- tion protocols were applied for the Cyclonell FPCA to make it talk to the RFM12 transceiver module. In this case the supply voltage and logic T voltage are both defined as +3.3 v. All source code files and executables devel- oped by the authors for both 'branches’ of the project (i.e. C/PIC or VHDL/FPCA) are available Transmitter rC Infl RFMI2A r~ Receiver Open Tx m Send DATA -□ Close Tx ^ Receive QATARI Preamble: SyacWorri aaaaaa 2004 DATA Checksum Stop bits AA 0 090721 - TJ free of charge from the Elektor website 1=1. The RFM12-868-S is available through the Elektor Shop as item # 071125 - 71 . i 1 1 ATM IS on the Air, Elektor January 2009, www. elektor.com /OS OS 52 , l^j Radio for Microcontrollers, Elektor January 2009, Www.eiektQr.com/Q71 125. [3] USB Radio Terminal, Elektor July S, August 2 0 0 9 , mvw, el ekto r. co m/090372. HI www.fiQperf.com 1 5 1 www.elektor.rom/09072 1 elektor 7/8-2010 53 V CC Guy Boniface and Jean Rowenczyn (France) Here's a novel way of listening to bats over the Summer. Put the receiver — powered by four A A (R6) cells — on a window-ledge, for exam- ple* preferably aiming the ultrasonic detector towards an outdoor light or some trees. Run out a few metres of cable so as to install the small loudspeaker inside the house. Wait for nightfall and, if there are bats around* you'll hear a sound like bursts of crackling from the loudspeaker. Do note that bats won’t fly about under some weather condition (rain, strong winds, etc.) The detector receives the ultrasonic sig- nals, which are amplified by T1* T2, and T3, then sent to IC1 which is wired as a thresh- old detector, it converts the analogue signal into digital pulses which it sends to IC2, which divides the signal by ten so as to make it audi- ble to the human ear. The gain oftheLF ampli- fier IC3 is adjusted automatically by transistor T4 and T5 depending on the amplification of the signal by T3, filtered by R7 and Cl 4. The impedance between IC3 pin 2 and ground is what determines the amplifier gain. The 40 kHz ultrasonic receiver used (MA4Q-R or 5Q40-R) is available from Conrad Electron- ics (# 182281 -62) or Farnell (# 213226). (090637-1) Jean-Louis Roche (France) There are two sorts of lights on aircraft: red or white flashing lights* which are called 'anti-collision lights', and steady lights, red on the tip of the left wing, green on the tip of the right wing* and white at the tail, called ■position lights', which enable an observer to see if the aircraft is approaching or going away. On the tip of each wing, in addition to the steady lights, there may also be flashing white strobe lights. The position light simu- lator given here takes a few liberties with the real position lights, making them flash (it s more fun!) and using a little trick to simulate the strobe effect. The well-known NE555 is found in Its SMD ver- sion for the timebase, combined with a 4017 decade counter with ten decoded outputs, also in SMD version. Normally, each output is used independently. In this circuit, two out- puts are coupled with a one-output gap: Q0 and Q2 (front left* red LED), Q1 and Q3 (rear left, red LED), Q5 and Q7 (front right* green LED}* Q6 and Q8 (rear right* green LED). To avoid the low output’s shorting the High out- put, a diode is used in series with each output. 54 7/8-2010 elektor - this way, we get 'double flashing 1 of each itQ. giving the strobe effect. Output Q4 is used for the tail of the plane white LED) or helicopter (red LED) with a sin- gle flash, without the strobe effect. Output 39 is used for the reset. Only one LED is tit at any given moment, so the consumption is kept low so as not to reduce battery life in flight. The 1 50 Q resis- tor limits the supply voltage/current to each LED. The circuit's power rail (4.5 V) can be taken from an unused output on the model's decoder. A sub-miniature switch could be fitted if necessary, but since a plane or heli- copter is required to have its lights on at all times... Internet links [ 1 1 www,elektorvcom/090965 1 Breadboard as Hotplate Klaus Bertholdt (Germany) A standard 60mmx 100 mm piece of prototyping strip board (breadboard)can very simply be used as a 12 V warming plate. All that's necessary is to connect the copper tracks in series. At 12 V the board will pass around 4 A giving a power dissipation of almost 50 watts. Power can be supplied by a standard car bat- tery or 12 V battery charger. The temperature on the epoxy side of the board can reach around 100 °C! D6098841 3 ance of around 70 mQ* With the hotplate connected to 12 V a current of a round 4 A was meas- ured Indicating a total resist- ance of 3 n i.e. approximately 83 mil per strip. The average temperature of the copper strips was measured at 65 C. Make sure that the connecting wire to the hotplate is of suffi- ciently heavy gauge to handle the expected current. Any wir- ing to a car battery should also include an in-line fuse, a short- circuit can be hazardous. The simplest method to make the plate is first to solder all the tracks together at both ends of the tracks. Now take a small hobby drill like a D re me I fitted with a cutting or grinding wheel and use it to cut through alternate soldered ends so that all the strips are connected in series. The two connections to the plate are made at the end of the strips as shown in the picture. A 15 cm length of track at 20 Chasaresist- As well as making a good hotplate the strips can also be used to make a precise low imped- ance voltage divider network. Water Alarm Roland Heimann (Germany) The LM183G fluid detector IC from National Semiconductor is designed to be able to detect the presence of fluids using a probe. This chip requires a relatively high supply voltage and is not the most frugal power con- sumer, It is also quite specialised so unless you are buying in bulk the one-off price Is not cheap. An alternative circuit shown here uses a standard CMOS IC type 74HC14, It has the advantage of operating with a 3 V supply and consumes less than 1 pA when the alarm is not sounding, this makes it ideal for use with batteries. The 74HC14 has six inverters with hysteresis on their input switching thresholds, A capaci- tor (Cl) and a feedback resistor (R1 ) is all that s necessary to make an inverter into a square wave signal generator. eiektor 7 / 8-2010 55 In the water alarm circuit the feedback resis- tor consists of R1 and the water sensor in series* R1 prevents any possibility of short- circuit between the inverter's input and out- put; Resistor R2 defines the inverter’s input signal level when the sensor is not in water. Any open-circuit (floating) input can cause the inverter to oscillate and draw more current. The remaining inverters in the package (1C 1 , B to IC1.F) drive the piezo buzzer to produce an alarm signal. Capacitor C2 ensures that no DC current flows when the circuit is in moni- toring mode (with the alarm silent) this helps reduce the supply current. A micro-switch can also be substituted for the water sensor to make the circuit a more gen- eral purpose alarm generator; IC1.A IC1.0 IC1.D 3-Pin Fan in 4-Pin Socket Joachim Berg (Germany) The most recent PC motherboards provide four pin connectors for coding fans especially for the CPU fan. The older three pin fans are controlled by varying their DC volt- age. The fourth pin on the newer connectors supplies a PWM signal to control fan speed. A three pin fan can be plugged into the four pin connector but with its fixed 12 V supply it runs at full speed all the time the PC is switched on. This is not an ideal situation if only for the noise levels* During a recent motherboard upgrade the author was reluctant to replace his existing copper- fin ned CPU cooler which still had plenty of life left in it. An electronic solution was the only way ahead* A circuit was needed to convert the PWM sig- nals from the fourth connector pin into a va ri - able DC supply for the three pin fan. The PWM !C1 LM317T signal originates from an open collector out- put which can only be pulled up to a maxi- mum of 5 , 5 V. For this reason R 1 is co n netted in series with a zener diode to limit the pull up voltage to 4.8 V. The PWM signal is integrated by the network formed by R2 and Cl* The resulting signal is amplified by an opamp (almost any type that can work at 12 V will do here)* The opamp output signal controls an adjustable voltage regulator which supplies sufficient current even for the most powerful fan. PI adjusts the fan's minimum rota- tional speed (with a cold CPU)* Capacitor Cl is connected to V cc so that when the PC switches on it transfers almost the full 12 V to the opamp input to run the fan at full speed momentarily. This ensures the fan gets a small kick to get it going from rest* The regula- tion sensitivity can be adjusted by changing the value of R4, Incidentally the plug from an old floppy disk drive power connector can be used (after a little trimming} to con- nect to the4-pin motherboard fan plug. (080306) Mobile Phone TX Demo Jonathan Hare (UK) This is a very simple and cheap device that demonstrates mobile phones (US: cell phones') generate RF energy (radio waves) strong enough to light an LED. We have a 30 cm (7.5 cm per side) full-wave- length loop antenna (a ‘Quad' to radio ama- teurs) connected to a germanium diode and a hyper-bright LED, The loop can be made of copper wire, thin sheet metal or a track on a RGB* The diodes need to be w r ired correctly. A germanium diode is preferable as the LED probably has too great a self-capacitance to perform at the very high frequencies gener- ated by the phone (approx, 800/900 MHz or 1800 MHz) but will work well with the DC(-ish) pulses from the germanium diode (which has a small capacitance as well as low forward drop). In the junkbox or granddad's elec- tronics drawer, look for fossils like the OA91 , OA95, OA79 or AA119* The common or gar- den silicon 1N914 or 1N4148 will also work to degree and Schottky's like the RAT85 are 56 7/8-2010 dektor worth a try but eventually you'll find good old germanium rules. To show the mobile's transmitter (TX) gener- ates radio waves put it near to the loop and dial a number (use a freephone number, e.g. y our voice mail) or text. The radio waves will induce a voltage into the loop, large enough to light the LED. The LED will flash indicat- ing packets of digital data being sent by the mobile phone transmitter. You may need to set your phone to ‘GSM 900/1800' (US; ‘Cell- phone 800') rather than the '3C' network in the settings menu. This may not apply to all mobile phones. The circuit can also be used to prove that a mobile phone transmits well before produc- ing a ring tone, as well as at intervals (using various power levels) to report its presence to the network. 01 OA91 ?,5cm 3 inch 100392 ■ 11 For other experiments with this device please see the author's website hk (100391) 1 1 ) www. creative-science. org.uk/ moblfe_LED.html need to know more ... ... www.elektor.com How will you use the Propeller chip? With eight 32-bit processors (cogs) in one chip and deterministic control over the entire system, the mukicore Propeller chip is inspiring. Witness the Propeller-based projects from the top three winners of our 2009/10 Propeller Design Contest. ” “* 1 1st; Thumper by Harrison Pham - Internet radio ptoyer w/ 3rd: Sphinx by Mkhael Park - MP3 recording ond playback capabilities. Hardware contains a Propeller Sphinx is a Propeller-based Spin compeer that chip and some externa/ support chips to implement a complete system , compiles complex programs {including those Has features not found in commercial products for a fraction of the cost/ containing Propeller ASM) such as the Parallax TV and graphics objects. Sphinx also performs 2nd: DAQPac by Ryan David - An automotive data logger for some of the functions of an operating system. motorsports enthusiasts, with all the features necessary for a driver It provides a command-line shell, a text editor* to improve both driving skill and vehicle performance. A well-balanced disk utilities, and a memory-resident (cog- system, able to provide the features a motorsports enthusiast requires. resident) I/O system. B434L lAX Z n www.parallax.com "Para/laxlnc' on Twitter, Facebook; and YouTube a m tune Instruments www.miiinst.com Spinvent www.spinvent.co.uk elektor 7 / 8-2010 57 Binary Clock Sanne-Martijn Kessel (NL) This clock displays the time in binary using discrete LEDs, The use of Fiowcode [1] makes it very easy to program the PIC controller in this project. The circuit is very simple and can be con- structed with individual parts on a piece of experimenter’s board or using the relevant E-blocks modules: EB006 (lx PIC Multi -pro- grammer), EB0G4 (3x LEDs). ER0Q5 (lx LCD) en EBQG7 (lx switches). The firmware, which can be downloaded from the website for this article [ 2 ], determines how this circuit functions. Port B drives six LEDs for indicat- ing the seconds, Port C drives six LEDs for indicating the minutes and portD takes care of driving the five LEDs for indicating the hours. Two pushbuttons on port E let you adjust the time (SI for the hours and S2 for the minutes). This leaves port A avail- able to drive the LCD display in 4-bit mode. For completeness, this display also shows the time, as well as the day of week (1 to 7), S3 is used to reset the processor, which also results in the seconds being set to zero. The current through the (white) LEDs is about 1 1 mA, which means that the total current supplied by the PIC will always remain below 200 mA, The LEDs project their light onto white opaque glass, which is covered by a transparent sheet with numbers printed on it. On top of this is a clear pane of glass. The LEDs are mounted in a frame with holes, so they will always remain neatly in place. For the power supply you can use a mains adapter with a stabilised 5 volt/400 mA out- put, Goldcap C4 is optional and can be added if you want to stop the circuit from losing the time when there is a brief power cut. At midnight the time jumps forwards by 54 seconds in order to keep the exact time (if required, this can be changed in the Flow- code). This Is necessary because increasing or decreasing the internal counter is either just too much or too little to keep perfect time. In the photo the time is: 16+4+1= 21 hours (bottom row) 32+16+8+1^57 minutes (middle row) and 32+16+4+1=53 seconds (top row). With the circuit housed in a suitable enclo- sure, you end up with a nice looking designer- clock, which is guaranteed to be noticed by any visitors! ( 090187 ) Web links: [1 ] wwwmatrixmu ltinrcedia.com [2] www.etektorxom/090187 LCD1 LCD 2x 16 (H 044780 Compatible) 3 £ O tu +5V Pi / 4 1(7 7 S 9 10 11 12 13 14 k ftESET 'LL 012 I I \ 22 m Y .H d1) ■H 010 "15 X FI +5V) 1 — t - 400mA T 0 +5V ■© C4 ° > QF47 5V5 220 R 22 GH +5V © Ti 10 33 34 35 R14 36 - 22QR | 1 37 R13 30 -I 1 39_ R12 40 I C3 lOQn 11 32 © © MCLR/VppfTHV RCO/T 1 OSO/T 1 CK I HCirriOSl/CCP 2 RC2/cm RC3/SC«ySCL RC4/SDI/5DA RC5/SDO BCenx/CK RC7/RJUDT FEO/AN^RD RE1/AN6/WR RE2/AN7/C5 PIC16F874A/877A RAO/ A NO RA1/AN1 RA2/AN2WREF- RA3/AN3/VRFF+ RAjnrocKi ICl RA5/AW4/SS 23 24_ 25 26 RSMNT R01 RB 2 RB3/PGM HB4 RB5 RB6/PGC RB77PGD Jm OSC1 HDQ/PSPO RDVPSP1 RD2/PSP2 HI>3fP0P3 RD4/P5P4 RD57PSP5 RD6/PSP6 RD7/PSP7 OSC2 _ 19 20 21 22 27 p 29 30 12 13 X h" 1 u 1 Cl C2 , *»T . 31 XI = 19-BBDBDOMHZ 16 FB 17 rH 2208 - 13 R9 Rfi H 220 H I - R7 Dt D 2 220R D3 f — j 220 R l t>4 D« - M - H 22QR j - R19 ft. 1 220 R RIO □ 14 ik-i mi M2 m ++ M8 M16 M32 220 R 1 05 M. Rii M 220 R [ 06 R22 22 QR F □ 17 1— rls n 016 Hi ■■ HS SIS , 013 t\ RIB 4 220 r h HI H2 H4 H16 090107.11 58 7 / 8-2010 elektor Atlas DCA - Model DCA55 Continual Development PEA K - making the best, even better. ” NEW MODEL The New Atlas ESR Plus , Model ESR70 This new model of the famous Atlas ESR offers all great features of the ESR60 but with extended measurement range and audible alerts. This is the Atlas ESR Ptusl the * Capacitance from luF Id 22.0G0uF * Equivalent Series Resistance from 0.01 ohms to 40 ohms. * Gres! for ESR and low resistance measurements (short Iracing) * Automatic controlled discharge function for your charged caps. * Audible Alerts (for good ESR. poor ESR. open circuit and more). * New universal gold plated 2mm plugs fur any test probes* * New software now enables componcnLio -component continuous testing without pressing the test button, giving readings and tones for every component tested. * Supplied with detachable Gold plated croc clips, many more probe types available including insulation piercing prods. * User Guide (with comprehensive ESR charl) and Saitery. New 2mm Probe Connections! What are these new probes ? m Atlas LCR - Model LCR40 Atlas ESR - Model ESR60 Our LCR and ESRs now feature our universal 2mm plug connectors Now you can securely connect a very wide range of pmoes, hooks Crocs, sharp prods tweezers. Insulation piercing prods Cold plaice) 2mm banana^ plugs Gold Hooks Shrouded Crocs Passive component analyser. Automatically identify and measure inductors, capacitors and resistors. Auto frequency seleclion. NEW Universal 2mm probe connectors Supplied with hook-probes luH - 10H IpF - fO.flOQuF 1 Ohms - 2M New 2mm Prqb Connections! £79 Inc VAT * As featured wi\ Efektor i LCR Shootoiih J Measure capacitance and ESR 1 Capacitance from IljF to22,000uF E5R from 0,01 ohms to 20 ohms Battery + Gold plated croc dips £75 Inc VAT New 2mm Prob Connections! Peak Electronic Design Ltd, West Road House, West Road Please add £2 75 p&p per order Prices include UK vat Bu xto n , Derbys hi re , SK 1 7 6 H F See website for overseas prices . tel 01 290 700 1 2 www. peake lec.cb.uk Sal es@peake 1 6 C . CO , lik Special Offer prices for limited period or while stocks last. The famous Peak Atlas, now with £$*% * fitted premium probes Just connect any way ** round to identify the type of semiconductor, pinout and lots of parameters too. Complete with battery, user guide and probes. Dgrlingtons MOSFETs Diodes T ransistors LEDs and morn... Atlas Star Pack (LCR/DCA) includes the Atlas LCR Passive Component Analyser (model LCR4Q), Atlas DCA Semiconductor Analyser (model DCA55), premium padded carry case and user guides Complete with extra spare battery. YouTe ready to go! £125 irtc VAT 50 PIC Microcontroller projects A laser alarm, USB teasing mouse, soundswitch and much more This book contains 50 fun and exciting projects for PIC microcontrollers such as a laser alarm, USB teasing mouse, eggtimer, youth repellent, soundswitch, capacitive liquid level gauge, "finger in the water” sensor, guarding a room using a camera, mains light dimmer (1 10-240 volts),, talking microcontroller and much more. Several different techniques are discussed such as relay, alternating current control including mains, I2C, SP1. R5232, USB, pulse width modulation, rotary encoder, interrupts, infrared, analog-digital conversion {and the other way around), 7-segment display and even CAN bus. Three PIC microcontrollers are used in this book, the 16f877A, 18f4455 and 18f4685. It is also discussed how you can migrate your project from one microcontroller to another - 1 5 types are supported - including two example projects. 440 pages * ISBN 978-0-905705-88-0 £36.00 - US 558,10 fclektor Reg us Brentford 1000 Great Wes l Road Brentford TW8 9HH United Kingdom Tel. +44 20 8261 4509 Further information and ordering at www.elektor.com/shop elektor 7/8-2010 59 Hexadocube Claude Ghyselen (France) The Hexadocube is a cube or die where each face is occupied by a Hexadoku, The problem to be solved (the six linked grids) is just a flat 2D representation (referred to as the development) Note that the face numbers that appear in the background are arranged in such a way that the numbers on opposite faces always add up to 7, just like on a die. Each grid uses figures from the hexadecimal system, i.e, from 0 to F. Fill in each grid in such a way that all the hexadecimal figures from 0 to F (0 to 9 plus A to F) are used once and once only in each row, column, and square of four boxes (marked by a bolder outline). Certain figures have already been entered in the grid to define its starting situation. Attempting to solve each grid individually is impossible, as each grid is linked with its four 'neighbours' by the boxes lying along the edges of the cube (boundaries) that separate them. These boxes are coloured yellow, and are deliberately left empty in Where to send your entry? Send your answer (the figures in the greyed- out section, from bottom to top) with your address by e-mail, fax, or post before September 1, 2010 to: Elektor Hexadoku - 1000, Great West Road Brentford TWS9HH * United Kingdom, Fax (+44) 208 2614447 Email: hexadoku@elektor.com oin in and win! Send us the six hex figures in the greyed-out area (from bottom to top). Well hold a draw of all the correct international responses we receive: the winner will receive a complete Sceptre-lntersceptre kit worth £236 We’re also giving away three Elek tor gift vouchers worth £40 each. So get those grey cells working! No corresponded e will be entered into, and Elektor International Media staff and their Families may not enter* One winner only per household. Prize winners The solution of the May 2010 Hexadoku is: C81BA. The £80.00 voucher has been awarded to: Olivier Heurtel (France). The £40.00 vouchers have been awarded to: Darjo Brlec (Slovenia), Recep Alaca (France) and Werner Stumpf (Germany), Congratulations everyonel 6o 7/8-2010 elektor the opening situation, [ he values that fit in a back-to-back pair of these boxes (either side of an edge, hence belonging to two different faces) must be the same. For example, a character A found on face 1 along the edge with face 2 wifi have to be copied across into the box on face 2 on the other side of the boundary. In the same way, the corners of the cube (there a re eight of them . cofoured orange) which belong to three faces must have the same values on all three faces, ( 090724^ i) CM < 1""- CD CO CD CM Ll CD CO CD PD ur> O CM Q 00 00 o in < h- co CD O < CO N LU Q 00 in O to O u- UJ O LL < LU CM CO LQ CM CD CD CM CO r^ 05 ll rT * k j j ll r r '•* t r 1 0 8 1 9 F 4 c 8 2 4 D 5 9 2 0 2 E 9 6 1 A B 2 | A D 1 A 1 B c E 6 3 E 8 7 E D B 1 E 4 0 3 B 9 F 3 5 ”1 7 B L ] 3 5 A 0 1 9 B 3 8 9 F 7 C 6 3 0 7 A D i. CM in O' 00 LU IO < - O CD CO M" Ll CO D h- CD CQ LQ CO a CO CO h- <- LD CO CM 00 LQ CM CO 0 CD 0 'sr < IO CD CD O CD CO oo < nT 0 05 CM O Q CO in CD O 0 CD O < CD CQ in < xt CO CD 0 CM OQ L 3 8 9 V a s d 6 d 9 V V e L P 9 a 1? z 5 - 1 0 0 I s 1 3 6 z 8 L S a 8 9 0 6 8 3 s 0 l 2 0 0 L a 3 P a 0 s 2 L V L 0 a 1 3 a l. Z 6 0 8 d 3 V £ 0 6 elektor 7/8-2010 61 USB Tilt Sensor Wilfried Waetzig (Germany) A tilt sensor is a very versatile device: for example, it can be used as a (game) control- ler or as an alarm sensor to protect valuables. The circuit described here uses the same sen- sor as we used in our two-axis accelerom- eter project J 1 L The Freescale MMA726QQ can measure accelerations along three spa- tial axes, producing three proportional ana- logue output voltages l 2 L The sensitivity of the device is adjustable in four steps. For the purposes of this project we use the 800 mV/g setting, giving a full-scale range of -1.5 g to + 1 .5 g on each of the three axes. The 1C comes in a tricky-to-solder QFN package, and so to make life easier we have made available a small carrier board with the device already mounted { H MMA7260 on carrier board', order code 090645-91: see I 3 )), The carrier board is simply plugged into the main board via two 4-way pinheaders. If the main board is now tilted about its main hori- zontal axis (or about the perpendicular hori- zontal axis), the sensor will record an acceler- ation in the X (respectively Y) direction equal to some fraction of 1 g, the acceleration due to the earth s gravity. From this value we can determine the tilt angle. In practice the sensor is not tilted about just one of its axes, and this is where the Z-axis acceleration measurement comes into play: we can use this value to help determine the deviation from vertical of the axis perpendicular to the main board. In gen- eral we can use the three acceleration values to compute a tilt angle in the X and Y direc- tions, assuming that it is held steady and not subjected to any translational accelerations. Based on the author's suggestions, Elektor lab trainee jerry Jacobs designed a compact printed circuit board, which can be ordered via the Elektor website l 3 l. As usual, a pre-pro- grammed microcontroller is also available, or, if you prefer, you can download the software as a hex file or as source code and program it yourself. The circuit is relatively simple. The central component is an ATmega8-16 microcon- troller, which drives an LCD panel via port B and which is controlled by pushbuttons con- nected to port D. The analogue signals from the acceleration sensor are connected to the analogue inputs ADCO to ADC2. Practically all the passive components are concerned with decoupling and smoothing, K 2 £ 7 10 15 27 2 a causa CBUSi C0U52 CBUS3 C01FS4 FT232RL DSR USB DM DC0 USB DP CTS OSCl OSCQ TEST 0 C 2 ;j Z z z z o (3 U <5 < USB MINI B ce u-i — i r-4 1 i •r-j — 4 5 _G_ _1C il 26 C9 1G0n SI H 32 H LCDl *5V O LI IOuH T C2 iDOn Displayed* 162 A 2x16 crt Sis! w ■o ■“ PH rt o Ca Q o a <; O a 0 Ifl Ul h- LU LD Qi O O _J _J u o a u 1 IC2 RESET AOC3 ADC4 ADC 5 ADC5 ADC 7 P 0 G 73 ; • S3 H ii 3d FD 3 ATrnegaS-lfiAU pgi P82 PB3 fMOSIl PBd |'M ISO J PBS iSCKl o d S as ^ £ <3 & K < £ a z O r r " ! hfi lO Kt H ji 1— dMHi > — — * +5V o- K 12 13 Id 15 18 17 CS 1 0 On. I +5V o in K3 16 0 0 0 6 6J fSP 070829-11 62 7 / 8-2010 elektor ■ ■ ith the aim of making the analogue meas- - ements as accurate as possible. Particu'ar attention is paid to smoothing the analogue s jppty to the microcontroller (AV cc ) a : ovver is provided over a USB connection, which also provides a means to transfer the measured angular values to a PC or other nost. The well-known FT232RL device is used as a UART-to-USB bridge. The 3,3 V power supply for the sensor, which also forms the reference voltage for the ADC. is provided by the FT232RL, which obviates the need for a separate 3.3 V regulator, Mow we turn to the mathematics involved, which are essential to understanding the soft- ware. The ADC resolution is 1 0 bits and so the analogue voltages at ADCO, ADCl, ADC2 are converted to digital values as follows; val = U ' 1024/V re f, where V ref =3.3 V. A value of V rcf /2 = 1,65 V corresponds, according to the device datash- eet. to an acceleration of 0 g; V = 2 .45 V corre- sponds to +1 g and 0.85 V to -1 g. For tilt angle measurements these are the maximum and minimum values that should be encountered, corresponding to inclinations of +90 c and - 90 D . Call the corresponding ADC conversion results (760 and 264, obtained from the for- mula above) ADC max and ADCmin, In practice the system must be calibrated before making measurements, which In this Jakob Trefz (Germany) PP3-size 9 V batteries (IEC: 6LR22) have a con- siderably poorer price/energy ratio than 1.5 V AA (IEC: LR6) cells. This makes it all the more unfortunate when you accidentally leave a device switched on! The author uses a number of such devices and so started looking for a solution to this problem. His first thought was to use a DC/DC co n ve rter to al !o w the use of 1 , 5 V cel Is in 9 V equipment, A perfect device for this applica- tion Is the Prema PR4401 LED driver. The 1C is small, with just three connections, and the required externa! circuitry consists of just a coil, a diode and a smoothing capacitor. The d e vice ca n convert i n put vo I tag es of between 0,9 V and 1.9 V to 9 V with acceptable effi- ciency. The maximum load is around 3 mA. case means determining the values of ADC- min and ADCmax for each of the three axes. Each axis is calibrated separately, by holding the board vertical in all possible orientations: t is easiest to hold it against a solid vertical surface. At the end of the process we have determined all the ADCkmax and ADCkmin values (where k-0 for the X axis, 1 for the Y axis and 2 for the Z axis). Button $4 then starts the measurement process. The readings are smoothed by aver- aging 16 consecutive conversion results, which helps to reduce the effect of small vibrations. Given the current averaged readings for ADCkvalue (where k runs from 0 to 2) the software calculates: (X/Y/Z)gval = ( ADCkvafue- ADCkmid ) / ADCkdif where ADCkmid - (ADCkmax + ADCkmm)/2 and ADCkdif = (ADCkmax - ADCkmin)/2* XgvaT Ygval and Zgval are then the measure accelerations (as a fraction of 1 g) along each axis, Freescale Application Note AN3461 i 4 l describes a method for deriving the values xangle, yangle and zangle: tan (xangle) - Xgva! j sqrt ( Ygval A 2 + Zgval A 2) tan (yangle) - Ygval / sqrt (Xgval A 2 + Zgvaf A 2) L( However, this is only half the story. Even when there is no load at the output the 1C still draws current, and so the battery will eventually run flat even if the equipment is switched off. This means that some kind of automatic shut- down circuit is needed. How can we make a tan (zangle) = sqrt (Xgval A 2 + Ygval A 2) / Zgval Here xangfe is the pitch (the angle the X axis of the acceleration sensor makes with the horizontal, positive for a clockwise tilt viewed from in front of the board), yangle is the roll (the angle the Y axis of the accelera- tion sensor makes with the horizontal, pos- itive when the board is tilted towards you) and zangle is the overall tilt (the angle the Z axis of the acceleration sensor makes with the vertical, positive for any tilt). When the board is horizontal, all angles are zero. The web page accompanying this article DJ links to a free extra document for down- load covering initialisation, calibration and more. There is also a brief description of the communication protocol used with the PC, and details of fuse bit settings in the micro- controller. The web page also includes the parts list and software downloads, and links for ordering the microcontroller and circuit board, (070829) 1 1 1 www e I e k to i\ c o m / 060 2 9 7 (2 1 www.freescale.c om /files/sensors/doc/ data_sheet/MM A7260QT.pdf 1 3 j www*elektor.com/070829 |4| http://cacheTreescale.com/flles/ se n so rsVd oc / a p n o t e , AN 34 6 1 .pdf a +u B timerthatrunson less than 1 volt and which consumes only a negligible current? The answer was found in the form of a MOSFET with a very low on resistance and a thresh- ofd voltage of just over 3 volts. This voltage is still more than twice the terminal voltage Virtual 9 V Battery elektor 7/8-2010 S3 of an AA cell, however; we need to gener- ate a sufficiently high voltage (greater than 3 V) briefly and store it on a capacitor. The capacitor wall discharge very slowly into the gate of the MOSFET to which It is connected, which will then cause the connected device to be powered fora few minutes before being turned off. The self-inductance of coil L is used to gen- erate the higher voltage. When switch S is briefly dosed a current flows in the coil. We need to check that the maximum gate voltage of the MOSFET (20 V) will not be exceeded: from the maximum input voltage (approxi- mately 1.6 V), the current that briefly flows through R (approximately 1.5 mA) and the inductance of L we can calculate how much energy can be stored In the coil. When S is opened C Is charged via 0, and we can then work o Lit the resulting voltage across C With the component values given, this comes to about 5 V. The author’s prototype gave a power-on period of 15 to 20 minutes. (090G92) Bench PSU for PC 3 Ludovic Voltz (France) Given that every PC has a powerful, well-regu- lated PSU that supplies, among other things, a 12 V rail, why not make use of it to produce a PSU variable from L25 to 10 V? Well, that's just what weTe proposing to do here. This power supply can also be used as an addi- tion to a conventional bench supply in order to simulate an analogue voltage, if the bench supply has only one output. The conversion part is entrusted to the cheap and very popular MC34G63 DC-DC converter, arranged as a step-down. Using a switching solution makes it possible to limit losses due to the Joule effect. The MC34063 is associated with a microcontroller, aided by an LCD display (1><16 characters) which lets you display the output voltage along with the current being supplied by the PSU (connect K3 to pins 4 an5 of K4), Under ideal conditions, 700 mA may be drawn, but don’t worry, the 1C includes a current limiter which will come into action as soon as you go over the limit. Program the microcontroller using the soft- ware available from PI and adjust P2 to make the displayed output voltage correspond with the actual value. Note that certain single-fine 16-character displays behave like a display with two lines of eight characters. The down- load contains two HEX files for dealing with both eventualities. K4 V+ o o o 11 12 4 RAO 5 RA1 tCSP 13 VOD AA5 103 RCQ RA4 &C1 R A S.'f.lC LiR/VPP RC2 RA2 RC3 RAt FTC-4 FA0 RC5 PIC1GF616SL vss to 14 14 13 12 11 10 ♦-f V+ © P3 \ LJ> 10k SoSSSSE5*?So§S f \ LCD! j 090B&3 11 Once the PSU has been assembled, you will be able to house it in one of your computer's spare slots for a SVi-inch floppy disk drive. One last little detail: to allow more accurate setting of the output voltage, you can include a second 1 kQ potentiometer in series with PL [ 1 ] www.elektoreom/090863 Green/Red Multiflasher Ken Barry (UK) This circuit can be made to produce inter- esting and attractive light effects using just a duster of red LEDs and one of green LEDs. One effect is first alternating between red and green, and then lighting red and green 3 together. With the exception of the triple LED devices (Rapid Electronics # 56-0205 for green, # 56-0200 for red) all parts are 64 7/8-2010 elektor m) VJ/ tC2 ICZ = 40106 R1 ~| '90- \ ~ IC2,F 13 JM u 13 * CT ‘ DO j 1DV 15 16 © CTfRWVKV DEC IC1 & 4017 CT=E> & 7 8 * 4 3 3 X 0 CT-:5 n_ 9_ 8_ 5_ 1 JO 7 R4 Ci.A T C4.A 6fi0n 04 0 C5.A on pi 2 T — T — T R2 R6 i m T ± +6V.„+9V — © R7 BC547C IC2.C #1 IC2.B n\ ■v 4 IC2.A iM T2 BS170 f 05 .A To&.B I DS.C ■k Q3 0ATS2 1N4T48 t3 BC547C BC547C ■ DBC-lSB-lt using tri colour LEDs with a common anode. Rapid LED types shown, about 70 mA may be The power consumption of the circuit expected at a 6 volts supply voltage. depends largely on the LEDs used. With the f 09045s j meap and easy to find, possibly even in . our junk box. ^he values of networks R3/C3* R4/C4and R5 15 govern the length of the flashes. Using the ndieated values, these are about 18 seconds with a 0.5 second interval. Because the colours used do not have equal luminous intensity (expressed in millican- delas) D1 and D2 are silicon diodes and D3 and D4, germanium* with Schottky devices ( BAT82) as an alterative because they also exhibit a low forward drop of about 0.3 V. As germanium devices, look for the OA91, OA85 or AA1 19. If D1 and D2 are omitted, Green and Red are brighter by themselves than when on simultaneously, MOSFET 12 switches both LED devices on simultaneously arranging for roughly equal luminous output. The display has an integrated LDR that causes the LEDs brightness to adapt automatically to darkness and bright light conditions. The circuit has lots of openings for experi- mentation and adaptation, forexample, the flash rate is determined by the value of Cl , while the link between the counter’s R (reset) input and 03 output determines if a space Is inserted after the last flash, or not* Colour- ful and lively effects may also be obtained by Ian Fiefd (UK) Anyone who's spent much time searching the web for interesting circuits is likely to have found at least one FL431 based audio amplifier, thecircust being based on the prin- ciple that any comparatorcan be used in lin- ear mode if iDs rolled off with enough neg- ative feedback. Although the TL431 is often referred to as a programmable or adjusta- ble zener, it is in fact a comparator with it's own 2.5 V reference all neatly wrapped up in aT092 package. The problem with the TL431 amplifiers to be found on the web is that they simply roll it back with large nfb and leave it at that, which results in very low gain, to make matters worse some such circuits make a bit of a hash of biasing the control input* The circuit presented here takes care of the low gain by adding an AC shunt to the feed- back path and using an electret mic for the input — the 2.5 V set on the control input at stable operating condition suits an elec- tret mic perfectly* The first prototype had a 35 ohms loudspeaker as a load (R L ), this gave good results although the TL431 ran a bit warm with a V cc of 12 V, An old 130 ohm telephone earpiece is likely to present a less stressful load. AC shunt C2 (100 pF) has to be a quality component in terms of its ESR spec- ification — don't just use a scruffy capacitor lying about as you may experience RF sensi- tivity. It was necessary to add a series resistor (R3; about 100 ohms) or in extreme cases an inductor (LI; 100- 220 pH), Components Cl & R1 are entirely optional to selectively feed some un-shunted feedback to reduce noise; 1.5 kfl & 5.6 nF are as good a place as any to start off with. Initial set up depends on the current drawn by the electret mic and the value for R, — any- where between 200 and 2,000 ohms is good. R2 allows the TL431 cathode to swing despite the AC shunt, 1.2 k Q was found to be satisfac- tory. PI can be a 47 kntrimpot and is used to set the voltage drop on R L . In the case of mov- ing-coil speakers a compromise between volt- age swing and pre-biasing the cone should be sought, with a resistive load adjust for 0,5 V cc , once the operating point Is determined PI can be measured and replaced by an equivalent fixed resistor. +9...12V The circuit has a couple of handy features, firstly it works very well on the end of a twisted-pair — the output can be tapped off at the wiper if ft, is a pot at the power supply end* secondly by salvaging the JFET from an old electret mic (some common types of JFET will work but not quite as well), just about elektor 7/8-2010 65 any piezo electric element can be used as the transducer. Brass disc sounders give a good output (handy as vibration sensors if glued to a structure); even the quartz discs from clock crystals give some output, a phono crystal cartridge gives a high output and the piezo- LED Tester Herbert Musser (Austria) In some circumstances it may be necessary to select LEDs with closely matched character- istics. This design makes the job a whole lot easier. It uses two tracking current sources to allow the comparison of the two LEDs under test. LED current is adjustable by potentiom- eter PI giving a range from 1 to 50 mA. Zener diodes Di and D2 ensure that the voltage across the LEDs cannot rise above 4,7 V, This prevents the LEDs from being destroyed if they are accidentally connected to the tester the wrong way round. Each of the two opamps together with a transistor builds a voltage controlled current source (more accurately a current sink). Each of the 100 0 emitter resistors act as a current sense, the voltage developed across them is proportional to the LED current. A voltage of 100 mV per mA of LED current can be meas- ured across the emitter resistor using either a DVM or panel meter. This allows precise con- trol and display of the LED current. Current through both LEDs track together with very good accuracy and makes it a sim- ple job to identify matching LEDs, (080315) ceramic pel let from a fii ntless cigarette lighter gives a huge output,,, the range of possible applications is awesome! A surprising application is the ability to test the mlcrophonic sensitivity of ordinary capac- itors! Disc ceramic types don't need to be tapped very hard to produce an output but rolled metalised foil types produce some out- put too. V-K Voltage Difference Magnifier Egbert Wolters (The Netherlands) This circuit was designed for monitoring the charge- and discharge process of a 6-V lead-acid battery. This process takes place between 6,2 V and 6,8 V. The author used a measuring instrument that has several meas- uring ranges (0-1 V, 0-10 V, etc.). The 10 V range, however, is too coarse for this meas- urement, A better measurement result could be obtained if 6 V were subtracted from the measured voltage. The measuring range would then be from 6 to 7 V. A single opamp such as the LF351 suffered + 15V from mutual dependency of the measured and offset voltages and was therefore not suitable. The AD620 from Analog Devices, however, has been especially designed for this type of application and works well. In this opamp each of the input signals has its own opamp, so that they do not interfere with each other. The schematic is simple. The offset voltage can be set accurately with a 10-turn poten- tiometer The resistor of 5.49 kO (1%) can be connected or removed from the circuit with a jumper; without the resistor the gain 66 7/8-2010 elektor is one, with resistor the difference voltage will be amplified 10 times (9. 998 times, to be more accurate). The AD62G draws slightly more than 1 mA (idle current is 1.3 mA max.), so that battery power is also an option. The 1C can be used with power supply voltages ranging from ±2.3 Vto ±18 V. Small button cells could even be considered when doing only brief meas- urements. The maximum differential voltage is 25 V, something that you will have to take Into account, particularly if you are going to measure an unknown voltage. The greatest DC-accuracy is obtained with the version of opamp shown in the circuit. There Is also a cheaper version, the AD620ANZ (the Z stands for lead-free). For a good application note about the AD620 we can recommend the document that describes the evalua- tion board made by Analog Devices (EVAL- ll\IAMP-62RZ_82RZ_82_RMZ.pdf at Ml), in addition to the data sheet, of course. (091035-1) Variable Crystal Filter £ R1 ^in Oo i i X1 BB204 D1 R3 X2 1 [ B8204 Zoiit rlKH-lfll-O* 02 R2 a R4 *— * * ♦ ^ i: O 100156- II Cert Baars (The Netherlands) Crystal filters are often used for IF filters in receivers, where the bandwidth of this fil- ter largely determines the selectivity of the receiver* The unique feature of the filter described here is that the bandwidth has been made adjustable. The configuration is a so-called ladder filter with three crystals of the same frequency. Because the crystals should actually be iden- tical, we reco m m end that you buy three from the same production batch, which is gener- ally the case of you order/buy them all at the same time. Varicap diodes are usually specified from U = 0*5 V. The measuring result for 0 V is shown nevertheless* With a range in U r = 0 to 12 V, the bandwidth is adjustable from 2 to 6 kHz, which is suitable for the range of CW/55B to standard AM. 3 bandwidth (kHz) (V) ~r~ 0 2 6.2 17,9 0.5 2 J 7.0 20.6 1 3.2 7*7 22.0 2 4.0 8.5 24.4 4 4.6 9*6 29*9 8 5.5 10.7 33*2 16 6.4 12.1 38.5 30 7.3 13.6 40,2 Measured at 7 . m " - 330 n The ripple of the filter is determined by the input and output impedances Z in andZ 0l[t . With smaller values of Z [n and Z out the ripple will increase, but the roll-off will be steeper A compromise isZ iM -Z nuX = 330 Q resulting in a ripple of <3 dB* It is expected that the charac- teristics at other IPs such as 10.7 or 9 MHz will be much the same* (100158-1) Automatic Rear Bicycle Light Ludwig Llbertin (Austria) This is a design for a rear bicycle light that automatically switches on and off according to ambient lighting conditions. The red LEDs flash with a 50 % duty cycle to save energy; you can modify the circuit to light Lhe LEDs continuously if local laws require it. The cir- cuit can of course also be used as a safety light by pedestrians* The author bought a commercia fly-available rear bicycle light and replaced the printed circuit board inside with his own design: the circuit is shown here. Space was rather tight, and so surface-mount devices were used in Lhe construction of the prototype. Leaded devices would of course work just as well, and the 10 uF SMD film capacitors can be replaced by electrolytic?. The five high brightness red LEDs shown to the right of the circuit diagram were already present in the original unit, on their own circuit board along with their series resis- tors. This part of the unit was re-used. This explains the variation in value of the series resistors, which can be changed according to the brightness desired and the character- istics of the LEDs used* The original light also included a green LED (D6), which we do not use in this design. The circuit has two sensors: a vibration switch 3 (SI) in a TOIS-like package (for example, RS Components order code 455-3671) and an LDR (R 5, a standard type with a resistance when illuminated of around 250 Gland a dark resistance of at least 10 M0). When the bicy- cle is moved the vibration switch will open and dose its contact* generating pulses at the base of Darli ng to n T 1 via Cl , ca using it to tu rn on, C2 is thus charged and the input to gate IC1.A(pin 1) goes low* If it Ss sufficiently dark the voltage produced by the voltage divider formed by R4 and LDR R5 will be greaterthan 0.6 V, causing transistor 12 to conduct and C3 to charge. When C3 is charged a low level will appear at the second input (pin 2} to gate 1C 1 , A, elektor 7/8-2010 090796 - 11 If both inputs are at logic zero the output of the NOR gate will go high, causing FET T3 to conduct. As a result power is supplied to the astable multivibrator comprising R9, R1 0, R11 f C4* C5, T4 and 15, and the LEDs will flash at 5 Hz. They will continue to flash for as long as pulses continue to be supplied by the vibra- tion sensor 51 and as long as it remains suf- ficiently dark. If the vibration sensor stops providing pulses (because the bicycle is stationary) C2 will no longer be charged and will gradually discharge over a period of 2 5 seconds or so th roug h par- allel resistor R3. The output of the gate wilt go low and T3 will block: hence after the expiry of the 25 second delay the LEDs will go out. If the bicycle is moving and SI is delivering pulses, but the LDR is illuminated (perhaps by passing cars or by street lighting) the LEDs will continue to operate for about 70 seconds, with C3 keeping its input to the gate low. The circuit isdesignedto run on 3 V (two AAA celts). The quiescent current consumption is less than 2 pA and the batteries should last for over 300 hours of operation. In practice the vibration sensor was found to be so sensitive that it delivers putses even when the cyclist is waiting at a traffic light, and so the LEDs continue to flash. The LEDs only go out when the bicycle is perfectly still* The ambient light threshold can be set by adjusting R4to suit the characteristics of the LDR* To modify the circuit so that the light is steady rather than flashing* remove T4* T5, C4, C5, R9* R10 and RU and connect the cathodes of LEDs D1 to D5 directly to the drain of FET T3. ( 0907 %) The LM341 0 LED Driver 090950 - 11 Steffen Graf (Germany) The LM341Q 1C is a constant current LED driver useful In either boost con- verter or SEPIC design applications. A SEPIC (Single Ended Primary Induct- ance Converter) design allows the power supply’s output voltage to be set above, below or equal to its input voltage. In this application the chip is configured as a boost- co n verte r (i.e. the output voltage is greater than the input voltage). The LM3410 is available in two fixed- frequency variants. Using either the 525 kHz or 1.6 MHz clock version it is possi- ble to build a very compact LED driver* The output stage can supply up to 2,8 A, allowing several high-power LEDs to be driven from a rechargeable l ithium cell or several 1.5 V bat- teries* The chip also features a dimmer input giving simple PWM brightness control. Output current is defined by an external shunt resistor. To keep losses low the LM341 0 uses an internal voltage reference of just 190 mV. Rowes dissipation in the shunt resistor is therefore low. Using the desired value of LED current the value and power dissipation of the shunt resistor Is given by: R_5hunt = 0.1 9 V/!_IED P_Shunt = 0,19 V*I_LED A 10 pH coil (LI) will be sufficient for most applications providing it has a suitable satu- ration current rating. The Input and output capacitors should be 10 pF ceramic types with a low value of ESR. Many distributors including Farnell stock these components. The Diode should be a Schottky type (as in all switching regulators). The author has developed a PCB for this design; the corresponding Eagle files can be freely downloaded from www.elektorcom/090850* In sum- mary the most important features of the LM341Q are: - Integrated 2.8 A MOSFET driver, - input voltage range from 2*7 V to 5.5 V, - Capability to drive up to six series connected LEDs (maximum output 24 V). - Up to 88 % efficiency. - Available is 525 kHz and 1,6 MHz versions. - Allows both boost and SEPIC designs. - Available in 5 pin 50T23 or 6 pin LLP outline. (og 0850,1 68 7/8-2010 elektor Python Programming and GUIs Get started quickly and proceed rapidly This book is aimed at people who want to interface PCs with hardware projects using graphic user interfaces. Desktop and web based applicationsare covered. The programming language used is Python, an object-oriented scripting language; a higher level language than, say, C. Obviously having fewer lines of code will be quicker to write but also fewer lines of code means fewer opportunities to make mistakes. Code will be more readable, and easier to modify at a later date. You can concentrate on the overall operation of the system you are making. This abstraction also applies when writing graphic user-interfaces. Writing low level code for graphics and mouse clicks and the like is something that you do not have to do. in Python all this is wrapped up in relatively simple functions. The book guides you through starting with Linux by way of a free downloadable, live bootable distribution that can be por ted around different computers without requiring hard drive installation. Practical demonstration circuits and downloadable, full software examples are presented that can be the basis for further projects. 224 pages • tSBN 978-0-905705-87-3 £29.50 • US 547.60 Elektor Reg us Brentford 1 000 Great West Road Brentford TWS9HH United Kingdom Tel, +44 20 8261 4509 See your project in print! Eiektor magazine is looking for Technical Authors/Design Engineers if you have v* an innovative or original project you f d like to share with Elektor 's 140 k+ readership and the electronics community ^ above a verage s ki Us in desig ning electro nic circa its v* experience in writing electronics-related software v* basic sk i Us in complem en ting yo ur h ard ware or soft ware with expla natory tex t a PQ email and Internet access for efficient communications with Efektor's centra Uy /oca fed team of editors and technicians then don't hesitate to contact us for exciting opportunities to get your project or feature article published. Our Author Guidelines are at: www,elektor.com/authors. Elektor Jan Suiting MA, Editor Regus Brentford, WOO Great West Road, Brentford TW8 9HH, United Kingdom Email: editor@elektor. com elektor 7/8-2010 69 Sailor’s Battery Meter Anders Gustafsson (Finland) On a sailboat, the condition of the battery is a major concern for obvious reasons. On the author’s boat, a 120 Ah lead-acid battery is charged from a 25 watts solar panel* The bat- tery monitor described here was designed to give peace of mind. It consists of two sub cir- cuits: a sensor and a control/readout. Lead-acid batteries are subject to self-dis- charge, usually expressed as a percentage of the total capacity per month, at 25 C C A fig- ure of 5% for a 100 Ah battery means that you will have 95 % left after one month at 25 °C Self-discharge is temperature-dependent, doubling for every 10 D C above 25 °C and halv- ing for every 10°C below 25 a C. This is inciden- tally why batteries last longer if stored cold (but not freezing). To accurately monitor a battery you need to measure the current into the battery and out of the battery. You also need to monitor tem- perature to be able to calculate self-discharge accurately. To make things more difficult, nei- ther a photovoltaic panel, nor a fridge com- pressor represent constant sources or loads, instead they vary with time. Another prob- lem is that you need to accurately measure currents as low as tens of mA up to tens of amperes in our case and do so with reason- able acc u racy over time. The process to measure charge is called cou- lomb-counting and is basically an integra- tion of current over time* Having measured the current, usually with a small shunt, the result is integrated to form a value represent- ing the charge. To do this, you can either sam- ple the current and integrate numerically, or you can feed the current (or voltage) into a current (or voltage) to frequency converter and count the resulting pulses. Both meth- ods have their advantages and disadvantages The pulse-counting approach eliminates the quantisation error from the measurement, leading to better accuracy overtime. This was the approach chosen for this project. Here the BQ2Q1S from Benchmarq (now incor- porated into Tl) is used as a charge counter The BQ2018 is a tiny chip originally designed to be embedded into a battery pack* It is com- pletely self-contained, needs only a handful of discrete components and communicates with the outside world through a serial link. The BQ201 8 and associated components can be mounted on a small PCS and located close to the battery in order for the built-in ther- mometer to read the battery temperature. LCD1 7 ° 7/8-3010 elektor The same PCB contains shunt resistor R5 (Wel- wyn, 0.01 f>, 1 W, SMD, 20 ppm/K). Since the maximum input to the BQ2Q18 is 200 mV this gives a full-scale of 20 A. A maximum of 200 A or 400 A might be appropriate for larger ves- sels, in which case you will use a lower value shunt. Metal-film resistors are recommended for R4 and R6 to keep noise and thermal drift to a minimum. R4, R5 and R6 should be con- nected in 'Kelvin T arrangement with heavy duty wires on the R5 terminals. The sensor board communicates with, and is powered by, the control/dispfay board via connector K1. The control/display with its PIC16F690, LCD displayandpushbuttonscan poll theBQ2G18 at a leisurely pace of once every 30s, allow- ing plenty of time for the PIC to calculate and display average current. Since the counters in the BQ201S are ‘only’ 16 -bits, care must be taken to read and zero them before they have a chance to roll over. In ourcase this happens every 6 hours, but the design has circuitry so that you can put the PIC to sleep and let the BQ2Q18 wake it when current rises above a predefined value. To implement that in soft- ware is left as an exercise for the reader. Serial data from the BQ2018 is according to a protocol called ‘hdq 1 defined as 'single- wire, open -drain interface asynchronous return- to-one referenced to Vss\ While it is possible to use the UART in the PIC16F690 to read this, you need additional components to make it work and besides, the UART is needed for 03 the MM FA output. The problem is solved by the software using 'bit-bang' communica- tion routines to talk to the BQ2Q1S. Basically the PIC sends a command and immediately changes the output pin to input to receive data — this has to happen quickly as the first data bit may begin as soon as the command R/W bit time ends. If you define NMEA in the source file the mon- itor will output NMEA data in the form: ; $ I ixdr i tij wyyw*CS ; $ 1 1 XDR , A , aaaaaa * GS ; $ I I xpr , G , hhhhhh* cs That’s, volts, amps and charge. If you addi- tionally define IDEBUG then it will instead dump out data for logging: ; etc ; ccr ;dtc;dcr ; ctcO ;ccr0 ?dteG;d crO ; charge ; amps ; volts This is great for debugging and trouble- shooting. The source code file for the project Is available free from the Eiektor website I'l. The same applies for the PCB artwork. Readers without access to a suitable pro- grammer may obtain a ready-programmed PJC16F690 device from Eiektor under order #090117-41. To connect the sensor, you remove the nega- tive terminal from the battery, connect the negative pole of the battery to the + termi- nal on the sensor and connect the cable that used to go to the negative battery terminal to the - terminal on the sensor. Connect a wire from + on the battery to BATT+ on the sensor board and connect the headers K1 and K2 through a 5-wire cable. To calibrate offset, short the shunt and hold down the Up key, whilst powering on. The unit will enter calibration mode and show a running counter on the display. After approximately one hour, the unit will show the measured offset and store it in EEPROM. Next, to calibrate voltage, measure the bat- tery voltage with a DVM and adjust PI for the same voltage on the display. To set the unit according to youi battery parameters, press (Right) until you reach "Maintenance', then press i (Down). This will take you to a menu where you navigate with the Right and Left keys; Down on a value lets you adjust that value with the Left and Right keys. Down accepts and Up aborts without saving. The left and right keys scroll through a series of display modes where the default of zero is probably the most interesting. Please see the source code for an explanation of the rest. Finally, the author runs a dedicated web- site on the battery monitor at 1 2 I. Software updates will be posted there. (090117) 1 1 J www.elektor.com/090 1 1 7 [2] www.dalton.ax/battmeter Timer for Battery-Powered Tools Piet Germing (The Netherlands) Most hobbyists will have some tools that are battery-powered, such as a drill, screwdriver or power scissors. Unfortunately (and espe- cially with cheaper devices) the batteries often seem to be empty when you need to use such a tool. This is usually caused by the self-discharge of the batteries. However, it's not a good idea to continually keep the bat- teries on charge because the cheap chargers would ruin the batteries in the long term due to their constant charging current. On top of that, it is wasteful of energy. A simple method for charging cheap battery- powered tools in an environmentally friendly eiektor 7/8-2010 7 1 and battery friendly way is to limit the charg- ing period. The charging current from a simple charger is such that an empty battery-pack can be charged in about 5 hours ("fast' charger) to 1 5 hours (normal charger). Assuming a charg- ing efficiency of 70% it means that the charging current is between 0.35 to 0.1 times the battery ca pacFty in Ah. To com pensate for the seif-dis- charge oF a fully charged battery of a maximum of 5% the c harger has to operate at a duty-cycle of 1% and 3% respectively. In other words, charge the battery for a quarter of an hour or three-quarters of an hour per day using the orig- inal charger. I n this calculation we haven't taken account of the discharging of batteries due to the actual usage of the tools. The practical solution is very simple: use a 24-hour time switch, which can be picked up for a few pounds from a DIY store. The time- slots in the mechanical versions are usually for quarter-hour periods. When pins are used to select the period the minimum time is often half an hour. When you add a 4 -way AC power adapter you can charge multiple devices at the same time. It is recommended to keep the charging peri- ods as short as possible and to spread them out through the whole day, so that if the bat- tery becomes over-charged it won't have enough time to heat up too much internally, which Is the most common cause of damage. With this method it won't do any harm if you add one or two extra quarter-hour periods in the clay, so that partially discharged batteries can be fully charged again. ‘Always on’ for PCs Dr Rolf Freitag (Germany) Many enthusiasts will be using their PCs as data loggers, controllers or as web servers. In these cases it is important that the machine is kept powered up for as great a fraction of the time as possible, even if there has been a power cut or if the power button is inad- vertently pressed by another member of the household. Today's operating systems offer a range of automation options and it is per- fectly possible to arrange things so that the computer starts itself up automatically. The 'always on' circuit shown here automat- ically restarts an ATX PC in the above situ- ations, There are just two components: a Schottky diode connecting the power but- ton pin on the motherboard to the +5 V line on the power supply, and a ca pacitor from the power button pin to ground. The capacitor is a 68 pF tantalum type rated at 6.3 V, and the diode is a type SB 120, rated at 20 V and 1 A. The total component cost is in the sub-one- beer range! The most convenient arrangement is to mount the circuit directly on a 4-way Mofex disk drive power plug, insulating the capac- itor and diode using heatshrink tubing. The assembly can then be plugged into a spare +5V 0 (±^F* $3120 s ©■ GV3 PWR HUTTON 0 MAINBQARD -0 GND socket on the power supply. The operation of the circuit is straightfor- ward, When the +5 V supply fails (i.e., when the computer is turned off), the power but- ton pin on the motherboard is pulled low via the Schottky diode. This instructs the moth- erboard to power up again. As fong as the + 5 V supply is present, the diode blocks and the power button pin remains at high imped- ance, floating typically at around 3.3 V. The M capacitor serves to filter out spikes and brief dropouts. In its simpler version the circuit replaces the power button on the case, and the computer can now only be switched on and off at the mains. The author has tested the circuit on modern SuperMicro X8SAX and X8DTH-6F mother- boards as well as on an olderTyan Tiger MPX. He found that the capacitor value should be reduced in some cases: the SuperMicro mottb erboards have a high internal pull-up resist- ance which only charges the capacitor rather slowly. Note that some PC keyboards have a ‘Sleep' button which puts the computer into a low- power mode. In this case the circuit will not work, and you should either use a keyboard without such a button or disable sleep modes from within the operating system, in its more advanced version the existing power button is retained in parallel with the circuit (see circuit diagram). The powerbutton then causes a ‘graceful shutdown' whereby the operating system can bring the compu- ter to a halt in an orderly manner* (100084) Car Radio Booster Christian Tavernier (France) One solution for increasing the power of an amplifier running on a low-voltage supply, like a car radio powered from at best 14 V, is to use a ’bridge' configuration, i.e. to connect the loudspeakers between the outputs of two identical amplifiers whose inputs receive the same signals, but in opposite phases. This doubles the apparent voltage applied to the loudspeaker, which in theory quadruples the maximum power available. In practice, because of the various losses in the power transistors, we can only triple it* The peak- to-peak voltage applied to the loudspeakers in the car radio example is 28 V, less the losses in the power transistors, i.e. around 24 V. So we have an rms voltage of around 8.5 V (24 V / 2x2), which gives an rms power — the a only one we hear— of 1 8 watts (8*5 V 2 / 4 Q). The booster described here does noticeably better, as it can deliver up to 55 watts rms into 4 n with distortion of less than 0*5 % — and it's capable of 70 watts rms if you can put up with 10 % distortion. To achieve this, it does not break the laws of physics, but it does use a very original system for boosting the supply l 2 7/8-2010 elektor Dltage, using integrated power switches and " gh-value electrolytic capacitors. l uses just a single 1 C per channel, a ‘DA1562Q from NXP which handles both the newer amplification in class H and the volt- age boosting. Since our circuit is intended to oe fitted 'behind 1 a car radio, it has no volume control and its high-impedance input allows t to be connected to either the radio's loud- speaker output, or, preferably, to the line out- put that some car radios have these days. Capacitors C3 and C 6 are used for the volt- age boosting mentioned above. Via the TDA1562Q’s integrated electronic power switches, these are alternately charged up to the circuit’s supply voltage, then put in series with the supply, thereby doubling it to supply the power output stages. Given the very high currents drawn by such a process when C3 and C 6 are being suddenly charged, the supply voltage needs to be very heavily decoupled so as to ensure that it doesn't col- lapse momentarily when C3 and G 6 are con- nected across it. This is the role of C2. Transistor T1 drives a 'diagnostic' LED from information provided on IC1 pin 8 . This LED, off in normal operation, Hashes when the 1C detects output distortion (in fact clipping, i.e. distortion of 10 % or more) and lights steadily when the 1C detects a short-circuited output, in the absence of an output load, or when its thermal protection comes into operation. The ATT input can be left floating if you don’t need it. This is a mute control that puts the circuit into stand-by when grounded. No out- put signal is produced and the consumption is reduced to a minimum. The PCB I 1 ! carries all of the components and two of them will need to be built for a stereo application. Given the heavy currents involved, the wiring for the supply and the connections to the loudspeakers wilt need conductors with a minimum cross sectional area (c.s.a.) of 2.5 mm 2 . Obviously, the TDA1562Q must be bolted to a heatsink, the efficiency of which wilt gov- ern the maximum possible time it can work at full power, (091071 -ij [ 1 1 www.elektor.com/09 1 07 1 3 Normalized RIAA Curve Christian Tavernier (France) jt has an input for a magnetic pickup with let you convert this into a high-level linear If you*re short of inputs on your amplifier, RIAA correction, this very simple project will Input, making it compatible with the outputs elektor 7 / 8-2010 73 from all current audio sources* It won't have quite such perfect quality as a real line input* for two reasons. Firstly, our circuit is bound to introduce a slight reduction in the signal-to-noise ratio (SNR), as it attenuates a high-level signal and then amplifies It back up again. Secondly, minor linearity 'hiccups' are inevitable, as the correction it produces is not precisely the reverse of the R1AA correction applied by the preamplifier - but it is still perfectly accept- able* especially if it is only for playing MP3 signals! Our circuit diagram is extremely simple, as it's just a simple passive filter whose components have been calculated to reproduce the inverse R!AA curve to that in the preamplifier, i.e. the same as that used when cutting discs. It's per- fectly simple to build, but to avoid degrading the signal-to-noise ratio too much, we rec- ommend using metat film resistors* which are less noisy than their carbon counterparts* What's more* since the preamplifier mag- netic pick-up input applies a great deal of bass amplification* because of the RIAA equalization, the circuit is extremely sensi- tive to induced interference, especially from AC powerlines, and so it will need to be very well screened. We built it ‘in the air' and fitted ft into a salvaged metal tube (a medicine con- tainer) which acts as both case and screen. Given the components used, and although it does of course depend somewhat on the sen- sitivity of the magnetic pick-up input of the amplifier with which it is used* signals with an amplitudeof 200-600 mV rrns can be applied to this circuit without fear of overloading the preamplifier (091075') Pulse Receiver Siegfried Borst (Germany) The compact circuit presented here is perfect for receiving the signals from pulsed fixed- frequency transmitters. Chest straps from several well-known brands (Polar. Huger. Kettler, Crane. Outbreaker, ...) transmit a short signal burst with a fre- quency of 5.3 kHz. These sig- nals can be received and used in your own projects, as the author shows on his website PL The circuit uses a ferrite rad with 1000 turns of 0.2 mm enam- elled copper wire and a (tun- ing) capacitor to receive the sig- nals, The value of the capacitor (22 nF) has been selected for use at a frequency of about 5,3 kHz, but this can of course be adapted for use at different frequencies. The received signals are amplified by opamp (iCl), after which a NANO gate (IC2) turns them into a nice waveform with straight edges. For the supply you can use any DC voltage source in the range of 9 to 18 V. There is a board lay- out available ! 2 1, which can be ordered via ThePCBShop Dl. (080093) Web links [1 ] http://peterborst.gmx home, de/sigiborst 1 2] http://www,elektor. com/080093 [3] www.thepcbshop.com AC Power Indicator Jacob Gestman Geradts (France) The AC powerline indicator presented here has a complete galvanic isolation from the grid. The indicator is an LED that lights up when a current flows, although the cur- rent can be measured more accurately with an AC voltmeter set to its mV range. The detector is a transformer taken from an old mobile phone charger. The value of the secondary isn't important because we only make use of the primary 230 V (115 V) winding. The (extension) cable through which the current has to be detected should have an as short as possible section of its outer insulation removed. The wires should then be moved apart. The blue wire should be placed on top of the transformer and the brown wire underneath, or the other way round. The brown and blue Isolation shouldn't be removed, so there is no danger of the AC line voltage becoming exposed. If there is a green/yellow wire as well, this can be placed on either side of the transformer. The brown and blue wires should be in par- allel with the windings on the transformer. The secondary winding(s) should be left open circuit so that they don't attenuate the measured signal. In our prototype we found that an alternat- ing 50 Hz voltage of about 2 mV was induced when a 30 watt soldering iron was connected to the extension lead. With higher-powered devices the measured voltage rises propor- tionally. Since it is unlikely that the iron core of the transformer will ever become satu- rated, the relationship between the meas- ured voltage and the current flow should be fairly linear. 14 7/8-2010 elektor ^he transformer output signal is amplified bv a differential amplifier built around T1 and T2. * you wish, you can connect an AC voltmeter across the collectors of T1 and T2 to get an indication of the size of the current. The rest : f the ci re u it ta Ices ca re of lighting up the LED , , hen a current flows through the (extension) cable. The measured signal is amplified again by T3 and then T4 is used to drive the LED with a 50 Hz square wave, A 9 V battery is suitable ^orthe power supply. ,7hen a capacitor is connected in parallel with the primary winding of the transformer it can make the circuit less sensitive to frequencies otherthan 50 Hz, Ideally, the circuit should resonate at exactly 50 Hz. This will make the circuit most sensitive. The capacitor should be chosen such that the measured signal across the collectors of T1 and T2 is at a max- imum fora certain current flow. However, the capacitor isn't vital and the circuit still works well when just the transformer is used. When a low-current type is used for the LED, R1 3 ca n be increased to 1 2 k£l 5 mAmax. for Dl), flDOOjS} 49 V t I 1 2-volt Cellar Drain Pump TR1 R 2 B40C3700 12V 15VA © 240V R1 MT2 R3 TR11 IC1 T ^ let MT1 \ G " [T^n | BT1 39-600 FI s □AG MOC 3021 R5 1 T P 1^ 7 F2 F3 |b b RS H 30k | — C2 S lOOn □ q n n □ Ifl U LJ 2A 3A BT1 §. J. 12V 2Ah4 PI 02 Z C T ~ 5V6 U 10X C3 lOtm C4 D3 T 1 R10 12V 1N4007 240H Re TRF630 470u 1BV ♦ -• 090(514 ■ 11 Gustave Bolkaerts (Belgium) This circuit lets you control a pump* to keep the level of water in a cellar below a certain threshold, for example. Power is supplied to the pump by a battery that is recharged auto- matically when the AC powerline voltage is present. If the water level rises, the electrodes touch the liquid and a current begins to flow. The transistor then conducts and the pump runs. The pump stops when the water level has dropped sufficiently for the electrodes to no longer be in contact with it — but not straight away, as the voltage on the tran- eiektor 7 / 8-2010 75 sister gate is maintained for a few seconds more by the 470 pF capacitor. This makes it possible to ensure the electrodes are com- pletely clear of the water. The battery is constantly tested by the com- parator circuit around the TLQ71 1C. Its output drives the gate of the triac in the transformer primary circuit via the opto-isolator. The transformer secondary charges the bat- tery via the rectifier, using as little power as possible, and in this way keeps the battery at 13.2 V. ( 0906421 ) 8DZ60 Evaluation Board "? Toe. PTA7 PTGO PTGQ PTG1 ftST PTEtl PTE1 PT£2 PTE3 PTE4 PTES z' PTES ^ PTE7 / ■r PTDO PTD1 \RST S +5V 1 K3 O O a 9 10 11 12 13 11 IS IS O O o o o o o o o & o o o o o o -0 o o o- o- 32 PTA6 at PTA5 V| 30 PTAd ^ 29 28 27 PTA3 2G FTA2 ’S 25 PTAl N 24 PTB1 ^ 23 PTAO ^ 22 PTSO N 51 < \ 20 PTD5 19 PTD4 ^ 10 PTDO N 17 "A PT02 N \ +SV 21 \ PTAli 23 V.PTA1 25 \PTA 2 26 \PTA1 27 \PTM_30 S.PTA 5 31 \PTA6 32 \PTA7 1 \PTG0 A V.PTG1 5 \pt;-;q 22 lj \PTB 1_24 IsT y — * — i "n ^00n 2 .3 VOD RST 6K.GD PTAO PTAl PTA2 PTA3 PTA4 PTA5 PTA6 PTA7 IC2 VDDA pteq/txci PTEl/RXDl PTE2/SS PTE3/SCK PTE4/MOSI PTE S/M ISO PTE6/TX02 PTE7/RXD2 MCS08DZ&0 PTGWEXTAL PTG1 OCTAL PTBO PTB 1 PTDO PTD1 PTD2 PT03 PTD4 PTD5 7 PTEO / & PTE 1 _PTE2 / 10 PTE 3 / 11 PTEA/ 12 PTE 5 / 13 PTEti / 14 PTE 7 / 15 PTDQy /’ 16 PTOI / 17 PTD5/ VSS VSSA X IS _P102/ 19 PJD4/ 20 PTD5 y * KS PTES 4 \ PTE 7 ; ■O O <3 £> 26 +5V ©■ 12 15 PTEQ K7 4 /"V. 3 r f PTEi 2 i f 3 20 16 It I VCC C2+ Cl 4 C2+ Cie IC3 TUN T1QUT T2IN T20UT RIOUT run R20UT R2IN MAX233AEWP C2D ve C2D ve v+ , GND GND 1 A +sv <±> ^^00n VCC IC4 TXO CANL RXD CANH MAX3057ASA RS SHDN GND 090526 ■ II I SUBD9 K5 Joel Guittet (France) This development board around a 68HC508DZ60 microcontrollerfrom Frees- cate aims initially to be a platform for exper- imenting with the CAIM bus. So it's equipped with a CAN driver and the bus is available on a 3-way connector. The board also carries an RS-232 driver. Hence the microcontrol- ler's SCI1 port is available on a standard 9- pin female D connector. The CAN driver and the RS-232 driver can be disconnected from the microcontroller via jumpers. 76 7/8-2010 elektor The 5 V power supply (with LED indicator s based around SCI . This is a switching module from Texas Instruments, but can be replaced without modifying thePCB by a conventional 7805 (in this case, there is no need for R1 , which should not be fitted). The dock circuit can be disconnected from the microcontroller via two jumpers, as the microcontroller is actually capable of running on an internal dock. Connector K2 enables the microcontrollerto be programmed, while K3 gives access to all its pins (except for BKGD, which is only used for programming) for a piggy-back module, for example. The tools needed for programming are the CodeWarrior For Microcontrollers' software av ailable for free download from the Frees- ca e website and a 68HCS08 programmer. Here, there are several possible solutions, like the Multi link programmer from PEMicro or the Q5BDM l 2 - 3 i Some programming examples, along with lots of other information about Freescale microcontrollers, are available from the author's website I 4 1 The RGB design is available from I 1 !, The PCB gives you an opportunity to have a go at a double-sided board, as there are not many tracks on the back of the board and none of the holes need to be through-plated. (0905^6-1) [1 j www. elektor.com/ 090 526 [ 2 ) fomms.freesca3e.com/freescale/ [3] www.68hc08.net [4 J myfreescalewebpage.free.fr Animal-friendly Mousetrap Kees Reedijk (The Netherlands) This mousetrap is built around a PIC12F6S3 and uses an infrared transmissive optical sensor that is modulated at a frequency of 38 kHz, so that it isn’t affected by the ambi- ent light. The modulation is carried out by the PIC, which generates a 38 kHz signal at port GP2, which is connected to the IR LED, The IR receiver is a type that is usually found for use with remote controls. It reacts only to 38 kHz signals. It reports the presence of an IR sig- nal to the PIC via port GP1. When the IR light- beam is broken the PIC turns of the relay via port GP4 and FET Tt, whk: : causes the door of the mousetrap to dose. The transmissive optical sensor is housed inside a small wooden box. A small amount of food is placed inside this box. When a mouse walks through the light beam on its way to the food it causes the door to shut behind it and an LED starts flashing. The door is normally kept open by the coil of a relay that has been taken apart. When the coil is no longer pow- ered the tin door is pushed shut by means of a spring, A piece of glass or transparent plas- tic should be put on top of the box, so that the mouse doesn’t have to enter a dark space. When a mouse has been caught it can be let free again somewhere outside, some distance away from the house. The reset button has to be pressed to ready the trap for its next victim. The author has managed to catch a few dozen mice with this device. The program is written in POASIC Pro and can be freely downloaded from the Ele- ktor website, it is found in archive file # 100308-11.zip. elektor 7 / 8-2010 77 Tiny Pulser Wiffried Watzig (Germany) The author repeatedly needed several differ- ent digital signals for testing his circuits, and a simple function generator did not provide a satisfactory solution. He quickly developed a design for a pulse generator with three out- puts, as described here, which can gener- ate a variety of pulse trains with adjustable frequency. The heart of the circuit is an ATtiny13. This compact AVR microcontroller has five external I/O pins, of which three (PGO, PG1 and PB2) are used for the pulse outputs and two (PB3 and PB4) are used as inputs for the A/D converter. Switches Select 1 to Select 3 and the R/2R net- work (R5. R6, R7, R8, R1 3 and R14) are used to set a voltage on PB4 that selects the pulse mode (0-7) in the software. The pulse rate is controlled by the voltage on PB3. which can be adjusted with potentiometer R1 1 to cover the range from 290 Hz to approximately 8 kHz. The timing diagrams illustrate the pulse sequences generated in modes 0 to 6: a IC1 Modes 1 & 2: non-overlapping pulses with adjustable frequency (normal or inverted) Modes 2 & 3: fully overlapping pulses with adjustable frequency (normal or inverted) Modes4& 5: partially overlapping pulses with adjustable frequency (normal or inverted) Mode 6: three-bit binary counter with adjust- able frequency Fuses: CKSEL = 0,1 -» 4.8 MHz CKDIV8 = 0 no divide by 8 SUT = 1 1 0 slow rising power The source code and a hex file can be down- loaded from the Elektor website (www.elektor. com/090444), along with a ReadMe file with information about programming. If you don't want to program the microcontroller yourself, you ca n orde r a pre- progra mm ed device from the Elektor Shop at www.elektor,com/G9G444 (order number 090444-41 ). {090444-1) Mode 7 is a special mode in which PWM sig- nals at a frequency of 2300 Hz are output on the PBO and PB1 pins. PB1 provides a PWM sig- nal that periodically ramps up from 0 to 100% (0—255) and back down again, with a repetition rate of a pproximatety 0, 5 Hz , Th e PWM signal on PB0 can be controlled via the ADC3 input. The pulses from TimerO are output on PB2. We have more to say about TimerO further on. The firmware for the Tiny Pulser was written in assembly language using At me! AVR Stu- dio 4. Fast execution is especially important here because the output pulses are generated by software in the TimerO interrupt routine. The pulse sequence is generated using a cyclic counter with a range of Oto 7, and the values of the three output signals are stored in an array indexed by mode (0 to 7) and cycle state. Each time an interrupt occurs, the appropri- ate values are read from the PULSE[MODE, CYCLE] array and fed to the outputs. The ATtinyl3 microcontroller is clocked by Its interna! RC oscillator at 4,8 MHz, and the fuse bits must be configured accordingly: MODE Oil CYCLE 0 1 2 3 4 5 6 7 PBO: FBI: t f~\ PB 2 : — * 0 1 2 3 * 5 6 7 f MODE 2/3 CYCLE 0 1 2 PBO: PBi: PB 2 : \ \ MODE 4/5 CYCLE 0 1 2 PBO: PBI: / / PB2: —f J F I* \ \ 5 5 ii MODE 6 CYCLE PBQ: FBI PB2 09C444 ■ 12 78 7/8-2010 elektor Messe Miinchen International 24th International Trade Fair New Munich Trade Fair Centre 09-12 November 2010 Automotive e-Mobifity nme for electronics. Time for the future* * ~ t topics, trends and technologies, The latest components, systems and applications. :t electronica 2010, the international trade fair that will show you today what is " cortant tomorrow and generate momentum for real growth. electronica 2010 components i systems i applications ^raJlel event: hybridiea. Trade fair for hybrid-component production, www, hybrid ica.de .1 the whole picture www.electronka.de/en MicrcMinimal Thermometer Do Config Clockdiv = 8 "Set clock=1.2MHz Iwreset "Start 1-Wire comrmmicat ion lwwrite &HCC "Skip ROM lwwrite &K44 "Convert T Config Clockdiv - 64 "Set clock=sl50kHz Counter 0 - 109 Go sub Wait "Wait Is Config Clockdiv = 8 "Set clocks 1.2MHz Gosub Read t "Read T Config Clockdiv = 64 " Set clock^XBOkHz Gosub Disp t ’Display T Portb.l = 1 ’Prepare to read JP2 [Powerdown) CounterO = 255 Gosub Wait "Wait 7ms If Pinb.l - 0 Then Portb.l » 0 Loop Forth, 0 = 0 Portb.l = 0 Powerdown End . Exit Do 'JF2 closed? Exi Powerdown ! Vladimir Mitrovic (Croatia) The thermometer shown here is "micro" not only because it is built around the ATtiny13 microcontroller, but also because it can be built as a miniature device when built from SMD components. The temperature is measured by a DS18S20 high precision 1-Wire® digital thermometer from Maxim, The program inside the ATti- ny13A microcontroller initiates a single tem- perature conversion, waits until the conver- sion has finished, then reads and displays the result, the temperature can be read by count- ing red and green blinks from a two-colour LED, For example, 2 red and 3 green blinks will be produced if the temperature is 23°C, Blinks are easily readable because each blink lasts approximately 135 ms and is followed by a 400 ms pause. The same LED pair is used to display other events, too: T When the temperature is negative (centi- grade value), an R-G-R-C sequence with no intermediate pauses stands for the sign (red and green blinks are clearly visible); 2, 0°C is displayed as a 1 second long sequence of short red and green blinks (red and green fight blend together); 3. A communication error is displayed as a 1- second long red light. As indicated in the circuit diagram, two differ- ent two-colour (red + green) LED types may be used: 3-terminal {with common cathode) or 2-terminal (with red and green LEDs in anti- parallel connection). The ATtiny program is the same for both versions. Since LEDs con- sume most of the power, choose an appro- priate value for R2 to suit your own needs. A 1 00 resistor results in an 8 mA current flow through the LED that’s switched on. During the display period the LEDs are on at a 25% duty cycle, with 1 second conversion peri- ods between two display sequences to reduce the average LED consumption to roughly 1.5 mA, This may be considerably lowered if two separate red and green low-current LEDs are used for display. But even with 20-mA LEDs, the circuit may be powered by a small 3 V Lith- ium cell for a good period. Although in theory the instrument can meas- ure temperatures between ^55 c t and +125 D C, in practice it seems prudent to stay within the -15°Cto+50*e range. The DS1 820 can be detached from the rest of the circuit for as far as the 1-wire protocol allows: a 3-m ( 10 ft.) connecting cable was tested and everything worked well. If the sen- sor is properly Insulated, you can measure the temperature of water or other non-aggressive liquids. But the most common use of the pro- posed circuit is to build a small and simple thermometer with low power consumption, which will be at hand and functional when- ever you need it. With ]P1 closed the readout is in 'modulo 5 + mode: each blink of the red LED now equals 5, while the green blinks are still unity. Thus 4 red and 3 green blinks will occur if the tem- perature is 23 P C. If JP2 is closed, the microcontroller goes into power-down mode if the temperature is meas- ured and displayed forthe firsttime. This option consumes minimum power. To repeat the meas- urement, switch off the thermometer, wait for 1 to 2 seconds and switch it on again. The program developed for the project is called l E£_micro_T,has* and was written in BascomAVR for compiling and turning into object code. A small extract Is shown here. The complete program is a free download PI. Those without access to an ATlinylBA programmer or BascomAVR may buy their ready-pi ogrammed 1C through the same web page. Readers preferring Fahrenheit readout should modify the BascomAVR program accordingly. 1090654) 1 1 j www.elektOLt.om,' 090634 So 7/8-2010 elektor Waterproof Bathroom Switch Ludovic Meziere (France) The object of this circuit is turn the domes- tic lighting on and off in complete safety in a room with very high humidity. A detector, flush-mounted into the wall, detects the mag- netic field variations caused by the proximity of a hand and controls an AC power switch- ing system. Hence lighting control is achieved through the wall covering, with no exposed electrical equipment. Operation is based around a specialized 1C (IC3): the QT113A from Quantum (bought out a few months ago by Atmel), This 1C generates a puised magnetic field while a capaci- tive measuring system detects the var- iations, Any variation in the magnetic field results in toggling of its output. A series of filters avoids errors, and detection has to be confirmed three times before the processor wifi toggle the output, which avoids unwanted triggering, IIC3 has a self-calibration feature that enables it to adapt itself to variations in external conditions. The pulsed operation limits RF emis- sions as well as consumption. The electrode is formed from a piece of copper-clad PCB board of around 5 * 5 cm, which has had the photosen- sitive film removed to allow a wire to be soldered on for connecting it to the electronics board. The electrode must be kept a few centimetres away from the electronics board, otherwise it won’t work; this prevents you from being able to use a double-sided PCB with one side carrying SMD compo- nents and the other side acting as the electrode. The value of capacitor Cl will determine the sensitivity of the detector, and its value will need to be adjusted depending on the environ- ment and the sensitivity required. ]C3 K s output provides an oscillating signal that enables it to prove it is working, which means we have to use a small controller which will register the information provided by the detector and handle the load switching via an opto-triac and a triac, A standard ISP connec- tor is available for programming the micro- controller. A miniature transformer makes it possible to include a small 5 V PSU on the board and isolate the circuit from the mains. Isolation between the output and the mains is ensured by an opto-triac, but it's important to remember that one part of the circuit is con- nected to mains voltage. All the components are SMD types, but are still easy enough to solder using a conven- tional iron. The PCB can be fitted into an elec- trical back-box (e,g. Legrand Batibox) in the bathroom, for example, behind a tile. All you have to do to turn the light on or off is touch this tile with your finger. ( 090537 - 1 ) [ 1 j www.elektor.comj 09053 7 K1 L P N O o- MAIN5 TF1 1 N 4148 VBQ.35/3/6 CT 47u 16V C2 WMn ft ,C1 ♦ LP 3985 3 . 3 V VEN 6 P 1 N 4148 Vcc © Vcc © C 3 2 j 2 S 2 S 4 BY 0 F Pi' 2 C4 lQDn VCC PB 2 IC 2 FBI PB&/OCOA PB PRESET ATtinyl 3A GNO PBS PB4 RS 1 330 R F BC84SBLT1G T83S-6Q0G FI. 1 A IC3 t VOD QPTI SNS2 OPT2 QT113A OUT GAIN SNS 1 vss RX rx C5 3n3 R 1 111 J£X * ' s X 090S37- 11 8 l elektor 7 / 8-2010 Lights Control for Model Cars Manfred Stratmann (Germany) The author gave his partner a radio-control- led (RC) model car as a gift. She found it a lot of fun, but thought that adding realistic lights would be a definite improvement. So the author went back to his shed, plugged in his soldering iron, and set to work equipping the car with realistic indicators, headlights, tail lights and brake lights. The basic idea was to tap into the signal from the radio control receiver and, with a bit of help from a microcont roller, simulate indi- cators using flashing yellow LEDs and brake lights using red LEDs, Further red LEDs are used for the tail lights, and white LEDs for the headlights. Connectors JP4 and JP5 (channel 0) are wired in parallel, as are JP6 and jP7 (chan- nel 1), allowing the circuit to be inserted into the servo control cables for the steering and drive motor respectively. The ATtiny45 micro- controller takes power from the radio receiver via diode D1. T1 and 12 buffer the servo sig- nals to protect Id's inputs from damage, IC1 analyses the PWM servo signals and gen- erates suitable outputs to switch the LEDs via the driver transistors. T3 drives the two left indicators (yellow), T4 the two right indica- tors, and T5 the brake LEDs (red). The red tail lights (JP2-8 and JP2-8) and the white head- lights (JP2-9 and JP2-1G) are lit continuously. The brake lights are driven with a full 20 mA, so that they are noticeably brighter than the tail lights, which only receive 5 mA. If you wish to combine the functions of tail light and brake light, saving two red LEDs, sim- ply connect pin 10 of JP2 to pin 14 and pin 12 topinlb.Thenconnectthe two combined brake/taif LEDs either at JP2-5 and JP2-6 or at JP2-7 and JP2-8, JP3 is provided to allow the use of a separate lighting supply. This can either be connected to an additional four-cell battery pack or to the main supply forthe drive motor. The val- ues given for resistors RS to R17 are suitable for use with a 4,8 V supply. JP2 can take the form of a 2x10 header. As usual the software is available as a free download from the Elektor web pages accom- panying this article Ml, and ready-programmed microcontrollers are also available. The micro- controller must be taught what servo signals correspond to left and right turns, and to full throttle and full braking. First connect the fin- ished circuit to the radio control electronics in the car, making sure everything is switched off. Fit jumper J P1 to enable configuration mode, switch on the radio control transmit- ter, set alt proportional controls to their cen- tre positions, and then switch on the receiver. The indicator LEDs should first flash on both sides. Then the car will indicate left for 3 s: during this time quickly turn the steering on the radio control transmitter fully to the left and the throttle to full reverse (maximum braking). Hold the controls in this position until the car starts to indicate right. Then set the controls to their opposite extremes and hold them there until both sides flash again. Now, if the car has an internal combustion engine (and so cannot go in reverse), keep the throttle con- trol on full; if the car has an electric motor, set the throttle to full reverse. Hold this positron while both sides are flashing. Configuration is now complete and JP1 can be removed. If you make a mistake during the configuration process, start again from the beginning, ( 090834 ) [1] www.elektar.com/090834 82 7/8-2010 elektor flff' — Bektor let the atpjiU uaaaaj^jjF^fe SCEPTRf Logic/ *S5sgI|lfc biilEI ' A i. --- - 1 My Hi SCEPTRE RULE! A JJ-Ml ARM‘ r Uil pratn '^™ 1 jyttPtn ******** * tftiWttn* '"R* 1 pMX +■ Urtunfm** 1 ? 4 PirWr^Tl^ .Ifrr.-* LriHH*^ ' _ The upgraded Elektor-PLUS subscription! O Atl 1 1 issues including the Summer Circuits edition o Included in your PLUS subscription: Annua! DVD O 20% cheaper than normal retail price O Welcome gift worth £25 When taking out an Eiektor PLUS subscription you get exclusive access to www.elektor-plus.com where the O Up to 40% discount on selected Eiektor products O Eiektor is delivered to your doorstep every month o Read your copy before everyone else O NEW: On your personalized Eiektor PLUS website, you have permanent access to the three latest issues of the magazine in PDF format, as well as to a fast Eiektor search engine! three latest editions of Eiektor magazine are available in the form of pdf files (Le* 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 Eiektor search engine found on the web. However the upgraded PLUS subscription offers many more interesting extras like free E-books and supplementary articles. www.elektor.com/subs • Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. ■L> T 1 T» 1 T 1N4148 1K414B 090795*11 Ian Field (UK) The TDA7052A is a readily available amplifier chip (Parnell # 526198) that has a DC control- led volume Input, Here, the 1C is used as the variable gain amplifier in a guitar compres- sor, so the effect can be accomplished with- out the hard to obtain CA3080 operational transconductance amplifier (OTA). Note that the suffix- 1 ess TDA7Q52 does not have DC vol- ume control. The TDA7052A has a relatively low input sen- sitivity and also a relatively lowinput imped- ance, so common source jFET amplifier T 1 provides some pre-gain while emitter fol- lower T2 provides low impedance drive for id's input. Advantage is taken of Id's dual outputs to keep the diode pump and output loads apart, although distortion from this probably wouldn't happen as IC1 has very low output impedance (about 0,2 ohms). The output on pin 8 Is fed via DC blocking cap C7 to the level pot P3.The output on pin 5 drives phase splitter 13 whose outputs drive 14 and T5 on alternate half cycles. Both of these transistors in parallel discharge C9 which effectively holds the control voltage for pin 4 of (Cl + The input stage has a number of design aspects worthy of mentioning. The JFET stage will clip if the is too high. For T1, a 2N3819 can be got away with if selected for / ds5 less than 5 m A otherwise the input amplifier won't work. This may not be pos- sible with all brands of 2 N38 19. The J 1 1 3 shown here is spec'ed at 2 mA min. and no upper limit given on the data sheet. Source resistor R5 may be determined empir- ically by temporary insertion of a trimpot to set the drain to 0.5 V BATT , obviously cen- tring the drain operating point optimises the headroom for output swing. With lower val- ues of drain resistor ft may be possible to use u n sorted exa m pies of the 381 9, ft Is made abundantly clear in the TDA7052 A appnote and data sheet that good supply decoupling is important, hence it is recom- mended that C6 be a good quality electro- lytic. C5 is specified as 0,1 pF in accordance with data sheet advice, although if a mini- ature 0.22 pF that will fit in the available space is ready to hand — every little helps. C5 should be fitted as close as possible to the PCI supply pins. It is assumed that anyone who gets as far as building a board fora guitar pedal will know how to wire a bypass stomp switch, however there are some notes that concern the place- ment of the pots. Ideally only one pole of the two pole changeover stomp switch is needed, to switch the output jack between the com- pressed output and an additional pot on the pre-gain buffer. It is likely that PI (pre-gain) would be use- ful as a front panel control, and this is a good place to connect the bypass stomp switch. The best option is to use 2x 10 kil pot in par- allel instead of PI on its own, one wiper feed- ing IC1 pin 2 (pre-gain), the other feeding the stomp switch bypass (bypass gain), P2 (sus- tain) varies how much effect the voltage on C9 affects the voltage on IC1 pin 4 and there- fore controls the range of gain control. The circuit is supplied by the usual PP3 9 V battery, a slide switch can be wired in series with the positive lead from the battery clip if preferred, but it is common practice in the FX industry to use stereo jack sockets with the tip of the plug carrying the signal as normal, the ring contact of the jack socket is shorted to ground when a mono plug is inserted. Pro- vided skeleton style jack sockets are mounted In a metal case, inserting a mono plug con- nects the ring contact to the case. In this way if the battery negative lead is connected to the ring contact of one socket and the PCB negative lead is connected to the ring con- tact of the other jack socket, removing either jack plug will break the circuit between the battery negative and PCB negative. The circuit from Cl to PI is useful In it s own right as a 'clean boost' pedal, within reason the input impedance can be pretty much as high as you want to make it, and emit ter fol- lower T2 gives it a very low output imped- ance capable of driving long cables without losing the high notes and also overdriving the input stage of valve amplifiers (not so worth while with transistor amps!). However, depending on the jFET choice and biasing it is just possible that a good quality guitar with ditto pickups might overload the input stage to a degree. (0QO79S) 84 7/8-2010 elektor Mini Sixties Pius Joseph Kreutz (Germany) "oes circuit is inspired by an amplifier pub* shed in the '60s that produced 8 watts a :nannel into 8H and was based on ADI 61 and AD162 germanium (not 'geranium ) rower transistors. These at last made it pos- sible to build complementary-symmetry power stages with performance similar to that obtained with the standard at the time: a class AB ‘push-pull 1 using with two EL84 5BQ5) pentodes. Modest as it is. the power of ihe 'Mini Sixties 1 is still more than enough to drive high-quality speakers and provide com- fortable listening for a signal from a compu- ter or MP3 player. It goes without saying that for a stereo project, you'll need to build two channels. The Input signal is applied to the base of T1, which is biased via the divider formed by R1, R2 r and R3, decoupled by C2. T1 's emitter receives the negative feedback signal tapped off the output by R6. As T1 ’s collector current is determined by the difference between the input and negative feedback signals, this tran- sistor forms an error amplifier. Series network R5and R6 determines the volt- age gain of the 'Mini Sixties' in the audio band. In the configuration shown here, the gain is 1 1 (1+R6/R5). Selecting a value of 22 £1 for R5 (and 470 uF forC3) enables you to increase the gain to 22 if this proves necessary, The values for R5 and C3 have been chosen to obtain a low-frequency cut-off of about IS Hz, The amplifier's voltage gain stage is formed by transistor T2, with resistor R12 as its load. The latter is connected to the loudspeaker output and not to the supply rail, in such a way that the voltage across it virtually doesn't vary at all: this is the 'bootstrap' effect. The current through it then stays constant and is enough to drive the power transistor, even when the output voltage nears its maximum. The dis- advantage is that this current also passes through the load, resulting in a small DC volt- age across the terminals of the load (26 mV @ 33 mA). Resistor R13 avoids T2 finding Itself open collector when there is no load connected to the amplifier, in such a way that the qui- escent voltage at the junction of R8| | R9 and RIO J | R11 maintains its value which is half the supply voltage. Emitter resistor R7 linear- izes the voltage gain stage and capacitor C4 establishes the dominant pole, which ensures the sta bility of t he amplifier. The power stage is formed by T3 and 14 wired as a very classic complementary-symmetry push-pull' stage. Diode D1 and D2 stabilize the power stage quiescent current, which wit! IC1 LM317T - — — r — - a 090561 - 12 Specifications: Sensitivity: 820 mV (9*1 W) Cain: 10.4 Max. power: 9.1 W (THD = 1 %) Frequency response: 21Bz - 1 MHz (1 W) 21 Hz -400 kHz (8 W) THD+N; 0,.4 % (1 kHz. 1 W, BW - 80 kHz) 5/IM: 78 dB (BW = 22 kHz lin.) 86dBA need to be set to 20 mA by adjusting preset P2. A multi-turn type is highly recommended for P2. The quiescent current is measured using a voltmeter between the emitters of T3 and T4: the voltage measured in mV cor- responds to the current in mA, If necessary, the quiescent current setting may need to be tweaked once the amplifier has reached its normal operating temperature. The powe r transistor will need to be fitted to a heatsink with a thermal resistance of less than 4 °C/W, using insulating spacers and heatsink compound. It will also be necessary to make sure that D1 and D2 are in good thermal con- tact with T3andT4, The amplifier does not use a symmetrical power supply, which Is why the load Is con- nected via capacitor C7. Since the amplifier is not protected against short-circuits on the load, a 1 A slo-blow fuse lets us limit the dam- age in the event of a problem. The 28 V power supply is taken care of by an LM317 regulator, whose current limiter offers an additional degree of protection. The regulator will also need to be mounted on a heatsink with a ther- mal resistance of less than 2 °Cj W. Where applicable, you may also need to provide insu- lation, The supply transformer TR1 must be capable of supplying 24 V@ 1-1.5 A. The fuse F2 should have the value recommended by the transformer manufacturer. The voltages and currents shown on the cir- cuit were measured on our prototype. We measured the distortion as 0,14 %{1 kHz, 1 W) — not all! that bad for an experimental project using just four transistors. (09086H) eiektor 7/8-2010 85 Network Wiring Tester IC2 KC1 = 4093 took X rS C7 ^p20rt □ 12 ff 3 1 2 2 4 3 7 4 10 5 1 6 5 7 G 8 1 IQ il ■2 13 14 15 COM 0 IC4 01 02 03 04 05 V-2_ \17 ULN2803 _ 06 17 IS 07 OS GND sje 15 14 03 12 11 Q R i_ 47QR 013 tt rg M 1 47QR DH ft R? J □ 15 ft R|_ 470R 5 016 *f R9 □17_t + 470R RIO 470 R CIS +t R11 010 ft j470R R12 47QR Oti +9V ■M-© 1N4004 Js Sx 1N4148 Christian Tavernier (France) Like all its counterparts, this network wiring tester comprises two elements, a transmitter unit, powered and fitted at the network start point, and a receiver unit, passive, which can be moved around from socket to socket. Each of these units carries eight LEDs, identically labelled 1 to 8. By operating a push-button in manual mode, or using a clock in automatic, the eight LEDs Sight up in sequence on the transmitter unit and obviously they should do the same on the receiver unit* In this way, just by watching the LED lighting cycle on the receiver unit, you can immediately spot any crossed wires, as well as any open circuits (the relevant LED never lights up) or shorts (two or more LEDs light at the same time). The transmitter unit ci rcuit is simple. The Sch- mitt-InputN AND gate ICI.Ais wired as a mul- tivibrator, whose speed can be adjusted using PI , while IC1.B is wired as a simple debounce circuit for button S2, used in manual mode. Switch SI lets you apply the output of one or the other of these to the input of 1C3, a dec- ade counter 1C, which here we force to count up to eight by connecting its Q8 output back to its reset input. Its outputs are not capable of driving LEDs, especially over wiring that be "dangerous" for them (a short, for example), so a ULN2803 is used to drive the outputs. This integrated network of eight Darlington transistors, each capable of switching up to 500 mA. drives the eight LEDs fitted to the " I 1 ! u 1 [ , [ j 1 J Q oA c« 470U 25V CUT OOOy y Y □9 1074- H 3 O u w Zil -|- ^ J_R2Q IRIS Jl^ 1 ® JLS 1 7 ce bc Q O r- £ T_I □20 R1 3 transmitter unit (D1 2-D19) and feeds its sig- nals to the socket comprising contacts OI- OS, to which the wiring to be tested must be connected. At the other end of the cable, via the socket comprising contacts 11 “18, is the receiver unit which contains just eight LEDs (D20-D27) and their current limiting resistors. For the latter to work, there obviously needs to be a common connection between trans- mitter and receiver. In the case of screened network wiring, the screen can be used for this purpose. Another solution consists of using the earth wire of the electrical installa- tion to fulfil the same function. But if neither of these solutions is feasible, then you’ll have to resign yourself to running a flying lead for this purpose. The transmitter unit power supply is obtained from a l plugtop h adapter supplying around 9 V at around 10 mA or so. The supply to 1C 1 and )C3 is regulated at 5 V, even though it’s not strictly necessary. For occasional short use. a 9 V battery could be used. If the project is intended solely for testing network wiring, G1-G8 and 11-18 will be in the form of RJ45 sockets and COM will be con- nected to their screening contact. Take care to stick to the same numbering forthe LEDs on the transmitter and receiver units, and if the project is going to be used in automatic mode, that the LEDs are in the correct order. ( 091074 -I ) 86 7 / 8-2010 elektor Merlin Blencowe {UK} Most guitar pedals obtain a high input impedance simply by using a large resistor at the input of the first opamp, but this generates a good deal of noise due to the input bias current. The Class Blower avoids this by using a smaller resistance (R2) which is boob strapped by C2 to an effective value of tens of megohms. The total input impedance of the circuit is then set mainly by Rl, which does not carry any DC bias current. Because most guitar pedals use a 9 V supply as standard, their output swing is limited to about 6 V pp with ordinary opamps, and this is barely enough to cause clipping in the first stage of a tube amp. The Glass Blower doubles these figures without requiring a greater sup- ply voltage. and so can produce 'earlyjesus & Mary Chain' Le. very high levels of additional tube overdrive. This is achieved by driving T1 and T2 with the output signal, which forces pins 4 and 7 of 1C2 to follow the audio Signal, effectively bootstrapping the power rails. With a raihto-rall opamp for IC2, an output of 16 Vpp (!) can be obtained with an ordinary 9 V battery. The voltage across the opamp remains constant, however, so there are no worries about damaging the opamp even with sup- ply volt- ages up to 30 V* To avoid instability at high gain and input levels, individual opamps should be used, not dual opamps. R7 sets the maximum gain to 1 + R6 / R7 or 22 (27 dB) using the component values shown. For use with humbucker pickups a value of about 1 k Q. for K7 may be more appropriate, to avoid dipping at maximum settings. Switch SI is an ordinary, latching foots witch (e.g., Maplin # N84AR), The power supply is of the conventional type used in guitar pedals. Either a 9 V PP3 battery or mains power adapter can be used, and the pedal is only switched on when a mono guitar plug is inserted into the stereo input jack. The author's prototype was built in a 11 6 * 64 ^ 30 mm aluminium enclosure (suggest Maplin LH71N and Rapid 303540, or Maplin GU62S and Rapid 303539 for the more experi- enced constructor!) The 2.1 mm DC socket must be an insulated type since the centre pin is grounded (e.g., Rapid 200980, Farnell 1137744, Maplin FT96E). The input j output jack sockets (6,35 mm) should ideally be of the insulated type, but non-insulated ones will do (e.g.. Maplin HF92A or HF93B). For guitar pedals it is inconvenient to have all the sockets / controls on a single circuit board they are panel mounted and wired to the RGB by hand. The author's design for a PCB and the asso- ciated wiring diagram may be downloaded from 3 1 !, Compared to the schematic shown here, small differences exist in respect of component reference numbers. (100165) C3 1 jZ 1 1 lofl 100U 25V 100165-11 elektor 7/8-2010 87 Modeller’s Clock Michel Kuenemann (France) The special feature of this analogue wall dock is that it uses a standard model servo to tel! the time. The display principle is the same as for an ordinary wall dock, but with two important differences, A standard model servo is unable to cover a travel of 360 °, so well need to adapt the clock face to this situation. What’s more, it's not possible to show the hours and minutes at the same time using just a single servo - so the dock will show the hours during the first part of each minute, and then the minutes for the rest of the current minute. The circuit is arranged around a PIC 18 LF 1320 microcontroller with a 32.768 kHz dock crys- tal to generate the ‘seconds’. The controller core and the peripherals are docked by the internal RC oscillator running at 8 MHz Test point TP I delivers one pulse per second. Two push-buttons are used to adjust the time, one for setting the minutes and the other for setting the hours. These buttons are also used -090(123 ■ ■ H h a * * * ■ • 5 ■ ■ * 3 to selectthe mechanical adjustment mode for the clock, as we shall see later. The LED connected to the microcontrol- ler flashes once per second while the servo is indicating the hours, but Is out while the minutes are being displayed - The hand indi- cates the minutes during the first 50 seconds of each minute and shows the hours during the remaining 10 s. Two potentiometers allow us to adapt the clock's operation to the mechanical travel of the servo used. A third potentiometer is used to compensate for any drift in the clock crys- tal. This adjustment makes it possible to com- pensate for an error of ±100 ppm, correspond- ing to a drift of over 4 mins per month, jumper jPI is to be fitted if the servo turns anti-clockwise while the clock is being set. Transistor T 1 is used to turn off the servo power between two movements. Even when it’s not rotating, a standard servo consumes around 15 mA or so, which is too much for a battery-powered dock. 6T1 T 4V5 |-[>0 fj K1 Cl 22Du 1 0 V K2 ISP O- o o o- o Jr 3 I PI 2SJ63G — ■* / P2 / P3 / / JPI C2 | yT d 9 iQQn 1 OOn TOOn pooh npoh Tiook ^ ^ ^ I 7 R2 47QR CS 22p XT CIO 32768Hz ]22p .i 2 Cl icon 16 16 C3 C4 Q 7 iDOn VDD/AVDO MCLR/VPP/RA5 IC1 OSC1/CLKVHA7 RB7/PGD OSC2/C LK O/H A6 RBS/PQC RBSjFGMj'KBII FI AO, 'AND R B4i'A N6 'fl X RA1MN1/LVDIN R B3/CCP VP 1 A RA2/AN2/VREP, RB2/P1B/INT2 RA3/AI43/VREF+ RB1/AN5JTX RA4/TQCK1 RBWAN4/1MTO VSSJAVSS C5 tOOn LOSiDB HtSSDE XTAL SERVO ADJUST DIRECTION PIC18LF1320 SET HRS u H = 1 in Servo SET MIN 090023 - 1 1 ss 7/8-2010 elektor Tie circuit is powered by three 1.5 V cells. Depending on the size of the servo used, it nay be better to replace the batteries by a small pkigtop adaptor supplying 5 V, You can also use three NiMH rechargeable cells, .veil known to model enthusiasts. The micro- controller's ‘brown out' facility, set at 2.7 V. ill avoid deep discharging the batteries by maintaining the microcontroller in reset if the threshold is reached. This little circuit can easily be built on 2.54 mm-pitch perforated board. The poten- tiometers should be wired in such a way that they are at maximum voltage at the dock- vise end. Do not fit jumper J PI and set the three potentiometers to mid travel. Connect up the servo and the supply. The servo goes briefly to neutral (mid travel) then turns anticlockwise to the 0 o'c position. If the servo turns the other way (towards 12 o'c), fit jumper JP1 and reboot the microcontroller. That should sort everything out. Now It's time to make the face for the clock. You will be able to draw inspiration from the “universal" face available to download Ml This 120 face can in principle be used with any type of servo that has a travel between 120 : and 180 Mo adjust the servo travel pro- ceed as follows. Set the dock running while pressing one of the setting buttons and wait for the servo to turn in the direction of 0 o'c. Adjust PI so that the hand is on the 0 o’c markon the face. Now press one of the buttons to set the servo to the other end of its travel, and adjust P2 so that the hand is o n the 1 2 o’c ma rk on the face. Repeat this operation until the adjustment is perfect at both ends. Turn the clock off, then back on again, and check that the hand moves to exactly opposite the 0 o'c mark. Setting the time is easy. Press the ‘set hours 1 button one or more limes to set the hours. Keeping the button pressed makes the hours advance fast. Setting the minutes is done in the same way, only pressing the 'set min- utes' button. If after about a fortnight you notice the dock is gaining or losing time, adjust potentiom- eter P3. If the dock loses, turn P3 slightly clockwise; if the dock gains, turn P3 slightly the other way. After an adjustment, you must wait at least 12 days before touch- ing the adjustment again. The adjustment lets you compensate for several minutes a month, so you'll need to adjust P3 very care- fully. What's more, it's important to note that P3 does not affect the frequency sup- plied by test point TP1, (ogOD2J-l) 1 1 ] www.elektor.com/090023 Touch-controlled Dimmer PH FI Christian Tavernier (France) Here's a dimmer that, besides being touch- controlled, also has a setting memory that enables it, for example, to turn the lighting on at the level you had set last time it was turned off. The project uses a specialized 1C, an LS7534 from LSI Computer Systems, availa- ble from Farnell among others. This 1C is pow- ered d i rectly fro m t he domestic AC powertine, which is dropped using capacitor C3 in order to avoid any thermal dissipation. The power switching element is a triac, turned on at the zero crossing of the mains via the synchronization Information conveyed to the LS7534 via R1 and C2, and turned off after a larger or smaller part of the sinewave so as to be able to adjust the brightness to the required level The touch pads are connected to the UP and DOWN inputs via two high-value series resis- tors, which For safety reasons must not be either reduced in value or replaced by a sin- gle resistor of equivalent value. Note here that the values of pull-up resistors R4 and R5 can be adjusted between 1 and 4.7 JVUi in order to adjust the sensitivity of the touch control Choke LI is a conventional toroidal type intended to reduce the interference radiated when the triac turns off, in conjunction with capacitor CL For safety reasons, it is vital that the latter, along with C3, should be class X2 ty pes, intended for direct mains operation. The triac can be any 400 V, 2-4 A type. You just need to take care to pick a type that is fairly sensitive, with a trigger current of no more than 50 mA. otherwise the LS7534 won't be able to trigger it properly. Although on the circuit diagram we have shown the maximum lamp power as 200 watts, it's pos- sible to go above that, but in this case the triac will need to be fitted with a heatsink, which elektor 7/8-2010 89 wifi make the project bulkier. If the project is not built in to an electrical wall box, you must be sure to choose an insu- lating case, since in the absence of a trans- former, the whole of the circuit is at AC line potential and any accidental contact with it could be fatal Using the dimmer is very easy, but requires you to make the distinction between long or short contact with the touch pads. When the light is off, a short touch (typically 34-325 ms, according to the data sheet) on UP makes the lamp light gradually up to the maximum value reac h ed last ti me i t was tu rned off. Wh e n the light is on, a short touch on DOWN makes the lamp slowly go out. A long touch on UP (typically longer than 334 ms) gradually increases the brightness up to maximum, beyond which it has no further effect. A long touch on DOWN reduces this same brightness down to minimum, [091072-]) Vest Pocket VHF FM Test Generator a length of coax cable to tap off the FM sig- Kai Riedel (Germany) After licensing restrictions were relaxed in many countries for VHF FM band transmit- ters with 50 nW transmit power, several small, inexpensive FM transmitter modules appeared on the market. In the author's view, such a module forms a good basis for a small FM-band test generator. This only requires a sine -wave modulation sig- nal, which can come from an existing audio generator. If you don't have a suitable audio generator available, you can build the Wien bridge oscillator described here. FET TI provides amplitude stabilisation in order to keep the distortion low. The gener- ated signal is fed to the transmitter module via a 3.5-mm stereo headset socket, which mates with the usual 3,5-mm stereo plug of the FM transmitter (the left and right termi- nals of the socket are wired together). Adjust the output level of the audio oscillator with potentiometer PI to avoid overdriving the transmitter. In the transmitter module used by the author, the HF stage is built around a Rohm BH 141 8 FV tC. You can easily find the data sheet for this 1 C with a Google search, and It can help you identify the HF output on the transmitter circuit board. You can then use nal and feed it to the antenna connector of the receiver under test. Here you must pay attention to the maximum rated input level of the receiver and impedance matching, and if necessary you should use an attenua- torat the receiver input. You can use an oscil- loscope to trace the signal in the receiver and analyse the receiver output signal (0904^7*1) Astrolamp Martin Diimig (Germany) It takes up to an hour for our eyes to fully adapt to the dark and achieve maximum light sensitivity with the iris fully open. Astrono- mers use red light to avoid interfering with this adaptation process. A lamp for stargaz- ing should also have several other features. Some of the features of the lamp described here are: • Red light for observation • Dimmable • Easy operation (including with gloves if necessary) • White light for erecting and dismantling the telescope • Reliable protection against operator a errors (no accidental white light) * Existing lamps can be remodelled The lamp is controlled by a single button and responds to button presses as follows: * With the lamp off, pressing the button for less than 5 seconds switches on the red fight * With the lamp off, pressing the button 90 7/8-2010 elektor 'or more than 5 seconds switches on the white light ■ .’, ith the red light on, pressing the but- ton for less than 1 second switches off the lamp * /. ith the red light on, pressing the button for more than 1 second alternately brigh- tens or dims the lamp ■ ith the white light on f pressing the but- ton switches off the lamp lamp also remembers the red light setting. me starting point for the remodelled lamp is an ^expensive headlamp from a D1Y shop, which ~as seven white LEDs and a splash-proof but- ton. The lamp has a battery module that holds !h ree AAA cells (4.5 V) ( with two spring con- tacts that press against contact surfaces on the OuiEt-in PCB. This board holds the control but- ton for lamp. Three wires lead from this board to another PC 8 with the LEDS and the LED driver C They are: ground (GND), +4.5 V (VtC), and Button (contact closure to ground), in the remodelling process, the original PCB with the LEDs and LED drrverwas replaced by a PCB with the author’s circuitry. The origin nal portion of the lamp circuit (battery holder and button) appears at the left in the sche- matic diagram. The new LED board is fitted with an ATtiny45 microcontroller and three LEDs with series resistors, consisting of two diffuse red LEDs and a white LED. The latter LED can be salvaged from the original LED board (maximum LED current around 50 mA). As the microcontroller’s rated output current is only 20 mA per pin, the white LED is con- nected to two pins. Buffer capacitor Cl may be omitted if space is tight. The firmware (including the source code in assembly language) may be downloaded from the web page for this project 14, where you may also order a pre-programmed ATtiny45 microcontroller. If you wish to pro- gram the microcontroller yourself, you can select various ATtlny microcontrollers or the AT90S2343 (the type originally used by the author) in the software. The firmware occu- pies only a small part of the microcontroller's program memory, so there’s plenty of room for extensions. The values of resistors R1 to R3 can be adjusted to match the forward voltages of the LEDs actually used. The voltage drop across the microcontroller is practically negligible. The remodelled lamp is switched off exclu- sively by the microcontroller, which accord- ing to the data sheet draws less than 1 pA in sleep mode, nearly the same as the self-dis- charge rate of the batteries. The microcon- troller is awakened by pulling PB2 to ground (when the button 3s pressed}, (090550-1) [1 1 www.elektor.com/090550 Sweep your Function Generator Holger Brians (Germany) Function generators built around the XR2206 have always had an excellent price/performance ratio, and the 1C although ’obsolescent' is still availa- ble. If your generator does not have built-in sweep (’wobbulator’) capa- bility, a small external circuit is all you need. You can fit the circuit in place of the frequency adjustment potentiometer if you don't already have a sweep input. The circuit is a classic sawtooth oscil- lator based on a unijunction transis- tor (U]T), which switches when its base voltage reaches the trigger level. This allows the capacitor con- nected to the base to discharge rapidly, obtain a linear charging characteristic a +12V To thus a linear sawtooth ramp, the capacitor nd is charged by a constant current source built around a BC557. The output signal Is buffered by a FET (BF256C) to mini- mise the load on the oscillator. The output stage built around the BC547 provides the interface to the XR2206 function generator, with trimpot PI serving to adjust the sweep amplitude. To make it easier to see the signal on an oscilloscope during alignment, it’s a good idea to remove jumper j P 1 near capacitor C2 in order to increase the sawtooth frequency. Fit the jumper again after completing the alignment. With the 100 pF electrolytic capaci- tor (C 2 ) back in the circuit, the sweep frequency will be significantly lower. If necessary, you can use a different value to obtain a different sweep rate. elektor 7 / 8-2010 91 (oS 1005-1) You can probably find all the necessary com* ponents in your parts bin, but if not, the UJT is still available (for little money from R5 Com- ponents). and the FET can be replaced by most other small-signal N-channel JFETs. For the UJT, you can also use a 2N2646 or a 2N2647. If you also want to put together an XR22Q6 function generator, check reference Ml for free instructions for assembling a tried and tested Elektor circuit. 1 1 1 wwvv elektor. com , 0603 1 2 r\i IV DIP Gregory Ester (France) Even though you can’t actually damage the m icrocontro 1 1 e r i n the ATM! 8 projec t by the configuration of its fuse bits, setting them wrongly can however disable it. There are actually several different ways of cutting off the branch you're sitting comfortably on. Thus it is possible to accidentally change, for example, the programmer access mode or the dock source. In both the aforementioned cases, bringing your microcontroller back to life can take some time and may even need equipment you don't have to hand. Rather than replacing the whole controller board # 071035-91 , how about just removing the ATmega88? This substitution operation will only cost you an ATmega88-2QPU DIP 28 at just a couple of pounds, which compares favourably with the price of the complete board sold by Elektor. We should! poi nt out that the DIP versi on offers V CC © K9 1 PD5 / \*r 2 PDG / y~\_ 3 4 PB6 / O 5 O o 6 7 PD4 / KS CH“ S O £> o-- O- pdi / POD / J3 S v JP1 (2) Jb 1 AREF 21 20 S.POO 2 \PD^ 3 \PD2 4 S ^P.D4 6 11 'vPDt 12 \PD7 13 Vec © Ts £ 4 100(1 C3 1 ATMEGA88 pc2(ADC2? -PDIP PCt(ADCI) PDO(RXD) PCO(ADCO> PDI(TXD) PD2(IHTQ} PBO(ICP) FD3(lNT1) PBlfQClA) PD4(XCIOTO) PB2(SS70CiBt PD5(T1) PB 3 f MO SI/DC 2) PD6(AtN0) PB4(MISO] PD7{AfN1) PBS(SCK) PBB PB7 6ND (XTALlJl (XTAL2) GND sa PC6 / PCS/ 27 PC4 / 26 PC3/ 25 PC 2/ 24 PCI / 23 PCD/ 14 PBD / 15 P01/ 16 PB2 / 17 PB3 / 18 PB4 / IS _£§sy PB7 P03 1 ^ PD2 2 ^PDI 3 •^PDO 4 ^ PCS S f PC4 6 ^ PC3 7 / pc2 8 / K12 PCI A REF \_PB5 -O l-o o o o o o o K 11 o K10 ^PB4 2 \ PB3 3 ^ PC 6 4 5 \PB2 6 \P8l 7 'v P0O 8 Pt>7 9 O ■o o o o o o 090896 - 1 1 a 6-channel ADC, as against eight for the TQFP version. Apart from this subtle difference, the ATM IS- DIP board is similar to its smaller sister in virtually every respect. Virtually, since we must note the following niceties all the same: - connector K12 is moved to the top: - if you opt for powering via the USB port, you’ll need to connect the USB/RS-232 (TTL) cable to the ATM1 8-DIP PCB in the same way as you did for the piggy-back board PCB. Then, if you want to use USB powering, con- nect a wire from J3 (ATM 18- DIP) to pin 2 ofJPl (piggy-back board PCS), So the ATM18-DIP will be used in the devel- opment stages, while once the system has been finalized and debugged, it’ll be prefer- able to use the TQFP version, which takes up less space. The parts list and PCB artwork for this project may be found at PL ’ATtVIlS 1 is a project series featured in Elektor, starting April 2008. (ogo&gEH) 1 ] www, el ektor.com/090896 Discrete Low-drop Regulator Jac Hettema (The Netherlands) This circuit was designed to ensure that an amplifiercircuit containing a TDA1516Q would not exceed its maximum supply voltage when the load is small. This amplifier is used in a PC to increase the audio power somewhat. The 92 7/8-2010 elektor D C power supply, however, created so much nterference that an additional power supply as required. The power supply has its own power trans- ■ormer with a secondary voltage of 12 V AC, After rectification and filtering this results in a DC voltage of about 1 6 V. The regulato r con - sists of a P-channel MOSFET SJ117, the gate of which is driven via a voltage di vider con- nected to T2. The base of T2 is held at a con- stant voltage by LED D2 t so that the voltage across emitter resistor R2 is also constant and therefore carries a constant current. When the output voltage is higher than about 13,5 V, zener diode D1 will start to conduct and supply part of the current through R2 — as a result the MOSFET will be turned on a lit- tle less. In this way there is a balance point, where the output voltage will be a little over 13,5 V {1.5 V across R2 pfusthe 12V zener voltage). The regulator is capable of deliver- ing up to about 2 A — in any case it Is a good idea to fit the MOSFET with a heatsink. It is possible to add an optional potentiome- ter in series with the 12-V zener diode, which Tfil K1 23CVJ2X 1 2 V Jr4~ T. R3 1 1 n 12 3 4 c c 3 A A c y i !> K2 Cl C2 BC549 C4 RE1 J 3 D3 2200u 40V 220n 3 02 iz Tr 2 t m [il K® a 1 loon 2200U 40V ' 1 ^ 1 O 1 00253 - 1 1 will allow a small amount of adjustment of the output voltage. The relay at the AC powerline input ensures that the power supply is only turned on when the PC is turned on. This relay is driven from a 4-way power supply connector from the PC, OQ025M) Analogue Electronic Key Christian Tavernier (France) This circuit uses two comparator that are com- bined in what is called a window comparator, i.e, resistors R2, R5, and RIO determine a volt- age window within which the voltage applied to the junction of D2 and D6 must lie in order for the outputs of IC2.A and IC2,B to both be high at the same time. Given the value used for these resistors, this window is from 10/21 to 11/21 of the com para tor supply rail (5 V). if IC2.A and IC2.B outputs are both high at the same time, transistor T1 is saturated via the AND gate formed by D3 and D4, and relay RE1 is energized to operate the electric latch or any other locking device. The key is defined by the generation of the specific voltage at the junction of D2 and D6, formed, for example, by a simple stereo jack containing the two resistors R4 and RS. Together with R1 and R9, they form a poten- tial divider that needs to be suitably calcu- lated in conjunction with the values of R2, R5, and RIO so that the key can open the lock. Clearly, all this will only work correctly is the supply voltage to these two dividers is stable, which is ensured by IC1, regulating it to 5 V, If we had set the values for R1 and R9, all the readers of this edition of Elektor would have ici had the same key, which is clearly not a good ideal So you need to decide for yourself not only R4 and R8, which form the key, but also R1 and R9 which let you customize the lock’. Here are the relationships between the values of resistors R1I , R4 r R8, and R9 for the key to be able to open the lock: 1 0 ■ R8 ■ R9 < 11 - (R1 + R4) - (R8 + R9) 10- (R1 + R4) - (R8 + R9) < 11 * RS - R9 Given the size of the window formed by R2, R5, and RIO, 5 % tolerance resistors are elektor 7/8-2010 93 adequate. Mote too that, as the relationships consist of inequalities, and that there are only two (un)equations for four unknowns, this leaves quite a wide choice forthe resistor values. We advise you to set at least two of them to pre- ferred values, which will then let you work out the others. If, as is more than likely, this does not result in other preferred values, you’ll then need to use series/parallel combi- nations to obtain the calculated values — or else choose different starting values in order to arrive at a better compromise. [1 ] www.ele kto r. com/ 0 8 1 177 (081177-1} DIY SMD Adapter Michael Holzl (Germany) In order to use an SMD device on a standard prototyping or perf board (breadboard) you will first need to fit it into some sort of carrier or (expensive) professional adapter board with pins atthe same raster as the perf board. Such an adapter can also be made quite cheaply; we will take you through the steps using an 50-8 narrow package as an example. Firstly cut a small rectangle of pert board to act as a chip carrier. It must be long enough to have one pad per 1C pin down each side of the It (in our case 4 pads long). Its width should allow two rows of unused pads either side of the chip with the chip in the centre. The next step is to carefully remove all the unused copper pads with a knife so that there Is no possibility of any of 1C leads shorting with a pad. Once the small piece of board has been cleaned up the 1C can be glued centrally onto the board. The carrier can now be fitted with the con- necting pins so that when complete, the whole assembly can be used in the same way as a standard DIP or OIL chip. Solder pins are used here; firstly push the pins into a solder- less plug-in breadboard to hold them in posi- tion, Place the carrier board over the pins then carefully solder each pin in position on the carrier board. Now connect each pin to the corresponding 1C lead using thin enamelled copper wire (ECW). If you are lucky enough to have the self-flux- ing type then this job will be much easier. Nor- mal ECW can also be used but it will be neces- sary to scrape the enamel from the ends and tin them. Any recommended supply decoupling capaci- tors can be mounted directly on the carrier board across the supply pins. The method works well with SO packaged chips. SO-8 devices do not need any enam- elled wire; the chip leads can be soldered directly to the solder pins. Before powering up the chip make a careful inspection of all the solder joints to ensure there are no unin- tentional short circuits. (090614} LED Bicycle Light Revisited Bernd Schulte-Eversum (Germany) The LED bicycle light that we described in the july/August 2009 edition of Elektor has proved very popular. The author was particu- larly struck by the basic design, but as always, there is room for a little improvement! Below we describe two enhanced variations on the original theme. Both circuits are, like the 2009 original, pow- ered from a 6 V (rechargeable) battery, shown here as VI , The simpler of the two circuits, which consists of four transistors, is in func- tion essentially the same as the original ver- sion . It takes the form of a boost converter with feedback provided by the voltage drop across a current sensing resistor, in this case R2. A value of 6.2 ft for R2 is suitable for use with four white LEDs at D4 to D7, and gives an LED current of approximately 20 mA. The 250 mW Zener diode D10 is provided to limit the output voltage In the case that the LED chain should go open-circuit, pulling the gate of the MOSFET to ground via T3, T1 and T2 If the output voltage exceeds the breakdown voltage of the Zener. A breakdown voltage of between 15 V and 24 V is recommended. LI is a 100 liH coil with a current rating of at least 0,5 A and should have a very low DC resistance. Transistor T1 provides a low-impedance source to charge the gate of MGSFETT5, Tran- sistor T2 (the author used an SMD BC846S dual transistor) is wired as a diode, and is responsible for discharging the gate of T5 via T3, This extension to the original circuit means that MOSFET T5 switches more quickly, which improves overall efficiency. As a side - effect the switching frequency also rises sig- nificantly. With a switching frequency of over 1 50 kHz ceramic or film capacitors must be used at the Input and output, as electrolytic* will gradually fall off in effectiveness. In the original circuit a type NTD4815N MOSFET with an on resistance R [3$t[}n) of 1 5 mft (at V cs =1 0 V) was recommended, although almost any N- channel MOSFET with similar on-resistance characteristics will be equally suitable. 94 7/8-2010 elektor Vinculum VNC2 The second circuit employs five transis- tors, and differs from the first in that it uses a secondary current regulation loop based around transistor T4 t This makes the design more suitable for use at higher LED currents, giving greater current stability in the presence of power supply voltage fluc- tuations. The voltage drop across resistor R6 due to the current flowing through the LEDs turns transistor T4 on. Via T3 this in turns modulates the switching of T5, hence keeping the output current constant. Tran- sistor 14 is a type BC856B; an alternative device in a leaded package is the BC556B. T3 is a BC546B, The 8C846S dual SMD tran- sistor used forTl and T2 can be replaced by a BC546B (forTl) and a type 1N4148 diode (forT2), ( 090723 ) ( SPEED. FLEXIBILITY. PERFORMANCE. FTDI Chip A programmable system-on-chip USB 2.0 Host / Slave controller - Dual channel USB 2.Q interface, handles all USB host and data transfer functions in single \L On-chip 18-bit Harvard architecture MCU core with 258 Kbyte Flash and iGkbyte RAM* External UART, FIFO, SP1 Slave, 5PI Master, GRID and PWM interfaces. Vinculum -It software development tools available for user application development. Multiple package size options including VNC1L backwards compatible package option. Targeted for range of USB applications, from portable media devices and cell phones to industrial and automotive applications. Vincul urn-11 evaluation modules - V2DIP1/2 - Miniature VNC2 Development Module with Single or Dual USB Connectors - V2-EVAL - Complete Evaluation & Development Kit for VNC2 WWWl 111 USB MADE EASY www.ftdichip.com elektor 7/8-2010 Ton Giesberts (Elektor Labs) This circuit is a revised version of the Audio limiter published in the 2002 Summer Circuits edition, which fs intended to limit the (pos- sibly excessive) dynamic range of the audio signal from a TV set or DVD player (for exam- ple). The original circuit is based on attenuat- ing an excessively strong source signal. Here we take the opposite approach of amplifying the quieter passages. To minimise the typical "breathing' effect of compressor the con- trol range is limited to only 24 dB. The gain is adjusted in discrete (non-audible) steps, which avoids non-linearity and thus avoids distortion. With the component values shown on the schematic diagram, the circuit can boost the gain in 15 steps of 1.6 dB each, yielding 16 lev- els from 0 to 24 dB. The voltage divider used in the original circuit has been replaced here by negative feedback circuitry using two non- inverting amplifiers. This reduces the number of resistors and allows smaller multiplexers to be used — in this case consisting of two halves of a 4052 1C per channel (the 4052 is a dual 1 - of-4 analogue multiplexer/demultiplexer). The entire control logic is the same as before. Although there are two stages per channel, fewer resistors are necessary than with the original design. To allow the overall gain to be controlled in equal steps, the individual amplifiers {IC1A/IC3 and IC1B/IC4) have differ- ent step sizes. The gain steps of the first stage are relatively small (0, 1,6, 3.2 and 4.8 dB), while the gain steps of the second stage are relatively large (0, 6.4, 12.8 and 19.2 dB), The total gain can thus be controlled over a range of 0 to 24 dB in 16 equal steps. The individ- ual resistor values are easy to calculate with this approach: (10 kQ)/(1 Q A f 20 - 1), where A is the desired gain and 10 k Q is the value of R5, R10. R14 or R1 8. Other gain ranges can also be implemented in this manner (see table), but you should bea r i n mind that steps larger than 1.6 dB may be audible. The control circuitry is largely made up of sim- ple discrete logic. The multiplexers are driven by an up/down counter (ICS). Window compa- rators are used to determine the signal level at the output. They are built around two com- parators of an LM399 (quad comparator) for each channel. The same reference voltage (across PI), at approximately 1 V, can be used for both channels. The reference voltage can be modified by changing the value of PI — for instance, 10 kii yields around 1.7 V. The con- Table. Alternative control ranges(R5 s R10 = R14 = R18 = 10k) 15 dB 20 dB Theoretical E24 E96 Theoretical E24 E96 R2&R7 24.24 kQ 24 kQ 24.3 kQ 17.10 kQ 18 kQ 16.9 kQ R3&R8 38.62 kSl 39 kQ 38.3 kQ 27.83 kQ 27 kQ 28.0 kQ R4 & R9 81,95 kQ 82 kQ 82.5 kQ 60.27 kQ 62 kQ 60.4 kQ R11 & R1 5 3.354 kQ 3kf>3 3,32 kQ 1.883 kQ 1,8 kQ 1,87 kQ R12&R16 6.614 kQ GkQS 6.65 kQ 4.142 kQ 4,3 kQ 4.12 kQ R13&R17 17,10 kn 18 kQ 16.9 kQ 11.80 kQ 12 kQ 11.8 kQ 10 1 1 1 r - ■ ■ -30 ‘20 -26 24 -22 -20 -IS -16 -14 -\2 -10 -9 4 -1 -6 -5 -4 -3 -2 -1 *0 M +2 +3 *5 dBr oswu-ia ge 7 / 8-2010 elektor +0V O 13 o g IC3 4052 L£| I +8V Q +SV C2 "on 13 3 □ A & IC4 X XO XI X2 X3 4052 Y YD Y1 Y 2 Y3 UJ T- S 1 1 2 ■ T 1 a cs p I m 22 (Ju WOnm 25 V > i V . ► IG 1 H C 4 C 6 © J kin I&Bp ? 5 V ft 1C1 = TLfla2.CN 1C 2 = TL0H2CN iC5 = LM339 1C6 =' 4538 1C 7 = 4093 K5 4rJV AO A 1 A2 A 3 W AD A1 A2 A3 CIA iMii 11 U IC7A CO a □ ic a Q1 Q2 Q3 Qi 451 & CLK PSE Cl U 1 D PST PI P 2 P 3 Pi Q Z d 15 IC7B 2 4 &JT 3C7D L ' " -4 13 12 10 :_r 12 13 +8V R2B jfc. 1 1M 1 10 — T &IT icrc R25 C11 "u? RextiCirt IC 6 A CeM 0 AST TRIG* 0 TRIG. id RutfCttl OB Cex? 0 fiST TRIG* Q TRIG -8V trol circuit responds to the peak level of the output signal. As long as the output signal level is lower than the reference level, oscilla- tor IC7c is enabled by monostabJe multivibra- tor IC 6 b. This causes IC 8 to count down slowly (pen 10 of ICS is low) until the lowest count is reached. The counter is then blocked by JC7b, and the gain is set to the maximum (the XO outputs of IC3 and IC4 are at ground level), IC 6 b Is triggered when the window compa- rators generate pulses. The outputs of IC 6 b remain asserted as long as this occurs (the 4528 is retrlggerable), and oscillator IC7c is blocked. iC 6 a is now triggered by the com- parators, The Q output of IC 6 a is connected to the positive trigger Input to prevent retrig- gering of ICSa, In this situation the counter is clocked by pulses from IC 6 a (pin 7). The pulse width is set to 1 ms to prevent the multiplexers from going a few steps too far at high frequencies. If you find the recovery time too long, you can make it shorter by reducing the value of R26. The time delay provided by IC 6 b ensures that the circuit does not start amplifying the audio signal right away, but instead waits for half a second. This gives the circuit a calmer control characteristic. The circuit is designed fora minimum gain of 1. Signals larger than the set reference level are passed through unchanged. As the qui- eter passages in the audio signal are ampli- fied, you can set the volume control of your sound system to match the loudest sound level. A circuit that simplifies the optimal adjustment of PI is described elsewhere in this Summer Circuits edition. The logic circuitry operates from symmet- rical 8 -V supply voltages. They are derived from the symmetrical 12-V supply rails with the aid of two resistors and two Zener diodes. The values of these components as shown on the schematic diagram are dimensioned for the external indicator circuit, which can be connected to K5. The current consumption is approximately 20 mA. If you don't use the indicator, the current consumption can be reduced by 5 mA by increasing the values of R30 and R31 to 470 Q. The distortion is very low- only 0.001% at 1 kHz with 500 mV input and output levels. The measured characteristic curve shows the behaviour of the circuit. The X axis represents the input signal, while the Y axis represents the output signal. Here 0 dB corresponds to the reference level. The 24 steps of control- led gain adjustment as the input signal level increases are clearly visible here. A PCB layout for the circuit and the accompa- nying components list may be downloaded from the Elektor website ITI. ( 090944 -fl elektor 7 / 8-2010 97 USB/TTL Serial Cable: Extension & Supplement 3 Antoine Authier (Elektor Labs) Two years ago, I presented here the USB/TTL serial conversion cables from FTDI PH 2 ! — worn derful communication and debugging tools. The increasingly frequent use of ARM CPUs in our projects like Sceptre, the battery monitor, the engine test bench, etc. has led us to use the 3.3 V version in order to protect the ARM’s input/output ports intended for 3.3 V (unless otherwise stated; the data sheets are unclear about this,,, but bettersafe than sorry!) v cc From now on, the 3.3 V version of the USB TTL-232R cable will be available in the Ele- ktor online shop with the reference 080213- 72. The 5 V version is still available with the reference 080213-71* While working on various projects, and espe- cially when debugging onboard software which is very handy for dip- ping on multimeter and oscil- loscope probe 'croc dips 1 . A second FA5TON terminal offers the USB 5 V rail in case it comes in useful, though i didn't actu- ally fit it. Note that the orderof the signals is changed at the DIP-switch so that the 5 V rail comes atone end, where the switch will be easier to operate with vour fingernail. On the deluxe' version circuit shown in Fig- ure 2, you'll see we've added a 4066 CMOS analogue switch, ICI. This makes it possi- ble to disconnect all the serial link's logic signals in one go sim- ply by pressing push- button 52. I noticed in fact that the volt- age present on the cable's TX pin is enough to power an ATmega324PA (low- voltage) and prevents hot rebooting of the microcontrol- ler. even if its power is momentarily inter- rupted. So this button comes to the rescue and makes debugging easier, without having to either unplug the cable or operate the DIP- switches for such a short time. (100007-1) [ 1 1 080213-1 USB -4 serial TTL cable: www. e I e k to r. com / us b - tt I [2] 080470-1 USB -4 RS6232 table: www.e le kto r. com / 0 8047 0 SCI. A using these cables, 1 found it was useful to be able to interrupt certain of the signals or to be able to look at them on an oscilloscope. It was then I came up with the modest circuit given in Figure L Connectors K3 and K4 make it easy to look at each signal The miniature 5 -way DIP switch SI lets you interrupt any of the TX, RX, CTS, RTS signals available at the end of the cable. It also lets you cut the 5 V rail coming from the USB cable. By Isolating your circuit like this from this voltage, which in cer- tain cases might end up connected directly across some batteries, you will avoid damag- ing them or even making them explode. The grounds remain connected. This 0 V ref- erence is present on the FASTON terminal Vcc © K3 999? 9~P1 H Ql K1 KG Si « llll|U 1 U ■P. 1iG 13 (Cl .B tCl.C ■? — * □ K5 1C1.D n ia t? K4 (q q p p q 61 Vcc © © tci *r p ci 10fln K2 O O O O & to EC1 = 4066 lOQDQ^ SE g8 7/8-2010 elektor Underfloor Heating Controller Marc Dtr ix (NL) Central heating systems that include under- floor heating often leave the extra pump used to pump the water through the under- floor pipes running continuously. The reason for this is that the central heating controller doesn't have a separate control circuit and output for the underfloor heating pump. This circuit was designed to control the under- floor heating pump independently or via the switch in the living room thermostat. The design has been made very flexible and can be connected in four different ways: 1) Temperature sensor 1 is connected to the inlet pipe of the underfloor heating, Tem- perature sensor2 is shorted. The pump is turned on when the inlet pipe becomes warm enough. When the temperature of the inlet pipe drops below the trigger temperature the pump will continue to run for 20 minutes. 2) Temperature sensor 1 is connected to the inlet pipe of the underfloor heating. Tempera- ture sensor 2 is connected to the outlet pipe. This works in a similar way to that in the previ- ous configuration, but also: as long as the inlet pipe is warm the pump will be stopped (tem- porarily) when the outlet pipe rises above the trigger temperature. +5V IC2 vcc GND PSS^ADCO) P8d{ADC2) P&34AEJC3) pea(ADCt) PBI(OCP) P'BQ(AREF) ATTINY25 1 Ftl X 3) Switch input connected to the living room thermostat. As long as the switch (connected to the same input as for Temperature sensor 1) is closed, the pump will run. When the switch opens the pump stops after 20 minutes. 4) Switch input connected to the living room thermostat. Temperature sensor 2 is con- nected to the outlet pipe of the underfloor heating. This works in a similar way to that in the previous configuration, but also: as long as the inlet pipe is warm the pump will be stopped (temporarily) when the outlet pipe rises above the trigger temperature. Temperature sensor 2 can also be used to pro- tect the underfloor heating from overheat- ing. In this case, set the trigger temperature to about 50 degrees and connect the sensor to the inlet pipe of the pump. The circuit is built around an ATtiny25. Two ADC inputs of the controller measure the volt- age across both PTCs. The voltage across the first temperature sensor is compared by the software to a trigger value and zero. When the trigger value is exceeded or the value is zero (due to an external switch), the Motor- power pin (pin 5) is pulled high and the pump is started via the opto-trlac. When the pump Is started, another output (pin 6) is pulled low at the same time. You can connect external components to this output, such as an indi- cator lamp. To prevent a continuous current from flow- ing through the presets and temperature sen- sors, the PTCs are connected to ground via a software-controlled FET only when a meas- urement is made. A configuration fuse inside the microcontrol- ler is blown so that the internal clock runs at 128 kHz, This is fast enough to run the pro- gram and this frequency is divided by 1024 in the prescaler of timerl . Timerl then counts to 125 and generates an interrupt. This interrupt will occur approximately once per second, Du ring the i nterru pt routine the state for the pump is determined. When Temperature sen- sor 1 exceeds the trigger value or equals zero (switch input), the pump timer will be set to 20 minutes. These 20 minutes are to make sure that the pump remains on for another 20 minutes after the temperature has fallen below the trigger level. If the second temper- ature sensor goes above the trigger level the pump will be stopped immediately. At the end of the interrupt routine a measure- ment is started by first making the FET con- duct so the PTCs are connected to ground* An ADC routine is then run to read in the value. The temperature sensors are measured alter- nately. so that the measurement interval for each sensor is 2 seconds. The circuit will turn on the pump for a mini- mum of 5 minutes during any 18-hour period. For this there is a Summer-timer, which keeps track of how long ago the pump was last on. When the pump is turned on the Summer- timer is reset to zero. If the Summer-timer hasn't been reset for 1 8 hours (16-bit integer = 65,536 s = 18,2 hours), the pump timer will be set to 5 minutes. As long as this is active, the pump will be on. 110031 S) elektor 7/8-2010 99 RGB Synchronizing Fireflies Wirt! ,4 INVALID HSOUT FtXO RSlN TXD FORCEOfcl FORCEOFF C2+ EN MAX3221 £20 i, V- C6 HH 15 10 11 12 16 14 10Qn OS 0-1 *1 M LL414S K4 +3V © RIO C3 IQOn C2 SI tH 11 +3V 1' ' 20 VCC IC1 PA2{RESE7) PB7(SCKi PB6(MISO) PDdlRXD) PB5(Mt>Sl) FD1(TXD) PD2{tNTQ) PBJtocrej PD3{[NTl ) PB3(0G1A> PD4{T0) PB2IQC04) PDSfTI ) pei(Aihli) PD6[lCP» PBO(AINO) ATHNY2313 XTAL2 XTAL1 GND 1Q0n I 19 18 17 1& 15 1.1 13 12 10 tC3 XC6216B302MR 01 SUB-09 5 LL4001 ❖ CE C3 C9 D5 CIO C lOu TvOOn (LL4146 11 35V II 1 • r 1 • 06 *H© +3V © LL4001 C11 en 1u 16V ^2025 K1 PROG Ml SO t 5CK 3 RST 5 MOSi O O O O o o +3V f | R9 R7 R8 R5 T R2 R1 H3 I m ©♦ SCOPE 07 LL4001 100327- 11 elektor 7/8-2010 101 Wireless Alarm Transmitter and Receiver Christian Tavernier (France) Here are two circuits that make It possible to add up to eight detectors to an existing alarm system without running a single cable. Each transmitter has a unique number that is reported to the central unit in the event of an alarm, and the transmitter battery condi- tion is monitored. Transmissions between the transmitters and the central unit are coded and are in one of the two ISM freguency bands: 433.92 MHz (US: 315 MHz) or 868 MHz (US: 915 MHz). The transmitter circuit (Figure 1) does not include the actual radio transmitter, as it is compatible with any UHF radio transmitter module with a binary input. The heart of the circuit (ICT) is a digital data coder. It outputs from its DOU I pin a binary sequence containing an address, coming from inputs A1-A5, and data reflecting the state of inputs D6-D9. The addresses are used here for the 'house 8 code, while data lines D7.D8.D9 code the transmitter number from 0-7. Line D6 transmits the battery status, measured by comparator IC2. The detector is a normally dosed type con- nected to inputs El and E2. In the absence of an alarm and if the battery is OK, ICS, A is inhibited, which also inhibits IC3.B. This pre- vents IC1 from operating, via its TE input, and also turns off T2, cutting the power to the RF module. The transmitter is then in stand-by and uses very little current. In the event of an alarm, i.e, opening of the detector contacts, or if th e battery is low, IC3. A goes high and enables multivibrator IC3.B, which then generates a rectangular signal with a low duty cycle, owing to the large dif- ference in the values of R9 and R1 0. When this is high, IC1 is enabled via itsTE input and T2 is saturated via T1, The radio transmitter mod- ule is then powered and transmits the infor- mation supplied by IC1. This state continues as long as the alarm has not been cancelled or the battery replaced. So the module transmits its status for a short time, then goes back into stand-by for a longer period, and so on. This makes it possi- ble to on the one hand to economize battery life, and on the other, to minimize the colli- sions that might occur if othertransmitters were to come on at the same time. Resistor R14 and zener diode D5 must be chosen according to the supply specifica- tions of the radio module used (usually 5 V at a few tens of mA). It is essential that IC2 be a TLC271, which is the only one able to guaran- tee very low stand-by power consumption. The address coding inputs are 3-state inputs. So each input can he connected to ground, to V+, or left floating. Obviously, you need to set the same code on all the transmitter mod- ules and the receiver. The data inputs D7-D9 are binary, and you need to choose a different combination for each transmitter. The receiver (Figure 2) does not include the +9V + VHF TX Module 102 7/8-2010 elektor UHF receiver, it's up to you to choose which one to use. The binary signal from the UHF receiver's output is applied to the input of 1C1, which is the natural companion to ICi used in the transmitters. If there is a clash of addresses, the transmitter s D6-D9 data appear on the same outputs of ICI. In addition, the VT sig- nal goes high each time ICI receives a valid data sequence. The three data bits corresponding to the transmitter number are decoded by IC4, a BCD-7 seg merit decoder. If its B I input is high , display LD1 shows the number of the trans- mitter that has triggered the alarm. The BE signal comes from a D-type flip-flop (IC2.B) that memorizes the alarm status, as it is trig- gered by Id's VT output. It is reset automati- cally at power-up via G3 and R11* or manually using push-button S 2 . in an alarm state, the flip-flop also energizes relay RE1 via T 2 . When the transmitter battery is exhausted* Id's 06 output goes high, setting off the audible alarm and lighting LED D5. Looking now at the receiver, we can tell if we have a ‘normal* alarm (RET energized, no audible warning, LED not lit) or a low battery warn- ing (RE1 energized, audible warning active, LED lit). In both cases, the display indicates the number of the transmitter concerned. Note that in the event of alarms from several modules* the display indicates the numbers of the modules concerned in turn, but this may be difficult to read if mo re than two t ra remit- ters are operating at the same time. The power supply is stabilized at 5 V* except for the relay supply. This can be provided by a l wallwart“ adaptor or* better still, be tapped off the associated central unit supply* which usually has battery back-up in the event of a mains failure. Remember to code A1-A5 as for the associ- ated transmitters. Note too that, given the circuit used* the audible warning device must be a model with built-in electronics. The relay output should be connected to one of the inputs of the associated alarm system. (0S1172-1) 1 1 ] www.elektor.com/081 172 elektor 7 / 8-2010 10 3 Thermometer with Four-Digit LED Display Andreas Kohler (Germany) Until recently, the Philips SAA1G64 LED driver 1C has been a sort of unofficial standard for driving seven-segment LED displays- It can be used to implement four-digit displays that can be driven over an l 2 C bus. However, no mat- ter how it's packaged {DIL24 or S024) this 1C is simply on the large side with its 24 pins. Its minimum supply voltage of 5 V and quiescent current of nearly 10 mA are also not exactly state of the art now. An attractive alternative for tasks of this sort Is the Maxim MAX6958 1C, It is available in While writing the assembly language firmware, the author had to battle with the complexity of the display driver, a conse- quence of the restricted number of pins. The type of multiplexing used here by Maxim has already been described in detail in Elektor ML If you want to know what goes on behind the scenes with this driver 1C. you can find a full explanation in Maxim Application Note 1880 l 2 I. Naturally, the Elektor web page for this article P! offers not only a ready-made hex file but a Iso the author’s fully com mented source code file, so you can modify the software if you so desire. If you simply want to build the circuit and aren't interested in programming the microcontroller, you can order a pre-pro- grammed device from the Elektor Shop l 3 L (qB053&-I) [ 1 1 Charlieplexing, Elektor July & August 2000; www.elektorx orn/OGO 1 24 [2] www.maxim4c.com/app-notes/ index.mvp/id/1880 [ 3) www.dektor.com/ 080 5 36 the smaller Q5Q package with only 16 pins, can operate at 3.3 V, and has a shutdown mode with a current consumption of only 20 pA. inspired by this progress, the author resolved to design a digital thermometer cir- cuit using this 1C, Aside from the MAX6958, four common-cathode LED display modules (Toshiba TLR 324) and an Atmel ATS9C2051 IRQ microcontroller (other types could conceiv- ably be used), all that’s necessary is a suita- ble temperature sensor. The selected device, a National Semiconductor LM75, fits well with the rest of the electronics becau se i t is also l 2 t compatible. The microcontroller dock signal for this simple application can be generated by any crystal with a frequency in the range of 4 to 12 MHz. 104 7/8-2010 elektor 1 2 V Power Saver Cery Szczepanskt (France) //hen a switched multiway is w sed to power a PC, printer, warmer, modem, and so on, all :^ese devices often stay pow- a"ed, in stand-by, simply out f habit or by oversight. The : rcuit described here lets you avoid this problem, /. hen the switch on the mul- ti way is turned 'on', you have around 5 — 10 s to turn the computer on. Turning the computer on powers the cir- cuit's opto-isolator, via its USB socket, which disables the sounder. When the computer is turned off, you again have around 5-10 s to turn ‘off the switch on the multiway. After this delay, the sounder oper- ates to remind you. The circuit uses just a single 1C CD4093), a quad Schmitt input \AND, along with an opto-iso- lator for mains isolation. Gate 1 forms a very low freguency oscillator at 1-2 Hz, enabled via pin 2, whose rise-time to logic 1 is of the order of 5 s. When the opto-isolator diode is powered, the resistor discharges the capacitor and keeps pin 2 of gate 1 at 0, Thus the oscilla- tor is disabled and the sounder (a type with built-in oscillator) stays silent. The 220 kQ resistor, 100 nF capacitor, and diode ensure the sounder cuts off straight away when the AC power is turned off and the 100 pF capaci- tor is discharging. The ci rc u it was b u fit on a 42 * 35 m m piece of prototyping board, fitted into a case salvaged from an old modem plugtop AC line adaptor, in this way, it can be plugged directly into one of the sockets on the multiway, A 2-core cable is used to connect it to the computer’s USB socket (pins 1 and 4), PS/2 socket (pins 4 and 3}, or the 15-pin sub-D joystick connector (pins 8 and 5), An RS-232 socket can also be used, with a slight modification (see circuit). 3 Warning: the circuit is at AC ime potential! (09O8&2-1) [1 j www.elektor.com/090862 Prototype & small series PCB specialists ALL SERVICES - Instant online pricing - Instant online ordering - Low pooling prices - Deliveries from 2 days - No tooling charges - Stencil service www.eurocircuits.com dedicated prototype service STANDARD pool widest choice 1 - S layers 100 pm techn^kjgy metal-bached PCBs Qn demand alt options up to 16 layers Call us; 020 8816 7005 Email; euro@eurodrcuits.com New website - new services 105 elektor 7/8-2010 RADIO MODULES Remote Control a Tl development tool example application By Dirk Gehrke and Christian Hernitscheck (Texas Instruments, Germany) In the article J RCB LED Mood l ighting' [Elektor, February 2008) we mentioned that a remote control could be added to the unit. Here we describe how it is done, connecting an eZ430-RF2500 to the MSP430 microcontroller The ideas presented can be adapted to a wide range of other applications. H n min ili IS isaifci ON 3 e ?! r t CAUTjONi Bright LEDS. Protective eyeweor is recommended 3 ( If « fV The eZ430-RF2500 is a development tool that includes two tiny eZ430-RF25Q0T radio module boards and a USB debugging inter- face board. Each board is provided with a six-way header connector. The USB debug- ging interface board can be used to help debug the MSP430 software as well as to program the two eZ43G-RF250OT boards. As Figure 1 shows, the main components on the eZ43Q-RF2500T boards are an MSP430F2274 microcontroller, a CC250O 2.4 GHz transceiver device, a crystal and a chip antenna, eZ430-RF25oo used as a radio remote control To simplify implementing the data com- munications functions we use the 'MSP430 interface to CC1 100/2500' library, which can be downloaded free of charge from the Tl website [ 1 ]. The advantage of using this library is that it includes alt the functions we need to communicate between the MSP430 device and the CC2500 transceiver used in this project. In particular, it makes it simple to initialise the CC2500 and to initiate trans- mission and reception of data. As already indicated, the eZ430-RF2500 kit includes two eZ430-RF25GOT boards; in this application we use one as a trans- mitter module and the other as a receiver module. 106 7/8-2010 elektor RADIO MODULES IS* VI »HI ''fc > ! . *— »g . -, v . ; u - , * e.w i * oV 0 ®V g Is -=l 3 o "• ’■'*» u u <‘ PI h3 P5 P? P3”PU P13 MS PIP ##«•# ###♦ P2*P4 PH7 ■lOOp tp IT 5 N t £ o 5 IL o 1 u HI V) n o X s GHD h - Li 3 ■ 4nH7 Cl 23 Pp4? 100p Cl £4 0p47 BT1 16 13 □2 R171 STt <| C3 C51 lODn C81 Cl 01 1 RXDO 1 2 VCC FXT 2 3 TST 3 4 rst 4 5 GNQ 5 6 TXDO 6 ■o JP1 26MHz Battery Expansion Board 0B0237 ' 11 Figure 3, Circuit diagram of the eZ430-RF2500T board. The typical current consumption of the transmitter board in idle mode therefore principally depends on the position of the rotary encoder, and varies between around 0.5 pA and 1 89,5 pA, To these figures must be added a factor to account for chip-to- chip parameter variations. The current con- sumption can be reduced further by using external high-value pull-up resistors at the encoder inputs rather than the internal pull- ups. Both LEDs are extinguished in transmit mode, lighting briefly when motion of the rotary encoder is detected. In the original article on the RGB LED mood light in February 2008 we described a very simple way to process the signals from the rotary encoder. For the remote control version we have improved the design, A glance at the new software will reveal that the processing is now done using look-up tables. Behind the data in the tables is a state machine whose pattern of execution is shown in Figure 4, The state diagram includes, for example, the ability to resyn- chronise when power is applied and the state of the encoder is not known, A signifi- cant problem when processing signals from a rotary encoder is switch contact bounce, which is taken into account in the state dia- gram, The decoder function is called when a change of state has been detected. An interrupt is only generated when an edge TOS 7/8-2010 elektor RADIO MODULES START Figure 4. State diagram of rotary encoder signal processing. rejected on one of the two inputs P2,0 r: r ‘2,4 t generating an interrupt, which ~ ti--s that the remote control spends most ; :s time In idle mode, minimising power :: nsumption. Software extensions for the RGB LED mood light “ne extensions to the software for the RGB AD mood light to allow its remote control = e relatively straightforward. The initiali- sation is extended to set up port pins P2,Q i nd P2.1 , and an interrupt service routine s added for port P2 to process the levels on nputs P2.0 and P2,l, which originate from the eZ430-RF2500T receiver board. Each rising edge on pin P2.0 generates a port P2 interrupt to the MSP430F2131, and the service routine increments pointer LEDptr, Remember that pointer LEDptr is used to access the table which contains the settings for the three high-power LEDs red, green and blue). Similarly, when a ris- ng edge i s detected on port pin P2 . 1 , a port P2 interrupt is triggered and the service rou- tine decrements pointer LEDptr. Reprogra mming the RGB LED mood light The MSP430F2 1 3 1 IRGE on the RGB LED mood light board must be reprogrammed with the most up-to-date software, A full guide to the installation of the IAR Embed- ded Workbench KickStart software and pro- gramming the device using either the MSP- FET430UIF or MSP-FET430PIF is given in the description of the TP362260LED-33S evalu- ation module, available on the internet [2], Conclusion Thanks to the use of the low-cost eZ430- RF25O0 kit the remote control can be con- structed without heroic SMD soldering skills or tedious tracking down of obscure components. Programming the software into the devices is simplified by the USB UART board provided. Project source code for the transmitter and receiver boards, as well as the new software for the RGB LED mood light board, are of course available for download from the Elektor website at www. eiektoccom* We hope that this article will spur you into developing your own applications and wish you many happy hours of experimenting! (080237-!) Web Links 1 1 1 h tt p: j I focusTLcom / me u/ docs/ meu supporttec hdoese . tsp?section1d=96S4abld=1 502&abstractName-slaa325 [2 1 http://focus.tLLom/docs/tooJsw/foJders/print/tps62260led-338. lit ml (documentation slaa325,pdf, code files slaa325.zip) CC2500 Low-Cost Low-Power 2.4 GH? KF Transceiver (literature number 5WRS04GB) M5P430X22X2 Mixed Signal Microcontroller (literature number 5LA5504B) TPS622G0IED-338 Literature eZ430-RF2500 Development Tool User's Guide (literature number SLAU227A) MSP430 Interface to CC 1100/2500 Code Library Sources of supply eZ 430 -RF 25 Oo; WWW, tL CO HI /e/430- if RGB EVM board ('LED mood light'): www.ti.corn/ eiektor 7/8-2010 109 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0 (0) 1 932 564999 Fax 0044 (0) 1 932 564998 ! ASTROBE V3.0 www.astrobe.com Windows Development System for LPC2000 microcontrollers. * Develop high-and low-level software without C or assembler * Generate fast 32-bit native ARM code * Mo special programming hardware required * Personal, Standard and Professional Editions ATOMIC PROGRAMMING LTD www . a to m i cp rog ra m mi n g xo m • AP-1 1 4 ISP/JTAG Programming System • JTAG Programming and Testing • Boundary Scan Testing • Universal In-System Programming • EEPR0M and SP1 Rash Out-of-Circuit Programming • Generic GDB Proxy Server / .*;■ /I is - Jennie JN5148 A ZigBee Development Applications • Training Platform available AVIT RESEARCH www.avitresearch ,co . uk USB lias never been so simple... with our USB to Microcontroller interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10,00. BETA LAYOUT www. peb- poo I, com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer's prices. BLACK ROBOTICS www . bl ack rob oti cs . c o m Robot platforms and brains for research, hobby and education, • Make your robot talk! • TalkBotBrain is open -source • Free robot speech software • Robot humanisation technology • Mandibot Gripper Robot ByVac www.byvac.com • PIC32 With BASIC • ARM With Forth • USB to E2C • Serial Devices • VT100 LCD Displays CEDA www.ceda.in ceda@v$nLcom < .1 U )/\ PADS | OrCAD | i PCB layout i-l earning l i jl£ORg ^ $5 Hourly • PCB Layout @ S5 Hourly • Learn PCB Designing with Multimedia DVD in OrCAD, PADS & ALLEGRO • Seif or e-tearning with support by email, phone & web-meeting DESIGNER SYSTEMS http;//www.designersystems.co F uk Professional product development services, * Marine (Security, Tracking. Monitoring & control) * Automotive (AV. Tracking, Gadget Monitoring & control) * Industrial (Safety systems, Monitoring over Ethernet) * Telecoms {PSTN handsets. GSM/GPRS) * Audiovisual ({HD)DVD accessories & controllers) Tel: +44 (0) 845 5192306 V, ■ EASYSYNC http ://www. easy sy nc.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnecxom Europe's leading device programmers manufacturer: * reliable HW: 3 years warranty for y most programmers • support over 52.000 devices • free SW updates * SW release: few times a week • excellent technical support: Algorithms On Request On Demand SW * all products at stock / fast delivery FIRST TECHNOLOGY TRANSFER LTD. h tt p ://WWW. fit, C0.uk First * Training and Consulting Technology for IT, Embedded and Transfer Ltd. Real Time Systems * Assembler, C, C++ (all levels) * 8, 16 and 32 bit microcontrollers * Microchip, ARM, RenesasJI, Freescafe * CMX, uCOSil, FreeRTOS, Linux operating systems * Ethernet, CAM, USB, TCP/IP, Zigbee, Bluetooth programming 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 FUTURE TECHNOLOGY DEVICES http://www,fEdichip,com FTDI designs and sells USB-UART and USB-RFO interface Lc.'s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB 0 Oscilloscopes 0 Power Supplies 0 Spectrum Analyzers 0 RF Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com no 7/S-2010 elektor products and services directory HEXWAX LTD I : ■ : " I' ;er-Free JS3 iCs: • !: SFi 120 bridges • Tr-L r 3B authentication dongles • - :r: j-USB 10 USB expander • :E - -Sys flash drive with SRI interface - : :-0 data logging flash drive SCIENCE, ROBOTICfS & Microcontrollers Servo Motor Controllers Artificial Vision Speech Recognition Flex Sensors IVAVAVi .com Tele: (718) 966-3694 Fax: (718) 966-3695 MQP ELECTRONICS *v .'..mqp.com • Lav, cost USB Bus Analysers • High, "ull or Law 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; vvww.robot-electronicsxomk 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. ro hots q ,co. u k Build your own Robot! Fun for the whole family! Now, available in time for X-mas • Arduino Starter Kits *NEWH* • Lego MXT Msndstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • ROB Robots {kits and components) email; sales@robotiq.co.uk Tel: 020 8669 0769 USB INSTRUMENTS h ttp ;// w w w.usb-i nstru m e nts .com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Anal ays ers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator multimeter sound meter, distortion analyzer LCR meter. Free to download and try.. ■ SHOWCASE YOUR COMPANY HERE Llektor 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 sen ices. For just £242 + VAT {£22 per issue for eleven issues) Elektor will publish your company name, website address and a 30- word description For £363 + VAT for the year (£33 per issue for eleven issues) we will publish the above plus run a 3cm deep full colour image - e,g, a product shot, a screen shot from your site, a company logo - your choice Places are limited and spaces will go on a strictly first come, first served basis, So-please fax back your order today! 7 . \ wish to promote m\ company, please book my space: • Text insertion only for £242 + VAT * Text and photo for £363 + VAT NAME: ■ ■ pbbbbbbb kith. ■ -i e i p t a 4 a !#- m * r m ¥ * + 4 r t • H H f i + - + P ■§■ * ■* ■ •• ‘ • “ ■ •* » ‘ * » ■ « .ORGANISATION: ■*■■*■ + ■ + B 4- i + 6 4 a 4 mm mm r 9 i 4 * a + w i b 4- 4 + B 4- 4 4 ■ t- 4 ■ 4- #■ 4- p 4 -p 4 44 + 4 + S4-* + » + ‘ a ■■■■■■ ■ ■ a ■ ■ ■ JOB TITLE;.. Piiii lii-H 4 4- ® 4 F * -P + -P * P 4 a a ■ a ■* 4 * 4 * ■’ ■ 9 a 9 p. p. r 9 rm pp pits put 9 -F ■ 4- § 4- P 4 8 # S 4- # 4 *■“ 1 - ■ ■ a ■* M t i t I + i ♦ ♦ I #• + i> + fi -H » M p 4 p 4 M t § t I + I ♦ I t S » » + It S f •> a a )»pf M P ■ a a a a a » ■■ ■ * ■■ ■■ ■ ■ ■ ■ ■ ■ ■ ■ bp b 9 ADDRESS P- P B PI B 9 B 9 P 9 B 9 B 9 P 9 P 9 P 9 P 9 "4 9 + § 9' P * fi + 4 * 4 4 ¥ 4 4 4 * * *■ ■* *■ * - - 4 ■ 4* PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44 (0)1 932 564998 P9P9-9P9P9‘---B9‘pa. ■ riTiTitH % 4 4 - p - i 4 M> COMPANY NAME, W EB At DDRCSS . .*B.... 9-.. *#.*.*4 4-4 48*84-44-8 4 B8 4 4 4 4 + 8 + « + ■*->* -4 pp p-.p-.p-. 30* Vv O B O h S C- B 1 1 I O ■■■ ■ a ■■ ■ ■ ■ * • * mm p a ■« ■ * »> * ■ ■ ■■ ■ ■ ■ ■ •* • B 9- B 9! 'B * B * B * B * * + * + 8 + 4 4’ * 4 ■ TiiipiTiTiTi4-Hi4F9Ht>4M p - 4- 9 f»rJtS4 , * + lt«t“**4*l a a mm a - aa i p 4 9 4 i 4- 4 4' i 4- m 4 F 4- i 4 4 4 * 9-B9-b9-b9-b4b*b4b*p4 p * p 4 4 4- P 4 4 ■* a a a a ■ * a a ■-*■-* ■ a m a aa aa aa aa • a aa aa aa aa* 9 P B P B 9 B 1 B r 9 4 9 4‘ 9 4 P 4 P ■» - 4 - • 44-4 + B4-8 + B + §§4-“4-B4-S4-P4-14 a a a a a a a a a ■ * 9 ■ a ■ b 9 a 9 - 9 . -4. P 4 .aa>paaa-aa-aaaaaaaaaaiaiaaB.iB.iBaajBaB.i aa ■ a ■ a a ■ p 9 p a a 9 99 n ■ 9- B 9- a 9 a 9 a 9 a a- a a a a p 9 r 9 a a B9I BIP9P9 B 9 P9 P 9 P99-9 P 9 !■ # 4i i 4 S 4- i 4- f 4- B + I t i + 1 + S « + » 4 t H * * 4 ■ * ■ 4 ■ *■*■■■■■»■!■■■ 9 B 9 'B 9 p4 j p9 p t ■ * P ■ - a-*»a - a a a 4 . a a, a a ■ a. a a ■ a- ■ a- * a aa aa aa aa a a. a a a aa a a aa a ■ aa aa aa aa a 9 B 9 B 9 r 9 9- 9 P 9 9- 9 B 9 4 9 >■ i 4- 4 4- P 4- B a L B 9 B 9 P 9 "P B "P B 9’ B 9" B 9 1 B 'P B "P B B 9 9 9"B9 B9'B9 P9 B9 B9 B BP a 9- a 9- a 4 a 9B 9P 9 a 4' -fc 4’ t 4 M S 4 4B44444I a a * a a a _ a a a a a a a a a a a a a a a a * a a a * ■ r m elektor 7 / 8-2010 SHOP BOOKS. CD-ROMs, DVDs, KITS & MODULES 2003 AND .NET PROGRAMMING re*. - ■ ■ .r Learn more about C# programming and .NET C# 2008 and .NET Limited Penoo for Subscribers'. £4 DISCOUNT «iww.elektor.com|i Principles, Application and Design Power Electronics in Motor Drives This book is aimed at people who want to u nderstand how AC inverter drives work and how they are used in industry. This book is much more about the practical design and application of drives than about the mathematical principles behind them. The key principles of power electronics are described and presented in a simple way. The detailed electronics of DC and AC drive are explained, together with the theoretical background and the practical design issues such as cooling and pro- tection. An important part of the book gives details of the features and functions often found in AC drives, and gives practical advice on how and where to use these. A wide range of drive applica- tions are described from fresh water pumping to baggage handling systems. Anyone who uses or installs drives, or is just interested in how these powerful electronic products operate and control modern industry will find this book fascinating and informative. programming This book is aimed at Engineers and Scien- tists who wa nt to learn about the . N ET en- vironment and C# programming or who have an interest in interfacing hardware to a PC. The book covers the Visual Studio 2008 development environment, the ,NET Fra me work and C# programming language from data types and program flow to more advanced concepts including object ori- ented programming. 240 pages * ISBN 978-0-905705*81-1 £29,50 ■ US$47.60 Circuit design and programming Complete practical measure- ment systems using a PC This book covers both hardware and soft- ware aspects of designing typical embed- ded systems based on person a (computers running the Windows operating system. It's use of modem techniques in detailed, numerous examples has been designed to show cl early how straightforward it can be to create the interfaces between digital and analog electronics, programming and Web-design. Readers are encouraged by examples to program with ease; the book p rovides clea r g u idel i n es a s to th e a p proprl- ate programming techniques "on the fly", 29 2 pages ISBN 9 7S- 0-905 705 -79-8 240 pages 11 ISBN 978-0-905705-89-7 * E29.50 * US $47,60 £28.50 * US $46.00 Prices and item descriptions subject to change. E. & O.E 7 / 8-2010 elektor For beginners and experts 50 PIC Microcontroller projects This book contains 50 projects for PIC mi- crocontrollers such as a laser alarm, USB teasing mouse, eggtimer, guarding a room using a camera, mains light dimmer, talking microcontroller and much more. You can use this book to build the projects for your own use, but also as a studybook or refer- ence guide. Several different techniques are discussed such as relay, R5232, USB, pulse width modulation, rotary encoder, interrupts, infrared, ana log -digital conver- sion (and the other way around), 7-segment display and even CAN bus, 440 pages * ISBN &78-0-905705-8fJ*G £36.00 * US$58.10 PIC Cookbook for Virtual Instrumentation Several case studies included PIC Cookbook for Virtual Instrumentation The software simulation of gauges, con- trol-knobs, meters and Indicators which behave just I i ke rea I hard ware components on a PC’s screen is known as virtual instru- mentation. tn this book, the Delphi pro- gram is used to create these mimics and PIC based external sensors are connected via a U5B/R5232 converter communication link to a PC 264 pages ■ ISBN 978-0 905705-84-2 £29.50 * US $47.60 '/JihV!. i * python A Get started quickly and proceed rapidly Python Programming and GUIs This book is aimed at people who want to interface PCs with hardware projects using graphic user interfaces. Desktop and web based applications are covered. The pro- gramming language used is Python, anob- ject-oriented scripting language; a higher level language than , say, C. Obviously hav- ing fewer lines of code will be quicker to write but also fewer lines of code means fewer opportunities to make mistakes. Code will be more readable, and easier to modify at a later date. You can concentrate on the overall operation of the system you are making* This abstraction also applies when writing graphic user-interfaces* Wri- ting low level code for graphics and mouse dicksand thelike issomething thatyou do not have to do. in Python alt this is wrapped up in relatively simple functions. The book guides you through starting with Linux by way of a free downloadable, live bootable distribution that can be ported around dif- ferent computers without requiring hard drive installation. 224 pages * ISBN 978 0-905703 87 3 [29.50 - US$47,60 V 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 Fmaik 4alpt@elektnr.cnm A must-have for audiophiles dvd Masterclass High- End Valve Amplifiers In this Masterclass Menno van der Veen will examine the predictability and perceptibil- ity of the specifications of valve amplifiers. The DVD represents 3.5 hours of video ma- terial. Bonus elements on the DVD include the complete PowerPoint presentation {74 slides), scanned overhead sheets{22 pcs), AES Publications mentioned during the Masterclass. Not forgetting the bombshell: 25 Elektor publications about valves. ISBN 978-0-905705-86-6 £24.90 * US$40,20 Seethe light on Solid State Lighting dvd LED Toolbox This DVD-ROM contains carefully-sorted comprehensive technical documentation abou t a nd aro u nd LEDs , Fo r s tand a rd mod - els. and for a selection of LED modules, this Toolbox gathers together data sheets from all the manufacturers, application notes, designguides,white papersandso on. It of- fers several hundred drivers for powering and controlling LEDsin different configura- tions, along with ready-to-use modules ( power su pply u n its , D MX co ntrol lers .dim- mers)* In addition to optical systems, light detectors, hardware, etc., this DVD also ad- dresses the main shortcoming of power LED s: hea ti ng . Thi s DVD con tai ns more than 1 00 articles on the subject of LEDs. ISBN 978-90-5381 -245-7 £28.50 ■ U5 $46.00 y elektor 7 / 8-2010 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES 1 10 issues, more than 2.100 articles dvd Elektor 1990 through 1999 This DVD*RGM contains the full range of 1990-1999 volumes (all 110 issues) of Elektor Electronics magazine (PDF), The more than 2,100 separate articles have been classified chronologically by their dates of publication (month/year), but are also listed alphabetically by topic* A comprehensive index enables you to search the entire DVD. ISBN 9 78’ 0- 9057 05-7 B -7 £69*00 * US S1 11.30 A whole year of Elektor magazine onto a single disk dvd Elektor 2009 This DVD-ROM contains all editorial arti- cles published in Volume 2009 of the Eng- lish. American, Spanish, Dutch, French and German editions of Elektor. Using the supplied Adobe Reader prog ram, articles are presented in the same layout as origi- nally found in the magazine. An extensive search machine is availableto locate key- words in any article. With this DVD you can also produce hardcopy of PCB layouts at printer resolution* adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other programs. ISBN 978-90-5381 -251 -B £17,50 - U5S28.30 (June 2010) In-vehicle CO 2 IV (May 2010) Incur March issue, we introduced Sceptre, a fast prototyping system fitted with a 32- bit microcontroller. Even on its own. this board will let you produce some great re- sults, hut if we add an extension board to make it easier to access all its peripherals, the Sceptre platform becomes downright powerful. What's more, if you fit this extension board into a suitable case, you'll be able right from the start to develop a prototype that you can use "properly' in a installation, with notrailing wiresorbitsof sticky tape holding everything together. IMow that’s what you call fast* convenient prototyping! TCjT of parts, contains PCS and components dsPIC Control Board (May 2010} The C0 2 Meter published in our January 2008 edition continues to operate very well, so why bother to do a new design? The answer is both simple and obvious. In the previous article, we mentioned that too high a concentration of C0 2 negatively affects the ability to concentra- te. And in which daily activity does the abi- lity to concentrate play an important role? Exactly! While driving a car (excluding con- vertibles). We therefore developed a C0 2 meter that is suitable forin-car use. Kit of parts , including sensor ond LCD l excl. enclosure / Art # 0100020-71 • £07.00 • US$221.00 Reign with the Sc (March 2010) This control board has been designed for incorporation into typical industrial elec- tronics applications like controlling mo- tors or adjustment of static up- or down -converters Jhe objectives were to obtain a board with a large number ofpul- sewidth modulation (PWM) generators, which enables us to control several mo- tors and static converters at the same time. The cost of the control board nee- ded to be as low as possible too* In addi- tion, it must be possible to construct the board using a soldering iron, without re- quiring use of a reflow oven* PCB , populated ond tested This open-source & open-hardware pro- ject aims to be more than just a little board with a big microcontroller and a few use- ful peripherals - it seeks to be a fast pro- totyping system. To justify this title, in addition to a very useful little board, we also need user-friendly development tools and libraries that allow fast implementa- tion of the board’s peripherals. Ambitio- us? Maybe, but nothing should deter you from becoming Master of Embedded Sys- tems Universe with the help of the Elektor Sceptre. PCB , populated and tested, test software loaded (excluding Bluetooth module f Art.# 090559 91 * £89.00 * US$141.60 V Prices and item descriptions subject to change* E . & G*E 7 / 8-2010 elektor $ ■i ■ July/August 201 Q (Mo. 403/404) ^ ^ ^ + + + Product Shortlist July/ August; See www,elektar f corn + + + ]yne2010(Mo,402) OBD2 Mini Simula tor Virtual car supports PWMfl5O/KWP2000 080 8 04 -7 1 „ K i t of pa r ts + + p H sb-b § bb a + a B + a b bb e bb pa ■+■ b + b p + a pa p p*p pa ■ bb b + b “ *-b* + b p b + s pa b + b 84.00 a ebb p 135+50 Wireless Electricity meets RFID 1 00051 - 71 „., Kit of parts, containing 3 PCBs (RFID Tag . debugger and reader), 2 programmed micro* controllers and 080910-91 module ., . ♦„♦, 35, 00. .,,.,,56.50 InterSceptre opens doors (and ports!) for you 1 001 74-71 .... Kit of parts, contains PCB and components 1 1 6.00..... 1 87, 1 0 May 2010 (No, 401 ) dsPICControl Board 090073-91 .... PCB, populated and tested 140.00 225,90 Cloud Altitude Meter 090329-91 .... Populated PCB in enclosure (see poll).,,..,,.... www.elektor.com In -vehicle C0 3 Meter 100020-71 .... Kit of parts 137.00. ...,221. 20 1 0 00 2 0 >2 .... Eric 1 05 ure ■■■... . . . 1 ^ . 130 .3 0.7 0 VisiOLED 081141-1 ...... Printed circuit board 1 3.30„..,„21 .50 April 2010 (No. 40Q) Unilab 09 0786-1 r , ... , Printed c Ercuit boa rd, . „ , „ 1 6,0 0 25 ,90 090786-7 1 .... PCB and all components, less power transformer 64.00 1 0330 Small is Beautiful: Minimodi 8 090773-41 .... Programmed controller with Bootloader pre-programmed E- p + B b + G B BB BB-B H B + B B + B BB B B + E BB - BB B + B - BB -B B EBB E + a pi ■ BB 21,80 a e ra BB-B 35,20 090773-91 .... PCB, populated and tested with Bootloader pre-programmed B» ■ ■ -ua ■ i ■ ■■■■■ lj ■ .■ ■ a m ■ o ui ■ ■ ■ ■ j ■ ■ ■■ ■ ■ ■ bji (.* ■ pa a i ■ 56.00 ■ E + B * + B 90.40 Bluetooth for OBD-2 090918-71 .... PCB with SMDs fitted, BTM222 Bluetooth module 26.70 43, 1 0 Fun with Fireflies 100014-1 iirir Printed circuit board 1 1,00. ,,.,..17. SO 1 00014-41 Prog ra m med controller. . 11.00 17.80 Beep. beep,.. Sesame 081143-41 ....Programmed controller... 15.50 25.00 SV Power Com roller 090719-1 ......Printed ore u 1 1 f o a r ci . . . . , . . . . . . . . , ... , . . . . . ,, , . . . . , . . . < . . , , . . . . , . . . 3 . 9 0 1 —1 , ^ 0 March2010(No. 399) Reign with the Sceptre 090559-91 .... PCB, populated and tested, test software loaded (excluding Bluetooth module) 89,00.,... 1 43.60 Modulo D 090563-71 .... PCB, SMD-populated.and all other components 69,90.,...! 12.80 February 20 1 0 (Mo, 393) Battery Checker 071131-41 .... AT mega32-1 6PU, programmed 1 7.80 28.80 071131-71 .... Kit of parts, exd, enclosure .. 124.00 200.00 Winamp Controller 090531-71 .... Kit of parts ■ BB G BB BB>B a + a BB a G + B BB a BB i + i BB S +B B BB fi + B B + B I + B E + B B + B E BB B + B E + B BB B B + 89.00 B B BB i 143,60 TheATMISRadb Computer 090740-71 PCB with SS4734/35 radio 1C ready mounted and tested. ■ a- a a a a ■■ a r a r a a r B ■ a a a ra a BB a B a B ■ a B pa BB-B bB a Bt a r a a r a- 27.50 44.40 CO OIF" MirmrfmfBnlFnB BiBrtirw-tf A 1 2 0 PIC Microcontroller projects ISBN 978-0-905705-88-0.... £36.00 USS58.10 Python Programming and GUIs ISBN 978-0-905705-87-3 .... £29,50 US S47.60 l/l o o CO 4 5 PIC Cookbook for Virtual Instrumentation ISBN 978-0-905705-84-2 .... £29.50 US $47.60 Complete practical measurement usm^oc ISBN 978-0-905705-79-8 £28,50 U5 $46.00 C# 2008 and .NET programming ISBN 978-0-905705-81-1 .... £29.50 US $47.60 Ma&terdass DVD High-End Valve Amplifiers ISBN 978-0-905705-86-6.... £24.90.... US $40.20 DVD Elektor 2009 ISBN 978-90-5381-251-8.,.. £1 7.50 .....US S28.30 dvdLED Toolbox ISBN 978-90-5381-245-7.... £28.50 U5S46.00 DVD Elektor 1990 through 1999 ISBN 978-0-905705-76-7 .... £69.00 ...US $1 1 1.30 CD ECD 5 ISBN 978-90-5381-159-7,... £24.90 US $40.20 Reign with the Sceptre Art. # 090559-91 £89,00 ... US $143.60 Unilab Art. # 090786-71 £64.00 US$103.30 ln-vehide C0 2 meter Art. U 100020-71 £1 37.00 ...US $221.00 dsPIC Control Board Art. #090073-91 £140.00 US$225.90 Modulo D Art. # 090563-71 £69.90 ...US $1 1 2.80 / r 1 Order quickly and securely through www.elektor.com/shop or use the Order Form near the end January 2010 (No, 397) USB Magic Eye 0907 SS - 1 Printed circuit board.., . ... 9.90..,..,. 16.00 090788-41 .... ATtiny23 1 3-20PU, programmed 9.90 1 6.00 M I AC for Ho me Au to mat ion 090278-91 .... Populated PC6 in enclosure 154.00. ....248.40 v J Elektor Reg us Brentford 1000 Great West Road Brentford TW8 9HH * United Kingdom Tel. +44 20 82614509 Fax +44 20 8261 4447 Email: sales IDelektorxom elektor 7/8-2010 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR 2.5 GHz Frequency Meter This modular design offers a wide frequency range from 40 MHz to 2.5 GHz and even the ability to perform level measurements (cJBm/mW/mV). For the operation and display of data use is made of the display module for the True-RMS voltmeter published in our May 2009 edition. Two different versions can be built, which differ in terms of accuracy and input voltage range. Image Detection System In this system the powerful yet inexpensive PltibFSgo micro is employed to process images from a small black and white camera (1916 x 1918 pixels) by way of its analogue input. This image can be compared to a reference stored in EEPROM. The PIC can detect movements in the image and even the coordinates of a light source seen' in the image. The image can also be sent to a PC. Digital Multi-Effect Processor Each musical performance sounds much better right away with some appropriate sound effects. This little circuit offers many options, thanks to the use of a special 1 C from Spin Semiconductors. This little 'effects miracle' includes high performance D/A and A/D con- verters, a RAM-based memory delay, four LFOs, three additional analogue inputs and a 24-bit ALU. Eight standard effect algorithms have already been programmed in the chip by the manufacturer. Article tales and magazine contents subjet f fn change: please check the Magazine tab on wwv.elektar.com Elektor UK/Europeon edition: on sate August 19 . 20 to. Elektor USA edition ; published August 12 . 2010 . VV V elektor.com www.elektor.com www.elektor.com www.elektor.com ms Ele All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the tlektor Shop you'll find all other products sold by the publishers, like CD-ROMs, DVDs, kits, modules, equipment, tools and books, A powerful search function allows you to search for items and references across the entire website. LET YOUR GEEK SHINE 113 no* spartdun A-*-' X: - £h M EfJbrt ) Also on the Elektor website: Electronics news and Elektor announcements Readers Forum PCB, software and e-magazlne downloads Time limited offers FAQ, Author Guidelines and Contact NHp ^ururisr" e*tiv «T*r »£*i m fr« ■ •dr* ?rbl*£l j ~ . 1 * MtfrlOA n*. S ! t Ir'r’r.T, Ah'HtU HEUS t: fiMCir.t L-z-J* ihflrt ’4 Tlil'brt 'L EtB. ■J £ Kitten ■* UnJljinr, w Orii> , y!,Lb;r;!i?ii D-ili*.* '!i| H*-- « ■ midi |y-j I « • W eiKBUHT PwigrJrnrttirWJ Eirlbflddtd PIC Mkrxenifollm Kit of parti tlckfciWIn't' I ;-nr Era. ■ bu< E- a ■ ,‘M' f il I ! 1 i 1 tDf lf. fndu^a-n THt 1 # p^CT OVD ILf 0 T-n*IH>u ■ * most y&w USB Lj‘ ii Acquisilum i\ I US n6 7/8-2010 elektor Description Price each Qty. Total Order Code 1 Power Electronics in Motor Drives fJjjZl £29.50 50 PIC Microcontroller projects £36.00 Python Programming and GUIs r'lLT £29. so DVD Masterclass High-End Valve Amplifiers £24.90 DVD Elektor 2009 £17.50 Sub-total Prices and item descriptions subject to change. The publishers reserve the right to change prices PBtP without prior notification. Prices and item descriptions shown here supersede those in previous issues. £. & OJE. Total paid Name METHOD OF PAYMENT (see reverse before ticking as appropriate) Bank transfer | | Cheque (UK- resident customers ONLY} i ] Giro transfer □ ^!sT □ I is is rr- — "tf — |J — I II H I I I l l Expiry date: Verification code: Please send this order form to * (see reverse for conditions) Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Address + Postcode Tel Email Date Signature EL7/S 1 P B - - * ■ ■ I 'B ■ ■ 1 1 "i ■ ■ 1 T P B a B P P ■ 1 I' P P B V f t B 1 B P - - " HI - J J 1,1 *■ “ ■* 1 1,1 Tel.: +44 20 8261 4509 Fax: +44 20S261 4447 www.e1ektor.com sales « elektor com USA and Canada residents should use S prices, and send the order form to: Elektor US PC So* 1 80 Vernon CT 06066 USA Phone 860 875-2199 fa*: 860 871 -04 H f mail: sales ' 1 elektor com Yes, I am taking out an annual subscription to Elektor and receive the E-book Microcontroller Basics totally free!' (Please fill- in your crnailaddress below) Microcontroller Basics 1 would like: — Standard Subscription (1 1 issues) Subscription-Plus {11 issues plus the Elektor Volume 201 0 DVD-ROM + exclusive access to www.elektor-plus.com) Offer available to Subscribers who have nof held a subscription to Elektor during the lost 12 months. Offer subject to availability. See reverse for rates and conditions. r METHOD OF PAYMENT (see reverse before ticking as appropriate) I ] Bank transfer | | Cheque [UK-resident customers ONLY) | ; Giro transfer □ visa □ Expiry date: Name Address + Postcode Verification code: Please send this order form to Tel Date Signature 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 subsc riptiiD ns" elektor.com EL7J8 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 U5 for applicable P&P charges. Please allow 4-6 weeks foi 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, 402702 11 held by Elektor International Media BY with The Royaf Bank of Scotland. London. [BAN: CB96 ABNA 4050 3040 2702 1 1 . B1C: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics, We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no, 34-1 52-38011 1 held by Elektor International Media BV, Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre, Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security, COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the suppfy of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) qiven 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 lor all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5.00, Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept 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 copyrightand 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 2010 r ■ ■ t n ■ ■ ■ n ■ ■ ■ n ■ ■ ■ ■ n u ■ ■ ■, i. a j j i. _ ^ . - - P - _ B H . a.., t j jl . * * SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom & Ireland £49.00 £6T50 Surface Mail Rest of the World £63.00 £75.50 Airmail Rest of the World £79.00 £91.50 USA £64.95 See www. elektor.com/ usa Canada £75.95 for special offers HOW TO PAY Bank transfer into account no, 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland. London. I BAN : GR96 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. Giro transfer into account no. 34-152-3801, held by Elektor International Media BV. Please do not send giro transfer/deposit forms directly to us T but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VI5A 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. Ef a permanent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs £39,20, a Student Subscription-Plus costs £51.70 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twenty-five per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 2010 Order custom-designed boards from the Elektor PCB Service The advantages at a glance * Professional quality PCBs. * Wo film charges or start-op charges * Wo minimum order quantity or charge for this service ■ Available to private and commercial customers wiSVhSsr 1 ^ f ° 311 emrieS ' We ’" l6t y0U know •Two PCBs supplied -three produced fr B ert c 2 6 9 “ a ' SalSOOkay ’ y0urecei ' ,el,as *“- Quick, cheap and secure www.elektorpcbservice.con1 Index of Advertisers Astrobs, Showcase www.astwbe.com . .110 Atomic: Programming Ltd. Showcase www,atomfcprogrammingcam ,110 Avi[ Research. Showcase www.aviiresearch.co uk 110 Seta Layout, Showcase ....... — www.pcb-pool.com . . . 2, 110 Black Robotics, Showcase www.blackrobotics.com 110 By Vac. Showcase www.pyvac.com ... 1 TO CEDA, Showcase. . . . . .... T ........... www.cedajo 110 Designer Systems, Showcase .... www. destgnersy stems. co ttk Easysync. Showcase www>ea$ysync .CQ.ilk Elnec. Showcase www.0trwc.com Eltim Audio Eurocircuits . www.eitim.po. , . 110 110 110 ......21 wwweuma/eurts. com 105 First Technology Transfer Ltd. Showcase . www.ftt.co.uk ,, no Flex i Panel ltd Showcase , „ . . , www.ftexipafibt.com ,,110 electromca 2010 . wmv.eiectrontcaMefen . . MikmEleklronika, MOP Electronics, Showcase. P arallax — ■ - www.paratlax.com Pe ak E I ectro nic De sign www. peakqtec. co.uk Pico. .j. Quasar Electronics wmv.p/cotech. com/scope2Q 12 .... 79 www.mikroe.com 8, 9 www.mqp.com 1 11 Nurve Networks .... — . . . www. xgamestaiion. com + , . £ 1 www. quasareteciromcs. com . ....... 57 . . .++#. 59 21 ■ ■ ■ ■ - i ■ 4 i 47 Robot E tec ironies. Showcase * . www.rQbol-electmfUCS.co.uk ... ...ill Rohotiq Showcase RS Components. Showcase USB Instruments, Showcase . . . Virlins Technology. Showcase . .. iwwrohof/g.co.ulr ,.,111 *■# + +■ . , www.rswww.com/edp. 3 ' ' ’ r.,, P I ■«». 1 . . . . ... HQ, 1 www. usb- instruments, com . . Hi . www.yirfins.com. 1 1 1 Future Technology Devices, Showcase wwwJtdicbip.com . . . ... 95,110 Hameg, Showcase — WWW.bameg.com . . tl no HexWax Ltd. Showcase www.hexwax.com. , 1 1 1 Images Scientific, Showcase www.jmageseo.com La be enter Ill - ■ , Wm.iabcentBr.com . . 120 Advertising space for the issue 23 September 2010 may be reserved not later than 17 August 2010 with Huson International Media - Cambridge House - Gog mo re Lane - Chertsey, Surrey KT16 9AP - England - Telephone 01932 564 999 - Fax 01932 564 998 - e-mail: ros.elgar@hysonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. elektor 7/8-2010 ng Board Edge Defined - CHECK CHECK Ail Connections Routed - CHECK Power Planes Generated - CHECK [\lo Design Rule Violations - CHECK Design with Confidence: The latest version of the Proteus PCB Design Software provides a multi stage Pre-Production Check which will detect and prevent a variety of common mistakes prior to your boards being sent for manufacture. PROTEUS DESIGN SUITE Features Board Autoplacement & Gateswap Optimiser. Direct CADCAM, ODB++, IDF & PDF Output. Integrated 3D Viewer with 3DS and DXF export i- Mixed Mode SPICE Simulation Engine. Co-Simulation of PIC, AVR, 8051 and ARM7. Direct Technical Support at no additional cost. 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 All levels of the Proteus Design 5uite include a world class, fully integrated shape-based autorouter at no additional cost - prices start from just £150 exc. VAT & delivery Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@tabcenter.com