Professional Documents
Culture Documents
52429
are n
s tow
June 2012 AUS$ 14.90 - NZ$ 17.90 - SAR 105.95 - NOK 102 £ 4.90
b e
Tu ck in
ba
www.elektor.com
Nixie
Thermometer / o r s a n d
i g n
, s e n s e d e s
Hygrometer Tub e s n g l
in a si i c ro
am
✚ Embedded Linux Made Easy
and the hardware too
✚ Computer-driven Heliostat
Servos track the sun or the stars
6 Colophon
Who’s who at Elektor.
4 06-2012 elektor
Personal Download for I © Elektor
52429
Volume 38
72 2-Wire Interface
for Illuminated Pushbuttons
Look at this circuit if you want a
doorbell pushbutton and the in-built
light to operate on the same two-wire
This project shows an example for a heliostat, built using two servo motors. 73 Component Tips
Raymond’s Pick of the Month: MOSFETs +
The position of the sun with respect to time and the location on Earth is cal-
Extras (2); BTS432E2
culated using a mathematical model. The result is used to drive the servos and
make them point in the direction of the sun or the stars.
74 Retronics
Intersil IMS6100 Vintage Dev Kit
Series Editor: Jan Buiting.
76 Hexadoku
Elektor’s monthly puzzle with an
electronics touch.
elektor 06-2012 5
Personal Download for I © Elektor
52429
elektor
The Team
Managing Editor: Jan Buiting (editor@elektor.com)
International Editorial Staff: Harry Baggen, Thijs Beckers, Eduardo Corral, Wisse Hettinga, Denis Meyer, Jens Nickel, Clemens Valens
Design staff: Thijs Beckers, Ton Giesberts, Luc Lemmens, Raymond Vermeulen, Jan Visser
Membership Manager: Raoul Morreau
Graphic Design & Prepress: Giel Dols, Mart Schroijen
Online Manager: Carlo van Nistelrooy
Managing Director: Don Akkermans
The Network
Volume 38, Number 426, June 2012 ISSN 1757-0875 elektor is published 11 times a year with a double issue for July & August. Head Office: Elektor International Media b.v.
P.O. Box 11 NL-6114-ZG Susteren The Netherlands.
Publishers: Elektor International Media, Regus Brentford, Subscriptions: Elektor International Media, Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161
1000 Great West Road, Brentford TW8 9HH, England. Regus Brentford, 1000 Great West Road,
Distribution:
Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Brentford TW8 9HH, England.
Seymour, 2 East Poultry Street, London EC1A, England.
www.elektor.com Tel. +44 208 261 4509, fax: +44 208 261 4447 Telephone:+44 207 429 4073
Internet: www.elektor.com/subs
the magazine is available from newsagents, bookshops and Email: subscriptions@elektor.com UK Advertising: Elektor International Media b.v.
electronics retail outlets, or on subscription. Rates and terms are given on the Subscription Order Form. P.O. Box 11 NL-6114-ZG Susteren The Netherlands.
6 06-2012 elektor
Personal Download for I © Elektor
52429
elektor
Membership Counter
We
now have 277285 members
in 83 countries.
Supporting Companies
AudioXpress Jackaltac
www.audioamateur.com . . . . . . . . . . . . . . . . 53 www.jackaltac.com . . . . . . . . . . . . . . . . . . . 41
Cadsoft MikroElektronika
www.element14.com/eagle-competition . . . . . . . 43 www.mikroe.com. . . . . . . . . . . . . . . . . . . . . . 3
Telephone: +31 46 4389444, Fax: +31 46 4370161 (other than third-party advertisements) are copyright elektor articles implies permission to the Publisher to alter the text and
Email: j.dijk@elektor.com International Media b.v. and may not be reproduced or transmit- design, and to use the contents in other elektor International
Internet: www.elektor.com ted in any form or by any means, including photocopying, scan- Media publications and activities. the Publishers cannot guaran-
Advertising rates and terms available on request. ning and recording, in whole or in part without prior written per- tee to return any material submitted to them.
mission from the Publisher. Such written permission must also be
Copyright Notice obtained before any part of this publication is stored in a retrieval Disclaimer
the circuits described in this magazine are for domestic use system of any nature. Patent protection may exist in respect of Prices and descriptions of publication-related items subject to
only. All drawings, photographs, printed circuit board layouts, circuits, devices, components etc. described in this magazine. change. errors and omissions excluded.
programmed integrated circuits, disks, CD-roMs, software the Publisher does not accept responsibility for failing to identify
carriers and article texts published in our books and magazines such patent(s) or other protection. the submission of designs or © Elektor International Media b.v. 2012 Printed in the Netherlands
elektor 06-2012 7
Personal Download for I © Elektor
52429
The Prizes:
1. DELL Alienware M17x r3 + EAGLE version 6 Professional incl. all three
modules.
2. MICROCHIP DV164037 Kit, Eval, ICD3 w/ Explorer-16 & DM163022-1 8-Bit
development board + EAGLE Version 6 Professional incl. all three modules.
3. EAGLE Version 6 Standard incl. all three modules.
The outcome of the competition will feature peer-voting from the element14
community. Members of the world’s leading technology community can ‘like’
8 06-2012 elektor
Personal Download for I © Elektor
52429
While small in size, the Zcd has a high-performance Cirrus Logic DAC and a fully inde-
pendent power supply for the analog circuits. With its built-in preamplifier functions,
the Zcd and included remote control can be teamed with Parasound’s Zamp v.3 class
AB stereo amplifier and a pair of speakers to make a compact, high-performance audio
system.
The Zcd plays conventional Compact Discs as well as MP3 files from a CD-R. It also func-
tions as a basic DAC-preamplifier with a USB input for MP3 files on a flash drive. It has an
analog 3.5 mm stereo line-input jack for portable players and other line-level sources.
The Zcd has fixed and variable line outputs as well as coaxial and optical digital audio
outputs. The source selection, track and MP3 file selection, and variable outputs are all
operated via the supplied remote control. The Zcd volume adjustments are controlled
by an independent analog volume control IC, not digitally inside the DAC.
limit to meet its specific input supply limi- The Zcd uses a 24-bit, 192 kHz-capable Cirrus Logic CS4353 DAC with a Cirrus Logic
tations for greater output power, a tech- CS8416 digital receiver. The circuitry boasts fifth-order multi-bit delta-sigma architec-
nique known as asymmetric power shar- ture with low latency digital filtering. It also includes analog filtering and ideal differ-
ing. In contrast, common regulators must ential linearity along with very high tolerance to clock jitter. The Zcd delivers excellent
current share, a feature where each input low frequency performance without external DC blocking capacitors. The analog cir-
supply contributes equally to the load, cuits are powered by an entirely independent analog power supply with its own power
which is restricted by the least powerful transformer.
input rail. Applications for the LTM8026 For custom installers, the Zcd has a rear-panel IR input and one-way RS232 serial con-
include point of load regulation in systems trol port. There are three turn-on options: manual, automatic when AC is supplied,
with 24 V and 12 V supplies such as VXI and 12V trigger. There is even a 12 V trigger output to turn on a Zamp v.3 amplifier
bus, for automotive, medical and indus- automatically.
trial end-markets. Like all Parasound Z Custom components, it is one rack-space high and 9-1/2-inches
Like other Linear Technology µModule reg- wide; half of a standard rack width. It can be used with Parasound’s SBS side-by-side
ulators, the LTM8026 includes the DC/DC bracket to link two Z Custom units together, or Zblank for mounting across one rack
controller, power switches, power induc- space. Parasound also offers its half-width Zrack for mounting up to five Z Custom
tor, compensation and a modest amount components.
of input and output capacitance in a sur- The Parasound Zcd is now available with a manufacturer’s suggested retail price
face mount package. The current limit is of $400.
adjustable by applying a voltage or resistor www.parasound.com (120332-X)
divider and can be automatically decreased
with rising junction or ambient temperature
using a thermistor to prevent the LTM8026
or load from overheating. externally adjustable soft start, adjust- Integrated 8-bit MCU
The LTM8026 operates from an input volt- able switching frequency and thermal with RF transmitter
age between 6 V to 36 V and regulates an shutdown.
output voltage between 1.2 V and 24 V The LTM8026 is packaged in a thermally
on a single chip
set by a single resistor. In a 12 V to 3.3 V efficient 11.25 mm x 15 mm x 2.82 mm Microchip’s new PIC12LF1840T48A 8-bit
output application, the LTM8026 achieves LGA package. Two temperature grades, E microcontroller (MCUs) offers a single-
an operating efficiency of 89% at 2 A. For and I for the –40°C to +125°C temperature chip solution for developing low power
noise-sensitive applications, the µModule range, are available for immediate delivery wireless designs. The combination of an
regulator can be synchronized to an exter- from stock. extremely low operating voltage and com-
nal clock frequency in the range of 100 kHz www.linear.com/product/LTM8026 pact 14-pin TSSOP package, make the
to 1 MHz. Additional features include (120332-VII) PIC12LF1840T48A ideal for developing
elektor 06-2012 9
Personal Download for I © Elektor
52429
10 06-2012 elektor
Personal Download for I © Elektor
52429
elektor 06-2012 11
Personal Download for I © Elektor
52429
RL78
Green Energy
Challenge
Renesas’ true Low Power MCU platform
By Mohammed Dogar (Germany) when they’re required. The ability to wait in a very low power state
until action is required and then wake up to take necessary action
In our Green Energy world many electronic designs are driven by and do so while using as little current as possible is one that can
requirements for reduced size, improved scalability, intelligent func- dramatically extend useful lifetimes.
tionality and most importantly low power consumption. Renesas’ RL78 MCUs are recommended solutions for embedded
The Renesas RL78 microcontroller (MCU) family is specifically systems that mandate low-power operation requirements because
designed to meet these demands by incorporating the highest they provide advanced power-management capabilities.
peripheral integration, intelligent CPU architecture and advanced
power-management capabilities to enable ‘True Low Power Design’. These functions allow the MCU to operate as follows:
In addition to excellent general low power characteristics RL78
MCUs incorporate special functions to minimise operating current. 1) run with exceptional power efficiency in the normal Run Mode;
Major sections of the MCUs can be turned off, while key peripheral 2) disable CPU operation, saving power in Halt Mode (allowing fast
blocks of the device continue to function. CPU wake-up time);
This smart low power operation is achieved with the unique ‘Snooze 3) disable more of the MCU functions in the Stop Mode to save the
Mode’ capability. Snooze Mode dramatically reduces the power con- most power (at the expense of a longer CPU wake-up time);
sumption of many typical MCU functions. The power savings are 4) Snooze Mode delivers even greater power savings.
accomplished by allowing common data acquisition or data-trans-
mission functions to operate without the need to wake up the CPU. Figure 1 shows an operational flow diagram for these three modes.
This operational flexibility is a significant advantage over other low-
power modes in which the CPU must remain active and assist with
common peripheral functions. RL78 MCU — Snooze Mode operation
In a system that periodically measures an analogue signal, the The Snooze Mode lets some peripheral functions wake up and exe-
Snooze Mode enables an RL78/G13 MCU to achieve over 30% cute simple operations while the rest of the MCU is stopped. This
reduction in the system’s average power dissipation compared to saves a significant amount of power compared to the Run or Halt
an implementation without this mode. Modes because in Snooze the CPU is off and only the peripherals
Besides Snooze Mode, RL78 MCUs have other important low-power that must operate are enabled.
characteristics that are valuable for power-constrained designs. Data reception from the synchronous serial port, the UART or a data
Their wide operating range, from 1.6 V to 5.5 V, suits battery-based conversion by the A/D converter can operate in the Snooze Mode by
applications where the voltage (Vcc) drops over time as the battery waking up the associated port, but not the CPU.
gradually discharges. The A/D converter can ‘wake up’ when the RTC or the Interval Timer
generates interrupt signals to start a conversion. Similarly, the syn-
chronous serial port can ‘wake-up’ when the Serial Clock input pin
RL78 MCU — reducing power consumption over 30% edge is detected, and the UART can ‘wake up’ when an edge on the
In extreme applications some battery operated equipment must RxD input is detected.
run off a battery for their entire operating lifetime, without any After any data reception opera-
recharges whatsoever. Such designs require the lowest operating tion in Snooze Mode is completed,
current possible. It is absolutely critical to turn-off functions in the a ‘match condition’ is checked. If
system whenever they aren’t needed and wake-up functions only the condition is a match, then the
Mohammed “Mo” Dogar works for Renesas Europe as a product marketing manager, focused on
promoting and selling microcontroller devices into major OEMs and distributors.
Mo’s group defines and develops MCU product roadmaps and development support infrastructure for
wide range of Industrial and Consumer electronics applications.
12 06-2012 elektor
Personal Download for I © Elektor
52429
Advertisement
GET MORE WITH THE
CLASS LEADING OSCILLOSCOPES
PicoScope 6000 Series
MORE MODELS • MORE CHOICE
1 MORE FEATURES AS STANDARD
MCU exits the Snooze Mode and enters the Run Mode. If the condi-
tion isn’t a match, operation returns to the Stop Mode. Thus, the
CPU can be activated only when the data received requires action
from the CPU. Figure 2 illustrates Snooze Mode using the ADC trig-
gered by timer.
For example, A/D conversion uses only 0.5 mA in Snooze Mode,
rather than 5 mA in Run Mode, hence dramatic power consump-
tion advantages are obtained. Highest sampling rate and deepest
Thus, an A/D conversion can be performed in Snooze Mode using memory of any scope for this budget
only 0.5 mA, 90% less than the 5 mA required to make a conversion
in Run Mode.
2 www.picotech.com/PS145
elektor 06-2012 13
Personal Download for I © Elektor
52429
Nixie
Thermometer / Hygrometer
tubes, sensors and
a micro in a single design
By Hans Oppermann (Germany)
When I first laid eyes on the cover of the precision thermometer for use in my living controller, a sensor, a step-up converter
January 2011 edition of Elektor magazine room, I soon decided to develop my own based on an MC34063 and a Nixie driver IC
I was determined: I had to have a Nixie circuit that would meet my demands, com- consisting of the good old 74141. The cir-
Tube Thermometer myself! Before getting bining them of course with these fine, newly cuit is shown in Figure 1. No SMDs, except
started, I did some research on Nixie Tubes discovered Nixie tubes. for the sensor, are used in order to make
and was astounded by the sheer number of construction as straightforward as possible.
types available on the market. I stumbled Hardware The power supply is very similar to the one
upon a certain model — the IN-19A — that The majority of the components were used in the above mentioned article. An
displayed a variety of physical units. While already pretty much predetermined by the external 12–15 V DC power supply (power
I had some experience using Sensirion SHT Elektor Nixie Thermometer project. At the adapter) should be used to power the circuit
sensors and also on the lookout for a high basic level this circuit consists of a micro- via K1. Regulator IC6 generates a steady 5 V
Features
• Sensor:Sensirion SHT21 [1] • Tubes: Russian IN14 and IN19A
• Temperature range: 0 to 99 degrees Celsius in tenths of degrees • Microcontroller: Microchip PIC16F876-20/SP
• Humidity range: 0 to 99 % in tenths of percents • Firmware: C (MPLAB) (source and hex files available for free
• Power supply: AC power adaptor, 12 V to 15 V download from [2])
• Current consumption: about 300 mA at 12 V
14 06-2012 elektor
Personal Download for I © Elektor
test & measurement
15
Figure 1. Clearly, the circuit resembles the earlier Nixie Thermometer project. There are a few differences, though.
R1 R2 R3 R4
C4 C1 C2 C3
22k
22k
22k
22k
V2 100p V3 100p V4 100p V1 100p
K3
IC8 Nixie IN14 Nixie IN14 Nixie IN14 IN-19A
5
1
SCL’ 6 3
VDD
SCL NC C12
SDA’ 1 4 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 °C % KµmnMP
SDA NC 100n
VSS
12
10
11
13
12
10
11
13
12
10
11
13
12
10
11
2
3
4
5
6
7
8
9
3
4
5
6
7
8
9
3
4
5
6
7
8
9
2
7
8
4
5
6
3
9
SHT21
2
13
14
11
10
16
15
13
14
11
10
16
15
13
14
11
10
16
15
13
14
11
10
8
9
1
2
8
9
1
2
8
9
1
2
8
9
1
2
O0
O1
O2
O3
O4
O5
O6
O7
O8
O9
O0
O1
O2
O3
O4
O5
O6
O7
O8
O9
O0
O1
O2
O3
O4
O5
O6
O7
O8
O9
O0
O1
O2
O3
O4
O5
O6
O7
O8
O9
+5V 5 5 5 5
VCC VCC VCC VCC
C5 IC1 C6 IC2 C7 IC3 C8 IC4
R5
D2 C11
100n 12 74141 100n 12 74141 100n 12 74141 100n 12 74141
10k
A1
A2
A3
A0
A1
A2
A3
A0
A1
A2
A3
A0
A1
A2
A3
D3
1N4001
3
4
20
1 28
330R
10k
10k
MCLR/VPP RB7/PGD
27
RB6/PGC
26
OSC2/CLKOUT
4 7
OSC1/CLKIN
RA2/AN2/VREF- RA5/AN4/SS
5 6
RA3/AN3/VREF+ RA4/T0CKI
L1 BYV26
VSS
VSS
330uH R9 R7
10
19
X1 D1
820k
47k
T1
IC6
6
C9 6MHz D4 7805
C10 +5V
VCC
1 3 1 5 T3
SC CI
33p 33p
R14 MPSA42
1N4004 IC7 C13
K1 7 2 T2
470k
IS SE
2
C14 C15 C16 MC34063
8 3 10u
DC TC IRF820 250V
R16
GND
R13
100u 100u 100n C17 R15 MPSA42
25V 25V C18 C19
150R
4k7
5k6
4
100n
100n 470p
06-2012
110321 - 11
elektor
52429
52429
COMPONENT LIST
Resistors
R1-R4 = 22kΩ
R5,R11,R12 = 10kΩ
R7 = 47kΩ
R8 = not used
R9 = 820kΩ
R10 = 330W
R13 = 5.6kΩ
R14 = 470kΩ
R15 = 4.7kΩ
R16 = 150W
Capacitors
C1-C4 = 100pF 2000V, 10%, radial, 5mm pitch
(Farnell #1141797)
C5-C8,C11,C12,C16-C18 = 100nF 50V, 20%,
pitch 5mm
C9, C10 = 33pF 100V, 5%, 2.54mm pitch
C13 = 10µF 250V, 20%, radial, 5mm pitch
C14,C15 = 100µF 25V, 20%, radial, 2.5mm
pitch
C19 = 470pF, 100V, 10%, 5mm pitch
Inductors
L1 = 330µH 1A, 20%, axial, D×L = 11×32.5 mm
(0.43”×1.28”) max.
Figure 2. The PCB can be ordered via the Elektor Shop or an artwork PDF can be
Semiconductors downloaded from the project web page [2].
D1 = BYV26
D2-D4 = 1N4001
IC1-IC4 = 74141 or K155ID1 (К155ИД1)
IC5 = PIC16F876-20/SP
IC6 = 7805 T3 = IRF820 K1 = 2-way PCB terminal block, 5mm pitch
IC7 = MC34063 PCB # 110321-1, available via www.elektor.
Miscellaneous com/110321
IC8 = SHT21 I2C humidity and temperature
sensor [1] (Farnell #1855468) X1 = 6MHz quartz crystal
T1,T2 = MPSA42 V1 = IN-19A, Nixie Tube (symbols)
V2-V4 = IN-14, Nixie Tube (numeric)
for powering the microcontroller and the cycle of the PWM signal applied to the base PIC powered at 5 V. The Low level of SDA
74141 decoder ICs. The high voltage sup- of T2 results in a higher voltage at the base and SCL is ‘generated’ by tying the pins to
ply required for the Nixie tubes is gener- of T1, which in turn results in a higher volt- ground, while the High level signal is ‘gen-
ated with IC7. This PWM controller switches age supplied to the Nixie tubes and thus erated’ by floating the PIC output pins. Pull-
MOSFET T3 in order to step up the voltage, a brighter lighting display. This way the ups R11 and R12 then define the SDA and
using inductor L1 and Schottky diode D1. switching between humidity and tem- SCL levels as High (3.3 V).
The output voltage is given by perature display can be done quite nicely At the core we find the PIC16 microcon-
by slowly increasing the PWM duty cycle, troller. Its 6 MHz clock is generated by exter-
Vo = Vref × R9 / R13 resulting in dimming of the filaments and, nal quartz crystal X1. Since this circuit func-
after applying the new settings for the Nixie tions stand alone, it requires no controls or
which, with the given values results in drivers, slowly decreasing the duty cycle other interfaces. The software runs by itself
of the PWM signal again, increasing the and alternates between the displayed meas-
Vo = 1.25 V × 820 kΩ / 5.6 kΩ = 183 V. brightness of the newly selected filaments. ured values automatically.
R1-4 take the high voltage supply to the The sensor used for measuring temperature Software
anodes of the IN-14 tubes, giving an oper- and humidity differs from the one used in Designed in C using the MPLAB IDE, the
ating voltage of around 143 V. With this the earlier Elektor Nixie Tube Thermometer. software is quite straightforward. Temper-
relatively high voltage the tube filaments In this circuit a Sensirion SHT21 [1] is used. ature and humidity are periodically read
will light up brightly. If less brightness is This calibrated sensor emits its data digi- out from the SHT21 sensor via its digital I2C
needed, R9 may be replaced by 680 kΩ, tally via an I2C interface. It requires a 3.3 V interface and received at the corresponding
resulting in a voltage of about 152 V at the supply, which is generated using the volt- ports of the PIC. Sample codes for interfac-
supply output. age drop across two diodes (D2, D3). Con- ing the sensor are freely available in C from
The high voltage supply line to the Nixie necting SCL and SDA with a pullup resistor the Download Center on the Sensirion web-
tubes can be controlled by the microcon- to 3.3 V on the sensor side prevents the site, which makes it very easy to implement
troller via T1 and T2. Reducing the duty upper voltage limits to be exceeded by the these functions in our firmware.
16 06-2012 elektor
Personal Download for I © Elektor
52429
For clarity’s sake, the output to the decod- using a four-wire cable and SIL headers (K2, An electrically insulated enclosure should
ers is generated using a lookup table. K3). In one corner of the PCB there is a sepa- be used, since the circuit generates high
Since there is no ‘F’ filament in the IN- rate section for mounting the sensor, C12 voltages. It’s important that no metal parts
19A, a Fahrenheit indication option is not and connector K3. This section can be cut are exposed. Nylon screws and insulating
implemented. off and located away from the main board. sockets should also be used or other insu-
Mounting the components on the PCB is a lating measures should be taken.
Construction breeze. As usual, start with the low profile
The PCB (see Figure 2) can be ordered via ones like resistors and place the ones with Nixie tubes
the project web page [2] or a .pdf with the the tallest ones last. Guiding the leads of the Nixie tubes and 74141 decoder ICs are read-
layout can be downloaded from the same Nixie tubes through the PCB might try your ily available on Ebay. Especially from the for-
page in case you want to etch the board patience. However, there is a trick to this, as mer USSR several large (ex military?) quan-
yourself. described in last month’s E-labs Inside sec- tities are offered at affordable prices. Pro-
tion [3]: cut the leads in a ‘staircase’ fashion, duction of tubes lasted well into the 1980s;
The sensor should be positioned a minimum each one a little shorter than the one next some say because of technological back-
of about 15 cm (5 inches) away from the cir- to it. Now they can be easily guided through wardness, others argue the tube’s superior
cuit. The heating of the components, espe- the PCB holes one at a time. Pay close atten- immunity to EMP made it the best choice
cially the 74141 decoder ICs, may impair an tion to its orientation. An arrow on the bot- for active components.
accurate temperature measurement. The tom of the tube indicates pin 1 (see also the In this design especially the IN-19A is
sensor is connected to the controller board datasheet). remarkable. This tube is especially con-
advertisement
www.techthefuture.com
Follow Tech the Future
elektor 06-2012 17
Personal Download for I © Elektor
52429
structed to display symbols of units. Our Nice to know: notice how the ‘2’ and ‘5’ last year in Elektor also showed these symp-
circuit only uses two of them: ‘%’ and ‘°C’. filaments in the IN-14 number tubes are toms. Some investigation may be in order
Note the suffix ‘A’! See also the head illus- actually the same, only one is upside down. here.
tration. For those having trouble reading Budget cuts or just clever engineering?
Cyrillic characters, here’s the ‘translation’ At the time of writing the author is working
of the table: To round up on a wireless solution where the sensor is
Once assembled and fully connected, the fitted in a separate enclosure together with
IN-19A IN-19B IN-19V circuit should work right away. No cali- the PIC and an RFM-12.
brations or other setup procedures are
% S –
required. The accuracy tolerance of the sen- A short impression of the circuit and the
M F A/B sor is ±0.3 °C typical (between 5 and 60 °C), fading effect can be found on the Elektor
P H ~ while the resolution can reach 0.01 °C. YouTube channel [4].
m V ∏ Consequently, with a displayed tempera- (110321)
ture of 25.0 °C the real temperature can be
K T <
between 24.7 and 25.3 °C.
n A >
µ Hz dB A side note on the sensor: the humidity
°C Ω + measured by the sensor can be quite off
the mark. That’s a little strange for a cali-
brated sensor, don’t you think? Perhaps it
Pay close attention: the Cyrillic ‘B’ translates has something to do with mounting the
to our ‘V’. The ‘Б’ would be pronounced as sensor on the main PCB, as was done with
the ‘B’ of our Western character set. our prototype. A logging circuit published
Internet Links
About the author
[1] www.sensirion.com/sht21
Hans Oppermann was educated as a radio and television engineer between 1963 and 1966,
followed by a degree in Physical Engineering. Until his retirement in 2006, he worked as [2] www.elektor.com/110321
a Software Engineer with several software developing companies. He stayed loyal to his [3] www.elektor.com/120229
hobby and kept designing electronic circuits throughout his career, often related to elec- [4] www.youtube.com/ElektorIM
tric model airplanes. Since the arrival of microcontrollers, he built one into almost all of his
circuits — mostly resorting to the PIC variety — time and again staggered by the absence
of the need for complicated wiring. Among others, he also developed a weather station
with long-term data logging and wireless transmission, a measurement circuit for domestic Elektor Products & Resources
power usage, also with a wireless read out option, an infra-red readout of long-term values
• Source code and hex files
for PDA and a twilight switch for outdoor lighting.
• Printed circuit board
His preferred programming language is tcl/TK, which he also uses on his PDA to bypass op- Available via www.elektor.com/110321.
erating elements on electronic devices, such as the GUI on a PDA.
18 06-2012 elektor
Personal Download for I © Elektor
52429
The RL78
Green Energy Challenge
It’s time to turn those big ideas into great, green solutions!
Join the Renesas RL78 Green Energy Challenge today and
show the world how your design solutions will revolutionize
the way we experience energy efficiency.
@Renesas_Europe • www.facebook.com/renesaseurope
Deadlin
Participation in Weekly Challenges and receipt of partner
e
for ent
prizes is not a factor in selecting winners for the Grand
ries:
Cash Prize from Renesas. Remember, a complete Project
Entry is your Abstract, Complete Documentation, Photos
August
and all supporting Source Code, zipped in one compre-
31,
hensive file, labeled with your unique Project Registration
Number, and uploaded to the contest Dropbox. See web-
site for complete rules and details. Void where prohibited
2012
by law.
This month we close off the discussions of the individual boards that make up the preamplifier, both in
terms of theory of operation and construction.
The Log-Law Level LED approximately from the on/off ratio. voltage set by divider R9 and R10, D6 also
(LLLL) stage Referring to the circuit diagram in Fig- conducts, reducing the gain further by neg-
The Log Law Level LED, or LLLL, is to the best ure 1, IC1A with R1, R2, D1, D2 is a preci- ative feedback through R9. This simple cir-
of my knowledge, a new idea. A normal sin- sion half-wave rectifier circuit. Its output cuit clearly gives only a very approximate
gle-LED level indicator is driven by a com- when combined with the feed through version of a log law but it transforms the
parator, and typically goes from fully-off R3 provides a full-wave rectified signal to operation of the indicator.
to fully-on with less than a 2 dB change in IC1B; this is another precision rectifier that
level when fed with music (not sinewaves). establishes the peak level of the signal on The processed voltage is applied to compar-
It therefore does not give much informa- C2. This is buffered by IC2A to prevent load- ator IC5A, and if the threshold set by R21,
tion. The LLLL, on the other hand, incorpo- ing by the next stage, and the peak voltage R22 is exceeded the open-collector output
rates a simple logarithmic converter so the is applied to the very simple log-law con- of IC5A goes Low and the output of IC5B,
range from LED-always-off to LED-always- verter IC2B. For low level signals the gain is which simply acts as a logical inverter, goes
on is extended to 10 dB. The preamplifier set to unity by R6 and R7. As the input volt- High, removing the short across the LED
internal level is correct when the LED is on age increases, first D5 begins to conduct, connected to pinheader K6 and allowing it
about 50% of the time. This gives a much reducing the gain of the stage by increased to be powered by current source T1. There
better indication as you can judge the level negative feedback through R8. At a higher are two channels for stereo operation and
20 06-2012 elektor
Personal Download for I © Elektor
52429
R3 R5
20k 20k
R2
K6 MAIN PCB 20k
K1 D1 D2 R4 D3 D4
3
Line L 10k
1
C1 R1 1N4148 1N4148 1N4148 1N4148 C2 IC2A
2 6 2
20k
1 7
K2 RE2B 2u2 IC1A IC1B 2u2
RE1B 50V 3 5 50V
Phono L
D6
R10
K4 PHONO PCB 100k +17V'
D5
1N4148 D13
V23105-A5003-A201 R8 R9 R23 R24
1k 1N4148
1N4148
100R
RE1A C12 RE2A D14
22k
C13
1k
R7
10k 1N4148
220n 220n R6
6 T1
10k
R26 R27 7 7
IC2B
K5 5 1
220R
220R
IC5A R25
+Vre
6 BC557B
R21
22k
4
Phono 910R
2
Off IC5B
5
-17V' 22k
R22 8
K4 LLLL PCB 3 14 K6
IC5C
1 9 A
10 R16 IC4A K
LLL Led
2
13 10k
IC5D R19
11
10k
R17 -17V' K5 FRONT PCB
1k
D11
1k
R18
+17V'
IC1 = NE5532 1N4148 D12 R20
IC2 = NE5532 100k
IC3 = NE5532 1N4148
IC4 = NE5532
IC5 = LM339 R13 R15
20k 20k
K7 1000uH C10
K6 PHONO PCB
17V 8 C5 8 C6 8 C7 8 C8 3 C9
100u 25V
0 IC1 IC2 IC3 IC4 IC5
C11
17V 4 100n 4 100n 4 100n 4 100n 12 100n
L2 100u 25V
1000uH 120231 - 11
-17V'
the outputs of comparators IC5A and IC5C line input stage, where it can be used to 110650-6 shown in Figure 2. It contains
are wire-OR’d together to pull-up resistor check the incoming level of any input. This through-hole components only, hence
R23 so that a signal on either channel will switching is done by relay contacts RE1B, nothing should hinder you from producing
make the LED illuminate. IC5D is not used. RE1C. Series relay contacts RE2B, RE2C a working board straight off if you are care-
The LLLL can be switched to read either the allow the LLLL to be disabled when its job ful about placing and soldering the parts.
phono input directly (so the switched-gain is done and the flickering LED may become The same applies to the other three (four)
stage can be set up correctly) or the signal irritating. boards discussed below. The finished LLLL
after the input select relays and balanced The LLLL is built on circuit board no. board is pictured in Figure 3.
elektor 06-2012 21
Personal Download for I © Elektor
52429
22 06-2012 elektor
Personal Download for I © Elektor
52429
9 10
7 8
K1 FRONT PCB
110231 - 13
K5 (K7) PHONO PCB
5 6
Line-
Line+
K3 (K4) MAIN PCB
Line-
K17
220n
RE1A
RE2A
RE3A
RE4A
K16
K15
220n
220n
220n
C1
C2
C3
C4
PHONO+
PHONO-
MM
MC
RE4B
RE4C
K13
K14
RE1C
RE1B
RE2C
RE2B
RE3C
RE3B
0R
0R
0R
R1
R2
R3
RE1...RE4 = 4 x V23105-A5005-A201
S1
S2
S3
S4
3
1
K11
K10
K1
K3
K5
K7
K9
1
2 2
K12
2 2 1 2 1 2 1 2 1 2 1
MC
MM
Line
JP1
JP2
JP3
JP4
1
1
1
4
K2
K4
K6
K8
2 2 2 2
COMPONENT LIST
Input board (# 110650-3) K11 = XLR plug, PCB mount, horizontal, 3-way S1-S4 = 3-pin pinheader, 0.1’’ pitch (2.54mm)
K2,K4,K6,K8-K10,K12 = RCA/Phono socket, Jumpers for S1-S4,JP1-JP4
Resistors PCB mount, Pro Signal type PSG01545 (red) RE1-RE4 = V23105-A5003-A201, 12V/960Ω,
R1,R2 = 0Ω (R) or PSG01546 (white) (L) 230V/3A, DPDT
K13,JP1-JP4 = 2-pin pinheader, 0.1’’ pitch PCB # 110650-3 (www.elektorpcbservice.
Capacitors (2.54mm) com); 2 pcs required
C1-C4 = 220nF 10% 100V, 7.5mm lead pitch Socket header for K13
K14,K15,K16 = 4-pin pinheader, 0.1’’ pitch
Miscellaneous (2.54mm)
Socket headers for K14,K15,K16
K1,K3,K5,K7 = XLR socket, PCB mount,
K17 = 10-way boxheader, straight, 0.1’’ pitch
horizontal, 3-way
(2.54mm)
Figure 5. The preamplifier’s input board (here at 75% of its real size). Two of these are required for stereo operation.
Board available through www.elektorpcbservice.com.
elektor 06-2012 23
Personal Download for I © Elektor
52429
K4 POWER SUPPLY
+Vre K17 INPUT PCBS
+Vre
K6 K1
R1 K6 LLLL PCB
2 1 S5B
Vre 220R K5
4 3 D2
0 A
6 5 LLL Led
K
8 7
10 9 S5A INPUT SELECT
+Vre
S4A and S4B control the operation of the
R2
+Vre LLLL indicator. In the first position the LLLL is
K5 MAIN PCB +Vre K3 PHONO PCB K5 LLLL PCB fed from after the input select and balanced
3k3
K2 K3 K4
D1 +Vre +Vre +Vre
input stage and can be used to check any
Tone Defeat MC Phono input. In the second position it is fed from
Power IEC Amendment Off
the phono stage only, whichever input is
selected. The third position removes the
S1 S2 S3
signal fed to the LLLL and so disables it.
Tone Defeat MM/MC IEC Amendment S4A S4B Only the first three positions of the switch
are used (Line—Phono—Off) and the other
LLLL INPUT SELECT
120231 - 12 three are blocked off by a mechanical stop.
Switch S1 controls the tone-control defeat
relay. When S1 is closed the tone-control is
Figure 7. This sub circuit of switches, LEDs, resistors and connectors forms a separate bypassed completely.
board intended for fitting to the inside of the preamplifier front panel.
Switch S2 selects between moving-mag-
net (MM) and moving-coil (MC) opera-
tion, using relay contacts RE1B, RE1C on
and LLL LEDs. blocked off by a mechanical stop. S5B is not the phono PCB. When S2 is closed the MC
S5A is the input select switch, controlling used. The switching between MM/MC and input is active.
the relays on the input boards Only the first Line input is done by a separate switch S2 on S3 selects the IEC amendment, which is a
four positions are used, the other two being the front panel board. largely unwanted extra roll-off at 20 Hz that
COMPONENT LIST
Front panel board (# 110650-4)
Resistors
(0.25W, 1%)
R1 = 220Ω
R2 = 3.3kΩ
Semiconductors
D1 = LED, green, 3mm, through hole
D2 = LED, red, 3mm, through hole
Miscellaneous
K1 = 10-way boxheader, straight, 0.1’’ pitch
(2.54mm)
K2,K5,D1,S1-S3 = 2-pin pinheader, 0.1’’ pitch Figure 8. The front panel circuit board.
(2.54mm) Board available through www.elektorpcbservice.com.
Socket headers for K2,K5,D1,S1-S3
K3,K4 = 3-pin pinheader, 0.1’’ pitch (2.54mm)
Socket headers for K3,K4
K6 = 2-way PCB terminal block, 5mm pitch
S1,S2,S3 = switch, SPDT (On-On)
S4,S5 = 2-pole, 6-position rotary switch, PCB
mount, e.g. Lorlin type CK1050
PCB # 110650-4
(www.elektorpcbservice.com)
24 06-2012 elektor
Personal Download for I © Elektor
52429
IC3
HS1 HS3
1 7815 3
K4
C13 C12 C11
Vre
2
0
HS2 100n 10u 100n
63V
R5 K6 FRONT PCB
was later added to the RIAA spec. When S3
1R
is closed the IEC amendment is applied. IC1 +17V
The small board no. 110650-4 for securing K1
LM317 1N4004
to the front panel of your preamplifier case C14 3 2
17V
47n R6 R1
is pictured in Figure 8, along with the Com- D3
adj D1 0
100R
17V
12k
ponent List. Check Figure 9 for the assem-
1
bled board. K5 C15
C8 C7 C2 C1
R2
47n D7 C5
4700u 100n 100u 100n
K2
18V
1k3
The power supply PCB D4 35V
47u
25V
17V
25V
The power supply is fairly conventional as 0
R4
the preamplifier does not require ultra-low D5 D8 C6 17V
18V
1k3
noise on the supply rails to give its best per- C16
C10 C9 47u C4 C3
K6 25V
formance. Referring to Figure 10, a centre- 47n
R7 4700u 100n R3 100u 100n
35V D2 K3
tapped 18–0–18 V power transformer, a D6
25V
17V
100R
1
12k
bridge rectifier D3–D6 and reservoir capac- adj 0
C17 2 3
itors C8, C10 produce the unregulated sup- 17V
47n 1N4004
LM337
ply voltages. Snubbing capacitors C14–C17
D3 ...D6 = 4x MBR1045 -17V
prevent RF being generated by the rectifier IC2 120231 - 14
Wiring
Comprising a total of seven boards, the
Preamplifier 2012 is quite an intricate job
to wire up. For your convenience the con-
nectors (‘Kx’) in this month’s schemat-
ics have been given what/where/to labels.
Most of the board interconnections consist
of short runs of 2, 3 or 4 light duty, flexible
elektor 06-2012 25
Personal Download for I © Elektor
52429
COMPONENT LIST
Power supply board (# 110650-5)
Resistors
(0.25W, 1%)
R1,R3 = 100Ω
R2,R4 = 1.3kΩ
R5 = 1Ω
R6,R7 = 12kΩ
Capacitors
C1,C3,C7,C9,C11,C13 = 100nF 10% 100V,
7.5mm pitch
C2,C4 = 100μF 20% 25V, 6.3mm diam., 2.5
mm pitch
C5,C6, = 47μF 20%, 25V, 6.3 mm diam., 2.5
mm pitch
C8,C10 = 4700μF 20% 35V, 22mm diam.,
10mm pitch
C12 = 10μF 20% 63V, 6.3mm diam., 2.5mm
pitch
C14-C17 = 47nF 50V, ceramic, 5mm pitch
Figure 11. The power supply board.
Semiconductors Board available through www.elektorpcbservice.com.
D1,D2 = 1N4004
D3-D6 = MBR1045
D7 = LED, red, 3mm, through hole
D8 = LED, green, 3mm, through hole
IC1 = LM317
IC2 = LM337
IC3 = 7815
Miscellaneous
K1,K2,K3 = 3-way PCB terminal block, 5mm
pitch
K4,K5,K6 = 2-way PCB terminal block, 5mm
pitch
HS1,HS2 = heatsink, 50.8 mm, Fischer Elek-
tronik type SK 129 50,8 STS
HS3 = heatsink, 50.8 mm, Fischer Elektronik
type SK 104 50,8 STS
PCB # 110650-5 (www.elektorpcbservice.
com)
Not on PCB:
Tr1 = AC power transformer, 115/230V prima-
ry, 2x18V/50VA secondary, e.g. Multicomp #
MCTA050/18, Farnell (Newark) # 9530380
F1 (230VAC) = fuse, 0.315A antisurge,
5x20mm, panel mount
F1 (115VAC) = fuse, 0.63A antisurge,
5x20mm, panel mount
S1 = 115/230V AC line voltage selector, e.g.
Arcolectric Switches type T22205BAAC Figure 12. Preamplifier PSU board assembled by Elektor Labs.
S2 = AC power switch
wires of different colours (agree on black for All wiring and components ‘ahead of’ and sandwich using four PCB pillars. Depending
ground though) twisted together and their including power transformer Tr1 is at AC on your response to the project we may do
ends soldered to the socket for plugging on powerline potential hence should comply a final article later this year on installing the
the pinheader. Look at the symbol with the with safety regulations and recommenda- boards in a high quality enclosure. For now
mating pinheader on the PCB to identify the tions in place for electrical safety. When in we leave that part of the project to you, as
bevelled edge, this will help you get the pin- doubt, ask for help or advice from a quali- well as enjoying the superb sound quality of
to-pin connections right. fied electrician. the Preamplifier 2012.
The 10-way connection between the front (120231)
panel PCB and the input PCB is the only one At the time of writing the Preamplifier 2012
requiring a length of flatcable (a.k.a. ribbon is fully wired up on the audio test bench at
cable) with IDC sockets pressed on at the Elektor House, but not yet fitted in a case.
ends. The two input boards are mounted like a
26 06-2012 elektor
Personal Download for I © Elektor
52429
All registered brands remain the registered trademarks of the respective manufacturer !
Free Stencil
Get a free SMD laser stencil
with every Prototype order
www.pcb-pool.com
elektor 06-2012 27
Personal Download for I © Elektor
52429
Stepper motor s are used in many in size) can control stepper motors in full-, nected according to the design already
mechatronics projects to implement some half-, quarter- and sixteenth-step modes encountered in the block diagram. The
kind of motion. Applications such as robots, with the aid of an integrated PWM con- windings of the stepper motor and the
scanners, milling machines and 3D printers troller. The internal FET bridge can supply power supply voltage for the motor are
come to mind. There is often the desire to a maximum current of 2.5 A at voltages connected to connector K4. The inputs
keep the accompanying electronics as sim- up to 35 V. Thanks to the built-in ‘trans- MS1 and MS2, which are used to set the
ple as possible. In particular with hobby pro- lator’ all manner of controlling a stepper size of the microsteps of the motor, are
jects, the legacy Centronics port of a PC is motor with this IC is easy. After establish- connected to K1 and K2 in the schematic. In
still frequently used to control a few motors ing the mode in which the motor is to be reality these ‘connectors’ are solder pads on
by way of power drivers. controlled, using inputs MS1 and MS2, a the circuit board. The user can decide with
pulse at the STEP input is sufficient to make two drops of solder across the appropriate
For all those enthusiasts unable or unwill- the attached motor rotate a full-step, half- pads which type of microsteps will be used.
ing to develop such a driver themselves, step, etc. Figure 1 shows the block diagram Table 1 shows the different options that are
the guys at Elektor Labs have developed a of the A3979, together with the necessary available.
universal board based on a special stepper external components. The datasheet for the
motor driver IC and featuring full electrical A3979 is available from [1]. To allow as much electrical separation as
isolation for the control signals. The supply possible between the controlling part (PC or
voltage for the electronics is derived from Apart from the selection of a few of these a microcontroller board) and driver board, a
the stepper motor’s power supply using a external components, which we will return four-way optocoupler is added in the form
small switch-mode power supply regulator, to shortly, there are very few things you of an ACPL-847 made by Avago Technolo-
which ensures that the power dissipation is need to consider. There are only three sig- gies (IC1). When one of the inputs DIR, STEP
kept to a minimum. nals that need to be supplied for the control or ENABLE is set to a Low level, the corre-
of the motor: step pulses, direction signal sponding LED in the optocoupler will turn
The A3979 and enable signal. on and as a consequence the accompany-
Allegro Microsystems’ type A3979 is a so- ing transistor will conduct. When changing
called microstepping motor driver with Optical drive the level at the DIR input the direction of
integrated DMOS bridge and level shifter. In the complete schematic shown in Fig- rotation of the attached motor will change.
This tiny IC (it measures only 6.5 x 10 mm ure 2 you can see that the A3979 is con- With every rising edge at the STEP input the
28 06-2012 elektor
Personal Download for I © Elektor
52429
Technical characteristics
• Suitable for most small bipolar stepper motors
• Integrated DMOS-bridges, maximum voltage/current: 30 V / 2.5 A
• Default current limit: 1.5 A
• Electrically isolated control lines using optocouplers
• Full-, half-, quarter- and sixteenth-step mode settable using solder bridges
motor will perform one microstep. Finally, • PWM control for minimal dissipation
the motor driver is activated when the ENA-
• Built-in translator for controlling the motor
BLE signal is set to a Low level. The A3979
• Built-in blanking function for the DMOS bridges
checks this level at every rising edge of the
STEP input. • Various protection features built in (current and temperature, among others)
Supply 2V
tions as the power-on indicator. VDD UVLO and Charge
Regulator
Fault Pump
Bandgap
VBB1
mitted to flow through the stepper motor RC1 >47 µF
coils. These resistors must have a very small STEP 4 OUT1A
RS1
motor. This increases the reactance (AC MS2
Gate
Drive
CS1
HOME
resistance) of the total circuit and results in SLEEP
4
OUT2B
isfy the condition PFD PWM Timer:
PWM Latch
0.1 µF
RC2 Blanking
Mixed Decay SENSE2
Here a value of 1.5 A was chosen for Itrip, and Table 1. Microstepping configuration.
a resistance of 0.1 Ω for Rsense. This results in K1 K2 K1 K2 K1 K2 K1 K2
a maximum Vref of 1.2 V. The motor current
through each sense resistor results in a rel-
atively high power dissipation. This power
dissipation amounts to
elektor 06-2012 29
Personal Download for I © Elektor
52429
K1 K2
R2 R3 R4 R5 C3 C4 C5
3k3
10
28
15
1k
1k
1k
VDD
VBB1
VBB2
27 22
IC1 SLEEP VCP
1k
1k
1k
17 23 GND
RESET CP1
1 16 2 C1
GND HOME
D1 3
DIR 220n
19 24
STEP CP2
K3 2 15
M
+5V
3 14 IC2 K4
D2 12 18
DIR MS2 OUT2B
13 25
STEP MS1 OUT1B
4 13 4
ENABLE OUT1A
5 12 26 11
ENABLE OUT2A
D3
VCC A3979SLP-T +VIN
8
REF GND
6 11 R9
7 10 6 1
RC1 SENSE1
22k
9 14
D1...D3 = LL4148 RC2 SENSE2
5
P1 PFD
8 9 R1 R12 R13 16 20
C8 C9 C10 SR VREG
+VIN R10 R11
12k
12k
2k2
C13 C6 C7
AGND
ACPL-847-30GE
PGND
100n
GND
0R1
0R1
PMEG6030EP 10k 470p 470p
VCC 220n 100n 100n
21
29
D6 GND
IC3 R14
4
L1
+30V
FB
7 8 GND
1k
VIN OUTPUT
100uH
LM2594M-5.0 D5 C12 C14 D4
110018 - 11
5
ON/OFF
GND
47u 100n
1
2
3
6
PMEG6030EP
GND
Figure 2. The complete schematic for the circuit, optocouplers provide full
electrical isolation of the control signals.
The combinations of R12/C9 and R1/C8 the previous step, the circuit will
determine the duration of the off-time for change decay mode. This can be a
the one-shot timer in the PWM generator, slow, fast or mixed decay. The voltage
which sets the amount of time when the across the PFD pin determines the decay-
internal MOSFETs are switched off. Accord- mode of the circuit. If the voltage at PFD
ing the datasheet these need to have a value is greater than 0.6 VDD, then slow-decay-
somewhere between 12 kΩ and 100 kΩ mode is used. When the voltage is smaller
for RT and between 470 pF and 1500 pF than 0.21 VDD, fast-decay mode is used. In
for CT. Bipolar stepper motors have a rela- this circuit we chose for mixed-decay-mode
tively low self-inductance, which means because this provides optimal performance
that the blanking time for the comparator for most stepper motors. The voltage at
does not have to be very long. That is why pin 5 is set to 2 V (0.4 VDD) here using R5
capacitors of 470 pF and resistors of 12 kΩ and R13. (Figure 3),
were selected. The purpose of the blank- thanks to the
ing function is to avoid incorrect measure- Miniature circuit board use of SMD com-
ments across the current sense resistors at The entire circuit is accommodated on a ponents. This does
the instant that the outputs are switching. circuit board measuring only 43 x 47 mm however require a cer-
When a step results in a lower current than
30 06-2012 elektor
Personal Download for I © Elektor
52429
elektor 06-2012 31
Personal Download for I © Elektor
52429
MiCroControllerS
Embedded Linux
made Easy (2)
Hardware
Choosing a suitable microcontroller and
supporting ICs is an essential step at the
beginning of many a project. In this part of our
course we will examine the circuit diagram of
our board and look more closely at the most
important components. We will then boot it for
the first time and study what happens. We shall
see how easy Linux can be!
By Benedikt Sauter [1] also has access to the ROM, from which one another. Each application is assigned
it can copy any application into RAM as its own virtual memory space and does not
needed. We will now look at these compo- have access to the memory of other applica-
In the first part of this series we looked at nents in more detail. tions. The project uclinux.org [3] provided
the history of the free GNU/Linux operating patches (see the text box) to the kernel to
system and its most important elements. The processor allow use with a processor lacking an MMU.
We now want to look at our hardware in We start with the processor. It is located Recently, however, these patches have been
detail: the Elektor Linux board. in the centre of the board, in a 12 mm-by- integrated into the ‘mainline’ kernel. In any
12 mm BGA package. The Linux kernel case, we will take advantage of the MMU in
The main components was originally developed for the x86 archi- our LPC3131 processor and will therefore
The circuit has deliberately been kept sim- tecture, which is rather a different beast not need to use these patches.
ple: we have included only the most impor- from that of a typical embedded proces- The LPC3131 [4] processor by NXP uses an
tant components. The idea is that any sor. Because of the open way in which the ARM9 core (to be precise, an ARM926 run-
reader should be able to understand the programmers work and the well-thought- ning the ARMv5 instruction set). It runs
system from end to end: from applying out structure of the software, however, it at 180 MHz and has 192 Kbytes of inter-
power to launching complex applications. is possible to port the kernel to a range of nal SRAM; an integrated DRAM controller
Running the GNU/Linux operating system different processors. Essential to porting allows external memory to be attached. All
requires the standard components of a Linux to a new architecture is the availa- the usual microcontroller interfaces, such
computer architecture: a processor, RAM bility of the GNU GCC toolchain [2], which as I2C, SPI and a UART, are included. There
(working memory) and ROM (non-volatile was briefly described in the first article in are 21 GPIO pins, four analogue inputs, an
memory): see Figure 1. How do these all this series. The processor must have a hard- LCD interface, an I2S audio interface and
work together on our board? When power ware timer and a 32-bit architecture. An a high-speed USB (480 Mbit/s) interface,
is applied a mini-bootloader (roughly the MMU (memory management unit) is not which open up a wide range of application
equivalent of the BIOS in a PC) is started, absolutely necessary, but it does help the possibilities from within the Linux operat-
which copies the kernel from ROM into operating system to allow different appli- ing system. The Elektor Linux board is only
RAM. The kernel is then started: this in turn cations to run stably and independently of double-sided, and so not all the signals can
32 06-2012 elektor
Personal Download for I © Elektor
52429
eMBeDDeD linUX
Power supply
Working memory
The processor itself includes just 192 Kbytes card essentially consists of a NAND flash for the LPC3131, 1.8 V for the SDRAM, and
of RAM, which we will need to expand with memory and a simple controller. Unlike 1.2 V for the ARM9 core in the processor.
external memory to allow us to run the ker- NOR flash memory, NAND flash is always When power is applied the ‘enable’ signals
nel, the other operating system compo- addressed by block and sector. Our stand- of the regulators (pin 1 in each case) are
nents and applications. The internal RAM is ard microSD card has a capacity of 1 Gbyte, immediately taken high and they immedi-
used only to run the bootloader program. although larger cards can of course be used. ately start to produce their output voltages.
Once the bootloader has configured the As well as being readily available, microSD Some of the more sophisticated ARM-based
external memory appropriately (which cards have the advantage that no special processors have rather onerous power
includes setting up the timing parameters programming equipment is needed for the sequencing requirements.
on the integrated memory controller and board: all programs and data files can sim-
initialising the memory contents), the inter- ply be copied to the card using an ordinary
nal RAM is only used for speed reasons, for card reader connected to a PC.
example as a cache for the operating sys-
tem or for applications. The external mem- The circuit
ory takes the form of SDRAM (synchronous We now turn to the circuit diagram (Fig-
dynamic memory): these are very low-cost ure 3), starting with the power supply. One
devices offering large storage capacities. A possibility is to power the board using a
quick glance at the LPC3131 datasheet [4] USB cable at connector X2. The same con-
suffices to identify find a suitable IC. We nection can be used to talk directly to the
also discover that the device supports a serial console of the Linux system over USB,
16-bit external data bus and a maximum the CP2102 (IC7) functioning as a USB-to-
address range of 128 Mbytes. A special fea- serial converter.
ture is support for so-called ‘low-power’ If the system is being used without a con-
SDRAM devices, which are optimised for sole (for example if the UART interface is
current consumption. On our board we use being used for a different purpose) exter- Figure 2. A microSD card
and an SD card adaptor.
an 8 Mbyte device; a 32 Mbyte device can nal power can be applied at connector X6.
be substituted if desired. Since the world of This allows higher voltages to be applied, as
RAMs is standardised by JEDEC [5], a suit- an MC7805ABDT linear regulator appears
able device can be obtained from a wide between this source and the regulators for With the board now powered up we can
choice of manufacturers. In the circuit we the processor proper. We suggest using a turn our attention to the LPC3131 in the
have shown the AMIC A43E26161 [6]: this DC supply of between 7 V and 12 V. Jumper circuit diagram. It is device IC6, split up in
is a low-power device that needs a 1.8 V J4 is used to select whether external power the diagram into three parts labelled IC6.A
supply. or USB power is used. to IC6.C: splitting the pins of the device into
The internal 5 V rail is taken directly to the logical groups like this makes the diagram
The ‘hard drive’ inputs of switching regulators IC1 to IC3. easier to understand. Block IC6.A covers all
The ‘hard drive’ of our board is a common- These have a maximum permissible input the important interfaces and I/Os of the
or-garden microSD card (Figure 2), as voltage of just 6 V. Resistors R4, R6 and R7 processor; block IC6.B includes the data and
used these days in practically every digi- determine the output voltages of these address buses; and block IC6.C contains the
tal camera and many mobile phones. The regulators. The voltages we need are 3.3 V power supply pins.
elektor 06-2012 33
Personal Download for I © Elektor
52429
eMBeDDeD linUX
+1V2 +5V
C4 C6 C5
+3V3 +1V8 +1V2
+3V3
4u7 4u7 4u7
C37 C35 C36
R12
R5 R8 R3
+3V3 10u 1n 220p +3V3 L3 1 4 C8 L1 1 4 C9 L2 1 4 C7
10k
301k
301k
301k
EN VIN EN VIN EN VIN
IC3 22p IC1 22p IC2 22p
3 VOUT/ 5 3 VOUT/ 5 3 VOUT/ 5
C14 C16 C15 C12 C13 R13 SW
VFB
SW
VFB
SW
VFB
4uH7 R6 4uH7 R7 4uH7 R4
AS1324 C1 AS1324 C3 AS1324 C2
DNP
10u 100n 47n 3n3 10u
66k5
150k
301k
GND GND GND
2 10u 2 10u 2 10u
M2
P1
L1
+1V2
USB_VDDA12-PLL
USB_VDDA33
USB_VDDA33-DRV
LPC_VBUS L2 N11
USB_VBUS JTAGSEL
LPC_DM N2 H14 RESET H3 A11
USB_DM RSTIN_N LPC_D0 G2 N8 LPC_CLK VDDI VSSI
LPC_DP P2 EBI_D_0 MLCD_DB_0 C21 C18 C19 L7 C7
USB_DP LPC_D1 F2 P9 VDDI VSSI
USB_ID M1 P13 TRST_N EBI_D_1 MLCD_DB_1 L12 D12
USB_ID TRST_N LPC_D2 F1 N6 LPC_A2 VDDI VSSI
J5 K9 TDI EBI_D_2 MLCD_DB_2 10u 100n 10n C12 G4
USB_RREF TDI LPC_D3 E1 P6 LPC_A3 VDDI VSSI
R11 P10 TMS EBI_D_3 MLCD_DB_3 C6 L6
TMS LPC_D4 E2 N7 LPC_A4 VDDI VSSI
K4 M14 TCK EBI_D_4 MLCD_DB_4 L11
USB_VSSA_REF TCK LPC_D5 D1 P7 LPC_A5 +1V2 VSSI
12k
LED1
UART_TXD
N13 B14 GPA0 GPA0 1 2 GPA1
E7
J9
B10
GPIO2
10k
6 5 LPC_CLK F2 F9 LPC_WE
+3V3 4 GPIO15 CLK WE GND GND
VSSE-IOC
VSSE-IOC
VSSE-IOC
VSSE-IOC
VSSE-IOC
VSSE-IOC
VSSE-IOC
E3
A1
A3
B7
C3
D7
J1
R22
X1
U1 K4 5
270R
10k
10k
10k
10k
10k
10k
D4 11 1
DM3D-SF
1 LPC_MCI_DAT2 +5V J3 R9 LED5 2 Relay
DAT2 3 1 LPC_VBUS 13
2 LPC_MCI_DAT3 1k BAT54 7
DAT3
3 LPC_MCI_CMD 2
CMD K1 G6D-1A-ASI5VDC
4
V+ 1 Q4 MC78M05ABDT
5 LPC_MCI_CLK VCC +5VEXT
CLK 2 LPC_DM GPIO18 IC8
6 D–
GND 3 LPC_DP USB_ID X6
7 LPC_MCI_DAT0 D+ BSS123
DAT0 4 R10 R14 2 R18 1
8 LPC_MCI_DAT1 GND C10 +5V
DAT1 C20
1M
1M
JP1
10k
LPC_MCI_CD GND 2
SW_A USB 100n
SW_B 1 47u
DC 7 - 12V
SD-CardSocket 120146 - 13
34 06-2012 elektor
Personal Download for I © Elektor
52429
eMBeDDeD linUX
J2:Boot
J2:Boot
J2:Boot
6 6 6
Linux system firmware will be loaded. The is master: this gives us an easy way to con-
LPC3131 is in fact capable of booting from trol external devices, such as a PCA9555 1 1 1
a range of storage devices and interfaces. I/O expander). The SDA and SCL signals are
The options available on the Elektor Linux available on J5.
board can be chosen from using header SV1 Figure 4. Bootloader jumper.
(see Figure 4). SPI
SPI peripherals can be controlled in exactly
For example, it is possible to boot from the the same way as I2C devices. The MOSI, interface can be operated in ‘host’ mode
SD card or over the USB-to-serial bridge at MISO and SCK signals are available on J5, or in ‘device’ mode (USB OTG, or ‘on-the-
X2 mentioned above. A further possibility is while the chip select signal OUT0 and (in go’). In host mode any USB stick LAN or
to boot over the second USB interface at X1 the case where the LPC3131 is operating as WLAN adaptor can simply be plugged into
(see below), for which a DFU (device firm- an SPI slave) the CS_IN signal are available the socket. In device mode the Linux board
ware update) programmer is needed. on test points TP3 and TP4. plays the role of a USB device, for example
behaving as a virtual USB network interface.
LED1 lights when power is present on the PWM We will of course describe later how this all
board; also, for simple experiments or as a A PWM output is ideal for driving a servo works.
status indicator we have LED2. Button S1 or for generating an analogue voltage. The
can be used as an input device: its state can LPC3131 has a hardware PWM output, and Das Boot
be polled on GPIO15. We have also provided the corresponding pin is brought out to J5. Before we boot the board for the first time
a relay to control external equipment via X1. let us take a quick look at what happens
We will look in more detail at this possibility UART during the boot process. In order to see
later in the series. The UART protocol is a particularly conveni- what is happening on the board, we need
ent way to implement simple communica- to connect it to a computer over USB and
The overall current consumption of the tions, especially between two microcon- use a serial terminal program. Under Win-
board is around 85 mA to 100 mA, which trollers. Unfortunately the processor has dows suitable options are Tera Term and
corresponds to a power consumption of only one UART, which in the normal con- HyperTerminal; if a Linux PC is available,
around half a watt. figuration is used for the root console. If we you can use picocom, microcom or a simi-
subsequently add a network interface (see lar program.
Interfaces below) then it is possible to run the root
Things really start to get interesting when console over this interface as well, freeing Using a standard Ubuntu system, at the
we use Linux to access directly the various up the UART for other applications. The RX Linux PC console type
microcontroller-style interfaces provided by and TX signals are available at test points
the processor, including digital inputs and TP1 and TP2. sudo apt-get install picocom
outputs, PWM, I2C and SPI. The relevant
pins are brought out to 14-way header J5 USB and then
and connector X4. The USB interface at K1 opens up a wide
range of expansion possibilities for the picocom -b 115200 /dev/ttyUSB0
GPIO Elektor Linux board. Not only do there
The 3.3 V-compatible inputs and outputs already exist Linux drivers for a wide range to connect to the Elektor Linux board.
GPIO11, GPIO14 and GPIO15 are availa- of USB devices (including audio and video
ble on screw terminals at X4. GPIO14 and interfaces, 3G modems, wireless LAN, wired Under Windows things are (of course) dif-
GPIO11 are simultaneously available on the LAN and so on), but also many simple 8-bit ferent. The VCP driver for the USB-to-serial
14-way header J5. microcontrollers can these days be con- converter has to be installed manually [7].
trolled over USB. A semi-autonomous con- Using Tera Term [8] or HyperTerminal it is
A/D channels troller or coprocessor of this kind makes an then possible to select the newly-created
Three of the four channels are made availa- ideal extension to the Linux system. COM port. The settings are shown in the
ble for simple analogue measurements. The screenshot in Figure 5.
3.3 V supply is used as a reference voltage. Network Once the correct interface is selected the
GPA0, GPA1 and GPA3 are available on J5, It is also possible to implement a network output from the bootloader and from the
with GPA1 also being available on a screw connection, either to a wired LAN or a wire- kernel should be visible in the terminal pro-
terminal. less LAN, using USB connector K1. This gram on the PC.
elektor 06-2012 35
Personal Download for I © Elektor
52429
eMBeDDeD linUX
36 06-2012 elektor
Personal Download for I © Elektor
52429
eMBeDDeD linUX
[3] www.uclinux.org
echo 3 > export easy as we can for readers by providing a
ready-made image for download, which can [4] http://ics.nxp.com/products/lpc3000/
cd gpio3 be used in a virtual machine. datasheet/lpc3130.lpc3131.pdf
(120146) [5] http://www.jedec.org
echo out > direction
[6] www.amictechnology.com/pdf/
These configure the relevant port pin as an A43E26161.pdf
output. Then enter Internet Links [7] www.silabs.com/products/mcu/Pages/
[1] sauter@embedded-projects.net USBtoUARTBridgeVCPDrivers.aspx
echo 1 > value
[2] http://gcc.gnu.org [8] http://ttssh2.sourceforge.jp
elektor 06-2012 37
Personal Download for I © Elektor
52429
Heliostat
Computer-driven Heliostat
Follow the sun or the stars
A heliostat is a device that tracks moving objects in the sky. This way you are able to extract the maximum
amount of sunlight, take a series of photos of a moving planet or track a satellite for the best radio or TV
reception with a dish. In this article we describe a simple heliostat that uses two servo motors. The servos
are controlled via a PC program.
By Zeno Otten (The Netherlands) a directly driven drive-shaft the minimum Servo control
rotation is usually 1.8 degrees or more, due We’ve used two modeller’s servos in the
to the motor’s stepping angle. Another heliostat [1], one for the control of the azi-
This project shows an example for a helio- disadvantage is that there is no feedback muth and one for the elevation. The azi-
stat, built using two servo motors. The posi- between the position of the drive-shaft and muth is the angle in degrees in the horizon-
tion of the sun with respect to time and the number of pulses sent to the motor. tal plane; the elevation is the position in the
the location on Earth is calculated using a A servo motor has less torque, but has the vertical plane.
mathematical model. The result is used to advantage that the drive-shaft can be set To make a servo turn you need a control
drive the servos and make them point in the steplessly to almost any position because of signal which has a pulsewidth that varies
direction of the sun. the use of a proportional control circuit and between 1 ms and 2 ms, with a frequency
The prototype described here can be easily a potentiometer built into the motor. This of about 50 Hz. The pulsewidth determines
expanded to a larger and more robust sys- circuit also makes it possible for the servo the position of the drive shaft. A pulsewidth
tem so it would be able to position an actual to correct any change in position caused by of 1.5 ms, for example, will cause the servo
solar panel for it to receive the maximum external forces. to move to a central position. A pulse of
possible amount of light and hence absorb A servo is also controlled using a pulsed sig- 1.25 ms will make the servo turn 90 degrees
as much energy as possible. nal, where the pulsewidth determines the anti-clockwise, whereas a pulse of 1.75 ms
angle of rotation of the servo arm. will turn the drive shaft 90 degrees clock-
Positioning with motors The choice for the type of motor for our wise. All values in between will cause the
When an object needs to be positioned project isn’t very important. Since Elektor drive shaft to turn by a proportional angle.
using a computer or microcontroller it is has had several articles on stepper motor However, these values could deviate by
often the case that stepper motors or servo control circuits, we thought it was time a few percent, depending on the type of
motors are used. for a change and decided on a servo con- servo.
A stepper motor can be set to its required troller. Besides, this project also serves as The control signal for the servo should be
position using a relatively simple pulsed an introduction to the graphical program- +5 V, whereas the supply voltage to the
control signal. On top of that, they tend to ming environment of Profilab. This can be motor may vary between 4.8 V and 6 V.
have a high torque. The stepper motor can used with little effort to control things like In Figure 1 you can see the schematic for
therefore hold its position fairly easily when the serial port, which we’ll use here to drive the ‘circuit’ to drive two servos via the serial
it is at rest. The disadvantage is that with the servos. port. Two PC817 optocouplers optically iso-
38 06-2012 elektor
Personal Download for I © Elektor
52429
Heliostat
10k
10k
that we can also control the servos via a USB IC1 IC2
port when we add a USB/serial converter. 4 3 4 3
1k
Profilab COM port COM port
Programming can be fun, but for many DTR GND RTS GND
elektor 06-2012 39
Personal Download for I © Elektor
52429
Heliostat
Figure 3. A specially written DLL takes care Figure 4. The complete program for calculating the position of the sun
of the calculations for the position of the and driving the servos.
sun.
14
VCC
17 6
manual RA0 RB0
S5 18 7
RA1 RB1
1 IC3 8
RA2 RB2
2 9
computer R5 RA3 RB3
3 10
RA4 RB4
PIC16F
10k
4 11
RA5 RB5
15
628A 12
Supply C1 C2 RA6 RB6
16 13 S4 S3 S2 S1
5V DC D1 RA7 RB7
470u 100n GND
16V
5
R2 R6 R4 R7 100204 - 16
10R
10R
10k
10k
IC1 IC2
4 3 4 3
1 2 1 2
R1 R3
PC817 PC817
1k
1k
Servo 1 Servo 2
Figure 6. With the help of an extra PIC you can add manual control.
40 06-2012 elektor
Personal Download for I © Elektor
52429
Heliostat
Figure 5. A view of the front panel. You can Figure 7. A practical implementation of the heliostat. One servo is mounted on a case, the
choose between real-time calculations or second is on a CD. The ‘arm’ on the servo points in the direction of the sun.
manual control.
application to position the heliostat with plies the year (Ye) and the day (Dy). Block After pressing push button PB1 the calcu-
an accuracy of tenths of a degree, but since TM1 supplies the time of day as the hours lated pulses are sent to the serial port for
we’re using a computer with ample process- (Hr) and minutes (Mn). The other informa- the next two seconds. If you want to drive
ing power it won’t do any harm either if we tion required is the location on Earth. This the servos continuously then this push but-
do the calculations very accurately. is input with the help of PT1 and PT2. PT1 ton should be replaced with a continuous
There is an example in the help-files of supplies a value between 0 and 90 degrees signal.
Profilab that explains clearly how you can north. PT2 supplies a value between –180 Every program in Profilab has an accompa-
include your own programming in a DLL file. and +180 degrees east. nying front panel. This acts as the control
All you have to do is to define all inputs and G1 is a pulse generator that makes sure that interface for our program. The control panel
outputs of the block and then write the pro- a new calculation will be carried out every belonging to Figure 4 is shown in Figure 5.
gram code that defines the relation between second by helio1.dll. Two analogue meters are used to show the
the inputs and outputs. Both Pascal and C++ The complete Profilab program is shown azimuth and elevation of the sun. Imme-
are supported. The model used here was in Figure 4. Several other functions have diately below these the position is shown
written and compiled in Borland C++. been added so that the program can carry numerically in degrees. When the servo
In Figure 3 the file helio1.dll is used in Pro- out simulations with regard to the position control is set to ‘Manual’ the servos can be
filab to calculate the position of the sun. on Earth and the time. REL3 and REL4 are controlled using slider controls. When it is
This block has eight inputs and two out- used to switch between manual operation set to ‘Real Time’ the true solar position is
puts, Q0 (the azimuth of the sun) and Q1 of the servos (with the help of slider con- shown. The indication is with respect to the
(the elevation of the sun). trols SR4 and SR5) and automatically via north. When the switch ‘Show position’ is
Four inputs of helio1.dll get their informa- the mathematical model. Furthermore, an pressed the pulses will be sent to the servos
tion from the standard functions for the interface has been added to drive the two for two seconds and the heliostat will move
date and time in Profilab. Block DT1 sup- servos via the serial port. to the calculated direction.
advertisement
elektor 06-2012 41
Personal Download for I © Elektor
52429
Heliostat
1k
1k
0V...5V
22k
10n
in Proton IDE BASIC and is also included in
1
P1 S1 VDD
D1 D2 the download suite from [5].
4
GP3/MCLR GP5
2
In order for the heliostat program to use the
1k
7 IC1 3 circuit in Figure 8 several changes had to be
C1 GP0 GP4 Servo 1
6 PIC12F675 5 made to the program in Figure 4. The posi-
220u
GP1 GP2 Servo 2
16V
P2 S2
VSS
tion of the sun is now converted to a value
1k 8 that’s translated to an analogue voltage
between 0 and 5 V by the K8061.
100204 - 17
And finally, there’s one thing we’d like to
mention about the servos used. They can
turn through an angle of only 180 degrees.
Figure 8. If you want to be less dependent on the timings under Windows you could drive This is not a problem for the elevation where
the servos with analogue signals via this circuit. the servo has to turn through a maximum of
90 degrees. (In the UK the maximum ele-
vation of the sun varies from 63 degrees in
Expansion 1: Manual control top of this disc. An ‘arm’ was then mounted the south to 53 degrees in the north.). The
Up to now we needed a computer to carry to the drive-shaft. It’s this arm that points positioning of the azimuth is limited to the
out the calculations and to drive the ser- in the direction of the sun. In the photo position of the sun between due east and
vos via the serial port. In order to drive the you can also see push buttons S1 to S4 and due west. This means that the sunrise (NE)
servos in situations where a computer isn’t switch S5 (computer/manual control). and the sunset (NW) on the longest day of
available the circuit from Figure 1 has been the year can’t be tracked.
extended with a small microcontroller, a PIC Expansion 2: Analogue control The mathematical model for the heliostat
16F628A (Figure 6). This inexpensive con- Accurately generating pulses with a can also be used for several other applica-
troller is provided with a simple program pulsewidth between 1 ms and 2 ms is quite tions, such as the automatic opening/clos-
that can generate pulses for the servos. The tricky to achieve in a multitasking environ- ing of curtains or blinds, or the turning on
program was written using the (free) Proton ment such as Windows. The result of this and off of lights.
BASIC Compiler and was then programmed is that the heliostat sometimes jitters a (100204)
into the PIC using a PIC programmer from bit when the operating system is particu-
Velleman (K8048). Of course, you can also larly busy. To get round this, we have also
use any other suitable programmer. The designed a servo controller that can be
BASIC program for the PIC 16F628A can driven by an analogue voltage. Internet Links & Literature
be found in the software suite that can be Since the PC itself cannot generate ana-
[1] www.hitecrcd.com
downloaded from [5]. logue voltages directly, we’ve resorted
When S5 is switched to ‘manual’ the supply to a USB interface card (K8061) from Vel- [2] www.abacom-online.de/uk/html/profil-
for the computer interface is turned off and leman [4]. This is able to output analogue ab-expert.html
the PIC is connected to the supply. LED1 will voltages between 0 and 5 V and is fully [3] R. Walraven: Calculating the position of
then flash a few times to indicate that the supported in Profilab. We also made our the sun. Solar Energy Vol. 20, 1978
controller is now active. Switches S1 to S4 life easier by using a standard ‘pan & tilt’ kit
can now be used to generate the pulses that made by Lynxmotion. This kit is supplied [4] www.velleman.eu/products/view/?count
make the servos turn to their required posi- inclusive of two Hitec servos [6]. To drive ry=gb&lang=en&id=364910
tion. Extra 10 Ω resistors have been put in these two servos with analogue signals [5] www.elektor.com/100204
series with the supply to the servos so that we’ve made use of a PIC12F674. This small
[6] www.lynxmotion.com/Product.aspx?pro
they operate from a slightly lower voltage controller is able to read in two analogue
ductID=287&CategoryID=61
than the PIC. voltages at a resolution of 10 bits. In the cir-
Available from Antratek: http://www.an-
Figure 7 shows the prototype of the heli- cuit diagram in Figure 8 you’ll see that the
ostat. On the first servo a disc (an old CD) analogue voltages are connected to pins 6 tratek.com/Servo-assemblies.html or
was mounted, on which a compass rose was and 7. S1 and S2 are used to switch between http://robosavvy.com/store/product_
glued. The second servo was then glued on the voltages set by P3 and P4, or the volt- info.php/products_id/1182
42 06-2012 elektor
Personal Download for I © Elektor
52429
Take
your THE NEXT GENERATION
chance
to win
EAGLE Design Challenge
1st of May – 31st of August 2012
In Association with
44 06-2012 elektor
Personal Download for I © Elektor
52429
elektor 06-2012 45
Personal Download for I © Elektor
52429
By Marc Gérin (France) Let’s start at the end: the Pitot tube, the its getting blocked when you solder it, have
detector, and the display. the longer tube that passes all the way
through the main tube protrude by at least
To measure how well a building is sealed, Pitot tube anemometer 1 cm at the far end. For the soldering, using
we go about it a bit like a inner tube: we The pressure created by a fluid moving a plumber’s blowlamp and flux paste, make
pressurize the building so as to then meas- around a solid is a function of its speed. The sure you keep the pre-assembled Pitot tube
ure the escaping air flow. This infiltrometry Pitot tube (see inset) exploits this principle vertical. Solder just the bottom end, to
involves fitting an adjustable fan hermeti- for measuring the dynamic pressure of a avoid the solder running down into the tube
cally into one of the building’s openings – fluid. Since June 2009, when the Air France by gravity. Now turn the whole thing upside
for example, the entrance door – with all Rio to Paris flight crashed over the Atlantic, down to solder the other end. It is vital that
the other openings kept shut. And then everyone is now aware that Pitot tubes are these two ends are soldered in such a way
we blow. The pressure difference between used on aircraft. as to completely close the gaps between the
inside and outside the building allows an small tubes and the main tube, otherwise
engineer equipped with a hot-wire ane- Now our Pitot tube anemometer here isn’t the static pressure measurement will be
mometer (or a smoke generator) to hunt of course designed for aeronautical use, but affected by the dynamic pressure.
down the slightest leaks. it is nonetheless suitable for air speeds up to To finish off, cut off the excess inner tube at
200 km/h (125 mph), i.e. a pressure differ- the front end of the probe – and there you
I’m offering you my toolbox for experiment- ence of 1,882 Pa at the tube outlet (see the have your Pitot tube.
ing yourself in order to improve the sealing Excel spreadsheet available from [3]).
of your building and adjust its ventilation: Pressure and accuracy
Without making a habit of it, we’re going to For low pressures, the data sheet for the
• a dual hot-wire anemometer for meas- start by doing some soldering even before pressure detector chosen, the MP3V5004G
uring small air leaks and balancing the we take a closer look at the electronics I’m from Freescale, gives an accuracy of 1.5 %
dual-flow ventilation, suggesting. To make our Pitot tube (Fig- of the output voltage at 2 / 3 FSD, i.e.
ure 1), drill four holes about 0.8 mm diam- 27 mV for around 30 km/h. This accuracy
• a Pitot tube for measuring higher air eter peripherally around the middle of an depends on the temperature, the linearity
speeds and calibrating the dual hot- 8 cm length of 5 mm diameter brass tube, of the detector, hysteresis phenomena,
wire anemometer. This system can also as used in modelling. Flatten one of the and mechanical stresses. Unfortunately,
measure pressure differences up to ends a bit, just enough to be able to insert the most interesting parameter, the ran-
2 kPa. two 2.5 mm diameter brass tubes. To avoid dom output deviation at low pressures, is
46 06-2012 elektor
Personal Download for I © Elektor
52429
12k
C3 C4 C40 PS1 5
ADS1100, a 16-bit ADC with I²C interface 4
R1
1
VDD
6 0V5
10u 10u 100n VOUT 1k VIN+ VIN–
that provides eight samples per second. To ADS1100
improve stability, we’ll be using the aver- GND C1
4
SDA
AD0
SCL
3
C2
R7
2k2
3 MP3V5004DP GND
one measurement roughly every ¾ sec- 220n 2 100n
+5V SJ1 +3V3
ond. If necessary, to improve speed, the
A
conversion could be limited to 14 bits. The
ADC’s I²C address is hard-coded on the
R12 R13
chip. I chose the label AD0 with the address
I2C
4k7
4k7
elektor 06-2012 47
Personal Download for I © Elektor
52429
J3 2 IC4 DIS1
D3 7805 VDD
3
1N4004
1 C11 C12
CONTR
VDD
VCC
VSS
R/W
RS
NC
NC
D0
D1
D2
D3
D4
D5
D6
D7
E
C1 C2 C7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
C5
R2
U2 C3 100n 10k
1 40 11 21 32
100n
VDD
VDD
VDD
AVDD
2
CONTRAST
3 2 38
RB0/AN0/CN2/EMU3D/VR+ PWM1L/RE0
4 3 37
RB1/AN1/CN3/EMUC3/VR– PWM1H/RE1
5 4 36
RB2/AN2/CN4/SS1 PWM2L/RE2
6 5 IC1 35
RB3/AN3/CN5/INDX PWM2H/RE3
7 6 34
RB4/AN4/CN6/IC7/QEA PWM3L/RE4
8 7 33
RB5/AN5/CN7/IC8/QEB PWM3H/RE5
9 8 17
RB6/AN6/OCFA FLTA/INT0/RE8 VDD
10 9
RB7/AN7
10 1 ICD2
RB8/AN8 dsPIC30F4011 VPP/MCLR
Spare 1
Connector
C4 15 30 2
RC13/CN1/T2CK//U1ATX/SOSCI//EMUD1 RF0
U1 16 29 3
RC14/CN0/T1CK/U1ARX/SOSCO/EMUC1 RF1
1 100n 26 4
PGC/EMUC/SDI1/SDA/U1RX/RF2
2 23 25 5
RD0/INT1/IC1/OC1/EMUC2 PGD/EMUD/SDO1/SCLU1TX/RF3
3 18 28
RD1/INT2/IC2/OC2/EMUD2 CN17/U2RX/RF4
4 22 27 to Microchip
RD2/OC3 CN18/U2TX/RF5
VDD ICD2/3
OSC2/CLKO
5 19 24
OSC1/CLKI
RD3/OC4 SCK1/RF6
AVSS
VSS
VSS
VSS
Spare
Connector
39 12 13 14 20 31 R4 R1
Serial Port VDD D45 VDD
2k2
10k
6 I 2C
R3
5 1
1N4148
10k
4 2
3 3
C6
2 4
S1
1 100n
to Pitot Tube
FTDI_Cable
110343 - 13
Figure 3. Circuit diagram of the dsPIC display board for the Pitot tube anemometer.
FTDI TTL-232R-5V USB cable [1] or by an and the code for each peripheral is imple- socket, and apply the solder on the other
external 9–12 V PSU. For this article, I built mented in a separate file. side of the board in the 0.25 mm gap
a second prototype (Figure 4). between the socket and the copper pad: the
Display for the Pitot tube solder will be drawn in by capillary action
The dsPIC program is in two parts. First of anemometer (a photo of this operation is available [3]).
all, it handles the calibration and storage On the double-sided PCB, the display and In order to insert the LCD into the sockets
in EEPROM of the reference parameters push-button are on the solder side. If you we’ve just soldered, it’s best to first mount
(value from the detector at atmospheric don’t have a through-hole plated PCB, the it in a male–male socket.
pressure and with the pressure from a dsPIC and the LCD will have to be mounted
200 mm column of water). Then, in nor- using individual pin sockets that can be sol- Implementation and
mal operation, the program’s primary dered on both sides of the board. If you’re configuration
loop interrogates the pressure detector, unsure about doing this, here’s a little tip The MP3V5004G detector is quite noisy,
then calculates and displays the speed. for soldering underneath this type of pin as it is very sensitive to handling. The sim-
It also adjusts the reference atmospheric socket. Coat the PCB pads using a flux pen ple fact of connecting a pipe to it and in so
pressure value when the button is pressed. [2] and insert the contact, leaving it stand- doing applying mechanical strain on the
For greater portability, the program is writ- ing 0.25 mm above the surface of the PCB. package will change the value measured. I
ten using the C compiler from Microchip Then apply the soldering iron tip to the recommend using silicone tubing, as used
48 06-2012 elektor
Personal Download for I © Elektor
52429
elektor 06-2012 49
Personal Download for I © Elektor
52429
+12V
R17 T1 R6
R1 R4
J3 2 IC4
180R
3k3
2k2 10k
D3 7812 +12V
3
7V11
BC547 R5 8 T2
5
27k 1N4004
R2 R3 7
C5 IC3.B 1 C11 C12
6
100R
16k
10k
68R
NTC 1
IN+
2
IN–
HEATED NTC 3
50 ºC V+
–4V6 4
V–
R9
IC3 = LM358N
1k
PMLCDL RA = 100k
–12V RB = 10M
+12V
+12V
R18 T3 R14
R7 R12
180R
10k
68R
NTC 1
IN+
2
IN–
HEATED NTC 3
50 ºC V+
–4V6 4
V–
R16
IC1 = LM358N
1k
PMLCDL RA = 100k
–12V RB = 10M
110343 - 19
eter probes are inserted into the supply and voltage will reflect the speed of the air cool- mistors (Figure 7). The values of R2 and R3
extract ducts via small holes. My choice of ing the 68 Ω thermistor. are chosen such that the bridge is balanced
a 100 % analogue circuit is justified more with just the 68 Ω thermistor at 50 °C. If
by nostalgia and the intellectual pleasure The thermistor’s operating point @ 50 °C the 68 Ω thermistor is cooled down by a
of it than by cost or performance factors. A and the thermal compensation of the whole draught, the Wheatstone bridge becomes
microcontroller would do the job just as well system has been calculated using a little unbalanced and the op amp reacts by vary-
— possibly better… program [3] written using Mathcad. In addi- ing the supply to the resistive bridge via T1.
tion to selecting the values for the bridge The current in the bridge increases and the
Thermistor probes bias resistors so as to ensure the 50 °C for 68 Ω thermistor returns to its temperature
Our ‘hot wire’ is in fact a 68 Ω negative tem- the ‘hot wire’, we also need to select values of 50 °C. Hence the bridge supply voltage
perature coefficient (NTC) thermistor wired for R2, R24 and R10, R23 to ensure the best reflects the speed of this draught. Clearly
in a resistive Wheatstone bridge and self- possible temperature stability. I did this by the same goes for the second anemome-
heated by the current passing through it. successive approximation in Mathcad. ter, which uses IC1A. Resistors R17 and R18
are used to maintain sufficient current in the
Temperature compensation is achieved in Op amp IC3A performs air-flow measure- 68 Ω thermistor, while reducing the heating
the second branch by another thermistor, ment and temperature compensation for in T1 and T3.
this time with quite a high value (6,800 Ω) the first anemometer. Its inputs are con-
so it will not be heated up by the current nected to the Wheatstone bridge formed The 68 Ω and 6,800 Ω thermistors can be
through it. The Wheatstone bridge output by R2, R3, and the 6,800 Ω and 68 Ω ther- seen in the photo of the anemometer probe
50 06-2012 elektor
Personal Download for I © Elektor
52429
Two displays
To display the air speed, I decided to use
Velleman LCD voltmeter/display mod-
ules, which are ready-to-use, elegant, and
cheap. However, the downside is that they
are tricky to incorporate into a circuit where
we need to measure a voltage with respect
to the 0 V rail. Their differential input IN−
has to be maintained at least 1 V above the
display’s V− rail. T2 and T4 are wired as a
current source to provide a floating supply
for the voltmeter, allowing their IN− to be
connected to the 0 V rail (GND). As these
voltmeters are fitted with a configurable
input voltage divider, RA will be 100 kΩ and
RB, 10 MΩ. A potentiometer is used for fine
adjustment of this divider.
elektor 06-2012 51
Personal Download for I © Elektor
52429
Figure 10. For the calibration, make sure you place the Pitot tube inlet at exactly the same
height as the thermistors, so that the air-flow is the same for both anemometers.
(‘cold’ position). Set P1 and P5 so that the easily balance up your ventilation system.
twin displays indicate the same speed as the Ventilating a building represents around
Pitot tube. Tweak the voltmeter gain poten- 25 % of the energy expenditure. With a lit-
tiometers if necessary. tle experience, preferably on a very windy
day, you’ll find that the north wind’s best
So here you are now, armed with the means friends are the joins between walls and
to track down that chilly north wind and window-frames, mainly in the higher parts
Pitot tube
dynamic pressure
fluid + differential
static pressure pressure
Pitot tube sensor
conversion
V of pressure
at speed
static pressure
110343 - 11
of the building and around the roof. But
this Mr North Wind also likes your sockets,
Principle for measuring speed using a Pitot tube and a pressure detector.
switches, skirting-boards, and so on. And he
hates you with your dual anemometer and
The Pitot tube is used for measuring the flow speed of a fluid by performing two pressure your silicone mastic gun!
measurements. One opening at the end of the tube makes it possible to measure the total
(110343)
pressure, i.e. the sum of the atmospheric pressure plus the pressure resulting from the flow
of the fluid (static and dynamic pressures). Another opening on the periphery of the tube
makes it possible to measure just the atmospheric pressure (static pressure). From these Links
two measurements, it is possible to calculate the flow speed of the fluid using this equation:
[1] www.ftdichip.com/Products/Cables/US-
BTTLSerial.htm
2( pt − ps )
V= [2] http://be01.rs-online.com/web/p/
ρ products/2513637/
[3] www.elektor.fr/110343
V: speed; Pt: total pressure
Ps: static pressure ρ: density of the fluid
The equation is in exponential form: it will be difficult to measure low speeds because the
pressure variations are very small.
52 06-2012 elektor
Personal Download for I © Elektor
52429
avr sdr
In the previous instalment [3] we described for DCF77. The filters need to be simple to algorithm, the samples are stored in a ring
a test transmitter and an active ferrite allow the AVR to compute them in real time. buffer. Each time a new sample is added, it
antenna, which we can put to good use In the front end we use what are called CIC replaces the oldest sample and the buffer
in this instalment. Now we dedicate our filters for this purpose. Now it’s time for a pointer is incremented. All samples in the
efforts to expanding the scope of our digi- description of how these simple filters work. ring buffer are added together each time
tal receiver. We have already described the to calculate the output value (four addition
digital I/Q mixer. Now it’s time for the filters Moving-average and CIC filters operations). This takes N – 1 addition opera-
downstream of the mixer. In order to imple- CIC filters are based on the moving-aver- tions for a filter with N samples. A large N
ment narrow-band reception, we need low- age principle. Figure 1 shows a filter that requires a lot of computation time.
pass filters after the mixer, and more spe- calculates the moving average of a set of It can be shown that the filter depicted in
cifically the same filters for the in-phase and five samples. Figure 2 does the same thing as the one
quadrature components. The filters located A series of delay stages stores the past sam- in Figure 1. Linear time-invariant filters
directly after the mixer operate at the same ples, which are summed for each average are fully characterised by their impulse
sampling rate as the front end — e.g. 10 kHz value. When this filter is implemented as an response. The impulse response is the out-
54 06-2012 elektor
Personal Download for I © Elektor
52429
avr sdr
elektor 06-2012 55
Personal Download for I © Elektor
52429
avr sdr
56 06-2012 elektor
Personal Download for I © Elektor
52429
avr sdr
I-channel
U X
I I C C C
Md
Mc
elektor 06-2012 57
Personal Download for I © Elektor
52429
avr sdr
I-channel
U
I-Filter
X
U in S & H cos Phase
Cordic P-I-control PLL will lock and the signal from the crystal
sin
oscillator will be held tightly in phase with
Y the received signal. You can use this to build
your own frequency standard by tuning the
Q-Filter radio to receive a signal broadcast as a fre-
V quency standard.
Q-channel
References:
DCF77, France Inter and BBC
Local oscillator The receiver can be adapted to various
20 MHz VCXO transmitters by simply altering a few param-
eter values. This only requires activating
the corresponding options with ‘#define’
Figure 7. PLL block diagram. statements in the source code. First let’s
try receiving the DCF77 signal. This signal
can be received everywhere in continen-
I-channel tal Europe. In the western part of Europe,
U signals from BBC Droitwich (at 198 kHz)
I-Filter
and France Inter (at 162 kHz) can also
be received. The same approach can be
X Frequency used in other countries with suitable local
U in cos Phase transmitters.
Local
oscillator Cordic Z -1 CI C
S&H sin
Putting the PLL into operation
Y
The receiver must be suitably aligned
in advance to enable it to lock onto the
Q-Filter received signal. Use the following proce-
V
dure for this purpose. First adjust the active
Q-channel
ferrite antenna. To do this, use the signal
generator to generate a sinewave signal at
Figure 9. Block diagram of RTTY decoding. the desired frequency. Weakly couple this
signal into the antenna by connecting the
output signal from the generator through
For the implementation, the coefficients High frequency accuracy a 1-pF capacitor to the hot end of the tuned
of the rotation matrices are multiplied by a with a PLL circuit. Then adjust the rotary capacitor to
factor of 65,536 and stored in a table. For For this we use the software EXP-Simple- maximise the signal level at the output of
an angle of 22.5 (for example), this gives: DCF77-RX-V01 [4] to display the amplitude the active antenna. Of course, the active
65,536 × cos(22.5°) = 60.547 and phase. antenna must be connected to the receiver
65,536 × sin(22.5°) = 25,080 during this process, to provide it with a
If you examine the signal received from the source of power. You can use the previ-
The routine for computing the rotation of a DCF77 time reference transmitter, you will ously described RMS voltmeter to measure
point at (X0,Y0) to a new point at (X1,Y1) is see that its phase drifts slowly. The reason the signal amplitude.
shown in Listing 4. for this is that the frequency of our crystal
This method is very similar to an algorithm oscillator is not exactly 20 MHz. You can try Next, load the program ‘EXP-VCXO-PLL-
called the CORDIC algorithm [6] [7]. After to calibrate the oscillator by adjusting the V01’, compiled for the right frequency, into
the point has been rotated to the X axis, its trimmer to minimise the phase drift, but the ATmega88. Put jumper JP1 in position A
X coordinate corresponds to the amplitude, this sort of adjustment will naturally not so that the PLL can be adjusted with trim-
which makes it very easy to determine the remain constant for a long time. A better pot P2. Start by setting P2 to its midpoint. If
amplitude. Our CORDIC routine delivers the option is to put together a phase-locked you now orient the receiving antenna, the lit
angle scaled such that a full rotation (360°) loop (PLL). This involves applying the phase LED in the LED circle should rotate more or
corresponds to exactly 256. This means that signal to a control amplifier and feeding the less quickly. Use the trimmer capacitor C8
range of CORDIC values for a phase range of amplifier output to the control input of the to adjust the VCXO frequency until the LED
0 to 360° is the same as the range of values VCXO, as shown in Figure 8. If everything point remains stationary or rotates only
of a single byte. is correctly dimensioned and aligned, the very slowly. If you now adjust P1, the direc-
58 06-2012 elektor
Personal Download for I © Elektor
52429
avr sdr
Figure 8. PLL phase response. Figure 10. Frequency signal before filtering Figure 11. Eye pattern (blue) and clock
(yellow) and after filtering (blue). signal (yellow).
tion and speed of rotation of the LED point quency signal is very noisy if the received posed. If they eyes in the pattern are free
should change according to the rotation signal is not very clean. This can be reme- from noise and wide open, signal reception
of P1. If this does not happen, you can try died relatively easily by filtering with a CIC is good.
using a different 20 MHz crystal oscillator or low-pass filter. The output signal from the The received characters are output over
slightly modifying the values of C9 and C12. filter is applied to a Schmitt trigger, result- the serial port of the ATmega88 and can
The above procedure ensures that the VCXO ing in the demodulated radio teletype be viewed in a terminal emulator program
can be adjusted over the right range by the (RTTY) signal. running on the PC. A short excerpt of the
0–5 V control voltage. Now place jumper The block diagram of this arrangement is received data is shown in Listing 5.
JP1 in position B to close the control loop. shown in Figure 9. In Figure 10, the top
After the circuit is reset, the lit LED should trace is the frequency signal immediately This series will continue in the next issue
wander back and forth a bit before settling after the difference operation, and the bot- with a test transmitter and more details on
down at a single point. When this happens, tom trace is the filtered signal — which is a the decoding of various transmitter signals.
the PLL is locked and the 20 MHz oscillator good deal cleaner. (120088-I)
is generating exactly 20 MHz. Incidentally, The output signal from the Schmitt trigger
the two PWM AC outputs of the receiver is fed to a software UART. The UART per-
still deliver the amplitude and phase of the forms start-bit detection, serial to parallel
received signal, which can be used as tun- conversion, and conversion from Baudot to Web links:
ing aids. When receiving the DCF77 signal, ASCII code. [1] www.elektor.com/100180
you can recognise the dip in the amplitude
[2] www.elektor.com/100181
that occurs at a 1-second rate. With the Now we tune the ferrite antenna to
signals from the TDF162 (France Inter) and 147.3 kHz (see [3]) and download the soft- [3] www.elektor.com/100182
BBC189 transmitters, you can see the phase ware EXP-DDH47-RTTY-RX-V01 to the SDR [4] www.elektor.com/120088
modulation. microcontroller. The RTTY signal and the bit
[5] www.ak-modul-bus.de
clock appear at the DAC outputs, and the
To check the behaviour of the PLL, we modi- received signal strength is shown on the LCD. [6] www.dspguru.com/dsp/faqs/cordic
fied the signal generator program to cause [7] http://en.wikipedia.org/wiki/CORDIC
it to generate a 125-kHz signal with a step Figure 11 shows the frequency signal as
change of plus or minus 1 Hz every couple of an eye pattern. Here the oscilloscope trace
seconds. In the oscillograph in Figure 8 you is triggered by the start bit detection sig-
can see the PLL phase response. The decay- nal, and several curves are shown superim-
ing oscillation after each step change shows
the PLL locking onto the new frequency.
Listing 5: Message received from the German Weather Service
DDH47: radio teletype at 147.3 kHz
The German Weather Service transmits CQ CQ CQ DE DDH47 DDH9 DDH8
marine weather reports on 147.3 kHz as FREQUENCIES 147.3 KHZ 11039 KHZ 14467.3 KHZ
radio teletype messages. The messages RYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY
are transmitted with frequency shift key- ZCZC 483
ing (FSK), which produces frequency mod- FQEW57 EDZW 100600
ulation. After you determine the phase with SEEWETTERBERICHT FUER WESTEUROPAEISCHE GEWAESSER
the CORDIC method, it’s relatively easy to HERAUSGEGEBEN VOM SEEWETTERDIENST HAMBURG
determine the frequency by measuring the 10.10.2009, 06 UTC:
difference between successive phase values, WETTERLAGE:
since the frequency corresponds to the rate HOCH 1025 ZENTRALE OSTSEE UND OSTPOLEN OSTWANDERND,
of change of the phase. However, this fre-
elektor 06-2012 59
Personal Download for I © Elektor
52429
MicrocoNTroLLErs
Platino
Controlled by LabVIEW (2)
In the previous instalment I showed you how to get started with LabVIEW and LIFA, developing a virtual
instrument to blink Platino’s LED. This month we will go considerably further, looking inside LIFA, adding
a relay board and getting rid of the USB cable that connects Platino to the PC. In the end you will even be
capable of monitoring Platino’s status on an iPad or Android tablet anywhere in the widely webbed world.
Pretty exciting, huh?
By Clemens Valens (Elektor UK/INT Editorial) bytes are combined into an array and passed on to the VI with the
glasses (Send Receive). The pin number, together with its type
Although I wrote it myself, after such a raving introduction it is hard (Digital or Analog), is checked by the VI with the red dot with
to not feel some pressure. After all, I am promising quite a lot, n’est the white cross in it (Check For Pin Out Of Range). If the pin
ce pas? So, with space at a premium let’s get to work straight away. number is out of range for the slave device, this VI will flag an error.
You may want to have the first instalment handy for reference. Double click the Send Receive VI and you immediately under-
stand why it wears glasses and a pencil: it is of the nerdy type. Fig-
Understanding LIFA ure 3 shows this intellectual VI. Here the Arduino block on the left is
As mentioned in the previous instalment, LIFA employs a serial com- the Packetize VI that builds the 15-byte packet to send to the slave.
munications server on the slave device to control it from LabVIEW (LV). The VISA block with abc written in it does the actual transmitting.
Serial communications implies some sort of communications protocol Then the Arduino Wait For Bytes VI waits for bytes to come back
and the one used by LIFA is simple and not very robust. It consists of from the slave. Their number is specified by the Bytes To Read var-
15-byte packets going to the slave device with variable length pack- iable in the upper left corner. If the right number of bytes is received
ets returned. The packets sent from LV start with 0xFF and end with within the specified time, the case structure with Max Retries
a checksum calculated over the payload including the first byte, and written in it is skipped. The second case structure will in that case
excluding of course the checksum itself (Figure 1). The second byte read the data into Read Buffer (not shown, it is in the True case,
holds a command and the contents of the rest of the payload depend not in the False). If not, errors will be produced.
on the command. The data returned by the slave device on the other On the serial server side things are much easier to understand for
hand is totally freestyle. Most commands return a single byte as a someone reasonably versed in C. Here, when a 15-byte packet is
kind of acknowledge, but its value is never checked. Other commands received, the checksum is verified and if correct the command con-
return whatever they feel like, although they will have to respect the tained in the second byte is executed. If the command does not
number of bytes as defined by the receiving virtual instrument (VI). No need to reply with data (like digitalWritePin) it will send a sin-
checksums, no synchronisation characters, hee-haw, it’s a free world. gle-byte acknowledge most of the time. If it does have to send data
Later on you will see that this freedom creates, let’s say, issues. back to the host, it will send it without the acknowledge byte. In
So how is this protocol implemented? To understand this, let’s take LIFA, C stands for Cool.
a look at the Digital Write Pin VI as shown in Figure 5 of the
previous instalment. When in LV you can double-click this block and Extending LIFA
see what is inside (Figure 2). In the upper left-hand corner you see Now that you have some understanding of the inner workings of
the command digitalWritePin, a numeric value in the range LIFA it is time to start thinking of adding your own VI. Doing so
of 0 to 255 (digitalWritePin equals 3). Just below you have the means that you will have to modify the serial server side too so that
number of the pin and below that, its value (0 or 1). These three it can interact with your VI.
60 06-2012 elektor
Personal Download for I © Elektor
52429
MicrocoNTroLLErs
?
0 ? 1
Figure 1. LIFA always sends fixed-format 15-byte long packets Figure 2. Inside the Digital Write Pin VI. All the clever stuff
to the slave device (top) which will respond in most cases with is done in the blocks labelled ‘Arduino’.
something to satisfy the receiving VI (bottom).
Figure 3. Inside the Send Receive VI. Shown here are the paths that are taken when an error occurs. For normal operation the black
case structures are almost empty.
elektor 06-2012 61
Personal Download for I © Elektor
52429
MicrocoNTroLLErs
hack. Also it is not very user friendly since the name does not cor-
respond to its function.
Another solution is to replace the drop-down list by a byte constant
Figure 4. This is the 8-channel relay board with synchronous serial with an unused value. To find out which values are used you can
interface that I want to control from LabVIEW. right-click the list and open its properties. On the Edit Items tab
the values that are already in use are listed. The last one in my list
is FiniteSampleStart which has the value 45. So 46 should be
free, right? Well, actually it is, but that’s pure luck. Because when
As an example I will use this nice 8-channel relay board with serial you look closely at the serial server code (in the file LabVIEWInter-
interface (Figure 4, Elektor Shop # 071035-72) that I have at my face.pde), you cannot but notice that there are four commands
disposal. It has a 2-wire custom serial interface that is a bit peculiar here that are not in the drop-down list. True, they can be config-
so I did the slave side implementation first. I based my code on the ured away by commenting out a define, but it shows that some LIFA
original BASCOM example, available at [1] that I ported to C. I will developers used the same approach as us, hard-coding commands
not go into details here, have a look at my code that is included in in the stepper motor VIs without adding them to the commands
the download for this article [2]. list. Ooh, that’s so gross.
To use the relay board from within LV two functions are needed, The proper solution is of course to add your own commands to the
one to set up Platino [3] (Arduino) ports so that it can talk to commands list. I did this by right-clicking the drop-down list and
the relay board and a second function to (de)activate relays at selecting Advanced -> Customize…. In the window that opens
will. The VIs that go with this are similar to LIFA’s Set Digi- you can create a copy of the Type Def (File -> Save As…)
tal Pin Mode and Digital Write Pin VIs so I used those which you can edit. Right-click the edit box with setArduinoMode
as templates. Actually, my VIs can be simpler because I don’t need in it and select Edit Items…. Now you can add commands and
the Check For Pin Out Of Range VI. Here is how you do it. reorder them. Make sure to add the stepper motor commands too.
If you don’t have one in your VI already, put a D i g i - In your VI replace the original Command drop-down list by your
tal Write Pin VI in your block diagram. Double click on it to extended copy.
open it, then click File -> Save As…. Now click Open addi- To be totally honest, I do not know if this is the right or recom-
tional copy followed by Continue. Specify a name for your VI mended way to do things, but it worked for me.
and save it somewhere, preferably not in the LIFA folder. Close the As you can see from Figures 5 and 6 the command arrays that are
Digital Write Pin VI so you will not accidentally modify it. constructed do not have the same size. You can change the size of
In your new VI click File -> VI Properties. In the win- an array (and of many other complex objects) simply by resizing it
dow that opens you can set some basic things like the title and with the mouse. Dragging the bottom line downwards will increase
the icon for the VI. As Category select General and click the the size, pulling it up makes it smaller.
Edit Icon… button to create your own icon. In the Documenta- Good for documentation and ease of understanding of VIs is using
tion category you can write a short description of the VI, and in labels. Do a right-click on the item for which you want to add a label
the Window Appearance category you can set the VI’s title. All and select Visible Items -> Label.
the other parameters can be left as they are. Finally, I coded the relay states as bits in a byte using a 1D Boolean
Open the block diagram (Ctrl-E) of your VI (if not already opened) array that I cast to a byte.
and remove the Check For Pin Out Of Range VI together Tinkering this way I created a whole bunch of VIs to control the
with its Pin Type constant. Connect the Arduino Resource peripherals of Platino like the buzzer or the rotary encoders. The
and error in blocks to the Send Receive VI. Rename the pin most important VI is the Platino Configure VI that lets you setup
and mode constants by double-clicking on them. One last thing now the LCD and the solder jumpers.
remains to be done: defining a new command. As you will see this
turns out to be the hard part. LIFA issues
The easy solution is to reuse a command that you don’t need like As mentioned before, LIFA has some quality issues that you may
maybe sevenSegment_Configure (click the Command drop-down want to be aware of. I already mentioned the hard-coded stepper
list to select it). This will work, but is not really recommended as you motor commands and if the LIFA development team continues
may run into conflicts later when you have forgotten all about this extending the library in such a manner, we will be in for trouble.
62 06-2012 elektor
Personal Download for I © Elektor
52429
MicrocoNTroLLErs
ANT1
+3V3
C4
100n
+3V3
17
2
VCC PVCC
20 37
R6 USB_DP RF_IO
R5 21 3
USB_DN AIO(0)
22 IC1 4
PCM_SYNC AIO(1)
1k
1k
23 5
PCM_IN PIO(0)
24 6
T3 T4 PCM_OUT PIO(1)
25 7
R4 PCM_CLK PIO(2)
RXD 26 8
1k UART_RX PIO(3)
27 9
UART_TX PIO(4)
BC847 BC847 28 11
TXD UART_RTS PIO(5)
30 12
UART_CTS PIO(6)
+5V 31 13
K1 SPI_MOSI PIO(7)
32 14
Figure 6. The Relay State VI allows toggling the state of the 6
5 R3 R2
33
SPI_CSB
SPI_CLK
BTM222 *
PIO(8)
PIO(9)
15
+5V IC2 +3V3
relays. Each relay takes up one bit of the command’s data byte. 4
LF33 R1
34
16
SPI_MISO PIO(10)
36
35
R7 R8
1k
1k
3 +5V 1 3 RESET PIO(11)
1k
1k
2
1k
GND
GND
GND
GND
GND
GND
GND
GND
1 T2 T1
C1 C2 C3 D2 D1
40
39
38
29
19
18
10
1
100n 10u 100n
6V3
GND BC847 BC847
But there is more. 120227 - 16
When you look closely at the commands that pass values that do
not fit in one byte you will notice that they do not do this in a con-
sequent way. Some VIs will use big-endian formatting where oth- Figure 7. Level-shifting the Rayson Bluetooth module. You can use
ers prefer little-endian. This is of course confusing and may quickly any Bluetooth module that can handle the Serial Port Profile (SPP)
lead to errors. (most, if not all, do).
On the serial server side the main problem is sloppy coding. This not
only leads to wasting precious program memory, it is also rather
hard to maintain. Also, when you compile it you may see warnings shield format on which I put two level shifters, the BT module and
(if you activated them in the Arduino IDE preferences) that can be a 3.3 V voltage regulator (Figure 8). You could also use module [6];
fixed easily. The commands are not implemented using defines with it already has a voltage regulator on it.
understandable names but instead coded directly as hexadecimal Before you can actually use the BT module you have to configure it.
values in a large illegible switch-case structure. For my own use I Several ways are possible, but the simplest is probably hooking it
decided to recode this properly and while doing this I added con- up to a serial port on your PC. If you are using Platino to follow this
figuration options allowing me to leave out the bits I didn’t need, article you probably already have what it takes: the FTDI USB serial
saving lots of program memory. adapter cable. Connect it to the level shifter BT shield you just made
Finally I came across a difficult issue probably due to the inher- and launch a serial port terminal program on the PC. Configure it to
ent parallelism of LabVIEW and the weak communication proto- use the right serial port and set the communication parameters to
col. When I tried to create a VI that would display the value gen- 19,200 baud, 8 data bits, 1 stop bit, no parity bit, and no hardware
erated by a rotary encoder and allow setting of the relays at the flow control. Connect and press Enter to send a new-line character
same time I noticed that the respective VIs did not receive the right to the BT module. It should respond with OK. If it does, you’re ready
data. It seemed that one VI was receiving the data intended for the to configure:
other. I finally managed to fix this by adding a serial port flush to • Tell the module to stop sending result codes. In the terminal
Send Receive VI. You can see it in Figure 3, it is the VISA block type ATQ1 followed by Enter. This is needed because otherwise
with a little microwave oven and a Wii game console in it (funny the BT module will output something like CONNECT ‘1234-
icon, isn’t it?), just left of the one with abc written in it. This one 56-789012’ (with a real network address) when a BT connec-
was added by me and is not part of the official LIFA distribution. tion is established, but since the serial server does not handle
What it does is flushing the serial input buffer right after sending a that, unpredictable behaviour may result.
command to Platino. Since Platino will handle only one command • Set the baud rate to 115,200. In the terminal type ATL5 fol-
at a time this flush should insure synchronisation between LV and lowed by Enter. Strictly speaking this is not necessary as you
Platino. An extra sync byte added to the protocol would have been could adjust the communication speed in the VI. After this com-
useful here. mand you must of course reconfigure your terminal for the new
speed.
Cutting the umbilical cord • Set the BT module’s friendly name. This step is optional,
I hate wires and cables. They are always too short; never have the but it helps identifying the connection. In the terminal type
right connectors at the end and forever create spaghetti knots. ATN=PLATINO (or another name, no more than 16 characters
Today there are solutions to get rid of some of those cables and long) followed by Enter.
one of them is called Bluetooth. My computer has Bluetooth (BT),
and if yours doesn’t just stick a BT dongle in it. Adding BT to Platino That’s it; you can now connect the BT shield to Platino. When done,
is very easy if you only need a serial cable replacement. In Elektor power on Platino and, if needed, the BT interface of your PC, then
we have used several Rayson BT modules that can do this. They are make the PC scan for BT devices. It should quickly find Platino (you
inexpensive and badly documented, but that doesn’t stop me [4]. know when it does, because you gave it a friendly name). Select it
To connect a BTM220 (BTM222, BTM112, etc.) you only need a level and enter the default password 1234 when asked for it. This should
shifter for the RX and TX signals because it is a 3.3 V module. We be enough to establish the connection. Normally you have to do this
already showed you how to do this in Elektor [5], but you can use only once as the BT module and the PC remember their settings.
Figure 7 as a reminder. I quickly built an extension card in Arduino To finish replacing the USB cable by a wireless Bluetooth connec-
elektor 06-2012 63
Personal Download for I © Elektor
52429
MicrocoNTroLLErs
Figure 9. The relay controlling VI including shared variables accessible from Data Dashboard.
64 06-2012 elektor
Personal Download for I © Elektor
52429
MicrocoNTroLLErs
Figure 10. The server selection window in Data Dashboard Figure 11. Data Dashboard showing the status of six relays. So
on an iPad. If your server is listed, tap it, if not tap where are relays 4 and 5? They are on the next page, because you
Connect to shared variable. can have no more than 6 indicators on one page. I wanted the
same layout as the LEDs on my relay board so relays 4 and 5 fell off
this page.
Get the Data Dashboard app from the market that suits you best. I indicator. A numeric variable can be shown as a string, a gauge or a
used an iPad so I downloaded it from the Apple Store. Launch the chart; a boolean can be a string, an LED or a chart. When you pick
app and select a page layout (1, 2, 4 or 6 indicators per page). Give a chart or a gauge you have to enter the minimum and maximum
the page a name (tap Untitled 1), then tap Add in the indi- values too.
cator of your choice. This will bring up the Select a server Once you have set up all the indicators you can tap Run to start
window (Figure 10). Since you don’t have a server yet, tap Con- monitoring (Figure 11). Of course the VI should be running too.
nect to shared variable… and enter the server’s name or IP In case of connection problems the indicators show a yellow warn-
address (192.168.0.2 in my case) and tap Connect. (If you don’t ing triangle.
have a server you can try the app with the Demo variables.) If That’s it, now you’re all set to let Platino ride around on a wirelessly
the server was found, you will now see the Select a variable controlled robot communicating over Bluetooth with a VI running
window listing the shared libraries available on the server. You will on your laptop, collecting data that you can monitor on your tablet
probably see the System library that you get as soon as you install from anywhere in the world. As I said in the introduction: pretty
LabVIEW. Tap your VI’s library and then tap the variable that you exciting, huh? Maybe in a future article I will introduce LabVIEW
want to display. You will be presented with a few options for the web services to take the concept even further.
(120227-i)
elektor 06-2012 65
Personal Download for I © Elektor
52429
By Burkhard Kainka (Germany) put voltage even higher. As a result, the cir- impossible to predict which state the circuit
cuit switches to the fully ‘on’ state. In the will assume after being switched on — it’s
other direction, a falling output voltage simply a matter of chance.
On or off, one or zero: welcome to the world causes the output to be quickly switched
of digital logic! Along with analogue tasks, to the ‘off’ state. RS flip-flop
transistors can also be used for digital tasks. Now let’s add a pair of LEDs our circuit,
In the past there were even full-fledged The amplifier can be built as a two-stage, along with two pushbutton switches that
computers built entirely from discrete tran- directly coupled transistor circuit (i.e. can be used to change the state as desired
sistors. One of the most important basic without coupling capacitors). Each com- (Figure 3). After switching on the power,
digital circuits is the flip-flop. Even a single mon-emitter stage (Figure 2) inverts its you will see that one of the two LEDs is lit.
flip-flop can be put to good use in practical input signal. This simple circuit is effec- You can’t say in advance which one of the
applications. tively a bistable flip-flop, which means two will light up. Which way the circuit goes
that the output voltage can be either when it is powered on (i.e. which state it
The flip-flop low (nearly 0 V) or high (nearly the same assumes) usually depends on the difference
A flip-flop is a circuit with two stable states. as the supply voltage), and it remains in in the current gains of the two transistors.
Flip-flops are important basic elements of the given state for an indefinite length of If they happen to have identical character-
digital computer technology, particularly time. The state can only be changed by istics, noise (which is always present in elec-
for use in counters and memories. some sort of external action. tronic circuits) plays a role. Accordingly, it
Flip-flop circuits use positive feedback of may happen that the circuit sometimes
an in-phase, amplified signal. This can be When the output voltage is low, the left- ends up in one state after being switched
implemented using two inverting amplifier hand transistor does not receive any base on, and sometimes in the other state.
stages (Figure 1). As each stage inverts the current and is therefore cut off. As a result,
signal, the input and output signals of the its collector voltage is high and the right- However, it’s possible to set the circuit to
overall circuit are in phase. The feedback hand transistor receives full base current, either state as desired. To do so, simply
from the output to the input causes the causing it to be driven hard on. This causes press one of the two pushbuttons, each of
output signal to go to one of two states. A the output voltage to stay low. When the which shorts out the base current of the
rising voltage on the output, for example, is output voltage is high, the situations of the associated transistor. This circuit is called a
amplified by the circuit and drives the out- two transistors are exactly reversed. It is reset/set (RS) flip-flop.
1k
1k
1k
1k
-1 -1
100k 100k
9V 100k 100k
9V
BC547B R S BC547B
BC547B BC547B
Figure 1. Functional block diagram of an Figure 2. A bistable flip-flop with two Figure 3. An RS flip-flop.
amplifier with feedback. transistors.
66 06-2012 elektor
Personal Download for I © Elektor
52429
Thyristors
Thyristors are bistable switching de- flowing through the device. This can
+6V
vices with three electrodes: a cathode be done by switching off the supply
(K), a gate (G) and an anode (A). The voltage or by briefly shorting out the
gate electrode is used to trigger (switch thyristor. Another technique that is of-
on) the thyristor, which remains con- ten used is to operate the device with
ductive until the circuit is interrupted. an AC voltage. In this situation, the
The structure of a thyristor is similar thyristor stops conducting each time
1k
to that of a transistor, but it has four S S
the voltage passes through zero.
semiconductor layers (NPNP). The gate The circuit diagram here also shows an
R A R
electrode operates in a similar man- equivalent circuit with bipolar transis-
ner to the base of an NPN transistor. If K G
tors. This equivalent circuit can also
the gate current rises above a specific be switched on (triggered) or off in
1k
threshold value, the thyristor is trig- the same manner. Both circuits can be
gered and starts conducting. It remains used in the same way as an RS flip-flop.
conducting until the current stops
An RS flip-flop can be used as a 1-bit data and things are even easier with MOSFETs. triggering by itself when the supply voltage
memory. It can save states such as ’red’ of An RS flip-flop using two BS170 MOSFETs is applied.
‘green’ (if you use LEDs with these colours), (Figure 4) can manage without the base
‘on’ or ‘off’, ‘yes’ or ‘no’, etc. You could use resistors needed by the version with bipo- Monostable flip-flops
this sort of device at home to leave a mes- lar transistors. In many situations what is wanted is a flip-
sage, such as “Back right away” or “Out for a flop circuit that changes to a different state
while”. Your message remains present until Triggering and clearing for a defined period instead of indefinitely.
it is changed. A flip-flop can be built with an NPN tran- For example, this could be used to build a
sistor and a PNP transistor wired as shown timer that is triggered by a pushbutton and
Reset buttons and reset inputs are com- in Figure 5. Here the collector current of switches off automatically after a certain
monly found on computers and microcon- each transistor is the base current of the time. This behaviour can be achieved by
trollers. This is hardly surprising, since com- other one. As a result, both transistors are including a capacitor in the feedback path.
plex systems of this sort contain a large num- either cut off or conducting. After power The capacitor starts charging when the
ber of flip-flops, some of which are used to is switched on, the circuit is initially in the timer is triggered. When it is fully charged,
store data. When the power is first switched non-conducting (‘off’) state. no more current flows in the feedback path
on, all static flip-flops initially assume a ran- and the circuit returns to the stable quies-
dom state. To bring order to this chaos, you Briefly actuating the switch puts the circuit cent state. The timeout period (‘on time’)
need a reset function. A short reset pulse is in the conducting (‘on’) state. The transis- of the circuit shown in Figure 6 is approxi-
all it takes to set everything nicely to zero. tors remain in the conducting state until the mately 10 seconds.
Now the work can begin. supply voltage is switched off. This circuit
therefore acts the same way as a thyristor Schmitt trigger
Incidentally, modern microcontrollers use (see inset). Incidentally, the capacitor in the A Schmitt trigger is a circuit that converts a
MOSFETs instead of bipolar transistors, circuit prevents the circuit from accidentally variable input signal into two distinct states
1k
100k
1k
1k
1k
1k
BC557B
100u
9V 10k
9V 9V
10k
100k
100n
Figure 4. An RS flip-flop with MOSFETs. Figure 5. A bistable circuit with Figure 6. A monostable flip-flop.
complementary transistors.
elektor 06-2012 67
Personal Download for I © Elektor
52429
Twilight switch
It’s quite easy to implement ‘Twilight switch
+5V
a Schmitt trigger function $regfile = "attiny13.dat"
using a microcontroller. You $crystal = 1200000
simply measure the input $hwstack = 8
10k
In addition, you can build a defined delay into the program. A one- If U > 600 Then Portb.0 = 1
second wait loop also helps prevent undesirable switching jitter. Waitms 1000
Loop
We implemented a twilight switch using the Tiny13 and a few
End
additional components.
(High or Low). It has two threshold levels then adjust the potentiometer very close there must be some hysteresis between the
separated by a hysteresis zone. For exam- to one of the switching points. Now flip a two switching points.
ple, with threshold levels of 2 V and 1 V, the light switch. You may hear some static on The voltage at the input of the Schmitt trig-
output changes to the ‘off’ state when the the radio, and at the same time the circuit ger here depends on the resistance of the
input signal rises above 2 V and remains in will be triggered and its state will change. LDR. This resistance increases with deceas-
that state until the input signal drops below Here the Schmitt trigger effectively acts ing ambient light level, which causes the
1 V. The current state remains unchanged as as a broadband radio receiver, with the LED to switch on. When the ambient light
long as the signal level remains in the hys- light switch acting as the associated radio level rises, the LED is switched off. There
teresis zone. transmitter. is noticeable hysteresis between the two
The classic Schmitt trigger circuit (Figure 7) switching points. It should be sufficient to
employs feedback over a common emitter An illustrative example of a Schmitt trigger prevent the circuit from responding to the
resistor. The thresholds and the amount of application is a twilight switch (Figure 8). flickering of artificial lighting.
hysteresis can be set as desired by selecting Here the idea is to switch on a lamp when
suitable resistor values. it gets dark outside. An important consid- Simplified Schmitt trigger
eration is that the lamp should not flicker A simpler implementation of a Schmitt
As a diversion, you can try a little RF experi- near the switching point. This means that trigger is shown in Figure 9. Here two NPN
ment with this circuit. Connect a length of the circuit should switch off only after the transistors in common-emitter configu-
wire to the input to act as an antenna, and light level rises significantly. In other words, ration are directly coupled. An additional
LDR
10K
10k
10K
10k
1k
1k
1k
9V 9V 9V
10k
BC547B BC547B BC547 BC547B BC547B
LDR
BC547B
470R
470R
100k
100k
10k
Figure 7. A classic Schmitt trigger. Figure 8. A twilight switch. Figure 9. A simplified Schmitt trigger.
68 06-2012 elektor
Personal Download for I © Elektor
52429
Quiz
The circuit diagram If you send us the correct answers, you have a chance of winning a
shows the Schmitt trig- Minty Geek Electronics 101 Kit.
ger from Figure 7 with Send you answer code (composed of a series of three letters corre-
4k7
slightly different compo- sponding to your selected answers) by e-mail to
1k
nent values and two test 100k basics@elektor.com.
points. The transistors 9V
U1 Please enter only the answer code in the Subject line of your email.
are C versions (with the
highest possible current 10k
BC547C BC547C
The deadline for sending answers is June 30, 2012.
U2
gain), so the base cur-
All decisions are final. Employees of the publishing companies forming part of the Elektor Inter-
rents can be ignored in
470R
100k
national Media group of companies and their family member are not eligible to participate.
your calculations. Volt-
ages U1 and U2 are both
measured to ground (i.e. relative to the minus terminal of the battery).
The potentiometer should initially be adjusted fully anti-clockwise The correct solution code for the quiz in the April 2012 edition is
(wiper at the bottom end). As a result, the left-hand transistor is cut ‘CDH’. Here are the explanations:
off. A high voltage is present on its collector, so the right-hand transis-
tor receives enough base current to drive it fully on. In the ‘on’ state a Answer 1: Unfortunately, there were three decimal-place errors in
voltage U2 is present across the common 470-Ω emitter resistor, due the first question. We apologise for these errors.
to the sum of the two emitter currents. Next we raise U1 until the cir- Instead of: A) 100 Ω B) 47 Ω C) 22 Ω
cuit changes state. Voltage U2 is now less lower before, because less the potential answers should have been:
current flows through the left-hand transistor when it is conducting A) 10 Ω B) 4.7 Ω C) 2.2 Ω
than through the right-hand transistor when the latter is conducting.
The difference between the collector currents produces the hysteresis.
Rx = 0.7 V / 0.35 A Rx = 2 Ω
Note: It’s easier to quickly build the circuit and make measurements
on it than to calculate everything exactly.
Result: 2.2 Ω; answer C is the closest (the current is 10% less than the
allowable current).
Note: We ignored the answer to this question, due to our errors in
1) U1 = 0 V. The LED is lit. What value do you measure for U2?
the question.
A) Approximately 0.47 V
B) Approximately 1 V
Answer 2: The voltage over the three LEDs together is 10.2 V.
C) Approximately 2.3 V
Efficiency = Utotal/Uuseful
= 10.2 V / 12.6 V
2) U1 is increased slowly. At what voltage U1 does the output
= 81%
change state?
Option D is correct.
D) Approximately 2.9 V
E) Approximately 4.5 V
Answer 3: UCE = 14 V – 10.2 V – 0.7 V = 3.1 V
F) Approximately 6 V
P=U×I
3) U1 is decreased slowly. At what voltage U1 does the
output change state? R = 3.1 V × 0.35 A
G) Approximately 1.4 V P = 1.085 W
H) Approximately 2 V
I) Approximately 2.5 V Option H is therefore correct (approximately 1 W).
resistor from the output to the input pro- and switches off when the light level falls. tions by modifying the voltage divider at
vides the necessary feedback for the switch- This circuit switches cleanly, even with a the input. With a 10-kΩ fixed resistor, it
ing hysteresis. slowly decreasing light level. It has the typi- switches at a relatively high light level (e.g.
cal Schmitt trigger characteristic of convert- close to a lamp). With a 100-kΩ resistor, it
For this experiment we again use the LDR as ing a gradual change into a step change. The is suitable for sensing typical light levels in
a variable resistor. However, in this case the sensitivity of the circuit can be adjusted over residential rooms.
LED switches on when the light level rises a wide range to suit various lighting condi- (120006-I)
elektor 06-2012 69
Personal Download for I © Elektor
52429
DESIGN tIp
Advertisement
70 06-2012 elektor
Personal Download for I © Elektor
52429
DESIGN TIP
100k
100k
33R
4k7
two wires instead of the more usual three when connecting an indi-
VCC
cator pushbutton. T1
R5 IC1
Engineers are no friends of a wiring rat’s nest. More cables means 10k PORT 1
more connections means more chance of an unreliable system. For Controller
BC560C PORT 0
this reason the trend is for serial in preference to parallel interfaces, T2
R6
even when the serial interface requires processing power to refor- 100k GND
mat information. The same is true for connections between a micro- K1 K2
S1 1 1 BC550C
controller system and a remote user-interface: the fewer the wires D1 X1
R7
the better. With this in mind the author set about optimising the X2 C1
220k
interface to a common type of input device: a pushbutton with an 22n
LED illuminator/indicator. The resultant circuit uses just two wires
110572 - 11
instead of the more usual three. As more switches are needed, the
benefits begin to add up.
Figure 1. Circuit of the two-wire interface.
Cutting down
When connecting an indicator pushbutton to a microcontroller it
is usual to use one wire from the pushbutton contact to an input cent state the voltage level at the controller input Port.0 will be Low.
port pin and another from an output port to drive the LED. Both use When S1 closes, the voltage across the LED drops to zero turning off
a common earth return making three wires altogether. To reduce T2 and allowing pullup resistor R4 to take input Port.0 logic High.
the wiring to just two wires it is necessary to wire the LED in paral- The low-pass filter formed by R6 and C1 suppresses any interference
lel to the pushbutton contacts as shown in the left hand side of the picked up on the wire X1. The quiescent current of the complete
diagram in Figure 1. In principle the LED can be connected in series circuit is the sum of the current through R1 and R4 and amounts
with the contacts but a normally-closed contact would be neces- to around 50 µA.
sary (or the normally-closed contacts of a changeover pushbutton)
otherwise the LED cannot light without the button being pressed. Adaptations
Parallel wiring is however the simplest configuration. Many of the more modern microcontrollers can operate with a sup-
The trick used here is to always have current flowing through ply voltage of 3.3 V or less. There are however still many new and
the LED, even when it is not illuminated (and the pushbutton not existing designs that use microcontrollers with a VCC = 5 V. Fortu-
pressed). The LED in this state passes a current level of just a few nately the circuit is designed so that only a single resistor needs to
tens of microamps to create a forward voltage drop but not suf- be changed for different values of supply voltage: with a supply of
ficient to produce any visible light. When a few mA are passed 2.7 V R3 = 8.2 kΩ while at 5 V R3 = 2.7kΩ. Where an even lower sup-
through the LED it lights and the forward voltage drop increases ply of 2.2 V is used R3 = 10 kΩ and T1 should be swapped for a PNP
slightly but always remains between 1.2 V and 1.9 V until the push- transistor with a particularly low value of VCEsat. A good example
button is pressed which shorts out the LED. The resultant voltage would be the FMMT718.
changes can be processed. The LED goes out when the pushbutton Other transistor types can be substituted but take care that they
is pressed to give a visual indication of a key press. are types with high current gain. The majority of microcontrollers
have configurable output port pins. A totem-pole or open-collector
The circuit output type can be used at Port.1. When using a port input with a
R1 provides a continuous low level current through the LED (around built-in pullup resistor for Port.0 resistor R4 can be omitted.
20 µA at VCC = 3.3 V). To make the LED light up the microcontroller The savings increase with the number of pushbuttons used: only six
output port pin Port.1 is switched to Low. In this state T1 operates wires are needed to connect five illuminated pushbuttons (one wire
as a simple constant current source with a voltage drop across R3 to each pushbutton plus a common ground). This represents a sav-
of approximately 1 V. Subtracting the Vbe ‘ON’ voltage of T1 leaves ing of around 40 % in cabling costs. The extra board space required
around 0.33 V across R2 which gives a constant current of the order to fit the additional circuitry will, to some extent, be offset by the
of 10 mA through R2 and the LED. When the Port.1 pin is High’ the use of smaller connectors with fewer number of ways.
LED does not illuminate. The circuit is suitable for driving red, green or yellow LEDs. Blue and
For the pushbutton the voltage divider ratio ensures that transistor white LEDs will only work at VCC ≥ 4 V.
T2 conducts when the voltage at K2.1 exceeds 0.85 V. In its quies- (110572)
72 06-2012 elektor
Personal Download for I © Elektor
52429
Component tIpS
BTS432E2
In last month’s column I discussed a MOSFET that allows the current through the FET to be measured efficiently. This time I will deal with an intel-
ligent switch, that is, a MOSFET with built in logic and diodes. Such a component often offers functionalities such as safeguards against reverse-po-
larity, switching of inductive loads and protection against high currents and high temperatures, and ESD protection. Such features are particularly
relevant in industrial and automotive environments. The clever switch below has all these features and even a few more.
(120226)
BTS432E2
The BTS432E2 is an intelligent high-side R bb + V bb
3
connected voltage source and an open circuit
Voltage
switch. It contains an N-channel MOSFET plus ground connection.
Overvoltage Current Gate
source protection limit protection
V Logic
a charge pump for the gate and many protec- Voltage Charge pump Limit for
unclamped
OUT
GND
detection
PROFET
® ing capacitive loads or lamps. To limit the
tive and capacitive loads (when used with 1
Signal GND Load GND current when the voltage source is reversed it
inductive loads it is recommended to use a is possible to connect resistors in series with
diode in parallel). This component can also Figure 1. Block diagram and connection
pins 1, 2, and 4. The current flowing through
be used at higher voltages; refer to the table. details.
the so-called body diode will be limited by
Designers experienced with MOSFETs and the load connected. But just how long this
inductive loads are aware that the transients can be sustained depends on the amount
generated when the MOSFET is turned off can of cooling of the component. If the switch
destroy the device and the logic connected to in normal use becomes hotter than 150 °C,
it. Thanks to all the protection measures built then it will switch off. Once the tempera-
in, the BTS432E2 does not have any problems ture has dropped sufficiently it will restart
with this and it can therefore replace a relay in automatically.
many applications.
Despite all the advantages there are also a
Very handy is the ability to control this switch number of drawbacks with these types of
using a microcontroller which is operating at switches. The biggest is the on/off switching
2.7 V. A level shifter is built in specifically for speed. Often, this is over 1000 times slower
this purpose, so that the gate will receive a than a ‘plain’ MOSFET. Consequently the
proper drive signal despite the low voltage. Ibb BTS432E2 is not suitable for applications that
There is also a status output; this open-drain I IN
3
require fast switching. But generally speaking
Vbb
output supplies a low level when the output IN
this type of MOSFET is an excellent electronic
2 IL VON
is open circuit, there is a short-circuit to GND PROFET OUT alternative for a relay.
I ST 5
or Vbb, or when the temperature is too high. 4
ST
V VST GND
When the voltage is too low or too high the V
IN
1 Datasheet: www.infineon.com,
bb IGND VOUT
MOSFET will restart automatically, in this R
GND search for BTS432E2
case the status pin is not activated. In addi-
tion there is protection against an incorrectly Figure 2. Currents and voltages.
elektor 06-2012 73
Personal Download for I © Elektor
52429
This Dev kit was real state of the art stuff in 1977, but you had to be
fairly dedicated to do much with it. There was no assembler or com-
piler. You had to write the program on paper, hand compile it and
then load the memory with the required data using the keypad —
not that there was all that much memory, only 256 words of 12 bits.
The keypad and 7-segment display is in the bottom left of the
board. The address of the selected memory cell and its contents is
displayed by a set of eight 7-segment displays. The Keypad is 4 rows
of 3 columns and most keys have several functions.
Memory
This kit has to have three chips each 256×4 bit to get its memory.
The previous version had 12 256×1 bit chips. This was early days
for memory chips and this emphasizes the problems they had with
memory capacity, A main frame would only have 64 K×16 bit and
each programmer had a 2 K partition to work in. If he or she needed
more space it had to be done with ‘overlays’ from a magnetic tape.
Processor
Intersil developed the CMOS process in 1972 and the processor used
in this Dev Kit followed in 1975.
At first glance the processor looks fairly good but when you delve
into it a bit the flaws become apparent. Although it has up to an It has only three registers and no stack pointer. To be able to return
8 MHz clock the processor takes at least 10 T states to do anything; from a suboutine you have to save the return address in the first line
even a NOP, meaning it is desperately slow. One conditional jump of the subroutine, pick it at the end then jump back to the original
instruction takes 22 T states! The quartz crystal on this Dev Kit is address.
only 2.4576 MHz which gives a minimum execution time for an
instruction of well over 6 microseconds. There is an interrupt, but you have to poll the I/O devices to find out
There’s not much in the way of I/O space; only 64 addresses and only which one called and really surprisingly there is DMA request and
12 bit addressing, i.e. 4 K. acknowledge lines.
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
74 06-2012 elektor
Personal Download for I © Elektor
52429
Other pins form part of the I/O, when an I/O cycle is started c0,c1,c2
along with the skip pin Carry information from the I/O device back
into the CPU and determine which type of operation is to happen.
The Skip input pin causes the next instruction to be skipped. Rivet-
ing stuff! A ‘link’ output pin seems to be the Carry flag.
The IM6100 uses the PDP-8 instruction set and so is very much a
design that is halfway between the bit slice technology and the fully
integrated (modern) processor. Rather primitive really and awkward
to program, but the PDP8 was popular in its time and so a single
chip version seemed a good idea. The IMS6100 did find its way into
some military applications. There was even a version of FORTRAN
for it, but it was all killed off in 1982 when the IBM PC was produced
based on Intel’s 8088.
(120161)
[1] http://en.wikipedia.org/wiki/PDP-8
[2] www.computerhistory.org/
Bit Slice
In a bit slice system the Central Processor Unit is a whole circuit
board (i.e. 15 inches × 18 inches) full of dual in line (DIL) chips.
Each element of the processor is implemented as separate chips,
so for instance a 16-bit ALU (arithmetic logic unit) would be 4 off
74LS181 4-bit slices, likewise the State Machine was made up
from LS74 D-type latches, and so on.. The circuit board had an
Comparison with the Z80, which is more or less contemporary,
shows up something else. The folks at Zilog made a quantum leap edge connector which was the equivalent of pins on a micropro-
and designed the Z80 as a complete microprocessor with only the cessor chip.
data, address and relevant control lines brought out to pins. In con- Other circuit boards provided the memory, the I/O, the tape drive
trast the IM6100 appears to be much more like part of a bit slice interface, etc. and the whole caboodle was mounted in a 19” rack
system integrated into a single chip, and in fact that that’s what it is. frame with its own power supply.
PDP8 legacy When colour monitors came along that created another great box
The IMS6100 is a single chip version of DEC’s legendary PDP8 mini full of circuit boards and another power supply.
computer from the 1960s, also pictured here for your amusement I had a Data General Eclipse for a while and it needed 15 amps at
(rare /E version; source: WikiMedia Commons). Go check out the 240 volts to run it!
PDP8 on Wikipedia [1] and even better at the awesome Computer
elektor 06-2012 75
Personal Download for I © Elektor
52429
INFOTAINMENT
Hexadoku
Puzzle with an electronics touch
We’re happy to present yet another Hexadoku for the puzzle fans among our readers (and their spouses/
girlfriends — hi there!). With 16 x 16 cells to look at a Hexadoku is a real challenge to solve. Enter the right
numbers or letters A-F in the open boxes, find the solution, send it to us and you automatically enter the
prize draw for one of four Elektor Shop vouchers.
The instructions for this puzzle are straightforward. Fully geared to in each column and in each of the 4×4 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 (that’s 0-9 and A-F) occur once only in each row, once the numbers in the grey boxes.
Prize winners
The solution of the March 2012 Hexadoku is: 78BE0.
The Elektor £80.00 voucher has been awarded to Wolfgang Kallauch (Germany).
The Elektor £40.00 vouchers have been awarded to Luis Fernando Fox González (Spain),
Francis Biette (France), and Bruno Couillard (Canada).
Congratulations everyone!
7 4 3 A E F 6 1 2 8 0 D 5 9 C B
8 5 9 E 2 0 C D B 6 3 1 A 4 7 F
2 6 D C 3 4 7 B 9 5 A F 0 1 8 E
B F 0 1 9 A 5 8 4 C 7 E 2 3 D 6
5 8 1 2 0 9 D 3 7 A C 6 F B E 4
E 7 4 B A 5 1 2 3 D F 8 6 C 9 0
0 9 A D F 6 4 C E 1 2 B 7 5 3 8
C 3 F 6 7 8 B E 0 4 5 9 D 2 1 A
4 0 B 8 6 D 2 9 5 3 1 A E 7 F C
D 2 C 3 1 B 8 4 F 0 E 7 9 A 6 5
9 E 7 F 5 3 0 A 6 2 D C B 8 4 1
1 A 6 5 C E F 7 8 9 B 4 3 D 0 2
F 1 2 0 4 C 9 5 A 7 6 3 8 E B D
3 D E 7 8 2 A 6 C B 4 0 1 F 5 9
6 C 5 9 B 1 3 F D E 8 2 4 0 A 7
A B 8 4 D 7 E 0 1 F 9 5 C 6 2 3
The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses.
76 06-2012 elektor
Personal Download for I © Elektor
52429
Now
Just
$35.00
Buy it today!
www.cc-webshop.com Personal Download for I © Elektor
52429
ELEKTORSHOWCASE
NEW: ELEKTOR PREFERRED SUPPLIERS • now on www.elektor.com
365 days per year preferred suppliers online with up to date and relevant information.
To become a preferred supplier contact Johan Dijk by j.dijk@elektor.com
FLEXIPANEL LTD
www.flexipanel.com The HRLV - MaxSonar Sensors
TEAclippers - the smallest $PD]LQJ2QH0LOOLPHWHU5HVROXWLRQ
PIC programmers in the world, 6LPXOWDQHRXV0XOWLSOH6HQVRU2SHUDWLRQ
6XSHULRU1RLVH5HMHFWLRQ
from £20 each:
7DUJHW6L]H&RPSHQVDWLRQIRU$FFXUDF\
• Per-copy firmware sales
7HPSHUDWXUH&RPSHQVDWLRQ
• Firmware programming & archiving 2XWSXWVQRZLQFOXGH77/6HULDO
• In-the-field firmware updates
• Protection from design theft by subcontractors
$
34.95 (MSRP) www.MaxBotix.com
ROBOT ELECTRONICS
http://www.robot-electronics.co.uk
Advanced Sensors and Electronics for Robotics
FUTURE TECHNOLOGY DEVICES • Ultrasonic Range Finders
EASYSYNC LTD. INTERNATIONAL LTD.
www.easysync-ltd.com/ • Compass modules
www.ftdichip.com <http://www.ftdichip.com> • Infra-Red Thermal sensors
Supplier of communications and
FTDI specialise in USB silicon, hardware and • Motor Controllers
instrumentation products with specialist
software solutions. • Vision Systems
expertise in serial connectivity solutions based on
• USB WHQL complaint drivers. • Wireless Telemetry Links
USB, CAN and RS232/RS422/ RS485 interfaces.
• USB host and slave solutions. • Embedded Controllers
• USB to Serial RS232/RS422/RS485 converter
cables. • Free firmware development tools.
• CANbus solutions • USB IC’s, modules, cables and
• Ethernet to Serial Adapters or to USB hubs.
• USB based Logic Analysers, Oscilloscopes &
turnkey custom solutions. ROBOTIQ
• World renowned FOC application support. http://www.robotiq.co.uk
Data Loggers.
USB MADE EASY Build your own Robot!
• OEM & ODM design services.
Fun for the whole family!
Now, available in time for X-mas
ELNEC • Arduino Starter Kits *NEW!!*
www.elnec.com
• Lego NXT Mindstorms
Europe’s leading device HEXWAX LTD • Affordable Embedded Linux Boards
programmers manufacturer: www.hexwax.com • Vex Robotics (kits and components)
• reliable HW:
World leaders in Driver-Free USB ICs: • POB Robots (kits and components)
3 years warranty for most programmers
• USB-UART/SPI/I2C bridges email: sales@robotiq.co.uk Tel: 020 8669 0769
• support over 69.000 devices
• free SW updates • TEAleaf-USB authentication dongles
• SW release: few times a week • expandIO-USB I/O USB expander
• excellent technical support:
Algorithms On Request, On Demand SW
• all products at stock / fast delivery
• USB-FileSys flash drive with SPI interface
• USB-DAQ data logging flash drive
www.elektor.com
78 06-2012 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 · Coast Electronics · CS Technology · Easysync ·
FPGAs · Elnec · FTDI Chip · Robot Electronics ·
• VHDL Code Generators
• Makes DSP design
Surf to www.elektor.com
simple 365 days per year preferred suppliers online
• Download demos from with up to date and relevant information.
website
elektor 06-2012 79
Personal Download for I © Elektor
52429
Going Strong
A world of electronics Creative solutions for all areas of electronics
Offer
Limited Period ers! LabWorX: Straight from the Lab to your Brain
crib
for Elektor Subs Mastering the I²C Bus
15% DISCOUNnTe
Mastering the I²C Bus is the first book in the
LabWorX collection. It takes you on an
m/ju
www.elektor.co exploratory journey of the I²C Bus and its
applications. Besides the Bus protocol
Associated 60-piece Starter Kit available
Books
80 Prices and item descriptions subject to change. E. & O.E 06-2012 elektor
Personal Download for I © Elektor
52429
Bestseller! 110
10 issues
issues, more than 22,100
100 articles
This book is a practical guide to processor System in C# 1990-1999 volumes (all 110 issues) of
Elektor Electronics magazine (PDF). The
design in the real world. It presents the This book is aimed at Engineers, Scientists
more than 2,100 separate articles have
Verilog HDL in an easily digestible fashion and enthusiasts with developed program-
been classified chronologically by their
and serves as a thorough introduction ming skills or with a strong interest in im-
dates of publication (month/year), but are
about reducing a computer architecture age processing technology on a PC.
also listed alphabetically by topic. A compre-
and instruction set to practice. You’re led Written using Microsoft C# and utilizing
hensive index enables you to search the
through the microprocessor design pro- object-oriented practices, this book is a
entire DVD. What’s more, this DVD also
cess from the start to finish, and essential comprehensive and practical how-to
contains the entire ‘The Elektor Datasheet
topics ranging from writing in Verilog to guide. The key focus is on modern image
Collection 1...5’ CD-ROM series.
debugging and testing are laid bare. processing techniques with useful and
practical application examples to produce ISBN 978-0-905705-76-7
337 pages • 978-0-9630133-5-4
high-quality image processing software. £69.00 • US $111.30
£27.90 • US $45.00
Analysis starts with a detailed review of
the fundamentals of image processing. It
progresses to explain and explore the
practical uses of two highly sophisticated
and freely downloadable, open source im-
age processing libraries; AForge.NET and
Emgu.CV, utilizing dotnet technology
within the Microsoft Visual Studio en-
vironment. All code examples used are Bestseller!
available – free of charge – from the Elek-
tor website; you can easily create and A whole year of Elektor
kt magazine
i
develop your own results to demonstrate onto a single disk
the concepts and techniques explained.
DVD Elektor 2011
307 pages • ISBN 978-1-907920-09-7
The year volume DVD/CD-ROMs are among
Free mikroC compiler CD-ROM included £35.50 • US $57.30
the most popular items in Elektor’s product
Controller Area range. This DVD-ROM contains all editorial
More information on the articles published in Volume 2011 of the
Network Projects English, American, Spanish, Dutch, French
Elektor Website:
The aim of the book is to teach you the ba- and German editions of Elektor. Using the
www.elektor.com
CD/DVD-ROMs
sic principles of CAN networks and in addi- supplied Adobe Reader program, articles are
tion the development of microcontroller presented in the same layout as originally
Elektor
based projects using the CAN bus. You will Regus Brentford found in the magazine. An extensive search
learn how to design microcontroller based 1000 Great West Road machine is available to locate keywords
CAN bus nodes, build a CAN bus, develop Brentford in any article. With this DVD you can also
high-level programs, and then exchange TW8 9HH produce hard copy of PCB layouts at printer
data in real-time over the bus. You will also United Kingdom resolution, adapt PCB layouts using your
learn how to build microcontroller hard- Tel.: +44 20 8261 4509 favourite graphics program, zoom in / out on
ware and interface it to LEDs, LCDs, and Fax: +44 20 8261 4447 selected PCB areas and export circuit dia-
A/D converters. Email: order@elektor.com grams and illustrations to other programs.
elektor 06-2012 81
Personal Download for I © Elektor
52429
Circuits,
rcuits, ideas, tips and tricks from Elektor
Ele
82 Prices and item descriptions subject to change. E. & O.E 06-2012 elektor
Personal Download for I © Elektor
52429
£ US $
Bestsellers
Product Shortlist
Books Books
100892-1 ...... Printed circuit board.............................. www.elektorpcbservice.com ISBN 978-0-905705-98-9 .... £29.50 .....US $47.60
Preamplifier 2012 (2)
Microprocessor Design using Verilog HDL
3
110650-2 ...... Printed circuit board.............................. www.elektorpcbservice.com
Lossless Load ISBN 978-0-9630133-5-4 .... £27.90 .....US $45.00
110755-1 ...... Printed circuit board.............................. www.elektorpcbservice.com
Controller Area Network Projects
AVR Software Defined Radio (3)
4
CD-ROMs
100182-1 ...... Printed circuit board.............................. www.elektorpcbservice.com ISBN 978-1-907920-04-2 .... £29.50 .....US $47.60
100182-71 .... Kit of parts Active Antenna PCB plus all components,
311 Circuits
24,5 meter brass wire included ................................. 25.15.......33.20
100182-72 .... Signal-Generator + Universal Receiver + Active Antenna: 5 ISBN 978-1-907920-08-0 .... £29.50 .....US $47.60
PCBs and all components +
DVD Elektor 2011
USB-FT232 breakout-board ...................................... 99.90.....133.00
1
Kits & Modules CD/DVD-ROMs
ISBN 978-90-5381-276-1 .... £23.50 .....US $37.90
April 2012 (No. 424)
CD 1001 Circuits
Preamplifier 2012 (1)
110650-1 ...... Line-In/Tone/Volume board .................. www.elektorpcbservice.com
2 ISBN 978-1-907920-06-6 .... £34.50 .....US $55.70
LED Touch Panel
DVD Elektor 1990 through 1999
070558-1 ...... Controller board.................................... www.elektorpcbservice.com
070558-2 ...... LED board ............................................. www.elektorpcbservice.com
3 ISBN 978-0-905705-76-7 .... £69.00 ...US $111.30
AVR Software Defined Radio (2) Masterclass
100181-1 ...... Receiver board ...................................... www.elektorpcbservice.com
100181-71 .... Universal Receiver: PCB and all components.............. 49.90.......65.90
4 DVD High-End Valve Amplifiers
ISBN 978-0-905705-86-6 .... £24.90 .....US $40.20
100182-72 .... Signal-Generator + Universal Receiver +
CD Elektor’s Components Database 6
Active Antenna: PCBs and all components +
USB-FT232R breakout-board .................................... 99.90.....133.00
5 ISBN 978-90-5381-258-7 .... £24.90 .....US $40.20
Thermometer using Giant Gottlieb® Displays
AVR Software Defined Radio
110673-1 ...... Printed circuit board.............................. www.elektorpcbservice.com
110673-41 .... ATTINY2313-20PU, programmed............................... 8.85.......12.40
1 Art. # 100182-72 ................ £99.90 ...US $133.00
RS-485 Switch Board
Embedded Linux Made Easy
110727-1 ...... Printed circuit board.............................. www.elektorpcbservice.com
110727-91 .... RS485-Relay board, assembled and tested ................ 40.00.......56.00
2 Art. # 120026-91 ................ £57.80 .....US $93.30
110727-92 .... Set of 3 RS485-Relay boards ................................... 106.75.....149.50
Improved Radiation Meter
March 2012 (No. 423)
3 Art. # 110538-71 ................ £35.50 .....US $57.30
elektor 06-2012 83
Personal Download for I © Elektor
52429
COMING ATTRACTIONS
Elektor Project Generator Edition 2012
The annual extra-thick edition with an extra bunch of circuits
Next month we publish the 36th (say, thirty-sixth) edition of Elektor’s famed annual double edition for the months of July and August.
Our readers love & collect the PGE — our competitors dread it and never managed to publish anything remotely similar.
Our editors and designers are now burning their midnight oil to make sure you can enjoy lots of pages
with detailed descriptions and inventive electronics applications.
Don’t miss it, this jumbo edition of Elektor packed with gem articles & projects … like:
Programmable Power Switch USB Power Monitor
Versatile AVR I/O Module Motorbike Alarm
Square Wave Generator Loudspeaker Test System
Inrush Current Limiter Knitting Rev Counter
Arduino’d Laser Beam Battery Rejuvenator
LED Dimmer Arduino’d LCD
Shoo Heron! RJ45 Cable Tester
ATM18 Hygrometer
+
Special Summer Project
Lap Counter for Swim Athletes
Accelerometer for accurate personal lap counting
Elektor UK/European July & August 2012 edition: on sale June 21, 2012. Elektor USA July & August 2012 edition: published June 18, 2012.
84 06-2012 elektor
Personal Download for I © Elektor
52429
Order Form
06-2012
Description
£16.95
METHOD OF PAYMENT
(see reverse before ticking as appropriate)
Starter Kit Fun with LEDs NEW £22.20
Design your own PC Visual Processing and Bank transfer
Recognition System in C# NEW £35.50 Cheque
(UK-resident customers ONLY)
Microprocessor Design using
Verilog HDL £27.90
Controller Area Network Projects £29.50
LabWorX – Mastering the I²C Bus £29.50
DVD Elektor 2011 £23.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.
Products
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
4 Park Street
Vernon CT 06066
Date – – Signature USA
Phone: 860-875-2199
Fax: 860-871-0411
EL06
E-mail: order@elektor.com
✁
Order Form
Plus Membership
(11 issues plus the Elektor Volume 2012 DVD-ROM TIP
+ exclusive access to www.elektor-plus.com)
* Offer available to people who have not held a membership
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
EL06 service@elektor.com
Personal Download for I © Elektor
52429
All orders, except for memberships (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 memberships (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: ABNAGB2L. Currency: sterling (UKP).
Please ensure your full name and address gets communicated to us.
Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident
customers or members. We regret that no cheques can be accepted from customers or members in any other country.
GCredit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is
SSL-protected for your security.
COMPONENTS
Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply
of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not
exclusive.
TERMS OF BUSINESS
Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guaran-
tee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before
obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the
dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods
Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21-days (all other countries).
Cancelled orders All cancelled orders will be subject to a 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 adverti-
sements) 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 2012
January 2012
Personal Download for I © Elektor
52429
Subscribe Now!
12 issues
per year for just
Digital: $50 : : Print: $75 : : Combo (Print + Digital): $110
ROUTE FASTER !
All versions of Proteus also include an integrated world class shape based auto-router as
standard.
< Unique Thru-View™ Board Transparency. < Direct CADCAM, ODB++, IDF & PDF Output.
< Over 35k Schematic & PCB library parts. < Integrated 3D Viewer with 3DS and DXF export.
< Integrated Shape Based Auto-router. < Mixed Mode SPICE Simulation Engine.
< Flexible Design Rule Management. < Co-Simulation of PIC, AVR, 8051 and ARM7.
< Polygonal and Split Power Plane Support. < Direct Technical Support at no additional cost.