Elektor 2009 09
Elektor 2009 09
Elektor 2009 09
65
OLED scope
on R32C experimenters board
OBD2 Analyser
with ARM Cortex-M3 controller
The Road to
Battery Power
electric vehicles come of age
Power Charger for ElektorWheelie
ATM18 Mini Chess Computer R39
GPS Datalogger
Microcontrollers
The Most Popular 8-bit Microcontrollers!
The Best Customer Support.
Controllers
Digital Signal
Analog
EEPROMs
Serial
The worlds most popular 8-bit microcontroller family has the best
customer support and the industrys shortest leadtime 3-4 weeks!
24/7 Support
With over 400 different variants, there is an 8-bit PIC microcontroller for every
t0OMZ Microchip offers full
design. Microchips 8-bit family now includes microcontrollers with the smallest support 24/7
form-factor, industry-first peripherals and up to 16 MIPS performance.
t*ODSFBTFE Field Application
Pin- and code-compatibility ensure easy migration across the 8-bit family and up Engineer support team
to 16-bit designs and Microchips MPLAB IDE is absolutely free, and supports ALL
of Microchips 8-, 16-, and 32-bit microcontrollers from 6 to 100 pins! t*ODSFBTFE Customer Application
With over 7 Billion PIC microcontrollers shipped worldwide and increased Engineer support team
investment in product development and customer support, you can count on t*ODSFBTFECustomer Training
Microchip to be here for you - especially through the tough times.
Support through Regional
Comprehensive support starts with the Microchip Advanced Part Selector (MAPS) Training Centers (RTCs)
and extends throughout the design cycle with free or low-cost development
tools, online and regional training and 24/7 technical support.
t Smallest form-factor, lowest cost - PIC10 and PIC12 MCUs YOU
t Advanced peripherals - PIC16 MCUs Now&Tomorrow...
t Highest-performance - PIC18 MCUs
www.microchip.com/8bit
The Microchip name and logo, the Microchip logo, MPLAB and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks mentioned herein are
property of their respective companies. 2009, Microchip Technology Incorporated. All Rights Reserved. ME223Eng/02.09
Discover the FUTURE with EasyPIC6
Everything youve always wanted from a development tool
Experience the ease of creating your own electronic devices!
Thanks to many new features, you can start creating your own devices
immediately. EasyPIC6 supports 8-, 14-, 18-, 20-, 28- and 40- pin PIC
microcontrollers. The mikroICD (Hardware In-circuit Debugger) enables
very efficient step by step debugging. Examples in C, BASIC and Pascal
are provided with the board.
Hardware In-Circuit Debugger High-Performance
for step by step debugging at USB 2.0 On-Board
hardware level Programmer
Port Expander provides easy On-Board
I/O expansion (2 additional 2x16 Serial LCD
ports) using serial interface Display
Full-featured and user-friendly Keypad enables
development board for PIC easy and fast data
microcontrollers entry
ON SALE NOW!
Find your distributor:
http://www.mikroe.com/en/distributors/
mikroElektronika
SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
www.mikroe.com
electronics & microcontrollers
Jan Buiting
Editor
CONTENTS
Volume 35
September 2009
no. 393
technology
16 The Road to Battery Power
on
secti
new e-labs inside
43 A dirt cheap mobile phone
48 Battery Monitor 44 Double-sided soldering
in reflow oven!
This circuit can be used in any application where batteries are 46 Ill take it
charged and discharged. The circuit uses an LPC2103 microcontroller Yokogawa 2054 oscilloscope
connected to a 22-bit A/D converter to measure charge and discharge
currents, battery voltage, charge status (or available capacity) and the
instantaneous power being supplied to or drawn from the battery. info & market
6 Colophon
8 Mailbox
10 News & New Products
74 Elektor PCB Service FAQ
80 Elektor SHOP
84 Coming Attractions
infotainment
76 Hexadoku
77 Retronics:
Leak coaxial trough-line
VHF FM stereo tuner (1962)
elektor electronics worldwide
English
German
Dutch
French
Chinese
Portugal
Italian
Spanish
Swedish
Finnish
Volume 35, Number 393, September 2009 ISSN 1757-0875 Elektor is also published in French, Spanish, American English, German and Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl)
Dutch. Together with franchised editions the magazine is on circulation in more
Elektor aims at inspiring people to master electronics at any personal level by than 50 countries. Graphic design / DTP: Giel Dols, Mart Schroijen
presenting construction projects and spotting developments in electronics and
information technology. International Editor: Managing Director / Publisher: Paul Snakkers
Wisse Hettinga (w.hettinga@elektor.nl)
Publishers: Elektor International Media, Regus Brentford, Marketing: Carlo van Nistelrooy
Editor: Jan Buiting (editor@elektor.com)
1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261
4509, fax: (+44) 208 261 4447 www.elektor.com International editorial staff: Harry Baggen, Thijs Beckers,
Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Subscriptions: Elektor International Media,
The magazine is available from newsagents, bookshops and electronics retail Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England.
outlets, or on subscription. Design staff: Antoine Authier (Head), Ton Giesberts, Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447
Elektor is published 11 times a year with a double issue for July & August. Luc Lemmens, Daniel Rodrigues, Jan Visser, Christian Vossen Internet: www.elektor.com/subs
elektor - 9/2009
Elektor PCB Service NEW!
Your professional PCBs
and Prototypes The advantages at a glance
The PCBs are professional quality.
Elektor PCB Service is a new service from Elektor. You
No film charges or start-up charges.
can have your designs converted into a professional-
There is no minimum order quantity or charge
quality PCBs via the www.elektorpcbservice.com for this service.
Available to private and commercial customers.
website. Elektor PCB Service is intended for prototype
Well first check if your project is producible.
builders and designers who want to have their PCBs Well let you know within 4 hours!
made to professional standards, and for users who In order to supply two PCBs, we make three.
If the third board is also good, you receive it
want customised versions of Elektor PCBs. If you need as well free of charge.
a couple of protos with fast turnaround or a batch of You can use our online payment module to pay
easily, quickly and securely with Visa or Master-
5 to 50 units, Card.
we can meet
your needs at Procedure:
a favourable 1. Create your account
2. Place your order
price. 3. Your project is checked
4. Payment
5. Your order is shipped
9/2009 - elektor
info & market mailbox
elektor - 9/2009
4.091904 V / 7.28052 k 0.06% (estimated, not cal- Robohockey robotics conference the project
3.37662 k culated), because the typical Dear Editor I write regard- was originally named HoroISEC
= 1.89777203 V offset voltage of the op amps ing an article published in but we changed the name
is 0.22mV, equating to an Elektors April 2009 edition after a professors suggestion.
resulting in an error of error of 0.013%. called OkISEC: Multiplayer At http://horoisec.07x.net, if
For the I (current) calibra- Online Robohockey. you follow the link to the team
1.9 V / 1.89777203 V 1 tor, we should anticipate an The credits printed are some- (Equipa in Portuguese) every-
= +0.1171263% error of 0.08%, which for all how incomplete because there one who worked on the project
practical purposes becomes where six persons involved in is duly listed.
Conversely, with the the typical error. Extremes may the project, the ones listed in Ricardo Faria (Portugal)
LM4050 deviating +0.1% = occur, naturally, but still within the article plus Nuno Paiva,
4.100096V, R2 at 0.1% = the bounds described above. Daniel Bastos and myself. Thanks for that Ricardo, credits
3.8961k and (R4A + R4B) In the paper submitted to a due where credits due.
at 0.1% = 3.3838 k we get
IC3
10k
1k
Only with the current measure- transistors and ICs, and other R6 4 4 R10
100k P1 100k
ment (I), the worst case error is parts of the circuits are potted.
cumulative and would amount Do Elektor engineers have any R4 10k
2 3
100k
to total positive and nega- knowledge of memory effect? R3 IC2.A
1 5
7
R9 IC3.A
1 6
3 2
tive errors of +0.343% and Would Elektor like to develop 100k
6
IC2.B
R7
1k
5
IC3.B
15k
9/2009 - elektor
info & market news & new products
Digital radio tuner for DAB and FM signals integrates fast RSSI
Maxim Integrated Products recently sensor ensure fast, accurate scan 2.048MHz IF frequency that is
introduced the MAX2172 dig- and seek functions. The RSSI pro- compatible with most DAB digital
ital radio tuner for FM and dig- vides 2dB accuracy and outputs demodulators. The device is pack-
ital audio broadcast (DAB) sig- the measured level in digital form aged in a lead-free, 66mm,
nals, with a high sensitivity for the through the I2C bus. FM sensitivity 40-pin TQFN, and is fully speci-
FM, VHF, and L-band frequency is an outstanding 111dBm (typ), fied over the 40 degrees Celsius
ranges. This device integrates all and FM adjacent-channel perform- to +85 degrees Celsius extended
components necessary to imple- ance meets ETSI EN 55020. Draw- temperature range. An evaluation
ment a complete tuner solution, ing 61mA (typ.) from a single 3V kit is available to speed designs.
including LNAs, mixers, an IF fil- supply, the MAX2172 strikes an
ter, and a fully synthesized local excellent balance between per- http://www.
oscillator. Additionally, the IC inte- formance and power consumption, maxim-ic.com/MAX2172
grates a front-end tracking filter making it ideal for consumer and (090568-II)
to eliminate interference between on-chip received-signal-strength automotive applications.
the UHF, VHF, and FM bands. An indicator (RSSI) and temperature The MAX2172 utilizes a standard
10 elektor - 9/2009
Norfolk Amateur Radio Club wins prestigious award training
Norfolk Amateur Radio Club der and build electronic circuits,
(NARC) has won a prestigious and many have gone on to get
national award from the Radio their full amateur radio licences.
Society of Great Britain (RSGB) The RSGB were so impressed with
for its amateur radio and electron- Bright Sparks that they may use
ics training programmes. it as a model for a nationwide
The club was presented with the initiative.
RSGBs Kenwood Trophy for out- Other activities include direction-
standing contribution to amateur finding foxhunts where members
radio training at the societys AGM have to track down hidden trans-
in Newcastle. mitters with equipment they have
NARC holds its meetings at Eaton built themselves, special event sta-
CNS School in Nor wich on tions where contacts are made
Wednesday evenings and runs with other radio amateurs around
Foundation, Intermediate and the world and an annual two-day
Advance courses for prospective Radioactive Weekend with lec-
radio hams, typically 5-6 a year. It also runs a Bright Sparks pro- gramme to teach youngsters to sol- tures, hands-on sessions, a barbe-
Piezo speakers replay music and voice with flat frequency response
The latest addition netic parts such as magnets or VSLBP1913E series is the soft and
to Muratas family of coils, they are almost entirely EMI- flexible resin film the diaphragm is
piezoelectric ceramic free. Moreover, as piezo speakers mounted on. This film reduces the
speakers is ultra-thin, are primarily a capacitive load, primary resonant frequency and
just 1.2mm in thick- they can dramatically reduce damps resonant characteristics of
ness, with side ven- power consumption, especially in the piezo ceramic, contributing to
tilation in its sturdy the voice band. flattening the frequency character-
metal housing help- Frequency response of the new istic. The diaphragms multi-lay-
ing to keep the rectangular speakers is much ered piezo ceramic construction
thickness down. The improved over circular diaphragms creates powerful sound, up to a
VSLBP1913E series as the rectangular ones are multi- sound pressure level (SPL) of 90
unique rectangular modal multiple oscillation modes dB maximum (measured at 1kHz,
shape improves its can be generated along the long 5.0Vrms, sine wave, at 0.1m,
frequency response and minimises voice and music in todays thin and and short sides of the diaphragm, 0dB:20Pa).
dead-space in handheld devices. stylish mobile phone handsets. to create as many peaks on
The series flat frequency response Since piezoelectric ceramic the frequency axis as possible. www.murata.eu
makes it suitable for the replay of speaker actuators have no mag- Another improved feature of the (090568-IX)
9/2009 - elektor 11
info & market news & new products
12 elektor - 9/2009
Your source for MikroElektronika Development Tools and Accessories in the United Kingdom
We can supply all MikroElektronika development tools including compilers, development boards, add-on boards, programmers and starter packs. We aim to keep all products in stock for
same-day dispatch and can offer next-day delivery within the UK as well as insured delivery by airmail post or courier worldwide.
EasyPIC5 PIC Development Board - 89 BIGPIC5 PIC Development Board - 119 LV18FJ PIC Development Board - 89
Get off to the best start with An advanced development Designed for low-voltage
PIC microcontrollers with board for 64 and 80-pin PIC PICs in the LV18FxxJxx
the EasyPIC5. Supports 8, microcontrollers in the 18F family with on-chip Ethernet
14, 18, 20, 28 and 40-pin family, the BIGPIC5 provides connectivity, the LV18FJ
PIC10F/12F/16F/18F on-board USB programmer, incorporates USB program-
devices and features built- in-circuit debugger plus mer, in-circuit debugger and
in USB programmer, in- extensive I/O devices and useful I/O devices and
circuit debugger and useful communications interfaces. supports 64, 80 and 100-pin
I/O devices. LCD displays LCD displays and SD card- MCUs. LCD displays and SD
sold separately. sold separately. card sold separately.
EasyPIC5 Starter Packs also available comprising BIGPIC5 Starter Packs also available comprising BIGPIC5, LV18FJ Starter Packs also available comprising LV18FJ,
EasyPIC5, character and graphic LCDs, touch panel, tem- character and graphic LCDs, touch panel, temperature character and graphic LCDs, touch panel, temperature sensor
perature sensor and either BASIC, C or Pascal compiler. sensor and either BASIC, C or Pascal compiler. and either BASIC, C or Pascal compiler.
EasydsPIC4A dsPIC Development Board - 89 dsPICPRO4 dsPIC Development Board - 149 LV24-33A PIC/dsPIC Development Board - 99
EasydsPIC4A Starter Packs also available comprising dsPICPRO4 Starter Packs also available comprising LV24-33A Starter Packs also available comprising LV24-33A,
EasydsPIC4A, character and graphic LCDs, touch panel, dsPICPRO4, character and graphic LCDs, touch panel, character and graphic LCDs, touch panel, temperature sensor
temperature sensor and either BASIC, C or Pascal compiler. temperature sensor and either BASIC, C or Pascal compiler. and either BASIC, C or Pascal compiler.
EasyAVR5A AVR Development Board - 89 BIGAVR2 AVR Development Board - 89 Easy8051B 8051 Development Board - 89
Get off to the best start with Work with 64, 80 and 100-pin Get off to the best start with
AVR microcontrollers with AVR microcontrollers with the Atmels Flash 8051 micro-
the EasyAVR5A. Supports BIGAVR2 development controllers with the
8, 14, 20, 28 and 40-pin board. Includes built-in USB Easy8051B. Supports 14,
AVRs and features on- programmer and range of on- 16, 28, 32, 40 and 44-pin
board USB programmer board I/O devices. LCD 8051s and features on-
and useful I/O devices. displays and SD card sold board USB programmer and
LCD displays and SD card separately. useful I/O devices. LCD
sold separately. displays sold separately.
EasyAVR5A Starter Packs also available comprising BIGAVR2 Starter Packs also available comprising BIGAVR2, Easy8051B Starter Packs also available comprising
EasyAVR5A, character and graphic LCDs, touch panel, character and graphic LCDs, touch panel and either BASIC, Easy8051B, character and graphic LCDs, touch panel, tem-
temperature sensor and either BASIC, C or Pascal compiler. C or Pascal compiler. perature sensor and either BASIC, C or Pascal compiler.
EasyARM ARM Development Board - 109 EasyPSoC4 PSoC Development Board - 89 UNI-DS3 Universal Development Board - 99
Easily develop for NXPs Learn about and develop for With the UNI-DS3 you can
32-bit ARM microcontrollers Cypresss exciting PSoC easily work with a number of
with the EasyARM. mixed-signal array devices popular microcontrollers from
Includes on-board USB with the EasyPSoC4. different manufacturers simply
programmer and useful I/O Features built-in USB by buying optional plug-on
devices and supports 64 programmer and advanced MCU cards. Devices sup-
and 144-pin devices. LCD I/O devices and supports 8, ported include PIC, dsPIC,
displays and SD card sold 20, 28 and 48-pin PSoCs. AVR, 8051, ARM and PSoC.
separately. LCD displays and SD card MCU cards, LCD displays and
sold separately. SD card sold separately.
NEW PRO versions just released for PIC and AVR - NEW range of GSM/GPRS and GPS add-on boards and NEW PIC and AVR Starter Packs now come with PRO
existing mikroBASIC, mikroC and mikroPascal customers accessories just released. Contact us for details. versions of mikroBASIC, mikroC or mikroPascal.
can upgrade free-of-charge! Contact us for details.
Please see our website at www.paltronix.com for further details of these and other products
We also stock components, control boards, development tools, educational products, prototyping aids and test equipment
Paltronix Limited, Unit 3 Dolphin Lane, 35 High Street, Southampton, SO14 2DF | Tel: 0845 226 9451 | Fax: 0845 226 9452 | Email: sales@paltronix.com
Secure on-line ordering. Major credit and debit cards accepted. Prices exclude delivery and VAT and are subject to change.
info & market news & new products
14 elektor - 9/2009
technology automotive
The Road
to Battery Power
The dawn of the age of electric vehicles
By Ernst Krempelsauer (Elektor Germany Editorial)
At the beginning of the twentieth century the internal combustion engine started to take over
from electrically-powered vehicles. Now, a hundred years later, electric vehicles are slowly
but surely making a come-back. Development continues apace and the enormous potential is
clear. The key to the success of electric vehicles lies, contrary to early expectations, in lithium-
ion cells rather than in fuel cells.
It was an electric vehicle, driven by Belgian Camille Jenatzy, hybrid vehicle. The design was also the first to feature an
that was first to break the magical 60mph (about 100km/ electric hub motor and all-wheel drive (Figure2).
h) barrier in 1899. His torpedo-shaped car (Figure1) was From then on the onward march of the motor car, first with
accelerated to 105.88km/h by 200V lead-acid batter- internal combustion petrol engines and then with diesel
ies powering two 25kW motors. Although not lacking in engines, seemed unstoppable. The most significant factor
power, the vehicle fell rather short when it came to endur- in their rise was the ready availability of cheap crude oil
ance. No less an individual than Ferdinand Porsche, work- from which fuel could be made. A century later, conditions
ing at the Lohner company in Vienna, was inspired by this have changed for the internal combustion engine. Oil is
to try to overcome the disadvantages of electric drive by becoming scarcer and more expensive, and there is pres-
combining it with a petrol engine, thereby inventing the first sure to reduce CO2 emissions significantly. In todays hybrid
16 elektor - 9/2009
vehicles the benefits now work in the opposite direction: the
electric drive serves to help overcome the disadvantages of
the internal combustion engine. And the prospects for these
vehicles improve as batteries improve; ultimately the internal
combustion engine may disappear altogether.
This article presents an overview of current developments
and the prospects for battery technologies in future electric Figure1.
vehicles. Back to the future: 112
years ago the electric
vehicle was the leader of
Paving the way for hybrid vehicles the pack. In 1899 Camille
Hybrid electric vehicles (HEVs) have been in mass produc- Jenatzy reached a top
tion since the introduction of the Toyota PriusI in 1997. speed of 105.8km/h (66.1
They have shown that the electric drive train is suitable mph) in a vehicle powered
by lead-acid batteries
for mass production and reliable. With the manufacture of
delivering 50kW.
some two million HEVs in Japan, and simultaneous rapid
progress in the development of lithium ion batteries, it is
inevitable that companies all over the world are racing to
produce the electric vehicles of the future. The next develop-
ment is the so-called plug-in hybrid electric vehicle (PHEV),
with a socket to allow its battery to be charged, and an
increased range in purely electric operation. The first PHEV,
the F3DM from BYD in China, is already being made in
small quantities and being sold to governmental organisa-
tions. BYD (Build Your Dream) is the worlds biggest pro-
ducer of mobile phone batteries and also makes vehicles,
most recently in a joint venture with Volkswagen.
The Chevrolet Volt (and the Opel sister model, the Ampera)
are expected to be the first mass-market PHEVs, available
Figure2.
at the end of 2010. Current reports indicate that Toyota The 1900 Lohner-Porsche
and others will join the market in 2012. In the next three was a hybrid car: a
years the mass production of pure electric vehicles (EVs) petrol engine drove a DC
is also likely to begin. Current models, manufactured on generator to produce power
a relatively small scale, include the Tesla Roadster, made for the electric hub motors.
in California, and the Norwegian TH!NK. The i-MiEV is
expected to go into production this year: this compact car,
announced as the first mass-production pure electric vehicle, at least three years from mass production.
is the result of collaboration between Mitsubishi in Japan The current best-selling battery for electric vehicles is manu-
and PSA Peugeot Citron in France. The PSA group is still factured in great secrecy: the ZEBRA battery, which uses a
the biggest maker of EVs, having sold more than ten thou- NaNiCl chemistry, is relatively low-cost (around /500
sand units, but the situation is changing rapidly. Besides its per kWh) but has the disadvantage of an operating tem-
PHEV line, Toyota has also announced an EV version of the perature of around 300C and thermal losses of 100W,
new iQ for 2012, and in the same year Nissan expects making it not ideally suited to private vehicles. A significant
to sell one hundred thousand units of its EV model, to be advantage, however, is that it is highly insensitive to ambi-
unveiled at the Frankfurt Motor Show in September 2009 ent temperature. The high-temperature units are available
or perhaps even earlier. as an option on the TH!NK city electric car; the alternatives
available are A123 cells with a Lithium Iron phosphate
(LiFePO4) chemistry, and the EnerDel LiMn2O4 spinel cells.
One left over For future electric vehicle development it would appear that
Until recently hybrid vehicles used exclusively NiMH bat- lithium ion cells offer the best prospects, and that ZEBRA
teries: manufacturers committed to the technology for three cells will occupy only a small market niche. Indeed, lithium
to five years and built capacity to suit. However, NiMH is
a mature technology and its development seems to have
reached its limits; for modern PHEVs and EVs it does not
offer a compelling proposition in terms of cost and energy
density.
From the point of view of cost the stalwart lead-acid bat-
teries are hard to beat. Recent technological developments
have made them suitable for use in hybrid vehicles. With the
explosive rate of development in lithium ion batteries, how-
ever, lead-acid technology seems to be being left behind. Figure3.
There is little that can be done to improve energy density The Mercedes S400 Hybrid
and, in the world of electric vehicles, its use is confined to is the first mass-production
low-cost scooters. Supercapacitors, although unmatched in hybrid car to use a lithium
terms of cycle life, store too little energy to be useful, and ion battery. The battery
industry will likely not wait for the capacitors announced is completely sealed and
by Eestor, with an enormous claimed energy density, to temperature-controlled.
materialise: devices suitable for use in electric vehicles are Picture: Daimler Benz AG.
9/2009 - elektor 17
technology automotive
Tesla Roadster
Manufactured since 2008 in small quantities. Total energy
storage is 53kWh in 6,831 notebook-style lithium ion cells
(375V overall voltage); maximum range 220 miles (360 km);
maximum power 225kW. In May 2009 the Daimler Group
(which includes Mercedes) acquired a 10% stake in Tesla.
Mitsubishi i-MiEV
In mass production from the end of 2009. This electric version
of a small car popular in Japan has an under-floor battery
made from prismatic lithium ion cells by Yuasa. Energy stored
is 16kWh with a nominal battery voltage of 330V, giving a
100 mile (160 km) range. The battery can be charged from
an AC power outlet in seven hours, or fast charging is poss-
ible at specially-equipped stations.
Image: MITSUBISHI MOTORS Germany GmbH
Chevrolet Volt
In mass production from the end of 2010. General Motors
are pinning their hopes on this first mass production plug-in
hybrid. A petrol engine is used to recharge the battery from
time to time via a 53kW generator, extending the range of the
vehicle. When fully charged via its socket, the 16kWh lithium
ion battery is good for a range of 40 miles; with the petrol en-
gine this is increased to 400 miles (600 km). Originally A123
were to supply the cells, but for mass production the cells will
be made by LG Chem of Korea. The petrol engine is a 1.4li-
tre four-cylinder model made at the Opel plant in Vienna, and
Opel has considerable involvement in the design of the Volt.
The Opel (European GM) version will be called the Ampera
Image: IFCAR
and is expected to appear in 2011.
18 elektor - 9/2009
ion cells are already found in the first mass-produced Euro-
pean hybrid car: the Mercedes S400 Hybrid has an electric liquid Li-Ion
drive rated at 15kW and is classed as a mild hybrid. The
lithium ion battery is from Johnson Controls/Saft and has
Kathodenmaterial
cathode material Anodenmaterial
anode material
a capacity of 6.5Ah at 120V, for a total energy stored of
0.78kWh (Figure3). An interesting aspect of the design long life,
safety risk LiCoO2 Hard Carbon 3.7 V material,
LiC6 low full-cycle values
is that the cars air conditioning system is used to help sta- highest safety risk,
good performance LiNiO2
bilise the temperature of the battery. poor life cycle,
Graphite
Graphit 3.7 V material, costly,
safety better as Co & Ni LiMn2O4 LiC6 high full-cycle values Figure4.
popular add-on material
LiCo1/3Ni1/3Mn1/3O2
There is a wide range of
to optimize features Titanate
Titanat 2.2 V material safe,
Chemistry set great diversity in
Li4Ti5O12 low energy density recipes for the electrode
add-on materials LiCoxNiyMnzO2
materials used in lithium
The common features of all lithium ion cells are that, in 3.3 V material, economic
LiFePO4
Silizium
Silicon
Li22Si6
3.7 V material,
high energy density, ion cells, all with different
and safe base material
the charged state, one electrode contains lithium, and that research status
090498 - 11 characteristic properties.
charge is transported across the cell by lithium ions. A sig- Source: ISEA, RWTH Aachen University
nificant advantage of lithium-based cells is their high termi-
nal voltage and good capacity-to-weight ratio.
A wide range of recipes is available for the electrode mate-
rial itself, each having its characteristic terminal voltage and Saft VHP
VHP
GAIA
LiFePO4
other properties (see Figure4). The other factors affecting 100000 Ah
6 Ah GS Yuasa
LEV 50
LiTeC
characteristics and cost are the choice of electrolyte and of Li-Ion
Very High Power HP 6 Ah
SuperCap A123
separator. Liquid electrolytes based on organic solvents and 10000
Li-Ion
specific power in W/kg (cell level)
Lead spiral
wound High Power Saft VL M
conductive lithium salts can be used, as can solid or gel film Kokam
Kokam
electrolytes (as in lithium-polymer, or LiPo cells). LiPo cells
1000 Pouch-cell
NaNiCl2
ir
ir
ir
ir
ir
ir
-a
-a
-a
-a
-a
-a
-a
-a
a
n-
um
nc
lliu
iu
iu
Zi
di
ci
si
ni
th
in
ry
ne
al
So
ta
um
Li
Be
C
way off.
Ti
ag
Al
090498 - 13
M
Figure5 shows a comparison of specific power and Source: ISEA, RWTH Aachen University
energy for the storage technologies described above using
various types of lithium ion cells. The gap between high-
power lithium ion cells and high-energy cells is striking. around 3C is a reasonable value to give acceptable accel-
Table1 shows an overview of the typical characteristics of eration and braking. The problem here is chiefly one of
these two product types. High power output is important for energy density: a battery might have an energy density of
hybrid vehicles, which need to draw or store large amounts around 190Wh/kg, some six times smaller than that of pet-
of energy over short time periods. Figures of 200A (20C) rol (1154Wh/kg). Notwithstanding the regular announce-
are typical for a 10Ah cell. For very high power applica- ments of magical new nanomaterials promising five- to ten-
tions such as hybrid Formula1 racing cars, cells with spe- fold increases in energy density, Dirk Uwe Sauer, professor
cific power as high as 6kW/kg are available. at the Institute for Power Electronics and Electrical Drives,
In pure electric vehicles the battery is relatively larger than RWTH Aachen University, believes that energy densities
it is in hybrid vehicles. A charge or discharge current of of up to 300Wh/kg should be possible using 5V cath-
9/2009 - elektor 19
technology automotive
2,8
-20C 20C
2,6
-40C and with shallow cycles (DOD of a few percent) the situa-
2,4 tion is reversed. What the illustration does not show is that
Figure7.
At very low temperatures
2,2 the cells deteriorate gradually over time so that a little-used
the power output of a
2,0 cell will, after a few years, become completely kaputt, as
lithium ion cell falls 1,8
0 2 4 6 8 10 12 14
Professor Sauer puts it.
markedly. capacity [Ah] 090498 - 14 The operating life requirements for HEV batteries are from
Source: ISEA, RWTH Aachen University 8years to 12years, and spend most of their life between
40% and 60% charged. In pure EVs the DOD is typically
around 80% (charge level varying from 20% to 100%).
source: Varta / Johnson Control
3% DOD
Costs and resources
charge conversion / nominal cycles
5% DOD
20C, 20,000 nominal cycles @ 5% DOD,
The special high-energy batteries used in EVs are not yet
eq. to 400,000 cycles made in large quantities and so prices remain correspond-
ingly high at around / 1250 per kWh. By way of com-
Figure8.
parison, Kokam has LiPo batteries available in quantity
Cell life as a function 12% DOD
at under /500 per kWh; lithium ion high-
of discharge depth and
temperature for NiMH
energy batteries are available from China at
80% DOD
cells. The characteristics of around /250 per kWh (they are used in elec-
lithium ion and lead-acid
100% DOD
tric bicycles, of which some twenty million are
cells are similar. 090498 - 15
made every year); and lithium ion laptop batter-
Source: Varta / Johnson Control ies have fallen in cost by a factor of five over the
ten years from 1995 to 2005 (see Figure9),
and now cost around /200 per kWh. Experts
at RWTH Aachen University believe that with
600
energy density
3
mass production high-power batteries could fall
specific energy in price to /500 per kWh and high-energy
specific energy in Wh/kg, energy density in Wh/l
specific cost
500 2.5
batteries to /250 per kWh. Estimates from
Japan of /150 per kWh are somewhat more
400 2 optimistic.
cost in US$ / Wh
AABC 2004, San Francisco and price hikes. The difficulty can be ameliorated
by careful planning of production capacity and
early construction of recycling facilities for lithium
ode materials such as LiCoPO4 or LiNiPO4, or silicon-based batteries.
anode materials such as LiSi5. The only theoretically feasi-
ble option for energy densities above 1000Wh/kg is the
metal-air cell (Figure6), although a rechargeable cell of Small is beautiful
this type looks rather unlikely to appear within the next ten Although there has been much popular interest
years. Of course, it is always possible to revert to the old in pure EVs with plenty of power and range,
plan of exchanging ones metal-air battery at the filling sta- such as the Tesla Roadster, Professor Sauer thinks a better
tion, with the old batteries being regenerated on an indus- approach is to move towards vehicles with smaller batter-
trial scale. ies. He sees the idea of PHEVs equipped with rather small
batteries as the best way of replacing petrol with electricity
So, to return to the present and lithium ion cells: an impor- as quickly as possible There are many arguments in favour
tant factor in their operation is temperature. Excessively high of this small is beautiful position.
temperatures can be dangerous, leading to thermal runa-
way; operation at somewhat elevated temperatures reduces - The larger the battery, the more expensive the vehicle, and
a cells life, and operation at low temperatures reduces the so fewer vehicles will be sold. This is not the way to move
power. The loss is noticeable at 0C and at 30C the quickly towards the widespread use of electric vehicles.
output power is reduced to less than 10% of that at room - In industrialised countries the average distance travelled
temperature (Figure7). Some kind of temperature man- by a car is around 25 miles (40 km) per day. A battery
agement system, such as that used in the Mercedes S400 providing a 120 mile (200 km) range (about 30kWh) will
Hybrid as we mentioned above, is a good idea. An EV for remain 80% unused, but this unused fraction of the battery
20 elektor - 9/2009
Advertisement
must still be paid for and its weight must be carried around
by the vehicle. A PHEV with a 30 mile (50 km) range on
battery power (5kWh to 10kWh) might spend two-thirds
of its time in electric mode. Coupled with the increased effi- The new PicoScope 4000 Series
ciency of the hybrid drive this leads to a reduction of 70%
in petrol usage. high-resolution oscilloscopes
- The only EVs with a significant chance of a large market
are small city cars, especially in developing markets such
9/2009 - elektor 21
projects automotive diagnostics
OBD Analyser NG
Next-generation handheld with graphical display,
ARM Cortex M3 controller and Open Source user interface
By Folker Stange and Erwin Reuss (Germany)
The compact OBD2 Analyser in the June 2007 issue was an enormous success not surprising for an
affordable handheld onboard diagnostics device with automatic protocol recognition and error codes
explained in plain language. Now enhanced with a graphical display, Cortex M3 processor and an Open Source
user interface, the next generation of Elektors standalone analyser sets new standards for a DIY OBD2 project.
The key advantage of the OBD2 Ana- practical than a PC adapter. A glance clearly identified, providing readers
lyser NG is that its self-contained and at the comprehensive Features panel keen on programming with com-
can plug into any OBD diagnostic port. indicates that this new gizmo has plete control over the configu-
It is handheld and lightweight, requires plenty more to offer. The source codes ration of the GUI, the way
no batteries and works without a note- for the firmware of the controller are that process
book computer, making it far more
22 elektor - 9/2009
results are displayed and all manner
of other functions. The hardware offers Features
plenty of scope for expansion too, with
the PCB already laid out for adding Hardware Handheld Analyser:
extra options such as a flash memory Full graphics display 132 x 32 pixels
data recorder, a USB interface and a RGB backlighting
real-time clock (provision), in case you
Convenient four press button control
wish to implement an additional data
logging function. Power supply taken from onboard diagnostics port (12 V car battery)
Uses standard OBD cable
DXM Convenient size (126 mm wide x 68 mm tall x 25 mm deep)
9/2009 - elektor 23
projects automotive diagnostics
+12V
K-Line VPWM
L-Line M3
15
S-GND
13
MAX3232
buffer memory Rx
12
PWM-
PWM
+ necting up to the other wires or lines
10
24 elektor - 9/2009
+12V
DXM
1
2
12V LLINE
34
33
C4 Safety tips and
e-approval
C1 D1 PWMP KLINE +3V3
3 32
PWMM CANH 100n
4 31 2
10u GND CANL
1N4004
63V 30 1 V+ 16
EEPINIT
MODE1
29
C2 C1+
According to the legislation in some
IC1
MODE2
28
100n
3
C1 countries, diagnostic interfaces without
27 11 14
+3V3
5 9
3V3OUT
RTS
CTS
26 12
T1IN
R1OUT
T1OUT
R1IN
13 1 e-approval cannot be used in a moving
9 6
4
8
10
BOOT0 RXD
25 10
T2IN T2OUT
7 2
7 vehicle. Drivers should not allow them-
3 11 24 9 8 3
2
7
12
RESET
LED1
TXD
MOSI
23 4
R2OUT
C2+
R2IN
C6 4
8
selves to be distracted by OBD2 diag-
6 C3 9
1 13
LED2 MISO
22
MAX3232
100n
5
nostics during test drives on private land
14 21 5 15
15
3V3IN
LCD
PA8
SCK
20
100n C2
V- either. Safety must come first when it
OBD plug PC RS232
16
OSCOUT CS
19
C5
6 comes to diagnostic tests.
17 18
PB1 A0
S1 100n
090451 - 13
Figure 3. Basic circuit for an OBD2 interface with the DXM module.
DSP
overvoltage protection UP ESC
12V power supply
AUTO-SCAN
V batt DXM
3V3
detector DWN RESET ENT
+12V Processor clock
16
CAN
7
S-GND
13
control
5
RTC
4
VPWM M3
11
PWM
PWM-
PWM
+ CPU AT90CAN128
10
VPWM
L-Line CPU
9
buffer Rx
K-Line memory USB
OBD Tx
transit mode
Dataflash
Expansion Port 4 MByte
DIAMEX DXM
090451 - 14
Figure 4. Block diagram of the new handheld OBD2 analyser. Flash memory, RTC and USB connector are optional extras.
9/2009 - elektor 25
projects automotive diagnostics
10k
4 KLINE S2
LLINE 8
100n
panel of the case. PWMP 7
3
2
CANH
4k7
4k7
PF5(ADC5/TMS) PD5(TXCAN/XCK1)
DXM_TX 57 29 A0_DISP
backlight LEDs, a switching regula- BOOT0 58
PF4(ADC4/TCK) PD4(ICP1)
28 TXD1
PF3(ADC3) PD3(TXD1/INT3)
tor and a low voltage-drop regulator CAN-RX 59
PF2(ADC2) PD2(RXD0/INT2)
27 RXD1
CAN-TX 60 26 SDA SDA
for the power supply, plus of course 61
PF1(ADC1) PD1(SDA/INT1)
25 SCL SCL
PF0(ADC0) PD0(SCL/INT0)
the DXM module itself. The switch-
9 RST_DXM
ing regulator IC2 provides 5V for the PE7(ICP3/INT7)
8 BOOT0
+3V3 PE6(T3/INT6)
backlight LEDs. The low drop regula- PE5(OC3C/INT5)
7 BUZZER
6
tor LD1117 supplies 3.3V for the AVR J3
PE4(OC3B/INT4)
PE3(OC3A/AIN1)
5 CTS
Construction R3 R2 C10 C8
+5V +3V3
1R
1R
7
IC2
5
200uH 4
33R
MC34063
COMP
1
4
220u
1N4148 470p B0530WS 6V 1u 1u
26 elektor - 9/2009
H choke (L1). L1 needs to be angled is to solder the DXM module precisely the module lines up properly, so dont
round by 90 degrees to face the centre into position on the main board. Begin solder everything solidly straighta-
of the PCB. The next placement task by soldering just one pin. Make sure way. Just a brief and sensitive touch
of the soldering iron with the minimum
of solder is best. When all the unsol-
dered pins line up exactly with their
+5V holes, then the other pins can be sol-
PAD_5V
dered firmly and the solder on the first
PAD_LED5V1
pin reflowed to relieve any tension.
LED1 LED2 LED3 Before mounting the graphic display we
R G B R G B R G B need to install the backlight. This is not
RGB difficult: just separate the sub-board
BACKLIGHT
R7 R8 R9 R10 R11 R12 R13 R14 R15 already fitted with SMD LEDs (LED1,
LED2, LED3) from the main board by
68R
47R
68R
47R
68R
47R
110R
110R
110R
26
PC2(PCINT11) D+/SCK 22R 4
GND The display is the centrepiece of the
PC4(PCINT10)
R21
25
PC5(PCINT9/OC1B) PC7(INT4/IC1P/CLK0)
22
USB-B unit, so solder only one pin to begin
1 23
1k XTAL1 PC6(PCINT7/OC1A)
D5 D6 and check all round that it fits properly.
C19
GND UGND Once soldered into place, it is very dif-
3 28
100n
ficult to adjust afterwards and is eas-
2x
PGB0010603
ily damaged.
The Sub-D connector is slid onto the
OPTIONAL EXTENSIONS +3V3 board sideways and aligned accu-
4
VDD
rately (Figure9). Before you do this,
R24 IC5
make sure the stand-off sleeves have
6 7 5 been screwed tight onto the connector.
10k
SDA CLKOUT J4
VCC 6
MOSI 1 IC6 8 MISO 10
SCL
3
3V Last in line is the micro loudspeaker,
SI SO INT CLKOE Batt
CS_FLASH 4
CS WP
5
RTC8564
the opening of which should face in
SCK 2 3
SCK
AT45DBXXX
RST
GND the direction of the backlights.
GND
7
9
Assembling the case is very simple by
comparison. Four aluminium plungers
are set above the touch switches and
the PCB is affixed with the screws sup-
plied. Finally the case lid is placed on
RST_DISP
A0_DISP
CS_DISP
MOSI
SCK
+3V3 STANDARD
BACKLIGHT
top and screwed together.
+5V
34 35 36 37 38 39 40
VDD
VDD
SCL
CS1B
A0
RST
and commissioning
SI
25 1 R25
V4 A1
24 2
DSP1
33R
V3 C1
23
22
V2 LC DISPLAY 132 x 32 20
To begin we can apply a voltage of 12V
21
V1 A2
C2
19 at the Sub-D connector (Pin9 = 12V;
CAP1N
CAP2N
V0
CAP1P
CAP2P
CAP3P
VSS
T5
9/2009 - elektor 27
projects automotive diagnostics
28 elektor - 9/2009
Figure 8. This is how the LEDs for the display backlight are fitted. Figure 9. The Sub-D connector needs to be soldered on both
sides of the PCB.
threshold values that actuate acoustic formant 10-pin ISP interface. You need [1] www.dxm.obd-diag.net
and optical alarms. This sample software to set jumper J5 if the programming (in German only, use Google to translate)
demonstrates that the analyser hardware adapter is expecting a supply voltage [2] www.er-forum.de/obd-diag-dl
is not restricted to diagnostics. As the on Pin 2. The authors used a low-cost (starts up in German but will display in
firmware is Open Source, users are free programmer [6] for this. English if you register [click on Login and
to alter and expand this themselves, also A data bank of error codes is already select Register] and set Sprache to English)
make enhancements available to other included in the firmware but this too [3] www.modiag.de
users. A commercial approach is also fea- can be altered, for instance to expand (in German only, use Google to translate)
sible, perhaps for LPG gas conversion or the information already entered. The [4] www.elektor.com/090451
additional convenience features, such as only limitation is the amount of flash
speed-dependent central locking or audi- memory available in the controller. Fur- [5] www.lightner.net/lightner/bruce/
Lightner-183.pdf
ble warning of speed. Other ideas include ther tips can be found among the com-
a stopwatch function, GPS navigation, ments included in the source code. [6] www.stange-distribution.de
GPRS redirection, event-driven relay New firmware can be burnt in rapidly (English version available)
functions or even a dynamometer, an using an ISP programmer and a com- [7] www.forum.obd-diag.net (German), www.
acceleration meter and a small onboard patible GUI using AVR Dude [6], for obdii.com/forums/ubbthreads.php and
computer. The expansion port could be which the original program is available www.obd-codes.com/forums/ (English)
used to scan additional sensors (e.g. as hex code. [8] www.elektor/forum
temperature). Average fuel consumption Many of the development ideas have
[9] http://carlist.blafusel.de
is another popular subject, with an inter- already appeared on the DXM Plat-
(English version available)
esting approach to be found at [5]. A CO2 form [1] and in a forum [7]. This and
monitor and an eco-meter would make the Elektor forum [8] are great places
very topical projects to support greener for swapping ideas and suggestions,
motoring. also finding construction help and
The programming connections of the application tips.
AVR are available via an Atmel-con- (090451-I)
Expansion components data. A B-type USB connector needs to be retrofitted in this case, fit-
ted at right angles. Mechanical stability is assured by soldering the
You have the option of equipping the board with a number of addi- screen to the circuit board. The casing is not deep enough for fitting
tional components ready for future developments: it the normal way round.
9/2009 - elektor 29
projects gps
GPS Datalogger
Basic Stamp linked to Google Earth
By Chris Savage (USA)
There are plenty of projects out there that deal with GPS and
microcontrollers, many of which make use of the data
for such things as navigation. The Robo-Magellan
competition is one such application. But what if
you wanted to visualise the path your robot
took through such a course? Better
yet, what if you wanted to log
the path of a bike or car
trip? Heres how.
30 elektor - 9/2009
details here. The language is very pow-
erful and warrants a look if youre inter-
ested in creating files for Google Earth.
For our purposes we will only want to
create paths. In order to do this we will
need three pieces of information:
BASIC Approach to KML Since this creates a break in the header pleteness the drawing includes the
For an understanding of the discussion block the value 255 is used to separate parts on the Parallax Super Carrier
below, you will find it useful to refer to blocks of KML code, see Listing1. Board used for building the proto-
the GPS Datalogger v. 1.0 code list- types. Use the Component List to do
ing contained in archive file # 081079- your shopping. Figure3 shows the
11.zip at [3].
Building the GPS Datalogger constellation of boards that make up
The program is very straightforward Figure2 shows the schematic for the the logger. In Figure4 you can see the
and includes many pieces of code from GPS Datalogger. For the sake of com- user I/O parts (switches, resistors,
other programs the author wrote for
the various hardware used.
The BASIC Stamp module has 2K of
EEPROM available for program and Practical use the system is ready to start logging data.
There are two pushbuttons on the GPS
data to be stored. The original concept
The Parallax Memory Stick Datalogger and Datalogger Board. Pressing the yellow one
of doing this by hard-coding the data
Parallax GPS Modules are used, so the first (SW2 on port line P15) until the LED turns
into SEROUT statements was put to thing that happens is the program initial- red will start the logging process. The GPS
the test. However, this left no room for ises and establishes communication with Datalogger writes data to the USB drive
making the program do anything other the Datalogger. A bi-colour LED is used to at a fixed rate of about one sample every
than writing the data straight from indicate status and blinks green while the three seconds. If the GPS signal is lost dur-
the GPS Module, so it was decided Datalogger is initialised. If no USB drive ing logging, the last coordinates are written
to create a data table in EEPROM of is connected the program will wait until it at the same rate. This makes it possible to
all the header data used to create the is connected before moving on. Once the
determine how long the data was accumu-
KML file. In order to do this, quotation Datalogger is initialised and the drive is
lated, even during times when the signal is
marks had to be coded into ASCII val- identified the program will write out the
not valid.
ues since quotes are used to enclose KML header data. This will take several
seconds since it is being read byte-by-byte
text. To trim a few more bytes, instead
from EEPROM and written out to the drive. At any time once the USB drive has been
of using a CRLF (carriage return / line
While this is happening the LED will be initialised you can hold down the red but-
feed; remember?) for each line a sin- fast- blinking red. ton (SW3 on port line P12) until the LED
gle null (zero) byte was used, being starts blinking red. This will write out the
replaced by the program whenever Once the data is written the program will
attempt to get the satellite signal status from KML footer data and close the file. When it
encountered. There was also a need is safe to remove the USB drive the LED will
the GPS module to see if the signal is valid.
to change the Altitude mode eas- blink red/green alternately. It is not advis-
During this process, which may take up to
ily. After trying several methods it 2 minutes to complete, the LED will slow- able to remove it at any point before this,
was ultimately decided to hard code blink red. Once the satellite signal is valid since corruption of the data or even the file
the text section of that one command the LED will turn solid green to indicate that system is possible.
based on a mode constant being 0 or 1.
9/2009 - elektor 31
projects gps
Vin R1
J1
B1
470R
C1 C2
9V
47u 47u D1
Battery
6V...12V Connector
Vss green
J2 Vss
1
6 SW1
2
7 1 24 +5V
SOUT VIN
3 2 23 RESET
SIN VSS
8 3 22
C4 ATN RES +5V J3
PARALLAX INC
4 4 U1 21
VSS VDD
GPS Receiver
R4 GND
9 5 20
100n C3 220R P0 P15 VCC
5 6 19
P1 P14 SIO
D2 7 18 /RAW
100n P2 P13
8 17
P3 P12 +5V GPS
9 BASIC 16
P4 P11
Bi-color 10 STAMP 15
red/green P5 P10
11 BS2 14
P6 P9 SW3 SW2
12 13
P7 P8
+5V
R2 R3
J4 Datalogger
10k
10k
8 S U 1
P
G
R 081079 - 11
JP1
PARALLAX
FTD1
USB
Rev A
Figure 2. GPS Datalogger schematic. The yellow area indicates the Super Carrier board.
bicolour LED) soldered in place on the while building it to simplify debugging A hungry client
prototyping area of the Super Carrier. if there is an issue. There are programs
Also note that a mounting hole was for testing the GPS, Datalogger, LED Once everything is assembled you
pre-drilled for the GPS Module and a and buttons. can download the file GPS Datalogger
4-pin SIP socket was installed. While The GPSTest.bs2 file is a modified V1.0.bs2 and start logging data. The
not required, this is recommended. You version of the GPS Demo program. The Super Carrier Board powers everything
will also need a 12mm (0.5) threaded DataloggerTest.bs2 file is a modified from its own 5volt regulator, so for
standoff between the board and the version of the Datalogger Demo pro- testing a cable which plugs into a cig-
GPS Module. gram and the ButtonLEDTest.bs2 pro- arette lighter or auxiliary connector in
A rubber foot from the Super Carrier gram was quickly written for the pur- a car is conveniently used to power the
Board was cut in half and used as a poses of testing those components. board. Note that the cigarette lighter
pad to hold up one end of the Memory Downloading the ButtonLEDTest.bs2 socket normally does not supply power
Stick Datalogger so that there is extra program will blink the bi-colour LED when the ignition is switched off.
support when inserting a USB drive red 5times, green 5times, then alter- Placing the board up in the centre of
into it. nate red/green 5times. After that it the dashboard nearest the window
At this point it is a good idea to run the will report whenever either of the but- will yield the best results and you
test programs included in the source tons is pressed. You should run these will rarely lose signal. Our advice is if
code package. The programs allow you programs to make sure all the hard- youre going to test it like we did, get
test individual subsystems of a project ware is functioning before moving on. some Velcro or temporarily tape it in
32 elektor - 9/2009
place. All regulations in force in your
country governing minimum unob- Listing 1. GPS datalogger code (extract)
structed windscreen area should be
observed. Write_Header:
SEROUT TX\CTS, Baud, [$07, $20, logdata.kml, CR] Delete File
The whole system consumes about GOSUB Get_Data Purge Receive Buffer
200mA of current depending on the
USB drive used. This causes the volt- SEROUT TX\CTS, Baud, [$09, $20, logdata.kml, CR] Create File
age regulator on the Super Carrier GOSUB Get_Data Purge Receive Buffer
Board to become quite warm. Be care-
counter = 0 Reset Byte Counter
ful of grabbing the board near the reg- DO
ulator. Another note about this is due TOGGLE LEDA Blink Red LED
to current consumption this unit can- READ Header + counter, ioByte Get Next Byte From EEPROM
not be powered from a regular 9volt IF ioByte = 0 THEN Replace 0 Bytes w/CRLF
battery. You will need a high capacity SEROUT TX\CTS, Baud, [$08, $20, $00, $00, $00, $02, $0D,
$0D, $0A, $0D]
power source, or if used in a car or on
ELSEIF ioByte = 255 THEN End Of Data Block
a motorcycle you can use the cigarette EXIT
lighter or auxiliary connector and you ELSE
should be okay. For a bicycle a genera- SEROUT TX\CTS, Baud, [$08, $20, $00, $00, $00, $01, $0D,
tor may even be possible. ioByte, $0D]
ENDIF
counter = counter + 1 Increment Pointer
Final Thoughts GOSUB Get_Data Purge Receive Buffer
LOOP
The code as supplied for the project
(downloadable at [3]) is relatively large
and uses all but six bytes of the EEP- people like to see some feedback when gram memory.
ROM space. The main reason is the testing things for the first time and the Note that by default the data logged
number of very verbose DEBUG state- author was inclined to provide that ignores elevation (altitude) data. If you
ments, which are not needed and can although DEBUG statements (or any- wish to enable this you can change the
be taken out or commented out. Many thing with added text) use a lot of pro- mode constant toward the beginning
Advertisement
9/2009 - elektor 33
projects gps
Internet Links
[1] http://earth.google.com
[2] http://maps.google.com
[3] www.elektor.com/081079 Figure 4. A closer look at how the bare bones user interface is built on the Super Carrier board. For your convenience everything
except the prototyping area has been greyed out. Note the PCB standoff used to secure the GPS module to the board.
BASIC Stamp
programming
Programming the BASIC Stamp (BS) plug-in
module is no Rocklin Science and based on a
free tool called Basic Stamp Windows Editor,
which is also available in Mac and Linux fla-
vours. The latest version may be found at http://
www.parallax.com/tabid/477/Default.aspx.
Basically, all you have to do is connect the BS
dev board to the PC using a standard RS232
cable, run the BS Windows Editor program,
load the file you want to transfer to the BS (it
has the .bs2 extension), run a quick syntax
check on it, and if all is beyond reproach
(message: Tokenize Successful), download it
to the BS.
34 elektor - 9/2009
Dont just test it...
...Analyse it!
Special Offer prices for limited period or while stocks last! electronic design ltd
Atlas SCR - Model SCR100 Atlas IT - Model UTP05 Atlas ESR - Model ESR60
Connect Triacs or Thyristors
any way round.
Auto part+pinout identification
Special Offer! Special Offer!
Identify network cabling type. Capacitance and ESR!
Check gate 100uA to 100mA.
Identify many fault types. Capacitance 1uF to 22,000uF
Measures gate voltage drop.
Tests sockets and cables. ESR 0.01ohms to 20 ohms
Regulated load test conditions
Complete with all this: Gold plated croc clips
75.00 inc VAT
(65.21+VAT)
Atlas DCA - Model DCA55 Atlas LCR - Model LCR40 Atlas Star Pack (LCR/DCA)
The famous Peak Atlas! Passive component analyser. Money Saving Pack: Save 20
Now with premium probes. Identify inductors, capacitors
Includes the Atlas LCR,
Connect any way round to and resistors. Auto frequency
Atlas DCA and a premium
identify semiconductor type, selection. Removable probes.
padded carry case.
pinout and lots of parameters. with extra spare battery.
Seller!
Transistors
Best
1-layer up to 30-layer
Cost and quality
On time delivery
Dedicated service
Instant Online Quote & Order
. . . . . Day and Night
9/2009 - elektor 35
projects microcontrollers
We recently announced that we would bring you an R32C starter kit project, including not only its own
power supply, I2C and SD card interfaces, but also an OLED display panel. Here we deliver on our
promise: see for yourself with our example oscilloscope project!
10
series continued with an application 1
2
VDC1
NSD
VDC0
P93
1
2
VCC
board in March 2006[2]. This mother- 3 CNVSS VDC1 1
VDC1 VDC0
64 VDC0 AVCC 3
4 XCIN NSD 2 63 P93 VREF 4
board, onto which the processor board 5 XCOUT CNVSS 3
NSD TB3IN/P93
62 AVCC WIZ_CS 5
CNVSS AVCC
+3V3
could readily be mounted, greatly 6
7
RESET
XOUT XCIN 4
IC2 VREF
61
60
VREF
WIZ_CS
AVSS
S1
6
7
K10
simplified the development of a wide 1
GND
GND 8 XCOUT 5
XCIN/P87
XCOUT/P86
AN0/P100
AVSS
59 AVSS S2 8
2 AN00 9 XIN RESET 6 58 S1 S3 9
range of applications. In May of that 3 AN01 VCC 10
RESET AN1/P101
57 S2 LED1 10
0V...+3V3
AN2/P102
year the series continued with a simple 4 AN02
+3V3
11 WIZ_A1 XOUT 7
XOUT AN3/P103
56 S3 LED2 11
5 AN03 12 WIZ_A0 55 LED1 LED3 12
oscilloscope application[3]. As well 6 13 WIZ_INT XIN 9
XIN
AN4/P104
AN5/P105
54 LED2 LED4 13
W/TA2IN/P75 INT5/P17
25 TXD1 WIZ_RD 20 DB5 25
offers considerably more processing 47u
16V
47u 4u7 26 RXD1 WIZ_SCS 21
W/TA2OUT/P74
44 DB1 DB6 26
16V V/TA1IN/P73 AN20/P20
power than its forebear, while still 27
28
CLK1
CTS1
WIZ_SCLK
WIZ_MISO
22
23
V/TA1OUT/P72 AN21/P21
43
42
DB2
DB3
DB7
DB8
27
28
remaining largely code-compatible GND 29 P33 WIZ_MOSI 24
TB5IN/P71
TA0OUT/P70
AN22/P22
AN23/P23
41 DB4 SS0 29
8
2
PWR_EN 9 6 GND
EN IC1 VS OLED_VDD R9 R10
1
VOUTP
4k7
4k7
Power supply
11 7 K4
PVIN FBN
R1 R2
+3V3 C11 CLK1 1 2
8
4k7
39k
CTS1 9 10
controllers will quickly recognise the SWN
D1 OLED_VSS
RXD1 11 12
4
3
13
10
C3 C9 C10 C7 C4
board. Let us start with the power sup- L2
E8a debugger
4k7
36 elektor - 9/2009
Features
socket for R32C processor board
all pins available on headers
power supply via mains adaptor
three buttons and four LEDs
8 digital I/O pins
4 analogue inputs
SD card interface controlled over
SPI
I2C connection
2.4inch OLED panel with
integrated controller (240 by
320 pixels), and on-board power
supply
socket for Ethernet and TCP/IP
daughter board
connection for E8a debugger
+3V3
Power is made available on the various
OLED_VDD headers on the board that the R32C
+3V3
R12 R13 uses to communicate with the outside
K1
10k
10k
54
1
SDA2 2
slave devices or any more sophisti-
VCI
VCI
IOVCC
AR_VDD
SCL2 3
4
C12M
6 cated interface circuits that you might
5 23 C1
6 24
DB17 design. Circuits can be constructed on
DB16 1u
GND I2C
25
26
DB15 C12P
7
8
the prototyping area provided on the
+3V3 Card 27
DB14
DB13
C11M
C2 board.
28
DB12 1u
RXD0 7 29 9
DO DB11 C11P
6
VSS2
30
DB10 C31P
11 We will look at the interfaces in more
CLK0 5 31 C5
4
CLK
VDD
DB8 32
DB9
DB8
K2 detail later, but for now we just note
1u
TXD0
3
2
VSS1
DB7
DB6
33
34
DB7 C31M
12
13
that under no circumstances should
SS0 1
DI
CS
DB5 35
DB6
DB5
C32P
C6 the R32C be powered over the USB
DB4 36
DB3 37
DB4
14 1u socket on the processor board when
SD Card DB3 C32M
GND DB2 38
DB2 C21P
17 it is mounted on the application
+3V3 DB1 39 C8
40
DB1
DB0
C0240QGLB-T board! This would lead to 5V rather
1u
GND 58 C21M
18
than 3.3V appearing on all the power
16
K9 4
X- VCI1
1 59 10 supply pins, likely causing irreversible
VCC
Y- VLOUT1
2 IN1 4 13 60 15
3 IN2 5
P0 INT
61
X+ VLOUT3
16 damage to components.
P1 IC4 Y+ VLOUT2
4 IN3 6 14 SCL2 52
P2 SCL MVDD
5 IN4 7 15 SDA2 CSB 47 53
6 IN5 9
P3
P4
SDA
RW_WRB 48
CSB
RW_WRB
VREG1OUT
VGH
55 In order to isolate the board from the
PCF8574
7
8
IN6
IN7
10
11
P5 A0
1
2
RS
E_RDB
49
50
RS VGL
56
44
5V supply present on the USB con-
P6 A1 E_RDB ENABLE
9 IN8 12
P7 A2
3 RESETB 51
RESETB SDI
45 nector when it is used to program
10 46
the microcontroller, it is essential to
GND
SDO
DOTCLK
AR_VSS
HSYNC
VSYNC
ID_MIB
+3V3
located on the underside of the proces-
43
42
41
2
22
21
19
57
5
1u 1u 1u 1u 1u 1u 1u 1u
GND
R7
sor board (see Figure2). Before using
2k4
GND
the application board, therefore, use a
S1
S2
S3
OLED_VSS
+3V3 soldering iron and a little desoldering
+3V3 +3V3 braid to break the connection to pre-
D2 D3 D4 D5 K7 K8
WIZ_MOSI 1 2 WIZ_MISO 1 2 RESET WIZ_SCS
vent the risk of the high voltage per-
S1 S2 S3 R3 R4 R5 R6
DB2 3 4 DB1 WIZ_SCLK 3 4 SCS R8 manently damaging the board.
DB4 5 6 DB3 WIZ_WR 5 6 WIZ_RD
0R
1k
1k
1k
1k
9/2009 - elektor 37
projects microcontrollers
Oscilloscope
Figure3. The board sports pushbuttons, LEDs, an I2C interface, an OLED panel, Now we come to the main course: a
an SD card interface and a socket for an Ethernet module. two-channel oscilloscope example
38 elektor - 9/2009
Figure4. There is plenty of space on the board for further expansion.
application to show off the power of ple rate of 480kHz. According to the using an external device it is also eas-
the R32C. The software is available Nyquist-Shannon sampling theorem, ier to suppress noise by providing the
for free download from the web pages the available bandwidth is equal converter with a power supply free of
accompanying this article[5]. to half the sample rate, in this case interference from the circuitry inside
240kHz. Although this may not seem the microcontroller.
The software only emulates a few of very impressive, it is worth remem-
the basic functions of an oscilloscope, bering that we are using the micro-
and can of course be extended and controllers built-in converter rather
The program
modified as the fancy takes you. The than a special-purpose A/D converter When the program starts it carries out
analogue-to-digital (A/D) converter IC. If higher sample rates are required, all the necessary initialisations, in par-
in the R32C offers a conversion time an external device can be connected, ticular of the R32Cs clock generator
of 2.06s and thus a maximum sam- using the SPI or a similar port. When and of the display. The function library
9/2009 - elektor 39
projects microcontrollers
40 elektor - 9/2009
Listing2: Rendering the oscilloscope trace
/********************************************************************
* DRAWING *
********************************************************************
* Parameter: *
* - channel: describes the channel which should be drawn *
* - data: reference to the data buffer *
* - offset: offset for the measured values *
* - yoffset: position of base line: *
* channel 0: 0 *
* channel 1: -100 *
********************************************************************/
void oszi_draw_data(unsigned char channel, unsigned int *data, unsigned int offset, signed char yoffset)
{
unsigned int pos, ypos, ypos_ref, ypos_prev, ypos_draw, data_pos;
// set offset for data buffer
// the values of both channels are alternating
data_pos = offset * 2 + channel;
// calculate the first value
ypos_prev = 105-yoffset-((unsigned int)(data[data_pos])%1024)*100/1023;
// calculate all 309 values and draw the connection lines
for(pos=1; pos<=310; pos++)
{
// calculate the new position for data buffer
data_pos = (pos+offset) * 2 + channel;
// calculate new Y-position
ypos = 105-yoffset-((unsigned int)(data[data_pos])%1024)*100/1023;
// calculate the average of old and new Y-position
ypos_ref = (ypos_prev + ypos) / 2;
// draw falling or horizontal connection lines
if(ypos_prev >= ypos)
{
// draw line starting from first X-value of the old Y-position to the reference (half height)
for(ypos_draw=ypos_prev;ypos_draw>=ypos_ref; ypos_draw--)
setPixel(ypos_draw, 315-(pos-1), 0x3F, (channel==0)?0x00:0x3F, 0x00);
// draw line starting from the second X-value of the reference to the new Y-position.
for(ypos_draw=ypos_ref;ypos_draw>=ypos; ypos_draw--)
setPixel(ypos_draw, 315-pos, 0x3F, (channel==0)?0x00:0x3F, 0x00);
}
// draw rising connection lines
else
{
// draw line starting from first X-value of the old Y-position to the reference (half height)
for(ypos_draw=ypos_prev;ypos_draw<=ypos_ref; ypos_draw++)
setPixel(ypos_draw, 315-(pos-1), 0x3F, (channel==0)?0x00:0x3F, 0x00);
// draw line starting from the second X-value of the reference to the new Y-position.
for(ypos_draw=ypos_ref;ypos_draw<=ypos; ypos_draw++)
setPixel(ypos_draw, 315-pos, 0x3F, (channel==0)?0x00:0x3F, 0x00);
}
// store Y-position as the old Y-position
ypos_prev = ypos;
}
}
9/2009 - elektor 41
4XDVDU(OHFWURQLFV/LPLWHG 3RVWDJH 3DFNLQJ2SWLRQV8SWR.JJURVVZHLJKW8.6WDQGDUG
32%R[%LVKRSV6WRUWIRUG 'D\'HOLYHU\8.0DLQODQG1H[W'D\'HOLYHU\
(XURSH(85HVWRI:RUOGXSWR.J
&0:38QLWHG.LQJGRP
2UGHURQOLQHIRUUHGXFHGSULFH8.3RVWDJH
7HO :HDFFHSWDOOPDMRUFUHGLWGHELWFDUGV0DNHFKHTXHV32VSD\DEOH
)D[ WR4XDVDU(OHFWURQLFV3ULFHVLQFOXGH9$7
(PDLOVDOHV#TXDVDUHOHFWURQLFVFRP 3OHDVHYLVLWRXURQOLQHVKRSQRZIRUGHWDLOVRIRYHUNLWV
:HEZZZTXDVDUHOHFWURQLFVFRP SURMHFWVPRGXOHVDQGSXEOLFDWLRQV'LVFRXQWVIRUEXONTXDQWLWLHV
&UHGLW&DUG
6DOHV
7KH(OHFWURQLF.LW6SHFLDOLVWV6LQFH
7KH(OHFWURQLF.LW6SHFLDOLVWV6LQFH
,QIUDUHG5&5HOD\%RDUG
0RWRU'ULYHUV&RQWUROOHUV &RQWUROOHUV /RJJHUV ,QGLYLGXDOO\FRQWURORQ
ERDUGUHOD\VZLWKLQFOXGHG
+HUHDUHMXVWDIHZRIRXUFRQWUROOHUDQG +HUHDUHMXVWDIHZRIWKHFRQWUROOHUDQG LQIUDUHGUHPRWHFRQWUROXQLW
GULYHUPRGXOHVIRU$&'&8QLSRODU%LSRODU GDWDDFTXLVLWLRQDQGFRQWUROXQLWVZHKDYH 7RJJOHRUPRPHQWDU\P
VWHSSHUPRWRUVDQGVHUYRPRWRUV6HH 6HHZHEVLWHIRUIXOOGHWDLOV6XLWDEOH368 UDQJH[PP6XSSO\9GF$
ZHEVLWHIRUIXOOUDQJHDQGGHWDLOV IRUDOOXQLWV2UGHU&RGH368 .LW2UGHU&RGH.7
$VVHPEOHG2UGHU&RGH$6
&RPSXWHU&RQWUROOHG6WDQGDORQH8QLSR &K6HULDO,VRODWHG,25HOD\0RGXOH
ODU6WHSSHU0RWRU'ULYHU &RPSXWHUFRQWUROOHG 1HZ&KDQQHO6HULDO3RUW7HPSHUDWXUH
'ULYHVDQ\9GFRU FKDQQHOUHOD\ERDUG$ 0RQLWRU &RQWUROOHU5HOD\%RDUG
OHDGXQLSRODUVWHSSHU PDLQVUDWHGUHOD\RXWSXWV FKDQQHOFRPSXWHU
PRWRUUDWHGXSWR$PSV LVRODWHGGLJLWDOLQSXWV8VHIXO VHULDOSRUWWHPSHUDWXUH
3URYLGHVVSHHGDQGGLUHF LQDYDULHW\RIFRQWURODQG PRQLWRUDQGUHOD\FRQ
WLRQFRQWURO2SHUDWHVLQVWDQGDORQHRU3& VHQVLQJDSSOLFDWLRQV&RQ WUROOHUZLWKIRXULQSXWV
FRQWUROOHGPRGHIRU&1&XVH&RQQHFWXSWR WUROOHGYLDVHULDOSRUWIRUSURJUDPPLQJXVLQJ IRU'DOODV'66RU
VL[GULYHUERDUGVWRDVLQJOHSDUDOOHO RXUQHZ:LQGRZVLQWHUIDFHWHUPLQDOHPXOD '6%GLJLWDOWKHU
SRUW%RDUGVXSSO\9GF3&%[PP WRURUEDWFKILOHV,QFOXGHVSODVWLFFDVH PRPHWHUVHQVRUVHDFK)RXU$
.LW2UGHU&RGH.7 [[PP3RZHU6XSSO\ UDWHGUHOD\FKDQQHOVSURYLGHRXWSXWFRQWURO
$VVHPEOHG2UGHU&RGH$6 9GFP$ 5HOD\VDUHLQGHSHQGHQWRIVHQVRUFKDQQHOV
.LW2UGHU&RGH.7 DOORZLQJIOH[LELOLW\WRVHWXSWKHOLQNDJHLQDQ\
&RPSXWHU&RQWUROOHG%L3RODU6WHSSHU $VVHPEOHG2UGHU&RGH$6 ZD\\RXFKRRVH&RPPDQGVIRUUHDGLQJ
0RWRU'ULYHU WHPSHUDWXUHDQGUHOD\FRQWUROVHQWYLDWKH
'ULYHDQ\9GF$PS &RPSXWHU7HPSHUDWXUH'DWD/RJJHU 56LQWHUIDFHXVLQJVLPSOHWH[WVWULQJV
ELSRODUVWHSSHUPRWRUXV FKDQQHOWHPSHUDWXUHORJ &RQWUROXVLQJDVLPSOHWHUPLQDOFRPPV
LQJH[WHUQDOO\VXSSOLHG9 JHUIRUVHULDOSRUW&RU) SURJUDP:LQGRZV+\SHU7HUPLQDORURXU
OHYHOVIRU67(3DQG', &RQWLQXRXVO\ORJVXSWR IUHH:LQGRZVDSSOLFDWLRQVRIWZDUH
5(&7,21FRQWURO2SWR VHSDUDWHVHQVRUVORFDWHG .LW2UGHU&RGH.7
LVRODWHGLQSXWVPDNHLWLGHDOIRU&1&DSSOLFD PIURPERDUG:LGH
WLRQVXVLQJD3&UXQQLQJVXLWDEOHVRIWZDUH UDQJHRIIUHHVRIWZDUHDSSOLFDWLRQVIRUVWRU
%RDUGVXSSO\9GF3&%[PP LQJXVLQJGDWD3&%MXVW[PP3RZHUHG 3,& $70(/3URJUDPPHUV
.LW2UGHU&RGH.7 E\3&,QFOXGHVRQH'6VHQVRU
stashed in a wallet or purse. Heiko Loy, the press spokesman for Silicon Solution [2]. It is most likely used to store SMS texts, phone
Pearl, told us that the 17Euro mobile phone is mass produced in directory, caller information and multiple versions of the menu text
China. in every language option.
Antoine Authier the head of our laboratory here at Elektor took a The second chip carries the inscription SKY77518-21 identifying it
closer look at the phone. Armed with a plastic tool designed to open as a dual-band GSM front end module from Skyworks Solutions [3].
iPods he quickly separated the two halves of the case. The PCB is The third chip (inscribed 7880 1.3G FC GO914) is probably some
retained by clips in the lower half of the case (screws would be way variant of the old 7880 GSM baseband processor marketed by Infi-
too expensive!). neon. As always we value your feedback, if you have more informa-
tion on this device dont hesitate to get in touch!
A short length of adhesive tape holds the display to the PCB, this is
quickly removed as Antoine wields a hot-air gun. The 1.5mm thick [1] www.pearl.fr
display is connected via 14 pins to the PCB. We searched for any [2] www.eonssi.com
identification marks on this component but sadly were out of luck [3] www.skyworksinc.com
this time. (090502-I)
E-LABS INSIDE
9/2009 - elektor 43
Double-sided soldering in
reflow oven!
All a matter of accuracy but its childs play !
By Antoine Authier (Elektor Labs) While I was about it, I thought Id add an electronic serial number
Many readers are eager to find out just what our reflow oven is ca- function using a DS2401, along with ESD protection (yet another
pable of have often asked me if they could solder components on Maxim chip). These devices are all available in SMD packages ideal
both sides of their boards. My initial answer was certainly yes at for a double-sided board, and so meeting my criteria. Of the three
least in theory; so I started looking around for a project to demon- through-hole components, I kept only the RJ11 connector, partic-
strate in practice that double-sided soldering is possible. ularly to give me an excuse for mentioning the order for solder-
I settled on the USB-IC interface published in February 2009, as a ing through-hole components with respect to the surface-mount
PCB hadnt yet been designed for this project, and the prototype devices.
we had certainly wouldnt win any prizes for elegance. To my way Get together the component layout, component list, and the com-
of thinking, a dongle ought to be compact and have a neat appear- ponents themselves.
ance; it contains a handful of passive components and a few ICs. You need to solder the underneath SMD components first. Start
E-LABS INSIDE
44 elektor - 9/2009
by applying soldering paste to the solder pads, then a small drop of for the first soldering operation, so they are held on the board while
SMD adhesive between the pads, preferably in the centre of the lo- the second side is being soldered.
cation for the component being soldered. When heated, the epoxy- To decide which side to glue, as I see it there are three main criteria.
based SMD adhesive polymerizes and holds the component its The first one is strategic: glue preferably passive components, to
like magic! Now place the components in their positions and solder avoid as far as possible soldering the more valuable ICs twice.
in the oven using your favourite/usual reflow program. Tip: before The second criterion is a practical one: you should glue as few large
starting the soldering process, check one last time that the compo- components as possible, since in the event of a mistake, the smaller
nents havent shifted while being moved to the oven. components are the easiest to unglue.
The last criterion is an economic one: its better to use the adhesive
on the side with fewest components.
The soldering method is simple Its also important to take these considerations into account when
designing the board, so as to distribute the components sensibly
between the two sides.
Leave to cool down, and get ready for the next step: apply the sol- So we can deduce that on the glued side, there should be as few
dering paste, this time to the top pads, then place the SMD com- components as possible, and preferably all passive ones.
ponents. Here, theres no need for adhesive. Solder in the oven us- One last small detail: to unglue a component, all you have to do is
ing your favourite program. The underneath components wont fall hold it firmly using tweezers, heat it up (preferably with a hot-air
off, as they are glued. gun) and push it gently away from its position in order to break the
Once the board has cooled down, all thats left to do is solder the blob of adhesive.
through-hole components using a conventional soldering iron.
The notions of underneath and top are arbitrary you can of Now lets get cooking!
course start by soldering the top components and finish with the
underneath ones; the important thing is to glue the components (090570-I)
9/2009 - elektor 45
Ill take it
Its not every day that our lab engineers Luc and Chris have an op- Why do you want it?
portunity to work with an oscilloscope that costs around 12,000. Look at the specs: thats why.
Thanks to the generosity of the scope manufacturer, Yokagawa, we Frequency bandwidth: 500 MHz
had a DLM2054 available on loan in the lab for a few months. The Analog input channels: 4
only question was: who would get to use it? A/D resolution: 8 bit (25 LSB/div)
Real time sampling mode : interleave off : 1.25 GS/s
Luc: A scope is indispensable in the lab; we use them every day for interleave on: 2.5 GS/s
all sorts of measurements. The DLM2054 is remarkably easy to use. Maximum record length: Repeat / Single / Single Interleave
The menu is intuitive, which is just right for me. 12.5 M / 62.5 M / 125 Mpoints
Maximum sampling rate: 1.25 GS/s
Chris: The amount of memory in the scope is important. This in-
strument comes standard with 1.8GB of memory, so it can hold a Trigger modes: Auto, Auto level, Normal, single,
lot of signal history. N-single
Trigger types (excerpt): Edge, State, Pulse width, State width,
Luc: And it has a sampling rate of 2.5gigasamples per second, with I2C, SPI, UART, CAN
a bandwidth of 500MHz and four channels. Display: 8.4 inch TFT LCD
Chris: Of course, you have to consider what you want to use it for. Built-in printer
With I2C circuits, the special trigger modes are a real help. USB peripheral connection terminal
USB PC connection terminal
Chris: And it has a built-in printer, which is handy when you need Ethernet
to check something quickly. External dimensions: 226 (W) x 293 (H) x 193 (D) mm
Luc: If you can put down the 12,000 euros, I can certainly use the Weight: approx. 4.2 kg
scope. (090572)
Chris: Maybe we should just say that we need more time to try it Website of the DLM2000 series (starting price around 3,300 Euros)
out. But Im the one who wants it! from Yokogawa: www.dlm2000.net
E-LABS INSIDE
Chris Vossen studied Electronics at Heerlen Polytechnic and afterwards worked Luc Lemmens studied Electrical Engineering at Eindhoven Technical University and
in a small company for a number of years where he designed data logging equip- has been a fixture here at Elektor. for the last 19 years where he works as a develop-
ment. He has worked as a designer here at the Elektor lab since 2005. He spe- ment engineer and technical editor. Lucs expertise is in measurement techniques
cialises in larger microcontroller projects for example the recent R32C and the and microcontroller circuits. He is also responsible for selecting smaller projects
ATM18 project series. and for example the choice of designs for our special Summer Circuits edition.
46 elektor - 9/2009
9/2009 - elektor 47
projects instrumentation
Battery Monitor
Everything under control
Steffen Graf (Germany)
This circuit was originally designed for monitoring the charge There are various ways of providing
rechargeable battery packs with an
status of the batteries in a solar-powered water feature. indication of their charge status. The
most widespread uses a simple volt-
However, it can be used in any application where batteries age measurement; however, NiMH and
NiCd cells have a rather flat voltage
are charged and discharged. The circuit uses an LPC2103 discharge curve and so the method is
microcontroller connected to a 22-bit analogue-to-digital not particularly accurate in this case. A
better approach is also to measure the
(A/D) converter to measure charge and discharge currents, current into or out of the battery. This
allows calculation of the flows of power
battery voltage, charge status (or available capacity) and the and charge, and hence (if the initial
state is known) also the available bat-
instantaneous power being supplied to or drawn from the battery. tery capacity. The module described
48 elektor - 9/2009
here offers all these features and can Summer Circuits (July/August) 2008 These devices require minimal exter-
be used to monitor batteries or more issue of Elektor. This remarkable IC nal circuitry. The input side of IC6 (the
generally to meter voltages, currents (see text box) is a 22-bit delta-sigma MCP3550) is simply connected across
and power in any DC supply system. converter with differential inputs and the shunt resistor to measure the bat-
The author uses the module to monitor an SPI port, available in a reasonably tery current: the shunt is connected
a small solar-powered installation. easy-to-solder SMD package. directly between the input and output
terminals on the printed circuit board.
The unit can work over a wide volt- An important aspect of this project is The board is inserted in the line to the
age range, from 6V to 42V, and so the generation of the various supply battery using these terminals, and
can be used in typical lead-acid bat- voltages. The circuit requires 5V for hence can monitor current flows into
tery applications at 6V, 12V, 24V or the LCD, 3.3V for the A/D converter and out of the battery. Terminal K1 also
36V. The current range is also very and for the microcontroller, 1.8V for provides the power supply for the cir-
wide; despite this, resolution is high, the microcontroller core and 1.2V as cuit via 5V switching regulator IC1,
with measurements accurate to around a reference for the A/D converter. All and, via the voltage divider formed
1mA. A 50m SMD shunt resistor, these voltages must be generated by R3, P1 and R8, provides the volt-
rated at 2W, makes for a compact con-
struction and allows currents of up to
6A to be measured.
Features
Display of current (in mA or A), voltage (mV), capacity (Ah)
and power (mW or W)
Suitable for monitoring all types of rechargeable battery
Suitable for battery voltages from 6V to 42V
Maximum measured current: 6A
High precision: voltage resolution 76mV, current resolution 12A (internal),
1mA (displayed)
Low power consumption due to use of high-efficiency step-down converters:
<200mW (backlight off), <300mW (backlight on)
Module takes into account its own power consumption
in calculating current and capacity
Display update rate 1Hz
Over- and under-voltage fault LED
Backlit 2-by-16-character LCD
Compact construction
Serial interface for outputting measured values
Firmware available for free download from Elektor website
Overview
The microcontroller used is the
LPC2103, a 32-bit ARM7-based RISC efficiently from a highly variable input age measurement input. The divider
device from NXP. It differs in only minor supply (between 6V and 42V). That reduces the voltage to a level suitable
details from the LPC2106 device used demands a switching converter to pro- for input to the A/D converter built in
in the ARMee development board vide a 5V regulated supply directly to the LPC2013, which can only accept
described in the April 2005 issue of from the input. A second switching voltages from 0V to 3.3V. The poten-
Elektor and in the article Automatic converter drops the 5V supply to 3.3V, tial divider can be set up in two differ-
Running-in Bench published in April and the remaining voltages (1.8V and ent ways:
2009. Both are based on the 32-bit 1.2V) are generated from the 3.3V
ARM7TDMI core, which we described supply using linear regulators. Even 1. use 0.1% tolerance components
in an article in the March 2005 issue. at high input voltages the power dis- for R3 and R8, in which case P1
The LPC2103s internal A/D converter sipation of the circuit is low, removing can be dispensed with;
has a resolution of only 10bits: this is the need for a bulky heatsink.
enough for our voltage measurement, 2. use normal (1%) resistors and then
but not enough for the current meas- calibrate the measured voltage by
urements we want to make. Further-
Circuit and construction adjusting P1. R8 is then omitted.
more, since we want to be able to The complete circuit is shown in Fig-
measure current flow in either direction ure1. Out of the total of six ICs, four If the input voltage is over 40V then
(charge and discharge) we need an A/ are voltage regulators. The switching adjustment of P1 will be necessary in
D converter with a differential input. regulators (IC1 and IC2) can be iden- any case for best accuracy; and if the
We therefore use the internal A/D con- tified by the inductors connected to input voltage is over 42V adjustments
verter only for voltage measurement, them, while the linear regulators (IC3 to the software are also needed.
and employ an external converter for and IC4) just have decoupling and
current measurement. We selected the smoothing capacitors. The meter cir- Jumper JP2 allows the units 5V sup-
Microchip MCP3550-50, which was cuit itself comprises just the LPC2103 ply to be taken from the programming
briefly described on page 87 of the (IC5) and the A/D converter (IC6). interface. This allows the microcontrol-
9/2009 - elektor 49
projects instrumentation
LED+
LED-
VDD
VSS
R/W
330H
VO
RS
D7
D6
D5
D4
D3
D2
D1
D0
D1 C2
E
100 GND GND
63V 3A 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
3 6 330 C14 C15 C16 +5V
100V
25V
+1V8 100n 100n 100n
LCD_D7
LCD_D6
LCD_D5
LCD_D4
LCD_RS
LCD_E
P2
R2
10k
5 40 17 42 10k
+5V +3V3 T1
VDD(1V8) VDD(3V3) VDD(3V3) VDDA +3V3
CORE I/O I/O
L2 6 4 +5V
1 9 RST VBAT
VIN L
6 IC2 4 22H C13 R9 2N7002 R6
ILIM PG 26 20 C17
8 5 RTCK IC5 RTXC1
*
10k
EN FB 27 25
100n DBGSEL RTXC2
C3 TPS62007 C4 100n
DGS OPTIONAL B
8 18
7 2 P0.27/TRST/CAP2.0 P0.2/SCL0/CAP0.0
100 SYNC FC 10 +6V...+42V 9 21
16V P0.28/TMS/CAP2.1 P0.3/SDA0/MAT0.0 S1
GND PGND C5 10
P0.29/TCK/CAP2.2
3 10 R3 15 48 LCD_D7
P0.30/TDI/MAT3.3 P0.18/CAP1.3/SDA1 OPTIONAL C
100n 16 47 LCD_D6
100k
P0.31/TDO P0.17/CAP1.2/SCL1
P0.16/EINT0/MAT0.2
46 LCD_D5 * siehe Text
32 45 LCD_D4
P0.22/AD0.0 P0.15/RI1/EINT2 +5VUSB +3V3 +1V8
33 41 LCD_RS
P1 R8 P0.23/AD0.1 P0.13/DTR1/MAT1.1
34 39 LCD_E +3V3 IC3
* P0.24/AD0.2 P0.26/AD0.7 1 5
8k25
+6V...+42V 38 IN OUT
P0.25/AD0.6
30 R5 TPS79118
10k P0.9/RXD1/MAT2.2 DBVR
K2 35 29 3 4
K3
10k
P0.10/RTS1/CAP1.0/AD0.3 P0.8/TXD1/MAT2.1 EN BYPASS
1 36
P0.11/CTS1/CAP1.1/AD0.4 C6 C7 C8
37 13 GND
+1V2 +3V3 P0.12/DSR1/MAT1.0/AD0.5 P0.0/TXD0
2 14 100n 2 10n 1
LPC2103 P0.1/RXD0
FBD48
LOAD/ 22 44
P0.4/SCK0/CAP0.1 P0.14/DCD1/SCK1/EINT1
SUPPLY R7 23 1
P0.5/MISO0/MAT0.1 P0.19/MAT1.2/MISO1
24 2
10k
1 8 P0.6/MOSI0/CAP0.2 P0.20/MAT1.3/MOSI1
SERIAL TTL
28 3
VREF VDD P0.7/SSEL0/MAT2.0 P0.21/MAT3.0/SSEL1 IC4
R4 MAX6520EUR-T
2
IC6 5 VSS VSS X1 X2 VSSA VSS
K1
R1 VIN+ SCK +3V3 +1V2
1k
7 19 11 12 31 43
50m
6 X1
1 SDO/RDY
JP1
D2
3 7
2W VIN CS C9 C10
2 MCP3550 C11 C12
50E/SN ERROR 100n 100n
VSS 22p 22p BOOTLOADER
BATTERY 4
X1 = 14.7456MHz 080824 - 11
Figure1. Circuit diagram of the battery monitor. Out of the total of six ICs, four are voltage regulators.
The meter circuit proper consists of a 32-bit ARM7 microcontroller (IC5) and a 22-bit A/D converter (IC6).
ler to be programmed without a battery a routine in software that causes a comes to the LPC2103 in its LQFP48
being connected. If a battery is con- PWM signal to appear on pin P0.9. This package. Despite the 0.5mm lead
nected while power is being supplied in turn drives MOSFET T1 to provide pitch, it is lining the device up with
over the programming interface, IC1 a dimmable backlight. If the ability to the pads on the board that is the tricky
will only draw a few milliamps from turn the backlight off is not needed, part of assembly, not the soldering
it: the rest of the circuit will still take R10 can be replaced by a 220 resis- itself. The easiest way to solder the
its power from the programming inter- tor (instead of 0) and the MOSFET device is to melt solder over all of the
face. Dont forget to change the jumper replaced by a wire link joining source leads on one side at a time (not wor-
back to battery power after program- and drain. R9, as well as R6 and S1, rying about short circuits) and then
ming the microcontroller. Alternatively, can be dispensed with. If the backlight remove excess solder using braid. It
if the ability to power the unit over the is not required, all the related compo- is helpful to use a little flux. It is best
programming interface is not needed, nents (S1, R6, R9, R10 and T1) can be to mount the microcontroller first so
JP1 can be replaced by a wire link join- dispensed with. that the other components do not get
ing +5VBATT and +5V. in the way of the action. Then solder
In order to make the module no larger all the other ICs and finally the other
The LCD panel used has a backlight. than the LCD, the printed circuit board SMD components. Finally mount the
In the interests of reducing power con- (Figure2) is almost entirely populated leaded components. Figure3 shows
sumption the light can be turned on with SMD components. This demands our prototype board, which differs
and off. Button S1, connected to port a certain amount of deftness with the in minor details from the final layout
pin P0.2 on the microcontroller, controls soldering iron, especially when it shown in Figure2.
50 elektor - 9/2009
R4
D2 K2
JP1 L1
R5
C1
K3
R1 JP2
C6
R7 C7
6
IC
15
K1
C
C2
C
IC3
IC
16
5
C10 X1 C8 IC2 L2 D1
14
C3
C
R3 IC4 R9
C9
12
R8 R2
C
C5 C4
11
P2 S1
C
P1 C13 T1
IC1 C17
R10
K4 R6
L+
Figure2. The printed circuit board is mostly populated with SMD components and is the same size as the LCD panel.
Software 0 is configured so that its counter is data bits can be read out. There is a
incremented every millisecond. The total of three eight-bit data blocks,
The ARM core used in the LPC2103 infinite loops tests to see whether which are logically ORed into the
offers plenty of processing power to the counter has reached 1000 (as appropriate positions in a variable.
extend the capabilities of the unit. 1000*1ms=1s). The twenty-second bit gives the
The firmware is written in C and polarity of the voltage measured at
source code is available for free down- The calculation routine first reads a the devices input: if the bit is a 1 the
load from the Elektor web pages for value from the A/D converter to obtain value is negative and the collected
the project [1]. The program is easy a current reading. This is relatively value must be suitably modified: the
to understand and modify. Only the straightforward as there is no need twos complement is taken by calcu-
start-up code has to be in assembler to send any data to the MCP3550: it lating a bitwise (ones) complement
(for which thanks to Alexander Graf, is simply a matter of taking its chip (ad_current=~ad_current;) and then
who wrote that code). The free GCC C select signal /CS low. It is then nec- incrementing by one. Since we only
compiler is used. essary to wait while the conversion want the least significant 22 bits of
takes place. The MCP3550 signals that the result we mask off the remain-
The microcontroller runs in an infinite the conversion is complete by taking der using a logical AND operation:
loop, and once per second calls a func- the data output line low. We need to ad_current&=0x3fffff;.
tion which performs the measurement switch the port to the correct mode in
process and displays the results. To order to detect this event. Now we can compute the actual cur-
obtain the one second period, Timer Once the conversion is complete the rent flowing. To avoid floating-point
9/2009 - elektor 51
projects instrumentation
52 elektor - 9/2009
Start-up
When programming has success-
fully completed, remove JP1 and
check that JP2 is correctly set (+5V
linked to +5VBATT). Connect a bat-
tery (rechargeable or not), or a bench
power supply with an output voltage
between 6V and 40V, to K1. If a volt-
age source was already connected to
terminals K1, it will be necessary to
remove it briefly to reset the circuit.
The LCD should now show a brief
message and then display the meas-
ured values. If nothing appears, check
the contrast setting (P2) again. If the
welcome message does not disappear
from the display, it is likely that there
is a fault in the connection to IC6.
If everything is working as expected
Figure3. Our populated prototype.
the LCD should show the current con-
sumption of the meter module and the
Internet Links
[1] http://www.elektor.com/080824
[2] http://www.elektor.com/080213
[3] http://www.flashmagictool.com/down-
load.html Figure5. The LCD panel in normal operation.
9/2009 - elektor 53
projects microcontrollers
ATM18
Mini Chess Computer
Elektor AVR board rubs shoulders
with kings, queens, bishops...
By Wolfgang Rudolph with Andre Adrian (Germany)
The Elektor ATM18 system can be used to make a surprisingly simple and effective chess computer. The
only additional hardware required is a few low-cost pushbuttons. The software for the project is written
in C, and it was far from an easy task to fit the program in the 8kB of program memory offered by the
ATmega88.
Chess holds a special position in the place in 1851 in London, and the first From the mechanical Turk
world of board games. Its origins can chess world championship was fought
be traced back to a game called Chat- in 1886 between Wilhelm Steinitz and
to the chess computer
uranga, played in India. The game Johannes Zuckertort. As early as 1769 the Hungarian court
spread to Arab lands via Persia, and Playing perfect chess is well beyond the official and skilled mechanical engi-
was then brought to Spain and the capability of even the fastest computers. neer Wolfgang von Kempelen demon-
rest of Europe by the Moors. By the fif- Even the number of distinct positions strated a chess-playing automaton, to
teenth century the game was enjoying is not known exactly, although it has the astonishment of his contemporar-
widespread popularity in Europe. The been estimated at around 2.281046, ies. Unfortunately it was an elaborate
name chess is thought to derive from and the number of possible games last- hoax: the robot sitting at the chess
the Persian word shah, which can be ing 40 moves by each player is approxi- table, dressed as a Turk (Figure1),
translated approximately as king. mately 10120. For comparison, scientists was operated via a complex system
Following a major revision of the rules, estimate the number of atoms in the bil- of levers and linkages to make moves
the first chess tournaments began. lions of galaxies in the universe at only on the board, all under the control of
The earliest such tournament took around 1078. a man hidden inside the table. It was
54 elektor - 9/2009
not until long after Kempelens death Chess on the ATM18
that the secret of his mechanical Turk
became generally known. The chess program Micro-Max[6] was
The first chess machine actually capa- written by Harm-Geert Mller[7]. As
ble of calculating and executing moves Mller himself writes, it was his goal
was a mechanical device constructed at to write the shortest chess program
the beginning of the twentieth century in the world in the C programming
by a Spanish engineer named Leonardo language. His target was 1024 bytes,
Torres y Quevedo, who had also devel- but even omitting the castling and en
oped a transatlantic airship and a cable passant rules the smallest he could
car over the Niagara falls. In 1912 his achieve was 1200 characters. He there-
El Ajedrecista automaton was capable fore increased his target source code
of winning the endgame of white king size to 2kB and included almost all
and rook versus black king. The algor- of the official FIDE (Fdration Inter-
ithm the machine used was not opti- Figure1. The celebrated mechanical Turk hoax chess nationale des checs, or World Chess
mal, and could take up to 63 moves to automaton of 1769. Federation) rules of chess. Validation
deliver checkmate to the black king. of user input is also included. Initially
An improved version was constructed the only missing feature was under-
in 1922 under Leonardos direction by promotion (promoting a pawn to a
his son Gonzalo. It was first demon- piece other than a queen on reaching
strated at the Paris Cybernetic Con- the eighth rank), which he felt unnec-
gress in 1951. This chess computer is essary; however, the feature was sub-
of a purely electromechanical design sequently built in to a later version of
and is still in working order. It can be the program.
seen in the Torres Quevedo museum at The program consists of fewer than 150
the Polytechnic University of Madrid. lines of C source code totalling under
Konrad Zuse[1], a pioneer of the 2000 ASCII characters. Andre Adrian
modern computer, joked to his friends has ported Micro-Max version 4.8 to an
in 1938 that within fifty years a com- Atmel AVR 8-bit microcontroller using
puter would be able to beat the world the WinAVR GCC compiler. The result
champion at chess. It was a bold pre- is a compact chess computer whose
diction at the time, but in retrospect LED display and operation are reminis-
surprisingly prescient. He wrote his cent of the celebrated Mephisto dedi-
first chess program in the language cated chess computer. This AVR-Max
Plankalkl (plan calculus)[2], which project will be described in a future
he had developed between 1941 and issue of Elektor. From this project sprang
1945. The language was not, how- the idea of adapting AVR-Max to run on
ever, supported by the computers of the Elektor ATM18 system. The project
the time; it was not until 2000 that the looked rather tricky at first. The LED
first Plankalkl compiler was written. Figure2. Konrad Zuse, shown here with a replica of his Z1 version uses a timer interrupt routine to
Chess programs suddenly gained enor- computer, was a pioneer of modern computing and even wrote drive the display and scan the keyboard,
mous popularity with the advent of the a chess program. (Photograph courtesy of Prof. Horst Zuse) which does not fit well with the two-
first microprocessors and the introduc- wire LCD interface used on the ATM18.
tion of home computers. The first was Despite a number of early problems,
Microchess, by Peter Jen- eventually all the bugs
nings, written for the MOS were tracked down and
Technology 6502 processor. ironed out. The software
Even more successful was was modified to display
Sargon by Dan and Kathe additional text on the two-
Spracklen. Sargon origi- wire LCD module. This
nally ran on Z80-based sys- makes the ATM18 version
tems and was later ported of the mini chess computer
to the AppleII. The Apple rather more communicative
version sported 1-bit digital with its adversary than its
speech synthesis using the AVR-Max cousin can man-
built-in loudspeaker. Since age with its four-digit
then, hundreds of chess seven-segment display. As
programs, ranging from the usual the software is avail-
excellent to the awful, have able for free download from
been released. the Elektor web site[8].
More information about the The keyboard scanning
history of chess program- code present in the LED
ming and chess comput- Figure3. Sketch by Konrad Zuse dating from 1941, thought to show the memory requirement calculation version of the software has
ers can be found at[3], [4] for an internal board representation (64squares x 4bits per square = 256bits total). (Source: Konrad been completely carried
and[5]. Zuse internet archive at http://www.zib.de/zuse/English_Version/index.html) over to the ATM18 version,
9/2009 - elektor 55
projects microcontrollers
PC0
PC1
PC2
PC3
be described in the section below on
operation.
S1 S2 S3 S4
The keyboard is wired as a matrix. It
A1 B2 C3 D4
is driven using open-collector outputs
S5 S6 S7 S8
on the microcontroller, which means
E5 F6 G7 H8
that if more than one button is pressed
S9 S10 S11 simultaneously the outputs of the pro-
FN CL GO cessor will not be damaged by the
080947 - 11
short-circuit.
It is advisable to use very flexible
cable for the seven-wire connection
Figure4. Wiring diagram for the CC2 mini chess computer.
between the ATM18 test board and
The two-wire display and 11 pushbuttons are connected to the ATM18 test board.
the keyboard, and it is a good idea to
mount the three printed circuit boards
and so the only addition necessary to function buttons. Seven wires suffice (test board, keyboard and LCD) on a
the hardware is to connect a matrix of to connect the buttons to the ATM18 baseboard or similar fixing to ensure
pushbuttons to the ATM18 board. board, using a total of just seven port that the connecting cables do not suf-
pins. The circuit diagram of the key- fer undue strain.
board is shown in Figure4. It should
Keyboard input be clear from the figure how the but-
The rather grandly-titled keyboard tons can be arranged on a piece of
The AVR-Micro-Max chess program
consists of a total of eleven pushbut- perforated prototyping board and The program uses the negamax
tons, eight (labelled A1 to H8) which wired up. In the figure the eight but- search algorithm to calculate its next
are used to enter moves, and three tons used to enter moves are shown move. It is implemented in Micro-Max
as a recursive function. The negamax
function calls itself until a termination
condition (such as its reaching a max-
About the program imum allowed search depth) is satis-
Andre Adrians program includes a number of elegant programming examples including func- fied. Recursive functions require stack-
tions such as scanning a keyboard with debounce and auto-repeat, power-saving and inter- based storage for local variables and
rupt routines, and the implementation of the principal variation display. Interested readers for saving values in the CPUs regis-
with a passing knowledge of C can learn from the thoroughly-commented source code. This is ters. However, it is always possible to
available for free download, along with all the other program files for the project, from www. rewrite a recursive function in iterative
elektor.com/080947.
form: instead of having the function call
itself, we use a loop around the func-
tion. There is then no longer any need
The Elo rating system to preserve the CPUs registers. For
simple functions, such as calculating
The Elo system is a way of grading the strength of chess players on a numerical scale. It factorials or elements of the Fibonacci
was proposed by Arpad Elo and adopted by the United States Chess Federation in 1960. In
sequence, the conversion to iterative
1970 it was also adopted by FIDE and became an internationally accepted standard. It was
renamed the FIDE rating system, although the term Elo rating is still in common use. Other
form is trivial. The negamax algorithm
national rating systems are also used alongside the FIDE system. can also be modified in this way, and
Andre Adrian has implemented such
A beginner will typically have an Elo rating of below 1000. Amateur players ratings normally
a version. His implementation requires
lie between 1200 and 2000, while experts and would-be masters have ratings of between
2000 and 2200. Masters will have ratings of from 2200 to 2500; beyond that lie the grand-
just 34 bytes of storage per half-move
master and so-called super-grandmaster (above 2700) ranks. (a move by one player, also called a
ply). Storing the chessboard in 0x88
There are also Elo ratings lists for chess computers: well-known examples include the SSDF
format requires 129bytes of RAM. With
list (http://ssdf.bosjo.net) and the Wiki Elo list (http://www.schach-computer.info/wiki/index.
1kB of RAM available, we can there-
php/Wiki-Elo-Liste_En).
fore search to a maximum depth of
56 elektor - 9/2009
20 half-moves. The iterative version Your move: D2D4 3. Press C3 to enable or disable dis-
requires no more ROM space than the Enter coordinates or GO to continue play of the principal variation (PV).
recursive version: stack accesses, rela-
tive to the stack frame pointer, take a If your move was legal, the computer When PV display is enabled the com-
similar amount of code on the ATmega will now calculate its move. If this will puter will show the move that is cur-
microcontroller to the array accesses take some time, a please wait mes- rently best in its opinion. Every time
that replace them. sage appears. The computers move the depth-first search returns to the
The AVR-Micro-Max program can also will then appear on the display along root of the game tree the computer
be run in the AVR Studio simulator (the with an invitation for you to enter updates its idea of the best move
free version is adequate for found so far. It then checks
this purpose). If you feel so to see if it has used all of
inclined you can modify the the time allotted to its
program to suit your own move. If it has, it plays
preferences and test the this as its next move; if
results immediately in the there is still time left, it
simulator. The GCC com- increases its search depth
piler is of course available by one half-move and
free of charge and free of repeats the search. This
arbitrary limitations. process is called iterative
Our aim was that the deepening.
program should play at
a strength of between
Elo1200 and Elo1399 (see
Check and mate
text box) under tournament You should find it quite a
time controls (120minutes challenge to beat the com-
for the first 40moves). This puter on its higher levels.
corresponds to amateur A tip: you can play the first
classD, an average hobby few moves at a lower level
Figure5. When power is applied the computer invites you to enter your first move.
player. The program has and then increase the level
nine levels of play. Level1 when the opening is over.
is a blitz mode, taking The computer does not
about 7seconds per move; level5 is your reply. If your move was not valid, have an openings book. It is poss-
suitable for quick games at around a suitable message appears on the ible to force the computer into a given
30seconds per move, and level8 is display. opening by entering whites and
designed for tournaments, taking If one of the players is checkmated, the blacks moves manually, pressing the
3minutes per move. On power-up the message Checkmate! appears on the GO button just once after each move.
computer defaults to level3. display. One popular opening begins 1.e2e4
Keen (coffeehouse) amateurs typically The CL button is used to correct entry e7e5 2.g1f3 b8c6 (1.P-K4 P-K4 2.N-
play at strengths of between Elo1400 errors before GO is pressed. KB3 N-QB3).
and Elo1700, and it is rare for non-club On power-up the computer takes the
players to have ratings above Elo1800. black pieces; if GO is pressed at this If the ATM18 system is to be used
Although our chess computer is not point, the computer will take the white permanently as a chess computer it is
capable of playing at such elevated pieces and play the first move. a good idea to fit it in an enclosure,
levels, it can still play a challenging The GO button has a further use. If the details of which we will leave to
game. it is pressed without entering a move, the imagination of our readers. Good
the computer will calculate a move luck!
for you. This can be used to exchange
Operation sides during a game: if you are on
(080947)
When the software has been flashed the point of losing to the computer,
into the microcontroller module and simply press GO without entering a
the keyboard, display and power sup- move and the computer will take your
ply have been connected, everything side for the rest of the game. If you [1] www.zuse.de/Konrad_Zuse/index.html
is ready to go. It is easiest to play repeatedly press GO without enter-
[2] www.zib.de/zuse/
with a real chessboard to hand on ing moves the computer will play itself
English_Version/index.html
which to make the moves as the game with you as a spectator.
progresses. [3] www.andreadrian.de/schach (in German)
When power is applied the text shown Pressing the FN button leads to a [4] www.computerhistory.org/chess/
in Figure5 will appear on the display. menu with three options. [5] www.geocities.com/SiliconValley/
You can now enter a move, such as Lab/7378/comphis.htm
d2d4 (P-Q4), by pressing the following 1. Pressing A1 starts a new game.
[6] http://home.hccnet.nl/h.g.muller/
sequence of buttons:
max-src2.html
2. Pressing B2 followed by another
D4, B2, D4, D4 button selects a new level: press A1 [7] http://chessprogramming.wikispaces.
to H8 for levels1 to8 and FN for com/Harm-Geert+M%C3%BCller
The LCD now shows: level9. [8] www.elektor.com/080947
9/2009 - elektor 57
projects embedded c programming
In this third and final article of the short Embedded C course, based on the MSP430
experimenters board, we get to grips with some of the components on the board that
havent been used so far, such as the 7-segment display and the piezo buzzer.
Amongst other things, the MSP430 board contains a 7- except that a few milliseconds delay occurred.
segment display, a 4094 shift register used to drive this Imagine that weve configured a port pin to initiate an inter-
display, a piezo buzzer, a watch crystal with a frequency rupt when its input is a certain state. This means that the
of 32,768Hz (connected to the internal TimerA of the program will be interrupted (for example during statement
MSP430) and connectors for adding extra hardware, such x) when the interrupt hardware detects the pre-programmed
as an I2C interface or an analogue input signal for the 16- state on this pin. The interrupt service routine will then be
bit A/D-converter. Well be using these parts in this final called after which the processing will resume where it left
instalment of the course. Well also take a look at the soft- off in the main program.
ware, and investigate the uses of polling and interrupts. There are several ways in which the hardware can gener-
ate an interrupt:
Polling and interrupts -by a change of state on a port pin;
We begin with polling and interrupts. Below is an example -by the watchdog timer;
C program that uses polling. -when the counter of TimerA is full;
- when the compare register of TimerA is equal to the value
void main(void) stored in CCR0;
{ -by setting a flag in software, for example to be able to
while(1) react immediately to a fault condition.
{
..;
if (!(P1IN & BIT5)) a=1; When an ISR is active and a flag is set at that instant for
// push-button S1, active low another ISR, then the first ISR is completed before the new
delay(65000); ISR is dealt with. This interrupt is therefore not lost but just
set_7segment(3,1) delayed in its execution. For this reason it is important to
..; keep ISR routines as short as possible, since they are often
} // endless loop time-critical and this way several different ISRs can be exe-
} cuted one after another. When more than one interrupt flag
is active, the ISRs are dealt with in order of priority (which
When we flash this program on the board and run it in step- is fixed in the hardware). For example, a CCR0 interrupt
mode, then pressing S1 will only set a to 1 if the proces- takes precedence over a port pin interrupt.
sor happens to execute the IF instruction at that time. If the
delay() function was called during the brief time that the For port pins that have push buttons connected to them
push button was pressed then a wont be set to 1. In this there are two possibilities (see Figure2). The push buttons
case we have to keep the button pressed until the IF instruc- (S1, S2 en S3) on the MSP430 board are connected via
tion is executed. In time-critical processes such as time keep- pull-up resistors to the positive supply rail (Vcc) and go to
ing or an alarm function this could cause a lot of problems. P1.5, P1.6 and P1.7. In the non-active state of push button
This method of determining the status of push button S1 is S2 the signal at P1.6 is high and this becomes low when S2
called polling; the status of S1 is determined every time is pressed (falling edge). We can configure the registers for
the IF instruction is executed. the port interrupts such that an interrupt is automatically
Inside the processor chip is some special hardware that generated when a falling edge is detected. Each port pin
can interrupt the workings of the processor. This hardware has its own setting for interrupts, which can be configured
makes the processor stop after it finishes the instruction it via the P1IE-register (enable interrupts for this port pin);
is currently processing, then remembers where it is (e.g. it P1IES is the interrupt selection register that is used to choose
stores the value of the program counter on the stack) and between a rising or falling edge. Each port pin interrupt
then calls a special Interrupt Service Routine (ISR), see also has its own interrupt flag (P1IFG); in other words, when
Figure1. Once the ISR has finished the processor jumps this is at 1 it means that its interrupt is in progress, unless
back to the exact point in the main program where it was another interrupt is active. As an example, a few register
interrupted. The main program then carries on as normal, values are shown in Figure3.
58 elektor - 9/2009
Embedded C
your reaction speed
9/2009 - elektor 59
projects embedded c programming
60 elektor - 9/2009
out how many seconds the crystal is out by per day (and data for driving the segments in a serial manner instead
then possibly use that information to make a correction to of parallel, which requires extra code and processor time.
the program). Again we see how the hardware and software influence
At this stage Im happy to give some general advice to each other: adding a bit more software means that we can
enthusiasts and students who design their own hardware reduce the amount of hardware required!
and software: when creating new software for new hard- The display (LTS4301E) is a common cathode (CC) type,
ware it is important to only add new functionality to your which means there is a common ground for all the LEDs in
code when you can base it on code that is known to work the display. We drive these LEDs via current limiting resis-
properly. It is a pity when you end up programming for tors with a value of 150. The current through the LED is
days, but you cant progress because of various mistakes then about
in the code and you dont know what exactly is happening
and what is going wrong. For example, you could start by (Vcc VLED) / 150 = (3.3 1.9) / 150 10mA.
checking that the crystal on the board with its thin connect-
ing wires functions properly (crystals are sensitive to shock The 4094 8-bit shift register has a data input, a clock input
and sudden impact, such as being dropped onto the floor). and a strobe input (see Figure6). After eight clock pulses
You should therefore first load the TimerInterruptDemo.c file the 8-bit data will have been shifted completely into the
in order to test the hardware! chip and can then be saved in the storage register using
the strobe signal. The level at the data input is read dur-
ing the rising edge of the clock signal, as can be seen in
7-segment display the waveforms in Figure6. Pin 15 of the IC is connected
Before we look at the program Game2Elektor_080558.c, to the supply voltage, which means that the output buffer
which tests our reaction speed, we first look in detail at the is always activated and can source current to the LED seg-
hardware and software for the 7-segment display. ments. Output QP7 (pin11) drives the LED for the decimal
In Figure5 you can see the part of the circuit diagram of point (dp).
the MSP430 board that deals with the display. In this circuit Before we start developing our own code to drive the dis-
you can see that three lines go to the 74HC4094 and 7+1 play we have to test the hardware associated with the dis-
lines go to the display. This method was necessary because play. We do this by flashing and running the file demodis-
our MSP430 processor has only eight I/O lines and other play.c. Part of the code for this program is reproduced in
peripheral components also needed to be connected, such Figure7.
as push buttons and LEDs. This solution has consequences The outer FOR loop determines what number is sent seri-
for the software: we now have to send the eight bits of ally. This is the variable i, which has a value of 1, 2, 4, 8
Advertentie
ElektorWheelie
Characteristics
Two 500 W DC drive motors
Two 12 V lead-acid AGM batteries, 9 Ah
Two fourteen-inch wheels with pneumatic
tyres
Elektors DIY self-balancing vehicle H-bridge PWM motor control up to 25 A
Automatic power off on dismount
ember 2009 Maximum speed approx. 11 mph (18 km/h)
Order before 1 Sept Range approximately 5 miles (8 km)
UNT!
Everyone agrees; the internal combus- and get 85 DISCO Weight approximately 35 kg
tion engine is coming to the end of (s 100 / US $150)
The kit comprises two 500-watt DC drive
its life cycle. However you dont need
motors, two 12-V lead-acid AGM batteries,
to go to the expense of a Prius or Tesla to experience two 14-inch ABS wheels, casing, control lever
the future of transportation devices. If you would prefer and assembled and tested control board with
something more personal (and dont mind turning sensor board fitted on top.
a few heads) why not build the astonishing ElektorWheelie? Art.# 090248-71 1380 1599 US $2275*
First take two electric motors, two rechargeable batteries (reduced price till 1 September 2009: 1295 1499 US $2125)*
and two sensors, now add two micro- * Incl. VAT, excl. shipping costs.
controllers and the ElektorWheelie
is ready to transport you in style Elektor
to your destination. Regus Brentford
1000 Great West Road
Brentford TW8 9HH
United Kingdom
Actual product may Tel. +44 20 8261 4509
differ from illustration.
9/2009 - elektor 61
projects embedded c programming
P1OUT |= BIT4;
etc. (these values are referred to as BIT0, BIT1, etc.). Of the set_7segment(c,dp); // clear 7-segment display
8 bits only one will be high at a time. When all bits have
been shifted inside it follows that only one segment will light The timer starts counting from 0. The TAR register of
up. All segments will then light up one after another, includ- TimerA will then have a value of 0 and will count upwards.
ing the decimal point. The program hasnt gone further than the while(!ready);
Variable i is sent serially to the shift register. The MSB loop. This loop consists of just a single statement because
(Most Significant Bit) is sent first. The inner FOR loop starts there is a semi-colon after while(). As long as ready=0 this
with j=7, which becomes BIT7 due to the instruction BIT0 << statement will keep executing. At the instant when S3 is
j. This instruction makes the lowest bit shift 7 places to the pressed the port pin interrupt will be called, and inside
left, thereby becoming BIT7 (in reality BIT0 is multiplied by this ISR the variable ready is set to 1. The while() loop
27). Next the instruction (i & (BIT0 << j)) checks if this bit is is then terminated and the value of the counter is stored
high or low. For the first time round this loop this becomes: in the variable t. This value is therefore proportional to
if(1 & BIT7). This is not true so the data line to the shift reg- the amount of time passed since the beep sounded. An
ister is made low via the ELSE instruction (see the arrows extra divider (x1/2) is added after the 32,768Hz crystal
in Figure7). using the instruction TACTL |= ID0. This means it will now
take 4 seconds before the timer fills up. We can now cal-
In this way the inner loop sends all eight bits when i=1 to culate the conversion factor required to show the time in
the shift register and clocked in, as we momentarily make tenths of a second. Four seconds correspond to 65536,
the clock signal high and then low again. When all eight so 0.1s corresponds to a counter value of 65536/40 =
bits have been sent to the shift register the contents of this 1638. We called this constant reslow using the define state-
register can be copied to the storage register using the ment: #define reslow (1638). For people with a very fast
strobe signal. reaction time a 1 will appear on the display, which cor-
The outer loop makes each segment light up in turn. Run the responds to a reaction time of less than 0.2 seconds. We
file demodisplay to check that it works! have also added a higher resolution mode using the vari-
able reshigh (1/2 * 1638 = 819) where we can measure
in units of 0.05s.
Test your reactions
Well now take a closer look at the code in the file In this program we made use of the source code from the
Game2Elektor_080558.c. This program generates a ran- second instalment, but for easy reference we have combined
dom number, which is used to generate a beep a random all code within one file. In this instance we havent used a
time after S1 is pressed. This can happen as soon as 0.25s library file, which is often useful when we have a number
later or at most after 2s. Following the beep you should of well-documented functions already written. For clarity we
press S3 as quickly as possible. TimerA is connected to the have shown the three interrupts used in Figure8.
32kHz crystal and is reset at the time the beep is gener- What is noticeable is that we have to reset the interrupt flag
ated (TACTL |= TACLR;). The relevant code from the above ourselves in the software, except for the TimerA0 compare
file is shown here: interrupt (where the hardware automatically resets the flag
when the interrupt finishes).
TACTL |= TACLR; // TimerA clear(TAR=0), It is very useful to go through a program in step-mode and
// start measuring gain an understanding of all the instructions used, which
while(!ready); // wait for S3 makes it easier to think of your own interesting programs
t=TAR; // read contents of TimerA
c=t/reshigh; // resolution of 0.05 s
and then create them.
if(c>15) { c=-1;dp=1;}
else dp=0; As is often the case, you learn the most when you try things
P1OUT &=~BIT4; out yourself!
delay(65000); (090252-I)
#pragma vector=PORT1_VECTOR
__interrupt void buttonactive(void)
{
ready=1;
Figure8.
P1IE = 0; // turn off port interrupts
The three interrupts
P1IFG = 0; // reset interruptPort flag
used in the program }
Game2Elektor_080558.c.
62 elektor - 9/2009
ONLINE AUCTION SALE
by order of the liquidator due to BANKRUPTCY of
www.TroostwijkAuctions.com
Order now:
New processor board, increased software 3D controller-board
(assembled and tested)
capabilities and mechanical upgrades 339.00 / US $494.00 / e 380.00
incl. ColiDrive en ColiLiner update
Upgrade your Proler to a PRO milling
New Z-axis with oating head
machine with: (assembled)
New 3D controller 404.00 / US $590.00 / e 454.00
Requested by many and now Professional grade engraving head
available! 263.00 / US $384.00 / e 295.00
ColiDrive Prices include VAT,
The control software has been exclude postage and packing.
expanded with quite a few new
options. Elektor
New Z-axis with oating head Regus Brentford
1000 Great West Road
More stable and easier to mount and calibrate.
Brentford TW8 9HH
Professional engraving head United Kingdom
With this head the milling depth Tel. +44 20 8261 4509
can be set very accurately!
9/2009 - elektor 63
projects elektorwheelie
ElektorWheelie
Construction and driving
In the first instalment about the self-balancing single-axle electric vehicle in the Summer
Circuits issue we explained the operation of the electronics. There is, of course, also some
mechanical construction required before the ElektorWheelie is ready to be used.
The ElektorWheelie is delivered as a kit containing all the nec- brackets/bearing mounts and four bolts with matching
essary parts. The kit contains all electronic bits, the batteries, washers and nuts.
the steel housing, the wheels, the motors, the control lever and 3. The mounting brackets/bearing mounts are attached
an economy battery charger. The printed circuit board comes with the bolts to the middle of the base plate (between
completely assembled and ready mounted in the housing, just the motors). The housing already has the mounting holes
like the motors. In this article, with the help of a few photo- for these. Tighten the bolts firmly so that they cannot come
graphs, we describe what remains to be done by you. loose due to vibrations.
4. Now you need to attach the coupling between the control
lever and the potentiometer. Start by adjusting the poten-
DIY tinkering tiometer to roughly the centre position. Make sure there is
1. The main things you have to do yourself is mounting the sufficient free movement clockwise as well as anti-clock-
control lever and attaching the wheels. wise because the pot is used to determine the position of
2. We start with the control lever. For this you need the the control lever.
64 elektor - 9/2009
5. Now turn to the cabling. The wiring diagram shows base plate. This switch lets the electronics know that you have
the electrical connections effectively made. Note that some stepped onto the Wheelie. You can now test the Wheelie by
cables may be a bit short for the next step and should be leaning forwards or backwards a little and check whether the
connected afterwards. Wheelie moves with it. The foot switch is part of the safety
6. You can now slide the cover at an angle over the control for the Wheelie, a little more about that later.
lever and fasten it at the sides with four screws. After this you Now put your other foot on the ElektorWheelie platform. It
attach the wheels and the two remaining parts of the control is important that you stand fully upright and not bend your
lever. Make sure the large wheel nuts are fastened securely! knees! It also helps if you look straight ahead, not down.
You accelerate by moving your weight towards your toes.
As already mentioned, the kit is supplied with a simple Dont push against the control lever, that doesnt work well.
charger. A complete battery charging cycle takes about To slow down you move your weight towards your heels.
16hours. An improved charger based on an earlier Elek- The electronics in the vehicle ensures that you will remain
tor design is described elsewhere in this issue. This circuit balanced and that you can remain standing on the bal-
ensures that the batteries can be charged independently so ancing two-wheeler as demonstrated in the ElektorWheelie
no imbalance can occur in respect of individual capacity. video on YouTube.
Before the first trip it is a good idea to test whether the Steering is done with the control lever. Push it to the left
ElektorWheelie functions properly. To do this, place the slightly and the left motor will turn a little slower, so that the
Wheelie on a crate or box with the wheels off the ground. Wheelie will make a left turn. A small deflection to the right
Turn the Wheelie on and check whether it responds cor- and the Wheelie will veer to the right.
rectly to tilting forwards and backwards. Also check the When the rider is no longer standing on the base plate, the
operation of the control lever. current to the motors is interrupted after a short delay (hys-
teresis), so that the Wheelie will not carry on and decide
for itself where to go. As an additional safety feature the
The first trip ElektorWheelie is fitted with an emergency stop (Safety
To allow you to drive the ElektorWheelie, you first need Switch). This works as follows: A pin is attached with a
to insert the double pin of the Safety Switch. The electron- cord to a strap around your arm. Should you fall unexpect-
ics can now be turned on with the Main Switch. Hold the edly then the pin will be pulled out by the cord, causing the
Wheelie upright, in the position in which you will drive it motors and electronics to be switched off instantly.
(base plate as horizontal as possible). The electronics will
calibrate itself in this position and will attempt to maintain
this position when you are driving the Wheelie. Tips
Now place your right foot on the Foot Switch built into the Make the first trip with the assistance of someone else! All
9/2009 - elektor 65
projects elektorwheelie
sorts of things can go wrong. Helmet, knee and elbow pro- and gather ideas about the software and the hardware and,
tection are certainly recommended initially. of course, share your experiences with other Elektor readers.
(090249-I)
The software controlling the ElektorWheelie vehicle is
open. That means that you can adapt and change the
firmware to your hearts content, but at your own risk. How- Notice
ever, the supplied software has passed thorough testing and This article provides a brief overview of the assembly of a pre-
has had extensive development and is therefore very suit- production sample. Each ElektorWheelie kit supplied to customers
able without any further changes. comes with an extensive construction manual. A pdf file of the ma-
nual will be available as a free download from www.elektor.com/
You are also invited to visit the ElektorWheelie forum on our wheelie in due course. Photos, videos and impressions may be
website at www.elektor.com/forum. There you can discuss found in the ElektorWheelie blog at http://ewheelie.blogspot.com.
MB MA
Safety
Switch
Fuse
Main
Switch
O - I
Steering
Foot Switch
12V 12V
The wiring diagram XLR
shows how all the parts are
to be connected together. 2
3
1
66 elektor - 9/2009
Elektor is substance
for professionals and
those wanting to reach
the level. The perfect
entry to my studies!
Christian, 19, freshman
20%
unt!
Disco Electronics at all the right levels
Advantages to subscribers
Power Charger
for ElektorWheelie
Dual battery charger for
lead acid gel batteries
When charging several lead acid bat- The charger is based on a previously circuit is actually a two-stage charger
teries at the same time, you should published design in Elektor, which is for sealed lead acid (SLA) gel batter-
take into account any possible small still perfectly suitable for the job. For ies, and includes temperature com-
differences between them. Two 12V this application it has been imple- pensation. The latter is formed by the
batteries are used in the Elektor- mented twice, so that two batteries five diodes connected in series to the
Wheelie. The charger described here can be charged at the same time. Ground connection of the L200 (D4D8
can be used to fully charge these bat- and D15D19). The voltage drop across
teries simultaneously, but independ- these diodes causes the output volt-
ently from each other (this is in con-
The design age to rise by about 3.5V, but this has
trast to the charger included in the As can be seen from Figure1, the same nothing to do with their actual function.
kit). The batteries can also be charged circuit has been used twice, each built Theyve been added solely to compen-
faster with this charger. around an L200 voltage regulator IC. The sate for the temperature coefficient of
68 elektor - 9/2009
IC1
2
LIM
R7 D9
1 L200 5
IN OUT 0R47
D1 D2
GND REF D10
C2 C3
D23 D24 R2
4
220n
10k
K4 2 R3 D3 R6
220n
P1
R8
1 56k 3k9
D4 2k5
R1
10k
C1
18V
D5
10k
> 20VA 2200u R5
K5 2 35V C4 D11
D6
4k7
1
T1 10u
D25 D26 D7 63V
D8
BD711 K1
R4 2
4R7 1 +BAT1
D9, D23...D26 = 1N5401 D3...D8, D10 = 1N4148
2
K2
IC2 1 BAT1-2
2
LIM
R15 D20 2
K3
1 L200 5
IN OUT 0R47 1 -BAT2
D12 D13
GND REF D21
C6 C7
D27 D28 R10
3
220n
10k
10k
C5
18V
D16
10k
1
T2 10u
D29 D30 D18 63V
D19
BD711
R12
4R7
D20, D27...D30 = 1N5401 D14...D19, D21 = 1N4148 090582 - 11
Figure1. The dual nature of the design can be clearly seen in the circuit diagram for the charger.
the average gel battery (+3.85 mV/C). sion). However, when a battery is con- a consequence, the charging current
The diodes cause the output voltage to nected to K1 (+) and K2 () and suffi- will gradually drop. However, as long
vary by a similar amount in the oppo- cient current flows through R4, transis- as a sufficient current flows, the output
site direction. The safe operating range tor T1 starts to conduct and the R3/D3 voltage will remain at a steady 14.4V
with the inclusion of these components branch is connected in parallel to R5. (or 7.2V for a 6V version). The current
is 20C to +40C. An additional advan- This changes the proportions of the through R4 will not rise above about
tage of these diodes is that they protect potential divider such that the output 200mA, even with a large charging
the voltage regulators against reversed voltage increases to about 14.4V. current. The rest of the output cur-
polarity at the output. When a discharged battery is con- rent flows via the base-emitter junc-
The circuit operates as a two-stage nected the initial output voltage is tion of T1. The BD711 can cope with
charger and can either charge the bat- therefore 14.4V, or 2.4V per cell. Series base currents up to 5A without any
tery normally or trickle-charge it. The resistor R7 ensures that the resulting problem. Once the charging current
fact that the charging current reduces charging current is limited to about drops to a value of about 0.01C its
when the battery becomes fully charged 0.1C (assuming that a battery with C safe to assume that the battery is fully
comes in handy. The L200 has been con- = 9Ah is used). R7 should therefore charged. At that point the voltage drop
figured as a constant current source in be adjusted for the maximum charg- across R4 will be too small for T1 to
the usual way, although an extra circuit ing current of the battery concerned. conduct, and R3 no longer has an effect
has been added: Normally the output Its possible to adjust the values of R6 on the potential divider connected to
voltage of the regulator is determined and R3 such that the output voltage is pin4. The charger now switches over
by the relationship between the resis- halved, making the charger suitable for to an output voltage of 13.8V (or 6.9V
tors in the voltage divider connected use with 6V batteries. The appropri- for a 6V version). This safe voltage
to pin4 (R6+P1/R5, with reference to ate values for these components may results in a trickle-charge that keeps
the top charger), which in this case be found in the table. the battery in a good condition.
results in an output voltage of about The more a battery is charged up, Since gel batteries cant cope well
13.8V (considering only the 12V ver- the higher its cell voltage will be. As with a large voltage ripple, a fairly
9/2009 - elektor 69
projects power supplies
Figure2. To keep the home construction of the charger as simple as possible weve used only trusty old through-hole components.
large smoothing capacitor (C1) has mum output voltage, the voltage drop type, but any comparable type can be
been added to the input. The smaller across D9 and R7, and the maximum used as well. This particular type has
electrolytic capacitor at the output (C4) dropout voltage of the voltage regulator. dual primary windings. The two pri-
has the function of keeping the L200 In the case of 12V batteries this means mary windings have to be connected
stable under all conditions. that a minimum of 18V is required and in series for operation at 230VAC.
LED D1 indicates that an input voltage for 6V batteries you need a minimum of The grey and purple leads have to be
is present. D11 does the same for the 11V. When selecting a transformer, do joined, with the connection thoroughly
output, but also lights up when a bat- take account the ripple across C1 and isolated. For use with 115-120VAC
tery is connected. LED D2 is on while the voltage drop across the bridge rec- (60 Hz) mains voltage, the two wind-
the charging voltage is 2.4V per cell and tifier (D23D26). The ripple across the ings have to be connected in parallel
turns off when the charger switches to smoothing capacitor at 1A is about 4.5V (connect blue to purple and grey to
trickle-charging at 2.3V per cell. Diode (as a rule of thumb: I / (2fC)) and the volt- brown).
D9 protects the L200 against reverse age drop across the bridge rectifier is A 35V type is required for C1 because
polarity and prevents the connected 1.2V. This means that a transformer is the voltage can rise above 25V when
battery from discharging via IC1. required with a minimum peak voltage no battery is connected.
of 23.7V (12V version). This results in a
choice of an 18V transformer. It should
Input voltage be rated for at least 40VA (for an output
Construction
The minimum input voltage required by current of 1A). A compact PCB has been designed for
the circuit is determined by the maxi- In the parts list weve chosen a 50VA the charger. The component layout is
70 elektor - 9/2009
shown in Figure2. The PCB artwork
Component values
(copper track layout) can be down-
loaded from the Elektor website [1] as component 6 V battery 12 V battery notes
usual. The construction should be fairly R6,R14 wire link 3.9k
straightforward. Start with the small- R3,R11 6.8k 56k
est components, such as the resistors
R7,R15 0.45 / Imax 0.45 / Imax
and finish with the largest. Remember
to put in the wire link next to D20. R4,R12 0.5(V) : 0.01(C) 0.5(V): 0.01 (C) Choose nearest E12 value
The prototype was mounted in a U- C = nominal capacity of the battery (in Ah)
shaped tray made from 2mm thick Imax = maximum (initial) charge current
aluminium. The heat conduction of
this wasnt really sufficient, so for the
final version we recommend a thick- A suitable hole has to be made for the Alignment
ness of 3 or 4mm. This tray functions AC power input (including a properly At room temperature (20 to 25C),
as a heatsink for IC1 and IC2. The ICs rated fuse and switch). In the parts list using P1, adjust the output voltage of
should be electrically isolated from the is a type that comes with spade ter- the circuit to 13.8V (6.9V for the 6V
tray, so use a mica sheet and a plastic minals. This makes it easier if the cir- version). Next, check that the output
sleeve. We used two ceramic isolators cuit has to be repaired, but takes up a voltage increases to 14.4V (7.2V for
(1.5mm thick), because this was more bit more space than a separate switch, the 6V version) when you momentar-
convenient to use after the alumin- fuseholder and an AC power cord with ily short the collector/emitter junction
ium was bent. The tray and the 50VA a strain relief. The charging cable has of T1. Everything is fine if the meas-
transformer are then mounted in a case been fed into the case via a strain urement is within 0.1V of the required
BT1
XLR
2 1
3
BT2
090582 - 12
relief and connected to the board using value. If the voltage is too high you
measuring 60 190 110mm. The spade terminals. When the charger is should increase the value of R3. Con-
tray is mounted using four bolts with used with the ElektorWheelie, the XLR versely, if the voltage is too low, R3
four nuts used as spacers. This pre- plug should be connected as shown in should be decreased.
vents the warm part of the tray (where Figure3. The transformer connections When using the charger, always carry
the voltage regulators are mounted) are also made with spade terminals. out these steps in the following order:
from making contact with the plas- The LEDs are mounted in the lid. The -Check the polarity of the battery.
tic case. The transformer is mounted cables are long enough to allow the lid -Connect the battery to the charger.
on a separate sheet of aluminium. For to be put down next to the case. On -Check that D11 is lit.
this the same four bolts are used. In the board we mounted 2-way headers -Apply AC power.
this way the tray can be larger (i.e. the instead of the LEDs. Suitable header (090582-I)
U a bit taller). The large head of the sockets were connected to the LED
transformer bolt no longer has to be cables, which makes it easier to work
between the tray and the case, but is on the circuit. Internet Link
now between the extra sheet and the Dont forget to add sufficient holes to [1] www.elektor.com/090582
U shape. the case to assist ventilation.
9/2009 - elektor 71
projects design tips
Quantum die
Markus Bindhammer year. These days the nucleus is The circuit here demonstrates We can use a Geiger counter to
(Germany) viewed as being in a superposi- that God does indeed play dice! count the number of decay events
tion of states, decayed and not Rather than using a single radi- that occur in a given period of
To paraphrase Albert Einstein, decayed, and the uncertainty as oactive nucleus we use a small time. This count is perfectly ran-
God does not play dice: the to its state is only resolved when quantity of radioactive mate- dom and therefore ideal for driv-
famous physicist was not happy it is observed. This idea is so rial, for example in the form of ing electronic dice. In our circuit
to accept that the world is ulti- alien to everyday human expe- a sample of pitchblende, an ore we use a ZP1320 Geiger-Mller
mately governed by chance. A rience that, even now that the of uranium. It is possible to pur- tube, which is available for pur-
radioactive nucleus does not consumer market starts to see de- chase small specimens of pitch- chase from various Internet sites.
decay at precise, regular inter- vices that rely on the principles of blende from suppliers to collec- This tube is designed for a supply
vals; instead, there is a certain quantum mechanics for their op- tors of rocks and minerals. Care voltage of between 540V and
probability that it will decay at eration, it is easy to sympathise is needed in handling the mate- 650V; our circuit can deliver a
some point in the next hour or with Einsteins point of view. rial (see below). voltage from around 300V to
around 1000V, which
also allows other tube
types to be used in-
stead. The tube is con-
nected to the circuit us-
counter tube ZP1320 ing a screened cable
and must be mounted in
coaxial cable R7 A
4M7
C3 C4
To generate the high
10n 10n
630V 630V voltage we use a
230V-to-6V transform-
R9
D1 D2 D3 D4 D5 C12
TR1
100k 100M er wired back to front.
y 300 - 1000V
R11 R1
6V 230V
C5
10n
5x 1N4007
C6
10n
D7 A MOSFET driven from
4k7
100k
630V 630V
2x D6
IC2 via R2, pulls one
R6 R5 R4
1N4148 side of the 6V winding
8 4 1VA
R
T1
10M 22M 22M
to ground. The resulting
7 4 8
R12 DIS
IC2 C1 R R10
T3
voltage spikes on the
primary side are multi-
R2 7
12k
CV T2 IC3.B
NE555
6
capacitor ladder to pro-
BZ1
duce over 1000VDC.
THR
1 5 50k 4 3
1 CV
R3 to R6 and P1 form
14
R3 5 1 R8
C11 C10 BC547 C2 C7 IC3 C8 C9
a potential divider that
1M
27k
120 7
220 7
120 7
10k
100k
IC3 = 7404
14
IC3.D
8 9
12
QA
IC4
A
4 8 once again below the
LED3 LED4 LED5
1
9
QB
B
1 R
DIS
7 100k transistors threshold.
7490 IC5
2
IC3.E 8 R0(1) 3 2
10 11
QC
R0(2)
3 OUT TR
The high voltage is
1 6 NE555
11
QD
R9(1)
7 THR
6 taken to the tubes an-
R9(2)
LED6 LED7
IC3.C CV ode via protection re-
5 1
sistor R7. The tube is
6 5
1 10 S1
C13 C14
filled with a noble gas;
10n 22M
ROLL
if ionising radiation is
060309 - 11 incident on the tube,
electrons are knocked
out of their shells in
the noble gas atoms.
These free electrons ac-
Caution: It is essential to be careful when handling radioactive materials such as pitchblende. celerate towards the
Keep a distance, wash your hands after touching the sample, and do not eat, drink or smoke anode, ionising further
while handling it. Do not under any circumstances cut or work the mineral sample.
atoms as they go. The
Caution: High voltages are present in this circuit, which is recommended only for experienced
constructors. The Geiger-Mller tube and the circuit must be mounted in a robust and electrically avalanche of ionisation
insulated enclosure. creates a brief current
flow between anode
72 elektor - 9/2009
and cathode. This current results monostable multivibrator. When where t is in units of seconds, verters are tied to the positive
in a voltage pulse across bleeder button S1 is pressed the output of C14 in F, and R19 and P2 in supply to prevent unpredictable
resistor R8, triggering IC1. The IC5 goes high and T4 conducts. M. behaviour.
pulses are output by IC1 on pins This gates pulses through to the
7 and 3. T3 turns on briefly with 7490 counter. After a preset time The 7490 counter is wired so The quantum die is perhaps not
each pulse, causing the piezo interval the output of IC5 returns that it is reset to 9(1001) rath- ideal for ludo-type games if your
sounder to emit a loud click. low and T4 blocks. The time pe- er than to 0(0000). It therefore fellow players are accustomed to
riod over which the radioactive counts from 1001 up to 0100. blaming their defeats on the dice
The pulses that are output on pin decay pulses are measured is de- IC3 contains six inverters and being loaded!
3 are passed via transistor T4. termined by C14, R19 and P2: is used to drive the seven LEDs (060309-I)
This is turned on by the output that form the display of the die.
of IC5, which is configured as a t 1.1C14(R19 + P2) The inputs of the two unused in-
Advertisement
Call us: 020 8816 7005 Email: euro@eurocircuits.com *excluding transport and VAT
www.eurocircuits.com
TOTALLY oFvReEnE!
Selected, tested & certified by Elektor
with your
Including Elektor-produced user manual
Fully menu controlled Art. # 080663-91 Price: 962.00 1195.00 US $1665.00 (Excl. VAT)
SMT Expert Tip: Double-sided Soldering
Demovideos available on the Elektor website Main technical specifications
Ideal for R&D laboratories, schools, small companies and Line voltage: 230 VAC / 1650 W
electronics enthusiasts Line frequency: 50-60 Hz
Product support from Elektor Customer Services Size: 418 x 372 x 250 mm (16.5 x 14.6 x 10 inch)
Weight: 16.7 kg (net)
Effective PCB area: 280 x 280 mm (11 x 11 inch)
Further information
mation and ordering at www.elektor.com/smtoven
9/2009 - elektor 73
info & market elektor pcb service
1 2
Gerber and Excellon files in Eagle in this case gerb274x.cam (in the Eagle subdirectory cam). For a
4-layer PCB select gerb274x-4layer.cam.
Generating Gerber- and Excellon files in Eagle (V 5.6.0) is a
piece of cake. Simply follow these steps: 4. The job opens itself in the CAM processor window. In the
right-hand panel the necessary items are already selected. You
1. Open the CAM Processor do not need to do anything here.
2. Select under FileOpen for Job. 5. Activate in every(!) layer the Dimension by clicking on it. This
3. In the window that now opens you select the correct .cam-file, shows the outline of the PCB. The tick box next to Mirror needs
3 4
74 elektor - 9/2009
Q. Can I supply my design the top side needs to have normal text and the bottom side
in another format besides Extended Gerber? has mirrored text so that it reads correctly when you look
A. We can be very short about this; its difficult because of at the PCB from the bottom side.
two reasons:
Q. Why do I need to supply
1. Converting CAD data to a format suitable for the actual my personal details?
PCB production process can result in errors that we cannot A. To allow us to make as accurate a calculation as
check for. possible of the total costs, including postage, we require
your personal details.
2. It is practically impossible to have available every PCB
design or CAD package in existence and also have the You can find answers to many more specific questions at
necessary skills to use it properly. In addition, not everyone http://elektorpcbservice.info. This website is formatted
uses the same version, which means we would also need as a discussion forum, with an important difference: it is a
to have a whole series of patches and upgrades available question and answer board where you can only read and
as well. not post. We frequently add new pieces of information to
The Gerber format is clear, unambiguous and has been the this website with regards to the Elektor PCB Service.
industry standard for many years. Every respectable PCB An extensive document with technical guidelines for the
layout program should be able to generate Gerber and specifications of a PCB can be downloaded from www.
Excellon files (below we will describe how to do this with elektor.com/pcbservice.
the popular Eagle software).
If, despite of this piece of information, you have further
Q. Do I need to mirror one or more layers? questions then feel free to send an email to info@elektor-
A. PCB is always viewed from above, through the board. pcbservice.com.
That is why no single layer needs to be mirrored. However (090602-I)
5 6
to be un-ticked each time. drilling the holes, you select the excellon.cam file when opening
the .cam-file (steps 2 and 3). You then click process job and the
6. The final step is carrying out the job. This is simply done by
Excellon file will be generated.
clicking the button Process Job.
You now simply combine all these files into a single zip file and
7. The CAM Processor places the Gerber files in the folder of
upload it via the Elektor PCB Service website.
your opened project. There are quite a few files there (six for a
two-layer board).
8. To create an Excellon file that contains the information for
. c o m
r vice
bs e
r p c
e k to
7 8
.e l
w w
9/2009 - elektor w 75
infotainment puzzle
Hexadoku
Hopefully youve recovered from the awesome Hexamourai puzzle featured in the July/August issue.
Puzzle with an
electronics touch
This month its back to normal with a regular Hexadoku to contend with. As always, all correct solutions
we receive in our international mailboxes enter a prize draw for an E-blocks Starter Kit Professional and
three Elektor Shop vouchers.
The instructions for this puzzle are straightforward. number of clues are given in the puzzle and these determine the
start situation.
In the diagram composed of 1616 boxes, enter numbers All correct entries received for each months puzzle go into a
such that all hexadecimal numbers 0 through F (thats 0-9 and draw for a main prize and three lesser prizes. All you need to
A-F) occur once only in each row, once in each column and in do is send us the numbers in the grey boxes. The puzzle is also
each of the 4x4 boxes (marked by the thicker black lines). A available as a free download from the Elektor website
Professional Regus Brentford - 1000 Great West Road - Brentford TW8 9HH
United Kingdom - Fax (+44) 208 2614447
worth 300 The closing date is 1 October 2009.
and three
Elektor SHOP PRIZE WINNERS
Vouchers worth The solution of the June 2009 Hexadoku is: 579BD.
40.00 each.
The E-blocks Starter Kit Professional goes to:
We believe these prizes Michael Andersen (Denmark).
should encourage An Elektor SHOP voucher worth 40.00 goes to:
all our readers to participate! Silvia Rotondi (Italy); Haije Talsma (The Netherlands);
The competition is not open to employees of Elektor International Media, Roland Louis (France).
its business partners and/or associated publishing houses. Congratulations everybody!
76 elektor - 9/2009
retronics infotainment
Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are
welcomed; please send an email to editor@elektor.com
5/2009 - elektor 77
ELEKTORSHOWCASE
To book your showcase space contact Huson International Media
Tel. 0044 (0) 1932 564999 Fax 0044 (0) 1932 564998
BYVAC
universal and dedicated device programmers HEXWAX LTD
excellent support and after sale support www.hexwax.com
www.byvac.com free SW updates World leaders in Driver-Free USB ICs:
USB to I2C reliable HW USB-UART/SPI/I2C bridges
Microcontrollers once a months new SW release TEAleaf-USB authentication dongles
Forth three years warranty for most programmers expandIO-USB I/O USB expander
Serial Devices
USB-FileSys flash drive with SPI interface
USB-DAQ data logging flash drive
FIRST TECHNOLOGY TRANSFER LTD.
http://www.ftt.co.uk
Training and Consulting
DECIBIT CO.LTD. for IT, Embedded and LONDON ELECTRONICS COLLEGE
www.decibit.com Real Time Systems http://www.lec.org.uk
Development Kit 2.4 GHz Assembler, C, C++ (all levels) Vocational training and education
Transceiver nRF24L01 8, 16 and 32 bit microcontrollers for national qualifications in
AVR MCU ATmega168 Microchip, ARM, Renesas, TI, Freescale Electronics Engineering and
CMX, uCOSII, FreeRTOS, Linux operating Information Technology (BTEC First National,
systems Higher National NVQs, GCSEs and GCEs). Also
Ethernet, CAN, USB, TCP/IP, Zigbee, Bluetooth Technical Management and Languages.
programming
DESIGNER SYSTEMS
http://www.designersystems.co.uk FLEXIPANEL LTD LCDMOD KIT
Professional product development services. www.flexipanel.com http://www.lcdmodkit.com
Marine (Security, Tracking, Monitoring & control) TEAclippers - the smallest
Automotive (AV, Tracking, Worldwide On-line retailer
PIC programmers in the world, Electronics components
Gadget, Monitoring & control)
Industrial (Safety systems, from 20 each: SMT chip components
Monitoring over Ethernet) Per-copy firmware sales USB interface LCD
Telecoms (PSTN handsets, GSM/GPRS) Firmware programming & archiving Kits & Accessories
AudioVisual ((HD)DVD accessories & controllers) In-the-field firmware updates PC modding parts
Tel: +44 (0)1872 223306 Protection from design theft by subcontractors LCD modules
78 elektor - 9/2009
products and services directory
ROBOT ELECTRONICS USB INSTRUMENTS
www.elektor.com http://www.robot-electronics.co.uk
Advanced Sensors and Electronics for Robotics
http://www.usb-instruments.com
USB Instruments specialises
Ultrasonic Range Finders in PC based instrumentation
Compass modules products and software such
Infra-Red Thermal sensors as Oscilloscopes, Data
MQP ELECTRONICS Motor Controllers Loggers, Logic Analaysers
www.mqp.com Vision Systems which interface to your PC via USB.
Low cost USB Bus Analysers Wireless Telemetry Links
High, Full or Low speed captures Embedded Controllers
Graphical analysis and filtering VIRTINS TECHNOLOGY
Automatic speed detection www.virtins.com
Bus powered from high speed PC PC and Pocket PC based
virtual instrument such
Capture buttons and feature connector ROBOTIQ as sound card real time
Optional analysis classes http://www.robotiq.co.uk oscilloscope, spectrum
Build your own Robot! analyzer, signal generator,
Fun for the whole family! multimeter, sound meter,
MeccanoTM Compatible distortion analyzer, LCR meter.
RFID COMPONENTS Computer Control Free to download and try.
http/www.apdanglia.org.uk Radio Control
For DIY, OEM's & Experimenters Tank Treads
EM4100 Cards .99 p (Prices inc vat) Hydraulics CANDO CAN BUS ANALYSER
Keyfobs 1.09 Internet Technical Bookshop, http://www.cananalyser.co.uk
R/W Keyfobs 1.65 1-3 Fairlands House, North Street, Carshalton, USB to CAN bus interface
RFID Coils 2.95 USB powered
Surrey SM5 2HW
RFID PCB FREE CAN bus analyser S/W
email: sales@robotiq.co.uk Tel: 020 8669 0769
with RS232 port Receive, transmit & log.
RFID ICs EM4095 - U2270B CAN messages
microRFID module (similar to Core ID12) ISO11898 & CAN
Free Reader download - Technical pages
Order online 24 hrs - Tel: 01244 520684
www.elektor.com 2.0a/2.0b compliant
Rugged IP67 version available
9/2009 - elektor 79
SHOP BOOKS, CD-ROMS, DVDS, KITS & MODULES
!
and modelling, RF techniques, home and
W
garden, test and measurement, microcon-
E
trollers, computer hardware and software,
N
power supplies and chargers plus of
course everything else that does not seem
to belong in any of these categories. 310
Circuits contains many complete solutions
as well as useful starting points for your
own projects.
er
Limited Period Off
for Subscribers!
4 DISCOUNT Bring your microcontroller to life
309 Circuits
This book contains 23 special and excit-
ing artificial intelligence machine-lear-
Complete with a free pen and SMD-tool
The
ningpresent
projects,tenth edition of the popular
for microcontroller and PC.
Books
80 elektor - 9/2009
Bestseller!
Learn by doing Learn more about C# programming and .NET See the light on Solid State Lighting
cations guidance with hardware and soft- Brentford Adobe Reader, articles are presented in
ware examples plus tips on interfacing the TW8 9HH the same layout as originally found in
mouse to typical microcontrollers. A wide United Kingdom the magazine. The DVD is packed with
range of topics is explored, including USB features including a powerful search en-
Tel.: +44 20 8261 4509
descriptors, a four-channel, millivolt-preci- gine and the possibility to edit PCB layouts
sion voltage reference all with fully docu-
Fax: +44 20 8261 4447 with a graphics program, or printing hard
mented source-code. Email: sales@elektor.com copy at printer resolution.
9/2009 - elektor 81
SHOP BOOKS, CD-ROMS, DVDS, KITS & MODULES
CD/DVD-ROMs
Completely updated
The program package consists of eight Since cars contain an ever increasing A TinyBrick is a small self-contained mi-
databanks covering ICs, germanium and amount of electronics, students learning crocontroller module fitted with a power-
silicon transistors, FETs, diodes, thyristors, about motor vehicle technology also need ful Renesas 16-bit M16C microcontroller.
Kits & Modules
triacs and optocouplers. A further eleven to know more about electronics and mi- A BASIC interpreter is installed in the
applications cover the calculation of, for ex- crocontrollers. In collaboration with the module to simplify software develop-
ample, LED series droppers, zener diode Timloto o.s. Foundation in the Nether- ment. Beginners will find it an ideal start-
series resistors, voltage regulators and lands, Elektor designed a special control- ing out point while more experienced
AMVs. A colour band decoder is included ler PCB, which will be used in schools in users will appreciate its power and con-
for determining resistor and inductor val- several countries for teaching students venience. With this evaluation board (to-
ues. ECD 4 gives instant access to data on about automotive technologies. But it can gether with a TinyBrick) you can build an
more than 69,000 components. All data- also be used for other applications, of intruder alarm that sends SMS texts.
bank applications are fully interactive, al- course. The heart of this board is an Atmel
lowing the user to add, edit and complete AT90CAN32 with a fast RISC core. Kit of parts incl. TinyBrick-PCB with SMD
component data. This CD-ROM is a must- parts and microntroller premounted plus
have for all electronics enthusiasts. Kit of parts, incl. PCB with SMDs prefitted all other parts
ISBN 978-90-5381-159-7 24.90 US $39.50 Art.# 080671-91 52.00 US $79.00 Art.# 080719-91 54.00 US $87.50
82 elektor - 9/2009
September 2009 (No. 393) US $
Bestsellers
Product Shortlist
Books Books
case, mounting materials and cable .................................84.00......135.00
Battery Monitor
C Programming for Embedded Microcontrollers
030451-72 ....LC display .........................................................................11.00........15.00
080824-1 ......Printed circuit board .........................................................12.90........18.75
3 ISBN 978-0-905705-80-4 ............... 32.50 .....US $52.00
080824-41 ....Programmed controller LPC2103 ....................................16.50........24.00
Artificial Intelligence
July/August 2009 (No. 391/392) 4 ISBN 978-0-905705-77-4 ............... 32.00 .....US $46.00
Luxeon Logic
CD-ROMs
Mouse Interfacing
081159-41 ....Programmed controller ATtiny25 .......................................6.40........10.50
Programmable Nokia RTTTL Player
5 ISBN 978-0-905705-74-3 ............... 26.50 .....US $53.00
090243-41 ....Programmed Attiny13 ........................................................6.40........10.50
DVD LED Toolbox
Breadboard/Perfboard Combo
080937-1 ......Printed circuit board .........................................................25.50........42.00
1 ISBN 978-90-5381-245-7 ............... 28.50 .....US $54.00
Annoy-a-Tron
Kits & Modules ECD 5
090084-41 ....Programmed controller ATtiny13 .......................................6.40........10.50
Fan Speed Controller
CD/DVD-ROMs 2 ISBN 978-90-5381-159-7 ............... 24.90 .....US $39.50
9/2009 - elektor 83
info & market coming attractions next month in elektor
Article titles and magazine contents subject to change, please check Magazine on www.elektor.com The October 2009 issue comes on sale on Thursday 24 September 2009 (UK distribution only).
UK mainland subscribers will receive the issue between 19 and 22 September 2009.
84 elektor - 9/2009
Order Form
09-2009
Description Price each Qty. Total Order Code
METHOD OF PAYMENT
Elektor Personal Organizer 2010 NEW 24.90 (see reverse before ticking as appropriate)
310 Circuits 29.90
NEW Bank transfer
C# 2008 and .NET programming Cheque
for Electronic Engineers NEW 29.50 (UK-resident customers ONLY)
DVD LED Toolbox NEW 28.50 Giro transfer
C Programming
for Embedded Microcontrollers 32.50
Phone: 603-924-9464
Fax: 603-924-9467
EL09 E-mail: custservus@elektor.com
Order Form
09-2009
Subscription-Plus
(11 issues plus the Elektor Volume 2009 CD-ROM)
Elektor
Regus Brentford
1000 Great West Road
Tel. Email Brentford TW8 9HH
United Kingdom
Date Signature Tel.: +44 20 8261 4509
Fax: +44 20 8261 4447
www.elektor.com
EL09 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 11.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. 40209520 held by Elektor Electronics with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20.
BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us.
Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or
subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country.
Giro transfer into account no. 34-152-3801, held by Elektor Electronics. Please do not send giro transfer/deposit forms directly to us, but instead
use the National Giro postage paid envelope and send it to your National Giro Centre.
Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is
SSL-protected for your security.
COMPONENTS
Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply
of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive.
TERMS OF BUSINESS
Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this
time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our
consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number.
If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods
must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21-days (all other countries). Cancelled orders All cancelled
orders will be subject to a 10% handling charge with a minimum charge of 5.00. Patents Patent protection may exist in respect of circuits,
devices, components, and so on, described in our books and magazines. Elektor does not accept responsibility or liability for failing to identify
such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes
and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be reproduced
or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor
in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature.
Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability
Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in
connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser
any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects
by the laws of England.
January 2009
INDEX OF ADVERTISERS
Antex Electronics Ltd . . . . . . . . . . . . . . . . . www.antex.co.uk. . . . . . . . . . . . . . . . . . . . . . . 47 MikroElektronika. . . . . . . . . . . . . . . . . . . . . www.mikroe.com . . . . . . . . . . . . . . . . . . . . . . . 3
Future Technology Devices, Showcase . . . . www.ftdichip.com . . . . . . . . . . . . . . . . . . . 35 ,78 Troostwijk Veilingen b.v. . . . . . . . . . . . . . . . www.troostwijkauctions.com. . . . . . . . . . . . . . 63
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