OCTOBER 2007 www.elektor.com • V9.U ■ J- I_» 1 rldwid t-l Bistort. f-J 'cuwi tidl IJ11 TLr n, h'uf.h. HJllf umbncnEerbes Milton Indutlnop^fK isloord LjmtirtcM luOtterri N276 we2><©V3 9 770268 45112 8 r» (l .1 n.^1 J [Tr r” i r~nll r« r B N276 JAYCAR ELECTRONICS Minimum Order Now Only £1 0 t j Visit us at www.jaycarelectronics.co.uk and obtain your free copy of our 430+ page, full colour catalogue. We have an extensive range of electronics kits and the best in innovative gadgets. Precision Japanese Made Carbon Steel Tools 125mm Precision Long Nose PI ers TH-1885 £7.00 + post & packing The pliers feature serrated jaws and a box joint to provide a precise action and strong grip. The coil spring ensures smooth, fatigue-free use. Insulated soft touch handles. POST AND PACKING CHARGES: Order Value Cost Order Value Cost £200 - £499.99 £30 £500+ £40 Autoranging DMM QM-1535 £8.50 + post & packing An excellent, accurate meter that is Cat II rated. It features diode, frequency and capacitance test, duty cycle, continuity, relative measurement and includes battery, probes and holster. These quality tools are made in Japan from the same High Carbon Steel that is used to make professional chef's 150mm Precision Side Cutters TH-1891 £8.00 + post & packing These cutters are designed for sharp cutting in precision wiring'. They have insulated soft-touch handles and a coil return spring for fatigue-free use. £10 - £49.99 £5 £50 - £99.99 £10 £100 -£199.99 £20 Max weight 121b (5kg). Heavier parcels POA. Minimum order £10. Note: Products are dispatched from Australia, so local customs duty and taxes may apply. How to order: Phone: Call Australian Eastern Standard Time Mon-Fri on 0800 032 7241 Email: techstore@jaycarelectronics.co.uk Post: PO BOX 6424, Silverwater NSW 1811. Australia Expect 10-14 Days For Air parcel delivery Adaptive Turbo Timer Kit KC-5451 £13.25 + post & packing Ordinary turbo timers with a fixed time setting don't adapt to engine use and can turn off too early it the car has been driven hard, or run your engine overtime if the car has only been pottering about. This excellent kit overcomes the problem by constantly monitoring engine load and adjusting the timer run-time to suit the turbo's cooling need. Maximum cool down can be adjusted from a few seconds to 15 minutes and the timer will automatically work within this range. Indicators show when the timer is in operation, cooling period, and sensor level. Kit supplied with silk screened PCB and all electronic parts. 18 & T. I Theremin Synthesiser Kit KC-5295 £14.75 + post and packing The Theremin is a weird musical instrument that was invented early last century but is still used today. The Beach Boys' classic hit "Good Vibrations" featured a Theremin. By moving your hand between the antenna and the metal plate, you create strange sound effects like in those scary movies! Kit includes a machined, silkscreened and pre drilled case, circuit board, all electronic components, and clear English instructions. Requires 12VDC wall adaptor (Maplin #GSR74R £9.99) Log on to www.jaycarelectronics.co.uk/ele for your FREE catalogue! 0800 032 7241 (Monday - Friday 09.00 to 17.30 GMT + 10 hours only) For those who want to write: 100 Silverwater Rd Silverwater NSW 2128 Sydney AUSTRALIA Universal Speaker Protection and Muting Module Kit KC-5450 £8.75 + post & packing Protects your expensive speakers against damage in the event of catastrophic amplifier failure such as a shorted output transistor. In addition, the circuit also banishes those annoying thumps that occur when many amplifiers are switched on or off, especially when the volume is set to a high level. The design also incorporates an optional over temperature heat-sensor that will disconnect the speakers if the output stage gets too hot. Configurable for supply voltages between 22VDC-70VDC. Supplied with a silk screened PCB, relay and all electronic components. ft JSTV, ■ L j 1 ■ - v. * x All prices in £ Stg v Free 430+ page ^ Catalogue IR Remote Control Extender MKII KC-5432 £7.25 + post & packing Operate your DVD player or digital decoder using its remote control from another room. It picks up the signal from the remote control and sends it via a 2-wire cable to an infrared LED located close to the device. This improved model features fast data transfer, capable of transmitting Foxtel digital remote control signals using the Pace 400 series decoder. Kit supplied with case, screen printed front panel, PCB with overlay and all electronic components. Requires 9VDC wall adaptor (Maplin #GS74R £10.99) jnucnr www.jaycarelectronics.co.uk Simulate. Prototype Test. Reduce design iterations with SPICE simulation and virtual instrumentation. Verify circuits and locate errors before prototyping, and interactively explore circuits with powerful analyses and virtual instruments. Also integrate test data to drive your circuits and compare simulated and real-world behavior. The latest versions of Multisim and Ultiboard introduce new features for board-level design, such as: ■ More than 1,200 new components added ■ Enhanced data visualisation and analyses ■ Microcontroller (MCU) cosimulation with support for C and assembly code ■ Significant Ultiboard performance enhancements ■ Integration with Nl LabVIEW for increased measurement productivity Nl CIRCUIT DESIGN SUITE Nl Multisim 10.0 ^Intuitive SPICE Simulation ■ Schematic Capture Nl Ultiboard 10.0 *Board Layout BAutorouting » View demos and download a free evaluation at ni.com/multisim 44 (0) 1635 523545 electronics WORKBENCH is now NATIONAL ^INSTRUMENTS ELECTRONICS WORKBENCH GROUP 10/2007 - elektor 3 electronics worldwide Just in case you did not notice, Elektor has a new subtitle. Half a dozen of these appeared and disappeared over the past 34 years. For the English-language edition, the first subtitle to appear was 'electronics for lab and leisure' and the most recent, 'leading the way'. No different for the other language editions, which now abandon their latest subtitles 'inspiring electronics' (German), 'imaginative electronics (French) and 'surprising electronics' (Dutch) in favour of the new, unified, 'electronics worldwide'. The subtitle of a magazine ideally qualifies the content as well acts as an afterburner to the main title — what's the coverage and purpose of the magazine, how does it affect the reader and what's the promise if he or she starts reading it on a regu- lar basis. It's 'electronics worldwide' now and we realise you may not care too much because the contents are more important: new circuits and ideas every month that enable you to experience and enjoy electronics no matter if it's professionally, as an enthusiast or both at the same time. Still, the new subtitle holds good news for you, because it underscores our intention to broaden our horizon. Developments in electronics cannot be stopped at frontiers using red & white barriers. The internet acts as a catalyst, vehicle and medium in this unstoppable trend. That's why Elektor launched new websites for its main European editions recently, with Spanish and Chinese to follow soon. Hence the new subtitle 'electronics worldwide'. Unwittingly, you are part of it all, together with 2 million others we reach every month with our publications and products. This issue of Elektor also marks our move from rather lacklustre, overcrow- ded and worn out 1970s style offices to a really 'grand' location — a real castle from the 1 3th century. Although we're not allowed to paint anything on the facade, or even attach a smal- lish nameplate (the building is under National Trust protection) we have dubbed the premises 'Elektor House'. See pages 1 6-1 8! lektor electronics worldwide s M The alarm systems of expensive cars and other vehicles often comprise positioning systems so they can report where the vehicle is located. However, such systems are rather expensive, so we decided to take the DIY approach and develop our own version, dubbed ElekTrack. USB-to-serial converters are often slow, especially when it comes to software con- trol of the handshake signals. The delays are particularly irritating when develo- ping and debugging software. Good (i.e., fast) USB to serial converters exist but are dearer than the more general purpose unit we describe here. USB bus and asynchronous serial busses (UARTs) appeared in the early 2000s. Now here we are with third, fourth, and even fifth generation circuits: faster, more reliable, and more stable (especially their drivers), and offering improved features. 52 USB/UART Interfaces The amplifier described here uses a mixture of transistors and valves to combine the advantages of both approaches and thus deserves the designation 'hybrid'. The result is an amplifier with audiophile performance. Wisse Hettinga International Coordinating Editor Indyi^irieparfe Hoard I 1. !□ 62 Astounding Engineering Solar Team Twente's vehicle built for the World Solar Challenge 2007 in Australia is based on the positively phototropic behaviour of sunflowers. Tilting solar panels with Fresnel lenses aim to maximise the yield of the sun's energy in this solar car. 20 Mugen - a Hybride Audio Amplifier Volume 33 October 2007 no. 370 projects Readers Circuits: E-dictator 20 MUGEN a Hybrid Audio Amplifier 30 Interference-free sou nd 36 Elektrack 42 Flash of I nspiration 46 USBProg 58 Home Automation 70 Design Tips Retirement home for alkal ine batteries EasyControl I/O technology USB/UART Interfaces info & market 6 Colophon 8 Mailbox News & New Products 16 Elektor electronics world- wide Astounding Engineering 66 Inexpensive ARM Kit 80 Elektor SHOP Sneak Preview infotainment 70 Labtalk: Data Books 76 Hexadoku 77 Retronics: The Revophone (1922) ELECTRONICS WORLDWIDE elektor international media Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. lektor lekt or r?wM i It * 1 ir%- ri JT rr- Volume 33, Number 370, October 2007 ISSN 0268/4519 Elektor Electronics aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 1 1 times a year with a double issue for July & August. Elektor is also published in French, Spanish, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Mat Heffels (m.heffels@elektor.nl), Wisse Hettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff: Harry Baggen, Thijs Beckers, Ernst Krempelsauer, Jens Nickel, Guy Raedersdorf. Design stc Antoine Authier, Ton Giesberts, Paul Goossens, Luc Lemmens, Jan Visser, Christian Vossen Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DT Giel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Customer Services: Anouska van Ginkel Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com 6 elektor - 10/2007 A world of electronics from a single shop Starting this month: brand new shop pages in Elektor! Books Highlights from the Elektor's book portfolio. Not just the latest titles but also top selling publications from the past. Elektor has books on a wide variety of subjects! r CD-ROMs Our digital media collection. Software, hardware, education and, of course, lots of Elektor magazine articles! Nearly all disciplines from the wide fields of electronics and information technology are represented. r Kits & Modules Whether you prefer to build up boards for yourself, or enjoy the ease of a ready-made module, Elektor supplies a kit of parts or a ready-populated and tested board with many projects published in the magazine. We leave the choice up to you! nt ' — ' ' a a, | ■ — 1 1 - — — 11 ■ 1 - " Also monthly in the restyled Elektor Shop: • Bestsellers: listing the five top selling publications for each medium • Product Shortlist: printed circuit boards, software and microcontrollers arranged by month of publication Ordering Info: fast and easy ordering via Elektor's online shop or the Order Form in the magazine A A r^Jlektor LZ3s op Go to page 80 to see all the enhancements! Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form Head Office: Elektor International Media b.v. P.0. Box 1 1 NL-61 1 4-ZG Susteren The Netherlands Telephone: (+31 ) 46 4389444, Fax: (+31 ) 46 43701 61 Distribution: Seymour, 2 East Poultry Street, London EC1A, England Telephone:+44 207 429 4073 UK Advertising Huson International Media, Cambridge House, Gogmore Lone, Chertsey, Surrey KT1 6 9AP, England. Telephone: +44 1932 564999, Fax: +44 1932 564998 Email: p.brady@husonmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. International Advertising Frank van de Raadt, address as Head Office Email: advertenties@elektor.nl Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carri- ers and article texts published in our books and magazines (other than third-party advertise- ments) are copyright Segment, b.v. and may not be reproduced or transmitted in any form or by any means, including photocopying, scanning an recording, in whole or in part without prior written permission from the Publishers. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protec- tion may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publishers to alter the text and design, and to use the contents in other Segment publications and activities. The Publishers cannot guarantee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media B.V. 2007 Printed in the Netherlands 10/2007 - elektor 7 INFO & MARKT MAILBOX Driving 8, 16, 24 or more servo motors from a single micro Servo motors require a pulse every 20 ms of which the width varies between 1 and 2 ms. Such a pulse sequence is easily generated using the famous 555 timer 1C. A microcontroller, too, has few problems driving one or two servo motors in this way. However, cunning plans are in order if you want to drive (many) more motors. The perennial problem: time! To enable a microcontroller to ge- nerate a pulse with a length of 1 to 2 ms at a 20-ms rate you could use its inbuilt timer. This is then programmed to supply an interrupt every 20 ms. The pseudocode shown in Listing 1 is just a suggestion (it's C code fora PIC16F690, but apart from the timing and the ports used, it makes no difference what controller is actually used). With a small modification, the code can be employed to drive up to 10 servo motors, and it's actually achieved by throwing in an array of servo timers and changing the inter- rupt rate to 2 ms (Listing 2). This looks nice at first sight but there are a few disadvantages to mention: • output bits on a controller cannot normally be indexed (minor problem!), but it can be done using a mask over the output port; • driving more than 1 0 servo motors is not feasible because we need a 2 ms pulse (max.) (10=20/2) every 20 ms; • when all 1 0 servo motors are fully driven (100%), no time remains for the fo- reground loop. This makes it impossible to adapt the motor positions (major problem!). Now, instead of generating a separate pulse for each servo motor, we could generate a mask across 8 (or 16, or...) bits and adapt it timewise. So, to begin with we set all servo motor outputs to be driven to True', and turn off servo outputs again per delta time (Listing 3). This allows the Listing 1 int servoTimel; // timeout for servo 1 On_2 0_milli_Seconds : Output 1 = true WaitMicroSeconds (servoTimel) Outputl = false Return routine Onlnit : InitTimerO // set timer to 20 ms and // set interrupt vector servoTimel = 1500 // between 1000 and 2000 while ( 1 ) // code to adapt servoTimel key = getkeyO if ( key = KEY_UP && servoTimel < 2000) servoTimel = servoTimel + 1 if ( key = KEY_DOWN && servoTimel >= 1000) servoTimel = servoTimel - 1 // and do other things // wait 1.5 ms // from interrupt loop micro to handle the delta time and the masks as foreground tasks. K. Wessing (Netherlands) Inaccurate DIY shop multimeter (1) Dear Jan — as an owner of a 'DIY shop multimeter', I was naturally interested in the arti- cle in the February issue. My meter looks exactly the same, but it is called 'Digi-tool'. I don't remember any more how long I've had it, but it's pro- bably about two years now. At the time, I was attracted by the accuracy of 1 % for a price of (at that time) £12.1 had to have it! Then I could finally do all those jobs accurately that had been waiting for so long Listing 2 int servoTime [10] // timeout for servos int currentServo = 0 ; On_2_milli_Seconds : Output [currentServo] = true WaitMicroSeconds (servoTime [currentServo] ) // wait Output [currentServo] = false currentServo = currentServo + 1 if (currentServo == 10 ) currentServo = 0 Return // from interrupt routine Onlnit : servoTime [0] = 1000 servoTime [1] = 1100 servoTime [8] = 1800 servoTime [9] = 1900 while ( 1 ) // code to adapt servoTimes loop Listing 3 00000000 all motors off On_2 0_milli_Seconds : 11111111 switch all motors on \ Wait 1000 +d0 microseconds 11111110 switch motor 0 off Wait dl microseconds 11111100 switch motor 1 off Wait d2 microseconds 11111000 switch motor 2 off between 1 and 2 ms 10000000 switch motor 6 off Wait d7 microseconds 00000000 switch motor 7 off / (and are still waiting). Since I bought the meter, it hasn't seen that much use. Last week I bought a new power supply for my compu- ter. As the motherboard (also new) didn't want to start up, I began by checking the output voltages of the supply, and to my surprise the 1 2-V and 5-V outputs were both much too low (10.6 V and 4.6 V), but even so my old motherboard still worked OK. So I got out my old analogue meter, and it knew how to display the right values. Nevertheless, I did a quick check using the battery voltage of my car with the engine running, measured with the analogue meter: 1 3 V. Conclusion: the analogue meter gives a better indication of the actual voltage than the 8 elektor - 10/2007 meter from the DIY shop. The latter is now sitting in the only place where it is useful: in the caravan as a sort of glorified voltage tester. The article says that The stated specifications are guaranteed for one year, after which calibration may be necessary'. I would suggest changing that to '...after which calibration may still be possible'. F.R. Goodmans (UK) The deviations you found are indeed quite large. They can probably not be corrected by recalibration. Naturally , we do not have any experience with the long-term accuracy of such meters , but it is obvious that you can't expect too much from the internal mechanical construction (rotary switch) of a meter that sells for 5 pounds. In light of the low price , it might not hurt to take the entire meter apart to see whether some of the con- tacts ore oxidised. Inaccurate DIY shop multimeter (2) Dear Jan — suspecting massive inaccuracy from a cheap D MM like the one you described in your February edition, I hooked up a 'known- good', digital instrument in parallel for a couple of simple measurements. The differences were considerable and as it turned out, caused by a flat battery in the £ 5 instrument. After replacing the battery, the accuracy was perfectly accep- table again — apparently it's strongly dependent on the raw supply voltage and I would advise all users to check their batteries from time to time. Edward Piso Thanks for that Edward [ ogoin it points to economies in the elec- tronic design , in particular , the supply regulation. A handmade resistor Dear Elektor readers — have you ever needed an oddball resistor value like 3 kQ and there's nothing to match in the component drawers? Cut off a slice of TC foam' (yes the conductive black stuff they use to prevent ESD on ICs during transport and handling), use your ohmmeter and trim the piece to the desired value. I tested it for an LED and it worked just fine! Nivard (by email) Seems like clever method but not sure about the stability of the resistance and of course the cur- rent rating! Which Brain for my Robot? Dear Jan — your fine overview of microcontrollers published in the Summer Circuits 2007 issue on robotics mentions a number of devices that are pin compatible with the BS2. Although I appreciate the difficulty in covering each and every compatible micro, I would like to mention that 1 . The StAVer-24M32 is a module containing an Atmel ATMega32 that's program- med over RS232. To program it you need BASCOM-AVR or WinAVR. 2. ARMexpress modules offer 16 TTL compatible digital IO lines and an equally simple to use serial interface. There exists a simple to learn Basic Compiler and a pre-configured C Compiler (see www.coridi- umcorp.com). As opposed to r “ — — — — — — — — — — — — — — — — — — — — — — — ! Corrections & Updates Coil Clinic - June 2007, p. 62-65, ref. 060195-1 The 'Low Battery' message is erroneously displayed when the battery voltage is sufficiently high. The problem is convenien- I tly solved by replacing R2 (10 kQ) with a 56 kQ resistor. Voltage Stabiliser - July/ August 2007, p. 86, ref. 070280-1 The input voltage range for this circuit is 3 V to 25 V, not 1 3 V to 25 V as indicated in the circuit diagram. Tube Sound - June 2007, p. 38-44, ref. 070067-1 The circuit diagram in Figure 5 contains a few errors. The correct rating of C6 and C7 is 47 piF / 1 00 V as indicated in the parts list. Also, C7 should be reversed, i.e. the negative terminal is connected to ground. The ratings of the fuses shown in Figure 6 are higher than those stated in the parts list. The lower ratings are adequate however. Speedmaster - May 2007, p. 50-55, ref. 070021-1 As correctly indicated by the text and the PCB design, output 15 of the sensor (XOUT) is connected to the AN0 input of the R8C via a 1-kQ resistor. In the circuit diagram however, AN0 and AN2 are shown reversed. XOUT should go to AN0 and ZOUT, to AN2. ras to give ro- bots vision. C. Kuhnel (Germany) the BS2, both controllers allow real interrupt handling. With ARMexpress you also get po- werful 32-bit technology thrown in. The device has great poten- tial I believe, for use in came- Ma Box Terms •Publication of reader’s orrespondence is at the discretion of the Editor. •Viewpoints expressed by correspondents are not necessarily those of the Editor or Publisher. •Correspondence may be translated or edited for length, clarity and style. •When replying to Mailbox correspondence, please quote Issue number. •Please send your MailBox correspondence to: editor@elektor.com or Elektor, The Editor, 1000 Great West Road, Brentford TW8 9HH, England. 10/2007 - elektor 9 INFO & MARKT READERS CIRCUITS E- Dictator Alexander Pozhitkov Here is a microcontroller-based system that acts like a speech-ena- bled reminder with a very intuitive interface. The user interface of the E-dictator is very intuitive and simple. Upon turning the system on, it is immediately able to reproduce stored messages or record new ones. All messages recorded into E-dictator are stored in non-volatile memory. To record new messages, E-dictator must be connected to a PC via a serial port and connector Kl. Any terminal program (such as HyperTerminal) set to 19200, 8, N, 1 should do. No commands whatsoever are necessary to make E-dictator start recording: just paste your text into the message window or use Send Text File from the Transfer menu (HyperTerminal). Every character received by E-dictator is echoed to the PC allowing the user to visually check the data transfer, at then end of which E-dictator automati- cally stops receiving. Paragraphs of uploaded text are separated by a carriage return (CR). There is no limit to the size of the paragraphs (i.e. message). The only limit is the total volume of text that can be uploaded, which is determined by the capacity of EEPROM (IC1). Currently, 32 kbits of text can be uploaded into E-dictator. Once the text has been uploaded, the buttons 'Next', 'Repeat' and 'Previous' will prompt E-dictator to reproduce the messages. The speech processor and EEPROM interact with the microcontrol- ler via an SPI interface, which is implemented via RC3, RC4 and RC5 pins of the micro. The ICs are activated one at the time via RCO and RC2 outputs of the microcontroller. Voice output is by way of a miniature 8-Q loudspeaker. The speech processor (IC3) is a Winbond device is produced in four versions: male or female voices for English or Chinese langu- ages. Its processor has SPI connectivity covering data, control and status. Of the other pins that can be used to monitor the status of 10 elektor - 10/2007 the processor, E-dictator employs only one, called 'Ready' (RDY). Resistors R7-R1 2 act as voltage dividers to adjust 5-V logic to 3-V logic on the speech processor input lines. The open-drain output of the speech processor (MISO) is tolerant of 5-V swings, allowing a seamless connection of the speech processor to the microcon- troller. RDY is an open-drain feedback pin pulling Low when the internal buffer of the speech processor is full. RDY was found to be 5-V intolerant, i.e. major faults would occur in the operation of IC3 if this pin was pulled up to 5 V. Therefore, transistor T1 is necessary to adjust voltage levels. The software was written in assembly language using Microchip IDE. The PIC program is organized in an event-driven fashion. An event loop) is constantly running upon the program start. Two con- ditions cause the loop to break: occurrence of a data character in the UART buffer or a press-button event. Recording messages. When data arrive to the UART buffer, the program switches to a message recording mode. In this mode, as soon as the character arrives to the UART buffer it is echoed back to the PC and also immediately transferred into EEPROM via the SPI. The EEPROM can only continuously receive up to 64 bytes, which is determined by its paged organization. As soon as the 64- byte page is full, the EEPROM needs some time (up to 5 ms) to ac- tually store the data. While the EEPROM is completing its internal write cycle, the PC does not stop transmitting characters. Those characters are temporarily stored in the RAM of the microcontrol- ler until the EEPROM is ready for more data. As soon as that is the case, the stored characters are flushed into the EEPROM. After that, the microcontroller returns to its regular procedure of direct transmission of the data from the UART to the EEPROM. Recording mode stops when a timeout occurs in the data transmission, which causes the program flow to return to the event loop. Playing back messages. When you press a button, this event is registered and the program flow is diverted from the event loop to a speaking mode. The PIC micro maintains a pointer to the current message. If the user pressed 'Repeat', then microcontroller retrie- ves text from the EEPROM starting from the appropriate address. Due to the EEPROM and speech processor sharing the same SPI bus, the PIC micro stores a portion of the text message in its in- ternal RAM and uploads text into the speech processor piece by piece: while the speech processor is interpreting and speaking the text, the microcontroller retrieves further parts of the message from the EEPROM and stores in its RAM. This procedure continues until the entire message is transferred from the EEPROM to the speech processor. If the user presses 'Previous' or 'Next', the program scrolls through EEPROM to locate the appropriate message. When it is located, the program executes the same procedure as described in the previous paragraph. ( 060352 - 1 ) The project software is available as a free download from www.elektor.com. Follow Magazine — ► October 2007 — ► Mailbox. Advertisement r\ron\r\r\ A N T E X CJLJLJLJLJ Antex offer a wtde choice of input voltages and bit profiles for our soldering iron range 1 liTii Mil 230V- tE J i a SSSSSSSBI ^ tat* « Mli 230V 60 + years of experience It may surprise you but buying an Antex soldering iron costs less than you think in the long run, British made to exacting standards, they test significantly longer than many imported brands. With a wide range of thermally balanced models, and temperature controlled irons too, you can always be sure to find an iron that meets your needs. A large range of replacement tips are available for most irons, and technical help is on hand from our offices in Devon UK, Buy Online Our new website has all of our irons, and soldering spares and accessories available 24hrs a day. Most items are shipped next day, and we offer free carriage throughout Europe. Why not give antex.co.uk a try! , r . « . » www.antex.co.uk FREE shipping on all orders Antex Electronics Ltd 2 Westbridge Industrial Estate Tavistock, Devon PL1 9 8DE, UK Tel: +44(0)1822 613565 Fax: +44(0)1822 617598 Email: sales@antex.co.uk Web: vwvw.antex.co.uk 10/2007 - elektor n INFO & MARKET NEWS & NEW PRODUCTS Online lighting applications design centre Microchip announces an online Lighting Applications Design Centre on the internet. The com- prehensive website provides a wide range of technical tools and resources that designers can use to add intelligence to lighting de- signs — including information re- lating to Microchip's PIC® micro- controllers, dsPIC® Digital Signal Controllers (DSCs), analog and memory products, as well as de- velopment tools. New lighting technologies, such as light emitting diodes (LEDs), dimmable fluorescent ballasts and high intensity discharge (HID) lamp ballasts, demand increased performance with greater energy efficiency. The flexibility of Micro- chip's low-cost digital, analog and memory products enables design- ers to easily add intelligence to lighting applications. Benefits include energy savings, prolonged product life, improved safety and light quality, reduced component counts, remote control and diagnostic capabilities, and the ability to easily adapt existing lighting designs. www.microchip.com /lighting (070679-5) Test-pins dot co dot uk Allendale Electronics are pleased to announce the launch of test- pins. co.uk, an eCommerce shop for all your test pin and receptacle requirements. The company stocks a wide range of test pin head and styles including, Convex, Concave, Spear, Serrated, Plain Radius, Crown. Our Website offers a cross reference search of other manufac- turers of Test Pins, providing you with our direct equivalent. Test-pins has a secure online shop, with a wide range of shipping op- tions including time definite such as by 9am Next Day, Pre noon and even a Saturday Delivery Service. The P50 Series are ideal for be- tween centres down to 1.27mm and a current rating of 3 A. Like- wise the PI 56 Series is suitable for 3.97mm between centres and have a current rating of 5 A. Test pins have a brass barrel with gold plate finish construction and the plungers are heat-treated beryl- lium copper rhodium plated over hard nickel for reliable contentions and long life probes. All test pins are available in two spring pressures - full technical data and drawings available on the website. Custom test pins can be manufac- tured from small to large volume to customers requirements and to suit individual applications. (070679-1) Allendale Electronics Ltd v Test-Pins Dept., 43 Hoddesdon Industrial Centre, Pindar Road, Hoddesdon, Hertfordshire EN11 OFF. Tel. +44 (0)1992 450780, fax +44 (0)1992 450781. Web: www.Test-pins.co.uk, email: Sales@Test-Pins.co.uk PowerBench for power supply engineers Vicor announces the launch of Pow- erBench™, a suite of online power supply design tools that helps en- sure designers select the best power supply to meet their requirements. If an appropriate standard product does not already exist, engineers can use PowerBench to design a customer-specific product, allowing them to focus on their ideas rath- er than the constraints dictated by power supply availability. By uniquely integrating design, or- dering, and manufacturing proc- esses, PowerBench minimizes costs and lead time. The tools also provide unprecedented levels of in- formation such as immediate price and availability quotes, giving complete control to the user. PowerBench enables engineers to determine whether a standard, existing non-standard or customer- specific specification power supply will best meet the needs of their application. Vicor is the only pow- er supply company to manufacture all products - whether standard or customer-specific - using the same production line and process. This reduces NRE, costs and lead times, ensuring comparable pricing for standard and non-standard sup- plies as well as the same outstand- ing levels of quality and reliability for all products. Engineers use PowerBench's mod- ule design system to specify online the exact power supply they need and verify in real time its perform- ance and attributes. This eliminates the risk of specifying the wrong power supply for the application. PowerBench tools encompass the design of DC-DC converters, AC- DC and DC-DC partitioned power architecture (VIPAC and VIPAC Ar- rays), and a broad range of pow- er-factor corrected AC-DC power supplies. www.vicoreurope.com/powerbench (070679-VII) 12 elektor - 10/2007 Robots donated to schools and The InstMC Wessex Section has donated a number of Lego Mindstorms Robot kits to Education Establishments in the Hampshire and Dorset Area and is aiming for more donations in the future due to the great feedback received so far. Donations are being funded from Social Events run by the Section with many more such events being planned. The Lego Mindstorm Education kits comprise a programmable proces- sor and I/O brick with a cut-down version of industry standard software LabView NXT. The brick takes inputs from a very wide range of sensors (movement, proximity, temperature, sound, light, touch together with being able to drive actuators and motors with positional feedback. The command and reaction code is programmed graphically with nest- ing, branching and feedback loops in abundance but is suitable for young children as well as Instrumentation and Control System Engineers. The processor bricks can communicate with each other over Bluetooth as well as to a programming and monitoring PC. The online Mindstorms community is vast with downloadable code blocks, example projects, videos of others creations and competitions. Cevn Vibert (centre left holding robot) and Dr Klaus-Peter Zauner (holding kit box), with Kisan Visavadia (far left) and Richard Ashley-Smith (far right), and in front, Rob Spanton and Stephen English of the Student Robotics Club, and Philip Bennett. Southampton University Students are creating a robot competition for Hampshire schools to encourage robotics and other engineering fields to flourish. So far eight schools have confirmed they will compete to con- struct fully autonomous robots. The team are still seeking sponsorships! Joyce Lewis, Marketing and Communications Manager for School of Electronics and Computer Science University of Southampton, said "It was very good to welcome you to the School and we are all delighted with the robot! Thank you so much!" Dr Klaus-Peter Zauner, ECS Tutor at Southampton University, teaches a course on Biologically-inspired Robotics and for example is working on robots controlled by slime mould! Southampton Saints Radio broadcast an interview with Cevn Vibert, Education Officer for Wessex InstMC also MES Business Manager for At King Edward VI School, Mr. Simon Barker, Head of Design Technology was awarded the Lego Mindstorms robot kit. colleges Mr. John Lambert, Teacher at Shirley School receives the robot kit. Silchester Control Systems, and caught up on the vital need for more En- gineers in the UK to continue the UK's global strength in innovation. King Edward VI School will be using the donation education kits to help promote the vital 'engineering spark' to young students up to GCSE level. Shirley School will be working with young people during science and after school clubs to demonstrate robotics, learn construction, instrumen- tation and motion programming skills. Wessex Section are doing their bit for the Institute's Royal Charter: "To promote for the public benefit, by all available means, the general ad- vancement of the science and practice of measurement and control tech- nology and its application." This, coupled with frequent schools and colleges visits for open days and student talks is what the section can do with only volunteers but is it enough for the UK's future? What can you do? (070679-III) www.instmc.org www.studentrobotics.org http: / / www.ecs.soton.ac.uk/about / news / 1 273 10/2007 - elektor 13 INFO & MARKET NEWS & NEW PRODUCTS PicoScope 5000 PC oscilloscopes with new advanced trigger types Pico Technology, have just added a set of advanced trigger types to the PicoScope 5000 series scopes to make it easier to trigger on com- plex waveforms. The PicoScope 5000 series PC Os- cilloscopes are Pico's top-perform- ing scopes, with the world's fastest real-time sampling rate, for a USB PC scope, of 1 GS/s. This, togeth- er with a probe-tip bandwidth of 250 MHz, makes them ideal for use with high-speed analogue and digital signals. The scope's huge memory buffer — either 32 M or 1 28 M samples depending on the version — ensures that the high sampling rate can be used on a wide range of timebases without losing detail. The new advanced trigger types are part of a continuing pro- gramme of upgrades for the Pico- Scope 5000 series scopes, which has recently seen the addition of an auto-setup command and a new spectrum view. The new trig- ger types are dual-edge, window, pulse-width, drop-out, interval and logic triggering. Window trigger- ing detects when signals go into or out of a given range, so is use- ful for finding overvoltages. Pulse- width triggering can recognise short or long pulses, so helps you find glitches and timing violations. The drop-out trigger finds the mo- ment when a repetitive signal, such as a clock, goes dead. Interval trig- gering detects when two successive clock edges fail to meet a timing condition. Finally, logic triggering lets you trigger on practically any combination of up to four input lev- els or voltage windows. If you're troubleshooting digital sig- nals, you will be able to use these new trigger types to obtain a stable display of complex digital wave- forms such as serial data streams and control signals. The PicoScope 5000 series scopes are ideal in- struments for digital troubleshoot- ing because of their high sampling rate and large buffer size, which when used together allow you to capture long-duration snapshots with high time resolution. The latest PicoScope 6 upgrade with advanced triggering is avail- able now for download, free of charge, from the Picotech website. www.picotech.com (070679-11) Cortex-R4X processor implementations □ a m n a ■ innP c c r~i cn m r jr VlC Port _r~ n r fTM luiurliat Prvlutch S thmiuh Prediction Unin Inittuclfon Cachu TCM ArfriTfir find I nl n rijcfl Miiini.iri|- tlml i * M f * M mi *. * M M * AXE Mltrrncv □XT u u u u u u u □ □ □ J ARM and Intensity, Inc. announced their agreement to produce high- performance implementations of the ARM® Cortex™ family of processors. The first of these will be implementations of the Cortex- R4 processor operating at around twice the frequency achievable us- ing standard synthesis techniques on the same silicon process. The processor implementations in- corporate Intensity's Fasti 4® 1-of- N Domino Logic (NDL) technology, which enables faster circuit speeds while minimizing power consump- tion and area. The ARM Cortex- R4X processor implementations enable higher capacity and data rates without increasing unit costs for very high-volume, deeply em- bedded applications such as hard disk drives, printers and network- ing equipment. The Cortex-R4X processor imple- mentations incorporate all of the advanced features of the popular Cortex-R4 processor. These enable the execution of complex control algorithms and real-time workloads in next-generation embedded sys- tems, while maximizing power ef- ficiency. The extremely flexible lo- cal memory architecture enables the tightly coupled memory (TCM) to be unified into a single logical address space while providing the same performance as cache memory. Straightforward direct memory ac- cess (DMA) support for the TCM extends the use of this memory for shared buffers and streaming data. In addition, all versions of the Cor- tex-R4 processor offer embedded Error Correcting Code (ECC) tech- nology which monitors memory ac- cesses to detect and correct errors, providing very high reliability and availability. The advanced AMBA® 3 AXI compliant bus interfaces al- low high performance memory backplanes to be implemented us- ing the ARM PrimeCell® portfolio. Various configurations of the Cor- tex^ processor will be available as Cortex-R4X implementations, on a range of silicon processes. The first implementation will oper- ate at 600MHz under worst-case operating conditions on the TSMC 65 LP process. As a cycle-accurate implementation of the Cortex-R4 processor it executes all the same software binaries, and is fully sup- ported by the RealView® Develop- ment Suite. Standard Cortex-R4 processor models can be used for cycle accurate modelling of the Cortex-R4X processor implementa- tion with RealView SoC Designer, offering rapid prototyping and ar- chitectural exploration. The Cortex-R4X processor imple- mentation is available for licensing from ARM immediately, with deliv- ery expected in Q1 2008. ARM Partners will be able to choose among a range of off-the-shelf fixed configurations, with the op- tion to order custom configurations as needed. www.intrinsity.com www.arm.com (070679-IV) 14 elektor - 10/2007 Analog + Digital Digital Storage Oscilloscope Dual Channel Digital Scope with industry standard probes or POD connected analog inputs. Fully opto-isolated. Mixed Signal Oscilloscope Capture and display analog and logic signals together with sophisticated cross-triggers for precise analog/logic timing. Multi-Band Spectrum Analyzer Display analog waveforms and their spectra simultaneously. Base-band or RF displays with variable bandwidth control. Multi-Channel Logic Analyzer Eight logic/trigger channels with event capture to 25nS. DSP Waveform Generator Built-in flash programmable DSP based function generator. Operates concurrently with waveform and logic capture. Mixed Signal Data Recorder Record to disk anything BitScope can capture. Supports on-screen waveform replay and export. User Programmable Tools and Drivers Use supplied drivers and interfaces to build custom test and measurement and data acquisition solutions. k USB Mixed Signal Oscilloscope ...or a BitScope BS100U Mixed Signal Storage Scope & Analyzer Innovations in modem electronics engineering are leading the new wave of inventions that promise clean and energy efficient technologies that will change the way we live. It's a sophisticated world mixing digital logic, complex analog signals and high speed events. To make sense of it all you need to see exactly what's going on in real-time. BS100U combines analog and digital capture and analysis in one cost effective test and measurement package to give you the tools you need to navigate this exciting new frontier. Standard 1M/20pF BNC inputs Smart POD Connector Opto-isolated USB 2.0 12VDC with low power modes BitScope DSO Software for Windows and Linux BS100U includes BitScope DSO the fast and intuitive multichannel test and measurement software for your PC or notebook. Capture deep buffer one-shots, display waveforms and spectra real-time or capture mixed signal data to disk. Comprehensive integration means you can view analog and logic signals in many different ways all at the click of a button. The software may also be used stand-alone to share data with colleagues, students or customers. Waveforms may be exported as portable image files or live captures replayed on another PC as if a BS100U was locally connected. www . bitscope . com A 10/2007 - elektor 15 INFO & MARKET ELEKTOR Elektor House, it doesn't get more historical than that! Wisse Hettinga For more than 40 years Elektor has taken its readers on a journey of discovery through the world of electronics. First in the Netherlands, and quickly followed by other countries and language areas. The unique formula of this magazine has withstood the test of time. The magazine, the books and events, the projects you can build yourself — all in all an enormous collection of activities and this goes around the whole world. Hence the byline electronics worldwide. What's in a name? The answer is given by our readers themselves. Mention Elektor in an arbitrary group of boffins or techies and eve- ryone will come up with a different story, anecdote or me- mory: the first radio or amplifier, the first computer, the first ... name whatever you like! A great many readers, now often with good jobs in process automation or electronic product development made their first steps with the help of Elektor magazine Putting aside a sense of modesty: in these 43 years Elektor has written "electronics' history and built an enormous reputation while half a dozen competitors fell off their perch. All this time Elektor has been true to its prin- ciples: unless otherwise indicated, circuits described have been tested and work; all designs are repeatable and the magazine has always closely followed the latest technolo- gy. However, since the beginning of the 1980's the evolu- tionary pace of electronics has also become the greatest threat. With the arrival of ICs, surface mounted technolo- gies and digital technology, building things yourself beca- me less attractive and viable. At the same time, consumer electronics became considerably cheaper, which removed an important argument for making things yourself. Disap- peared completely? No, building and discovering things for yourself continues to have unbelievable attraction, and worldwide many people occupy themselves doing this, eit- her privately or professionally. 16 elektor - 10/2007 The secret For the big secret behind Elektor as a publication and institution we have to look across all borders. Soon after the launch of the Dutch edition in 1964 it became clear that there was also potential in oth- er countries. A German edition quickly followed and in a few years the circulation increased there to 100 kcopies. After that came the United King- dom (1974) and France (1978). We recently also launched Elektor in Spain. With our own activities and licences, websites in five languages, a large selection of books and live events we inform an au- dience of 2 million people worldwide. We receive reactions and mail from the entire world about our articles and products. We are, to be honest, quite proud of this. Even better than this, we see good op- portunities for further expansion of the title into more countries, regions and/or language areas. We are currently taking the first steps to develop activities in China and Eastern Europe. To give shape to all plans and ambitions we have changed the name of the publisher from Segment to Elektor International Media and the name of the Dutch language maga- zine is changed from Elektuur\o Elektor to bring it in line with all other editions. "The purpose of the publication remains unchanged however" were the words of Bob van der Horst at the launch of the Dutch Elektuur in 1964, when re- ferring back to his earlier publication Elektronica- Wereld. "We will be primarily practically oriented and in this way supplement the theoretically oriented foreign magazines". Words to the same intent can still be said today. In as much as the first Elektor was about informing, inspiring and activity, discovering for yourself all the things you can do with electro- nics, Elektor these days is no different: we remain very much a projects-oriented and hands-on maga- zine. Elektor continues to explore the boundaries of electronics, and everyone is invited to come along to discover and experience. We have however en- tered the path of professionalism more and more. Indeed, exactly those people who say: "Elektor, now wasn't that the hobby mag from the seven- ties? Amazing to see you're still around". Turning your interests into a job We ourselves prefer to call it a 'special inter- est' magazine. A whole generation of read- ers have literally turned their hobby into a profession and so gave proof that 'interest' does not distinguish between spending time at 'work' or 'leisure'. You just have it. We know that many professionals read the magazine as a source of ideas for new technologies or chip sets. Via the web- site alone you can find hundreds of cir- Borders, what borders? An illegally translated and published version of Elektor's 308 Circuits book pictured in Iran. Well it's all Greek to us! That's him! Jan Buiting, editor of this the English- language edition of Elektor has been with the company since 1985. Jan's cherished projects are the 1986 Elektor Satellite Receiver and the 1989 Filmnet Decoder. Both projects were authored by him in collaboration with two friends (who shall remain anonymous). The Filmnet decoder resulted in a sell-out of the magazine, extensive press coverage and about 20,000 units built, mainly in the UK and Scandinavia. ■ * 10/2007 - elektor 17 INFO & MARKET ELEKTOR ip-10 BU Sffnr , 3B a nS - QU^'° »3p 8**** The first edition of Elektor in English. It's bound to appear sometime on Flog It! tor am^ r cuits and designs. Many of these cir- cuits have found their way into large and small applications. As we said be- fore; the secret of Elektor is its multilingual approach. The individu- al language- defined markets are currently served opti- mally. At the same time, we see new regions with in increasing interest in electronics and in particular what you can do with it yourself. Eastern Europe and China are prominent examples of this. Step by step, we discover the possibilities for us, and - this may sound a bit strange - for you as well. As an invariable part of the formula for the magazine, exploring new developments for the magazine is of great interest not just for the publishers but for readers as well. With the recent addition of a Spanish Elektor there will cer- tainly be a new influx of information and ideas. Just thumb through the magazine — in your issue you will see contribu- tions from authors/designers whose native tongue is Ger- man, English, Dutch or French (but also Finnish, Danish, Portuguese, Turkish or Greek in which case manuscripts are supplied in basic English). The PR4401 LED driver board that was added free on the cover of the September 2007 issue of Elektor was a joint effort between German and Dutch companies. A total of 150,000 of these tiny PCBs will enter the market! International cooperation is a daily reality for Elektor. We have language-specific editors directly in house and we hope to add a Spanish speaking colleague to the team soon. All language editions are written, DTP'ed and print- ed simultaneously, or at least in true multitasking fashion to strict deadlines. At our central production offices you will hear at least four languages spoken every day (not includ- ing dialects and accents). The English version of Elektor has been on publication with- out fail these past 33 years. Articles originate from an origi- nal (language) version and are given a template-like layout by our in-house DTP staff. The original language is always one of four we publish in: English, Dutch, French or Ger- man. Translated versions are produced from the original material, and the language editors provide for a localised News, Products & Market section in the magazine, as well as for Mailbox and the readers forums. In addition there are language-specific websites, the largest of which is the English-language one at www.elektor.com. The lab Almost everything we publish in the magazine goes through the Elektor lab first. Here we test, develop, build proto- types and design the modules for DIY construction and sale through our SHOP (formerly 'Readers Services'). Further- more, there is a continuous stream of responses and ques- tions from readers and companies, which all have to be answered. In this way the lab plays an important role in the formula for the magazine and is at the same time a source of inspiration. All new technologies, development kits and equipment come to life here. It is conspicuous that visitors from companies are always keen to sit in the lab. They are apparently at ease among all the technical bric-a-brac, measuring equipment, modules, components and tools! At our new location we have also made room for the audio lab. Here we can thoroughly test amplifiers, filters, using our dependable 20k Audio Precision 2722 rig. An important activity in the lab is the design of PCBs for circuits. In 2007 the lab team migrated from Ultiboard to Altium Designer PCB layout software. At the same time, we see that via the lab we have more and more contact with companies that are also active in the area of electronics de- sign, manufacture and development. We are always look- ing for new ways of cooperation. Elektor Live A new addition to our product range goes by the name of E-vents. These include a series of masterclasses where de- signers, authors and experts from the industry share their knowledge on, for example, audio, PCB design and home automation. In addition we will be organising a number of company-sponsored events for our readers. It works along the line of: Elektor opens doors that normally remain closed. We have made agreements with a number of market lead- ing companies for events or training/instructions day(s) for our readers. In this way, readers obtain direct access to very specific information about a certain type of product that's introduced on the market by that company or institu- tion. It's all low-profile, but the house is always full. To the castle We do all this with about 40 staff from our central offices in Beek, near Maastricht in the Netherlands. Beek, of all places? It's not that surprising. The founder of Elektor, Bob van der Horst, happened to live there and the company grew from his attic. A (then) contemporary office building was literally built in his back garden in 1975. Because of all the activity around Elektor this building is now entirely worn out and we move to premises with more character; a real stronghold, the 1 3th century Castle Limbricht, about 15 km from the Beek location. The castle, now rebaptised Elektor House, has been there for centuries and appears to be eminently suitable for all our new activities. The future The secret for Elektor is that we refuse to see borders or bar- riers anywhere. The same is true for the future — adding new languages to the list of activities appears to be a good strategy for the magazine. Not all that surprising, really. Electronics is not, and never was, bound by country borders and users — developers work, (re)search and inspire each other worldwide, using English as the lingua franca but also their native tongue - hence: electronics worldwide. ( 070661 - 1 ) 18 elektor - 10/2007 mikrollektronika DEVELOPMENT TOOLS | COMPILERS | BOOKS CAN-1 Board - Interface CAN via MCP2551 . CANSPI Board - Make CAN network with SPI interface. RS485 Board - Connect devices into RS-485 network Serial Ethernet - Make ethernet network with SPI Interface (ENC28J60). lrDA2 Board - Irda2 serve as wireless RS232 communi- cation between two MCU’s. CF Board - Easy way to use Compact flash in your design. MMC/SD Board - Easy way to use MMC and SD cards in your design. EEPROM Board - Serial EEPROM board via I2C interface. RTC Board - PCF8583 RTC with battery backup. ADC Board - 12-bit analog- to-digital converter (ADC) with 4 inputs. DAC Board - 12-bit digital- to-analog converter (DAC) with SPI. Keypad 4x4 Board - Add keypad to your application. Accel. Board - Accel, is an electronic device that meas- ures acceleration forces . PICFIash with rtfilkrtlCD import PICFIash programmer - an ultra fast USB 2.0 programmer for the PIC microcontrollers. Continuing its tradition as one of the fastest PIC programmer on the market, a new PICFIash with mikrolCD now supports more PIC MCUs giving devel- oper a wider choice of PIC MCU for further prototype development. mikrolCD debugger enables you to execute mikroC / mikroPascal / mikroBasic pro- grams on the host PIC micro- controller and view variable val- ues, Special Function Regi- sters (SFR), memory and EEP- ROM while the program is run- ning. - All of our products are shipped in special protective boxes. -On-line secure ordering provides fast and safe way of buying our products. EasyPIC4 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD Uni-DS 3 Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer 1 1 1 , LV 18FJ Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD Following tradition of its predecessor EasyPIC3 as one of the best PIC development systems on the market, EasyPIC4 has more new features for the same price. The system supports 8-, 14, 18, 20, 28 and 40 pin PIC microcontrollers (it comes with a PIC16F877A). USB 2.0 on-board programmer with mikrolCD (In- Circuit Debugger) enables very efficient debugging and faster pro- totype development. Examples in C, BASIC and Pascal language are provided with the board. LV24-33 Development Board Complete Hardware and Software solution with on- USB 2.0 programmer and mikrolCD f ; k-] r.»d I I fc _k!| t 1 board The system supports PIC, AVR, 8051 , ARM and PSoC micro- controllers with a large number of peripherals. In order to con- tinue working with different chip in the same development environment, you just need to swich a card. UNI-DS3 has many features that make your development easy. You can choose between USB or External Power supply. Each MCU card has its own USB 2.0 programmer! EasydsPIC4 Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer and mikrolCD ■ ■- is System supports 64, 80 and 100 pin PIC18FxxJxx microcon- trollers (it comes with PIC1 8F87J60 - PIC1 8 Microcontroller with an integrated 10Mbps Ethernet communications peripheral, 80 Pin Package). LV 18FJ is easy to use Microchip PIC18FxxJxx development system. USB 2.0 on-board programmer with mikrolCD (In-Circuit Debugger) enables very efficient debug- ging and faster prototype development. Examples in C, BASIC and Pascal language are provided with the board. dsPICPRO 3 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD 51 System supports 64, 80 and 100 pins PIC24F/24H/dsPIC33F microcontrollers (it comes with PIC24FJ96GA010 - PIC24 16-bit Microcontroller, 96 KB Flash Memory, 8 KB RAM in 100 Pin Package). Examples in BASIC, PASCAL and C are included with(in) the system. You can choose between USB and External Power supply. LV 24-33 has many features that make your devel- opment easy. USB 2.0 on-board programmer with mikrolCD (In- Circuit Debugger) enables very efficient debugging and faster pro- totype development. PICPLC16B Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD The system supports 18, 28 and 40 pin microcontrollers (it comes with dsPIC30F4013 general purpose microcontroller with internal 12-bit ADC). EasydsPIC4 has many features that make your development easy. Many of these already made examples in C, BASIC and PASCAL language guaran- tee successful use of the system. Ultra fast USB 2.0 on-board programmer and mikrolCD (In-circuit Debugger) enables very efficient debugging and faster prototype developing. EasyARM Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer ESS The system supports dsPIC microcontrollers in 64 and 80 pins packages. It is delivered with dsPIC30F6014A microcontroller. dsPICPR03 development system is a full-featured development board for the Microchip dsPIC MCU. dsPICPR03 board allows microcontroller to be interfaced with external circuits and a broad range of peripheral devices. This development board has an on- board USB 2.0 programmer and integrated connectors for MMC/SD memory cards, 2 x RS232 port, RS485, CAN, on- board ENC28J60 Ethernet Controller, DAC etc... BIGPIC4 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD PICPLC16B is a system designed for controlling industrial sys- tems and machines. 16 inputs with optocouplers and 16 relays (up to 10A) can satisfy many industrial needs. The ultra fast mikrolCD (In-circuit Debugger) enables very efficient debugging and faster prototype development. Features : RS485, RS232, Serial Ethernet, USB 2.0 on-board programmer and mikrolCD (In-Circuit Debugger) on-board. mikroElektronika Compilers Pascal, Basic and C Compilers for various microcontrollers n EasyARM board comes with Philips LPC2214 microcon- troller. Each jumper, element and pin is clearly marked on the board. It is possible to test most of industrial needs on the system: temperature controllers, counters, timers etc. EasyARM has many features making your development easy. One of them is on-board USB 2.0 programmer with automat- ic switch between ‘run’ and ‘programming’ mode. Examples in C language are provided with the board. EasyAVR4 Development Board with on-board USB 2.0 programmer Following tradition of its predecessor BIGPIC3 as one of the best 80-pin PIC development systems on the market, BIG- PIC4 continues the tradition with more new features for the same price. System supports the latest (64) and 80-pin PIC microcontrollers (it is delivered with PIC18F8520). Many of these already made examples in C, BASIC and Pascal lan- guage guarantee successful use of the system. Ultra fast on- board programmer and mikrolCD (In-circuit Debugger) enables very efficient debugging and faster prototype developing. BIGAVR Development Board with on-board USB 2.0 programmer Supporting an impressive range of microcontrollers, an easy-to- use IDE, hundreds of ready-to-use functions and many integrated tools makes MikroElektronika compilers one of the best choices on the market today. Besides mikrolCD, mikroElektronika compilers offer a statistical module, simulator, bitmap generator for graphic dis- plays, 7-segment display conversion tool, ASCII table, HTML code export, communication tools for SD/MMC, UDP (Ethernet) and USB , EEPROM editor, programming mode management, etc. Each compiler has many routines and examples such as EEPROM, FLASH and MMC, reading/writing SD and CF cards, writing charac- ter and graphics on LCDs, manipulation of push-buttons, 4x4 key- board and PS/2 keyboard input, generation of signals and sounds, character string manipulation, mathematical calculations, I2C, SPI, RS232, CAN, USB, RS485 and OneWire communications, Manchester coding management, logical and numerical conversion, PWM signals, interrupts, etc. The CD-ROM contains many already- written and tested programs to use with our development boards. E mikroElektronika manufactures competitive development sys- tems. We deliver our products across the globe and our satis- fied customers are the best guarantee of our first-rate service. The company is an official consultant on the PIC microcon- trollers and the third party partner of Microchip company. We are also an official consultant and third party partner of Cypress Semiconductors since 2002 and official consultant of Philips Electronics company as well. All our products are RoHS compilant. The system supports 8, 20, 28 and 40 pin microcontrollers (it comes with ATMEGA16). Each jumper, element and pin is clearly marked on the board. It is possible to test most of industrial needs on the system: temperature controllers, counters, timers etc. EasyAVR4 is an easy-to-use Atmel AVR development system. Ultra fast USB 2.0 on-board program- mer enables very efficient and faster prototype developing. Examples in BASIC and Pascal language are provided with the board. Easy8051B Development Board with on-board USB 2.0 programmer The system supports 64-pin and 100-pin AVR microcon- trollers (it is delivered with ATMEGA128 working at 10MHz). Many already made examples guarantee successful use of the system. BIGAVR is easy to use Atmel AVR development system. BIGAVR has many features that makes your devel- opment easy. You can choose between USB or External Power supply. BIGAVR also supports Character LCD as well as Graphic LCD. EasyPSoC3 Development Board with on-board USB 2.0 programmer • IJ- ■r FrTT BV m ■fvi §3 http://www.mikroe.com/en/distributors/ Find your distributor: UK, USA, Germany, Japan, France, Greece, Turkey, Italy, Slovenia, Croatia, Macedonia, Pakistan, Malaysia, Austria, Taiwan, Lebanon, Syria, Egypt, Portugal, India. System is compatible with 14, 16, 20, 28 and 40 pin micro- controllers (it comes with AT89S8253). Also there are PLCC44 and PLCC32 sockets for 32 and 44 pin microcon- trollers. USB 2.0 Programmer is supplied from the system and the programming can be done without taking the micro- controller out. n JQ R ns | '■■■ ■ The system sup- ports 8, 20, 28 and 48 pin microcon- trollers (it comes with CY8C27843). Each jumper, element and pin is clearly marked on the board. EasyPSoC3 is an easy-to- use PSoC development system. On-board USB 2.0 program- mer provides fast and easy in-system programming. Please visit our website for more info http://www.mikroe.com SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD 10/2007 - elektor 19 There are many different configurations for audio amplifiers, including types with bipolar transistors, FETs, ICs, and valves. The amplifier described here uses a mixture of transistors and valves to combine the advantages of both approaches and thus deserves the designation 'hybrid 7 . The result is an amplifier with audiophile performance. Valves (or ‘vacuum tubes’) are experi- encing a real revival in the audio world, which can readily be seen from the large number of commercial amplifiers and DIY designs that have appeared in recent years. Unfortunately, valve amplifiers are rela- tively costly compared with transistor amplifiers, in part due to the need for a high voltage supply and output trans- formers. Output transformers in partic- ular are a major investment. This design attempts to remedy this situation by replacing the output valves and transformer by a solid-state circuit using modern transistors, which can drive a loudspeaker directly. Valves are used in the input stage. Driver circuit The amplifier (Figure 1) consists of a voltage stage and a current stage. The voltage stage, which is the driver por- tion, is built around valves VI and V2, and it must provide adequate amplifi- cation of the input signal. Here 20 to 30 dB is a practical figure. The current stage, which is built around transis- tors Q4 and Q5, enables the amplifier to drive 4-ohm or 8-ohm loudspeakers. The current stage acts as buffer and does not have any gain. The voltage stage has to supply a solid 25 V eff to the current stage to drive the amplifier to its maximum output lev- el. A key factor here is that the signal must have sufficiently low distortion, since overall negative feedback is not used in this design. The circuit must also be able to drive a load impedance of 10 kQ, since the driver circuit sees Rll (20 kQ) in parallel with the combi- nation of P3 and R16 (20 kQ). The im- pedance could be increased by boot- strapping or using MOSFET drivers, but bootstrapping and MOSFET driv- ers do not fit with the concept of this amplifier. In other projects implemented en- tirely with valves, the author has ac- quired experience with driver stages that must supply output signals with large amplitudes and low distortion. The ‘long-tailed pair’ circuit is excep- tionally well suited to this task. This configuration was also chosen because it can act as a phase splitter, which al- lows a certain trick to be used as ex- plained below. The long-tailed pair can be regarded as a differential amplifier that ampli- fies the difference between the signals on the two control grids. The input sig- nal is connected to the ‘left’ input. The ‘right’ input is tied to ground here, so the output signal is an amplified ver- sion of the input signal. An advantage of this arrangement is that feedback can be connected to the right input, where it will be subtracted from the original signal. This negative feedback reduces the amount of distortion. The common cathodes of the two halves of the ECC83 (US equivalent: 12AX7) can be regarded as a third in- put, which here provides 6 dB of local negative feedback. A characteristic of the long-tailed pair is that it has two outputs with oppo- site phases (180 degree phase offset). The left anode is ‘in phase’, while the right anode is ‘out of phase’. The long-tailed pair normally has a common cathode resistor, which is what gives it its name. A current source is used instead in this design. The high internal impedance of the current source improves the charac- teristics of the circuit, including the distortion, and the operating current of the ECC83 can be adjusted easily using a trimpot. Due to its high amplification factor (100) and excellent availability, the ECC83 is the right choice for this ap- plication. The need for high gain can be explained as follows. The long- tailed pair has 6 dB of local negative feedback. A normal cathode-resistor or grounded-cathode amplifier built around an ECC83 can provide a gain of more than 35 dB, and the long-tailed pair circuit used here can provide more than 29 dB. The original intention with this amplifier was to avoid using over- all negative feedback. However, we have included an option for adding 6 dB of overall negative feedback. A jumper/header is provided on the PCB for this purpose. This allows every- Figure 1. The hybrid amplifier has a valve driver stage and a transistor output stage. Mugen Hybrid Amp - Mugen (mu-gen) is a Japanese word that means 'infinity’ of ‘endless’. ‘Endless’ is the name of a track on the live CD Changeless by the Keith Jarrett Trio. This piece was the source of the author’s inspiration for this design. 20 elektor - 10/2007 mUGEN HYBRIO RITIP RS 10/2007 - elektor AUDIO Specifications (mesured without overall negative feedback) Input sensitivity: 825 mV (8 Q) 770 mV (4 Q)) Input impedance: 300 kn Gain : 29 dB (23 dB with negative feedback) Output power ( 1% THD): 70 W into 8 Q 110 W into 4 Q THD + noise at 1 W/8 Q : < 0.1 % at 1 0 W/8 Q : <0.15% Damping factor: 20 (with 8-D load) one who builds the amplifier to decide what he or she finds best. Even with overall negative feedback, the gain is still high enough (23 dB) to provide ad- equate input sensitivity. This brings us to the previously men- tioned trick. With a normal cathode-re- sistor circuit, it would not be possible to obtain overall negative feedback by feeding the output signal back to the cathode in the usual manner, because the output signal is in phase with the input signal and this would cause posi- tive feedback. The Vlb output signal of the long-tailed pair is out of phase, and this makes overall negative feed- back possible. Overall negative feedback forms the subject of a lot of debate. The author has learned from experience that an amplifier with strong negative feed- back has a less open and ‘pleasant’ sound than a design without negative feedback. A value of 6 dB represents a good compromise. A disadvantage of the ECC83 is that it has a relatively high output imped- ance. Consequently, a cathode follower is included after the ECC83 to provide sufficient drive for the transistor stage. The cathode follower has a low output impedance (less than 500 Q), com- pared with around 50 kQ for the long- tailed pair. After much experimenting, the best results were obtained with an ECC88 in this position. The bias is set to satisfy the maximum anode voltage rating of the ECC88 (130 V DC ). How- ever, the JJ version of the ECC88 has a maximum anode voltage rating of 220 V, the same as the Philips ECC88. The high value of the cathode resis- tor of the ECC88 allows the ECC83 to be coupled directly to the ECC88. The ECC88 is self-biasing thanks to the large amount of negative DC feedback provided by cathode resistor R7. A supplementary advantage of the cathode follower design used here is that the cathode voltage is 0 V when the circuit is cold and gradually rises to its operating bias level of approximate- ly + 194 V as the ECC88 warms up. The coupling capacitors are charged gradu- ally during this process, with the result that the transistor stage does not have to handle any spikes. Exceptionally good results can be ob- tained by using a current source in place of cathode resistor R7. When an Ixys IXCP10M45 was used as the cur- rent source, a distortion of less than 0.1% (without negative feedback!) was measured at an output power of 45 W. However, this IC is difficult to obtain, so this option was not pursued any further. For practical reasons, the amplifier described here uses JJ Electronics valves. They are readily available, nice- ly priced, good-quality valves, and they come from current production. Many people regard the 6N1P as a re- placement for the ECC88, but with this design the distortion was not accept- able when a 6N1P was used. A simple and interesting alternative is to use a 5751 in place of the ECC83. These are directly interchangeable types. The amplification factor is slightly low- er, but this is not a problem. From an acoustic perspective, the author pre- fers a 5751 (from ECG/Philips or NOS) in combination with a JJ ECC88. If you have adjusted the amplifier for opera- tion with an ECC83, the voltage at TP3 will increase automatically by about 2.2 V if you replace it with a 5751. Coupling capacitors The valve and transistor stages are linked by two high-quality coupling capacitors. They cannot be omitted in this design, since the DC voltage on the cathode of the ECC88 is about 194 V. Unfortunately, these capacitors affect the ultimate sound of the amplifi- er. The sound characteristics of capaci- tors are the subject of heated debate among audiophiles. Listening tests have shown clearly that these capaci- tors have an important effect. We final- ly settled on a type from the Clarity- Cap SA series, which has an extremely good price/quality ratio. Thanks to its high working voltage (600 V), the SA series is very well suited for use in de- signs with high voltages, such as valve circuits. The PCB layout can also ac- commodate types from other manufac- turers, including Wima and Solen. The value of 3.3 jiF was chosen to position the low-frequency roll-off well below 10 Hz. Note that the coupling capaci- tance combines with the input imped- 22 elektor - 10/2007 ance of the transistor stage to form an RC filter with a corner frequency of 1 / (271 x 3.3 jllF x 10 kQ) the coupling capacitors must have a working voltage of at least 400 V DC . Current stage The current stage (power stage) is based on bipolar transistors. Although MOSFETS such as the BUZ900P or 2SK1058 families would also be an op- tion, they were intentionally not cho- sen for this design. The selected driver transistors are often used in audio amplifiers. They have outstanding characteristics for audio use, and besides that they are inexpensive. The output transistors (2SC5200) have excellent characteris- tics, and they are specifically designed for audio applications, readily available (but beware of imitations!), and very robust thanks to their large SOA (safe operating area) range. The 2SC5200 is available in two versions, with an ‘O’ or ‘Y’ suffix. This code designates the h FE range. Both types work well, but all of the transistors should be the same type. The O type was used in the prototypes and the final version of the amplifier. The current stage is a standard quasi- complementary output configuration, which means a configuration with two identical NPN output transistors. This contrasts with the currently common practice of using a complementary design with an NPN type and a PNP type. Quasi-complementary output stages were often used in the 1970s and early 1980s because complemen- tary PNP transistors were not availa- ble, or were too expensive. This con- figuration has acquired a bad reputa- tion among many people, but this is not justified. Very good results can be obtained with a quasi-complementary design. The main advantage is that the output transistors are identical. NPN and PNP transistors can never be more than approximately equivalent. This is why manufacturers such as Naim still use only the NPN/NPN configuration. The ultra-modern Denon PMA1500AE amp also uses a quasi-complimentary NPN output stage, in this case using two UHC n-type FETs. The selected supply voltage of ±38 V DC is optimal for this output stage and al- lows a 4-ohm or 8-ohm load to be driv- en without any problems . D5 Figure 2. This circuit provides a switch-on delay and DC protection for the output. Circuit details Resistor R1 is a grid-leak bias resistor for Via. Its value is not critical, but the resistor is essential because the valve would otherwise not be able to gener- ate the negative bias that sets its DC operating point. R2 forms a low-pass filter in combination with the input capacitance of the ECC83. This pre- vents any tendency to oscillation. The same thing applies to R5 in combina- tion with the ECC88. Anode resistors R3 and R4 are dimensioned to yield a voltage of slightly more than 190 V on the anodes of VI. VI thus has the right bias with an anode current of 0.8 mA. The power dissipation is well within the permitted value. The long-tailed pair with VI uses a current source built around Q6 and Q7. The LED provides a reference voltage, and the current can be set easily with PI. The total current is approximately equal to 1/PI. A separate power sup- ply using an LM377 provides a voltage of -12 V for the current source. The overall negative feedback is ap- plied to the control grid of Vlb. As al- ready mentioned, a value of 6 dB was chosen here. This is determined by the ratio of R8 and R6. A small capacitor (56 pF) can be connected across the feedback resistor to increase stability. The bias of the ECC88 is chosen to generate an anode current of approxi- mately 9 mA with an effective anode voltage of around 115 V DC . The power dissipation is 1 W, which is beneficial for the service life of the valve. The to- tal distortion would be slightly less at a higher current, but the life of the valve would be reduced significantly by the higher dissipation. Q1 sets the quiescent current of the output transistors, and it must be fit- ted close to the output transistors to achieve good temperature stability. Minimum quiescent current is obtained when the wiper of P2 is turned fully to- ward the collector of Ql. P2 must be a ten-turn potentiometer of very good quality. The R11/P3 pair and R16 en- sure the DC stability of the amplifier output, and the values of these compo- nents also determine the input imped- ance of the circuit, which is approxi- mately 10 kQ (20 kQ 1 1 20 kQ). These values could be increased if MOSFETs were used, but here this is not possi- ble due to the amount of base current required by Q2 and Q3. R12/C4 and R20/C8 are additional decoupling net- works, and they are indispensable. C4 10/2007 - elektor 23 AUDIO L© MAINS 230V 'X/ N © ‘ see text T1 Amplimo 3N604 FI s- 400mA T pink white F2 s 1A6T T2 Amplimo 78075 Z1 D9...D12 = BY228 1200V red > o in CM gelb purple e > o CO purple blue CO > (O grey > co CM * C29 2n2 > co CM * C30 (+360V)-» D13 H 4 110V 1W3 1 N4007 U3 SKI 04 14K/W IN ~?\ TL783 V 150|a 450V C25 lOOn R42 rDO 1W (+315V)-» R39 X R40 C26 □ DF06M 600V- 1A C21 □ J3W +42V -CH© +31 0V -cK±)h C27 22|a I 400V >^C R43 iw +31 0V C28 22|a I 400V R41 >L ^^0 10p — ^ 400V ^ 3 3W 220p 50V C22 lOOn x - 22 | -J- -p-@6V3 IW Cl 5 l-ll ± | 250V 'V o X R37 IW R38 IW - 0-@ 6V3 400V - 35A 41 ( > 4 > 4 * C31 C32 C33 h d b d b nz 2n2 4700|a 4700^1 O 1 63V > • < 63V H— +38V -0-® C34 □ 4700p 63V X 4 63V > < 63V I -38 V 070069-12 Figure 3. The power supply provides four different voltages. and C8 can also be 220 \iF or 330 \iF if desired. P3 allows the DC offset of the output stage to be set to zero. Ac- tive DC offset control in the form of an opamp integrator is intentionally not used here because the author believes that this affects the sound quality of the amplifier. 02 and Q4 form a Darlington pair that provides adequate current gain, as do Q3 and Q5. Q3 and Q5 form what is called a ‘Sziklai pair’, which is used here to mimic a PNP transistor. Quasi- complementary circuits normally use a ‘Baxandall diode’ to improve sym- metry and linearise the response. This approach was used in the Ekwa ampli- fier published in Elektor in 1972. In the present design, a transistor configured as a diode (Q bax ) is used instead of a normal diode. The measured distortion at 1 W was 0.22% with a diode in the circuit, while the value with a2SC1815 configured as a diode was 0.08%. Note that the BL version of the 2SC1815 should be used here. Although the -O, -Y and -GR versions can also be used, they yield results that are practically the same as with a normal diode. The difference decreases gradually at lev- els greater than 5 W. The PCB is de- signed to allow a 2SC2073 or a 1N4007 to be used instead. This is also the or- der of preference. Obviously, only one of these three types of components can be fitted on the board. 24 elektor - 10/2007 Figure 4. The amplifier board can be split in two, depending on how it is arranged in the enclosure. Component overlay reproduced at 80% of actual size. Thanks to the inherent local negative feedback, the output stage is very sta- ble with regard to temperature drift and quiescent current. The emitter re- sistors should preferably be Intertech- nik MOX types. They are non-inductive and have relatively small dimensions. The amplifier output has a Zobel net- work built around R23 and C7, which ensures stability above 100 kHz. Base resistors (R13, R17, R14, and R18) are used for all transistors in the output stage to prevent oscillation. The resis- tors for the driver transistors (R13 and R17) are essential. The heatsink extrusion for each output stage must be rated at 0.7 K/W or less to ensure reliable operation. The switch-on delay and DC protec- tion circuit (Figure 2) is built around relay RLY1 and MOSFET Q8. This cir- cuit was previously used in the Valve Final Amp design published in the April/May 2003 issues of Elektor Elec- tronics. The switch-on delay is approxi- mately 30 seconds. If a hazardous DC voltage is present at the output, the re- lay will disconnect the amplifier output from the loudspeaker. The relay used here is an Amplimo type with special contacts that make it especially suit- able for use as an output relay in audio amplifiers. A coil can optionally be fitted in se- ries with the output to make the am- plifier more general-purpose with re- spect to possible capacitive behaviour of the speaker. This coil is omitted in the version of the amplifier described here. A DIY coil with an inductance of 4 jiH, consisting of 16 turns of 0.75-mm enamelled copper wire wound on a 6.3- mm drill bit, can be used here if de- sired. A 15 Q/2 W resistor must be fit- ted inside the coil and soldered across the coil. Power supply The high-voltage supply (Figure 3) uses a type TL783 voltage regulator IC. The input voltage of the TL783 must be approximately 360 V DC for proper operation. The Amplimo toroidal high- voltage transformer used here provides this voltage in a manner that is per- haps somewhat unorthodox. The 250-V winding is so generously dimensioned that it is hardly loaded by the ECC83s and ECC88s, so the secondary voltage is a good deal higher than the rated 250 V. You should bear this in mind if you use a different transformer. The TL783 is fitted with a small heat sink and must be mounted insulated. Voltage divider R39/R40 sets the out- put voltage to around 315 V. Resistor R41 is included to discharge the elec- trolytic capacitors when the amplifier is switched off. R40 and R41 must be 3-watt types. R42/C27 and R43/C28 are additional RC filters for the left and right channel, respectively. The high voltage for VI and V2 is approxi- mately 310 V DC . If you cannot find a Wima FKP1 type for C23 as specified in the components list, you should omit it. The 30-V winding of transformer T1 is used for the switch-on delay and pro- tection circuit. The AC filament voltage is tied to ground via a capacitor. In this case it cannot be connected directly to ground. This is because the cathode of the ECC88 is not close to ground po- tential here, but instead at -I- 195 V. The capacitor arrangement allows the max- imum cathode-filament voltage rating to be respected. This floating filament supply works well in practice. A value of 0.47 |iF can be used instead of 1 jiF with equally good results. The value of R36 must be determined experimentally. This resistor deter- mines the value of the filament voltage, which must be close to 6.3 V. The power supply shown here is suit- able for stereo use, but it can also be used for a mono final amplifier. If it is used for a stereo version with a single transformer and a single supply PCB, then R37, R38 and C15 only have to be fitted on one of the two amplifier boards, although fitting them on both boards will not do any harm. The ±38-V supply is simple but effec- tive. A toroidal transformer with a sec- ondary voltage of 2 x 28 V AC gives the best results in terms of output power. If you use a different type of transform- 10/2007 - elektor 25 AUDIO Figure 5. The power supply board is dimensioned for a complete stereo amplifier. Component overlay reproduced at 80% of actual size. COMPONENTS LIST amplifier & power supply (for a stereo version, all components must be purchased double) Resistors (1% metal film, 600mW unless other rating indicated) R1 = 392 kft R2,R5,R12,R20,R32 = 1 kQ R3,R4 = 1 50kft 2W (BC PR02 series) R6,R1 5,R1 9,R45 = 100ft R7 = 22kft 3W (BCPR03 series) R8 = 2kft43 R9 = 274ft RIO = 560ft R1 1 = 18ft R1 3,R1 7 = 392ft R14,R18 = 2ft2 R1 6 = 20kft R21 ,R22 = 0ft22 4W (Intertechnik M OX) R23 = 1 Oft 2W R24,R26 = 182ft R25 = 1 I Heatsink profile for U3 (Fischer SKI 04 25,4 STC-220 14K/W (e.g. Conrad Electronics # 186140-62) Heatsink profile for U1 and U2, Fischer FK1 37 SA 220, 2 1 K/W (e.g. Conrad Elec- tronics # 188565-62) Heatsink profile for Q4 and Q5, 0.7K/W or better 9-way valve socket (Noval), PCB mount, for VI and V2 Amplifier board, no. 070069-1 (mono), www.thepcbshop.com Supply board, no. 070069-2, www.thepcb- shop.com Suggested suppliers Toroidal transformers and output relay: www.amplimo.nl ClarityCap SA capacitors: www.claritycap.co.uk www.capsandcoils.com http://wduk.worldomain.net (OEM like Soniqs SAX) 26 elektor - 10/2007 er here, a type with a more conven- tional value of 2 x 25 V AC can be used, but the maximum output power will be somewhat less. The 2.2-nF Wima FKP-1 capacitors provide additional decoupling. Construction The PCBs for the amplifier and the power supply are shown in Figures 4 and 5. The actual size layouts can be downloaded from the Elektor website, or you can order ready-made boards from PCBShop. The board shown in Figure 4 is for a mono amplifier, so you need two amplifier boards and a power supply board for a stereo version. The components list has several com- ponents with quite specific descrip- tions or type numbers. Based on the author’s experience, you will obtain the best results from the amplifier if you use these components. However, you are naturally free to experiment with comparable components. Assembling the power supply board is straightforward. Use good-quality blade connectors for the various sup- ply and ground terminals. This makes wiring the amplifier much easier. After the power supply board is done, you can assemble the amplifier boards. The amplifier board is designed so that it can be split in two in order to mount the power stage on the heat sink and the driver stage somewhere else, such as on the base of the enclosure. How- ever, the wiring between the two parts must be kept as short as possible. Figure 6 shows clearly how the tran- sistors of the power stage are fitted (all insulated!). For best results, first fit the transistors to the heat sink, bend their leads at right angles, and then secure the board to the heat sink with screws. Do not solder the transistors in place until everything is properly positioned. An enclosure with two large heat sinks on the sides was used for the prototype (see the photo of the fully assembled amplifier in Figure 7). It is big enough to hold a complete ampli- fier board. The two supply transformers and the bridge rectifiers for the ±38-V supply are fitted in the middle of the base of the enclosure. The supply board is lo- cated above transformer Tl. The amplifier board and supply board have several ground connections. They must all be connected separately to a single star point as indicated in Fig- ure 8. In order to avoid ground loops, the grounds of the ±38-V supply, the +42-V supply and the +310-V supply Figure 6. Fitting the power stage transistors. 10/2007 - elektor 27 AUDIO are not joined on the supply board. The 4.7-Q resistor (R44) between the input neutral terminal and circuit ground is optional and can be replaced by a wire link, but in the prototype this resistor proved to be necessary to keep the overall arrangement free of hum. Be sure to use plastic standoffs for mounting the circuit boards. Metal types can cause shorts between PCB tracks and the heat sink or chassis. A mains entry unit, a double-pole mains switch, a pilot light and a pair of fuse holders for the transformers can be fitted on the primary side. In this regard, consult the instructions on the Electrical Safety page that’s published regularly in the magazine, or accessible permanently on the Elektor website. Alignment Inspect all components and connec- tions before switching on the amplifi- er. Check that the transistors are insu- lated from the heat sink and from each other, check the polarity of the elec- trolytic capacitors, and check that the right valves are fitted in the sockets. The ECC83 and ECC88 are absolutely not electronically interchangeable. The amplifier has three adjustment points: • PI sets the operating current of the ECC83. • P2 controls the quiescent current of the output transformers. • P3 adjusts the DC level of the output. Before switching on the amplifier, en- sure that the wiper of P2 is at the end connected to the collector of Ql. This results in minimum quiescent current. Test points TP1 and TP2 are provided for this purpose on the PCB. Adjust potentiometer PI to a value of approximately 800 Q before soldering it to the board. After switching on the amplifier, adjust PI so the DC voltage at TP3 is +1.6 V. The exact value is not critical, but the DC voltage measured across R7 must be close to +195 V (±5%). If neces- sary, readjust PI to obtain this value. The anode voltage of Vlb should be about +190 V. These three voltages are interrelated. Figure 7. The fully assembled amplifier. 28 elektor - 10/2007 After this, adjust P2 and P3 with no in- put signal and no load. P3 controls the output offset. The DC voltage meas- ured at the output must lie between + 50 mV and -50 mV. It varies slightly, which is normal. Then adjust P2 to set the quiescent current. The DC voltage across emitter resistor R21 or R22 must lie between 22 mV and 33 mV (for a quiescent current of 100 to 150 mA). After the amplifier has warmed up for approximately 15 minutes, check all the values again and adjust the set- tings as necessary. You can repeat this procedure several times during the first hour. In between these adjustment cycles, you can test run the amplifier with an inexpensive loudspeaker (such as a PC speaker) and a bit of music. Key points • Be careful! High voltages are present at various places on the circuit boards. Remember that residual voltages can be present for a while after the ampli- fier is switched off. • Be kind to your loudspeakers: never connect or disconnect inputs or interlinks unless the amplifier is switched off. Results Despite the fact that overall negative feedback is not used in this amplifier, it has relatively low distortion. The dis- tortion is less than 0.1% at low power levels. This respectable value is the result of careful component selection and dimensioning. The damping factor is also suitable for practical use. This is often a problem with final amplifiers that do not use negative feedback. The sound characteristics of an am- plifier are often difficult to express in words, but here we’ll try to give you an impression in a few sentences. The amplifier can create a splendid sound stage, the lows are controlled, and the dynamic behaviour is convincing. The listening pleasure is thus also very good. The Mugen amplifier has an honest character without any signs of an exaggerated ‘valve sound’ (i.e. colouration). By combining a valve driver stage with a transistor power stage, the Mugen amplifier offers the best of both worlds at an attractive price. ( 070069 - 1 ) signal input R44 = 4Q7 — in n - resistor to prevent earth loop 070069-14 Figure 8. The ground connections must be arranged this way in the enclosure. They are all tied to a single ground point connected to the enclosure. 10/2007 - elektor 29 PSU FILTER Interference-free Sound Mains filter for clean audio power Joost Waegebaert When listening to your favourite CD, any audiophile will at some occasion realise that the CD concerned used to sound better during the previous listening session. Or perhaps just the other way around. The cause for this difference in quality cannot be directly traced to one of the carefully assembled chain of audio components and saddles the listener with a feeling of uneasiness. To exclude all technical causes we need a decent mains filter, which at the least ensures that nothing can be blamed on the very beginning of the audio chain, the power supply. The nice thing of audio as a hobby is the freedom to take as long as you like to choose or build audio components until the whole installation sounds just ‘perfect’. The achievement of this goal cannot be established scientifically, of course. It is a subjective matter that is the cause of many discussions and just as many opinions. This is, however, not the subject of this article. Instead, we concentrate on the phenomenon cited in the introduction, namely: why does identical source material sound better on one day than another? Cloaked in noise... State of mind can play a role here, but is it also possible to find a technical basis for these differences in listen- ing experience? An electrical cause which is often forgotten, is the qual- ity of the energy required to power our audio equipment, the energy from the mains. The number of devices that are con- nected to the mains increases every day. Many modern appliances use en- ergy-saving switching power supplies. These, by their very nature, gener- ate quite a bit of noise on their mains connection. Examples are computers, TVs, battery chargers, etcetera. The assumption can be made that each of these appliances conforms to the Eu- ropean EMC requirements and there- fore sends only a limited amount of noise back to the mains. For a number of appliances it is, of course, the sum of all the individual interference levels that determines the total noise level of the mains, and this can add up to quite a bit. igure 1 The equivalent circuit of two appliances, each with a mains filter, that are connected in parallel . Figure 2 The current that will flow through C2 as a result of interference source U 2 . 30 elektor - 10/2007 The author connected two transformers in parallel for the prototype, so that they are smaller and the whole filter could fit in a lower enclosure. Another source of noise is the use of power-line communication equipment (alarm systems, remote controls, en- ergy meters and such). These use the mains network, in addition to being their power source, also as communi- cation network. The frequencies that are permitted for this use cover a range from 3 to 148.5 kHz. Furthermore, there are the traditional polluters: incandescent lamp dimmers, electric motors, fluorescent lights, etc. All in all, the power source that is available to power our expensive au- dio equipment can be significantly pol- luted. To power the equipment from such a source is disrespectful of the audio engineers who moved heaven and earth to realise a dynamic range of 100 dB for audio signals (that is a fraction of 1/10 5 of a typical 2 V RMS -au- dio signal, that is, 20 jiV). It is there- fore not inconceivable that a polluted mains can penetrate into the signal path of an audio component and pre- vent the device from performing at its optimal level. A solution An obvious approach to filtering the undesired interference from the mains is to use a traditional, ready-made mains filter (see Figure 1). This con- sists of a coil (LI, L2) and a few Class X and Class Y capacitors (Cl, C2, C3). This is a method that works well and proves its use every day, but is less suited for audio applications. In audio equipment, the X capacitor does its job as expected and removes the differential mode interference. The problem is with the Y capacitors. Normally speaking, these conduct common-mode interference nicely to earth. However, the current through the earth conductor has no limitations with respect to direction of flow. There is therefore no reason to suppose that signals which are already present on the earth conductor could not pen- etrate the audio equipment via the Y-capacitor! This situation is drawn in Figure 1 with a PC as the other device. The PC has the same mains filter as the audio component (L3, L4, C4 to C6). U1 rep- resents the interference which is gen- erated by the switching power supply in the PC. Figure 2 shows the result of the simulation. This clearly shows that the interference source U1 generates a current through capacitor C2 and as a result also generates interference across R1 (which represents the load of the connected audio equipment). So the interference from the PC enters the audio equipment via the very filter that was supposed to clean the mains voltage! In a traditional mains filter such as this one, the coil is connected in series with the load. This seems to be no problem at first glance since the impedance of the coil at 50 Hz is negligible. This is obviously true for loads that draw a constant power, but not for a power amplifier which is reproducing a dy- namic piece of music. The power re- quirements of an amplifier naturally follow the dynamics of the reproduced music. And that includes frequencies up to 20 kHz. The filter certainly has an effect at these frequencies: it limits the rate at which the current for the pow- er supply in the amplifier can increase, with audible differences as a possible consequence. A better solution The filter shown in Figure 3 is purely connected in parallel with the mains. It is really a ‘frequency selective short- circuit’ for disturbance signals that we want to eliminate. Translated into im- pedance, this filter therefore needs to have as low as possible a value for the frequencies of the disturbance. The series network Ll/Cl has an im- pedance of nearly zero at the reso- nance frequency ( 1 / 27 tVl 1 C 1 ). R1 has been added so suppress the tenden- cy of the LC network to oscillate. This reduces the impedance at higher fre- quencies. With the addition of C2, 10/2007 - elektor 31 PSU FILTER higher frequencies experience an even larger short circuit. The choice of the resonant frequency of Ll/Cl is such that it falls in an 'important' frequency range of the audio signal, so that the interference suppression is the most effective. This resonant frequency has to be sufficiently far away from 50 Hz, of course. Since the impedance peak of an LC filter is quite narrow, it would be ideal to use multiple LC networks with different resonant frequencies, spaced at one octave apart, for ex- ample. In this way a wide frequency range with low impedance can be realised. This will however quick- ly become expensive, heavy and quite large. This design limits itself to one single LC combination. This would appear to have only limited effect on the transfer characteris- tic, but is very useful for restricting the consequences of mains voltage drop-outs. Further improvements The filter up to this point only works for differential-mode interfer- ence. Common-mode interference is not affected and as has just been shown, Y capacitors are very unde- sirable. Why don’t we use an iso- lating transformer? 230 V in, 230 V out, the mains is nicely separated and you’re done... Unfortunately this does not work. The common-mode in- terference happily appears on the sec- ondary side of the transformer because of the parasitic capacitance between the primary and secondary windings. There are good (and expensive) trans- figure 3 A parallel filter works better in an audio system. ci igure 4 We can use this circuit to suppress common-mode interference. formers with multiple screens between the windings that can suppress inter- ference by impressive amounts. In or- der to realise this, the screen has to be connected to earth however. This again results in undesirable capacitive coupling between earth and the sec- ondary side of the filter. Another approach of dealing with common-mode pollution is the use of a winding with a centre tap on the secondary side of the transformer. This centre Tap is connected to the earth conductor. The result of this is that the common-mode voltages at the ends of the transformer wind- ing are in anti-phase and therefore cancel each other out (Figure 4). U2 is the common-mode interference source. Owing to the parasitic ca- pacitance in the transformer (Cl and C2), this signal is also at the outputs and therefore also across load R2. Because of the way the transformer is made, these signals are displaced in phase by 180°. They therefore dis- appear for the attached load. The ideal transformer for this type of filter needs to have a very small capacitance between the wind- ings in combination with a limited bandwidth (around 50 Hz) - a filter in its own right and unaffordable. You can come a long way however using standard transformers if you connect two back-to-back. Figure 5 shows the complete sche- matic. This schematic immediately offers another possibility for addi- tional filtering, using C3. In Addi- tion, varistor R2 gives protection for incoming spikes. It is not a good idea to connect varistors from phase and neutral to earth, because these parts have a parasitic capacitance of about 350 pF and therefore would look like a type of Y capacitor. If after all the foregoing the tempta- tion exists not to connect the ‘pollut- 32 elektor - 10/2007 ed’ earth connection to the audio equipment then we have to strongly advise against that. The earth con- nection has to be present always, to ensure safety in the event of an isolation fault! Components It is perhaps unnecessary to men- tion that the complete filter of Fig- ure 5 is connected to the mains. That means that there are lethal voltages present on the components and these must never be touched when the filter is plugged in! The components for the filter are quite different from the minuscule SMD bits that have to be bought for a ‘normal’ electronic project. You have to look for them at suppliers of, among other things, motor con- trols. The capacitors are, for exam- ple, available from Epcos in their se- ries ‘Power electronic capacitors for General purpose applications’ (refer [1]). The coil is available from Sie- mens, among others, with the name ‘Single Phase Reactor’ (ref. [2]). For the transformers, any type of 300 VA to 500 VA with a secondary voltage from 36 V to 50 V can be used. On the primary side two 115V windings have to be available. The prototype was built with toroidal transformers to limit the size and weight. This minimises the stray magnetic field at the same time. Results The first listening tests did not re- sult in cries of joy and the language that is typical for various audio fo- rums (along the line of “the music is much more open and deeper and broader and ...”). The conviction that the filter did indeed do its job came after the filter was removed from the system again. The sound was clearly different. The higher fre- quencies in particular benefit con- siderably from this filter. Figure i Transfer function of the complete filter. This clearly shows that higher frequencies are strongly attenuated. Elektor A-A FFT SPECTRUM ANALYSIS I 1 An i '° 1 J i 15 1 o -55 B ^ ^ ./V \Kk) ■AtL \ A# Ur / Ar u At aJ L L Alt .J • lAJ J k, Aa H - T 1 i0( ! _ 1 | Mill MINI . 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 . ill LLLLL INI Mill II II 1 1 II 1 II 1 1 II II 1 Li LL 5k 10k 15k 20k 25k 30k 35k 40k 45k Hz 070135-16 Figure 7 An FFT of a square wave with a frequency of 1 kHz. The characteristic odd harmonics slowly reduce as the frequency increases. Figure t The same square wave, but measured after the filter. It is obvious that the higher harmonics reduce much quicker in amplitude. Here the 1 -kHz signal is attenuated by 15 dB relative to Figure 7. For the technical justification we obviously made a few performance measurements on the filter. The transfer function is drawn in Fig- ure 6. The graph shows that the filter starts to filter at quite a low frequency. Above 5 kHz the curve drops rapidly. High noise frequen- cies on the mains voltage are fil- tered very effectively. Figures 7 and 8 show how effective a square wave signal of 1 kHz (Fig- ure 7) is filtered by the filter (Fig- ure 8) and in this way provides a much cleaner mains voltage. So this prevents undesirable signals from entering via the power supply and influencing the audio signal. Conclusion The use of a ready-made filter does not generally have the desired effect in combination with a component in an audio signal chain. It usually goes wrong because of the Y-capaci- tors which pass noise on the earth wire unfiltered through to the mains voltage. Fortunately through a dif- ferent filter design a better solution can be found. By judging the results of the filter proposed here for yourself, you can make up your own mind whether it is worth the effort to filter the mains voltage that the audio installation requires. We are not going to say that there is a world of difference. But a difference there certainly is with this circuit. ( 070135 - 1 ) Web Links [1] www.epcos.com/inf/20/50/ds/ B3236X.pdf [2] www.automation.siemens.com/cd-sta- tic/material/catalogs/ e86060-k2803-al 01 -a4-7600.pdf [3] www.epcos.com/inf/70/db/ var_01/01 5901 73.pdf [4] www.epcos.com/inf/20/25/ds/ b32320_22.pdf COMPONENTS LIST Resistors R1 = 220 1W R2 = varistor 250 V, e.g. Epcos S14K250, see [3] Capacitors Cl = 303.3 ji/F 250 VAC, e.g. type B32360A4305J080 from Epcos, see [1] C2 = 10-1 5 a/F 250 VAC, e.g. B32360A2 1 06J050 or B32360A21 56J050 from Epcos, see [1 ] C3 = 20-25 jL/F 1 00 VAC, see [4] C4 = lOOnF 250 VAC X class capacitor Miscellaneous LI = 3-4 mH 50Hz choke, e.g 4EM4700- 0CB00 from Siemens, see [2], p. 24. FI, F2 = fuse, 5AT (slow) TR1 , TR2 = mains transformer, primary 2 x 115V, secondary 36-50 V; 300-500 VA 10/2007 - elektor 33 Quasar Electronics Limited PO Box 6935, Bishops Stortford CM23 4WP, United Kingdom Tel: 0870 246 1826 Fax: 0870 460 1045 E-mail: sales@quasarelectronics.com Web: www.QuasarElectronics.com Postage & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7 Day Delivery - £3.95; UK Mainland Next Day Delivery - £8.95; Europe (EU) - £6.95; Rest of World - £9.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 17.5% VAT. Call now for our FREE CATALOGUE with details of over 300 kits, projects, modules and publications. Discounts for bulk quantities. »u> JBHk Jtm n Q 7 4 7 WM U u mm B B B Credit Card QUASAR electronics The Electronic Specialists Since 1993 Motor Drivers/Controlleirs I Controllers & Loggers Here are just a few of our controller and Here are just a few of the controller and driver modules for AC, DC, Unipolar/Bipolar data acquisition and control units we have, stepper motors and servo motors. See Sep website for full details. Suitable PSU website for full details. for all units: Order Code PSU445 £8.95 i 41 PC / Standalone Unipolar Stepper Motor Driver Drives any 5, 6 or 8-lead unipolar stepper motor rated up to 6 Amps max. Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode. Up to six 3179 driver boards can be connected to a single parallel port. Supply: 9Vdc. PCB: 80x50mm. Kit Order Code: 3179KT - £12.95 Assembled Order Code: AS3179 - £19.95 Bi-Polar Stepper Motor Driver Drive any bi-polar stepper motor using externally sup- plied 5V levels for stepping and direction control. These usually come from software running on a computer. Supply: 8-30Vdc. PCB: 75x85mm. Kit Order Code: 3158KT - £17.95 Assembled Order Code: AS3158 - £27.95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32Vdc, 10A) in both the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166v2KT - £17.95 Assembled Order Code: AS3166v2 - £27.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15Vdc. Box supplied. Dimensions (mm): 60Wx100Lx60H. Kit Order Code: 3067KT - £13.95 Assembled Order Code: AS3067 - £21.95 Most items are available in kit form (KT suffix) or assembled and ready for use (AS prefix). 177 168 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay out- puts. 4 isolated digital inputs. Useful in a vari- ety of control and sens- ing applications. Controlled via serial port for programming (using our new Windows inter- face, terminal emulator or batch files). In- cludes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £54.95 Assembled Order Code: AS3108 - £64.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located ^ 200m+ from board. Wide range of tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £17.95 Assembled Order Code: AS3145 - £24.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £44.95 Assembled Order Code: AS3180 - £54.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. Not BT ap- proved. 130x110x30mm. Power: 12Vdc. Kit Order Code: 3140KT - £54.95 Assembled Order Code: AS3140 - £69.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m+ range. 112x122mm. Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £47.95 Assembled Order Code: AS3142 - £59.95 PI0 & ATMEL Programmers We nave a wide range of low cost PIC and ATMEL Programmers. Complete range anc documentation available from bur web site. Programmer Accessories: 40-pin Wide ZIF socket (ZIF40W) £14.95 18Vdc Power supply (PSU010) £18.95 Leads: Parallel (LDC136) £395 / Serial (LDC441) £3.95 / USB (LDC644) £2.95 NEW! USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP software. Wide range of upported PICs - see website for mT— complete listing. ZIF Socket/USB lead not included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £39.95 Assembled Order Code: AS3149E - £49.95 NEW! USB 'All-Flash' PIC Programmer USB PIC programmer for all ‘Flash’ devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included. Assembled Order Code: AS3128 - £44.95 “PICALL” PIC Programmer “PICALL” will program virtu- ally all 8 to 40 pin serial- mode AND parallel-mode (PIC16C5x family) pro- grammed PIC micro control- lers. Free fully functional software. Blank chip auto detect for super fast bulk programming. Parallel port connection. Supply: 16-18Vdc. Assembled Order Code: AS31 17 - £24.95 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. Program/ Read/ Verify Code Data, Write Fuse/Lock Bits, Erase and Blank Check. 4 LED’s display the status. ZIF sockets not included. Supply: 16-18Vdc. Kit Order Code: 3123KT - £24.95 Assembled Order Code: AS3123 - £34.95 www. QuasarElectronics. corn Secure Online Ordering Facilities • Full Product Listing, Descriptions & Photos • Kit Documentation & Software Downloads 34 elektor - 10/2007 With a PoScope USB instrument you get the features of an oscilloscope, spectrum analyser, chart recorder, logic analyser (with UART, SPI, l 2 C and 1 -wire serial bus decoding), pattern generator and square- wave/PWM generator. That’s equivalent to six pieces of test equipment for £99 including UK cfejivety and VAT. PoScope is a low-cost USB- based instrument that adds invaluable test equipment features to your desktop or notebook PC. Being PC-based, all measurements can be printed, copied to the clipboard and saved as text, bitmap or vector graphics for subsequent analysis or to import into other programs. PoScope is ideal for use by electronics hobbyists, students and engineers alike and is particularly suited to those developing with microcontrollers such as PIC and AVR. PoScope provides the following operation modes: • 2-channel oscilloscope with 100Hz to 200kHz sampling, -20 V to +20 V input range, 10-bit ADC resolution, absolute, differential and external triggering, adjustable pre-trigger and marker measurements. • 2-channel spectrum analyser with klirr factor measurement, Hamming, Hanning, Blackman and Blackman-Harris FFT window functions. • 2-channel chart recorder with 0.01Hz to 200kHz sampling, maximum, minimum and average voltage measurements for each channel and waveform record over several tens of hours. • 16-channel (8 when pattern generator used) logic analyser with 1kHz to 8MHz sampling, versatile triggering with adjustable pre-trigger, external clocking, preset pulse miss, preset bit sequence/edge, decoding of UART, SPI, I2C and 1-wire serial interfaces. • 8-channel 1kHz to 1MHz pattern generator with tabular waveform formatting or direct timing chart plotting on the screen. • Square-wave/PWM (pulse width modulation) generator. Compatible with Microsoft Windows ME, 2000 and XP, PoScope is supplied with easy- to-use software and a USB cable. Oscilloscope probes and logic analyser test lead/clip sets are available separately. Order now on Freefone 0800 612 2135 or online at www.paltronix.com PALTROniK EQUIPMENT FOR ELECTRONICS DEVELOPMENT, TRAINING & EXPERIMENTATION Paltronix Limited Unit 3 Dolphin Lane, 35 High Street, Southampton SOM 2DF Telephone: 0845 226 9451 Facsimile: 0845 226 9452 Email: sales@paltronix.com Web: www.paltronix.com AtEW&fli Abesirfr visa V/5A EleCErOri All major credit and debit cards accepted . tew Cr^ l-fi|ouk> i . J ■ nm itVHPhAAil- cri i^m LialtJefl Nodcar Cum T&itfttr T&iftcJyi & tracing Chris Vossen Cjiurwoo von Lcmbrtclil WZ7& Position determination is all the rage. The manufacturer of the well-known TomTom navigation system has become a publicly traded company, and the alarm systems of ■ _ expensive cars and other vehicles often comprise positioning systems so they can report where the vehicle is located. However, such systems are rather expensive, so we decided to take the DIY approach and develop our own version, dubbed ElekTrack. Nowadays we want to know the cur- rent position of everything. Where’s that package I ordered? Is the book I want already back in the library? Has my nephew’s train arrived already? Technology has advanced so much in recent years that there’s almost no sit- uation we can imagine that doesn’t al- ready have a solution. And otherwise we provide a solution! Big Brother People are often a bit nervous about organisations that keep track of every- thing, but in some cases this is exactly what we want. For example, consider car security and alarm systems. Those of us who can afford the latest May- bach or Mercedes SLR will doubtless encounter stringent security require- ments when they take out insurance for their vehicles. Quite often these cars must be fitted with security sys- tems that include vehicle tracking and tracing capability in addition to stand- ard anti-start and alarm functions. This means that they have a built-in GPS- based positioning system that reports the vehicle location to a message cen- tre. Stolen vehicles are indicated by red spots on a map in the control room. Passenger cars are not the only vehi- cles being fitted with tracking sys- tems. Lorries and boats can also ben- efit from such systems. More and more excavating machines are also being fitted with security systems, because they are stolen by the truckload. With a built-in track & trace module, these pricy machines can be tracked down and recovered. Of course, not everybody has an exca- vating machine or a Bentley in the ga- rage, but it’s still possible to find other interesting uses for a GPS tracker. For example, on a scooter or motorcycle. And if you’re a private detective, such a system is bound to make your eyes light up. We developed the ElekTrack to give our readers an opportunity to experi- ment with GPS tracking. Due to the large number of SMD components and the difficulty of soldering such components, we decided to supply this module fully assembled only. Objective of the design What must a tracking aid be able to do in its simplest form? Naturally, you want to be able to track the unit’s lo- cation. We chose the most obvious so- lution for the position determination part: GPS. With this, the system can identify its position nearly everywhere in the world. In addition, GPS is pres- ently very accurate, and as long as the European Galileo system [1] is not yet operational, it is the best ‘alternative’. We decided on SMS for data transmis- sion. Although data transmission is not actually live with this approach, it is possible almost everywhere and at all times. The GPRS network would have been another good option for data transmission. GPRS works with a di- rect link via the Internet, so data can Figure 1. As you can readily see from the schematic, everything revolves around the GSM modem. 36 elektor - 10/2007 be displayed live on a computer with Internet access. The loca- tion could thus be queried without any time delay, and the data could be stored ‘live’ in a da- tabase. However, we gave the pref- erence to the simpler SMS system. The de- sign 100n K4 3V3 Q eg RESERVED VCC XSTANDBY BOOT PPS XRESET RF-IN IC4 TXD-B TXD-A LNA Copernicus GPS Receiver SHORT RXD-A OPEN RXD-B OOOOOQOO zzzzzzzz oooooooo thus consists of two main modules: a GPS module and a GSM module. The GSM module is a type Q2686 from Wavecom. This module can be con- trolled using Wavecom OpenAT com- mands, and it has a built-in microcon- troller. The main advantage of this is shorter development time compared with using a separate modem, since it is not necessary to implement a mi- crocontroller or any peripheral logic. Everything is located in a single mod- ule. This also keeps the overall design nicely compact. For the GPS module, we decided on the Copernicus from Trimble. This is a suc- cessor to the Lassen iQ, which already showed what it could do in the USB 4V3 o 1V8 o D2 DALC208 16 _19_ 24 23 1V8 o CIO lOOn GND 21 20 C9 lOOn GND IC3 o o > THREE-STATE IVCC1 OVL1 OVCC2 o IVL2 z o MAX3375E 42 43 2V8 o -| col oo| 1= 1= 1= < < < m co m > > > ON OFF FLASH LED SIM VCC SIM JO SIMPRES SIM RST SIM_CLK BUZZ OUT BOOT /RESET BAT_TEMP AUX ADC SPI1-CS SPI1-CLK SPI1-I SPI1-IO SPI2-CS SPI2-CLK SPI2-I SPI2-IO MIC2N SPK1P MIC2P SPK1N i o o “I > oo o ~ “4 o o "i J X X o o o o > 00 IC2 PCM OUT PCM CLK PCMJN PCM SYNC DTR1/GPI041 CTS1/GPI039 DSR1/GPIO40 RXD1/GPI037 RTS1/GPI038 TXD1/GPI036 DCD1/GPI043 RI1/GPI042 ROW0/GPIO9 ROWI/GPIOIO R0W2/GPI011 R0W3/GPI012 R0W4/GPI013 C0L4/GPI08 C0L3/GPI07 C0L2/GPI06 C0L1/GPI05 COL0/GPIO4 GPI024 GPI022 MIC1N SPK2P MIC1P SPK2N TXD2 RXD2 CTS2 RTS2 GPIOO GPI044 Wavecom Q2686 Q Z o o z o o z o USB-DM GPI023 USB-DP GPI02 VPAD-USB GPI01 INTO INTI GPIO20 GPI021 SDA GPI019 SCL o z o GND 80_ 79 78 77 76 75. 74 73_ 72_ II 70 69_ 68 67 66 65 64 63 62. 61 60. 59 58 57 56 55 54 53 52 51 50. 49_ 48_ 47. 46 45 44 GPS receiver design published in the May 2005 issue of Elektor Electronics. Schematic diagram A glance at the schematic diagram in Figure 1 quickly shows that everything is built around the GSM modem. The GPS module is connected to UART2 of the modem via a logic-level converter (IC3). The circuitry around T3, T4 and T5 detects whether the antenna circuit is shorted, open, or connected normal- ly. The GPS module supplies power to the active antenna via T1 and T2. Two supply voltages are necessary for proper operation of the circuit: 4.5 V and 3.3 V. They are provided by IC5 and IC6. IC5 (a LT3430) is a buck convert - 3V3 o C4r lOOnl C5r lOOnl 11 C1+ C1- C2+ C2- T1IN R10UT FORCEOFF V+ IC1 T10UT MAX3221E RUN INVALID V- EN o FORCEON z o 16 C3 lOOn 13 LI BLM21B102 rrrri 12 L2 BLM21B102 C6 lOOn GND DIO Dll DI2 10/2007 - elektor 37 er operating a frequency of 200 kHz. Resistors R12 and R14 determine the output voltage, which is set to approxi- mately 4.5 V. IC6 provides the supply voltage for the GPS module. It generates a fixed 3.3-V output voltage from a 4.5-V input volt- age. Three identical level converters are formed using T6, T7 and T8. They convert the relatively high input volt- ages to logic levels that comply with the specifications of the GSM modem. IC1 is a standard RS232 converter, which among other things can be used for connecting the unit to a PC in order to program the modem. You can also use IC1 as a port for your own appli- cations. D1 and D2 protect the input of the GSM module against static dis- charges that can occur when the SIM card is inserted in the socket. LED D3 shows the status of the GSM link. If it is continuously on, the mo- dem is not logged in to the network. It starts blinking as soon as the modem logs in successfully. LED D12 shows the status of the GPS module. External connections ware in order to reduce the current consumption. For instance, you could implement a function to place the GPS module in sleep mode with an SMS command and awaken it with another command. Naturally, the unit also has antenna connectors: one for the GPS module and one for the GSM module. The mo- dem also has several logic inputs. They can be used for purposes such as con- necting an alarm to the ElekTrack. A voltage above approximately 8 V will cause the digital input of the GSM mo- dem to be triggered. When this hap- pens, a text message can be sent to one of two previously programmed tel- ephone numbers. You will have to im- plement this in the software yourself, since this function is not yet included as standard. Perhaps it will be imple- mented in a firmware update. at+cpin? If the modem responds with ‘ + CPIN : READY’, the SIM card does not need a PIN code. If you receive the response ‘ + CPIN:SIM PIN’ instead, the SIM card needs a PIN code, and this will first have to be eliminated. The cur- rent firmware does not yet support automatic PIN code use. This may be implemented in a future version of the firmware. Check our website for the latest version. If you enter the command at+cpin=xxxx The power supply can work with an external 12-V or 24-V system. Based on tests, the ElekTrack requires an exter- nal supply voltage of at least 8 V for proper operation. The external pow- er source must also be able to supply sufficient current. Relatively high peak currents occur when the GSM modem is transmitting data. The average pow- er consumption of the unit is around 500 mW, so a 9-V battery would only last for approximately 2 hours. A scoot- er or motorcycle battery will hold out for a lot longer. Naturally, it would al- ways be possible to modify the soft- The GPS module can be configured using various commands. For this pur- pose, the module must be linked to a PC by a cable. A program such as Hy- perTerminal for Windows must be used to configure the ElekTrack unit. The se- rial port of the PC must be configured as shown in Figure 2. Startup The first thing you have to do is to check whether the SIM card is pro- tected by a PIN code. Use the follow- ing command for this: (where ‘xxxx’ is the pin code of the SIM card), you will receive ‘OK’ in response. Next you have to request disabling of PIN checking by entering the follow- ing command: at + clck = "SC" , 0 , xxxx (where ‘xxxx’ is again the PIN code of the SIM card). The modem will again respond with ‘OK’. In order to check whether the modem can now log into the network automat- ically, you have to reset it with 38 elektor - 10/2007 at+cfun=l If everything goes well, the upper LED (D12) will start blinking after a bit less than a minute. This means that the mo- dem has successfully logged in to the network. If you wish, you can check this by entering the command at+cops? The modem will respond with +COPS : 0,2,20408 OK (here ‘20408’ is the operator number, p™ — — — — — — — — — — — — — — — — ■ ! Better than GPS - The Global Positioning System (GPS) was origi- nally developed for military use. In response to ■ steadily increasing demand for accurate position ■ determination, the GPS system was released for ■ civilian use a bit at time. At first, the accuracy of ■ the satellite signals was intentionally degraded | by the US authorities who originally established | the system. This restriction was removed a few | years ago, so consumers can now use the full | resolution of the system. This allows GPS to be | used to determine positions with an potential | error of up to three metres. The positioning ac- I curacy depends on the number of 'visible' satel- I lites and whether a WAAS or EGNOS signal is I received. The terms WAAS and EGNOS relate to systems that can be used in combination with GPS to increase positioning accuracy. WAAS stands for ' Wide Area Augmentation System', while EGNOS stands for 'European Geostationary Naviga- I tion Overlay Service'. The EGNOS and WAAS ■ systems do the same thing, but the former is for ■ Europe and the latter for North America. Each ■ system consists of a network of satellites and | ground stations that generate a GPS correction | signal that can be used to increase positioning | accuracy by a factor of up 5 on average. A re- | ceiver that supports WAAS or EGNOS generates | positions that differ from true positions by less than 3 metres in more than 95% of all cases. EGNOS currently consists of three geostationary satellites and several ground stations distributed over Europe. The ground stations collect infor- mation from each other and generate a correc- tion signal. The ground stations know their own locations with high accuracy, and they compare their positions with the signals received from the satellites, since the paths of the satellite sig- nals can be distorted by atmospheric conditions and other causes. The correction signal is then transmitted to the geostationary satellites. This data has the same format as the standard GPS signal, so it can be read by any GPS receiver that supports WAAS. EGNOS is as joint project of ESA, Eurocontrol and the European Commission, and it works with the American GPS navigation system and the Russian Glonass navigation system. The EG- NOS satellite number for Europe is 33. Many GPS systems indicate whether they are receiv- ing a correction signal. The term 'differential' is also used for this. The MSAS system, which operates the same way, is used in Asia. 10/2007 - elektor 39 GPS Figure 2. The settings shown here must be used for serial communication. which depends on the provider.) Now the modem will log into the net- work automatically as soon as power is applied to the module. Security The first thing you have to do is to change the password. The default password is ‘elektor’. To change the password, first enter the following command to request the password: at+password? The modem will respond with ‘+PASS - WORD : : elektor’. To change the pass- word, use the command: at+password="gpsmodule" Note: you must enter the quotation marks as shown; otherwise you will re- ceive an error message. The maximum password length is 20 characters. GPS status The GPS module is connected to the serial port of the modem. Two com- mands for requesting data from the GPS module are implemented in the first version of the firmware. The first command is at+gpshealth? The following is an example of a pos- sible response from the modem: Rcvr status code = 0x01 (Don't have GPS time yet) Receiver health byte = 0x11 Battery backup: BBRAM not available at start-up Antenna feedline fault: An- tenna line open/short Type of fault: Open detected OK From this, you can deduce that the GPS module does not have any valid coor- dinates at present. The antenna status indicates a fault situation. The fault type indicates that the antenna con- nection is open-circuited. The antenna is probably not connected. If the command is issued again after the antenna has been connected, you might receive the following response: Rcvr status code = 0x00 (Do- ing position fixes) Receiver health byte = 0x01 Battery backup: BBRAM not available at start-up Antenna feedline fault: OK OK Here you can see that the antenna status is ‘OK’. If the antenna input is short-circuited, a ‘Short circuit’ sta- tus message will appear. The receiver status code reports that the receiver was able to determine a valid posi- tion. When the module is first enabled, the receiver status code indicates the number of satellites being received. When the receiver has managed to de- termine a valid position, the lower LED (D3) starts blinking. If this LED is on continuously, something is wrong. It could mean that the module is not re- ceiving enough satellites, but it could also mean that the antenna is connect- ed incorrectly. Normal use Now that you have determined that a link has been established, you would like to know the latitude and longitude coordinates. Enter the following com- mand for this: at+gpsposition? The modem will return a set of coordi- nates in response, such as Long: 5.803043 E; Lat: 50.941492 N; OK GPSco“vrdin eu ham !• CPS c n-ff nl'P-.i-thK P U-jLrK & TrviE&h m tf iDCrffJun nr** I J ivupiiinvtsi I l fr . rln I I IQWi. ■ . J SL01 §444,1 *11147 □ nict k* M Ji M SI i: -4*. t \ '■* i (14- Figure 3. ElekTrack knows exactly where to find Elektor's new head office! 40 elektor - 10/2007 Practical problems Anyone who writes software knows that little bugs always find a way to creep into the code. When were first devel- oping the software, we had problems with sending SMS messages. It seemed like the SMS service of the modem somehow didn't want to work. After spending several hours looking for the source of the problem and reading through documentation, we came up with the simple but brilliant idea of trying a different SIM card. That meant a quick trip to the shop to pick up a new SIM card. And just imagine our surprise when we discovered that there were no problems at all with the new card! Of course, we found it rather remarkable that everything worked OK with the new SIM card, so we contacted the supplier. It turned out that there was indeed a bug in the modem firmware. Logging in to the SMS service evident- ly did not work properly with some types of SIM cards. This problem has been corrected in the latest version of the firmware. Another problem that is probably familiar to most soft- ware developers is the difference between little-endian and big-endian memory organisation. The GPS module outputs latitude and longitude coordinates as doubles in radians. The GPS module operates in little-endian mode, while the GSM module operates in big-endian mode. When you import the data (as ASCII values), the order of the bytes must therefore be reversed. If you convert little-endian radian data in a big-endian processor, the results are naturally all over the map. We overlooked this detail at first. Your first impulse is to think that you made a mistake in the code that performs the conversion. In retrospect it's all pretty obvious, but in the midst of the fray it's a hard nut to crack. Of course, you want to be able to re- quest the coordinates via SMS so you can request the position of the mod- ule remotely. To prevent unauthor- ised persons from receiving a reply from the module if they send a text message to it, the module must have a password. Send the following mes- sage to the module via SMS to assign it a password: info : : or INFO : : Note: ‘info’ must be written either entirely in upper case or entirely in lower case. The password you con- figured using the at + password com- mand must be entered here in place of . The parameter is option- al. The reply is returned to the sender by default. If you want to have the re- ply be sent to a different number, you can use this parameter to specify the desired number. After a few seconds, the ElekTrack will send a text message via SMS with the longitude, latitude and altitude data, which can be used to determine the lo- cation of the ElekTrack unit. For exam- ple, you can do this online at [2] (Fig- ure 3) or [3]. The ElekTrack is supplied as fully as- sembled unit, and you can order it via our webshop at www.elektor.com. The latest version of the software is also available on our website. And of course, we always appreciate hearing from our readers about interesting ide- as and applications. ( 040161 - 1 ) Web Links [1] en. wikipedia. org/wiki/Galileo_positioning_system [2] www.gpscoordinates.eu [3] http://boulter.com/gps 10/2007 - elektor 41 RECYCLING Michael Gaus and Bernhard Kaiser Barely believable: inside a low-cost flash gun the authors discovered hidden treasure — a Freescale 8-bit controller equipped with 4 kB of Flash memory suitable for in-circuit programming. Add a homebrew programming adapter and a couple of free programs off the Internet and you've got a multifunction LED lamp! The boom in camera phones means you can now pick up tiny snap-on flash guns for a couple of pounds if you know where to look. And if you look inside them you’ll find some extremely bright LEDs and some sophisticated electron- ics that make these bargain units ideal for conversion into pocket torches, sig- nalling lamps and more. Some descrip- tions of the control logic found on the Internet [1] were the authors’ inspira- tion for this project. That’s not all. Since even a simple flash gun requires some logic and needs to tell the mobile phone what it’s doing, there’s normally a small microcontrol- ler among the components. If you’re thinking this controller is going to be some anodyne mask-programmed no- name product, prepare for a pleasant surprise, at least with the MPF-10 KRY from Sony Ericsson. Inside this little beauty we find an industry-standard 8-bit controller by Freescale, equipped with 4 kB of Flash memory with the bo- nus of in-circuit programming capabili- ty. And doesn’t this just beg you to cre- ate your own mini programs? That way you can get rid of the existing exter- nal control logic, which in turn leaves empty space in the casing for your own purposes. A whole raft of features can then be realised quite simply: constant illumination, dimming, flashing on and off or a stroboscope effect. The sample software our authors have written pro- vides all these functions, enabling this LED lamp project to be used as a mul- tifunctional torch, for low energy light- i MC68HC908QT4 7 PTA0/AD0/TCH0/KBI0 PTA2/IRQ/KBI2/TCLK 070479-13 Figure The phone flash employed can be bought for a couple Figure Pin assignments for the miniature 8-bit Controller, of pounds on the Internet. Figure 3 The step-up transformer can be seen among the passive SMD components. 42 elektor - 10/2007 ing outdoors, a USB light for laptops, a programmable stroboscope or even a signalling lamp for joggers or cyclists. Even more applications are possible if you replace the white LEDs with col- oured ones. Hardware The phone flash used is a standard product of Sony Ericsson and goes by the name of MPF-10 KRY (Figure 1). It’s available new from many online stores or far cheaper second-hand from Amazon and on eBay (just enter the search string ‘MPF-10’). Do a bit of searching and you can find examples for under £ 2. The microcontroller mentioned has the designation MC68HC908QT4 and is equipped with 4 kB Flash memory plus 128 bytes of RAM as well as an internal 3.2-MHz oscillator (Figure 2 gives the pinout details). With the phone flash you also get six white ultra-bright LEDs, a pushbutton switch and a step-up transformer, which you can make out in Figure 3 among the passive SMD components. That’s about it, as the remarkably simple circuit dia- gram seen in Figure 4 shows. The LEDs are not illuminated at pow- er-on. The Enable input of the step-up transformer and hence also the LEDs are made active at the Port pin PTA4 of the microcontroller; the LEDs come on when this is in its logic High state. The output of a PWM signal enables the LEDs to be dimmed as well. The operating pushbutton switch is con- nected to Port pin PTA3, which reads a Low level when the button is pressed. This can also be used for special func- tions in the program. Its intended purpose as a mobile phone accessory means that the flash unit is designed for an operating voltage of 3.6 V. According to the datasheet [2] the permissible microcontroller supply volt- age lies between 2.7 V and 5.5 V and the authors’ tests indicate that the com- plete flash unit will operate successful- ly anywhere in the range 3.0 V to 5.5 V. Current draw with the LEDs illuminated is a moderate 180 mA (at 3.6 V). The built-in step-up transformer, which supplies the series-connected LEDs with a constant current of around 27 mA at a total voltage near 20 V, en- sures there is no discernible variation in brightness across the range of sup- ply voltages noted. Batteries are an ideal power source therefore; for exam- ple three 1.5 V alkaline cells will oper- ji d |~R2~ C4 C3 C2 Cl © v cc TA1 H o IC1 ■© V CC © PTAO PTA1 PTA2/IRQ PTA3/RST PTA4 PTA5/OSC1 8 MC68HC908QT4 IC2 "© v cc © OUT step-up ENABLE converter D1...D6 = LED white D3 D4 D5 D6 070479 - 1 1 The circuit of the phone flash is extremely simple — the functionality is all in the ICs. Figure Reprogramming calls for a relatively simple programming adapter, which is little more than an RS-232 level changer. 10/2007 - elektor 43 RECYCLING Figure Programming is carried out via this connector on the phone flash. The matching connector illustrated can be bought online. Figure You can also make the matching connector yourself using a PCB designed for SMD components. Figure When the Tower Cycle Dialog' window appears the supply voltage must be switched off and on again briefly. ate cheerfully down to a level of 1.0 V. Programming adapter Reprogramming the tiny microcontroller requires a relatively simple program- ming adapter. Basically this is just an RS-232 lev- el changer (see Figure 5). If you intend to program several phone flash units it would make sense to use the existing multiway connector as this has links to all the connections nec- essary for programming. You will need a counter- part for the multiway con- nector to plug into it and can buy this online [3] (see Figure 6). It is sold by speciality mobile phone spares dealers under the name ‘connector strip for Sony Ericsson T68’ or something similar to that. If you cannot track it down you can also make up your own from a PCB intended for SMD components with 0.9 mm distance between tracks (Figure 7). When you put the project into practical use you will also need a power connector to the DC volt- age and for this you can either employ another matching connector or else solder the power leads direct to the micro- controller. The second approach will naturally require opening up the case of the unit (see inset Opening up the case). Figure A series of settings needs to be made when using the serial interface. Figure The programming file is selected with 'SS'. The module is erased with 'EM' and programmed with 'PM'. Compiler Software requirements are just a compiler and suit- able programming soft- ware. To generate a new program (or modify our sample program MUL- TILED.C) the freeware compiler SDCC-2.6.0 [4a] is ideal, although you can also use Freescale’s Code- Warrior development en- vironment that was de- scribed in the March and April 2007 issues of Ele- ktor Electronics [4b]. For Windows systems select ‘sdcc-win32’ in [4a] as your download. The source code of the C file can be created and manipulated in a simple text editor such as Note- pad. When writing your own programs remember that Variables containing ‘near’ must be declared to make sure they end up in the internal RAM, for example: unsigned char near cTest ; At the outset of our pro- gramming activity we need to turn off the Watch- dog function with: CONFIG1 = 0x01; // disable Watchdog The compiler is called up with a small batch file (for convenience we have in- cluded the file in the soft- ware Zip file 070479-11 that you can download 44 elektor - 10/2007 from the Elektor Electronics website [5]): sdcc -mhc08 - -out-fmt-sl9 -- code-loc OxEEOO --stack-loc OxFF MULTILED . C pause OxEEOO is the start address of the in- ternal Flash memory bank. The stack begins at Address OxFF in the internal RAM und runs downwards. Programming The compiler produces several files from the source code, including an .SI 9 file. This is used for programming the microcontroller. You will need to install the tool ‘PROG08SZ Programmer’ from PEMI- CRO [6]. This freeware program re- quires no-cost registration before you can download it so go first to the and Hex file) that you can download gratis from the Elektor website [5]. The program MULTILED. C operates in two different modes. The ‘constant/dimmed light’ mode al- lows you to operate the LEDs at maxi- mum brightness with power enabled without needing to press the built-in switch. Pressing the button puts the dimmer into operation, with the step- up transformer cycled on and off by the Enable input. Keeping the button pressed further dims the brightness by reducing the On/Off phase. Once the minimum brightness level pro- grammed has been reached the lamp regains maximum brightness. You can enter ‘flash/strobe’ mode by applying power and simultaneously pressing down the flash button. Re- peated operation of this button switch- es the frequency between 60 different values. Caution Please take great care when using this device, as the ultra-bright LEDs can all too easily damage your sight. Never look at the light source at close quarters or for any extended period of time. Login page (‘New Account’). Follow- ing this, download the installation file ‘prog08sz_interactive_install.exe’. A number of settings need to be spec- ified in the process of using the seri- al interface, which can be seen in the screenshot (Figure 8). When you have connected up the phone flash to the power supply and the programming adapter you have to activate the button ‘Contact target with these settings’. A new window opens, in which you need to select the microcontroller type (‘908_qt4.08P’). When the window ‘Power Cycle Dialog’ opens (see Figure 9), the power must be switched off and on briefly. The ac- tual programming comes next. First we select the correct programming file (in this example ‘MULTILED. SI 9’) us- ing the program function ‘SS’ (see Fig- ure 10). The module is erased with the command ‘EM’ and programmed with ‘PM’. Using ‘VM’ (verify module) you can check whether the whole opera- tion is functioning error- free. Sample program The authors have written a small but practical sample program (source code ( 070479 - 1 ) Web Links [1] Phone flash info, additional photos and the inspiration for this project: http://avr.auctionant.de/mpf-l 0_handyblitz [2] Data sheet for the microcontroller: www.freescale.com/files/microcontrollers/ doc/data_sheet/MC68HC908QY4.pdf [3] Connector for flash programming the phone flash: http://stores.ebay.de/MOBIL-PI_ANET-GMBH (keyword: AnschluBleiste t68') Or try a Google UK or eBay UK search to find a more local supplier (let us know if you do!). [4a] C Compiler SDCC 2.6.0 (Freeware): http://sourceforge.net/project/ showfiles.php?group_id = 599 [4b] Freescale SpYder project in Elektor Electronics March and April 2007: www.elektor.com [5] MULTILED.C, free download from the Elektor website. Follow: Magazine— ►2007— ►[Month]— ►[article title] [6] Programming software (registration required): https://www. pemicro.com/login.cfm ?from_ url = http://www.pem icro.com/down loads/ download file.cfm?download id = 83 Opening up the case During programming (using a DIY adapt- er or even a fly-lead) it is important to secure the power supply, by mechanical means, from disconnection. This means opening up the case and soldering the wires to the microcontroller. This is a con- venient opportunity to replace the white LEDs with coloured ones if you wish. There are two steps to this disassembly operation. The clear window and reflector assembly clip onto the remainder of the case. Press- ing a knife or screwdriver blade into the slot releases the window/ref lector assem- bly and allows you to separate the phone flash into two parts. To get at the electronics you need to re- move the rear cover by undoing the four cross-head screws holding the reflector assembly. The power leads are soldered direct onto the supply pins of the microcontroller. Closing the case afterwards assures a good strain relief 10/2007 - elektor 45 MICROCONTROLLERS Open source Swiss Army knife Benedikt Sauter and Thomas Scherer AVR prog If USB-RS232 intc A new microcontroller, and yet another new programmer? Anyone involved with microcontrollers today will have a drawerful of printed circuit boards and adaptors for programming various devices. Enter USBprog, which can replace all those with a single unit. As a bonus, it can even be used as a general- purpose USB I/O port and RS-232 adaptor. Features and functions - USB interface - Software for both Windows and Linux - Programmer and debugger for AVR processors - Programmer and debugger for ARM processors - USB-to-RS-232 converter without driver - JTAG interface - USB-to-digital-l/O interface (ten signals) Benedikt Sauter was prompted to de- velop this design by his frustration at the fact that each new microcontroller seemed to demand its own program- mer. Not only is this a waste of space and money, it is hardly an environmen- tally-friendly way to proceed. Further- more, many of the simple programmer designs available on the Internet, as well as older commercial units, require the use of a PC with a ‘legacy’ inter- face such as a parallel printer port or an RS-232 port: these are becoming a rare feature on modern machines. These days, a USB interface is essen- tial on any peripheral. Sometimes a serial peripheral can be given a new lease of life using a USB- to-serial converter. However, these converters are often slow, especially when it comes to software control of the handshake signals. Even transfer- ring just a couple of kilobytes of data into the microcontroller’s memory can leave you twiddling your thumbs for a minute or so, and these delays are particularly irritating when develop- ing and debugging software. Good (i.e., fast) USB to serial converters ex- ist but are somewhat more expensive than the more general purpose unit we describe here. Jack of all trades? Having set out the problems, we now try to solve them, preferably all at once! Since we want to achieve relatively fast data transfer between the USB port and the target system, it makes sense to use a USB interface chip along with a dedicated microcontroller which is responsible for high-speed commu- nication with the processor in the tar- get system. If we choose a reasonably powerful microcontroller for this task we will also be able to add some intel- ligence to the unit. We can download data into a buffer in the microcontrol- USB serial USBprog USB/ Parallel IC2 USBN9604 8-bit-Bus ^ i\| Firmware IC1 ATmega32 serial serial i Bootloader 8-bit-Bus ^ ^ 8 bit \r parallel j 060224 - 12 Figure 1. The block diagram of USBprog shows the combination of a USB bridge and a microcontroller. 46 elektor - 10/2007 ARM programmer USB-I/O interface JTAG interface ;rface Table 1. Firmware available from the project website (status: August 2007). The range availabl e is continuously being extended. N° Name Description Status 1 AVRISP mkll clone Clone of the original AVRISP mkll stable 2 OpenOCD adapter Adapter for ARM7 and ARM9 beta 3 AT89 programmer Developed for the Elektor Electronics AT89S8252 board beta 4 SimplePort Ten I/O signals that can be controlled using C, Python or Java stable 5 JTAG adapter Universal USB-to-JTAG adapter with C library beta 6 USB-to-serial converter USB-to-RS-232 converter (no extra driver needed) pre-alpha 7 JTAGICE mkll clone Clone of original JTAGICE mkll in development (basic functions) 8 XSVF-USB player Universal XSVF player structure and source code framework in place 9 Blink demo Simple LED flashing demonstration stable 10 PIC programmer Based on 'Odyssey' for Linux and Windows structure and source code framework in place 1 1 USB BDM interface Interface and debugging for 68-series processors structure and source code framework in place 12 MSP430 JTAG Interface for this low-power microcontroller from Texas Instruments structure and source code framework in place ler in one rapid operation, and then it can carry out the rest of the program- ming task autonomously, simulating the programming interface and trans- ferring data to the target system (see Figure 1). In fact, we can go one better: if our microcontroller is programmed with a generic bootloader, then it is possible to download into its memory whatev- er software is required for the partic- ular task at hand from the PC, using the USB interface rather than using its own programming interface. Of course, this facility allows for straightforward firmware updates, but it also turns the device into a general-purpose tool. By using firmware with different func- tions in USBprog’s microcontroller, we can turn the unit into an AVR program- mer, or an ARM7/ARM9 programmer, or a USB digital I/O port. And, since the microcontroller we use has a built- in UART, we also get a free USB-to-se- rial converter! Open source The most elegant hardware design in the world is nothing without its ac- companying software, and this is es- pecially true of USBprog. Without a suitable bootloader and firmware to provide all the anticipated functions we would just have a useless piece of electronics. It is hardly reasonable to tell users to write their own firmware, and so, in addition to the required USB interface driver for IC2 and bootloader for IC1, the author has made a range of additional programs available on his own project website [1]; the firmware is also available for download from www. elektor. com . Table 1 shows at a glance what firmware is available and currently in development. An interesting item al- 10/2007 - elektor 47 MICROCONTROLLERS VUSB O vcc D2 MBRS130T3G K1 1 10 USB R4 L | lk5 l <> C5 1u GND VCC O JcT- ^00n GND V PCO 26 ^ PCI 27 ^ PC2 28 s. PC3 1 v PC4 2 v PC5 3 v PC6 4 PC7 5 DO/SO vccl DACK D1 RESET D2 INTR D3 CS D4 IC2 RD D5 WR/SK D6 A0/ALE/SI D7 USBN9604SLB DRQ D- CLKOUT MODEO D+ MODE1 V3.3 AGND 1— =) o z z o z O X X o R3 H 1M U Y1 Cl 15p I \ 24MHz C2 15p TT 24 22 GND R1 PB3 PB1 JC7 Jc6 Jc9 Jc- ^Tooi^ioo^c VCC ? GND 10 GND PD2 11 19 PD3 12 20 PD4 13 21 PD5 14 25 PD6 15 23 _16_ 18 15 VUSB 8 Jin * D1 0 _7 H MBRS130T3G f° ? I JP2 K2 PBO 40 PB2 100R 100R 100R R13 4 R15 6 R14 8 10 O O o a o a o o o o 1 R8 3 R9 5 RIO 7 R11 9 R12 100R 100R 100R 100R 100R MOSI PB5 PB4 RST PBO SCK PB7 MISO PB6 PB1 41 f PB2 42 ' PB3 43 ' PB4 44 ' PB5 1 f PB6 2 f PB7 3 GND PBO C8 lOOn GND o o o o o o o o > > > > PDO (RXD) PD1 (TXD) PD2 (INTO) PD3 (INTI) PD4 (OC1B) PD5 (OC1A) PD6 (ICP) PD7 (OC2) IC1 PCO (SCL) PCI (SDA) PC2 (TCK) PC3 (TMS) PC4 (TDO) PC5 (TDI) PC6 (TOSC1) PC7 (TOSC2) XTAL1 XTAL2 ATmega32L PBO (XCK/TO) PB1 (T1) PB2 (AIN0/INT2) PB3 (AIN1/OCO) PB4 (SS) PB5 (MOSI) PB6 (MISO) PB7 (SCK) □ o z z CO (0 RESET AREF -8MU PAO (ADCO) PA1 (ADC1) PA2 (ADC2) PA3 (ADC3) PA4 (ADC4) PA5 (ADC5) PA6 (ADC6) PA7 (ADC7) o z (0 to co co cn CM CO T GND 19 PCO, 20 PCI , 21 PC2 , 22 PC3, 23 PC4, 24 PC5, 25 PC6, 26 PC7, 4_ 29 37 36 35 34 33_ 32 31_ 30 VCC O R2 R7 JP1 R5 R6 lc£l lc£l 1^1 1^1 InI I r — I IcmI I cm I RESET JP4 AUX LED1 red LED2 POWER green GND 060224-11 Figure 2. The circuit diagram of USBprog is hardly more complicated than the block diagram. lows USBprog to be turned into a clone of the Atmel mkll in-system program- mer. It can then be used directly with Atmel’ s free AVR Studio development environment [2] and other software that supports the AVRISP mkll. An- other firmware option allows ARM7 and ARM9 microcontrollers to the pro- grammed and debugged using the OpenOCD software development en- vironment [3]. Other options allow the unit to act as a USB -to -serial converter or simple USB interface with ten dig- ital I/O lines. In the works are a JTAG- based programmer and firmware for programming other microcontroller families. In the true spirit of open source soft- ware, the source code for the firmware is freely available. You are warmly en- couraged to add to the project for the benefit of all users; there is already a small community of USBprog users and developers. In the interests of making it easier to get started with this open source project, the project site also contains software that can not only reflash the ATmega32, but also (at the press of a button) check the project site to see if any new firmware has become avail- Table 2. Pinout of K2 under various firmware configurations. Pin number AVRISP mkll clone OpenOCD adapter AT89 programmer SimplePort JTAG adapter USB-to-serial converter JTAGICE mkll clone SV2 pin 1 MOSI TDO MOSI Port 1 TDO — TDI SV2 pin 2 VCC VREF VCC VCC VREF VCC VREF SV2 pin 3 — SRST — Port 2 SRST — — SV2 pin 4 — TRST — Port 3 TRST — — SV2 pin 5 Reset TMS Reset Port 4 TMS — TCK SV2 pin 6 — — — Port 5 — — — SV2 pin 7 SCK TCK SCK Port 6 TCK — TMS SV2 pin 8 — — — Port 7 — — — SV2 pin 9 MISO TDI MISO Port 8 TDI — TDO SV2 pin 10 GND GND GND GND GND GND GND JP3 RX — SRST — Port 9 — RX — JP3 TX — TRST — Port 1 0 — TX — 48 elektor - 10/2007 Construction and bootloader able, and, if so, download it. The package is available for Linux as well as Win- dows, and an OS X version is planned. Hardware Figure 2 shows the circuit diagram of USBprog, which is hardly more complicated than the block diagram. The whole circuit draws less than 100 mA and is comfortably powered directly from the PC via the USB connector. D2 pro- tects the PC from excessive voltages originating in hard- ware connected to the unit. IC2 is a dedicated USB bridge Figure 3. Most of the components on the double-sided printed circuit board are surface-mount types. USBprog is built on a double- sided printed circuit board and employs a number of sur- face-mount components, and so many readers might prefer to buy the kit available from the Elektor Shop where most of the components have al- ready been mounted on the circuit board. Just the con- nectors and headers remain to be soldered. More ambi- tious constructors can make their own printed circuit board (Figure 3) using the layout available for download from http://www.elektor.com or order the board from http:// COMPONENTS LIST Resistors R1 , R2, R7 = 1 OkU, SMD 0603 R3 = 1 MU, SMD 0603 R4 = 1 l download center] on their web- site. They also provide there the drivers for Windows, virtual COM, and direct 10/2007 - elektor 55 TECHNOLOGY USB/UART access, as well as some examples of source code describing direct access under Linux. The COM port driver un- der Linux is developed independently Linux. We haven’t come across this type of product before in Europe. K-micro, an American manufacturer, also offers this type of product, but driver and the D2XX direct access to- gether won’t work, you will be asked to uninstall the current driver. - If your IC offers two interfaces, you Customize your products ^ Modifying the ICs' EEPROM in order to change the VendorlD and/or ProductID of your de- vice can prove risky. The reference drivers will no longer recognize the device. ^ If you want to customize your projects and have your own official VendorlD, it will cost you $2,000 from the regulatory authority: www.usb.org/. ✓ However, you can get a batch of ten unique, official VendorlD/ProductIDs from http://www. mecanique.co.uk/ for the modest sum of £ 29.95. ^ What's more, FTDI offers companies the opportunity of having a group of eight ProductIDs, provided these are used in conjunction with FTDI's VendorlD (0x0403). by Greg Kroah-Hartman; the code is built into the kernel. Others The last manufacturer we’ll tackle here is Indian and presents a very extensive range of products. The two recent USB/serial interfaces from Moschip Semiconductor Technol- ogy Ltd are the MCS7820 and MCS7840. They provide two and four interfaces re- spectively, complying with the USB 2.0 standard and the RS-232, RS-422, and RS- 485 protocols. These components need an I 2 C -compatible EEPROM and can be powered directly from the USB bus. Driv- ers are available for both Windows and we’re not yet convincing, so we’ll content ourselves with just mention- ing them - you can always read more about them on their website. So at the end of this brief introduction, it seems as if each manufacturer of- fers a complete range of products that are to a greater or lesser extent iden- tical. The prices, the support offered, and the information available from the manufacturers, along with the summa- ry table we’ve prepared for you, ought to help you choose. Remarks and advice - (tested for FTDI only) Warning! installing the virtual COM will have to install the same driver twice. Each interface in effect has its own group of USB endpoints, managed separately by the host device. ( 070478 - 1 ) Web Links www.ftdichip.com/ www.silabs.com/ www.prolific.com.tw/ www.k-micro.us/ www.compuapps.com/ www.moschip.com/ www.usb.org/ 56 elektor - 10/2007 “Elektor? Prescribed reading for our R&D staff because that’s where we need professional guidance for microcontroller technology.” - Frank Hawkes, 39, development engineer - VJHVl . nscjwt "I ekf lQ Secure a head start in electronics with a subscription! Advantages to subscribers Cheaper than 1 1 issues from the newsstand Subscribers get up to 40% discount on special Elektor products As a welcome gift you get a free 1GB MP3 player worth £ 34.50 No queues, travelling, parking fees or ‘sold out’ Elektor is supplied to your doorstep every month Always up to date - read your copy before everyone else f the magazine. eitto electronics worldwide HOME AUTOMATION Automation Using a broadband router to control home automation devices Arthur Vogels A wireless router can be used for a variety of unusual purposes, such as controlling home automation devices. This article describes a relatively simple conversion of an Asus router for use as a home automation control unit. As already described in an article in the February 2006 issue on modifying routers, standard broadband routers can be used for many purposes that their designers never had in mind. That article described how to add a USB port to an inexpensive Sweex router and convert it into a web server. In this article, we show you how to modify a standard wireless router for use as the central control unit of a home automa- tion system. Figure 1. The PCB inside the case has an expansion connector for two serial ports. 58 elektor - 10/2007 The home automation system in ques- tion is a DIY system that was original- ly designed to work with a PC as the central control unit. If you use a differ- ent home automation system, you will probably have make some adjustments to the project described here, but the basic idea is the same. The advantage of using a router is that it consumes much less energy that a PC. You probably have a wireless rout- er somewhere in your house for your broadband Internet connection, and it can assume an additional function. In order to implement the system, you have to select a suitable router that can run user-generated software, fit it with a USB or RS232 port, write the home automation software, and then connect and configure everything. All of these steps are described in this article. Router selection There are several things you have to pay attention to when selecting a suit- able router. First, it is advisable to choose a router that uses a standard operating system. A router is actually a computer without a keyboard, mouse or monitor. But just like a PC, it has an operating system. If you want to run your own software on a router, it’s handy to use one with an open operating system. Some routers use operating systems written by the manufacturer specifically for the router. As these operating systems are usu- ally not made public, there’s not much you can do with them. Fortunately, more and more routers nowadays use a variant of Linux, and this means that the source code is publicly available. This opens the door to interesting pos- sibilities, such as this home automa- tion project. It is also important to select a router that supports connection of USB or RS232 devices. This is possible with most routers. In some cases you will have to open the case for a bit of solder work, but this shouldn’t pose a prob- lem for the average Elektor reader. Finally, the router must have enough memory and (preferably) a high-per- formance processor. After all, who knows what else you’ll want do with it after you’ve see what’s possible? The potential applications are nearly end- less - a web server, an FTP server, an MP3 server - you name it. The following website provides an overview of routers and their features: http : / / wiki . op en wr t . org/TableOfHardware In this case, we chose an Asus WL500g Premium router. It costs around £ 65 (€ 80), which means it's not the cheap- est model, but it has a 266-MHz proc- essor, 32 megabytes of working mem- ory, and two USB 2.0 ports on the rear panel. There is also a large community of hobbyists who experiment with this router (see http://www.wl500g.info), and you can consult them for advice if you get stuck. Modifying the router As delivered, the router does not sup- port user access except via its web in- terface, which you can use to configure network settings and the like. Natural- ly, you can’t do much with the router in this condition. It’s thus necessary to modify the router so it acts like a con- sole and you can use a prompt (like a DOS prompt, but for Linux) to enter and execute commands. An obvious way to do this is to use a telnet program, but the standard firmware does not support telnet access. In order to add this capability, you can download the firmware source code from the Asus website. Then you can add a telnet module to the source code and recom- pile it using a compiler that can also be downloaded from the Asus website. Fortunately for those of us who are not Linux wizards, there’s an easier way to do this. A modified version of the firmware is available in the form of ‘Oleg’s Firmware’, which can be down- loaded from http://oleg.wl500g.info/ #latest. That saves you the trouble of making the changes yourself. Be sure to download the firmware version for the WL500g Premium. There are vari- ous versions of Oleg’s Firmware for dif- ferent Asus models, and they are not necessarily interchangeable. The next step is to flash the new firmware. We recommend that you test the router for correct operation in its original condition before doing this. As usual, the guarantee is void if you make any modifications, so it’s a good idea to make sure that you won’t need it. Flashing is a simple process. First, open the router’s web interface in a browser window. At the right- hand end of the navigation bar, select ‘Firmware Upgrade’, and then select the file with Oleg’s Firmware. Flash- 10/2007 - elektor 59 HOME AUTOMATION ing takes a minute. If anything goes wrong, there is a recovery tool that re- stores the router to its original condi- tion. This tool is on the installation CD for the router. After flashing the firmware, you can use telnet to establish a link to the router. A program such as PuTTY can be used for this, but the standard Win- dows telnet utility also works. Launch telnet by entering the command ‘tel- net’, and then enter the fol- lowing string after the telnet prompt: o 192.168.1.1 Here ‘o’ stands for ‘open’ and 192.168.1.1 is the IP address of the router. This is the standard setting, but you might want to check it to be sure. If every- thing is OK, you will be asked to enter a user name and a password. The default values are ‘admin’ and ‘admin’. Now you’re logged in to the operat- ing system of the router. There is other alternative firmware available beside Oleg’s Firmware, such as OpenWRT (http://openwrt. org/). It works in a similar way, although OpenWRT has the advantage that it is not spe- cific to Asus routers. You could thus use the Sweex router de- scribed in the previous article or the Linksys WRT-54G, which is also popular. RS232 link open the case. As you can see from the photo, there is a connector on the board, or alternatively several holes for a connector. Two RS232 ports can be attached to this connector. The pin layout is printed nicely next to the con- nector. There are two ports (Port 0 and Port 1), each with a Tx line, an Rx line, a 3.3-V line, and a GND line. We recom- mend using Port 1, since Port 0 is used as a console and is thus in constant use. Incidentally, Port 1 cannot not Be sure to use the right IC here. The ‘standard’ MAX232 needs a 5-V supply voltage, but the router only provides 3.3 V. The circuit can be built on a small piece of prototyping board and fitted in the router case. Use solder pins or a plug to connect the converter to the router. You can use a 3.5-mm jack sock- et to route the serial port to the outside world, along with an adapter cable to convert it to a 9-way or 25-way con- nector. There’s not enough room on the rear panel of the router for a con- nector of this size. You can test the port by con- necting it to a PC COM port via a null modem cable and using a terminal emulator program to ‘listen’ to the serial port (set- tings: 115,200 baud / 8N1). Now you have a Linux port for your home automation appli- cation available on your router. This port answers to the name ‘/dev/tts/1’. Converter cable method As the router has two USB ports, you can use a converter cable to avoid solder work and any need to open the case. The only thing you have to check is that a driv- er is available for the converter you plan to use. We chose an AT- EN UC-232A, which costs about £ 1 0 (€ 15) and uses a Prolific PL2303 IC. A driver for this IC is included in Oleg's Firmware. However, you won't see much happen after you plug in the cable. First you have to launch the driver by typing the follow- ing commands in the Linux com- mand line interface: +3V3 © In 1 16V 16 o liC o TX DATA 11 RX DATA 1 0_ 12 15 ^ V + © C1 + U1 Cl- T1IN TIOUT T2IN T20UT RIOUT RUN R20UT R2IN C2+ MAX3232 C2- V in 1 Un o 16V 14 _7 13 Un cm 16V 16V RS232 DB9 ? 1 070376 - 1 1 Figure 2. This circuit built around a MAX3232 must be added to create a full-fledged RS232 port. JlrtMi I V.IHI.I ntwl nr l-iu In ■ mh Ih Phi mm+t. rtfill i4 ■ ^ h -Tnuti f li jQJi ■I IJ i.Lrl / IE I It ■ IF I Figure 3. Access via telnet. Now that you can work with the router via telnet, it’s time to let the router communicate with the outside world. This is necessary for the home au- tomation application. In the home automation system used by the author, RS232 is used for connection to the control unit, but the standard version of the router only has two USB ports. Here you have two choices. The WL500g has a UART, so you can create a ‘real’ RS232 port with a minimum of addi- tional hardware. The other option is to use a USB-to-RS232 converter cable. Both methods are described here. DIY method The circuit board is visible after you be used with early versions of Oleg’s Firmware due to an IRQ conflict, but this problem is corrected in version 7b and later. These ports use a signal level of only 3.3 V. In order to turn them into normal RS232 signals, you have to use a con- verter circuit with a MAX3232 such as the one shown in Figure 2. I insmod usbserial insmod pl2303 The insmod command adds an new module to the running op- erating system. Usbserial is a generic driver, and pl2303 is a driver for this particular IC. After these two drivers start running, the port will be visible with the name ‘/dev/usb/tts/0‘. However, these driv- ers will disappear if the router is re- started. Consequently, the commands must be included in a boot file, which is similar to the Autoexec.bat file you may recall from the DOS era. This can also be done with Oleg’s Firmware, with a file named /usr/local/sbin/post- boot providing this function. However, 60 elektor - 10/2007 About the author i Arthur Vogels wrote this article as part of his graduation project at Fontys Polytech- nic in Eindhoven, The Netherlands. This rounded off his course of study in Advanced Informatics. He completed his graduation project in the Technical Software Engineer- ing group of LogicaCMG in Eindhoven, which carries out innovative projects in collaboration with students of colleges and universities at various locations in the Netherlands. See www.workingtomorrow.nl for more information. you first have to create this file and en- ter the commands in it: mkdir -p /usr/local/sbin/ echo "insmod usbserial" >> /usr/ local /sbin/post -boot echo "insmod pl2303" >> /usr/ local /sbin/post -boot chmod +x /usr/local/sbin/post-boot After this, you have to store the file in flash memory. The command for this is: flashfs save && flashfs commit && flashfs enable Now you’re done with the RS232 part, and you can start building and connect- ing the home automation hardware. Home automation hardware The hardware of the home automation system is based on an interface mod- ule that communicates with the control unit via RS232 on one side and a net- work of I/O modules on the other side. The control unit can be a PC or a router modified for this purpose. Sensors, ac- tuators and motors can be connected to the I/O modules. You can use a second-hand PC power supply to power all of this. The router needs a 5-V supply, and the home au- tomation hardware usually needs 5 V and 12 V, so a PC supply is an ideal so- lution. This also makes a separate AC adapter for the router unnecessary. It’s best to use an ‘old’ AT supply instead of a newer-model ATX supply, since an AT supply is fitted with a real on/off switch. This completes the hardware. Software The router runs on a platform (MIP- SEL) that is not based on a standard PC processor, so it cannot run PC soft- ware directly. This means that the source code of the software first has to be cross-compiled to the router plat- form. You can download a tool chain for this (for use on a Linux PC) from the Asus website (http://dlsvr01.asus. com/pub/ASUS/wireless/WL-300g/ toolschain323_tar.rar). Naturally, this presumes that you have a Linux sys- tem available, such as Ubuntu (http:// www.ubuntu.com/), which is a very user-friendly Linux distribution. The software is written in C + + using KDe- velop as the development environment. The nice thing about this is that it is all freeware and available as open-source software. As the software is designed to work with the DIY hardware components, it is not described in detail here. One of the interesting elements in this con- nection is the web interface used to control the system. The router is al- ready connected to a home network for its usual job as a router, so a web page on the router is the most conven- ient way to give the user access to the home automation software. One way to implement this is to write a PHP page that reads and writes text files from and to the database layer. The only other thing you need is a PHP-capable web server that can run on the router. Such a web server can be installed by following the procedures in an excellent guide available on the Internet at http://www.macsat.com/ macsat/content/category/3/13/29/. First follow the procedure for install- ing the IPKG package, and then follow the procedure for installing the THT- TPD web server. It’s convenient to first configure the router for a fixed DNS before perform- ing these procedures so it can find the server with the package lists. This can avoid a lot of problems with download- ing IPKG package information. Once the web interface is installed and running, you’re all set. Now you have a router running control software for an attached home automation sys- tem, with a user interface. It’s by no means the only alternative use for a broadband router, but it is one of the nicest ones. ( 070376 - 1 ) 10/2007 - elektor 61 INFO & MARKET SOLARTEAM Astounding More ingenuity in solar Elkin Coppoolse It all started in September last year. Since then over 40,000 man-hours have been invested on the solar car by Solar Team Twente. They have picked a daring design, based on the positively phototropic behaviour of sunflowers. Some very creative brainstorming took place to find the best possible performance for the World Solar Challenge 2007 in Australia. Tilting solar panels with Fresnel lenses aim to maximise the yield of the sun's energy in this solar car. The Twente One with tilting solar panels The changed regulations for the World Solar Challenge 2007 [1] have made it more exciting to design a poten- tially winning car. Many of the participating teams will focus on a car that is as light as possible and which has a low air resistance in combination with a high efficiency. Solar Team Twente [2], however, has chosen a concept that is significantly different from any of the other designs. It's a car that will stand out in the race, and has an inno- vative design that will improve its chances for a podium finish. The application of two innovative techniques has made the incoming energy a focal point for a poten- tially winning design! The solar car made by Solar Team Twente, the Twente One, has a tilting solar panel and a special lens system. Well now take a look at the most im- portant features of each of these parts. CAD drawing of the unique construction using Fresnel lenses Tilting wing The 2000 or so Gallium Arsenide triple-junction solar cells are on the top of the car, which we've termed the wing. What is noticeable about this wing is that it can tilt along its longest axis. The frame of the wing is made out of aluminium and was designed to perfection using the computer program Ansys [3]. During the race the team drives from North to South Aus- tralia. During the day the sun will therefore move from the left to the right of the car. When the solar cells are perpendicular to the sun they will absorb the most energy. The refractive index will have less of an effect and the reflection of light from the coating will also be less. The solar cell will then take in more of the energy from the sun's rays. Having the wing tilt towards the sun keeps the sun at right angles to the panel for longer and hence increases the time during which the maximum power can be extracted from the cells. The tilting is a simple principle as such, but the imple- mentation in the car was a mechanical challenge. The 62 elektor - 10/2007 Semi-conductors wing rests on roll bars that are mounted to the chassis of the car. With the help of rod-ends in the wing it becomes possible to make it tilt over the brackets of the chassis. This is not done by the driver, however. An actuator, con- nected to the chassis and the wing, adjusts the position of the wing towards the sun. This actuator is controlled us- ing PWM from a board that also takes care of the whole dashboard. There is an engineer in the support vehicle who decides what the position of the wing should be. The required value is sent to the car electronics, which then adjust the panel to the correct position. Fresnel lenses Fresnel lenses are special types of lenses that can also be found in overhead projectors, for example. The lenses used for the Twente One differ from normal ones in that they have a focal band instead of a focal point. Placing the solar cells underneath the lenses increases the light in- tensity. The new regulations limit the area of solar cells to 6 m 2 . However, the use of the lenses has made the collect- ed power equivalent to that of a panel of about 7.5 m 2 ! As a result of the 'movement' of the sun, the focal band will not always fall onto the solar cells. To overcome this, a system was designed that can move the solar cells un- derneath the lenses. The cells are mounted on a carrier that moves over a spindle mechanism. Simply put a large bolt connected to an electromotor. This motor is driven by a board designed specifically for this task. A number of photo diodes connected to a microcontroller are used to determine where the sunlight is most concen- trated. This information is used in a PID controlled system to make the motor move the carrier to the correct position. The system operates completely autonomously. Solar Team Twente has applied for a patent on this technique. The technique is new and innovative and it surely has a lot of promise in the future. The solar cells are made from GaAs (Gallium Arsenide) and have an efficiency of over 27%. They have an inter- nal protection system: the cell with the smallest yield deter- mines the current through the rest of the panel. To prevent the whole panel from becoming unusable because of a single broken cell, each cell is fitted with a bypass diode in parallel. This also stops the yield from dropping too much when a shadow covers part of a panel. Batteries have been used to improve the efficiency of the power collection. Maximum power transfer is achieved with the help of Maximum Power Point Trackers (MPPT). The devices make sure that the optimum voltage and cur- rent is used to extract energy from the solar panels. When the solar panel is loaded with a small current, the voltage will be higher, but the power transfer (the product of the two) will be low. When the panel is loaded with a high current, the voltage will drop and the power will again be low. The optimum is somewhere in between and is called the 'maximum power point'. The MPPT determines several times a second where this point lies and delivers a volt- age and current that is dependent on the light falling on the panel. The next circuit in the electronic system is the start-up box. The most important function of this box is the 'pre-charging' of the car. This means that when the car is turned on, the battery is initially connected via a resistor to the electronic circuits. This is needed because nearly all of the circuits in the car have a large suppression capacitor at the supply input. The combined capacitance of these capacitors is so great that if the car was turned on with an ordinary switch, an enormous current would flow. This would be enough to fuse the contacts of the switch or relay together and it would be impossible to turn the car off again. 10/2007 - elektor 63 INFO & MARKET SOLARTEAM Chassis of the Twente One Batteries More than 5 kWh of Lithium Polymer batteries have been connected in series to provide the energy for the car. The danger of putting the batteries in series is that some may get out of balance with the rest. When a battery is out of balance, its cells are charged at a different level to the Nice to know The power used by the solar cars to travel at 130 km/h is about the same as that used by a household electric kettle or vacuum cleaner. If you convert the power used by the electromotor into horsepower, you get about 7.5 hp. An average car contains about 1500 metres of cabling inside, the Twente One has only 100 metres. The Twente One has 29 'computers', including the onboard computer, motor controller and battery management system. The batteries in the solar cars have a capacity equivalent to that of 2200 mobile phone batteries. others. That also results in a different voltage and inter- nal impedance. And if this impedance limits the current it could result in the cell being charged the wrong way round. In extreme cases the cell may even explode or catch fire. The Battery Management System (BMS) moni- tors all cell voltages and gives an alarm if any cells ap- Solar Team Twente hopes their tilting wing concept will get them on the winners' podium. pear to become undercharged or overcharged. The car is said to use '(energy) regenerative braking'. The batteries are charged by the solar panel when the current consumption of the motor is lower than that can be pro- vided by the panel. The batteries are mounted onto two sturdy trays. Ventilation is provided by an NTC controlled fan. The control is part of the BMS. There is also a shunt resistor in the battery connector, which is used by the BMS to keep track of how much charge has gone into and come out of the batteries. It needs this information to predict when the batteries are nearly discharged or fully charged. Communications To control everything requires reliable communications between all modules. For this we've used the CAN bus. All control buttons on the dashboard are connected to this bus. However, not all modules come supplied with this useful protocol, and several boards had to be designed to pass on the control signals. During the race there is a need to analyse a large amount of data from the solar car. In the new car there are nearly 200 measurement signals on the CAN bus, which can be inspected by the engineer in the support vehicle. (The temperature of the tyres is measured with infrared sen- sors, the temperature of the batteries with thermo-couples, the load on the shock absorbers with potentiometers, the values from the motor come via the motor controller, etc.) A complete arsenal of sensors is therefore available in the car. To process all these signals properly we've used CRONOS from IMC [4]. This clever device provides all the required inputs and outputs, which are controlled via DSPs. Many of the calculations can be programmed and the resulting data is sent wirelessly to the engineer. From these, the optimal driving conditions can be determined. This completes the circle and the new information is sent back to the Twente One. Speed A CSIRO Surface motor [5] is used to convert the gener- ated electrical energy into motive energy. This is a 6 kW electromotor with a permanent magnet, connected inside the rear wheel. The motor is virtually directly coupled over the complete revs range. Because the rear axle is driven directly there is no energy lost in the transmission. The effi- ciency of the CSIRO (98%) is a bit higher than that of the NGM motor (94%) that was used by the previous Twente team. This motor has already proven itself in the World Solar Challenge in 2005, so is perfect as a spare. The CSIRO motor is supplied in kit form: a coil, two mag- netic rings and a sensor board for the Hall effect sensors. The design had to take account of the electronic aspects as well as all the mechanical and strategic aspects. Quite a challenge! It is interesting that Solar Team Twente has used the mo- tor in a smaller wheel than the one it was intended for. Instead of 16", it was made to fit into 14". When the revs of the motor increase its efficiency also increases, which results in a more efficient car. A consequence of the small- er wheel is that the car's top speed isn't very high. Notes from the editor There are of course many other teams hard at work. Stu- dents from all over the world are racking their brains to 64 elektor - 10/2007 Two concepts compared Dimensions (LxWxH) Weight (excl. driver) Number of wheels Innovations Speed Solar cells Motor Nuna4 Twente One 472 x 1 68 x 1 1 0 cm 500 x 1 80 x 140 cm <_ 1 90 kg 3 < 230 kg 3 Very light construction Tilting solar panels Lens system with Fresnel lenses and moveable solar cells Not given 2318 GaAs triple-junction cells Efficiency >26% InWheel Direct Drive Electromotor Biel/CSIRO Average 75 to 90 km/h Top speed 1 20 km/h 2073 GaAs triple-junction cells Efficiency > 27% InWheel Direct Drive Electromotor CSIRO/NGM Steering Bodywork Suspension Tyres Brakes Air resistance Efficiency 97-99% Carbon fibre steering wheel Carbon fibre and Twaron (aramid fibre) Integrated composite roll cage Front suspension: Double wishbone suspension made from carbon fibre and aluminium Carbon fibre shock absorbers Lightweight aluminium rims Ceramic ball-bearings Rear suspension: Carbon fibre horizontal wishbone Aluminium mounting points Michelin Solar Radial 16" (slicks) Front: Lightweight, custom disc brake with Brembo brake pads Lightweight aramid brake lines Rear: Regenerative braking using the motor 6 times smaller than a normal car Efficiency 95-99% Steering wheel made from aluminium tubing, roughly A5 sized Carbon fibre sandwich construction (body) Box construction using aluminium plate Roll bars made from chrome-molybdenum steel Front suspension: Double wishbone suspension made from chro- me-molybdenum steel Horizontal racing shock absorbers Lightweight aluminium rims Ceramic ball-bearings Rear suspension: Trailing-arm construction made from chrome- molybdenum steel Bridgestone/Maxxis radial 14" (slicks) Front: Disc brakes Pneumatic brake lines Rear: Regenerative braking using the motor 5 times smaller than a normal car Telemetry WiFi connection to support vehicle Wireless connection to support vehicle come up with a winning design for their car. We've com- pared the specifications of the Twente One car with those of the team from Delft, the Nuna4, which can be seen in the table below. The cars are well matched and we won- der which of the designs turns out to be the better one in the competition. In the next article we have a report of the race itself and give an account of how well the cars did in practice. Now we just have to hope that the innovative designs show their full potential and result in a place amongst the top finishers. ( 070468 - 1 ) Web Links [1] www.wsc.org.au [2] www.solarteam.nl [3] www.ansys.com [4] http://www.imcdata-berlin.de/en/ [5] www.csiro.au 10/2007 - elektor 65 INFO & MARKET REVIEW Inexpensive ARM Ki ARM yourself with a new microcontn Paul Goossens Embedded-system designers work in a very dynamic world, and a wide range of products are dependent on their efforts. However, the average embedded-system designer is not so dynamic when it comes to selecting a microcontroller. He tends to remain loyal to a specific type. But for anyone who is considering switching to a modern ARM7 microcontroller, iSystem has put together an inexpensive ARM7 kit. LPC2138 features • ARM7TDMI-S microcontroller • 60 MHz clock rate (using internal PLL) • 512 kB flash program memory • 32 kB RAM • Two 8-channel, 1 0- bit ADCs (2.44 jL/s conversion time) • Two 32-bit timers • six PWM outputs • two UARTs • I2C, SPI and SSP interfaces • 9 interrupt inputs • 3.3-V supply voltage • All I/O lines 5-volt tolerant The predominant trend in electronics is to combine a vari- ety of functions in a single piece of equipment. This trend is actually nothing new. As early as 20 years ago, even the simplest thermometer was fitted with a clock to keep it (and its owner) current. All these extra features (useful or other- wise) require additional processing power. The latest trend is to equip everything possible with USB, Bluetooth, WLAN, and so on. You see these new 'extras' in mobile phones, PDAs, and other types of equipment (usually bearing three-letter abbreviations). It won't be long before the marketing wizards will also want to have these modern goodies in their newest thermometers. After all, they sell better that way. Is 8 bits no longer enough? A modern 8-bit microcontroller is adequate for most em- bedded applications. The speed of these controllers has been boosted considerably by techniques such as reducing the number of clock cycles per instruction. You'll also have a hard time finding an 8-bitter nowadays without internal flash memory or RAM. The component count can be kept nice and small, production costs can be minimised, etc., while embedded-system developers can still use their old familiar tools and expertise to get the job done. USB, IrDA, and the like can all be handled by an 8-bitter as well. Unfortunately, in most cases only a small amount of memory is left over, and the processor is nearly pushed to its limit. This is not necessarily a problem - until the time comes to add a few more functions to the equipment. In many cases, the only option here is a complete re-design. It doesn't cost much more now to use an ARM7 micro- controller than it does to use a modern 8-bit microcontrol- ler. Creating a new design with 'room to grow' thus offers an inexpensive way around the generally dreaded total redesign.. New tools If you're interested in ARM7 microcontrollers, you'll be glad to know that iSystem has put together a complete develop- ment kit for ARM7 microcontrollers that goes by the name IF-DEV-RTK and sells for around £50 (€ 70). The software in the package includes a GNU ARM7 compiler, a real-time debugger and a project manager. There is also a USB to JTAG interface and a small micro- controller PCB fitted with an LPC2138, which is an ARM7 microcontroller from NXP with 512 kB of flash memory and 32 kB of RAM. The board has only minimal I/O hardware, consisting of a single LED driven by one of the microcontroller's I/O pins. However, all essential signals are available via headers. This makes it easy to add your own I/O circuitry. Use There's not much we need to say about installing the soft- ware included in the kit. It goes the way it should, which means simple and straightforward. After the software has been installed and launched, the winIDEA development environment appears on the screen. The capabilities of this program are exactly what you would expect. You can edit source code, compile it, download it and debug it - all with the same program. Compiling the first sample program is easy. Just select 're- build' in the 'Project' menu. Any problems that occur during compiling or linking can be viewed in the 'output' window. If everything goes without a hitch, the program will down- load the new software directly to the microcontroller and put it in the 'reset' state. You can the press the F5 key to start running the software in the microcontroller. You can stop and restart the microcon- 66 elektor - 10/2007 cue -r-rifc 0 &• r * i* P * cto > £ «. ' h n rf 4 I mr* Weft. iu niF.r . 1 1 ■ «re .* .. . tUUftf ••• *■!**-■■ I 1^ il tFlifldl . II Ml* I mi ■ Ith m nil pn«- ■ Hi ■ LiA p* iM t >H iriUPftlfimtT * iN-l iMI ill ■, i ;T ■ j-^ , n Lrurmni . \iP5NrA5Wn* t— ■ HT^iirt' MNH PP* 'n p Ml an ■CP'. iiir.M’I’.m mb Im, '*ip ^[iBliCTMOTtufliirriPiiA -Wi “>7: i iFPTW' KP^iSpAa.1 aiai a ^LljJMAJAVh^Dci UMaji'.i IvriTWin ■i;n^rii*' '±3. LiDNI ■ + ■ . 111 hhlH lrMiin Fll 1 II# ^ i 1 in I r t > HI i , ml P j ip ■> fl I i* lamxi m im it i ip Hi vaapi *aiap 1 L-ftll l il I* ll.lUnHlM HH K1I Hy«l ipp Tl.tMEP - -pin annul : ■ ■*> . Urii .-. i JLItll i m ~ ■ I Pllil I ril ,a „ r . ., m‘„ VUA-kWl itorn—iHmtou iJi^i |i • ,| *.>VI 1 II |KW«'lnl|4CWvnP ITLI-ltl ■ im 'PH . troller whenever you wish. Single-step program execution is also possible. This can be done at C level or assembly- language level. You can also view and modify memory contents. All this is what you expect to find in a modern development system. Another nice feature is setting hardware breakpoints. This does not affect the operation of the microcontroller. Pro- gram execution is stopped automatically when a breakpoint is reached. Hardware breakpoints are possible thanks to the Embedded ICE interface of the ARM7 microcontroller. Sample programs The kit comes with two sample programs. The objective of both of them is to cause the LED to blink and demonstrate a large variety of routines. These routines show how easy it is to debug software using winIDEA. The main difference between the two sample programs is how they cause the LED to blink cheerfully. In the first sam- ple program, the wait time is determined by a large FOR loop. By contrast, the second sample program uses an inter- nal hardware timer and an interrupt to drive the LED. Comments Although we were quite satisfied with the development kit, there are definitely a few comments we feel obliged to make. During our experiments, we occasionally received a mes- sage advising that the debugger could not stop the CPU, which is an annoying 'obstacle'. The only recourse in this case is to issue a reset via a button on the toolbar. This forces the microcontroller into the normal reset state. Af- ter this, we could continue debugging the microcontroller in the usual manner. We were not able to determine the cause of this problem. Fortunately, this situation occurred only very sporadically, and in any case it's something you can live with. Our second (and last) criticism relates to loading and sav- ing projects. We spent a fair amount of time trying go fig- ure out how to load and save projects. After a bit of sleuth- ing, we found that each workspace is linked to a project. When you open a new workspace, you automatically open the associated project. Saving a workspace causes your project settings to be saved at the same time. This is rather non-intuitive at first. Once you know how it works, it's not a problem. DIY If you would like to build the hardware yourself (despite the low price of the kit and the fact that it uses small SMD components), you can. The manufacturer offers a free download on its website under the name iF-DEV SBK, where 'SBK' stands for 'Self-Build Kit'. It contains all the schematic diagrams, component lists, PCB layouts and firmware for the USB-JTAG interface and the microcontrol- ler board. This download also includes all the software and documentation. The 32-bit era If you would like to try out an ARM7 microcontroller, wheth- er simply out of curiosity or for some other reason, this de- velopment kit is definitely worthwhile. Thanks to the includ- ed USB-JTAG interface, you can also continue to use it long after you have completed your first experiments. The same applies to the development environment. It is certainly suitable for developing small to medium-sized projects. Not bad for a development system costing around 50 pounds! (070240-1) Web Link http://www.isystem.com/ifdev iF-DEV RTK contents • USB-JTAG interface • complete toolset and documentation on CD • ARM7 microcontroller board • USB cable • Quickstart guide 10/2007 - elektor 67 INFOTAINMENT LABTALK Data Books Farewell to paper copies Luc Lemmens At the time of writing, we're one month away from a change of premises for Elektor Electronics' head office. After around 40 years, we're leaving the town of Beek, Limburg (Netherlands) and moving to Limbricht, near Sittard. And as with every relocation, it's a good idea to take as few things as possible with you to the new location and throw away as much as possible before the packing starts. This is sometimes accompanied by a bit of heartache and/or pangs of regret, but you have to be realistic. If something has been sitting unused in a cabinet or on a bookshelf for a few years, the chances that you will need it sometime later on are vanishingly small. So why should you bother to pack it and take it with you? Still, it's not easy to throw so many things away, especially when you think about how much you paid for them. Our collection of data books is one of the victims of our recent house- cleaning frenzy. They were once the 'bibles' of electronics, but in light of the fact that they have vary rarely left the shelves in recent years, it's understandable that no space was allocated for them in our new premises. There was a time when companies found it rather difficult to obtain data for components such as ICs, transistors and diodes, and hobby- ists could only dream of putting their hands on such books. In some cases, data books were actually quite expensive, but over the years they followed the same trend as other products, such as microcon- troller software development tools. At first they were nearly unafford- able, but later on they were free of charge - at least for commercial users. After the introduction of data CDs, many data books appeared in the form of CD-ROMs, which are much less expensive to reproduce and take up much less space. At that time, the idea of throwing away the real books and installing a PC with a hefty CD jukebox in their place was discussed in the Elektor labs, but nothing ever came of it. However, with the advent of CDs the contents of our bookcases were updated and augmented much less frequently than before, for the simple reason that semiconductor manufacturers made less and less use of printed media. Nowadays everyone can E?i«i High-speed CMOS K lhAf /A HG/HC; T/HCU 1C06N easily find individual datasheets on the Internet. Every manufacturer (with a few exceptions) has its own website, where you can down- load complete data, application notes, errata sheets and the like to your PC with a simple mouse click. You can always find the most recent data on the website, so you no longer have to worry about whether changes have been made to a component. Many websites also show you right away whether the component concerned is still in production, so you can quickly decide whether it is advisable to use it in a new design. Given all this, what's the point of having an old- fashioned data book in the lab or even in your hobby room? One of the reasons to want a real book is purely practical in nature. Nothing else is as pleasant to read as an 'old-fashioned' printed page. Besides this, you can easily scribble notes on paper or add your own comments. A datasheet for a simple component consists of just a few pages, and if you wish you can print it out, staple the pages together, and voila: your mini-book is ready for use. With more complicated components, the 'datasheet' can easily amount to several hundred pages, and the amount of paper and ink necessary to print it out is often reason enough to abandon the idea - not to mention the trouble it takes to convert such a thick pile of paper into a handy reference document. In such cases, a real book certainly not be a luxury, but of course it is understandable that distributing PDFs is a lot easier and less costly for semiconductor manufacturers. Another reason for keeping old data books involves a completely dif- ferent aspect, and it relates primarily to discrete components such as transistors. For example, take the data sheet for the BC557, a gar- den-variety transistor. In the 1987 version of the Philips data book, the datasheet for this transistor included 15 characteristics charts documenting the performance of the device with various parameters. The 1999 version of the datasheet for the same transistor from the same manufacturer has a grand total of one chart: a plot of h FE ver- sus / c . Admittedly, this is not exactly a transistor that is intended for top-end analogue applications, and it is questionable whether the BC557 deserves such a wealth of data, but this dilution of data is a trend that has become increasingly common in transistor datasheets in recent years. Are people no longer interested in the data, or are discrete components in gen- eral no longer interesting? The company that empties our paper skip here was not particularly enchanted with our clean- up campaign. The skip was full to the brim with books and so heavy that it took three people and a lot of effort to roll it from its position. The tip- ping mechanism at the back of the lorry also had visible difficulty lifting the skip, but in the end the entire library disappeared into the lorry container. Did we really throw everything away? No, a few of us kept aside some special items and added them to their personal libraries, in some cases for nostalgic reasons. Perhaps they will become valuable collector's items some time in the future! ( 075086-1 1935 68 elektor - 10/2007 Professional PCB Supplier i\vn M jNmVSll lit** URL: WWW.ElPCB.COm Email: sale5-@ezpcb.cqm Tel: +80 109 1002 1704 HOI Up To 50 Layers, 2.5m\ T/C, 0.1 mm Hole Size Olher Products: Spends. Keypads, Frontpanels. Flex PC6, Enclosures. Turnkey Services INTRINSIC FIDELITY .1ST NO ti ■ "is. i sn Ti . ' J T TIPS TWEAKS PROJECTS DIY audio at its best! 12 monthly issues for only $63 US Subscribe at www. audioXpress.com i Tel: 01635 40347 N i : v 1 1 1 j r EJi:i:l riiiki::^ Llii Fai:aiKJ 5 3 &l 43 hirctef HKri H -mbuy ■ m: h^lrr:. iltifiii'vh i-v.h:: ■- * 1 | ■ §* ■ m ■ 9 4 4 4 ¥ 9 I i 9 « g I 1 | ■ ■ ■ | q 4' P 1 i ■ «■ 4 4 m 4 li + 9 g A i 'fl # 1 W i i i 9 « * 9* ifl * 9 H ■fl r 4- 9 Hr - ■ 9 s Hr #■ A •fl « * r r m fli i B ■• fj I jl n .jp n •fl 9 1* C 3 * + ■ fl •fl if 4 * 4 m m 9 * A m m I* 4 A * 4> 4 ■ u m V g ■ "P 1’ ■ * if 4 4 A * 9 4 ■ # 4 ■ m m ■ ■ 9 w * - ■ ■ ■ ■ fli 9 ■ 9 -I* ■ mi 9 ■■ m fl •9 B **1 -- 1 * * * ■- m ■ + 9 ■ ■ m ■ 4 # ■ ■ >4 # A ■ 9 ■ 9 9 ■i ■ ■ ■ ■ fli I ■ h i , it Figure 5. Using the ECIO for project development with a prototype board. Next time In the November 2007 issue we will look at how you can use the ECIO to develop a fully operational Programma- ble Logic Controller (PLC). ( 075076 - 1 ) Figure 6. An ECIO with adaptor board and E-blocks. 10/2007 - elektor electronics 75 INFOTAINMENT PUZZLE flAYAnAkfl P uzz le with an f IvAOvJviALI electronics touch Hello all Hexadoku fans, here's another exercise to keep the odd brain cell active. Eminently suited for a rainy day (or two) in Autumn! Send us your solution and enter a prize draw for one of the prizes: an E- blocks Starter Kit Professional and three Elektor Shop vouchers. The instructions for this puzzle are straightforward. In the diagram composed of 1 6 x 1 6 boxes, enter numbers such that all hexadecimal numbers 0 through F (that's 0-9 and A-F) occur once only in each row, once in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle and these determine the start situation. All correct entries received for each month's puzzle go into a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. The puzzle is also available as a free download from our website. SOLVE HEXADOKU AND WIN! Correct solutions received enter a prize draw for an E-blocks Starter Kit Professional worth £248.55 and three Elektor SHOP Vouchers worth £35.00 each. We believe these prizes should encourage all our readers to participate! The competition is not open to employees of Elektor International Media b.v., its business partners and/or associated publishing houses. PARTICIPATE! Please send your solution (the numbers in the grey boxes) by email to: editor@elektor.com - Subject: hexadoku 09-2007. Alternatively, by fax or post to: Elektor Hexadoku Regus Brentford - 1000 Great West Road - Brentford TW8 9HH United Kingdom - Fax (+44) 208 2614447 The closing date is 1 November 2007. PRIZE WINNERS The solution of the july/august 2007 puzzle is: LVC4ZM1 . The E-blocks Starter Kit Professional goes to: Andy Hartley (UK). An Elektor SHOP voucher worth £35.00 goes to: Manne Tallmarken (SE), Rotondi Silvia (IT) and Sudhir Kumar Gupta (IN). Congratulations everybody! 5 4 7 2 F 6 E 0 A D C 3 F 2 4 D 1 9 3 A 0 7 B F 6 2 D 1 4 C 5 9 F 8 C 3 2 1 B 3 9 F 0 D E 8 C A 3 B D 7 6 7 1 E F 5 3 7 6 3 8 C E B 0 B 9 5 F 2 7 4 A 1 C 5 A 9 4 6 0 1 C 4 E 2 9 A 8 B 7 A D E F 2 9 4 C D 3 D A B 5 9 E C 0 D 1 3 6 8 B F (c) PZZL.com 2 5 A P 9 R 0 3 D C B 4 0 S H 1 Z W K Y M E 7 N 1 U J G 6 X T F Q V L 8 D 6 L U 3 T 1 Q R 5 9 X M G J A F 2 C H Z B 8 P Y 4 K S 0 V 1 E 0 7 N W 0 8 H 4 Z E G W T 7 A 0 V 6 K U Y B D 1 3 J 1 F P L C Q N R 5 X M 2 9 s 7 X 0 M K S L P 6 H Y 2 8 N C 9 1 Q V 5 A 0 U T B 3 W Z E F G J 1 R D 4 G Q N B J 1 1 E F 8 U V 4 5 D P 3 L 0 S R 9 X W 7 T 2 A H M Y 6 0 K C Z F C W V Y 1 Z S K N J M E 0 T X 7 R L 6 Q G 2 4 9 8 D 0 5 1 U P H 3 A B H 1 D Y N 4 B J X T 2 U S M 0 Z C V G E K 8 P A Q 5 L 1 0 3 F 9 7 6 W R 5 1 Z L M Q K C A D 0 8 H U 2 Y 4 9 W F T R N 1 6 G S B P 7 X 3 E 0 J V X V 8 C 2 9 4 5 Z M G R W E Q 0 B 6 7 1 L U 3 Y N A F J T 0 K D P 1 s H 0 P E T W B Q 9 S L N 6 X F 3 7 A 1 5 M J Z C V H Y R 4 D K 8 U 2 1 G 0 J R 3 7 0 G W H Y 1 F E 1 P L K T 5 X D S 0 6 2 8 9 V M C U B Z A N 4 Q K A 6 S F U V 1 3 0 P 7 D J N R G 8 0 B 4 Q 9 H 2 1 X E Z W M 5 T L Y C S W 1 5 B F J G 0 Q T P 9 4 Z 1 2 C 6 7 N 3 R 8 M H E X A D 0 K U Y V L A 3 V 1 7 8 F 0 M W H N R X P L U S T G 2 Y D K 0 B 5 9 1 6 4 Q J C Z E 9 4 J N G 0 6 D U B Z L 5 8 1 M E Y Q X C W H 0 K 7 1 V 2 P A R 3 S F T E L K Z U M C X 1 R 4 5 A D B G N 3 9 P V F S J T Q 0 w 8 Y 0 1 6 H 2 7 P 2 C 0 D H E Y 8 3 S 1 Q K V T 6 7 A 0 1 5 4 U L J G F R Z 9 B N W X M 6 Y T Q R X 9 V 2 K 7 A J W F 0 0 H Z L B M 1 E 3 C 4 U S N D G 1 P 8 5 3 0 S K 5 D M 2 J Y R F G H 7 V 0 1 E U P 1 Q 9 X W A L B 8 N C 4 z T 6 T M X A 1 N U 1 C P W Z B 3 6 8 S K 4 V 0 H J L 5 F Q Y 9 G R 7 D 0 E 2 Y H 9 F L 2 0 B 5 S Q G Z T E C M D 1 N 0 X A 3 1 6 P R 7 4 W V 8 u K J 1 U 7 E Q P 8 N 9 0 L K F R 4 2 5 X M W 6 C Y D Z V 3 T J 1 H 0 S G B A V G B 6 C J H T 4 E X 3 L 0 Y W P A R 8 F 7 K Z 0 D N 2 U S Q M 5 9 1 1 W Z 4 R 8 0 D A 7 6 V 1 N 1 9 J Q U S 2 5 T G B E K 0 H M C 3 Y L X P F 8 T 2 1 4 V Y 0 N 9 K J 7 Z A Q W P B 3 E S M X D 0 U 6 L 5 C 1 R F H G R B G 9 S 5 T L V U C 0 Y 2 M 4 H N 1 Z D K W 6 J 1 7 3 F 0 E 8 X A Q P Q 0 F 3 6 L 7 8 W 2 M D C B G E 1 T P 9 Y 4 0 1 R X H N K A Z S V J 5 U N 7 1 W P A R F G X E S 6 9 U 5 8 0 J 0 H L V C 4 Z M 1 Q B 2 T Y D 3 K Z D M X 0 C 3 6 P 4 1 H l< V R F L J U A G 2 5 Q W S T 8 Y E 1 0 9 B 7 N U J Y H E K 5 Z Q A 1 B 3 1 X S D 0 8 T 7 N F R V P 9 C G 2 L 4 W M 6 0 M F U 8 H Y N R 1 J 3 C T 7 W D K G 2 4 X V 0 5 S E B P 1 L 6 A z Q 0 9 4 K R J V 3 A M B G D Y P L s 6 9 E H Q 8 1 Z 0 F N 1 0 W T 7 2 c 5 U X B S Q G X W P U 0 Z 5 T 1 C 0 3 J F N R 9 6 E M A 2 Y 7 4 H V L K 8 1 D 1 9 5 D T 6 S 7 E F 0 W 2 Q 8 H V M Y C 1 A L G U R Z K X J P N B 4 0 3 C E 0 2 A Z X K L 1 6 Q U Y 5 N R 4 3 J W P B 7 G 0 8 D V 9 s H F T M 1 L N P 0 1 7 2 4 H V 8 9 0 A 1 B X Z F K u D T S C M 6 5 3 Q J W G E R Y 76 elektor - 10/2007 RETRONICS INFOTAINMENT The Revophone (1922) A W Simpson I first experienced a crystal set as a child in the late thirties when my father dug out his old set to show my brother and I. The re- sult was unforgettable, voices and music coming out of a small wooden box via, what I thought at the time, a very heavy pair of headphones. This was especial- ly fascinating as we had neither a wireless (radio) nor a gramo- phone (CD player). I particularly remember hearing several pro- grams fading in and out, quite loud and sometimes two or more at a time. Presumably we were then listening at dusk. A few years ago I rediscovered my fa- ther's set and again was delight- ed by its performance and sim- plicity, especially as crystal sets don't use batteries. I have been researching crystal sets ever since. However I have chosen here to describe a simpler crys- tal set, the Revophone, which I recently obtained. The set, complete with a pair of 4000 ohm headphones, is in pristine condition and appeared to have had little use and prob- ably has remained untouched for over 80 years. It is built into an elegant mahogany box, and both the box and the headphones are labelled to indicate that they are approved by the Post Mas- ter General, no less. Confirma- tion of his approval is indicated by the BBC symbol as shown in the photograph. Inside the box is a variable inductor, connect- ed between the aerial (antenna) and earth (ground) terminals. This can be adjusted using the two rotary switches to produce series resonance with the aerial capacity at the frequency of the required program. It consists of a cylindrical coil of wire 55 mm in diameter and 85 mm long with twelve tapping points. These are connected to two six-posi- tion rotary switches mounted on the front of the box. The tapping connections to the coarse switch are widely spaced and cover roughly two thirds of the length of the coil. The connections to the fine control switch are spaced closer, allowing smaller chang- es in the coil inductance. The two rotary switches between them give an 11:1 range in inductance from 30 to 350 |iiH, which, with a typical outside aerial, cover the medium wave band. The only other component in the set is the crystal de- tector. This is essentially a point con- tact Schottky diode and is connected between the aerial and the head- phones. The oth- er head- phone lead is connected to the earth terminal. The crys- tal itself, shown on the left, con- sists of a lump, roughly 5 mm in diameter, of polycrystalline synthetic galena (PbS) soldered in to a small brass cup using a low melting alloy (70 °C) called Wood's Metal. The point contact is made using a spiral of fine wire, called the cat's whisker, which is mounted on the end of an insulated rod to enable the user to place the tip on any part of the surface of the crystal. Only certain regions give good recti- fication and it generally takes some time to find a suitable point to give good reception. The left hand side of the box is open to hold the headphones when not in use. A list of instructions and a diagram of a suitable aerial are given inside the set lid. The rec- ommended aerial shown would have been too long at the time to be legal and would not have pleased the above mentioned Post Master General! He insisted that the total length of wire used to make the aerial, including the down lead, should not exceed 1 00 feet (30 m) As soon as the set was delivered I immediately tested it by tem- porarily bypassing the crystal/ cat's whisker arrangement with a modern point contact germa- nium diode (OA91) and con- necting it to an aerial and earth system. I soon picked up the four local AM stations loud and clear. The loudest program was pro- duced by a 1 000 watt transmit- ter 24 km away. I then removed the modern diode and used the original crystal detector and, af- ter quite a time, again received the local stations. Not bad for an 85 year old electronic device! Surprisingly I, and other crystal set enthusiasts, have found the galena/cat's whisker combina- tion can give a slightly better performance than any modern diode. However, an appropri- ate diode is much preferred as finding a suitable position for the cat's whisker can take ages. Also the slightest vibration or knock loses the precious connection. It is perhaps worth noting that no present day radio has any chance of surviving for 80 years: maybe not even 8 years! Also even when brand new, if dam- aged it is impossible to repair, especially if it is a digital radio. In sharp contrast, a crystal set can generally be repaired with a Swiss Army Knife! If any of the many future disasters that the 'experts' are constantly predict- ing do occur — such as a large asteroid hit or Yellowstone Na- tional Park caldera's long over- due explosion — having a crys- tal set could be very useful for the few survivors! Any batter- ies that remained would not last very long and the electromag- netic shock wave would proba- bly destroy all but the old valve (tube) radios. Perhaps the world governments should provide all village elders (local politicians) with long, medium and short wave crystal sets! ( 075088 - 1 ) Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are welcomed; please send an email to editor@elektor.com 10/2007 - elektor electronics 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 56 ATC SEMITEC LTD www.atcsemitec.co.uk Thermal and current-sensitive components for temperature control and circuit protection; • NTC Thermistors • Current Diodes • Thermostats • Re-settable Fuses • Thermal Fuses • Temperature Sensors Call today for free samples and pricing Tel: 01 606 871 680 Fax: 01 606 872938 AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £15.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. BYVAC ELECTRONICS www.byvac.co.uk 32Bit ARM Microcontroller, USB, built in RTC with itis own operating system, no complex tools, just a terminal emulator, start writing programs in 20 minutes. Complete with CD-ROM, Software and 100 Page Foundation book DECIBIT CO.LTD. www.decibit.com Smallest 2.4 GHz ISM band MCU embedded transceiver modules. Complete tiny solution, ready to transmit RF data by only attaching as example a CR2032 coin cell to it. EasyDAQ www.easydaq.biz We design & supply low cost USB/RS232 based data acquisition, automation & control products: • USB connected & powered, 8 opto isolated voltage inputs chans, 4DI0 & 4 onboard relays capable of switching 240V@10A. With Labview, VC & VB examples - £60 FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • device programmer manufacturer • selling through contracted distributors all over the world • universal and dedicated device programmers • excellent support and after sale support • free SW updates • reliable HW • once a months new SW release • three years warranty for most programmers FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk/PICProTrng.html Microchip Professional C and Assembly Programming Courses. JSLwfa®- The future is embedded. Transfer Utf. Microchip Consultant / Training^ Partner developed courses: • Distance learning / instructor led • Assembly / C-Programming of PIC1 6, PIC1 8, PIC24, dsPIC microcontrollers • Foundation / Intermediate 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 FUTURLEC http://www.futurlec.com Save up to 60% on • Electronic Components • Microcontrollers, PIC, Atmel • Development Boards, Programmers Huge range of products available on-line for immediate delivery, at very competitive prices. LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and Advanced Qualifications). Also Technical Management and Languages. MARCHAND ELECTRONICS INC. www.marchandelec.com • power amplifier modules • electronic crossovers solid state / valve / passive • valve amplifiers • phono preamps • handheld sinewave generator • kits or assembled • software electronic instruments • custom design services eJ iiy,TT MODular ElecTRONics www.modetron.com • Plug and Program • FREE application s/w • Hobbyist ease-of-use • Professional finish with enclosure and LEXAN faceplate • We will design and brand your custom application • Growing range of PSU’s, i/o modules, displays and microcontrollers 78 elektor - 10/2007 products and services directory MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes NEW WAVE CONCEPTS www.new-wave-concepts.com Software for Hobbyists: • Livewire - circuit simulation software, only £34.99 • PCB Wizard - PCB design software, only £34.99 • Circuit Wizard - circuit, PCB and breadboard design software, only £59.99 Available from all Maplin Electronics stores and www.maplin.co.uk ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers SOURCEBOOST TECHNOLOGIES USB INSTRUMENTS http://www.sourceboost.com Next generation C compiler and development products at highly affordable prices: • C, C++, and Basic compilers for PIC1 2, PIC1 6, PIC1 8 • Modern IDE, with PIC simulator, source level debugger and virtual devices. • RTOS for PICmicro. • PIC based controller and Development boards. • Download and try for Free from http://www. sourceboost.com COMPONENTBIN.COM www.componentbin.com Kickstart your development modules and parts from componentbin.com • ARM7 modules • Ethernet modules • Superb Graphic LCD displays (all with example software) and much much more... Online ordering and great prices! ULTRALEDS Ultral^ , * http://www.ultraleds.co.uk http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. WWW. elektor. tel: 0871 7110413/01625 576778 Large range of low cost Ultra bright leds and Led related lighting products. Major credit cards taken online with same day depatch. com SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £220 + VAT (£20 per issue for eleven issues) Elektor will publish your company name, website address and a 30-word description For £330 + VAT for the year (£30 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! _ n I wish to promote my company, please book my space: • Text insertion only for £220 + VAT • Text and photo for £330 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION 10/2007 - elektor 79 BOOKS, CD-ROMs, KITS & MODULES Going Strong A world of electronics from a single shop! Fully elaborated electronics projects 309 Circuits The present tenth edition of the popular '30x Circuits' series of books once again contains a comprehensive variety of circuits, sub-circuits, tips and tricks and design ideas for electronics. Among many other inspiring topics, the following categories are well presented in this book: test & measurement; RF (radio); computers and peripherals; audio & video; hobby and modelling; microcontrollers; home & garden; power supplies & battery chargers; etcetera. 432 pages • ISBN 978-0-905705-69-9 • £19.95 • US$ 39.95 5.0, 6.0, VBA, .NET, 2005 Visual Basic for Electronics Engineering Applications This book is targeted towards those peo- ple that want to control existing or self- built hardware from their computer. After familiarizing yourself with Visual Basic, its development environment and the tool- set it offers are discussed in detail. Each topic is accompanied by clear, ready to run code, and where necessary, sche- matics are provided that will get your projects up to speed in no time. 476 pages • ISBN 978-0-905705-68-2 £29.00 • US$ 58.00 Learn more about them Microcontroller Basics This book offers more than just a basic introduction! It clearly explains the tech- nology using various microcontroller circuits and programs written in several different programming languages. In the course of the book, the reader gradually develops increased competence in con- verting his or her ideas into microcon- troller circuitry. 230 pages • ISBN 978-0-905705-67-5 £19.50* US$39.00 / \ J Prices and item descriptions subject to change. E. & O.E 80 elektor - 10/2007 Software Tools & Hardware Tips Ethernet Toolbox Stand Alone OBD-2 Analyser (June 2007) Digital Inspector (September 2007) This CD-ROM contains all essential in- formation regarding Ethernet interfaces! Ethernet Toolbox includes a collection of datasheets for dedicated Ethernet in- terface ICs from many different manu- facturers. To help you with your own projects, the CD-ROM provides a wealth of information about connectors and components for the physical layer (PHY) and specific software tools for use with the Ethernet (Software). Of course, none of the Elektor Electronics articles on the subject of Ethernet are missing on this CD-ROM. ISBN 978-90-5381-214-3 • £18.90 • US$ 37.90 Ready-made applications and more Home Automation This CD-ROM provides an overview of what manufacturers offer today in the field of Home Networking, both wired and wireless. The CD-ROM contains specifications, standards and proto- cols of commercially available bus and network systems. The documents included on the CD-ROM have been classified according to communica- tion media: mains (power line), coax- ial cable, telephone line and wireless (RF). ISBN 978-90-5381-195-5 • £13.90 • US$ 27.80 This handy analyser makes a simple job of rummaging through the information stored by the client-accessible part of your car's computer. It works with all cur- rent OBD-2 protocols and can read and erase trouble codes stored in the vehicle and reset the MIL display. All this without the help of a PC or a visit to a service station. Kit of parts containing all components, the case (with front panel foil fitted), mount- ing materials and an OBD-2 cable. Art. # 070038-72 • £55.20 • US$ 1 10.40 PCB, ready-assembled and tested (case and OBD-2 cable included) Art. # 070038-91 • £61.50 • US$ 123.00 More information on the brand new Elektor Website: www.elektor-electronks.co.uk Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 208 261 4509 Fax: +44 208 261 4447 Email: sales@elektor-electronics.co.uk r^lektor LZ3shop When checking digital signals a logic analyser is indispensable, especially since many circuits use microcontrollers these days. This four-channel logic ana- lyser is compact and battery-powered. The maximum sampling rate is 2 MHz and the circuit has sufficient memory to store 1 024 samples of the signal. The dot-matrix display with a resolution of 64 by 1 28 pixels shows a clear representa- tion of the digital signals. Construction kit including the PCB, con- troller, display, case and all parts Art. # 060092-71 • £77.60 • US$ 155.20 Software Defined Radio (May 2007) SD radio receivers use a bare minimum of hardware, relying instead on their software capabilities. The Elektor SDR project (by Burkhard Kainka) demon- strates what's achievable, in this case a multi-purpose receiver covering all bands from 150 kHz to 30 MHz. It's been optimised for receiving DRM and AM broadcasts but is also suitable for lis- tening in to the world of amateur trans- missions. Ready-populated and tested board Art. # 070039-91 • £72.45 • US$ 126.50 10/2007 - elektor 81 PRODUCT SHORTLIST, BESTSELLERS ■\ October 2007 (No. 370) £ USS ElekTrack 040161 -91 .... PCB, ready assembled and tested, GPS/GSM-antenna, cable and case 275.00... ...550.00 USBprog 060224-1 Printed circuit board www.thePCBshop.com 060224-71 .... PCB, SMD populated plus other parts 18.80... 37.80 060224-81 ....Software on CD-ROM 5.20... 10.40 Mugen: A Hybrid Audio Amplifier 070069-1 Printed circuit board, amplifier (mono) 20.70... 41.40 070069-2 Printed circuit board, power supply 19.30... 38.60 September 2007 (No. 369) Tilt Gamepad 070233-41 ....Programmed controller ATMega8-16PI 6.20... 12.35 070233-81 ....Software on CD-ROM 5.20... 10.40 070233-91 .... Printed circuit board with sensor fitted 18.90... 37.80 Digital Inspector 060092-1 Printed circuit board www.thePCBshop.com 060092-41 .... Programmed controller PIC1 8F4580-I/P 13.10... 26.20 060092-71 .... Kit of parts PCB, controller, case and all parts 77.60... ...155.20 060092-81 ....Software on CD-ROM 5.20... 10.40 July/August 2007 (No. 367) Dual Battery 070343-1 PCB, bare 5.20... 9.75 Fast Charger for NiMH Batteries 070213-1 PCB. bare www.thePCBshop.com Lithium Charger 070273-1 PCB, bare 8.90... 12.95 Low2 Cost USB Demo Board 060342-81 ....CD-ROM, project software 5.20... 9.75 060342-41 .... PIC1 8F4550, programmed 15.15... 28.50 LPC 900 Programmer 070084-1 PCB, bare 6.90... 12.95 MotoBox 070129-1 PCB, bare www.thePCBshop.com 070129-41 .... PIC1 6F628-04/R programmed 14.80... 27.95 Propeller Prototyping Board for BoeBot 070275-1 PCB. bare 11.00... 20.75 Satnav for Robots 070350-81 ....CD-ROM, project software 5.20... 9.75 070350-41 ....ATmega32, programmed 16.50... 31.15 Serial Interface for the Propeller 070276-1 PCB, bare www.thePCBshop.com Stereo Robot Ears 060040-1 PCB, bare www.thePCBshop.com 060040-81 ....CD-ROM, project software 5.20... 9.75 060040-41 .... PIC1 6F88, programmed 10.00... 18.85 June 2007 (No. 366) 2.4 GHz WiFi Spectrum Analyser 070040-1 PCB, bare 8.25... 15.50 070040-1 1 .... CD-ROM, Linux & Windows software 5.20... 9.75 Coil Clinic 060195-1 PCB, bare 7.60... 14.25 0601 95-1 1 .... CD-ROM, project software 5.20... 9.75 060195-41 .... Atmega48-20PU, programmed 5.20... 9.75 Linux Oscilloscope 060241 -1 1 .... CD-ROM, project software 5.20... 9.75 Stand-Alone OBD2 Analyser 070038-72 .... Kit of parts, ind. case, cable, front panel foil and mounting materials 55.20... ...110.40 070038-91 ....PCB, ready-assembled and tested (case and 0BD-2 cable included) 61.50... ...123.00 Whistles from on high 060044-1 PCBs, bare; set for TX and RX 12.00... 22.75 060044-11 ....CD-ROM, project software 5.20... 9.75 060044-41 .... ATtinyl5PC, programmed 10.00... 18.75 / Prices and item descriptions subject to change. E. & O.E Bestsellers oaa n \ o od 1 2 3 4 5 1 2 4 1 2 3 5 309 Circuits ISBN 978-0-905705-69-9 £19.95. US$ 39.95 Visual Basic for Electronics Engineering Applications ISBN 978-0-905705-68-2 £29.00. US$ 58.00 Microcontroller Basics ISBN 978-0-905705-67-5 £19.50. US$ 39.00 PC Interfaces under Windows ISBN 978-0-905705-65-1 £27.25. US$ 54.50 308 Circuits ISBN 0-905705-66-1 £19.25 US$ 38.50 Ethernet Toolbox ISBN 978-90-5381-214-3 £18.90. US$37.90 g USB Toolbox ISBN 978-90-5381-212-9 £1 9.90..... US$ 39.80 Elektor 2006 ISBN 978-90-5381 -207-5 £1 6.90. US$ 33.80 Home Automation ISBN 978-90-5381-195-5 £13.90. US$ 27.80 Robotics ISBN 978-90-5 ISBN 978-90-5381-179-5 £12.90. US$ 25.80 Stand Alone OBD-2 Analyser Art. # 070038-72 £55.20...US$ 1 10.40 Digital Inspector Art. # 060092-71 £77.60...US$ 155.20 Software Defined Radio Art. # 070039-91 E72.45...USS 126.50 Tilt Gamepad Art. # 070233-91 £18.90. US$ 37.80 g-Force on LEDs Art. # 060297-71 £10.50. US$ 21.00 Order online at www.elektor-electronics.co.uk or use the Order Form near the end of the magazine! Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH * United Kingdom Tel. +44 208 261 4509 Fax +44 208 261 4447 Email: sales@elektor-electronics.co.uk 82 elektor - 10/2007 SERVICING YD U R COMPLETE PROTOTYPE NEEDS 1 EUROCARD (160 x 100 mm) + Tooling + Photoplots + VAT €49 Price example Any size and contour possible! Optional: • Soldermask • Fast-turnaround • Silkscreen • 4-Layer Multilayer • 6-Layer Multilayer Q&whQW OtfJt I fjii Freephone Q) 0800-3898560 Simply send your files A/IA 0/1/1# //I i|# and order ONLINE: rVO"rv(/i« V l/lrl Take out a free subscription to E-weekly now Do you want to stay up to date with electronics and computer technology? Always looking for useful hints, tips and interesting offers? Subscribe now to E-weekly, the free Elektor Newsletter. Your benefits: ■ The latest news on electronics in your own mailbox each friday » Free access to the News Archive on the Elektor website * You’re authorized to post replies and new topics in our forum Khrrliqi- Lt iti !h-p, iiK+nwriv- . njh-nr'l SCCrOL .11 |->-in>- ifr II -h-l ■ >--1 InXrl Hi ' r.-T 1 m I h t--H r-.> ■ ■ -J 1 if i rr-J m ‘a* 1 --: s K : ' Lj ’■H ' --i ,r. ■ )_ 1.J1 >IJ»d,L nfan . -Vi . . li. — i. — H H 1 ■: I ■fc'ji- : * hNKIIN'Bl ■ -■ rr_ Hr ■ n IB >‘4 Register today on www.elektor-electronics.co?uk/newsletter i ii I* KM Mlkirli Our online store contains an ever expanding variety of products designed fc engineers, hobbyists students. These include: V/ r and ^ j lur i J rtcsilU ni rer |.'i tlP* ( ■dill- 6 * t>-s f > 1 jI an**. >i I tj e- ( i §6 Divi’iij I he WhlC-j: ARM Development Systems Ethernet Modules RF Modules Graphic LCD Displays (With example software!) Home Automation Power Conversion Components & Connectors And Much More! Educational Discounts Available fc •rthi +■ : «r bt | u utoic Inioiir-siwi Full product support with reference software and secure online ordering to kickstart your development. 11 11 f IILir \i.l i U I Uiflui DwrJiy Vi ih LJ U ,, , ■■ Ift 1 :.!. --. 1 ■- ■ , ITH4 P«hr.v^fUiA t|C' b*.- in in'll liiii-il li'li j ■; iVnii rill#r i> ‘i — 11 www.componentbin.com +44 ( 0 ) 1354 778224 FRONT PANELS & HOUSINGS Cost-effective single units and small production runs Customized front panels can be designed effortlessly with the Front Panel Designer. The Front Panel Designer is available free on the Internet or on CD. • automatic price calculation • delivery in 5-8 days • 24-Hour-Service if required f rrrr nz ii Sample price: 30,42 € plus VAT/shipping Schaeffer AG • Hohentwielsteig 6a • D-14163 Berlin • Tel +49 (0)30 8058695-0 Fax +49 (0)30 8058695-33 • Web info@schaeffer-ag.de • www.schaeffer-ag.de 10/2007 - elektor 83 INFO & MARKET SNEAK PREVIEW USB data acquisition card This data acquisition card for connection to the USB has eight digital outputs, eight digital inputs, two 1 0-bit analogue out- puts and eight 10-bit analogue inputs for voltage swings of 0 to 5 V. The system's core is a Microchip USB-ready microcon- troller type PIC1 8F4550 programmed in C. The circuit is built on a compact PCB and requires no external power supply. Low-cost Webserver A small, stand-alone web server is very handy (and trendy) if you want to store data from camera's, data loggers, sensors and other devices, for accessing (and viewing) anywhere on the globe via your own web pages. Our project for a home web server is cheap and easy to reproduce. It is based on an ATmega32 microcontroller employing an old ISA-network card to link itself to the Internet. The web server's mass data may be stored on an SD/MMC memory card. The project has lots of scope for your own additions, experiments and adaptations. Flash-board on USB Quickly and easily programmed, Flash microcontrollers are just the ticket to developing software the comfort- able way. Until recently, the link to the PC was based on the RS232 port but that's had to give way to the more contemporary USB on most PCs. So, a controller board is needed that's USB savvy. Our board is, and it's ideal for lots of experiments. The micro used is an AT89C51 31 A sporting an 80C52 core and a full-speed USB inter- face. Moreover, the controller comprises an update interface that makes loading new software a breeze. Chip programming is handled by free Atmel software called FLIP. RESERVE YOUR COPY NOW! The November 2007 issue goes on sale on Thursday 25 October 2007 (UK distribution only). UK mainland subscribers will receive the magazine between 1 9 and 22 October 2007. Article titles and magazine contents subject to change, please check www.elektor.com. NEWSAGENTS ORDER FORM SHOP SAVE / HOME DELIVERY Please save / deliver one copy of Elektor Electronics magazine for me each month Name: Address: Post code: Telephone: Date: Signature: lectronics Please cut out or photocopy this form, complete details and hand to your newsagent. Elektor Electronics is published on the third Thursday of each month, except in July. Distribution S.O.R. by Seymour (NS). w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor. Elektor on the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software down- loads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you'll find all other products sold by the publishers, like CD-ROMs, kits and books. A powerful search function allows you to search for items and references across the entire website. ii** Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact d B ■ m Fife 84 elektor - 10/2007 Description Price each Qty. Total i Order Code 309 Circuits £19.95 Formula Flowcode Buggy £85.00 CD-ROM Ethernet Tool box £ 18.90 Visual Basic for Electronics Engineering Applications £29.oo Prices and item descriptions subject to change. The publishers reserve the right to change prices without prior notification. Prices and item descriptions shown here supersede those in previous issues. E. & O.E. Sub-total P&P Total paid Name METHOD OF PAYMENT (see reverse before ticking as appropriate) □ □ □ □ Bank transfer Cheque (UK-resident customers ONLY) Giro transfer AiatfBfCant Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Address + Post code Tel.: +44 208 261 4509 Fax: +44 208 261 4447 www.elektor-electronics.co.uk. sales@elektor-electronics.co.uk Tel. Email Date - - 2007 Signature ELIO Yes, I am taking out an annual subscription to Elektor and receive a free 1GB MP3 player. I would like: 171 Standard Subscription (11 issues) Subscription-Plus (11 issues plus the Elektor Volume 2007 CD-ROM) * Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email Date - - 2007 Signature * cross out what is not applicable ELIO *USA and Canada residents may (but are not obliged to) use $ prices, and send the order form to: Old Colony Sound Lab P.0. Box 876, Peterborough NH 03458-0876. Tel. (603) 924-6371, 924-6526, Fax: (603) 924-9467 Email: custserv@audioXpress.com METHOD OF PAYMENT (see reverse before ticking as appropriate) Bank transfer | Cheque (UK-resident customers ONLY) □ Giro transfer Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 208 261 4509 Fax: +44 208 261 4447 www.elektor-electronics.co.uk. subscriptions@elektor-electronics.co.uk ORDERING INSTRUCTIONS, P&P CHARGES Except in the USA and Canada, 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. On-line ordering: http://www.elektor-electronics.co.uk Readers in the USA and Canada may (but are not obliged to) send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Old Colony Sound for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Prio- rity) Outside Europe: £9.00 (Standard) or £11.00 (Priority) HOWTO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40209520 held by Elektor Electronics with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsibility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. September 2007 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £41 .90 £48.80 Surface Mail Rest of the World £54.50 £61.40 USA & Canada US$ 95.50 US$106.50 Airmail Rest of the World £68.90 £75.80 USA & Canada US$120.00 US$131.00 HOWTO PAY Bank transfer into account no. 40209520 held by Elektor Electronics, with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL- protected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a perma- nent 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 student- ship signed by the head of the college, school or university faculty. A standard Student Subscription costs £33.50, a Student Subscription- Plus costs £40.40 (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 2007 ■ 7r jr ±ri m -M.U I'fllJCI ■■ A. mcc-ss#-- ij. it'JH'iL lN«h i A • rr-’iiiM* ulkitkM rclr/ii * utl^arc + cumcuijm L ra ■ NEW IN DESIGN SUITE 7: IXIEW: Redesigned User Interface includes modeless selection, modeless wiring and intuitive operation to maximise speed and ease of use. IXIEW: Design Explorer provides easy navigation, design inspection tools and cross-probing support to n prove quality assurance and assist with fault ding. IXIEW: 3D Visualisation Engine provides the means to preview boards in the context of a mechanical design prior to physical prototyping. IXIEW: Simulation Advisor includes reporting on simulation problems with links to detailed troubleshooting information where appropriate. IXIEW: Trace capability within both MCU and peripheral models provides detailed information on system operation which allows for faster debugging of both hardware and software problems. IXIEW: Hundreds of new device models including PIC24, LPC2000, network controllers and general purpose electronic components. Electronic Design From Concept To Completion Labcenter Electronics Limited Registered in England 4692454 Electronics E-mail: inTo@labcenter.com Tel: +44 (O] 175G 753440 Fax: +44 (O] 175G 752857 Registered Address: 53-55 IVlain Street, Grassington, IXIorth Yorks, UK, BD23 5AA