MAY 2008 AUS$ 12.90 - NZ$ 15.50 - SAR 84.95 - US$ 9.95 £ 3.90 x y \e v t e N ^v* electronics worldwide i ' \ V ■A ji GRARHICmTALENT DigiButler Id USB Programmer = /MS tog \ v \ to \ / £ I 9 770268 R21 05 45113 5 a yi \v 141 W M ? a\* » , « v- \ I 1 M Vi- u. • i v 11 It a year Catalogue OUT NOW \rder on-line at ■I. n M B L 1 electronics, co. uh/ catalogue i t I n’D Ub,t AV Project Kits Be one of the Theremin Synthesiser Kit The Champ" Audio Amplifier KC-5295 £14.75 + postage & packing The Theremin is a strange 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 you hand between the antenna and the metal plate, you can create unusual sound effects. Kit includes a machined, silkscreened, and pre drilled case, circuit board, all electronic components with clear English instructions. • Required 9VDC wall adapter (Maplin #GS74R £6.99) r -i . KC-51 52 £1 .95 + postage & packing This tiny module uses the LM386 audio 1C, and will deliver 0.5W into 8 ohms from a 9 volt supply making it ideal for all those basic audio projects. It features variable gain, will happily run from 4-12VDC and is smaller than a 9 volt battery, allowing it to fit into the tightest of spaces. • PCB and all electronic components included first to get our brand new colour catalogue. It’s bursting with over 800 new products, all with PDS pricing and in full colour. Short Circuits Booh and Parts IR Remote Extender MKII Kit KC-5432 £7.25 + postage & 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 pay TV 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 power (Maplin #GS74R £6.99) and 2-wire cable KJ-8502 £1 1 .95 + postage & packing This full colour 96-page book has over 100 drawings and diagrams. The projects are fun to build and relevant to the electronics scene in the new millennium. Included with the book, you get the baseboard, plenty of spring terminals and ALL the components required to build every project in th book, INCLUDING the bonus projects. Book measures 205 x 275mm li Battery Zapper Kit MK II KC-5427 £29.00 + postage & packing This kit attacks a common cause of failure in wet lead acid cell batteries: sulphation. The circuit produces short bursts of high-level energy to reverse the damaging sulphation effect. This improved unit features a battery health checker with LED indicator, new circuit protection — '' against badly sulphated batteries, test points for a DMM and connection for a battery charger. Kit includes case with screen-printed lid, PCB with overlay and all electronic components with clear English instructions. • Suitable for 6, 12 and 24V batteries LED Water Level Indicator MKII Kit Precision Tools Ideal for PCB work! version^ How To Order KC-5449 £10.25 + postage & packing This simple circuit illuminates a string of LEDs to quickly indicate the water level in a rainwater tank. The more LEDs that illuminate, the higher the water level. The input signal is provided by ten sensors located in the water tank and connected to the indicator unit via-light duty figure-8 cable. Kit supplied with PCB with overlay, machined case with screen printed lid and all electronic components. Requires 1 2-1 8V AC or DC, 500mA plugpack. Both pliers and side cutters are made from quality tool steel and have soft padded handles that are spring loaded for comfortable long-term use. Both are excellent for PCB work. mm 6" Long Nose Pliers TH-1887 £3.00 + postage & packing Precision, slim line long nose pliers that are ideal for working in confined areas. They have serrated jaws so you can get a firm grip on the item you're holding 5 " Angled Side Cutters Post and Packing Charges TH-1897 £3.00 + postage & packing Ideal for fine PCB work, these cutters will easily cut leads flush with the board's surface. N-LINE 1 MNGIN 1 Order Value Cost Order Value Cost £200 - £499.99 £500+ •ALL PRICING IN POUND STERLING •MINIMUM ORDER] L ONLY £10 J £10 - £49.99 £5 £50 - £99.99 £10 £100 - £199.99 £20 Max weight 121b (5kg). Heavier parcels POA. Minimum order £10. £30 £40 Note: Products are despatched 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. Fax: +61 2 8832 3118 Email: techstore@jaycarelectronics.co.uk Post: PO Box 107, Rydalmere NSW 2116 Australia Expect 10-14 days for air parcel delivery Low Cost DMM QM-1500 £2.25 + postage & packing This full featured Digital Multimeter is perfect for the home handyman or young experimenter and will give years of reliable service. It features a huge 10A DC current range as well as diode and transistor testing functions. Also measures AC & DC volts and resistance. At this price you should buy two! -—® ■ H >>H 1 Check out the Jaycar range in your FREE Catalogue - logon to www.jaycarelectronics.co.uk/elektor or check out the range at www.jaycarelectronics.co.uk 0800 032 7241 (Monday - Friday 09.00 to 17.30 GMT + 10 hours only) For those who want to write: P0 Box 107, Rydalmere NSW 2116 Sydney AUSTRALIA I nycnr BitScope PC Oscilloscopes & Analyzers DSO Test Instrument Software for BitScope Mixed Signal Oscilloscopes 4 Channel BitScope 2 Channel BitScope Pocket Analyzer Digital Storage Oscilloscope Up to 4 analog channels using industry standard probes or POD connected analog inputs. Mixed Signal Oscilloscope Capture and display up to 4 analog and 8 logic channels with sophisticated cross-triggers. Spectrum Analyzer Integrated real-time spectrum analyzer for each analog channel with concurrent waveform display. Logic Analyzer 8 logic, External Trigger and special purpose inputs to capture digital signals down to 25nS. Data Recorder Record anything DSO can capture. Supports live data replay and display export. Networking Flexible network connectivity supporting multi-scope operation, remote monitoring and data acquisition. BitScope DSO Software for Windows and Linux BitScope DSO is fast and intuitive multi-channel test and measurement software for your PC or notebook. Whether it's a digital scope, spectrum analyzer, mixed signal scope, logic analyzer, waveform generator or data recorder, BitScope DSO supports them all. Capture deep buffer one-shots or display waveforms live just like an analog scope. Comprehensive test instrument integration means you can view the same data in different ways simultaneously at the click of a button. DSO may even 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 other PCs as if a BitScope was locally connected. BitScope DSO supports all current BitScope models, auto-configures when it connects and can manage multiple BitScopes concurrently. No manual setup is normally required. Data export is available for use with third party software tools and BitScope's networked data acquisition capabilities are fully supported. Data Export Export data with DSO using portable CSV files or use libraries to build custom BitScope solutions. www.bitscope .com 5/2008 - elektor 3 More than just a mag Most of you will associate 'Elektor' with the printed magazine that's been on circulation in newsstands, bookshops and in electronics retail stores since December 1974. In fact you are reading issue # 377 right now — on paper, and we intend to print quite a few more editions for you to enjoy. However over the past few years Elektor has developed a number of activities that do not in- volve paper anymore, although we consider them part and parcel of our publishing activities in general. Some of these activities may be un- known to you so I'll mention a few. To start with, there are our PCBs, CDs, books, special issues, kits and modules. Elektor PCBs have been on sale since issue #1 but kits and modules are relatively recent additi- ons. We started selling them to help those individual readers 'dying' to build our more ambitious projects but were either unable to source the components or shamefully ignored by component suppliers moving to- wards the professional domain with the inherent, awful P&P quotes. Our first 'module' was the legendary GBDSO. Some of our recent kits, like DigiButler (page 26) and last month's Elektor Internet Radio are 'hybrids' in that they contain a PCB that has the SMD components pre- mounted. From reader feedback we learned that many of you still enjoy soldering through-hole parts, hence these are supplied separately with the kit for an hour or so of wielding the old soldering iron (low-power, mind you). Elektor is also expanding its 'e- vents' portfolio by staging work- shops and seminars. Our partners are field leading companies and individuals. Examples include valve workshops and MultiSimlO from (and by) National Instruments EWB. Both were highly successful and got high grades from attendants. Another 'e-vents' activity you may have seen announced is the Elektor- hosted study trip to China. We have created an Elektor chan- nel on YouTube, provisionally at www.youtube.com/elektorim. We have discovered that short films, however primitively made, on our techno stuff are a great way of pul- ling in not only newcomers of the MTV generation but also those now in retirement and having discovered Elektor again through successful Googling. Jan Buiting Editor leRfor electronics worldwide Display Computer Programming a graphic display is distinctly more difficult than programming a text display. Our mini microcontroller board features a new display-on-glass module and a high-performance Renesas M16C microcontroller. The board is available fully assembled, and the microcontroller is pre-loaded with a TinyBasic interpreter to simplify the development of graphics applications - even for novices. 38 Elektor AVRProg Two events triggered the conception of this AVR programmer: the feedback received on USBprog from Elektor, October 2007 and a series of articles started last month around our ATM1 8 project. The outcome is a plug-and-play AVRISP mk2- compatible USB programmer for AVR controllers! CONTENTS Volume 34 May 2008 377 58 Tiny Counter The tiny frequency counter module described here consists essentially of just an ATtiny2313 microcontroller and an LCD panel. The microcontroller is clocked at 20 MHz, and so the counter module can be used at frequencies of up to 5 MHz without the need for a prescaler. Free E-book 1 5 top articles from Elektor bundled in a single pdf file details on page 1 2 Elektor Blockbusters t or In addition to its audio uses the soundcard can also be used for measuring purposes. But which software is the most appropriate? In this article we help you get oriented by giving you an overview of what can be found out there. projects 1 8 Display Computer 26 DigiButler (2) Two-wire LCD 38 Elektor AVRProg 42 Soldering with Reflow Control 44 paX: a Power Amplifier with Error Correction Protection System for Power Amplifiers 58 Tiny Counter 70 E-Blocks: Flowcode Interrupts 74 Design Tips: An SPI-networked microcontroller Symmetrical square wave technology 6 j Measuring on the PC Display info & market 6 Colophon 8 Mailbox Elektor E-book News & New Products 56 Review: MikroElektronika EasyPIC5 Development System 80 Elektor SHOP Sneak Preview infotainment 76 Hexadoku 77 Retronics: 'Alibi-Nota' telephone answering machine (1972) 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. pa* CSurrpund .Software builds &***'* 'hardware loktor Sternet ladio UK Umversit' Volume 34, Number 377, May 2008 ISSN 1 757-0875 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: 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 sta Antoine Authier (Head), Ton Giesberts, 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 - 5/2008 FPGA Course on CD-ROM Modern technology for everyone [3lektor L_3shop FPGAs have established a firm position in the modern elec- tronics designer's toolkit. Until recently, these 'super com- ponents' were practically reserved for specialists in high-tech companies. That's all changed now, also because of the Elektor FPGA module. The combination of the module and the prototyping board is the perfect introduction to FPGAs. The nine lessons on the courseware CD-ROM are a step by step guide to the world of Field Programmable Gate Array technology. Subjects covered include not just digital logic and bus systems but also building an FPGA Webserver, a 4-channel multimeter and a USB controller. The CD also contains PCB layout files in pdf format, a Quartus manual, project software and various supplementary instructions. ISBN 978-90-538 1-225-9 • £14.50 • US$ 29.00 Free of charge FPGA product bundle. WWW elektor.com /ipgacombi Order quickly and safe through WWW.el6ktor.com/shop or use the Order Form near the end of the magazine 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. 2008 Printed in the Netherlands 5/2008 - elektor 7 INFO & MARKET MAILBOX Compact Fluorescent lamps Dear Editor — I liked the article on CF lamps in the January 2008 issue. It gives an insight into the requirements for ope- ration of these miniature fluorescent lamps, but despite the attempts of various governments to inflict these units on the populous, there is still some resistance to their general use. There are many reasons for this. In Britain at least, the cost is relatively high compared to the humble incandescent lamp, although prices have dropped in the last few years. One issue with all CFLs is to know the colour emitted by them. The warm-up time can be a problem in some applications, espe- cially in outdoor units having a short on time such as in IR detector controlled fittings at doorways. In cold weather these can take a few minutes to give a useful light, and by then, the detector is ready to switch off again. I have used the standard BC fitting replacements for several years now, but current building regulations in the UK demand at least a certain number of low energy fittings in every new build or extension. These must be of a type that cannot accept a standard incandescent bulb as a replacement, ef- fectively ruling out the GLS replacement lamps now becoming widely available here. We are therefore faced with fluores- cent fittings, Bi-pin types or square 4D fittings. Unfortunately, the lamp unit manufacturers have been slow to provide suitable units that are acceptable to the home user. Most of the fittings available that will only accept a none- incandescent type lamp tend to have a somewhat industrial look to them, necessitated by the requirement of providing a ballast of some kind and a place to keep said ballast away from danger. That has to include dissipation of heat in a safe manner, isolation from prying fingers and safety in failure either of lamp or ballast. There are pendant drops made that will only accept a bi-pin lamp, but they do not readily take a standard shade as the fitting is larger than the old bayonet holder. Then there is the lamp equivalent problem. How does one relate 1 8 W = 1 00 W and pictures of several light bulbs on the packet with the real world? In truth I have seen 5-W CFL lamps that claim to be equivalent to 30 W candle lamps, and yes they are bright, but the light produced has an eerie greenish tinge presumably due to a lack of red in the spectrum produced. By the same token, some CFLs give a stark blue-white light, and these are very bright to the point of being painful, but the quality of the light seems strange. The shadows are harsh and yet the corners of the room seem to be in darkness, despite or perhaps owing to the intensity of the light elsewhere in the room. It must be said that the more recent spiral and the multi loop lamps are a better colour match to tungsten lamps than they were, although perhaps efficiency has been sacrificed for colour temperature. I modified a fitting to take a 16 W 4D lamp from 2x60 W golf ball bulbs, and for some reason ordered a cool white lamp. It is very bright, but using a 2700° lamp in the same place gives a dismal, gloomy light. It is still 16 watts, but how many incandescent lamps should it have on the pack? It is all a matter of perception. No-one seems to quote lumen output from GLS lamps (standard house- hold bulbs). These vary enormously dependant on the construction of the filament and the coatings on the lamp in any case. A 60 W rough service lamp has a tough relatively cold fila- ment that gives a yellow light, whilst the mushroom lamps so popular in the 1960s were fragile beyond belief and burned at a high temperature with a coiled coil filament. This gave a very white light compared to its predecessors. Comparing wattage ratings between GLS, quartz-halogen, CFL, 'normal' fluorescent and other discharge lamps is a bit like comparing fruit, ve- getables and bread. It is meaningless without colour temperature and total light output being compared. It would be far more helpful to insist on comparison of lumens per circuit watt, which would also include losses in the ballast. One almost unknown loss outside of the electrical frater- nity is that suffered in standard iron cored ballasts used for standard fluorescent lamps with switch starters. These can add 15% or more to the tube rating, thus a traditional 40 W 4-foot (1 200 mm) fitting actually used a total circuit power of nearer 50 watts, and whist the efficiency was far above that of a tungsten lamp, only recently have HF ballasts become the norm in traditional 'long' fittings. I recently installed some new lamps in my garage, the tubes being rated at 58 W and the whole fittings claiming to be 59 W. The power factor is also close to 1 and so these are sui- Power meter revisited The author of the article on the versatile DC power meter, Oliver Micac, has generated an updated version of the software for the meter. The new version makes it possible to use the meter with 60-mV DIN shunts. The new firmware is availa- ble on the website under the original article (look for item number 070559-1 1 under 'Versatile DC Power Peter' in the January 2008 issue). Not a Summer Circuit Okay — it's not a circuit; it's not even electronic but I think your readers might be inter- ested in my Logic Goats, h ttp : // www. flying-pig.co.uk/ pagesv/logicgoat.html Logic Goats are paper models 8 elektor - 5/2008 table for industrial use as well. They are soft-start, thus reducing inrush currents and have flicker-free start. The mains pollution emitted is low and they also offer possibly longer lamp life. This must be a step forward, but at the cost penalty of about twice that of a switch start unit. Contract electricians will not supply these until they are forced by legislation to use them. For me the cost penalty is not an issue for four units, but if I was supplying four thousand to a site, then offering the switch- start units would make the costing look better to the client. Unfortunately the lamps are still a five foot long glass tube mounted on a metal box screwed to the ceiling, and we are back to the industrial look again. What comes next? LEDs are looking promising. They are brighter by the week it seems and can be acceptable for some areas, but once more we are back to perceptions again. The GU 1 0/GZ1 0 240 V dichroic type halogen lamp can now be replaced with a CFL version or an LED version. The original tends to be either 35 or 50 watts and produces a typical tungsten light with about 30° spread. The CFL version is too big for most fittings and woefully dim but only rated at 7 or 9 watts. The lack of a realistic reflector makes the light output seem poor. The LED version is an incredibly bright, bluish-white but only offers about a 5° beam. White LEDs tend to have a limited life as well. They are really blue LEDs with a phosphor coating inside, and like fluorescent tubes, rely on this for their final colour. The light output diminishes fairly rapidly and after a year or so, a new white LED is dazzlingly bright compared to one that has been in use for the past 1 2 months. All fluorescent lamps, compact or otherwise, use mercury va- pour as the principle radiating component in the tube. When a current is passed through the tube the mercury vapour emits a high concentration of UV light. This is sometimes visible if the ends of the tube are not fully coated with phosphor powder, a blue glow can be seen inside the tube itself. The UV excites the phosphors that coat the tube, and cause it to glow. The colour temperature of the light emitted depends on the phosphor mix used, and can be a range of colours from daylight through to red or blue or even UV. The great efficiency associated with standard fluorescent lamps came from the fact that the light was emitted over an exceptionally large surface compared to a filament lamp. This gave softer shadows, less glare and a greater distribu- tion of light over a given area. The humble tungsten filament lamp, like its predecessor the candle, was effectively a point source. With the CFL we are back to a point source (relatively speaking) so it has to be intensely bright to give a reasonable light output, as do HID lamps. Similar reasoning applies to LEDs as well. Unfortunately this tends to give them a characte- ristic starkness and glare. Here we go again! The energy debate will continue no doubt, but what is the environmental effect of the CFL now poised to replace the incandescent lamp? Disposal of large quantities of dead units may be an issue, as they all contain mercury and some exotic phosphors, typically rare earth and metallic phosphor salts. The cathodes (the heater bit that glows in a switch-start fitting) are made from tungsten wire coated with barium, strontium and calcium salts, and are similar in design to an electronic valve (tube) cathode, being designed for optimum thermionic emission at low temperatures. If these things ever do replace the simple GLS lamp, even at five times the life span there will be a lot of undesirable rubbish being dumped into the ground, and no doubt even more regulation will be needed to ensure that the lamps are re-cycled in a safe manner. This cost could be inflicted on the retailer or the manufacturer, put- ting up the price and making their use less attractive. There is also the question of energy required to actually make, package and distribute these lamps. They may use one fifth of the energy in their life time, but how much energy is expended making each one in comparison to its more humble cousin? The glass envelope is far more complex than a single bulb, and the electronics for the CFL ballast inevitably has to be made and built. Despite the maker's claims, the life of the CFL can be depressingly short, especially in the very compact designs that have a cooking hot ballast in the centre of the spiral fitting. Are we in danger of moving the energy consumption and pol- lution generation from the end user to the manufacturing and disposal process, or like the electric car, from our cities to the power stations? Andrew Denham (UK) of working logic gates but in goat form — you can see a Youtube video of them in ac- tion here: www.youtube.com/ watch?v=vu3o6JNclRQ Best wishes Rob Ives (Flying Pig) In a word \ brilliant! Everyone , put down your soldering irons and get out your scissors and cardboard. The 'Dekatron' decimal counter valve (1) Dear Sir — your magazine used to be good, unfortunately it swerves time and again to high-tech subjects. What good are FPGAs and microcontrol- lers to me when I can't get any use from them? To be able to follow your construction projects you need an academ- ic degree and vast amounts of 'pocket money' to buy special parts and programming tools. That used to be different, and better, in the past. For example, in your March 2008 issue you present the Dekatron counter valve with a schematic. Where, please, should normal people go to obtain, at a reasonable price, such parts declared obsolete decades ago? Kind of utopian, no? I am not so affluent as to spend my hard earned cash 5/2008 - elektor 9 INFO & MARKET MAILBOX on this grot. Not my cup of tea and I am cancelling my subscription. G. Kratzin (Germany) A bemusing response indicating that Mr Kratzin has missed the point about our Retro nics arti- cles entirely , see the footer prin- ted with every instalment. Anti-Standby Switch — a sequel on safety Dear Editor — on your green standby switch project (January 2008, Ed.), a current transformer MUST always work into a very low imped- ance load. It is extremely dangerous to not have a low-value load resistor across the secondary, across which a small ac voltage is developed. So dangerous that some com- mercial current transformer manufacturers install the load resistor within the transformer module. Without such a load, under transient and high cur- rent events several thousand volts can be developed across the secondary as it tries to drive its secondary current into a non-existent load. Without a load a CT looks like a voltage step-up transformer multiplying the 240VAC mains input being pushed through it. Only the saturation of the core limits the energy. The secondary winding, load resistor and PCB must be rated for the divided down primary load current. For example if the primary is rated for 1 3 Amps and there is a 1:10 turns ratio then the secondary must be designed for a steady state current of 1 .3 Amps and a peak current of say 5 Amps (typical domestic 0.2 second fault current is 50 Amps). Obviously with a low imped- ance load and suitable con- ductors the power dissipation is very small. (name withheld at request of correspondent) The designer , Thomas Scherer , replies Dear Jan — I thank the correspondent for being so concerned about security issues. But in my eyes he is too concerned about this and misses the point in some way. Specifically, the rule he men- tions is no law of nature. In fact this is pure theory which doesn't match the real circum- stances. Especially transients may happen with every inductive load, with coils and ordinary transformers too. This is nothing special. But they do not occur at the high energy levels he mentions. Therefore this never is as dangerous as you believe — otherwise a big part of commercially produced electronic devices would be dangerous. What he has not considered really is the amount of energy a pulse can have which is provided by this little current transformer. Like you said: this energy is limited by the core of this transformer and therefore is not insignifi- cant. Second, there is no 'no load' condition. Connected to the secondary coil of the cur- rent transformer is found a 10- k resistor in series with a 100- nF capacitor which has nearly zero ohms for transients. A transient pulse of 1 kV peak should produce a current of 0.1 A which equals a peak power of about 1 00 W (for some |js). This little transformer is never able to produce such a peak power. And if you still believe in your theory: I mea- sured the voltages which occur at the secondary windings of the current transformer during shutting off currents of 1 0 A on the primary side. The result is that the maximum measured pulse peaks do not reach 20 V. Is this dangerous? Not even for the following opamp, I believe, because the voltage at the 1 00-nF capacitor never exceeds 1 V. Lastly the correspondent is completely wrong in thinking that the parts at the secondary winding of the current trans- former need to withstand 5 A peaks. This really really never will happen. This is a practical case of impossibility ;-) So I am really sure the PCB is totally safe and nobody can be killed but your theory of unsafety.... Dr. Thomas Scherer The original correspondent replies Dear Jan — as your contribu- tor Thomas points out it is all a matter of coupling. The CTs I was working with were de- signed to accurately measure (to within a percent or so) the primary current (typically 300 A) and in that applica- tion had many thousands of secondary turns to scale the primary current down to an electronics-friendly few milliamps using a substantial core. I have seen capacitors and ICs explode off the board when a load of 1 ohm was inadvertently omitted and in once case a senior engineer was thrown the length of the test bay when a technician perhaps deliberately removed the working load. In this application the CT is mostly sensing any significant primary current. I do not fully accept that the capacitor is a load since its contribution would be out of phase. The transient I am concerned about is the switch-on surge of the connected appliance, which with modern switch mode power supplies can sometimes be as much as 50 A for the first cycle. So-called power factor cor- rected PSUs sometimes have a lower in-rush current. Providing the core saturates at the odd amp or so the energy fed into the secondary is relatively small. Even so the 10 k resis- tor becomes a safety item, should this fail, downstream electronics would probably be damaged. At one time we considered put- ting voltage limiters across the CT secondary but our Safety Committee could not resolve a satisfactory fail-to-safe mecha- nism and concluded that the reliability of a quality ohmic load was such that it far less likely to fail than the protec- tion components proposed to protect the system should it fail. Every component was subject to such analysis which sometimes took weeks and sometimes needed experiments on live systems with induced failures. Perhaps Elektor should publish a follow-up advising readers only to use the specified core and winding specification and not to substitute a genuine cur- rent transformer which is likely to have a very significantly higher coupling efficiency. Current transformers are very weird components that few readers are likely to have had experience of. Although I never had a shock or caused others to have a shock off them, what I have seen has made me very wary of such an innocent looking device! Mai I 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, 1 000 Great West Road, Brentford TW8 9HH, England. 10 elektor - 5/2008 EasyPIC5 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD Following tradition of its predecessor EasyPIC4 as one of the best PIC development systems on the market, EasyPIC5 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 prototype development. Examples in C, BASIC and Pascal language are provided with the board. Touch screen controller with connector is available on-board. Uni-DS 3 Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer The system supports PIC, dsPIC, AVR, 8051 , PSOC, ARM and PSoC microcontrollers with a large number of periph- erals. In order to continue working with different chip in the same development environment, you just need to swich a card. UNI-DS3 has many features that make your develop- ment easy. You can choose between USB or External Power supply. Each MCU card has its own USB 2.0 programmer! LV 18FJ Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD System supports 64, 80 and 100 pin PIC18FxxJxx microcontrollers (it comes with PIC18F87J60 - PIC18 Microcontroller with an integrat- ed 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 debugging and faster prototype development. Examples in C, BASIC and Pascal language are provided with the board. 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. 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 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. EasyAVR5 Development Board with on-board USB 2.0 programmer The system supports 8, 14, 20, 28 and 40 pin microcontrollers (it comes with ATMEGA1 6). Each jumper, ele- ment and pin is clearly marked on the board. It is possible to test the most of industrial needs on the system: temperature con- trollers, counters, timers etc. EasyAVR5 is an easy-to-use Atmel AVR development system. On-board USB 2.0 programmer makes your development easy. Examples in BASIC and Pascal language are provided with the board. AVR EasyPSoC3 Development Board with on-board USB 2.0 programmer The system supports 8, 20, 28 and 48 pin microcontrollers (it comes with CY8C27843). Each jumper, ele- ment and pin is clearly marked on the board. EasyPSoC3 is an easy-to-use PSoC development system. On-board USB 2.0 pro- grammer provides fast and easy in-system programming. The system supports 18, 28 and 40 pin microcontrollers (it comes with dsPIC30F4013 general purpose microcon- troller 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 lan- guage guarantee successful use of the system. Ultra fast USB 2.0 on-board programmer and mikrolCD (In-circuit Debugger) enables very efficient debugging and faster pro- totype developing. EasyARM Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer 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 automatic switch between ‘run’ and ‘programming’ mode. Examples in C language are provided with the board. BIGAVR 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 lOMFIz). Many already made examples guarantee suc- cessful use of the system. BIGAVR is easy to use Atmel AVR development system. BIGAVR has many features that makes your development easy. You can choose between USB or External Power supply. BIGAVR also supports Character LCD as well as Graphic LCD. Easy8051B Development Board with on-board USB 2.0 programmer 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 microcontroller out. dsPICPRO 3 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD The system supports dsPIC microcontrollers in 64 and 80 pins pack- ages. It is delivered with dsPIC30F6014A microcontroller. dsPICPR03 development system is a full-featured development board for the Microchip dsPIC MCU. dsPICPR03 board allows micro- controller 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... BIGPIC5 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD System supports the lat- est (64) and 80-pin PIC microcontrollers (it is delivered with PIC18F8520). Many of these already made examples in C, BASIC and Pascal language guarantee successful use of the system. Touch screen controller with connector is available on- board. This development board has an on-board ultra fast on-board USB 2.0 programmer, mikrolCD (In-circuit Debugger) and integrated connectors for MMC/SD memory cards, 2 x RS232 port, RS485, CAN, on-board RTC, PS/2 connector, DAC etc... mikroElektronika Compilers Pascal, Basic and C Compilers for various microcontrollers 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. 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 wllft rrrlkrOiCD support 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. g 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. http://www.mikroe.com/en/distributors/ - All of our products are shipped in special protective boxes. -On-line secure ordering provides fast and safe way of buying our products. Find your distributor: UK, USA, Germany, Japan, France, Greece, Turkey, Italy, Slovenia, Croatia, Macedonia, Pakistan, Malaysia, Austria, Taiwan, Lebanon, Syria, Egypt, Portugal, India, Thailand, Taiwan, Czech and Slovak Republic. Please visit our website for more info http://www.mikroe.COrn SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD 5/2008 - elektor 11 book' * yjxNVJ lekto* ml eV, ° 15 Elektor Blockbusters Free e-book for all Elektor readers 5/2008 elektor - Each month Elektor magazine is packed with fine articles and challenging projects. Our archive going back to the mid-1970s, you can well imagine the immense repository of articles published in your favourite electronics maga- zine. Especially for all faithful Elektor readers we selected top-ranking articles from our recent issues and compiled them into the free e-book title '1 5 Elektor Blockbusters'. Visit the Elektor website today and download this col- lector's item — it's exclusive and all free! Elektor likes to do a little extra for its readers, like a CAD software CD-ROM or the 24-page 'tinker-away' i-TRIXX supplement in the centre of the December issue. Our sub- scribers enjoy the additional luxury of receiving, via the address carrier, advice on exclusive offers and discounts that together can add up to considerable savings. Now, we add a free e-book for all readers: '1 5 Elektor Blockbus- ters' — an exclusive collection of top ranking articles from recent Elektor issues. Getting your copy of the e-book is easy, fire up your In- ternet browser and go to www.elektor.com/ebook. As a registered user of the Elektor website you are just one click away from'15 Elektor Blockbusters'. No problem if you are not yet a registered user of our website. After a few easy steps you will receive your personal login data and then '1 5 Elektor Blockbusters' is also available to you for downloading. io n • Elekt 111 Cc Gktor RFID Rearl • rse acfei' ° ft ware n*»f; • M ^VVe bserv 7 RaC •° SB ^Boar/ CQUiPNCHT r*>R EH^H-OMIC* DEVELOPMENT, TRAIN: NO 4 EXFE H IME NTATWN EasyPIC5 Starter Packs — everything needed to learn about and develop with PIC microcontrollers from only £99 UNI-DS3 Universal Development System dsPICPR03 Development System PICPLC16B Control System PoScope Multi-Function Instrument LAP-1 61 28U Logic Analyser Leaper-48 Universal Device Programmer Robo-PICA Robot Experiment Pack NX-51 V2 Microcontroller Trainer IDL Series Circuit Labs Please see our website at www.paltronix.com for further details of these and other products We stock components, control systems, development tools, educational products, prototyping aids and test equipment Paltronix Limited, Unit 3 Dolphin Lane, 35 High Street, Southampton, SOI 4 2DF I Tel: 0845 226 9451 I Fax: 0845 226 9452 I Email: sales@paltronix.com Secure on-line ordering. Major credit and debit cards accepted. Prices exclude delivery and VAT. We also stock a range of probes and test leads suitable for use with the PoScope as well as money-saving bundles. We can supply all ZeroPlus logic analysers and advanced protocol decoding options. We also stock Leap device programmers for EPROM/ EEPROM/Flash EPROM, 8051 and PIC. Four starter packs available, all of which include the EasyPIC5 development board, USB power/programming lead, blue backlit 16x2 character and 128x64 graphic LCDs, touch- screen overlay for GLCD, RS-232 lead, PIC16F877A 40-pin microcontroller and DS1820 temperature sensor plus manuals and software. EasyPIC5 Starter Pack - £99 Our EasyPIC5 Starter Pack is ideal for those wishing to learn about and program using assembly language or other makes of compiler. The pack contains the EasyPIC5 board, all required leads, character and graphic LCDs, touch-screen, PIC16F877A MCU and DS1820 temperature sensor. Exclusive to Paltronix, the pack also includes a getting started guide, tutorials and example programs — ideal for newcomers to microcontrollers. MikroElektronika’s EasyPIC5 development system simply must be the most versatile and best value PIC development system on the market. The board supports Flash-programmable devices in the PIC10F, 12F, 16F and 18F families in 8, 14, 18, 20, 28 and 40-pin packages and features a fast built-in USB2.0-based programmer. Also on the board are a useful range of I/O devices such as LEDs, pushbutton switches, potentiometers, RS-232 interface, USB and PS/2 connectors and provision for the easy fitting of character and graphic LCDs, touch-screen and DS1820 tempera- ture sensor (all of which are supplied in our starter packs). Clearly labelled DIP-switches and jumpers allow any I/O devices not being used to be disabled and all of the PIC’s I/O lines are available on IDC headers for easy expansion using MikroElektronika’s extensive range of add-on boards or for connection to your own circuits. Detailed documentation and example programs and our own getting started guide and tutorial make the EasyPIC5 ideal for beginners and experienced users alike. The PoScope features a 16-channel logic analyser with I2C, SPI, 1-wire and UART serial bus decoding, dual-channel oscilloscope, pattern generator, spectrum analyser, chart recorder and square-wave/PWM generator in one low-cost instrument for £79. The Leaper-48 is a USB- based universal device pro- grammer supporting an exten- sive range of memories, programmable logic devices, microcontrollers and digital signal processors at a low price of £295. Please see our website for full list of sup- ported devices. As featured in this month’s Elektor magazine - Please note that our packs all include the LCD displays, touch-screen and DS1820 temperature sensor. EasyPIC5 BASIC Starter Pack - £149 EasyPIC5 C Starter Pack - £189 EasyPIC5 Pascal Starter Pack - £149 Get off to the best start with the EasyPIC5 and save money with one of our compiler starter packs, which include the contents of the above EasyPIC5 Starter Pack plus a full version of MikroElektronika’s mikroBASIC, mikroC or mikroPascal PIC compilers. These user- friendly compilers feature in-circuit debugging when used with the EasyPIC5 and also provide library routines to support all the EasyPIC5’s built-in I/O devices and optional add- on boards. Work with various MCUs using one development board with the UNI-DS3. Currently supporting PIC, dsPIC, AVR, 8051, ARM and PSoC devices, the UNI-DS3 has a wide range of I/O features from £109 including main board and one plug-on MCU card. We stock all MikroElektronika development and add-on boards and PIC, dsPIC/1 6-bit PIC, AVR and 8051 compilers. We stock a large range of similar development systems for PIC, dsPIC, AVR, 8051, ARM and PSoC microcontrollers. A wide range of microcontroller and PC-based control boards and add-ons are also available. Similar robot kits stocked based on 68HC1 1 , 8051 , AVR and BASIC Stamp plus large range of accessories. Other training systems available for microcontroller and electronics teaching. We have a large range of prototyping products from bread- boards to advanced digital and analogue circuit labs. The LAP-1 61 28U from The new dsPICPR03 is a development system for the dsPIC with advanced I/O and communications devices including RS-232, RS-485, CAN, Ethernet, real-time clock, SD card reader and displays. Starter packs priced from £149. The PICPLC16B makes an ideal platform for developing and implementing control and automation applications. This PIC microcontroller- based board has 1 6 relay outputs, 16 opto-isolated inputs plus RS-232, RS-485 and Ethernet interfaces for £99. Start experimenting with robotics with the Robo- PICA robot experiment pack. Contains everything required to build various PIC microcontroller-based robot projects and carry out a large range of fun experi- ments for £89. The IDL-400 Logic Trainer, IDL-600 Analogue Lab and IDL-800 Digital Lab all feature a large solderless breadboard, built-in DC power supplies, switches, displays and useful logic gates or test features and are priced from just £1 79. ZeroPlus is a powerful 16- channel 200MHz logic analyser with UART, I2C and SPI protocol decoding priced from £195. Further protocol decoding options available including 1-wire, Microwire, CAN, LIN, PS/2 and USB. Designed specifically for teaching 8051 microcon- troller interfacing and programming, the NX-51 V2 incorporates a useful range of I/O devices and comes complete with detailed example programs for £99. 5/2008 - elektor 13 INFO & MARKET NEWS & NEW PRODUCTS USB Digitisers & Digital Multimeter National Instruments has an- nounced the release of the Nl USB-5 1 32/5 1 33 digitisers and the Nl USB-4065 6 V 2 -d i g i t digital multimeter (DMM). These small, lightweight instruments feature bus- powered and plug-and-play opera- tion, which makes them ideal for portable, benchtop and OEM ap- plications. They are also shipped with Nl LabVIEW SignalExpress LE, an interactive measurement workbench for quickly acquiring, analysing and presenting data, with no programming required. The USB-5 132/51 33 50 MS/s and 1 00 MS/s digitisers offer two simul- taneously sampled channels with 8- bit resolution. These USB digitisers feature 1 0 input ranges from 40 mV to 40 V and programmable DC off- set, and come standard with 4 MB/ ch of onboard memory for measure- ments requiring extended data cap- tures. The USB-4065 DMM offers 6 V 2 digits of resolution at up to 10 readings per second and up 4 MB/ ch of onboard memory for meas- urements requiring extended data captures. The USB-4065 DMM of- fers 6 V 2 digits of resolution at up to 10 readings per second and up to 3,000 readings per second at low- er resolutions. With ±300 V of isola- tion, current measurements up to 3 A and 2- or 4-wire resistance measure- ments, the USB-4065 offers a com- plete multimeter solution for portable 672-digit measurement needs. Each of these instruments includes its own soft front panel, which provides an interactive, familiar interface to get up and running quickly. For data logging applications, engineers can easily combine the USB-5 1 32/51 33 digitisers or the USB-4065 6 l/ 2 -digit DMM with LabVIEW SignalExpress measurement software. Together, this intuitive software and the bus- powered architecture of these new instruments are extending the ease- of-use and performance of portable measurements. www.ni.com / modularinstruments / usb (080073-VII) Verotec strengthens direct sales route and technical support Verotec, the successor company to Vero Electronics and APW, an- nounce that a new online shop will be launched on March 1st 2008. Well-known APW / VERO products such as KM6-II Subracks & Front Pan- els, Diplomat, LBX & Verotec Cases, Fan Trays, 1 9" rack cases and many others can now be purchased either directly or through the new on-line shop. Selected sizes from all ranges are also available from the leading pan-European catalogue distributors Farnell and RS Components. Verotec standard products are available direct on short lead times with many popular items be- ing available ex-stock. Customi- sation is a very common require- ment for all types of sub rack and enclosure; Verotec's experienced technical support team are avail- able to advise on the best product for any particular application and to provide quotations for custom versions. The intrinsic experience, knowledge base, tooling and pro- duction equipment availability nor- mally means that Verotec is able to offer the most competitive price and lowest time to market for any standard enclosure configured to meet the project needs. For 50 years, the name VERO has been synonymous with high qual- ity electronics packaging. The ma- jority of Verotec employees are ex VERO and APW; they have exten- sive knowledge and experience of the design, engineering, man- ufacturing and customisation of all the products. The traditionally high quality, fit and finish associ- ated with the VERO name is being maintained and bettered; in-house technical and commercial depart- ments provide support on all as- pects of the product range. www.verotecshop.co.uk (080087-IX) PS-900 soldering system OK International has introduced the PS-900 Soldering System. Controlled and powered by Sm- artHeat® Technology, the PS-900 provides users with exceptional ca- pability to solder high thermal de- mand applications including lead- free solders, multi-layer boards, and large mass components. The PS-900 is a fixed temperature system that varies power to match the thermal demand of the device being soldered. SmartHeat® Tech- nology provides an exceptionally fast response when under load while eliminating the potential for thermal overshoot. The result is a high quality solder joint formed at safe, controlled temperatures. The PS-900 has a compact foot- print power supply in a rugged, lightweight cast aluminum housing. The system includes an ergonomic soldering handpiece, an Auto- sleep Workstand for the soldering iron, and a temperature resistant tip removal pad. Over 30 tip geometries are avail- able in dimensions as small as 0.4 mm (.016") to 5 mm (.197"). This range of tips allows users to per- form a wide variety of applications including single point soldering of through-hole and SMD leads, drag soldering SMD leads, touch-up and pad clean-up. All PS-900 tips em- ploy the use of high plating thick- ness. This feature protects the tip from flux attack, therefore, prolon- ging tip life and lowering opera- ting costs. The Auto -Sleep workstand, which is unique to OK International, auto- matically reduces the tip tempera- ture during idle periods, providing increased tip life. Moreover, with SmartHeat® Technology, the PS- 900 does not require calibration. This eliminates costly down-time ty- pically associated with conventio- nal soldering systems. http://www.okinternational.com (080073-X) 14 elektor - 5/2008 PicoScope 5000 Series 250 MHz bandwidth - fl P RWa T , fe - I=| . IS jt P- ^ The No Compromise 1 G5/s real-time sample rate o PC Oscilloscopes 128 megasample record length o With class-leading bandwidth, sampling rate, memory depth and an array of advanced high-end features, the PicoScope 5000 PC Oscilloscopes give you the features and performance you need without any compromise. un LU QC LU Vi © un III LU M H 55 > Advanced Triggers In addition to t tie standard M^ers the PicaScope S 000 series comts as stafKJard with pulse width, window, dropout, delay, and logic levd triggering. 250 MHs Spectrum Analyser High-speed USB 2,0 Connection Automatic Measurements Arbitrary Waveform Generator Define you* - own waveforms or select from 3 predefined signiils with the 12 bit, i££ MS/s arbitrary w^vffej'rti generator. Waveform Playback Tool ft f^iccScopc software now allows you to gd bade, review, i 9 and analyse up to 1000 captures ¥ within its waveform playback tool. Technology The PicoScope 33CK3 Senes or osc lloscopes from Pea Tffchcicdoigy includes general purpose- and high resolution mode's; With 12 bn resolution .ind ' \. accuracy, she TQM Hz PicoScope 3424 is able to detect changes is small as 0.024'^ (244ppm) - making it the ideal Channel oscilloscope for anafep. design and analysis. The higher speed S hit models in the Pieekopo 3000 scr cs fcilure samp i n t - rates up :o 2 G 0 MS/* dnd u p to 1 MS/v record length* for general purpose and portable ■tppSicntions. , The Pico^copc 2 (X 50 series oscilloscopes offer single and dual channel units that offer highly ^ portable/ low Cost solutions to jciilrlJ purpdtc telling. The .(.ward wmhirtf? 25 MHi: h.indhc-ld Ri« 35 ctipc 21 0 5 « fits CL R4 1^ -1 O O if) CL if) C/5 R5 R3 R2 RIO R11 R9 +VDD R1 R8 36 37 38 39 40 32 R6 C20 rill C21 rih C19 rlh I in in 29 30 31 28 27 35 34 CL < O SI SCL AO RST CL < o CL co CL < o CL CM CL < o CM CL < O CS1B VOUT VO LCD1 LC DISPLAY EA DOG Ml 28 VI M2 V3 V4 O CM Q 0 > O > A1 A2 A3 Cl C2 <« « C3 C/5 C/5 > > +5V © R19 , rS- 1 R20 ! | icon I— 1 , R21 L-p00o]-(> C22 21 C18 22 C17 23 C16 24 C15 25 C14 26 T T T T T " [Tp "p "pp "p p u p 18 19 20 +5V © IC4 SW3 o I \TX/RX *- \TXD2 R22 Q3 33 o R18 © b > o— u y T R23 H 680 Q h SW2 TXD/A / A 0^22/ U 0 RXD/B / SW1 SN75176BD P7.6 BC548 070827 - 1 1 Figure 1. The circuitry around the M16C is relatively uncomplicated. troller to the display), so only two sig- nal lines are necessary All in all, only five microcontroller I/O pins are needed - two for the data lines and three for the control lines (RESET, /CS and DATA). The display also features a very low profile of only 5.8 mm. The integrated LED backlight and automatic contrast adjustment ensure good legibility un- der all conditions, combined with low current consumption. Thanks to its pin- header contacts spaced at 2.54 mm, the module is easy to fit on a PCB. And on top of all this, it is available in sev- eral colour combinations (e.g. from Re- ichelt Germany [3]). Microcontroller Our search for a suitable microcon- troller led us to choose the Renesas M16C28/29 [4]. This 16-bit machine has an impressive array of features. With 128 kB of flash program memory, 4 kB of flash data memory and 12 kB of RAM, it is generously endowed with storage capacity. Although the display has its own graphic memory, the data for the display must still be assembled in the microcontroller. A monochrome display with a resolution of 128 x 64 pixels requires an image memory of 1 kB in the microcontrol- ler for this purpose (128 x 64 8). The M16C28/29 has two DMA channels, so data can be copied directly from the image memory to the display without imposing any significant load on the microcontroller. 5/2008 - elektor 19 MICROCONTROLLERS Figure 2. The data transferred via the SPI link is clocked into the display on the rising clock edge. I write pointer Page 0 Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 DO D7 Figure 3. The image memory structure of the display. Naturally, this little powerhouse in its 64-lead P-LQPFP package also has a lot more to offer. Along with a 10-bit ADC with 16 input channels, it has several timer units, one of which can generate up to eight PWM signals with a resolu- tion of 16 bits. There is an SPI interface for the display (of course), as well as two UARTs available for user-defined functions. A third UART is used for the ISP/debug interface. Without wishing to revive the old de- bate on the relative merits of RISC and CISC architectures, we can sim- ply mention here that the instruction set of this CISC processor is extreme- ly efficient. The instruction execution ZOfl S 3 h*mme h A I ■ V V - I MISiBE KU1 * SM2- (a* E* 1 B 1 2 e i 3 off on i ■ ; r 1 ' fi tl & I* I- Rev. ft (c) 2007 I.K !!!!!!!£ fej f n r, r, ■ t; f r\ t f.M f, f* uuuptingbasic.de # mm time is only 50 ns with a 20 MHz clock. Several registers can be saved on the stack at the same time with a single assembly-language instruction when an interrupt routine is called. This re- sults in extremely short interrupt re- sponse times. For information on other features, such as clock generation us- ing a PLL, we suggest that you consult the datasheet. Circuit The schematic diagram of the circuit (Figure 1) is relatively uncomplicated. It is built around an M16C29 micro- controller (IC1) with a minimum of pe- ripheral components. The Reset input manages nicely with a simple RC net- work (R12/C2). The primary clock sig- nal is generated using an 18.432-MHz crystal (Ql). The microcontroller has a specified maximum clock frequency of 20 MHz. Given the capabilities of the internal dividers and the requirement to have the serial interfaces support all standard baud rates from 300 to 115,200 baud, the maximum clock fre- quency that can be used is 18.432 MHz. However, the SMD crystal used here is a standard component. In the interest of maintaining a low profile, the display is soldered flush against the surface of the circuit board. All other components are mounted on the solder side. This means that SMD components must be used (with a few exceptions). This applies to the second crystal as well (Q2), which operates at 32.768 MHz to provide a second- ary clock signal. There are essentially two situations in which the second- ary clock can play a role. The first is when a timer is programmed to act as a real-time clock, for instance in order to trigger a low-priority interrupt once per second. Alternatively, the second- ary clock can be used in place of the primary clock in order to operate the microcontroller with the lowest possi- ble power consumption. A 10-way MicroMatch connector is used for programming and debugging the microcontroller. The signals avail- able on this connector correspond to the signals needed by the Renesas E8 emulator for this type of microcontrol- ler. The Renesas emulator is available from Reichelt [3], among other sourc- es, but it can also be obtained from Rutronik or Glyn along with an evalu- ation board. The emulator is accompa- nied by a very good C compiler, which 20 elektor - 5/2008 Listing 1. Display initialisation (Data types used: BYTE = 8 bits unsigned, WORD = 16 bits unsigned, INT8 = 8 bits with sign, INT = 1 6 bits with sign, LONG = 32 bits with sign) // Init sequence const BYTE InitList [] = // start line // normal layout can handle a code size of up to 64 kB in the free version. But that’s not all: for the C fans among our readers, the next issue of Elektor will have an article describing a small circuit that lets you program the mi- crocontroller without using purchased hardware. All you actually need to flash into the M16C is a serial inter- face and a few freely downloadable tools (for example, from Renesas), and many readers are probably already fa- miliar with them from the R8C ‘Tom Thumb’ project. Display power The display (LCD1) requires only a sin- gle supply voltage of 3.3 V. The micro- controller can be operated at 3.3 V or 5 V. As the display module is intended to be used in other circuits, we decided on a supply voltage of 5 V. A supplementary low-drop 3.3-V volt- age regulator (IC2) generates the sup- ply voltage for the display. Simple volt- age dividers (R1-R10) are used to ad- just the levels of the signals from the microcontroller to the levels required by the display. Here the fact that the display is driven by only five lines, and only in one direction, is a distinct ad- vantage. It keeps the amount of hard- ware necessary for level adjustment within reasonable limits. The display microcontroller (an ST7565) needs higher internal voltages to drive the LCD segments. For this purpose, a set of external capacitors (C14-C21) must be connected to its integrated charge pump circuit. The LEDs for the display backlight are driven via series resistors R19, R20 and R21 and a simple transistor stage (Q3). The display illumination is always on unless it is programmed otherwise. In the simplest case, the illumination can be switched on and off under software control. However, the I/O pin used for this purpose (P7.4) can also be pro- grammed as a PWM output to provide a conveniently adjustable brightness level under software control. One of the two free serial interfac- es is connected to one of the 14-way headers via an RS232 level converter (IC3, a MAX202). This interface can be used for connection to a PC or a mo- dem. The TinyBasic interpreter, which is described later on in this article, also uses this interface for download- ing program code. (Note: if you’re not afraid of a bit of soldering work, you { 0x4 0 , OxAl , OxCO , 0xA6 , 0xA2 , 0x2F , 0xF8 , 0x00 , 0x27 , 0x81 , 0x16 , OxAC, 0x00 , OxAF }; // Init display -- void InitDisplay ( ) { BYTE nCmd ; LCD_CS = 1; LCD_RES = 0; Sleep (50) ; LCD_RES = 1; Sleep (50) ; LCD MODE = 0; can tap off another V24 signal from the T20UT pin of the MAX202 - see the schematic diagram.) The second serial interface can be con- nected to the header either directly or indirectly via an RS485 level converter by suitable configuration of jumpers SW1, SW2 and SW3. This means that // normal COMO.. 6 3 // normal display // set bias 1/9 // booster regulator on // booster to 4x // set contrast //no indicator // display on // no chip select // 50ms reset delay // 50ms power-up delay / / command mode the module can also be connected to a network and share a bus with other microcontrollers . Drive logic Now let’s turn our attention to the graphic display. The SPI interface is Listing 2. Page copying // Copy a single page void Copy Page (BYTE nPage) { BYTE nPos ; LCD_MODE = 0; SPISend ( 0x4 0 ) ; SPISend(0xB0 + nPage); SPISend ( 0x00 ) ; SPISend ( 0x10 ) ; / / command mode / / memory base // select page // col low / / col high LCD_MODE =1; // data mode for (nPos = 0; nPos < 128; nPos + + ) // copy page SPISend ( Pixels [nPage] [nPos] ) ; // send byte LCD_MODE = 0; SPISend (0xE3) ; / / command mode / / send nop for (nCmd = 0; nCmd < sizeof ( InitList ) ; nCmd++) { SPISend ( InitList [nCmd] ) ; // send cmd Sleep (1); // wait 1ms } 5/2008 - elektor 21 MICROCONTROLLERS operated in Mode 0, which means that the data is clocked into the display on the rising edge of the clock. The timing diagram for this is shown in Figure 2. The individual data bytes are trans- ferred to the display sequentially using this clocking scheme. In the code ex- amples, the SPISend() routine is called for this purpose (see Listing 1). The display must be initialised be- fore any image data is sent to it. The routine that does this is called Init- Display(). This routine sends several commands after the Reset pulse and a short startup time delay. The AO line of the display must be held low while the commands are being transferred. Con- sult the data sheet for the display mi- crocontroller (ST7565) for the specific functions of the individual commands. The sequence of commands shown in Listing 1 is designed to initialise the display to an operational state. The next question is how to send im- age data to the display. To answer this question, you first have to understand how the image memory of the display is organised. The EA-DOGM128 is di- vided into eight sections called ‘pag- es’. Each page consists of a 128 x 8 array of pixels. This means that each page needs 128 bytes. The top left pix- el corresponds to bit 0 of the first byte of the top page. The display has a write pointer in ad- dition to the image memory (see Fig- ure 3). The write pointer can be set to a specific position in a page by send- ing commands to the display. All data bytes sent after this are written to the image memory starting from this posi- tion. The write pointer is incremented automatically during this process. Naturally, each data byte modifies eight pixels at the same time. Modify- ing a single pixel is thus not possible, and it would anyhow not be especially efficient. Instead, a copy of the image memory is maintained in the microcon- troller, and it is also organised in pag- es. This can be achieved by declaring a suitable variable: BYTE Pixels [8] [128]. All drawing operations are performed directly on this internal image memory. This simplifies the graphics routines, and it is significantly faster. Of course, the internal image memo- ry must be copied periodically to the display. In the simplest case, this can be done by an interrupt routine that copies only one page at a time to the display. The CopyPage() routine first sends several commands to the display to set the write pointer to the start of the page to be copied. After this, the page data is sent to the display, and the process is terminated by a NOP command (see Listing 2). At a data rate of 1 Mbit/s, the copy process takes approximately 1.1 ms. Listing 3. Pixel setting // Set a single pixel void SetPixel (BYTE x , BYTE y) { if (x < 128 && y < 64) { BYTE nPage = y / 8 ; BYTE nMask = 1 << y % 8; Pixels [nPage] [x] |= nMask; // clip // calc page // calc mask // set pixel Figure 4. The Bresenham algorithm constructs lines as sequences of adjacent pixels. Here three steps in a straight line are followed by a diagonal step (see Listing 4). 22 elektor - 5/2008 If the interrupt routine is called every 10 ms, it takes around 80 ms to transfer a full image. Naturally, it is only neces- sary to copy the pages where changes have actually occurred. For this pur- pose, a ‘Dirty’ flag is maintained for each page. It is set by the graphics routines. The alternative ‘high-end’ solution is to use a DMA channel for the page data. Listing 4. Line from point A(ax,ay) to point B(bx,by) // Draw a line void DrawLine (BYTE ax, BYTE ay, BYTE { INT X = ( I NT ) ax ; INT y = (INT) ay; INT dx = (INT)bx - ax; INT dy = (INT) by - ay; INT8 SX = 1; INT8 sy = 1; if (dx < 0) { SX = - 1 ; dx = - dx ; } if (dy < 0) { sy = -1; dy = -dy; } if ( dy < = dx ) { INT C = 2 * dx; INT m = 2 * dy; INT d = 0; while (x != bx) { SetPixel (x, y) ; x += SX; d + = m ; if ( d > dx ) { Y += sy; d - = C ; else { INT c = 2 * dy; INT m = 2 * dx; INT d = 0; while (y != by) { SetPixel (x, y) ; y += sy; d + = m ; if (d > dy) { X += SX; d - = C ; bx, BYTE by) // start // distance // step width // x orientation // y orientation // select direction // draw in x direction // set pixel // step x // draw in y direction // set pixel // step y Graphics programming Now that you know how to connect and program the EA-DOGM128, you might think that you’re all set - but in fact you’re just getting started. Here we want to talk about drawing line and circles, which is not as simple as it seems. Of course, the first thing you need is a routine for setting the values of indi- vidual pixels, which goes by the name SetPixel(x,y) - see Listing 3. As the im- age memory is virtually located in the RAM of the microcontroller, the routine only has to set the right bit. One of the most important tasks in this connec- tion is range checking, as otherwise it would easily be possible to set bits that have nothing at all to do with the image. When you hear the term ‘straight line’, you may well recall the standard alge- braic formula for a straight line: y = ax + b. It can be used to calculate the y value of a straight line for all possi- ble values of x. This is a good initial approach, but it requires very precise calculation of the factors, in particular the slope a (Ay/ Ax), and even with a precise calculation the formula for a straight line results in a broken line if the slope is steep, due to the quantisa- tion of the x values. Avoiding the need for floating-point arithmetic another is another factor that makes revisiting the ‘stone age’ of computer technology worthwhile. At that time, clever approaches were often devised to compensate for low processing power - something that seems to neglected more and more these days. In the 1960s, Jack Bresen- ham was working at IBM on graphic output for plotters, and around 1962 he developed an algorithm that bears his name: the Bresenham algorithm [5a] [5b] - see Figure 4 and Listing 4. Even now, 40 years later, this algorithm is just as important as ever. Lines and circles The Bresenham algorithm first con- siders only straight lines with slope 0 < a < 1 (first octant). The line is drawn by processing the x coordinates incrementally starting from the ini- tial point and deciding for each point 5/2008 - elektor 23 MICROCONTROLLERS whether the y coordinate should be in- creased. The y coordinate is increased if the error relative to the straight line is greater than half a pixel. The error is calculated for each step in a manner that only requires an integer comparison. Finally, the algorithm can be applied to the other seven octants by mirroring or by reversing the direc- tion of drawing. This yields a very fast and exact line-drawing algorithm. The Bresenham algorithm can also be used to draw circles and ellipses, which avoids the need to calculate sine and cosine values. A suitable listing can be downloaded from the Elektor website [ 6 ]. TinyBasic interpreter As mentioned above, the microcontrol- ler used here has enormous potential, including a relatively large memory capacity, analogue inputs, and a va- riety of interfaces. It would be a sin to use this potential for nothing more than driving the display. To make it even easier for novice programmers to create their own graphic applica- tions, the author has developed a Ba- sic interpreter. Programs can be generated using a convenient PC -based text editor that highlights keywords in colour (Fig- ure 5). The program code can then be downloaded directly to the flash mem- ory of the microcontroller, where it will be launched immediately when the module is switched on. An overview of the language and the available commands is available online [1]. Naturally, it supports condition- al branching and loop commands, as well as mathematical functions such as SIN(), COS(), EXP() and LOGO- There are also commands for graphic output (PLOT, MOVE, DRAW, COLOR, FRAME, CIRCLE, PICTURE, BARGRAPH) and for accessing the hardware (POKE, PAUSE, SOUND, SETCOM, SETPWM, SETPORT, SETCLOCK, SETDRIVE, SETKEYPAD, SETDISPLAY, SETNET- WORK, SETCOUNTER, SEND, RECV, I2CIN, 12 C OUT, and SPISHIFT). As an example, up to eight R/C ser- vos could be connected to the mod- ule, which is enough for a small walk- ing robot with facial expressions and gestures. A sample application... As a sample application to get you started, here we describe how to use Figure 5. The PC-based text editor provides a convenient development environment for Basic programs. Listing 5. Analogue clock in TinyBasic (excerpt) Definitions #def ine BTN1_PRESSED (portO. 5 = 0) ' Button 1 #def ine BTN2_PRESSED (portO. 6 = 0) ' Button 2 #def ine BTN3_PRESSED (portO. 7 = 0) ’ Button 3 #def ine BACKLIGHT port7 . 4 ' LCD backlight #def ine T20SEC 20000 ’ Backlight time ’ Hardware setdisplay LCD_DOGM128x64 setclock REAL_CLOCK setport 7 , $10 setport 0,0, $E0 ' Variables float w,t0,tl byte ho, mi , se , da, mo, ye , x, y byte Icon [18] ' Ini t BACKLIGHT = 1 TimerO = T20SEC gosub Scale ' Main loop Display type Real-time clock Backlight output PB switch pull-ups Backlight on Start timer Draw clock face do if BTN1 PRESSED or BTN2 PRESSED or BTN3 PRESSED then TimerO = T20SEC BACKLIGHT = 1 elsif TimerO = 0 then BACKLIGHT = 0 endif ’ Start timer ' Backlight on ' Backlight off if Time. Second <> se then gosub UpdateTime gosub UpdateTemp endif New second Update time Display temperature 24 elektor - 5/2008 the module to make an analogue clock with an integrated display of the in- door and outdoor temperature. This requires a small amount of additional circuitry for measuring the tempera- ture in a suitable manner. A temperature-dependent current source, such as the AD592, can be used as the temperature sensor. The advantage of this sensor is that it has a linear characteristic. You only have to connect a 10-kQ resistor in series with the sensor in order to covert the current into a temperature-dependent voltage with a scale factor of 10 mV/ K (see Figure 6). Unfortunately, this sensor is relatively expensive. As an alternative, you could construct a sim- ilar circuit using the more economical LM344 sensor. The AD592 supplies a current of 273 /dA at a temperature of 0 °C. This results in a voltage of 2.73 V across the resistor. The analogue inputs (in this case PO.O +9V...+12V Figure 6. This additional circuitry can be used for temperature measurement. and P0.1) have a resolution of 10 bits, which means they supply values in the range of 0 to 1023. The currently meas- ured temperature can be calculated us- ing the simple formula ‘temp = (ana- loop logue_value - 559) 2.04’. Naturally, the previously described rou- tines for lines and circles can be used for the analogue clock display. The sin() and cos() functions must be used to calculate the positions of the hands. TinyBasic provides these trigonometric functions (and others) - see Listing 5. As this is supposed to be an analogue clock, the hands should of course move smoothly. For this reason, the positions of the hour and minute hands are inter- polated. This gives the impression of continuous motion. The second hand is represented by a small circle, which is more a question of design than necessity. ...and your own applications If you buy the display board from the Elektor Shop, you receive a fully assem- bled and tested module. The TinyBasic interpreter is already installed in the microcontroller. The Basic development environment can be downloaded from the Elektor website [6] free of charge, along with additional examples and listings. ' Clock face Scale : frame 0,0,127,63 ’ Draw frame circle 39,32,29,25 ' Draw clock for w = 0 to 2 * pi step 2 * pi / 12 x = round(39 + 25 * sin(w)) y = round (32 - 22 * cos (w) ) plot x,y next for w = 0 to 2 * pi step 2 * pi / 4 x = round(39 + 26 * sin(w)) y = round (32 - 23 * cos (w) ) plot x,y next return ' Hands Clock : ’ Hour hand . . . w = pi - (mi * 60 + se) * 2 * pi / 3600 x = round(39 + 23 * sin(w)) y = round (32 + 19 * cos (w) ) move 39,32 : draw x , y ’ Minute hand. . . if ho > 11 then ho = ho - 12 w = pi - (ho * 60 + mi) * 2 * pi / 720 x = round(39 + 18 * sin(w)) y = round (32 + 16 * cos (w) ) move 39,32 : draw x , y ’ Second hand. . . w = pi - se * 2 * pi / 60 x = round(39 + 23 * sin(w)) y = round (32 + 19 * cos (w) ) circle x, y , 1 return For beginners, we have also put togeth- er a step-by-step guide that describes how to install the necessary software on the PC and how to download your own application. ( 070827 - 1 ) Web Links [1] www.tinybasic.de/ [2] www.electronic-assembly.de/deu/dog/dog. htm [3] www.reichelt.de/ (in German) [4] www. ml 6c.de/ [5a] http://en. wikipedia. org/wiki/Bresenham_algorithm [5b] http://www-lehre.inf.uos.de/~cg/2002/ skript/node30.html (in German) [6] www. e I e kto r. co m Component availability notice Ready assembled and tested board including display and pre-programmed microcontroller (bootloader and Basic Interpreter) available from the Elektor Shop, order code 070827-91 . Bare PCB, ref. 070827-1 available from www.thepcbshop.com. 5/2008 - elektor 25 HOME AUTOMATION SERVER assembly, test and software DjgiButler (2) Richard Sumka & Eric Gregory (Freescale Semiconductor Inc.), Luc Lemmens &Jan Buiting (Elektor) Continuing on from the April 2008 issue, in this the second and final part of the article we go about assembling the kit and connecting up the hardware and software to get DigiButler active on the web and in control of an electrical appliance in your home or office. Assembly and test All components used in this project are con- tained in a kit that’s avail- able through the Elektor Shop as # 071102-71 (Figure 1). The PCB contained in the kit comes with all but six SMD compo- nents ready-soldered and the Coldfire micro ready programmed with the Di- giButler firmware. This makes building the project a matter of soldering three dozen or so through-hole components and six relatively large SMD parts in- cluding the Ethernet transformer Tl. The component mounting plan of the DigiButler board is shown at true size in Figure 2. The associated parts list clearly indicates which parts are prestuffed on the board you get, and which ones have to be soldered. Assembly of the board should be straightforward using the parts from the kit. Solder the SMD components first and follow with the through-hole components. The SMD parts you have to solder yourself are: • capacitors C20, C21 (both 4.7/jF solid) located at the underside of the board; • capacitor C15 (4 ^l/F 7 solid) located between Jll and J12 located at the top side of the board; • transformer Tl (H1102NL) located at the top side of the board. Triangle marker on the PCB overlay to regis- ter with the white dot printed on the device; • quartz crystal Y1 (25 MHz) located at the top side of the board; - voltage regulator U2 (LD29080DT33R) located at the top side of the board. If you use a fine-tipped solder iron and the usual care and precision then mounting these parts should not cause problems. Give the mounting of Tl a thorough visual inspection to make sure no adjacent pins are short- Figure 1. The DigiButler kit ready to be assembled, complete with the SMD-prestuffed PCB. The project is an hour's worth of careful soldering, (packaging not shown; actual parts supplied may differ from photograph) 26 elektor - 5/2008 installation Exercise extreme caution if using this board to switch power to an AC mains powered load as dangerous voltages will exist on the pins of J14 and RE1. The maximum current switched by the relay contacts is 2 A. If in doubt consult an experienced professional. circuited by solder blobs. Now, on with the soldering of the lead- ed parts from the kit. Voltage regula- tor U2 has a thermal pad on the un- derside of the device, the tip of which should be soldered to the nearby cop- per square on the PCB. The centre pin is not used — the metal pad establish- es the ground connection. The connectors, fuseholder and relay should be assembled last. Pay special attention to J14 and RE1 which should be placed on the board together before being soldered. The ‘pin-1’ marker printed on resistor networks RN1, RN2 and RN3 should register with the respective little circles on the PCB overlay. Watch the polari- ty of radial electrolytics C22 and C25, LEDs D2 and D4, diodes D1 and D3, and finally U4, the MAX3232ECPE. When placing the assembled PCB di- rectly onto a hard surface, take care to avoid damage to the passive surface mount components at the underside of the PCB. Four 5 mm high PCB pillars secured with M3 nuts will take care of the problem. The base of RS232 socket J13 may be secured to the board using two M3 screws and bolts. RJ45 socket J2 has two plastic studs that snap secure into the 3 mm holes on the board. Do not install jumper JP2 (BDM_ENa- ble) and set JP1 (BDM_SEL0) the right- hand position (2-3). Check the board carefully before apply- ing power. Ensure that all solder joints are good and that there are no shorts. Connect power to the board using ei- ther an unregulated or a regulated DC supply with an output voltage of 5-8 V. LED D2 should light up. I can do it cheaper Be our guest, although you’ll find the price of the DigiButler kit hard to beat. Especially for those among you who insist on sourcing their components lo- cally and doing the microcontroller pro- gramming all by themselves we also supply the same SMD-prestuffed PCB with an empty microcontroller as Ele- ktor Shop # 071102-1. ‘Empty’ means no firmware in the MCF52231, so you will also need the TBLCF hardware and software, or a professional equivalent from Freescale or a third party. TBLCF hardware For completeness’ sake we recall that the PCB design and construction notes for Daniel Malik’s Turbo BDM Light Coldfire Interface (TBLCF) may be found at [7] referenced in Part 1 of this article (April 2008). PCBs for the TBLCF are supplied through the Elektor Shop as # 071102-2. The bare board is shown in Figure 3. You will need TBLCF if you want to make changes to the DigiBut- ler firmware, or use the hardware as a Coldfire development system. Remember the ‘free samples’ trick we showed in last year’s 3- Axis Ac- celerometer article? Use the Frees- cale website again to get a free MC908JB16JDWE chip for the TBLCF programmer. For the project name, en- ter: ‘Elektor DigiButler’. Caution: the supply of free samples is strictly at the discretion of Freescale Semiconductors Inc. Look in Elektor’s forum topics on Figure 2. DigiButler board layout. The board comes with all but six SMD parts premounted 5/2008 - elektor 27 HOME AUTOMATION SERVER Figure 3. TBCLF board, unstuffed. the SpYder and Accelerometer projects how others did it. TBLCF is programmed from the ground up as described in its exten- sive manual. Compilation and programming Code (re)compilation and device (re)programming is only necessary if you COMPONENTS LIST 1 . Components pre-fitted on board Resistors R3 = 12kQ, SMD 0805 R4 = 390D, SMD 0805 R5 = 1 0MD, SMD 0805 R6,R7,R8 / R9 = 51 a SMD 1206 Capacitors 02,03,04,012,013,014 = 220nF ceramic, SMD 0805 09,010,011 = 1 OOnF ceramic, SMD 0805 017 = 220nF ceramic, SMD 1 206 05, 06 = 22pF ceramic, SMD 0805 07 = 1 nF ceramic, SMD 0805 08 = 1 OOnF ceramic, SMD 1 206 016=1 OnF ceramic, SMD 1 206 Inductors FBI ,FB2 = BLM31 PG601SN1 ferrite bead, SMD 1206 Semiconductors Ul = MCF52231CAF6 (Freescale)* 2. Components to fit on board Resistors R1 = 22Q SFR1 6S R2,R1 7,R1 76 = 10kDSFR16s R15 = 470D R10-R13 = 75Q SFR1 6S R14 = 270D R16 = 1 kf2 SFR16S RN1 = 7 -way 4kf27 SIL RN2 = 5-way 1 Old! SIL RN3 = 7-way 1 Old! SIL Capacitors 01,023,024, 026,0143,0144-0147 = lOOnF ceramic, lead pitch 5mm 015,020,021 = 4yL/F7, solid, SMD1 206 C18 = 2nF2 1000V ceramic (TDK) 022 = 330/-/F 16V, electrolytic, radial 025 = 220/l/F 6.3V, electrolytic, radial Semiconductors D1 = 1N4004 D2 = LED, 3mm, green D3 = 1N4148 D4 = LED, yellow, 3mm Q1 = BC546B U2 = LD29080DT33R (STMicro) U4 = MAX3232ECPE Miscellaneous FI = 0.5A slow, 5x20mm J1 = 26-way double-row pinheader J2 = RJ45 socket, PCB mount J3 = DC adaptor socket, PCB mount J 1 1 = 1 0-way double-row pinheader J12 = 8-way double-row pinheader J 1 3 = 9-way sub-D socket (female), angled pins, PCB mount J14 = 2-way terminal block, 5mm lead pitch JP1 = 3-way pinheader with jumper JP2 = 2-way pinheader with jumper RE1 = G6D-1 A-ASI-DC5 (Omron) SI ,S2 = pushbutton, EVQ-PAE05R Panasonic) T1 = HI 102 Ethernet transformer (Pulse) Y1 = 25MHz quartz crystal Fuse holder, PCB mount Kit of parts, Elektor Shop # 071 1 02-71 , contains all parts and SMD -prestuffed cir- cuit board (see text) PCB, Elektor Shop # 071 102, available separately. Marking: 00286_01 "home au- tomation unit" PCB for TBCLF, Elektor Shop # 071 1 02- 2 ** * ready-programmed on PCB in kit 071 1 02- 71; blank on PCB 071 102-1. ** optional, see text. 1. have an unprogrammed board # 071102-1 and/or 2. want to make changes to the exist- ing firmware. The project software including the full C source code is available from the Elektor website as a free download — you’ll find it as archive file # 071102- 11. zip. Unpack it into an appropriate directory. Compilation and (re)flashing the MCF52231 requires CodeWarrior De- velopment Studio for Coldfire Archi- tectures, v. 6.3. CodeWarrior is an in- tegrated development environment which includes a project manager, ed- itor, compiler and debugger. Version 6.3 is a free download. At ref. [1] it’s marked as “Updates and Patches” but Elektor has ‘inside information’ that it’s actually a full install version! The download is about 140 MB. Type ‘Ele- ktor DigiButler’ when you are asked for the project name. At the time of writing, the ‘Special Edi- tion: CodeWarrior for ColdFire Archi- tectures’ (v. 7.0) revealed some issues with the MCF52231 micro we’re using. An update/patch or service pack for 7.0 has been announced by Freescale. It should be well worth the wait con- sidering that the suite can compile up to 128 k of code in ‘C’ and unlimited as- sembly code. The Special Edition can be downloaded at [1] too — sit back & relax for 270 MB or so. Programming and debugging also needs a background debug pod such as TBLCF or the USB-ML-CFE [2] from P&E Micro. A detailed procedure to do the firmware flashing is given in the ‘(re-)FIashing your board’ inset. Network connection The most important part of the project is connecting DigiButler to a network, and for this we need an IP address for the board. An IP address is similar to a telephone number and allows the board to be identified by other devices on the network. By default, the board software is configured to request an IP address from a DHCP server, although it can be reconfigured to have a fixed, or static, IP address. Most home ca- ble or DSL modem routers have built in DHCP server functionality and are able to provide local IP addresses. To link to your network, connect the Di- giButler board to your router using a standard RJ45 cable. Next, connect the 28 elektor - 5/2008 board to a PC’s COM port using a regu- lar RS232 cable. USB-to-RS232 adapt- ers are often problematic so an (older) machine with a real serial port (COM) is preferred. If necessary, borrow the kiddies PC. Start up a terminal session such as Minicom for Linux or HyperTerminal or TeraTerm for Microsoft Windows. The communication settings are - 115,200 databits/second - 8 data bits - no parity - 1 stop bit - no flow control Power up the board and push switch SI to reset it. This will cause the applica- tion software to communicate with the DHCP server in the router to acquire an IP address for the board. On the PC screen, the terminal window will display the board IP address, like F 4, indicating connection to the network and ability to be accessed remotely. Note that it takes a few seconds for the board to obtain an IP and include it in the message sent to the terminal. Got the complete message? Congratu- lations, your hardware is working. If you just want to connect the board direct to a PC, you will need a crosso- ver RJ45 cable and a fixed IP address in the application software. Ethernet setup and access security We have assumed so far that DigiBut- ler will be connected to the Internet via an Ethernet router. A router allows many computers on a local network to share the same internet connection. It also prevents unwanted Internet visi- tors accessing those same computers unless authorised. Preventing access to your private Di- giButler could be a problem if it were not for a router feature called Port Re- direction or Port Forwarding, see Fig- ure 5 for a typical example. Port For- warding lets through Internet traffic destined for a given IP address and port and then sends it to a computer or other device on your local network. Let’s say the local IP address of the server is 192.168.0.2 and the address of your router - given to you by your Internet Service Provider (ISP) — is 86.131.222.120. Login to the administra- tion pages of the router and change the router settings to forward any incom- ing traffic destined for port 80 to DigiB- utler at address 192.168.0.2. Anyone who now enters http://86.131.222.120 in their web browser will be taken to your DigiButler board. Be aware that you probably won’t be able to see the server if you try this from a PC on the same local net- work. Instead you will have to use http://192. 168.0.2. Another important point to note is that each port can only be forwarded once. It’s not possible to have port 80 for- warded to multiple IP addresses so you won’t be able to run a web server on a local network and also run DigiButler as they both use port 80. The end result: network, web and WAP The home automation server is ready for access over a network as soon Figure 4. "It's alive Jim!" Output from serial port after DigiButler is reset. as the Coldfire device has been pro- grammed and the network cable is (re-)Flashing your board The following procedure was recorded with a PE Micro parallel programmer / debugger pod connected to J 1 on the DigiButler board, a laptop PC running Windows XP and a down- loaded version of CodeWarrior 6.3. TBCLF may require different jumper settings and steps, please consult the TBCLF documentation. Updates to this procedure may become available at www.elektor. com/digibutler_en. 1 . Fit jumper JP2 and set jumper JP1 to the right-hand position (2-3). 2. Start the CodeWarrior IDE, open the project 'elektor.mcp' using the File-*Open command in the IDE menu bar. Connect the debug pod to connector J1 and apply power to the board. 3. Use Tools-*Flash Programmer to bring up the Flash Programmer dialogue box. 4. In the Target Configuration menu, Browse to the Target Initialization files and there select and Open: M52235EVB_Pne.cfg 5. In the Flash Configuration menu, select: CFM_MCF52230 25 MHz. 6. Go to the Erase /Blank Check menu and run an Erase action. This is useful to check if the connection to the target is okay. If erasure is successful, the comms are okay. Click on Save Settings. 7. Now go to Program/Verify and browse to the file 'web_coordina- tor' (without an extension). This is a precompiled binary image, in- cluded for those who do not wish to recompile the source code. 8. Program the device! With the de- vice programmed, the board is ready to be used. Flsvli Piug^-mr piRjf os® 1 CoW'gwttofi Fla;h Pnij.ni ,‘Vnfv £iait /'Blank Ctwcfe ClmtajE Pict«i V UvlioiunSiflr'i; |n» V gnu ”3 fcwrtc*.' jj T nw M toteof 0 iff# 1 Mm.** ftJIri Ajfciftn ik'niifxn TaraatMHi»njDJIn Sin: flfclDWOQOW" r VMj Hvaty'uAbK Showing LogdSMrfL. ] £»we Gettmgi m | Cmd Use Tarfiat Initialization file Look in. J _j li«li/4/H HLFSiHaVB INJOflMinW-D IN2QTD01GN-T IhlJtiFlQfllHtt* in;wjiig-: i mWdKBC I Seitei Addin* CWMOT OWCOWF iV'Vf&vi KMocrrr QQOOIOOD BHBI7FF mmiaai tooniFFF i i i i uj ij mMfoTF Ml.™ mogqmq imniFr MMpMp DMWFFT gfflWffl [MKH7FF QWUMl OaiMFFF flfiWjrYili inifc.iTT UHMfl UDWftfH OttOCOCO DMffilfT ijK'XiOi 1 pOKfiTFr OUXUKi DO0O75FF CKO?™ wsw nwff Show Log load ’-srt w. | tavern 5/2008 - elektor 29 HOME AUTOMATION SERVER connected to either a rout- er or a PC. Remember that when connecting directly to a PC, the network cable must be a crossover type. Enter DigiButler’s IP ad- dress in the web browser of a PC on the same net- work and an authorisation dialog box will be present- ed (Figure 6). The default user name is ‘user’ and the password is ‘1234567’. If required, both can be changed in the project source code. ^D5L-:[!4+ CjL : anfigurat on Q Ms int enancB Cl Summary n I li'lcf in n NH rrk f* f Pf np le \ Port Redirection Port lie dire ctlon State | enabled w - EKlftmn Entry 5 Vdlitl Entry 5 f Tl e (frillies in yr-aj culcii die mapped by UP 11 P. -J Internet Local Inctm Sr-fttr Prn'T'nrn! Shtrt Pm+ fud fnjt 1 nr jiE TP Ariilrrtt 1 enabled TCP SD |SD 19J .IS 6.0.2 rJ Splftrl index tn srI Statu PrntnrnI Iritm nul Start Pmt Erul Puil l nral If Address, Nn( spIftrlF rt unablyd T } rjpIprF Oner TCP WhIHui uwir fjurl T [ g n ■PT Dona Add 1 UpCfl Notebook Successful authentication brings up the default main web page, index.htm. As illustrated in Figure 7, a graphic image on the example default web page shows the status of the re- lay. The project source code allows you to substitute your own image! A dark image signifies that the relay (RE1) (lamp) is off, while a bright im- age shows that the relay (lamp) is on. The relay can be switched on and off remotely using Light ON / Light OFF button on the web page. Application note AN3455 (ref. [2] in part 1) gives an in depth description of an alterna- tive method of switching the relay on and off using web page variables in a browser address bar. From the same web page it is also possible to set a timer for when the relay should switch on or off, this function making use of the Coldfire’s real time clock. And last- ly, the example page allows the user password to be changed if desired. The process for talking to DigiButler over the Internet is exactly the same. Entering the router IP address in the browser of an Internet connected PC gives the same results, but only if the router has been set up for forwarding port 80 to the Di- giButler’s local IP address. In our exam- ple, the router address is 86.131.22.120. Be aware that it might not be possible to access the server from a PC within a local network, if you use the rout- er IP address. If you are having dif- ficulty remembering the IP address, NO-IP [3] offers a free service which maps the IP address to an easy to remember sub domain name. Finding an Internet connected PC is not always possible or safe, so WAP phone access is also sup- ported. Nearly all modern mobile phones have WAR but the serv- Figure 5. Most routers support port redirection or port forwarding. Setting the IP address and port number allows Internet users to access DigiButler on a local network. tern. Both can be used to store web pages, graph- ics files and other con- tent and both allow di- rectory structures and file names up to 255 charac- ters. Since the application looks in the writable sys- tem for a requested file be- fore searching the compile time file system, it’s pos- sible to override the com- piled files. For example, if an image file exists in both file systems with the same name, then the file in the writeable system will be used and the one result- ing from the compile will be ignored. ice is subject to what your provider is offering you. DigiButler’s default WAP page is wap.wml. Entering our exam- ple URL, http://86.131.22.120/wap.wml from the browser of a WAP enabled phone, gives similar results as before but without the images. The WAP pag- es have been tested using Nokia and Samsung mobiles, but may need to be changed to support other manufactur- ers’ handsets. Creating and uploading web pages A neat feature of the software is its support for dynamic uploading of new web pages. The following is in- tended for those having some experi- ence in programming web-connected devices. By implementing an Ethernet writea- ble FLASH based file system, it’s pos- sible to update web pages remotely without reprogramming the Coldfire device. Two files systems are actually implemented — a static compile time system and the dynamic writable sys- Authentication Required *1 Example web pages and Ethernet loading utilities can be found in the web _p age directory of the project. The files required to upload new web con- tent to the automation server are make, bat, filelist.txt, emg_dynamic_ffs.exe and emg_web_u ploa der. exe . The batch file make.bat conveniently calls the necessary utilities to com- press and upload the web-resultant content image file using the files list- ed in filelist.txt. Before executing make, bat, change the IP address in the line emg_web_uploader 10.171.88.63 dy- namic, ffs joshua in make.bat to the board’s IP address as shown in the terminal window. The parameter dynamic. ffs is the name of the compressed file image generated by compression utility emg_dynam- ic_ffs.exe. This compresses the files in filelist.txt into a single image. The parameter joshua is the upload secu- rity key, used to prevent unauthorized upload of web content. DigiButler will verify the supplied security key with the version in memory and upload only if both match. The security key can be changed in the server source code if required. 1; Ehter username and password tor "Home Automaton" at http : if3&, 1 31 . 222 , 1 20 ■ User Name: user Password: Use Password Manager to remember this password. ] CK cancel Figure 6. The first access in a web session requires the user to enter a username and password before access is granted to the main page of the home automation server. An example of the contents of filel- ist.txt is shown below. These files will be compressed into one im- age for upload to the server. The last line in the file must be a blank line with only a CRLF (i.e. hit En- ter in the last blank line). * This is a list of the files stored in the bin file. 30 elektor - 5/2008 * The files are arranged in the order they are listed here. index . htm kitchen . jpg black . jpg main . j s pot_data . txt f sllogo . gif variables . htm wap . wml wapl . wml wap2 . wml wap_main . wml incorrect . wml Overcoming firewalls l_| Home Automation Demo x' freescale $Qfn\oonC1/-^ r - ID 2D 3 V n 9 10 14 13 12 11 4094 LCD1 ( \ HD44780U LC DISPLAY 20 x 4 V J > O (f) r^tOlDTfCOCMi-O C/) O Q c/) DQQQQQQQUJirCE>>> lJ 1 C 1 c 1 c 1 c 1 c Li 14 13 12 11 10 D1 BAS70 Pi \ 10k +5V -© 071148-11 Figure 1. The LCD interface is built around a shift register. that models differ, as the manufactur- ers are not consistent as to whether the backlight supply should be locat- ed next to pin 1 or next to pin 14. Our printed circuit board is designed for displays where the backlight connec- tions are on pins 15 and 16, and two pads are provided to which the back- light power supply can be soldered. If a different display is used it is sim- plest to use just the 14 main connec- tions and leave the backlight uncon- nected. The display we used has the following pinout: Pins 14 down to 7: data bus Pin 6:E (enable signal), active high Pin 5: R/W, 0 = write, 1 = read Pin 4: RS, 0 = command, 1 = data Pin 3: VO, contrast adjustment from 0 V to 2 V Pin 2: VDD, +5 V Pin 1 : VSS, 0 V The direction of data transfer is spec- ified by the level on the R/W signal. Here we only use write mode, and so the pin is connected permanently to ground in the circuit (Figure 1). The internal registers of the display con- troller are selected using the RS signal, which is used to distinguish between data and commands. Two- wire interface The circuit is based around a port ex- pander that uses two port bits. A natu- ral choice for such a design would be the I 2 C bus, but we have chosen a fast- er and cheaper approach. All that we need is a type 4094 shift register (see Figure 1). This allows clock rates of sev- C compiler Advanced C programmers who wish to control an LCD using the ex- pansion module described here can take advantage of two exam- ple programs available for download from the Elektor website. One example is for use with WinAVR (GCC) and the other is for use with CodeVision. Software house HPInfoTech has produced a special free-of-charge ver- sion of their popular 'CodeVisionAVR' compiler for this Elektor project. The compiler supports the ATmega48, ATmega88, ATmegal 68 and ATmega328 with a maximum object code size of 4 kB. A version limited to 1 6 l nf-fiimrtf mwiiurtifiMinl qI gplrgge., currc-nl and rev&lnnce-. Graphics and Data Displays A rongtr of donuDhiic data displays taw controller based applications Oi-gi Sable in LCD or LED, Custom Displays custom dct-gn service -Gita-ring o dtotco oF lachnologics to dollar a hieciionalL oad-alfactivit ctrta rcWbta disptatf sotaiion Fgr your your next project, Lascar can help. ( 0 ) 1 79 a S 3 4616 « E-mail: 5 ales@Iascar. co.uk 5/2008 - elektor 41 REFLOW SOLDERING Soldering SMDs with Simple job thanks to comprehensive Harry Baggen The latest version of The Elektor DIY SMD oven, which goes by the name of 'Reflow Control', makes easy work of doing your own soldering of SMD parts on printed circuit boards, using a simple little electric oven. We already introduced the electronics for this project in last December's issue. There is now a comprehensive kit available for this project, which allows even electronics enthusiasts with two left hands (do they exist even?) to easily build such an SMD oven. Since more and more electronics components are now avail- able from their manufacturers only in SMD versions it is as a designer impossible to avoid using SMD parts. But making a single circuit or a small run of a few boards does not jus- tify (certainly for use at home!) the purchase of a real SMD oven, which is necessary to mount all those little, leadless parts on the board. Can't we think of a simpler solution? Yes, of course we can! As we already wrote in the Decem- ber 2007 article, with a special control circuit you can transform an ordinary kitchen oven into a handy SMD bak- ing station. The control circuit that is required for this is now available from Elektor as a kit, so that there is no chicken and egg problem. To solder the SMD parts on the PCB you really need a reflow oven. But this is not ready yet because you need this board for that... etcetera. Now, that is no longer a problem because of this handy kit. Simple job The kit available in the Elektor Shop under part number 060234 contains all the parts for building the controller section. The only other thing you need is a cheap electric oven that you can buy from any appliance store. A quick recap of the requirements for this oven. Use a simple analogue type, that is fitted with a mechanical thermostat and a mechanical clock. The temperature has to be adjustable to at least 225 Q C and preferably a lit- tle higher still. It is also beneficial if the volume of the oven is as small as possible. This allows the temperature of the oven to increase rapidly. A power rating of 1 .5 kW is usually enough. There is no need to make any changes to the oven itself. 42 elektor - 5/2008 The plug on the end of the standard power cord is replaced with the appliance connector that is included in the kit. The thermocouple from the kit is attached inside the oven. Contents of the kit The kit for the Reflow Control circuit contains a complete- ly assembled main board, a display and control panel board, and an enclosure with pre-milled front and rear panels. Plus of course all the other required little bits and pieces such as thermocouple, sockets, nuts, cables, cable ties, self-adhesive feet, mains switch, IEC connectors and a mains cable. You only need to mount the boards in the case and make a few connections between the PCBs and the sockets/switch on the rear of the box. The kit includes a clear construction manual which gives a step-by-step description of what you have to do. Even with- out electronics knowledge it is easily assembled within an hour. A separate operating manual describes how to use the Reflow Control circuit. This manual also discusses the calibration, the changing of the temperature profile and dry- ing of components ('baking') using the oven. With this kit you can build a very handy SMD oven in no time at all. A very useful device that quite possibly you may end up using more often than your ordinary solder- ing iron. ( 071007 - 1 ) 5/2008 - elektor 43 AUDIO Part 2: The voltage amplifier and input Jan Didden 44 elektor - 5/2008 ith Error Correction buffer stages Last month we discussed the principle of error correction and developed an error-correction power output stage. In this instalment we will use H.ec in a voltage amplification stage and present the complete amplifier. Let’s revert to the conceptual circuit of error correction as defined by Mal- colm Hawksford, shown in Figure la. We know that if summing circuits SI and S2 are unity gain summers, we get V 0 ut = ^in> an ideal gain-of-one amplifi- er stage. But for our voltage amplifica- tion stage (V as ) that drives the output stage, we need much more than uni- ty gain. Common amplifier gains are around 26 to 30 dB, a gain of some 20 to 30 times. I like the lower value be- cause it is better to have less gain in the power amp than to have a lot of un- necessary gain, only to turn down the volume control to get rid of it. It turns out we can use H.ec in voltage amplifi- ers quite easily if we insert an attenua- tor in the V out sense leg, similar as we would do in a regular negative feed- back circuit. We do that in Figure lb. The sums are slightly different: ^c = (^out/^)-V e , but still V = V - V e in c ■ Substitution and rearranging shows us that V out /V in = 1/B. So, if we make B, as is customary, from a simple resis- tive 1:20 voltage divider, we have now an amp with gain, linearised by error correction. There is one other very important thing to note here. When we found that the open loop gain no longer is part of the amplifier transfer equation, we said that the gain of the amplifier block no longer has any bearing on the final re- sult. That is true in theory, but not in practice. In the case of the power out- put stage, we said the gain is ‘about 1’. A realistic value would be 0.98 at mid frequencies and light load, down to 0.95 at higher frequencies and higher loads. That means that the error correction cir- cuit needs to add 0.02 to 0.05 times the signal level to the input to straighten out the amp. Intuitively we feel that it is advantageous to have only small sig- nals in the error correction circuitry that helps it to work linear and with low dis- tortion. But in the case of the V as , if the forward gain block would have only a gain of 1, the error correction circuit would have to add 19 times the sig- nal level, and it would be much more difficult to design simple circuits that could handle those levels with high lin- earity. So, what we would want is to make the open loop gain of the V as am- plifier block such that the signal levels in the error correction circuit are mini- mized. This will be the case when the open loop gain is as close as possible to the closed loop gain. Then, there will be quite small differences between the input of the actual amplifier and the scaled down output (by B), and that small difference then is the error sig- nal. This limits the signal levels in the error correction circuit, greatly relieving the burden on the H.ec loop. In other words, you set the V as open loop gain as close as possible to the required am- plifier closed loop gain. This of course is totally at odds with what you would do for a negative feedback amp. There, you would try to get the highest open loop gain you can get away with, sta- bility wise, to have a lot of excess gain for the feedback loop to work with. Not so with H.ec, and a corollary to this is that your V as can now be a very simple gain-of-20 amp. Voltage amplifier The particular topology I chose is in Figure 2. It’s very simple. U1 is a uni- ty-gain buffer. V in applied appears at the buffer output across R7. The out- put current through R7 comes from the supplies, of course, so we find a signal current V in /R7 in the current mirrors formed by Q1 and Q3. The quiescent current for the buffer (I will tell you lat- er which buffer type I used) happens to be about 7 mA. With an R7 value of 220 Q, and a current of 14 mA peak- to-peak available, this buffer can han- dle a little over 3 V peak (about 2 V RMS ) before running out of class-A, which of course is good for linearity. With an amplifier gain of 20 that is enough to deliver 100 W in 8 Q. That same signal current in Q1 and Q3 is mirrored through Q2 and Q4, and flows through R16 to generate the output volt- age. As a first approximation, because the same signal current flows through R7 and R16, and the signal across R7 is the same as V in , the gain (open loop) of 5/2008 - elektor 45 AUDIO this circuit is simply R16/R7 which is then set to 20. So, this is our V as stage. But in the discussion in Part 1 we said that the amplifier out- put stage needs to be driven by a low (and constant) source imped- ance (ideally zero) for the output stage H.ec to work; so we add a low output impedance emitter follower stage to the basic V as stage (Q10, Q9). This emitter fol- lower stage is also biased at about 7 mA. Because of D3, the voltage drop across R6 and R8 is about the same, so if we chose R6 = R8, the same current flowing through Q2 and Q4 will flow through Q10 and Q9. D3 and D4 also provide a measure of temperature stabiliza- tion to the emitter follower output stage bias current. Now that we have the main gain block for the V as , we enclose it in an error correction loop similarly as we did with the output stage: Figure 3. There are a few things to note here. Although both the ec sense and the ec generation resis- tors are given as l R\ they are not equal. The sense resistance actu- ally is the sum of resistor R plus the output resistance of the B -network (R11//R12). It is the total resistance of R plus R11//R12 that determines the error current into the CCII. That same current generates the ec voltage when flowing through the left side R, and these volt- ages should be equal, so similarly, the left side R is actually the series resist- ance of the nominal R and the output re- sistance of whatever will drive the V as . We’ll revert to this issue later. The second thing to note is that the gain of this amp is not strictly 1/B. Ter- minal Y is a virtual earth point. To cal- culate the exact attenuation from Vout the node Rll, R12 and R, we need to account for the fact that for the attenuation, seen from the V as output V drive , R ap- pears in parallel with R12. So, the attenuation, and thus the gain, is slightly higher than 1/B. We need to consider both of these issues when we dimension the error cor- rection sense and generation re- sistors. Just as with the output stage, we will use an AD844 for the ec circuit, while the buffer is used in the amplifier input stage to drive R7. The complete V as cir- cuit is shown in Figure 4. What we haven’t mentioned yet are the diodes D9, D12, D13 and D14. In Part 1 of this article we have dis- cussed what would happen if we over- drive the amplifier. The positive feedback loop is regenerative and will continue to increase the input signal until stopped by some physical limit like the supply voltage or current or voltage limitations in the circuit. (We also saw in part 1 that, because of the lower open loop gain, overdrive can be expected to be less se- vere; but we still need to deal with it). In the V as stage, this is taken care of by the four diodes across the error correction generation resistor R29 (Figure 4). When Figure 3. The CCII as the H.ec element for the V as stage. the amplifier is overdriven, the er- ror correction current out of pin 5 of the AD844 CCII will increase con- siderably. This current will start to generate a large correction voltage across R29, to the point that the threshold voltage of the diodes is reached. At that point, the imped- ance of R29 collapses to just the dynamic diode impedance that is only a few tens of ohms. Further increases in the error correction current will not generate more er- ror correction voltage and the posi- tive feedback loop is broken. This makes the clipping clean, and re- covery fast. But we run the risk that the diodes increase the dis- tortion because they may already conduct a small current before the threshold, upsetting the error cor- rection accuracy. It turns out that because of the very small error cor- rection voltages across R29, this can be avoided. In Figures 6 and 7 you see that if we would use a single pair of soft clipping diodes, the distortion starts to rise before maximum output. With the dual pairs, the difference is very small. Figure 8 shows this effect from a different perspective. The soft clip- ping diodes for the negative signal part have been temporarily removed so only the positive signal is affected. You can see that without the diodes, clipping recovery is delayed (negative part), while with the diodes (positive part) there is only a hint of delay. Buffer stage and DC offset All that is needed now for a complete amplifier is the input buffer and the DC offset servo. This is shown in Fig- ure 5. Just as with the output stage, we need to drive the V as input resistor, which develops the ec voltage (R29), with a low im- pedance source. You guessed it: we will again call upon the open loop buffer in an AD844 to drive the V as from V in . The signal enters the buffer in U2 through R51 and R33 at pin 5 and exits at pin 6. The enemy of your loudspeakers (and the amp as well) is DC offset at the output terminal. Most am- plifiers have some sort of means to avoid that. In this amplifier, the output stage doesn’t need any additional measures: the er- ror correction ideally duplicates the driving voltage (from the V as ) 46 elektor - 5/2008 to the output terminal, with zero offset, although there will still be some offset from the error-correcting AD844, which will generate a small DC offset of a few millivolts. The only requirement is that the V as has negligible DC offset. The V as however has higher gain and will amplify its own AD844 offset with that gain. I decided to implement a DC ser- vo to keep the V as offset under control. The servo uses a low offset opamp, a TL051CE We will use the uncommitted current conveyor in that input AD844 (U2, Figure 5) to couple the servo sig- nal to the amplifier. The way this works is as follows. Re- member that whatever current flows in or out of the low impedance input pin 2, also flows (in opposite direction) out of or into pin 5. We also know that the voltage at pins 2 and 3 will track accurately. When we couple the ser- vo signal to the reference input pin 3, it will cause a current in R50 to keep pin 2 at the same level. That same current will flow through R33 in R49 (and R1 if the source is DC coupled), and in this way the offset correction will be added to V in . R49 assures that this current, which essentially is DC, can flow even if the V in comes from a coupling capacitor. Finally, this input buffer and servo amp have their own ±15 V supply from two zener diodes, D5 and D6. With this circuit, compos- ite offset of the whole amp is just a few millivolts. Protection circuitry There is a separate protection sys- tem for this amplifier that protects the speakers against DC output as well as the output devices against overload. It also provides delayed switch-on and immediate switch-off. This is described in a separate article in this issue. Power supply The power supply for this amplifier should deliver about 2 x 44 V DC . Al- though the output devices are rated for higher voltages, it is not advisable to increase the supply in trying to get more output power. The allowed dissi- pation at higher V ce is much less than the rated DC dissipation due to sec- ondary breakdown limitations of the SOA (Safe Operation Area). With loads that dip substantially below 4 Q, even temporarily, the SOA may be exceeded and an output Darlington destroyed (or the protection activated). The supply VP Figure 4. Full circuit of the H.ec V as stage. 5/2008 - elektor 47 AUDIO Figure 6. Amplifier distortion as a function of output level, with single diode (blue), dual diode (red) and without soft-dipper diodes (yellow). Figure 7. Amplifier distortion vs. frequency at 50 W in 8 Q, with single diode soft clipper (blue), dual diode soft clipper (green), no soft clipper (red). for the error correction circuit in the output stage is bootstrapped from the output; that part of the circuit can ac- tually drive the output devices beyond the supply voltage. Consequently, it is the V as that determines how close the output can get to the supply rails. Since the V as will clip first, there is no clipping overdrive and overdrive delay in the output stage. The output can swing within a few volts of the sup- ply, which is better than in most ampli- fiers (unless separate, higher voltage, V as supplies are used). The power supply for this amplifier is uncritical. The error correction not only corrects internal amplifier non-lineari- ties, but also any power supply ripple or noise that makes it into the circuits. (The supplies for the error correction AD844’s is stabilized separately with zener diodes). Therefore, a classic rec- tifier-and-reservoir capacitor supply delivering 2 X 44V dc under load is sufficient for about 100 W in 8 Q, 200 W in 4 Q. The power supply circuit details are given in Figures 9 and 10. For a stereo version, a 300 or 400 VA transformer should be sufficient; after all, you will not drive both chan- nels at full power for a long period (except maybe on the test bench). You can use the common transformer with a centre-tapped secondary, but other configurations can also be used. One nice option for a stereo amp is to use two com- pletely separated supplies, each with a 250 or 300 VA transformer. That would make it easier to maintain strict star point grounding. It is important to get the grounding right. Ground currents back to the sup- ply from the speaker, as well as from the reservoir electrolytics, can be quite large and have all kinds of ripple and noise. Such ground currents gener- ate voltages across the ground return wiring. If the ground for the signal is connected to this ground wire at an- other point, you have effectively cre- ated a small ripple signal that appears in series with the input signal. This may seem far fetched, but with very low distortion and very clean amplifi- ers, even a few mV of these noise sig- nals can be enough to ruin the linearity and distortion figures of an otherwise very good amplifier. Usually one tries to prevent this by using a star ground: All ground returns come together at a single point, and no signal return runs through the same ground wire with another return loop. If you look at the amplifier PCB layout you see that the power connections get to a central star point. On the PCB itself, care has been taken to do the same. There are two or three separate traces that bring the re- turns for the regulator zener diodes and the decoupling capacitors to the same point. The signal returns from the input network, the gain setting resistors R7, R16 and the error attenuation network Rll, R12 are also brought to this point separately. All return wires from the supply, the transformer and the speak- er are returned to the star ground. The signal grounds in the amplifier are then returned to this point via a low-value resistor R28, which is then by defini- tion the ‘clean’ ground point (pad J1 on the PCB is the clean ground and should be used as ‘ground’ for meas- urements as well). Any error voltages generated by ripple and pulsating currents in the ground wires cannot end up in the signal, except through radiation. This in turn we can minimize by making all high- current wires short and as far away from sensitive signal ar- eas as possible. Finally, the rectifier diodes should be types that recover quickly from voltage reversal when switching off, and do so ‘softly’, that is, without very sharp current steps. Di- odes that take a long time to reverse themselves and in the process generate sharp cur- rent steps may cause high- 0.00 s 100.00 ms 200.00 ms 300.00 ms 400.00 ms 500.00 ms 600.00 ms 700.00 ms 800.00 ms 900.00 ms 1.00 ms Figure 8. Error correction current (blue) and amplifier output clipping (amber) with soft clipper (positive signal) and without soft clipper (negative signal). 48 elektor - 5/2008 TR1 Figure 9. DC power supply. Diodes are paralleled, dual, fast, soft recovery 3-pin TO220 types. Figure 10. Mains wiring for the power supply, mains filter, overvoltage clamp and fuse. frequency noise that is difficult to fil- ter out. Fast, soft recovery types don’t need capacitors or snubbers; indeed, such capacitors would only increase the transmission of mains-borne noise to the amplifier. My recommendation is to use Philips BYV32E-200 diodes. These are TO220 dual types with a common cathode; the two diodes should be paralleled. They have a rela- tively low threshold voltage, and are quite inexpensive. They don’t need to be heatsinked so they can be put on a PCB in free air. For the reservoir capaci- tors, a minimum of 15,000 jliF should be used per supply polarity. 63 V rating is adequate. A mains filter as shown in Figure 10 should be used to keep out high fre- quency noise and switching pulses rid- ing on the mains. Good mains filters are not cheap but worthwhile; use a type with at least 6 A rating. Ground the filter ground lug as well as the mains safety ground wire to the chas- sis only. Use a slow-blow fuse of 3.15 A for a stereo version, larger if you use larger reservoir capacitors. A 275 V AC varistor clamps any high-level pulses that make it out of the filter. Conclusion So, there you have it, a complete, high quality yet simple error correction pow- er amplifier. The parts list shows all components for one (mono) amplifier. Note that the values of Cll, C12, C17 and C18 (output stage) were given as 330 juF in Part I but 470 juF fits on the PCB so these should be used. A sepa- rate Construction Guide is available as free download from the Elektor website as archive file # 071085-w.zip. Although harmonic distortion meas- urements do not always correlate with sound quality, they do give an indica- tion of linearity and behaviour of an amplifier. Therefore, a few performance curves are given in Figures 6 and 7. If you work in a step-by-step fashion as described in the Construction Guide, checking your work after each major part, it will help to avoid errors and, if errors are made, to quickly isolate and fix them. Also check on my website for any last-minute information, additions or corrections. This is not a very difficult project but it provides you with an excellent am- plifier, which reproduces your source music faithfully, adding nothing, taking nothing away. This amplifier is stable and will happily drive a wide range of different speakers. In short, an ampli- fier that will let you enjoy your music for many years to come! ( 071085 - 1 ) Additional information www.linearaudio.nl Availability of construction kits: www.pilghamaudio.com Advertisement ClmScan Elmscan 5 is an advanced diagnostic package for use with EOBD compliant vehicles. • Read and clear trouble codes • Access up to 192 engine parameters • Advanced Graphing and Data Logging • Built-in Dyno and Drag Strip feature • And much more... For under £100! - -T 4 «\ - I La ^ -m I 1 - V! y-l J&J 1 1 L ■ J ^ Id a 4J 5/2008 - elektor 49 AUDIO Jan Didden In Part I and part 2 about the paX amplifier we developed a complete error-correction power amplifier. In this accompanying article a protection system is described that's constructed on a separate small circuit board for mounting directly on the speaker binding posts. We will also discuss the Safe Operation Area for the output devices and how it is modelled in the protection system. An indispensable companion (or the paX amplifier A good protection system for an audio amplifier has two important tasks: speaker protection and ampli- fier overload protection. Speaker pro- tection concerns a possible excessive DC voltage at the amp output due to either excessive ultra-low frequency signals, or from a circuit failure inside the amp. By the way, you can also get excessive DC output if you have a DC coupled power amp and your preamp gives out DC. If you go on tour with your amp, it would be wise to insert - even temporarily - some input cou- pling caps. There are many convoluted circuits to disconnect the speaker from the amp through a high-power relay in case of significant DC offset at the output. These circuits often do double duty in delaying the closing of the relay until after the turn-on transient, as well as immediately opening the relay when power is switched off - again to avoid transient thumps in the loudspeaker. I used a low-cost, purpose-designed, but not too well known IC: the uPC1237 from, among others, NEC. The NTE7100 from NTE Electronics, is pin- and func- tionally compatible. It’s an 8-pin sin- gle-in-line (SIL) chip with all the func- tions mentioned above. The datasheet gives the formulas for calculating the component values. It can handle two channels for a stereo amp, but I used one chip per channel to make it easier to construct the amp as dual mono. 50 elektor - 5/2008 SPEAKER POSTS J3 r 1 Figure 1. Overall protection system. For the speaker relay I used a little- known device specially designed for this function and sold by the Dutch company Amplimo. The relay has two parallel internal contacts, one heavy- duty tungsten 100 A contact and a smaller gold contact pair. When the re- lay closes, the tungsten contact closes first, and is then bridged by the gold contact. The reverse takes place when opening the relay. Circuit diagrams The overall protection system is shown in Figure 1. The blocks for the Indica- tor and the Safe Operation Area pro- tection will be described later. The uPC1237 has an internal 3.4 V shunt regulator at pin 8, and the supply cur- rent is provided by R19 and R20. The relay switching output (pin 6) drives the relay through R18. Jumper J6 sets the circuit operation. If J6 is closed, the circuit becomes ‘re-entrant’: if there is an error input, the relay falls off, and after a short delay is activated again. If, at that point, the error has disap- peared, the relay stays activated, if not, it falls off again and the cycle re- peats. If J6 is not closed, the relay is deactuated when an error is present and you have to switch the power off and on again to reset the circuit. DC offset shut-off Pin 2 of U2 is the DC offset input. AC on the amplifier output signal is re- moved by R17-C3 and the DC offset is sensed. Although the uPC1237 only has a unipolar supply (the amplifier’s VCC + ), pin 2 does accept bipolar sig- nals. The calculations are a bit com- plex because the internal positive and negative thresholds are not equal. It is all explained in the datasheet. With some care you can set the threshold for positive and negative offset to the same value at 0.6 V DC . These values are set by R17 and C3 as shown in Figure 1. Switch- on delay You will also see that a sample of the AC from the supply transformer is connected to the uPC via R21 and D8 to C6. This part of the circuit will de- lay the loudspeaker switch-on after a power up to make sure the amp has stabilized and there are no switch-on thumps. When the power is turned off, this signal will disappear imme- diately, before the supply capacitors have a chance to discharge. This way the speaker relay will be opened be- fore the turn-off thumps occur. Safe Operation Area The second main part of the protection system is to guard the output devic- es against excessive low impedance loads and short-circuits. Michael Ki- wanuka has written a very informa- tive article on Safe Operation Protec- tion in audio power amplifiers [1]. My own protection circuit is different, but was inspired by Mike’s design and has many things in common with it. Fig- ure 2 shows the circuit. The circuit re- ceives two types of information from the power amp: the I c in the output devices through V protP and V protN (via connector J7 in Figure 1): this actu- ally is the voltage across the emitter resistors. Secondly, through the com- ponents connected to the supply and V out a voltage is developed that repre- sents V ce of the output devices. (There is a separate part to this article that explains the circuit in detail and how 5/2008 - elektor 51 AUDIO Calculating and setting up the protection system Icprot DC SOA lOOmS SOA Res load-1 Res load-2 Reactive load-1 [Figure 1 . SOA, load lines and protection locus. See text for explanations. transistor (N device) sources current even with a negative V out ! Under these circumstances (which can happen easily with real speaker/cross- over loads) quite high V ce to l c combinations can occur although the device dissipation is very much limited as shown in the SOA cure. For instance, in this example, at V ce = 60 V and l c = 3 A, allowed dissipa- tion (per device!) is 90 W, although the data sheet calls this a 1 60 W device. So, we can put in a simple current limiter that follows, say, the 4 £2 complex load line. But then we cannot use the large safe area, es- pecially at low V ce and l c between 1 0 A and 30 A, which may come handy with speaker loads that have low impedance dips. It is clear from Figure 1 that a simple current limiter is not enough. What we want is to 'model' the cyan DC curve in our circuit. This can be done with some non-linear circuit elements, and my target SOA protection curve is shown in dark blue. It has three inflexion points at V ce = 20 V and V ce = 50 V. The paX amplifier uses Safe Area Operation (SOA) protection. In this section we will address the specific design equations and how to de- velop the circuit values for the SOA part. Figure 1 shows the various curves that we need to develop the SOA protection for two pairs of output devices. I c (A) is on the vertical scale, V ce (V) is on the horizontal scale. When V ce is zero, it means that V out is equal to V supp | y . In practice, there will always a few volts V ce remain- ing at maximum output, but we will disregard that for the moment. The cyan curve shows the safe combinations of DC l c and V ce for two parallel STD03 Sanken Darlington devices used in this amplifier. The yellow curve shows this for loads lasting no longer than 1 00 ms. That means that combinations of l c and V ce that fall below and to the left of the curve, are safe, but as soon as the curve is crossed, the protec- tion system should activate. Since music is impulsive and not DC, one could argue that protection for the yellow curve would be sufficient, but if we use the cyan curve we have an additional safety factor and we also are protected against DC shorts. Figure 1 also shows some load lines, which are combinations of l c and V ce required to drive a (resistive) load, assuming ±40 V supplies. The lower one, in pink, is an 8 £2 load, the light blue one is 4 £2. For example, in the 4 £2 case, we see that when V ce = 0, the output volt- age is the supply voltage (40 V in this case) and thus l out in 4 £2 is 1 0 A. The brown curve is also for 4 £2 load, but now with a maximum reactive component of 90° phase shift. This is a particularly mean load. At V ce = 40 V we are exactly between the supplies (assuming a ±40 V supply) with V out = 0. With V ce = 60 V, V out is actually -20 V negative but l c is still positive (about 3 A). That means that the upper The way I implemented this is shown in Figure 2 , which is the positive half of the full circuit given in Figure 2 of the article about the pro- tection circuit. (The negative part works similarly and will not be dis- cussed). There are 4 distinct points on the blue target curve. The first and last points are defined by V ce =0 and l c =0 respectively. The other breakpoints are at V ce = 20V and V ce = 50 V. These two breakpoints are caused by diodes D3 (for 20 V/l 3 A) and D2 (for 50 V/5 A). Re- member, all currents are for two parallel devices! At each breakpoint, the diode(s) start to conduct and shunt current away from R14 and R4, so that Q1 conducts later. To calculate the component values for this rather involved circuit, we start with the simple part: if V ce = 0, the maximum allowed l c is 30 A for two output pairs. Also at this point, V out = VCC+ so there is no current coming from R6/R5. The voltage to turn on Q1 comes exclu- sively from the voltage drop across the output devices' emitter resis- tors, through Rs. We need to ensure that at 30 A, the voltage at Q1 (base) is approximately 0.65 V. Although there are two emitter resis- tors and two Rs resistors in the circuit, they are in effect parallel, so we will use from now on Re = 0. 1 1 £2 and Rs = 50 £2. With 30 A through the parallel value of Re, V Re = 3.3 V, which is attenuated through Rs and R4: 1 2/(50+ 1 2) • 3.3 = 0.64 V — close enough. Now it gets interesting. Lets move to the breakpoint where V ce = 20 V. The allowed l c is (cyan curve) about 1 3 A. We assume some values and then calculate the rest: Rs= 1 00 £2, R4 = 12 £2; we set R1 4 to 270 £2. Let's disregard D2/R8 and D3/R7 for the moment; we just need to be sure later that that was justified (that the diodes don't con- duct at up to V ce = 20 V). V ce = 20 V and l c max = 1 3 A gives an effec- tive Vs of Vs = R4/(Rs + R4) • (Re • l c ), which, with the given values, is 0.28 V. We need V b = 0.65 V, so the current from R5 should gener- I calculated the various component values). The purpose of the SOA protection is to limit the combinations of V ce and I c for the power devices to a safe val- ue. Normally, such a protection circuit would be arranged to take away the drive from the output driver transis- tors to limit the available output cur- rent. The protection transistor (Q1 or Q2, Figure 2) collector would normally be connected to the base of the (pre) driver transistor in the output stage. Q1/Q2 turns on when its V be exceeds about 0.65 V, shunting driver base sig- nal away. But in my experience, even with a V be of only a few 100 mV, the protection transistor starts to influence the driver base signal, resulting in in- creased error correction and increased distortion. For this reason I decided to make this an on/off protection circuit: the protec- tion transistors drive the ‘overload’ pin (1) of the uPC1237 through the dual op- tocoupler Ul, an MCT6. If overload oc- curs, pin 1 of the uPC is set high via R1 (Figure 1) and the uPC opens the speak- er relay. I have the uPC set for auto re- entry by jumpering J6: in this mode, the speaker relay will be periodically closed 52 elektor - 5/2008 ate the remaining 0.37 V across R14. So this current needs to be l R5 = 0.37/270 or 1 .37 mA, which also flows through R6 of course. With a V ce of 20 V (we disregard the small V ce loss across Re), that would make R5 + R6 = (20-0.65)/! .37 =14.1 kD. It doesn't really matter how we split up the total value (it does matter for the other values of course, but not for the functioning), so let's make them equal: R5 = 7 k£2 and R6 = 7 k£2. At this breakpoint, V ce =20 V, diode D3 should be on the verge of con- ducting, so D3 should be a zener equal to the value of Vm. Since we have 1 .37 mA through R6, Vm = 20 - (1 .37 • 7) = 1 0.4 V, making D3 a 1 0 V zener. Now let's move to the next point, 50 V/4 A. Analogous to the 20 V/l 3 A point, D2 should be on the verge of conducting so we can disregard it, and R8, for now. As before we calculate the contribution of l c at Vs: Vs = 1 2/(1 2 + 50) • (0.1 1 -4) which is 85 mV, so the V ce -derived current from R5 and R6 should add 0.65-0.085 = 0.565 V at Vb, therefore VCC+ Figure 2 S0A protection circuit. I R14 = 0.565/270 = 2.1 mA. This 2.1 mA also flows through R5 and R6, so Vm = 0.65 + (2. 1 x 7) = 1 5.35 V. (This of course means that D2 should be a 15V zener, and we will use that later). With Vm = 1 5.35 V and D3 a 1 0 V zener as calculated above, we have 5.35 V across R7. The voltage across R6 now is V R6 = 50-1 5.35 = 34.65 V, so IR6 = 34.6/7l< = 5 mA. Since 2.1 mA flows through R5, 2.9 mA must flow through R7 with 5.35 V (Vm-1 0 V from D3) across R7, so R7 = 1 .8kT2. Moving on now to 1 00 V/0 A, it gets pretty boring: l c =0 so there is no contribution from Re to Vs, and the V be = 0.65 has to be generated by the current through R5 and R14 + R4, so l R i 4 +R 4 = 0.65/282 = 2.3 mA. This current also flows through R5 so Vm = 2.3 • 7) +0.65 = 16.75 V. The current through R6 is: l R6 = (100-1 6.75)/7 = 1 2 mA, so the ex- cess of 1 2 mA-2.3 mA = 9.7 mA needs to be shunted away through D2/R8 and D3/R7. V R7 = (16.75-10) = 6.75 V with R7 at 1.8 kQ so l R7 = 3.75 mA, which sets l R8 to 9.7-3.75 = 6 mA. V R8 = 1 6.75-1 5 = 1 .75 V so R8 = 290 Q. So, there you have it, but it would be nice if there was some way to verify this before committing solder (and parts). We have disregarded several things, for instance the loss of V Re for V ce and several round- ings in the calculations. I have developed a spreadsheet to try to dou- ble check all this (available on www.linearoudio.nl and www.elektor. com). It works backwards from what we just did: using the compo- nent values in the circuit, it calculates at each V ce the Vb contribution from the current through R5, and then finds the l c that would add just enough voltage across Re to make V be = 0.65 V. Plotting those pairs of V ce and l c then should give us the actual (blue) SOA curve we wanted in the first place. What we see is that the spreadsheet shows reasonable correspondence to our values, but there are some devia- tions. The reason is that once I had the spreadsheet, I 'played' with the component values to get the best fit to the SOA curve, or to get 'nice' values for parts. I used a V cc of 44 V and a V ce ( min ) of 2 V in the spreadsheet. Also, manipulating the R5 and R6 ratio lets you home in on standard zener values. The way to do that is to use Excel's solver to find the ratio of R5 to R6 that results in say D3 = 12 V. Some more playing then gets you to D2 = 1 8 V. In the end, I used the values from the spreadsheet in the actual circuit as given in the main article. Since we stayed on the safe side with the blue protection curve, small deviations won't cause disaster. Just try it, you can't break anything, but don't mess with the formulas unless you know exactly what you're doing! I developed this spreadsheet for this particular application and did a fair amount of checking, but I cannot guarantee that it is without er- rors. If you find any, please let me know and I will update it, giving credit where it is due, of course. It is not so easy to test the accuracy of such a protection system in real world, and mistakes could be expensive. So this double check of calculating the values and then working backwards to verify them is important to gain confidence in the circuit. to see if the overload still exists, and if so, it is opened again immediately. It can be argued that the protection system should work by limiting the output in case of overload and not by disconnecting the speakers. I would agree that for PA duty this would be preferred, but for home use it is a very minor nuisance, if at all. But doing it this way prevents influenc- ing of the music signal by the circuit when there is no need for protection activation. Having used this amp for about a year now, I have never seen the protection system disconnect the speakers, except in one case where I had a problem with a balanced ca- ble which put a signal with 2.5 V DC on the amplifier input. I immediately heard the on-off cycling of the ampli- fier, so I switched it off and managed to find the problem. After solving the problem all was as it should be. So, for me, this works quite well. Status indicator Then, lastly, there is a small bi-stable circuit that takes the relay drive volt- age to drive a bi-colour LED which you can place on the front panel. The LED will be one colour when the amplifier is in turn-on delay or in protection and another colour if the amplifier is oper- 5/2008 - elektor 53 AUDIO R16 VCC+ Figure 2. Safe Area Protection system. Vrel Figure 3. Status indicator. ating normally. This circuit is shown in Figure 3. All components shown in fig- ures 1, 2 and 3 are on the output/pro- tection (o/p) board shown in Figure 4. Construction Before building the o/p board, first complete the amplifier. We need the amplifier to test the o/p board. The o/p board can be populated first with the DC and delay circuitry around U2. Start with the components shown in Figure 1. Next, construct the 6-wire flatcable as shown in Figure 1 in the Construction Guide. Be sure to orient the notches in the 6-pin headers exactly as shown! Connect the two boards with the flat- cable, again noting the header notch position as indicated on the PCB silk screen. Also connect one side of the power transformer secondary (the AC point) to the protection board at J1 as shown. Don’t connect a speaker yet, and don’t yet connect the speaker wire from the amp to the protection circuit. Now, when you switch on the ampli- fier, you should hear the relay pull in after a few seconds. If you find it too fast, you can increase C6 for a longer delay. If you switch off the amp, the re- lay should immediately open again. Next we will check the DC offset pro- tection. Temporarily connect a resistor of 100 kQ from the positive or the nega- tive supply to the speaker input point on the protection board (J4). The re- lay should deactuate. Check this with both J6 set and removed to verify cor- rect operation. Then, install all components for the status indicator in Figure 3. The PCB has labels ‘ON’ and ‘OFF’ at J2. That indicates which pin will be ac- tive at which status. If you use a red/ green LED you would connect the RED pin to J2/OFF and the GREEN pin to J2/ON. You may want to repeat one of the tests described above to veri- fy the correct operation of the status indicator. The last part will be to complete the Safe Operation Area (SOA) protection components. Put all remaining parts on the protection board. Connect the flat cable, and connect the speaker output from the amplifier (Amplifier J3 to o/p board J4), as well as the star ground wire (o/p J3 to supply star ground). Switch on the amplifier and verify that it works normally. Then, to simulate an overload situation, connect a resistor of 10 kQ between the positive supply and the node Ql(base)/R14/R5/ Cl and ver- ify that the relay falls off. Do the same with the negative supply and the node Q2(base)/R12/R15/C2. Note: If you do not mount the o/p board directly on the speaker output posts, you can connect the speaker return wire directly from the output post to the supply star ground without going through the o/p board. The loudspeak- er’s 'hot' connection then goes from the o/p board J8 to the output post. Stand-alone! This article focused on using this o/p board with my ‘paX’ amplifier. But you can use it with any amplifier, provided you adjust the SOA circuit values as re- 54 elektor - 5/2008 r — — — — — — — — — — — — — — — — — - I COMPONENTS LIST Resistors (0.25W metal film) R1 = 1 0k£2 R4,R9 = 12Q R5,R1 2 = 8kQ2 R6,R1 3 = 6kQ2 R7,R1 1 = 2kQ0 R8,R1 0 = 560£2 R1 4,R1 5 = 270Q R1 6,R22 = 3k£29 R17 = 36k£2 R18 = 510Q R19 = 1 6kQ R20 = 56kQ R21 = 1 8k£2 R24,R25 = 22kQ R23 = 3.9kQ 1W Capacitors C1,C2 = lOOnF ceramic C3 = 330jL/F 6.3V C4 = 22nF ceramic C5 = 33jL/F 10V C6 = 4jL/F7 25V Semiconductors D1 ,D6-D1 1 = 1N4148 D2,D5 = zener diode 1 8V 0.5W D3,D4 = zener diode 1 2V 0.5W J2 = dual colour LED Q1 = 2SC2910 Q2 = 2SA1208 Q3 = BC546B Q4 = BC556B Ul = MCT6 (Fairchild) U2 = UPC1 237 (NEC) or NTE71 00 (NTE Electronics) Miscellaneous J6 = header 2 x 1 pin J7 = 2 x 3 pin DIL flatcable header RL1 = Amplimo LS relay DIL socket 2x4 SIL socket 1 x 8 pin PCB, # 071 086-1 from the author or www. thepcbshop.com Figure 4. Component placement of the double-sided PCB for the o/p board. quired, as described separately. The in- set in Figure 1 shows the connections you need to make from your amplifier to the o/p board through J7. ( 071086 - 1 ) Literature [1] Transparent V-l Protection in Audio Power Amplifiers, Michael Kiwanuka. Electronics World, October 2002. • 4 • 4 m _ ( 1 • * rtj 1 t 4 I % % 4 i % 4 4 * 4 P * \ I’lJ Kti ■ T c i 4 4 4 £ i 4 4 4 r- m. € P 4 f %. jP 4 4 ® *■ < ? 1 1 -5 „ £ - f x 4 : v - J - * 4 * 44 4 4 y ■ 4 * 4 4 4 «. C 4 i 4 4 4 4 hr v » »■ 4 4 m £ < HI * Advertisement Your price conscious PCB supplier Eimo CIRCUITS Online price calculation Online ordering Online order tracking Online 24/24H and 7/7D Interested? Contact us; +44 2DSS 167 005 E-mail: etino@euredrceits.com www.euroci rcu its.com carte E - pooling for standard boards - up to 6 layers - from 1 to 10 DO pieces ■ from 2 working days onwards - pooling with more Options - up to S layers - from 1 to 1000 pieces -from 3 working days onwards your board, our challenge up to 16 layers from 1 piece onwards from 3 working days onwards 5/2008 - elektor 55 INFO & MARKET REVIEW MikroElektronika EasyPIC5 Development System Jan Buiting Out of Belgrade comes a vast line of microcontroller development tools and related goodies that's sure to make microcontroller geeks drool and students and other beginners start examining their wallets, savings or budgets — the prices sure are attractive! We examined EasyPICS, one of the flagship dev kits from MikroElektronika. rttllirolCD I 0 UnwiUlWf "" n ■ w | L >- A I L - *1* iBIU I li^KBaEClIkl it:' r if mmaufii m V k -V L •fc 56 elektor - 5/2008 Many moons ago, development sys- tems for microcontrollers were sup- plied by none other than . . . the manu- facturers of the relevant devices. Alas, these kits were expensive or hard to come by if you were not a journalist/re- viewer or a manager commanding 20 or more staff in the product design de- partment. Also, in the early days, man- ufacturer-specific dev kits, although comprehensive and with technically fine contents, would give you an un- easy feeling of being chained to, again, the microcontroller manufacturer for support and hardware extensions (“sure, that can be done with our prod- uct xyz, I’ll connect you to sales...”). Today, that’s changed a lot and any- one with a reasonably defined target for hardware product development, or an educational interest, should be able to buy microcontroller develop- ment systems that can be relied on to give a head start. Al- though prices gener- ally have come down, the link to the device manufacturer seems inevitable. Or is it? Unpacking The EasyPIC5 box is compact yet stur- dy and in general shows good pack- aging standards applied. The board, measuring 25x21 cms and having rounded corners, struck me a as well laid out and extremely solid (it’s 3 mm thick). It has lots of useful markings on the silkscreen overlay and, remarkably in this day and age, no SMD parts ex- cept one voltage regulator. The gener- al finish of the board is superb — no hand-soldered wires or knifed PCB tracks revealing design errors a.k.a. ‘h/ w revisions’. A pity, though, some of the jumper setting instructions are ob- scured when the graphic LCD (GLCD) is installed on the board. The review board came with the 2x16 character LCD and DS1820 tempera- ture sensor in a separate package — this is an optional add-on costing $15 extra. MikroElektronika sell a variety of optional add-ons for the board, includ- ing a touchpanel and a 128x64 pixel graphic LCD. At $24 and $7 respective- ly these items are good value for mon- ey and it seems wise to order them straight away with the EasyPIC5. Oth- er add-ons include CAN, SmartMP3, RS485, Ethernet and irDA. A remarkable built-in feature of the board is called MikroICD. This in-cir- cuit debugger allows you to monitor (on your PC), the state of all registers inside the MPU while it executes ob- ject code. The associated PC software called PICFlash2 is a free download as well as supplied on CD. Besides the EasyPIC5 User Manual, the box also contains ‘hard copy’ i.e. printed documentation of the PIC- Flash2 and mikroICD utilities — a rare find in this day and age of CD-ROMs and Internet. All printed matter is bright, copiously illustrated and has a consistent layout and use of colours, from the Quick Start leaflet right up to the print on the CD-ROM. EasyPIC5 overview Despite claims in favour of competing devices, Microchip PIC microcontrol- lers have a leading position in terms of acceptance among not only enthu- siasts and students, but also seasoned workers in the embedded industry. At the heart of the EasyPIC5 board sits a PIC16F877 in its 40-way DIP case. However you can remove it — besides the DIP40 socket, DIP20, DIP18, DIP14 and DIP8 sockets are available on the board to take PICs with fewer pins. The EasyPIC5 documentation tells you which are suitable. I/O-wise the PIC is totally accessi- ble with all its ports bonded not only to connectors and DIP switch arrays but also LEDs for easy visualisation of logic states as you program along (and make errors!). Input to the digit- al ports is easy to simulate by means of 36 pushbuttons labelled with port line names. The analogue world is not forgotten either with PIC pins RA0-R5 on pinheaders and two potentiometers on the board to simulate discrete ana- logue levels between 0 and 5 V. For higher level connectivity, the board has RS232, PS/2, USB and a 4-digit 7- segment display, not forgetting the USB comprised in the MikroICD of course. Hardware fans will like to know that the complete schematic and board lay- out of EasyPIC5 may be found on the CD in the kit. POS and NEG My only criticism of the EasyPIC5 kit proper is that the 2x16 LCD and the DS1820 should have been included in the package instead of supplied as an option at $15 extra. These add-ons make for a lively start for first time us- ers like myself. I took the DS1820 tem- perature sensor project as my first at- tempt to use the board and it was up and running in less than half an hour, including a short experiment with the MikroICD feature. The kit and the software tools sup- plied succeed in freeing your mind from hardware intricacies and instead concentrating on software and under- standing and optimising the PIC code (in that order). For example, using MikroBasic it wasn’t too much trouble to program three temper- ature levels at which PIC output lines are activated. When I got the hang of it, cheer- fully debugging an associated indication using the 7-seg- ment LED display, I was told to stop and finish this review. At $129 (plus P&P and options) and the dollar in the toilet at the time of writing, EasyPIC5 is good value for money. A wide distributor network is available as well as support, both directly from MikroElektronika them- selves and from knowledgeable us- ers in their online Forum, where criti- cal users are not shunned either and all the latest on updates etc. can be found. Further encouraging points to mention are the neatly produced man- uals, the non-SMD approach, the wide range of low-cost add-on boards, and a fine selection of get-you-going ex- amples. Users will also appreciate the trial versions of MikroC, MikroPascal and MikroBasic on the CD with the kit. Registration keys for these com- pliers can be obtained online from MikroElektronika. ( 071070 - 1 ) Web Links MikroElektronika: www.mikroe.com UK distributor: www.paltronix.com US distributor: www.circuit-ed.com At $129 (plus P&P and options) and the dollar in the toilet at the time of writing, EasyPIC5 is good value for money. 5/2008 - elektor 57 Jochen Bruning Frequency counter module using ATtiny2313 Most small function and signal generators do not have a very accurate frequency control and do not offer a built-in frequency counter. Help is at hand with the tiny frequency counter module described here, which consists essentially of just an ATtiny2313 microcontroller and an LCD panel. The microcontroller is clocked at 20 MHz, and so the counter module can be used at frequencies of up to 5 MHz without the need for a prescaler. This counter module is therefore ide- al for retrofitting to an existing signal generator or as the main component of a tiny self-contained frequency meter. In the former case it will probably be possible to derive power for the mod- ule from the unit’s own power supply, and the signal input of the module is best connected to an existing square- wave (5 V level) output. The display ranges from 0 Hz to 5 MHz with auto- matic selection between units of Hz, kHz and MHz according to the input frequency. Mini counter The starting point for the module de- scribed here was the minimalist 1 MHz frequency counter design by Hergen Breitzke described in the July/ August 2005 issue of Elektor Electronics [1]. That design employed an AT90S2313 programmed using the BASCOM AVR Basic compiler. This version is based on the same principles but uses an AT- tiny2313 rather than the AT90S2313. The newer device can be clocked at up to 20 MHz, which allows us to extend the maximum frequency from 1 MHz to 5 MHz. Fortunately 20 MHz crystals are readily available off-the-shelf. The proc- essor clock speed directly determines the maximum frequency that can be counted: according to the datasheet, the maximum allowable frequency at the counter input pin is one quarter of the processor clock frequency, and this is how the 5 MHz limit arises. To make the display as easy to read as possible the frequency value is shown in MHz, kHz or Hz as appro- 58 elektor - 5/2008 K 1 2 V5 -o 1 — o -o 3 IC1 UA78L05ACLP 2KBP005 green 0 IN 0~ GND 0 SI H D1 1 -05V C3 1u 16V GND 5V O CM 11 ^7 o 100n GND m C5 XI lill C6 27pp20MHz^27p GND LCD1 16x2 r'-com^i-cocMT-o gqgqgqcqcogqgqgq QQQQQQQQ tn o: a o o a z > > O PA2/RESET VCC (SCK) PB7 PD0 (RxD) IC2 (MISO) PB6 PD1 (TxD) (MOSI) PB5 PD2 (INTO) PB4 PD3 (INTI) (OCI) PB3 PD4(T0) AT-tiny2313 PB2 PD5 (T1) (AINI)PBI PD6 (ICP) (AIN0) PB0 XTAL1 XTAL2 GND 19 18 17 16 CO CM 15 14 13 CD CO co m 12 CO CM 05V Pi Ik GND 070954-11 Figure 1. As can be seen from the circuit diagram, the frequency counter consists of just a microcontroller with accompanying voltage regulator and LCD panel. priate, with the decimal point being shifted as needed. The display does not change to and fro rapidly when the unit switches between ranges. The frequency value is deliberately shown as only five digits. In the high- est range (MHz) the 10 Hz and 1 Hz digits are suppressed so that the dis- play is steady and easy to read. If re- quired, the software can easily be modified to show these digits. The hex file and source code for the software are naturally available as a free down- load from the Elektor website. It is also possible to cause the sup- pressed digits to appear without modi- fying the software. The circuit diagram in Figure 1 shows a button (SI) con- nected to pin 2 of the microcontroller. When the button is pressed and pin 2 is taken to ground, the counter will show the 10 Hz and 1 Hz digits when in the MHz range. A switch could be used instead of the button or, if this fa- cility is not required, the button could simply be omitted altogether. Construction As can be seen from the circuit dia- gram in Figure 1, there are no special components in the design and the unit is very simple, consisting essentially of just the microcontroller, a voltage regu- lator IC and the LCD panel. Just a few components are required to support the operation of the microcon- Features • Frequency range 0 Hz to 5 MHz • Accuracy dependent on crystal, typically 50 ppm to 1 00 ppm • Display in units of Hz, kHz or MHz with automatic selection • Stable display even when range changes • Selectable 5-digit or 7-digit display using pushbutton • Indication of gate open and display update via red and green LEDs • Power supply: 5 V DC regulated or 6 V to 9 V AC or 9 V to 12V DC unregulated • Current consumption approximately 40 mA (when display specified in parts list is used) • Simple construction • No SMDs, no special components • Printed circuit board and ready-programmed microcontroller available • Hex file, source code for software and printed circuit board layout available for free down- load from www.elektor.com. 5/2008 - elektor 59 INSTRUMENTATION Figure 2. The double-sided printed circuit board for the frequency counter module. There are no SMDs in the design. Components list Resistors R1,R2 = 390C2 PI = 1 l«rv»«i 3 .BI Magnitude Frequ ^ Q 0 & diCIO] (Jtt U.IfflL. |j ^ ■. ■ -mIC 4.\ Time Data — S-.1M >-■ HW — I xs* )«» » 1 < l Win As the name of the program indicates, WinMLS 2004 can be used to make MLS measurements. The program gener- ates a very detailed frequency characteristic. There is a se- lection of signal sources available. The setting options are nearly endless, which makes this software very comprehen- sive. Except that how to use it is not always very clear. The software is very reliable and accurate and optimal for system calibration and spacial measurements, help when designing loudspeakers and is even suitable for resonance measurements of buildings. The screen shot shows several features such as time- and frequency-windows and room acoustics. 5/2008 - elektor 63 TECHNOLOGY MEASURING SOFTWARE WinMLS is available in various configurations which vary in price from $ 1 00 to $ 1000. The software is only suit- able for Windows and can use any sound card that is compatible with Windows. For more information: www. winmls.com Praxis The Praxis software from Liberty Instruments Incorporated is essentially the same as WinMLS. But Praxis has a few extras. For example, an RTA-function (Real Time Analyser). This can be used to make direct ('real-time') measurements. The settings can be stored as presets. The documentation is quite extensive and there are a large number of wav-files that can be downloaded from Liberty Instruments that can be used to carry out measurements and tests. On this website you can find many examples and explana- tions how certain measurements should be made including the required files and descriptions. For programmers, the manufacturer also has made a Script Designer available online. Script Designer can be used to write applications for Praxis. The script is based on Micro- soft Visual Basic and Borland Delphi. It was during our eval- uation not at all obvious how the AudPOD interface is cir- cumvented to enable you to use your own microphones, but the website clearly indicates that this should be possible. The accompanying screen shot shows the important win- r -j Omni Mnrin nanTAdp Ifion-drajMaJ CNWt I U F'k “JdlJlfJ Iv UJfJ.i 44.5& m U pk I llbVKiri 1 liqwi U.rms Llmi'it' l IikkiI ?0.&0rn ULpk D? iiOn t-I.rms (Prim Ary Pin!) Q\n\m fcL — Fwnuit Clnv H'M rliuvHh Tiilfa Mnfct PfctfScl'i Tu«A 1 U Iffitir* A | f | TlKW-'l Mjhi \r Tltf-i | pfclt-n Wulh J * | > |flT.iS h'i. m jgnMudt I trjX I twfflet | < rarmiii raw jiih *■ I dows of Praxis, which allow most of the settings to be changed and measurements performed. Praxis is clearly a Windows based application. The price amounts to $ 998. The 'free' version lets you do quite a lot but not all the pro- gram's features are available. For more information: www. Iibinst.com. ARTA, STEPS and LIMP A fantastic set of programs has been developed at the electronics university in Split in Croatia. The set compris- es three applications: ARTA for impulse response measure- ments, real-time spectrum analysis and frequency analysis, STEPS, which uses 'stepped-sine' excitation for frequency response measurements and LIMP for the measurement of loudspeaker impedance. ARTA can be used for loudspeaker measurements, room parameters and speech intelligibility analysis. It is very user friendly and well-organised. The software offers vari- ous measurement sources which are completely configura- ble. Among others, you can use white noise, pink noise, MLS, linear/log 'stepped sine' and periodic white and pink noise. The test results are very clearly displayed and further calculations using these results are very easily made. The manuals are very extensive and easy to follow. There are examples of different configurations, measurements and settings. A comprehensive procedure for the calibration of the sound card is also available. This calibration is obviously very im- portant when doing these types of tests. The software is only suitable for Windows and costs from £ 36 (€ 49) to £ 110 (€ 1 49). The demo version does not allow anything to be saved, but is otherwise fully functional. More information at: www.fesb.hr/~mateljan/arta FuzzMeasure Pro 3 Attention Mac users! This is one of the few applications of this genre for OS X. FuzzMeasure was originally intended for room measure- ments, but its application is much broader however. The main purpose of this software is to calibrate rooms such is live podiums, auditoriums, studios, etc. FuzzMeasure is not only suitable for measuring delays and reflections in rooms but can also be used to generate loudspeaker characteris- tics, for example. The program uses the swept-sine method, which avoids am- bient noise and distortion. The software is only suitable for OS X Leopard and costs $ 150. At the time of writing the software is up to version 3.0. 2, which contains a few bug fixes compared to version 3.0. You can find more information at www.supermegault- ragroovy.com. itfi* wo Tom Frwjuoncy (Hi) M ftMlitUUW * WO Tort Impulse Response I tueei mi H/m uvi l*«r O»0 m Wnm " DfcflM. i*vl P ; _'»i_ it y*9*M t* e r #■ Iriin Sui H.-*.- T‘ S-t' it jv: L’c P 1 * *-*■ J-M- '“■■scjrs-’iYiUr' II.Trt!|i. TjHbvua, iiKtfcj ci -3^ ■ii'i ■ 1 H IU L_l I ' - j kJr >dl> ~.€ ■ v ■rsp Dm Mi— Lw^'a measured. Electroacoustics Toolbox costs about £ 370 (€ 500) and can be ordered from the Faber Acoustical website: www. faberacoustical.com. SignalScope, which costs about £ 55 (€ 70), is considerably cheaper than Toolbox and can be purchased from the same website. Spectra PLUS SpectraPLUS is an audio spectrum analyser which is mainly targeted at real-time measurements. It is only available for Windows and comprises various 'options' (modules), which have to be bought separately. The most important functions are: real-time FFT analysis of the signal at the sound card input, recording and playing of wav-files, displaying the measured signal in the time domain, in the frequency do- main and in 2D and 3D spectrograms. The FFT measurements are very extensive and the resolution is high, 1 ,048,576 points. The octave analysis can be set from 1/1 to 1/96. The measurements can be made at up to 24 bit and 200 kHz sampling frequency, depending on the capabilities of the sound card. Ten different options are available which are suited for dif- ferent applications. For example, the base package offers you only a mono channel that can be used for measure- ments, an FFT analysis which is limited to 1/1 and 1/3 octave analysis, phase measurement and microphone compensation. The base package of SpectraPLUS costs $ 295. Each ad- ditional option or module costs a further $ 200. There are Advertisement FAST RESPONSE THERMISTOR SENSORS Semitec the world's most innovative NTC manufacturer, offers a range of novel, fast-acting thermistor sensors for temperature control problems in the electronics industry. Cost-effective, mini TO-220 style packages with R25s from 1 kQ to 1 0OkQ can be mounted directly to a P.C.B. or fitted with flying leads. Exposed bead sensors monitor and control rapid air-flow movement and "Soft-touch" sensors operating to 200°C offer time constant as fast as 0.5s. Our latest NC sensors reacts quickly to I.R. output in non-contact applications where thermopiles would be restricted by high local ambients. Let us help you solve your temperature control problem, contact us today. ATC Semitec Ltd Unit 14 Cosgrove Business Park Daisy Bank Lane, Anderton, Northwich Cheshire, CW9 6FY Tel: 01 606 871680 Fax: 01 606 872938 Email: sales@atcsemitec.co.uk Web: www.atcsemitec.co.uk 5/2008 - elektor 67 TECHNOLOGY MEASURING SOFTWARE also bundles for $ 595 and $ 795 and the complete pack- age costs $ 995. You can find more information about SpectraPLUS here: www.telebyte.com/pioneer/index.html EASERA SysTune Most of the description of EASERA also applies to SysTune. It is very comprehensive and reliable, but quite expensive. In addition to the fact that you can use SysTune to measure 8 channels at a sampling frequency of 192 kHz, simulta- neously and in real-time, SysTune also offers the following capabilities: the program gives a choice between live input signals or internally generated signals, impulse response measurements, spectrogram measurements, multiple-channel FFT, phase measurements in real-time and much more. For the price of $600, SysTune comes as a complete test system, which not only lets you make all kinds of meas- urements on the incoming signal, but can also do spatial measurements and measurements for the positioning of loudspeakers in studios and auditoriums. More informa- tion: www.easerasystune.com VB Audio VB Audio is a company who mainly develop VST plugins. They have developed a range of plugins which are intend- ed for audio measurements, for example, Frequencies Ana- lyser, LF Generator and VU Meter. The names already in- dicate what they do. What is very interesting, is the stand-alone application FFX16. This application can load' several plugins. This transforms the PC into a real-time audio processing and measuring instrument. The 'stacking' of plugins makes it possible to measure several frequency ranges at the same time, by first separating the desired frequencies with band- pass filters. The Frequencies Analyser has this function built in. In ad- dition to level measurements in the frequency domain the plugins can measure the difference in frequency between left and right channels and display spectrograms. You can generate various waveforms with the LF Genera- tor. Impulse and sweep modes are also included. The VU Meters is a very stable and accurate meter that is very flex- ible to use. On the VB Audio website you can find much more informa- tion about these plugins: www.vb-audio.com. Conclusion With a simple sound card you can quickly measure all kinds of things using a computer. The results of these measure- ments depend of course on the application for this 'test set- up' and the quality of both the hardware and the software. Cheaper cards often have high latency and a low maximum sampling frequency. This can cause problems when calibrat- ing, which leads to inaccurate measurements. Software that is much too cheap often means that there is no money and therefore no time for development and test- ing, so that it is less reliable and the test results may be questionable. A small step up and still reasonably affordable are for ex- ample TiePie [4] and Picotech [5]. The best solution de- pends on the measurements required and the financial room available. In conclusion we can state that there are plenty of programs available that are very good at making measurements us- ing the sound card. Obviously, this type of solution cannot compete with professional test instruments from, for exam- ple, National Instruments. But then, these cost considerably more. ( 071084 - 1 ) Web Links m www.rme-audio.de/en_products_multiface_2.php [2] www.steinberg.net [3] http://saturn5.com/ ~jwb/ mueller.pdf [4] www.tiepie.com [5] www.picotech.com 68 elektor - 5/2008 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 www.elektor.com/subs Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. E-BLOCKS Sean King (Matrix Multimedia) Just a mention of the word 'interrupt 7 makes many novice programmers shiver nervously and state that the use of interrupts is 'far too complicated for them' and that they can 'make do without'. Actually the principles and practical use of interrupts is not that complicated, and in this article we hope to take some of the mystique out of interrupt programming to encourage you to make use of this really useful programming technique. A simple programming method used to monitor multiple events within a program, and react accordingly, is to con- tinuously test and react as each event occurs. This meth- odology is termed Tolling' and it can be achieved rela- tively easily and successfully in simple loop program with a series of 'IF' statements and associated subroutines. But as programs become complex the use of subroutines, which may include delays and tests for further external events, means that it is increasingly difficult to guarantee the response of a program to an external event within the required response time. On top of this the use of polling is inefficient as every failed test for an event is a waste of system resources. To overcome this problem the internal circuitry of micro- controllers is designed to allow programmers to run pre- determined subroutines on the occurrence of an external, or internal, event — separate from the main program. This provides interrupts with two big advantages: 1 . the main program does not need to test for the interrupt events, simplifying the program structure; 2. Response to an interrupt event will be quick! Examples, please An external digital input interrupt As an example, consider a domestic burglar alarm: if poll- ing alone was used then it would not be possible for the alarm to be triggered whilst a user was entering a key code to unlock the system: the program would be waiting for the 70 elektor - 5/2008 user to enter a key and could not service the alarm trigger routine. However if the sensor input is connected to an inter- rupt pin then the programmer can develop a system where the alarm trigger routines are run whatever the rest of the program is doing. Internal timer interrupt An example of an internally generated interrupt is the timer interrupt. Within a microcontroller, a digital counter block, made up from a chain of flip-flops, is connected to the main system clock. The counter block generates an internal inter- rupt signal each time the counter overflows. The design of the counter block is enhanced so that the effective length of the counter block is determined by the contents of a writable memory register within the chip, allowing the programmer to determine the effective length of the counter. Together this digital block of circuitry and the memory register is called the 'prescaler' and it allows programmers to generate an interrupt every, 2, 4, 8, 16, 32, etc. counts, depending on the length of the counter. The timer interrupt is incredibly useful: if you have a micro- controller clocked with a crystal at 1 9660800Hz with a 1 6- bit prescaler counter then it produces an internal interrupt at 1 9660800/65536: an interrupt 300 times per second. So all you have to do is have a small timer interrupt routine that counts 300 of these and you can accurately produce a clock that shows time passed in seconds. In practice there are many variations of the external digital interrupt and the timer interrupt: external interrupts can be active low or high, some microcontrollers have timer inter- rupts that can be triggered on an exact count match, etc. Other internal interrupts Most microcontrollers are integrated with a collection of pe- ripheral devices. Each peripheral device contains hardware that is optimised to perform task that would be difficult, time consuming, or even impossible for an unaided microcon- troller to undertake. Most of these devices have the ability to generate interrupts when special events occur. Here are just a few more examples: • UART, SPI, l 2 C: interrupts can be triggered when data is received or a transmission complete. Figure 1. A practical example of an interrupt driven program. Flowcode is supplied with an interrupt function block. You select it from the vertical toolbar at the left of the screen by clicking on the small yellow lozenge with 'INT' in it. It pro- vides direct support for several of the more common inter- rupts. There is also a custom interrupt option that can be used to configure each of the unsupported interrupts offered by the target device. • A/D converter: interrupt triggered when the A/D conver- sion is complete and sample available. • Data EEPROM: interrupt triggered when write operation is completed. • Comparator: interrupt triggered when the input has changed from previous status. The first icon configures the timer interrupt. Clicking on it results in the dialogue box shown in Figure 2. Here you can see that we have selected the TMR0 (TiM- eR 0) overflow interrupt to be enabled and that when the timer 0 overflows the macro, or subroutine, in the flowchart TMROisr is called. Clicking on the Properties button reveals the screen in Figure 3 where you can see that the param- eters of the timer 0 overflow interrupt can be selected. The interrupt frequency here is 1 200 Hz which means that the macro TMROisr is called 1 200 times a second. Putting it into practice The example program you can download from the Elektor website (archive # 071069-1 1 .zip) shows how a Flowcode program written for the ATMEGA32 can use two interrupts to create a high speed analogue data logger. Download it, unpack and open it with Flowcode for AVR. When a microcontroller is powered up, all interrupts are off by default - so the first task a programmer has is to turn them on. The 'main' flowchart contains a sequence of three icons which configure the chip to be suitable for our purposes. PropcrIEcs; Ininr/iipl L'gl+w rrrv'-r ■unnnwiM ft l unn fi r'l i u kw- nm Vir* r.-i-— r [n*l> ■TjOTfJ r Dcdfcrtancri THFUkr .11 taw CJF. 1 H-k 1 : Figure 2. First interrupt icon properties. 5/2008 - elektor 71 E-BLOCKS Figure 3. The properties of the Timer 0 interrupt. For those who are curious, here is the maths on Figure 3: The clock is 20 MHz. The prescaler is 1 : 64 - effectively a 6 flip flop counter. 2 6 = 64. However the clock feeds into an 8 bit counter before it reaches the prescaler - effectively a 1 4 bit counter. 2 14 = 1 6384. So the actual interrupt fre- quency is 20000000/16384 = 1220.703Hz. In this case the TMR0 interrupt has been configured to gen- erate an interrupt at a frequency of 1220.7Hz (819.2(js), see Figure 3. From the Interrupt on' drop box shown in Figure 2 you can see that other interrupts are available which are as follows: • INTO: interrupt when a selected transition is detected on the INTO pin; • INTI : interrupt when a selected transition is detected on the INTI pin; • INT2: interrupt when a selected transition is detected on the INT2 pin. If you are just starting out with interrupts then use of the timer and INT interrupts will be as far as you want to go for now. Once you have mastered these then you may want to learn a little C code, dig into the datasheets of the mi- crocontroller and you can then take advantage of more advanced interrupts as follows. The second icon in the flowchart configures a second inter- rupt in the Atmega chip: the A/D Converter Conversion Com- plete interrupt. Once this is on the flowchart if you click on the icon and select the 'Custom.. / option from Figure 2 you will get a new dialogue box as shown in Figure 4. Here you need to enter appropriate C code which enables the interrupt by setting the status of the ADCSRA register (ADC Control and Status Register A), and then additional C code which ensures that the selected Flowcode macro is called. Using interrupts like this requires some knowledge of the inner workings of the microcontroller device itself, and a little C code. The third icon in the program sets up several variables for the program. After this we get to the main program loop. As you can see this is a loop while 1 ' pair which simply loops the program round the loop forever. The odd thing about this program is that there are no instructions in the main loop at all! The TMROisr macro is called each time a timer-0 inter- rupt is issued. This macro contains a single C command that initialises the ADC conversion in the Atmega chip. Note that a Flowcode ADC conversion hardware macro is not used here as these require a response from the ADC hard- ware inside the chip (curiously enough using the Polling technique) suspending operation of the main program until conversion is complete, or a timeout period has elapsed. Techtalk 'onINT After a Power- On -Reset, interrupts are usually disabled. The microcontroller has several levels of control over its interrupts. A Global Interrupt Enable (GIE) flag is available in one of the system registers to allow the entire interrupt system to be enabled or disabled in a single instruction. Individual interrupt enable flags (e.g. TMR0IE) are contained in various system registers allowing each interrupt to be enabled and disabled independently. An interrupts will only be generated when they are enabled both individually and globally. When an interrupt is generated it will set a flag in one of the system registers (e.g. TMR0IF). This can be used to confirm the presence of the interrupt re- quest, and should be cleared before returning to the main program. There are several different requirements for clearing interrupt flags, depending on the interrupt type, device family etc. Ref- erence should be made to the device data sheet. Interrupt operation When an active interrupt condition is detected, the micro- controller completes the machine instruction it is currently executing, saves the address of the next instruction to be executed in the main program onto the stack, and loads the program counter with an alternative address — similar to a programmed subroutine call. The address loaded into the program counter is that of an interrupt vector. What the mi- crocontroller expects to find at the interrupt vector address depends on the device type. Two popular devices are the PIC1 6F877a and the ATMEGA32. The PIC device has a single interrupt vector and expects to find a sequence of instructions starting at the vector address. One of the first tasks to be carried out is to identify which of the potential sources generated the interrupt, before branch- ing to the appropriate service subroutine. The ATMEGA32 has a separate interrupt vector for each in- terrupt source. There is no need to identify the source of the interrupt in this case so the device expects to find the address of the service routine at the vector address. The outcome of the response to an active Interrupt ReQuest (IRQ) is that the program flow is diverted from the main program and directed to the appropriate Interrupt Service Routine (ISR) that performs the tasks required by the interrupt event, clears the interrupt, re-enables the interrupt system (if necessary), and returns the program counter to the next in- struction in the main program. 72 elektor - 5/2008 The ADCisr macro is called each time an ADC Conver- sion Complete interrupt is issued. This macro then reads the sample ADC value and outputs this value onto a bank of LEDs on Port B. Back to the program The entire program is handled by interrupts. The TMRO inter- rupt generates interrupts at a frequency of 1 200.7 Hz. The TMRO interrupt service routine macro (TMROisr) starts the ADC conversion and returns to the main program loop. The ADC Conversion Complete interrupt service routine macro (ADCisr) reads the converted ADC value and writes it to PORT B before returning to the main program loop. Almost any program could be written in place of the main While loop, without affecting the operation or timing of the data logging function. Of course this is not necessarily a practi- cal program, but hopefully it illustrates the use of a simple timer interrupt as well as giving an example of a more com- plex interrupt and an idea how these are set up. Interrupt pitfalls It is important that interrupt service routines are completed as quickly as possible. Most will transfer small amounts of data, update a variable, or trigger another event. Program loops, macro calls, and complex calculations should be avoided. The delays involved in writing data to the LCD could cause problems in a multi-interrupt application. In this case the interrupt service routine should transfer any neces- sary data to a suitable location and create an indicator that LuEtnm Irvh rnipl prnppril?-: Code: mx'jza + (i | mitim | fi f fitmjfcrtir I Figure 4. The advanced ADC complete code in C. the main program can use to detect that an interrupt has been serviced and further action is required. The fact that interrupt response times are down to individual machine instructions can cause problems if an interrupt oc- curs during a multi-instruction operation, especially if the interrupt service routine modifies a variable that is in the process of being used by the main program. There are many techniques for avoiding this problem, enough to jus- tify another complete article. (071069-1) Advertisement / SE!/ SERVICING YDLIR COMPLETE PROTOTYPE NEEDS 1 EUROCARD (160 x 100 mm) + Tooling t +Phqmlots^w + VAT €49 Price example Any size and contour possible! Optional: • Soldermask • Fast-turnaround • Silkscreen • 4-Layer Multilayer • 6-Layer Multilayer wwkmt* m* tuET !£j & I] r ■ Cl LJd Freephone Q) 0800-3898560 C- . '*^5" i injlftL 1 Simply send your files A/ft A A/1 /if /*/til/| and order ONLINE: rV O " V IrfFl We add value to.jPCBs when otheij^just sell it. - One Step Manufacturing Service Free Electronics Components Free Prototyping Assembly Professional Consultant £ m High Quality Competitive Price 5/2008 - elektor 73 TECHNOLOGY DESIGN TIPS An SPI-networked Microcontroller Dirk Bohm A little over a year ago Microchip [1] launched the first Ethernet controller with SPI connectivity — and just 28 pins. With the ENC28J60 available also in a solder-friendly DIP version, this makes embedding a microcontrol- ler in a local network particularly simp- le and attractive. The basic circuit (see diagram) requires only a handful of extra components, enabling the whole affair to be built conveniently on a pi- ece of Veroboard (stripboard) or on a solderless prototyping breadboard. A Magjack integrated module from Belfuse [2] is our choice for the net- work connector. Apart from this you will need a 25-MHz crystal oscillating at its fundamental or natural frequen- cy. Online suppliers of the micro- controller, connector and crystal inclu- de [3] and [4] but you may well know of other firms that are closer to hand. The 1% tolerance resistors, capacitors and coils are available from the usual mail order firms, such as Maplin, Ra- pid Online and Conrad Direct. Once you have powered up the mo- dule you need to apply a frequency of 6.25 MHz on PIN 3 (CLKOUT), otherwise a link will not be established to the network. This 6.25 MHz signal must come from a crystal oscillator operating on its fundamental frequen- cy. If you cannot detect any trace of the 6.25 MHz signal try removing the capacitors experimentally. For your very first trial you should try activating the LEDs connected to the microcontroller. If this works read out the Revision ID. Should something pre- vent reading to and from the Register, sending some packets should unblock this. If you don't feel like developing the TCP/IP Stack from scratch you can download an oven-ready TCP/IP Stack absolutely gratis from Microchip! For developing network application software we recommend installing the Ethereal network sniffer, downloa- dable at [5]. This lets you log all the packets passing in broadcast mode or direct to and from the controlling PC. One final tip: it's crucial that you download the errata and update infor- mation relevant to the particular Revisi- on ID of the module you are using [1]! SPI in a nutshell The Serial Peripheral Interface Bus or SPI (often pronounced 'es-p - ' or 'spy') bus is a synchronous serial data link standard named by Motorola that operates in full duplex mode. Devices communicate in master/slave mode where the master device initiates the data frame. Multiple slave devices are allowed with individual slave select (chip select) lines. Definition from Wiki- pedia [6]. ( 070190 - 1 ) Web Links [1] www.microchip.com [2] www.belfuse.com [3] www.csd-electronics.de [4] www. m i c roco n tro 1 1 e r-sta r te r k i ts . d e [5] www.ethereal.com [6] http://en.wikipedia.org/wiki/Seri- al_Peripheral_lnterface_Bus Symmetrical square wave Patrick Knobel Just about anyone must be famil- iar with the NE555 by now. It is one of the most common compo- nents in do-it-yourself circuits. This 1C, however, was not designed specifically to generate a clock signal, and certainly not one with a duty-cycle of 50%, although it is frequently used for that. There are of course a number of circuit possibilities that could realise a duty ratio of 50%. Figure 1 shows a solution that uses two diodes. Capaci- tor C is, via the diodes, always charged and discharged with the same resistor value, so there is no asymmetry and the duty- cycle stays at 50%. We can calculate the (clock) frequency as follows: f= 1.44/ (2 RQ where = R 2 = R. It is however not possible to calculate the frequency exactly because the forward voltage drops of the diodes are not known. This and the fact that six parts are required make it worthwhile to think about another solution. The engineers that STMicroelec- tronics [1] thought the same. Their data sheet for the NE555 contains a circuit that, for a clock generator with 50% duty- cycle, requires only three exter- nal components (see Figure 2). The amount of time that the out- put is high (^ ), is calculated as follows: t] = 0.693/?] C The time that the output is low (t 2 ), is a little more complicated: f 2 = (/?]X/? 2 ) / (/?]+/? 2 ) x Cx ln((/? 2 -2/?i) / (2 /? 2 — /?,)) For a duty cycle of 50% it is true that f] = f 2 = t. The clock frequency is then: f= 1/2 1. The disadvantage of this circuit is that it is not easy to select the values for the components. For example, R 2 may not be greater than V 2 /?] . 74 elektor - 5/2008 +u So there is an opportunity to do better still. And this is shown in Figure 3. This extremely simple schematic shows a clock generator using an NE555 with a 50% duty ratio in its minimal form. It requires only three com- ponents in total, including the timer 1C itself. The frequency can be calculat- ed with this formula: f= 0.72 / RC Where most people would nor- mally use a D-flipflop, we solve that with this circuit using only a capacitor and a resistor. It is not likely to get much simpler than this. Links: [1 ] www.st.com (070050-1) Advertisement PCB House ^ 4>Start from £30 ^Prototype & Production 'fc’No Min Order ^Fast Delivery ANQIf^ S_jA.M QTkEl 1 3 A LfAM£s7>VT/ON Lf *'v>v HrEP^-EF^aTEP" Haw tet Dlhuu nrnia*i toua \nar a ciur cwrfsouri U«Jj£n!nsplrwJ Lt Ihe BflO/WPP. EX SfHWtW. % 1 Alipki II A Caa m nfc Mhi ro 641 Pin. i r. i rsx-Krr Gom>i u Men IftfGfl/nrc- . / ■ Trafc. 0 *m» ILUtlHIm! T*SL.' - 7 '” m v ' tl'pp* Pjr Hotitjf-feli STjJctiIi! K Tht Tim Wi|i toL»mEPitK4fe4E|ffnfniJ fill J iuiiiiiiBn~' r ' r ft* i ini iniif" ,, L C>Hp*«f Stuart’ HJtf 11 J : : ■ #OT€Kk. m Dr-*gjwrg.1hkr- XCA Cc-nirtr-! ' mra PufMT Suttfh-fcKfadted ■ . . " r '? .** www.XEameStation.cdm 1 2.^6u.2JSS| HurnzrttilglNuitcvtLfHL-T Pm: rWi* i-^IMMl ifiil ’ : n . c « Lm ^ ,u::j ul tel. 01298 70012 fax. 01298 70046 www.peakelec.co.uk sales@peakelec.co.uk Handheld Test Gear - Cool, Smart. Atlas DCA Model DCA55 Semiconductor Analyser Identifies type and pinout! Atlas LCR*^9 Atlas LCR Model LCR40 Atlas ESR Model ESR60 ESR and Capacitance Meter Resolution of 0.01 ohms! Atlas SCR Atlas SCR Model SCR100 Inductor, Capacitor, Resistor Analyser Triac and Thyristor Analyser Automatic part identification. Auto gate test current up to 100mA UK: Please add £1.00 p&p to your order. Prices include UK VAT. Please see website for overseas pricing. 5/2008 - elektor 75 INFOTAINMENT PUZZLE HOTAnrtlfM Pu«lewithan F 1 vAOnJUIaU electronics touch Looking back on the poor weather conditions of the last few months it seems prudent to have a Hexadoku puzzle in stock for yet another a rainy day. If you've not participated before, by all means do so and you may win 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, 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 5-2008 (please copy exactly). Include with your solution: full name and street address. 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 June 2008. PRIZE WINNERS The solution of the March 2008 puzzle is: C2563. The E-blocks Starter Kit Professional goes to: Ben Rowles (UK). An Elektor SHOP voucher worth £35.00 goes to: Philip Soper (UK); Silvia Rotondi (I); Sudhir Kumar Gupta (IN). Congratulations everybody! D 9 7 3 4 B 1 4 3 5 2 C 8 7 E F 3 4 8 9 C D 2 0 8 6 2 E 1 C 4 5 F 3 3 1 E D 9 2 8 7 4 5 2 D C 0 6 1 3 A B A 7 1 B C 5 3 0 2 5 C 3 F D 8 F B 2 3 1 0 8 2 C F 9 B 7 D F B 3 0 C 7 9 D 4 E 6 5 2 1 9 B 1 8 E 7 0 8 A 7 5 9 F B 4 D 2 0 7 5 4 0 B 4 2 9 A F (c) PZZL.com 7 D 1 9 0 8 4 6 3 C 5 B E 2 F A C 2 6 3 D 5 E A F 0 4 8 7 9 B 1 F 4 E 8 B 9 7 3 1 6 2 A 5 C D 0 0 A B 5 F 1 C 2 D 9 E 7 8 4 6 3 D 8 F B A 4 1 0 9 E 3 5 2 6 7 C 6 3 C E 5 B 9 7 A 2 8 0 D F 1 4 5 9 2 4 E 3 6 F 7 1 C D B A 0 8 A 7 0 1 C 2 D 8 B 4 6 F 3 E 9 5 8 C 3 A 6 F 0 B E D 7 2 1 5 4 9 2 1 5 D 9 A 3 E 0 8 F 4 6 B C 7 B F 9 7 4 C 2 5 6 3 A 1 0 8 E D E 6 4 0 1 7 8 D C 5 B 9 F 3 A 2 1 0 A 6 8 D 5 C 2 B 9 E 4 7 3 F 9 5 D F 3 E B 4 8 7 1 C A 0 2 6 4 B 7 C 2 6 A 1 5 F 0 3 9 D 8 E 3 E 8 2 7 0 F 9 4 A D 6 C 1 5 B 76 elektor - 5/2008 'Alibi-Nota' telephone answering machine (1972) Peter Beil As early as 1972, a telephone answering machine appeared on the market that was sec- ond to none: The 'Alibi-Nota FL' with remote listening / erasing functionality. Zettler, a company famous for its pio- neering telecomms technology, had succeeded in going round the extremely strict regulations laid down by the German tel- ephone authorities, forbidding private users to send control signals of any kind (be it car- riers or dial pulses) over the public telephone system (PTS). The resultant 'O' and ' 1 ' code allowed the Alibi-Nota (what's in a name!) to validate the caller/user. The code was programmed using small plug- in boards marked 'yes' and 'no' and inserted into slots marked 1-10 located at the underside of the equipment locked in any position. The front side had a replaceable cassette for the fixed message. Inside we find an endless tape with a clearance in it for on/off switching and switching over. Sporting a microphone, foot- switch and fast tape rewind the machine was also suitable for use as a Dictaphone. The com- plete Alibi-Nota weighs 15 kgs. The tape recorder proper is quite conventional, but the remote control unit is a masterpiece of engineering. Removing the one kilogramme steel cover of the encoder bay reveals a large ver- tically mounted board that can be hinged out. The relays allow the equipment to be controlled 'in parallel' and the logic circuits used are now long forgotten types from Siemens & Halske like the FLH131, FLJ121 and FLK1 01 . Pulse dialling was the de facto standard at the time and DTMF (tone dialling), in its infancy. The idea of remotely control- ling an answerphone machine was ingenious and relied on a 'binary' method: ten short 1 -kHz tones played after the welcome message had to be answered or not. In practice, callers had to blow into the mouthpiece or say a word out loud in Pitfalls — sure! 'Static on the line' — quite normal at the time — would have upset the opera- tion of the Alibi-Nota machine as it was unable to discern between 'yes' and 'no'. As part of the dialogue, further check tones had to be 'answered' correctly, if not, the machine would stop the play- back and disconnect. To use the remote erase function, you had to respond to the last tone prompt as well (the last tone naturally was within the call you were making). Alibi-Nota was a full- fledged tape recorder recording at 2.4 cm/s — fully adequate for the limited frequency response of analogue phone lines. It was fitted with a call counter, a ring pulse counter and adjustable recording length. For each key, the control buttons could be response to two text- announced tones, or muffle the mouth- piece in response to two other tones. To date this answer- phone is fully func- tional on the ana- logue phone sys- tem. In 1 972 it would have set you back the equivalent of about a month's wages. ( 071073 - 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 4/2008 - elektor 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 564999 ATC SEMITEC LTD www. atcse m itec . co . u k 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 £10.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the manufacturer’s prices. B0W00D ELECTRONICS LTD www. bowood-electronics.co.uk Suppliers of Electronic Components • Semiconductors • Opto Electronics • Passives • Enclosures • Switches • Stripboard • PCB Materials • Popular Special Offer Packs Online Store, all major cards Same day despatch upto 3.00pm Personal Service sales@bowood-electronics.co.uk 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. 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! DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0)1872 223306 EasyDAQ www.easydaq.biz • USB powered, 4 relays + 4 DIO channels • Will switch 240VAC @ 10 amps • Screw terminal access • LabVIEW, VB, VC • Free shipping • From £38 Design & supply of USB, USB Wireless, Ethernet & Serial, DAQ, Relay & DIO card products. info@easydaq.biz EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • device programmer manufacturer • selling through contracted distributors all over the world • universal and dedicated device programmers • excellent support and after sale support • free SW updates • reliable HW • once a months new SW release • three years warranty for most programmers YOUR ELECTRONICS OPEN SOURCE http://dev.emcelettronica.com Website full of Projects and Resources for Electronics Engineers and DIY. • Tutorial • Hardware (Schematic & Gerber) • Firmware (Asm & C) • Reference Design Everyone can submit a story as a useful source! 'Share for life' S first TethnalGCfY Trantftr ltd. FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk/PICProTrng.html Microchip Professional C and Assembly Programming Courses. The future is embedded. 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 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 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. ILP ELECTRONICS LTD www.ilpelectronics.com Tel +441233750481 Fax +441 233750578 ILP have been manufacturing audio modules since 1 971 and apart from our standard range we also offer a custom design service for the OEM market. LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and GCEs). Also Technical Management and Languages. HE 78 elektor - 5/2008 products and services directory 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 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 OBD2CABLES.COM http://www.obd2cables.com • Thousands of OBD cables and connectors in stock • Custom cable design and manufacturing • OBD breakout boxes and simulators • Guaranteed lowest prices • Single quantity orders • Convenient online ordering • Fast shipping Visit our website, or email us at: sales@obd2cables.com ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! • MeccanoTM Compatible • Computer Control • Radio Control • Tank Treads • Hydraulics Internet Technical Bookshop, 1-3 Fairlands House, North Street, Carshalton, Surrey SM5 2HW email: sales@robotiq.co.uk Tel: 020 8669 0769 RADIOMETRIX www.radiometrix.com The leading global developer of ISM band, low power radio modules for wireless data transmission: • Transmitters • Receivers • Transceivers • RF modems • Evaluation Kits w SCANTOOL.NET http ://www. scantoo I . n et Scantool.net offers a complete line of PC-based scantools for under £50. • 1 year unconditional warranty • 90 day money back guarantee • For use with EOBD compliant vehicles • Fast shipping • Compatible with a wide range of diagnostic software Visit out website, or email us at: sales@scantool.net USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. 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 5/2008 - elektor 79 BOOKS, CD-ROMs, KITS & MODULES Going Strong A world of electronics from a single shop! Principles and Practice e-t * i Silent alarm, poetry box, night buzzer and more! PIC Microcontrollers This hands-on book covers a series of exciting and fun projects with PIC micro- controllers. You can built more than 50 projects for your own use. The clear ex- planations, schematics, and pictures of each project on a breadboard make this a fun activity. You can also use it as a study guide. The technical background infor- mation in each project explains why the project is set up the way it is, including the use of datasheets. Even after you've built all the projects it will still be a valuable reference guide to keep next to your PC. 446 pages • ISBN 978-0-905705-70-5 £27.00 • US$ 54.00 303 CIRCUITS Fully elaborated electronics projects 309 Circuits Computer Vision Computer vision is probably the most exciting branch of image processing, and the number of applications in robotics, automation technology and quality control is constantly increasing. Unfortunately entering this research area is, as yet, not simple. Those who are interested must first go through a lot of books, publications and software libraries. With this book, however, the first step is easy. The theoretically founded content is understandable and is supplemented by many practical examples. Among other subjects, the following are dealt with in the fundamentals section of the book: Lighting, optics, camera technology, transfer standards, camera calibration, image enhancement, segmentation, filters, correlation and stereo vision. The practical section provides the efficient implementation of the algorithms, followed by many interesting applications such as interior surveillance, bar code scanning, object recognition, 3-D scanning, 3-D tracking, a stereo camera system and much more. Approx. 320 pages • ISBN 978-0-905705-7T-2 • £32.00 • US$64.00 The present tenth edition of the popular '30x Circuits' series of books once again contains a comprehensive variety of cir- cuits, sub-circuits, tips and tricks and de- sign ideas for electronics. Among many other inspiring topics, the following cate- gories are well presented in this book: test & measurement; RF (radio); com- puters and peripherals; audio & video; hobby and modelling; microcontrollers; home & garden; power supplies & bat- tery chargers; etcetera. 432 pages • ISBN 978-0-905705-69-9 £19.95 -US$39.95 v y \ y Prices and item descriptions subject to change. E. & O.E 80 elektor - 05/2008 All articles published in 2007 Elektor 2007 This CD-ROM contains all articles pub- lished in Elektor Volume 2007. Using the supplied Adobe Reader program, articles are presented in the same layout as originally found in the magazine. An extensive search machine is available to locate keywords in any article. The instal- lation program now allows Elektor year volume CD-ROMs you have available to be copied to hard disk, so you do not have to eject and insert your CDs when searching in another year volume. With this CD-ROM you can produce hard copy of PCB layouts at printer resolution, adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other programs. ISBN 978-90-5381-218-1 ' £16.90 • US$33.80 More than 68,000 components ECD4 The program package consists of eight databanks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. A further eleven applications cover the calculation of, for example, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A colour band decoder is in- cluded for determining resistor and in- ductor values. ECD 4 gives instant access to data on more than 68,000 compo- nents. All databank applications are fully interactive, allowing the user to add, edit and complete component data. This CD- ROM is a must-have for all electronics enthusiasts. ISBN 978-90-5381-159-7 • £15.90 • US$31.80 DigiButler (May & April 2008) A low-cost home automation server based on a Freescale Coldfire 32-bit mi- crocontroller. The project has been de- signed with open source in mind and doubles as a powerful Coldfire develop- ment system using free CodeWarrior soft- ware from Freescale. DigiButler activates electrical appliances in and around the home, accepting on/off commands from a WAP phone, through an Ethernet net- work or via a webpage at an allocated IP address and with full access security. Elektor Internet Radio (April 2008) In the good old days, you had to modu- late audio signals onto an RF carrier so they could be received and demodulated to produce something more or less audi- ble. Nowadays you can access every Internet radio programme in the world by receiving, buffering and decompres- sing IP packages. This is all very easy with the Elektor Internet Radio. All open- source! Kit of parts including SMD-stuffed PCB , programmed microcontroller , all leaded parts and CD-ROM containing CodeWar- rior , TBLCF documentation , datasheets , application notes and source code files. Art.# 071 102-71 • £29.00 • US$ 58.00 More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com r^lektor LZ3shop PCB, SMD-populated Ait.# 071081-/1 • £115.00 • US$230.00 r — 1 i & Datalogger "deLuxe" (March 2008) We have had the pleasure of proposing various data acquisition units over the last few years. This Datalogger "deLuxe" is a nice exercise in product develop- ment. It actually utilises an SD card as the media for data storage. The hard- ware design is compact and that makes the firmware and software features even more interesting. Kit of parts incl. PCB , programmed control- ler and display Art.# 070745-71 • £71.75 • US$ 143.50 05/2008 - elektor 81 PRODUCT SHORTLIST, BESTSELLERS May 2008 (No. 377) £ USS Two-wire LCD 071035-93 ....SMD-populated board with all parts and pinheaders ...12.70... 25.40 Display Computer 070827-91 ....Populated PCB in enclosure ...78.80... ...157.60 DigiButler (2) 071102-1 PCB with SMDs premounted; empty microcontroller ...18.00... 36.00 071 1 02-71 .... Kit of parts incl. CD-ROM, PCB with SMDs premounted; programmed microcontroller ...29.00... 58.00 071 1 02-81 .... Software on CD-ROM (project software and CodeWarrior 6.3) 5.20... 10.40 Elektor AVRprog 080083-71 ....SMD-populated board with all cables ...23.50... 47.00 Tiny Counter 070954-1 PCB, bare ...11.50... 23.00 070954-41 ....Programmed controller 7.50... 15.00 April 2008 (No. 376) Elektor Internet Radio (EIR) 071081-71 ....PCB, SMD-populated .115.00... ...230.00 CC2-AVR-Board 1 071 035-91 .... PCB, partly populated, ATM1 8 Controller module 7.30... 14.60 071 035-92 .... PCB, partly populated ATM1 8-Testboard ...27.00... 54.00 Frequency Response Sweep Oscillator 070951-41 .... Programmed controller 5.40... 10.80 March 2008 (No. 375) Data Logger "deLuxe" 070745-1 PCB, bare 16.30 070745-41 .... Programmed controller 1 9.90 070745-71 .... Kit of parts (PCB, programmed controller and display) ....71 .75 The Secrets of I2C 070600-1 PCB, bare 13.60 070600-41 .... Programmed controller 1 9.90 Cylon Voice 070859-41 ....Programmed controller 4.70 ECIO PLC 070786-1 PCB, bare 16.30 70786-71 Kit of parts (PCB, EClO-module, all other components)....76.00 ..32.60 ..39.80 143.50 ..32.60 ..39.80 ....9.40 ..32.60 152.00 February 2008 (No. 374) LEDBUS System 070459-1 PCB, power module 070459-2 PCB, central 070459-41 .... PIC1 2F638-I/SN, programmed (power module) 070459-42 .... ATmega32-l 6PC, programmed (central) RGB LED Mood Lighting 070892-1 PCB, bare 070892-2 PCB, bare 070892-3 PCB, bare Surround Light for PC Monitor 070491-1 PCB, bare 070491-2 PCB, bare LED Ringflash 070612-1 PCB, bare 070612-41 .... PIC1 6F628, programmed 070612-81 ....Software on CD-ROM TV Surround Light 070487-1 PCB, bare 070487-41 .... Programmed controller 070487-42 .... Programmed controller 070487-81 ....Software on CD-ROM CAN Explorer 060201 -1 PCB, MCP2515 and MCP2551 SN 060201 -W Testing & Error Sources Manual www.thePCBshop.com www.thePCBshop.com 3.10 6.20 13.80 27.60 www.thePCBshop.com www.thePCBshop.com www.thePCBshop.com 21.50 43.00 5.00 10.00 www.thePCBshop.com 10.50 21.00 5.20 10.40 21.50 43.00 12.70 25.40 10.50 21.00 5.20 10.40 www.thePCBshop.com www.elektor.com / Prices and item descriptions subject to change. E. & O.E Bestsellers m r mi* \ O od 1 2 3 4 5 1 2 3 4 5 1 20 3 4 5 PIC Microcontrollers ISBN 978-0-905705-70-5 £27.00. US$ 54.00 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 E19.50.....USS 39.00 PC Interfaces under Windows ISBN 978-0-905705-65-1 £27.25. US$ 54.50 FPGA Course ISBN 978-90-5381-225-9 £14.50. USS 29.00 Elektor 2007 ISBN 978-90-5381-2 1 8-1 £1 6.90..... USS 33.80 £15.90. US$31.80 ECD 4 ISBN 978-90-5381-159-7 USB Toolbox ISBN 978-90-5381-2 1 2-9 £1 9.90 .....USS 39.80 Ethernet Toolbox ISBN 978-90-5381-2 1 4-3 £1 8.90 .....USS 37.90 Datalogger "deLuxe" Art. # 070745-71 E71.75...USS 143.50 C0 2 Measurement Art.# 070802-71 E107.50...USS 215.00 ECIO PLC Art. # 070786-71 E76.00...USS 152.00 Elektor Internet Radio Art.# 071081-71 £1 15.00... USS 230.00 USB Flash Board Art. # 070125-71 £36.20 US$ 72.40 Order quickly and safe through www.elektor.com/shop 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 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com 82 elektor - 05/2008 Electronics inside out! The free e-magazine about internet, computers, hacking, tweaking, modeling, gadgets, geekstuff, gaming and DIY electronics. The e-zine you have to check out now! Receive i-TRIXX in your mailbox FOR FREE I each Wednesday a From the Elektor labs: Simple, useful and fun electronic circuits! Play the i-TRIXX Quiz and win! Test your knowledge about internet, computers and electronics. Take your chance now and play the i-TRIXX Quiz. There are great prices to win! Powered by Check i-TRIXX.com and subscribe now! INFO & MARKET SNEAK PREVIEW on the testbench: PC soundcards All PCs are now sold with a plug-in soundcard or equivalent on-board circuitry for processing audio signals. To electronics design- ers, the soundcard doubles as a fine instrument to do (low-frequency) measurements, effectively turning the PC into an analyser or an oscilloscope. Sufficient resolution of the soundcard is perhaps the single most important condition for accurate measurement results. Hence we ran laboratory tests on a number of soundcards on the market with different price tags. The results are presented in the June 2008 issue. Colourful Computer Light We live in a colourful environment these days. Everything is in colour: TV, advertising billboards, mobile phone displays and LEDs. Philips added a further dimension to all this with their Ambilight, Wake-up Light and Living Colors lamp. We will work with the latter in this Modding & Tweaking article. The wireless remote control offers interesting possibilities once the protocol has been cracked... Switch-mode audio power supply Lots of electronic equipment is powered by a switch-mode power supply (SMPSU) because it's light, efficient and compact. Alas, SMPSUs suitable for use with audio power amplifiers are rare finds. That's going to change with SAPS-400, a module with an ad- justable output voltage to ±60 V and good for a whopping 400 watts of output power. SAPS weighs just 500 g and is a little larger than two cigarette packs. RESERVE YOUR COPY NOW! The June 2008 issue goes on sale on Thursday 22 May 2008 (UK distribution only). UK mainland subscribers will receive the magazine between 1 6 and 1 9 May 2008. 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 magazine for me each month Name: Address: Post code: Telephone: Date: Signature: Please cut out or photocopy this form, complete details and hand to your newsagent. Elektor 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 S3 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. 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 5 f Ipklrnr April 3CC " L JiSfS tern .«•« if SC Pfit W Y 5 k\ R#s-#i># 1-YHDiX yzaj mJblhAa Par t'tt W«-flTtt4illh'! CD HO** CwM-t LMrA AT FtiKiS 84 elektor - 5/2008 Description Price each Qty. Total i Order Code Computer Vision £32.00 CD-ROM FPGA Course fTTSSl £14.50 CD-ROM Elektor 2007 £16.90 PIC Microcontrollers £27.00 Data Logger “deLuxe” £71.75 Elektor Internet Radio £115.00 Free Elektor Catalogue 2008 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 Address + Post code METHOD OF PAYMENT (see reverse before ticking as appropriate) □ □ □ □ Bank transfer Cheque (UK-resident customers ONLY) Giro transfer VISA Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com sales@elektor.com Email Date - - Signature EL05 Yes, I am taking out an annual subscription to Elektor and receive a free 2GB MP3 player*. I would like: I I Standard Subscription (11 issues) Subscription-Plus (11 issues plus the Elektor Volume 2008 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 - - Signature EL05 *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 MatfBffant Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com subscriptions@elektor.com 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. Online ordering: www.elektor.com/shop 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 (Priority) Outside Europe: £9.00 (Standard) or £11.00 (Priority) HOWTO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40209520 held by Elektor Electronics with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsibility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. September 2007 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £42.00 £49.00 Surface Mail Rest of the World £56.00 £63.00 Airmail Rest of the World £71 .00 £78.00 USA & Canada For US$-p rices please check www.elektor.com 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.60, a Student Subscription- Plus costs £39.20 (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 2008 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 weekly t-p+i - — - gr l i • te -i r.-ii: Epjiil hVK IM 111 faniaCi . b 9 .,m 1 a ■ “ - t! ■ ■ ■ »n 9 t- ri,- a * - ’a* -■-a- i n n BTT'-a ttt : ^ rns i-ri h?hbi m i .* a ’jbi ■ c" *a e i a ■ ■ j ■ ■ ! a «■ r * 4 > j * a s aa !■ a L i. --+:>a, H^: t * a riMi Register today on www.elektor.com/newsletter WWW. elektor. com Tel: 01 03 S 40347 Mr.vhijp,' EJi:i:i rniki::!-: LIH Fm:D16aJffil43 farads Hurt BsilsFfiU BID 2 null: clrvmitattnnulBfty.tmn.ra.ulc x > 7 Ht u ryd I'Kirri nl n s . r?a . 1 1 k Index of Advertisers Allendale Electronics Ltd www.pcb-soldering.co.uk 36 ATC Semitec Ltd, Showcase www.atcsemitec.co.uk 67, 78 Avit Research, Showcase www.avitresearch.co.uk 78 Beijing Draco www.ezpcb.com 73 Beta Layout, Showcase www.pcb-pool.com 73, 78 Bitscope Designs www.bitscope.com 3 Bowood Electronics Ltd, Showcase u/u/u/./}ou/ooo , -e/ecf/'or7/'cs.co.iyA' 78 Byvac Electronics, Showcase www.byvac.co.uk 78 Decibit Co. Ltd, Showcase www.decibit.com 78 Designer Systems, Showcase www.designersystems.co.uk 78 EasyDAQ, Showcase www.easydaq.biz 78 Easysync, Showcase www.easysync.co.uk 78 Elnec, Showcase www.elnec.com 78 EMCelettronica Sri, Showcase www.emcelettronica.com 78 Euro circuits www.eurocircuits.com 55 First Technology Transfer Ltd, Showcase . . www.ftt.co.uk 78 FlexiPanel Ltd, Showcase www.flexipanel.com 78 FLYPCB www.flypcb.com 75 Future Technology Devices, Showcase. . . . www.ftdichip.com 78 Futurlec, Showcase www.futurlec.com 78 Flammond Electronics www.hammondmfg.com/uk 35 ILP Electronics Ltd, Showcase www.iipeiectronics.com 78 Jaycar Electronics www.jaycarelectronics.co.uk 2 Labcenter www.labcenter.com 88 Lascar www.lascarelectronics.com 41 London Electronics College, Showcase . . . www.lec.org.uk 78 Marchand Electronics Inc, Showcase Microchip MikroElektronika MQP Electronics, Showcase New Wave Concepts, Showcase . . . Newbury Electronics Nurve Networks Paltronix Peak Electronic Design Pico Quasar Electronics Radiometrix, Showcase Robot Electronics, Showcase Robotiq, Showcase ScanTool, Showcase Showcase Tsien (UK) Ltd, Showcase USB Instruments, Showcase Virtins Technology, Showcase www.marchandelec.com 79 www. microchip, com 17 www.mikroe.com 11 www.mqp.com 79 www.new-wave-concepts.com 79 www.newburyelectronics. co.uk 87 www.xgamestation.com 75 www.paltronix.com 13 www.peakelec.co.uk 75 i/i/i/i/i/i/.p/'cofec/?.coA7? 15 www.quasarelectronics.com 37 www.radiometrix.com 79 www.robot-electronics.co.uk 79 www.robotiq.co.uk 79 www.obd2cables.com, www.scantool.net . ... 79 78, 79 www.componentbin.com 78 www.usb-instruments.com 79 www.virtins.com 79 Advertising space for the issue of 23 June 2008 may be reserved not later than 27 May 2008 with Huson International Media - Cambridge House - Gogmore Lane - Chertsey, Surrey KT 1 6 9AP - England - Telephone 01 932 564 999 - Fax 01932 564998 - e-mail: p.brady@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. 5/2008 - elektor 87 The Proteus Design Suite Celebrating BO Years of Innovation 1988 1990 2000 2005 2008 Labcenter commences trading with PC-B for DOS 1 989. First integrated autorouter added for PCB Design. Schematic Capture added to PCB Layout package 1 99 1 . forid First Schematic Capture for Windows™ . 1 99B. Topological route editing for easier PCB layout. 1 993. Proteus offers fully integrated circuit simulation. 1 994. Autorouter enhanced with Rip-Up and Retry algorithm. Gridless, shape based power plane support 1 99G. True, mixed mode SPICE simulation introduced. 1 997. Interactive simulation - ideal for educational users. 1 998. PIC microcontroller simulation technology developed. 1 999. 8051 microcontroller simulation technology developed. Worlld First Interactive MCU co-simulation (VSM] EOOI . High level language support added for MCU simulation. EOOE. ELECTRA adaptive shape based router interface added. E003. forOd First 32 bit MCU simulation support with ARM7. E004. Integration between Proteus VSIVI and MPLAB™. Redesigned GUI across the Proteus Design Suite EOOG. 3D visualisation engine integrated with ARES PCB Design. EOD7. forid First USB schematic based USB Simulation. Coming Soon: Introduction of HDL support in simulation, ODB++ manufacturing output, improved core SPICE simulation algorithms, enhanced live DRC error checking and much more. LABCEIMTER ELECTRONICS LTD A technology pioneer in the EDA Industry since 1988 Technical Support direct from the program authors Flexible packages and pricing tailored to customer requirements. !Yean v Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com