Professional Documents
Culture Documents
Android Tablet: Electronic LED Candle
Android Tablet: Electronic LED Candle
52429
December 2011 AUS$ 14.50 - NZ$ 17.50 - SAR 102.95 - NOK 99 4.80
www.elektor.com
Android Tablet
Does time-lapse photography
Electronic
LED Candle
You can blow it out!
R51
Microcontrollers
New 8-bit Microcontrollers with integrated configurable
logic in 6- to 20-pin packages
Digital Signal
Controllers
Analog
Memory
RF & Wireless
Microchips new PIC10F/LF32X and PIC12/16F/LF150X 8-bit microcontrollers Fast-start
(MCUs) let you add functionality, reduce size, and cut the cost and power Development tools
consumption in your designs for low-cost or disposable products, with
on-board Configurable Logic Cells (CLCs), Complementary Waveform
Generator (CWG) and Numerically Controlled Oscillator (NCO).
the Configurable logic Cells (ClCs) give you software control of combinational and
pICDem lab Development
sequential logic, to let you add functionality, cut your external component count and save Kit - Dm163045
code space. then the Complementary Waveform Generator (CWG) helps you to improve
switching efficiencies across multiple peripherals; whilst the numerically Controlled
oscillator (nCo) provides linear frequency control and higher resolution for applications
like tone generators and ballast control.
pIC16F193X F1 evaluation
platform - Dm164130-1
pIC10F/lF32X and pIC12/16F/lF150X mCUs combine low current consumption, with an
on-board 16mHz internal oscillator, aDC, temperature-indicator module, and up to four
pWm peripherals. all packed into compact 6- to 20-pin packages.
www.microchip.com
The Microchip name and logo, HI-TECH C, MPLAB, and PIC are registered trademarks Personal Download
of Microchip Technology for
Inc. in the I
U.S.A., andElektor
other countries. mTouch, PICDEM, PICkit, and REAL ICE, are trademarks of Microchip Technology Inc. in the U.S.A.,
and other countries. All other trademarks mentioned herein are the property of their respective companies. 2011, Microchip Technology Incorporated. All Rights Reserved. DS30629A. ME293AEng/09.11
52429
...and 167 more devices which could not t into this ad.
4 12-2011 elektor
Personal Download for I Elektor
52429
75 Hexadoku
Elektors monthly puzzle with an
electronics touch.
76 Retronics:
RCA Cosmac
Development System IV
66 USB Data Logger (CDP18S008) (ca. 1978)
hELLO wORLD from Embedrock City.
The USB data logger described here is a low-energy, universal solution to the Series Editor: Jan Buiting
problems with adding EEPROM and RAM to microcontrollers performing data
logging functions. It takes all the serial data sent from any external micro and 84 Coming Attractions
stores it in a file on a USB memory stick which can be analysed later with a PC. Next month in Elektor magazine.
elektor 12-2011 5
Personal Download for I Elektor
52429
Elektor International Media provides a multimedia and interactive platform for everyone interested
in electronics. From professionals passionate about their work to enthusiasts with professional
ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration
and entertainment. Analogue and digital; practical and theoretical; software and hardware.
analogue digital
microcontrollers & embedded
audio test & measurement
Volume 37, Number 420, December 2011 ISSN 1757-0875 Elektor is also published in French, Spanish, American English, Editorial secretariat:
German and Dutch. Together with franchised editions the Hedwig Hennekens (secretariat@elektor.com)
Elektor aims at inspiring people to master electronics at any magazine is on circulation in more than 50 countries.
personal level by presenting construction projects and spotting Graphic design / DTP: Giel Dols, Mart Schroijen
developments in electronics and information technology. International Editor:
Wisse Hettinga (w.hettinga@elektor.nl) Managing Director / Publisher: Don Akkermans
Publishers: Elektor International Media, Regus Brentford,
Editor: Jan Buiting (editor@elektor.com) Marketing: Carlo van Nistelrooy
1000 Great West Road, Brentford TW8 9HH, England.
Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 International editorial staff: Harry Baggen, Thijs Beckers,
www.elektor.com Eduardo Corral, Ernst Krempelsauer, Jens Nickel, Clemens Valens. Subscriptions: Elektor International Media,
Regus Brentford, 1000 Great West Road, Brentford TW8
The magazine is available from newsagents, bookshops and Design staff: Christian Vossen (Head), 9HH, England.
electronics retail outlets, or on subscription. Thijs Beckers, Ton Giesberts, Luc Lemmens, Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447
Elektor is published 11 times a year with a double issue for July & August. Raymond Vermeulen, Jan Visser. Internet: www.elektor.com/subs
6 12-2011 elektor
Personal Download for I Elektor
52429
Elektor eC-reow-mate
Professional SMT reow oven with unique features
New
The eC-reow-mate is ideal for assembling prototypes and small production batches of PCBs with SMD
components. This SMT oven has a very large heating compartment, which provides plenty of space for several
PCBs. The accompanying PC software allows you to monitor the temperature curves of all sensors precisely
during the soldering process, and it enables you to modify
existing temperature/time proles or create new ones. Special features:
Optimal temperature distribution thanks to
special IR lamps
Drawer opens automatically at end of soldering
process
Glass front for easy viewing
Technical specications:
Supply voltage: 230 V / 50 Hz only
Power: 3500 W
Weight: approx. 29 kg
Dimensions: 620 245 520 mm (W H D)
Heating method: Combined IR radiation and
hot air
Operation: Directly using menu buttons and LCD
on oven
Remotely using PC software and USB connection
Temperature range: 25 to 300 C
Maximum PCB size: 400 285 mm
Temperature sensors: 2 internal and 1 external
(included)
Price:
2170.00 / 2495.00 / US$3495.00
(plus VAT and Shipping)
www.elektor.com/reflow-mate
Email: subscriptions@elektor.com Email: t.vanhoesel@elektor.com system of any nature. Patent protection may exist in respect of
Rates and terms are given on the Subscription Order Form. Internet: www.elektor.com circuits, devices, components etc. described in this magazine.
Advertising rates and terms available on request. The Publisher does not accept responsibility for failing to identify
Head Office: Elektor International Media b.v. such patent(s) or other protection. The submission of designs or
P.O. Box 11 NL-6114-ZG Susteren The Netherlands Copyright Notice articles implies permission to the Publisher to alter the text and
Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 The circuits described in this magazine are for domestic use design, and to use the contents in other Elektor International
only. All drawings, photographs, printed circuit board layouts,
Media publications and activities. The Publisher cannot guaran-
Distribution: programmed integrated circuits, disks, CD-ROMs, software
tee to return any material submitted to them.
Seymour, 2 East Poultry Street, London EC1A, England carriers and article texts published in our books and magazines
Telephone:+44 207 429 4073 (other than third-party advertisements) are copyright Elektor
International Media b.v. and may not be reproduced or transmit- Disclaimer
UK Advertising: ted in any form or by any means, including photocopying, scan- Prices and descriptions of publication-related items subject to
Elektor International Media b.v. ning an recording, in whole or in part without prior written per- change. Errors and omissions excluded.
P.O. Box 11 NL-6114-ZG Susteren The Netherlands mission from the Publisher. Such written permission must also be
Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 obtained before any part of this publication is stored in a retrieval Elektor International Media b.v. 2011 Printed in the Netherlands
elektor 12-2011 7
Personal Download for I Elektor
8 12-2011 elektor
Personal Download for I Elektor
52429
iPad forty years ago. SideKicks carbon first and only touchscreen IC that delivers Intersil: DC/DC Controllers
compound is similar to the one found in built-in 10 V Tx to drive the touch panel for embedded and low
printers ink. That carbon compound is why at 10 V. Because SNR is directly propor-
newspapers have been an effective way to tional to the voltage at which the panel is
power CPU/GPU cores
clean windows for generations. When you driven, this feature allows Cypress to offer Intersil Corporation recently expanded its
get a fingerprint on a lens or a computer nearly four times the SNR of the next clos- portfolio of industry leading multi-phase DC/
screen, its an accident. But when you get est competitor. DC controllers by introducing the ISL95835
fingerprints on an iPad or tablet, it means The Gen4 family further raises the SNR and ISL95837. Both controllers provide a
youre using it! SideKick is not just an acces- bar as the first touchscreen device family complete low cost solution for CPU and
sory, its a necessity. to completely eliminate display noise in GPU core power while delivering best-in-
SideKick is available at electronics stores hardware. Gen4s patent-pending Display class transient response and efficiency. Each
nationwide in the US. Replacement cleaning Armor offers unprecedented immunity to complies with Intels IMVP-7/VR12 specifi-
pads are available in packages of two. Each noise from every type of display, even low cation for smart voltage regulation to reduce
pad gives 150 cleanings. MSRP for SideKick cost noisy displays such as ACVCOM LCDs. power dissipation in the second-generation
is $19.95, and $14.95 for the package of This allows touchscreen designers to make lntel Core-i5/i7 processors.
two replacement pads. their products thinner by removing the air Both the ISL95835 and ISL95837 are the
www.lenspen.com gap between the display and the sensor, industrys smallest solutions available and
www.youtube.com/lenspennews and also less expensive by removing the offer combined functionality and reduced
(110675-X) shield layer in the sensor. Display Armor pin count, saving valuable board space and
allows Gen4 to operate seamlessly with reducing the total bill of materials. The
direct lamination, on-cell and in-cell stack- ISL95837 has been optimized for lower
ups, regardless of the display chemistry. power, thin and light applications.
The Gen4 product family offers the indus-
Cypress: new Gen4 trys fastest refresh rate of 400Hz, and has
the unique ability to scan a capacitive touch
TrueTouch controller panel at 1,000 Hz both industry-best met-
line is ultra noise resilient rics. This level of performance is enabled by
the 32-bit ARM Cortex core at the heart
Cypress Semiconductor Corp. (NASDAQ: of the Gen4 products. The Gen4 family
CY) introduced its new Gen4 family of Tru- also provides the industrys best accuracy
eTouch touchscreen controllers. Gen4 and linearity of 0.2 mm while boasting the
is clainmed to deliver industry-best per- worlds lowest active power consumption
formance in all categories, including the of 2 mW, and a deep sleep mode that only
worlds best Signal-to-Noise Ratio (SNR) draws 1.8 W with wake-up via address
match on the COM port. Features and Specifications
Gen4 also offers more The ISL95835 includes two internal MOS-
capacitive sensing I/O FET drivers for a 3+1 solution and can be
than the competition, configured as a 3-, 2- or 1-phase VR
while still fitting into the The ISL95837 can be considered as an
worlds smallest touch- ISL95835 dedicated for a 1+1 application
screen packages. With with an output of 1-phase VR, maximizing
up to 40 I/O for mobile flexibility
phone applications, Gen4 Both devices operate in diode (or sleep)
can support up to four mode when a CPU enters light load modes
standalone CapSense for added efficiency and battery life
buttons while still deliv- Accept input voltages from 4.5V to 25V and
ering ideal sensor pitch deliver output voltages from 0.25V to 1.5V.
for up to 5-inch screens.
The Gen4 family also The controllers are based on Intersils
offers features that only Robust Ripple Regulator (R3) technology,
TrueTouch can deliver, a hybrid of fixed-frequency PWM control
including waterproof- and variable-frequency hysteretic control
ing functionality that that delivers the industrys fastest transient
allows products to meet response. The R3 modulator delivers faster
and unparalleled performance in the pres- IP-67 standards; 1-mm stylus support for transient settling time than typical modu-
ence of all noise sourcesthe biggest chal- Asian character sets and accurate handwrit- lators and automatically adapts switching
lenge faced by touchscreen designs. ing capture; and hover sensing to provide frequency to optimize light load efficiency.
The Gen4 family was designed from the mouseover-like features and true fingernail www.intersil.com/products/deviceinfo asp?pn=ISL95835
ground up to deliver the worlds high- or thick-glove support in mobile devices. www.intersil.com/products/deviceinfo.asp?pn=ISL95837
est SNR in real world applications. It is the touch.cypress.com (110675-XI) (110675-XII)
elektor 12-2011 9
Personal Download for I Elektor
52429
10 12-2011 elektor
Personal Download for I Elektor
52429
elektor 12-2011 11
Personal Download for I Elektor
52429
of 0.22 C over the temperature range of and processing time. The AS1130 LED driver Vector Fabrics Joins ARM
5 to 60 C, combined with very low power can also extend battery life by controlling
consumption an especially important an external power supply (e.g. charge Connected Community
consideration for battery-operated devices. pump) which is required when LEDs need a Vector Fabrics recently announced it is
The STS21 is pin and protocol compatible higher voltage than the battery can supply, now a member of the ARM Connected
with Sensirions standard SHT21 humidity allowing continuous operation even under Community, the industr ys largest
sensor, but it has a different I2C address. low battery voltage conditions. ecosystem of ARM technology-based
This allows the STS21 to be used as The AS1130 dot-matrix LED driver products and services. As part of the ARM
alternative to the SHT21 in applications is designed to make driving LEDs an Connected Community, Vector Fabrics
where temperature measurement is easier task, commented Rene Wutte, will gain access to a full range of resources
required and humidity measurement is austriamicrosystems Marketing Manager to help it market and deploy innovative
optional, since the same hardware can be for Lighting. It enables driving a large solutions that will enable developers to get
used with both sensors. number of RGB LEDs from one IC for creative their ARM Powered products to market
The STS21 temperature sensor is fully light designs while providing the highest faster.
calibrated, provides a digital output, and efficiency available, an important feature Mike Beunder, CEO at Vector Fabrics: Many
is very competitively priced. It therefore for both battery-powered and AC-powered of our customers have adopted multicore
fulfills the stringent requirements of many applications. The AS1130s features simplify ARM-based architectures and use our
applications in terms of both performance design and programming, optimize total vfEmbedded tool to optimize their software
and cost effectiveness. cost, and allow developers to provide the applications for it. Thats why vfEmbedded
www.sensirion.com/sts21-datasheet lighting features required to stay ahead in already provides support for the ARM
(110698-III) CortexTM-A series of multicore applications
processors, including the ARM NEONTM
technology. Were excited to be working
more closely with ARM to ensure our tools
integrate well with the ARM architecture.
132 LED driver features The vfEmbedded multicore development
tool allows developers to unlock the
industrys highest performance potential of the multicore
efficiency and smallest h i g h - p e r f o r m a n c e A R M C o r t e x- A
architectures. Optimizing software for
size multicore processors by hand is simply
austriamicrosystems has announced the too complex, is error prone, takes too
AS1130, the most advanced and smallest much time, and wont result in an optimal
dot-matrix LED driver (channels vs. PCB implementation. VfEmbedded thoroughly
space) available. The AS1130 drives 132 this market. analyzes the program code, predicts
LEDs but requires only 5 mm PCB space, In addition to the ultra-small sized CS-WLP-20, parallel performance and swiftly guides
reduces external component count, allows the AS1130 LED driver is also available in a gull the developer toward an optimal multicore
use of cheap connectors and requires fewer winged SSOP-28 package, allowing easier implementation that is free of errors.
PCB (printed circuit board) layers. Benefits handling in applications that are not so space
for end users include up to 80% longer sensitive. This makes the AS1130 a perfect
battery lifetime, more colorful effects and replacement for indoor high pixel density
smoother running animations. video walls, easily replacing up to eight
Using a 12x11 cross-plexed technique, 16-channel PWM LED drivers, or reducing
austriamicrosystems AS1130 LED driver is the complexity of externally (user designed)
targeted for dot-matrix displays in mobile multiplexed systems.
phones, toys, small LED displays in personal Only 12 lines are required to drive all
electronics, but also non-battery powered 132 LEDs. This is accomplished with
household goods, indoor public information austriamicrosystems multiplexing technique
displays, and industrial applications such called cross-plexing. It reduces line count on The ARM Connected Community is a
as power meters. The AS1130 drives the PCB as well as pins on the connectors, global network of companies aligned to
132 LEDs, each with an 8-bit dimming saving space & costs. Other features include provide a complete solution, from design
control and no external resistor required. control via a 1 MHz IC compatible interface, to manufacture and end use, for products
Additionally, an 8-bit analog current control open and shorted LED error detection, and based on the ARM architecture. ARM
allows fine tuning of each current source low-power shutdown current. offers a variety of resources to Community
to compensate for different brightness The AS1130 LED driver operates over a members, including promotional programs
of different colors, or to adjust the white temperature range of 40 to +85C and a and peer-networking opportunities that
balance on RGB LEDs. austriamicrosystems wide 2.7 to 5.5 V power supply range. enable a variety of ARM Partners to come
AS1130 incorporates 36 frames of memory www.austriamicrosystems.com/LED-driver/ together to provide end-to-end customer
for small animations or for use as a buffer to AS1130 solutions. Visitors to the ARM Connected
reduce host processor load, saving energy (110698-IV) Community have the ability to contact
12 12-2011 elektor
Personal Download for I Elektor
52429
,,
14 12-2011 elektor
Personal Download for I Elektor
52429
hot
Turn a
idea into a
cool
solution.
DesignSpark chipKIT Challenge
Visit www.chipkitchallenge.com
for complete rules and details.
* Participation in the Community Choice Awards does not increase your chances of winning
the Grand Prize with your Final Project(s) submission. See website for more information.
IN ASSOCIATION WITH:
Personal Download
chipKIT for trademark
is a registered I Elektor
of Microchip Technology Inc. Max32 is a registered trademark of Digilent, Inc.
52429
Android-tAblets
Android
as a Development Platform
Using low-cost
tablet PCs in
embedded applications
By Elbert Jan van Veldhuizen (The Netherlands)
Tablet computers (PCs) running the Android sions of 7 to 10 inches (18 to 25 cm) and Android devices, including a web server, an
operating system are now available for resolutions of 800 x 480 to 1024 x 600 pix- FTP server and a variety of e-mail applica-
under 100 pounds/euros. They are packed els. Most low-cost models have a resistive tions. These apps are able to run concur-
full of electronics and are visually attrac- touchscreen, which allows only one touch rently, including in the background. This
tive. Many functions that cost consider- at a time, but this is generally good enough makes it easy to use an Internet connection
able effort to implement in an embedded for our purposes. to view or download data remotely or to
environment are standard features in tablet control electronic devices remotely. Some
computers. In this article we examine the You might be thinking that tablets can tablets (typically the more expensive mod-
factors involved in using tablets in electron- only be used as a sort of dumb terminal, els) also have a 3G mobile telecommunica-
ics projects. but this is by no means true. Even the low- tion port. This allows them to be used in
cost models have an ARM11 processor with areas outside the range of a WiFi router, as
Hardware over 600 MIPS of computing power. This is long as mobile phone coverage is available.
What can you expect to find in a tablet com- more than 10 to 100 times faster than the Tablets have integrated non-volatile (flash)
puter priced below 100 pounds/euros? To microcontrollers we normally used in our memory, and most of them also have a
start with, a nicely finished enclosure. A tab- designs, and it means that tasks that need micro-SD slot for memory expansion. This
let is perfectly at home in you living room a lot of processing power can run without allows up to 32 GB of memory (with cur-
or mounted on the dashboard of your car. major problems on a tablet. Some exam- rent devices) to be added. A typical appli-
It can also be fitted on the front panel of an ples include computations that are nor- cation for this is data logging. This amount
enclosure to serve as a control panel with a mally executed by a DSP, such as Fourier of memory is sufficient to store a years
professional look, which is one of the major transforms and filtering. Android is not a worth of data at a data rate of 1000 sam-
potential uses. real time operating system, so a tablet can- ples per second. This memory can also be
A tablet has a backlit touchscreen display, not be used for real-time computations. used for the previously mentioned multime-
which make it an ideal platform for a user However, Android can handle near real dia applications.
interface, and in particular a graphic user time tasks with response times in the sec- Furthermore, most tablets have speak-
interface. The combination of a screen and onds range. ers (as well as an audio out connector), a
a touchpad allows you to create virtual Programming Android apps was described microphone and a webcam built in. Tablets
buttons (which can even be context sensi- in detail in this years June 2011 edition [1]. can provide a regulated 5 V supply voltage
tive) and entry fields, and you can present Android is a multitasking operating system, (from the USB port), taken from the inte-
elaborate menu structures. Tablets are which means that different applications for grated (or replaceable) rechargeable bat-
also suitable for multimedia applications, different purposes can run in parallel. tery. Although this is not the main reason
allowing you to display live imagery from Another important aspect of tablet com- for using a tablet in an electronics project,
a camera (with or without an IP interface) puters is Internet connectivity. All tablets its a handy bonus.
or play instruction videos. The displays of have a WiFi port for connecting to the Inter- Incidentally, tablets are not the only
the low-cost tablets have diagonal dimen- net. Various Internet apps are available for Android devices worth considering. Android
16 12-2011 elektor
Personal Download for I Elektor
52429
Android-tAblets
Figure 1. USB Micro B to Type A bus cable for use with a tablet operating in host mode.
smartphones are also available for under with a USB device port can also be con- sion 3 (for fancier tablets). One of Googles
150 pounds/euros. Although they have nected to this second port. Microchip pro- explicit goals is to allow Android devices to
smaller displays, they are equipped with 3G vides code that can communicate with an communicate with many different types of
functionality as standard. If 3G functional- Android unit configured as a USB device. accessories. The software class accessory
ity is more important than display size, an A number of development boards are also [4] has been developed specifically for this
Android smartphone is an excellent choice. available [3]. purpose. Although this functionality is
These smartphones also support Blue- implemented in Android versions 2.3.4 and
tooth wireless communication. The Ama- In addition to the hardware, you need the 3.1, there is no standard support for it in the
rino project [2] uses the Bluetooth inter- right driver software, which is not so easy. ROM. The USB port is configured as a host
face to link an Arduino board to an Android Android does not have any standard sup- with the new class, which allows simple USB
smartphone. port for USB devices other than those men- controllers to be connected to the port. This
tioned above. Although the most recent simplifies the connection of USB devices to
USB interface versions of Androids (2.3.4 and 3.1) have Android tablets. Support for this will prob-
Every tablet has a USB port, which appears enhanced capabilities, using them is not ably be provided in the standard ROM ver-
to be the logical way to connect the tablet straightforward. In order to install the right sion, eliminating the need for upgrades.
to external circuitry. In theory this is a sim- drivers, you must first install a modified ver- Android version 4 is expected to be avail-
ple task, but in practice it is full of pitfalls. sion of Android. This requires not only the able in late 2011. The system requirements
First of all, you need to realise that Android software (the ROM), but also root access for the new version exceed the capabilities
tablets have evolved from Android mobile permission in the tablet. Apps that can pro- of current low-cost tablets. It will probably
phones. The USB port of a mobile phone vide this access are available for low-cost take a while before low-cost tablets that
acts as a USB device (slave mode) and is tablets with a standard Android installa- support this version become available, since
intended to be used for purposes such as tion, but creating a new ROM is a task for the prices of processors with sufficient com-
connecting the phone to a PC, and the USB advanced users, and it is essential to have puting power are presently too high.
ports of Android tablets are also device all of the necessary drivers available. This
ports. This means that the connected cir- is a lot of work for a single project, but if a Architecture
cuitry must acts as a USB host (master particular tablet can be used in various pro- If you use a tablet in an electronics project,
mode), which generally requires a relatively jects, it may be worth considering. the place where you put the software that
complex USB controller. However, many provides the intelligence (either the tablet
tablets are able to switch the USB port to Fortunately, it appears that this problem or the external circuitry circuitry) is a signifi-
host mode (which requires a special conver- will be remedied in the future. Google, the cant architectural issue. The advantage of
sion cable) or have a second port that oper- maker of Android, is hard at work on ver- putting the intelligence in the tablet is that
ates in host mode. This port is intended to sion 4 of Android, named Ice Cream Sand- you can work in a well defined program-
be used for connecting a mouse, keyboard wich, which combines version 2 (for mobile ming environment with an API that provides
or memory stick. Simple USB controllers devices, including low-cost tablets) and ver- direct access to the various components of
elektor 12-2011 17
Personal Download for I Elektor
52429
Android-tAblets
applications and briefly describe the neces- A coffee machine control panel that sends
sary architectures: an e-mail to the maintenance department
when the coffee needs to be refilled or
Data logger with configuration set- a problem occurs. Here the tablet can
tings entered over the GUI. The data serve as the heart of the system, but I/O
Figure 2. The Android API is extensively can viewed in graphic form on the GUI circuitry is necessary for controlling and
documented. or on a web page. The raw data can be reading data from all of the components.
uploaded over the Web or via FTP. The A standard maintenance console. A tab-
hardware requirement for this is an ADC let is very suitable for use as an external
the tablet. The tablet also has high process- connected to the USB port. On the soft- console for troubleshooting, configu-
ing power and large memory capacity. How- ware side, three apps would be necessary: ration and maintenance. In its simplest
ever, real-time applications are not possible. a web server and an FTP server (both of form it can communicate with the target
The main reason for placing the intelligence which are available as standard apps), and system over the USB port, using a termi-
in the connected microcontroller is that the a user-written app for reading and storing nal emulator app on the tablet. This could
application requires real-time control of the the data plus a configuration settings be used to view start-up messages or dis-
circuitry and/or short response times. screen and graphic output. play the commands sent from the termi-
In practice a hybrid solution will usually be Telemetry from a (race) car, with live data nal. A more complex option is a console
the most appropriate choice, with the app displayed on the GUI and 3G link capabil- connected over a USB to JTAG converter.
that runs on the tablet handing the tasks ity for reading out data in real time and Thanks to its low cost, a console of this
closely related to the peripheral devices of storing it on a flash memory card. This sort could kept on hand at every cus-
the tablet, while the connected microcon- requires a USB to OBD2 interface and tomer site.
troller provides direct control of the I/O. software to handle the interface, config- Prototyping: the ease of writing apps
uration settings, and data readout and makes a tablet suitable for develop-
Applications storage. If the data only needs to be read ing prototypes and proof-of-concept
To give you an idea of the realm of possibili- out once per lap, a standard FTP server designs quickly and efficiently. Thanks
ties, here we outline a number of potential app would be sufficient. If real-time or to the large number of standard func-
near real-time readout is required, a new tions in Android and the wealth of avail-
app must be developed for this purpose able apps, considerable functionality
(perhaps based on a serial communica- can be deployed in a very short time.
tion app).
Home automation: controlling a solar
water heater and a central heating sys- Conclusion
tem with the aid of weather forecasts on Low-cost tablet computers can be effec-
the Web, with remote control via a web- tive, affordable and quickly implementable
site and a GUI on the tablet. This requires components of electronic projects. In addi-
the same configuration as the data log- tion to a visually attractive design, they
ger mentioned above. An additional have many readily accessible functions.
feature here is that decisions regarding At present it takes a good deal of effort to
how the solar water heater is used can use the tablets USB port for connection to
be taken based on information available external circuitry, but with the advent of
on the Web, such as the forecast hours Android version 4 in the coming year this
of sunshine and outdoor temperatures. will become easier. This will open the way
This requires writing a special app to for a host of new applications.
obtain this information, for example by (110667-i)
reading RSS feeds and extracting the
necessary data.
Digital oscilloscope with settings and Internet Links
waveform display on the GUI, and poten-
tially the ability to send oscillograms by [1] www.elektor.com/110265
e-mail. The configuration described for [2] www.amarino-toolkit.net
the data logger is necessary here as well. In [3] www.microchip.com/android
this case this case the majority of the intel-
Figure 3. Using a tablet in a home ligence must be located in the connected [4] http://developer.android.com/guide/
automation system. circuitry due to the required signal speeds. topics/usb/accessory.html
18 12-2011 elektor
Personal Download for I Elektor
52429
Free Stencil
Get a free SMD laser stencil
with every Prototype order
D
WOFIRRSLT!
All registered brands remain the registered trademarks of the respective manufacturer !
FITS-OR-NOT
3D PCBs: Hands-on
collision check
Assembly service
Even one component possible
Cool
Alu-Core IMS PCBs
www.pcb-pool.com
elektor 12-2011 19
Personal Download for I Elektor
52429
The design described here can be used with A special feature of this project is that an servo, which makes it usable for all
a still camera to cause it to take pictures at inexpensive Android tablet (as described types of still cameras. The author first tried
regular intervals. If you make a film from elsewhere in this edition is used to provide to access the shutter button leads of a com-
these pictures, the result is what is called a the GUI (graphic user interface) and enable pact digital camera in order to operate the
time-lapse film in which hours or even days operation over the Internet. This article is camera electronically, but the components
are reduced to a few seconds. A similar pro- handy for learning more about the basic are so small that it is virtually impossible to
ject for cameras with an external shutter building blocks for programming Android do this without destroying the camera.
release input was published in a previous tablets in embedded systems.
edition of Elektor. The product described As can be seen in Figure 1, the servo actu-
here operates the camera button mechani- Design and user interface ates a lever with a plunger that presses
cally using a servo of the sort used in RC This design is intended to operate a still the shutter button on the camera. Other
(remote controlled) models. camera mechanically with the aid of an RC mechanical arrangements for operating
R5 +5V
10k
R6
10k
SERVO
R3 T2
R4
47k
1M
AUDIO T1
C1 R1
47k BC547C
100n
R2 BC547C GND
10k
110690 - 11
Figure 1. A prototype put together with a Figure 2. This circuit boosts the audio output signal to 5 V TTL level. A small 5-V AC power
few Meccano parts. adapter provides an adequate source of power.
20 12-2011 elektor
Personal Download for I Elektor
52429
the shutter button with a servo are also sliders. The first position is with the camera
conceivable. at rest; the second position is for pressing
As described in the article on Android the shutter button halfway for focussing;
tablets elsewhere in this issue, it is pres- and the third position is for taking a pic-
ently not easy to use the USB port of an ture. Check to make sure that the slider set-
Android tablet. In practical terms, tings are right, since the position between
doing so would mean that for 0.5 ms and 2 ms varies. For some servos this
each different type of tablet, is outside the working range, and they may
different instructions and soft- be damaged if they are driven with corre-
ware would be necessary to sponding pulses for a prolonged time.
make the design described here
work properly. For this reason, The Phase button selects either positive or
the author decided to use the negative pulse output. Depending on the
audio output to drive the servo. tablet, it may be necessary to invert the
The position of a servo is deter- pulses (this doesnt matter for audio out-
mined by pulses having a width put). Finally, the Start button starts and
between 1 and 2 ms, or with stops a time-lapse sequence.
some servos between 0.5 and
1.75 ms. These pulses are repeated The application can also be operated over
every 20 ms. A pulse signal of this sort can the web. It listens to port 8090 at the IP
be generated directly using the tablets address of the tablet. Start by accessing the
audio output. The pulse amplitude at the tablet from your browser (on another com-
audio output is typically under 1 V, so this puter), for example by entering the address
signal needs to be converted to TTL level. http://192.168.1.101:8090/. The Figure 3. The GUI for camera operation
using the tablet.
This is done by the circuit shown in Fig- current status will be shown. New values
ure 2. Transistors T1 and T2 amplify the sig- can be entered in the form, and the time-
nal. As the zero level of the audio output sig- lapse sequence can be started and stopped
nal is not necessary the same as the circuit with the links. The logo on the web page (at
ground level (it may be floating), quasi-DC the top left) must be entered by the user by
coupling is provided by R1 and C1. None of placing a logo.jpg file in the /scard/
the component values here is critical. webserver_TL folder on the tablet. This
folder is created automatically when the
If no modifications to the software are nec- application is launched for the first time.
essary, the program can be installed by cop-
ying the file timeLapse.apk (in the binary GUI programming
folder of the zip file) to the tablet over the The basic aspects of programming Android
USB port or from a flash memory card. devices and the necessary resources were
Sending the file to the tablet as an e-mail described in the June 2011 edition. The
attachment doesnt work. The installation author also used Eclipse [1] and the Android
program included with the tablet must be Development Toolkit (ADT) [2] for this
used to install the program. Under Settings purpose.
/ Application settings / Unknown sources,
enable Allow installation of non-market The GUI can be designed in a fully graphic
applications. environment in Eclipse (see Figure 5). But- Figure 4. The accompanying web interface
on the computer monitor.
tons, entry fields, text fields and so on can
The circuit can be operated in two differ- be dragged from the toolbar to the virtual
ent ways: either via a GUI on the tablet (see tablet screen. This generates a file named
Figure 3) or via an external web interface main.xml containing descriptions of all tion with the buttons. To access a button,
(see Figure 4). On the GUI the number of of the elements, including their unique IDs. you have to link an object to the previously
pictures and the time between pictures (in mentioned ID as illustrated by the follow-
seconds, with a minimum value 3 s) can be The main routine is located in the Time- ing example:
best in the two text boxes. Three different LapseActivity.java file (created by
servo positions can be set with the three Eclipse) under the class TimeLapseAc- ToggleButton mtoggleButton1 =
tivity . This class provides the interac- (ToggleButton) findViewById(R.
elektor 12-2011 21
Personal Download for I Elektor
52429
Variables
loop_*
Static
variables
Server_TL
cmm_*
publishProgress
onProgress-
Update
110690 - 15
id.toggleButton1); crash). The functions publishProgress allows files to be viewed in the file system.
and onProgressUpdate are provided This is a simple solution, but it has the draw-
Buttons can be used in two ways: actively for this purpose. publishProgress is back that it is limited to viewing the system;
or passively. An objects functions can be used to call onProgressUpdate from it does not support operating the system.
used to read buttons and set values. This AsyncTask. Writing to the GUI is only It also requires frequent updating of the
is passive use. If a function of the class allowed from the latter function. As only HTML file, which in time will wear out the
should be actively invoked when a button this one function is available for driving all flash memory.
is pressed (or when the status changes), of the buttons, a specific action is defined
this is done with mtoggleButton1. in onProgressUpdate according to the At the other end of the spectrum there is
setOnClickListener(this). Only the value of the first passed-in parameter (see the option of using an extensive package
Start button is used actively in this program. the code in onProgressUpdate and the such as i-jetty [3]. This allows you to imple-
The time-lapse portion of the application pp_* variables). ment a versatile web server, but such an
is a procedure that runs for a very long The variables (loop_state, loop_count extensive range of functions (and the asso-
time. This is not possible in the main class and l o o p _ d e l a y ) are used for com- ciated complexity) is not always necessary.
(TimeLapseActivity) because this class munication to start or stop a time-lapse The author chose to use the open-source
is responsible for handling the GUI. If this sequence (communication in the opposite software android webserver [4] for this
class is busy, the GUI will not be refreshed, direction of publishProgress). Figure 6 purpose, by including the code in the appli-
with the result that the GUI will freeze solid. illustrates the communication between the cation and modifying it where necessary.
Furthermore, Android terminates a class of various classes. The most significant modification is that
this sort if it does not respond within 5 sec- The pulse waveform for the servo is stored the web server still reads files from the file
onds because it assumes that the program in an array, which is read out by the function system, which allows images such as logo.
has crashed. audioTrack. jpg (as used here) or CSS files to be used
This is why Android provides the class in the directory, with the exception of a
AsyncTask. It runs in a separate thread Web server file with a user-defined name (in this case
that is allowed to be constantly busy. This This project also uses the WiFi Internet link. index.html) that the program uses to
thread may be launched only once, for The status and settings can be viewed in a generate the web page on the fly. Because
which reason it is not launched every time web page, and the application can be oper- the web server runs in a separate thread
a time-lapse sequence is started but instead ated from this page. There are essentially and therefore does not have direct access
runs continuously, even if a time-lapse three options for making all of this possible. to the main routine TimeLapseActiv-
sequence is not being executed. The first option is to use a separate web ity, the settings and status data are trans-
Writing directly from AsyncTask to the server app, for which there are many free ferred using static variables (see the cmm_*
GUI elements is not allowed (it causes a downloadable versions available. This variables). A static variable can be regarded
22 12-2011 elektor
Personal Download for I Elektor
52429
as a fixed memory location. Unlike normal istry of MS Windows. These functions are Incidentally, there are rumours that this
variables, which require a new variable to elements of the SharedPreferences problem will be mitigated in Android ver-
be created for each object of a class, a static class. The parameter values are read when sion 4 and later.
variable is the same for all objects of a class, the program starts up and are saved when When an application is installed in Android,
and it can also be read and written from the program is stopped (by OnStop). These the user must give permission to grant the
another class. For this reason, static varia- settings are also retained when a new ver- application specific privileges for communi-
bles are called by their class name instead sion of the program is installed. cating with various hardware and software
of their object name. components of the tablet. For this program
Current versions of Android do not include this consists of access to the WiFi interface,
The application is checked by analysing the an application manager, so it is not possi- access to the flash memory card (for the
link. In the same manner as for HTML forms ble to see which applications are running web server files), and access for blocking
(in GET mode), the variables are placed after (regardless of whether they are running in the screen saver. These permissions must
a question mark in the URL (URI). In this the foreground or the background). This be placed in the TimeLapsemanifest.
case the URI index.html?act=start means that its easy to lose sight of your xml file in the form of uses-permis-
starts the TimeLapse process. The same application. If you then launch the appli- sions (take care to avoid the common
approach can be used to set the number cation again, you will end up with two typo user-permissions)
of pictures and the delay, for example with instances of the application running in par- Finally, you can dress up the program with
index.html?del=5. This is generated allel. This is especially problematical with your own icons. This requires placing three
automatically by the HTML FORM order. the application described in this article images in .png graphic format in the pro-
Static variables are also used to communi- because the web servers of both instances jects Res directory under drawable-hdpi,
cate these settings and orders. These vari- will listen to the same port, making the drawable-mdpi and drawable-ldpi with
ables are monitored in AsyncTask loop. results unpredictable. Three provisions sizes of 72x72, 48x48 and 36x36 pixels
Another way to do this would be to use a have been incorporated in the program in respectively.
handler for this communication, for which this connection. Firstly, the icon is displayed
there are two options: a general handler or on the status bar to make it easy to switch All files for this project can be downloaded
a handler that is specified when the object back to the application from the status bar. free of charge from
is created. However, that was not necessary Functions for this purpose are provided in www.elektor.com/110690.
in this case. the NotificationManager class. Sec- (110690)
ondly, the setting android:launchMode
Other functions = singleInstance is included in the Internet Links
Here we can make a few general comments TimeLapse manifest.xml file to indi-
regarding programming for Android. cate that a second instance of this program [1] http://eclipse.org/
It is user friendly to save the settings (pulse is not allowed to run in parallel. Addition- [2] http://developer.android.com/sdk/
widths, phase, number of pictures and ally, the tablet should not be allowed to eclipse-adt.html
delay) in the program so that they do not enter screensaver mode, since that makes
[3] http://code.google.com/p/i-jetty/
have to be entered again the next time the the application unstable for some unknown
program is launched. Android has specific reason. This is prevented by the setting [4] http://code.google.com/p/
functions for this, comparable to the reg- android:keepScreenOn = true. android-webserver/
Advertisement
www.eurocircuits.com
elektor 12-2011 23
Personal Download for I Elektor
52429
By Harry Baggen has been using a PCB Prototyper for a while. Avasto developed the entire system in-
(Elektor Netherlands Editorial) Avasto is a multifaceted facility services house and has already installed several sys-
contractor that is active in construction tems. The system is approved by the Dutch
work, automation of production pro- Keurmerkinstituut, which is responsible for
After Elektor presented the PCB Prototyper cesses, and the design and maintenance of assessing and certifying product safety.
in December 2010, it didnt take long for saunas, whirlpools and the like. Electronic Co-owner Swen van Vrouwerff is a dyed-
the first orders to come in. The manufac- controllers are used in various projects, in-the-wool technology buff who knows
turer (Colinbus) was already busy with the often based on PLCs. However, this has also absolutely everything about the projects
first production batch, and after a while the involved more and more in-house develop- underway in his company, including their
first units were delivered. The responses ment of electronic devices in the last while. mechanical, electrical and electronics
from users proved to be extremely positive. Their latest product is a slide safety device aspects. Nowadays the company is devel-
They hadnt expected to be able to buy such for swimming pools. This system provides oping more and more electronics devices
a precise, easy to use machine at a budget a signal at the top of the slide to indicate in-house. When the PCB Prototyper was
price after all, PCB milling machines are when the next swimmer can jump onto the presented in Elektor, he thought it would be
usually much more expensive than the slide. The swimmer can also press a button the perfect machine for his company, since
3,500 euro (ex VAT) price tag of the PCB to start a time measurement. After exiting it would allow them to make PCBs quickly
Prototyper. the slide, the swimmer presses a Finish for small product volumes. Although order-
button in the catch basin, and the elapsed ing small quantities of PCBs from a PCB
Here in the Elektor editorial office we were time is displayed on a scoreboard. In addi- manufacturer is also possible, this takes
wondering how this machine is used in tion to preventing blockage of the slide, this more time and is relatively expensive. Swen
practice, so we arranged a visit to Avasto in system introduces a competitive element is convinced that the investment will pay for
Oudewater (The Netherlands), a firm that that makes the slide more attractive. itself quickly.
1 2
24 12-2011 elektor
Personal Download for I Elektor
52429
3 4
Right now the PCB Prototyper is primarily top-quality PCBs. Producing a PCB with This is just one example of the many poten-
being used to produce PCBs for the slide roughly Eurocard dimensions takes around tial uses of the PCB Prototyper. Presently
safety system described above. All of the half an hour. The machine stops automati- Avasto produces mainly single-sided PCBs
circuitry for the system, distributed over cally when its time to change the drill bit or for leaded components, but if the company
nine PCBs, is housed in the robust enclo- milling cutter, so you dont have to be there wishes to switch to SMDs in the future, the
sure of the display unit. All of the PCBs are all the time and you can do other jobs in the PCB Prototyper can easily mill PCBs for them
made on the PCB Prototyper (photo 1). It meantime. Photo 3 shows the end result as well. Furthermore, a variety of extension
is controlled by a netbook located next to in this case a PCB for a display segment. The options for the PCB Prototyper to make it
the machine (photo 2). Its worth men- PCBs from the machine are assembled and even more versatile will be available in the
tioning that the user interface for the PCB then coated with a thick plastic film on the near future.
Prototyper and the structure of the entire copper side (photo 4) to protect the cop- (110694-I)
slide safety system were designed by two per against the effects of chlorine, which is
young employees with intermediate voca- abundantly present near swimming pools. Internet Links
tional school education. They told us that Photo 5 illustrates the quality of the milled
www.elektor.com/projects/
the PCB Prototyper is very easy to use. After tracks on the PCB. Finally, photo 6 shows
pcb-prototyper-(100619).1599728.lynkx
spending a day trying it out, they were able the enclosure of the slide safety system with
to use it properly and they managed to mill the fitted boards. www.avasto.nl
5 6
elektor 12-2011 25
Personal Download for I Elektor
52429
READERs PROJECTs
Robusta:
a Satellite Built by Students
Picosatellites to promote
space education
By Frederic Giamarchi (France)
France is well known for its significant participation in the European space
programme and for its front-line space industry, but perhaps rather less so
for the training of its elite in this field. This is why in 2006 the National Centre
for Space Studies (CNES) launched Expresso: the first call for
projects to higher education. Montpellier 2 University applied with
their Robusta project a cubesat picosatellite carrying a scientific
experiment of interest to the space community.
The
Robusta
(Radiation The Robusta satellite
On Bipolar This satellite has a real scientific mission: to measure the deteriora-
University
U Sat- tion of electronic components based on bipolar transistors caused
ellite Test Appli- by ionizing radiation. The components chosen for testing are LM139
cation, Figure 1)
cation voltage comparators and LM124 voltage amplifiers, frequently-used
satellite [1] is going components on satellites. This deterioration is quantified by meas-
to be launched by the uring currents, voltages, temperature, and dose received (Figure 2).
new European Vega rocket This dose corresponds to the absorbed radiation per unit of mass.
in late 2011. It will carry a scientific The results will then be compared with those obtained by a ground
experiment to measure deterioration in electronic components. It test method devised by the researchers at Montpellier Universitys
will be placed into an elliptical orbit between 340 km and 1,450 km IES laboratory (IES stands for Institut dlectronique du Sud, Southern
at an inclination of 71. Throughout the whole flight, it will trans- Electronics Institute) [3][4].
mit to the student ground station located on the campus of the The duration of the mission is fixed at two years. The data will be
University of Montpellier measurement data for the components measured at least every 12 hours. They will then be transmitted
being tested and the various status parameters. Subjected to the to the Montpellier campus ground station using an amateur radio
various sources of radiation, solar wind, particles trapped in the protocol and frequencies. Transmission will take place in broadcast
radiation belts, and cosmic rays, it will gradually fall back down mode, i.e. continuous every minute, whether or not the satellite is
towards the Earth and after two years will disintegrate on entering in a window of visibility for the ground station.
the atmosphere. A crucial point for the success of the mission is power manage-
Note. Readers Projects are reproduced based on information supplied by the author(s) only.
The use of Elektor style schematics and other illustrations in this article does not imply the project having passed Elektor Labs for replication to verify claimed operation.
26 12-2011 elektor
Personal Download for I Elektor
52429
READERs PROJECTs
Internal structure
The mechanical structure, the dimensions and positioning of the
electronics boards, and the aspects of the launch system via a
p-pod (Figure 3) are being taken care of by the GMP (Gnie Mcan-
ique et Productique, Mechanical & production Engineering) and GEII
(Gnie lectrique et Informatique Industrielle, Electrical & Industrial
Computing Engineering) sections of Nmes Polytechnic. The power
supply board and power management for the battery and solar cells
sub-system is also being dealt with by Nmes Polytechnics GEII sec-
tion. The controller board sub-system, which manages the com-
mands between boards and stores the measurement data, and the
microcontroller programming and test receiver elements are being Figure 1. CAD model of the Robusta satellite.
(source: RobustaCom)
operated by departments within PolytechMontpellier. The experi-
ment board sub-system, which includes the components under test
and the dose and temperature sensors, is being designed by EEA
(Electronics, Electrical Engineering, and Automation) degree and
Masters students in the Faculty of Science. The radio communica-
tion board and ground station sub-systems specifically are being
handled by Microwave students.
The components and materials used in this project are commercial
components that are not hardened, apart from certain ones like the
battery and solar cells. A rigorous radiation quality assurance pro-
cess has been operated to minimize the risks associated with their
exposure to radiation as far as possible. The project will be consid-
ered a success if it operates for more than a year.
Mechanical structure
The mechanical structure has been designed and machined out of
a solid block so as to form a single piece (Figure 4). The structure
is made from aluminium 6061, which has stable density in a space
environment. The various elements of the satellite, solar cells, PCBs,
screws, connectors, wires, etc. have all been designed and dimen-
sioned as the project has progressed. Its taken constant interac-
tion between the different teams for various the parts to keep the Figure 2. Example of modelling for calculating the dose absorbed
various measuring elements up to date with developments in the by a component in Robusta using the FASTRAD software.
various corrections validated. (source: RobustaCom)
Cubesat
Cubesat satellites are part of an educational programme put in board experiment, and a platform comprising the various electron-
place in 2000 by California Polytechnic University (CalPoly) [2], the ics boards allowing control of the experiment, communication with
aim of which is to offer students concrete experience and in-depth the Earth, and power management. The whole thing represents the
knowledge in relation to research and the aerospace industry. A simply a very small equivalent of a conventional larger satellite, sub-
cubesat is a satellite in the form of a 10 cm cube, weighing a maxi- ject to the same stresses, with thermal shocks, extreme vibration at
mum of 1 kg and having a maximum power of 1 W. It consists of blast-off, radiation, and the vacuum of space.
a useful load referred to as the payload, corresponding to the on-
elektor 12-2011 27
Personal Download for I Elektor
52429
READERs PROJECTs
Figure 3. 3D exploded model of a p-pod. (source: CubeSat Project) Figure 4. 3D exploded model of the satellite. (source: RobustaCom)
Power board thoroughly designed and tested. Each of the integrated circuits
The power board recharges the battery and distributes the different under test (LM124 and LM139) includes eight elements, for which
voltage rails needed for the various sub-systems. It also includes the currents, voltages, temperatures, and doses have to be measured.
system required for triggering deployment of the antennas once in So it was necessary to find an architecture based on analogue
orbit. The component ratings chosen allow a significant margin in switches driven by the microcontroller in order to multiplex the
terms of the power required. The battery charging system allows measurements made at the various pins of the devices (Figure 5).
for the temperature-dependent variation in the solar cell voltage, The students had to choose a bus that would allow managing the
as well as their deterioration over time. Three rails are provided: large number of addresses allocated to the switches, and in so doing
8 V for the amplifier used to transmit the data back to Earth, 6 V for learnt a lot about IC and SPI buses.
the logic circuits, and 5 V for the components under test. The six Apart from the power board, the other boards each have a
faces carrying solar cells will be subjected to the suns rays in a ran- PIC18F4680, an ADC interface and an anti-latchup system (protect-
dom order, depending on the rotation of the satellite. It has been ing the microcontrollers against short-circuits generated by ioniz-
decided to measure the voltage and current from these six faces in ing particles).
order to verify proper charging of the battery and implicitly meas-
ure the satellites rotation. An IC bus was chosen by the students
for dialoguing between the power board and the controller board. Controller board
The brains of the satellite: its function is to organize the tasks of the
other boards. It manages the dialogue with the other boards and
Experiment board it is responsible for managing the power available. For example, it
The electronic circuitry for the experiment board had to be very inhibits communication with the ground station while an experi-
Composants
Tests Interrupteurs Systme
de Antenne
2x LM124 mesure
2x LM139
Carte Carte
Bus SPI
Experience Communication
Dosimtrie Software P
Vers carte Support Electrique
O contrleur
Dosimtrie OSL R Bus CAN
T Carte Carte
MUX CAN Puissance Controleur
Temprature Bus I2C
Capteur de temprature 1
I/O Mmoire
Capteur de temprature 2
110493 - 11
Figure 5. Block diagram of the experiment board. Figure 6. Interconnection of the four boards
(source: RobustaCom) using IC interface and CAN bus.
28 12-2011 elektor
Personal Download for I Elektor
52429
READERs PROJECTs
100 % student
The Robusta satellite and dedicated ground station have been tions and making the project information accessible for the media.
entirely designed and produced by the students from the vari- The satellite has to be conceived, produced, and tested by the stu-
ous courses at the Montpellier 2 University: Nmes Polytechnic, dents, guided by educators who are experts in the field concerned,
PolytechMontpellier engineering college, and the EEA (electronics, and always under the control of the CNES. The students are also re-
electrical engineering, automation) degree and masters courses sponsible for the project management.
in the Faculty of Science. This project in partnership with the CNES This project represents real experience of an industrial nature, but on
is also being supported by major manufacturers in the electronics a scale that remains accessible to students by virtue of its duration,
sector. cost, and technical level. Robusta, as a system, makes it possible
Several major educational themes can be identified within this pro- for college students from 2nd year degree to PhD level to develop
ject: the system design and associated project management, the sophisticated engineering prototypes and to improve their sense
mechanical structure, the environmental tests, and the sub-systems of communication, while discovering the world of space. They are
involving several fields within the EEA: power management, payload, deeply committed right from defining the mission to exploiting the
controller board, radio communication board, and the associated measurement data, through all the phases of design, component
ground station. And lastly, there is an element involving communica- sourcing, production of prototypes, and testing.
ment is in progress, as these two actions are too power-hungry. direct consultation with the ground station sub-system students,
In the course of the inter-sub-system meetings, it was decided to in accordance with the link budget. In addition to learning a great
use a CAN bus for the communication between the various sub- deal about the problems specific to using radio frequencies, they
systems (Figure 6). But as part of the prototype design process, were also called up to implement signal processing processes when
the students have been able to develop their own data exchange choosing the type of modulation and demodulation. And simula-
protocol. As there are such a large number of messages to be sent tion has not been overlooked, particularly for the satellite antennas,
to the other boards, a Petri net has been used to avoid jams and which were fully simulated using CST Microwave Studio, a special
losing messages, and to correctly handle the imposed restrictions. professional microwave application.
Expresso
The Toulouse Space Centre (CST) which comes under the CNES offers at minimal cost. To support the project, the CNES is offering financial
students an opportunity to gain concrete experience in the field of resources and is making available a project co-ordinator and experts
orbital systems. This is also the occasion to test out new technolo- from the CST for the thermal analysis, the solar cells, vibration test-
gies and to perform scientific experiments for the space community ing, frequency use permissions, etc.
elektor 12-2011 29
Personal Download for I Elektor
52429
READERs PROJECTs
The Robusta ground sta- others during the Vega rockets (Figure 8) qualification flight.
tion (Figure 7) is con- The Vega project should make it possible to put small satellites
structed around ama- between 300 and 2,000 kg into low or polar orbits. This will be a
teur radio hardware. first for this launch vehicle which will blast off from the Kourou space
The central element base in French Guiana in late 2011.
in its architecture is a In all, nine cubesats will be released from the launcher at the same
transceiver that allows time as the main payload, a scientific satellite called LARES System
modulation/demodula- along with the educational mini-satellite ALMASat.
Figure 7. The Robusta ground station. tion of AFSK signals, in (110493)
(source: RobustaCom) the 430 MHz band for
the telemetry and in
the 144 MHz band for
the remote commands.
Two motorized anten-
nas establish the link
with the satellite. A PC
manages the motori-
zation of these anten-
nas, as well as sending
the remote commands
and the reception of
the telemetry. All this
ground station soft-
ware has either been
developed internally or
comes from the world
of open source start-
ing with the Ubuntu
operating system on the
ground station PC. This
means we can adapt the Internet Links & References
software to our specific [1] Project Robusta: www.ies.univ-montp2.fr/robusta/
needs and upgrade it
[2] Cubesat by California Polytechnic State University:
over time with no par-
http://polysat.calpoly.edu/
ticular restrictions.
[3] J. Boch, Estimation of Low Dose Rate Degradation on Bipolar Lin-
ear Integrated Circuits Using Switching Experiments, IEEE Trans.
The Vega launch Nuclear Science, vol. 52, pp. 26262621, December 2005.
vehicle [4] J. R. Vaille, F. Ravotti, P. Garcia, M. Glaser, S. Matias, K. Idri, J. Boch,
Following a call for
E. Lorfevre, P. J. McNulty, F. Saigne, L. Dusseau, Online dosimetry
applications, the
based on optically stimulated luminescence materials
Robusta satellite was
chosen to be put into IEEE Trans. on Nuclear Science, vol. 52, Issue 6, December 2005
Figure 8. The Vega rocket.
(source: ESA) orbit along with eight pp. 25782582.
30 12-2011 elektor
Personal Download for I Elektor
52429
Highlights:
Databases for Transistors, FETs,
Triacs, Thyristors, Diodes and ICs
NE555 circuit design om
An Ohms Law calculator Now available fr
Store
Schematic Diagrams the Apple iTunes
4. !
99
Number base converter for just $5.99 /
LED / resistor calculation
R/L and BJT calculations
And more
Further information at
www.elektor.com/app
20
Burkhard Kainka
Lars Gollub Products
310 Circuits Experiments with to choose
Digital Electronics from!
h Di it l Electronics
Burkhard Kainka
ons
creative solutironic
CD-ROMM
& Lars Gollub
CD-RO
s
for all areas of elect THE
POWER SUPPLY
20.05.2009 13:36:40
Uhr
12:50:58 Uhr
COLLECTION
1
23.09.2010
on
for home constructin
supply designs
More than 75 power chaltunge
orgungs-Selbstbaus soi-mme
Mehr als 75 Stromvers
Ir. Menno van der Veen
raliser
dalimentation voor zelfbouw
Plus de 75 projets chakelingen
Meer dan 75 voedingss
High-end
Valve Amplifiers 2
ations
New models and applic
Discounts up to 58%
Offer valid until 1 January 2012
h
d V lve Amplifiers 2
elektor 12-2011 31
Personal Download for I Elektor
52429
EmbEddEd Linux
From the hardware perspective, the XPort software for anything you may dream up. lowed by /mnt/iso/install.sh to launch the
Pro module [1] is a Freescale MCF5483 Cold- However, its a good idea to bear in mind installation script.
fire microcontroller. It operates at 166 MHz, that no SDK is entirely foolproof (dont say If your Linux distribution is based on Debian
has a built-in Ethernet interface and an we didnt warn you!). Usually there are a lot or Red Hat, things should be very easy from
encryption accelerator, is equipped with of settings that need to be dealt with, espe- this point onward. Otherwise, such as in
8 MB of RAM and 16 MB of flash memory, cially when youre just getting started. If the authors case, you must first copy the
and is housed in an RJ45 enclosure measur- all this is making you feel a bit nervous, we entire CD to a new folder of your choice.
ing 3.3 1.6 1.4 mm. It has five I/O pins, hope that the pointers below will put your This is because you need to modify the
with two of them reserved for TxD and RxD, mind at ease (more or less). script file install.sh, and no matter how
while the other three can be used for RTS, hard you try, you cant modify a file on a CD.
CTS and DTR on the serial port or for gen- SDK installation Install.sh calls another script named scripts/
eral-purpose I/O under the monikers CP1, The Lantronix SDK only runs under Linux. host_depend.sh, which installs the software
CP2 and CP3. All of this runs under Linux, or However, its possible to run Linux on a Win- required for the SDK. However, this doesnt
more precisely, under uCLinux (pronounced dows machine in a virtual PC environment. work with distributions that use the RPM
you see Linux). This is a good solution, not only for devoted or DPKG package manager, so you have
Windows users but also for everyone who is to comment out the lines in install.sh that
You dont need to make a PCB in order to willing to sacrifice a bit of performance for call host_depend.sh by placing a number
get acquainted with the XPort Pro module easier installation. The downloads for this sign (#) at the start of each of these lines.
you can use a demo board from Lantro- are available at [2], although you may find In SDK version 2.0.0.0, these are lines 167
nix (Photo 1) or the XPort (Pro) to bread- a bit of explanation necessary. to 171 (inclusive). All of these lines must
board interface described in our Embed- be commented out with a number sign at
ded Guide 2010 supplement, which was If you prefer not to take the virtual machine the start. Now you can run the installation.
included in last years December issue. approach, you will have to install the SDK If you choose this method, you will have to
If youre totally new to installing and con- yourself. There are two options here: you install all of the software necessary for the
figuring a Linux SDK, you may quickly find can burn the ISO image of the SDK on a CD, SDK yourself, guided by the error messages
yourself wondering where to turn next, so or you can mount the image (to use the displayed during the installation process.
we should first explain what a Linux SDK is. Linux jargon). The author chose the second After completing the installation, you can
Usually its a collection of source code files, option. unmount the image with umount /mnt/iso.
including the Linux core, a C library, applica- Start by creating a directory to hold the
tions and so on, along with a set of rules for image, for example with the mkdir /mnt/ Elektor patch
putting everything together which take iso command (note that this requires you to Once the SDK is installed, you can add the
the form of what is called a make file. There be the root user). Now you can mount the demo applications for this article. They are
are several other essential ingredients, such image with the command mount o loop / intended to form part of the image, and
as the compiler chain, a utility for creating path/to/iso/image /mnt/iso. Next, create a they should be located in /home/elektor.
images, and so on. After all this hotchpotch directory for installing the SDK, for example Start by downloading the zip file from the
has been installed and configured properly, by typing mkdir ~/xportsdk. Then type Elektor website [3]. Extract it in the folder
its very easy to use it to develop all sorts of cd ~/xportsdk to go to this directory, fol- of your choice (such as /tmp). This creates
32 12-2011 elektor
Personal Download for I Elektor
52429
EmbEddEd Linux
elektor 12-2011 33
Personal Download for I Elektor
52429
EmbEddEd Linux
A touch of Internet
Making a pair of LEDs flash is good fun, but
its not really world news. We have a built-
in network link in the XPort, and it would be
a sin and a shame to not use it, so we need
some sort of Web application. Lets do it!
For this purpose we use Boa, a lightweight
web server included with the SDK. It has to
be provided with a configuration file named
Figure 2. Screenshot of the web application that controls the GPIO ports. boa.conf. The syntax rules for this file can be
34 12-2011 elektor
Personal Download for I Elektor
52429
EmbEddEd Linux
elektor 12-2011 35
Personal Download for I Elektor
52429
EmbEddEd Linux
36 12-2011 elektor
Personal Download for I Elektor
Elektor Academy Webinars in partnership
52429
with element14
Elektor Academy and element14 have teamed up to bring you a series of exclusive webinars covering blockbuster
projects from recent editions of Elektor magazine. Participation in these webinars is COMPLETELY FREE!
All you need to do is register at www.elektor.com/webinars.
Webinar programme:
Lets Build a Chaos Generator
Date: Thursday December 15, 2011
Time: 15:00 GMT (16:00 CET)
Presenters: Maarten Ambaum and R. Giles Harrison (Reading University) FREE PARTICIPATION
Join us in this webinar to look at the making of the Chaos Generator project published Register now!
in the September and October 2011 editions of Elektor. Get out your opamps, wipe your
monitor and glasses and turn up the volume loud!
Microcontrollers
One of the pleasing things about electron- MCP3551 ADC from Microchip for use in
ics is the way you can get inspiration from his circuit in order to obtain the high pre-
other projects. In this case it was the reader cision required to detect minute tempera-
project Temperature Gradient Meter from ture changes. This device converts voltages
last months issue [1]. Author Dr Diet- to digital values with 22 bits of precision.
mar Schrder selected an external type Figure 1 shows the tiny circuit built around
Figure 2. Printed circuit board designed
by Dietmar Schrder. X100 and X101 are
+5V connected to K4 on the experimental node.
R101 R100
+2V5 3mA2
390R 390R
V100
R102
C100
2k2
C102
47u
TL431 100n
+2V39
R103
C103 8 PC5
27k
VDD 5V
1 6
220n VREF SDO/RDY PC4
49uA
IC100 GND
NTC X102 C104 2
IN+
MCP3551
- 3
IN- SCK
5
22k 100n max. 5MHz
CS GND
7 4
110610 - 11
Figure 1. Circuit diagram of the high-resolution temperature sensor, with connection to Figure 3. Display of ADC values and
our experimental node. temperature readings in the ElektorBus
browser.
38 12-2011 elektor
Personal Download for I Elektor
52429
Microcontrollers
elektor 12-2011 39
Personal Download for I Elektor
52429
Microcontrollers
function ProcessPart(part)
{
if (SetFlag==true)
{
if ((part.Sender == 2) && (part.Parttype == PARTTYPE_SCALE) && (part.Channel == 0))
{
if (QuantityToSet==TEMPERATURE) {TextSetvalue(unit,C);};
if (QuantityToSet==RAWVALUE) {TextSetvalue(unit,ADC-Value);};
DisplayScale = ScaleToSet;
SetFlag = false;
}
else
{
var parts = InitParts();
parts = SetScale(parts, 10, 2, 0, 0, QuantityToSet, 0, ScaleToSet);
SendParts(parts, true);
}
}
fied. The command bytes to set a sensor var parts = InitParts(); However, I discovered in testing that clicks
to report values in ten-thousandths of a parts = SetScale(parts, 10, 2, did not always have the desired effect. Now
degree using channel 0 are (in decimal) 40, 0, 0, TEMPERATURE, 0, -4); the OutCommand text box in the Elektor-
193, 33 and 4. SendParts(parts, true); Bus browser showed that the message data
bytes were being generated correctly, and
The JSBus Javascript library lets us avoid the Reliable transmission so it was probably a problem with the node
need to calculate these bytes by hand. The I arranged for the above lines of code to be firmware. My hunch was that that the mes-
commands shown below can be included called when the corresponding button on sage was not being correctly received by the
within the HTML page, and they will gener- the HTML form is clicked on, exactly as in sensor in the case where it was busy deal-
ate the appropriate part and send it. the previous instalment of this series [6]. ing with the external ADC. I noticed that
40 12-2011 elektor
Personal Download for I Elektor
52429
Microcontrollers
the transfer of commands was reliable if the rogates the nodes one after another. The
variable intFreeBusTime in the ElektorBus second is the routine ShowMessage, which Setting the interval
browser was reduced: strictly speaking in
this application we do not need any Free-
is executed in parallel when a sixteen-byte
message arrives: if this message comes
between readings
BusPhase at all, although we might imple- from the interrogated node then the next In principle a single sensor could be re-
ment the ability to control this from within node in sequence can be processed. And the motely controlled over the ElektorBus
Javascript code at a later date. Unfortu- third adds a timer to the mix: if a bus partici- without using the scheduler. We simply
nately, in the absence of a bus monitor or pant is not heard from for a certain period, tell the device how often to report a new
firmware debugging facilities I was unable the next node is processed anyway. reading, just as we would in a data log-
to track down the source of this bug. How- ger application.
ever, it does give us an opportunity to see I finally realised that I had made a schoolboy
how this kind of problem can be worked error. To indicate which node comes next in
around. sequence I had allowed all routines direct BIT BYTE
7 6 5 4 3 2 1 0
access to the global variable intPolledNo-
SET C2 C1 C0
Listing 2 shows a solution. The buttons desCursor, which points to the next node 0 0 1 0 1 C H AN N EL ADDRESS
for changing the unit setting call a Javas- in the scheduling list. If, however, this vari- 1 1 1 0 0 0 0 0 COMMAND
cript routine called SetSensorScaleIndi- able is changed externally while the sched- 0 I NT E RVA L VA L UE FIRST
rect(), which simply sets a flag rather than uler loop is at work, the above subtle prob-
0 I NT E RVA L S CA L E SECOND
directly sending the required command. lem can be triggered. I modified the code so
The master repeatedly sends this command that instead a flag boolNextNode was used 110610 - 13
as long as the flag is set. The code to imple- to indicate when the scheduler should move
ment this can be integrated into the routine on to the next node. The flag is inspected
The figure shows the four-byte applica-
ProcessPart(part), which is periodically only at the start of the scheduler loop and
tion protocol command. The interval
called by the JSBus library whenever a read- otherwise does not affect the flow of the
ing arrives. code. Success! The system was running value is encoded in seven bits. The cod-
reliably, and fortunately there was time to ing is as follows.
The flag is cleared when an acknowledge- upload the corrected files to our website to
ment is received from the node. (The accompany the previous instalment of this Hex Dec Interval
BASCOM firmware packs the four bytes series. The improved ElektorBus browser
04 4 1 s
required along with the reading in the reg- can also be downloaded at [5], in the form
ularly-transmitted message.) Only then is of VB.NET source code and as a .EXE file. 05 5 10 s
the display of the selected unit updated 06 6 100 s
on the HTML page. To display the decimal Some more ideas 07 7 1 ms
point properly in values shown in the text I would have liked to implement further
08 8 10 ms
box we call the function TextboxSetval- features, such as a display of temperature
ueScaled(), which is implemented in the gradient including a filter with adjusta- 09 9 100 ms
new version of JSBus [5]. The download- ble parameters. That would have made a 0A 10 1s
able HTML file also now includes a little complete replacement for the processor 0B 11 10 s
CSS [7] to make the user interface some- board, display and potentiometers of Diet- 0C 12 100 s
what prettier. mar Schrders original project. However,
10 16 1 minute
time caught up with me, and time will be
A touch of optimisation even more limited in future after a slight 11 17 10 minutes
Further testing showed that after a few min- problem with my USB-to-RS485 converter 12 18 100 minutes
utes the display would lock up. Firing up the (see elsewhere in this edition). Interested 18 24 1 hour
oscilloscope it transpired that bits were still readers should be able to implement vari-
19 25 10 hours
zipping about on the bus, at least until I ous extensions to this project without too
stopped the scheduler. Next I arranged to much difficulty, given a little expertise in C 20 32 1 day
display all the bus bytes in a separate text programming, the source code of the tem- 21 33 10 days
box, which showed that the only messages perature gradient meter, and the Bus tools 22 34 100 days
being sent were FreeBusMessages from we have previously described.
28 40 1 month
the scheduler. It was not easy to track down
the reason for this, as the scheduler is based Incidentally, the ElektorBus is also capable 30 48 1 year
on three processes running in parallel. The of receiving messages from nodes. In prin- 31 49 10 years
first is the scheduler loop itself, which inter- ciple it would only be possible to have two
elektor 12-2011 41
Personal Download for I Elektor
52429
Microcontrollers
[1] www.elektor.com/110151
nodes talking to one another under such a next instalment we will look at the prom-
scheme, but RS485 in combination with our ised connection to an Android smartphone. [2] www.elektor.com/110258
protocols nevertheless form a good basis for (110610) [3] http://ww1.microchip.com/downloads/
the remote control of sensor equipment. en/DeviceDoc/21950e.pdf
With the sensor no longer being regularly
interrogated by the scheduler it needs to What do you think? [4] www.elektor.com/110428
be possible to instruct it to emit readings at Feel free to write to us with your [5] www.elektor.com/110610
specified intervals. The text box shows how opinions, ideas and applications. [6] www.elektor.com/110517
such an interval command can be encoded
using the application protocol. [7] http://en.wikipedia.org/wiki/
There is plenty more in the pipeline: in the Cascading_Style_Sheets
42 12-2011 elektor
Personal Download for I Elektor
52429
Work in progress
The Elektor Labs generally remain a closed fortress, with access to Elektor House limited to those who happen visit the castle
during one of the annual Dutch Open Monument Days. Whatever happens in the lab usually remains behind closed doors. That,
of course, does not mean that there is nothing interesting going on. So heres a first, small peep show of two projects that are
being worked on in the lab at the moment. First the new LCR Meter. Designer Raymond Vermeulen and colleague Jan Visser are
busy with building the prototype...
The second photo series shows the efforts of Head of Design Chris Vossen working on his version of a 3D printer. The publication
date remains a secret for now, but for more information about this exciting project and the latest state of affairs you can take a
look at www.techthefuture.com/3D-printer.
E-LABs INSIDE
(110527)
elektor 12-2011 43
Personal Download for I Elektor
52429
LED Exorcism
Ghostly
goings-on (2)
By Dr. Thomas Scherer (Germany)
& Elektor readers
R1
up with the step changes in the LEDs characteristics. The dashed 1k
line indicates where it failed in this task! BT1
Mr Bredow assured us that this was the only time ever he had
been guilty of deliberately causing the demise of an innocent LED1 C1
12V
component 10u
44 12-2011 elektor
Personal Download for I Elektor
52429
For this to have any chance of working the LED must still be operation. At high temperature the adhesive starts to give off gas,
partly working i.e. flashing but not completely dead. ;-) generating voids in the interface between the die and lead frame.
This damage degrades the thermal path and reduces the LEDs
Gwyn Evans in Munich got in touch via his smartphone: power handling abilities further, leading to more localised adhesive
Obviously the reason for your observations is that the 9VDC isnt gassing and more voids. As die temperature increases the emitted
quite DC, its half rectified AC and what you are observing is a light wavelength shifts, becoming longer.
localized breakdown in the space-time continuum, resulting in a Eventually there is very little contact area remaining and the LED
50 times or so reduction in perceive time. This is nothing to worry mould material becomes locally heated so that expansion of the
about, and due to the induced effect resulting from Lorentz Con- materials exerts pressure on the die and interrupts the current flow.
traction your flat will appear bigger too. With no current flowing the die temperature falls and contraction
Alternatively the result is probably due to a heating effect. As an pulls it back to its original position, re-establishing contact. The die
LED ages it can become more sensitive to ambient temperature. The now heats up again and the process repeats...
LEDs temperature rises causing the LED to fail. The LED then cools The thermal time constant of this oscillation is in the range 0.1 to
allowing it to recover and start working again. 10s, depending on current and power dissipated. This flashing mech-
Right, OK, glad we got that one sorted out then Gwyn went on: anism is effectively the same as the old mechanical bi-metal relays.
It is possible to extend the life of an LED by pulsing it; usually 1kHz Incidentally of all the ways an LED can be destroyed this mechanism
is sufficient. is not particularly probable. For it to occur it must be assumed that
Im wondering now if I should suggest to the utility companies the diode junction is not damaged and also that the bond wire is still
that they derive the powerline frequency directly from the out- intact. More often than not the die bond adhesive just becomes irre-
put of wind turbines versibly damaged and the LED simply goes open-circuit.
Seems logical?
Hubert Maiwald from Neutraubling, Germany:
The majority of LEDs consist of a single die cemented to the lead frame So, dear reader, did any of that sound like a plausible explana-
with silver-loaded conductive adhesive forming one electrical connec- tion? The consensus suggests a link to thermal effects but that
tion and a wire bond forming the other contact on top of the die. is the fascination with electronics there are always puzzles to
This adhesive is the weak point; it can be damaged by excessive solder solve, sometimes in the most unexpected places.
temperature during installation or dissipation of too much power in (110668)
Pins to length
By Thijs Beckers (Elektor Netherlands Editor) display is mounted closer to the PCB, so that, for example, the
In a previous E-LABs Inside instalment we already mentioned entire assembly is more compact when building into an enclo-
placing a piece of experimenters board between an LCD and sure. When there are sockets on the PCB for connecting the dis-
a (mother)board, with the objective of making the display eas- play, then the only option for fitting the display closer to the PCB
ier to remove and without damaging it. This was targeted spe- is to shorten all the pins. It is then desirable that all the pins have
cifically at the more fragile displays, such as the DOGM-series the same length. And here is where our experimenters board
made by Electronic Assemblies. Now there is even a second trick comes in handy again: insert the pins of the display as far as they
for this experimenters board. go into the board and cut off the part that sticks through. The
The DOGM displays mentioned above stand quite tall on their length of the pin that remains is then perfect for plugging into
legs (have quite long connecting pins). This length is neces- a header. And all the pins have exactly the same length, so that
sary when they will be provided with a backlight that and the the display cannot not rock in its socket.
name gives it away already is fitted behind the display. But Do you have any handy tips for us?
when this backlight is omitted, it is often much better that the Mail them to editor@elektor.com.
(110664)
elektor 12-2011 45
Personal Download for I Elektor
52429
Smelly bus
By Thijs Beckers
(Elektor Netherlands Editor)
While quietly working on the article
about the use of cheap tablets in embed- In short, the next day we immedi-
ded electronics (see elsewhere in this ately checked whether the remaining
edition) I suddenly noticed that typical stock (and therefore also the boards
smell of burnt electronics. Following my already supplied) were built correctly
nose (and as a member of the First Aid or whether we had a big problem.
team Im of course more or less obliged to act on the smell of What emerged: We could breathe a sigh of relief, because the
fire), I arrived in the adjoining room with the German editorial boards we pulled out of stock were built correctly. What we
staff, where colleague Jens Nickel was working on the Elektor noticed though, is that different components were used on
Bus project. Was, because it appeared that the tantalum elec- the boards we have in stock. And then it dawned on us... The
trolytic capacitor on the USB/RS485 converter, which is part of modules that Jens was using were early prototypes built in the
the Elektor Bus system [1], had given up (see photo). Jens was lab, hence the different components compared to the produc-
E-LABs INSIDE
already back in the lab with the faulty board, but an odour like tion version. Probably whoever assembled them didnt realise
that of burnt bakelite was still in the air. that with tantalum capacitors the + is marked (with electrolytic
We were of course not at all happy with this. What if this could capacitors the is usually marked).
happen to all the boards that have already been sold? Was this
a manufacturing fault or are the tantalum capacitors mounted So this fortunately ended in a fizzle (well, more like smoker).
the wrong way around? Do we have to recall all those boards So here you have one example of all the kinds of things you
out there? Is this our fault or that of the assembler? Who will go can come across during the development of a project. It is cer-
ballistic? Who will foot the bill? tainly not likely to be boring! What surprised us quite a bit how-
Checking the stock that was still in the warehouse should give ever, is how long this tantalum capacitor was able to hang on
a definitive answer. It was already towards the end of the after- while being reverse polarised. There was nothing unusual to be
noon, so this would have to wait till tomorrow, because our ware- noticed about the functionality of the circuit.
house is in an industrial area about 6 miles from Elektor House. (110693-I)
46 12-2011 elektor
Personal Download for I Elektor
Subscribe to audioXpress magazine!
52429
Subscribe to audioXpress at
www.cc-webshop.com
today!
How secure is the remote control of your car or other valuable vehicle? This project shows you
how to use a couple of ordinary microcontrollers together with a transmitter and a receiver
to implement an IR remote control system that uses a secure code with 128-bit AES encryption and
bidirectional IR data communication.
Were all familiar with remotely controlled The encryption algorithm implements of both in and out by eavesdropping, they
door lock systems in cars. The remote con- the function out = f(in, key). The inverse will not be able to derive the key by using
trol transmits a code, and if the receiver of function in = finv(out, key) also exists, but a function fkey. The only way to determine
the lock system recognises the right code, it the function key = fkey(in, out) does not the key is to use what is called a brute force
unlocks the doors. A drawback of systems of exist. attack, which consists of trying all possi-
this sort is that people with malicious inten- For each value of in there is a unique ble keys in the encryption function f. This
tions who eavesdrop on the code transmis- value of out. In other words, there are requires spending so much time search-
sion can effectively pick the lock, since they not multiple values of in that generate ing for the key that trying all possible val-
can transmit the code at any desired time to the same value of out. ues takes too long. Powerful computers
unlock the car. This also applies to the key: two different can try all possible values of a 64-bit key in
keys produce two unique encrypted out approximately one day. With a 128-bit key,
A much more secure method is the chal- values. this would take more the lifetime of the uni-
lenge-response handshake authentication verse, which is long enough to be secure.
protocol, which is used for many forms The first condition ensures that if persons We chose the AES protocol for the encryp-
of Internet banking. With this approach with malicious intentions learn the values tion algorithm. This encryption algorithm
the lock transmits a specific code and the
remote control must perform a defined
computation using this code. The result is 1V8...5V
then send back to the lock. The lock remains
locked unless the right computation has
been performed.
100n
Eavesdropping on the communication
between the lock and the remote control is 14
VDD Lock
useless in this situation, because the next 17 16
RA0 RA7
time the lock will send a different code for 18
RA1
the computation. As long as anyone with 1
RA2
IC1
2 8
malicious intentions does not know the 4
RA3 RB2 330R IR
RA5
computation, the lock cannot be picked. 3
RA4 330R
Here its important to choose a good com- 6
RB0
putation method. Encryption is very suit- 9
RB3 RA6
15
330R
10
able for this. Encryption uses a key to con- RB4
PIC16(L)F1827
vert data into new data, which is exactly the 11 12 J1
IC2 RB5 RB6
type of computation that we need for the 18-Pin PDIP
7 13 J2
remote control system. RB1 RB7
S1 VSS
48 12-2011 elektor
Personal Download for I Elektor
52429
is used in devices such as WiFi routers to are used extensively. The circuit
prevent eavesdropping on data traffic and The new PIC16F1827 enhanced microcon- Aside from the microcontrollers, only a few
breaking into the network. This algorithm troller from Microchip is a device that ful- components are needed to implement prac-
has not been cracked up to now. In other fils these requirements. It has 4096 words tical circuits (transmitter and receiver) that
words, nobody has found a function fkey or of code memory and 396 bytes of RAM. It utilise this encryption method. Figure 1
some other way to determine the right key can also run at up to 32 MHz using its inter- shows the circuit diagram of the base sta-
with fewer attempts. nal clock, and the microcontroller has a tion (the lock), while Figure 2 shows the
The AES algorithm needs a lot of resources new instruction set called enhanced mid circuit diagram of the remote control. They
compared to what is customary in the range that makes working with arrays a communicate using infrared LEDs, in the
microcontroller realm. Over 240 bytes of good deal easier. Although the RAM is split same was as remote controls for television
RAM are necessary for the computations, into individual blocks of 80 bytes each, the sets. LED D1 is used for transmission, while
the code consists of approximately 1500 enhanced instruction set allows these indi- IC2 (a standard IR module from Sharp with
instructions, and execution of the compu- vidual blocks to be viewed as a single large an operating frequency of 36 kHZ) is used
tation takes approximately 30,000 instruc- block (linear mode), which facilitates access for reception. The switches for operating
tion cycles. Furthermore, tables and arrays to tables. the devices and configuring the parameters
are connected directly to the I/O ports. The
weak pull-up capability of the microcon-
troller make resistors unnecessary here. A
keypad for entering a PIN code can also be
1 2 3 BT1
connected to the remote control. A matrix
keypad should be used for this purpose.
100n 3V The remote control operates directly from
4 5 6 two AAA batteries, but a lithium button cell
14
VDD
BZ can also be used. The base station can be
17
RA0 RA7
16 powered from a mains adapter. The usable
7 8 9 18
1
RA1 supply voltage range is 1.8 to 5 V. Note that
RA2
2
IC1 8 the maximum rated voltage of the LF ver-
RA3 RB2 330R IR
sion of the microcontroller is 3.3 V.
*
4
0 # RA5
3
RA4 330R
6
9
RB0
15
Operation
RB3 RA6 330R
10
RB4
A communication session starts when the
PIC16(L)F1827 remote control sends the code A6h. The
11 12 J1
RB5 RB6 base station then generates a random 128-
IC2 18-Pin PDIP
7 13 J2 bit number. A random number is better
RB1 RB7
than a predictable number because the lock
VSS
5 can potentially be picked by code phishing
GP1UX31QS if a predictable number is used. The encryp-
tion algorithm is also an excellent random
110358 - 12
number generator (see inset), using an
input value derived from a counter. The
encryption algorithm converts the input
Figure 2. Schematic diagram of the remote control. value into a random number (using a sepa-
elektor 12-2011 49
Personal Download for I Elektor
52429
50 12-2011 elektor
Personal Download for I Elektor
52429
PIN code
The remote control is equipped with a key-
pad for entering a PIN code. The PIN code
is disabled by default. If you do not wish to
use a PIN code, simply connect a pushbut-
ton between RA3 and RB0 (this corresponds
to the # key on the keypad). The PIN code
can be set by fitting jumper 2 and pressing
the * key (or entering the current PIN code
Figure 4. Both circuits can easily be built on Figure 5. The IR LED and the IR receiver are
if it has already been set) and then entering
pieces of prototyping board. located next to each other, facing in the
the new PIN code twice in a row. To disable
same direction.
the PIN code, a new PIN code must be set
with a value of #### or ****.
If a PIN code has been set, it must be
entered when the remote control is acti- station and the remote control is located High beep tone / green LED low beep
vated. If the wrong PIN code is entered in a single file because many routines are tone / green LED: wrong key; lock
three times, the remote control is blocked the same for both devices. The correct hex remains locked (or the remote control
by erasing the key. After this the remote file can be generated by placing #define may be blocked)
control must be resynchronised with the remote or #define homestation at the High beep tone / green LED high beep
base station by generating and program- start of the code. Naturally, the code can tone / green LED high beep tone /
ming a new key. also be modified. green LED: lock opened
If jumper 2 is fitted, only the sequence
On/off The IR LED and the IR sensor are connected 'high beep tone / green LED high beep
You may have noticed that the remote to the serial port (TX/RX). Other devices, tone / green LED' occurs in the latter two
control does not have a power switch. The such as a GSM modem, could also be con- situations. In this case opening of the
problem here is that the power consump- nected to this port. This would allow a lock lock (or otherwise) is the only indication
tion of the latest PIC microcontrollers is (or other device) to be actuated securely of whether the right key was used.
so low that the circuit does not switch off anywhere in the world by sending text The # key can be pressed again within
immediately, due to energy storage in the messages. 5 seconds to send another unlock
decoupling capacitor. For this reason, we request without requiring new entry of
chose a different solution. After five sec- The user interface the PIN code.
onds, the remote control enters sleep Using the devices is simple after the key has The remote control switches off auto-
mode, and in this mode it consumes virtu- been programmed as described above. matically after 5 seconds without user
ally zero current (much less than the self- Press the # key on the remote control to activity.
discharge rate of the batteries). The # key activate it. If the LEDs blink rapidly, the (110358)
generates an interrupt and is therefore PIN code must be entered. If an incor-
effectively the On switch. rect PIN code is entered three times, Note: If you manage to discover
the red LED blinks constantly and the a way to reveal the code of this
The software remote control must be resynchronised. code lock, please let the editors
The author converted existing open source Three different beep/visual results are know: editor@elektor.com
C++ code for the AES routines (the source possible at this point:
is stated in the code) into assembly lan- High beep tone / green LED low
guage because the code was not compiled beep tone / red LED: base station not
properly by the C compilers for PIC micro- responding (may be too far away or not
controllers. The program code for the base switched on)
elektor 12-2011 51
Personal Download for I Elektor
52429
DSP CourSe
By Alexander Potchinkov (Germany) tion of low cost and high signal quality: for either a sine wave or filtered noise at its
sine wave signals this means low distor- output. The two channels are independ-
tion and low noise, and for noise signals it ent of one another, allowing the simultane-
An audio signal generator is a fundamental means that the characteristics of the noise ous generation of a sine wave and (filtered)
item of test equipment in any small audio filter are tightly controlled. Analogue signal noise signals.
or electro-acoustics laboratory. For the generators (under comparable conditions) The signal processing chain shown in Fig-
utmost in flexibility the generator should cannot match the performance of our dig- ure 1 requires a total of five parameter val-
ideally be able to produce output in ana- ital system. To turn the DSP board into a ues: the phase increment df, which sets
logue or digital form and have two out- piece of test equipment we need to add a the frequency of the sine wave, the index
put channels, allowing test signals to be user interface to allow the entry of various FI of the noise filter (regarding this index
fed simultaneously to analogue and digi- settings and, if wanted, an extra analogue as a switch setting), the position of signal
tal devices. It is useful to be able to carry output stage. In this article we will describe source selection switch S1, the attenua-
out measurements both in the lab, such as the signal processing and the DSP program tion factor a and the noise signal amplifica-
on ones homebrew loudspeakers, and on that implements it, closing with some notes tion factor Gain, which can be set in steps
devices when installed at their final place of on how a user interface can be constructed. of 6 dB (that is, each step corresponding
use, for example to measure the frequency to a doubling in output amplitude). Using
response of a speaker system when installed Signal processing in the digital the parameters a and Gain in combination
at a large event. We also want to be able to audio generator allows any desired gain value between the
measure both linear and non-linear distor- Figure 1 shows the block diagram of the 6 dB steps to be obtained. Because there are
tions in equipment. signal processing involved in one of the two two independent channels the DSP code will
identical channels in the system (which we need two separate areas each storing a set
To this end the audio signal generator shall call the left and right channels), fea- of five parameters.
described in this article provides test sig- turing two basic signal sources. One is a sine
nals of sufficiently high quality to ensure wave generator with adjustable frequency We will now describe the three main blocks
that such measurements can be made accu- and the other is a white noise generator. in the signal processing chain in turn: the
rately. If the top end of the frequency range Following the noise generator is a bank of sine wave generator, the noise generator
required is not unreasonably high (in most 42 spectrum-shaping filters with a switch to and the digital noise spectrum filter.
cases for audio measurements the audi- select between them. Then there is a signal
ble range from 20 Hz to 20 kHz is plenty) source selection switch and an attenua- Sine wave generator
then we can realise the generator using the tor. Depending on the switch settings and There are two main approaches to generat-
DSP. The result is an unbeatable combina- the selected filter the system can produce ing a digital sine wave of the form
52 12-2011 elektor
Personal Download for I Elektor
52429
DSP CourSe
x(n) = level of distortion; however, the degree of 23/48 = 0.125. The twos complement
a sin (2pnfS/fT), n = distortion still rises with frequency. arithmetic used by the DSP56374 lets us
0, 1, ... We have chosen to use this last approach as view numeric values as being arranged in
where f T is the sample rate, the spectral quality of the sine wave output a circle and automatically produces the
fS<fT/2 is the oscillation frequency, is our primary goal. In other words, going to desired sawtooth waveform without further
the phase offset is zero and a is the the effort of generating a sine wave digitally processing. The value in the phase accu-
amplitude. Note that the accumulator rep- is only worthwhile if we can achieve a lower mulator is held in double-precision format
resents values from 1 to +1 rather than distortion figure than can be obtained using (as a 48-bit quantity) and is moved to and
from 0 to 1, hence must work modulo 2.
The first approach is to use an oscillator
with feedback, such as the Wien bridge cir-
cuit well known in analogue electronics. In d S
digital form this is known as a second-order Function shaper
recursive oscillator. In both analogue and
0
Out
digital forms if there are stringent require- + 1 x
ments on distortion then some form of
amplitude control is required. Signal source switch
z -1 Sinewave and attenuator
generator
The second approach is to use a phase accu-
Phase accumulator
mulator followed by a non-linear function FI
mapper, as used in the DDS [Direct Digi- 0 0
tal Synthesis] RF Signal Generator project 1 1
Pink
published in Elektor in October 2003. In the
digital sine wave generator the phase accu- 2
1/
2
Noise
3 Oct. 1 Gain
mulator produces a sawtooth output with amplifier
a period equal to that of the desired sine
wave. The non-linear mapper modifies the Noise 31
1/
31
generator 3 Oct. 30
sawtooth signal into a sine wave. In ana- 32 32
logue electronics this can be achieved using Octave 1
elektor 12-2011 53
Personal Download for I Elektor
52429
DSP CourSe
54 12-2011 elektor
Personal Download for I Elektor
52429
DSP CourSe
Figure 2. Normalised frequency responses of the one-third- Figure 3. Spectrum of the 1 kHz sine wave oscillator output.
octave and one-octave filters, in decibels.
8000 Hz, 10000 Hz, 12500 Hz, 16000 Hz logue domain, these can be made by cascad- from the ideal performance by less than
and 20000 Hz: these values are as speci- ing three second-order sections. Our imple- 0.1 dB over the frequency range from 10 Hz
fied in BS (DIN) EN 61260. mentation of the sixth-order filter requires to 20 kHz. The band-pass filters are capable
eight memory locations to store its state: of attenuating stop-band signals by more
Ten one-octave band-pass filters to gen- these memory locations map to capacitors than 100 dB: such performance is difficult to
erate noise within octave-wide bands and inductors in the corresponding analogue realise in an analogue circuit without inordi-
with nominal centre frequencies at filter realisation. The filter also requires a nate amounts of design effort.
31.5 Hz, 63 Hz, 125 Hz, 250 Hz, 500 Hz, total of fifteen coefficients that determine
1000 Hz, 2000 Hz, 4000 Hz, 8000 Hz its characteristics. The complete set of filters The DSP code
and 16000 Hz, again in accordance with thus requires a grand total of 41 15 = 615 The signal processing code itself is embed-
BS (DIN) EN 61260. coefficients, which we store in a table. For ded as a block in the audio loop. Even
simplicity in programming we add a forty- though in this case we have no need to
By way of an example Figure 2 shows the second filter which has no function except read the incoming audio signal, we leave
frequency response of a one-third-octave to pass the white noise signal through unaf- the existing audio loop code as it is and load
and a one-octave filter with normalised cen- fected. This filter has index zero. the input samples as normal. This ensures
tre frequency. Table 2 shows various points that synchronisation is maintained within
on the response curve of the two filter types Selecting a filter is simply a matter of load- the audio loop and means that the frame-
when centred in the middle of the audible ing the coefficient pointer so that it points work code is identical for all three of our
range at 1 kHz, giving the frequencies at to the correct set of coefficients. The value projects. The code has a total of ten local
which certain levels of attenuation occur. of this pointer is easy to calculate: if the parameters: Table 3 lists these along with
The 3 dB points of the filter are highlighted base address of the filter coefficient table is their valid ranges and other characteristics.
in the table. AB and the filter index is FI then the pointer The default values of the parameters are
address is given by A = AB + 15 FI: this is chosen so that the left channel emits a
Since the filters are implemented digi- the start of the relevant coefficient block. sine wave with a frequency of 1 kHz and
tally and we are using sample rate of only Here we see one of the big strengths of the right channel a noise signal filtered to
48 kHz the centre frequencies of the filters digital signal processing: imagine how one third of an octave around a centre fre-
at higher frequencies tend to deviate from complicated and costly it would be to cre- quency of 1 kHz. In both cases the attenu-
their ideal values. The reason for this is that ate a comparable analogue filter bank! ator halves the output sample values: this
signals at half the sample rate, or 24 kHz, The author has a superannuated octave corresponds to an attenuation of 6 dB. The
undergo infinite attenuation: we in effect and third-octave filter bank made by Brel noise amplifier stage has its gain set to 0 dB
have an additional null in the frequency and Kjr in his laboratory: it weighs 15 kg (on both channels). The default values of
response at this frequency. The (not nec- (33 lbs). We could have arranged to have the parameters are listed in Table 4 and the
essarily disadvantageous) result of this is hundreds of sets of filter coefficients stored files that comprise the DSP program are
that the left and right sides of the filters in the DSPs memory selected just by mov- given in Table 5.
response are not symmetric: the response ing a pointer.
is steepened on the right-hand side. For the record, the forty band-pass filters Subroutines and signals
All the filters are implemented as sixth-order meet the specifications of BS (DIN) EN Two subroutines are called before the audio
recursive or IIR filters. Just as in the ana- 61260 class 0. The pink noise filter deviates loop is entered. The subroutine InitStat-
elektor 12-2011 55
Personal Download for I Elektor
52429
DSP CourSe
FilL Subroutine
FilR FilterSwitch
CPHA=0 CPOL=0
Subroutine
NoiseGenerator
MOSI MSB 6 5 1 LSB
NoiseL
NoiseR
MISO
Subroutine MSB 6 5 1 LSB
Filter
NoiseGainL
NoiseGainR CPHA=1 CPOL=1
GainL Subroutine
GainR GainBlock CPHA=1 CPOL=0
NoiseShapedL
NoiseShapedR
MOSI MSB 6 5 1 LSB
SwL Subroutine
SwR SignalSwitch
MISO
MSB 6 5 1 LSB
GeneratorL
GeneratorR
AlphaL Subroutine SS
AlphaR Attenuator
110006 - 17
OutL
OutR
Figure 4. Subroutines and signals in the audio loop. Figure 5. Timing of the SPI port. (Source: Wikipedia)
eVars clears the filter state memories and function using an approximating polyno- The macro can be used to implement IIR fil-
the two phase accumulators. The shift reg- mial is done within the macro sine. The ters of any desired order and is a standard
ister states are set to one of the allowable state variables for the sine generator sub- building-block. This subroutine requires
values. Then the subroutine SetDefault- routine are the two phase accumulators no parameters, as the base address of the
Params sets all the parameters to the val- l:PhaseAccuL and l:PhaseAccuR, block of fifteen coefficients has already
ues given in Table 4. which contain the current phase values. been computed in the subroutine Fil-
The six coefficients of the approximating terSwitch. Two areas for state memory,
Seven subroutines are called from within polynomial are stored in Y RAM with base each of eight locations, are required. Their
the audio loop. Six of these are directly address SinCoef. The two sine wave out- base addresses are FstateL and FstateR.
involved with the audio signal processing puts themselves are stored in memory loca- The two filtered noise signals are available
chain. The seventh, subroutine Filter- tions y:SineL and y:SineR. at y:NoiseGainL and y:NoiseGainR.
Switch, reads the two filter index param- The subroutine GainBlock contains the
eters FiL and FiR and from these values The subroutine NoiseGenerator contains code that applies gain to the filtered noise
calculates the start addresses of the corre- the code for the two statistically independ- signals. The gain function is not protected
sponding filter coefficient blocks, each of ent (for practical purposes at least) noise against clipping and should therefore only
which contains fifteen entries. Although this signal generators for the left and right chan- be used to apply small amounts of gain.
operation is more a translation of parameter nels. Again, a macro is used for the signal More detailed information on this is given
values than strictly speaking an audio signal generation proper. The macro has two argu- elsewhere in this article. The code itself
processing operation, it nevertheless must ments: the memory location where the shift is very straightforward: a gain of 6 dB (a
occur within the audio loop as the param- register contents are stored and a 24-bit doubling of the signal level) is done using
eters can be changed dynamically. The constant representing the feedback pat- a left shift operation. The DSP features a
other parameters are used directly and do tern. The state variables are the two 24-bit barrel shifter that can shift by any num-
not require further processing within the shift registers y:NoiseL and y:NoiseR, ber of places in constant time: this means
audio loop. which are also the output signals of the two that we can apply a gain of any multiple of
noise generators. 6 dB in a single step. The two filtered noise
The subroutine SineGenerator con- signals, after any gain has been applied,
tains the two independent sine wave gen- The subroutine Filter implements the are available in y:NoiseShapedL and
erators for the left and right channels. The two noise shaping filters. Each is a sixth- y:NoiseShapedR.
two phase increment parameters DphiL order recursive, or IIR, filter. We take
and DphiR determine the frequency of advantage of the library macro iir2mac The subroutine SignalSwitch imple-
the oscillators. The calculation of the sine provided by Freescale (formerly Motorola). ments the two signal source switches that
56 12-2011 elektor
Personal Download for I Elektor
52429
elektor 12-2011 57
Personal Download for I Elektor
52429
DSP CourSe
Available now!
The DSP board used for all the experiments in this course, plus its
programming adaptor, are now available at a special price.
See http://www.elektor.com/11001-92.
58 12-2011 elektor
Personal Download for I Elektor
52429
Available add-ons:
Previous Contest Projects
Elektor Back Issues
audioXpress Back Issues
Archive includes:
All Circuit Cellar issues in pdf format that are in print through
date of purchase. Also includes associated project code.
Imitation candles using an LED as the illuminating element are available commercially.
But here were describing a rather different project with a few unusual characteristics
after all, candles are meant to be blown out!
Candlelight is by nature variable, so were Puff detector and with an ambient temperature of 25 C,
going to do a bit of animation to simulate As stated above, were using an NTC ther- the current is
the candle flame. There will be a lighting mistor (R2 in Figure 1) as an air movement
sequence, a blowing-out sequence, and a detector. Weve chosen a type in a CMS I25 = 5 / (100 + 220) = 16 mA.
few animated sequences intended to repro- 0603 package with a nominal resistance of
duce more or less faithfully the flickering of 220 @ 25 C, a beta coefficient of 3,540 K, The voltage across the thermistor is
a natural flame. and a maximum dissipation of 180 mW. A V25 = 220 I25 = 3.5 V, and the power dis-
high beta coefficient means the resistance sipated by the thermistor is
To produce these animations we need varies to a greater extent with variations in
a microcontroller. We went for the temperature. P25 = V25 I25 = 3.5 16 mA = 56 mW.
PIC16F1827 from Microchip which has a
4 Kword program memory, enough for the The principle of our circuit is as follows. Were a long way from the maximum of
code to handle the application and the ani- We may consider that a persons breath is 180 mW, but this power is enough to cause
mation sequence definitions. appreciably similar to the ambient tempera- the devices temperature to rise, thereby
This microcontroller also has easy-to-imple- ture in the room. So at first sight, blowing reducing its resistance, increasing the cur-
ment functions for handling touch keys. So on a thermistor that is already at ambient rent, and so on. After a few seconds, the
we decided to include a copper area on the temperature isnt likely to make its resist- whole thing stabilises, as the oscilloscope
back of our PCB to create a touch pad to let ance change! The trick here is to pass trace shows (Figure 2). Our software waits
us light the candle. enough current through the thermistor to for 20 s so that the temperature is properly
heat it up slightly. Then a pronounced blow stabilized before taking the measurements
To achieve our (rather over the top!) objec- will cause its temperature to drop, which into account. Its tricky to show how this
tive of being able to blow out the candle, we well then be able to measure using one of graph changes when you blow on it. After a
have found a new use for a temperature sen- the microcontrollers analogue inputs. lot of attempts, we managed to define that
sor in the form of an NTC thermistor. Our circuit includes a potential divider with a positive variation of the order of 25 mV is
And it works! a pad resistor of 100 (R1). At power up enough to detect a human breath.
60 12-2011 elektor
Personal Download for I Elektor
52429
Technical specifications
Realistic flame simulation
Blows out
Lights via a touch pad
PIC16F1827 programmed in C, source code provided
Puff detector based on an NTC thermistor
From a software point of view, its neces- Constructional difficulty: average
sary to suit the frequency of the analogue
acquisitions to the rate at which the meas-
ured signals change. Weve used initial fil-
tering to eliminate noise, then averaging
+5V
over 16 successive values, so as to be able
to detect when a filtered value deviates
D11
from the average of the 16 values by more C1 C2
R3 R1
D4
100R
10k
than 25 mV. The result is that you have to 33u 10V 100n
D13
blow reasonably close to the candle to blow
15
16
24
GND D12
it out. Nonetheless, the whole thing is still K1
VDD
VDD
VDD
K2 1 5 D2
LED1
quite sensitive to draughts. +5V
1
2
2
3 12
RB0
7
8
SIN 2
SIN LED2
6
7
0 RB5 IC1 RB1 IC2 LED3 D3
You dont need accuracy here, as all you are +5V
3 4 CPU_ISPDAT
CPU_ISPCLK
13
RB6 RB2
9 CLK
LATCH
3
CLK LED4
8
4 5 14 10 4 9 D9
0
doing is comparing the temperature differ- 6
RB7 RB3
RB4
11 BLANK 21
LATCH
BLANK
LED5
LED6
10
22 11 D14
ences to the average of the temperatures ISP TOUCHE 19
RA0
SOUT LED7
LED8
12
20 13 D1
recorded. So there was no need to fit a volt- 1
RA1
RA2
PIC16F1827
SSOP20
CAT4016
TSSOP24
LED9
LED10
14
TEMP1 2 15 D6
age reference on the board, nor even to use 3
RA3
RA4
LED11
LED12
16
CPU_MCLRVPP 4 RSET 23 17
TP1 D7
the microcontrollers internal reference. 17
RA5/MCLR/VPP
RA6
RSET LED13
LED14
18
18 19 D5
Hence the analogue measurement range is RA7 LED15
LED16
20
R2 D8
delimited by the 0 V rail on the one hand, R4
GND
Vss
Vss
27k
5
1
D16
and the supply voltage on the other. -
220R
NTC D10
elektor 12-2011 61
Personal Download for I Elektor
52429
COMPONENT LIST
Resistors (SMD 0603) ange, low current, SMD 0805, e.g. King-
R1 = 100 bright KPHCM-2012SECK
R2 = NTC, 220 , Epcos D13 = LED, red, low current, SMD 0805,
B57311V2221J60 (e.g. Farnell # 129- e.g. Kingbright KPHCM-2012SURCK
9912 or RS Components # 706-2702)
R3 = 10k Miscellaneous
R4 = 27k K1 = 6-pin pinheader, lead pitch 0.1 inch
(2.54 mm)
Capacitors K2 = 4-pin pinheader, lead pitch 0.1 inch
C1 = 33F 10V aluminum electrolytic, (2.54 mm)
case C, e.g. Panasonic EEE1AA330SR
C2 = 100nF, SMD 0603
Semiconductors
IC1 = PIC16F1827I/SS (SSOP20),
Microchip
IC2 = CAT4016Y-T2 (TSSOP24), ON
Semiconductor
D4 D11, D15 = LED, yellow, low cur-
rent, SMD 0805, e.g. Kingbright Figure 3. The double-sided PCB carries only surface
KP-2012SYCK mount (SMD) devices, but it can still be built by hand.
D1, D2, D3, D12, D14, D16 = LED, or-
Driving the total of 16 LEDs that are going The CAT4016 uses on/off digital drive. To PCB
to make up the flame has been entrusted make the animations a bit more fluid, we A 17 60 mm board was designed (Fig-
to a specialized IC, the CAT4016 from ON need to be able to adjust the brightness of ure 3), of which the LEDs occupy an area
Semiconductor (IC2). This device incor- the LEDs on an individual basis. The solution 17 39 mm. The lower part of the board is
porates constant current regulation for is to do this in the software. reserved for the microcontroller program-
16 LEDs, with the current value defined by Our microcontroller is clocked at 16 MHz, ming connector and for the power input
an external resistor (R4). The current pass- and as it takes four clock cycles to execute points.
ing in each LED channel is 50 times the cur- an instruction, we have an actual speed of
rent passing through the resistor connected 4 MHz. Timer 1 has been set to produce an On the top of the board there are only the
to the Rset pin. Given that the voltage on this interrupt every millisecond. This source of LEDs in CMS 0805 packages, i.e. a size of
pin is regulated to 1.2 V, with R4 = 27 k we main timing is often called a tick system. 2 1.25 mm. We also find on this side the
have a current of 44 A through the resistor, At each tick, we refresh the contents of temperature sensor, the NTC thermistor in
and hence 2.2 mA in the LEDs. This value IC2s shift register. On our prototype, the an 0603 package. This is necessary so we
offers good visibility of the animations while action of transferring the commands for can blow on it!
ensuring acceptable luminosity levels over- the 16 LEDs takes 160 s, i.e. 16 % of the
all. If you use other LEDs you may have to processor time. On the underside, you can spot at once the
tweak the value of R4. tip of the board, which forms the touch
At this repetition rate, the human eye, or pad. Note too the test point TP1, above the
The CAT4016 is driven via a serial connec- rather the visual perception system, does microcontroller (referred to above).
tion. Four signals are used, in the direction not perceive the LEDs as flashing on and
from the CPU to the CAT4016: off. Very far from it, in fact it would be To fit all the other functions on the other
possible to reduce the refresh frequencies if side, it was necessary to resort to fine-pitch
CLK: clock signal necessary, for example, to leave more CPU packages. Our microcontroller comes in an
SIN: serial in data signal time for the other software routines. So we SSOP20 package with a pitch of 0.65 mm
LATCH: store signal can create software pulse width modulation and the LED driver was chosen in a TSSOP24
BLANK: signal to blank all 16 LEDs (PWM) for each LED. In our case, weve con- package, also with a 0.65 mm pitch. These
simultaneously tented ourselves with a 5-state PWM (0 %, fine pitches should not be seen as an obsta-
25 %, 50 %, 75 %, and 100 %). This might not cle, but rather as an effort to get closer to
The device data sheet illustrates the seem very much, but the software also has the industrial techniques that are within the
sequencing of the signals for individually to define the patterns the LEDs are going to reach of an amateur. An illuminated magni-
driving the 16 LEDs. The data received, make in an attempt to reproduce the flicker- fier, a fine-tipped, temperature-controlled
clocked by the clock signal, are stored in ing of a real flame. Now were restricted for soldering iron, 0.5 mm (AWG24) diameter
a shift register whose output is accessible space in our microcontroller, so unless we solder, and above all flux in a syringe! Bet-
(serial output signal SOUT), which we are give it external memory and a method for ter not to drink too much strong coffee,
not using here, but which would make it programming this storage space, we need though, before you start the soldering
possible to connect several devices in series to reduce the number of states so as to be
without using up more in/outputs on the able to define enough patterns to make our The technique is well established you
microcontroller. animation pleasing. should put a tiny amount of solder on a land
62 12-2011 elektor
Personal Download for I Elektor
52429
Extract of the code for initializing of Timer 1 for the 1 kHz timebase:
Extract of the code for initializing the function to handle the capacitive sensor:
OPTION_REG = 0b01101000;
// 0 : WPUEN#=0 -> Weak pull-ups enabled by individual WPUx
// 1 : Interrupt on rising edge of INT (not used)
// 1 : TMR0CS=1 -> Timer0 counts on T0CKI
// 0 : TMR0SE=0: Timer 0 counts of rising edge of T0CKI
// 1 : PSA=1: prescaler is not assigned to Timer0
// 000: Prescaler value, 1:2
at one end; then position the device onto Table 1. Pin-out for the ICSP connector. Flash memory, i.e. 3,460 words out of the
its lands and solder the tinned IC pin. Once Pin 1 is marked with a square dot. 4,096 available. A good three-quarters of
you are sure it is correctly positioned, you this space is used for defining the patterns
Contact Signal
add some flux and solder the other pins. Sol- and would require a degree of optimization
der bridges will form, but its easy enough 1 MCLR/Vpp if the space issue had to be tackled.
to remove them using fine desolder braid. 2 +5 V rail
The board has been made double-sided and 3 0 V rail The full source code, along with the HEX
uses through-hole plating. The power rails file, is available free on the project web
4 ISPDAT
have been routed in the form of planes; the page. Youll also find there the PCB design
+5 V plane is on the top surface, since this 5 ISPCLK and you can order the PCB (bare, or built
rail is the common for our LEDs. Hence the 6 Not used (PGM signal) and tested).
0 V rail is on the underside.
To your soldering irons and Merry
The in situ programming connector K1 is too, pad 1 is marked by a square dot. Doub- Christmas!
in fact a row of six through-plated holes. ling up the supply pads like this is useful (110644)
The pin-out follows the order of the signals when joining several boards together, to
given by the ICD3 programming interface multiply the graphical effect.
from Microchip (Table 1). Software, PCB, products, etc.
There are pads for connecting the power Software www.elektor.com/110644
(K2) two for the +5 V rail (pins 1 and 3), As a guide, the current code written in C
and two for the 0 V rail (pins 2 and 4). Here occupies 84.5 % of the microcontrollers
elektor 12-2011 63
Personal Download for I Elektor
52429
1N4148
pulses. Now transmission line theory tells 4n7 IC1.A IC1.D J1
K2
us that if the cable is terminated in its char-
C5 R5 R8
1 2 9 8
1 1 220 22
acteristic impedance, and hence, if it is in C6
1n S1
BNC
good condition, no pulse will be reflected IC1.C
R6 R9 K3
5 6
back from the far end of it. And so the oscil- C7
220p 1 220 47
64 12-2011 elektor
Personal Download for I Elektor
52429
elektor 12-2011 65
Personal Download for I Elektor
52429
Microcontrollers
66 12-2011 elektor
Personal Download for I Elektor
52429
Microcontrollers
1
2
+5V GND
used to terminate the data storage process. GND
GND
C3 C2 C1 [uC-Rx/Logger-Tx]
10
The 6-way pin header K3 allows the micro- GND
4u7 uC-Tx/Logger-Rx GND
controller to be programmed in-circuit and 35V
100n 100n
10
9
is compatible with standard programming
adapter tools such as those used in PICkit F1 R3
C9 C7 C8
3 and ICD2/ICD3 from Microchip. Jumper
*
5k6
+ 100n 100n 100n
JP1 is not used in the current version of PTC
23 13 28
the firmware but may be employed in the K3 VUSB VDD VDD
ICSP 15 2
future when newer versions of the firmware VBUS RA0/RP5
1 1 3
become available. MCLR IC1 RA1/RP6
2 12
RA4
The circuit can be built on the PCB (Fig- 3
PIC24FJ64GB002
PCB component side and no SMD outlines 2 1 7
RB3/RP3 RB5
14
elektor 12-2011 67
Personal Download for I Elektor
52429
Microcontrollers
Configuration
COMPONENT LIST The serial communication parameters are
Resistors IC2 = LP2950-33LPE3 placed in the simple text file config.txt
R1 = 1k stored on the memory stick. As soon as
R2,R4,R5,R6 = 220 Miscellaneous the USB stick is recognised (during power-
R3 = 5.6k F1 = resettable fuse, 250 mA hold current,
up with the stick already in place or during
500 mA trip current (Littlefuse 72R025XPR)
Capacitors X1 = 12MHz quartz crystal operation when the stick is plugged in) this
C1,C2,C7,C8,C9 = 100nF K1 = USB socket, Type A, PCB mount file is read and the serial interface config-
C3,C6 = 4.7F 35V radial K2 = 10-pin (2x5) pinheader, right angled ured accordingly. Without this configura-
C4,C5 = 22pF K3 = 6-pin pinheader tion file the default standard communica-
PCB # 110409-1
tion parameters are: 9600 Baud, 1 start bit,
Semiconductors
D1 = LED, low-current, 3 mm 1 stop bit, no parity.
IC1 = PIC24FJ64GB002-I/SP (programmed,
Elektor # 110409-41) Operation
The data logger will be in recording mode
(C) Elektor 2011 when it is powered up and a memory stick
110409-1 v1.2
is fitted. Short flashes from the LED indi-
C7
X1
C6
IC1
C5
in the logging.txt file. Before unplugging
K1
JP1 C3 the memory stick it is necessary to press
C8
IC2
the store pushbutton; this ensures that all
D1 C1 10 data held in the receive buffer is stored to
R3
C2
R1
C9 K3 the logging file and that the file is closed
F1 cleanly. The stored data can then be read on
any PC by plugging the memory stick in to
Figure 2. The PCB does not use any SMDs. a free USB socket and reading the contents
of the logging.txt file using a simple text
editor program.
10). Pins 2, 4, 6 and 8 are all tied to ground. connected to pins 3 and 7 of K2 via 220 Work in progress
The second signal connection shown as (C- resistors. These additional connections are Although the data logger design presented
Rx/Logger-Tx) is brought out to pin 5 but intended for future use with modified firm- here only stores data to a memory stick it is
not used by the current firmware version. ware to allow, for example the microcon- clear that the design can easily be tweaked
Microcontroller port pins 16 and 17 are troller to retrieve stored data. to make it even more useful. An obvious
candidate would be to allow the stored data
files to be read back to the external micro-
controller system. As a stand-alone logger
it could also be programmed to automati-
cally sample the analogue and digital inputs
at pre-programmed intervals and store the
readings to memory stick. Four pins of the
10-pin K2 pinheader are not currently in use
but are wired back to the controller I/O pins,
these peripheral signals can, for example be
used to implement an SPI interface or addi-
tional UART.
(110409)
Internet Link
[1] www.elektor.com/110409
68 12-2011 elektor
Personal Download for I Elektor
52429
readers project
Although a true homebrew design this lamp lamp operates from a single push button The brightness of the dimmed beam can
has a truly professional feel to it. The alu- to switch between high beam and dipped be set by turning the lamp on with a long
minium body is designed to be watertight beam. Conventional vehicle lamps switch press. Now it enters setup mode where fur-
and requires some machining. The design between two filaments to achieve a dipped ther press of PB1 cause the lamp to cycle
uses four Li-Ion cells connected in parallel, beam but with this design the main beam is through increasing then decreasing levels
each with a capacity of 2.2 Ah. A microcon- just reduced in brightness to avoid the risk of brightness until the desired brightness
troller takes care of battery management of dazzling oncoming vehicles. If you are is reached. Before long the torch reverts to
allowing the lamp to be charged at 5 V from planning to take your bike further afield it normal operational mode.
either a mains adapter or car adapter. is worth checking the local cycling regu-
lations before you travel. Some countries The push button is fitted with an indicator
Lights, cycle, action! do not allow lamps that give out too much LED which is used here to give a visual indi-
Flashing LED cycle lights are fine for the light. In the UK the regulations only specify cation of the batterys state of charge. Peri-
urban commute; they are highly visible and that they should emit more than 4 Cande- odically it will issue a series of flashes (four
the batteries last a long time. If you how- las. Whatever the regulations this robust, flashes indicating a fully charged battery).
ever get the urge to explore unlit country versatile lamp should be more than capa- When the voltage falls below a threshold
lanes or off-road trails then the chances are, ble of taking anything thats thrown at it. the lamp automatically switches to the low-
when the sun goes down you will quickly est brightness setting to prolong burn time.
discover their limitations. For the sake of Operation
safety you need something more powerful The lamp uses just a single push button and The circuit
to warn you in good time of the road con- operation is quite intuitive. A short press White LEDs have a forward voltage drop
ditions up ahead. Equivalent professional switches the lamp on then further presses of around 3.5 V and the voltage output of
cycle lighting systems are available but cost toggle the lamp between high beam and a single Li-Ion cell varies from 2.7 to 4.2 V
hundreds of pounds. This self-contained dimmed. A long press turns the lamp off. depending on its state of charge. To operate
Note. Readers Projects are reproduced based on information supplied by the author(s) only.
The use of Elektor style schematics and other illustrations in this article does not imply the project having passed Elektor Labs for replication to verify claimed operation.
70 12-2011 elektor
Personal Download for I Elektor
52429
readers project
+VBATT +VBATT
X1
L2 D2
6 VCC
5 RESET R40 10uH
MBR530
4 MISO R31
3k3
3 MOSI 5 U2 1
47k
VIN SW
2 SCK
LM3410
1 GND 4 3
DIM FB
R30
GND C11
PGRM
R41 2
1k
1k2 10u 10V
+VBATT
1
VCC
6
PA7
U3 7
R43 SIGLED+ L1
PA6/MOSI 270R C1 C1 C1
PUSH 2
PB0 PA5/MISO
8 X2
BUTTON 3 9
PB1 PA4/SCL 10u 10u 10u
5 10 6uH8 10V 10V 10V
X4 PB2 PA3 5A1
4 11 +VDRIVE
PB3/RST PA2
ATTINY44 PA1
12
13
D1 LED + *
PA0
C5 X8
GND C42 SMB340 C8 C9
14
16 1u Q1 R4
100n 4u7 4u7
VCC 25V 25V
33k
18 15
HV NDRV
11 9
UVEN U1 FLT
FDS7066A
BATT+ +VBATT
17
12
IN CS
13
LED *
PWMDIM
X6 6
REF Q2 X9
5 R6
MAX16834
5
COMP
BATT C7 20
1k2
4 DIMOUT
IN 3
CHARGE+ OVP+
1
SELV CHG
8
220n FDS7066A
2
U4 7
REFI SENSE+
2
X5 SELI 8 10
7 SC RT/SYNC
EN MAX1811 1 19
R5 R7 LV EP CLV R3 R1 R9 R10
GND GND GND C4 C2 C6
C30 SGND PGND
40mR
4k7
470R
0R2
3 6
1k
12k
X3 4 14
100n 1n 100n
10u 10V (5x 1R||)
GND
100269 - 11
X7
Figure 1. The circuit includes a microcontroller, two switched mode converters and a battery charge regulator.
a single LED from a single cell it would be 5.6 A. The maximum LED current is defined lised voltage (+VDRIVE). The LM3410 is
necessary to use a regulator which provides by how many 1 resistors are fitted to the essentially a constant current regulator for
a voltage initially below the fully charged PCB for R10. With all five resistors in place driving LEDs up to 500 mA. At the start of
cell voltage but then above the cell volt- the combined value of R10 will be 0.2 . this design the authors original intention
age as it discharges. A SEPIC (single ended This will give a maximum LED current of 1 A. was to use several LM3410s to power the
primary inductance converter) is capable The author fitted just three 1 in the proto- LEDs but all that remains is one of these
of this sort of operation. The disadvantage type to give an LED current of 600 mA. This tiny chips configured as a constant voltage
of this type of converter (besides the addi- value produces more than adequate light boost converter.
tional circuitry) is that they are relatively output and limits power dissipation in the The Atmel ATtiny44 microcontroller (U3)
inefficient. With this in mind it was decided LEDs. has the job of controlling all the other com-
to use the four LEDs (CREE XR-E) connected The PWMDIM pin is an input for the PWM ponents in the circuit. It generates the PWM
in series mounted on a circular PCB and fit- signal to dim the LEDs. This is used to drive signal to enable the power LEDs to be
ted with lens optics made for the CREE LEDs. reduce the energy dissipated by the LED. dimmed and provides the shutdown sig-
The regulator required to supply the neces- Pin 11 (UVEN) would normally be con- nals to U1 and U2 as necessary. The built-in
sary 14 V is a simpler upwards converter nected to a voltage divider network to A/D converter measures the battery voltage
(step-up or boost converter). sense and shutdown the chip when the sup- using the voltage divider network R40 and
ply voltage falls too low. In the circuit here it R41. To reduce current flow through the
The circuit diagram in Figure 1 shows that a is connected directly to port pin PB2 of the voltage divider network when the lamp is
MAX16834 (U1) is used. The ICs configura- Atmel microcontroller (3). switched off the ground end of the divider
tion in this circuit is taken from an applica- For circuit operation and to ensure the MOS- is connected to port pin PB0. It can now be
tion example in the chips data sheet, only FETs fully conduct when they are switched switched into a high impedance state to cut
component values have been changed to on the MAX16834 (U1) requires a supply off current flow through the voltage divider
make it suitable for this application. Note voltage of at least 5 V. The rechargeable network.
that with a LED current of 1 A and the bat- cells alone have insufficient output so an
tery voltage at its lowest level the coil must additional voltage converter type LM3410 The lamp is never turned completely off; the
be able to cope with an average current of (U2) has been used to provide the stabi- microcontroller, boost converter and LED
elektor 12-2011 71
Personal Download for I Elektor
52429
readers project
Construction
A double sided round PCB has been devel-
oped for this project (Figure 2). The popu-
Internet Reference
lated board can be seen Figure 3.
Figure 4. A view of the lamp internals. Despite improvements in high power LED [1] www.elektor.com/100269
72 12-2011 elektor
Personal Download for I Elektor
52429
gerards columns
74 12-2011 elektor
Personal Download for I Elektor
52429
INFOTAINMENT
Hexadoku
Puzzle with an electronics touch
If you are into puzzle solving, why not join the crowd of Elektor readers who solve the secret of Hexadoku
every month, or at least have a crack at it! Were sure youll be thrilled. Simply enter the right numbers
in the puzzle below. Next, send the ones in the grey boxes to us and you automatically enter the prize draw
for one of four Elektor Shop vouchers. Have fun!
The instructions for this puzzle are straightforward. Fully geared to in each column and in each of the 44 boxes (marked by the thicker
electronics fans and programmers, the Hexadoku puzzle employs black lines). A number of clues are given in the puzzle and these
the hexadecimal range 0 through F. In the diagram composed of determine the start situation. Correct entries received enter a draw
16 16 boxes, enter numbers such that all hexadecimal numbers for a main prize and three lesser prizes. All you need to do is send us
0 through F (thats 0-9 and A-F) occur once only in each row, once the numbers in the grey boxes.
Prize winners
The solution of the October 2011 Hexadoku is: D0837.
The Elektor 80.00 voucher has been awarded to Olavi Parkka (Finland).
The Elektor 40.00 vouchers have been awarded to Susanne Mller-Furrer (Switzerland),
Robert Amandine (France) and Thierry Notot (France).
Congratulations everyone!
2 A 0 7 B C F 3 9 D 6 4 8 E 1 5
B 8 3 9 A 5 4 D 7 0 E 1 6 2 F C
5 1 C D E 9 0 6 8 F 2 3 7 4 A B
4 6 E F 8 7 1 2 A 5 B C D 0 9 3
C 2 1 8 6 D 3 B 0 7 4 E 9 A 5 F
E D F A 7 8 2 5 B 6 3 9 1 C 0 4
0 7 5 3 4 A 9 F C 8 1 2 B 6 D E
9 4 6 B 1 E C 0 D A 5 F 2 3 7 8
1 5 8 C 9 4 6 A E B F 0 3 7 2 D
6 B 2 0 C F D 8 1 3 7 A E 5 4 9
D 3 7 E 2 0 5 1 4 9 C 8 A F B 6
A F 9 4 3 B 7 E 5 2 D 6 C 1 8 0
F 9 B 6 5 1 E C 2 4 A D 0 8 3 7
3 C A 5 D 2 8 7 F E 0 B 4 9 6 1
7 E 4 2 0 6 B 9 3 1 8 5 F D C A
8 0 D 1 F 3 A 4 6 C 9 7 5 B E 2
The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses.
elektor 12-2011 75
Personal Download for I Elektor
52429
retronics
By Jan Buiting (Elektor UK & US Editorial) always cherished my Cosmicos CDP1802 system and all its cards
and peripherals, and a few years ago while browsing the ELF pages
As far as microprocessors are concerned my roots are in the early at Yahoogroups I could not believe my eyes! A posting from a fel-
1980s when all sorts of hobby systems were around based on low countryman politely asking a mostly American audience on
competing devices like the Z80, 6502 and 8085. Ive always hated the forum if anyone would like a complete Cosmac IV system. All
electronics that gets hot while doing nothing useful so I left these respectfully declined because of the colossal cost of getting the kit
NMOS current hungry micros, fan clubs and BBSs well alone and shipped to the US, where it had come from in 1981. To cut a long
went for a less popular 8-bit number cruncher called CDP1802 story short, I collected the complete system, paid a symbolic price
originally designed and produced by RCA, the company behind the and drove it home. A load of hardware actually developed with the
famous CD4000 series of logic ICs. The CMOS (hence acutely energy system was also included, as well as documentation in binders and
friendly) 1802 and its family of Cosmac peripheral ICs did really software on 8-inch floppy disks. It was the first time I had to adjust
well in the USA after a cute DIY system called Cosmac ELF was pub- the headlights on my car to prevent dazzling oncoming traffic. I
lished in Popular Electronics way back in 1976 (it was roughly the never realized the system I had seen in a book 30 years ago was so
time when Jobs & The Woz tinkered with 6502s in their Palo Alto bulky and heavy. But Home & Mother, what a find!
garage). A more sophisticated European variant called Cosmicos The bright blue and off-white unit labelled Cosmac IV is basically
was developed about four years later and that was to become my a CRT dumb terminal talking internally to a CDP1802 system. It
personal platform (see CDP1802 the first micro in space, Ele- weighs only 17 kgs (38 lbs). Believe it or not but the terminal is
ktor October 2006). itself a CDP1802 video system sitting between a keyboard and a
12-inch CRT. The actual development system is a separate back-
In 1980, as a student, if you could lay your hands on an RCA Cosmac plane onto which RCA CDP18Sxx micromodules are plugged like
data book, you were King. I managed to permanently borrow one CPU (CDP1802), ROM, RAM, I/O, FDISK, etc. The software you want
from a kind soul at Vekano, a former RCA distributor in Holland. Prob- to develop for a custom application is fully written, tested and
ably to fill the book and keep the marketing people happy, the last debugged using the card nest, until (you think) hex code is ready
40 or so pages of the book showed some of RCAs software tools, to safely burn firmware (E)PROMs like the 2708 and 2716. The (E)
hardware, programmers, compilers (like BASIC and PL/M) and Cos- PROM programmer is accessible under a hinged panel. The panel
mac development systems. Although my own DIY Cosmicos system opens and closes by pressing it. People fund it funny. On the rear of
was pretty well equipped (48 KByte RAM and all that), green (under the terminal casing theres connectors for AC power, disk, printer,
200 mA @ 5 V) and fast too (3.58 MHz), I marvelled and drooled over CRT EIA, SYS, EIA, MOPS EIA, spare #1 and spare #2.
the specs and (very poor) photograph promoting RCAs top-line The Cosmac IV terminal unit has a nostalgic bright green CRT display
product: the monumental Cosmac System IV Development System thats just perfect to read although at 24 lines of 80 characters its
CDP18S008. No price was given I guess you had to telephone. claustrophobic compared to todays LCD monitors. Also, the Sperry
Depending on your hobby or interests, it may take just 30 years made 73-key ASCII keyboard is a delight to listen to when typed
before you can actually buy what you dreamt of as a youngster upon at speed, the keys being of the Hall effect type. Using the full-
or student. Two forces work to your advantage, slowly but surely: screen editor (FSE) to write your code (in assembler, of course) you
(1) you make money instead of wasting it and (2) the price of the hardly miss the ease and comfort of a mouse, menus, icons or the
desideratum/a drops to the level of techno junk no one wants. Ive constant distraction of the Internet!
76 12-2011 elektor
Personal Download for I Elektor
52429
retronics
If you thought the Cosmac IV blue & white CRT terminal is expen- a comfortable way. A later version (CDP18S030A) had a detachable
sive & comprehensive and you cant wait to start writing code and display/keyboard unit that looked like a 1970s pocket calculator.
burn ROMs, wait! There are two more components that go into The only mass-produced CDP1802 application circuits that seem
the CDP18S008 system. to have survived are a US made traffic lights system occasionally
First, theres a dual disk drive for 8-inch floppy (flexible) disks offered on Ebay, and a 1996 (!) Nokia UHF in-car radiotelephone that
with a gross capacity of 256 KBytes (0.025 GBytes) each. Made by got hacked and converted to amateur radio use. Oops, I should not
Pertec (Chatsworth & Irvine, CA) and the case cover sprayed RCA forget a home / game computer called COMX35.
blue according to a leaflet I found, this monster called Model 3712 Today, a small group of people still enjoy working with the CDP1802
weighs 34 kgs (75 lbs). The same drive units but in a different colour Cosmac CPU; they can be found within the ELF communities on the
were supplied to Altair for their 8080 based systems, and very likely web. Personally, I am using the Cosmac IV system occasionally to
to other minicomputer manufacturers. The unit produces a horren- tweak the software of my DIY hothouse climate and irrigation con-
dous amount of noise due to a huge extractor fan and the two disk trol based on a good old CDP1802. I cheerfully use things like PL/M,
drive motors spinning all the time (probably to keep disk access CDOS, UT5, MOPS, BASIC1, and ASM8. The bulky disk drives and the
times within limits). A loud clack is heard whenever a floppy disk Micromonitor are no longer used, the former being emulated by
gets selected or released. The hum of the heads racing across on the two SMD static RAMs with battery backup! For sure I can appreciate
disk surface would make a nice ringtone. Inside the case, a control 30 years of progress and miniaturisation we all achieved in micro-
board roughly the size of two iMacs is seen, stuffed with 150-odd ICs controller systems and components. True, all 70 kgs (155 lbs) worth
mostly plain TTL running at 5 V. Noisy, hot and slow as it may be, of CDP18S008 should easily fit in, say, a single Xilinx Spartan FPGA.
the dual disk drive unit turned out to work reliably after 30 years I know, my Cosmac IV system really belongs in a computer museum.
all 8-inch disks I got from the previous owner could be read without On the Internet, a 1976 price of $70,000 was mentioned some-
problems and I am now considering starting an 8-inch-to-USB-stick where for a full blown CDP18S008 system like the one described
On Demand Conversion Service. here. I have no way of verifying. All I know is that the previous owner
The third component of the system is called Micromonitor never quite managed to recoup the cost of his system through
(CDP18S030), where micro definitely refers to microcontroller, developing, selling and supporting highly specialized applications
not size. Its an aluminium suitcase, again sprayed RCA blue, con- commissioned by clients including government institutions. Its a
taining not much more than LEDs, switches and ZIF sockets. The sobering thought that today microcontroller development systems
idea was to migrate the CPU from the customer application to the are available at give-away prices from the manufacturers.
Micromonitor (via a length of 40way ribbon cable) and then sort of
single-step the firmware to watch what the CPU lines were doing! If any Retronics reader out there has any original RCA Cosmac CDP-
So, the blue suitcase not unfit for a travelling salesman appearing 18Sxx disks containing software tools or higher level programming
on The Jetsons was intended to help debug CDP1802 applications languages, please let me know. The same for a CDP18S021 Micro-
in-system, in real time, on site! But just how? I really cant figure terminal running UT5.
out because you soon need to view hex code and possibly enter it in (110528)
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
elektor 12-2011 77
Personal Download for I Elektor
52429
ELEKTORSHOWCASE
To book your showcase space contact Elektor International Media
Tel. 0031 (0) 46 4389444 Fax 0031 (0) 46 4370161
ELNEC
www.elnec.com
TO BOOK YOUR
Europes leading device
programmers manufacturer:
reliable HW:
SHOWCASE SPACE
CONTACT ELEKTOR
www.
3 years warranty for most programmers
support over 58.000 devices
free SW updates INTERNATIONAL MEDIA elektor.
SW release: few times a week
excellent technical support:
Algorithms On Request, On Demand SW
Tel. 0031 (0) 46 4389444 com
all products at stock / fast delivery Fax 0031 (0) 46 4370161
78 12-2011 elektor
Personal Download for I Elektor
52429
TYDER
http://www.tyder.com
ONEoverT Digital Filter Design Software (Full
version for only 30)
Design FIRs, IIRs, NCOs, FFTs for DSPs and
FPGAs
TO BOOK YOUR
ROBOT ELECTRONICS VHDL Code Generators
SHOWCASE SPACE
http://www.robot-electronics.co.uk Makes DSP design simple
elektor 12-2011 79
Personal Download for I Elektor
52429
Going Strong
A world of electronics LabWorX: Straight from the Lab to your Brain
W!
applications. Besides the Bus protocol
NE
plenty of attention is given to the practical
applications and designing a solid system.
The most common IC compatible chip
classes are covered in detail. Two experi-
mentation boards are available that allow
for rapid prototype development. These
are completed by a USB to IC probe and a
software framework to control IC devices
from your computer.
ore
This book and m
are available at A highly-practical guide
m/books
www.elektor.co Linux PCelectronics
Fully elaborated -basedprojects
Measurement Electronics
309 Circuits
Books
80 Prices and item descriptions subject to change. E. & O.E 12-2011 elektor
Personal Download for I Elektor
52429
Bestseller!
Circuits, ideas, tips and tricks from Elektor
CD Elektors Components
416 pages ISBN 978-1-907920-02-8
34.50 US $55.70
and control of really useful peripherals. It of eight databanks covering ICs, transistors,
details a project which will enable you to Elektor diodes and optocouplers. A further eleven
instruct your computer using your voice Regus Brentford applications cover the calculation of, for ex-
and get it to control electrical devices, tell 1000 Great West Road ample, zener diode series resistors, voltage
you the time, check your share values, get Brentford regulators, voltage dividers and AMVs. A
the weather forecast, etc. and speak it all TW8 9HH colour band decoder is included for deter-
back to you in a natural human voice. If United Kingdom mining resistor and inductor values. All da-
you are interested in the practical techno- Tel.: +44 20 8261 4509 tabank applications are fully interactive,
logy of interfacing with machines using Fax: +44 20 8261 4447 allowing the user to add, edit and complete
voice, then this book is your guide! Email: order@elektor.com component data.
elektor 12-2011 81
Personal Download for I Elektor
52429
Bestseller!
FT232R USB/
All articles in Elektor Volume 2010
Serial Bridge/BOB
DVD Elektor 2010
(September 2011)
This DVD-ROM contains all editorial arti- USB Long-Term
Weather Logger
cles published in Volume 2010 of the Youll be surprised rst and foremost by
Kits & Modules
English, Spanish, Dutch, French and Ger- the size of this USB/serial converter no
(September 2011)
man editions of Elektor. Using the supplied larger than the moulded plug on a USB ca-
Adobe Reader program, articles are pre- ble! And youre also bound to appreciate This stand-alone data logger displays
sented in the same layout as originally that fact that its practical, quick to imple- pressure, temperature and humidity rea-
found in the magazine. An extensive ment, reusable, and multi-platform dings generated by I2C bus sensors on an
search machine is available to locate and yet for all that, not too expensive! LCD panel, and can run for six to eight
keywords in any article. With this DVD you Maybe you dont think much of the vario- weeks on three AA batteries. The stored
can also produce hard copy of PCB layouts us commercially-available FT232R-based readings can be read out over USB and
at printer resolution, adapt PCB layouts modules. Too expensive, too bulky, badly plotted on a PC using gnuplot. Digital
using your favourite graphics program, designed, Thats why this project got sensor modules keep the hardware sim-
zoom in / out on selected PCB areas and designed in the form of a breakout board ple and no calibration is required.
export circuit diagrams and illustrations (BOB).
to other programs. Kit of parts incl. PCB, controller, humidity
PCB, assembled and tested sensor and air pressure sensor modules
ISBN 978-90-5381-267-9
23.50 US $37.90 Art.# 110553-91 12.90 US $20.90 Art.# 100888-73 31.10 US $50.20
82 Prices and item descriptions subject to change. E. & O.E 12-2011 elektor
Personal Download for I Elektor
52429
US $
Bestsellers
Product Shortlist
Books Books
programmed controller ........................................... 35.50.......57.30
ISBN 978-1-907920-08-0 .... 29.50 .....US $47.60
Simple Bat Detector
110550-1 ...... PCB, bare ................................................................... 8.85.......14.30 Design your own
OnCE/JTAG Interface 3 PC Voice Control System
ISBN 978-1-907920-07-3 .... 29.50 .....US $47.60
110534-91 .... Programmer board, assembled and tested ............... 35.60.......57.30
Here comes the Bus! (9)
4 Mastering the IC Bus
elektor 12-2011 83
Personal Download for I Elektor
52429
Andropod
Android devices are ideally suited to use in conjunction with embedded electronics. For
little money they offer access to a display, computing, various interfaces and sensors. The
big problem however is to pinpoint the connectivity between the Android device and the
hardware connected to it. The Elektor Andropod was developed specifically with that in
mind: its an Android USB interface with host functionality
Digital VU Meter
In Part 7 of our DSP course, the DSP board gets combined with an LED VU meter. This setup
enables the levels of two digital audio signals to be visualised with great accuracy. The
VU meter employs special LED driver ICs from Texas Instruments and has a display made
from 2 x 40 LEDs. If you think thats not enough, you can simply connect multiple boards
in series.
Article titles and magazine contents subject to change; please check the magazine tab on www.elektor.com
elektor Uk/european January 2012 edition: on sale December 15, 2011. elektor USA January 2012 edition: published December 12, 2011.
84 12-2011e lektor
Personal Download for I Elektor
52429
Order Form
12-2011
Description
29.50
METHOD OF PAYMENT
(see reverse before ticking as appropriate)
Design your own PC Voice
Control System NEW 29.50 Bank transfer
Cheque
(UK-resident customers ONLY)
Controller Area Network Projects 29.50
LabWorX Mastering the IC Bus 29.50
Linux PC-based Measurement Electronics 29.50
CD 1001 Circuits 34.50
Sub-total
Please send this order form to*
P&P (see reverse for conditions)
Prices and item descriptions subject to change.
The publishers reserve the right to change prices
without prior notification. Prices and item descriptions Total paid Elektor
shown here supersede those in previous issues. E. & O.E.
Regus Brentford
1000 Great West Road
Brentford TW8 9HH
Name United Kingdom
Tel.: +44 20 8261 4509
Address + Post code
Fax: +44 20 8261 4447
www.elektor.com
order@elektor.com
*USA and Canada residents should use $ prices,
and send the order form to:
Tel. Email Elektor US
PO Box 180
Vernon CT 06066
Date Signature USA
Phone: 860-875-2199
Fax: 860-871-0411
EL12
E-mail: order@elektor.com
Order Form
Subscription-Plus
(11 issues plus the Elektor Volume 2011 DVD-ROM TIP
+ exclusive access to www.elektor-plus.com)
* Offer available to Subscribers who have not held a subscription
to Elektor during the last 12 months. Offer subject to availability.
See reverse for rates and conditions.
Expiry date: _______________________
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
EL12 service@elektor.com
Personal Download for I Elektor
52429
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. 40270211 held by Elektor International Media BV with The Royal Bank of Scotland, London.
IBAN: GB96 ABNA 4050 3040 2702 11. BIC: ABNA GB2L. Currency: sterling (UKP).
Please ensure your full name and address gets communicated to us.
Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident
customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country.
GCredit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is
SSL-protected for your security.
COMPONENTS
Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply
of components are envisaged, a source will normally be advised in the ar ticle. Note, however, that the source(s) given is (are) not
exclusive.
TERMS OF BUSINESS
Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran-
tee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before
obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the
dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods
Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21-days (all other countries).
Cancelled orders All cancelled orders will be subject to a 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 responsi-
bility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards,
programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party adver-
tisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording,
in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of
these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for
private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss
or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor
other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any
question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England.
January 2011
January 2011
Personal Download for I Elektor
52429
dsPIC/PIC24-Bundle
Advantageous hardware/software solution for rapid project development
This solution is perfect for anyone wanting to
develop systems based around Microchips
powerful 16 bit core products. The pack is
supplied with a dsPIC30F2011 device, and is
fully compatible with the full range of E-block
boards and accessories. Datasheets on each
individual item are available separately.
Contents:
s &LOWCODE FOR DS0)#0)# 0ROFESSIONAL 6ERSION
s 53"