-£> g V ISP? February 2011 AUS$ 14.50 - NZ$17.50 - SAR 102.95 £4.80 + Telephone-to-VolP Adapter For high-speed telegraphy operators Are you running an infrared temperature? 77 D268 45 1 66 R08 0 2 9 LPC1 1 C2x CAN MCU Series Flash ARM CORTEX-MO SRAM ROM High-speed GPiO (42] 32-hit Timers (2) 16- bit. Timers [2) SPii (2) Systick Timer WDT Power UART PMU, portCf modes. BOD, single Vdd power supply POR 12 MH£„ 1% IRC OSC, Watchdog QSC, 1 ,25 MHz System OSC System P 1 .I- B-e+iflruwl- tO-b'i. ♦ LPCUCi- a tr-i Industry's first integrated CAN microcontroller and transceiver with CANOpen® Drivers. ► Features high-speed CAN transceiver and 32-bit LPC1100 MCU ► Higher code density powered by Cortex-MO ► Superior performance than 8/16-bit microcontrollers ► Enable development of a wide range of industrial networking applications www.nxp.com/microcontrollers Writing your project with mikroC PRO for PIC is piece of cake Useful *»P : of our « V oU buV l t sV stems, V° u set de ve\oprne V comp ,\er r.ts’— _ at RDl5_bit - G1jCD_ -14 bit' r T C D D6 at bit G ' ' t T rn DS at i t G1 BEST SERVED with EasyPIC™6 board Ingredients: 1 x Intuitive IDE I x Powerful ANSI C compiler I I x Software Tools 28 x Hardware Libraries 1 2 x Software Libraries 1 x Comprehensive Help file 1 39 x Ready To Use Examples Preparation: Get mikroC PRO for PIC. Open existing example you wish to start your project with. Include additional libraries and add custom code. Use Free Product Lifetime Tech Support as much as you need. Compile the project. Pour the generated HEX file into the desired microcontroller on EasyPIC6 board and enjoy! MikroElektronika DEVELOPMENTTOOLS I COMPILERS I BOOKS c\\a. v V V v Uv-n \ GET IT NOW www.mikroe.com Communicate Surveys and feedback indicate that Elektor readers expect to find a large variety of articles, viewpoints and tech- nical approaches in the magazine. For this February 2011 edition we have done our utmost to pack the pages ahead of you with a wide variety of topics with a slight accent on communication, our announced theme of the month. Let’s see what’s communicated on communication. A telegram-style explanation is presented on the famous OSI layer model, which is widely used in computers and networks. There’s also a handy VoIP adapter that enables the good old analogue telephone set gathering dust in the cupboard to be used for state of the art VoIP com- munication. The adapter features a USB port for connecting to the computer and is designed to work under Linux. If you like to mess around with old computer gear you’re sure to have fun with the article on a DIY Texting (SMS) gateway based on a scrap PC and a cellphone your spouse or children have classified as ‘RIP’ or ‘unfashionable’. There’s plenty of ICT scrap material around, and it’s often free for collection. Communication at the hands-and-feet level is also covered in this edition with the AlphaLED (Alpha- betLED) letter shaker, a small board that ‘writes’ messages in the air if you wave it. There are a few messages in memory, but you can also create your own words or text by on the fly programming. Finally we have a circuit that bridges 100+ years effortlessly, happily combin- ing Morse (the pundits say CW) with PIC microcontroller technology. The Ulti- mate keyer is for experienced CW fans, maintaining the correct time relations between dots, dashes, words and lines, besides doing a lot more. The project was designed to support the famous Ultimate mode, a system that reduces hand movement on part of the telegraph operator and so allows amazing speeds of up to 100 wpm to be achieved. And more ... just browse this edition because there are many more interest- ing articles I am unable to communicate at the risk of exceeding the 360 word limit the page layout colleagues have communicated over coffee and a piece of OSI cake (page 14). Jan Buiting, Editor 6 Colophon Who’s who at Elektor magazine. 8 News & New Products A monthly roundup of all the latest in electronics land. 14 OSI from ISO “Seven Bridges You Shall Cross” before you can eat your OSI Cake and have it the ISO way. 16 Reradiating GPS Antenna To keep you headed in the right direction, here’s a quick and cheap method to overcome poor GPS signal levels in a car. 18 Gentle Awakenings This circuit has advanced features geared to waking you up ‘sunrise style’. 24 Ultimatic CW Keyer Morse is not dead and this project is for high speed telegraphers having mastered the Ultimatic ‘squeeze’ keying method in combination with a CW paddle. 32 Educational Expansion Board Flexible, multi-talented and versatile are some descriptions that fit this expansion board for our popular ATM18 controller. 38 Geolocalization without GPS WiFi spots and triangulation methods can be used advantageously to pinpoint your position with remarkable accuracy. 43 E-Labs Inside: Here comes the bus (2) The guys at Elektor labs delve deeper into their plans to develop a proprietary bus. 45 E-Labs inside: Design tips for instrumentation amplifiers Input noise and ADC resolution are important considerations in very sensitive measurement systems. V’ Tfi » V 4 1.^ •Jp - i 1 4 02-2011 elektor 5V Pit £M15V C ICI'JIl CONTENTS Volume 37 February 2011 no. 410 18 Gentle Awakenings The light alarm clock described here is built around a microcontroller and can switch and dim an existing lamp (or lamps) fitted with an incandescent bulb (normal or halogen). It has several advanced features and its purpose is to wake you up without a startle. 24 Ultimatic CW Keyer The circuit discussed in this article was developed specially for the squeeze paddle CW key but works great with single lever keys too. It looks after a lot of time related issues such as the pauses between dots and words, fully support- ing the renowned Ultimatic mode. 53 TimeClick TimeClick controls a digital SLR camera without human intervention using a wired connection. It can take photographs at fixed or random time intervals or in response to sensor input, which makes it suitable for various purposes from HDR photography to sound-triggered pictures. 60 Linux’ed Telephone-to-VolP Interface Start phoning with no fears of a massive Telco bill. The powerhouse board de- scribed here works under Linux using the renowned Asterisk IP PBX software, and at a stroke enables you to use your home telephone set (dare we say ‘vin- tage’) to connect to the VoIP world. 48 Contactless Thermometer This thermometer employs an infrared sensor to read an object’s temperature without touching it. 53 TimeClick A controller for sensor, sound or time driven photography at an advanced level. 58 MIAC Controlled Underfloor Heating System A stunning application of Elektor’s Flowcode powered super PLC. 60 Linux’ed Telephone-to-VolP Interface Connect your vintage telephone set to the world of VoIP and start phoning with no fears of a massive Telco bill. 65 AphaLED Shaker This little gadget when shaken prominently shows a letter in the air. 68 How to Get your Own USB ID Less than one LSB of all people designing stuff to work on USB actually manage to get their own ID in chips. 70 TEXT Me! Fromi, PC junkyard An old PC and a surplus cellphone together make your very own text messaging system. 75 Hexadoku Our monthly puzzle with an electronics touch. 76 Retronics: Slide Rules & The Electronic Engineer Regular feature on electronics ‘odd & ancient’. Series Editor: Jan Buiting 84 Coming Attractions Next month in Elektor magazine. elektor 02-2011 5 e ektor international media bv Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. TimeClic ANALOGUE • DIGITAL MICROCONTROLLERS & EMBEDDED J AUDIO • TEST & MEASUREMENT - 4 ft 4 - 1 * wi CM + Telephone- to -VoIP Adapter ktor Geolocalization withoutTGRS Li q lit AlarmCloek Programmed! Sunrise Foi-hlgh-^p^d telegraphy operator « manea&m bi ■ - ■ m&nmm Arc you rurning.no loFr.ire-iJtrtmpf-rjtor-n? i Volume 37, Number 410, February20ii ISSN 1757-0875 Elektor aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+ 44 ) 208 261 4509, fax: (+44) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 11 times a year with a double issue for July & August. Elektor is also published in French, Spanish, American English, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Flettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff Flarry Baggen, Thijs Beckers, Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Design staff Christian Vossen (Flead), Ton Ciesberts, Luc Lemmens.Jan Visser. Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DTP: Ciel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com/subs 6 02-2011 elektor Elektor PCB Prototyper W^ > A professional PCB router with optional extensions! This compact, professional PCB router can produce complete PCBs quickly and very accurately. This makes the PCB Prototyper an ideal tool for independent developers, electronics labs and educational institutions that need to produce prototype circuits quickly. The PCB Prototyper puts an end to waiting for boards from a PCB fabricator - you can make your own PCB the same day and get on with the job. In addition, the PCB Proto- typer is able to do much more than just making PCBs. A variety of extension options are available for other tasks, and a range of accessories is already available. Specifications • Dimensions: 440 x 350 x 350 mm (WxDxH) • Workspace: 220x1 50x40 mm (XxYxZ) • Weight: approx. 35 kg (78 lbs) • Supply voltage: 1 1 0-240 VAC, 50/60 Hz • Integrated high-speed spindle motor; maximum 40,000 rpm (adjustable) • Integrated dust extraction (vacuum system not included) • USB port for connection to PC • Includes user-friendly Windows-based software with integrated PCB software module Ordering The complete machine (including software) is priced at € 3,500 / £3,1 00 / US $4,900 plus VAT. The shipping charges for UK delivery are £70. Customers in other countries, please enquire at sales@elektor.com. Further information and ordering at www.elektor.comlpcbprototyper Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form. Head Office: Elektor International Media b.v. P.O.Box ii NL-6114-ZC Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Distribution: Seymour, 2 East Poultry Street, London ECiA, England Telephone:+44 207 429 4073 UK Advertising: Elektor International Media b.v. P.O.Box 11 NL-6114-ZC Susteren The Netherlands Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 Email: t.vanhoesel@elektor.com Internet: www.elektor.com Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Elektor International Media b.v. and may not be reproduced or transmit- ted in any form or by any means, including photocopying, scan- ning an recording, in whole or in part without prior written per- mission from the Publisher. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities. The Publisher cannot guaran- tee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media b.v. 2010 Printed in the Netherlands elektor 02-2011 7 NEWS & NEW PRODUCTS External 48 & 60 watt power supply series meets latest energy standards XP Power recently announced the launch of the highly efficient single output AFM series of 48 & 60 watt external AC-DC power sup- plies designed for a wide range of IT and medical equipment. The ranges offer out- put voltages of 12, 15, 18 and 24 VDC. Offering a typical efficiency of up to 88%, these highly efficient units meet the lat- est stringent energy efficiency standards such as Energy Star Level V, EISA2007 and CEC2008 in the United States and the ErP Directive for Europe. These standards define the average energy efficiency and the max- imum no load power consumption. The AFM45 has a no load power consumption of less than 0.3 W, and the AFM60 less than 0. 5 W. In addition, the AFM series comply with the internationally recognized safety approval standards for IT and commercial equip- ment IEC60950-1 / UL60950-1 / EN60950- 1 . They also comply with the IEC60601 -1 / UL60601 -1 / EN60601 -1 medical safety standards. The units offer multiple input cable inter- face options allowing designers to specify either IEC320-C1 4, -C6 or -C8 connectors. The -C8 option provides a Class II grounding method. An optional cable restraining clip is also available. XP Power is an Energy Star partner and has an approved certification facility that allows in-house testing for compliance to the energy efficiency standards. To help designers keep up to date with the changing energy efficiency legisla- tion, XP Power provides a number of useful resources and information on their web site. In addition, XP Power applications and sup- port staff can assist customers in under- standing the various ‘green’ initiatives. The AFM series is available from Farnell or direct from XP Power. The units have a 3 year warranty. www.xppower.com (100820-IX) Smart current sink LED backlighting platform Semtech Corp. recently announced the industry’s first smart current sink LED back- lighting platform with on-chip digital light- ing effects for high-end handheld displays. This new platform incorporates Semtech’s patent-pending, smart Automatic Drop- out Prevention (ADP) technology to enable a new-generation of high-quality current sink drivers that can replace boost convert- ers and charge pumps in high-end hand- helds, while providing high-quality display backlighting. The new SC667 and SC668 current sinks with ADP technology reduce the total parts count and extend battery life compared to boost converters or charge pumps, and offer far superior illumination quality compared to conventional current sink drivers. Additionally, on-chip digital lighting effects provide the flexibility to incorporate fade, breathe and blink effects without changing the firmware. White LEDs used in backlighting applica- tions typically have a forward voltage up to 3.6 V. When the battery voltage declines in portable devices, the supply voltage must be boosted to ensure the white LEDs have sufficient voltage to illuminate the display. Charge pump or inductive boost converter devices have typically been used to provide this voltage boost function. In an effort to maintain constant output power, these cir- cuits increase current draw as the battery voltage declines, shortening battery life. Improvements in white LEDs have resulted in forward voltages as low as 3.0 V, reduc- ing the threshold at which conventional LED drivers need to boost the battery volt- age. Because of this, LED backlight driv- ers increasingly are operating in a non- boost mode, making current sink drivers an attractive alternative. Current sink driv- ers eliminate the capacitors and inductor associated with the boost circuitry, reduc- ing component count, board size and sys- Smart LED Backlight Drivers for High-End Handhelds tern cost, with the added benefits of elimi- nating any switching noise and extending operating time. The SC667 and SC668 are the first current sinks to incorporate ADP technology. These devices also integrate a number of functions to enable high-end features on portables, including an ambient light sensing/control circuit that sets backlight brightness based on surrounding lighting conditions. A PWM dimming interface that incorporates a dig- ital low-pass filter is also included, provid- ing the capability to perform content-adap- tive brightness control (versus ‘always-on’ illumination). The SC668 provides eight current sinks, while the SC667 features seven current sinks plus an interrupt request indicator sig- nal to tell the host processor when an ambi- ent light threshold has been crossed. Both devices include an on-chip digital lighting- effects engine to control LED fade-in/fade- out, breathe, blink, auto-dim full, and auto- dim partial; an PC interface to program and control the LEDs; and four programmable, 200 mA low-noise LDO regulators to man- age the power for multiple embedded peripherals. Key Features of the SC667 and SC668 include • Patent-pending Automatic Dropout Pro- tection (ADP) technology • On-chip digital lighting effects (fade, breathe, blink) without changing firmware • Ambient light sensing option can auto- matically adjust backlight brightness • Low parts-count: only one low-voltage capacitor needed, no inductor required • I2C programming interface (fast and 8 01-2011 elektor standard modes) • ±0.5% (typ.) LED current matching, ±1 .5% (typ.) LED current accuracy • Four low-noise LDO regulators • Ultra-small, low-profile 20-pad MLPQ package with exposed thermal pad: 3 x 3 x0.6 mm The SC667 and SC668 are available imme- diately in production quantities. www.semtech.com (100820-X) MEMS oscillator covers 1 MHz to 800 MHz frequency range IQD has announced immediate availability of a newly developed high frequency MEMS Oscillator on the opening day of Electron- ica 2010. The new IQMS-900 series MEMS (Micro Electro Mechanical Systems) oscilla- tor is available in an exceptionally wide fre- quency range from 1 MHz up to 800MHz. The new model can be factory programmed with either a LVDS (low voltage differential source) or LVPECL (low voltage positive emitter coupled logic) output. The plastic packaged IQMS-900 series is available in two sizes: either a 7 x 5mm or the increasingly popular 5 x 3.2mm. Due to its MEMS technology design, phase jitter is low being typically 0.7 ps at 200 MHz. Two supply voltages are available, 3.3 V & 2.5 V. Frequency stabilities can be specified at either ±1 0 ppm over an operating tempera- ture range of 0 to +70 degrees C or ±1 5 ppm over -40 to +85 degrees C. MEMS technology is based upon the pro- cess techniques of CMOS (Complemen- tary Metal Oxide Silicon) and as such can be produced on standard production lines in foundries that are more used to produc- ing standard or custom integrated circuits. This of course lends itself to the ability of producing product in vast quantities at an economic rate. The IQMS-900 range is eminently suitable for the incorporation into infrastructure equipment where it will provide very accu- rate timing processes coupled with the abil- ity to drive the very latest high-speed pro- cessors that will enable the transfer of high data rates — the fast rise and fall times con- tribute to this. Typical applications include Fibre Channel, Ethernet 1 0G, HDMI, SATA / SAS&USB3. www.iqdfrequencyproducts.com (100820-XI) Advertisement THE ORIGINAL SINCE 1994 PCB-BDIL Servicing Your complete PCB prototype needs. iffy 8 hour prototype service 1 mm material now available Free Laser $MT Stencil with all PCB prototype orders pcb-pool.com 1 PSfpW slfflw '.a Email* safe Phone UK: ► ‘pool.com 389 8560 REFLOIAMUI accessories r.renow-Kir.CL Supported File Formats On ArTwhrj PULSONIX e-co.iioo* Easy. PC ■ill LA YD elektor 01-2011 9 NEWS & NEW PRODUCTS Factory modification services for enclosure panels Standard front panels for enclosures and sub racks, typically conforming to sizes specified in international standards, are produced by many companies, giving users ready availability and a wide choice of suppliers. All such panels have one thing in common; they will usually need to be modified to suit the application before they can be used. Vero Technologies offer a rapid turn-round factory customisation service for its own manufactured panels, a modification service for panels from other suppliers and bespoke panel fabrication to customer drawings with a maximum size of 480x400 mm. Panels can be punched, drilled, multi-colour screen-printed, engraved, engraved with a coloured infill, fitted with polyester over- lays, rebated to accept a flush-fitting mem- brane keypad and fitted with EMC gaskets. Conductive and non-conductive finishes, to both sides or just to the rear can be pro- vided orthe panels can be painted. Cutouts can be within 1 mm from the panel edge without distortion by using laser machin- ing or extend through the edge by using three-dimensional CNC machining, ena- bling rebates and apertures to be created. Both plastic and metal panels can be modi- fied; plastic panels and enclosures can be moulded in custom colours. Specialist fin- ishes can be applied to give EMC/RFI pro- tection or anti-bacterial capability for use in medical instrumentation. Card mounting brackets, conductive and non-conductive fixings, handles, gaskets and sealing strips can all be supplied to meet specific project requirements. www.verotl.com (100820-XII) 100-watt low profile PCB-mountable power supplies Power supply expert TDK-Lambda France has upped the output power of its ZPSA series of compact PCB-mountable AC-DC power supplies with the introduc- tion of a 100 watt model. The new single- output ZPSA1 00 accepts a wide input volt- age range, has a very low profile (26.6mm) and industry standard footprint (127 x 76.2 mm), making it an ideal choice for applications such as LED signage and light- ing, point-of-sale equipment, datacom, video/audio routers and test & measure- ment equipment. These 1 00-Watt supplies are available with the most popular single output voltages from 5V to 48Vdc. Offering a typical effi- ciency of up to 90%, these models are well- suited for operation in both convection or customer air cooled environments from 0°C up to 70°C, with appropriate derating. A green LED is provided as an indicator that the power supply is on, and other standard features include overvoltage and short-cir- cuit protection. These supplies are offered in an open-board configuration with Molex input/output connectors. Accepting a wide input voltage range of 90-264 VAC (47-440 Hz) or 1 20-370 VDC, the ZPSA1 00 series is ready for use globally with no further configuration or input selec- tion. Its industry standard footprint makes it an ideal choice as a drop-in replacement for existing supplies, while its low profile means that it can be installed in the most compact of applications. TDK-Lambda’s ZPSA1 00 series is approved to national and international safety approv- als, including IEC/EN/UL/CSA60950-1 (edi- tion 2) meets conducted and radiated EMC requirements of EN55022-B and FCC Class B (without additional filtering or compo- nents) and meets EN61 000-4 immunity specifications for greater reliability. All mod- els in the ZPSA1 00 series carry the CE mark, according to the LV Directive, and come with a two-year warranty. www.uk.tdk-lambda.com/zpsa (100820-XIII) WLCSP 2.4 GHz chips target space-constrained sports, fitness, and health applications Ultra low power (ULP) RF specialist Nordic Semiconductor ASA (OSE: NOD) recently announced that it is to expand its exist- ing 2.4 GHz RF and ANT™ product line- ups in Q1 2011 with a new set of ultra miniaturized, wafer-level chip scale pack- age (WLCSP) options designed to meet the highly space-constrained needs of both existing and emerging sports, fitness and health applications such as wireless watches, bike computers, sensors, hearing aids and other devices designed to be worn on or near the body. Sampling in Q1 201 1 and available for vol- ume orders in Q2 201 1 will be the nRF24AP- 2WLCSP (1- and 8-channel) and nRF24LE1 WLCSP (Flash or OTP) options. The new 1 - and 8-channel nRF24AP2 WLCSP package options will represent the world’s small single chip ANT solutions (nRF24AP2- 1 CHC32 and nRF24AP2-8CHC32) featuring 400pm pitch (regular array) 32-ball BGAs with a thickness of 0.5 mm and a flat foot- 10 01-2011 elektor NEWS & NEW PRODUCTS print area of just 2.6 x 2.7mm (7 mm 2 ) that is over 5x smaller than the footprints of competing 6x6 mm (36 mm 2 ) packaged products. The new nRF24LE1 WLCSP option (Flash or OTP) will again be a 400pm (regular array) 32-ball pitch BGA measuring 2.7 x 2.7 (7.3 mm 2 ) in footprint area for the Flash ver- sion and 2.6 x 2.7 (7 mm 2 ) for the OTP ver- sion. Both devices are 0.5 mm in thickness. www.nordicsemi.no (100926-I) RAP for ADAM mobile robot RMT Robotics® a Cimcorp Oy company, launches ADAM RAP (Reactive Audio Play- back). The programmable sound system, designed exclusively for the RMT Robotics ADAM (Autonomous Delivery and Manip- ulation) mobile robot, includes interac- tive voice messages and a mobile “vehicle in motion” jukebox for every mood and season. “In developing the ADAM RAP module, we wanted to create a new ‘vehicle in motion’ function that not only improves safety but leverages the power of the ADAM plat- form to enhance the interactive experience between humans and the mobile robots that they work with every day,” said Bill Tor- rens, Director of Sales & Marketing for RMT Robotics. AGVs have a standard beeper-based ‘vehicle in motion’ alert system which is mandated by most international safety standards. In most operations however, noise prolifera- tion combined with the monotonous beep of vehicles tends to diminish the alertness of workers with constant exposure. An enhanced audio system that could gener- ate a variety of sounds and automatically associate these sounds with vehicle position or function would dramatically improve the effectiveness of the warning system. RMT Robotics developed the ADAM sound application to play ‘text to speech’ mes- sages, sound bites or musical interludes through its mobile robot that can be either actively or passively triggered in reaction to a variety of operational conditions and system inputs. Through the ADAM Com- mander mapping software, regions on the facility map can be embedded with commands to automatically load specific tunes or prompt a series of voice mes- sages. For example, ADAM may play a song in the aisle ways and then switch to a text to speech-based message saying, “Excuse me I am coming through” as it approaches the region of a doorway. After successfully moving through the doorway, ADAM will automatically revert to playing the original song. ADAM RAP also has the ability to react to inputs. As another example, if a worker (or object) is fully obstructing the doorway and ADAM is unable to reconcile an alternative path, ADAM will politely enunciate, “Please move, I cannot get around you.” As another example, if the emergency stop button is pressed, ADAM will state, “My emergency stop has been pressed,” or if the Enter Desti- nation button is pressed on the vehicle key- pad, ADAM will state, “Thank you, see you later” before proceeding on its mission. “Now that ADAM can “speak” and interact with workers, there is an improved harmo- nization between the work force and the robots that serve them,” says Torrens. “The fact that ADAM can also entertain while enhancing safety and efficiency in the pro- cess is an added bonus.” www.rmtrobotics.com (100926-II) Contactless sensing for 360° navigation in human-machine interfaces austriamicrosystems has announced the AS5013, a contactless magnetic encoder 1C that monitors the displacement of a magnet incorporated in a knob relative to its centre position and provides x and y position information via an l 2 C interface. The AS5013 Hall-sensor 1C is used in the EasyPoint (TM) module, which consists of a mechanical stack incorporating a naviga- Advertisement PROTO-PIC UK based suppliers of . . . sparkfun FEZ ARDUINO mbed LilyPad XBee GHI adafruit industries To claim your free shipping (UK mainland only) use voucher code 'elektor' at checkout +44 ( 0 ) 1592 572092 elektor 01-2011 11 NEWS & NEW PRODUCTS iPad app for Engineers Apple brought a whole new format to the world of personal com- puting when they intro- duced the iPad. The handy tablet computer can be taken anywhere and the interactive touch screen makes it dead easy to use. Add to that the convenience of the thou- sands of downloadable software apps available to solve real-world prob- lems the iPad can be with- out doubt a very useful tool. Elektor have added another to the firmament of apps with their ‘Elektor Electronic Toolbox’. This one should be indispensable to engineers and hobbyists alike. It comprises 28 applications, any one of which can be selected from the opening screen. The app contains a data bank of over 45,000 electronic compo- nents, including bipolar transistors, FETs, triacs, thyristors, diodes and ICs. A component can be selected from the lists in different categories on the left hand side of the display. As usual for iPad you can drag your finger to scroll through the list and select a component by tapping the screen whereupon the pin-outs and important electrical characteristics appear on the right side of the display. All data is contained in the app so an internet connection is not necessary. Also included is a special data bank containing pin assignments of the majority of connectors used in the fields of audio, video, computer and telephone engineering. To add to that an interactive component calculator is included which simplifies the design of resistive circuits (series, parallel, bridge), high and low pass filters (R/C, R/L and L/C) and transistor circuits (with base resistor values and voltage divider calculations). The ubiquitous NE555 is also included as a basic circuit building block as are all the characteristics of the differ- ent colour LEDs. The electronic toolbox not only provides assistance in component selection but also supports some engineering design activities. For example circuits often require a regulated DC linear power supply and this app has all the tools necessary to make the job a cinch. Other useful tools include a virtual resistor colour-code clock, units of measurement converter, circuit diagram symbol data bank plus much more. The Elektor Electronic Toolbox can be downloaded from the Apple iTunes Store for just $4.99. Go to the apps web page for more information. UK & European readers: http://apps.elektor.com/Toolbox/?c=en&d=3&l=en US & Canada readers: http://apps.elektor.com/Toolbox/?c=us&d=3&l=en tion knob, a magnet and the AS501 3 mag- netic encoder 1C. Its simple construction and contactless sensing technology give the module very high reliability and is designed for any kind of 360° navi- gation input device. The AS501 3 is a complete Hall-sensor 1C for human-machine interface (HMI) applications requiring low power. This simplifies software integration chal- lenges for joystick navigation in prod- ucts such as cell phones and other handheld devices, e.g. MP3 players, PDAs, GPS receivers, Digital Still Cam- eras, gaming consoles, and remote controls. The AS5013 single-chip 1C includes user-selectable power-sav- ing modes, 5 integrated Hall sensing elements for detecting up to ±2 mm lateral displacement, a high-resolution analogue-to-digital converter (ADC), an XY coordinate and motion detection engine, and a smart power management control- ler. The XY coordinate registers and mag- EasyPoint™ AS5013 2D Linear Magnetic Encoder for Mini Joysticks High reliability: contactless sensing Full 360° navigation ^ I v" ij austfiamicrosystems fftspstort? J.1 imktg face to the host processor. The HMI device also provides two interrupt modes (motion detect, data ready) and two operating modes: idle mode, with less than 3 pA current consumption, and low-power mode, with selecta- ble readout rate. The low-power AS501 3 operates over a power sup- ply range of 2.7 to 3.6 V, and down to 1 .7 V peripheral supply voltage. Specified over an operating temper- ature of -20 to +80°C, the AS5013 Hall-sensor 1C operates from a 3.3 V power supply and is offered in a 1 6-pin 4 x 4 x 0.55 mm QFN package. The EasyPoint (TM) module is available as small as 8 x 8 x 1 .5 mm. netic field information for each Hall-sensor element are transmitted over the l 2 C inter- www.austriamicrosystems.com/ AS5013/Hall-sensor-IC (100926-VI) 12 01-2011 elektor QUASAR electronics The Electronic Kit Specialists Since 1993 Quasar Ele PO Box 693 CM23 4WP, Tel: 01279 * Fax: 01279 E-mail: sale Web: www. ctronics Limited 5, Bishops Stortford United Kingdom 167799 267799 !S@quasarelectron quasarelectronics. VISA 01279 Postage & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7 Day Delivery - £4.95; UK Mainland Next Day Delivery - £1 1 .95; Europe (EU) - £1 1 .95; Rest of World - £1 2.95 (up to 0 5Kg) SOrder online for reduced price UK Postage! We accept all major credit/debit cards. Make cheques/PO’s payable to Quasar Electronics. Prices include 17.5% VAT. Please visit our online shop now for details of over 500 kits, projects, modules and publications. Discounts for bulk quantities. eurocafo MasterCard Electron Credit Card Motor Drivers/Controllers ■ Controllers & Loggers i+I+I+M Here are just He da re are just a few of the co ta acquisition and control units we have. a few of our controller and driver modules for AC, DC, Unipolar/Bipolar stepper motors and servo motors. See website for full range and details. for all units: Order Code PSU445 £7.95 ?+T+T+T+T+T+T+'! it+t+f+t+t+tJS’+t+l: m See website fo ntroller and SIS! full details. Suitable PSU Computer Controlled / Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vdc 5, 6 or 8-lead unipolar stepper motor rated up to 6 Amps. Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode for CNC use. Connect up to six 3179 driver boards to a single parallel port. Board supply: 9Vdc. PCB: 80x50mm. Kit Order Code: 3179KT - £15.95 Assembled Order Code: AS3179 - £22.95 Computer Controlled Bi-Polar Stepper Motor Driver Drive any 5-50Vdc, 5 Amp bi-polar stepper motor us- ing externally supplied 5V levels for STEP and DI- RECTION control. Opto- isolated inputs make it ideal for CNC applica- tions using a PC running suitable software. Board supply: 8-30Vdc. PCB: 75x85mm. Kit Order Code: 3158KT - £23.95 Assembled Order Code: AS3158 - £33.95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32Vdc, 10A) in both t the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166v2KT - £22.95 Assembled Order Code: AS3166v2 - £32.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15Vdc. Box supplied. Dimensions (mm): 60Wx100Lx60H. Kit Order Code: 3067KT - £18.95 Assembled Order Code: AS3067 - £26.95 Most items are available in kit form (KT suffix) or assembled and ready for use (AS prefix). 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay outputs. 4 isolated digital inputs. Useful in a variety of control and ■sensing applications. Con- trolled via serial port for programming (using our new Windows interface, terminal emula- tor or batch files). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £69.95 Assembled Order Code: AS3108 - £84.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located 200m+ from board. Wide range of tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £19.95 Assembled Order Code: AS3145 - £26.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £49.95 Assembled Order Code: AS3180 - £59.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. Not BT ap- proved. 130x110x30mm. Power: 12Vdc. Kit Order Code: 3140KT - £74.95 Assembled Order Code: AS3140 - £89.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m+ range. 112x122mm. Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £59.95 Assembled Order Code: AS3142 - £69.95 New! 4-Channel Serial Port Temperature Monitor & Controller Relay Board 4 channel computer serial port temperature monitor and relay con- troller with four inputs for Dallas DS18S20 or DS18B20 digital ther- mometer sensors (£3.95 each). Four 5A rated relay channels provide output control. Relays are independent of sensor channels, allowing flexibility to setup the linkage in any way you choose. Commands for reading temperature and relay control sent via the RS232 interface using simple text strings. Control using a simple terminal / comms program (Windows HyperTerminal) or our free Windows application software. Kit Order Code: 3190KT - £69.95 PIC & ATMEL Programme We have a wide range of low cost PIC and ATMEL Programmers. Complete range and documentation available from our web site! Programmer Accessories: 40-pin Wide ZIP socket (ZIF40W) £14.95 18vdc Power supply (PSU120) £19.95 Leads: Serial (LDC441) £3.95 / USB (LDC644) £2.95 mm USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP software. Wide range of supported PICs - see website for complete listing. ZIF Socket/USB lead not included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £49.95 Assembled Order Code: AS3149E - £59.95 USB 'All-Flash' PIC Programmer USB PIC programmer for all ‘Flash’ devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included. Assembled Order Code: AS3128 - £49.95 See website for full range of PIC & ATMEL Programmers and development tools. www. quasarelectronics. com Secure Online Ordering Facilities • Full Product Listing, Descriptions & Photos • Kit Documentation & Software Downloads COMPUTERS OSI from ISO Seven layers is all it takes As with any structured approach to such a problem it would be best to identify and divide the job into manageable tasks. Pro- cesses to deal with error control and data packet addressing for example can be eas- ily defined. Some of the lower level tasks would be concerned with details of the physical transfer of bits over the medium while other higher level tasks would deal with the interface to the application soft- ware. In between the data would pass through a series of intermediate processes. This gives rise to a functional hierarchy of the program structure which Elektor edito- rial team have chosen to illustrate using this seven-layered cake. Now we come to the International Organi- zation for Standardization (ISO) which as Physical Radio, optical or cabled, it doesn’t matter which medium you use, this layer defines how a digital 0 and 1 is represented in the media so that transmitter and receiver can communicate with one another. Data link This layer is responsible for detecting corruption of the trans- mitted message. The interference may come from an external source or from more than one transmitter talking at the same time on the network (data collision). Techniques such as data packetisation, message headers, checksums and CRC algo- rithms all help here. Network This layer ensures that each packet arrives at the correct re- ceiver. In larger networks there may be a hierarchy of network nodes relaying the data packets. Similar to how a postal ad- dress and code uniquely identifies a delivery address, the des- tination address is comprised of several fields e.g. a series of characters or character sequence. M 02-2011 elektor COMPUTERS When computers communicate it’s important that messages are exchanged reliably, efficiently and securely (to protect against eavesdropping). To build such a complex communication protocol from scratch represents more than a weekend’s work for sure. usual has a thing or two to say about techni- cal standards. At the beginning of the 1 980s they released the OSI layered model (Open Systems Interconnection Model) which sub- divides such a communication system into seven distinct ‘layers’. When all the inter- faces are strictly adhered to (i.e. the func- tion of each layer and the data between the layers) it is possible to substitute a layer from one implementation of the standard model to another without problem. This promotes the concept of interchangeable software building blocks which can simply be linked to fulfil a particular communication require- ment. A similar model called TCP/IP uses fewer layers and is responsible for data trans- fers most notably over the internet. (100781) Transport This layer checks that all the packets have arrived correctly. Packets can be dropped when net nodes are overloaded. A resend request can be issued if an error is detected. The basic requirement is that communication occurs in both directions. Protocols such as TCP build a logical connection between the transmitter and receiver. Session This layer ensures that a ‘discussion’ between the transmitter and receiver can be successfully concluded, even if the ses- sion is interrupted. When interruption occurs (for whatever reason) it ensures that the exchange does not need to start from the beginning again. Presentation This layer deals with the details of formatting and encrypting data for transmission over the network. Application This layer forms the interface between the user software and the network providing application facilities for file transfer, email and other network services. Protocols such as HTTP and SMTP, used by the World Wide Web (e.g. to transfer emails) are implemented in this layer. elektor 02-2011 15 MINI PROJECT Reradiating GPS Antenna Banish poor reception in (cars By Ton Giesberts (Elektor Labs) 7 ; * * * * ' * A portable navigation system often suffers from poor reception when used inside a car. This can easily be improved with the help of an active antenna and the mini circuit described here, which doubles as the battery charger. The signal strength of a portable navigation system such as a TomTom, a Garmin eTrex or a PDA/mobile phone with built-in GPS- receiver is often poor inside a car because of the metal coating which is often applied to the windscreen of a modern car. A possible solution is an active, external antenna. This type of antenna is available in all sorts of shapes and sizes. However, many portable GPS-receivers do not have a connection for an external antenna (any more); PDAs are not all that likely to have one either. In order to provide a navigation system without an external antenna connection with a stronger satellite signal, it is possible to use a so-called re-radiating antenna. A loop antenna is installed either in, behind, or in front of the navigation system (depend- ing on the position of the receiving antenna inside the navigation system) which then re- radiates the received and amplified GPS sig- nal from an active antenna mounted on the outside of the car. In this way the navigation system is still able to receive a sufficiently large signal so that it can function properly. For this design we only need a commer- cial active GPS antenna and a tuned cir- cuit which will re-radiate the output signal that is available on the connector at the end of the active antenna cable. In addi- tion, we require a regulated power supply for powering the active GPS antenna. And while we have one of those, we could, at the same time, also use it to charge/power the navigation system or PDA while in the car. The circuit is so small that all of it is easily accommodated on a small piece of proto- typing board of a few square centimetres. The circuit basically consists of a standard application forthe LM31 7 voltage regulator (C3 for less noise and higher ripple/interfer- ence suppression) and a pass-through cir- cuit for the signal from the active antenna to the antenna which will be mounted near the navigation system. A loop antenna is used forthe radiating element. This is made from a sturdy piece of enamelled copper wire soldered to the prototyping board on which the remainder of the circuit is built. The wire is 19 cm long, equal to the GPS signal’s wavelength. It is normally recom- mended to keep the loop between 1/8 and 1 / 4 of the wavelength to prevent self resonance. But with a larger dimension it is easier to bend it into a shape that suits the GPS receiver better (the loop has to be positioned near the location of the internal antenna). The power supply for the active antenna is first RF decoupled with R4 and C5/C6. R4 is Figure 1 . The schematic for the circuit: a voltage regulator and an antenna circuit which re-radiates the GPS signal from an active antenna. 16 02-2011 elektor a normal, through-hole resistor which is mainly used as an induc- tor. By keeping the value of R4 low, the voltage drop across it is kept as small as possible. LI decouples the active antenna signal from the power supply voltage. LI is an air-cored coil, made by wind- ing a few turns (6 or so) around a small diameter drill bit (diameter 5 mm). Keep the individual turns apart by at least the thickness of the wire used (for example 0.5 mm CuL). This is to minimise the internal capacitance. A standard 1 00-pF-capacitor is used to cou- ple the signal from the active antenna to the loop antenna. None of this is very critical. The photo shows the assembled prototype. The circuit was found to work superbly. We have tested it within the thick walls of our castle with, among others, a Pocket PC Mio P350. This had no reception inside the building, but by placing it next to the loop antenna it was able to find six satellites quite quickly. The active antenna was placed near a window. The 5-V voltage on K2 can be used as the power supply for the Pocket PC (or GPS receiver or some other device with GPS functionality). This is often a mini-USB connector which is also intended for charging the battery. Fuse FI is there for safety, so that when experiment- ing you will not easily blow one of the car’s fuses. In our proto- type, the power consumption (without load on l<2) amounted to just below 28 mA. There appears to be no standard for the connector at he end of the cable of the active antenna. The same antenna is often available with different types of connectors. For testing we used an older type made by Trimble (39265-50) which has 5 meters of cable and an MCX connector. There are also active antennas with SMA, SMB, etc. So before you buy an active antenna, check that you can also obtain the corresponding chassis-mount connector. ( 100808 - 1 ) AFFORDABLE EXPERTISE THE PC OSCILLOSCOPE RANGE FROM PICO TECHNOLOGY BANDWIDTH 20 MHz to 12 GHz SAMPLING RATES 50 MS/s to 5 GS/s MEMORY 8 kS to 1 GS RESOLUTION 8 to 16 bits PRICES £125 to £6995 Latest Software Updates: l 2 C & CAN bus decoding, mask limit testing, advanced triggers, digital low pass filtering, rapid triggering www.picotech.com/scope2034 elektor 02-2011 17 HOME & GARDEN By Aike Terjung (Germany) In the natural world, our biological clocks are controlled by daylight. The light alarm clock described here imitates a natural sunrise to wake you gently from your slumbers in a natural manner. Start your day better by waking to the light instead of that horrid alarm clock. Features • Output connector for one or more dimmable 230 V / 115 V lamps (80 W max.) • DCF77 radio time synchronisation • Touch sensor for switching off the alarm • ATmegai68 microcontroller • PCB and programmed microcontroller available from Elektor • Firmware and source code available free from Elektor • Can also be used on 115 V power grids We all know the unpleasant feeling of being rudely awak- ened from our sleep by the buzzing, beeping or ringing of an alarm clock. This often happens when you’re in deep sleep, which frequently results in not feeling properly awake or groggy the whole day long. However, it doesn’t have to be this way. If you sleep in the summer with the win- dows unobstructed, you often awaken spontaneously when it becomes light outside. When you awaken in this natural, gentle manner, you also feel much better, and this feeling often persists all day. Obviously, it would be better to start your day with a simulated sunrise if the real thing isn’t available. Light and time The light alarm clock described here is built around a microcontroller and can switch and dim an existing 230 -V lamp (or lamps) fitted with an incandescent bulb (normal or halogen). Although it might seem more log- ical to use power LEDs, there are good rea- sons for using an incandescent lamp. Aside from low cost (money and effort) and the possibility of using a lamp you already have on hand (such as a bedside lamp), the col- our characteristics of incandescent lamps are better for this purpose. The colour of the light from an incandescent lamp var- ies when it is dimmed, gradually changing from a strong red hue to nearly white as the brightness is increased. This is similar to what happens at sunrise, and in any case it is more attractive than what you see with an LED dimmed under PWM control. If you wanted to simulate this effect with LEDs, you would have to use RGB LEDs or LEDs with several different col- ours. Things would be even more complicated if you also wanted to be able to continuously vary the brightness. The power savings that could be achieved by using LEDs are anyhow very limited because the alarm clock does not keep the lamp lit for hours on end. In addition to a lamp, the light alarm clock naturally needs to know what time it is. A DCF 77 receiver module is a good solution here, since it allows us to use a fairly sim- ple, software-controlled time base in the microcontroller. There’s no need fora real- time clock, since the microcontroller clock frequency (controlled by an external quartz crystal) is sufficiently accurate to allow it to manage for several hours without a proper DCF 77 radio signal. 18 02-2011 elektor HOME & GARDEN Sensor buttons and dimmer There’s more to the alarm clock circuit than just a microcontroller. A display and buttons are necessary for the user interface. In the schematic diagram (Figure 1) of the alarm clock, you can right away see that the user interface takes the form of an inexpensive (and ubiquitous) LCD module with two lines of 1 6 characters (LCD1 ) along with four pushbutton switches (S1-S4), which are connected to the main circuit board (Figure 2) by plug-and-socket connec- tors (l<7 and K8) and a length of 5-way cable if necessary. Each switch pulls an I/O pin of the ATmega168 (IC2) to ground. Pull-up resistors (R7-R10) provide defined high levels when the switches are in the quiescent state. Table 1 . Touch sensor functions State Touch duration Action Display backlight off < 1 second Switch on display backlight for 1 minute Lamp off; alarm not active > 3 seconds Switch on lamp at full brightness Lamp on (including alarm phase) > 3 seconds Switch off lamp Wake-up alarm < 1 second Switch off alarm (with optional snooze function) The alarm clock is controlled by five but- ton functions in total. The fifth ‘button’ is a capacitive sensor based on an idea described on a German microcontroller forum I 1 !. The sensor consists of a metal- lic surface connected to the Sensor input (near R13), which is connected to an I/O pin (PC5) of the ATmega microcontroller via R13 and a protection network consist- ing of D2, D3 and R1 5. The microcontroller firmware (written in C in the WinAVR devel- opment environment) periodically switches the output of this pin from logic 1 (High) to logic 0 (Low) and then repeatedly samples the level on the I/O pin while it is returning to the High level. The capacitance of the signal line and the connected metallic sen- sor surface is charged via resistor R1 5, and the logic level changes back to logic 1 when the voltage crosses the switching threshold. The software can determine the capaci- tance of the sensor circuit connected to the I/O pin by measuring how long this pro- cess takes. If you touch the sensor surface, the capacitance increases and the charging time increases accordingly. The author used the aluminium front panel of his light alarm clock as the sensor surface. +5V +5V Figure 1. The circuit of the light alarm clock essentially combines the functions of a dimmer controlled by a microcontroller and a timer clock. Both of these functions are implemented in microcontroller firmware. elektor 02-2011 19 HOME & GARDEN COMPONENT LIST Resistors R1 ,R2,R7,R8,R9,R1 0,R1 2,R20 = 1 0kn R3,R17 = 470a R4 = 330^ R5 = 1.5kn R6 = 1 5£1 R11 = 4.7ft R13 = 100ft R14 = 6.8kft R1 5,R21 =100kft R16,R19 = 1kft R18 = 22ft PI = lOkft trimpot Capacitors Cl ,C6,C7,C9,C1 0 = 1 0OnF, ceramic, lead pitch 5mm C2,C3 = 1 5pF 2 %, ceramic, 5mm lead pitch C4 = 1 0OnF, X2 class, 275VAC rated, 1 5mm lead pitch, 5mm wide C5,C1 1 =220pF 25V radial, 3.5mm lead pitch C8 = 22pF 35V, radial, 2.5mm lead pitch 0 2,03,04,0 5, Cl 6 = 10nF ce- ramic, 5mm lead pitch Inductors LI = 1 0OptH 5.4Atriac suppressor coil (e.g. Murata Power Solu- tions type 1 41 0454C) Semiconductors D1 = 1 N4004 D2,D3,D4 = 1 N4148 D5 = LED, low current, diam. 5mm, Kingbright type L-53LSRD B1 = 40V 1 .2A bridge rectifier, Se- mikron type SKBB40C1 500L5B T1 ,T2 = BC547B T3,T4 = BC639 TRI1 = BTA1 6-600BW (e.g. STMicroelectronics BTA16-600BWRG) IC1 = LM2940CT-5.0 (National Semiconductor) IC2 = MOC3023 (Fairchild) IC3 = ATmega168-20PU, programmed, Elek- tor# 080850-41* Miscellaneous K1 ,l<2 = 2-way PCB terminal block, lead pitch 7.5mm (0.3 in.) K3,K4 = 4-pin SIL pinheader, 0.1 in. pitch l<5 = 2-pin pinheader, 0.1 in. pitch l<6 = 6-pin (2x3) pinheader, 0.1 in. pitch K7,K8,K9 = 5-pin SIL pinheader, 0.1 in. pitch LCD1 = 16-pin SIL pinheader, 0.1 in. pitch SI ,S2,S3,S4 = pushbutton, SPNO, e.g. Multi- comp MCDTS6-5N XI = 1 0MFIz quartz crystal, HC-49/S case, 50ppm, 1 2pF load capacitance, e.g. AVX HC49SFWB1 OOOOHOPESZZ) FI = fuse, 2.5A slow, 5x20 mm, with PCB mount holder and protective cap TR1 = power transformer, 2x8 V sec. 2x1 1 5 V prim., 1.5VA(e.g. Block AVB 1. 5/2/8) or 1x9 V sec., 1x230 V prim., 1 .5VA (e.g. Block VB 1. 5/1/9, see text) LCD1 = 2 x 16 characters (DEMI 621 7), e.g. Elektor# 03045 1-72 Piezo buzzer, e.g. Kingstate KPEG827, or 8 ft loudspeaker (min. 0.1W) PCB #080850-1* * Elektor Shop, www.elektor.com/080850 Figure 2. The PCB (available from the Elektor Shop) has a narrow strip for the four pushbuttons, which can be separated from the main PCB. The functions listed in Table 1 can be acti- vated by touching the sensor surface. One of these functions is switching the backlight of the display module, which is controlled by pin PD6 of the ATmega microcontroller and transistor T3. The 230 V or 1 1 5 V lamp connected to K1 (maximum power 80 W) is dimmed by a standard phase-control triac dimmer circuit, although here the trigger time of the triac (TRI1 ) is controlled by the microcontroller via an optocoupler (IC2) for mains isolation, instead of by the customary diac and poten- tiometer. The dimmer circuit is based on the ‘Semitone Crystal’ open source design l 2 l. However, in the alarm clock circuit we dis- pensed with an optocoupler for zero cross- ing detection and used a simple transistor (T2) instead. Connections We already mentioned that the 230 V (115 V) lamp(s) is (are) connected to K1 and the buttons are connected by K7 and l<8. That leaves us with connectors l<2 to l<6. I<2 provides the AC power connection to the alarm board (1 1 5 V or 230 V). An approved AC power cord with strain relief is con- nected to these terminals. I<3 is a serial port for programming and debugging. It is compatible with the FTDI USB to TTL adapter cable DL The DCF77 receiver module is connected to l<4. This port is laid out for the well known Conrad Electronics DCF77 receiver module (order number 641 1 1 3) shown in Figure 3. The data sheet and circuit diagram of this module are available on the Conrad web- site for reference. Only pins 1 to 3 of the DCF77 receiver module are used; they are connected to pins 1 to 3 of l<4. The inverted output of the DCF77 module (inverted out- put) is not used. Pin 4 of l<4 is connected to PD5 of the ATmega microcontroller and provides an Enable signal, which the author needed for a different module. DCF77 can be received across most of Central Europe and the UK. A small loudspeaker (8 f 1 ) or a piezoelec- tric buzzer can be connected to K5. This acts as a sort of fail-safe for people who sleep with an eye mask or as an acoustic alternative to the light alarm. I<6 is a six- way ISP port, which for example can be used in combination with the Elektor USB AVRprog interface HI for programming and debugging. 20 02-2011 elektor HOME & GARDEN Power supply The mains transformer (TR1) on the PCB receives AC grid power via 1 15/230-V power connector l<2. This transformer has two 1 1 5-V primary windings and can be configured for either 1 1 5 V or 230 V oper- ation using jumpers. For 230 V operation, JP1 must be fitted and JP2/JP3 must be left open; this connects the two primary wind- ings in series. For 1 1 5 V operation, leave JP1 open and fit JP2 andJP3 to connect the two primary windings to the mains voltage in parallel. The two 8 V secondary windings of the transformer are connected in parallel. The rest of the power supply circuit is conven- tional, with a bridge rectifier, electrolytic capacitor and 5 V voltage regulator. The only unusual element is diode D1 between the bridge rectifier and storage capacitor Cl 1 . This allows the pulsating DC voltage at the output of the bridge rectifier to be tapped off for zero crossing detection by transistor T1 and I/O pin PD2 of the micro- controller, before it is smoothed by the capacitor. The LCD module is also powered from the 5 V rail. Trimpot PI provides a variable volt- age derived from the 5 V supply voltage for adjusting the contrast of the display module. Assembly A programmed AT mega 1 68 and the PCB for this project are available from the Elektor Shop (see the components list). Of course, you may also program the microcontroller yourself; the source code and hex file can be downloaded free of charge from the Elektor website I 5 1. The PCB consists of two parts. In addition to the main PCB for the light alarm clock, there is a small strip designed to hold the four pushbutton switches and a header (see Fig- ure 2). No SMDs are used in this circuit, so you can solder everything the same way you did 30 years ago. As usual, you should pay attention to the orientation and/or polar- ity of the components. This applies in par- ticular to the bridge rectifier, since devices with nearly the same shape but different pin configurations are available. The right one is shown in Figure 1 . Our European readers can fit a regular 230 V PCB mains transformer with single primary and secondary windings instead of the international version with dual primary and secondary windings, as long as it has a com- patible pin configuration. In this case, omit the three jumpers. An example of a suitable 230 V transformer is given in the compo- nent list, and any similar El 30 transformer rated at 1 .3 or 2 VA with 230 V on pins 1 and 5 and 9 V on pins 7 and 9 can also be used. Initial operation AC line voltage (230 V or 1 1 5 V) is present on the PCB and on some components, so the light alarm clock must be fitted into Figure 3. A DCF77 receiver module is used for precise time synchronisation. This module is based on the proven Temic DCF77 receiver 1C. an enclosure for protection against con- tact with live voltages before it is con- nected to the mains or put into service. The enclosure must comply with the applicable safety regulations. In this regard, see the electrical safety instructions published on the Elektor website at www.elektor.com/ electrical-safety. If the board is assembled properly and the microcontroller is programmed correctly, you will see the time of day ‘00:00:00’ on the display after you plug in the power cable. If you don’t see anything on the dis- Advertisement Prototype & small series PCB specialists EURO CIRCUITS PCB proto STANDARD pool 14 ©^ TECH pool IMS pool On demand dedicated prototype service widest choice 1-8 layers 100 |jm technology metal-backed PCBs all options up to 16 layers Call us: +44 (0) 20 8816 8180 Email: euro@eurocircuits.com See us live at Southern Manufacturing and Electronics 2011 - Stand H29 ALL SERVICES - Instant online pricing - Instant online ordering - Low pooling prices - Deliveries from 2 days - No tooling charges - Stencil service www.eurocircuits.com elektor 02-2011 21 HOME & GARDEN Figure 4. The fully assembled Elektor prototype board. play, first check whether the contrast is adjusted properly (with PI ). Next the alarm clock tries to receive the cur- rent time from the DCF77 module. After it receives a correct data set, a small trans- mitting tower symbol is displayed next to the time to indicated that data is being received. However, it may take several min- utes after this symbol appears before the correct time is displayed, since the pro- gram (to be on the safe side) waits until it has received two successive data sets before it updates the time. If you now briefly touch the sensor surface, the backlight of the display will light up for approximately one minute. If you touch the sensor surface for longer than around three seconds, the lamp con- nected to K1 is switched on. To switch it off again, repeat this action. The front panel of the author’s prototype acts as the touch sensor surface. It is connected to the sensor port of the PCB. Control menu The menu settings can be configured using the four buttons, whose assigned functions are listed in Table 2. First press S2 to display the alarm clock menu. Then press S2 again to open the Alarm submenu, or press S3 to open the Settings menu. A user guide in the form of a detailed overview of the menus is availa- ble for downloading at [ 5 L The basic menu structure is as follows: Alarm Alarm active Alarm time Settings Set alarm -with light -with sound - Dimmer advance Debug Use the Alarm menu to enable the alarm and set the alarm time. When setting the alarm time, bear in mind that the simu- lated sunrise is programmed to end at the set alarm time, so the alarm clock starts the alarm process earlier than the set time. For this reason, the light will remain completely dark if the time interval until the set alarm time is shorterthan the duration of the sim- ulated sunrise (the ‘dimmer advance’ time). Use the Settings menu to configure the basic alarm clock settings. In the ‘Set alarm’ submenu you can enable ordisable the light alarm, enable or disable the supplementary acoustic alarm, and specify the duration of the light alarm phase. This alarm phase (‘Dimmer advance’) can be set in the ‘Set- tings’ menu. The default setting is 1 5 min- utes, but you can also select 30, 45 or 60 minutes. The Debug menu is displayed only when Table 2 . Menu button functions Button Function SI Back (return to previous menu item) S2 OK (confirm) S3 > (larger or upwards) S4 < (smaller or downwards) the alarm clock is operating in debug mode. Among other things, this menu shows the number of detected bits since the last start marker of the DCF77 signal and the last detected bit in this signal. If no informa- tion is displayed in Debug mode, there is a problem with DCF77 reception. This may be due to the location of the receiver or the antenna orientation, or it may be caused by misconnection of the receiver module or a defective receiver module. Your own ideas The software for this project, including the source code, can be downloaded from the Elektor website and was generated using a free C compiler (GCC), so there is nothing to stop you from modifying it as desired - for example, you could completely remodel the control menus and add new functions. One very nice change would be to replace the brutal acoustic alarm signal with a gen- tle wave noise signal whose amplitude increases gradually along with the increas- ing light intensity. For stubborn sleepy- heads, you could also add a ‘Maximum vol- ume’ menu item with the options ‘Hurri- cane’ or ‘Jet fighter take-off’. Finally, Elektor USA readers are encouraged to develop software based on their national time signal stations like WWV and WWVB. Let us know. (080850-I) m www.mikrocontroller.net/topic/25045 (in German) [2] www.engbedded.com/semitone [3] www.elektor.com/08021 3 [4] www.elektor.com/080083 [5] www.elektor.com/080850 22 02-2011 elektor h 0 _ fll? p V , , r' T : f. T r < ? f { V '*■ *" "* ** ** UfcB , 0 0 (•) L 01 02 G1 O* ^ a c o 1 *■ +* ** ri- ** ii | V 'J i R CW [PLAY] - i • : [ • ] or [ - ] f “ [REC] + [PLAY] - < - ft : [ - ] fi:[-] u : [REC] WPM info [REC] + [ - ] i " 4 4 n . n . RAM ■■■■► EE [REC] + [ • ] ±5s H SETUP [REC] 4 MSG .. 4 R The purpose of the auto spacing routine is to insert correct time pauses between char- acters and words based on the CW standard. The routine executes in the main program loop and can be disabled with jumper J2. If J2 is open, the routine is enabled. Auto spacing can significantly improve the quality of your CW code and can help the telegrapher to get a good sense of timing for the specified pause. Proper pauses between characters and words are the biggest problem during keying. A SETUP routine has been added to keyer elektor 02-2011 27 RADIO &RF COMPONENT LIST Resistors R1 = 1 ka R2=4.7I< a R3 = 2.2ka R4,R5 = 1 00£1 R6,R13-R16=15kni% R7-R12 = 30k£l 1% R17 = 1M£} PI = 1 0I<£1 potentiometer, mono, linear (not on circuit board) P2 = 10k£± potentiometer, mono, logarithmic (not on circuit board) Capacitors Cl = 470pF 25V radial, electrolytic, lead spacing 5mm C2 = 1 0pF, 63V, radial, electrolytic, lead spacing 2.5mm C3 = 1 0OnF 50V, ceramic, lead spacing 5mm C4-C7 = 47nF 50V, ceramic, lead spacing 5mm C 8 = 47pF 25V, radial, electrolytic, lead spacing 2.5mm C9 = 220pF, 1 6V, radial, electrolytic, lead spacing 2.5mm Cl 0-C1 3 = 47nF, ceramic or MKT, lead spacing 5mm or 7.5mm Cl 4, Cl 7 = 1 jllF 63V, radial, electrolytic, lead spacing 2.5mm Cl 5 = 5.6nF 5%, polyester/MKT, lead spacing 5 or 7.5mm Cl 6 = 1 0OnF 50V, ceramic, lead spacing 5mm Cl 8 = 470nF 63V, polyester, lead spacing 5mm Inductor LI ,L2 = 1 OOjiH choke, axial, e.g. Bourns type 79F101 K-TR-RC Semiconductors D1 = 1 N4148 D2 = 1 N4004 D3 = 1 0V 0.5W zener diode D4 = LED, green, 3mm T1 = BD135-16 T2 = BC639 IC1 = PIC1 6F688-I/P, programmed, Elektor# 100087-41, see [1] Figure 2. This small board was designed by Elektor labs to build the Ultimatic keyer. Note that controls like pots and switches are externally connected to the board. The copper track artwork is a free download from [1 ]. IC2 = TDA7052A/N2 (‘A’ suffix device must be used) IC3 = 7805 B1 = 1 00V 1 .5A bridge rectifier, Vishay General Semiconductor type W01 G Miscellaneous FI = fuse, 32mA (230VAC), 63mA (1 1 5 VAC), slow blow, with PCB mount holder and cap D4,S1 ,S2,JP2 = 2-pin pinheader, lead spacing 0.1” (2.54mm) D4,S1 ,S2 = 2-way socket SIL, straight, lead spacing 0.1 ” (2.54 mm) JP1 = 3-pin pinheader with jumper, 0.1 ” (2.54 mm) JP2 = 2-pin pinheader with jumper, 0.1 ” (2.54 mm) K1 = 2-way PCB terminal block, lead spacing 5mm K2,K3,I<4 = 3.5mm stereo jack socket, PCB mount, e.g. Lumberg 1 503 09 l<5 = 6.3mm (1 / 4”) jack socket, switched, 3-way, PCB mount, e.g. Cliff Electronic Components type S2BBBPCA K6,S4 = 2-way PCB terminal block, lead spacing 7.5 mm, Camden Electronics CTB01 10/2 LSI = miniature loudspeaker, 1 W / 8£2 (not on circuit board) RE1 = reed relay, 12VDC, SPST-NO, e.g. Flamlin Electronics type HE72 1 A1 210. SI ,S2 = pushbutton, 1 make contact, e.g. APEM type 9633NVD with black cap type U482 (not on circuit board) S3 = SPST (toggle) switch (not on circuit board) S3, PI ,P2 = 3-pin pinheader, 0.1 ” (2.54mm) S3, PI ,P2 = 3-way socket, 0.1 ” (2.54mm) TR1 = AC power transformer, PCB mount, prim. 2x1 1 5 V, sec. 2x6V 2.3VA, e.g. Block type AVB2. 3/2/6. Strap primary for local AC line voltage. PCB# 100087-1, see [1] software. It allows copying of the message saved in RAM to EEPROM, as CW keyer user could permanently save frequently used messages and make RAM memory free for temporary messages which will be auto- matically erased after keyer is switch off. The SETUP routine is also used for PIC oscil- lator frequency adjustment which will be explained below. Launching of the routine takes 5 s and the routine is active only 3 s, this is done to prevent accidentally start it. The SETUP routine is started by press- ing REC and the dot lever simultaneously. After that, REC can be released but Dot lever must remain pressed for at least 5 seconds, until the keyer starts to key ‘SETUP’. After that, REC] must be pressed briefly within 3 s. The keyer will key ‘MSG’ and the message saved in RAM will get copied into EEPROM. When done you will hear ‘R’ keyed out and the keyer is ready for normal use. The mes- sage saved in EEPROM can be overwritten with a new message at any time by repeat- ing the procedure described. The message in EEPROM can be erased by copying pre- viously erased RAM into it. Microchip guar- antees one million write cycles to EEPROM. Internal oscillator frequency adjustment. The PIC 1 6F688, like many other new types of PIC, has an internal oscillator with a default frequency of 8 MHz, and the use of an external quartz crystal is optional. Here, the accuracy of the internal oscillator is suf- ficient especially after frequency adjust- ment with the software tool. Frequency can be changed in increments of approxi- mately 60 kHz and after adjusting the CW speed error will not exceed ±0.5%. The pro- cedure for oscillator frequency adjustment is not too complicated and described in a free supplementary document HI. Construction and testing The circuit is built on an Elektor-designed printed circuit board of which the com- ponent overlay is shown in Figure 2. Only through-hole components are used, so assembling this board should not cause problems provided you work accurately as it has to be admitted the component 28 02-2011 elektor RADIO &RF arrangement is fairly dense in places. When gathering the components for the project, pay attention to the pin arrangement of jack sockets l<2, l<3, l<4 (3.5 mm) and l<5 (6.3 mm). Also note the size and lead pitch of Cl 8 for which a space of about 3.5 mm is available on the board. The programmed PIC micro is preferably mounted in a 1 4-pin DIL socket. The completed board is fitted in a metal enclosure, see Figure 3 for an impression of the author’s prototype. The jack sock- ets are lined up at the board edge to enable them to protrude from the front panel. The two pots and the two pushbuttons are con- nected to the board byway of 0.1 -inch pin- headers and receptacles. Care and attention should be given to the 230/1 1 5 VAC power connections to the board. All wiring between the board and external AC power switch S4 must be secure and rated at 250 VAC mini- mum. On/off switch S4 must be rated and approved for AC line voltage (230 VAC / 1 1 5 VAC) switching. Do not even dream of going sloppy here. The 7805 and the BD1 35 both have an easy job and do not require a heatsink. Ready-programmed PICsforthe project are available from Elektor, see PL The 13.8 VDC input is byway of a screw ter- minal block because a zillion different con- nector systems exist on radio rigs. The component list includes references to all 2-pin and 3-pin 0.1-inch pinheaders to controls and components mounted off the Figure 3. Suggested mounting in a metal case (author’s prototype). board — see, for example, potentiometer PI which gets connected to the board with a 3-way combination of a SIL pinheader and mating socket. Before installing it in its case, the assem- Advertisement V-Mcdule Make the design much easier VMP320X series DC- DC Module Compact slit, fully integrated package Vint &.QV-2-4.0V Vou t: 1.0V-MV Efficiency up to 95% No heatsink required Cost effecitve High reliability, Low EMI H M MX* XJt VMP32Q1; 1,2A VWP3303- 2. DA VMP32D3! 3. DA Dealer W anted URL ; http : www.v madule.com Email- sbIbe a u module. cam Te| ; + SB 1 0 SS5S 0700 Fax -ae 10 ease a?o? Take out a free subscription to E-weekly now Do you want to stay up to date with electronics and computer technology? Always looking for useful hints, tips and interesting offers? Subscribe now to E-weekly, the free Elektor Newsletter. Your benefits: * The latest news on electronics in your own mailbox each friday * Free access to the News Archive on the Elektor website * You’re authorized to post replies and new topics in our forum e weekly 'w tin in hLBwL-ccje a' Bapid.clevelap^nlfoiriiroSlvpgsi .rid com plex jsystemsi U«r iflMHK-i 1 ih.ilIk (ruin unli'a l.iihi 1 i ji Nr* V* Ns*« s* ^ ff iivki wmr*r Wfl !*■■ m< mil fi-i -at p iiu APrj sa i-ut a w U amhi. nAfff ►= - : s* -i- ■ - : £1 k-o I w G*vt i li*. Ip fc- wi- mKCtd mad* '-v •'•d ■ In Th‘v-f (rum 1 IHil-itr: I5VJ] Aurl» CuDi'flionVrii. :i tt* ! i*ati la J»W' rjt 1M f ifc'r -m hF“*?ui ■Ij' ti Register today on www.elektor.com/newsletter elektor 02-2011 29 RADIO &RF Figure 4. A close look at the finished and tested prototype of the keyer assembled by Elektor Labs. When in doubt, look closely at this photograph - HI. bled board (Figure 4) can be given a quick test by running over some of the routines described in the Software and Operation section above. This requires all controls and a small loudspeaker to be connected, if nec- essary, in a temporary fashion. Connecting to a radio station Connection between keyer and radio sta- tion can be done in several ways depend- ing on your desires and the type of radio station. The first connection method involves con- necting the keyer to the radio station with two cables. First, the ‘control’ cable con- nects the CW output (Out) with paddle input (Key) on the radio station and serves to activate the transmitter while the other, ‘audio’, cable connects the headphone jack (Phones) with an output for headphones (Phones) on the radio station to listen to the receiver and the keyer monitor on the same headphones. Using this method of connect- ing the keyer and radio station, grounds are joined via the connecting cable! This method is recommended because it ensures proper keyer grounding while galvanic iso- lation from the AC grid is afforded by the transformer. If the radio station has a 13.8 V output for powering small external loads you are in luck as the keyer is switched on and off together with the radio station. When the ground lines of both devices are connected together, the use of reed relay as the keyer output is pointless because the transistor output provides a better defined CW output (in terms of pulse timing). When using the transistor output, the control and audio cables are identical and standard cables with 3.5 mm diameter ste- reo connectors at both ends. Such cables are used to connect a PC audio card and video monitor which have a built-in speak- ers and/or a microphone, and can be pur- chased ready-made in PC accessory outlets. It is important to emphasise that before connecting the keyer to a radio station, two parameters in the radio’s menu need chang- ing: (1 ) turn off internal keyer; (2) turn off the internal monitor. The second way of connecting up is to pro- vide full galvanic isolation between keyer and radio station. In this case, the audio cable should not be used, and the reed relay selected for the CW output. To ensure gal- vanic isolation of the CW output from the keyer ground, the reed relay contacts are connected to the tip and ring of a 3.5 mm stereo connector and the control cable should be made separately. In this case, it is desirable for the keyer ground to be con- nected to the ground rail in the radio shack (not: Radioshack). The third method of connecting is a com- bination of first and second methods and is applicable in the event that the radio sta- tion requires a potential-free contact on its Figure 5. A collector’s item and a QRQ delight, this vintage Vibroplex paddle keyer is easy to adjust to your personal preferences and rock solid on its cast iron base. Courtesy Anton Klok PA3AQV. paddle input. This may occur at older radio stations which have not internal electronic keyer. The reed relay should be used for the CW output, and the control cable should be made as described above (second way of connecting) while the audio cable can be used as stated in the first method. (100087) Note: paddle keys used for circuit testing and photography kindly provided by Anton Klok, PA3AQV. Internet Link [1 ] www.elektor.com / 1 00087 Figure 6. A low cost ‘utility’ paddle keyer mounted on a plastic base. Great for practicing and “getting up to speed” as some say. Courtesy Anton Klok PA3AQV. 30 02-2011 elektor NXP mbed Design Challenge empowered by: CIRCUIT CELLAR i show us what’s possible Were you inspired by mbed's Robot Racing at ARM Techcon? Or enlightened by the mbed seminar at Elektor Live ? Then its time to take your from concept to reality and enter for a chance to win share of $ 10,000 in cash prizes. If you haven't registered yet , don't delay . You could have the next design that moves the industry forward! ; The mbed Challenge is on! We’ve challenged you to a create an mbed project that is insightful and reuseable. So if you’ve been constructing, compiling, tweaking and testing with the mbed NXP LPC1768 prototyping board then you’re ready to answer the challenge and compete in the NXP mbed Design Challenge! Deadline for entries is February 28, 201 1 at 1PM EST! Show us what you got! Register for the challenge at www.circuitcellar.com/ nxpmbeddesignchallenge 3 mbed DESIGN CHALLENGE ATMi8 EDUCARD Educational Expansion Board With handy general-purpose peripheral functions By Gregory Ester (France) This expansion card, which is designed to be used with the Elektor ATM18 board, should come in handy for all sorts of projects. The combination provides a platform that is very suitable for both rapid prototyping and educational use. Due to its suitability for educational applica- tions, we have dubbed this board ‘EduCard’. The basic idea is very simple: each subsys- tem of the circuit (see the schematic dia- gram in ) provides a function that is often used in a wide variety of electronic systems. All inputs and outputs are brought out to PCB headers for easy access. The addresses, digital inputs and so on are configured by jumpers. Using a normal printer, you can easily generate an overlay for the PCB with appropriate signal names and I/O labels, which you can place on top of the board. The link between the EduCard and the ATM18 board requires only 19 leads. The ATM18 board was described in the April 2008 issue of Elektor and is available from the Elektor Shop (item number 071035- 2). Once you have the ATM 18 board, you can immediately start developing the soft- ware for your application. The modules fit together very nicely, and the result is some- thing you can show with pride. Mating modules All of the PCB headers are located at the edge of the PCB, so they can easily be marked with the appropriate signal names or I/O labels. This way you can see exactly which lines are connected to the ATM18 board or to peripheral devices. For power- ing the board, you can choose from a PCB terminal strip (l<2) for use with an 8-1 2 V power source, a male PCB header (K1 ) or female PCB headers (l<3 and l<4), all three of which can be used with a 5 V power source. If you aren’t overly fond of cutting and strip- ping short lengths of wire and you’re tired of seeing them break after being used just a few times, we have a handy tip for you. You can buy ready-made breadboard jump- ers from Sure t 2 l and save yourself time and trouble. They are available in both male and female versions (). All of the connec- tions necessary to use this board properly 32 02-2011 elektor ATMi8 EDUCARD Figure 1 . EduCard schematic diagram. with the ATM1 8 board are listed in Table 1 for easy reference. Just one wire The 1-Wire bus was developed by Dallas Semiconductor and Maxim; it also goes by the name ‘MicroLAN bus’. The nice thing about this bus is that you can connect a nearly unlimited number of I/O devices to your board with just one twisted-pair cable, which has a maximum length of several dozen metres. This is what is called a ‘multi- drop’ system. Under certain conditions, the bus can be extended as far as 300 metres (1,000 ft.) or so. Each device on the bus has a unique 65-bit identification number. Another handy feature is that the ID num- ber is marked on the device package, so you always know where to find it. The 1 -Wire devices transmit their digital data over the bus. The device identifier is protected by a cyclic redundancy check (CRC) code to pre- vent address errors on the bus. A free API called ‘TMEX’ is available from Dallas/Maxim. You can use the attractive iButton Viewer user interface to access and program all 1 -Wire devices on the bus, although in this case the ATM 18 board looks after this task for you. 1 -Wire devices that do not draw very much current can take their operating power directly from the bus. This is called ‘parasitic power mode’, and it utilises the fact that the signal level on the bus is often in the High state, so a cur- rent of a few milliamperes flows through the bus lead. The two sensors shown in oper- Features • 2 temperature sensors on i-Wire bus • 2 DACs with SPI interface • RC5 sensor • Matrix keypad • 7-segment LED display • 8 digital inputs on I2C bus • Real-time clock • Potentiometer • 5-V supply voltage ate in this mode. Connector K1 6 is provided to allow you to connect additional 1 -Wire devices. Although individual 1 -Wire devices usually draw less than 1 00 pA, there is nat- elektor 02-2011 33 ATMi8 EDUCARD urally a limit to how many devices operat- ing in parasitic power mode can be con- nected to the bus. It is always possible to power some of the devices on the bus from a separate 3-V or 5-V power supply. Two DS1820 temperature sensors are present on the board as standard. Here we should mention that the DS1 8S20 as opposed to the DS1 820, normally takes around 500 to 750 ms to convert a temperature reading to a bus signal. Figure 2. Ready-made breadboard jumpers. Figure 3. Basic operating principle of the 1 -Wire bus. Jl„ stop Tek + 010101010 1* CM 1 00V START D Q CD CD O M Pos: 4320 ms 10 10 10 vi 2. DEVICE 50 m <1 O 2 1 ]Hz COMMAND 11000000000010 MESURES CHI D-C Am CHI Aucune CHI Aucune CHI Aucune CHI Aucune -1 20 V 100742 - 13 Figure 4. RC5 frame format. Everyone on the bus The Inter Integrated Circuit Bus, usually des- ignated ‘l 2 C bus’, was developed in the early 1 980s by Philips for use in consumer electron- ics and home automation systems, in partic- ular to provide a convenient way to link the various circuits in modern television sets to a microcontroller. Atmel and some other com- panies call this system Two Wire Interface’. The l 2 C bus is a synchronous bus with two leads plus ground. One lead is designated ‘SDA’ and carries the data, while the other lead is designated ‘SCL’ and carries the clock signal. Addressing is used to ensure that the data arrives where it is supposed to go. The EduCard has three components con- nected directly to an onboard l 2 C bus: two PCF8574 devices and one PCF8583. The PCF8574s provide two 8-bit digital I/O ports (one each) for general purpose use. One port drives a seven-segment display, while the other can be configured and used as desired. It can be accessed via eight jump- ers (JP8-JP1 5). The PCF8583 contains a real time clock and calendar and is equipped with a backup battery (a CR2032 3 V lithium cell fitted in battery holder BT1 ). The appro- priate address assignments are listed in . Note that there is also an ‘A’ version of the PCF8574, which uses a different addressing scheme. Its most significant nibble is set to a fixed value of ‘001 1 ’ binary (hex 7x). Invisible remote control The RC5 standard for infrared data trans- mission is also a Philips invention. The fourteen data bits are biphase coded (Manchester coded) and available on pin 5 of connector K5. If you have a uni- versal remote control unit programmed for controlling a Philips television set (TV1 mode), pressing the ‘2’ button will cause 34 02-2011 elektor ATMi8 EDUCARD ^ co n 5 _j < r- O n Q q O O c/5 C/5 O O fc O -J = O O-.-oiro-^-^-ojcoTi- C/5 2 C/5 C/5 Z5 CO CO ? D _ 15 I _IOOOO^£f^2T* Table i. Connectors, jumpers and their functions. 00 K3 • JP1 • JP2 JP3 JP4 Ab JP5 JP6 JP7 K5 Buzz er CB 6?) K igigigiifigigig “jji. b 5^(?) yjj y y.y.yjj- ■ •• » :=sp>‘ Function Connections Description Power K1 , l<2, l<3, l<4 5 VDC or 8 - 1 2 VDC external source; indicated by LED D1 Keypad l<5 pins 9-16 C1,C2,C3,C4, R1,R2, R3, R4 I2C PCF8583 (IC1): RTC l<5 pins 1-3 SCL, SDA, INI jpi Address: on: AO = 0; off: AO = 1 K10 CR2032 button cell |2C PCF8574 (IC2): 8 digital inputs l<5 pins 1-3 SCL, SDA, INI JP2.JP3.JP4 Address: AO, A1, A2 JP8-JP1 5 8 digital inputs: P0_E-P7_E l 2 C PCF8574 (IC3): 8 digital outputs l<5 pins 1-3 SCL, SDA, INI JP5.JP6.JP7 Address: AO, A1, A2 The states of the 8 outputs are shown by 7 segments and deci- mal point of the 7-segment display. SPI MCP4921 (IC4and IC5):two DACs l<7 pins 1-4 SCK, MOSI, SS(1 ) (IC4), SS(2) (IC5) K8 and l<9 DC_0UT1 , DC_0UT2 (2 analogue outputs) 1 -Wire DS1 820 (IC6 and IC7): two digital tem- perature sensors connected in parasitic power mode l<16 pins 1-6 GND, DQ, GND, GND, DQ, GND l<5 pin 4 DQ RC5: infrared receiver K13, l<14, K1 5 TSOP2236 to GND, VCC and OUTJR l<5 pin 5 OUTJR output Buzzer K11 and K12 Intended for buzzer (+ and GND) l<5 pin 6 Buzzer input Potentiometer l<7 pin 5 Output range 0-5 V Two-line Elektor LCD module l<6 pins 1-4 VDD, GND, DATA_LCD and CLK_LCD for driving the LCD modu- le; DATA_LCD and CLK_LCD are available on K5 pins 7 and 8 the waveform shown in to appear on the output connected to pin 5 of connector l<5. The first two bits always have a value of ‘1’ and are used for synchronisation. They are followed by a toggle bit, which changes state when a button is pressed (or pressed again). This means that the tog- gle bit stays the same as long as a button is held pressed. The toggle bit is followed by five address bits to select the device that should execute the command, and finally six bits corresponding to the pressed but- ton (in this case ‘2’). Analogue outputs The EduCard has two 1 2-bit D/A converters implemented with type MCP4921 ICs. The analogue outputs are available on connec- tors l<8 and l<9. The converter ICs are config- ured as bus slaves and are enabled by pull- ing their Chip Select (CS) inputs Low. Data from the microcontroller is clocked into the Master Out Slave In (MOSI) input of each converter by the clock signal on the SCK line. The data is formatted as 1 6-bit words. The first 4 bits contain configuration infor- mation, while the remaining 1 2 bits contain Table 2. I 2 C device addresses. Component PCF8583 (IC1 ) : RTC PCF8574 (IC2) : 8 inputs PCF8574(IC3): 8 outputs 1 0 0 0 1 1 K3 • JPI • JP2 II II II II 1 0 0 0 0 0 elektor 02-2011 35 ATMi8 EDUCARD Table 3. Connections between EduCard and ATM18 board. Function Educard ATMl8 Two-line LCD module DATA_LCD, CLOCK_LCD PB2, PB1 Matrix Keyboard C1,C2,C3,C4, R1 , R2, R3, R4 PD0, PD1 , PD2, PD3, PD4, PD5, PD6, PD7 Buzzer BUZZER PC5 DS1 820(1 -Wire) DQ PC4 RC5 (infrared) OUT JR PC3 |2C SDA, SCL PB0, PC2 SPI SS(1), SS(2), MOSI.SCK PC0, PCI, PB3, PB5 ^ Figure 5. Two successive bytes on the SPI bus. the value to be converted (see ). An SPI link supports four different operat- ing modes depending on the values of two parameters. The first parameter determines the clock polarity (active High or active Low), while the second parameter deter- mines whether data is clocked in or out on the first edge or the second edge of the clock signal when after the CS input goes active (Low). Here these converters are con- LCD TEST OK BUTTON i fi Key re ad value ▼ Today Time 20/ 1 0 11: 59s 58 4 Device i Conroand : : 0 : 4 1-wire sensors : 2 I d = RF00080 l DflDDOC 1 0 I d : 3400080 l F9698B 1 0 Id: 4 Figure 6. What you should see on the display when you test your EduCard. Cm TEST: UREF=4. 9SU? DC _OUT 1 = 2.480 U DC_0UT2 = 2.789 U NB s Measure IJ_UPR ! figured to operate in SPI mode 0, which means that the clock is inactive when Low (polarity = Low) and data is transferred on first clock edge after CS goes Low. The data is transmitted with the most significant bit first (data order = MSB). A few other configu- ration settings are: /SHDN = 1 Disable sleep state A/B = 0 Write data to DAC a ; there is actually no other choice with only one DAC per 1C BUF = 0 No buffer for V REF /GA = 1 Gain = 1; V 0UT = (Vref x 1 x D)/4096 If D = 1 0001 1111111 (binary) = 2303 (deci- mal) and V REF = 5 V, the voltage at the output of the converter should therefore be 2.81 1 V. The glue The firmware is the glue that bonds all these components together. We generated the firmware using BASCOM-AVR 2. 0.1.0, which has a solid track record. The firmware includes test routines for all of the components on the EduCard. shows what you should see on the display after power-up. Use the following procedure to prepare for testing the EduCard: 36 02-2011 elektor ATMi8 EDUCARD • Connect the LCD module to K6 and the buzzer to K1 1 /l<12 on the EduCard (the LCD module was described in the May 2008 issue of Elektor and is available from the Elektor Shop under item num- ber 071035-93). • Using 19 breadboard jumpers, connect the EduCard to the ATM18 board as described in . • Connect an external AC power adapter to the ATM 18 board. • Download Development _ Board_Test. hex to the flash mem- ory. After this, the board can be tested using the following procedure: 1 . The following message should appear on the LCD: ‘LCD TEST OK’. 2. Matrix keyboard test: press ‘F’ to proceed to this test. 3. PCF8574: the segments of the seven-seg- ment LED should light up in sequence. If the value read is ‘255’, which means that jumper positions JP8 and JP9 are both open, the routine proceeds to the next test. 4. PCF8583: the display shows the date (DD/MM format) and time (e.g. 20/10 1 1 :59:55). At 1 2:00:00 the routine pro- ceeds to the next test. 5. RC5 mode TV1 : press the ‘0’ button on the remote control unit (which must be configured in TV1 mode) to proceed to the next test. 6. 1 -Wire: the serial numbers of the two temperature sensors are displayed. Press ‘8’ on the remote control to proceed to the next test. 7. DAC via SPI: write ‘2048’ to DAC1 and ‘2303’ to DAC 2. With V REF = 4.96 V, the measured values should be 2.480 V on l<8 and 2.789 V on l<9. 8. Finally, use a voltmeter to measure U_ VAR. Adjust PI to vary the voltage. COMPONENT LIST Resistors R2-R9 = 10l<£2 R1 8,R1 9 = 2.2k£l R20 = 56D R1 ,R21 -R28 = 1 1<£1 R10-R17 = 150£1 R31-R38 = 470E1 R29 = 100 £1 R30 = 4.7l<£2 PI = 1 0k horizontal, trimpot Capacitors Cl = 1 0OjaF 16V radial C2-C6,C8,C9,C1 1 = lOOnF C7 = 22pF trimmer or 22pF capacitor CIO = 470 jiF 25V radial Semiconductors D1 = LED, low current, green LD1 = 7-segment display, Avago type HDSP-315L D2,D3 = BAT85, Schottky diode D4 = 1 N4001 IC1 = PCF8583 IC2JC3 = PCF8574 IC4JC5 = MCP4921 IC6JC7 = DS1 8S20+ IC 8 = 7805 Miscellaneous XI = 32.768kHz quartz crystal CR2032 Lithium button cell, 3 V S-S1 6 = pushbutton, PCB mount, push to make, e.g. SPNO-B3S series (Omron), Far- nell# 1 18-1016 K2,K8,I<9 = PCB solder pins or 2-way PCB ter- minal block K1 = 2-pin pinheader, lead pitch 0.1” (2.54mm) K3,K4,I<7 = 5-pin socket strip, lead pitch 0.1 ” (2.54mm) l <6 = 4-pin socket strip, lead pitch 0.1” (2.54mm) l<5 = 1 6-pin socket strip, lead pitch 0.1 ” (2.54mm) K1 0 = PCB mounting for CR2032 cell K1 1 -K1 2 = DC buzzer, 5 V/4 kHz K1 3-K1 4-K1 5 = TSOP2236 or equivalent K1 6 = 6 -pin socket strip, lead pitch 0.1 ” (2.54mm) JP1-JP1 5 = 2-pin pinheader with jumper, lead pitch 0.1 ” (2.54mm) 3 pcs 8 -pin DIL 1C socket 2 pcs x 1 6- pin DIL 1C socket PCB, #100742-1 (see [1 ]) If your EduCard passes all of these tests, it is working properly. (io 0742 -I ) [ 1 ] www.elektor.com/ 1 00742 [ 2 ] www.sureelectronics.net/goods. php?id=841 Internet Links elektor 02-2011 37 GEOLOCALIZATION Geolocalization without GPS Where am I? Where am I headed? By Clemens Valens (Elektor France Editor) These days, the simplest way to find out your geographical position is to use a GPS receiver or ‘satnav’. A GPS (let’s drop the ‘receiver’) is accurate and works anywhere in the world. GPSs are getting smaller and smaller and performing better and better, and new applications are constantly being found for them. But in spite of how powerful it is, the GPS is not the solution to every geolocalization problem. Where the signals from the GPS satellites can’t get through properly, like indoors or in places surrounded by tall buildings, GPS receivers won’t work correctly. Luckily, there are other solutions. As we’ve often seen in TV detective series, it is indeed possible to find someone’s posi- tion using their mobile phone. Knowing the positions of the cellphone network towers (‘repeaters’) with which it is in contact, we can find out roughly where the telephone is. And if these repeaters are able to compare between them the strength or the arrival time of the phone signals, it’s even possi- ble to get a quite accurate estimate of the position. It works the other way round too. If the mobile phone has a database containing the positions of the repeater stations, it can calculate its own position using the signals transmitted by the repeaters nearby. The operators take advantage of this technique to offer automatic pedestrian guidance or local information services. And what works with mobile phones and repeater stations can also be used with other wireless communication systems like Wi-Fi, ZigBee, or Bluetooth networks. GPS works all over the world — it’s a global sys- tem (remember that GPS stands for Global Positioning System); in the same vein, a positioning system using a local network is called a Local Positioning System or LPS. In this article, we’re going to be taking a look at some systems that make it possi- ble to locate an object (or person) at any moment, i.e. in real time, and anywhere within the area covered by the cellphone network. This type of system is known as Real Time Location System or RTLS (in this context, real time means periodically). Hence this excludes those systems that use, for example, RFID tags or barcodes to track the position of an object or beacon systems that make it possible to find an object by means of a mobile beacon detector. A short history of geolocalization Before launching into a description of LPS, its worth taking a little trip back into his- tory, for the navigation techniques we use today were developed for the first mariners who sailed the seas and oceans. Until the 1 5th century, sea journeys were almost always coastal: they would sail from port to port without every getting too far away from the coast. They navigated by observing the stars, the wind, the sea, the land, and the behaviour of birds and sea mammals. Basic tools like the star chart (used by the Arabs) or a wind rose (in the Mediterranean) made it possible to formal- ize good practice a little. In the Northern hemisphere, the Pole Star allows “constant latitude” navigation; in the Southern hemisphere, they managed using other stars and constellations. Then the first instruments capable of measuring the angle of a star made an appearance: the kamal, the cross-staff (‘Jacob’s staff’), the nautical astrolabe, the quadrant, the octant, and lastly the sextant. These instruments make it possible to calculate the latitude with suit- able precision. By the late 1 2th century, the lodestone was already being used to find magnetic North and thereby deduce the ship’s heading. By adding a compass card to it, it becomes a real compass, making it possible to read the ship’s heading off directly. Speed measurement arrived with the inven- tion of the ship’s log. These two elements, heading and speed, allow dead-reckoning navigation, but this still wasn’t accurate enough for longer voyages. In 1759, an Englishman, John Harrison, invented the marine chronometer, capa- ble of keeping accurate time during long months aboard a ship. This allowed improved accuracy for these navigational approaches and significantly reduced the risk of running aground. With this kind of timepiece, you are able to measure the longitude by using the principle of time differential. Later, the accuracy of these methods was improved and calculation methods refined. First employed during the First World War, the gyroscopic compass made it possible to get around the difficulties encountered with both the declination of the Earth’s mag- netism, and the influence of metal masses present aboard ships, which distorted and complicated the measurements. The Second World War led to the emer- gence of devices exploiting radio waves, like radar and so-called ‘hyperbolic’ radio navigation systems like GEE, LORAN, and DECCA. These made possible an accuracy varying between a few metres and a few kilometres. Then they in turn were sup- planted by more accurate satellite position- ing systems. 38 02-2011 elektor GEOLOCALIZATION The first GPS satellite was launched in 1 978 by the United States. The current system comprises 30 satellites orbiting at an alti- tude of 20,200 km. The Russian equivalent GLONASS, comprises, at the time of writ- ing, 26 satellites (20 of them operational) in orbits at 19,130 km. Europe is lagging behind with Galileo, supposed to be oper- ational in 2014, but so far, no satellite has been placed into orbit. Satellite positioning systems offer great accuracy, to the nearest metre, or even better. Triangulation, trilateration, or multilateration? LPS and GPS (not just the US system) both use several transmitters to enable a receiver to calculate its geographical position. Sev- eral techniques are possible, each with its advantages and drawbacks. The important thing in all these techniques is the notion of a direct path (Line of Sight or LoS). In effect, if the transmitter signal has not taken the shortest path to the receiver, the distance between them calculated by the receiver will be incorrect, since the receiver does not know the route taken by the radio signal. Three mathematical techniques are usu- ally used for calculating the position of a receiver from signals received from several transmitters: triangulation, trilateration, and multilateration. The last two are very similar, but should not be confused. Triangulation Triangulation (Figure 1) is a very ancient technique, said to date from over 2,500 years ago, when it was used by the Greek philosopher and astronomer Thales of Miletus to measure (with surprising accu- racy) the radius of the Earth’s orbit around the Sun. It allows an observer to calculate their position by measuring two direc- tions towards two reference points. Since the positions of the reference points are known, it is hence possible to construct a triangle where one of the sides and two of the angles are known, with the observer at the third point. This information is enough to define the triangle completely and hence deduce the position of the observer. Using triangulation with transmitters requires the angle of incidence (Angle of Arrival or AoA) of a radio signal to be meas- ured. This can be done using several anten- nas placed side by side (an array of anten- nas, for example, Figure 2) and to measure the phase difference between the signals received by the antennas. If the distance between the antennas is small, the inci- dent front of the signal may be considered as straight, and the calculation of the angle will be fairly accurate. It’s also possible to use a directional antenna to determine the position of a transmitter. The antenna orientation pro- d = Lsin(a) sin(p) sin(a+p) B 100809 - 12 Figure 1 . Triangulation: you are at A, from where you can see B and C. If you know their geographical positions, you can find out your own position with the help of a compass. Oh yes you can! elektor 02-2011 39 GEOLOCALIZATION Figure 2. An antenna array makes it possible to measure the angle of incidence of a radio signal, and hence its direction. ducing the strongest signal indicates the direction of the transmitter. All you then have to do is take two measurements from known transmitters in order to be able to apply triangulation. Trilateration This technique requires the distance between the receiver and transmitter to be measured. This can be done using a Received Signal Strength Indicator (RSSI), or else from the time of arrival (ToA, or Time of Flight, ToF, Figure 3) of the signal, pro- vided that the receiver and transmitter are synchronized — for example, by means of a common timebase, as in GPS. Thus, when receiving a signal from a single transmitter, we can situate ourselves on a Figure 3. The length of the arrows corresponds to the arrival time at receiver P of the signals broadcast by three transmitters A, B, and C. It forms a measurement of the distances between the transmitters and the receiver. circle (for simplicity, let’s confine ourselves to two dimensions and ideal transmission conditions) with the transmitter at the cen- tre. Not very accurate. It gets better with two transmitters — now there are only two positions possible: the two points where the circles around the two transmitters inter- sect. Adding a third transmitter enables us to eliminate one of these two possibilities (Figure 4). When we extend trilateration to three dimensions, the circles become spheres. Now we need to add one more transmitter in order to find the position of the receiver, as the intersection of two spheres is no longer at two points, but is a circle (assum- ing we ignore the trivial point when they touch). This explains why a GPS needs to ‘see’ at least four satellites to work. Multilateration Using a single receiver listening to the sig- nals (pulses, for example) from two syn- chronized transmitters, it is possible to measure the difference between the arrival times (Time Difference of Arrival orTDoA) of the two signals at the receiver. Then the principle is similar to trilateration, except that we no longer find ourselves on a cir- cle or a sphere, but on a hyperbola (2D) or a hyperboloid (3D). Here too, we need four transmitters to enable the receiver to calcu- late its position accurately. The advantage of multilateration is that the receiver doesn’t need to know at what instant the signals were transmitted — hence the receiver doesn’t need to be syn- chronized with the transmitters. The sig- nals, and hence the electronics, can be kept simple. The LORAN and DECCA systems, for example, work like this. LPS using Wi-Fi and RSSI With the advent of Wi-Fi, we now find radio networks everywhere, and some people have had the idea of using these wireless networks to make an LPS. Often in these cases the ‘L’ of local is limited to a building or just a few rooms. These projects almost all use the RSSI signal strength indicator, available in the majority of receivers. The energy in a radio signal from a transmitter broadcasting uniformly in all directions is inversely proportional to the square of the distance from the transmitter (in effect, the area of a sphere is equal to 47tr 2 ). Hence the further we are from the transmitter, the weaker the signal. So the RSSI signal gives us a measure of the distance between the receiver and the transmitter, and thus can be used for trilateration. In reality, RSSI trilateration is not as simple as that, as the RSSI signal is not accurate enough. Already, the manner in which the RSSI depends on the intensity of the radio signal is not necessarily inversely propor- tional to the square of the distance from the transmitter, and in addition, the RSSI is influenced by obstacles like partitions or ceilings. Figure 4. Two-dimensional trilateration. In 3D, another transmitter has to be added in orderto determine a position unambiguously. 40 02-2011 elektor GEOLOCALIZATION One way of remedying this is to map the RSSI over the whole area where the posi- tioning system is required to operate. Microsoft’s RADAR project uses this prin- ciple. The receiver measures the RSSI and then searches for the position that best matches on the map (or in a table). To improve the chances of getting the right position, the system takes account of the recent history of the receiver’s movements and the environmental factors that have a direct influence on the RSSI map, like the number of people present or the ambient temperature. You can watch an animation about RADAR on the Internet [1 ]. To pro- duce this animation (based on actual meas- urements), it was necessary to ensure that the receiver was at all times receiving at least four Wi-Fi transmitters (access points). Figure 5. Wi-Fi coverage in and around the author’s house, drawn with the help of the HeatMapper software. It’s surprising to discover that the neighbours have a hidden Wi-Fi AP in their garden (‘hidden’ means that the SSID is concealed)! Ekahau, a company spawned by research at Helsinki University (Finland), is offering a free software application [2] for easily pro- ducing a map of the Wi-Fi coverage in your home, based on the RSSI. On a grid or with the help of a previously-prepared plan, the Advertisement Fundamental Amplifier Techniques with Electron Tubes ^E^The ultimate tube amplifier reference book! The aim of this book is to give the reader useful knowledge about electron tube technology in the application of audio amplifiers, including their power supplies, for the design and DIY construction of these electron tube amplifiers. This is much more than just building an electron tube amplifier from a schematic made from the design from someone else: not only academic theory for scientific evidence, but also a theoretical explanation of how the practice works. No modern simulations, but because you first understand the circuit calculations, then you can work with your hands to build the circuit and last, but not least, if you have a multimeter, a signal generator and an oscilloscope, you can measure the circuit parameters yourself to see that theory and practice are very close. That is the aim, and makes this book a unique reference source. [3ektor Further information and ordering at www.elektor.com/shop elektor 02-2011 4 i GEOLOCALIZATION WPS One means of exploiting Wi-Fi access points (APs) for geolocalization on a larger scale has been developed by Skyhook [6]. As Google is currently busy doing for its Street View project, Skyhook too is sending cars out to go around towns, but looking for Wi-Fi APs. The geo- graphical positions of the APs and their names (SSIDs) are stored in a database, which already contains over 250 million APs! In this way, the company has created the Wi-Fi Positioning System (WPS). In order to find out your position, all you have to do is send the WPS the APs ‘seen’ by your computer or mobile phone. The database will tell you (roughly) where you are. To improve the system, the geographical positions of phone network relay antennas have also been entered into the database. According to the company, the accuracy of the WPS varies between 1 0 and 20 metres (30 and 60 feet). software (which weighs in at a hefty 1 00 MB — it’s hard to understand why it should be so huge?) plots a brightly-coloured image while you walk around your home with your computer (Figure 5). You can then use this plot for experimenting with a robot fitted with a Wi-Fi receiver that provides the RSSI. Some commercial LPSs Several companies market LPSs or RTLSs based on wireless networks. RTLSs are standardized in ISO/ 1 EC 24730. They are often used for tracking objects or per- sons (like Big Brother). In this scenario, the receiver position is not determined for navi- gating around, but so it can be transmitted to a master system. Hospitals, for example, are very keen on these types of system to avoid losing track of their patients or equip- ment. Here are a few examples. Ekahau RTLS [3], the flagship product of the Ekahau company mentioned above, uses Wi-Fi to determiner the position of persons and objects. The system works broadly like Microsoft’s RADAR, using RSSI mapping, but has been extended with, among other things, the notions of ‘problematic paths’ (an object cannot pass through walls) and ‘relevant places’ (an object cannot be at multiple places at the same time). More than anything, this makes it possible to limit the calculation power needed, since the sys- tem itself is capable of tracking thousands of objects at once. The manufacturer also sells Wi-Fi tags to allow remote tracking of the movements of an object or person. Figure 6. This RTLS Wi-Fi tag (802.1 1 b/g/n) attached to an object makes it possible to locate it with a range of around 50 m (1 50 ft.) indoors and up to 1 50 m (450 ft.) in free field. Zebra Technologies [4] is the owner of WhereNet, which markets the WhereLAN RTLS. This product is compatible with Wi-Fi, but adds proprietary access points that use the difference in the radio signal arrival time (DToA), instead of the RSSI sig- nal. WhereLAN complies with the ISO/IEC 24730-2 standard. Zebra also offers a proprietary ultra-wide- band (UWB) radio technique: Dart UWB. This system works like a radar with tran- sponders. A network of transmitters sends short pulses of UWB electromagnetic energy to ‘wake up’ active RFID tags so they can then be read. This system offers accu- racy of 30 cm (12 in.) and reading distances up to 100 m (300 ft.). One RTLS based on ZigBee is being sold by Awarepoint [5]. In this system, a building is fitted with detectors and their position is indicated on a plan. Objects to be moni- tored are fitted with a beacon that sends out a signal periodically — every five seconds if the beacon is moving, or every minute if it is stationary. The detectors then use this sig- nal to accurately determine the location of the beacon. The position is reported back to the central unit, where the database of all the objects being monitored can be con- sulted. The grid network of detectors also monitors the RF conditions and is auto- matically adapted when the environment changes. (100809-I) Internet Links [1 ] research.microsoft.com/en-us/ um/people/bahl/MS_Projects/ RadarDemo/demo.htm [2] www.ekahau.com/products/ heatmapper/overview.html [ 3 ] www.ekahau.com [ 4 ] zes.zebra.com/technologies/ location/index.jsp [ 5 ] www.awarepoint.com [6] www.skyhookwireless.com 42 02-2011 elektor Here comes the Bus! (2) By Jens Nickel Readers whose memories stretch back to our previous issue will recall that in the first part of this series our small but highly effective team decided that electrically the ElektorBus would be based on the RS-485 standard, operating over a twisted pair. To provide reliable communications each of our bus par- ticipants needs to be able to send and receive data. The bus is wired as shown in Figure 1 , which is based on a Maxim applica- tion note I 1 !. The screenshot on the next page shows how not to do it. MASTER With all bus nodes con- nected to the same pair of wires, the obvi- ous sixty-four thou- sand pound question is: how do we make sure that only one bus node is talking at any given time? Unlike the CAN bus standard, the RS-485 standard does not spec- ify a mechanism for detecting collisions, and without such a mecha- nism we are in danger of losing data. As you might suspect, we spent some time dis- cussing the problem, coming up with several alternative solutions. The simplest approach is to make one of the nodes the boss, with the underlings simply doing what they are told and speaking only when spoken to. The master- slave arrangement has the advantage that the slave nodes can be kept very simple and to a large extent standardised, which in turn relieves the developer of a considerable burden: all the nodes can use the same micro- controller, and even be running identical firmware. The master simply issues commands like ‘take port pin PB5 High’, or ‘take a reading from ADC1 and send it to me’. The software in the slave microcontrollers then simply has to parse the commands (of which there need only be a few different types) and then suit the action to the word). However (as you might have guessed from the length of this article), there are some serious downsides to this quasi-direct access of the bus master to the slave’s I/O pins. The most sig- nificant of these is that the master must know exactly how each slave is wired. For example, if a slave includes a temperature sensor, the master must somehow know how to convert a raw A/D converter reading into a temperature value. It also makes for a lot of bus transactions. Consider, for example, the task of raising a roller blind until a limit switch is actuated. The con- versation between master and slave might go something like this: “Set port pin PB5 High.” “Done that.” “Now, is port pin PCI High?” “No.” “How about now?” “Yes.” “Okay, take port pin PB5 Low at once.” SLAVE 1 SLAVE 2 1=0 *3t* “Slaves, I’m listening to your input" “Temperature exceeds threshold here” “Slave 2, then execute your •*'* program [window shutter down]”— So as you can imagine this idea was rapidly sent on its way to the shred- der. After all, what we have is more of an inter- microcontroller commu- nications protocol aimed at a certain narrow range of applications than a true bus system. In my mind’s eye I was pictur- ing a fully-fledged home automation system, with the slaves having at least a modicum of intelli- gence. This means that a node should for exam- ple translate a raw A/D converter reading into a physical quantity so that different types of sensor, converter and microcon- troller can be mixed on the same bus without the bus master needing to know the details. It would also be desirable to implement simple control loops running within the slave (of the form ‘set output X low until input Y goes high’), which would be enough to cover cases such as the roller blind example above. It also seemed at first sight to be a little impractical to have the slaves only send messages on request. When values need to be monitored, this means that the master must interrogate the slave on a regular basis, which, besides feeling inelegant, might result in latencies unacceptably great for applications such as alarm systems. In my vision of the bus system (Figure 2) the master can go into a ‘listen mode’, waiting for a range of events = 0=1 “Window shutter closed!” 100864 - 13 g CO to CD < elektor 02-2011 43 g LO LO CD < such as ‘input 2 on slave 1 has gone low’ or ‘temperature at slave #3 has gone over 1 00 °C’. By design these events should be relatively rare, which will help minimise the number of col- lisions on the bus. “That should be enough for a modest home automation sys- tem,” said my French colleague Clemens, “but what else could we do with the bus?” “Well,” I said, “we could provide a ‘fast transmit mode’ to allow rapid point-to-point commu- nications.” That would allow us to send rapidly- changing data to the master, at least from one of the slaves. SCHEDULER “Junction 2, please transmit ''''•“Temperature okay" “ Junction 3, your turn now’’- “Junction 2, back to you\ ''' “Temperature too high here” “Junction 2, 1 need to know more “Temperature is 32 degrees C” It was obvious to us both that in this situation the bus would not be avail- able for other activi- ties and that we could in some circumstances miss important event notifications from other nodes. “We need some kind of prioritisation on the bus,’ said Clemens, ‘we need nodes that are workers, under-managers, over-managers, under-over-managers, over-under-managers...” So, like the CAN bus in a car, where (in the fullest sense of the word) vital data can always get through? “And what happens,” asked Cle- mens, warming to his point, “when we have more than one node making decisions? In your design only the master collects data, but if all the nodes have access to all data packets, there isn’t really a single master any more.” entation on ‘Time-triggered CAN’ [3]. The advantages of a time-slice architecture were very seductive, but the details involved in synchronisation would be fiddly. I also felt that it would be difficult to get such a system up and run- ning with a reasonable amount of development and debugging time, both for us and for our readers. “All right then,” said Cle- mens, “what about using some sort of scheduler?” This would allocate to each of the other nodes a time to speak based on the importance of what it might have to say, with the nodes being sched- uled in order of decreas- ing priority. “Something like a pre-emptive mul- titasking scheduler,” he explained. $T*=l ‘—“Nothing to report" 100864 - 14 Oh my giddy aunt, I thought to myself, things are starting to move quickly. If the nodes are allowed to talk to other nodes without going via the master, then we are getting close to designing a network that can tolerate faulty nodes. How do we stop the nodes from chat- tering away uncontrollably to one another on the bus? “How about allocating defined time-slices?” suggested Clemens, “though that would of course put a limit on the number of devices we could support simultaneously.” There followed an hour of furious googling and sending one another links. We discovered, for example, a Siemens patent on a time-slice-controlled symmetric bus architecture which could be used for sending home-automation commands at the same time as multimedia data streams l 2 L Also of interest was a pres- I had to concede that this approach to colli- sion avoidance was not bad, even though it was almost exactly the opposite of what I had originally envisaged. Nevertheless, the problem still remained of how the scheduler could stop a node from talking if the bus was needed for something more important. The solution to this came to me somewhat later: each node would only be allowed to send a fixed number of bytes before having to give way to the next node (Figure 3). If a node reports a higher-priority event, the scheduler would then give it per- mission to speak. All we needed to do now was to try out these fine ideas to see if they would actually work in practice... ( 100864 ) What do you think? Feel free to write to us with your opinions and ideas. [1 ] http://www.maxim-ic.com/app-notes/index.mvp/id/763 [2] http://www.patent-de.com/20030320/DE1 01 26339A1 .htm (in German) [3] http://www-lar.deis.unibo.it/people/crossi/files/SCD/An%20ln- troduction%20to%20TTCAN.pdf 44 02-2011 elektor Design tips for instrumentation amplifiers keep an eye on? When choosing the opamp, do you have to make a distinction between AC and DC applications? Also, when does it make sense to use a chopper-stabi- lised opamp? What is the maximum accuracy that can be obtained in practice?” By Ton Ciesberts (Elektor Labs) Many Elektor readers faithfully keep all their old issues and also fre- quently refer back to them when search- ing for a circuit for a particular application. Younger readers have now also discovered how to find these older circuits, because these are often of excellent quality and are still relevant to build (for those who are interested: have a look at the DVD Elektor 1990 through 1999). We frequently receive comments and questions about these old publications. This is how Elektor reader Marcus Fiese- ^ ler used the circuit from the ‘Univer- sal instrumentation amplifier’ from January 1 992 as the basis for his own measuring circuit. While he was experimenting he came up with a number of questions: “I would really like to know how to dimension an instrumentation amplifier. What are the criteria when selecting an opamp and what are the most important specifications in the datasheet that I need to For these types of ques- tions there is one designer in the Elektor lab who spe- cialises in this subject: Ton Giesberts! When designing instru- mentation amplifiers, a number of criteria are impor- tant in order to facilitate the correct selection of the opamps to be used in it. Criteria that come to mind are common-mode range, input offset, tempera- ture dependence of the input offset, bias current, temperature dependence of the bias current, bandwidth and power supply range. For battery-powered circuits the choice will quickly nar- row to rail-to-rail types. However, with many of the opamps of this type, the characteristics of the amplifier change when oper- ating close to the supply rail. When used in accurate measuring systems this is something that certainly has to be taken into account. In these situations you could consider using an invert- C37 to 00 elektor 02-2011 45 to CO ing amplifier as input amplifier. There are then also no problems the with common-mode dependency of some characteristics. With some opamps, in particularthe bipolartypes, the bias cur- rent depends on the common-mode voltage at the inputs. In a non-inverting amplifier there is a greater chance that the output voltage deviates, depending on the values of the resistors used. This results in distortion with AC voltage signals, and with DC voltage measurements a gain that appears to change with the change in input voltage. This is nowhere to be found in most datasheets. A good example of where this information is provided in the form of a chart (BIAS AND OFFSET CURRENT vs INPUT COM- MON-MODE VOLTAGE) is the OPA1 1 1 from Burr-Brown (Texas Instruments these days). But with a maximum bias current of 1 pA this is not a problem in most applications. When we look at an OP27, where the bias current can amount to several tens of nA (and because of internal bias correction this can be either positive or negative), then we can expect a problem with DC voltage stability when using larger val- ues of resistors. Because of noise it is better to choose lower impedances, and you will then also have less of a problem with DC voltage variation due to bias current. Very good opa- mps are available for extremely stable DC voltage measure- ments, such as the OPA1 77, a device with an offset of only 25 pV (F-type). For even more accurate DC voltage measurements you could consider using chopper-stabilised opamps. Devices such as the TLC2654 or ICL7650 have and offset of less than5 pV. There are also related models such as the AD8551 from Analog Devices, which possess a special auto-correction circuit (this one has an offset of only 1 pV). Their disadvantage however is that none of these are particularly fast amplifiers. With chopper-stabilised opamps it’s recommended to stay at least a factor of 1 0 below the chopper frequency. This is perhaps the reason why there are so few chopper-stabilised opamps (for example, the MAX420 and ICL7650 have disappeared from the Maxim line-up). These days there are also normal opamps with equal, if not better, specifications. More bandwidth is usually a trade-off with reduced DC volt- age stability, so you need to strike a compromise. There are now opamps that have a bandwidth of several 1 00 MHz. If a lot of gain and good linearity are required, then you could consider dividing the gain across two or more separate stages. The overall bandwidth will be greater for any given gain. For the total gain this has the disadvantage that the accuracy is reduced by about 2 % with each stage when using 1 % tolerance resistors. An amplifier stage will now need to have a potentiometer added to allow for calibration. The impulse response of the total amplifier is also more com- plex. When searching for the right opamp it is often difficult to find the desired impulse response. It is usually necessary to use frequency compensation in the feedback circuit (or some other method). With multiple amplifier stages it is nec- essary to tune the individual frequency compensations with each other. And then we haven’t even mentioned frequency compensated voltage dividers with multiple ranges. When the instrumentation amplifier functions as the front-end for an A/D converter, then the amount of noise determines the maximum resolution of the A/D converter. If you want a band- width that’s as large as is possible, then you will quickly bump into the theoretical noise of the amplifier stages and not in the last place the impedance of the voltage divider for the meas- uring ranges, too. The noise of a resistor is determined by the well-known formula a l(4KTBR ). For example, let’s take a resis- tor as a noise source and an 8-bit A/D-converter. With a 1 V reference and a desired bandwidth of 1 MHz, the value of the resistor may amount up to 1 1 5 M£1 Above that the noise will clearly exceed 1 LSB. With this calculation we have assumed ‘sine-shaped’ noise and have divided the size of the resolu- tion by 2 a/ 2 (peak-to-peak). We’ll ignore for the moment that the noise can have bigger peaks in practice. It’s a good idea to choose the impedance of the voltage divider as half the calcu- lated value or even lower. We will also assume for the moment that the voltage divider is not frequency compensated. For the resistor R we have R = ((\/ ref / 2 N ) / 2 a/ 2) 2 / (4 x 1 .38 x 1 0' 23 x 300 x 1 x 1 06) where 300 K = T; 1 .38 x 1 0 23 = Boltzmann constant K, and N is the number of bits. For 1 2 bits a resistance of up to 450 kO is allowed, at 1 6 bits, 1 .76 k£l and at 24 bits, just 26.8 m^ (with a 1 kHz bandwidth this equates to 26.8 f 1 ). Clearly, with a resolution of 1 2 bits and an even higher bandwidth — for example a digital oscilloscope and a 1 0:1 -probe — a certain amount of noise will be visible. In the active parts there is further contribution to the noise level mainly from the first amplifier stage. However, in practice, the frequency compensation will be around 1 0 kHz, for example 1 M^ and 1 5 pF. If we calculate the number of bits, only taking the noise contribution from the voltage divider: V ref / 2 N = 3.64 x 10' 5 . From this follows 2 N = 27474 or N = (log 10 27474 / log 10 2) = 14.75 bits. Add to this the noise from the amplifiers and the chaotic nature of noise, you soon realise why the resolution of those top of the range oscilloscopes is usually around 1 2 bits. When using microcontrollers for taking measurements of sen- sors, you could even use the noise to your advantage to obtain a higher resolution than that of the internal A/D converter. By using a considerable amount of oversampling and averaging you can obtain a much more accurate measurement. In addi- tion, software offers the possibilities of correcting non-lineari- ties and other defects. But that is a different story. (100812-I) Internet Links www.analog.com/library/analogDialogue/archives/39-05/ Web_ChH_final.pdf http://en.wikipedia.org/wiki/Operational_amplifier 46 02-2011 elektor Subscribe now to the leading US-based computer applications magazine specializing in embedded systems and design! — ^ \ taiiAdBi OPLKitti, Wtfli PA&E.** PWlfc M. — C\RC\1W BBU® jMtOMW »' EMBEDDED y '” \ \ . fv nm If' &T\flNS Control System Errtbecideci EDevgV Conserv atVon Select your personal subscription at www.elektor.com/cc-subs 1 2 editions per year for just Digital: $38 Print: $63 Digital + Print: $90 CIRCUIT CELLAR TILE MAGAZINE TOft CGMI’UIIEl Am (CATIONS INFRARED THERMOMETER Contactless Thermometer Are you running an infrared temperature? By Christian Tavernier (France) It’s easy these days to find several cheap sensors for contactless thermometers, also called infrared thermometers. These sensors, which measure the infrared radiation from objects, make it possible to build a contactless thermometer yourself with performance easily as good as its commercial counterparts. Technical specifications • Infra-red detecting thermometer • PIC16F876A microcontroller • Four line x 20 character LCD display • Displays ambient and object temperatures • Stores minimum and maximum temperatures • Runs off two 1.5 V cells • Open-source software Our thermometer measures at the same time both the ambient temperature and the temperature of any object placed within its ‘field of view’. And even though the ambi- ent temperature range ‘only’ goes from -40 to +1 25 °C, the object temperature can be from -70 to +380 °C, and all with an accu- racy of 0.5 °C and a measurement resolu- tion of 0.02 °C. In order to be self-contained and portable, it runs off batteries or rechargeable cells, and for even greater convenience, our ther- mometer automatically remembers the maximum and minimum temperatures of objects, and displays everything on a backlit LCD display with four lines of 20 characters. Thanks to the sensor used, it only needs two ICs: a perfectly ordinary PIC microcontroller and a switching regulator to power it. MLX90614 sensor The sensor we’ve chosen is the MLX9061 4 from Melexis, and it’s this that gives our thermometer its excellent performance. This 1C, which comes in a metal TO-39 pack- age with a window, should not be regarded as just any old temperature sensor, like a thermistor, for example, as it includes a whole load of processing and shaping cir- cuitry (Figure 1). The sensor proper is an infrared thermopile (or two, depending on the 1C version) that delivers a very low, non-linear signal which would thus be difficult to use directly. This signal is first amplified by a chopper-stabi- lized opamp. It is then converted to digi- 48 02-2011 elektor INFRARED THERMOMETER tal in a delta-sigma type converter before being applied to a digital signal processor (DSP). After noise filtering and sensor sig- nal processing performed by this DSP, the temperature information is available in a directly-usable digital form. To simplify interfacing, the sensor can pro- vide this information via a 2-wire SMBus (virtually identical to the l 2 C) or in the form of a PWM (pulsewidth modulated) signal. Although the latter mode does make it simpler to connect up the MLX9061 4, the PWM signals are trickier to process than those from the SMBus. What’s more, the resolution in PWM mode is only 0.14 °C, as against 0.02 °C in SMBus mode. Depending on the version, this 1C runs off a single power rail of either 3 V or 5 V, so you need to pay great attention to which type you’ve got before fitting it into this circuit — we nearly learnt the hard way... Talking to the sensor If we decide to communi- cate with the sensor in SMBus mode — which is what we’ve done in our thermometer — the syntax to be used is relatively simple, provided we don’t want to modify the internal parameters, which are factory-set but perfectly suit- able for our needs. To read the ambient temperature and the temperature of the objects the sensor is aimed at, all you have to do is read from two different locations in its internal RAM, which is done using an SMBus frame similarto the one in Figure 2. After sending the sensor its slave address, all you then have to do is send it a com- mand, chosen from those proposed in Table 1 as far as temperature measure- ment alone is concerned. Sending its slave address again then lets you receive back two bytes containing the LSB and MSB of the temperature, followed by a check poly- nomial, marked PEC in Figure 2, which we won’t be using here. The temperatures, expressed in Kelvin, are represented by unsigned 15-bit words. If 0 0 81101 / I / X v t° ADC DSP PWM STATE MACHINE 90302 Voltage Regulator 100707 - 12 Figure 1 . Internal block diagram of the MLX9061 4 sensor. 1 7 l l 8 l 1 7 l 1 S Slave Address Wr A Command A Sr Slave Address Rd A 8 1 8 1 8 1 1 Data Byte Low A Data Byte High A PEC A P 100707 - 13 Figure 2. Principle of one of the sensor’s RAM read frames. Table 1 . The main commands for reading the temperatures. Command Code (hexadecimal) Raw ambient temperature 0x03 Temperature, IR sensor 1 0x04 Temperature, IR sensor 2 0x05 Linearized ambient temperature 0x06 Linearized sensor 1 temperature 0x07 Linearized sensor 2 temperature 0x08 we call the 1 5-bit word output N, and given the sensor resolution in SMBus mode, the measured temperature T expressed in l< is given by: T= 0.02 x N But as it’s more user-friendly to read a tem- perature in degrees centigrade (Celsius), the thermometer software simply uses the formula: T= 0.02 xN - 273.1 5 If you’re not familiar with the SMBus, don’t worry, it’s 99 % identical to the better- known l 2 C bus. It only differs in a few sub- tleties in the protocol, which are unimpor- tant here, and by a small difference in terms of the electrical levels; a difference that very fortunately PIC microcontrollers with an l 2 C interface are able to handle, as long as we correctly program one bit in one of the con- trol registers in their MSSP interface. Thermometer circuit Clearly, the sensor’s high degree of integra- tion simplifies the circuit of our thermome- ter, which can therefore be based on a sim- ple PIC microcontroller, as long as it has an l 2 C interface. Here the 1 6F876A was chosen. As shown in Figure 3, our PIC is used in crystal clock mode (20 MHz) and has a manual reset command via the button SI , included to allow the memories containing the maximum and minimum temperatures to be reset. elektor 02-2011 49 INFRARED THERMOMETER COMPONENT LIST Resistors (0.25W 5%) R1 ,R4,R6 = 10I<£1 R2,R5 = 100^ R3 = 1.5kn PI = 10 k^trimpot, horizontal Capacitors Cl ,C3 = 1 OOjiF 1 6V, radial, lead pitch 2.5mm C2 = 470nF 63V, MKT, lead pitch 5 or 7.5mm C4 = 1 OjiF 25V, radial, lead pitch 2.5mm C5, C8 = 22pF ceramic, lead pitch 0.2” (5.08mm) C6 = 1 0OnF ceramic, lead pitch 5 or 7.5mm C7 = 1 0nF ceramic, lead pitch 5 or 7.5mm Inductors LI = 1 0pH, Panasonic type ELC08D1 00E (RS Components) LCD1 riii • hh # ■■■■■■■■a C6 • • t||fe IC2 R1 R3 R4 R6 ® ® ® C5 C8 | j| j j »||« HI* "(HI*) 5555 R2 D2 St St ' PI C4 IC3 C2 / • hn @) r<^ . u ¥ f (C)Elektor 100707-1 VI .0 •Mo® !'•«■■ K1 SCL SDA VDD VSS Semiconductors IC1 = LT1300 IC2 = PIC16F876A-I/SP, programmed, Elektor #100707-41 IC3 = Sensor type MLX90614ESF-BAAor MLX- 90614ESF-AAA (see text) D1 = 1N5817 (must-have Schottky) D2 = 3.3V 0.4W zener diode Miscellaneous LCD1 = LCD, 4 lines of 20 characters, e.g. Dis- playtech 204A XI = 20MHz quartz crystal, HC1 8/U case 51 = pushbutton, 1 make contact, ITT type D6 if fitted on PCB 52 = swich, changeover, or wire link DIL 1C sockets: 1 pc 8-way; 1 pc 28-way Pinheader pins, lead pitch 0.1 ” (2.54mm) Pinheader sockets, lead pitch 0.1” (2.54mm) PCB, Elektor# 100707-1 The display used is an LCD type, with or without backlight as you prefer, depend- ing on whether or not switch S2 is closed (or a link is fitted). Ideally, you should use a perfectly standard type with four lines of 20 characters, but the circuit also works with a pin-compatible two-line, 16-charac- ter type. In this instance, the two lines dis- playing the minimum and maximum are not visible, which is a bit of a shame. The display is used in 4-bit mode, driven from port B of the microcontroller. The two bus lines coming from the sensor terminate at RC4 and RC3 of the PIC respec- tively, the inputs to parallel port C, which are shared with its internal l 2 C interface. The circuit is powered at 5 V from two 1 .5 V cells (or two 1 .2 V NiMH rechargeables) by way of the LT1 300 switching step-up DC-DC converter. This 1C provides a stabilized 5 V output from any input voltage between 2 and 5 V. It is capable of supplying a current of 400 mA, i.e. a great deal more than is needed for our thermometer. Although the sensor does exist in a 5 V version, the most readily available at the 50 02-2011 elektor INFRARED THERMOMETER moment is the 3 V version. This explains the reason for resistor R2 and its associated zener diode (D2). Note here that the SMBus load resistors R4 and R6 are returned to the 5 V rail all the same, in order to guarantee correct electrical levels at the PIC input. But there’s no risk to the MLX90614, as it has internal limiting diodes. Software The software (copiously annotated source code and HEX file) is available for free down- loading from [i] and I 2 !. It has been written in Mikro Basic from Mikroelektronika, which has the advantage of having available a per- fectly functional l 2 C library. Note that the size of the compiled software is over 2 KB and so it can’t be compiled using the demo version of this compiler. temperature and 0x07 for the temperature of the object); • send a repeated start signal; • send the IC’s slave address, this time with Read mode selected (R/W = 1 ); • receive a series of three bytes: the LSB and MSB of the temperature, then the PEC (not used in our application); • send a stop signal to terminate the l 2 C/ SMBus transaction; • and finally, reconstruct the 1 5-bit word containing the temperature by concatenation of the two bytes received. We’ll leave you to analyse the rest of our program with the help of our copious notes, and move on to the practical aspects of construction. Judging by the content of the Internet forums devoted to the MLX90614, some users seem to have encountered difficulties, so we thought it would be worth comment- ing here on the relevant section of code. The procedure for reading the temperature is called using the parameter ‘com’ for the chosen command. The procedure then scru- pulously adheres to the instructions from Melexis, namely: • send a start signal to start the l 2 C/SMBus transaction; • send the IC’s slave address (Melexis specifies in the data sheet that all the ICs respond to the address 0x00) with Write mode selected (R/W = 0); • send the command contained in the variable ‘com’ (0x06 for the ambient Construction With the aim of simplifying the mechanical side of building the thermometer, we’ve designed a PCB the same size as the dis- play board, so it can be mounted on the back of it. Sourcing the components should not pre- sent any problem. The display used is a Dis- playtech 204A, but in theory at least any 4 line x 20 character LCD display using a standard interface (ST7066, HD44780, or KS066 controller) will do, as well as any 2 line x 1 6 character LCD display, as indicated above, albeit with the loss of the min. / max. display. The MLX9061 4 exists in numerous versions, distinguished by the part number suffixes. The commonest and cheapest version is Sub p r oc e dure R e a d _ t e mp ( d i m c 0 m as by t e ) 1 2 C 1 St ar t ( ) issue 1 2 C s t a r t s i gna 1 1 2 C 1 Wr ( 0x00) send a d d r e s s (d e v i c e a d d r es s + W) 1 2 C 1 Wr (com) send c 0 mma nd 1 2 C 1 Re peat ed _ St a rt() 1 issue 1 2 C s i gna 1 r epe at e d s t a r t 1 2 C 1 _ Wr ( 0x01) send a d d r e s s (d e v i c e a d d r es s + R) Sen s 0 r L ow = 1 2 C 1 Rd ( 1 ) 1 Read t e mp . 1 0 w by t e ( a c k nowl e dg e) Sen s 0 r H i gh = 1 2C1 _ Rd ( 1) ' Read t e mp . h i gh b y t e ( a c knowl ed ge) PEC = 1 2 C 1 _ Rd ( 1) Read PEC ( n 0 t u s e d) 1 2 C 1 _ S t op() issue 1 2 C s t op s i gnal Sen s 0 r R aw = S e n s 0 r L 0 w + ( Sens 0 r Hi g h < < 8 ) 1 Bu i 1 d t e mp , wo r d End sub the MLX9061 4ESF-BAA. The letter B indi- cates that it runs on 3 V. If you come across an MLX9061 4ESF-AAA, this is a 5 V version that can still be used in our circuit, but in that case you’ll need to remove D2, C4, and C7, and replace R2 by a wire link. Note that LI must be capable of carrying a current of 800 mA without saturating. Oth- erwise the LT1 300 will work very badly, or not at all. The sensor can be remoted to the case via the four connecting pins provided for the purpose, but to avoid possible interference and distortion of the SMBus signals, it’s preferable not to extend its connections more than a few tens of cm. We fitted 2.54 mm (0.1 ”) pitch sockets on the back of the display and pins at the same pitch on the copper side of the PCB. In this way, you can produce an assembly that’s easy to remove in the event of problems. Use and adapting to your own needs The thermometer operates as soon as power is applied, and the first line of the display gives you the ambient temperature, i.e. that of the sensor case. The second line shows the temperature of the object the sensor is pointing at, i.e. the average of the temperatures of the objects in the sensor elektor 02-2011 5 i INFRARED THERMOMETER Can also be read without contact, but using a mobile phone. window’s field of view. The angle of view of the standard version (MLX90614ESF-XAA) is not stated. For the MLX9061 4ESF-XAC it is 35°, and 1 0° for the MLX9061 4ESF-XAF. The maximum and minimum object tem- peratures are stored automatically, and display on the last two lines of the display. They are updated at the same time as the measurements, which take place once per second. To reset the minimum and maximum, all you have to do is press the reset button. You can adapt the software to your own needs and make the thermometer behave quite differently. However, if you want to modify the procedure that handles the communication with the sensor, only do so if you really know what you’re doing, as it is possible to write to it, and incorrect writing may destroy or modify its factory-set cali- bration parameters, rendering any subse- quent measurements inaccurate. ( 100707 ) Internet Links [1 ] www.elektor.com/ 1 00707 [ 2 ] www.tavernier-c.com +3V (±> ci cn 100u 25V ®-"- LI rVYVY lOuH V, IC1 sw SELECT SENSE LT1300 SHDN GND ■lim PGND D1 1N5817 Tr6 Tr4 Tr2 8 IC3 MXL90614 K1 f o- SCL SDA VDD VSS I C3 ] lOOu 25V C6 lOOn 470n - SDA 2 _ 3_ 4_ 5_ 6 7 15 SCL 14 i3_ 12 _ 11 20 VDD MCLR IC2 RBO RAO/ANO RBI RA1/AN1 RB2 RA2/AN2 RB3 RA3/AN3 RB4 RA4/TOCKI RB5 RA5/AN4 RB6 PIC16F876A RB7 RC4/SDA RC3/SCL RC5/SDO RC2 RC6/TX RC1 RC7/RX RCO VSS OSC1 OSC2 VSS C4 □ lOu 25V C7 lOn C5 XI . 20M r Hz 10 24 25 26 27 28 16 17 18 19 C8 22p ^22p 400mW LCD1 ( \ LC DISPLAY V J c/j Q I> C/5 Q O CO IS > > > a. a. oooaaooa<^ CONTRAST 10 S2 BACKLIGHT R5 1 100R |- X 11 12 13 14 15 16 100707 - 11 Figure 3. Complete circuit of the contactless thermometer. 52 02-2011 elektor AUDIO & VIDEO TimeClick Programmable camera controller Carlos Ladeira (Portugal) This project dubbed TimeClick controls a digital SLR camera without human intervention using a wired connection. It can take photographs at fixed or random time intervals or in response to sensor input, which makes it suitable for various purposes from HDR photography to sound-triggered pictures. This project came about after having taken too many photos randomly at events like parties. This way of operating a camera can lead to funny results at best. However, as the project developed, the author started to have new ideas and added several new fea- tures to extend the functionality, such as: • Fixed delay between photos • Random delay between photos • Sensor input to trigger photos • Manual operation for use as wired remote • Bulb mode • Mirror lock • Exposure bracketing • 1 2 presets to save different sets of configurations Operation is remarkably simple and once the device is configured and wired to the camera, you simply choose the right spot for the camera on a tripod and let it do all the work. Depending on the power source used for the device and the camera, you can have the camera in operation for days. Tools used The circuit started out on a breadboard and later evolved into a complete PCB design. For the hardware design (schematics and PCB) open-source CAD program Kicad was used. It is very easy to use, even for first time Elektor Products & Services • Firmware (free download): • - PCB artwork: # 1 00371-1 .pdf #100317-1 1.zip • - Hyperlinks in article • Programmed ATtiny861 microcon- • Manual (free download): Items accessible through troller: # 100371-41 100317-W.pdf www.elektor.com/ 1 00371 elektor 02-2011 53 AUDIO & VIDEO LCD1 D1 Figure 1 . Schematics users. Since the author has done every- thing at home (PCB making using the iron- ing method), no metallised holes have been used and all connections between both lay- ers of the PCB are made using wires or com- ponent pins. For the software design AVR Studio 4 was the development tool. The microcontroller programming was done with Atmel’s AVR Dragon using ISP mode. In the beginning the author experienced some troubles with AVR Studio and AVR Dragon. Sometimes AVR Studio seemed to be able to connect to the AVR Dragon but unable to communi- cate with the microcontroller. This problem was solved once by restarting the computer and ultimately by completely reinstalling AVR Studio. From what can be found in postings on the Internet by users with simi- lar problems, we’ve a hunch it was caused by a bug in AVR Studio mixed with inappro- priate procedures. The advised procedure for programming the microcontroller can be found under Assembling & Programming. Hardware description Starting with the power supply, there are two options for powering the device. One is using an internal 9-V battery, the other is using an external power supply. A power switch has been added in this section of the circuit, see Figure 1 . The author’s prototype used six AAA batteries instead of a 9-V block battery, mostly because of the poor battery life of the 9-V block type (IEC 6LR22). Under normal operation the circuit con- sumes about 1 0 mA with the LCD backlight off. If the LCD backlight is on, current con- sumption rises to about 100 mA. To save energy during operation, the LCD back- light is turned off automatically when no buttons are pressed for 1 0 seconds. To turn the backlight on again, just press any of the device’s buttons. Since the LCD needed 5 volts and the same voltage was suitable for powering the rest of the circuit, the author went for a stand- ard voltage regulator. Thus, the first pick was the well known 7805. However, a quick change of mind occurred after a close look at the datasheet. A 7805 needs at least 7 volts at its input to be able to stabilise its output at 5 volts. This of course isn’t any good when you want to power your circuit from batteries. Moreover, the 7805 is not known for its high efficiency... As result of all this, an LP2954 seemed much more appropriate. This is a regula- tor with reverse battery protection and a low dropout voltage which helps to extend battery life. There is a battery level indication option included using R1 1 , R1 2 and a free ADC port (ADC9) of the microcontroller. The heart of this circuit is an ATMEL ATtiny861 which fits the bill exactly. The main reason for the author to choose this microcontroller instead of another from the Atmel family was mostly because of its availability in SOIC-20 package. This pack- age is not too hard to solder and still is rela- tively small. The microcontroller operates at 1 MHz. Here, you have two options: just use a crystal of 1 MHz or an 8 MHz device and set the CKDIV8 fuse when programming. The 2x1 6 LCD is used to show information and allow the user to configure the device. It’s being used in 4-bit mode and the LED backlight is controlled by the microcon- troller through N-channel FETT2. 54 02-2011 elektor AUDIO & VIDEO The keyboard input is implemented using one ADC input (ADC6) instead of several (digital) ports. That way there is no need for a controller with more input ports and consequently no larger package is needed. The voltage the ADC reads depends on the key pressed. When no key is pressed, the ADC will read roughly 5 V. All ADCs work in 1 0 bit mode, which means the value read lies between 0 and 1 023. With 5 V on the ADC pin, the software will read 1 023. If a key is pressed, the voltage on the ADC pin may be calculated using the formula: ^adc = ^cc - (R1 5 x V cc ) / (R1 5 + R sw ) where V cc = 5 V, R1 5 = 1 0 k£l and R sw = 1 .5 kn, 5.6 kQ, 1 5 k Cl or 68 kQ. depending on the switch pressed. The four keyboard switches have the fol- lowing functions: MENU, MINUS, PLUS and ENTER, with which you can adjust the set- ting of theTimeClick. ADC5 is used for sensor input. The sensor is connected through a 3.5-mm jack socket. At the tip there is 5 V available for powering the sensor. The ring carries the sensor out- put signal and the shield is grounded. There are three types of sensor included in the schematic: a light sensor, a sound sen- sor and a vibration sensor (piezo). But of course the sensor range can be extended to whatever sensor you need. To avoid con- nection mistakes, the sensor input jack and the output jack have different sizes. The output signal is available at a 2.5-mm jack socket, as found on some Canon cam- eras. For safety reasons the output of the microcontroller is coupled to the jack via an optocoupler. This device can be used with many differ- ent camera models (see inset Camera Com- patibilty Guide); you only need to have the right adapter cable and the camera should be able to work with the implemented protocol. This protocol is rudimentary: it uses three pins: 1— ground; 2— ring and 3— tip. When pins 1 and 2 are shorted, the camera behaves the same as when the shutter but- ton is halfway pressed. When pins 1 and 3 COMPONENT LIST Resistors T1 = BC547 R1,R10 = 4.7kn T2 = BS170 R2,R13,R14 = 1 k£2 IC1 = LP2954IT R3,R4,R12,R15 = 10kn IC2 = ATTINY861-20SU, programmed, Elektor R5,R9 = 100k£l #100371-41 R6 = 470k£2 IC3 = LM358P R7 = 47 k£l R8 = 1£2 IC4 = CNY74-2 R11 = IMn Miscellaneous R16 = 68k£2 K1 = 6-pin (2x3) pinheader, lead pitch R17 = 15ka 2.54mm (0.1”) R18 = 5.6ka l<2,l<3,l<4,K5,K7,l<1 0,l<1 1 = 3-pin pinheader, R19 = 1.5ka lead pitch 2.54mm (0.1 ”) PI = 10k£itrimpot K6,Bt1 = 2-pin pinheader, lead pitch 2.54mm P2 = 100kf) trim pot (0.1”) SI = switch, SPST Capacitors S2,S3,S4,S5 = 6 mm tactile switch type Cl ,C2 = 22pF MC32830 C3,C6,C7,C8,C9 = lOOnF l<8 = PCB jack socket, 3.5 mm, stereo, e.g. C4,C5 = 10|iF 25V radial Lumberg type 1 503 09 CIO = lOOpF l<9 = PCB jack socket, 2.5 mm, stereo, e.g. Lumberg type 1 501 06 Semiconductors XI = 8MHz quartz crystal D1 = BPW16N photo transistor LCD1 = LCD, 2x16 characters, Lumex type D2 = 5. 1 V 400mW zener diode LCM-SO1602DSF/A Figure 2. Component layout are shorted, the camera behaves like the shutter button is fully pressed. Sensor operation The way the sensors work is very easy to understand. The microcontroller reads the ADC input receiving the voltage a sensor generates. Regardless of the type of sensor used the microcontroller waits for a tran- sition (rise or fall) across a trigger value. When this condition is met, it acts accord- ingly depending on the configuration, i.e. elektor 02-2011 55 AUDIO & VIDEO Camera Compatibility Guide TimeClick was successfully tested with a Canon 500D, which has a 2.5 mm jack intended for a remote control (E3-type) and a Canon 7D that has a Canon N3 connector for the same purpose. As a result, all cameras from Canon with 2.5 mm jacks should be compatible with TimeClick. This includes models 1 000D, 550D, 500D, 450D, 350D, 300D and 60D. The N3 connector is present in Canon models EOS 1 D, 5D, 5Dml<2, 7D ,1 OD, 20D, 30D, 40Dand 50D, so these should be compatible too. Of course in this case — since N3 connec- tors are difficult to obtain — the easiest way is to buy a special connecting cord or a cheap remote trigger and just use the N3 connector. Connecting cords are available from l 3 i for example (go to ‘Remote Accessories’ in the ‘Remote Cords/Wireless/Infrared’ section). Other brands haven’t been tested, but a search using Google revealed that all Pentax cameras use the same pinout as the Canon cameras, so it’s very likely they are compatible. Nikons have different connectors, but they have the same basic functionality. They use an MC-DC1 connector on models D70, D70s and D80, a MC-DC2 connector on models D90, D31 00, D5000 and D7000 and a 1 0-pin connector with different names (MC-20, MC-22, MC-30, MC-36) on models D200, D300, D700, D3 and D3x... So perhaps they can be used with TimeClick too. We would like to hear from you if they do (or don’t). Everyone’s invited to post their findings on the Elektor forum. waits a configured time expressed in ms and then fires the shutter. Always turn off the power before plugging and unplugging the sensors. This way short- circuits inside the mini-jack connectors are avoided. Software description The source code, freely available from PI, was written completely in C language using the very efficient compiler avr-gcc. About 99% of the 8 K flash space of the microcontroller is used to store the pro- gram. It was hard to squeeze all the fea- tures into the device. Several code opti- misations were required. All configuration data are preserved in the EEPROM of the microcontroller. The program operation is clearly com- mented; the program does the initial setup and then enters an endless loop. Inside this loop is where all the action happens. TIMERO is configured to generate a pulse every second to take care of all timing mul- tiples of 1 second. To allow for maximum flexibility, there are 12 different profiles where the user can save different operating configurations. Each profile can be renamed to indicate the function it was created for. For example, the user can have a profile for ‘Lightning’, one for ‘Drops’, and so on. Included in the source code at P] is a file with the EEPROM contents of several preconfigured modes. Assembling & Programming A printed circuit board and a programmed microcontroller can be purchased from the Elektor Shop PI. When assembling your device, start with the lowest profile compo- nents and work your way up to the tallest ones. Figure 2 shows the PC board compo- nent layout. The LCD and switches need to be mounted on the copper side of the PCB. Once the board is populated, it is time to put some intelligence in! The programming of the Atmel microcontroller is done byway of ISP connector K1 . Assuming you’re using AVR Studio and AVR Dragon / AVR ISP pro- grammer, here is what you should do: First choose the appropriate device in the menu Project -> Configuration options. Next, the programmer and the TimeClick device should be connected. However, since the author experienced some mysterious occurrences in this step, he advises to stick to the following order: 1. With both TimeClick and AVR Dragon/ ISP powered OFF, connect the ISP cable between them. 2. Then connect the AVR Dragon/ISP to a USB port capable of supplying more than 300 mA. 3. Now you can power up TimeClick. Next, go to the menu Tools -> Program AVR -> Connect to choose the appropriate pro- grammer/port and press Connect. Figure 3 shows the window you should see right now. It’s important that the programming mode is set to ISP and that the ISP frequency is set to 1 25 KHz (< 14th of the device clock). If everything checks out, an ‘OK’ should be returned after you press Read Signature. Now we’re ready to set the fuses to the correct values as shown in Figure 4. SPIEN is active as factory default. If you used an 5 b 02-2011 elektor AUDIO & VIDEO Mar pigjrn L _r!*ii LMfcbt* ,5 *lswm *-'i’i' Eauvji j HhVrt: : hit L'-itiT . It BlSIMII S'jr^.pp rrjdii-n !pd :Fvkf F : :-:j trzTf . i _ Midi ml 7. ■ j 1 Tri ! ■ b i iSFrwrf* □ K 1 Offl 1 1 r. HAS, W)tr OKI Le-ftvrs pigarmns "sih OKI Eras* &s«* Raid S-graUi E J !3r i TOijeny IfSfrl'Hf AWT Piiyrr Hi-iP mrnJp a *i iTlinjifil ! fieysn r d»: Lsdtfci ’ jSowcM ‘-'iV HSfsi j ►OV Mt | Mia •-.nr WiPPaWN □ FtfTDliSl E **N V.'DTCiN KniF.TL frrwitU MPiai M VTC-4 IV * rrrarv? Wouf &iT_CK5EL Ck be JMDMt«j:.aw^t«rWlJ>WN.11E5t’r ISKQUIt anfJdjfD QtFF H1&4 Mt idw felB Iytu£ «Rnrgi ■ pt^jnnm t I rtQ4m Va^r ~| OK 1 bfie^gpwsw^rjP^St OS’ n>.%V.;^.w wUMtCla/ IkTD HE lilT C<’ Le-tvrs P :jar« T f v ; is* OK.' AvP Rkiyun m T^P' mi!# ailh ilHlny frS L »*r %r hiMI | LidCbll < A*WBSd j HW S"fj> j MW Ks-J lUl Cy-ivfl bp° Iwjth* ] J R'Jtw ikirvEH Indira I - n '-' . nr j FUi -■' \'vi\ dewi LW Q*r*i SrrJ&r'b nfdn Utr-m 1 £ VlLvJ ' P fK'V Li T &' T WkLVifl i TWn&*"jWfc |~j Fngrin VsVy Read rFPSOH “ Ircu: j iEa Th LOS - H fEuC 1 S', l IwOdtAVH I *H&KUd B. j Ftsstti | [ V*#¥ [ HtiJ ] r.r PKdLcfaari fin Forrui i^aFTta fT| Si™* IW j- , !A3K :V EtTJlOM P Lists LOCKfil T3 fvm ^ fajd*. I— 1 |— —4 --uB H tpK^frib^V: Sawi j'ni^i fa £U CW-.-j-.j; ?lSD A'-H LXe-jwi Ii&jw sn USB S-4K CJC Figure 3. Connecting to the device. Figure 4. Setting the fuses correctly. Figure 5. Programming the microcontroller. Battery level Sensor mode Operation mode Active profile Frames count F [ 3. names : a @ 0 : 09 : 58 1 Message area Metering mode Bulb mode Mirror lock Exposure Bracket J y v v v iniF+~ Qele 100371 - 12 8 MHz crystal, you should also check the CKDIV8 fuse as shown in the screen capture. It is also important to set the correct clock source, in this case select ‘External Crystal 3.0- 8.0MHZ’. The Brown-out detection could avoid EEPROM corruption with batteries at the end of life, so set this to 4.3 V. Finally, it’s time to program the device. All the needed files are inside the ZIP-file associated with this arti- cle (1 00371 -11 .zip, see PI). Down- load and extract this file. In the flash area, select the file TimeClick.hex and hit the Program button (Figure 5). At the end, the device will reboot. If you want to use the preconfigured EEPROM settings, in the EEPROM area select the file TimeClick_Con- figured_ee prom. hex (also inside the downloadable zip package) and hit the Program button. Figure 6. Information shown on display. • Number of photos taken so far • Metering setting • Bulb setting • Mirror lock setting • Exposure bracketing setting Some of this information is presented using custom characters defined in the software. Pressing the MENU key while the main screen is being displayed, ena- bles the user to enter the menu where the configuration takes place. The menu is intuitive and easy to navigate. Press MENU to go back, PLUS and MINUS to change val- ues and ENTER to go forward. For a more complete reference about the operation of the TimeClick, there is a user manual available at PI and the author’s website PL (100371) Software Operation With the device programmed, it’s ready for use. When the ENTER key is pressed and held during device power on, a reset to fac- tory defaults of all configuration possibili- ties can be carried out. This option will erase all saved configurations, even the precon- figured EEPROM settings mentioned before. In the main screen the following informa- tion is always visible: • Battery level in steps of 25% • Sensor mode • Operation mode • Active profile Internet Links [1 ] www.elektor.com/ 1 00371 [2] http://timeclick.no.sapo.pt [3] www.enjoyyourcamera.com elektor 02-2011 57 MIAC & FLOWCODE MIAC Controlled Underfloor Heating System Totally programmable with Flowcode By Ben Rowland (United Kingdom) This heating system sketched in this article keeps you warm in cold times and with the help of Flowcode software is designed for total adaptability to heating capacity and other parameters. The MIAC (Matrix Industrial Automotive Controller) supplied by Elektor is an indus- trial grade control unit similar to a PLC but more feature packed and easier to program without having to resort to using ladder logic. It’s based on the powerful 18F4455 PIC microcontroller and can be directly con- nected to USB, making programming — via Flowcode, C or Assembly — a breeze. An LCD, pushbuttons, four relay outputs, eight inputs — selectable analogue or digital — and a CAN connection complete the system. The main purpose for the MIAC is industrial applications. Hence it makes use of voltages of 12 volts instead of the 5 volts normally applied in PIC microcontroller systems. Practical application... In this article we demonstrate how we can replicate an expensive underfloor home heating system at a fraction of the normal costs. This heating system consists of a few major key elements: • a boiler • electronic valves • a thermostatic mixing valve • a central heating pump • an air release valve • PEX underfloor piping • an AC power residual current device (RCD) • temperature sensors • a MIAC • compression fittings to assemble manifold ...and implementation Figure 1 shows a basic schematic of a two loop underfloor heating system. We let the MIAC use a lookup table technique to read the temperature of thermistors tl and t2, which are situated in the floor near the PEX heating loops. The lookup table data is generated using an Excel spreadsheet with values matching those of the thermistors (included in the free download 1 00871-1 1 . zip from the Elektor website PI). When the temperature of the thermistors drops below a threshold value, we check to see if the individual loops are enabled. If they are, we open the valves connected to the individual loops. We then switch on the pump and the boiler. An example pro- gram — Heating System.fcf— is included in the download from PI. As the water from the boiler output starts to heat up, the thermostatic mixing valve does its work and starts to mix the cold water from the output of the PEX loops with the hot water from the boiler. We can mon- itor the temperature of the water running through the PEX loops by reading thermis- tor t3. When this temperature has reached the required level, we can shut off the boiler and we can also shut off the pump. Every so often we can activate the pump for a bit to circulate the water and ensure that it is still up to temperature. Please note that the RCD is an essential part of the system, as it could make the differ- ence between a nasty shock and death if you were to come into contact with a live cable. With reference to the existing boiler and thermostat, wiring should be implemented so that the room thermostat can still work when the underfloor heating system is not running. The example program is very basic and sim- ply checks the return temperature t3. When t3 drops below a threshold value, the tem- peratures of tl and t2 are read into the sys- tem. Depending on these temperatures the valves to the PEX loops are opened and then the boiler and the pump are switched on. When the return temperature t3 returns to a value above the switch off temperature the pump and boiler are switched off. Improvements The program could be improved by allow- ing loopl and loop2 to be enabled or dis- abled separately to allow for zones to be left unheated if required. Another way to improve the system would be to add a timer functionality to allow the temperatures to vary, for example drop slightly during the night. The file MIAC_Underf1oor_vl .1 .fcf, found in the download 1 00871-1 1 .zip on PI, con- tains the latest version of the author’s ther- mostatic heating controller program for the MIAC. It has lots of functions and allows you to save up to 40 programmable events, directly control the system, it has fill and drain modes, temperature settings for each zone, back-off temperature settings and a lot of other bits and pieces. The green menu button accesses the main menu that allows you to set up the device. The author decided to simply use thermis- tors for each zone for now rather than cre- ate a CAN network of sensor nodes mainly because of time limitations on the project. The thermistors he used (Rapid # 61 -041 0) are simply connected between 1 2 V and the MIAC input terminal and the lookup table provided in the file works to translate the readings to degrees centigrade. If a warm-water based system is not for you, then the MIAC can also be used to directly drive electrical underfloor heating elements. The relay contacts are rated up to 1 800 - 2000 W at AC grid voltage allow- ing you to drive small through to large, 58 02-2011 elektor MIAC & FLOWCODE Elektor Products & Services - MIAC, ready assembled * - MIAC and Flowcode 4 Bundle* - 3x MIAC and Flowcode 4 Bundle* - USB Ato B mini lead* - Flowcode program: # 1 00871-1 1 .zip* * available atwww.elektor.com/miac ** accessible through www.elektor.com/ 1 00871 high power heating mats. To do this, you would connect the Neutral and Ground sig- nals from the AC powerline to the heating mat. Then connect the Live from the AC grid through one of the MIAC relays to the Live from the heating mat. If you want full electrical separation when the mat is not in use, then you will have to use a second relay to connect and discon- nect the Neutral connection. Again an RCD should be used along with a great deal of precaution to avoid any injury caused by contact with AC powerline voltage. Electri- cal underfloor heating mats should also be placed on an insulated layer to avoid a high percentage of the heat escaping directly into the ground. Word of warning Please note that all electrical work will need to be inspected by a qualified electrician. Electrical regulations may differ from coun- try to country, so make sure you check your local legal requirements. Also the wattage quoted for the electrical heating mat is sub- ject to a 250 VAC system. The amperage on the relay outputs, the screw terminals and the PCB tracking of the MIAC is rated to 8 A. Therefore at 250 V the theoretical power is 250 Vx 8 A = 2000 W. At 1 1 0 V the wattage drops to a theoretical maximum of 880 W. The author is in no ways a qualified plumber or a qualified electrician so got advice from qualified personnel when installing the sys- tem and then signed off the electrical and heating systems with approved profession- als. If you decide to do similar things using domestic AC grid voltages or plumbing sys- tems, then please ensure to get help and advice from qualified professionals in your area before you begin and again before you switch on or commission the system. Some pictures of the author’s installation work can be found on l 2 l, where more infor- mation about MIAC and Flowcode is also available and help is on stand-by. (100871) Internet Links [1 ] www.elektor.com/ 1 00871 [2] www.matrixmultimedia.com/mmforums w RCD L PSU I I r 1 DC Q1 Q2 1 MIAC Q * L> a, B 1 2 3 J MIAC CONTROLLED VALVES UNDERFLOOR PIPES % THERMISTORS BOILER PUMP (*) E3 THERMOSTATIC MIXING VALVE 1 O G AIR RELEASE VALVE L_l 1 — ' t RADIATORS Figure 1 . Schematic diagram of a heating system using an Elektor MIAC as the controlling unit. Figure 2. Using Flowcode for programming the MIAC is quite straightforward. elektor 02-2011 59 MICROPROCESSORS Linux’ed Telephone-to-VolP Adapter Quick Recipe Asterisk, Linux, No telco bill. By Angelos Varvitsiotis (Greece) This open hardware & software project is a USB-connected interface that links a Voice-over-IP (VoIP) system to an analogue phone set or similar equipment like an analogue exchange. The powerhouse board works under Linux using the renowned Asterisk IP PBX software, and at a stroke enables you to use your home telephone set to connect to the VoIP world. Are you ready for some acronyms? Engi- neers use them all the time and the tele- phony/telecomms industry has plenty! Like: an FXS (Foreign exchange Subscriber) interface (the plug on the wall) delivers POTS (plain old telephone service/system) from the local phone company’s CO (Cen- tral Office) and must be connected to sub- scriber equipment like telephone sets, modems, and fax machines. In other words, an FXS interface points to the subscriber. An FXS interface provides the following pri- mary services to a subscriber device: dial tone, battery current and ring voltage. Note that all three services come with different values and parameters in countries around the world. Sometimes the FXS acronym is also rendered as Foreign exchange System. Now, an FXO (Foreign exchange Office) interface (the plug on the phone) receives POTS, typically from a CO of the PSTN (Pub- lic Switched Telephone Network). In other words, an FXO interface points to the Telco Elektor Products & Services • PIC18F2550-I/SO, programmed: • Hyperlinks in article • PCB, bare: #100761-1 #100761-41 Items accessible through • PCB artwork:# 1 00761 -1 .pdf • Source code: # 1 00761-1 1 .zip www.elektor.com/ 100761 60 02-2011 elektor MICROPROCESSORS Figure 1 . With the arrival of VoIP this is all history but you may appreciate a bit of remedial teaching on basic telephony and the quirky acronyms used. office. An FXO interface provides just one primary service to the Telco network device: on-hook/off-hook indication (loop closure). As illustrated in Figure 1 , a telecommunica- tions line from an FXO port must connect to an FXS port in order for the connection to work. Similarly, a line from an FXS port must connect to an FXO port in order for the connection to work. When the FXO port on your analogue telephone is connected to the FXS port in the wall, you receive FXS ser- vice from the Telco — and assuming your bill is paid, you hear a dial tone when you pick up the phone. Note the arrows in Figure 1 , they illustrate the pointing. If you connect an FXS device to another FXS device, the connection will not work. Likewise, if you connect an FXO device to another FXO it will not work either. So, for example, you can not plug a standard ana- logue telephone (FXO) directly into a stand- ard analogue telephone (FXO) and talk phone-to-phone. That’s FAB (full acknowledgement of broad- cast, tnxThunderbirds) but with the arrival of VoIP (voice over internet protocol) we don’t need the Telco anymore and that begs the question: can I connect an ana- logue phone (system) to VoIP? The answer is: YES (yes, exquisitely so) using Linux and a dedicated converter designed for use on the USB (universal serial bus). The circuit The schematic of the adapter is shown in Figure 2 — this should be a treat for all fans of microcontrollers, embedded applications and open source platforms including Linux. The analogue phone is connected to J1 and the PC’s USB port to... ‘USB’! Simple as that, the Linux environment on the PC and the firmware running inside the PIC do all the work and you can start phoning for free using your trusted analogue phone. At the heart of the circuit is a Silicon Labs Si32 1 0 microcontroller Ml in its default application circuit. This chip, also called a SLIC (subscriber line integrated circuit), con- trols the telephony-related functions of the board, namely: • a DC-DC converter that generates the necessary voltage to drive the sub- scriber line; • the actual subscriber line; • the analogue-to-digital and digital-to- analogue conversion (PCM codec). The SLIC is complemented by an analogue line driver type Si3201 , again from SiLabs. The circuit also comprises the DC-DC con- verter analogue circuitry, consisting mainly of D1 , LI , Q7 and Q8 plus surrounding com- ponents. The converter is driven by a PWM signal from the 321 0’s DCDRV output. Besides the analogue telephony interface, the chip uses two digital buses to com- municate to the (digital) world: a PCM bus and an SPI bus. Both are controlled by a PIC1 8F2550 microcontroller running some clever firmware. The parts marked with an asterisk (*) have values optimised for a phone line length of up to 2,000 feet (approx. 700 m) and a ring voltage of 45 V rms . The PIC (ticking at 20 MHz) and its firmware accomplish a large number of tasks: pack- ing PCM 1 -ms audio samples into USB pack- How 2 make it come alive There are plenty of reasons why an otherwise perfect board would not work at first try. The first step in giving life to the board is to bring up the bootloader, as explained in the blog at [5b]. This is done by switching on SI b (i.e. the DIP switch closest to the USB plug) in order to in- voke the bootloader and enable the use of a USB bootload utility like PICDEM or fsusb (the latter on Linux) to load the firmware. However, this applies to a pre-programmed PIC. In the case of a fresh, empty PIC, you first need to flash the bootloader firmware from here: http://openusbfxs.googlecode.com/svn/trunk/PIC18FSource/Bootloader-FXSMOD/boot- loader.hex using a PIC programmer that will do In-Circuit-Serial-Programming (ICSP). Once the boot- loader has been flashed, you need to switch SI b and plug the board into a USB in order to invoke the bootloader. The final step is to use PICDEM-FS or fsusb to load the actual adapter firmware pulled from [8]. Flashing just the FXS firmware without the bootloader will cause the board to fail to work. This is because the bootloader firmware takes care of jumping into the right places within the FXS firmware during reset and interrupt sequences. Obviously, if the bootloader is not installed, this is not going to work. Other than that, please check the author’s blog page for more hints and advice in the rare case that your adapter does not work straight off. elektor 02-2011 61 MICROPROCESSORS J1 — 1 2 3 680p ZIZZIZZZZZZZIIZI — 4 < n ? 5 6 RJ45 680p — H L3 BLM18AG601SN1 J. L2 BLM18AG601SN1 +5V © C31 lO^^V 10 27 ^^0 +5V © ^^0 | cpci^g CDC2 30 ^^0 lOOuTlOOn 10V 1 25V RDTX R1 -| 200k [ 15 VDDA1 VDDA2 STIPDC C24 8 HE 100n C3 R8 ■ L/u L_||_[l70Rj 220n 1% 1 20 STIPAC 220n 100V VDDD PCLK DRX DTX FSYNC f f C18 | C19 VDD TIP C105 100V C5 4u7 15 6V 4u7|6V 29 IC1 13 25 16 28 14 26 3 5% 6 4 5 5 4 6 3 7 2 36 21 CM CM CO CO CM T— 1 2 13 37 18 24 | Rli R32 C106 100V 22n BLM18AG601SN1 L4 12 14 I Jci |c2 CM 0 13 lOuj 6V lOuj 6V 1 1m% © rY +5V +5V © 20 RCLR VDD MCLR/VPP/RE3 RA4/T0CKI/C1OUT/RCV RC0/T1OSO/T13CKI RA3/AN3/VREF+ RC1/T10SI/CCP2/UOE RA2/AN2/VREF-/CVREF RB4/AN11/KBI0 RA1/AN1 |p- RB5/KBI1/PGM RA0/AN0 RB6/KBI2/PGC RB0/AN12/INT0/FLT0/SDI/SDA RB7/KBI3/PGD RB1/AN10/INT1/SCK RB2/AN8/INT2/VMO RB3/AN9/CCP2/VPO VUSB RC2/CCP1 PIC18F2550-I/SO RC4/D-/VM RC7/RX/DT/SDO RC5/D+/VP RA5/AN4/SS/HLVIN//C20UT RC6/TX/CK VSS OSC1 OSC2 VSS LD1 C02 22p XI I I 20MHz 10 COl 22p 11 12 25 26 19 • • 9 -» 750mA lOu 25V RUSR 27 28 23 14 15 16 17 JLVP K1 O O- O O- O O- -0D — i RPGM +5V (+) USB CUSB 220n 1 2 OVBUS O D- O D+ OGND SI 100761 - 12 Figure 2. The core of the circuit is a SLIC (subscriber line integrated circuit) from SiLabs while most of the intelligence resides in the PIC18F2550 microcontroller. ets (and vice versa), driving the 321 0’s PCM bus clock, transmitting and receiving isoch- ronous data over USB, keeping the PCM bus time in synchronism with the USB bus ‘tick- ing’ and, finally, managing all other generic functions required for USB communication. While the SiLabs ICs are seen in a more or less standard constellation following the manufacturer’s datasheets and ref- erence circuits, the originality of the cir- cuit of course resides in the PIC firmware, which manages all the above functions in real time, and thus obviates the need for an expensive FPGA device (sooo corny now in telephony designs) and keeps the whole cost very low. Pinheader array K1 is the PIC ICSP (in-circuit programming) connector. Construction - yes you can, too All Linux fans should want to build this, so a nice compact board (60 x 30 mm) got designed for the adapter and best of all it’s available ready-made from Elektor (# 1 00761 -1 ) and the same goes for the programmed PIC (# 100761-41). Figure 3 shows the board stuffing plans for the top and bottom sides. The board is brimful of SMD parts at both sides, including the three integrated circuits so assembly might not be too easy if you’ve never worked with these tiny devices before. The Si32 1 0 is troublesome with its extremely fine pitch leads, which may push your limits in terms of accuracy and power of sight. All fears aside, the prototype was success- fully built by Jan Visser of Elektor Labs using manual soldering throughout at both sides of the board and the ‘solder braid trick’ to separate the Si32 1 0 pins electrically after mass-soldering. FYI Jan is spectacled and at the safe side of 50, but just. The result is shown in Figure 4. Choke LI is very conspic- uous on the board with its two large solder pads. As a tip-off, SiLabs operate a sampling ser- vice for their ICs. Our ICs however were obtained through Mouser with a little help from CJ and Valerie at our sister magazine Circuit Cellar based in Vernon, CT. Firmware The PIC firmware may be downloaded free from the Elektor website t 2 l and is upgrada- ble over USB, using a Microchip-supplied tool called PICDEM Ul. This function is accomplished by DIP switch S 1 (b), which controls whether the board boots in boot- loader or normal mode. Firmware upgrades can also be performed by a utility program. The other DIP switch, SI (a) resets the PIC, it should be kept in the OFF position. 62 02-2011 elektor MICROPROCESSORS COMPONENT LIST Resistors (default: SMD 0805) R1 ,R3,R5 = 200k£2 R2,R4 = 196kn R6,R7=4.02k£2 R8,R9 = 470£} R14 = 40.2kn R1 5 = 243a R16 = 200£l R1 7 = 453ft* R1 8A.R1 8B = 0.82ft*, shape 1 206 R19,R20=18kft R21 = 1 5ft, shape 1 206 R28 = 37.4kft R29 = 453kft* R32,RCLR, RPGM, RUSR = 1 Okft RL1 =3300, shape 1206 Capacitors (default: SMD 1206) C1,C2,C31 = 1 0pF 6V C3,C4= 220nF 1 00V, shape 1812 C5,C6= 22nF 1 00V, shape 1812 C9 = 10pF 100V radial Cl 0,C1 4,C26 = 1 0OnF 1 00V, shape 1 21 0 Cl 5, Cl 6, Cl 7,C24,C30= 1 0OnF, shape 0603 Cl 8, Cl 9 = 4.7pF 6V C25 = 1 0pF 25V tantalum bead Cl 05,1 06 = 680pF 1 00V CDC1 = 100pF 10V radial CDC2 = lOOnF 25V C01 ,C02 = 22pF CUSB = 220nF Inductors LI = 100pH 1 A, SMD L2,L3,L4 = 1 50pH 1 A, SMD, type BLM1 SAG- 601 SN1 , 0603 shape Semiconductors (all SMD) D1 = ESI D (SMB) IC1 = Si321 0-FT/GT (TSSOP38-LP), SiLabs, Mouser#634-SI3210-CT IC2 = Si3201 -FS/GS (ESOIC-1 6T), SiLabs, Mous er# 634-SI3201 -GS IC3 = PIC1 8F2550-I/SO, programmed, Elektor #100761-41, see [2] LD1 = LED, green (1 206 CHIPLED) Q7 = FZT953 (SOT230P700X160-4N) Q8,Q9 = MMBT2222A (SOT95P280X1 3-3N) Miscellaneous FI = fuse, 0.75A, shape 1210 J1 = RJ-1 1/12 socket, PCB mount JLVP = jumper or temporary wire link K1 = 6-pin (2x3) pinheader block, 0.1 ” SI = 2-way DIP switch, SMD U1 = USB-A-H socket XI = 20MFIz quartz crystal PCB, Elektor # 1 00761 -1 , see [2] * for phone cable length up to 2,000 ft. and V(ring) = 45 Vrms. Figure 3. Component mounting plan of the VoIP adapter board. The bare board is available from Elektor. Linux driver and Asterisk The board is accessible via a Linux device driver. The author has chosen to integrate the board with the Dahdi I 4 1 device driver family, so that the board can be used under the open-source Asterisk IP PBX system. Extensive instructions on how to build the driver and integrate the board into a Linux system can be found in the author’s blog l 5 l When the ‘oufxs’ device driver module is compiled and loaded into the Linux ker- nel, the system recognises the USB FXS as soon as it is plugged. The verbosity of debug messages is tuneable: while terse by default, with the ‘debuglevel’ parameter set Figure 4. A close look at both sides of the board. Check your soldering against this! elektor 02-2011 63 MICROPROCESSORS to 4, the driver displays in detail all its steps while initializing the board (Fig- ure 5). By now, you have a new Dahdi device, that you can see and manage with utilities like dahdi_scan. The next step is to configure the device’s signalling, i.e. the electri- cal method by which the system tells the subscriber that the line has become available, or that the other party has hung up. While a phone set does not care much about these, analogue exchanges do, so Dahdi support various signalling meth- ods. The author uses ‘fxols’ signal- ling, which stands for ‘Loop-Start’. To do this, the ‘/etc/system/dahdi. conf’ file must be created or edited and a line reading ‘fxols=1 ’ must be added at the end. If you would like to change the default ring and dial tones as well, that’s the place to do it, by select- ing a ‘tonezone’ other than the default ‘us’. You can also add an echo canceller e.g. by adding the following line ‘echocanceller=oslec,1 ’. Finally, the ‘dahdi_cfg’ utility must be run. You are now ready to start with Asterisk. Follow the author’s instruc- tions for setting up and configuring Asterisk l 9 l, then start Asterisk in debug console mode (‘e.g. asterisk -vvvvvvc’). Pick up the phone; Aster- isk should note an off-hook event, and you should be listening to a dial tone. Then, dial ‘600’ (and wait a bit for an inter-digit timeout); Asterisk will log a console message and start Figure 5. The Linux ‘oufxs’ driver sees a board plugged and takes action. Listening to one’s voice may be a great tool for debugging, but it is not of much use, is it? So what about placing your first free inter- national VoIP call using IAX (the Inter-Asterisk-eXchange proto- col)? Hang up, then pick up the phone again and dial 500. This will route a VoIP call to Digium’s demo IAX server in the United States (Figure 6). Digium are the people behind Asterisk. You will hear a ring tone, and then Digi- um’s own Asterisk system answers the call (beware: this is a real VoIP PBX, and if you dial an extension, you will probably reach a Digium employee). an ‘echo’ application. You can then speak on the phone and listen back to your own voice with a few tens of milliseconds delay. a Tim mhiail R« £4t Jtontotl Iktf |'L]« dLEil p-l ihA 1 Cvrfc t ■“ ’rinr' .rviiial L< r r^J canfLg D rar -- 1 . **1 npfc ili ■ diva iL-i-jI EtC rp 1 Iffcl 2. Dial > EJ.I2 piiTlftbi 4aqativ coa - i*!i ■■jl.l > i ska «ar>l Li| 9 PtarklcA.i.diai * 05*1 i ib bp* Lai ■ . fiata 1 9-' 3ataj£An4 Lai 1 Ir-cluJc J -dSPri 3cal i34"ci!4h' ti > vi-3inJ bp (A* 1 | , * ■■ ’. yyx/ iww nari ndc.iivi' data CArllLfl !»Mi i-f tide'll-' l^I ‘ • *■. 1 L 1 *lm*« i-KMUll !ib« tM 1 * Lai « V? 1 L‘X V.-' C 'll 11 * .|4 II ‘Isl VejM | liiiii ' H+ii J ' 1 1 ‘ iCfiar 15 - *■ ■“'51 !jh is ( an 1 1 1 1 50c*' ||ih> t+d+nl - itK U-TTUL^I , ] 1 _■ ■ i~ir*a.LBru. • 13 p*-Larii ini jjt Z 1 rc-niu * *■ 0 . 2 - ‘StJirT^nfli ■ : ■ | 1 i i.-.uli aab QliOJ i 1 J - 3 'UWF/i-r SSiHanc iikiIv avrlrh QAHQfrl -1 fiTJimflng 1 SOOfMc^iuLl : L 1 PlqtfclintUHlt/l'i 1 , ‘ fils Uzuh r 1 : rj" " in nr* tl aci *■ J-3 b *1 Br 1 ■* 7 2 « r . ■ 3 =3 r graa' lla^gafT ■*«’? Lucia'S r a :i Dull 'C^WE L l*. "‘■’j'.p.iiifc.ffchi t*i Lr rv*v i!kv -.TUd ipjnlqfbbi ■. if^fc^aj! 1 Lai 1 , mt r-crlrd l i .'l-.- JOi a i fnrrMl p ■ ■ ■ ■ **rai3 Jaf Cal*. Li ill .f t W P Mil rtvrfr | I'-Irom 1 • - ifli? MILK* KX* it itr* *■- ' 1*1 CaKiM'l Figure 6. Displaying the dialplan and logging a call from Asterisk’s console. An open project All the parts of the design, including the schematic and PCB design files in Cad- soft Eagle format l 6 l, the firmware l 7 l and the Linux driver software are open-source, meaning the work is licensed under the GNU Public Licence (code) and Creative Com- mons licenses (PCB, documenta- tion, etc.). The source code can also be found at I 8 1. All Elektor readers are invited to improve and extend the software to their heart’s content and let the Editor, the author and members of the community know by way of the Elektor forum (main topic: Micro- controllers & Embedded). ( 100761 ) Internet Links [1 ] www.silabs.com/Support%20Documents/TechnicalDocs/si321 0. pdf [2] www.elektor.com/1 00761 [3] Microchip PICDEM FS: www.microchip.com/Microchip.WWW. SecureSoftwareList/secsoftwaredownload.aspx?device=en021 940&lang=en&ReturnURL=http://www.microchip.com/stellent/ idcplg?ldcService=SS_GET_PAGE&nodeld=1406&dDocName=e n021940&part=DM1 63025# [4] http://downloads.asterisk.org/pub/telephony/dahdi-linux/ releases/dahdi-linux-2.3.0.1 .tar.gz [5] (a) http://openusbfxs.wordpress.com/ and (b) http://openusbfxs. wordpress.com/dyi-setup-and-debugging-guide/ [ 6 ] http://code.google.eom/p/openusbfxs/source/browse/#svn/ trunk/Eagle-OPENUSBFXS-Dongle [7] http://code.google.eom/p/openusbfxs/source/browse/#svn/ trunk/PICI 8 FSource/OPENUSBFXS-FMWR [ 8 ] http://code.google.eom/p/openusbfxs/source/browse/#svn/ trunk/LinuxDahdiDriver [9] http://openusbfxs.wordpress.com/getting-started-with-asterisk/ 64 02-2011 elektor READERS 1 PROJECTS AlphaLED Shaker Magic message machine By Kurt Schuster (Germany) Give the board a shake, and letters fall out? Not quite: but you can make your favourite message appear as if suspended in thin air. The basic principle will be familiar: as a row of LEDs is moved from side to side, the LEDs are driven in such a way as to exploit the persistence of human vision and create the illusion of letters, symbols and other graph- ics floating in mid-air. This Reader’s Project is a new twist on that idea: the board carry- ing the row of LEDs is moved by hand rather than being driven by a motor. We use a fairly sophisticated motion detection system to let us synchronise the display of text with the movement of the unit, and the text can scroll to allow longer messages to be dis- played. As a bonus, it is possible to edit up to four short messages ‘on the fly’. Shaken, not stirred The author persuaded some friends of his to try out the device: an occupational therapist, a graphic artist in the adver- tising industry, and a gaggle of children. Impressions were positive: the occupa- tional therapist thought it would be a good way to motivate his patients, particularly the younger ones, with the combination of the larger-scale shaking moves and the delicate motor skills required to operate the pushbuttons to enter messages having ‘definite potential’. That the device might also encourage younger children to learn the alphabet through play he saw more as a side-effect. The graphic designer also saw potential in the unit, and had the witty idea of mounting one on the side of a cocktail shaker to display an advertising message. Children, especially older children who have already learned to read, quickly got the hang of using the buttons and shaking the device to create their own messages. The ease with which the text could be read at a distance was mentioned as a particularly good fea- ture, and they were inspired to make the board into a toy by decorating it with colour- ful characters and animals. Calling all Elektor readers with a sideline in toy design... Sensor and sensitivity In principle the moving-LED idea could be applied to a yo-yo, with the text of a mes- sage being spelt out as the yo-yo goes up and down. However, the motion of a yo-yo proved too slow to produce a satisfactorily stable visual effect, and hence we settled on the letter shaker approach. The basic ingredients, comprising a few LEDs and a microcontroller, were easy enough to find and solder together. Harder to solve was the problem of finding a suitably sensitive shake sensor without having to resort to a fully-featured accelerometer. Two homebrew attempts, one using a steel ball and the other using a magnet in a tube with switches (both mechanical and reed-contact) at either end, were not really up to the job. Several commer- cial tilt switches were tested, and the readily- available (from Farnell or Conrad Electronics) Assemtech CW1 300-1 was found to work well. Surprisingly, taking the sensor apart reveals two apparently gold-plated balls, one small and one large. The smaller one bridges the con- tacts, while the larger one presumably ensures that contact is made with sufficient pressure. The software was written in AVR assembler and was, at least initially, kept very simple. A fixed text graphic was read from mem- ory and output sequentially to the LEDs when the ball in the (home-made) sensor pressed one of the two switches. To get a stable display it proved necessary to com- pensate for the inertia of the sensor using a variable delay in the code to synchronise the Note. Readers’ Projects are reproduced based on information supplied by the author(s) only. Readers projects have not passed Elektor Labs for replication to verify claimed operation. elektor 02-2011 65 READERS 1 PROJECTS vcc 20 VCC PA2(RESET/DW) (AIN0/PCINT0)PB0 PDO(RXD) (AIN1/PCINT1)PB1 PDl(TXD) (OCOA/PCINT2)PB2 PD2(CKOUT/XCK/INT) (0C1A/PCINT3)PB3 PD3(INT1) (0C1B/PCINT4)PB4 PD4(T0) (MOSI/DI/SDA/PCINT5)PB5 PD5(OCOB/T1) (MISO/DO/PCINT6)PB6 PD6(ICP) (UCSK/SCL/PCINT7)PB7 ATTINY2313-20 PA1 (XTAL2) PAO(XTALl) GND 12 13 14 15 _16 _17 19 * JP1 /SP nn 10 MOSI MISO SCK 6 O 090337 - 11 Figure 1 . A tilt switch controls the drive tinning of a row of LEDs via an ATtiny microcontroller. The key to the circuit is in the software. LED data output. It was particularly tricky to arrange things so that the message did not appear in two different positions as the device was moved to and fro, reducing the overall perceived brightness. As the pro- gram was developed more and more func- tions were added, with the bulk of the (thor- oughly commented) code P] concerning the user interface, control logic, character sets, message scrolling, LED drive and polling the control buttons. Shake detection is done under interrupts. Sensor inertia compensa- tion accounts for very few lines of code, but a disproportionately large amount of know- how, including a detailed analysis of the shake movement using an ADXL320 acceler- ometer. It was only armed with this knowl- edge that we could make the final version of the device work with just a tilt switch. Circuit and construction The tilt switch is connected across the pins of JP2 (see the circuit diagram in Fig- ure 1). It is debounced by R8, RIO and C5 and then taken to port pin PD2 of the ATtiny microcontroller. Two miniature but- tons (K1 and l<2) connected to PD5 and PD8 provide the user controls for entering text. I<3 is not used in the current version of the software, and so is not fitted. A DIP switch (SO) on the printed circuit board (Figure 2) is used to turn the device on and off; the two-pole version would also be suitable. Power is provided by a 3 V type CR2032 button cell, and of course observ- ing correct polarity is essential when sol- dering its holder (type SMTU-2032-1 ). The best LEDs to use are high brightness 3 mm types with a wide viewing angle; these are connected to the microcontroller outputs PBO to PB7. To make the resulting display as pleasingly solid as possible, the LEDs are mounted tight up against one another and round LEDs may need a bit of filing to get them to fit. Alternatively, rectangular LEDs can be used. The value of the series resis- tor depends on the LED colour: 47 Q is suit- able for red LEDs, 27 Q for green, 22 Q for white and 1 0 Q for blue. Since the blue LEDs in particular are being driven at 3 V, below their rated voltage, it is recommended to select devices manually for uniformity of brightness. It is also a good idea to do this for green and white LEDs, but it is less criti- cal for red LEDs. The tilt switch is mounted horizontally, soldered to the pins of JP2 (see Figure 3). The ISP connector on the board (JP1) need not be fitted, and the relevant Figure 2. The double-sided printed circuit board mainly uses SMDs that can be soldered by hand. 66 02-2011 elektor READERS 1 PROJECTS Users’ auide Switching on - Set SO to the ON position. Displaying a message - Hold the board so that LED 0 is at the top. Then quickly but regularly shake the unit to and fro. Selecting a message (single LED flashes) - Hold the board still, and LED 7 will continu- ously emit single flashes. - Hold down button K2 until LED 7 flickers, and then release the button. LED 6 will then start to emit single flashes continuously, and message 2 is ready for display. - Hold down button K2 until LED 6 flickers, and then release the button. LED 5 will then start to emit single flashes continuously, and message 3 is ready for display. - Hold down button K2 until LED 5 flickers, and then release the button. LED 4 will then start to emit single flashes continuously, and message 4 is ready for display. Four messages are available. Message 1 is connections are made by tracks on the circuit board. If the ATtiny2313 is only to be programmed after it is soldered to the board, the four tracks joining the header pads need to be cut and a 2mm pitch header soldered on. After programming the broken connections must be restored: this can be done by plugging a suitably-wired socket to the programming connector. The resistors are all 0805 SMD types, as are all the capacitors with the exception of C6 (a 47 jlxF 6 V electrolytic, radial, 2.5 mm pitch). Soldering the microcontroller in its SOIC package requires a fine bit and a little confidence in SMD work. Pin 1 of the micro- controller is indicated by a small dot on the printed circuit board. With a little skill with the soldering iron the SMD crystal can be replaced by a wired device or by a ceramic resonator. If a resonator is used capacitors C7 and C8 should be removed, and the mid- dle contact of the resonator should be con- nected to the ground via near C7 and C8 (see Figure 3). It is a good idea to fit the microcontroller before the crystal as other- wise the room left for soldering is a bit tight. Programming and operation The text box gives an overview of how to operate the device. Of the four stored mes- hard-programmed in, while messages 2 to 4 can be changed at will by the user. If a mes- sage is not programmed the letter ‘E’ (for ‘empty’) will be displayed. Programming a message (double LED flashes) - Select message 2, 3 or 4 according to the instructions above. - Hold down K1 and K2 simultaneously until the LED flickers and then release the buttons. LED7 will now continuously emit double flashes which means that the unit is ready to be programmed with a capital letter. - Shake the board, and the currently select- ed letter (‘A’ initially) will be displayed. - Repeatedly press button K1 or K2 brief- ly. This changes the selected letter forwards or backwards through the sequence ‘A’, ‘B’, ‘C’, and so on to ‘Z’. To program the selected letter, hold down K1 until the LED flickers. To switch between programming modes, hold down K2 until the LED flickers. The programming modes are indicated as sages, messages 2, 3 and 4 can be edited using the buttons; message # 1 , however, is hard-programmed into the device and can- not normally be changed or erased. There is, however, a special way to change this mes- sage: in quick succession press K2, l<2, l<2, K1, K1 and then K2. LED7 will then flicker briefly to confirm that the special mode has been entered, and message 1 can now be edited. To protect the message once more, use the same magic button sequence. It is also possible, of course, to enter a mes- Figure 3. The top side of the printed circuit board, with horizontally-mounted tilt switch and 4 MHz ceramic resonator. follows: - LED7: programming mode for the capital letters ‘A’ to ‘Z’ and the space character (the space character is displayed as a rectangle during programming); - LED6: programming mode for the lower- case letters ‘a’ to ‘z* and the space character; - LED5: programming mode for the digits ‘0’ to ‘9’ and the space character; - LED4: programming mode for symbols, accented characters, punctuation and the space character; - LED3: erase functions B (‘backspace’, de- letes the most recently entered character) and C (‘clear’, deletes the entire message). To execute the erase function, hold down K1 until LED3 flickers. Leaving programming mode - Hold down buttons K1 and K2 simul- taneously until the LED flashes, and then release both buttons. The most recently se- lected (or edited) message will be displayed. sage directly into the EEPROM of the ATtiny microcontroller using a programmer. (090337) [1] http://www.elektor.com/090337 (includes software download) About the author Kurt Schuster is a self-employed electron- ics engineer and software developer. Figure 4. The underside of the printed circuit board, with the button cell, smoothing capacitor, on-off switch and the two buttons that are used to operate the device and enter messages. elektor 02-2011 67 USB IDs How to Get Your Own USB ID Options and costs By Harry Baggen (Elektor Netherlands Editorial) Every device with a USB interface needs to have a set of ID numbers that enable it to register with a host (computer or other equipment) so the host can take the appropriate action. Is it also necessary to have these ID numbers for devices you develop yourself, and if so, how can you get your own ID numbers for your products? Here we report on the results of a brief survey. Nowadays you find products with USB interfaces just about every- where, ranging from practical devices such as external USB hard disks to frivolous gadgets such as USB coffee mug heaters. Every USB device that you connect to a computer (known in USB ter- minology as a host) uses two ID codes to register with the com- puter: a vendor ID (VID) and a product ID (PID), each of which is a 1 6-bit number (for example, 0x0424 and 0x0531 ). From this set of ID codes, the operating system of the PC determines what sort of device is connected, what designation should be assigned to it, and what driver should be used for it. These numbers are administered by the USB Implementers Forum (USB IF Ml), an organisation that was founded by various computer companies and ensures that manufacturers of USB devices comply with the formulated USB standards. Buying your own VID If you develop a device with a USB port and you want to market it commercially, you can request your own VID from the USB IF. There are several options, although they are actually oriented toward mass production and not intended for devices such as prototypes. Briefly, the options are: • Become a member of the USB IF (membership fee: US$ 4000 per year). You will be assigned a VID at no additional cost. • Purchase a USB logo licence (fee: US$ 2000). This licence is good for two years. • Purchase a VID alone (fee: US$ 2000). With this option, you are not allowed to show the USB logo on your products. Once you have been assigned a VID, you receive a large block of PID numbers that you may assign as you see fit. The number of PIDs is large enough (around 65,000) that manufacturers of USB prod- ucts don’t have to worry about using them up too quickly. Only one number is necessary for each product type or model, so each individual product does not need to be assigned a separate number. Prototypes and small-scale production What can you do if you want to use your own VID and PID for a single prototype or small volume of products? You probably don’t wish to spend a large amount of money for this. In the past, there were a few companies that bought their own VIDs and then sold small blocks of PIDs to people who wanted to use them for their prototypes and their own products, but the USB IF disapproved of this arrangement. Some time ago it prohibited this form of trading in USB numbers and added a corresponding clause to the regula- tions. However, there is one company that still does this (MCS Elec; see I 2 !), based on the stance that the rules were amended after it bought its VID. If you use Atmel microcontrollers, there is also another option. If you use the V-USB driver Dl, you receive a VID/PID set free of charge if you agree to adhere to the conditions of the GNU general public licence (GPL) governing the V-USB project. If you do not wish to release the software you develop, as required by the terms of the GPL, you can also purchase one or more VID/PID sets. For hobby use, each set costs about £/€ 1 0. What about the situation where you develop a device with a USB interface 1C in its circuit? Usually the 1C manufacturer has its own VID and assigns a separate PID to each individual product with a USB interface. You can then use these products to develop prototypes of devices or circuits. The next question is: what if you wish to make products on a mod- est scale? We found two manufacturers who are willing to do a bit more for their customers in this regard. Microchip has a large num- ber of PICs with integrated USB interfaces in its product line. On the Microchip website you can find a document K1 that you can use to apply for a sublicence. With this sublicence, you receive the Micro- chip VID and your own PID, which you can use for your product. This Figure 1 . The USB Implementers Forum administers all vendor IDs. 68 02-2011 elektor Index of Advertisers C QJ E CD co QJ > “O < is handy if you want to manufacture products on a small scale. In this regard, the only condition imposed by Microchip is that the pro- duction volume must not exceed 1 0,000 units. As far as we know, there are no other costs associated with this, although Microchip naturally makes money on the ICs you buy from them. FTDI is a semiconductor manufacturer that has become very well known for its USB interface ICs, which make it very easy to provide a USB connection for a device with a serial interface. FTDI also sup- plies RS232 connectors with integrated USB ICs, and of course vari- ous types of adapter cables, such as USB to TTL). On FTDI’s website you can find a PDF document I 5 1 that clearly explains which VIDs and PIDs are used by FTDI and what options are available to users of FTDI ICs. Here again, it is possible to apply for a unique block of product IDs for use in prototypes and small-scale production, with no specific quantities mentioned. With other manufacturers that also have a lot of ICs with USB inter- faces in their product lines, such as Atmel, Analog Devices, Freescale and Tl, we were unfortunately not able to find any option for apply- ing for your own block of PIDs. With these products, the VID/PID pairs programmed into the ICs can only be used for circuit devel- opment. In most of the documentation, it is simply noted that you need a separate VID/PID set for each product you develop, with a recommendation to contact the USB IF or visit their website. Per- haps these companies could take a cue from Microchip and FTDI to make things a bit easier for users who manufacture products on a modest scale (as long as the USB IF doesn’t decide to prohibit this sort of arrangement). If you are curious about the VIDs assigned to all sorts of manufac- turers, you can visit the website at I 6 ) to view a list. ( 100718 -I) Internet Links [1] www.usb.org/home [ 2 ] www.mcselec.com (look in the shop under Hardware/USB) [3] www.obdev.at/products/vusb/license.html [4] wwl .microchip.com/downloads/en/AppNotes/Application%20 for%20USB%20Vendor%20ID%20Sublicense.pdf [5] www.ftdichip.com/Support/Documents/TechnicalNotes/ TN_1 OO_USB_VID-PID_Guidelines.pdf [ 6 ] www.linux-usb.org/usb.ids Astrobe, Showcase www.astrobe.com 78 Atomic Programming Ltd, Showcase . . . .www.atomicprogramming.com 78 Avit Research, Showcase www.avitresearch.co.uk 78 Beta Layout .www.pcb-pool.com 9 Black Robotics, Showcase www.blackrobotics.com 78 CEDA, Showcase www.ceda.in 78 Designer Systems, Showcase www.designersystems.co.uk 78 Easysync, Showcase www.easysync.co.uk 78 Elnec, Showcase www.elnec.com 78 Embedded Adventures, Showcase www.embeddedadventures.com 78 Eurocircuits .www.eurocircuits.com 21 EzPCB/Beijing Draco Electronics Ltd www.v-module.com 29 First Technology Transfer Ltd, Showcase .www.ftt.co.uk 78 FlexiPanel Ltd, Showcase www.flexipanel.com 78 Future Technology Devices, Showcase. . .www.ftdichip.com 78 Flameg, Showcase www.hameg.com. 78 FlexWax Ltd, Showcase www.hexwax.com 79 Labce nte r www. labcenter. com 88 Linear Audio, Showcase www.linearaudio.net 79 M i kro E I e kt ro n i ka www. mikroe. com 3 MQP Electronics, Showcase www.mgp.com 79 NXP Contest www.circuitcellar.com/nxpmbeddesignchallenge . . 31 NXP Product www.nxp.com/microcontrollers 2 Pico www.picotech.com/scope2034 65 Quasar Electronics www.guasarelectronics.com 13 Relchron www.proto-pic.co.uk 11 Robot Electronics, Showcase www.robot-electronics.co.uk 79 Robotiq, Showcase www.robotiq.co.uk. 79 Showcase 78, 79 Steorn SKDB Lite, Showcase www.kdb.steorn.com/ref25 79 Virtins Technology, Showcase www.virtins.com 79 Advertising space for the issue 15 March 2011 may be reserved not later than 15 February 2011 with Elektor International Media - Allee 1, 6141 AV Limbricht, the Netherlands Telephone 0031 (0) 46 4389444 - Fax 0031 (0) 46 4370161 - e-mail: advertenties@elektor.com to whom all correspondence, copy instructions and artwork should be addressed. elektor 02-2011 eg LINUX SMS GATEWAY TEXT Me! from i, PC Junkyard An £0.00 SMS gateway centre using Linux and a recycled PC By Hans Henrik Skovgaard (Denmark) In this small project a discarded PC together with an old mobile phone will both be granted a second lease of life. With the ‘Damn-Small-Linux’ (DSL) variant running on the PC and the mobile phone attached, the basics of a small, totally free SMS gateway will be demonstrated. Fasten your seatbelts. If like me you refuse to throw away electronic assemblies that are functional but ‘less fashionable’, you will most likely too have man- aged to accumulate several old PCs and maybe a few old mobile phones. Of course, you will have hidden your clunkers in an artful manner from viewing by a house-proud partner. A veritable 201 1 Aladdin’s cave. After several years, some of my own such treasures were very close to reaching their final destination at the ‘recycling place’ (aka ‘Old- Silicon Heaven’). That was until I saw the “Remote control by Mobile Phone” article in Elektor’s November 2008 issue, where a mobile phone got attached to a dedicated piece of hardware. However since I’m currently into Damn Small Linux coding I wanted to con- nect a phone to a PC, run Linux and make something useful out of it all. It is now up to you to decide if this is clever, crafty or crazy, but here I got DSL up and running, attached the mobile phone to the PC, installed software and built the basics of my very own small SMS gateway. Here’s how you can do it, too. Installing DSL People already into Linux, in particular Damn Small Linux (DSL), will possibly scoff at the level of detail in this article, but the aim is to enable you to set up such a system all by yourself even if you’re new to Linux. In Table 1 you can seethe hardware configuration used for this pro- ject. The PC was originally a Dell Dimension XPS T600r but in good PC Junkyard fashion the only bits of it left by now are the mother- board and the power supply. No preferences are expressed here — check out what you have lying around, dig it out and see if it works for you. There is one thing though that needs to be in place. Your old PC must have either a USB or an RS232 connector. You need to align this with the method of connecting the mobile phone to the PC. Nowadays USB is the port of choice but not so long ago it was RS232 - like in the November 2008 article. Con- figuring Linux for both cases will be described —actually three ways to con- nect a mobile phone to the Linux PC. One final thing before we continue: change the PC BIOS so it will boot from the CD-ROM drive. Damn Small Linux is a stripped down version of another Linux distri- bution called Knoppix. It’s a free Linux distribution for the x86 fam- ily of personal computers and fits inside a 50 MB live CD. One of the reasons why DSL is so small is that instead of using KDE or GNOME as its desktop it employs one of the two ‘lightweight’ desktops that go by the names of ‘Fluxbox’ and ‘JWM’. This makes DSL an ideal choice to run on junked hardware and thereby bring back new life to it. You may choose to use another Linux distribution where there will most likely be differences but nothing that can’t be managed. A link to the DSL home page can be found at PL At the time of writing there are two maintained versions of DSL: an older version called DSL-3.4.1 2 which uses Linux kernel version 2.4.26 and a newer one called DSL-4.4.1 0 which uses Linux kernel version 2.4.31 . Sure, there exists a newer Linux kernel but this is how DSL is configured in order to keep the system small and fast. Forthe purpose of this article, version DSL-3.4.1 2 was downloaded from PI, the file you want is identified as “dsl-3.4.1 2. iso”. The reason for choosing the DSL-3.4.1 2 version is mainly due to the author’s ‘C’ development environment used for the control centre described in his book! 3 ]. Once downloaded, use your favourite CD burning soft- 70 02-2011 elektor LINUX SMS GATEWAY ware to make a bootable CD containing DSL. Note that you have downloaded an ISO image file, this is essential to know when you burn the CD-ROM for later use. The CD-ROM you just made is a Live CD allowing you to boot up a fully functional Linux system running completely in RAM. As you probably want to install a permanent system, the next thing to do - after the first boot up — is to install DSL on your old PC’s hard disk. Now that’s straightforward and can be found under the menu item: APPS- >Tools- >Install to Hard Drive. Note that the menu is found by right clicking anywhere on the desk- top. Please refer to the description at the end of this article if you need help installing DSL. Connect the mobile phone Like in the November 2008 article a Siemens mobile phone is being used, in this case a C65 mainly because the author contributed to developing it. Not surprisingly the AT command set Kl interface and the phone proper are ‘old stomping ground’. Don’t feel tied to using the C65 phone in this project though, and as you can see when we get to the SMS gateway software, one of the most commonly used mobiles are [... drumroll ...] Nokia phones. In Figure 1 you can see what the interface cables to the C65 look like. To the right in the picture is the RS232 connector and in the centre, the actual phone connector. To the left there is a small power adaptor in order to keep the phone running so you never need to turn it off and recharge it. If you attach the phone to the RS232 interface right away you will then be able to communicate with the phone via the device inter- face called /dev/ttySO. If you have done some C programming (if not there’s a good Elektor book on this I 7 !) you will know how to read from and write to a file. It is exactly the same thing here. In order to read or write to the phone you read or write to /dev/ttySO. In order to verify that the phone is connected and working there is a small program called ‘microcom’ you can use, see Figure 2. In case your PC has a USB connector and no RS232 interface you can use an USB-RS232 converter. If you do that you will get a different device interface this time called / dev/ ttyllSBO. In order to use ‘microcom’ to test your connection this time you need to tell ‘micro- corn’ which interface to use. This is done as shown in Figure 3. If your phone and PC both have USB connectivity, just connect them together and your device interface will then be / dev/ACMO. You ver- ify the connection the same way as with the USB-RS232 converter. When connecting the phone via the USB interface you need to set up your phone in ‘modem’ mode or similar. In many cases a mobile phone has a USB mode setting where you can choose between ‘mass storage’, ‘modem’ and maybe some more modes. You may have to do some testing to see what’s working. All in all it gives you possibilities listed in Table 2. You will be able to install support for both IrDA and Bluetooth as Table 1 . Junkyard PC hardware configuration (example) CPU Pentium III 600MHz RAM: 384 Mbytes BIOS: PhoenixBIOS 4.0 release 6.0 Hard disk: 10 GByte (Samsung) Network card: Realtek 100Mbit card Display adaptor: CD-ROM drive: NEC DVD drive PC sucto u n x root^box;/# nicrocom J Try /dev/tty SO at&f m Modern found on /dev/ttySO Figure 2. microcom w. / dev/ttySO. Table 2 . Possible device interfaces. Interface Device Std RS232 /dev/ttySO USB - RS232 /dev/ttyUSBO USB /dev/ttyACMO elektor 02-2011 71 LINUX SMS GATEWAY DSL step bv step installation Listen up PC users, DSL here means Damn Small Linux, not Digital Subscriber Line. 1 . Insert the Live CD in you CD-ROM drive and power up the PC. Remember to set the boot sequence to CD-ROM first. 2. Set the language like “boot: dsl lang=xx” (where xx = language code) then hit Enter. You can see more lan- guage definitions by pressing F2. This should bring up you DSL desktop. DSL menus are found by right clicking anywhere outside a program on the desktop. Find the following menu: APPS->Tools->lnstall to Hard Drive. 3. You are now ready to install DSL on your hard disk. Please note all data present before the installation will be lost after the installation. During the installation you will be asked some questions which most likely should have the following answers: Enter the target partition: hda2 (or hdal ) Do you wish to support multiuser login: n Use journalized ext3 filesystem: n Continue: y (This was your last warning to save the content on the PC) Proceed to install a boot loader: y Use [Gjrub MBR or [Ljilo Active Partion: g (If you selected hda2 above the following will appear) Do you have windows installed: no Reboot: yes 4. You should now remove the CD and see your system reboot for the first time. The first picture will be the Grub boot loader startup picture. After that you will be asked to assign your system a root and a user dsl password. After that you should then get your DSL desktop up. well but that’s maybe another article. You should hopefully now have a running Linux system and a work- ing mobile phone attached. High time to install some software. Installing gnokii The SMS gateway software we’re going to use is the software from gnokii l 5 L In the following a lot of file manipulation will take place. You can do this either via a terminal window using Linux commands or use the built-in file manager called Emelfm. This file manager can be accessed by the Emelfm icon on the desktop. If you are a hardcore Linux user you will now download the code and compile it yourself. You can still do that but fortunately you will also be able to find prefab software packages made by the DSL community. The ready to run software packages can be found via the MyDSL (Extension tool) icon on the desktop. Once started you will be able to see lots of precompiled (almost) ready-to-install applications. The installations we are interested in here can be found under the ‘Testing’ tab! Please remember that you need to have Internet access in order to use the MyDSL tool. If not, you will be unable to see the list of precompiled applications and therefore unable to download them. Under ‘testing’ you will find the gnokii-0.6.25.uci package. The UCI extension indicates that it is a Universal Compressed ISO image. Extensions with the .uci format are mounted as a separate file sys- tem to minimize RAM usage. On mounting, see t 6 l. You download the software package by selecting it and after having read the instructions hit ‘download’. You should save the software in a directory where you can find it later as you need to include the location in a boot file. The default download location is / tmp. As indicated in the DSL description for gnokii you need to download the following software packages as well: -gtk+-2.12.9.uci - bluez-utils.uci. Like the gnokii software these are also located under ‘testing’ in the MyDSL Extension tool and should be saved in the same directory as the gnokii software. Once downloaded the software packages will be installed in the /opt directory — or mounted as they will not be present there following the next reboot. In order to have the newly installed software available after a reboot you need to add the following - mydsl - load /tmp /gnokii - 0 . 6 . 2 5 . uci -mydsl-load /tmp/gtk+-2 . 12 . 9 . uci -mydsl-load /tmp/ bluez-utils.uci at the end of the file /opt/bootlocal.sh. If hardcore you can use the ‘Beaver’ or ‘VI’-editorto edit /opt/bootlocal.sh. You can verify that your software packages are fully mounted by right clicking the MyDSL icon and selecting ‘UCI tool’. This displays which UCI pack- ages are loaded. Next thing to do is to set-up gnokii. This is done by copying the file: /opt /gnokii - 0.6. 25/gnokiirc to the home directory for the user dsl — which is /home/dsl — and rename the file to “.gnokiirc” (gnokiirc). In case you want to run the software as root you need to copy the file to the root-home 72 02-2011 elektor LINUX SMS GATEWAY directory - which is /root. In the config file you need to specify the correct port. You can see which port you should select in Table 2. It’s recommended to specify: port = /dev/ ttyUSBO when a USB-RS232 converter is used. You also need to specify which model you will be using. Here you need to read the documentation and/or consult the gnokii homepage. I specified mode 1= AT as I wanted to use the AT-command mode, which is fully supported by the C65 phone. By default it should not be necessary to change more in the config file. The rest of the parameters are explained if you want to experi- ment with them. To verify that your system is working you should now run the fol- lowing command: gnokii — identify in a terminal window. Remember to have your mobile phone switched on. You will hopefully see lots of AT commands flying across the screen, ending with a listing of your phone’s IMEI number, Manufacturer, Model and Product name. If it is not working you’re in for a debug session. Some hints to a conclusion can be found in the file: /var/log/mes sages You may also want to increase the gnokii debug information in the gnokii config file mentioned earlier. After installation you will have noticed two additional icons (Gnocky and Xgnokii). They are the entry points to a GUI interface. In order to use them you need to do some initialisation of the new GTK library before you reboot your PC for the first time after the download and installation of the software. The initialisation is done via the MyDSL menu, which has been extended by two new entries: Advertisement See your project in print! Elektor magazine is looking for Technical Authors/Design Engineers If you have ^ an innovative or original project you'd like to share with Elektor's 140 k+ readership and the electronics community above average skills in designing electronic circuits ^ experience in writing electronics-related software basic skills in complementing your hardware or software with explanatory text a PC, email and Internet access for efficient communications with Elektor's centrally located team of editors and technicians then don't hesitate to contact us for exciting opportunities to get your project or feature article published. Our Author Guidelines are at: www.elektor.com/authors. Elektor Jan Buiting MA, Editor Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, United Kingdom Email: editor@elektor.com elektor 02-2011 73 LINUX SMS GATEWAY gnokii-0-6-25 GTK+-2 . 12 . 9 -setup The actual initialisation of the new GTK library is achieved via the menu item: MyDSL - >GTK+ - 2 . 12 . 9 - setup- >GTK+ - 2 . 12 .9-setup And then just follow the instructions. After the initialisation of the GTK library you can use the two GUI interfaces (Gnocky and Xgnokii) either via the icons on the desktop or via the MyDSL menu. One final tip before we continue using the actual software: in case you want to keep the new menu items in the MyDSL menu listing, you should save a copy of the file /home/ dsl/ . f luxbox/mydsl . menu and replace the myDSL.menu file that will be created after a reboot of the PC. Using gnokii If everything you’ve done so far has been successful you should now be ready to send your first Text (SMS) message. Before continuing, be cautioned that “depending on your mobile phone subscrip- tion, sending excessive numbers of Text messages may cost you a fortune if you are not careful. No monies returned.” Having said that, let’s continue. Sending Text In order to text somebody, start a terminal window so you can enter commands. If you just enter the following: gnokii you will see all the arguments that can be used with gnokii. The ones we are interested in is the -sendsms argument. So, to send a Text message (SMS) you need to enter the following: echo "enter text here" | gnokii --sendsms +4412345678 Where +441 2345678 is the phone number with the country code included (+44 for United Kingdom). Note that there is no space between ‘—‘and ‘sendsms’. In the terminal window you should hopefully once again see many AT commands flying across the screen ending with the following text before the command prompt returns: Message sent (reference: 2) Send succeeded! Serial device: closing device. The number after reference : may differ. Receiving Text In order to receive Text (SMS messages) we need to make use of one of the other arguments to gnokii: - - smsreader So to receive Texts you should enter the following command in a terminal window: gnokii --smsreader yflur EMBEDDED LINUX CONTROL CENTRE Figure 4. If you like working with old ■SI ■ r\m computers and Linux, this book comes highly recommended. 0^ This makes gnokii look continuously for incoming Text msgs and save them into a mailbox under /tmp/sms/* (actual filename varies). Such a file could look like this: /tmp/sms/sms_4512345678_1189_0 and will contain the content as you would see it on your mobile phone. There will be no additional information present. If everything works as expected, incoming Texts are never actually saved in the phone. You exit the gnokii smsreader mode by pressing -. Please note that you will not be able to receive and send Text mes- sages at the same time. This is due to the way Linux works. When you start the gnokii program it will lock the device specified with the port command in the gnokii config file, thereby preventing other programs from using the port. What I have shown so far is the basic stuff that must be present in order to set up a small rudimentary TEXT Gateway. In a further article I will show how to install an Apache server and make the received Texts available to ‘the public’ and present a more stream- lined interface to send Texts around — overcoming the need to use the command line interface. If you’re interested in the full details of how to design your own Embedded Linux Control Centre on a PC, check out the Elektor book with that title t 3 l (Figure 4). (090939) Internet Links [1 ] DSL homepage: http://damnsmalllinux.org/ [2] DSL download link: http://distro.ibiblio.org/pub/linux/distributions/damnsmall/ current/dsl-3 .x/ [3] Design your own Embedded Linux Control Centre on a PC: www.elektor.com/products/books/computer/ embedded-linux.529463.lynkx [4] AT command set decription: http://en.wikipedia.org/wiki/AT_commands [5] gnokii homepage : http://www.gnokii.org/ [6] Two descriptions of mounting file systems: http://en.wikipedia.org/wiki/Mount_%28computing%29 http://en.wikipedia.org/wiki/Mount_%28Unix%29 [7] C Programming for Embedded Microcontrollers: www.elektor.com/products/books/microcontrollers/ c-programming-for-embedded-microcontrollers. 868705. lynkx 74 02-2011 elektor INFOTAINMENT Hexadoku Puzzle with an electronics touch Is your hexadecimal calculus a bit rusty? Not to worry, for this ‘electronified’ puzzle the requirements are limited to counting from o to F, persistence and some logic reasoning to arrive at the solution. Enter the right numbers in the puzzle, send the ones in the grey boxes to us and you automatically enter the prize draw for four Elektor Shop vouchers. Flave fun! The instructions for this puzzle are straightforward. Fully geared to electronics fans and programmers, the Hexadoku puzzle employs the hexadecimal range 0 through F. In the diagram composed of 16x16 boxes, enter numbers such that all hexadecimal numbers 0 through F (that’s 0-9 and A-F) occur once only in each row, once Correct solutions received from the entire Elektor readership automati- cally enter a prize draw for one Elektor Shop voucher worth £ 80.00 and three Elektor Shop Vouchers worth £ 40.00 each, which should encourage all Elektor readers to participate. Prize winners The solution of the December 201 0 Hexadoku is: 381 F0. The £80.00 voucher has been awarded to: B. Horn (Germany). The £40.00 vouchers have been awarded to: Karin Menzel (Germany), Serge Sussel (France), Christian Klems (The Netherlands). Congratulations everyone! Solve Hexadoku and win! in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle and these determine the start situation. Correct entries received enter a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. Participate! Before March 1 , 201 1 , send your solution (the numbers in the grey boxes) by email, fax or post to Elektor Hexadoku - 1000, Great West Road - Brentford TW8 9HH United Kingdom. Fax (+44) 208 2614447 Email: hexadoku@elektor.com 2 8 E 3 D C 7 1 A 4 9 0 B F 5 6 B 5 D 9 0 6 8 F C 7 3 1 E A 4 2 6 A 0 1 9 4 E 5 2 8 F B 3 C 7 D C 4 7 F B 3 2 A 5 6 D E 8 9 1 0 9 3 6 C E 0 A B 4 2 1 5 7 D F 8 0 F 8 7 4 2 1 D 3 E 6 A C B 9 5 D 2 5 4 6 7 F 3 9 C B 8 A 0 E 1 E 1 A B C 8 5 9 D F 0 7 6 3 2 4 3 B C A 2 E 4 8 7 9 5 6 0 1 D F 8 6 4 2 A 1 B 0 F D E C 9 5 3 7 5 7 1 E F 9 D 6 0 3 A 2 4 8 C B F 0 9 D 7 5 3 C B 1 8 4 2 E 6 A 1 E F 6 5 A C 4 8 0 7 9 D 2 B 3 4 9 3 8 1 F 0 2 6 B C D 5 7 A E A D 2 0 3 B 9 7 E 5 4 F 1 6 8 C 7 C B 5 8 D 6 E 1 A 2 3 F 4 0 9 c F 8 7 E 1 B A 6 7 0 5 3 F B F 6 c 3 8 A 5 E F 1 D 7 4 C 0 A D 1 9 B 6 C 1 2 F 7 1 E 8 5 0 2 B C 5 0 1 4 7 8 A 3 F 1 4 C B E 2 5 5 A 6 E F D 0 1 7 5 9 D F 8 c F A E 4 B F 7 0 E c B 3 4 C 2 D 1 A 2 9 C B 4 F D 7 A 1 5 6 C E The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses. elektor 02-2011 75 RETRONICS Slide Rules & the Electronic Engineer By Reginald W. Neale (USA) COMMON LOGARITHMS OF KUMBEKS — GOO Engineers translate ideas into products. They’re limited by the tools available for facilitating that translation. Over the span of my engineering career, those tools have undergone a dramatic trans- formation. I hope you will agree that it’s interesting to review on this month’s Retronics pages some of the rich history of those changes. First-hand knowledge of much of this material is fast disap- pearing. Fortunately, the web has some remarkable archives that will help to preserve it. Nothing new, just faster! Let’s take a brief look at the tech- nology that produced radios, rockets, bridges and automo- biles sixty years ago, when many of today’s tools were yet to be invented. Consider that your computer, calculator and soft- ware design package don’t do anything fundamentally new, they just make the old tasks easier and orders of magnitude faster. To one of today’s newly minted engineers, the pace of yesterday’s product life cycles would appear glacial; the design time and effort per product would seem exhausting. And there were once entire disciplines, like high- performance filter design, whose commercial potential was unre- alized because the calculations could be so tedious. Obviously, the tool revolution has been powered by continuous advances in semiconductor tech- nology. Transistors, integrated cir- cuits and microcontrollers have relentlessly driven increases in the computing power available to electronic engineers. Moore’s Law predicts that semiconductor capability roughly doubles every two years. The cumulative effect of In Figure 1, the nearest value in the table is .07518. Using the Pro- this exponential increase has been profound. T.J. Rodgers of Cypress portional Parts chart at the right, you determine that the antilog is It* 0 1 ? 3 4 5 * ? * 9 Pni[urLiMiit puh 540 M OH 044 05? WO 00! 076 0*4 052 OM 107 851 116 w 131 930 14? MS i*J 170 176 1 AC 357 194 702 ?1G ?LB 775 ?J3 ?+l 7+9 SV 266 773 760 796 J04 317 323 327 335 *43 38* 319 5H- K? 374 39 2 406 111 4?t SM 4J? 4*3 413 401 m 474 4*4 492 600 5 V, 507 SI 5 £?3 51 F U9 547 564 1C? 6F0 5F* 357 506 503 601 004 61 7 *74 63? 6+0 655 5W W3 071 0*7 69 5 702 710 716 776 733 550 7*1 7S7 764 77? 740 796 501 *ii 560 419 m S.14 642 *50 *V* *65 581 559 46 1 *04 91? 9M 935 943 950 9M 405 a 562 974 581 997 *005 *01? *030 *035 •043 J M 463 75 651 050 056 074 OH? 0S9 097 105 113 ISO I 1.4 664 m m 143 161 TVS- IB* 174 IS? 159 m f 4 1.4 u K5 905 fsJ JM 73* 243 Z5T 289 2 V 71* 1 4 * 566 n - f 284 MF 308 *17 JTO 3?* 335 343 351 1 * « 14? 3M 365 374 331 W9 397 404 41 % 470 *27 j 1 4 566 415 44? *50 4VJ *73 +91 4t8 490 504 j 4,4 86fl *34 * 1 ? 549 657 MS *72 MO 1 u 570 E-S7 845 *01 6 IQ R-l A 6?* G33 641 64* 68* 1 3711 Ml S?i 679 6*4 *04 792 709 717 774 73? 172 WO 747 758 762 1 10 77S 7«8 7*3 * 0 * 873 *15 *1) A3 6 6*6 (M B F.I *6? *T* SB* 374 *91 nn 906 914 97T 929 937 044 95? S75 40? 974 9*2 969 997 ♦Ml *019 *035 i?e 76 04? 030 017 Ml- 07? 6*0 0*7 to 5 103 110 ST7 m 125 133 140 14* 1 Si 161 170 17* IBS 1 37fl T93 200 70S 318 221 SiO we ?*5 260 1 379 !0* 275 263 200 22* 305 513 374 37* 338 M) 3*3 350 3M 365 373 3sa 3*9 395 *03 410 7 M3 *75 4J3 440 440 411 4fr? 4t0 47? 463 1 — j-* M3 45? 500 50? 115 £?? *30 437 a+4 882 *i9 a MJ MF 374 552 M? *97 604 61? 619 6*6 6.54 i 34* 641 645 010 »4 671 675 4*6 693 701 701 1 , MS 714 723 730 73* 745 753 760 76* 775 ?59 l i MG 7M 797 *1? 019 m 0J4 S+? 849 SK I a 4 W7 S6+ 571 *T9 ess 593 4-51 20ft 91* 9?3 93& l ^ i 4 M* 9 IS 1H5 KG 967 5?1 96? 939 w *004 ■ i 1 77 01? Q19 0?* 034 04] 04* OM 063 070 07* MO 0*5 WJ 1W 107 US 17? tW 137 144 Ml Ml 1W IC6 173- ist 1 S3 19S 2&3 2i0 ai? MV 237 210 254 262 969 9*3 ?9l M3 301 J15 3?G 3?7 331 24? 344 3b? 364 371 &-J4 379 3E6 393 401 409 414 42? 430 437 444 bib 4K 459 *** 474 4fll 49* 491 HJ *10 *17 534 m 53? 535 5+5 S54 461 86* 076 1*3 ioa 097 W7 605 632 619 6?7 614 641 (its 6>6 66J 3*6 UTO 67 7 0S5 692 *73 TOO 714 Ml 728 735 *99 745 7» 757 764 772 374 726 793 601 aoa GW *1* *2? 630 637 *44 *51 509 560 673 650 n. d 1 2 i 4 6 t 7 I 9 Ffu-I H_ifLiUEi.il r-sri' , 7103 * — aao Semiconductor notes that if auto- motive technology had followed the same trajectory as computer technology, today you would be able to buy a Chevy for a penny and it would get 1 0,000 miles per gallon. Sounds like hyperbole? In 1 948, ENIAC cost $500 k and per- formed 0.002 MIPS. The current Digi-Key catalogue lists embed- ded controllers for $0.50 that per- form 2 MIPS. Apply those same factors to the 1 948 Chevy at $2 k and 15 mpg and Rodgers’ claim doesn’t look so preposterous. Reference tables and pencils Compared to the design world we take for granted today, the environment of a mid-twentieth century designer was awkward and inefficient. Whatever tech- nical information you couldn’t keep in your head had to be retrieved from reference books. New advances in technology took months or even years to trickle down from laboratories to arti- cles printed in trade magazines and scientific publications. There was also an overwhelming gen- der bias — engineers were almost exclusively male. Here’s an example of how pain- ful it could be to complete even a simple calculation, back when you had to do it the hard way. Suppose you need to find an accu- rate value for the reactance of a 220 pF capacitor at 6.085 MHz. Picking up your paper and pencil, you write down X c = 1 l(2nfC). You open up your book of logarithm tables. You look up the logarithm of each factor and you do the arithmetic, grinding out a result of 2.07514. 76 02-2011 elektor RETRONICS ft ML"i.na-^DDiiDi*^:-rT we nr _ , Pri , t ,ft u , , , , . u ^ M , a ^ . r . . . . r t l . tp* ■ -%!• 3 ' v 'g, i| r . ; a y , tj . .'■* - . ’ T _ ri Cl • !’ 1 | .1 : - - 1 ] I O Lfe fe. 4 - 13 , pjfr l.P 1 i ' "/ 1 1 ■; j i ihM'I'l I’l 'l*T A 1 ■ t 1 y '"■"1 "5 j „ • •. -i n: ;c 7; _ 1 , v p Ti j 1 1 1 1 . 1 1 . i. ( 1 .1 M |. u Ihi liii.l l.inM • 1 3 1 „ 1 1 < " 1 11 f- 1 • | infill I, " j .J If r , I t ' I, * I* . r* « '1 1 * 'll- M r . i i'll' . " , jli S i: u X ^ ® ? 6* ' 9 rgi « TflV |T| III H"» 1 . ' 'I m*|l»'»i* »•»**! — |?|rr I-| •■»tpi.*||l 1 I • 1 • I • 1 • ' 1 • I ' 1 • 1 -1 1 VI lit* 1 ST • 4 « 1 A i W ** ih ' & to to m w i 1 j“ 1 — f -* Vi'i l'llTl'li' ill* 1 ‘ ~TY "d 1 m ! J 4 1 , : a ■ 1 ___ _i_ _ _ _ * , . if approximately 1 1 89. Your calcula- tion results in a characteristic or exponent of 2, so the solution is X c = 1 1 8.9 ohms. Whew! And you have to hope you didn’t make any dumb mistakes in your arithmetic or in using the tables. No wonder reactance nomograms and other charts were so popular in mid- century technical publications. Usually they could get you close enough for building a prototype circuit, and you could tweak the value from there. Slide rulez Unless the highest precision was needed, most mid-century engi- neers would have skipped the above hand calculation in favour of using a slide rule. Slide rules are nearly as old as logarithms. A slide rule is simply a mechanical analogue computerthat adds and subtracts logarithms by repre- senting them as distances. Much less accurate than log tables; but again, close enough for many pur- poses and far, far quicker. Slide rules don’t have decimal points, so the user is forced to keep track of it mentally. That might sound like a nuisance, but it’s a mental skill that engineers should still exercise today as a reality check. Figure 2 shows a selection of slide rules: a miniature combina- tion slide rule and caliper that fits into a pocket protector, and two standard 10-inch rules with user manuals. Circular rules were also available, along with elaborate helical rules boasting spiral scales equivalent to 10 feet in length! Accuracy depends on the skill of the user, the size of the rule, and how carefully the scales are If ratETicrfsIl If y a ft c il-iJ if 1 ■* */t 2 Q ii*n p It] air'O * t - Q- *0? >1 (7j cot(f) = \ - i . - a^x’)] 1? £ t < 50" ii 3 '“ irivh 1 L L>- i&J staff) - C4*f«0 - »l an I us? tataiiirr £?} abev* tc calcultle slnH > - L’s* 'nt Hestilp ffl'J *■ ftta(*J3 - c; af.i ar t v 4 tl£J'- { i= 3 aCDV* tC CO* l * ! FflCCeDL’PJi PCS 3A]i rj3p[ft EC1V.TICW ( STOP CrSPATKtt STEP 1 er tct 1 x 6 ■nultiuly bv ■ * L"c * ii rc j* 7 Tiuj’opjv i?v -ia*5C7 5tl J t> g Add ; 4t 1 ? nu ] by 1 4 Ti-Jtttalir bv k jO nuitSply by 1.7HSja93 nj.e tTLiimtn errar In latliUJ SinCfll St COa( 4 ) fro J-tt Iflfia '*■ 1 OM (7 I 1 le arnrsi in.a-.-el y per mill ier.j* If 0" < t % 30* fcrirj If I - G/IQC Xhtn. Co; m(t} “ aligned. A couple of significant figures for the standard-sized rule would be typical. What a contrast to the calculator accessory in my three year old PDA, which cranks out twelve significant figures as soon as you hit the ENTER key! From Burroughs & Co. to HP and Tl he typical engineering student proudly carried his rule hanging from his belt, in a leather scab- bard. If 2010 students have even heard of slide rules, they prob- ably associate them with the era of powdered wigs and quill pens. In the early ‘70s when simple four-function handheld calcula- tors were flooding the market, scientific calculators were still priced out of reach for most engi- neers. The geek community soon developed clever algorithms to implement transcendental func- tions (Figure 3) on the cheap four-bangers from Burroughs and other manufacturers. But just as these shortcuts hit their stride, the first affordable scientific hand- held calculators finally arrived: the Hewlett-Packard HP-35 and the Texas Instruments SR-50 (Figure 4). It would take almost another decade for real personal computers to become widely available, but the handhelds made logarithm tables and slide rules obsolete almost overnight. (100802) Retronics is o monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and reguests are welcomed; please send an email to editor@elektor.com elektor 02-2011 77 ELEKTOR SHOWCASE To book your showcase space contact Elektor International Media Tel. 0031 (0) 46 4389444 ASTROBE V3.0 www.astrobe.com Windows Development System for LPC2000 microcontrollers. • Develop high-and low-level software without C or assembler • Generate fast 32-bit native ARM code • No special programming hardware required • Personal, Standard and Professional Editions ATOMIC PROGRAMMING LTD www.atomicprogramming.com • AP-114 ISP/JTAG Programming System • JTAG Programming and Testing • Boundary Scan Testing • Universal In-System Programming • EEPROM and SPI Flash Out-of-Circuit Programming • Generic GDB Proxy Server • Jennie JN5148 ZigBee Development Applications • Training Platform available AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BLACK ROBOTICS www.blackrobotics.com Robot platforms and brains for research, hobby and education. • Make your robot talk! • TalkBotBrain is open-source • Free robot speech software • Robot humanisation technology • Mandibot Gripper Robot TO BOOK YOUR SHOWCASE SPACE CONTACT ELEKTOR INTERNATIONAL MEDIA Tel. 0031 (0) 46 4389444 Fax 0031 (0) 46 43701 61 CEDA www.ceda.in ceda@vsnl.com 1 ;f ) A 1 1 Tfc uo | OfCAD | -learning PCB layout^ ■GRO $5 Hourly • PCB Layout & library service @$5 Hourly • PCB Reverse Engg, MCU Code/ckt. Extraction service • Learn Signal Integrity with Hyperlynx, PCB Design with PADS & Allegro. Support by email & web meeting DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0) 845 5192306 EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com Europe’s leading device programmers manufacturer: • reliable HW: 3 years warranty for \ * most programmers • support over 58.000 devices • free SW updates • SW release: few times a week • excellent technical support: Algorithms On Request, On Demand SW • all products at stock / fast delivery www. elektor. com EMBEDDED ADVENTURES www.embeddedadventures.com From news and tutorials to modules, components and kits, we have everything for your next microcontroller based project. Your embedded adventure starts here. .embedded adventures ^ FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk • Training and Consulting First for IT, Embedded and Technofogy Real Time Systems Tran ^ r • Assembler, C, C++ (all levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas,TI, Freescale • CMX, uCOSII, FreeRTOS, Linux operating systems • Ethernet, CAN, USB, TCP/IP, Zigbee, Bluetooth programming FLEXIPANEL LTD www.flexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.e.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB Instruments A Rohde & Schwarz Company 0 Oscilloscopes 0 Power Supplies 0 Spectrum Analyzers 0 RF Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com 78 02-2011 elektor products and services directory HEXWAX LTD www.hexwax.com World leaders in Driver-Free USB ICs: • USB-UART/SPI/I2C bridges • TEAleaf-USB authentication dongles • expandlO-USB I/O USB expander • USB-FileSys flash drive with SPI interface • USB-DAQ data logging flash drive — = = = Z T 60 pages of tech audio articles Linear Audio Self ' Linkw , itz ' Corde ": Passa -°- your tech audio resource www.lmearaudio.net MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes www. elektor. com ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! Now, available in time for X-mas • Arduino Starter Kits *NEW!!* • Lego NXT Mindstorms • Affordable Embedded Linux Boards • Vex Robotics (kits and components) • POB Robots (kits and components) email: sales@robotiq.co.uk Tel: 020 8669 0769 STEORN SKDB LITE Join the SKDB Lite, the place to understand, discuss and experiment with magnetics. • Learn more about magnetics and electromagnetics • Participate in developer forums and discussion surrounding magnetics and related topics. For FREE access to SKDB Lite: https://kdb.steorn.com/ref25 VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. WWW. elektor. com SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £242 + VAT (£22 per issue for eleven issues) Elektor will publish your company name, website address and a 30- word description For £363 + VAT for the year (£33 per issue for eleven issues) we will publish the above plus run a 3 cm deep full colour image - e.g. a product shot, a screen shot from your site, a company logo - your choice Places are limited and spaces will go on a strictly first come, first served basis. So-please fax back your order today! _ I wish to promote my company, please book my space: • Text insertion only for £242 + VAT • Text and photo for £363 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION elektor 02-2011 79 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Antennas Analyze RFID tags RFID readers Elektor Designer's Companion ^ ZigBee Bluetooth GPS | Wi-Fi ISM. bands NFC | REID transceivers receivers Development kits Software tools Standards Datasheets User guides White papers Application notes A world of electronics from a single shop! ir\v~ 1 m \X Limited Period Offer for Subscribers! £4 DISCOUNT vww.elektorxom|febru?r: RFID, NFC, Zigbee, GPS and more dvd Wireless Toolbox On this DVD-ROM you’ll find a number of technical documents and tools that will enable you to add wireless data exchange to your electronics systems. The choice of equipment depends on the transmission distance: a few centimetres using Near Field Communication (NFC) or Radio Frequency Identification (RFID), tens of metres with the Bluetooth, Wi-Fi or ZigBee systems, or indeed thousands of kilometres using a module for receiving GPS data. In accordance with the principle of our Toolbox series, we’ve brought together technical documentation (spec, sheets, application notes, user guides, etc.) on various devices according to the frequency and/or pro- tocol used. All of the documents are PDF files (in English). Browsing around the DVD is made easy by an HTML menu. ISBN 978-90-5381 -268-6 • £28.50 • US $46.00 A must-have for audiophiles dvd Masterclass High- End Valve Amplifiers In this Masterclass Menno van der Veen will examine the predictability and perceptibility of the specifications of valve amplifiers. The DVD represents 3.5 hours of footage filmed in the grand meeting room of Elektor House. Bonus elements on the DVD include the complete Power- Point presentation (74 slides), scanned overhead sheets (22 pcs), AES Publica- tions mentioned during the Masterclass. Not forgetting the bombshell: 25 Elektor publications about valves. ISBN 978-0-905705-86-6 £24.90 • US $40.20 £• n^xS^v-**** ' 1 1 0 issues, more than 2,1 00 articles dvd Elektor 1990 through 1999 This DVD-ROM contains the full range of 1 990-1 999 volumes (all 110 issues) of Elektor Electronics magazine (PDF). The more than 2,1 00 separate articles have been classified chronologically by their dates of publication (month/year), but are also listed alphabetically by topic. A comprehensive index enables you to search the entire DVD. ISBN 978-0-905705-76-7 £69.00 • US$100.00 8o Prices and item descriptions subject to change. E. & O.E 02-2011 elektor 75 Audio designs for home construction dvd The Audio Collection 3 This DVD contains more than 75 different audio circuits from the volumes 2002-2008 of Elektor. The articles on the DVD-ROM cover Amplifiers, Digital Audio, Loudspeak- ers, PC Audio, Test & Measurement and Valves. Highlights include the ClariTy 2x300 WCIass-T amplifier, High-End Power Amp, Digital VU Meter, Valve Sound Con- verter, paX Power Amplifier, MP3 preamp and much more. Using the included Adobe Reader you are able to browse the articles on your computer, as well as printtexts, cir- cuit diagrams and PCB layouts. ISBN 978-90-5381-263-1 £17.90 • US$28.90 More than 75 power supply designs cd The Power Supply Collection 1 This CD-ROM contains more than 75 differ- ent power supply circuits from the volumes 2001 -2005 of Elektor. Highlights include the Cuk Converter, Automatic Battery Switchover, Battery Voltage LED, Digital Benchtop Power Supply, Lithium-Ion Charger, Electronic Fuse, High Voltage Reg- ulator, Power Supply for USB Devices, Step- up Converter for White LEDs, Vehicle Adapterfor Notebook PCs and much more. Using the included Adobe Readeryou are able to browse the articles on your compu- ter, as well as print texts, circuit diagrams and PCB layouts. ISBN 978-90-5381-265-5 £17.90 • US$28.90 V J £#2010 Programming -• v — -Tlfip*** o r ■ — ■ ■ i j^hn All wuhn Visual Studio C# 201 0 Programming and PC interfacing This book is aimed at anyone who wants to learn about C# programming and interfac- ing to a PC. It covers programming con- cepts from the basics to object oriented programming, displaying graphs, thread- ing and databases. The book is complete with many full program examples, self as- sessment exercises and links to supporting videos. All code examples used are availa- ble -free of charge- from a special support website. Professional quality software tools are downloadable -also free of charge- from Microsoft. The Microsoft Visual Studio 201 0 environment is extensively covered with user controls and their properties, methods and events. Detailed guidance is provided for those wishing to control hard- ware from a PC with PCinterfacing chapters which explain the legacy serial and parallel ports, analogue interfacing using the sound card and use of Microsoft DirectX drivers. Interfacing to the ubiquitous USB port is ex- plained in-depth with a detailed hardware and software design for a USB connected PIC-based hardware target included. 306 pages • ISBN 978-0-905705-95-8 £29.50 • US$47.60 More information on the Elektor Website: www.elektor.com Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com Associated starter kit available ARM Microcontrollers This is the perfect bookfor people who want to learn Cand who wantto use an mbed ARM microcontroller in an easy and fun way. The mbed NXP LPC1 768 uses cloud technology, a revolutionary concept in software develop- ment. This means you do not need to in- stall software on your PC in orderto program the mbed! The only thing you need is a brow- ser such as Microsoft Internet Explorer, and a USB port on your PC. No previous expe- rience or knowledge required. You can get access to your project from any PC anywhere in the world and continue working on it. When you are done a few mouse clicks trans- fer the p rog ra m to yo u r m bed ha rd wa re. 250 pages • ISBN 978-0-905705-94-1 £29.50 • US $47.60 Experiments with Digital Electronics An introduction to digital control electronics Experiments with Digital Electronics This book presents fundamental circuits using gates, flip-flops and counters from the CMOS 4000 Series. Learning these funda- mentals is best done using practical experi- ments. Each of the 50 experiments presented in this book has a circuit diagram as well as a detailed illustration of the circuit’s construc- tion on solderless breadboard. Building these digital circuits will improve your know- ledge and will be fun to boot. 176 pages • ISBN 978-0-905705-97-2 £26.50 • US $42.80 elektor 02-2011 81 SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES Principles, Application and Design Power Electronics in Motor Drives This book is aimed at people who want to understand how AC inverter drives work and how they are used in industry. The book is much more about the practical design and application of drives than about the mathematical principles behind them. The detailed electronics of DC and AC drive are explained, together with the theore- tical background and the practical design issues such as cooling and protection. 240 pages • ISBN 978-0-905705-89-7 £29.50 • US $47.60 Fundamental Amplifier Techniques The ultimate tube amplifier reference book Fundamental Amplifier Techniques The aim of this book is to give the reader useful knowledge about electron tube tech- nology in the application of audio amplifi- ers, including their power supplies, for the design and DIY construction of these elec- tron tube amplifiers. This is more than just building an electron tube amplifierfrom a schematic made from the design from someone else. No modern simulations, but because you first understand the circuit cal- culations, then you can work with your hands to build the circuit . An Internet connection would be a valua- ble addition to many projects, but often designers are put off by the complexities involved. The ‘NetWorker’, which consists of a small printed circuit board, a free soft- ware library and a ready-to-use microcon- troller-based web server, solves these problems and allows beginners to add In- ternet connectivity to their projects. More experienced users will benefit from featu- res such as SPI communications, power over Ethernet (PoE) and more. Module , ready assembled and tested Art.# 100552-91 • £53.00 • US$85.50 Digital Multi-Effects Unit (September 2010) It’s a simple fact: every recording sounds better with the right sound effects. Here we prove that it’s possible to generate a variety of effects digitally, including hall, chorus and flanger effects, without having to work yourself to the bone with DSP pro- gramming. The circuit is built around a highly integrated effects chip and featu- res an intelligent user interface with an LCD. The result is a treat for the eye and the ear. Kit of parts including PCBs , programmed controllers and EEPROM The Elektor DSP radio (July/August2010) Many radio amateurs in practice use two receivers, one portable and the other a fixed receiver with a PC control facility. The Elektor DSP radio can operate in ei- ther capacity, with a USB interface giving the option of PC control. An additional feature of the USB interface is that it can be used as the source of power for the re- ceiver, the audio output being connected to the PC’s powered speakers. To allow portable 6 V battery operation the circuit also provides for an audio amplifier with one ortwo loudspeakers. PCB, assembled and tested Art.# 100126-91 • £149.00 • US$240.40 Reign with the Sceptre (March 2010) This open-source & open-hardware pro- jectaimsto be more than justa little board with a big microcontroller and a few use- ful peripherals — it seeks to be a fast pro- totyping system. To justify this title, in addition to a very useful little board, we also need user-friendly development tools and libraries that allow fast implementa- tion of the board’s peripherals. Ambitio- us? Maybe, but nothing should deteryou from becoming Master of Embedded Sys- tems Universe with the help of the Elektor Sceptre. PCB , populated and tested , test software loaded (excluding Bluetooth module) 834 pages • ISBN 978-0-905705-93-4 £65.00 • US$104.90 Art.# 090835-71 • £165.00 • US$266.20 Art.# 090559-91 • £89.00 • US$143.60 82 Prices and item descriptions subject to change. E. & O.E 02-2011 elektor February 2011 (No. 410) £ us$ + + + Product Shortlist February: See www.elektor.com + + + January 2011 (No. 409) Nixie Tube Thermometer 090784-1 Printed circuit board ....12.40 ..20.00 090784-41 .... Programmed controller AT89C2051 /24PU 8.75 ..14.10 Flight Data Recorder 071035-91 .... ATM1 8 controller module 7.30 ..15.40 090773-91 .... PCB, populated and tested with programmed bootloader 56.00 ..90.00 100653-1 Printed circuit board ....12.95 ..20.90 Low-cost Headphone Amp 100500-71 .... Elektor Project Case 16.80 ..25.80 100701-1 Printed circuit board 8.75 ..14.10 Wireless ECG 080805-1 Printed circuit board 8.75 ..14.10 Support Board for Arduino Nano 100396-1 Printed circuit board ....18.00 ..29.00 December 201 0 (No. 408) NetWorker 100552-91 .... Module, ready assembled and tested ....53.00 ..85.50 Heating System Monitor 090328-41 .... ATmega328-20AU (TQFP32-08), programmed ....11.00 ..17.80 Stroboscopic PC Fan 1 001 27-1 Printed circuit board 4.50 7.30 100127-41 ....ATtiny 231 3, programmed 14.20 8.75 ARM Freephone Control 080632-91 .... ECRM40 module, ready assembled and tested 32.00 51 .70 Modular LED Message Board 100664-41 ....MC9S08SH32CWL, programmed 8.75 14.20 Speed Controller for Small DC Motors 100571-41 .... ATtiny44-20PU, programmed 8.75 14.20 November 201 0 (Nr. 407) Micro Fuel Cell Measures Oxygen Concentration 090773-91 .... PCB, populated and tested with programmed bootloader 56.00 90.40 The 5532 OpAmplifier (2) 100124-1 Amplifier board (one channel) 23.00 37.10 100124-2 Power supply board 17.95 29.00 Camera Interval Timer 0811 84-41 .... PIC1 6F886-I/SP, SPDIP28, programmed 8.00 1 2.90 October 201 0 (No. 406) CL-3 Digital Rotary Combination Lock 100026-41 ....AtmelATTINY2313-20PU, programmed 8.00 12.90 WheelieGT 1 00479-71 .... Kit of parts upgrade kit controller board + 2x Hall sensor board 105.00 169.40 September 201 0 (No. 405) Elektor Project Case 100500-71 .. ... Predrilled Lexan sheets with standoffs .14.90... 24.10 Digital Multi-Effects Unit 090835-31 .. ... EEPROM 24LC32 ...4.00... 6.50 090835-41 .. .. ATmega8-16PU ...8.30... 13.40 090835-42 .. .. ATtiny2313-20PU ...8.30... 13.40 090835-71 .. ... Kit of parts including PCBs, programmed controllers and EEPROM 165.00... ...266.20 Dual Voltage/Current Display 100166-71 .. ... Kit of parts incl. PCB, item -41 , LCD .62.00... ...100.00 Vision System for Small Microcontrollers 090334-1 PCB 19.90 32.10 090334-41 .... PIC1 6F690-I/P, programmed 8.00 1 2.90 Bestsellers a niwi \ ARM Microcontrollers ISBN 978-0-905705-94-1 .... £29.50 US $47.60 Experiments with Digital Electronics ISBN 978-0-905705-97-2.... £26.50 US $42.80 C# 201 0 Programming and PC interfacing ISBN 978-0-905705-95-8.... £29.50 US $47.60 Fundamental Amplifier Techniques with Electron Tubes ISBN 978-0-905705-93-4.... £65.00 ...US $1 04.90 Power Electronics in Motor Drives ISBN 978-0-905705-89-7.... £29.50 US $47.60 CD The Power Supply Collection 1 ISBN 978-90-5381 -265-5.... £1 7.90 US $28.90 DVD The Audio Collection 3 ISBN 978-90-5381 -263-1 .... £1 7.90 US $28.90 DVD Elektor 1990 through 1999 ISBN 978-0-905705-76-7.... £69.00 ...US $100.00 DVD LED Toolbox ISBN 978-90-5381 -245-7 .... £28.50 US $46.00 79 2 hJ (/) O 3 4 O CO 5 to 0 O' 2 1 O > 3 bJ 4 G U 0 to QJ 1 3 "O O 2 FI 3 o3 to 40 k 5 fl DVI Masterclass VD High-End Valve Amplifiers ISBN 978-0-905705-86-6.... £24.90 .... US $40.20 NetWorker Art. # 1 00552-91 £53.00 US $85.50 Digital Multi-Effects Unit Art. #090835-71 £1 65.00 US $266.20 Reign with the Sceptre Art. #090559-91 £89.00 ...US $143.60 Elektor DSP radio Art. #1001 26-91 £149.00 US$240.40 InterSceptre Art. #1001 74-71. £116.00 US$187.10/ Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH • United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com elektor 02-2011 83 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR SatLocator Anyone who regularly needs to align a mobile satellite dish (for example, on top of the caravan), is forever busy locating these ‘birds’ in the sky. This handy circuit is linked to a database containing popular TV satellites and employs CPS data to calculate the angle at which the satellite can be received. The hardware consists of little more than a GPS receiver module, an ATmega8 microcontroller and an LCD. Very handy for use on your next vacation! Minimodi8 Web Server In this instalment of the Minimodi8 (ATM18) series we put this AVR controller ‘brick’ at the heart of a basic web server. For the client we propose the Firefox browser which ensures error-free HTML viewing. A type EZL-70 module is in control and ensures a smooth adjust- ment between the various components. Wireless Telemetry for Elektor Wheelie ElektorWheelie, our popular self-balancing two-wheel vehicle gets a transmitter/receiver combination that allows lots of live system data such as battery voltage, speed, power per engine and tilt angle to be transmitted wirelessly to a laptop. A related program processes and visualizes data, giving a good impression of how your Wheelie is behaving and what software remains to be tweaked. Article titles and magazine contents subject to change; please check the Magazine tab on www.elektor.com Elektor UK/European March 2011 edition: on sale February ry, 2 on. Elektor USA March 2011 edition: published February g, 2011. w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor.com w\ Elektor on the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Shop you’ll find all other products sold by the publishers, like CD-ROMs, DVDs, kits, modules, equipment, tools and books. A powerful search function allows you to search for items and references across the entire website. lektor I FLOWCDCS*?' MiK'Xt rifin Fii-jiTi Bv&Jvct 4 n« - £r&wf tfl Vi' H Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Time limited offers • FAQ, Author Guidelines and Contact i-mi it n y.'ws* neiaur ru $nKUCf fy* CiD"! N 11 » rii raiifror Pm -m-"H n; tj.:h ram- PM ».irc*q f j" iM. 1 ' rn-wi in- ■m- wp* tarn £ n&ir O V CMyS-WJ'i o'- HrtjtteuM v DPfari i.-m-TL QliUfeM uimlni N&— jI ■ tovoi' it'afabry fanr 1 L4Q / *TD /C54 DEfiCCUliT 1 riabUF Products iar up 16 JU Wi&utZt t? lTuxit Pmn Wd*"? tw irv q*i? Tksi Ul £ Program rr»«n-g Eir bedded PIC MierocDnlrallrrE tricf fw L-t ■ iMti 1 pr* l« 5 4*1* Subwlbtra 1 PCH a"*-nl rti-ETr Thh i!Vr— J 1 *T! pBfmawul SCI Kit ot p.irir, Elefcl hi M I0OK , 9 £p 6 cu 6 ■CK^u 1 Efe*rW SD% HOdUIC Ir«: r rtf 5d ’ USB Dal a Ac 84 02-2011 elektor Description Price each Qty. Total Order Code DVD Wireless Toolboxl l £28.50 CD The Power Supply Collection 1 r | £17.90 Fundamental Amplifier Techniques with Electron Tubes ^ rr% A £65.00 ARM Microcontrollers ^ A £29.50 Experiments with Digital Electronics C#2010 Programming and PC interfacing LEDs 1 (Special Project) Prices and item descriptions subject to change. The publishers reserve the right to change prices without prior notification. Prices and item descriptions shown here supersede those in previous issues. E. & O.E. £26.50 £29.50 £9.90 Sub-total P&P Total paid Name Address + Post code Tel. Email Date Signature EL02 Yes, I am taking out an annual subscription to Elektor and receive the E-book Microcontroller Basics totally free!* (Please fill in your emailaddress below) I would like: □ Standard Subscription (1 1 issues) Subscription-Plus (1 1 issues plus the Elektor Volume 201 0 DVD-ROM -^> + exclusive access to www.elektor-plus.com ) * Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email Date Signature EL02 METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) □ VISA EUROCARD MasterCard Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com sales@elektor.com *USA and Canada residents should use $ prices, and send the order form to: Elektor US PO Box 1 80 Vernon CT 06066 USA Phone: 860-875-2199 Fax: 860-871-0411 E-mail: sales@elektor.com METHOD OF PAYMENT (see reverse before ticking as appropriate) □ Bank transfer | Cheque (UK-resident customers ONLY) □ VISA □ EUROCARO MasterCard Expiry date: Verification code: Please send this order form to Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com subscriptions@elektor.com ORDERING INSTRUCTIONS, P&P CHARGES All orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. Online ordering: www.elektor.com/shop Readers in the USA and Canada should send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Elektor US for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £1 1 .00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: CB96 ABNA 4050 3040 2702 1 1 . BIC: ABNACB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. GCredit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran- tee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 1 0% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsi- bility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party adver- tisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. January 201 1 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION United Kingdom & Ireland Standard £51.00 Plus £63.50 Surface Mail Rest of the World £65.00 £77.50 Airmail Rest of the World £82.00 £94.50 USA & Canada | Seewww.elektor.com/usaforspecialoffers | HOW TO PAY Bank transfer into account no. 4027021 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident cus- tomers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a permanent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs £40.80, a Student Subscription-Plus costs £53.30 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twenty-five per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 201 1 “Elektor is substance for professionals and those wanting to reach the level. The perfect entry to my studies!” Christian, 19, freshman - 0 0 iscount: Electronics at all the right levels Secure a head start in electronics crcuitsf mU | aSon DSP Radio Scanner 7 1 0-watt power! ^totingSy steni ^^trobosco ixieTub hermon ElcUtor ft Aorofessional PCBro“ ter 1 with optional ext en: NetWorker] An advanced webser' w ith a micro with a Student Subscription!* * Only available in UK. Ask for the conditions. Advantages to subscribers o m Students qualify for a discount of no less than 20 % compared to the normal price of an annual subscription Subscribers get up to 40% discount on special Elektor products No queues, traveling, parking fees or ‘sold out’ Elektor is supplied to your doorstep every month Always up to date - read your copy before everyone else www.elektor.com/subs • Tel. +44 20 8261 4509 k PRE-PRODUCTIOIM CHECK Board Edge Defined - All Components Placed - All Connections Routed - Power Planes Generated - IMo Design Rule Violations - Design with Confidence: The latest version of the Proteus PCB Design Software provides a multi- stage Pre-Production Check which will detect and prevent a variety of common mistakes prior to your boards being sent for manufacture. PROTEUS DESIGN SUITE Features: ■ Hardware Accelerated Performance. ■ Board Autoplacement & Gateswap Optimiser. ■ Unique Thru-View™ Board Transparency. ■ Direct CADCAM, ODB++, IDF & PDF Output. ■ Over 35k Schematic & PCB library parts. ■ Integrated 3D Viewer with 3DS and DXF export. ■ Integrated Shape Based Auto-router. ■ Mixed Mode SPICE Simulation Engine. ■ Flexible Design Rule Management. ■ Co-Simulation of PIC, AVR, 8051 and ARM7. ■ Polygonal and Split Power Plane Support. ■ Direct Technical Support at no additional cost. All levels of the Proteus Design Suite include a world class, fully integrated shape-based autorouter at no additional cost - prices start from just £150 exc. VAT & delivery Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA. Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com Visit our website or phone 01756 753440 for more details