JUNE 2007 vyww.elektor*etec&Dnics.co.uk fcj 77G265 45112 fi jerqy nr- Log on to r: : . f\f CS.^CO* U fc/® 1 for your FREE catalogue! •n e n rn ,ri *>. -5 ..i 4 u-bUy U3^ /£%1 (Monday - Friday 05,00 to 1730 GMT + 10 hours only) War those who want to write: 100 Silverwater Rd Silvemvater NSW 2128 Sydney AUSTRALIA www. ji a y c - - • r >Jl u V % . - / ■> All prices in £ Stg \ v A * Free j 430+ page ^7 .Catalogue ■ i Visit us at www.iaycarelectTomcs.tG.uk and obtain your free copy of our 430+ page, full colour catalogue. We have an extensive range of electronics kits and the best in innovative gadgets. Jacobs Ladder High Voltage Display Kit KC-5445 £11.75 + post & packing With this kit and the purchase oF a 12 V ignition coil (available from auto stores and 7. £ 1 f |\ parts re cyclers), create an awesome rising J0 » ladder of noisy sparks that emits the distinct -■ smell of ozone. This improved circuit is suited to modem high power ignition coils and will deliver a spectacular visual display. Kit includes PCS, p re- cut wire/ladrier and all electroEiic components. * 12V car battery, 7AH SLA battery or 5 Amp DC power supply required Powertool Battery Controller £11.75 + post & packing Enhance the performance of the charger supplied with your power tool with this controller It incorporates charge timeout, min and max temperature monitoring. Delta charge detection, power and charge LED indicator, adjustable Delta V, temperature settings, and optional adjustable trickle charge. Suits both Ni-Cd and Ni-MH cells. Kit includes PCB with overlay, case, all electronic components and dear mstnietions. POST AND PACKING CHARGES: Order Value Cost Or der Value Cost £20 - £49.99 £5 £200 - £499,99 £30 £50 - £99.99 £10 £500* £40 £100 - £199.99 £20 Max weight 121b (5kg). Heavier parcels PDA, Minimum order £20. Wole: Products art dispatched from Australia, so local customs duty and taxes may apply. How to ord^n Phone: Dill Australian Eastern Standard Time Mon-Fri on Q3&0 032 7241 Email : techsio r-t* j syco re ct remits- co . ufc Post: FQ SOX 6424. Silvenvater NSW 1611. Expect 10-14 Days Far Air parcel delivery DC Relay Switch KC-5434 £4.50 + post B. packing An extremely useful and versatile kit that enables you to use a tiny trigger current - as law as 400pA at 12V to switch up to 30 A at 50VDC It has an isolated input, and is suitable for a variety oF triggering options The kit includes PCB with overlay and all electronic components with clear English instructions. Voltage Regulator Kit KC-5446 £4.50 + post & packing Tills handy voltage regulator can provide up to 1,Q0QmA at any voltage from 1.3 to 22VDC. ideal for experimental projects or as a mini bench power supply etc. Kit supplied with PCB and all electronic components. Stereo VU and Peak Meter Kit KC-5447 £20.50 - post & packing Accurately monitor audio signals to prevent signal clipping and ensure optimum recording levels. This unit is very responsive and uses two 16-segment bargraphs to display signal levels and transients peaks in real time. There are a number of display options lo select, and both the signal threshold and signal level calibration for each segment are adjustable. Kit supplied with PCSs, LCD and all electronic components. Accuracy within 1 dB for signals above -40dR. ■ Case not Included use HB-6G82 £2.95 Requires 9-12VDC wall adaptor (Maplin -JC91 Y £14.99) Short form kit ignition Coil Driver KC-5443 £13.00 + post 8. packing Add this ignition coll driver to the KOS442 Programmable Ignition System and you have a complete stand-alone ignition system, that will trigger from a range of sources including points. Hall Effect sensors, optical sensors, or the 5 volt signal from the cars ECU. Kit includes PCB with overlay and all specified components, * Kit supplied with PCB, and all electronic components Battery Zapper MKIl KC-5427 £29 OD -r post & packing Tins kit attacks a common cause of failure in wet lead acid cell batteries: sulphatiom. The circuit produces short bums of high level energy to reverse- the damaging sulphation effect. This new 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, all electronic components and clear English instructions. Suitable for 6, 12 and 24V batteries * Powered by the battery itself ^ / ^Proved maa e i 50MHz Frequency Meter MKIl Kit KC-5440 £20.50 + post & packing This compact, low cost 5GMHZ Frequency Meter is invaluable for servicing and diagnostics. This upgraded version, has a prescaler switch which changes the units from Mhz to GHz, kHz MHz and Hz to kHz, and has 10kHz rounding to enable RC modellers to measure more accurately. Krt includes PCB with overlay, enclosure, LCD and all electronic components. Other features include; * 3 digit reading (LCD) * Pres cater switch * Autoranging Hz, kHz or MHz * 3 resolution modes including 10kHz rounding, 0.1 Hz up to 15 0Hz r 1 Hz up to 16MHz and 10Hz up to 16MHz Ignition System KC-5442 £26.25 + post & packing This advanced and versatile ignition system can be used on both two & four stroke engines. The system can be used to modify the factory ignition timing or as the basis for a stand-alone ignition system with variable ignition timing, electronic coil control and anti-knock sensing. Features: * Timing retard & advance over a wide range ■ Suitable for single coll systems * Dwell adjustment * Single or dual mapping ranges 1 Max &. min RPM adjustment * Optional knock sensing ■ Optional coil driver * Krt supplied with PCB, diecast case, abd all Hand Controller KC-53B6 £25-95 + post & packing This LCD hand controller is required during the initial setting-up procedure. It plugs into the main unit and can be used while the engine is either running or stopped. Using this Hand Controller, you can set all the Initial parameters and also program the ignition advance/retard curve. Kit supplied with silk screened end machined case, PCB, LCD, and all electronic components. DSO Test Instrument Software for BitScope Mixed Signal Oscilloscopes ^ ^ v \ / , . ,i Tt r ' E ~ 1 n TT » _n 1 k n It 30 TF1 r ii j. r ! ns wL iflrn iO =n IS-JL -M i', 4 Channel BitScope 2 Channel BitScope Pocket Analyzer BitScope DSO Software for Windows and Linux Up to 4 analog channels using industry standard probes or POD connected analog inputs. Mixed Signal Oscilloscope 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 OSO supports them all. Capture and display up to 4 analog and 8 logic channels with sophisticated cross-triggers. Capture deep buffer one-shots or display waveforms live just like an analog scope. Comprehensive lest instrument integration means you can view the same data in different ways simultaneously at the click of a button. 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 Z5nS. DSO may even be used si and- alone to share data with colleagues, students or customers. Waveforms may be exported as portable image riles or live captures replayed on other PCs as if a B si Scope was locally connected. BitScope DSO supports all current BitScope models, auto-coni -gums when 'i connects and can manage multiple BltScopes concurrently. Ko manual setup is normally required. Data export is available for use with third party software tools and Bit Scope's networked data acquisition capabilities are fully supported. 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. Data Export Export data with DSO using portable CSV files or use libraries to build custom BitScope solutions. Measuring — but what exactly? I am from a century when you could safely say ihal a steering wheel wheels, an engine, seats and a chassis are among Hie main parts that constitute a car. Although I also remember lots of tinkering I always felt owner of the vehicle . I cheerful- ly adjusted the eight valves ro match my very own preferences and never failed to keep the cor going one way or anoihec If we are to believe car tuning expert Chris Vossen of the Ele- ktor design lab, my concept of a car is antiquated. The car, or should that be the onboard computer, pushes the driver out of his seat and takes over big time'. A multimeter is the standard measurement tool for every electronics hobbyist. You can use them to measure voltages, currents and resistances. Many modern multimeters can also measure capacitance and frequency. A few of them The OBD-2 Analyser described in this issue will inform you m plain language what s happening under the bonnet. Taking that a bit further OBD-2 supplies only a subset of the massive amount of information your car is process- ing (and recording?) and your car dealer will not spill the beans either when asked for the full set of data. So. along this line of thinking, what if car computers get smarter still and start to record route information and vehicle speed? This begs the ques- tion of who owns the information. You / the car dealer / the hacker / the car manufacturer / the computer manufacturer / MOT? * The digital multimeter is a trusty test instrument owned by almost any electronics enthusiast. It comes in many shapes and sizes, but versions with a serial interface are of particu- lar interest. We tested a number of these instruments spotted differences and collected the results in a tv article. just in case you have no practical interest in OBD-2 or a new multim- eter may I suggest a fine class-A valve amplifier? A solid design using well-established technology and components, the omp is sure to take you back to the previous century in more than one way. Wisse Hettinga international Editor This handy analyser (available as a kit} makes a simple job of rummaging through the information stored by the client-accessible part of your cars computer. It works with all current OBD-2 protocols and can read and erase trouble codes stored in the vehicle and reset the MIL display. All this without the help of a PC or a visit to a service station. T cross out y. 1 hot's not applicable even have the facility of a PC connection for data logging. In this article we give an overview of (almost) ail devices that are currently available wi th th is feature. Volume 33 June 2007 no. 366 26 32 38 46 56 62 66 2.4 GHz Spectrum Analyser Whistles from High Up Tube Sound Stand-Alone OBD-2 Analyser Linux Oscilloscope Coil Clinic Flowcourse: Alarm System Simple DIY Programming 26 2.4 GHz WiFi Spectrum Analyser This project employs a Cypress 2.4 GHz digital radio chip to make a simple spectrum analyser. This can give you a picture of which parts of the 2.4 GHz WiFi spectrum are being used in your immediate vicinity and even be used as an aid in optimising chan- use and detection of interfering devices. It is remarkable that triode output stages still occupy an important place in high-enrt audio amplifiers. Triode amplifiers are often very expensive. The design presented here is based on a combination of optimal quality and reasonable construction cosh Keywords: 6AS7 power triodes and a marched output transformer Reliable Fingerprints 75 Design Tip: SDR Soundcard Tester info & market 6 Colophon 8 Mailbox News & New Products Meters with a Tail 53 OBD - between ecology, marketplace and Big Brother 81 Eiektor SHOP Sneak Preview 76 Hexadoku 77 Type 1650-A Impedance Bridge (1960) lektor lectronics Volume 33, Number 366, June 2007 ISSN 026S/45 1 9 E-sJiic-- Etsctr&tiizs alms at ring prop’s to master e ! ££trciifti£ zt zrry personal IcveE by pre^E^bng construcdcfi projects 2nd spotting developments in el’ecirorh-a arid inform ajicn technology. Publishers E'-zvic i£rt-_- _ r- - - 7^3 lOOOGh^Vfe* Boe 4 Brentford TW3 9HH, &^snrf. (+44) 208 261 4539, fee (+44) Iffi 261 4 1 IT T-F — i II _ * The - z - Zzbie tom f5a«Sc^ti. bi*>3X€E zrdta&znxiss T+t oufei, ~ r a* — ----' ' " ' —""EctT-T" - — - : '-tv — * j eel^'t.-- 1 ■_ £ U 4&I ik*zr zrri be tt^ztc 5 esc arrived ri ireth {knei 2 nd - -- .---- -- f>± ■■?: ege, '£ v - ■■ - = _ z_‘ ~- - rr - n-_ --.- - , — r -=, -- Internationa] Editor , T id- •--- = := — ■ •: : /.Zee LJ =” r= ( *- r I -j '■■L r ■ } Editor: e _ _ : ■ £ - : c-.ior^etscL'C - -3 am*} IniernatiofuJ editorial staff; —irry . Trsp ffedt=rs. Ejtezi Kf sr^e^t^C [€. " £ : . - B_ - 1 T— “f 1 “ 7 " “ Design suff: Arzc _ e -j: j e “i t Gesberis -e_ GzcEEerrs U*Z 1^-— T-e-£, ;E“ . "ZEE r CrTE!£2f4 /l-n=- Ed] tonal set marizt: ~t 7 . : -’"^z - :~e - - Graphic design DTP: B e Z_ z. Scr^c e - Managing Director Publisher: -z_ i~z< - le M arketing: Zb^z- e - Zzee-oz. Customer Services: Margr-et: Cere -■■ zeez-s. I^sr Subscriptions: E --‘ ■ t iibc" ze -Jz'ilr £ RegLS Brentford, 1 000 Gteei Wes fo+d. firsr-iford TWB 9HH, England. + 1 t-44i BOB 26 : ^5G r * fe* +44 2CB >_ 4+^ • ' _+ e — er ■ . -. :-z_ -- t • ■ :•- - • • ■ Ernst: ~zz£n e : :e^i E _ e r , E" E“ : _ e- B_ i-:: .t ■ " =- z : — Head Office: 5e=m#ab.v. BO. Bo* 75 NL-6 1 9Q-A5 Seek Tr= <+31)46 4369444, fee (-3 1) 46 4370161 Distribution: I: ._ I IbiAry Street, Lcreton ECIA Erg^rid Te 44 EE - 4E? 407] UK Advertising: -1 Hezza. Cstibrid^ J-foysfe Gogmore fene. Br-er.-e., ; ■ ~ t 9Ar EtyrereL “+ei--i— • B3Z 564979 fe^ 921 5649§g r^T r ■ 7 . . . . ■ ■= rTt liififfset .:: e: e :— T . ~ ~I ” £ “EE'EE E - I EE ’ i E'i£ ,;d — _I Z"T _. ■£■££ International Advertising: -- 7-: - es±. sz _ _ — -i _ &r2_- . ---- - ‘ ^ - --■r.iv --i ~.te: ttrfmi e.i ££ - 1 - ~eT,:er Copyright hloiice Tne dn&is described ii d?5 rr.iTir.--e z-= k* tkxo&*x «e cr*/. AS pCcEsgtsmi, pWed -— erd: se^-Ei t?you(X pn^r^xjred x *i±b crirri. a=Js, sefeATne ottcet :e r i-.i i'zr: ._- _-:-. •- mt irr~: ;: _ z' r ' - 7 .-- t _ r 1 ± : : . Szgrerr lev. 3rd msy twz i be TbpnGdiKsd c< tr^nsvizad « +— z< by sty rw=nt wV tffn g p^*CK0py«£. rsccft&ig, Sflt vbtj&e or in. pit wStKrr 1 - it . .- 3 t 5 ?i peFfTK^bo fnem Pybfisriers- SudN -ATt^ perrv^en i?so be cfct^igd fart tf« s. ttmslii a^r raiijt f^ert pre^z+e- bc£ n crc^rr tfayibs :onf^5fti^jfejC!iHr r.irfi u^aK, The PdtAZ' zr oos ret zicept fftKTi^yferQir| to eierefy 3 ^ p^st^oc.od^pnctKtiac fir sstsfruscr- £?oesgTtoc - ^Kles.j r r=:i:e 5 istt 55 > 5J - - - - be F .. I'iTTe- ir-risr ire ^ ; tvt — 1 :■: _:i — --± icrie r, r . --:■- :ep tT ;_ r tior^ oi?,ie. Hie ^bSdieri 2 eny mstsr^ s. i~ r=d to r-er- Disclaimer Pes and dzHlcCJtini rf <=bts Titten id trtr^e. E?nxs svi a tjaa © Segmeni b.v. 2007 Printed in the Netheriands ElmScc i USB Scan Tool ■ Diagnose any car with EOBD - Bassd on the ELH327 1C ■ Supports all EOBD and OBD- JI prococok ^ tfG/5765-4 (CAN) S ISOI423Q-4 (Keyword 2000) + fS09l4i-2 SjlBSQVPW ^ JIB50 PWM 9600 or 3B400 baud S up p cried by more software than any other QBD interface Inexpensive Full Speed USB U Automatic protocol detection Package includes cables, software CD, and Quick Start Guide Buy from your local UK distributors! www. ElmScan5.com/elek tor Your price conscious PCB supplier i m CIRCUITS Online price calculation Online ordering Online order tracking Online 24/24H and 7/7 D Interested? Contact us: +44 2088 16? 005 VISIT US AT NEPCON BOOTH 350 www.eurocircuits.com Verified A la carte On demand pooling for standard boards up to 6 layers from 1 to 1000 pieces from 3 working days onwards - pooling vj\lh more options - up to 8 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 6 ehklc: daefronro ■ 6/2007 http://wv/w.mjkroe.com/eni'dtstribLftors^ Find your distributor: UK USA Germany, Japan. France, Spain. Greece Turkey, Italy. Slovenia. Ct ostia. Macedonia, Pakistan. Malaysia. Austria. Taiwan, Swjtterland, Lebanon. Syria. Egypt Portugal Please visit our web page for more info http://www*mikroe.COfTI EasyARM Development Board BIGPIC4 Development Board with sn-fcssnt USS 2.0 pfec r n it f' Cc-rnpi—E Hajifirart zred 5^-lLiIki-n wtii fln-board USB 2.0 j.t/tw wxJ irtflu&JCO mikroElektronika Compilers Rif-T jnd C Ik i'shujS jiwj OKidi&jjri -nemo ■_ - -i Scard EasvAVR4 Development Board BIGAVR Development Board * 7 th ndJ-lMSKf USa 2 l 0 prasrafTLTier *itn c-r»- hoard USB 2.C- pf frj}- Jmm* ? -A-Z,-, KA= DeVcLOPLTE/TT SYSTEM S SST“" ■ inftajf VtrV -- =- . -=.==— r ??l =O j - lT-~-l~ :• i "i - ,*£=, zr\ Ote rr^r-KEi of tr*=F 5^TiE pfzj£_ fbt* t.iswi S- f 14. 10, 20. *S <0 VI FfC y=s w^fi'a FtCr6FS77AL EasyBOSIA Development Board EasyPSoC3 Development Board rtilh at d USS 2. 0 p r f *fi5h an-co,=jd tJSB 2; (tfcgra^rw - E= li L?A ,_ -ZL^r 2.1 L'CO = - L ' ' EasydsPIC4 Development Board dsPICPRO 3 Development Board Cc i K j ■■Tii.: '." _ ' i £: lli E- i r. In z _ - Cest->i-E=Je !-,e:”.iZ."= 37-1 Sc~i. z r z i: utijz-n i c f) ir-c-irrf U 5 5 2. 0 pragMKt t f 4 jv 3 r » J Ci! C 0 U 35 10 p^c-3njn--Ttir zr.d — * mfCU CfcS-jS ZEPP.Z-'Jtza&r. z:: r JOT--- f-.& flash e-o w: Thtijtisn&mxse. 20. 2S *nd 4Gpln uiijj *in Aw.££A]e1 Fslt. fjTBE*. 5 ow*=d on the tnarrf b s crasfefe so fes ~- -* •= — - _ z-n ? = s ■ itJfcJj (4 Thff sytiMl ■■1 r ' : :"i ■=-= : r"c.sl !■* :: LCD m - lOMrtzj dcr'.f’jCiTiejTf . i _ or En^r-a! lCH- ^ ■ -. c! Z_- 1 .. :-LZ 3 L i k^t' 7 c-:-: ' soe ■ .- prO!±oL-v* bites haqHSr s^se±^-e- tics: ftr !£a Rsa^Trc deiuggiki cr 3 rncraecrv V— rra %% mikroElektronika DEVELOPMENT TOOLS | COMPILERS j BOOKS EasyPIC4 Development Board *43! on’biiro 3J5E 2 0 prc-g^-mn^T JiT^d 'n'iJifdErQ Uni-DS 3 Development Board With on-fco3fd USS 2-0 pnjgra^rr^r LV24-33 Development Board CtKrc^tLj Hijfinfirci ana S-anAiLS faction wih on- UBS 2-0 pm fflAJMrk g ,5Jid fpiknKCD cr-t-i 6 200? - e!A)ur ek^lronsG 7 MAILBOX TTTiW^B [TTTTPii i L viM itiii:} /J.li MIDI to DMX Hi there — I have built your MIDI- DAAX project (September 2C0 1 , frdj using o PCB purchased from yourselves. I have checked everything and the project does not seem to function, 4 meg and 24 meg clocks are present, there is activity on the doto and address busses but no output from the UART. Is it possible there were any er- rata in the documentation etc? Any ideas welcome. Phil! Macdonald (by email) C -■ ' e c f c u ■ c ro fotypes was ca- pacious when starting, Giving erroneous UARl operation , The only solution to get it to work property was to add a push-but- ton in parade with capacitor C ' so we were oboe ip reset *ne board manually, if necessary: Since fitting this button, the pro- to r \ p a n o s . : w o ■. 5 *v 'c r k ed c o r - rsctly. tree it this phenomenon appeorec on just one of our pro- totypes r we should mention this workaround, In the end we dis- employed by the author for the project (March 2007 } , under freeware license. The company ana the product may be found on the internet at w w w . qd de v. Qt/p rc ducts/ a vrusb / ' f n dex . n tm The freeware license is also the reason hr the circuit d*aaram w appearing in the article. Shortwave Capture: forum buzzing arid the optical encoder A small community c r radio en- thusiasts nos gathered around our atest shortwave receiver as- sign {December 20061 and the participants live , exchange of ideas in response to the publico - tion may be read on our Fort-m under the header 'My circuit does not wo-v set } . The rotary encoder used in the design was not specified in detail in the article. It is the covere d ih at the BAL'D OUT p in of /Cd ■■■ as stuck at 66 He when it should go to A MHz. It is not clear from your mes- sage whether He supplied rest p r cd ro rn d m >:_tes ter. e x e v vo rks. nor if you programmed the EPROM yourself or purchased our ready-programmed device 010303-21 type ECW1J-B24-AC0024 from Bourns . T h. : s de\ ce supplies 2d pulses per full revolution , ena- bling a step size of 2d i .Hz as- suming a resolution of J kHz :'v. htch : $ sufficient tor AM and FM tuning }. For 555 listening in the ham radio bands . 100- Hz resolution will be selected resul- ting in 2.4 kHz tuning range per full turn or the encoder. h a rotary encoder with a large r number of detents is used, it is AVR drives USB even possible to achieve fOO- A number of readers have ex- Hz step tuning in alt ranges, pressed their curiosity about the Suggested types include the source of the USB ENC;j-D28-lQQ128L f 128 de- firmwa - tents) and ENC1J-D28LQ025& re with 256 de terns. Further infor- mation o n ih es e en co a e rs a t w \w . . n o u rm . cam compo- n en is . a spx?cm sph i d-762 1 3 8317 1632 9 9 : f 282 Q252#ce 1,4-volt zener diode Dear Jan — I would like to point out that diode 02 is drawn incorrectly in the circuit diagram of the Simple Solar Charger from the April 2007 issue. The cathode of q diode is indicated by a coloured ring. Because zener diodes For low voltages ore not operated in reverse-biased mode, the ring marker should be at the negative side of the circuit, i.e., ihe other way around than with zener diodes with a higher voltage. Hans E Kiefer (Germany) The very property you men hew. is discussed ex fen she > in ire text l did you read if?). None ihe less. the device is a zener diode and should be represented as shown in ,: :-= circuit diacram. w £5 DMM from builders market Dear Editor — I would like to respond to your article Accurate Measurements for a Fiver' I read in the February 2007 issue. In the illustration I discovered the wording 'Cat II 600 V' which for ail practical purpos- es means that a cheap meter like the one pictured can be used for checking 230-V mains voltage on a wall socket. Personally I would not like to have one of these in my hands For that purpose, Ef only for the risk of one of the lest leads accidentally left in the 10 A receptacle (whatever 3 EC 1010 has to say about about that!). My point, really, is to say that the article is right in proving the usefulness of these cheap meters, but somewhat lacking in information on how to measure safely. B. van Linden [Netherlands) 7he author of the article , Fans Jan sen replies: "A typical use of these meters will be voltage checks on mains sockets . and then it is rerrec' to soy that this measu- rement should not be done with an un fused JQA receptacle on the instrument , because other- wise *he domestic fuses may blow. Consequent'} 1 the user manual contains a number of safety guidelines to help prevent accidents, However the gist of the article is the electronics inside these lew cost meters, era He accuracy •t con achieve Although a sec- tion on safety wau/d hove been interesting it was unfortunately 04 a sice ihe scope of the arc e Nonetheless i hope you did like tre article. Scale Deposit Fighter — "the green way' Dear Jan — 1 was happy to see Mini Circuits appearing again in the March 2007 issue with a nice design of o water softener [Scale Deposit Fighter, bd ). This type of circuit has been known for some time al- ready and I have one installed on the main water intake pipe in my home. Whilst it serves it purpose quite well, I was less happy to reason that the de- vice adds to my electricity bill, it being left on for 24 hours, 356 days a year. AJf hough my proposed solution does con- sume a little power I do steal it from a source that's humming anyway: the bell transformer. In this way I hope to do my bit for the environment, because there are losses anyway in the bell transformer. After oil, if the water softener were to hove its own transformer there would be energy losses two rimes over, just thought I d send you this tip. Malcolm Fobre (UK) 8 elector deitmn ics - 6/2007 r Thanks Malcolm for your environ- mentally inspired suggestion in respon- se to our publication. May 2007 issue Dear jan — I just had la drop you a quick note to say that I though! ihe content of your May 2007 issue was of an exceptionally high standard. The article on the LCD graphi- cal display was very helpful and although f don't have any of the E -Blocks systems, I intend to now build my own PIC hosed interface using your module. Then there was the article on the RDS radio beacon — a beautiful piece of software de- sign and this was reflected in the almost trivial hardware then the article on the Software Defined Radio. A truly amaz- ing range! Your team must have burnt ihe midnight oil on lhat one. Keep up ihe good work! Mike Boyden (UK) Vran k s for h e res p o n s e A- ■ icho el it made a nice chance from u being at ihe wrong end of ihe customer compbires line. Freescale samples Dear Editor — I have wondered whether you could explain to me o matter that's related to your magazine's report on Freescale'' $ offer of free samples ('Attack of the SpYder', Morch 2007 and 'g-Force on LEDs', April 200 7 r Ed.). 1 have been unable to get these despite their web page confirming my request [via Farnell UK) which v/as around 6 weeks ago. The authors of the article did not necessarily imply an ar- rangement with your maga- zine. but the implication v/as that they at least had obtained these themselves. So I am wandering why I have not received any or whether anyone else has, I am waiting to hear what Farnell hove fo say. G.H* Davies (UK) information received from Freescale indicates that fol- lowing the publication or our March 2007 issue many hund- reds or readers have succes- sfully obtained samples of the /AC9S08 micro using the me- thod printed in the article you refer to. See also the rreescale SpYder Code^Varrtor & Co to- pic on our forum. May we sutjaesr you first obtain assistance, through a forum pas- ■Jna from other readers cn how iu* r they did it Samples should be ordered di- rectly from Foescab. \e. nor through ram eh as you seem to have attempted. If you still experience problems, let us kno w and I will assist Thank you for the explana- tion. I now realise that I clicked 'Parnell on Freescale s web page thinking they would be supplying me, whereas it really named Fornell os ihe sample recipient! When I revisited the site I also ordered a $50 demoboord whereupon such ambiguity vanished. Sincerely, G.H.D. Glad to see that the problems „jn. r-. ■ ore sorted out. We should rei- terate however that the sup- ply of free samples of the MC9SQ8QG8CFBE chip is at *t Solution to Hexadoku April 2007 I I 1 i i t t i i i i t t i t t i i i ! I I t t I L — ^ — _ — _ D _ — = = D B I = _ — — = = =, 1 6 0 A C D 8 2 E 9 1 4 5 3 F 7 B 7 3 5 8 A 1 6 0 E B D F 2 9 4 C F 1 B 2 7 4 5 9 C 0 A 3 6 D 8 E ■4 9 D E F B C 3 8 2 6 7 A 1 5 0 3 F C B 8 2 D A 6 5 o" 4 1 E 9 7 D 2 4 0 Q 3 9 5 1 7 8 j E C A F 6 A 5 E 6 c 7 4 1 3 D F 9 0 8 B 2 1 8 9 7 E F 0 6 B A C 2 D 5 3 4 8 D F 1 3 5 B C 0 9 7 6 E 4 2 A 5 E 2 A 4 0 1 7 F C 3 B 8 0 6 9 9 7 6 3 0 E 8 2 5 4 1 A B C D F C B 0 4 6 9 A F 2 8 E D 5 7 1 3 2 A 8 F 1 0 7 B D 3 [9 C 4 6 E 5 0 4 7 9 5 6 3 8 A E B 1 F 2 C D B 6 1 5 9 C E D 4 F 2 0 7 3 A 8 E C 3 D 2 A F 4 7 6 5 8 9 B 0 1 ! Corrections & Updates I I t j Wireless USB in miniature j March 2007, p, 44-51, ref. 05 0402 4 1 The battery must be disconnected from the prototyping board j 1 (Figure 10) if the circuit is powered by a mains adapter. 1 — — — - _ _ = ^ = ^ = = ^ = .1 the discretion of Freescale only ; ft of El ek tor or Co rn eli The su pp i v was set up as a saeca- arrange- ment in support of the Elektor ac - celerometer and S odder pro leas and may have been stopped when this edition $ published (June 2007}. MailBox Terms -_z :s::” ■ sscs w 's cccEcc~cB r :s i si tfte of tns Esjpfo * f Itv.-p i "ts e.we resEed C . -zrd~r,% gra ms nt-;5*5sr ty ri-sr if B-Scrcr er Pubiiftaf. ■ Correspondence may ba l cans czc cr tir&c V £Til3 tT . 5, * ytcoi repC ~z a Vs uox ”--•1 ■ + -~ ~- u'esss r .~c= r -'.isast Sc- >■ :-tr Va = : •::- r Ei.::-^Er:E in ec i :c ■ V s = 6 -:tc ^sctr z n i c s. i _ . -» _ - Elektor Tha Editor. 1 000 Great .Vest Robb. Brentford nVa 9 HH. England ic ftTyr< ■ 6/2007 - ciekier electronics 9 NEWS & NEW PRODUCTS Single-chip ZigBee® Platform in Package"' solution Freescale Semiconductor has m- Produced o single-chip platform solution based on the ZigBee® specification that is designed to deliver the industry s lowest power consumption and highest perfor- mance The MC 1 322x platform is engineered to support battery life of up to 20 years, doubling the expectations for current ZigBee solutions. Freescale's MC 1 32 2x Is available in a Platform in Package :v (PiP) solution that integrates the essen- tial components of a ZigBee ap- plication within a single package, thereby reducing component count and system cost. The MC1322x platform contains a 32-bit micro- control !er (MCUj a fully compliant IEEE® 802.15.4 transceiver bal- un and RF marching components- all integrated into a small-footprint land-grid array (LGAJ package that virtually eliminates the need for external RF components. The platform solution also features o TurbaLink -1 '' technology mode, en- gineered to increase data rates by up to 2 megabits per second be- tween nodes. Itron, a leader in advanced meter- ing technology for (he global utility industry, has selected the ZigBee standard for home energy manege- menl and load control applications far its Open Way Advanced Meter- ing Infrastructure [AMI) platform. ZigBee technology currently targets industrial, commercial and medi cal applications, such as energy management and asset tracking. Freescale 's proprietary TurbaLink technology mode boosts the data rate up to 2 Mbps providing an ideal platform to support diverse applications, such os voice, wi re- less headsets and compressed au- dio, as well as large data trans- fers. Far healthcare-related appli- cations, such as patient monitoring systems, TurbaLink technology also enables real-time data collection from sensors on the body. That data then can be sen! via a Zig- Bee network !o a central location far monitoring. The MCI 322x devices will switch automatically between the IEEE 802. 1 5.4 protocol and TurbaLink technology pockets, allowing she developer to take advantage af the high-speed capabilities, while si- multaneously controlling and mon- itoring a ZigBee mesh network. This high-speed capability creates a tremendous opportunity for new designs and applications. The MC 1 322x platform was de- signed from the ground up to support battery-powered applica- tions. Optimized for Lithium ton or NiCad batteries, the MCl322x is designed to support batteries as small as coin cells or use standard alkaline batteries that can provide up to 20 years of system life, www.freescale.cam MotionDSP launches new copyright detection technology MotionDSP announced I ken a Copyright a copyright detec- tion technology that matches con- tent solely an the video content. Ikena Copyright uses a (patent- pending] component of MotionD- SP'' s military-grade video enhance- ment technology first announced in October, '2006. As opposed Eg audio-matching methods. MolionD- SB's unique technology creates a 'video fingerprint by tracking the motion characteristics the video. Several major online video cam- ponies have already expressed strong interest In Ikena Copyright and MotionDSP expects several an- nouncements in the coming months far agreements related to Inis tech- nology platform. ikena Copyrighl is a pure video technology; it does not rely on audio fingerprinting in any fash- ion. ft uses potent-pending video imelllgence algorithms (which are based on MotionDSP's care video enhancement technology] to gener- ate signatures for any video file, ikena Copyright s video signature system is claimed to stand up to many attacks such as; © Editing: n con identify' dips os small as 20 seconds • Low-bitrate compression: it can identify dips that hove been re-en- coded (i.e.: from their native for- mat to Adobe® Flash© internet video) • Aspect ratio change: 16:9 con- tent compressed into o 4:3 display or 4:3 stretched to 1 6:9 • Cropping the sides of a video © video quality change such as B&W conversion and colour distortion. MotionDSP's core intellectual prop- erly Is protected by several pat- ents and is now being delivered to customers through its ikena vid- eo processing service. Ikena is a scalable service for the automated processing and identification of video, designed for high-volume use by content owners such os Viacom'®. Warner Brothers® and FOX©, as well as Internet Video sites such as MySpoce Tv and You- Tube''"'. There is also great appli- cability for Ikena with mobile carri- ers such as AT&T®, Verizon© and DoCoMo®. . ' . _ L_-5 www.motIond5p.com New low-cost serial communications tool Microchip announces the PiCkit™ 5eriai Analyzer. This new too! en- ables design engineers to easily and cost-effectively interface with embedded circuits within serial systems using any Windows®- based PC. The new PIC kit Serial Analyzer comes complete with a 28-pin demo board featuring the 8-bif PIC16F886 microcontroller. The kit's hardware and Graphical User Interface (GUI) software allow test- ing and debugging of communsca- lion between the PC and several in- dustry-standard serial protocols an the microcontroller being tested, in- cluding EC™, SPI and USART. Included are user s guides for the PiCkit Serial Analyzer and the 28- pin demo board, complete source code, selected application notes and Microchip's free MPLAB© IDE integrated development environ- ment. The kit also comes with a GUI that enables designers to eas- ily analyze the various serial com- munication protocols, as well os create and save scripts. Available now, the PiCkit Serial Analyzer (Port # DV 164122) includes Micro- chip s 2 8-pin PIC16F886 Flash microcontroller demo board, USB cable and CD. The 28-pin demo board [Part # DM1 641 20-3) can oho be purchased separate- WWfWJnlirodilpJirect.com ly and comes with one populated and two bare boards. 0713117 10 eleptfar eSeclmniii - 6/200? Single-cell Li-Ion / Li-Polymer chargers in SOT-23 packages Microchip announces the cost-ef- fective MCP7381X Li-lon/Li-Poly- mer charge-management con- trailers. Offering programmable charge currents up to 500 mA, they feature integrated current sense, integrated pass transistor, thermal regulation and reverse bat- tery protection, ail in a 5-pin SOT- 23 package. Since they operate within USB out put-power limits the MCP7381X charge-management controllers can be powered do rhe USB parts on most PCs, The charge-enable input of Ins new devices provides a very simple interface for design- ers to use. The MCP738 I ] has a digital input and selectable USB charge currents of either 1 00 mA or 500 mA, while the MCP73812 offers a user-programmable charge current via an external resistor. The new devices are ideal for a range of consumer electronic de- vices. such as rechargeable toys and low-cost MP3 players. Samples of the nsv devices are available at sam- ple, microchip, com and volume production orders can be placed today at www. micrcchipdirecl. com. For more in- formation, visit Microchip s Web site at: www. micro chip, .*t pt ‘rcars ■ Ll£ UW -iii J r^v - A- -- - - ' W v =j^±±ir ln*v Jeter**! Jf':‘ T ; Qt ■ u L l) K* -j: *2 H»l| IT 0 C O ECU ** cc 11 Hriro c< «? 16114? U 41 !BU£0 CiO EficSitis DC D V) r ti '-*133* DC 1B7I u-j jwin> 111 tuiik DC 1 2J.S a.V Al/TD III DC s *y nofQ It 5T3 i rata DC T0IQ *«JT0 1 - 1 i xm 4 _ _ j _ t fl O B I m i » »ij ^ — stricted In this version in that ihe data can be stored in a file and retrieved again, but the file name is fixed. Voltercuft VC92© Meter: This is a sturdy meter with soft rubber edges. It has a large dual display with a bargraph. and a bright white backlight. It turns off automatically after an adjustable amount of time. The main display has 4 3 /z digits (40000). There are many different settings such as Min/Max display. Peak, Hold, Rel,, storing and show- ing of a number of measurements, frequency [400 MHz) and capaci- tance (40 mF). It takes true RMS measurements up to 400 kHz. It is a well-designed device offering many functions. Software: The accompanying software is dear and easy to use. The window shows the actual value, an analogue meler scale, and the measured values in o table as well as a graph. It uses R5232 for the connection. USB is also possible, but you need to buy an opiional cable for this. There is no help Function* You can measure a preset number of records or record indefinitely. The measured values can be stored in a Cyrae jj rwt*. El com Uraemia] -Q000H 4S V i&t* V =* e;«w I'm ± | f z» 'Ul ;■ .ii-:* V U.»S -l&C* * \\_ ’i»ss K -4 IBS* V lisui GC -lien ~~V- 1'r'l t!«t» ! DC " -iiUCJ lr rn 1 s DC iXSJ r ■ i -* ii DC : - % Hiifl -SHlEI ■# - ii becl File (Excel, database or text format) ond can also be retrieved. The sam- pling interval can be set as a number of seconds and the graph can be scrolled and zoomed. 6/2007 - dshorde fimniu 23 Brand & model rrp ! approx.) (t| exd. VAT no. of digifs [HzJ basic accuracy [%] C f AC (true-RMS) other ranges D-giiek DT-4QQQZC 22 (€32j 3 3/4 (4,000' 0.5 1 00 pF 10 MHz duty cycle VoitcraH VC-820 27.50 €.40) 3 3/4 (4,000) 0.9 1 00 ut 1 0 mHz . SinomeJer MAS-345 34 (€49) 3 3/4 (4 ,000) 0.5 400 nr * s_ HI ■ t Vel lemon DVM345Dt 43.50 (€63i 3 3/4 (4,000) 0,5 400 nF - - hfe DJgilck DTE OOO 50 €73 4 5/6 (80,000) 0.03 IOOuF 3 MHz -r rev co uni. dBm UNI T UT70B 50 [€73j 3 3/4 (4,000} G.a 40 mF 400 MHz rav count VoStcr oft VC 920 72.50 i€ 1 05 i 4 3 4 (40,000) 0.1 40 mF 400 MHz 400 kHz duty r-.de; R$232 Sinome-cr MS82 18 125 f€4 8 1 ] 4 5/6 50 r GQ0) 0.03 5 mF 2 M Hz 20 kHz duty cycle: dBm Sonwa PC510 146 € 2 1 2 • 3 5 6 ;5 ; 000) 0.06 U_ E r-* 125 kHz 20 kHz Melri* MX 26 163.50 (€237) 4 5/6 50,000} 0.3 D0 mF 500 kHz TOO kHz Sanwa PC 5 000 242 €351) 5 5/6 (500,000) 0.03 1 mF 2 MHz 20 kHz duty cycle; dBm: R5232 Gsf-Ltn Vetnjwatt Met ra hit j-fra 310 (4-449 4 1/2 (T 2,000) 0.05 1 mF 1 MHz 20 kHz pulse v/dlh Agilent UT 252A 310 {€450} 4 5 6 [50,000) 0.025 100 mF 20 MHz 100 kHz pulsewidfh; dBm; dB\ Fluke 189 351 €509 1 4 5c 5C 0.025 50 mF 1 MHz 100 kHz pulsevvidlh; d5V Goshen Metro watt 295 440,50 (€639) 5 1/3 310,000] 0.02 30 mF 300 MHz 100 kHz d B ; V/;VA;Var. ;VVh ; V/a h Metrix MTX 3283 Bluer, I 462 (€670) 5 1/2 (100,000) 0.02 2 MHz 200 kHz 63: pulsev, ,dth voiturs ”e sc«! 9 35 comparable* d un apparel/ 6 / ou/rc err ;ii. r jsn dee differenfes pi’&dsfons oonnees cur rhacun des fmbnconfs Brand & model display backlight auto-off extra functions M : =Min/Mox, A=Avei'cgs, H— Hold, P^f^ok, R=Re). cable software rrp £ (€1 excl. VAT 5 Digits k DT-4000ZC - * H, R R5232 incl. /oltcraft VC -820 - - H, R RS232 1 ind. Sinometer MAS -3 45 ■ - - R5232 incl. Ve Neman DVM345D1 ■ - - RS232 md. - Digitek DT8COO - - R H, R R5232 mcl. UNI-T UT70B # * M r H, R. RS232 incl. Voltcra ft VC -920 ■m ■ M, h, n R R5232 incl. Sina meter M.S8218 m m M, H, R R5232 ind. Sariv/a FC5 1 0 *■ * Mj H, R R, Zoom R5232 POUnk 76 (€110; Metrix /AX 26 * R Mem R5232 SX QMM 103.50 !€15GJ Sanwo PC5G0D - m M, H, ? t R R5232 FC-Unk 76 (€110) Gosses Metrawatt Melrahft x-iro • * M* H, square wave gen, F dole: memory , USB Metro V /?n T 3 i {€ 1 90) Agilent U1252A # m /4 r H R R, square- wo-e gen., data memory USB incl- Fluke 1 S9 * * M t A. H, F) R, data memary USB Fluke Vi ew Forms 121 €175- Ga55en Metrawatt 295 * M, H, square wave gen, r data memory, stop writ ch USB Metro V/ in 131 (€190) .‘4st-'=x MIX 3283 Bluet. * m M, H. F) R r data memory USB 5X-DMM 103.50 (€150) - Log/cie) y comp ris cable _ 1 Manufacturer Model Manufacturer's internet address Agilent U1252A ww, c q ) 1 e nt. com Digitek Sinameter Unt DT-4000ZC, DT8000 MAS-345. MS82T8 UT70B wwv-'.elv.de Fluke 189 www. fiuke.com Gasmen Metro watt 285, i'i’ieSrobil x-lro . 4 -w,v. g -□ ssenrr etro ,vqH. com. d e to u 3 1 . h l m Metrix MX 26, MTX 3283 www, dn a u\ i n - a rn o u x.tr Sanwa PC510, PC 5 000 w ,%-hV. 5 a n -vvE - rr" c-f€ r. to. j p Vdleman DVM345DI .-,vav. -j e! 1 tm on.be Voll croft VC-820, VC-920 wvrfwl .uk.conrod.cam 24 etejiorefeEtranlu - &2Q07 N»i Number One Systems The World Beating PCB design software for Windows Easy-PC version 10 sets another milestone Winning accolades the world over, Easy-PC for Windows V 1 0 is another major milestone in the evolution of this extremely popular software tool. Try a demonstration copy of Easy-FC and prepare to be amazed at the power, versatility and remarkable value for money °Af Version 10 features □ Intelligent Gerber Import option ■ TracldShape < Hug t Mode Routing ■ Text Callouts ■ Layer Sc Via Stack Previews □ Blind & Buried Via Support □ Teardrop Pads ■ Draw Spacing Clearances H Spiral Tracks fit Shapes Plus many more exciting features,..... Fully integrated Schematics & PCB layout in a single application complete with forward and back annotation. Design and rules checks at all stages ensure integrity at all times. Professional manufacturing outputs allow you to finish the design process with ease. Stop press,.* Stop press*.. Stop press.,. Stop press, Easy-PC imports Eagle files as well asTsien Boardmaker 2 files call for a brochure, prices & CD on +44 (0)1684 773662 or e-mail s3les@numberone.com you on also download a demo from www.numberone.com Oak Lane. B redo n. Tewkesbury, Glos. GL20 7LR. United Kingdom No CcHpromise Oscilloscope Other oscilloscopes in this price range force you to compromise on one of the key specifications; sampling raU\ memory depth d bandwidth The PicoScope 5000 series is a no compromise PC oscilloscope at a price every engineer can afford. 1GS s sampling rate 2S0MHz bandwidth I28M sample buffer memory I25MS s 12 bit AWG built In PicoScope 5203 32M buffer £1195 PicoScope 5204 I28M buffer £t79S 6/2007 - ekktor efedronirs 25 RF MEASUREMENT Wniat's appenii c in your area? Jason Hecker This project takes advantage of certain parts of the circuitry in a 2.4GHz digital radio chip to make a simple spectrum analyser. This can give you a picture of which parts of the 2.4 GHz WiFi spectrum are being used in your immediate vicinity and even be used as an aid in optimising channel use and detection of interfering devices. The 2. 4- GHz Industrial, Science and Medical (ISM) band has been a boon for the short-range personal commu- nications market in recent years. Due to its unlicensed nature and universal allocation, all sorts of communications devices for the home and office have be- come available. These include the ubiq- uitous ‘WiFi’ wireless LAN technology, digital cordless phones, video and au- dio transmitters, wireless keyboards and mice and Bluetooth among others. Unlicensed' does not mean anyone can just build his/her own transmitter and start using it — compliance rules ex- ist in respect of maximum transmitter output power, bandwidth, fixed anten- na construction and other aspects, and mint be met before commercial 2.4 GHz units are allowed on to the market. Type approval for any 2.4 GHz transmitter equipment has to be obtained from rel- evant national institutions like FCC. Heart of the project The chip we : re going to use is the CY- WUSE6935 from Cypress Semiconduc- tors, a complete two-way digital radio modem requiring few external compo- nents to operate. A similar device, the CYWUSB6934, was discussed in some detail in Ref. [ 1 1 _ The datasheets of the J 6935 device and the module may be found at [2] and [3] respectively. As you can see from the simplified block diagram in Figure 1, the ‘6935 contains a modu- lator, programmable frequency refer- ence, demodulator, and most impor- tantly for this project a Received Signal Strength Indicator {RSSI). It is through the combination of the progra m m ab le frequency generator and RSSI that a basic spectrum analyser can be con- structed. By Incrementing the frequen- cy of the signal generator and reading the RSSI register shortly after, a use- ful picture of the 2. 4- GHz band can be built up showing the relative levels of activity in this ISM band. The chip itself is constructed in a GFN package. Tills is a surface -mount pack- age that doesn't lend itself to solder- ing with a regular soldering iron. For- tunately Cypress has made available a module which can be utilised by mere soldering iron wielding mortals for use- ful projects. Tliis module contains the chip, small antennas and the handful of components needed to support It. All the experimenter has to provide is Figure L E) Irak diagram of the OWIMB6935 WiFi data traniceiYer from Cypress. 26 dekfoj dodrania - 6/2007 some power and a few digital signals to communicate with the chip. “Lest we forget", samples of the CY- WU SB 69 3 5 may be obtained from Cypress. Interfacing The chip's internal registers can be read from and written to using the sim- ple SPI protocol Being a 3-volt CMOS part, ibis means that with suitable level conversion it can be connected to a mi- crocontroller or a TTL parallel port. This project takes advantage of the parallel port (due to its simplicity and ubiqui- ty) found on most PCs and laptops but the ideas demonstrated here can just as easily be applied to a microcontroller connected directly to the part. Due to the 3 V (or more precisely, 2.7 V to 3.6 V) power, digital interfacing re- quirements of the chip are straight- forward, hence a surprisingly simple circuit diagram can be drawn for the spectrum analyser — see Figure 2. There are a couple of options for pow- ering the chip itself. The parallel port cannot supply enough current to run the chip whereas the USB port has ample current sourcing ability. Two silicon diodes in series can drop the USB potver from 5 V to about 3.6 V. Three diodes will drop it down to 2.9 V — both choices are hue for the operation of the chip. Bear in mind that PC power supplies can oper- ate the S V power bus as low as 4.7 V (lower for the cheap or overloaded PSUs) so two diodes may be sun fie lent. Toe more expensive alternative istouseaBVto 3.3 V linear voltage regula- tor. A bench power supply may also be used if a USB port isn't available. The TTL interface on a PC's parallel port can be easily used to connect to the 3 V CMOS-based SPI port. The digital output voltage from the parallel port can be re- duced to compatible levels by simple voltage division. The signal input to the par- allel port is a direct connec- tion, as TTL will acknowl- edge V F (logic High level) down to 2.4 V. The output from the TTL port can be as high as 5 V and as low as 2.4 V. In the author’s expe- rience, the High level out- put from the p ar allel p orf Figure 2* Circuit diagram of the spedrum analyser lor the 2.4 GHi WiFi band based has been above 4 V so a di- on ihe Cypress G\flJS06935. USB connedirity is lor supply purposes unly! 6/2D07 - eSefcter dedfsmks 27 RF MEASUREMENT Figure h. £02.1 lb WEAK art Wiry on channel 9. Figure 3 b. Loral souice* ptubablfaCPU dock. Figure 3c. BlueEoolh USB dong la faithfully scanning for other SI uetoo I h devices. Figuie 3d. Micro wave oven calling CQ cm 7.4 GHl vider with a ratio of 0.6 is sufficient to drive 3-V logic. The SPI signal itself requires RESET, MOSI (data out), MISO (data in), SCK (data clock) and SS (slave select). The latter indicates the start and end of the data transaction. The SPI protocol is a host -driven synchronous signalling interface with the data being sent in MSB (most significant bit) order. The first byte written on the MOSI line con- tains two control bits and six address bits, A write transaction is followed by another eight bits of data. If a read transaction is being asserted then the slave sends back a byte from the se- lected address after the initial control byte is written. Scanning and RSSI In order to get a picture of the activity in the 2.4 GHz spectrum, the signal gener- ator inside the "6935 must be repetitive- ly swept up in frequency and the sig- nal level at each frequency measured. The frequency generator in the CY- WUSB0935 can be programmed to oper- ate at one of 128 frequencies starting at 2.4 GHz t using intervals of 1 MHz, The ISM band only extends to 2.463 GHz so there is no point scanning beyond this frequency (indeed the device may not actually operate above the 83 rd step). The RSSI circuit in the chip is designed to take a 50 us snapshot of the incom- ing signal and make an estimate of the power received at that time. The proc- ess of scanning is simple - set the fre- quency, trigger the RSSI circuit, read the RSSI value after 50 us. V The RSSI register puts out a value be- tween 0 and 31. According to the da- tasheet, the range between 0-10 means the received signal level is below - 95dBm, The range from 28-31 means the received signal level is above - 40dBm. This means each count is ap- propriately -3dBm (i.e.J MO) - (-95) / (28-10) - - 3.056 dBm per count. The purpose of the register is to give an indication of whether or not some- thing else is transmitting in the band rather than an accurate estimate of the absolute signal power. If there is no signal above a certain threshold, then it should be safe to transmit without fear of being drowned out by other sig- nals at the receiver. Without some sort of calibration it's not possible to determine the precise power level each register count corre- sponds to, and may vary from device to device The datasheet mentions that when scanning for ail empty channel, up to 10 reads should be made in order to determine whether or not the chan- nel is indeed clear. Software The QTScan software for this program was written to run in Linux and uses QT4 for the GUI. Inside are the parallel port and SPI driver routines. Users of Linux can compile and run the code so long as they have the GT4 runtime and development libraries and headers (for the GUI) and the kernel development libraries and headers (for the parallel port) installed. The binary supplied runs on Ubuntu 6. 10 "Edgy EfL but may work on other recent Linux systems as well. To build QTScan, simply run the executable make. The parallel port should be configured in the RIOS as SPP 1 but depending on your computer hardware it may also work in EPP and ECP mode. Because SPI is a serial protocol, every byte is serialised and deserialised in software. This serialisation combined with the parallel port running at very slow ISA bus speeds (for historical and backwards compatibility purposes) the scanning software actually runs at a fraction of the speed the chip is capable of scanning at. The scanning speed could be much improved by us- ing a microcontroller with a dedicated SPI port or a general-purpose digital I/O port that is capable of mimin g at much higher speeds. Now there's a challenge — anyone with a successful application running on his/her ARM, PIC24F RSC or AVR platform should report to Elektor. Due to the slow nature of the ISA bus parallel port, we measured about 600,000 ioctl ( } functional calls per second that could be executed when reading and writing the parallel port registers. The inb and outb instruc- tions called by iocti ( ) are stalled by the parallel port hardware for what is an eternity for a modern CPU. This puts a very high system load on ihe compu- ter, effectively slowing it down while it twiddles its thumbs waiting for the parallel port to complete the inb and outb transactions. The software simply sweeps all 83 channels in a repetitive fashion. As you can see from the examples in Fig- ures 3a-2d, QTScan shows the results of the current scan as a red line. In the background, a green histogram cap- tures the peak level detected in each frequency bin. With this device the peak histogram can take tens or sec- onds to develop a useful picture of a c- 28 debar drtttimks - tivity in the 2.4 GHz band, so be pa- tient. Most sweeps however will only produce about one peak per scan. The vertical yellow lines mark the cen- tre frequency of the B02.ll WiFi chan- nels. The x-axis starts at 2.4 GHz and * A ends at 2.483 GHz. Each x-axis tick is 1 MHz. The y-axis spans the 32 count levels available in the RSSI register Assuming the dBm per count levels discussed above, the y-axis starts at “125,6 dBm and ends at -30. B dBnr M3 Windows software is being de- veloped at the nine of writing this article. All software for this project is availa- ble free of charge from the project page on the Elektor website. Simply follow Magazine -v June 2007 — 2,4 GHz WiFi Spectrum Analyser or search for archive file 070040 -11, sip Results The authors household contains var- ious sources of 2.4 GHz radiation, in- cluding the computer, microwave oven, Bluetooth devices and an IEEE 802. 1 lb (WiFi) access point, if tills sounds fa- miliar to you. read on* IEEE 802.11b COMPONENTS LIST Resistors R\-RA = lOkO R5-RH = 15kQ Semiconductors D1 ,D2 r D3 = 1N4001 Miscellaneous MODI = Cypress mcduie tyoe CYWM6935 K1 — 25-way sub-D plug (male , angled pins, PCS mciunl K2 - USB-B connector PCB, rei. 070040-1 from vvww. \ h e PC B 5"h a p . cam Figure 4. Component mounting plan of the PCB designed tor ihe spectrum anttlyiet proe/cpuiniG information said the CPU is ru nnin g at 2,310 GHz but the peak is shown to be at 2.4 10GHz in QTScan, If could also be a harmonic from one of the many clocks operating in a mod- ern pc. The signal is present in all the scans, Bluetooth Bluetooth devices utilise the entire 2.4 GHz ISM spectrum. Figure 3c is a scan of a USB Bluetooth dongle scan- spec tram process it uses along with packet retransmission techniques. Tills scan lasted about 50 seconds. Antenna modifications The antennas on the PCB are only de- signed for short-range operation - ac- cording to Cypress, up to 50 m or so for the original purposes of data transmis- sion and reception. The on-board am Design challenge — anyone with a successful application of the CYWUSB6935 running on his/her ARM, PIC24F, R8C or AVR platform should report to tlektor. Figure 3a shows a WLAN access point operating on channel 9, This scan took two minutes to accumulate all the peaks. The signal displayed comes from the regular beacon signal any ac- cess point will continuously transmit. It shows the main lobe centred nice- ly on the channel 9 indicator line. The lumps e idler side of the main lobe are the sideiobes typical of a GPSK (quad- rature phase shift keying) spectrum. You can also see how the adjacent channels overlap. The best way to en- sure that multiple local 802. 11b net- works aren't interfering is to make sure none of the main lobes overlap. PC CPU Clock In the scan in Figure 3b. rhe peak at the left is what's strongly suspected to be emitted from a computer. The / ning for other Bluetooth devices. It is apparent that it is hopping among many of its own channels in the search for a Bluetooth client device it’s ea- ger to talk to. This scan lasted for 10 seconds. Microwave Oven It’s no accident that the unlicensed 2,4 GHz spectrum falls within the same band allocated to microwave ovens. Such ovens can put out over a kilowatt of (pulsed) broad spectrum microwave power and it’s inevitable that some of it will leak out. Figure 3d shows the signal levels leaked by the author's mi- crowave oven operating in the kitch- en about 5 metres away through two walls. You can see how it swamps the spectrum. WiFi can overcome such in- terference to a point due to the spread- tenna could be disconnected (with a knife or scalpel) and an SMA or MCX connector attached to allow for the connection of a larger antenna, either directly or via a length of low-loss coax cable. This would extend the detection range of the device as well as accom- modate directionality with the use of an antenna such as a Conifer |4j, Prin- gles cantenna or the Elektor precision Cantenna [5]. Construction Th an it s to the use of a ready-made module there are no gigahertz con- struction nightmares like tuning PCB strip line s, buying PTFE Duroid " board, adjusting oscillators, knowing if the re- ceiver works at all or indeed what GHz stands for. 6/2007 - daiiT&r ehmodcs 29 PROJECTS RF MEASUREMENT Figure 5. Prototype of the spectrum crnalyser Jason kindEy sent us hf rruil (from Aurlralio), The Caress module and a ridiculous- ly low number of other components are simply mounted on an Elektor-de- signed PCB of which the artwork is shown in Figure 4. The board is avail- able from our business partner The P C B Shop ( w ww.thepcbshop .com ) . Mounting the parts should not present problems. Finally, Elektor is sometimes criticised for not showing the 'less organised side of things'. Here we apologise and make amends by priming a photo- graph of the author 1 s prototype of the WiFi spectrum analyser, see Figure 5. As you can see it r s perfectly possible to construct the circuit on a piece of periboard. We’re now anxiously wait- ing for emails from SticklersforPerfec- tion & Co. in response to printing an example of not so slick' (bur fully func- tional) electronics hardware! References and web finks [ 1 J &acho Control using W LAN ICs, Elektor Electronics December 2006, [ 2 J www. cypress.com po rta I /se rver. pt?s p ace = Community Pag e&comrol— SstComm u n tty S CanrimunitylD=209&PagelD=259&fid=65 &rpn=CYWUSB6935 }3] http: dov/nload-cypress.com published- conten t/p u b I is h / d esig n _ resources; data she ei s /co n tents cywm 693 58 .pdf f 4 ] www. m rx.cam . a □/ wirel ess / CanfierModifIta1ians.htm [ 5 ] '■'■'LAN Antenna Design, Elektor Electronics December 2006. A commercial unit The Wi-Spy Spedrum Analyser is proudly announced as " the smallest spectrum analyser in the world, an invaluable tool for making WLAN price quotes, troubleshooting WiFi problems and optimising WiFi implementations"'. The hardware actually consists of no more than a carefully sealed USE stick with □ tengih of 4,5 cm. The software supplied on CD is called Chanalyser 2.0 (beta) and hints at melageek.net for its source. Compatibility with V/in2000, XR Linux and Ma- cOS is claimed on the box. Wi*5py has some Interesting features like data trace, average trace, peck trace,, fteauen- cy/ channel view and record, playback. Remarkably, Wi*Spy is claimed os being able to track do wn interfe- rence from DECT phones, which (we would hope) work between 1 ,880 and i 900 GHz i.e. r well outside the 2.4 - 2.483 GHz ISM frequency range. But then the receiver inside may be a very' widehand type* The unit casts €119 [approx, £82); we got ours from w\v’iV_\v tan-shop. nl. 30 elskicr etecfranFcs - c 2007 12 monthly issues for only $63 US crlbe at wwvv. audioXpress.com Tel: 01635 40347 Newbtlry Electronics Lid Fan Oi 633 361 13 Fei^ tea * 210 C-3ffiffc tflULlittOBew&llltf. iEGHLCO ilk AWWlK^tUTYCisUl IKK3-C0 SERVICING YOUR DOMPL|T| PROTOTYPE NEEDS 1 EUROCARD ' f/iflx fMrnraJ + Mm + fton/o/s wF Prise eiflmpb An/siie ond coni&^r Opf/ono/; * SoMemadr * Fast-turnaround •Silksttm * f layer Multilayer * 6-lam Mvliihm Q0WNL0A6 GW nil wmwnwmt Freephone Q) 0800-3896560 ware [|£gj £ £JT^ Sfligjjf sefJ yflUT fife onJ Gffet GHtiHfc PC8-POOL.COM % 0,9V/ Boost Driver PR 4401 for White LEDs operation with one 1.2 V or 1.5V battery cell only one external component (inductor) required small outline 50T23-3 package MR S£M!CONDU CTO F? Specialized in analog ASICs / ASSPs Phone +49-6131-5062-0 p/ema 3pfema.com, vAY.v prema.com i the bush: the sole function of the Ferfical speed indicator (VSI) described here is to F an RC model glider pilot with information about fe of climb (or descent) of the craft. ■ -v c ■ Designed to detect very small vari- ations in atmospheric pressure so as to enable the pilot of the model fitted v/ilh it to keep within an ascent, espe- cially when these are infrequent, our acoustic vertical speed indicator is an example of some of the most com- plex electronics we're likely to come across, employing both analogue and di0tal technologies. Tire project com- bines RF and LF and for this reason, it calls for extremely careful construction, since the dynamic range of the signals that nib shoulders on the FCB reaches 120 dB. General allow the model to soar aloft. Our vertical speed indica- tor for models is fitted with a pressure sensor. When the glider moves in the ver- tical plane, the measured at- mospheric pressure will vary The associated electronics con- verts this pressure change into a vertical acceleration figure that s then used to modulate an audio signal, transmitted via a radio link to the re- ceiver, and thence to die pilot's ears. Climbing is indicated by a high-pitched signal, descending, by a low-pitched one. In each direction of variation (climb/de- scend), three vertical speed ranges produce three different frequencies. Below the lowest speed threshold, the audio frequency is modulated by the speed, changing from a continuous tone to an intermit- tent beep. m: ■» \* i-- "-j Q\ i wait a whole second before informing the pilot — the reaction time of the cir- cuit {pressure measurement s- process- ing + audio generation T transmis- sion) must be less than half a second. All proper' aircraft are fitted with an instrument, the *V3F that indicates on a dial the 'rate' of climb or descent (in ft/mn — feet per minute or m/s — metres per second) — - in other words, how fast it is climbing or descending. A model glider pilot stands behind a remote control, eyes glued to the sky, and when tire air is still, it's sometimes hard to judge the vertical acceleration and catch that Thermal 1 that’s going to Target performance The model flying zone lies at an al- titude between Qm (sea level) and 3,000 m, In order to J catch a thermal 1 .r - ~ fe '.‘ip!n n T MB ■Mfcjjr'.* when the air is still (no wind ) t the VSI needs to be able to measuie a low ver- tical speed: the target sensitivity is 10 cm/s (< 20 ft/mn). It is also necessary to be able to pi- lot the model in real time, so it mustn't Block diagram As the block diagram in Figure 1 shows, the unit consists of two mod- ules: a transmitter installed in the glid- er (the top series of blocks) and a re- ceiver on the ground (the bottom series of blocks). The on-board part consists of an abso- lute pressure detector, a quad op. amp (the analogue processing chain), an 8- 32 debar dtaramcj - 6/2007 pin oiicTocontroiler (taking care of the digital processing ), and a miniature UHF transmitter. A compact pow- er supply makes it possible to draw the power needed ( > 200 mW) from a 7 V lithium polymer (LiPo) accumula- tor, though in fact any self-contained 6/12 V battery or rechargeable would do. Circuits Having got an idea of the sub-assem- blies that make up this project, now it f s time to take a look at the circuit di- agrams. To keep things simple, we've subdivided the project into two dia- grams. one for the transmitter (Fig- ure 2j and one for the receiver (Fig- ure 3). Let's start with the most com- plex one, the transmitter. Analogue We opted for an MPX 5100AP sensor (from Motorola, since become Freescale) as it ena- bles us to achieve the desired sensitivity, without being a mini- aturized component; what's more, it is compatible with being used in a mod- el, while being readily avail able at an affordable price (the datasheet can be downloaded from the site provided in reference |7|), The MPX 51Q0AF is simple to use: it provides a DC output voltage with a slope of 45 mV/kPa, i.e. 512 fJV per me- tre (at ground level @ 15 C). So in or- der to react to 10 cm, the VSI electron- ics needs to have a sensitivity better than SO pV. The voltage provided by the sensor may vary from 0.5 V (0 mb) to 4.75 V (1,100 mb); now the dynamic range of oui VSI is limited to between 0 m and 3,000 m; hence the useful output volt- age is going to be from 4.75 to 2.95 V Establishing a virtual earth V EE at 2.5 V enables us to obtain a signed speed output directly from the ana- logue chain. In the absence of speed, the output is at 2.5 V (virtual earth zero); if the model climbs, the pres- sure reduces, the sensor output volt- age falls, and the analogue chain out- put signal is negative wxt the virtual earth V^. During descent, the reverse happens. Let's take a closer look at all that. R10. C7, IC4A are wired as a differentiator. R7 is a compensating resistor to stabi- lize the gain of the circuit, regardless of phase. Analysis of the circuit shows that it is also a filter with a lower cut- off frequency of 0.23 Hz; tills filter elim- Figure 1. Block diagram of Ihe too sub -assent lies that mate up Ite ocaurtc VH: transmitter (lop) and receiver (below). in ate s rapid movements that tend to repeat (vibrations). The gain G of the differentiating circuit is set at G = -6.8 dP / dT IC4B amplifies the signal with a gain G = 56 X. The first-order low-pass filter R6/C8 cutting off at 156 Hz eliminates most of this noise. The function of the last opamp r IC4C, is to match the imped- ance between the filter and the micro- controller ADC input. For a vertical speed of 10 cm/s, the wanted signal out of the pressure sen- sor (dP/dT) is 51.2 pV which is de- tected and amplified by the analogue VPX51EAF AT^tS Vtsn icv vcc O TiU&CKIpfi Q BAT-:-* Figure 2. TrqfliTmtttF circuit diagram, The inlegraled aerial and ihe sensor ore the bultol components. 6-/2007 - ek Vtar eietirenits 33 PROJECTS VS1 Figure 3. Ths r«*iv=r circuit amounts fo very litlle really qi the inl&goted module does the Mori's stare of lbs wwi processing chain; at the input to the microcontroller this wanted signal {19.3 mV) is drowned in noise and off- set by the offset voltage. Signal processing is performed digit- ally by the microcontroller. Digital The digital processing chain extracts the wanted signal from this noisy in- formation, then calculates the relevant speed and delivers the audio signal. The microcontroller we’ve chosen is the ATMEL ATtiny 15L, which is powerful enough despite its 8 pins T with four 10-bit ADC inputs, two programma- ble counters, and an EEPRGM. What's more, it can operate without any ad- ditional components (crystal, voltage reference, Reset, etc.). Choosing V cc as the reference voltage, the 10 -bit ADC has a resolution of 2' iD Le, 5 V e 1,024 - 4.88 mV defining the circuit's sensi- tivity threshold at 12.8 pV i-e M 2.5 cm/s (12.8 pV X 6,8 x 52), An interrupt triggers the program eve- ry 5 ms. Each interrupt prepares an A- D conversion in the following order; the virtual earth, the speed, the absolute pressure, the battery voltage. Thus each of these parameters is encoded at 50 Hz. To extract the wanted signal, the soft- ware performs three filtering opera- tions. The first supplies the mean val- ue of five consecutive measurements, thus providing a filtered speed across five samples at 10 Hz. The second fil- ter performs a rolling average at 10 Hz of the last n {where n is configurable) values of the filtered speed. The speed value obtained at the output of this second filter stage is used to produce the audible signal. The third stage of processing is ena- bled when the speed signal produced at the output of the second filter re- mains within the 'configurable' level flight limits (± 20 cm/s or ± 3Gcm/s, i.e, when the vertical speed is less than 3 or 4 cm/s) for 7.2 seconds at a stretch. This filtering derives the mean value of the residual noise, on the assumption that it in fact represents the offset at the output of the analogue chain; the relevant value is used to "digitally off- set’ the virtual earth value. Thus the bias at the analogue chain output is compensated for in real time. Together, all this processing increases the sensitivity dynamically to bring the noise amplitude on the wanted speed to ± 2 LSE {± 5 cm/s). In the presence of this processing, hav- ing defined {in consultation with end users) the minimum detectable speed threshold at 20 cm/s (by clipping), on the bench the circuit does not produce any spurious audible signal, unless there's a forecast of storms,... Below the J leve! flight 1 speed thresh- old. the software considers thai the model is flying level. To produce the audible signal, four speed values have been defined: 50 cm/s, 75 cm/s, 1 m/s, and 2 m/s. Below 1 m/s, the audio frequency is generated at 625 Hz descending and 1 ,000 Hz climbing, and is modulated by the speed, going from a keyed tone at the lowest speed to a continuous tone at 1 m/s. Between 1 and 2 m/s, the sound is continuous at 1,250 Hz climb- ing or 430 Hz descending. Beyond 2 m/s, a continuous tone of l r 650 Hz climbing and 310 Hz descending is produced. The on/off modulation (keying) below 1 m/s increases below 75 and then 50 cm/s to enable variations at slower speeds to be detected. Table Speed Climbing Descending <30 cm/s NofhEng Noihing < 1 m/s 1,000 Hi keyed 625 Hi keyed > 1 m/s 1 ,250 Hz steady 430 Hz steady > 2 m/s 1,650 Hi steady 310 Hz steady The audio generation needs to he 'de- coupled' from the continuous, rapid speed variations. Without this processing, the audio sig- nal is constantly varying and hence dif- ficult to interpret. To obtain 'meaning- ful' audio information, the audio gen- eration processing takes the maximum speed value produced over three cycles (the maximum value measured every 300 ms). To achieve maximum sensitivity in the analogue chain, the circuit needs to have reached thermal stability and the differentiating capacitor to ‘have reached charge balance 1 . In order to differentiate an almost con- tinuous voltage (frequency <0.1 Hz), the capacitor charging time constant is long. From a cold start, stable operation is reached after 20 minutes; from a ‘hot 34 e!=Uor elecirortfcs - 6/1007 start 1 , the operating point is reached 3-5 minutes after power-up. This difference is partly due 10 the tem- perature stabilization, as well as to the fact that when hot starting, the differ’ entiating capacitor is already partially charged. Operating initialization takes place in three stages: 1 . the voltage at the ADC falls rapidly from 2.S V to 195.2 mV (the differential voltage between pins 3 and 2 of the microcontroller) in less than 3 minutes; this delay will varies, as it depends on the type of start: cold or hot. During this phase the audio output produc- es an 800 Hz signal on/off modulated; flying is possible, but strongly to be discouraged. 2. The ADC input voltage is below 1 90 mV, the level flight threshold is set at 30 cm/s and the microcontrol- ler ‘compensates’ for the offset at its analogue input. This compensation is established in two ways: by adjust- ing the offset dynamically by means of regular self- calibration while the meas- ured speed remains below z; 30 cm/s (assumed to mean level flight ]; and by superimposing on this first compensa- tion inverse correction (predefined) for the differentiating capacitor charging. During this phase, flying is possible, albeit with slightly reduced perform- ance: reduced sensitivity and a risk of the appearance of a slight bias on the audio output, 3. Once the offset correction calculat- ed in phase 2 falls below - 20 crru's, the first successful sell-calibration ends the operational initialization process and automatically selects a sensitivity of ± 20 cm/s* ! Developing the software ! l l The code was written in assembler, using the laab provided by ATMEL Studio 3.5 ihen Stu- dio 4, available on free download from the ATMEL website (Ref [8]). Once you've got ine I hong of this tool, writing, debugging and emulating become child's ploy. « I , . , . 1 | The program VMR-G-4.hex will be loaded into Hash memory, using one of the suitable com- § j merdclly-av a liable tools; in developing this project, the STK 500 tool was used in coniundion | I with Studio 4. I f After loading, the microcontroller has to be configured in order to function correctly: RESET I = internal, BROWNOUT = 4 V, and H is preferable, Ihough not essentiol, to use the internal _ , . clack calibration constant Numerous examples of code (Assembler and Cl are available on the ATMEL website, obviating the need to write everything from scratch (Ref. [9])* The docu- mentation that enables us exploit the microcontroller's resources corredly is comprehensive and contains a wealth of information. You can also download the detailed spec, sheet for the i microconi roller from the ATMEL website [Ref [10]), | | Once treated and tidied up, the VMR-G-4 software occupies 99 of the Flash memory and | i 40 % of the EE PROM. I I I I The software runs at a rare determined Timer 0 which supplies an interrupt every 5 ms I processing time 200 /Js|. Every five cycles, the main process is run (process time < 400 ii$). The background Task manages switching between the main task of processing, putting the mi- crocontroller into standby, and the audio output; it takes less than 50 ps. I 1 i Jn assembler, processing times are extremely short, | I 1 | For this application, the processing time is not a constraining factor the main problem is l 1 posed by the EEPROM write lime — - as there is no RAM, use has to be made of the EEPROM 1 1 resources to store the data. The duration of □ write cycle is 8,192 machine cycles, i.e, 5,12 m$ l 1 ol a dock frequency of 1 .6 MHz. The processing task performed at 50 Hz performs three * writes and 1 6 reads; there is no constraint on the read duration. I " ' I Tnis task requires a processing time of 3x5.1 ms = 15 ms, which is still compatible wilh the 20 ms cycle time. To limit the effects ai an uncontrolled process, the interrupt generator that sets the processing rate to 5 ms is interrupted during this Task. f I ( RF section The RF transmitter is the smallest pos- sible, and the frequency the highest permitted, so as to ensure frequency- compatibility with the radio-control receiver and limit the size of the on- board aerial. We chose the TXM-433 from LI NX Technologies. The sum- mary, just about adequate, datasheet can be downloaded from the Internet (Ref. [3]). With a standard receiver* as well as with a dedicated receiver specially built for this application, the range is sufficient. The 50 O transmitter aerial has been designed for the most even radiation pattern, whilst taking very little spacs. So we opted for a planar-type integrat- ed aerial, the 433-SP2 'Splatch from LINK (mem again! J. Opting for this type of aerial allows us to produce an extremely compact transmitter. Noth- ing overhangs the board, not even the pressure sensor* This leaves the receiver to talk about. This version of the receiver, the circuit shown in Figure 3, is extremely simple: an RXM-433-LC-S RF receiver, also from LINK Technologies, a low-pass filter to suppress everything except the want- ed audio signal, and an amplifier. Power supply The circuit could be powered from the model* s own battery — to do so, all you need do is replace IC1 by a protec- tive choke. Although this solution does make it possible to limit the space oc- cupied and the weight, it is not really to be recommended. Models are pow- ered from a battery whose voltage var- ies from 4*7 to 5.6 V at full charge. This supply voltage variation, along with the interference generated by the ser- vo motors, is not conducive to correct operation of the analogue chain and achieving the required sensitivity. Hie processing chain needs a stabi- lised, regulated 5 V supply, and the virtual earrh must be 'centred 1 with an error of less than 1 mV. In order to avoid potential interference that could disrupt the operation of the VSI or the model, the circuit is designed to be supplied from a dedicated battery. Construction The two POBs, whose component over- lays are shown in Figures 4 and 6, re- quire careful construction, and the 6 'Ml? - dskTaretarronlu 35 VSI Figure 4. Transmitter component overt ny. Figure 5. Receiver component overfa^ components must be chosen carefully to minimize the noise level. The two boards are available from the usual addresses. On the PCB, we find the five blocks from the block diagram: power sup- ply, RF transmitter, microcontroller, op. amp : and sensor, Each of these blocks has its own decoupling capacitors, and the shortest possible track lengths. The PCB is double-sided and through- hole plated, fitted with SMD compo- nents on both sides. .. The recommended order for fitting the components to the PCB is as follows: * Stick or position the SMDs, then sol- der. Take care to check the value of each component before fitting it. These components are not at all difficult to fit, it ! s almost’ as easy as fitting the dis- crete components. One tip is to use a * i Components ! list I Transmitter ( 06 - 1044 . i} ■ Resistors all 0805 SMDs) R1,R3 = 47kfl R2 = 5000 SMD preset 4 mm R4 = 56kQ ?5 = Ik n P6 = lid B I R7 r R9,Rl 1 -R15,R17 - lOkQ I P8 = 5kT26 1 R10 = IGQkfl 1 R19 - lOOQ J R 16 - lO 1 R1 8 = 75fl j R2Q = 1 MQ Capacitors Cl ,C5 f C9 = lOuF C2 f C3 r C4 f C6,C10 # Cll ( 12 = IGOnF C7 - 68u F C8 = 680nF C13 = lOnF 1 Semiconductors I D 1 = BATS 4 1 Ti - FDV 301 N — * * 8 ■■ m mm ■ - * ■ i • ■ ■ ■ she mm i dominant i 33 elefcior elsdicnia - 6/2007 and d3 with pentodes. Liven-n umbered harmonics are largely cancelled in push- pull circuits, odd-numbered harmonics are not. The result of this is that a triode push-pull amplifier has a lower open- loop distortion than a pentode push- pull amplifier, mostly due to the third harmonic (d3). The second advantage of a push-pull amplifier is that with correct DC bias- ing there is no DC bias in the core of die output transformer The core can there- Figtire I, lhe thmodsmliu of □ Iriode and a p-snfed-e. 6/2007 - dekl&f E&trcME 39 PROJECTS AUDIO F j □ Li ■! □ ?. Distortion with a Iriode and □ pentode. Flpre 3. n’ Fix^d robe of grid voltage, b: Wilh ifse oid of g cathode reiistor □ simple aulomotk negative grid valEa^s ton bo mads. fore be smaller, and as a result the trans- former is cheaper to make. Also, the ef- fect oi the power supply ripple is mostly cancelled in the output stage. A disadvantage of a push-pull amplifier is the requirement of a phase shifter to drive the output stage with two signals that have equal amplitude and opposite phase. Output power and efficiency It is incorrect to think that sound ap- pears twice as loud to the ear when the power rating of the amplifier is two times larger. The sensitivity of our ears is logarithmic and lias a range of 0 dB (threshold of audibility) to 12(1 dB ipain threshold). Doubling the output power of an amplifier gives a power gain of 3 dB. 4 Principle schematic lot I be Inode pushed I omplEftac The amplifier published in this article delivers an output power of 2 9 watts at a THD (total harmonic distortion) of 2 C (open-loop). This is a reasonable amount of power considering the loga- rithmic characteristics of our ears, and also because of the soft-dipping behav- iour (excessive signal peaks do not lead to 'aggressive' distortion). If desired, high-efficiency loudspeakers could also be used. The valve handbook from Philips [3] states that a pentode push-pull output stage with 2 - EL34 has an efficiency of 53%. This does, however, not take into account the dissipation of the screen grid. This should be included for a fair comparison between triodeand pentode output stages. Including the screen grid dissipation the efficiency is 42 . . The ef- ficiency of the triode push-pull amplifier presented here amount to 35 ;, so that is still competitive. Distortion The audibility of distortion is stmnglv dependent on the spectrum. Crossover distortion in transistor amplifiers is very annoying because it has a very broad spectrum. In addition, this distortion increases at lower output powers. With valve amplifiers, the concerns are with lower-order harmonics and according to Douglas Self [4J the threshold of audi- bility in this case is around 13 . There i- therefore very iittle motivation to design valve amplifiers with lower distortion. DC bios setting A fixed negative grid voltage (Figure 3a) has the disadvantage that the DC bias setting is dependent on device toler- ances and ageing of the valve. It is often necessary to make manual corrections for the DC bias setting to obtain the de- sired result With an automatic nega- tive grid voltage i Figure 3b) the grid- cathode voltage is determined bv the voltage drop across cathode resistor R ■ , which is caused bv the cathode current. In this method of negative feedback, R k determines the DC bias setting in a significant way and the effects of valve parameters are strongly reduced. If AC negative feedback is not desired then R v typically needs to be decoupled with an electrolytic capacitor. Simplified schematic In Figure 4, the simplified schematic for the amplifier, the RC coupling compo- nents between the different stages have 40 etakiDrdetfrtmG - 6 ; 20 07 been omitted tor simplicity’s sake. Hie low g of the triodes used makes a 3- stage approach necessary. For the DC bias setting of the output stage, an auto- matic negative grid adjustment was cho- sen, separate for each triode. As a result, the DC offset is much smaller compared to a common cathode resistor and this is advantageous with respect to the po- tential DC bias in the output transform- er. Decoupling of the cathode resistors is necessary to prevent die preamplifier from having to deliver an even larger drive voltage. The output stage of a push-pull amplifi- er is often driven by a phase shifter. T his is not recommended with triode output stages because the wave shapes of the output signals of the phase shifter are not equal at very large signal swings, which would result in more distortion in the output stage than is necessary. The second stage in this amplifier employs a push-pull amplifier with a common cath- ode resistor. This resistor is not decou- pled because the AC cathode currents are in opposite phase and therefore do not cause a voltage drop across R k . The first stage is a differential amplifier used as a phase shifter From all the circuits that are suitable for this purpose, this is the only type where both input termi- nals remain freely available. By doing so, the design becomes similar to that of an cramp, which means that tire usual methods for negative feedback around op amps can be used here as well. The implementation of the current source i.. can be a resistor, the ohmic value of which must be much greater than the 15 of the valves (where 5 is the mutual conductance). This requires a negative power supply voltage of > 50 V D -. An important advantage of this design is the complete push-pull structure so that the distortion and sensitivity to hum and interference are minimal The complete amplifier Figure 5 shows the complete schematic Figuie 5. the complete schemetie ul the amplifier [one chcrnnel shown), Hole the swikhabte negative feedback. a 2007 - stellar iteareniu 41 Jj flgg AUDIO Flgyjf 6, Ths power supply uses □ special mains Jroruformer which is available from Amp Fi mo. tor the triode push-pull amplifier, The power supply is shown separately in Figure 6. The cost of the output valves and out- put transformers often make the most significant contribution towards the fi- nal price tag of a valve power amplifier For this design we chose the 6AS7 valve in combination with the 3 AS 24 output transformer The 6AS7 is a high quali- ty valve for a relatively low amount of money (for details and pricing refer to \vwwamplimo.nih The 6AS7 is a dual power triode (maximum dissipation 2 ■ 13 1\ ) which was originally designed to be the series-pass element in regu- lated high-voltage power supplies. This can be seen from the maximum allow- able value for the voltage between the cathode and the filament ( ±300 V). This indicates high quality isolation. The re- maining properties of the 6A57 are com- parable to those of other power triodes, The 3A524 output transformer (maxi- mum 40 W) is generously sized for a 9- watt amplifier. The primary impedance is 3545 i’T For optimal output drive the DC settings for the output valves are: t4 = 270 Y / 3 = 67 mA, LJ k = SO V and l? k -lk2. Iriode push-pull output stages have, by their very nature, a dass-A characteristic operates as discussed below. Suppose that, because of the drive sig- nal, the anode current of V3a increases significantly, f/ a of V3a will tlren reduce significantly. The influence of V3a on the output transformer is now domi- nant and this causes an increase in L’ of \ 3b. Since the IT of triodes lia^ a large effect on anode current, V3b does not stop conducting despite the increase of Ur (more negative), which results in a cl ass -A operation of the output stage. The quiescent current of about 10 mA has very little effect on tile efficiency Be- cause of ihi^ dass-A behaviour crosso- ver distortion' is precluded and die cur- rent consumption from the power sup- ply is almost independent of the output drive. The preamplifier (V2j ha> to be able to deliver two drive voltages of up to 70 V AC to die output stage and dial plac- es high demands on the dynamic range. An ECCS2 (12AU7) is very appropriate for this. To obtain the highest possible drive voltage, R7, RS and R9 are con- nected to -50 V instead of ground. This increases the power supply voltage to V2 by 50 V to 320 V A hybrid DC bias setting' was selected here. R9 is a common cathode resistor (automatic negative grid adjustment c The voltage across R9 is partially de- termined by the current through R10. The consequence of this is that the DC bias setting is a hybrid of automatic and fixed -negative, which results in better drive capabilities. Because \ 2 is a push- pull circuit of triodes as well, the distor- tion is also small because of the cancella- tion of the even order harmonics. The DC bia^ setting combined with the values of Rll and R12 ensures that suffi- cient capacitive current can be delivered to the output stage at higher frequen- cies. The input capacitance of V3a and components list Resistors all rnstol film 1 %, 0.25'.V or 0 6'” ante's oiher.vise specified' R1 = 470kft R2 = 390ft R3 = 8kft2 R4,R5 = iOOkft 1W Ro = 33kft R7,R8 = 470K1 R9 = 470ft R1 0 = 4kft7 R1 1 ,R1 2 = 22kft 1W R 13 .R 14 = 470 kft Ri 5 , Rid = Ikft R1 7,R18 = 1 kft2 6W (wire wound) (1) R19 = 33kft 1W R2u = 1 50ft 5Vv wife wound.: R21 = 150kft 1W R22.R23.R24 = 100ft Pi — 50kft logarithmic law potentiometer Capacitors Cl = 1 50aF ceramic C2-C5 = 33 nF 400V C6,C7 = 47pF 10QV electrciyiic C8 = 1 O^iF 350V electrolytic C9,C1 0,C1 1 = 1 00^ F 350V electrolytic Cl 2, Cl 3 = 470uF 63V electrolytic Valves VI = 1 2AX7 or ECCS3 V2 = 1 2AU7 or ECC82 V3 = dAS7 Semicondueto rs; D1-D4 = 1 N4007 or bridge rectifier 400V — — — — — — — — — — — — — — *i piv @ 1A | D5 = 1 N4007 Miscellaneous TV 1 — mot ns transformer type ^N1 609, pri- ^ its n ry 2 3 0 V. seco n d a ry 23 0 V/ 4 OV/ 6.3 V I (www.omp Ftmo.nl) g Tr2 = aulpu! transformer ty pe 3A524 (www. g omplimo.nl) Fl — fuse, 600mA, slow F2 = fuse, 300mA, slow 1 Aluminium corner profile, e,g. # I 04 . 90 . 2 2 0£ jw v.w. t e Esairo nic.nl ; www H | display.nl Self adhesive standoff e.a,, Conrad Eleciro- ^ njes # 532037-89 Self adhesive mounting for cable strap. e.g, I Conrad Bectronics # 543234-89 J H) matching aesfroble — - — — — — — j 42 fief l or ErEETronjcs - 6-2007 <#■ ■ Y3b amounts to about 40 pF For the phase shifter an ECCS3 (12AX7J is the most suitable, in particular be- cause of its relatively high^, the gain of the Erst stage is as high as possible. The influence of Rh on the offset (the non- ideal current source functionality is of concern here) is about 4%. Further im- provement by increasing the negative power supply voltage and a larger value for R6 is not worthwhile. Fhe input signal for the amplifier is con- nected to Ylb and the negative feed- back signal, via a switch and R3| j Cl and R2, to \ la. Swapping the input terminals results In positive feedback, which causes the amplifier to oscillate badly. It is therefore very important to care full) check the numbering on the valves and the colour codes of the out- put transformer. Because of the good open-loop charac- teristics, a moderate negative feedback factor or 3 (9.5 dbi was selected. The negative feedback can be switched on and off to be able to determine the dif- ference in listening tests. When the neg- ative feedback is switched on, the input signal needs to be larger by a factor of 3 (600 mV instead of 200 mV for an output power of 9 W). It is important to consider that with valve amplifiers, large negative feedback can cause RF instability in addition to AF instability, because of the AF phase shift resulting from the RC coupling be- tween stages and the output transform- er. a very low frequency oscillation can occur. In the past, this has sometimes been called 'motor-boating'. Resistors R13 and R16« the so-called grid stop- pers reduce the risk of RF instability in the output stage. The power supply The power supply bection can be seen in Figure b. The power supply transform- er, with the part number 5N1609, has been specifically designed by Amplimo Netherlands for this project, and is avail- able fr o m them ( w w w, a m p I i m o . rtl ) . The electrostatic shield has to be connected to the chassis and its task is to divert mains borne disturbances to earth that could otherwise be capadtively coupled through the transformer to the power supply. Inodes make high demands on the pow- er supply ripple filter. The design of these filters Is based on a so-called "-network, such as C 1 1 J 1 1 C 1 1, R20 and C9. The series resistor has a comparable effect to that of the forward resistance of a valve rectifier. This forms a low-pass filter which ef fee- figure 7. The amptitiB viewed from above. lively suppresses the ripple voltage (the higher harmonics in particular), mains disturbances that are inductively coupled through the transformer and switching pulses from the rectifier diodes. Since the amplifier (including the output stages) operates in class-A, the current consump- tion from the power su pplv is practically constant and the use of series resistors is not a problem. In order to limit the hum from the fila- ment supply, the ' elec Lri cal centre' of the filaments is connected to ground via R23 and R24- Under certain circumstance^, when, for example, the amplifier is switched off shortly alter is has been switched on, it is possible that the high voltage elec- trolytic capacitors in the power supply filter can take a very long time to dis- charge completely. Thb is undesirable, particularly horn a safety perspective. Connecting a bleeder resistor (R21 ) in parallel with Oil and CI1 discharges the electrolytic capacitors to less than 50 Y \yr in about two minutes. Realisation The starting point for the construction Rpre 8. IKis ii ho^ ihe components are mounted on the bottom side. 6/2DG7 - deleter eletirania 43 2221 audio ftgujfl 9. Clipping behaviour crt 11 W/l kHi (5 V/dk), value of 2%. This value also corresponds . 3 >' - ' of die enclosure (Figures 7 and 8) is an aluminium corner profile (for exam- ple type 04.90.2208, available from Tes- salronics. Display and odiers). The pro- file is normally supplied in a length of 1 m and can be used for four corner pro- files of 25 cm each. The front and rear panels are made from 3-mm thick hard aluminium sheet and are attached to the ends of the corner profiles with M 5 bolts. The side panels ( 1.5 mm thick alu- minium sheet) fit in the slots of the cor- ner profiles. 1 hese side panels support the chassis plate (2 mm thick alumini- um plate with 4 cornered edges) with M5 nuts and bolts. Between the chassis and die front and rear panels is a gap of 15 mm to ensure sufficient cooling. Tire top and bottom plates (perforated steel plate, 1 mm thick, with cornered front and rear edges) is attached with M3 bolts and square nuts that fit in die corner profile. The connecting and the mounting of the components is done using the hard-wired" method. This takes a Hide bit more time compared to assembling a printed circuit board, but that shpild not be an objection considering [he simplic- ity of the circuit. An added benefit is that die results are better, among other things because twisted wiring for the filaments has a lower risk ol hum and is better suited to handle large currents. The as- sembly i see Figure S) uses discs cut from circuit board for the star-point ground, strips of circuit board for ground and cable supports. The discs, strips and ca- ble supports are attached to the chassis with self-adhesive stand-offs. There are two options regarding the coupling ca- pacitors C2 to C 5: cheaper polyester foil from, for example, FRO or hlgh-quahtv paper-in- oil from Jensen. It is recommended to use 1 YY 14 metal film resistors for anode resistors R4, R5, Rll and RI2, That is because die larger dimensions of these resistors are better suited for dealing with high voltages. Since this amplifier is implemented as a complete amplifier", die front pane] has a power switch, input selector switch and a volume control. On the back of the enclosure you can add, in addition to the usual inputs and outputs, the switch for turning the negative feedback on and off, so that it becomes very easy to ex pe rim en t w i th this . Test results With valve amplifiers it is customary to give the maximum output power at THD = 5%. Because this amplifier can also be used open -loop we assumed a to the limit before clipping occurs. Figure 9 shows the soft-clipping behav- iour a I an output power of 11 W (5 V div.). Figure 10 shows the open-loop square-wave response at 2 kHz and 5 V/ciiv. It is of interest to note that this amplifier, because of the characteristics of the tri- ode output stage, is open-loop stable. Literature [1 i Lecture Notes an Electronics, Technical University Delft, 1957. [2) Audio Frequency Amplifier Design. E. Ro- denhuis, 1959 (reprinted by Audio Ama- teur Press, 1994) [3] Electron Tube Handbook, Volume 1, Phi- lips, 1964. [4] Audio Power Design Handbook Douglas Self page 9. Fig jj v ID. Square- wra- j&iponK without feedback (2 kHi, 5 V/dix.J. 44 dehor dittanies - 6/2007 L Ojr range of more than 40 hardware circuit blocks. 6 CD-ROMs, 50 sensors and a host of accessories and support materials, means that whatever you want to make, you can make it with E-blocks. If you are a beginner then we suggest you start with one of our E blocks Starter Kits. These have everything you need for your first project Jf you need to learn how io program in Cfor AVFt PIC or ARM, or you want to connect your system to the internet. or develop CAN bus communication systems, then we have the right starter kit for you. YOU LL SAVE A MASSIVE 30 DISCOUNT W.R.T, INDIVIDUAL ITEMS! if you want to make up your ovm kit then it is also easy: just select the Items you need for your project from the list below. Modules “".V programmer AVR mul If programmer lluetooth board Bluetooth CODEC board CAN board CPLD board FPGA daughter beard Graphical LCD display Internet board IRyiRDA transmitter recE LCD board LED L-rsrd MID] board Fewer board Prototype l : s o £ 69,20 £ 77,65 £ 117.80 NEW £ 119.00 £ 33.50 £ 117,95 £ 104.50 NEW £ 39,30 £ £ L. NEW £ £ £ 71.95 58.50 19.30 14.65 35,70 35.95 20.50 Quad 7 segment display RS232 board Scre.v ter nei ncard Switch board USES muiti programmer X-10 home automation board Software (single user) Assembly for PiCmicra MCUs C for ARM rii'crcccntf Oilers C f c r Av R m.c re : o r. 1 1 o 3 !e r $ C for PIC microcontrollers F ewcode for PiCmicm MCUs v3 I pro vers ierc Programmable logic Techniques £ 118,00 117.90 Ordering Use the order form at the back or go to www.elektor-felectronics , co.uk (shop). E-blocks m be shipped after receipt of payment. Prices are exclusive of postage Free downloads available on www.elektor-electronics.co.uk/eblocks! This handy analyser makes a simple job of rummaging through the information stored by the client- accessible part of your car's computer. It works with all current OBD-2 protocols and can read and erase trouble codes stored in the vehicle and reset the IVIIL display. All this without the help of a PC or a visit to a service station. Since the turn of the millennium more and more new car models have been fitted with the latest version of the on board diagnostic interface GBP-2, With the increasing sophistication of mod- ern engine management many new owners have seen the benefits of an OBD analyser such that it is fast be- coming an essential part of the garage tool kit along with the torque wrench and spark plug spanner. It has been reported that sometimes when owners fit a new car radio or sat - nav system to their car the vehicle management system unnecessarily registers a fault, similarly some owners who have modified the engine to ac- cept an alternative fuel have noticed that the engine management can in- correctly interpret the engine condition and trigger an error. In some cases the engine management can even be switched into an emergency condition. Whatever the cause the outcome is the same; a dashboard mounted MIL {mal- function indicator light) comes on, a fault condition is stored and It is neces- sary to make an (expensive) visit to the nearest garage to have the trouble" put light and the MIL reset. With the OBD analyser described here in your glove box it is a simple job to connect to the OBD socket, find out what the trouble is, reset the error and continue on your journey. On cost grounds alone the price of the analyser will be more than repaid by avoiding just a single unnecessary visit to a dealership garage. A number of OBD analysers have been featured In the electronics press (in- cluding Elektor Electronics) describing an interface between the OBD connec- tor and a laptop. The approach we have adopted here is however far less cumbersome, this stand-alone unit does not require a notebook or battery, recognises all the usual OBD-2 or EOBD protocols and is small enough to stow in your car’s glove box. Operation is quite straightforward using just two buttons, 580 of the commonesi trouble codes can be recognised and described on its running text display The Circuit The OBD-2 analyser employs an AT- 9GCAMI28 microcontroller from the AT- mega!28 family horn Atmel. This par- 46 etehor eltiJranra - 6/2QQ 7 figure 1. Block diagram ol Jhs OBD-2 oimlyseL licuiar model lias an on-board CAN bus interface as shown in Figure 1. The controller is supplied pre-pro- grammed with the AGV490G firmware which handles the user- inter face in- cluding push buttons, buzzer, LEDs and LCD. Pin assignments the OBD-2 connector are given in Figure 2, In order to sup- port all the currant OBD-2 protocols the analyser needs to be able to inier- race to several bi-directional interfaces: O Automatic car manual selection of OBD-2 protocol 0 Very fas! automatic protocol scan [0.1 to 2.6 s per protocol) ° Fast software boot sequence [ready to go around a second after switch on o Read and display important vehicle information [depending on the vehicle) O Real-time sensor reading [selectable) o Vehicle chassis number display (if supported by the vehicle manufacturer) 0 Readout and display of the trouble code memory & Read out and display of Freeze-Frame data o Erasure of trouble code memory o Language selection English or French; O 580 trouble codes with description in running text o All existing OBD protocols tor private vehicles ore supported: IS09U1-2 ISOl 4230-4 (KWP2000) J1850PWM J1S50VPWM ISOl 5765-4 [CAN, 1 1/29 Bit, 250/500 kbib/s) o Power for the analyser is supplied from the vehicle's OBD-2 connector (12 V; O Backlit 3 -line LC display with adjustable contrast o Acoustic signal gives audible feed beck ard beeps when trouble codes recognised O LED Indicators for connection status and data traffic flow o Simple operation using just two push buttons o Connection far □ standard OBD-2 cable o Handheld format: 80x1 35x30 mm (wxbxd), weight 150 g approx.) O Supplied as a kit through Efektor SHOP Figure 2. Fin cfeFfnlltons of the 00EM/EQBD rannedot O K/L interface o PWM interface O VPWM interlace O CAN interface The first three of these in the circuit diagram (Figure 3) have been imple- mented using transistors and compa- rators configured to meet the interface standards. The specified puli up resis- tors for the K and L signals have a reia- PqBddOs 0© m®0© The OSD analyser is only suitable for vehicles fitted with an OBD-2 EGBD connecter. EOBD is fitted to vehicles said in the EU: - after 0 LO 1 .200 1 , for petrol eng ine vehicles. - after 01.01.2004, far diesel engine vehicles. Before the analyser is plugged Into ony vehicle manufactured before these dotes, it Is important to check compatibility with the OBD-2 standard. The website of Ftorlan Schaffer [3] contains a databank of vehicles where you check So see if yours is OBD-2 corrjpalible. 6/2007 - el e IrJo r e? ectron its 47 JECTS VEHICULAR TEST EQUIPMENT -I2V — If II -C -u Figure 3* The AVR rnitTotcntfoller w 1 i h oivboard CAM interfere is Ihe main part of ihs circoil diagram. lively low impedance so MOSFETs have bean used here as drivers. The CAN bus driver IC type PCA82C250 takes care of the CAN interface. The user- interface software is logically designed such that just two push but- tons are required to operate the ana- lyser and select all possible menu op- tions. Connections for the buzzer, the connect' and Data Traffic 1 LEDs should not require any further explana- tion, Control of the three-line LCD is a little more complex, a rive wire SPI in- terface connects the display to the con- troller, LED backlights ensure that the display Is night time readable. The rel- atively law controller clock speed (8 MHz) is a good compromise, produc- ing a low level of EMI emissions while still giving ample operating speed for this application. The Firmv/nre The heart of the OBD-2 analyser is the pre-programmed microcontroller with the designation AGV49QD f 1 ] available solely from Stange Distribution [2], The software was developed by co-author Erwin Reuss. Like similar OBD projects the firmware for this analyser is only available pre-programmed into the mi- crocontroller where it is copy protect- ed. The source files are not available for download. Without this software copy protection is would not be possi- ble to offer the analyser in kit form. There is no possibility for the home constructor to assemble a low-cost ver- sion of tills design unless of course all the necessary software is written from scratch. A menu option switches all display in- formation between either English or French {for the convenience of our Ca- nadian readers), Stange Distribution are specialists in OBD related equip- ment and produce several OBD-2 con- trollers for applications in the field of OBD development. All the OBD analyser functions can be selected from the menu using just two keys. One feature of the software is the very quick boot procedure which en- sures that the device is ready for use in little more than a second after switch- oil. The most important 580 trouble codes have a plain text description of the fault which is displayed in running text (in Uie language chosen). This fea- ture helps promote a quick and effec- tive diagnosis of the problem In the vast majority of cases there will be no need to look up the code in an OBD trouble code book. 48 ekktor Eletfrobrs - 6/2007 f igu Ik 4. The KB is an SMD-tree ions. Putting all the bits together Attention lias been paid to the PCS layout (Figure 4); SMD components have not been used for this design to simplify component mounting. The PCS is produced to industry standard using FR4 type board with gold plat- ing. Gold is chemically inert and gives the board almost unlimited shelf life. The plating also ensures that there should be no problems of corrosion which have been reported when lead- COMPONENTS LIST Resistors RR1 = lkD R3,R4 - IGGkn R5,R9 = 33L1 R6,R1 1 - 56Qtt R7,R&= ioon R12 = Udl5 RN l r RN2 = VOkQ SIL-VO orray RN3 = 6kQ8 SSL- 8 orroy Capacitors C1,C2,C3,C10 = 1 OGnF C4,C5 = 22 pF C6,C7 - 470pF Semiconductors DI = 1N4004 D2 # D4,D5 = 1N4148 IC1 = 78L08 IC2 - LM339N IC3 - AT9QCAN 1 28 (Atmel; OIL case), programmed os "AGV4900 Sianae Distribution 3C4 = PCA82C250 PhiHps 1C 5 = 7805 LED! = 3mm, red LED2 = 3mm, green Q3-G6 - BS170 (109-2) Q7,G8 = BS25Q iT092; Miscellaneous Ql = 8 MHz quartz crystal (HC49, 5 LC- Display 3x1 6 lines, type EA DOGM1 63 E; ^ with background light: EA LED55X31 -A SI ,53 = FCB mount pushbutton type 4Q-XX ^ B3F 'Gmron 1 with matching aluminium cap DC buzzer 1 X2 = 9-way sub-D plug (male), PCB mount 1 1C socket 14-way I 1C socket 8 -way 1 Q1L docket 4 segments of 1 6 pins) I PCB 1 Case with front panel foil 1 Mounting materials I Note: Kit of parts no, 070038-71 contains J □31 components, the case (with front panel 1 foil fitted;, mounting materials and OBD- [ 2 cable, see Elektor SHOP advert or vavw. ] e!ektor-eledronics,co,uk \ j 6/2&Q7 - deklnreledrenks 49 rl VEHICULAR TEST EQUIPMENT Figure S. The PC8 comported I side. Figure L The two push bottom, LEDj nnd ICO ore mounted on the other side of the FCB. free solder is used on unplated boards. Gold has excellent tinning properties and allows the use of either lead- free or lead/tin solder. Apart from the need to take care with component place- ment and soldering, no special elec- tronic skills or programming compe- tence is needed to complete this project. Except for the two LEDs 'connect' and ' d ata -traffic , the two pushbuttons and the LC display all other components are mounted on the PCS side printed with the component outlines and iden- tification {Figure 5). Mounting the component starts with soldering each of the individual resistors into place followed by the diodes, capacitors, crystal, IC sockets, resistor networks (make sure they are the right way round), voltage regulator and then the transistors. The 7805 should first be mechanically secured before the leads are soldered in place. Once the buzzer and the sub-D connector are fitted the board can be flipped over and the pushbuttons, display and LEDs sol- dered into place. The AT9GCAN128 chip from Atmei Figuje 7. Th& conlroller braid connector Is math up ol four sections. used in this project is unfortunately only available in either the TGFP or MLF/QFN outline and neither of these are really suitable for a self-build project The controller is therefore sup- plied (in MLF outline) already mounted on a small carrier board. It is only nec- essary to fit an intermediate pin/socket arrangement to connect the carrier board to the main PCS. The pin layout of this connector is the same as a GIL 64 package (Quad in line, 64 Pins). All the components for this connector are included in the kit, to ensure suc- cess it will be necessary to follow the instructions carefully a mistake here will be difficult to correct. The complete socket is made up of four strips (Figure 7) fitted to the main PCB, each strip is fixed in place initially by soldering just one pin of each of the strips, this allows the final layout of the complete socket to be easily adjusted until it exactly matches the layout. 50 etehor etearonlu - 6/2007 Figure 3. The three steps lo mount the controller board. Once you are sure that the four strips are accurately aligned (check that they axe also all at the same height on the board) all the remaining pins can be carefully soldered to complete the socket. The carrier board can now be fitted with the pins. The supplied pin strips must be carefully separated into 8-pin lengths. Any rough corners can be smoothed down with a fine file* The strips are pushed fully into the socket Figure 8a (They only Gt one way round: the thinner tapered pins go into the socket). The controller board can now be positioned onto the pins (Figure 8b) ensuring that pin 1 is correctly aligned (to the left by CIO)* The 64 pins can now be carefully soldered onto the controller board (Figure 8c). Once ail the components have been fitted a short test can be carried out by connecting a 12-V supply to the sub-D con- nector (pin 9 = -f 12 V, pin 1 or 2 = 0 V). The current drawn by the analyser should not ex- ceed about 150 mA, The dis- play backlight will be lit and the boot loader version number will appear on the display followed by the greet- ing message. The short self- test is now complete. The finished PCB can now be mounted in the case: Fit the pushbutton caps and the sub- D cover, remove the protective film from the display and with the display facing dotvn wards position the PCB into the front cover of the case. The small countersunk screws can now be carefully screwed m and t ightened. Lastly fit the remain- ing half of the case and die QBD-2 -An- alyser is now ready for action! Analyser operation The first requirement before the OBD-2 analyser can be used is that the car is fitted with the corresponding OBD-2 connector (see the advice given in 'points to note' elsewhere in this arti- cle). If it is, the supplied OBD-2 cable is inserted into the OBD-2 connector in the car. The connector shouldn't be too difficult to lo- cate. regulations insist that it must be mounted in the vehi- cle within 1 metre of the driv- er's seat. A concise operating manual for the analyser is available to download from v.* vw. a I s kio r - e I eci ro n \c s . cq . u L A shortform manual is also sup- plied in the kit of parts so we will not delve too deeply into the finer points here. An on- line simulator is also available on our website so you can fa- miliarise yourself Virtually' with die analyser operation. At switch- on it is possible to alter the display contrast (Fig- ure 9a). This is achieved by holding down keys A and B and plugging the analyser into the OBD-2 socket. The con- trast changes each time key A is pressed. Once you are hap- py with the setting release key A and press B to store it. This basic method is used to control the analyser: Key A cy- cles you dirough the menu op- tions while key B confirms a selection or provides a re- sponse from the equipment. The display now shows the greeting *£LEKTGR OBB2 1.4 T with the start menu (Figure 9b) following shortly after- BL10 W266302776 Contrast, setup +- rmwmi j ok MIL! OFF D ► L i e data c MflF ► PID! 10 / / \ < e Figure 9. Deploys: (q) Conliosl Jetting, (b) Start menu, (r) StoSus display, (d) MIL OTC PID Ate nu, (e) OTC Trouble cade number &/2007 - elektef etedroniEs 51 •ROJECTS VEHICULAR TEST EQUIPMENT dTGS 2/4 (by I P -1 - * ll L k J Fuel Pun ►Next cod errors found: 2 of 4 error code 2 error 2 description select error 3 with button B Q7Q03B - 13 figiiffc 10. TroijbEe tode menu riiQtfiflg o dBCiiplion ol the frcuhle in running fell. Figure 1 1, The Fr^te frame menu [PID scIkI), The example in Figure 1 1 indicates a sensor reading when trouble was logged; trouble FOOD a PID OD ( speed) of VSS — 33 km/h measured. Button A rakes you through successive parame- ters while button B returns to the pre- vious menu. The downloadable user’s manual con- tains overviews of all the menu op- tions, selections and display messag- es. When you want to get more familiar with its operation, try the online simu- lator mentioned earlier or better still put your order in and build your own OBD-2 Analyser! An extra file contain- ing soldering and assembly hints can also be downloaded from the Elektor Electronics website, . J- : . Literature [1 j Daiasrssi for the AGV4 900 -Controller: va-,v/. ob d ' dio g . d e [2] Source otthe AGV microcontroller: \wav. 5fange-dirinbuiicn.de 13] h tf p : / \vww . b I ofu s e Ld e misc OBD-2 sconned.php wards with the options: Start Diag, Protocol and Language , When the ana- lyser is regularly used on the same ve- hicle and you are sure of the correct protocol then it can be selected other- wise option code 0 tells the analyser to automatically find the correct protocol. A press on key B begins the scan (if the vehicle interface is not compatible with OBD protocol the test ends with a fail- ure message). When the scan has run the display will show the state of the MIL/DTC indicating if any troubles were present (Figure 9c). Selecting the option Live Data with button B will show the actual value of a parameter. The chassis number or vehicle ID can be read and the communication Proto- col displayed as well as the option to rescan. The current reading of a sensor {live data ) is given in the PID (parameter identifier) menu. The example shown in Figure 9d is a reading of the intake Mass Air Flow (MAT in g/s). Pressing key B takes you back to the previous menu. When a failure has been detect- ed by the engine management system me analyser will indicate that the MIL is on {MIL: Oil), and the number of stored DTCs (Diagnostic Trouble Code) is given (Figure 9e) There is now a choice between displaying the trouble codes or freeze frame data. For trouble codes the code number is displayed along with (in most cases) a detailed description of the fault (see Figure 10 ). When the trouble codes are displayed, pressing key A brings up an option to clear the codes from the vehicle’s memory. More information about the failure can be gleaned by selecting Freeze Frame. When an error is detected by the en- gine management system the on board computer will take a snap- shot or freeze frame of all sen- sor readings and store them in the vehicle’s memory. A data can pro- vide a valuable insight into the cause of rhe failure. In selecting freeze frame trouble codes it is possible to select succes- sive sensor va- lues stored around the time that the lure oc- cur- red. - 6/2007 52 Dr, Thomas Scherer OBD — the On Board Diagnostic for vehicles — was originally conceived as a system to reduce exhaust emissions and produce better air quality. Since its introduction, the ecological aspect of the diagnostic system has taken something of a back seat. These days the OBD is a key element in vehicle servicing for all garages. It has also become something of a marketing tool in the competition between dealership garages and independent garages. Informal on gleaned from the OBD connector can also be of interest to the manufacturer's sales department. When the next generation OBD-3 system is introduced, it may be able to pass vehicle information over a radio link to a roadside monitor as we drive by, and the politicians will convince us the system is in our best interests to improve air quality... Buck in 1930 the stole of California hod just six million inhabitant and an astonishing (at that time) fv/o million cars. Ten years later almost every adult mole CaliFornian owned a car. In 1943 the city of Los Angeles suffered from choking smog (see video [1]). Exhaust gases were not thought to be the prime suspect at the time, in i 947 a national programme to monitor air quality across America was instigated. A milestone in environmental politics was reached in 1960 when research begon into the effects on the atmosphere of exhaust gases. The link had been proven and in 1967 the Californian Air Resources Board (CARS) was setup with the remit to improve air quality. In 1971 CARS introduced a nitrogen oxide (NOx) emis- sion limit on cars sold In the state and in 1976 reduced the lead content of petrol. In the same year Volvo became the first car manufacturer (Figure 1) to produce a vehicle with an electronically controlled three-way ca iolytic con- verter and lambda probe. This was not just an ecologi- cal and environmental breakthrough but also marked the beginning of electronic engine management in mass produced vehicles. By 1 984 in California legislation was in place for all cars sold to be fitted with a system which monitored the exhaust gases and warned the driver v/hen the limits had been exceeded. Already by 1902 work was in progress to standardise an an-board diagnostic system which could measure exhaust emissions. By 1988 all car makers endorsed this standard and OBD-1 was born. Figure L Tfre daddy of them alb A 1977 Yoko 2^0 - The first volu me (or model To bs titled with an elHfronicdly controlled ibt^way catalytic tomrertw 6/2007 - efeVlor 53 Figure 2, An OBD-Afinlyssi The Qosch KTS 1 IS isc handheld device similar lolhestond-nloHsOBD amlper feature in this tiiagoiine. California was the pioneer in exhaust emission regula- tion and here tn Europe manufacturers were obliged to fit catalytic converters to cars sold in America bur they were not available for the home market. Manufacturers were reluctant to fit them as standard because of ihe increased production costs. Effective lobbying by environmental groups across Europe has however succeeded in turn- ing the situation around. Particle filters for diesel engines are also not yet obligatory, Peugeot have developed a highly stable and effective filter system that could have been filled os standard to their vehicles since 2000 but so far it has only been offered as an extra. Diesel powered cars represent around 50 = b of new car sales in some parts of the EU, The next generation of standards for cars California. Two years later it applied to all cars sold in America, EOSD is the European variant of OBD-2 and is essentially the same as the Ameri- can model. This standardisation has o number of benefits to the manufactures by lowering production costs and also for in- dependent garages by standardising test equip- ment, The wheels of EU bureaucracy grind exceeding- ly slowly so it v/as not until five years after the American regulations had been imposed that EOBD finally became mandatory for petrol engined cars sold in Europe in 2001 and then 2004 for diesel engined vehicles. Vehicles fitted with the 1 6-pin EOBD diagnostic connector con not only pass sensor information as described in ihe standards document but also manufacturer specific infor- mation. OBD-2 and EOBD have far more sensor data, pa- rameters and failure conditions than before. Many DTCs (Diagnostic Trouble Codes] and protocols are standard- ised. Worn out catalytic converters can also be detected along with other failure conditions brought about by gen- eral wear and tear. Whose data is it anyway? Apart tram producing cleaner exhaust gases other as- pects of the diagnostic system have become apparent. The car makers are installing ever more complex systems which can store far more information than the standard OBD-2 interface requirements . Smaller independent work- Few people question what car manufactures do with all the data they download from a car when it goes in for a service. ( Euro 5 ) have issued a directive which limits the emission of Paniculate Matter (PM) to 5 mg of per kilometre which means that all new diesel engines manufactured from 2009 wifi need to be fitted with a particulate filter. The directive is less than six months old. OBD-2 and EOBD The original standard was relatively crude. It only moni- tored the oxygen sensor (the lambda probe], a possible emission recycler fuel system and provided motor control based on the level of emissions. A flashing dashboard mounted lamp ar MIL [Malfunction Indicator Light] was fitted and any detected errors were stared in a memory which could be examined via a serial interface by garage technicians during the next service. Unfortunately the regulations were not specific enough so that each car maker came up with their own version of the interface. This caused havoc for many small independ- ent garages who found it necessary to purchase third party OBD readers and adopters to allow them to carry out servicing on different makes of car. Even with these tools some manufacturers imposed restrictions so that not oil the data could be read by a third party. The weakness of the OBD-1 specification led to the OBD- 2 standard which v/as released by CARB in 1 994 and became mandatory for all vehicles sold in the state of shops do not have the resources or access to special man- ufacturer-specific diagnostic fools to read all the informa- tion stored in the vehicles management system. Buyers ore persuaded that only dealership garages con offer a full service. For this reason It is essentia! and indeed intended fo maintain a certain degree of interface standardisation so that independent garages are freely able to use the di- agnostic information stored on board. Without this many independent garages would no longer be able to carry out vehicle servicing let alone fault tracing or repairs. The outcome would be that independent garages would eventually disappear and the customer would be left with little alternative but ta use □ dealership garage. Not a free market but a monopoly controlled by the cor mak- ers, without competition prices would inevitable rise. On the other side of the coin manufacturers are anxious that certain information for example about their engine control techniques [2] [3] should be protected from their competi- tors" prying eyes. They have invested heavily in vehicle development and the future of their company depends to some extent on how well they protect their investment. The line between protected manufacturer specific data and open data which can be used for vehicle servicing is not so easy to draw and goes beyond the current EOBD standard. Does anyone ever ask what happens to all the informa- tion that is downloaded from their car when it goes in for 54 elector - 6/2007 □ service? It would seem to make sense as long as the information was made anonymous for ihe vehicle manu- facturer to use it to identify any trends that may indicate a weakness in the design of a particular model or engine. Surely we would all benefit if cars were designed to be more reliable? What would you say as the owner of a standard Ford Focus if the Ford dealership started send- ing you sales brochures about the new sports Focus ST? you probably wouldn't give it a second thought but what if you hove been specifically targeted by the sales de- partment because the Iasi time you took your cor in for a service it was 'noticed' from the diagnostic data that you lend to be a little heavy footed in the accelerator depart- ment? Would ihis be a harmless use of the data? How about if you have a major mechanical failure just after the vehicles warranty expires and before you can even begin pleading your cose to the garage manager, a mechanic connects to the EOBD and announces that the breakdown was not surprising considering ihe way you drivel These examples are of course entirely hypothetical but not outside ihe realms of possibility, the technology is available and so is the data, the modern EOBD system is no longer just on air purifier but also a Vehicle Data Recorder... What does OBD-3 hove to offer? As technology becomes more and more sophisticated the question of how we can protect our right to privacy becomes ever more difficult to answer. No sooner hod OBD-2 been successfully adopted than work begun 'on its successor 080-3. In ihe meantime technological progress has made it possible to incorporate much more powerful and complex systems which would not have been feasible ten years ago. The initial indications ore that OBD-3 will not just be an improved OSD-2 with faster processors and more memory capacity. The whole concept is undergoing a radical rethink. It Is anticipated that the systems will be implemented throughout the world so ihe final proposal will be ihe re- sult of ihe input from many interested par- ties and committees, needless to say the whole procedure will not be swift. Some of the suggestions that have been mooted sound a liltle implausible if not laughable and are probably the result of feasibility studies rather than a considered design approach. It has been suggested for example that the number of vehicle sensors will be Increased to measure such mundane things as the vehicle doors so that the next lime the car is serviced the mechanic will be able to inform you that ‘ the drivers door has been opened 623 limes in the last year and the passenger door only 346 times, the hinges on the drivers door will need to be greased dur- ing the service, do you want us to do the passenger door as well? Much less bizarre is the suggestion [which many car manufacturers are currently working on] thai the on-board OBD con- nector will be replaced by o radio link. In much the dame way as the RFID system is designed, each vehicle would have its own unique identity. One made of operation would be used principally during servicing where large amounts of stared parameters would be analysed by the cor mechanic to opiimise the car s performance and change settings. Another mode could transfer a limiied amount of Information in a very short burst, When, for example the car is driven past a roadside monitoring system. This possibility of monitoring individual vehicles in a continuous traffic flow suggests a number of interesting applications; it would be possible to Jog each vehicles chassis number along with its instanta- neous exhaust emission parameter and feed the informa- tion into a central computer where it con be evaluated. The owner of any vehicle over the emission limit may then be issued with a fine or advised to get the vehicle serviced in the next few days. Looking at the system in a slightly mors sinister light we would now have the In- frastructure in place and the information available to be able to track the movement of every vehicle... Big Brother would be proud of us. The impact of 9/1 1 in 2001 has mads the world a less secure place. Improved security is usually the reason giv- en whenever steps are taken fa increase the level of pub- lic surveillance but in this case it would be under the guise of "efficient emission monitoring'. The probability that air quality will be significantly improved with a continuous level of surveillance compared to She current yearly MOT emission test is quite low. The first rule of criminal inves- tigations when searching for o motive is ’cui hono (who benefits?] and It may be applicable to the deployment of an expensive nationwide monitoring infrastructure which eventually may hove a more profound impact on our civil liberty than just the Innocent ecological aim of monitoring exhaust emissions. I [1] ViV Av.arb.co.gov •. ideas dskies.htm [2] Chip Tuning, Eiekior E'edrorks July August 2005. p, 24 ff. [3j Warp speed on demand,, ttektor Electronics January 2007, p. 62 fl. Figure 3 . Big flrclhej's Jil lie tialpsn: cameras on gantries over German autobahns being introduced la log v chide m me moots. Similar systems ore being trolled in ihe UK, photo: Sletsn Kuhn (vnvtf.w eb kuehn . d e}. 6 r 2 &D 7 * efettor 55 PROJECTS MEASURING Linux is used more and more frequently for the control of various electronic devices such as mobile phones, routers and satellite receivers. These devices often use a special derivative of Linux, which is called /iCLinux. This variation has a small footprint and can be used on many different types of microcontrollers. As an introduction to this variant of Linux we look at the development of an oscilloscope based on Linux. This scope can even perform measurements via the Internet! W it h the arrival of uCLimix lor the Blackfin series of DbPs controllers, the development of Internet applica- tions for this family has become much easier, hi addition to making a uCLimix version that is suitable for the Blackfin controllers, Analog Devices also have a development kit in their program, called the BF537- 5 TAMP or Stampboard, A number of additional modules are available, including a fast A D converter. VVe are going to make an oscilloscope with the combination of this development kit and the V D extension module. The unusual part of this project is that it is entirely based on LiCUnux! Why Linux? Using Linux in embedded devices is not so much a question of 'being trendy' but more a question of not reinventing the wheel over and over again. By using an existing operating system it is possible to save much time and money during the development phase. Most of the required software parts are already available in Linux For example, writing and testing vour own I CP IP stack will require a lot of vour tune. But this is already available in Linux as standard. Furthermore, driver- are available for all kinds of hardware and have already been extensively tested bv may users. in addition to that, Linux obviously also has the advan- luges of a multitasking system: the possibility of running multiple programs i apparently) simultaneously. By choosing an operating system such as uC Linux, the designer can focus on those aspecLs that make his product different from those of the competition. 56 clsbsr Elstfionki - 6/2007 hardware. In our case we use a fast A D converter, which is avail- able as a ready-made extension kit. k. ux Stamp-kit The electronic heart of this project is the STAMP-kit. The processor power is delivered by a Blackfin537 controller, with a clock frequency or no less than 500 MHz. The core of this chip has a strong resemblance to a D5R because or the powerful instructions to generate loops plus die 2 lvlAC-units lvhich can both multiply simulta- neously and add the result to the previous instruction. The internal data paths have also been designed in such a way that the controller can effortlessly process large data streams. All this is provided with copious amounts of memory, namely n4 MB of RAM and 4 MB of flash memory. This is sufficient to accommodate a complete, functional Linux system including applications and together with a suitable bootloader. Communicating with this board can be done via both a serial interface as well as an Ethernet interface. All die important signals lines from the controller are available via headers. This offers the possibility of extending the board with all sorts of additional Software The development kit. as standard, is delivered with a bootloader (V-Booh, a uC Linux- kernel and Busy B ox pre- installed in its flash memory. U-Boot will be the first to run as soon as the hardware is powered up. This in turn will load Linux into memory and run it. You can follow the entire boot process via the serial port with a terminal emulator program, such as Hyper terminal, for example. The configuration of the -erial port is quite standard: 57600 baud, S bits, no parity and 1 stup bit Once all this is done you have a working Linux system. The usual commands such as Is, cp, cat. etc. can be sent via the same serial port to carry out Linux tasks. One tiling is still missing: an application. This we will have to write ourselves. But before v. e get to that we have to install the development environment first. Development environment In our case the required development environment comprises 3 parts: pCLinux, the toolchain and the Figure l Stamp Kin the development-board including the A D- atiens on. b:l\D7 - eiebc-i detiromis 57 MEASURING Figure 2* Configuration of the kernel figure 1 Adelina me A D -driver w to the kerne!.. Figure 4. Screen dump of the oscilloscope software. bootloader U-Boot jiCLiimx eon tains the complete source code for the uC Linux kernel with Bus} Box. To be able to compile the kernel, a cross-compiler and accompanying tools are required, the so-called Yoolchatri. Tins contains the gcc- compiler tor Elackfin processors as well as a linker assembler, in addition there are a number of utilities to convert between various formats, etc. Finally we need U-Boot, because of a he I per- program mkimage'. We need this program to convert our kernel into a format that can be read from flash mem or v bv the bo o tlo a der U “Bo o t . You can find the development environment that we used in die download that goes with this article. Note that this tookhain only works on Linux, if vou really want to continue to work on Windows then you can use the program co Linux to allow you to develop Linux soft- ware, Unfortunatelv we cannot give you anv details about hove that works since we onlv worked on Linux «■ wh il e d e v eloping th is pro j eck You can find instr uctions on the Internet how to install this development environment We wrote a script for this purpose, to Simplify things for you. The script installs all three components automatically. This script is named 'tnstailbf and can be found in the folder r bl addin environment in the zip-file that you can download from the Elektor Electronics website (EPS 060241-11), Use the command ' . /instalLbf f to install everything from the root of the file system. Configuration & testing of the installation Before we can continue we first have to configure the tool chain. To dothis u r e earn’ out the fallowing com- mands in the folder Yi Clin ux-disP: >ffiake clean >insJke con f i g >nmke After executing the second command you will be surprised by a program that offers you the option of configuring the kernel and such. First choose the option Vendor Product and select Analog Devices Products' in the next window. Now select the option Bi : 537-SLAMP , After that leave the co nG gu ra ti o n wi n d o w. The program will now ask it vou would like to sav e the new kernel configuration. Answer this with 'YES'. The last command compiles the entire Linux kernel, in d u din g i h e a ecom pan yin g a p p I i ca cion s. B eware! T h i s can take quite a while when running it for the firs! time. So feel free to make a pot of coffee or go wash the car! Ihe result of all this effort is the file Tinux that you can find in the folder Ti Clin ux-dist images . Using, for example, a TF IP- program you can send this freshly-baked Linux version to the hardware and verify that everything works as it should, if everything has gone well, you can now watch, with the aid of a terminal emulator, as tills Linux software starts up. We have now arrived at the point where we will write our own application and add it to our image. Adding our own application Our application is a server which sends measurement values from the A D-con verier via the network to a client This application (which is called oszi) we therefore have to add to our source code, to do this we add a folder named oszi in the folder ' uQinux-disL user \ All the source code for our software has to be stored in this folder We will need the customary Makefile, which contains the elehof electron ies - 6/2007 58 instructions tor compiling our software. in addition we have to change 3 more files so dial die tool chain will compile our software as well. in the folder J uClinux-dist user we can find a Makefile. VVe have to change this so that diis makefile knows that our software exists. We only need to add the following tine: ' ' . ' ' dir_S [ CONFXG_USER_OS2X_rS2rD} += oszi That was easy, wasn't it? The next two changes are required so that we can select the compilation of our software via make config\ These tiles are in the folder uCfinux-dist config' The first file that we u Ul deal with is Configure. help'. We add the following two lines to the end of that file: C QNF I G_U 5E R_0 S Z I_0 S Z I D Oscilloscope-Server The last change we make to the file config.itT. In the section Network Applications' we add the following line: bool ' oszi J CO!?FIG_USER_OSZT_OSSID After all these changes we can configure die kernel via die now familiar make contig. We are now going the change the kernel a little. To do this we select Kernel Library Defaults'. ■J On the screen that follows we indicate that we want to change both the Kernel settings as well as the User- sellings. Under the heading Character Devices we select the driver for ADC support. This driver enables the use of the A D -converter from within Linux, which is what we need for our application. Once we leave this window a new window appears where vve can select which additional applications we want to compile as well. Under the option Network Applications' we find that our own application, oszi is now nicely listed with the other software. He select this option, obviously. After we have saved tills new configuration we can use die command "make to compile a new Linux kernel. This is sent to the hardware, just like last time, and we can now test the software. Client software We wrote a Java application for the client software. The advantage of this is that it is independent of die operat- ing system. This software lias been tested on both Linux as well as Windows XT! It should also work without anv j problems on, for example, MAC- OS, The IT-addresses that have been used are fixed in the source code of the Linux software to T92.16ST 15 for the hardware. The client ! PC for example) needs to have the following IP-address: 192.16FLL2. These can be easily changed if need be in the source code (of the Blackfin, obviously! l We assume that at tills point you have started the new kernel on the blackfill board. By clicking the oszi .jar ’ file on the PC the client software is started. Via the terminal we can instruct Linux to start the oscilloscope application with diecommnd usr oszid'. With a mouse dick on the button connect a network connection is established ivith die hardware. The measured values now appear on tire screen in the shape of a graph just as with a normal oscilloscope. The maximum usable sampling frequency of diis scope is about 200 kHz. Server-software A complete description of the server-software is unfortu- nately outside the scope of this article, the source code for tliis software contains comments, so it is not to o difficult to figure out how it works, Whal we don't want to withhold however, is how you can change the II 1 address of die server and the address at which our application expects to find the client PC. In the file oszid. h’ there is a line for the IP-address of the client PC: -define IF ADDR 1 92 . 1 6 B* 1 , 2 ” b ( 2007 - dfllDf d^mernES PROJECTS MEASURING If is obvious that you can change this line to suit your needs. If we add the following line to the end, we can ensure ihat the oscilloscope software will start automatically when the system is booted: os 2 id s ' To change the IPnaddress of the Linux-osdlloscope, we have to do ihe following: Open ihe file t z * in the folder uClinux-dist/vendors/ AnalogDevices/BF537'STAMP' . In this file you will rind a line with ihe command 'ifcanfig . Change this line as follows to, for example, obtain an IP- address of 1 92.1 68 J ,3: >if config ethG 192,168*1,3 up After these changes it is necessary to compile the kernel again (make, remember?). Release Once we are happy with our software it would be very convenient to ^tore this in flash memory. In this way we also make sure that the software starts automatically when live hardware is powered up. First, we have to make a so-called image' for U-Boot. Such an image contains all our software, which has io be compressed first In addition Lius image contains a header that contain? information as to the location of the image in memory. This whole process is done via a script with the name mkulmage'. You can find this script in the main folder of our download. The final result 'ulmage is in fhe folder /uClinux-disf/images . Start the hardware again and press the space bar in the terminal window. The bootloader is now in the so-called command model Give the fallowing commands: >lf fcp OxIOGOOGG ulmage >srase 0x2 01 00000 Ox203FFFFF >cp,b 0x1000000 0x20100000 5(filesize) >baotn\ 0x20100000 The first command sends the file ulmage from live PC to the RA_\ ! on the hardware. The next command erases the last 3 MB of the Bash memory. This is then programmed with the file that you just loaded* The last command ensures Lhat L -Boot unpacks this image into memory and runs it* Final words The development of software with tire aid of LiClimix is a fascinating affair: For starters, consider all the standard possibilities that this operating system has to offer. Hopefully this article has whetted your appetite to get Started with LiClinux yourself, with or without the hardware described here. Many have already gone before you! The Linux operating system has become famous os o desktop sever operating system. Over the years this operating system has been developed by countless users into a powerful entity, and will continue to be developed in the future. The current Linux is actually much too big for embedded sy- stems. In oddiiion, standard Linux requires a so-called memory manager. This is a piece of hardware inside Ihe processor, which can ensure that each application has its own chunk or memory without accidentally overwriting ihe memory of another application. The Controller in o standard embedded system does not typi- cally contain such hardware. Tne desire to be able to use Linux on a controller with a limited amount of memory and without a memory management urwi has Jed to the development of pC Linux. This is a version if Linux that con operate wish out a memory manager. Linux is built in a very modular fashion, so that those parts of ihe kernel that ore no! used can simply be omitted. By also stripping ihe accompanying library ham unnecessary hills the whole thing can be quite small. A piece of hardware with only on operating system is of course completely useless. That is why standard Linux contains c whole gamut of smaller tools, such os for example programs Q|D to copy files, moke folders or navigate the file system. All these separate commands are normally small applications. A targe col- lection of these tools results in a large memory requirement far storing all these stonoard commands 'applications Busy Box was developed to save even more me- mory. This software is able to carry out nil the stondord com- mands on a Linux system. A single program oc- cupies much less space than a large number of individual programs* The Busy Box user does not notice of all that these commands are now processed by Busy- Box instead of individual programs. 60 eleklof deftrofJiES - 6/2007 Booting with a submarine: 'Das U-Boot' After a reset □ toniroller vdll always execute cade that can be fauna at a fixed address localion. In our case the Blade- fin will ip/ to run the cade that is stored at the start of the Bosh memory. At this ic cation is normally she program 'Das U-Boat', which 's often abbreviated to U-Baotk This program is a so-called bootloader and is comparable to the BIOS at a normal PC. Its main task is to start the Linux kernel- To do Shis, the Linux kernel has to be unpacked first, considering thol this ls norma U iy stared in Hash memory in a compressed form. Once unpacked the Linux kernel is in RAM and the controller is instructed to execute this cade. In addition to this main task, U-Boat has a large number of ad- ditional functions. These are all related to- the leading of pro- grams plus the erasing ond programming of the flash memory, U-Boat can, tf required, load a program over the network with TFTP Trivial -FTP' or even NFS, and execute it. This is obviously also possible via the serial port, but it will clearly be much slo- wer than via the network. Th is functionality is very handy during (he ’esting stages of the development phase of the software. This method of testing □voids the need to repeatedly erase and reprogram She flash memory. When first started, U-Boat will wait a predetermined amount of time. If a space character has been received through (he serial port within this time, it will change over to command-mode. IF not, it wifi carry out its assigned task i start Linux). How U-Boat does this is communicated with environment vari- ables. These variables are also stored in flash. In command mode you con send various commands to U- Booi. With the command print' U-Boot wiff show all the current environment variables. The most important variable Is 'boot- cmdVTTiis one indicates what U-Boat has to do when a space character is received during the initial wait loop. These variables look like this: boo trie L^y ■= 5 boovCisd=hootTn 0x2QlGQGGG In the above example U-Boot will wait for up to 5 seconds for □ space character From the serial port. If this time elapses and no space has been received then U-Boat will execute the com- mand ‘bootm 0x201 00000k This means that U-Boot expects an image at address 0x20100000, unpacks this into memory, verifies its integrity and finally instructs the controller to run the program it loaded. TFTP During development it is likely (hat a new version of software needs to be loaded frequently. la ensure that U-Boat loads the new software automatically from your PC using the TFTP- proto- col. ii is best If you change the bootemd' into BootCiCci = tftp Oxl 000000 Li- nux; boot elf 0x1000000 HeS commando hiervoor in U-Boat is ab volgi : set bootamd = ifcp Gxl 000000 limix;boptelf 0x10000 DD seveenv The last command ensures that the environment variables are saved In flash, so thor these variables are nor lost when the po- wer supply Is disconnected! TEST & MEASUREMENT Gerl Baars Here's a portable instrument to measure self-inductance quickly and accurately. Coil Clinic is a one-stop, autoranging meter with microprocessor control - - all you do is connect up the unknown inductor and read the value on the LCD. The inductor with its property 'induct- ance" (symbol L) is one of three low- down passive components around which all electronics has evolved, the other two being the resistor (symbol R for resistance) and the capacitor (sym- bol: C for capacitance). Of the three, the inductor is the one that seems to divide whole communities in two: you either love it or hate it. The latter opinion Is held by many of the younger genera- tion who get frustrated by inductances being present liter ally everywhere in circuits — but totally invisible! These stray inductances you need to devel- op a keen eye for. No problem for the seasoned radio amateur but a source of confusion and headaches for newcom- ers cheerfully installing a 50 -cm long wire to carry a high -impedance milli- volt AF signal from one board end the other, and then wondering why Vati- can Radio blesses their construction at nightfall, or (with less interesting stuff to listen to), mum's hairdryer! Other skills most 'simulation- genera- tion' enthusiasts have diffi culty mas- tering in relation to inductors include guesstimates of the inductance (i.e. P the inductor’s self-inductance and from there, its operating frequency) and winding one's own coils. The latter job is fraught with pitfalls and hassles; knowing the core and wire properties, number of turns, finding a suitable core and understanding the difference be- tween nano-, micro- and millihenries (nH T pH and mH respectively). To add to all the misgivings, few, if any, digital multimeters support induct- ance measurement. And to cap it all. the fixed and adjustable inductor in- dustry is mostly Asian and Japanese (Toko, Mu rat a et al.) with a solid tradi- tion of producing quirky type- designa- tions and a lot of unbranded no -name aftermarket components. In rhe end, most head bashing and ob- jections against the humble inductor can be sussed out if help is available to ‘find out the value of the tiling'. And that's where Coil Clinic conies in. Principle of the measurement After some research, resonance-fre- quency measurement was found the best method available to make Coil Clinic work over the stated inductance range. Another method was aban- doned but needs to be mentioned here for the sake of completeness. Due to its self-inductance property, an Inductor supplies a voltage that's pro- portional to the variation of the cur- rent it carries. Consequently, an in- ductor supplies a square wave when fed with a ramp {tri angular) current. The amplitude of the square wave is proportional with the rate of rise of the current and likewise with the induct- ance we re hoping to measure. In prac- 62 ekldor ektf tonics - 6/2007 Coil Clinic quick specs • Measures 100 nH to 99.9 mH En ane range • 2% resolution (approx*) • Direct readout on LCD • Battery powered • Battery status indicator • 35 mA current consumption • ATMega48 microcontroller A 100 nH to 100 mH single-range inductance meter with LCD readout tice. an effect called ringing' (damped oscillations) spoils the ac curacy of the proposed method, not forgetting the in- ductor 1 s series resistance wreaking havoc at lower frequencies. The resonance frequency /. of an LC network is not too difficult to calcu- late from ft - 1/(2 k \L O Now, if C has a fixed, known value, the we can isolate L as L = 1/ C(2 itfi) 2 and deduce it from the resonance fre- quency measured by a suitable circuit such as a micro controller. To prevent any kind of range switch- ing. an oscillator was developed capa- ble of covering a wide frequency range using one and the same, fixed, capaci- tance C. The output of the wide-range oscillator is then fed to the microcontroller set up to + gate' its internal counter for 100 ms before being disabled again. The result in this case is the output frequency di- vided by 10. Using the above formula (in software!) the microcontroller con- verts frequency to inductance value and shows the latter on a display. Practical circuit Tire theory (almost) over we can have a look at the circuit diagram in Fig* ure 1, Not much the re, really. Because the microcontroller runs at 'just" 20 MHz, the highest frequency that can be accepted from the oscilla- tor is about 8 MHz. A normal Colpitts oscillator configuration cannot be used because the Q (quality factor) of the LC circuit will be low if small induct- ances are measured with a relatively small (fixed) C. After aO, the internal gain of die oscillator has to be greater than unity (1) not just to overcome LC losses but also to afford the required high bandividth of about 8 MHz with- out stalling or trouble starting. The AD8099 fast op amu from Analog Devices has a high open-loop gain cou- pled with a high input impedance to minimis e the load on the LC network* In this special configuration, oscillation oc- curs not chiefly because the LC network impedance maximizes at resonance (as the textbook will tell you), but rather be- cause the phase shift is zero degrees at resonance. This interesting characteris- tic affords quite accurate measurements as wall be seen later. flgoffi 1. Haidware-wise, this is oil ihere is fo Call Clinic — an ATM^q driven E rubric me me let v.iEh dlred LCD readout and no range switching. The trux of the rinuit is (he wideband oscillator around ihe ADS099 opomp. 6/2007 - debtor detfreniu 63 Tj TEST & MEASUREMENT Double'ilded PCB for the tndgtionte metet COMPONENTS LIST Resistors R1 = lOOkO R2 - lOkO R3,R5 = 1 kO R4 = 1MQ R6 - 6S0Q PI = 50k£j preset Capacitors ,C2,C3,C7 = 470nF 12pF C6 - 4nF7 C8 = 22nF Semiconductors D1 = BATS 5 IC1 - 78L05 IC2 = Almega48-2GPU (order code 0601 95-41 J IC3 = AD8099ARDZ Miscellaneous SI = pushbutton, e.g. RA3F7L6 {Mullimet) XI = 20MHz quartz cry sick lav/ profile Alphanumerical LCD module, 1x16 charac- ters, HD44870 compatible [see te d) K2 = 1 4 -way SfL pinheoder K3 = 6-way SSL recepiqde strip (see text) PCB, ref, 060195-1 from ElekiorSHOP Source and hex files for AT;,Vego48 free download From www. e i e kto r- e I ect ro n j ts .ca . u k caler. A fairly accurate gate timing is achieved by clever use of the prescaler and pre-load parameters. Computing the L value from the meas- ured frequency represents a heavy load to the micro. Sure, it can add, subtract and multiply, but you will look in vain for assembly code instructions to do di- visions. Like it or not, at some point it is required to divide a 24-bit number by. , . another 24-bit number. A workaround was found in the use of the ‘long divi- sion 1 method we learned at school many moons ago. Here, it is done at bit level! As the author discovered, writing a long division in assembler language is not accomplished during tea break, in fact it forced him to call in the help of the internal debugger in AVRStu- dio 4.0, The debugger was found to be an invaluable aid in tidying up the code, weeding out minor errors, over- sights and the odd bungle, and gener- ally tweaking the code. elekfor electronic - 6/2007 FLnally, the circuit is powered by a low- drop low-power 5-volt regulator, which takes its input voltage from a 9-V PP3 battery. Preset PI is the LCD contrast adjustment. Software and the micro The oscillator output is directly fed to the PD4 (counter) input of the AT- Mega48 microcontroller. This input is gated for 1 00 ms under software con- trol, and the resultant -^10 signal (i.e. 4/ 10) is ‘slow* enough for measuring, again in software. In fact, about 95% of the functionality of Coil Clinic is due to carefully designed firmware running in the ATMega chip. Measurements and calculations were programmed in assembly language, Tire source code (.asm) and object code (.hex) hies for the project are available free of charge from our website as archive file # 060195-lLzip (June 2007). You may want to have the .asm listing avail- able to be able to follow the discussion below. Of two internal timers avail- able in the ATMega48 r one is used as a frequency coun- ter and the other, to governs the 100-ms gate signal. Use is made of the counters' ability to generate internal interrupts on an overflow condition. The tinier used as a counter has a width of just 8 bits. However, by incrementing a 16-bit reg- ister by 1 on each overflow, the effective width becomes 24 bits which is ample for our purposes. The timer ’doing" the gate time is set up as an up -coun- ter and features a pres- Figure 3, Prototype of the board. The footprint for P] ks b&en corrected in the final PCB artwork. Construction Luc at Elsktor labs has again succeed- ed in designing a PCB for the project that’s so nice & clean we can safely print the copper track layout on our website and the component mounting plan in Figure 2. As you can see, the board is double-sided with plenty of copper pour at the solder side to act as a ground plane. The 8-pin AD8099 is an SMD compo- nent which will require the most atten- tion when wielding the soldering iron. After the 8099, it's all plain sailing as only through-hole parts are involved. The ATMega48 micro is best fitted in a 2 8 -pin narrow-DIP socket.... come again? which is made from two strips of SIL pin receptacles cut to 14- way length. Although the LCD is oper- ated in 4-bit mode, the PCB has a 14-way connector as we also need to cater for E (enable), RS (register select), contrast and the LCD supply voltage. The LCD may be a general- purpose device with 1X16 characters, as long as it has the HD44780 control- ler (or equivalent). For the lab prototype we used an MC16Q11A-STR from Famell, order code 1ZZQ423, which can be plugged directly onto K2, Make sure you know the connections of the LCD mod- ule you intend to use. Figure 3 shows the last pro- totype of the meter. Preset PI was improvised, but Its 64 footprint is correct on the final PCB lay- out. The unknown inductor is inserted into K3. a piece of 5IL receptacle strip cut to 6- way length. Another piece may be stacked on top so you can easily re- place it when it wears out or gets dam- aged. Two sets of three receptacles are in parallel to allow several lead pitch- es for these components* If you have to use wires between the board and ‘L x t keep them as short as possible. Do not touch the leads while measuring, on penalty of incurring a lot of stray inductance* The finished board and LCD module should he easy to fit in a compact plas- tic or metal case with a battery com- partment and an LCD window* Calibration Do not attempt to calibrate the instru- ment if it does nor work yet. With the microcontroller up and running you will see 'OVER 1 on the LCD, Did you get the LCD contrast right with the preset? Good, continue. Short-circuit the L : , inputs and check that "NO VAL- UE' appears. The calibration calls for two reference inductors, one 22 pH and one 220 nH (yes that's 0.22 pH). The first is for the correction factor measurement, which is required to level out the tolerance on the ceramic caps in the oscillator. The 220 nH inductor, then, serves to com- pensate the length of the connecting tracks to L . (and wires, if arty). From a batch of 5 to 10 220 nH induc- tors (E 12-series miniature chokes), se- lect the one that comes closest to the average value of the batch (measured with Cod Clinic). The same is done for the 22 pH inductor also needed for the calibration. If you find large devia- tions from 22 pH (Le,, below 16 pH or above 26 pH) then the 12 pF ceramic caps need to be reviewed. Best results are obtained if the uncalibrated meter achieves an accuracy of about 10% at this stage already Switch off the meter, depress S1 T switch on again and release S 1 . You will see the message: Place LI =22,0 uH 1 on the LCD. Connect the calibration induc- tor and press SI again. Disconnect L l and connect the 220 nH inductor (Ld. Press SI again. With this inductor also checked and measured, Coil Clinic will display: 'Calibration OK’. Tire correction factor and offsets so es- tablished sue stored in the E EPROM in the ATMega chip and will be recalled and applied every time the instrument is switched on. Calibration is required only once, and afterwards the meter is ready for instant use. The LCD will show an error message if L or 1 2 is not connected up, or if an out of the blue value is measured. Calibra- tion data are then ignored until, during a proper c ali bration, values are avail- able that do make sense. Accuracy & resolution matters A deviation of 0. 1 pH equals only 0.45%, which is negligible considering the to- tal error of up to 2% caused by number rounding. The 2% resolution in turn, is insignificant if you look at the tolerance stated for cheap off me shelf E 12-series chokes, which is another way of saying that Coil Clinic can be pretty accurate, but it all depends on the accuracy of the calibration process. Practical use KISS applies here: connect up the mys- tery 7 inductor and read the value on the display! No range switching or esti- mating required. Now try this at home: ° What happens if you spread the turns of an air-cored inductor? 6 What if you insert a core (ferromag- netic or metal)? • What if long connecting wires are used? • Wind a coil loosely on a ferrite core, measure L l9 and then remove the core. Measure L 2 . Hey presto the 7V parameter of the core material equals L 1 /L 2 . ® Slide a small ferrite bead up a length of wire and see what happens. 6 Measure the L value of a window or rhombic antenna and use it to calcu- late C required to tune for resonance in a specific frequency band. ° Find out ihe crucial A L spec of an unmarked ferrite ring core — wind 10 (n) or so turns evenly on the core. Measure L. from which: A t = L } n z , A special case exists with inductors larger than 100 niH ('OVER' readout). These can be measured indirectly with the help of a reference inductor, as follows. First, measure the known inductor, note its value and call it L : , Now connect the unknown speci- men in parallel with L, and repeat the measurement, noting the value as L z . The value of the large inductor. L x , is calculated from L x = ! / (1/L 2 — 1/L.) For example, with L : =47.5 mH and L- = 45.0 mH on the display we get L^— 1 / (1/45- 1/47.5) - 855 mH. In principle, inductors smaller than 100 nH can be measured, too — sim- ply connect a known inductor in se- ries. However, the inductance of the connecting wires may cause prob- lems; just remember that a wire piece with a length of just 1 cm easily repre- sents 10 nH, NO VALUE is displayed if tire meter 'sees' a short-circuit or an inductance only UHF and SHF techni- cians care about, Tha message 'LOW BATTERY' will flash every 10 seconds or so if ihe bat- tery approaches the 'fiat' state. The voltage measurement is performed by an ADC on board the ATMega48 chip Although measurements are still pos- sible for a while, replace the FP3 as soon as possible. Fortunately, induct- ance measurements normally take little time to perform, so the batter y should last for years. — w — ■* *» ** ** *- « ^ ATMega48 fuse settings This is a tricky one mainly because of i the dock setting. If you get is wrong, ihe j software will run =o slow characters con » be seen typed one by one an she display i like on old fashioned RTTV Screen dump j shows the settings on the Elnec Smart- | Prag2 programmer in the EFektor lab- j BO0T3Z=11 | BODLEVEL^l 1 CKSEL-I111 SUT^ll | 6; 2007 - elekior detJroma 65 jean-Pauf Brodier wo articles in this series show how the microcontroller is capable of 'playing all the only interaction with the Outside world is the emission of light by the LEDs. Tt hing more useful, the microcontroller needs to react to conditions^ events in its . W' ^ V- ” . » - * * ' T ' ^ ent, which robotics engineers call stimuli (singular: a stimulus). Sensor 0 Sensor 1 Sensor 2 Sensor 3 ^ Sensor 4 figure : Keypad and indicators for the claim system* (Source: Malrii Muttrmedto) The second example given in Flowcoursa [an CD-ROM] describes an intruder alarm that lights an LED in response to sensor activity. It is configured and set by a series of buttons. The signals produced by ihe sensors and the but- tons are the stimuli that are will determine the behaviour of the microcontroller; we shall be seeing how ihe pro- gram takes these signals into account. The installation (see panel in Figure I) comprises six intrusion sensors and six buttons, one of which is used for set/reset. On the output side, there ore just two LEDs. One indicates that the system is armed, the other, that an intrusion has taken place, in a real application, when the LED lights, a relay Is also energized to power a siren, lighting, or trigger telephone reporting of the alarm. The set/ reset button makes it possible to arm or disable the alarm system depending on the moment in the day. The sensors are normolly-open contacts. When they are operated, they fake the corresponding microcontroller in- put to logic high. ■KIH'J UJL?JUE£U 1_7Z> I4j n =c- r -i t ES-COM&i *= t v _■ til Ihe 3 TED board is sell-cGnlairiod, the LED anodes ore connected via 560 1 J : v.re 3 The 3-push button switch board needs a power supply lo bs luVen Irom the tV roits tors Its Ihe port outputs, ihe cathodes to earth. {Source: Matrix Multimedia) term! no Ls of the Mu I ft* prog rammer board. The microcontroller inpuls are pulled down by 4k7 D resistors and protected by 390 1> series resistors. [Source; Matrix Multimedia) 66 e S e trier Electronics - 6/200? ✓ Construction Besides the Mu lil-prog rammer board the experimental setup will include the 8-swiich Switch board and the 8-LED LED board (Figure 2). The E-Blocks Switch board in Figure 3 needs powering via a wire from a *V terminal on the Multi-programmer board, connected to one of the +V terminals (OUT or IN, they are joined together). These two circuits ore taken from the CD-ROM by Matrix Multimedia . At rest Our setup will be using port B For the inputs and port A for the outputs. As per the flowchart in Figure 4, the pro- gram continuously monitors the state of bit 0 of port B. The lest if decides if it is necessary to perform the relevant action for the case where the Input (the Properties of which can be found in the screen dump in Figure 5) has gone high. If pin 0 of port A goes high, the program exits She small bop A to perform the action requested ( out- put) ond then return into the big bop; light the Armed' LED ond set the variable ARMED to ' 1 The screen dump in Fig yre 6 illustrates the output properties Intrusion Now the system is armed it is necessary to enable It to react to an intrusion, which will correspond to She closure of a sensor contact. We enter a new loop, in which we shall need to verify ihe state of the sensors and the set/ re- set button. A high on a sensor line will light the INTRU SION LED connected to output 1 of port A. For the test, we shall only take info account input 1 of port B. The screen dumps in Figures 7 and 8 give the Proper- ties of the input and output. The flowchart in Figure 9 shows only the part of the full flowchart that we are inter- ested in. Te. from ihe point 'while ARMED <> O', ihe rest being identical to the flowchart in Figure 4. This deteciion loop needs to be modified so as to take account of all the inputs to which sensors are connected. Two methods are available to us; adding fresh 'Input' boxes or adding bits in the Properties' of the existing box. It's also possible to make provision for two Input' boxes, each monitoring one part of the sensors and triggering an action appropriate for the zone where the sensors are. And back at rest again Alt we now have to do is to exit the detection loop in order to dear the alarms and disarm the system. Here again, there are (at least) two solutions. We con simply add a test for the set/reset button. We can also - and this is what we are going to be doing here - make use of one of ihe properties of port B: triggering an inter- rupt whenever one of the pins changes state. Pins 4 to 7 react to any change of state. Depending on its configu- ration, pin 0 labelled INT r reacts to either a rising or a falling edge. We configure It (Properties) to react to a rising edge on pin 0 and reset the variable 'ARMED' to zero (Macro). By so doing, the condition for remaining in the detection loop disappears and the program exits this loop. Before returning to the big loop, we take care to disable the interrupt RBO/1NT, to extinguish the Indicators and set a timer. Two problems arise, which we shall solve in a single ac- tion. The first and obvious, problem. Is that once the Input 0 of port B is Ins only one taksn info account. t 23 07 - dekior 67 PROJECTS E-BLOCKS . Output 0 of port A gee; high la udtiatB the thongs of si a I us. Input 3 a! pari 8 rones ponds to the first sejhol . Output I of port A goes high la signal on intrusion. figure 9. The Intrusion delotiion leap ho; no end instruction. ll will ho necessary la cut the po *er to eiit il sysEem is armed, the user cannot leave the premises with- out setting off an alarm. The second is that, if pressure is maintained too long on the set/reset button when turning it oft this will immediately be interpreted in the big loop as a request to arm. The solution is common to both these problems: time de- lays need to be introduced in the execution. After arming, a delay of a few tens of seconds will give the user time to leave the premises without setting oft an alarm. After dis- arming, o delay of a few seconds will leave enough time to release the button and allow the inevitable mechanical switch bounce to stop. The complete flowchart for the intruder alarm can be found in Figure 10, Each of these delays is achieved using □ countdown in the loop, A register is loaded with the number of seconds delay. An interrupt from the timer decrements the con- tents of the register. When the counter gets to zero, the program exits the wait loop. If there is nothing else to be done except v/ait, the rest of loop can be empty. The variable 'RATE (Figure 1 1) is a 1 6-bit number In the microcontroller s default configuration, the internal os- cillator has a frequency of 1 9,6608 MHz. Pre-division by 256 yields a signal at 75 Hz to clock TIMERO, 75 zero 68 ddricr ekdronics - 6/2007 transitions, and hence 75 interrupts, are needed for a de- lay of one second. The counter is loaded with the number of dock pulses instead of the number of seconds The number of seconds appears in the flowchart - the multi- plication by 75 Is [err to the compiler. It is also possible to create an auxiliary variable that would count 75 inter- rupts before counting down RATE. The macro 'Ticrac', called by the interrupt, counts the overflows of the counter-timer TIMERO, The C instructions contained in this macro/command are: if ( FCV_RATE > 0) FCV_RATE - FCV_RATE - 1; / / Count down if (FCV_rAYE %75 -=0) FCV_LED_AIIHEB==1; // Dereceian very second Output During the delay period after arming, LED AO will flash pt 1 Hz. To achieve this, the status of the flag LED_ARME is tested in the loop. This flag is set when the value of the counter TEMPO is divisible by 75 [modulo opera- tion above), i.e. when v/e are at a round second. In this case, the value of AO is read, is inverted by the exclu- sive OR operation, and is brought out on the AO output pin. Once ti has been used to decide the branching, the LED_ARMED byte can be used as an auxiliary variable. In this series of operations, one piece of good program- ming practice may be noted: the flag that triggers output switching is set by one function, the interrupt routine, and reset by another function, the output switching routine. Poor practice would have been to set and reset the flag within the same routine, which would run the risk of giv- ing random Flashes. The LED will be lit at the exit of the bop, whatever state it was in before. Extensions To complete the burglar alarm all that remains to be done is to increase the number of sensors being monitored and add a few hardware elements. First of all, one or more relays, connected from the output pins via transistors, to signal the alarm in a more dramatic fashion than by an LED; then the incoming lines far connecting the sensors, with the necessary protection against overvoltages and induced voltages. r . i 1 . The variable ftATf count ot the seconds d the delay Q BEGIN J Initialise RATE = 0 ARMED = G Ticiac Enable JMRO Overt! ;> Figure 10. bdjtad fiom the intruder dorm program. fr2QD7 - debar electronics 69 TECHNOLOGY SENSORS Security is becoming an increasing important topic nowadays. Protection of personal data in particular is receiving a lot of attention. Fingerprint sensors are thus riding a rapid development trend, the ESCO Biometric DigitalisS is an unusual type of fingerprint sensor system. It uses RF signals to record fingerprints. The first fingerprint sensors, which were developed around 1 990, used surface contact methods to record the unique patterns of fingerprints. The predecessors of cur- rent methods used optical imaging methods to produce pictures of fingertips.. A number of different methods are now available each with its own advantages and disadvantages. Methods One example is electrical capacitive measuring, which uses charge-sensitive sensors to detect the differences between ridges and valleys. The disadvantages of this method are irs sensitivity to static charges and the fact that its electronic circuitry can be tricked relatively easily by using on artificial finger. Another method Is based on using piezoelectric sensors to measure pressure. The disadvantages of this method are its low sensitivity, its inability to differentiate between real and false fingerprints, and its sensitivity to excessive pressure. A third method is thermal recording. A pyroelectric mate- rial can convert the difference between the temperature of a pixel element touching a ridge and the temperature of an element located beneath o valley into a voltage. This technique is nearly foolproof. However, It has the disadvantage that the thermal image disappears within one-tenlh of a second. The sensor array Is heated quickly by the finger, with ihe result that there is no longer any temperature difference. Optical detection, which is the method that was first used to record fingerprints, is also still used. A picture can be taken using a CMOS or CCD sensor array and then con- verted into grey tones. The disadvantage of this method is that impression left by the finger can be reused, ft is also difficult io distinguish a real finger from a good imitation. The method used in the DigitalisS system is based on RF signals. A low-intensity RF signal is applied to the fingertip, which causes it to act as an antenna. A properly config- ured miniature antenna array can then use ihe RF signals to mop ihe ridges and valleys of the fingertip. It is difficult to trick this sort of sensor, since its operation is based on Ihe physical properties of the skin. The weakness of this method is the quality of the connection between the finger and the contact that transfers the RF signal to the finger. The contact point can also become very hoi TruePrint The American company AulhenTec has developed sensors that utilise the RF signal method. The technology they de- veloped , dubbed TruePrint 1 , works by reading the finger- print from the live, highly conductive foyer of skin cells just beneath the dry ouler surface layer (see Figure 1 ] This method is relatively insensitive to dry, abraded, row, dirty or greasy fingertips, which can confuse other types of sen- sors. The False acceptance rote (FAR) is 0.01%, while the Cross ssfikn of si ;i Figure I. FruePrinl I ethnology ujh fif signals to lead liogtrpnnls. false rejection rate (FRRj is 0. )Q%. The DigitalisS system made by ESCO Biometric uses ihe AF58600 sensor, which was developed by AulhenTec and is based on TruePrint technology. It consists of a sen- sor array, o drive ring, and the associated electronics. The electronics detects the presence of a finger on the surface of the sensor and produces a digital image of the fingerprint. The square sensor array is located in the middle of the chip, and it has an edge dimension of 1 1 ,43 mm. This sensor array is actually the top surface of the chip. The surface is treated with a special ceramic coating with o Moh hardness of 7+, This protects the chip against abra- sion and wear. The array is formed by 9216 individual elements ar- ranged in a 96 x 96 matrix. This arrangement is divi- ded into six rows of 96 x 16 pixels. Each element has 70 cfcfctor ef^tronTts - 6, 2007 Operation The elements in each column of o suharroy are scanned to generate a digital image, A 1 6-channe! multiplexer selects each column of the subarray in turn for sampling and digitizing, The selected column drives an analogue bus line. The signal Is amplified, integrated, and fed to a sample-and-hold circuit. The resulting analogue signal is then digitized. The drive ring transfers the signal to the finger which me- ans it must make contact with the finger for proper recog- nition. Consequently, it is located around the periphery of the sensor array. It can be recognised by its slightly lighter colour. The drive ring Is driven by on-chip direct digital synthesis (DDS) components that generate a sine-wave signal. The phase, frequency and amplitude of this signal are determined by software via the control registers of the sensor. The sensor array is actually a set of active antennas that pick up the very weak signal transmitted by the drive ring. The signal from the drive ring is coupled into the user's finger, and it is modulated by propagation through the various layers of the skin. This means the finger must make contact with the drive ring and the sensor at the same time In order to generate a pattern corresponding to the Fingerprint af the dermal (live) layer of skin cells. AuthenTec has integrated a temperature sensor in the fin- gerprint module to avoid generation of an excessively hot contact spat due to the resistance between the finger and the drive ring. It monitors the temperature and switches off the module if the temperature becomes too high. Recognition The recognition process con start after the data has been recorded digitally. T nis process involves several steps. First the data must be converted into a manageable for- mat. A commonly used method, which is also used by the FBI is to identify the 'minutiae . These are special features In the pattern of the lines of a fingerprint, such os branches and intersections. A unique 'signature specific to a particular person can be composed from 40 points. Determination of the positions and orientations of the mi- nutiae is sufficient for comparison of different fingerprints. As a result, a unique Fingerprint occupies only 1 28 bytes in the digital domain. This digital information can be compared with information In a database. Although each sensor manufacturer uses its own algorithms,, they are all based on the same bosic principle, which is to took for the best match. All sorts af circumstances can occasionally cause slight differences be- tween the stored and measured images of the minutiae. For this reason each algorithm usually has a configurable er- ror tolerance, which also directly determines security level. This is of course directly related to the FAR and FRR values of the system. The more stringent the security le- vel setting, the more often fingerprints will be rejected. Although it may be acceptable to let your fingerprint be scanned 15 times for access to a top-secret government facility, this would be For too inconvenient for consumers who want to use fingerprint identification for paying at a filling station. Everyone benefits from a fast, accurate de- tection system, and TmePrint technology provides a solid basis for such a system. Web links: wwv v. e s co b ; oroet ric.com ay. vv.a uihem^c. co m an amplifier located just below the pixel ele- ment, a synchronous demodulator, and a filter. 6-2007 - sfsrifomts 71 PROJECTS Like it or not, the microcontroller litis become an indispensable part of electronics. However, there are still people who know very little about these components. For this reason alone, many people avoid building various projects. The problem is often the programming of the microcontroller. Buying it is one thing, but programming the firmware... Figure 1. The ' Enigmatic' is really nothing more fbaji a few wires and a socket for the miercc&ntfdiar. Figure 2, We niaally keep the number of p=r|j h 5 mirstnum. But this fine there ere very few indeed... Jeroen Domburg & Thijs Beckers The main reason for people to avoid a microcontroller based project is the obstacle of programming the thing". The expectation is often that an expensive programmer is required to program microcontrollers. This is fortunately not alwoys the case. Although there ore o Few, usu- ally older, microcontrollers that require a professional (and expensive) programmer, making a good programmer yourself for most modern microcontrollers is a matter of only a few quid. In this article we look at o programmer that's specifically suited for the AYR series of micro- controllers from Atmel. It can program practically all AT90, ATTiny and AT Meg a chips. AVR r by the way, means... nothing. Protocol In addition to complicated and Faster protocols, most AVR microcon- trollers also support the slower ISP protocol. ISP stands for In System Programmable and has been specifically designed lo (re-)prcgram an AVR micro svithout having to remove the chip from the circuit. I his does make it necessary that o few pins are reserved for the programming operation. Preferably not too many, because that is not convenient if the controller has already been fitted in a circuit. Atmel has been able to limit the protocol to five signal lines: Reset, MISO, MOST SCK and GND. With this information we can get started. Design There is no need for special (high) programming voltages, so if we can generate the correct signals we are actually done. The PC has a port that makes it easy to generate TTl compatible signals: the parallel [or Centronics) port. It is therefore obvious that we use this port for our programming adapter". The pins can be directly connected to the AVR micro. The supply voltage we also 'steal' from ihe parallel port. With a Few 1G0-Q resistors we join a few pins from the parallel port together (see Figure T). We connect all ihis to an 1C socket For ihe AVR micro to be programmed. Use a somewhat more expensive, turned pin sock- et. These lost a lot longer than on ordinary sockel, which tends to have rather saggy springs after only a few uses. We still miss one part. Some microcontrollers have a built-in oscillator, but most of them need □ quartz crystal to generate the clack frequency. We therefore have to add that to our ‘circuit' as well. Because the pro- gramming is done with a clocked signal, the value of the crystal Is not very critical . Any value from 4 MHz up to the value that the AVR micro is rated For, con be used, We should also connect two capGcitors of 22 pF lo ground, bul we leave those out for simplicity. We have never 72 els V tore fetfH nils - 6/2G07 The construction can b* done \m Ways: on the left I he cinpissi way ad on Ihe right the Veriios with * small RGB. hod any problems because of this. You can always add them later if they turn out to be necessary after oil. Software The (free) software that we use with this programmer can be found under the name of AVRDUDE' [AVR Down- loader/UploaDEr). The software was originally made to operate in a Unix environment, bul a number of fans have written a version for Windows. The programming software is bundled with the free package WinAVR' [Ij. In addition lo AVRDUDE WinAVR also contains a compil- er, an assembler and other programming loots. We don't need these, however, if we only want to program the firmware in an AVR microcontroller. AVRDUDE has been designed for Unix-based operating systems. If you are running such an operating system on your computer than you will heave no problem program- ming an AVR microcontroller using the manual. However, AVRDUDE does nor have a user interface that Windows users expect. This can be solved with the pack- age 'AVRDU DE-GUI' [2] (GUI means Graphic User Inter- face), After downloading you need to unpack the files from this package into the same Folder that contains AVR- DUDE, usually C:\winavr\bin. The program starts with a double-click on avrdude-gui.exe and you can now easily adjust all the parameters. An example As an example, we wish lo program the code for the Ethermeter (E/ek/or Electronics March 2007) in the AVR microcon troll er. What things have to be set? Firstly, it is device . Here we choose the J ATTiny23 13 as that's the controller we are going to program. The programmer" we describe in this article is ihs so-called bsd program- mer, so we select if. After that we have to select the parr we're using. In our case, it's the printer port, that is, LPT1. Unfortunately, AVRDUDE in combination with this inter- face con only drive parallel ports that ore mounted direct- ly on the motherboard of the PC, USB to parallel adopters never work and with PCI expansion cards there is □ good chance that ihey don't svork either. So, it will often be the case that you need to select LPTl'in the Port box. Now we can configure the AVR settings themselves. We want to Rash o File, so tick the ‘Flash box called Write' and below that indicate where the hex file is. With the T.. button you can browse lo the correct location, if necessary. Usually we also have to set the fuses. The settings are nor- mally in the article or in the source code for ihe program (the .asm or x file, which is often available as o down- load). The fuses have to be entered in hexadecimal form. If the values are indicated in a different way then we can convert them with ihe on-line fuse-calculator [3], In the case of the Ethermerer, the .asm file states that the low fuse has to be Oxer' and the hioh fuse Oxdr , With both we tick the Write' box and enter the appropriate values. If all is well, the window will look about the same os ihe one shown in Figure 4. i - ^ i : > vti * !:*: r L -I-tiiliil I±± 1 * 11 ' “-it I-mL.I 'HF'n | " *■ ■ J * tl 1 -±±M. —Li Ft-J «;ni fan d .1 ' - - rfm- i -= — f.ZE 1 --■-‘i L r “ Stcjt L" EL? -\'H -=KItir 5 - ' Li ■* . T 3 - ■ ; j- — »-li _ WT-tl — *: = : ReJrtmics is a monthly column ceding vintage electronics fnduding legendary Elokfar designs. Contributions, suggestions and inquests ere welcomed; pleose send on emoil to ed I to r ' I wish to promote tm company, please book nr, space: * Text insertion only tor £220 + VAT ■ Text and photo for £330 + VAX va\jp- OIJfiANIXATinM* S 1 ■* ■ * i J • * »■ n. J ■ * * ■ nn n. i ■■ ■■■ lb J- J a ■■■■■. 4 pa i. ■ ■■ * ■ a. a u ■ * B- ■ ■■ ■ ■■ ■ * ■ ■■ ■ k ^ ^ Ci ■*-- * 1 - 3 . J ♦ 1 * 1 I B -k ■ ■"* * - k - b t- ■ + »■ B B ■# * ■ + B-« ■ + 8 - fi B --■■■* B -r B - -- B % ■» B * B -k b--- r ■ fa B--S B--B B- b B B t ■ -fa i-f- r- - «i ■» k *-vr ADDR.ESS B M * + *+ k* #M ¥ P *#«f f H If f H kkt k*kt +*♦***# tl IBM »l k B k ♦ If f f k 4 k ■ f If kl B- * -k %■ ■* B- « + * » S- P b- B * ■ * B--B B- -S + B * k + » * » -B * « » 4 * -fi 8 - B 8 - I- -B ■# m * ■ 8 - »■ "k B- 8 - * -B b- * B- * » 8 * b + 1 8 - B- 4 *■ ■m * r t -B * -m 8 - B * w -fa a ■* * B 8 - r * B ■ b- 8 + ■ + i -fi B * ■■ + B- * I- b B ■m B I ■*-b-» 8--8 t B-ark-a- _ , __ .TEL: PLEASE CO^tPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS /ORD DESCRIPTION.,. j-.- i . - ■ ■ I I I ! 1 I t I I 1 l E I 1 I I I I I I j ai. a. ■ a-. + + Jctbt-.bB-b-bb-bb-btb-Bb-bb-bb-bfb^B'Btb- -r ■ a n -r ■ t -- i i r t b t -b b- b b- » r m m b b B - r m -r b r ■ t w m b^ b b- b t e- t b b t b t « r b b t b b p riTiBrBBirBi-itriiiTivrTi 6/ 2007 ■ tleklijr detlrtvar^ 79 t. Electronics at all he right levels Advantages to subscribers loony. Never Tailed to impress ny boss or my wife.” Thomas Gosling 38, electronics enthusiast - Secure a head start in electronics with a subscription! 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 IUNIHG EXPLO (if 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 Pi 1 r*i m mxTkh 1 | * J* / t • **■. JF. * — - i , ' , wwiAeleltiMr-eleotroliilics.co.iiWstiliJS Tel. +44 (0) 208 261 4509 Or use the subscription order form near the end of the magazine. lektor Order now using the Order Form in the Readers Services section in this issue „ - CD-ROM BESTSELLER Elektor 2006 This CD-ROM contains all editorial articles published in Elektor Electronics Volume 2006. Using the supplied Acro- bat Reader program, articles are presented in the same layout as originally found in the magazine. All free, printed, supplements our readers got last year, like the Visual Basic. C and i-TRIXX booklets are also contained on the CD. The Elektor Volume 2006 CD-ROM has a rather different look and feel than previous editions. Its gone through a makeover in more than one way! ISBN 978-90-536! -207-5 ! £16.25 (USS 28.75) USB TOOLBOX This CD-ROM contains techni- cal data about the USB inter- face. It also includes a large collection of data sheets for specific USB components from a wide range of manufacturers. There are two ways to Incorpo- rate a USB interface in a micro- controller circuit: add a USB con- troller to an existing circuit, or use a microcontroller with an integrated USB interface. Included on this CD-ROM are USB Basic Facts, several useful design tods for hardware and software, and all Elektor Elec- tronics articles on the subject of USB. ISBN 978-90-5361 -21 2-9 I £18.95 (USS 34.95) Home Automation This CD-ROM provides an overview' of what manufactu- rers offer today in the field of Home Networking, both wired and wireless. The CD-ROM contains specifications, stan- dards and protocols of commer- cially available bus and network systems. For developers, there are datasheets of specific components and various items with application data. End-users and hobbyists will find ready-made applications that can be used immediately, ISBN 978 90-5361-195-5 I £12,95 (USS 22.90) Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Telephone +44 208 261 4509 Brentford TW8 9HH Fax +44 208 261 4447 United Kingdom Email: sales@elektor-eiectronics,co.uk More information on www.elektor-etectronics.co.uk Microcontroller Basics Microcontrollers have become an indispensable part of modern electronics. They make things pos- sible that vastly exceed what could be done previ- ously. Innumerable applications show that almost nothing is impossible. There's thus every reason to learn more about them. This book offers more than just a basic introduction. It clearly explains the technology using various microcontroller circuits and programs written in several different programming languages. In the course of the book, the reader gradually develops increased competence in converting his or her ideas into microcontroller circuitry. Visual Basic for Electronics Engineering Applications This book is targeted towards those people that want to control existing or home made hardware from their computer. After familiarizing yourself with Visual Basic, its development environment and the toolset It offers are discussed in detail. Each topic is accompanied by clear, ready to run code, and where necessary, schematics are provided that will get your projecls up to speed in no lime. ISBN 978*0-9 05705-67-5 230 Pages £18.70 (USS 33,70) Visual Basic 91 l«)H Hi fte? k-1 : for Electronics Engineering Applications ISBN 978-0-905705-68-2 476 Pages £27,50 (USS 51.50) BESTS1LLING BOOKS Visual Basic for Electronics Engineering Applications ISBN 978-0-905705-68-2 £27.50 (USS 51.50) ( 2 ) Microcontroller Basics ISBN 978-0-905705-67-5 £18.70 (USS 33.70) ( 3 ) Modern High-end Valve Amplifiers V — ISBN 978-0-905705-63-7 £25.95 (USS 52.00) (4) PC-interfaces under Windows ISBN 978-0-905705-65-1 £25.95 (USS 52.00) (g\ Designing Audio Ci ISBN 978-0-905705-50-7 £20.75 (USS 42.00) More bestsellers on www.elektor-elecbron1cs.co.uk Stand-Alone OBD2 Analyser {June 2007) Software Defined Radio (May 2007) Kit of parts, rnci. case, cable, front panel foil and mounting materials 070038-72 £ 51.70 / US$ 97.50 Free downloads: Online simulator examples (070038-21) Manual (070038- W1) See www.eiektor-eIecfronics.co.uk Ready-populated and tested board 070039-91 £ 72.45/ USS 126.50 Speedmaster (May 2007) The circuit voted winner of the R8C Design Competition! Ready-populated and tested board (excl, R8C module) 070021 -91 £ 51 .70 / USS 97.45 No. 366 JUNE 2007 £ si 2.4 GHz WiFi Spectrum Analyser 070040-1 PCB, bare 8,25 15.50 0700.11-11 CD-ROM. ^ tYindows software 5_2u 9.75 Coil Clinic 060195-1 PCS,, bare 7.60 14.25 060195-1 1 CD-ROM, ppact software 5.20 9.75 3SG 1 95-4 1 AtmeGa46-2£fFll , programmed 5.20 9,75 Linux Oscilloscope 05 0241 - 1 1 CO-PC M , projec' sc; - v. srs 5.20 9.75 06024 W* Frogf^m tstlrsg tree download Stand-Alone OBD2 Analyser 070933-72 K i d parts ?fcl. case. cibte. fre-n ps ar. • ft>: and rro^ifjng 5170 97.50 G7O033-21 Or ssnujalar e^amp'-ss free tiowitioad Q70G3B-V/1 Manual free download Whistles from on high 060044- 1 PC Ez Dare Eat far TX ~-=d RX 12X0 22.75 060044 -*1 CD-ROM, pDj set software 5.2£f 9.75 06MH441 ATtsnylSPC, profammaa 10.90 13,75 No. 365 MAY 20ti7 Software Defined Radio 070039 - 3 1 Read, -p: coated a r j tested to^nj 070 j 19 -i 1 CD-ROM prp-vri software Thank your for Flying USB FtrfeSim G6037S-1 FOB. bare 060376-41 PiCl E F2550 '.SR program Unive rs a I J TAG Ada pto r G5G2B7-1 FCB . fcsrs, iwm programmed rnsatJcentiDto l0v 2B“^1 EPS0C1C o nr/, programmed Magnetometer 050276-1 PC B. bar? Speedmaster 07 C02 - -9 1 Rrsd , /-p:pJaled 3rd t sstsd beard :a *d. R8C med Seismograph 0o0207-1 PCB, bare 060307-1 1 CD-ROM. pr^fet software 307-4 1 ATT n f 45 pr pgj^nvnsd ATtiny as BOS Signal Generator 060253-4 1 A!l=ny2 3 1 3 - 2 j, prog m r.rrsd 420 7.E0 !No. 364 APRJL 2007 i H Battery Charge-n-Check 050073-1 PCS. bare, mam boad 1030 I9 60 060073-2 PC3 bare, ffep-5y beard 10.30 19.50 050073-1 1 C D- F-0 M* u d j€Ct softwera £20 9.75 050073-41 ST7FMC2S4. pogrcTTimed 16.90 31. S5 g-Force on LEDs 060297-71 PCS s^t, net 2 MMA72SQ sensors, BDM csbie parts IQ CO 18.85 060297-1 1 CD-ROM perfect soft a sre 5.20 9.75 Programmer for Freescate 6BHC(9)08 060263-1 PCB, tare www.thepcGskjp.com A Simple Mains Inverter 060171-1 PCB hare wu-w.thepdBhpp.com Very Simple Clock 060350-1 PCS b*e WTW.thepctJshop.com E-b locks Light Chaser Squared 075032-1 PCS, bare wviw.thepcbshcp.com No. 363 MARCH 2007 Attack of the SpYder 060296-91 SpVdEf Oscover, Kit 6,45 12.70 AVR drives USB 060275-1 PCS, t ere 10.M 16.65 06027c- 1 1 CD ROM, c-tec! s:*w3re net Sfluia cbOa 5.20 9J5 050276-41 AT^33S2-16PC, programmsc! 8.95 1665 Wireless USB in Miniature 050402-1 PCB bay?. D.varf r-r ,vd 8.3=3 15.60 050402-91 -ISSTransxnto macWfe M £ tested) 24.10 45.45 050402-92 Ov.-id '7^ B O&l Lbivt £ tsstsrfi 17.20 32.45 050402-93 Dwarf Hub Board (bull £ lesied) 17 20 32:45 Mobile Phone LCD for PC □60184-1 PCa, bar? www ctehopcom 0601 64- n C D- ROM pr ujse t k ftwsre 5.20 9.75 060104-41 4 ; aq5i6-1t-PG t • ed 395 1665 Scale Deposit Fighter 070001-1 PCS. Dsi'£ wvAvthepctidiop.com 7^45 126.5-9 9,75 '.Vl'lW.T rpc esre-p, com 15.50 2225 11.00 20.75 PSP cTm/ PSP coSy .vnVr.m?pc^-:p-COm 5170 97.45 a VlW .U&pcfeste: j.Cbm 520 9.75 10,35 19.50 inline at ectronics.co.uk Dus to practical constraints. final fikeslFatioos and specifications Elektor Electronics (Publishing) Reg us Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 (0) 208 261 4509 Fax: +44 (0) 208 261 4447 Email: sales@elektor-electfonics.co.uk may differ from published designs. Prices subject to change. See www.gjg^t pr-etecuonLcs .co.uk fc?r up to date information. Wireless USB in miniature (March 2007) iDwarf -168 Transmitter module (built & tested) 050402-91 £ 24.10 / US$ 45.45 Kits & Modules g-Force on LEDs (April 2007) RGB set, bare, incl, 2 MMA7260 sensors, BDM cable parts 060297-71 iDwarf Node Board (built & tested) 050402-91 £ 17.20 /US$32.45 £10.00 /US$18.85 USB Stick with ARM and RS232 (November 2006) iDwarf Hub Board (built & tested) 050402-93 £ 17.20 /US$ 32.45 Assembled and tested board C6 000 6 -91 £79.90/$ 149.95 No. 362 FEBRUARY 2007 No. 358 OCTOBER 2006 ... 3, 2, 1 Takeoff! 050238-1 Trar* 5 CTtit!£f PCB, bare v^^.thtpcbsbop. com 050238-2 tee-ve* PCS, bare MP3 Preamp 060237-1 PCB. tare vtw.thQMdsftop.eGm A Telling Way of Telling the Time 050311-1 =05 bare w -a lALbQxhsfiop.com 05031 1 -31 CFL D. pc ogr^T t=c 35.50 66.95 FPGA Course (9) 0SD2S-9 - v :D-RCV rc-jree s eft ws?* .net e a jcc cod* SM 9.75 Explorer-16 Value Pack 060230- 3 1 - u • c g in ocner. ts ps i - : cgetr^ - a s - :- be", 122.90 232.50 No. 361 JANUARY 2007 Sputnik Time Machine 050010-1 PCS www.thepchshqjxom 050018-1 1 CD-ROM, prefect scfTwai? (aid source code) 52v ’ 9,75 0500 TE-41 ATB9 02 0 5 1 c ■ og* ^ttt si 3.40 6.45 Very Simple Clock O6O350-1 PCS w7iW.tftspcbsftop.com 060350- is CD-ROM, fyc s : r seft ware ■ c . cods 5-20 9.75 C6035 i r-E 55 '1 Cl M ‘ METHOD OF PAYMENT (see reverse before ticking as appropriate) Bank transfer 1 Cheque (UK-residen- customers OWLYi □ Giro transfer □ Expiry date: Yerificaucn coda: SWITCH D.'iLY: Stan date; Is sae mjmtien mm m mm ■ n Please send this crasr forrr. to Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom TeL: -s44 2GB 261 4509 Fax -44 20B 261 4447 vavw eteMor ‘electronic co.uk. subscriptions ff efektor-electrtmies.co. uk ORDERING INSTRUCTIONS, P&P CHARGES E'Cepl in tile USA and Canada, all orders, except for subscriptions (for which see below), must be sent 3Y POST or FAX to our Srentford address using me Order Form overleaf. On-line ordering: http^/ . i ; v^v.el eKtor-slectm nicsxo.uk Readers in the USA and Canada may (but are not obliged to) send orders, except for subscriptions (for which see below) to the USA address given on the order form. Please apply to Old Coloru Sound for applicable P&P charges. Please alio ,'- 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard} as follows: UK: £4,00 Europe: £5.00 (Standard) or £7.00 (Priority) Outside Europe: £8.00 (Standard) or £12.00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40203520 held by Elektor Electronics (Publishing) Segment b.v. with ABU- AMRO Bank, London. JBAM: GS35 AB'^A 4Q5Q 3040 2095 20. BIG: ABf3AG82l. Currency: sterling ilIKPx Please ensure your full name and address geis communicated to us. Cheque sent by past, made payable to Eiektor Electronics (Publishing) Segment b_/,_ We can only accept sterling cheques and bank drafis from UK-resident customers or subscribers. We- regret that no cheques can be accepted from customers or subscribers in am, other country. Giro transfer into account no. 34-152-3801. held by Befctor Electronics (Publishing) Segment b.v. Please do not send giro transfer* deposit forms directly lo us. but instead use the National Giro posiage paid envelope and send it to your National Giro Centre. Credit card VISA, Access. MasterCard. JCBCardand Switch cards 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 tfektor Electronics 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 sourcets) 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 sca^ for eft orders. Returns Faulty goods or goods sent in error may be returned for replacement or rotund, but not before obtaining our consent. All goods relumed should be packed securely in a panderi bag or box. enclosing a covering letter staling the dispatch note number. If the goods are relumed because of a mistake on our pan. ,ve will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentfora office within 10- days (UK); 14-days (Europe) or 21 -days (all oiher countries). Cancelled orders All cancel led 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, Elsktor Electronics i Publishing) does not accepi responsibility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, primed 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 nos 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 Electronics (Publishing « in writing. Such written permission must also be obtained before any part of tnese 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 Electronics i Publishing | snail 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 wish, foe supply of goods or services b\ Elector Electronics (Publishing) other tnan to supply goods as described or. at foe option of Elektor Electronics (Publishing), to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Eleklor Electronics (Publishing) shall be determined in ail respects by the laws Of England. January 2007 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Pius United Kingdom E4L9Q £48.80 Surface Mail Rest of the World USA & Canada £54.50 USS 95,50 £61.40 USS1 06.50 Airmail Rest oi the World USA & Canada £55.90 USS1 20.00 £75.80 USS131.00 H OW TO PAY Bank transfer into account no. 40209520 held by Elektor Electronics (Publishing) / Segment b.v. with ABN- AMRO Bank. London. IBAN: GB35 ABMA 4050 3040 2095 20. BIG: ABNAGB2L Currency: sterling (UKP). Please ensure your full name enu address gets communicated m us. Cheque sent by post made payable to Elekfor Electronics (Publishing) Segment b. v. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. V/e regret that no cheques can fcs accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801. held by Efektor Electronics (Publishing) Segment b.v. 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 Access, MasterCard jCRCard and Switch cards can be processed by malt, email, web, fax and telephone. Online ordering through our website *s SSL- protected for your security. SUBSCRIPTION CONDITIONS Tna 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 reruno will he made, nor expiry date extended, if a change or address allows the use of a cheaper service* Student applications, which qualify for a 20% (twenty per cent) reduc- tion m current raies. must be supported by evidence of studentship signed by the head of foe college, school or university faculty. A standard Student Subscription ccsts £33.50, a Student Subscription- Plus costs £40,40 (UK only). Please note that new- subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% ( twenty - five per cent) of the full subscription price or £7.50. whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more January 2GQ7 lektor lectronics Eleictor D*slgi>ef L '5 CamparHon — ether ns tl°o°J CD-ROM Ethernet Toolbox P Softwa.'e I Tooii Software Tools en Hardware Tips This CD-ROM contains all essential information regarding Ethernet interfaces! To help you learn about the Ethernet interfaces, we have compiled a collection of all articles on this topic that have appeared in Elektor Electronics and complemented them with additional documen- tation and links to introductory articles on Ethernet interfaces. •Controllers & Microcontrollers •Boards with Ethernet connectivity •Serial to Ethernet •CAN to Ethernet •Connectors •Physical Layer Tranceiver •IEEE 802® standard ISBti 978*90*5381-2144 £18,90/ US$37. 90 It includes a collection of datasheets for dedicated Ethernet interface ICs from many different manufacturers. To help you with your own projects, the CD-ROM provides a wealth of information about connectors and components for the physical layer (PHY) and specific software tools for use with the Ethernet (Software), All of the documents are PDF files. Order now using ifte Ortjer Ftirm in the Readers Services section in this issue. Elektor Electronics (Publishing) Reg us Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel +44 208 261 4509 H-vU See also www.elektor-eleclronJcsxo.uk Index of Advertisers ATC Semtec Lid Showcase - . .78 Audk) AmsieiiJ wn'&auaiQXpre-ssxom _ J31 AvS Re.55rfc^. Showcase ittW.awireseafiftcauA: . ..... .78 BAEC. Showcase . .78 Beta Shoving , . . , tomKpebrpGGLciMn ...... ........ .si 78 SdSCQDS DnStgrrS ttViV/.frTSCOpe CDfTJ ...3 EasyUAC Showcase . . . www. sssyd&fMii . , , ... . 78 Easysync, Showcase . , waiy. tesysyiHLCQMk 78 Hcac. Showcase iwvatefoeexitwt ............... 7S Eufijcirc Lifts Yi\vw.eumckctii&&xn 6 F , rsi Tec n no; :• gy Trass re? Lid Snn.vcass w y.'Mcq.u? 76 Future TeetoSogy Devices. Showcase . iVAwJLtfcfijp.cpm 78 Future Shmvcas . . .WiYjiftu/fe^cfxn . . ,78 Jaycsr fetreruGS ^ViYjiyzarti&irD+cs.CQ.ii* ....... ...... ^ J3 Systems Showcase ... WiY-mu2etwn,coni _ , * , _7B Uhc&Dlsr . . . . . rtVrtr/Rtcefifef .. . ,H3 London BcCironies College, Showcase , .78 Mikru EScKTroniXa. ....... HTViy OttfoTja^COJ .7 MQPffectraniEs, Showcase . .iYiViVmqp.c-um ,, . .... . .78 ■ . t vi \\ = * = C Doct pis , $ now csss w.i'jvj7c j v-iva ve-ccFicepfs cc.ti 7B f&ftdury Betmoh cs wwvnfri . . , .31 Nufrifesr One Systems - , awa numhErunE.zam Nurre fietwQrks .... s w \LxgamQstBtiun.CQm FC3 World. SnowcHse .Avrw.pr frAarfd.ojgM P£itje”Lx , . . . tvw ■-tepaSrortat esm . Pk* ww phxilecii cdffi . .. FflE.VA Sen^efitfuctor , , , . Bectreriics ... ..... u>ya\ qu&s&iectmtuts cum . .RdS'jI E'e riTE i c a . -S r ~ y; : a ; e j v, r,v. tni&Z-els etner. us.CQMk ScatiLMt iWAv§&3Scan5JftmJ&tekft)t . . ^ T T, ...... . ....11,1 - - ■-■ ■!■■.■ SOLTdlB Gdal Tel- r I-'IITR. Ei" 3 XvEEE ,V,Vi\ ilL r LE-5-2-D5LC&V SytrorifE Tech na og y Uh. Showcase wa mZmtdctmz/y cum Uitra’TSS, S how c as 5 , . . m^'Mitr&lsds com* . , U53 instmmcnls, Showcase .... cava tisb nifiuiTCrrtl5.cc m vlrtins Technology Showcase wv#w, . .25 -.--9 TO i ..... i . ro 13 ■ #■■■*§■ 25 73. 79 ......... 73 78 .79 , .79 79 Advertising space ter the issue oi 20 August 2007 may be reserved not taler than 24 July 2007 with Husen International Media - Cam&ntige House - Gagmore Laoe - Chertsey, Sorrey KT16 9AP - England - Telephone 01932 5SA SS9 - Fax 01932 55-I99S - E-mail: Gemx-!7^u,spnffieai5 corn IQ whom all correspondence, copy instructions and artwork should be adoressaa. 1 VIE FOR A CHANGE ll\l DE5IGIXI SUITE 7 i\JEW: Redesigned User Interface includes modeless selection, modeless wiring and Intuitive operation to maximise speed and ease of use, MEW: Design Explorer provides easy navigation, MEW: Simulation Advisor includes reporting on simulation problems with links to detailed troubleshooting information where appropriate. MEW: Trace capability within both MCU and peripheral models provides detailed information on system operation which allows for faster debugging of both hardware and software problems. MEW: Hundreds of new device models including P1C24, LPC2000, network controllers and general purpose electronic components. design inspection tools and cross-probing support to improve quality assurance and assist with fault finding, MEW: 3D Visualisation Engine provides the means to preview boards in the context of a mechanical design prior to physical prototyping. Design From Concept: To Completion labcenter.cam Labcenter Electronics Limited Registered in England 4692454 Electronics E-mail: lnfa@labcBnter.cam Registered Address: 53-55 Main Street. Grassingtnn, North Yorks, UK, BD23 5AA