Beruflich Dokumente
Kultur Dokumente
com
lektorlabs
DESIGN BUILD SHARE magazine
(almost)
everything
you wanted to
know about
Soldering
Experimental
Doppler Radar
or how to build your own speed trap
POV Fidget
Nixie Spinner
Bargraph
Thermometer
High-tech look with a
vintage Nixie tube
User-programmed
illuminated text strings and animations
IoT Security Suite
Making the Complex Simple
The IoT Security Suite for the SAMA5D2 MPU enables rapid and easy use of its advanced
security features, such as ARM® TrustZone® technology and hardware cryptography,
without a long learning curve. The suite covers the security requirements for IoT
device manufacturers in a single, easy-to-use package. It supports storing, encrypting,
decrypting and exchanging keys between devices and applications, and its easy-to-use
APIs save you time.
Download the IoT Security Suite Evaluation Kit (free) to get started.
www.microchip.com/SAMA5D2
The Microchip name and logo and the Microchip logo are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. ARM and Cortex are registered trademarks of ARM Limited (or its subsidiaries)
in the EU and other countries. All other trademarks are the property of their registered owners. © 2018 Microchip Technology Inc. All rights reserved. DS60001511A. MEC2201Eng01/18
Elektorlabs Magazine
(continued from: Elektor Magazine)
Edition 4/2018
Volume 44, No. 490
July & August 2018
www.elektor.com
www.elektormagazine.com
Copyright Notice
The circuits described in this magazine are for domes-
tic and educational use only. All drawings, photographs,
printed circuit board layouts, programmed integrated
circuits, disks, CD-ROMs, DVDs, software carriers, and
article texts published in our books and magazines
(other than third-party advertisements) are copyright
Elektor International Media b.v. and may not be repro-
duced or transmitted in any form or by any means, The Circuit
including photocopying, scanning and recording, in
whole or in part without prior written permission from Editor-in-Chief: Jan Buiting
the Publisher. Such written permission must also be Translators: David Ashton, Jan Buiting, Martin Cooke,
obtained before any part of this publication is stored
Ken Cox, Arthur deBeun, Andrew Emmerson, Tony
in a retrieval system of any nature. Patent protection
may exist in respect of circuits, devices, components Marsden, Mark Owen, Julian Rivers
etc. described in this magazine. The Publisher does Membership Manager: Raoul Morreau
not accept responsibility for failing to identify such
International Editorial Staff: Mariline Thiebaut-Brodier
patent(s) or other protection. The Publisher disclaims
any responsibility for the safe and proper function Denis Meyer, Jens Nickel
of reader-assembled projects based upon or from Laboratory Staff: Thijs Beckers, Clemens Valens, Ton Giesberts, Luc
schematics, descriptions or information published in or
Lemmens, Jan Visser
in relation with Elektor magazine.
Graphic Design & Prepress: Giel Dols
© Elektor International Media b.v. 2018 Publisher: Don Akkermans
www.eimworld.com
Printed in the Netherlands
26 Err-lectronics
Corrections, Feedback and Updates on
projects published.
58 Homelab Helicopter
Remarkable items spotted for the home
30
electronics enthusiast.
Features
(almost) everything
10 Repair to Wi-Fi Card you wanted to know
with MHF4 SMD Connector
On installing a more capable Wi-Fi module
Projects about...
than the module fitted to the machine as
standard.
Doppler Radar
74 POV Fidget Spinner
Rotating animations.
Next Editions
Elektorlabs Magazine 5/2018
VHDL Course • Analogue Alternating Linear LED Fader
74
• Function Generator • GPS-based 10-MHz Reference •
VFD Clock •Short-Seeker •74xx TTL LED Clock • Remem-
bering the SN76477 • Cute temperature controller • DIY
solder station • and more.
12
search institutions as well as private authors, covering
High-tech look with a vintage Nixie tube.
ng 38 CAN Bus Debugging Tool
professional approaches to analogue and digital auto-
motive electronics and technologies. Plus you’ll find fresh
CAN 2GO: easy to use and low-cost. instalments of all the EBE regulars like Infographics,
44 Elektor RPi Audio DAC and Volume Operation Marketing, Our Business, and Business Store.
Control Tweaks & Updates
Thanks all for asking and contributing. Elektor Business Edition issue 4 / 2018 is published in print on 12
June 2018 to Elektor Gold members, and Elektor Green members
48 Experimental Doppler Radar as a pdf download. The edition is also available for purchase at
or how to build your own speed trap. www.elektormagazine.com.
Features
• Tracks pitch over five octaves
• Octave shifter
• Not highly accurate
• Fully customizable
The idea for this project came when A clever combination of continuously monitors its input pin 8 (PB0
browsing the Elektor Archives. In 301 hardware & software on the ATmega328). As soon as an edge
Circuits, the second book in the popular The input signal (from a microphone for is detected — rising or falling — it starts
Elektor ‘300’ series of books we came instance) is applied to K6 with trimpot counting microseconds; the next edge of
across project no. 14 entitled Easy Music. P1 controlling the input sensitivity. If a the same type — again, rising or falling
The article claims that the little circuit is stereo signal is applied it will be turned — indicates the end of the period and
capable of tracking a melody whistled at into mono first, before being amplified stops the counter. The measured period
its input and then adds a second voice by IC1.B and even further by IC1.A (see is converted into a frequency and com-
to it. Its output stage consists of a basic inset). Provided the input signal isn’t too pared to a table of musical notes (fre-
power amplifier and a loudspeaker. complex in terms of waveform shape, quencies). The note nearest in frequency
When asked to develop something sim- i.e. it is limited to two zero crossings to the measured frequency is selected
ilar today the first thing we would do is per period — as is the case for a typical and a signal with that frequency is output
throw an Arduino at it, and that’s exactly whistle sound — the signal should now be on pin 11 (PB3) to be used as input to
what we did. In the circuit presented close to a rectangle wave. IC2.A, a fast another signal processing system (delay,
here we have combined the old and the comparator, makes the rectangle wave’s chorus, other).
new. The old is the input stage from the edges really steep thus enabling precise
Easy Music project, the new is either an frequency measurements. The sketch in more detail
Arduino Uno or an AVR Playground run- The rest of the process is taken care of Pin change (PC) interrupts are used to
ning pitch tracking software. The sche- by the software executed by the micro- measure the frequency of the input sig-
matic shown in Figure 1 is the result. controller on the Arduino Uno board. It nal. Since these kinds of interrupts on the
Æ entry level
rupts are timestamped using the Arduino to a musical note. Unfortunately, manip-
micros() function and the time difference ulating multi-byte values are handled by
intermediate level
between two of them will then correspond the MCU on a byte per byte basis, and
expert level
to the period of the input signal. consequently the manipulation can be
interrupted in between bytes. The ISR
When Clark Gable turns into has priority over the rest of the pro-
2 hours approx.
Clint Eastwood gram and so it can change the value of
The value of the period measured in period just when it was being read by
microseconds does not fit into a single some other function. It’s like watching
Soldering tools,
byte. For example, 1 kHz corresponds TV while your roommate is playing with
Arduino Uno,
to a period of 1,000 µs which is larger the remote control. When Clark Gable
computer with Arduino IDE
than 255, the maximum value that fits starts of with “Frankly, my dear…” and
in a byte. Two bytes can be used for fre- Clint Eastwood takes over with “… go
quencies down to about 15 Hz, so to be ahead, make my day”, you are mud-
€20 / £18 / $22 approx.
on the safe side the period is stored as a dled. The same is true for our program;
32-bit (i.e. 4-byte) value (24-bit values it can get confused and produce unex-
are not available). pected results.
A4/SDA
A5/SCL
AREF
GND
+5V
12
10
11
13
9
8
7
6
5
4
3
2
1
0
K2 K1
S1
1
10
9
8
7
6
5
4
3
2
8
7
6
5
4
3
2
1
K5
C5
R11
1k
10u +5V
50V
R1 R8 R10
14 8 C6
2k
10k
27k
IC1 IC2
7 4 100n
C2
R13 C4
10k 10p
K6 P1
R4
15p
5M6 R7
C1 R2 3M3
6
100k C3 R5
R12 47k 5 3
100n IC1.B 4k7
10k 1 4 3
100p IC1.A
2 1
IC2.A
2
IC1 = LM3900
R3 IC2 = LM393 R6 R9
C7
5M6
5M6
10k
100n
+5V
1
2
3
4
5
6
1
2
3
4
5
6
7
8
A0
A1
A2
A3
A5/SCL
IOREF
A4/SDA
VIN
RESET
+5V
+3V3
Figure 1. Like a rolling stone, the 40-year old LM3900 drives the Arduino-based pitch tracker.
COMPONENT LIST
Advertisement
Extruded enclosures
standard and heatsink
www.hammondmfg.com/1455.htm
www.hammondmfg.com/1455NHD.htm
01256 812812
sales@hammond-electronics.co.uk
Elektor breaks the constraints of a magazine. It’s a community of active e-engineers — from
novices to professionals — eager to learn, make, design, and share surprising electronics.
Elektor PCB Service: Order your own PCBs, Elektor Weekly & Paperless:
both one-offs and larger runs. Your digital weekly news update. Free.
www.elektorpcbservice.com www.elektor.com/newsletter
Elektor Academy: Webinars, Seminars, Elektor Books: Arduino, Raspberry Pi, ESP32,
Presentations, Workshops and DVDs ... IoT, Linux and more. Available in our online
Practice-oriented learning. store with a 10% Member discount!
www.elektor-academy.com www.elektor.com/books
✔ Access to over 1,000 Gerber files ✔ Access to over 1,000 Gerber files
✘ Elektor Annual DVD
✘ Elektor Annual DVD ✔ Elektor Annual DVD
✘ 10% Discount in Elektor Store
✔ 10% Discount in Elektor Store ✔ 10% Discount in Elektor Store
✔ weekly e-zine
✔ Exclusive Offers ✔ Exclusive Offers ✔ Exclusive Offers
www.elektor.com/green www.elektor.com/gold www.elektor.com/newsletter
Q What’s a good soldering iron for electronics? A That is often a personal preference. At Elektor Labs we
use tin/lead solder wire with resin core (lux) for our
prototypes — the lux cleans the surfaces where the solder
Q How do I keep my soldering iron clean? A hot-air pencil or gun is not only useful for soldering or remov-
ing SMD components, it can also be very useful for desoldering
Q How do I solder a component with a BGA housing? A Fumes from modern solder wire alone are not known to be
toxic or hazardous in small amounts but they can cause
irritation and trigger certain allergies. Burnt plastics though are
Many metalworking fans wish to upgrade their lathes or milling machines by retrofitting a “computer link”
and so move on to the realms of CNC. This article describes the use of an Elektor Platino microcontroller
board and up to four digital callipers to determine the exact location of your drill bit or cutter on the machine.
PROJECT INFORMATION
Platino Arduino
measurement
CNC
entry level
Æ intermediate level
expert level
FTDI USB/TTL
converter cable (5V type)
VCC VCC
R21 R22
6k8
6k8
3 IC5 = LM393 5
K9 K11
1 1 SCALE1 1 7 SCALE2
IC5.A IC5.B
2 2 2 6
3 3
R1 R2 R6 R7
6 6
K8 K10
1k
1k
1k
1k
7 CLK1 7 CLK2
IC1.B IC2.B
1 5 1 5
1V5 1V5
2 2
CLK CLK
3 IC1 = LM393 3 IC2 = LM393
DATA DATA
4 3 4 3
5 1 DATA1 5 1 DATA2
GND R5 R4 R3 IC1.A GND R10 R9 R8 IC2.A
2 2
470k
470k
470k
470k
470k
470k
VCC VCC
R23 R24
6k8
6k8
3 IC6 = LM393 5
K13 K15
1 1 SCALE3 1 7 SCALE4
IC6.A IC6.B
2 2 2 6
3 3
1k
1k
1k
7 CLK3 7 CLK4
IC3.B IC4.B
1 5 1 5
1V5 1V5
2 2
CLK CLK
3 IC3 = LM393 3 IC4 = LM393
DATA DATA
4 3 4 3
5 1 DATA3 5 1 DATA4
GND R15 R14 R13 IC3.A GND R20 R19 R18 IC4.A
2 2
470k
470k
470k
470k
470k
470k
VREF VREF
VCC
K1
1 2 3 4 5 6 7 8 9 10 R25 VCC
R26
R27
R28
R29
R30
R31
R32
R33
C2
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PC7
PC6
6k8
6k8
6k8
6k8
6k8
6k8
6k8
6k8
6k8
100n
K4 VREF
16
1 2 3 4 5 6 7 8
D1 C1 VCC
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PD7
CLK1 6 7 CLOCK
1C0 1Y
CLK2 5
100n 1C1 IC7
K5 CLK3 4
1N4007 1C2
1 2 3 4 5 6 7 8 CLK4 3
1C3
SCALE1
CLOCK
AREF
DATA
74HC153
GND
PB5
AD1
AD0
DATA1 10 9 DATA
2C0 2Y
DATA2 11
2C1
DATA3 12 14 AD1
2C2 A
SCALE4
SCALE2
SCALE3
PC0
PC1
PC5
DATA4 13 2 AD0
2C3 B
K7 1G GND 2G
1 2 3 4 5 6
1 2 3 4 5 6 1 8 15
K6
GND
GND
RST
VIN
+5V
3V3
VCC
to Platino D2
K2
+VCC
2 8 8 8 8 8 8
C4 C3 C5 1N4007 VIN
IC1 IC2 IC3 IC4 IC5 IC6
1 4 4 4 4 4 4
100n 100n 100u GND
50V
Figure 1. The schematics of the extension board show the relative simplicity of the circuit.
+
6
5
4
3
2
1
1 2 3
Software
Because there was no description to be found, we were forced
to reverse-engineer the data protocol used by the callipers at
hand. Figures 2 and 3 show screenshots of the data and clock
signals captured from a calliper.
@ WWW.ELEKTOR.COM
ªExtension Board, bare PCB
www.elektor.com/140343_41
ªProgrammed microcontroller
ATMega328P
www.elektor.com/140343_1
ªPlatino v1.4, bare PCB
www.elektor.com/150555-1
ªLCD, 4x20 characters
www.elektor.com/120061
ªBook: Mastering Microcontrollers
helped by Arduino (3rd edition)
Figure 5. Make sure to use these fuse settings when programming the ATmega328P via ISP! www.elektor.com/mastering-
microcontrollers
ªE-Book: Mastering
Microcontrollers helped by Arduino
(3rd edition)
Web Links www.elektor.com/mastering-
[1] www.elektormagazine.com/100892 microcontrollers-e
[2] www.elektormagazine.com/140343
[3] http://en.timm.cn/instruments-tool-v29-horizontal-digital-scale-unit.html
The shutdown of analogue television an increasing number of voices calling Why DAB?
irst to DVB-T and then DVB-T2 in order for the replacement of the broadcast of No argument: DAB radio has no back-
to fully exploit the ‘digital dividend’ (= analogue modulated radio signals with- ground noise and actually sounds pretty
make better use of the available band- out compensation. In Germany the out- good, dependent mainly on the data
width in the ether) highlights how tech- cry would be great, because DAB sim- rate on ofer (typically between 48 and
nical progress can also cause collateral ply cannot achieve this on its own and 112 kbit/s) — as good as CD quality
damage by making existing receivers no 97% of the German population still pos- sounds when streamed. Of course, this
longer usable or at least not fully usable. sess completely non-digital radio sets. does not give you the same quality as
Even lovers of classic audio broadcast- The state would like to enforce a larger lossless or at least low-loss compressed
ing (i.e. radio) are afected by drastic installed base before, for example, most signals, but digital transmission certainly
changes. Many nations have announced road vehicle drivers will no longer be able beats the sound quality of FM in many
or already implemented the replacement to receive traic updates. repects. In addition, signiicantly more
of analogue radio broadcasting by digital digital channels can be squeezed into a
[1]. In some countries the sale of radio That’s technology for you! If people do speciied frequency domain than would
receivers without DAB capability will soon not adopt DAB voluntarily, some admin- be the case with analogue. So every-
be no longer be allowed. There is also istrative force will be required... thing is ine then and the legislature is
Experience gained
Reception is extremely good. This is
remarkable, as my oice is right on the
edge of German territory, only around
Figure 6. Despite low field strength, reception of DLF Nova is good. The screenshot illustrates Expert
4 km away from France as the crow flies.
View mode.
For me which stick I used made no great
diference. Only the ield strength of indi-
vidual transmitters varied. This was occa-
sionally one point below maximum with
the white stick, whereas the blue stick
indicated mostly maximum ield strength
— no wonder with its longer antenna.
However, I soon had new problems,
because for some reason reception or a
new channel search failed altogether. To
check whether this could have something
to do with loading the new driver without
deleting the old one, I installed Welle.io Figure 7. Current consumption of the blue stick in DAB radio operating mode.
and the drivers again onto a fresh Win-
dows 10 system on my laptop. Lo and
behold: everything perfectly in order —
stable and interference-free reception at in action. At 5.2 V we have a current of contribute to its further development.
diferent corners of the house. Even with 0.26 A flowing. That means the stick con- The complete source code is available on
the short antenna and the cheaper stick, sumes 1.35 W. To this we should add the the corresponding GitHub page.
the reception was ine; just occasionally energy consumption of the PC on which Welle.io is not only for Windows. On
I had to position the antenna correctly. Welle.io runs. I can also report here that Google Play there is also a version for
All in all, the combination of a low-cost Welle.io poses an additional requirement Android and consequently for suitable
DVB-T stick and Welle.io will give you of about 5 W (over and above idle). How- mobile radio devices equipped with USB
a good PC radio for little outlay. In my ever, this relates speciically to my PC, master interfaces. As well as the version
experience the blue stick has the edge which is itted with an i7-7700K CPU, for ARM-SoCs there is even one for x86
on account of the antenna, even though which runs at around 4 GHz. On a laptop processors. In principle a standalone DAB
it costs twice the price of the more basic it would be somewhat less. radio (including display) can be created
white one. Before you ask, the little remote con- on a Raspberry Pi platform. The Win-
trol zappers provided with DVB-T sticks dows version is available for download for
And finally do not work with Welle.io. Maybe you installation in ready compiled form, whilst
In standby mode a DVB-T stick of this need to wait for a software update or there is a 64-bit version for Linux x86.
kind draws around 100 mA from the else tackle the task yourself. Implementations for OS X are circulating
5 V furnished by the USB interface, i.e. Welle.io is not only an easy-to-use Open on the Internet as well. My experiments
equivalent to 0.5 W. Active operation in Source program but it’s also backed up took place on the very latest 64-bit ver-
radio mode increases its energy con- by online instructionals, a small Wiki, and sion of Windows 10.
sumption. Figure 7 shows the blue stick a user forum. If you wish, you can also (160502)
Web Links
@ WWW.ELEKTOR.COM
[1] Digital radio switchover status: https://en.wikipedia.org/wiki/Digital_radio
[2] Welle.io software website: www.welle.io ªElektor SDR Shield 2.0
www.elektormagazine.com/170515
[3] Realtek RTL2832U chip web page: https://bit.ly/1dtzV0T
www.elektormagazine.com/tags/elektor-business-edition
Many thanks for your feedback from ’on high’ so to speak. We are glad you
enjoyed the article and can conirm the results reported in the article.
Elektor Editor
Weather Station
Elektor 1/2018, p. 54 (160566)
FEEDBACK. The article discusses,
amongst other things, the I2C bus. I have
a gripe with the use of pull-up resistors in
this project. In this design there are several
sensor modules connected to the I2C bus and some
contain built-in pull-up resistors. According to the
deinition a pull-up, resistor should have a value to
ensure a known state for a signal. In order to reduce
possible interference and counteract the efects of
line capacitance, it’s advisable to use lower pull-up
resistance values, and place just one at each end of the SDA and SCL line.
It is by no means the case that each device on the bus requires its own pull-up resistors. Even though none are itted
it is not necessary to add any to the diferential pressure sensor modules used in the article. So many pull-ups on the
bus lines can even be detrimental. Operating at 3.3 V the efective pull up resistance should be >= 1.1 kΩ (3 mA max-
imum according to the I2C specs). I suspect (but I’m not certain) that the three connected sensors each have 10 kΩ
installed as a pull-up. These are all connected in parallel on the bus producing an efective pull up resistance of 3.3 kΩ.
An additional pull-up will probably not create a problem and may even help to ofset bus capacitance efects. When the
pull-ups are 4.7 kΩ however they will produce an efective resistance of around 1.5 kΩ and this value will produce close
to the maximum allowable current. Add another pull-up with a value less than 4.7 kΩ and the maximum current will be
exceeded which can lead to unreliable operation or system malfunction.
The best solution is to terminate the bus lines at each end with pull-ups and remove any additional pull-up resistors it-
ted to any module you hang onto the bus.
Martin Seine
U R P ROJEC T–
OGY F O R Y O
N A L TECHN S OL
PRO F E S S IO
HIGHLIGHT
TECHNOLOGY
MEASURING
EN
TRMS multimeter, 6000 counts 61010-1
CAT IV
In addition to all relevant basic measuring functions 600 V
PRICE
TIP 71. 99
(£ 59.99)
2 CHANNELS
25 MHz
SAVE SAVE
309.74 (£ 258.12) 10% (Please order compatible mains
cable: NKSK UK 180, see below) 224.20 (£ 186.84) 11% (Please order compatible mains
cable: NKSK UK 180, see below)
TER
Test equipment set, 8-piece AC power cable, 1.8 m
B S C R IB E T O NEWSLET
SU ITS!
ANY BENEF
2x Kleps 30 test probes UK plug >
2x PRÜF2 test probes IEC socket NOW FOR M
2x AK2S alligator clips
Always be the first to be informed –
2x 1 m test lead
MLN 1/100 (1.0 mm²) ORDER NOW Top offers, interesting information,
promotions and new products
Order no.:
PMS 4 8-piece 19.90 (£ 16.58)
Order no.:
NKSK UK 180 3.33(£ 2.78) LOG IN NOW ► http://rch.lt/ NLUK
Daily prices! Price as of: 28. 5. 2018 Onlineshop languages:
The statutory cancellation provisions apply. All prices are stated in £ including statutory value added tax, plus
shipping charges for the entire shopping basket. Our Terms and Conditions (available at https://rch.lt/TERMS
or on request) apply exclusively. Actual appearance of products may differ from photos. We accept no liability
for misprints or errors; prices subject to change.
www.reichelt.co.uk
reichelt elektronik GmbH & Co. KG, Elektronikring 1, 26452 Sande (Germany), Phone: +44 203 808 95 25 ORDER HOTLINE: +44 203 808 95 25
LABS PROJECT
Nixie tubes are always fascinating. Nowadays they are mostly used Æ entry level
intermediate level
for clock displays, such as the project in the May/June 2016 issue of expert level
Elektor [1]. The ‘Nixie’ bargraph tubes for analogue readout in the form
of a column of light are less well known. Strictly speaking, they are not
2 hours approx.
Nixie tubes because they do not display numerals, but they have the
same warm retro allure because they are also illed with neon gas. The
thermometer described here uses a Russian IN-9 tube and is a nice Standard soldering equipment
alternative to the usual clock projects. PC with Arduino IDE
We initially considered using the Russian quantities (a few dozen). As we hope Bargraph tubes
IN-13 bargraph tube for this thermom- this thermometer project will be more
eter. That’s because it is fairly easy to popular than that, we ultimately opted History
control and it has been used success- for the IN-9 tube. It is still available in Linear indicators have been with us for
fully in several modern designs. In our relatively large quantities and at low cost. hundreds of years already, in the form of
search for a reasonably large amount of One of the reasons is that this tube is thermometers illed with mercury or alco-
‘new old stock’ of this particular tube, less popular with designers and electron- hol, liquid level indicators (sight glasses),
we contacted a number of vendors but ics hobbyists because it is difficult to get pressure gauges and the like. The advent
unfortunately came up empty-handed. it working reliably. That often leads to of electronics led to a constantly grow-
Aside from being distinctly pricey, IN-13 frustration and a bit of strong language. ing demand for displays, indicators and
tubes are now only available in limited measuring instruments with electrical
+5V A
V1
R22 R20 R14 L1
C8 C2
820k
D1...D3 =
27k
3k3
47uH
1% MUR160G
220u 100n
C4 +5V IN-9
100n D3
4 8 +3V3
JP1
RESET VDD 3
5 100V D2
CV C3 C 2
T1 7 R12
DISCH D1 1
R19
100n
1k
IC1
1%
27k
R13
BC ICM7555 T5
R18 8
547B R1 3 T2 T3
2k2
6 3 10k
1% TRSH OUT 47R 1
2 1% IC2.A
T4
TRIG 2 2x
C1 GND IRLD110 C6 C7 C5
P1
4 MPSA42
4k7 1 TUBE_PWM R3 R4
330p 2u2 2u2 1u
220R
220R
200V 200V
2N7000
R2
+5V
150R
+5V 1%
DS18B20 R15
T6
3
4k7
VDD
K1
1 75HZ
2 2 1-WIRE R21 R11
DQ
3
IRLD110
820R
100k
DS18B20 MOD1
GND 1W
GND VDD 1 1 30
DQ TX VIN
+5V 2 29
RX GND
3 28
RST RST +5V
4 27
GND 5V
D4 D5 5 26
D2 A7 +5V
6 25
D3 A6
7 24
IC2 = LM6142
D4 A5 R17
8 23
D5 A4
10k
R5 R6 R7 R8 R9 R10 9 22
D6 A3
10 21
330R
330R
330R
330R
330R
330R
D7 A2 5
11 20
D8 A1 7
PWM_R 12 19 IC2.B
D9 A0 6
PWM_G 13 18 R16
D10 AREF +3V3
PWM_B 14 17 10k
D11 3V3
15 16
D12 D13
USB
160705 - 11
ARDUINO_NANO
About a year ago there was a lively dis- That most commonly occurs with tubes also tends to start at the bottom. That
cussion of this topic on the neonixie-L that have not been used for a while. For- works more reliably than ignition in the
newsgroup site [3]. A user with the moni- tunately, this problem can be eliminated IN-9. In addition, with the IN-13 it is
ker ‘start end’ even posted the schematic by a burn-in process in which a higher usually not a problem if the tube is not
of a circuit that periodically interrupts the than normal current is forced through the used for a while, so the burn-in process
current through the IN-9 tube. We put tube until the light column is high enough. is not needed as often.
that idea to a rigorous test, and it turns With both the IN-13 and the IN-9, the
out to work very well. You won’t be sur- IN-13 versus IN-9 useful life is limited by sputtering, which
prised to learn that we have partly based The IN-13 is a bit longer than the IN-9, causes material from the cathode to be
our thermometer design on that princi- and the current necessary to light up deposited on the glass tube. As a result,
ple. A small drawback of this technique the tube over a given length is lower. the metal layer gets darker and darker,
is that it slightly degrades the linearity However, the light output is somewhat and in some cases internal shorting may
of the tube, but that can easily be cor- lower. The main difference is that the occur.
rected in the software. IN-13 has an auxiliary cathode in the
Another annoying characteristic of IN-9 form of a short length of wire. This aux- Schematic
tubes is that sometimes the light column iliary cathode is constantly ignited, so In the schematic (Figure 2) you can see
does not reach all the way to the top. the light column of the main cathode a switching power supply, the drive cir-
COMPONENT LIST
dle 75 V or so (half the output voltage). Additional interesting information about enough current. By the way, during nor-
For the sake of simplicity, however, we voltage multiplication is available at [4]. mal operation the software periodically
chose components with 200-V rating for runs the light column up and down in a
both C6 and C7. That doesn’t make much Driving the IN-9 tube short animation sequence to keep the
difference in the price, and it avoids fatal The IN-9 tube is driven by a current tube in good condition.
mistakes. source consisting of opamp IC2, tran-
The combination of diodes and capaci- sistors T2 and T3, and resistors R2, R3 Construction
tors in the voltage doubler may appear and R4. The analogue input signal to the Mount the components on the component
complicated at irst sight, but the prin- opamp is a PWM signal from the Arduino side of the PCB (Figure 3) in the usual
ciple is actually fairly simple. Suppose Nano, with low-pass iltering by R18/C5. manner, working from low to high proile.
transistor T5 is conducting. Then a cur- Here we use the 3.3-V supply voltage Leave K1 unmounted for the time being.
rent flows through the inductor L1. When provided by the USB/serial converter Resistor R11 must be mounted well clear
T5 switches off, L1 will try to uphold of the Arduino module. The 5-V supply of the PCB because it becomes very hot
the current, with the result that the voltage from computer USB ports, USB during the burn-in process.
stored energy is transferred through power adapters or USB powerbanks can Bend the leads of the RGB LEDs in a U
diode D1 to capacitor C6. The voltage vary considerably, often due to the volt- shape and mount them on the solder side
is boosted incrementally by each suc- age drop over the USB cable. By using with the LED packages inserted in the
cessive cycle. Up to this point we have a the 3.3-V supply voltage, we avoid any 5-mm holes in the PCB. Make sure the
conventional boost converter. Now sup- influence of this variation on the tem- lead orientation is correct. Remove one
pose that C6 has been charged to 75 V. perature readout from the IN-9 tube. pin from each of the 16-pin bus strips
When T5 switches on, capacitor C4 will To keep the temperatures of the transis- and mount them on the solder side of the
be charged from capacitor C6 through tors in the current source within reason- PCB to hold the Arduino Nano. Finally,
diode D2 to about 75 V. In this situation able limits, we connected two MPSA42 mount K1 on the component side. Fig-
no current flows through D3 because transistors in parallel. ure 4 shows what the inished board
we can assume that the voltage on C7 Transistor T6 is driven directly by the should look like.
is higher than the voltage on C6. When Arduino Nano and switches the IN-9 tube Plug the Arduino Nano into the bus strips
T5 switches off again, C7 is charged to on and off at a 75-Hz rate. That is a good and insert IC1 and IC2 in their sockets.
the sum of the voltage at the junction deal higher than the 50-Hz line frequency Then mount the IN-9 tube on the tem-
of T5, D1, C4 and L1 (about 75 V) and and helps to reduce visible flickering. perature scale using the included clips.
the voltage on C4 (also about 75 V), On account of the low supply voltage Click the clips into the temperature scale
in theory yielding a voltage of about (5 V), we chose a rail-to-rail opamp — with the small groove facing to the rear,
150 V. As capacitor C4 only transfers in this case an LM6142. With a ‘nor- then slide the IN-9 tube beneath the clips
charge from C6 to C7 in each cycle, mal’ opamp such as the LM358, the from the bottom until it reaches the right
it can have a signiicantly lower value maximum output voltage is not high position (Figure 5). The IN-9 tubes have
than C6 or C7. The overall efficiency of enough to drive T2 and T3 sufficiently a rather wide range of diameters, so the
the circuit is not especially high because into conduction. kit includes four sets of clips for vari-
we chose a low-cost MOSFET with a rel- Finally, jumper JP1 allows the cathode ous tube diameters. Choose the set that
atively high RDS(on) for T5, and there is of the IN-9 tube to be connected to will hold the IN-9 tube securely without
noticeable heat dissipation. However, ground through an 820-Ω resistor for applying too much clamping force, as
given the total power consumption of the the burn-in process. Do not connect the otherwise the tube may break. Fit the
circuit — about 0.6 to 1.7 W in normal circuit to the USB port of a computer for cover plates for the RGB LEDs with the
use — that is not a problem. that purpose, because it cannot supply metallic side facing inward.
The widest
selection of
processor executes the code concerned with the correct tim-
the newest
ing. However, the underlying Arduino library is temporarily
blocked when a lot of data is sent to the serial port, until a
number of characters have been transmitted, so the software
products.
is not able to generate the 75-Hz signal correctly and the tube
is not driven properly. Over 5 million products from
This effect can occur with commands that send back a lot of
data, such as settings dump, or if the software is compiled over 700 manufacturers.
with enabled options for sending debug data. However, it does
not occur during normal use of the thermometer.
The software uses a look-up table to convert the tempera-
ture in degrees Celsius to the PWM signal that drives the
IN-9 tube. In the calibration procedure you can manually set
PWM values and then see which temperature is indicated.
Then you can program these PWM values in the table. The
more values you program in the table, the more accurate
the temperature indication will be on the thermometer. If
the table does not contain a PWM value for a particular tem-
perature, the software interpolates between the PWM values
of two known temperatures.
It is advisable to check the calibration after the thermometer
has been in use for a while, and adjust it if necessary.
(170589-I
CAN (Controller Area Network) is a popular communication interface used in many industrial and automotive
applications. The complex character of these applications often requires efficient and easy to use debugging
tools. CAN 2GO is such a tool, suitable for the CAN 2.0 A and B protocols. Connected to a CAN bus and a PC,
all functions of the tool are accessible from a PC application with a GUI.
By Szymon Panecki (Poland) user to see the CAN message in the CAN Analyzer application,
a dedicated application for CAN 2GO.
The second task is the counterpart of the irst task: when
CAN 2GO can be described as a tool that allows debugging of content is sent from the PC to the CAN 2GO (using the CAN
CAN 2.0 A/B communication. On application level there are sev- Analyzer application), it converts this to a CAN message and
eral tasks the circuit performs, presented graphically in Figure 1. sends it on the CAN bus.
Let’s start by focusing on each of them and explain their purpose. The third task is related to the irst two tasks. The sending
The irst task CAN 2GO performs can be described as “CAN-to- and receiving of CAN messages should be indicated to the
USB converter”. The circuit listens to CAN traffic and receives user somehow. The very simple solution we use for this is…
and processes every CAN message that is sent on the CAN bus. an indicator LED. After the reception of each CAN message an
It converts the message content to ASCII format and transfers LED on the PCB is made to blink once. When a CAN message
it to the connected PC via the USB interface, permitting the is sent, another LED is made to light up shortly.
Components selection
The implementation of the functionality described above requires
Figure 1. Tasks executed by CAN 2GO kit (PCB and PC application)
a speciic selection of Integrated Circuits. These are: MCU
together with arrows showing the direction of data low.
(microcontroller), CAN transceiver, power management IC and
USB protection IC. The author selected the following compo-
nents from the portfolio of Inineon Technologies:
• MCU: XMC4100-F64K128;
• CAN transceiver: TLE6250GV33;
• Power management IC: IFX1763XEJV33 voltage regulator;
• USB protection IC: ESD8V0L2B-03L TVS (Transient-Volt-
age-Suppression) diodes.
VDD3.3
TRST
R8
C4 C5 C6 C7 C8 C9 C12 C13 C10 C11
4k7
10u 100n 10u 100n 10u 100n 10u 100n 10u 100n
8 38 56 13 57 9 42
VDD5USB VDD3.3 VDD3.3
VDDC1
VDDC2
VDDP1
VDDP2
VDDP3
VBAT
P0.8
R4 L1
1 22
P0.1 VDDA/VAREF
L2 2 64 BLM18PG600
10k
17 51 4 8
3 ESD8V0L2B-03L P14.5 P1.1 RXD INH
18 50
P14.4 P1.2 GND
C15 19 49
P14.3 P1.3 2
20 46
P14.0 P1.15 VDD3.3
100n 23 35 X2
P14.9 P2.7
24 36 RESET 10 9
P14.8 XMC4100-F64K128 P2.6
25 58 R9 TDI 8 7
P2.15 P0.7 33R
26 33 R10 TDO/SWO 6 5
P2.14 P2.1 33R
27 45 R11 TCK 4 3
P2.9 TCK 33R
28 44 R12 TMS 2 1
P2.8 TMS 33R
29 34
P2.5 P2.0
VSSA/VAGND
U3 30
P2.4 PORST
43 Debug
IFX1763XEJV33 31 32
P2.3 P2.2
XTAL1
XTAL1
VSSO
8 1
IN OUT
7 2 37 39 40 21 41
NC SENSE R1 R13 R14 R7
3
NC C2 R6
100R
100R
510R
100R
10k
5 4
EN TAB BYP Q1
GND 10n
160387 - 11
Figure 3. The schematic shows the MCU as the main component of the circuit.
C9
C20
R8
U4 R 4
Care has to be taken regarding the ground pins, of which the R3
R2 R 10
R 11
MCU has three: VSSA/VAGND, VSSO and VSS. All of these LED1 C4
R12
C16
R1
C5 R7
C1
C13
C12
C11
need to be connected to the same ground plane, which is also
R6
C10
R5 Q1
C18
connected to the voltage regulator, the CAN transceiver, the C15 R13 R14
C14
C7 C6 C17
C3
LED3
USB connector and all decoupling capacitors. C2 L1
LED2
• A table showing traffic on the CAN bus (both sent and can be sent onto the CAN bus by clicking the “Send” button.
received CAN messages). The Clear button clears the An example of CAN communication between two CAN 2GO kits
table; is shown in Figure 6.
• CAN message ields which can be illed by the user. The (160387)
Send button sends these as a CAN message.
For questions the author can be contacted via email:
Practical use Panecki.Szymon@gmail.com.
First we need to setup the hardware:
Web Link:
• Connect the CAN 2GO PCB to a PC using a micro USB
cable. [1] www.elektormagazine.com/160387
• Connect the CAN 2GO PCB to the CAN bus via X3.
• If CAN 2GO is the irst or last node on the CAN bus, set
JP1 to terminate the bus correctly.
Web Links
[1] Before the Crash: Early Video Game History, Mark J. P. Wolf.
[2] www.pong-story.com/GIMINI1978.pdf
[3] http://mrpjevans.com/2014/05/binatone-composite-mod/
[4] https://en.wikipedia.org/wiki/File:AY-3-8500_pinout.png
Possibly due to a synergetic effect of crossbreeding a real stomper like the Raspberry Pi with the fine art of
high-end audio design, the publications RPi High-end Audio DAC [1] and the subsequent Volume Control for
RPi Audio DAC [2], were both raving successes. But with success come queries.
As with any good audio DIY project disseminated through a Configuring WLAN and getting an IP address worked though it
publication on paper and/or online, users not only flock to buy took a few minutes or so it seemed. Also adding a NAS mount
the boards and play music, but in good engineering spirit also succeeded. But a Library Update didn’t finish. After rebooting
respond with useful feedback. Here is some — be warned, it the entire WLAN interface was gone...
goes at terrific speed. A few days later I plugged the SD card in and tried one more
time and Volumio started normally. I set up WLAN and to my
RuneAudio surprise it worked, I got an IP address and the NAS mount
One user kindly reported that WLAN does not work when using added previously was accessible as well as operational. But
the image of Volumio 1.55 we added to the project software booting after disabling the option ‘Wait for Network at Boot’
at [3] (that’s Elektor_Volumio_8GB_Image.zip under Attach- in the Raspberry Pi Software Configuration Tool (raspi-config),
ments/Software). When testing it, indeed WLAN didn’t work. To no LAN got connected, is slowed down by more than a minute.
come up with a solution I repeated the installation of Volumio Adding the line
1.55 as described further on in ‘Raspbian Stretch not work- xserver-command=X –s 0 –dpms
ing’. I used 2017-07-05-raspbian-jessie, it employs Desktop in
Pixel which has a GUI to configure WLAN. Setting up a wireless /etc/lightdm/lightdm.conf
connection worked like a charm. Next up for me was installing to disable the screensaver causes the installation to
Volumio. To install the 3.5-inch Touch Screen TFT LCD from freeze. I am not confident this image is working prop-
Waveshare, the driver ‘LCD-show-170703.tar.gz’ is needed [4]. erly but luckily there’s an alternative solution: RuneAudio!
my WiFi-network was listed also. Make sure new devices are many hours it was time to use an older version of Raspbian:
allowed to connect to your router. Other security settings in 2016-09-23-raspbian-jessie.img without upgrading, and no
your router or network configuration can caus the connection to RPi update. This worked. The textbox ‘Recipe for a stand-
fail and/or your SSID not among the wireless networks found! alone music player’ shows an updated description how to
Disconnect the LAN Cable and reboot. RuneAudio should now install Volumio 1.55. Having performed this installation, a few
connect through the WLAN interface. After power-up a short settings need to be changed to get the Audio DAC to play
copyright screen is shown with a login. Just wait and be patient within Volumio:
— this screen may be shown for more than a minute before boot- • in Playback/Audio Output, select ’sndrpihifiberry’;
ing continues. RuneAudio has no menu for resampling and con- • in Playback/Volume control mixer/mixer type, select
sequently all audio files and Internet radio stations (like Dirble) ‘disabled’;
must be 24-bit or 32-bit encoded, otherwise there’s no sound. • in System/I2S driver, select ‘Hifiberry’;
In case you inst all the 3.5-inch Touch Screen TF T • in Library, select UPDATE LIBRARY.
LCD yourself, in the original RuneAudio image check
the following configurations necessary for our DAC: Any changes in a disconnected/reconnected USB thumb drive
(in Elektor_RuneAudio_8GB_Image these settings are already or NAS require another update to make the changes visible
set): in Volumio.
running on RASPI 2B. He then took the Raspi image found on especially with updating the “Library”. Al last some songs, 16-bit
the Mini DVD and followed all the instructions as described in as well as 24-bit were seen in the playlist and the playtime
the article. He configured Volumio and performed many reboots, was ticking. Sadly, despite the DAC module and stereo amp
along the way getting used to handling the audio player-GUI, both powered there was nothing at the analogue-audio input.
Web Links
[1] RPi High-end Audio DAC, Elektor Magazine 4/2017 (May & June): www.elektormagazine.com/160198
[2] Volume Control for RPi Audio DAC, Elektor Magazine 6/2017 (November & December): www.elektormagazine.com/160321
[3] Elektor Labs page:
www.elektormagazine.com/labs/audio-dac-for-rpi-networked-audio-player-using-volumio#/comments/labs/1206
[4] LCD driver: http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)
At this stage the LCD is still isn’t used, just the HDMI output.
sudo reboot
Volumio appears and asks to update. Updating the first time
produces an error. Close Midori (Alt-F4) and start Midori again.
Enter http:/localhost in the address bar and try again. Or
right-click on the error page and select back and try again.
Experimental
Doppler Radar
or how to build your own speed trap
48 July & August 2018 www.elektormagazine.com
Features
• Measures speed of moving targets
• Commercially available low power radar module
• K-band (24 GHz)
• Range 60 m minimum; 100 m usable
• Resolution 0.24 m/s
• Easy-to-understand digital signal processing
• Universal dsPIC baseboard can be repurposed for other applications
PROJECT INFORMATION
Doppler
radar
DSP FFT
entry level
intermediate level
Æ expert level
4 hours approx.
A couple of years ago I read an article about small radars [2]. After that I also began noticing product news
items from various companies about small, low-cost radar transceiver chips and modules, and so I decided to
do a hobby project on microwave radar. Here’s what I came up with.
The aim of the project was to build a Of course, it’s also important to assign A little bit
microwave Doppler radar by using a, low- some practical use to the final product. of Doppler radar theory
cost off the shelf radar module. For example, a Doppler radar may mea- A radar transmits a signal using its trans-
sure the speed of a ball, a bicycle or a mit antenna. When the signal hits upon
The most interesting thing as I see it running person, which may turn out to an obstacle a portion of the transmitted
was to learn new things and make elec- be pretty entertaining among the more energy gets reflected and is received,
tronics bits and pieces work as planned. sporty kids in the neighbourhood. heavily attenuated of course, by the
+5V +3V
10k
IC3
IC5
K1 D1
ADP3336ARMZ-REEL7 IC4 IC11 *see text D2
1N4148 ADP150AUJZ-3.0-R7
1 7 1 1 6 5 1
IN OUT VIN PG L1 VIN BOOST
2 R26 3 7 C19 R43 1 5
ON/OFF MBRS540 OUT EN SW MCP16301 VIN VOUT
15uH
210k
8 3 4
31k6
BAT1 IN OUT ADP2370 EN
2 6 100n 3 4
FSEL SW EN NC
6 5 4 5 3 GND
9V SD FB SYNC FB VFB
C9
GND
C10
R27 R28 * C12
PGND
C11 C21
GND
D3
R44
C20 C13
2
C14
4 8 PAD 2
64k9
10k
NC
2u2 2u2 10u 10u 10u 10u 2u2 2u2
16V 16V 16V 16V 16V MBR120 16V 16V 16V
SW
+3V3
K3
DBG
+5V
R1
+UB 1 2 3 C2 C3
IC9
RA4
RA3
10k
Si3865DDV
R31
R34 R35 100n 100n
2 4 R32
10k
13 28
10k
10k
+3V
180k
3
VDD AVDD
6 1 26 BC
MCLR RPI47/T5CK/RB15
2 25 AC
R30 AN0/OA2OUT/RA0 IC1 RPI46/T3CK/RB14
5 3 24 FC
10k AN1/C2IN1+/RA1 RPI45/CTPLS/RB13 C18 C8
R33 EC 4
PGED3/VREF–/AN2/C2IN1–/SS1/RPI32/CCTED2/RB0
100k
DC 5 23 GC 10u
PGEC3/VREF+/AN3/OA1OUT/RPI33/CTED1/RB1 RPI44/RB12 100n
1 6 22 D0C 16V
CC PGEC1/AN4/C1IN1+/RPI34/RB2 TDI/RP43/RB11
DPC 7 21 D1C 1
PGED1/AN5/C1IN1–/RP35/RB3 TDO/RP42/RB10
9 20 VDD
OSC1/CLKI/RA2 dsPIC33EP128GP502-I/SS VCAP
10 18 5
IC2
+3V3 +3V3 OSC2/CLKO/RA3 TMS/ASDA1/SDI1/RP41/RB9 SDATA
OSC1 D2C 11 17 6 3
RP36/RB4 TCK/CVREF10/ASCL1/SDO1/RP40/T4CK/RB8 CS IN+
K4 12 16 4 A/D K2
4 3 ICSP CVREF20/RP20/T1CK/RA4 SCK1/RP39/INT0/RB7 SCLK 2
VCC OUT 1 MCLR 14 15 AD7680J
PGED2/ASDA2/RP37/RB5 PGEC2/ASCL2/RP38/RB6 1
8MHz 2 GND
1 2 VSS VSS AVSS C15
OE/ST GND 3 2
8 19 27
C16 4 RB5 10u
5 RB6 16V
100n 6
D2C
D1C
D0C
+UB
10k
10k
10k
10k
R42
NC
* +3V
4 2
3
4 2
3
4 2
3
C1 6 6 6
1u C4 C17
16V 5 5 5
R21 R36 R38 R40
100k
100n 1n
1k
1k
1k
R25
K-LC5 20k 1 1 1
K8 K7 K6 K5 C6 R23
1 1 1 1 6 8
1k
2 2 2 2 7
2u2 16V IC10.B
3 3 3 3 5
3 8 3 8 3 8
4 4 4 4
CA CA CA CA CA CA
5 5 5 5 C7 2 LD1 LD2 LD3
1
bottom top IC10.A SA10-21SRWA SA10-21SRWA SA10-21SRWA
2u2 3
Radar Transceiver 16V
4 IC10 = AD8656ARZ 5 5 5
R24 R22 dp dp dp
C5
100k
K-LC5 K-LC5
1k
7 a g 10 7 a g 10 7 a g 10
100n
b c d e f b c d e f b c d e f
6 4 2 1 9 6 4 2 1 9 6 4 2 1 9
DP
DP
DP
E
E
G
G
F
F
A
B
C
D
A
B
C
D
A
B
C
D
Mod-Bottom Mod-Top
DP
G
A
1k
1k
1k
1k
1k
1k
2k
T1...T8 = BC847C
T1 T2 T3 T4 T5 T6 T7 T8
10k
10k
10k
10k
10k
10k
10k
DPC
AC
BC
CC
DC
EC
GC
FC
160385 - 11
Figure 2. The power supply at the top of the schematic generates three voltages from a 9-volt battery: +5 V, +3.3 V and 3 V. The bottom-right shows
the 7-segment display and its LED drivers. The radar transceiver module is connected to one of the sockets K5, K6, K7 or K8, where K5 and K6 are
mounted at the top side of the board while K7 and K8 are mounted at the bottom side.
COMPONENT LIST
of the controller’s I/O ports, timer and calculated and the output is rearranged ing the square root from the sum of the
interruption operation, as well as initiali- (bit-reversed) to get it into a practica- squared real (a) and imaginary (b) parts:
sation of the Fast Fourier Transform (FFT) ble order. Because the input of the FFT
library. When done the processor enters are real values (as opposed to complex), Magnitude = √(a2 + b2)
the main loop. only the first half of the output array —
Every iteration starts by switching on the i.e. elements 0–255 — contains useful The computationally costly square root
radar transceiver and waiting for a while data while the other half is redundant. calculation can be avoided by using an
to allow the module to get ready for oper- Each element of the array — i.e. each approximation. Several methods for
ation. Then 512 samples are taken from bin — corresponds to a frequency equal calculating the approximate magnitude
the input signal and get stored into an to i × Fs / 512, where i is the element’s of a complex number exist; I used the
array of 16-bit integer values. As soon index or bin number and Fs the sampling equiripple-error approximation method
as the data has been captured it can be frequency (60/3 kHz; as 3 samples are presented in reference [3]. More details
processed. While this is happening the averaged into 1). The frequency differ- about this approximation can be found
radar module is switched off in order to ence between two bins of the FFT output in the source code comments [1].
conserve battery power. is about 39 Hz (20 kHz / 512). According
to the Doppler-shift formula above this Target detection
Oh my giddy aunt, an FFT! corresponds to a speed of about 0.24 m/s At this point the signal amplitude in each
Signal processing includes a windowed and this determines the resolution of our frequency bin is known. If the radar
FFT. Microchip provides a DSP library with Doppler radar. beam was reflecting off a target, there
the Microchip C30 Toolsuite for dsPICs will be a signal with a frequency corre-
(see inset) containing all the functions A little light trickery sponding to the target’s speed (towards
to do this. Using this library, first a The FFT output is an array of fractional or away from the radar). This signal can
Hanning window is applied to the data complex numbers. The signal amplitude be detected because the magnitude of
to correct it for the fact that the data or magnitude, which is what we are inter- the corresponding frequency bin exceeds
length is not infinite. Then the FFT is ested in here, can be calculated by tak- the detection threshold. If there are no
Elektor: What do you consider the most important development within BotFactory after November 2016?
BotFactory: We released our SV2 PCB Printer to the market!
If you’re interested to learn more, check out the website www.botfactory.co.
Elektor: Has there been a change in your plans that you did not anticipate back in November 2016?
BotFactory: We did not anticipate the diiculty of some of the technical challenges we encountered in developing our
new SV2 PCB Printer. I can’t go into specific detail, but some of the problems we thought were small were big, and
vice versa. Our SV2 is an incredibly complex device and we did a superb job catching our blind spots on certain
issues by having a very rigorous product development process grounded in Agile Development methodology to be
responsive. In the end the product development and eventual release was much further off than we would have
expected in November 2016, but we think the product is better than we could have expected too!
Elektor: In the coming ten years, will your challenge be primarily financial like finding enough resources to invest in new
technology or, on the other hand, technical by improving and growing your product line?
BotFactory: The technical aspect of our technology is the largest challenge — electrical engineers have very specific
needs and we have to fulfil them in order to ship units. Pushing our existing technology to meet them is our primary
focus, and the financial challenges are secondary — everyone knows that this is a huge industry with a huge market
problem that once technically resolved could have a huge return on invested capital.
Elektor: What do you consider to be the most difficult part of your job?
BotFactory: Part of my job is to sell, which is a fundamentally repetitive and mechanical process. That requires a certain
attitude to be maintained, even after a hundred people say “not interested” to you. But you have to remember that you
are providing a favour to them — a product that really could make a difference in their work. That keeps me going.
Elektor: Is it difficult to find new colleagues, given a shortage of people with technical skills?
BotFactory: Yes! To anyone reading this, if you want to work with us, drop us a line at contact@botfactory.co!
(160702)
We look forward to hosting the e-ffwd 2018 edition and welcome you
at the electronica trade show in Munich this November.
HomeLab Helicopter
Compiled by Clemens Valens (Elektor Labs)
Some people claim that if they can’t repair something they own,
they don’t really own it. That may be an extreme point of view (I
can’t repair myself, for instance), but the fact that manufacturers
do their utmost to make it diicult to repair their products is not
only frustrating but also unfair. Planned obsolescence is the
name of the game, and fraud may be the closest synonym.
Up to now my solution to the problem has boiled down to
investing in special tools, weird screwdriver bits and tool
kits containing tiny Torx® screwdrivers, suction cups, guitar
picks and plastic display lifting tools. I have a roll of sticky
display tape and own a special tool to lift to those pesky
clips car manufacturers are so fond of and that break as
soon as you look at them.
“We should be working to reduce needless waste — repairing things that still have life — but companies use their power to make
things harder to repair. Repair should be the easier, more affordable choice, and it can be; but, first, we need to fix our laws,” says
Emily Rusch, executive director of the California Public Interest Research Group (CALPIRG).
Of course, we will have to see if this will really help us any further. A few years ago I downloaded the service manual including
schematics for my Samsung Galaxy S3 smartphone just for the sake of it — I stumbled on it accidentally on the internet — and
quickly saw that it was way beyond my capabilities to repair anything of it, except maybe replacing the screen or the battery. The
same can be said for the software of many Wi-Fi routers (and friends). Even though you can download their source code, that
doesn’t mean that it is helpful to many of us.
https://calpirg.org/sites/pirg/iles/reports/CAP_Recharge_Repair_Feb1_2018.pdf
Although nice at irst sight in reality they often lack stability, boards never it well,
and the articulations tend to come loose or, on the other hand, are too tight. In the
end, they are not that practical at all. A better solution is this 4-arm holder with
thermal-protected swivelling clips. The flexible arms of about 30 cm (12”) long
allow the positioning of objects any way you like. The heavy base has threaded
holes for up to eight arms (or something else like a fume extractor) allowing
several objects to be held together at the same time. The only thing lacking
really are motors to let it do your work for you.
This Fume Extractor can be attached to the Third Hand‘s base plate.
(www.elektor.com/hobby-creek-fume-extractor-arm)
Want to contribute? Please send your comments, suggestions, tips and tricks to labs@elektor.com
A feature of the irst version of the SDR provided with at least one more output. ing the sig gen and receiver functions you
Shield was the SI5351, a triple PLL gen- With this enhancement the SDR Shield can create a level measurement instru-
erator of which only one output was used could then be expanded into a complete ment for analysing frequency response
with the receiver. It was soon apparent CW transceiver for amateur radio use. and impedance curves. Everybody can
that users could tackle plenty more if Up till now, however, this output was not now devise their own particular measure-
easily accessible on the SMD module. For ment tasks with a simple Arduino Sketch.
the second version of the board we have The schematic (Figure 1) is barely
Characteristics provided direct connections to two addi- altered since the previous version. Only
tional outputs from the PLL generator. the four connections A through D are
• Operating voltage: 5 V and 3.3 V
You simply solder a couple of pinheaders newly added.
from Arduino
and attach the necessary cables.
• Frequency range: 150 kHz to 30
There’s also much more you can do A: SI5351 output CLK0
MHz
besides amateur radio. The Shield can B: SI5351 output CLK2
• Sensitivity: 1 µV
now become a universal signal genera- C: AF/IF left output, DC-coupled
• Overall gain: 40 dB
tor with frequency accuracy that can be D: AF/IF right output, DC-coupled
• Maximum signal level at antenna:
trimmed to the highest standards using
10 mV
software alone. Every electronics lab Figure 2 illustrates the Shield and the
• Dynamic range: 80 dB
needs something like this. Or by combin- 90-degree pinheaders for connecting the
4k7
GND
2
25MHz 3 GND
XB 1
9 C3 R9 R10 VIN
CLK1 10
10k 100k C8
K3 R3 SI5351A 4 8
SCL 4 6 IC3B 100n IC4C
SCL
10 330R SCL CLK2 B 2
D
S 5 3 9
C4 100n
SDA
9 R4 IC2A 5
SDA 5
8 330R SDA 3 C 6 R12
AREF 2n2
GND
7 GND
R 4 100k C
R7 C6
6 1 R11
IO13 8 100R K1
5 6
10k
IO12 100n
4 1 IC3A 7
IO11 3V3 C5 R13 IC4B
3 13 5 C7
IO10
4k7
2 L2 2n2
IO9
1 2 100n
IO8
100uH
C9 R14 R15
C19 3
K5 10k 100k C14
1
IO7
8 8 IC3C 100n IC4A
100n T1 2
7 C10 100n K4
IO6 6
6 1
IO5 ANT 2n2 R17 AD0
5 BF545B 2
IO4 9 100k D AD1
4 R8 C12 3
IO3 L1 R6 R16 AD2
3 D1 D2 100R 4
IO2 GND AD3
470R
13
10k
2 100n 5
IO1 10 IC3D 14 AD4
IO0
1
2200uH C11 R18 IC4D 6
AD5
12 12 C13
4k7
2n2
2x 1N4148 11 100n
160577 - 11
COMPONENT LIST
COAXIAL CABLE
ously, an entirely false calibration may In addition, you will need an RF trans-
arise on the irst run. If so, a click on former-type isolating barrier/coupler GND
RESET is enough to enforce the default that prevents the clean earth connec- EARTH
settings, in which an error of a few kHz tion from being polluted by the protec-
can be expected. tive ground wire. In the ideal scenario
With this the receiver is now ready for a coaxial cable leads from the receiver Figure 7. Installing a transformer.
action. It enables you to monitor all sig- to the transformer (Figure 7) placed
nals from AM broadcast radio, CW and close to the window, so that the actual
SSB. Digital operational modes can also antenna is located more or less entirely
be decoded if you provide suitable extra external to the house. With a little luck
software. you can improve the noise threshold by
up to 20 dB.
Antenna advice
When you irst go forth on the airwaves For the transformer widely differing
using SDR you may experience a nasty cores are suitable. Figure 8 shows an
surprise, simply because there is little to iron powder core with two separate wind-
be heard other than loud hissing. For the ings. The size of the core and the number
beneit of newcomer users here are some of turns are not critical and you can also
tips about antennas suitable for SDR. For experiment with the turns ratio. Figure 8. Isolated windings on a ring core.
powerful broadcast transmitters on the
short waves a wire one metre in length,
hanging or lying anywhere in the room, Listing 1. PLL control code in si5351example (excerpts).
is entirely satisfactory. Unfortunately this
#include "si5351.h"
indoor antenna will also pick up interfer-
#include "Wire.h"
ence from power wiring and electrical
appliances. Comprehensive digitalisation
has led to powerful background noise Si5351 si5351;
that makes your quest more challenging,
particularly indoors. void setup()
{
You can improve the aerial by increasing // Start serial and initialize the Si5351
the length of the antenna wire and erect- Serial.begin(57600);
ing it outdoors. Unfortunately even more si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0);
interference then reaches the receiver
input, arising mainly from the contami-
// Set CLK0 to output 14 MHz with a fixed PLL frequency
nated GND (earth wire) connection. Even
si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
if the antenna delivers a totally clean
si5351.set_freq(1400000000ULL, SI5351_PLL_FIXED, SI5351_CLK0);
signal, its counterpoise is the contam-
inated earth connection. Both voltages
are summed at the input, with the nett // Set CLK1 to output 20 MHz
result that you sufer an elevated noise si5351.set_freq(2000000000ULL, 0ULL, SI5351_CLK1);
loor that drowns any weak signals. }
void loop(void)
{
si5351.update_status();
if (si5351.dev_status.SYS_INIT == 1) {
setup();
delay(500);
}
if (Serial.available()) {
int ch = Serial.read();
freq = Serial.parseInt();
Serial.println(ch);
Serial.println (freq);
int ch2 = Serial.read();
Serial.println (ch2);
lcd.setCursor(0, 1);
lcd.print(ch);
lcd.print(" ");
lcd.print(ch2);
ch2 = Serial.read();
if (freq> 20){
lcd.setCursor(0, 0);
lcd.print(freq);
lcd.print(" ");
if (ch == 32) si5351.set_freq(freq*400000ULL, SI5351_PLL_FIXED, SI5351_CLK1); //" "
if (ch == 70) si5351.set_freq(freq*400000ULL, SI5351_PLL_FIXED, SI5351_CLK1); //F
if (ch == 102) si5351.set_freq(freq*400ULL, SI5351_PLL_FIXED, SI5351_CLK1); //f
a resolution of 1 kHz and makes large have two universally applicable gen- core transformers for speciic frequency
steps of 25 kHz. The upper slider delivers erators covering the entire range from ranges. Further applications in measure-
ine tuning in increments of 10 Hz. As 8 kHz to 160 MHz. In this way you can ment technology will be the subject of
well as the radio buttons for individual equalise resonant circuits, verify lowpass another topic in Elektor Magazine.
frequency bands there is now a scanner ilters or test the suitability of small ring (160577/170515)
function that works through the bands in
5-kHz steps. You can set the SDR soft-
ware to AM in the widest band coverage
to gain a quick idea of the current level
of occupancy.
Below this you will find the controls
for the auxiliary outputs A and B. You
can enter a frequency in Hz and then
send this to the VFO output. In addi-
tion, you must switch in the chan-
nel. The output can be switched on
and of repeatedly, retaining the fre-
quency that you set. The default
is 1.000000 MHz for channel B
and 7.040100 MHz for channel
A, which is the centre of the
only 200-Hz-wide WSPR frequency
allocation on the 40-m band.
This digital mode places the
highest demands on fre-
quency accuracy, for
which the output on
Channel A can be an
aid to the correct tuning.
Stencil Frame
for
Reflow Soldering
Save money the DIY way
Are you tired of hand-soldering your PCBs? And contemplating reflow
soldering instead? If your budget won’t run to the four-figure prices that
industrial stencil frames cost, why not build one yourself?
Figure 2. Getting the hang of things: the linear bearings for the stainless Figure 3. The stencil is clamped firmly in the jaws. At this stage the PCB
steel guide rails are seen here. has not been positioned; it will be located afterwards using magnetic feet.
Practical implementation
Don’t despair if you feel none the wiser after reading the above
description! On the project page for this article [3] you will find
additional technical drawings of the individual parts along with Figure 4. The front guide rail is counter-tensioned with two threaded
dimensions, a component list of all parts plus more photos. rods.
The student team had the advantage of the university’s own
mechanical workshop at their disposal when building the stencil visually. The same holds good for the screws used for securing
frame. This is equipped liberally with milling machines, lathes the clamping jaws. In this way the stencil can be aligned and
and pillar drills. But don’t worry if you do not have access to tightened without the use of extra tools.
this kind of machinery. You can order almost all parts prepared A few more words about the PCB platform. You can’t operate
to size by an (Internet) metal stockist. This then leaves you it independently in X and Y directions. If you could, it would of
only the drilling and threading to handle using your own ini- course be ideal for orientating the PCB precisely to match the
tiative. For these tasks a good quality bench or pillar drill and stencil. However, that would call for an expensive precision
modicum of experience in metal-bashing are indispensible (if X-Y positioning table, which would largely eliminate the cost
not, then check out [4]). The side panel lists everything you saving of making the frame yourself.
need in the way of workshop tools. The students’ remit was to produce the stencil frame up to
With all parts now assembled, you can now concern yourself the state shown in the photos. In order to put the device into
with some practical and artistic extras, for example two spirit practical use at the Institute in future some (not entirely cheap)
levels on one of the two guide rails, to ensure horizontal accu- micrometer heads still need to be added. If you look at this
racy when you set up the frame is set. The wingnuts could web page [5], you will gain a good overview of positioning
also be replaced with locking nuts of hard plastic or brass, to devices of this kind!
make them more ergonomic to use and look more attractive (160567)
Web Links
[1] ‘Item’ system profile components: http://product.item24.de/produkte/produktkatalog/products/
konstruktionsprofile-6-1001042790/ (select English language option at top right)
[2] For example: www.indiegogo.com/projects/pcbite-the-professional-and-affordable-pcb-holder--4#/
[3] Technical drawings and more: www.elektormagazine.com/160567
[4] Tapping and screw threads: www.nmri.go.jp/eng/khirata/metalwork/basic/bolt/index_e.html
www.kmstools.com/blog/hand-taps-proper-tapping-techniques/
www.gsr-germany.de/files/newsletter/gsr-handbuch-de.pdf (in German, largely pictorial)
[5] Mechanical positioning: https://uk.misumi-ec.com/vona2/detail/110302576370/ (select English language option at top right)
eBay. By comparison water leak detectors door or window has been opened.
4k7
Have you come up with an inspired way of solving a really tricky problem? Perhaps you’ve discovered an ingenious but
unconventional way of using a component or tool? Maybe you’ve invented a better or simpler way of tackling a task?
You deserve a reward, write in — for every tip we publish you win £40 (or local equivalent)!
The ‘circuit’
The word circuit is in quotes because the
inverter is just two resistors — that’s a cir-
cuit but only just, we hardly need a diagram.
The reed relay is connected between
ground and the digital input which also
has a pull-up resistor connected. When
the reed relay contacts open the pull up
resistor ensures that the input to the mod-
ule goes to a high state indicating the
magnet has moved away and the door
is open. A resistor as high as 220 kΩ
placed across the open relay contact con-
nections is enough to overcome the pul-
lup and make the module input level go
‘low’ (as if the contacts had closed). A
180 KΩ resistor is now permanently con-
nected across the relay contacts so that
the module default condition is equiva-
Figure 2. The author’s prototype. The breadboard rests on 4 x 3 extended-pin headers. At two
lent to ‘door closed’. When water is pres- corners they act as electrodes also.
ent between the two electrodes the input
voltage level should rise and trigger the
alarm condition. To achieve this, one
electrode is connected to the supply rail to place the board on a cellar floor, for board results in a slightly higher current
(3 V) and the other to the module input. example in an area where you want to drain of just a few µA through the 180-
A resistance somewhere around 10 kΩ detect water ingress, it will only be nec- kΩ resistor. Operation from two AA cells
to 100 kΩ is measured between the two essary to replace the batteries every few however gives long operational life.
probes submerged in water, this value is years. Incidentally, the modifications to the (160470)
sufficient to make the input voltage level
go high and trigger the alarm. The reed
relay doesn’t even need to be un-soldered!
NB: This basic arrangement creates a @ WWW.ELEKTOR.COM
problem if the reed relay contacts close
POV Fidget
Spinner
Rotating
Animations
By Thomas Raab (Germany)
Every few years, a gimmick craze sweeps Unless it has something to ofer that the of vision, as do the popular Elektor pro-
over the world like a tsunami. Yo-yos, mass-produced ones lacked: POV. Here peller clocks. With the clocks, LEDs on
pendulum balls, superballs, Rubik cubes, that abbreviation stands for ‘persistence the propeller blades create light patterns
slime, tamagotchi, loom bands — and of vision’. Due to the limited time res- that show the time of day using the POV
last year, idget spinners. These fads usu- olution of the human eye, light stimuli efect, while with the POV Fidget Spinner
ally ebb away just as quickly as they continue to afect the retina for a short they show short text strings and ani-
arrive, and last summer’s big hit, the id- while after they have gone away. As a mations that you can program yourself.
get spinner, is no diferent. At that time result, light stimuli with a suiciently high The POV Fidget Spinner consists of three
kids and adults alike absolutely had to repetition rate merge into a continuous parts: the circuitry with the microcontrol-
have one, but now it is completely out. motion or a persistent pattern. Films ler and LEDs, a bit of clever software in
Totally uncool. and television make use of persistence the microcontroller, and the not-so-sim-
10k
10u 100n
10V 50V
LED1
without any further calculation. Here
1
the maximum voltage to be measured
VCC 4 18
C9 IC3 VCC AVCC
LED2 is 10.267 V, which is close enough to the
3 23 30 R2
SIG PC0(ADC0/MISO1) PD0(RXD0/OC3A) 470R
LED3
ideal value of 10.23 V with 1023 ADC
100n TLE4905L 24 31 R3
PC1(ADC1/SCK1) PD1(TXD0/OC4A) 470R
50V
GND 25 32 R4 increments. Capacitor C3 stabilises the
PC2(ADC2) PD2(INT0/OC3B/OC4) 470R
2 26
PC3(ADC3) PD3(INT1/OC2B)
1 R5
470R
LED4
voltage while the ADC is sampling. The
27 2 R6
28
PC4(ADC4/SDA0) PD4(T0)
9 R7
470R
LED5 measured voltage is tapped off after
PC5(ADC5/SCL0) PD5(T1) 470R
29
PC6(RESET) IC1 PD6(AIN0)
10 R8
470R
the ‘main switch’ T2 so that the voltage
LED6
PD7(AIN1)
11
divider does not drain the battery when
+VCC 12 ATmega328PB +U IN
13
PB0(ICP1)
19 LED7 the spinner is switched of.
PB1(OC1A) PE0(ADC6/SS1/ICP3)
14 22 R11
PB2(SS/OC1B) PE3(ADC7/MOSI1/T3)
100k
MOSI 15
K1 PB3(MOSI/TXD1/OC2A) Power supply
2 1 MISO 16
PB4(MISO/RXD1)
4 3 SCK 17 20 The circuitry is powered by two ordinary
PB5(SCK) AREF
6 5 RESET
GND AGND R12 CR2032 button cells in series. There are
C4 C3
5 21 several reasons for this choice. Firstly,
12k
ISP
programming
connector 100n
50V
100n
50V
the TLE4905L needs a supply voltage
of at least 3.7 V. A single cell would not
+VCC +U IN be enough, and a step-up voltage reg-
T1
FDN358P
T2
FDN358P
+VCC
ulator would be an unnecessary com-
8 1
R9 R10
IN IC2 OUT plication. Secondly, the blue LEDs have
(+4V)
LE33CD R15
a minimum forward voltage of 3.0 V.
220k
4
10k
ADJ
Although they produce a bit of light at
1k
GND
GND
GND
GND
INH
BAT1
2 3 5 6 7 a lower voltage, their brightness would
1 2
vary too much as the battery voltage
D2a D2b
T3 C5 C6 C7 C8
drops. Thirdly, it is necessary to balance
D2
BAT2 3 BAV70 10u 100n 1 2
10u 100n the spinner by arranging the components
10V 50V 10V 50V
R14
S1 so each arm has the same weight. With
BSS138
two cells, it is much easier to balance
220k
D1
3 BAV70 the spinner, and it spins longer due to
160595 - 11 the additional mass.
The p-channel MOSFET T1 provides
reverse-polarity protection with very
Figure 1. The circuit of the POV Fidget Spinner consists of a microcontroller, a number of LEDs, a
low voltage drop. Of course, a Schottky
Hall sensor and a clever power supply.
diode could be used for this, but the volt-
age drop (about 0.3 V) would be signii-
cantly higher. When the cells are installed
mode, you can tell the timer how high to be used. The microcontroller acquires with the right polarity, the drain voltage
it should count before it overflows. That the sensor signal on pin PB0 (Input Cap- reaches the source via the body diode,
provides good resolution with low jitter ture Interrupt) and calculates the rotation so the source is more positive than the
for the LED light dots. period from the timer count between two gate. Then the transistor conducts and
rising signal edges. shorts out the body diode. The voltage
Hall sensor drop is only a few millivolts. With reverse
To provide the right timing for the LEDs, LED display polarity, the body diode does not con-
the microcontroller needs to know how I chose blue LEDs because they are very duct. Then the source is at the same
fast the POV Fidget Spinner is turning. bright even with very with low operating potential as the gate, and the transistor
One way to measure the rotation rate, current. That way the batteries last lon- is cut of.
or equivalently the rotation period, is to ger than with other colours. The 470-Ω
have a rotating Hall sensor travel past a resistors R2–R8 limit the current through Voltage regulator
fixed magnet. For this purpose I chose the LEDs to a safe level. The current is As the Hall sensor needs at least 3.7 V,
the TLE4095 (IC3), which generates a suicient for a bright display when the the voltage regulator (IC2) generates
small signal with a rising edge when it LEDs are multiplexed with the spinner a supply voltage of 4.0 V to provide a
passes through a magnetic field with the rotating. When the spinner is not moving, bit of safety margin. With the typical
right polarity. This means that the fixed the LEDs are dimmed by a PWM signal. LE33CD dropout voltage of 0.2 V, the
magnet must be mounted with the right button cells could theoretically be dis-
orientation. The sensitivity of the sen- Battery voltage measurement charged as low as 2.1 V before the reg-
sor is suicient to allow a small magnet The battery voltage is measured by the ulator stops working. However, the cells
Power on/off
The circuit around T2 and T3 imple-
ments a manual power-on switch and
automatic power-off switch. Pressing S1
when the device is off pulls the gate of
T2 to ground. That causes T2 to con- tion would ill several issues of the maga- display efect while the spinner is turn-
duct and supply the battery voltage to zine. For speciic details, you can consult ing. To ensure a suiciently bright image
the voltage regulator, which in turn sup- the description on the Labs website [3] when the spinner is turning, the LEDs are
plies the microcontroller with 4.0 V. Once or look at the extensively commented driven so hard that they would be much
the supply voltage for the microcontroller source code. too bright in the Still state. The LEDs are
is present, the switch can be released The main task of the software is to cre- therefore driven by a PWM signal in the
because the microcontroller sets the gate ate patterns of LED light dots while the Still state to reduce the average bright-
of T3 to a high level via PB2. That causes spinner is turning. For this, the software ness to 10%.
T3 to conduct and pull the gate of T2 to must know when and for how long each
ground, in place of S1. LED needs to light up, as otherwise it Synchronisation
When the microcontroller decides it’s would only display chaotic spots of light. Output of the LED pattern is synchronised
time to switch off, it simply sets PB2 That means it must synchronise the by the magnet and the Hall sensor. The
low. Alternatively, a reset puts this pin in LED patterns. Another task is to gener- sensor generates a Low pulse when it
a high-impedance state, and then resis- ate a series of LED patterns that create passes by the magnet. The pulse edge
tor R14 takes over the task of pulling images. As stationary images are a bit is detected by a hardware interrupt that
the gate of T3 to ground. In any case, boring, it is also possible to animate starts a hardware timer. Each time the
T3 is cut off and the gate of T2 is pulled the images by changing them over time. timer reaches a speciic value, the next
to the source voltage via R9, cutting off dot row is output. In order to create an
the transistor. Main loop image with a constant width, the timer
This circuit could also work with the gate The main loop is has several states. value must depend on the rotation speed.
of T2 connected directly to pin PB2 of the In the Power-on state when the pro- For this the software needs to know the
microcontroller, but then there would be gram starts running after the pushbut- rotation period before it can display the
a problem because current would flow ton is pressed, the power-up animation dot rows.
from the supply rail (+Vcc) through R10 sequence is displayed. That is intended Nothing is displayed during the irst rota-
and the internal protection circuitry of the to avoid unintentional power-on. tion. Instead, the counter is started to
microcontroller. That would be enough In the next state, Still, the program waits determine the time until the next edge
to keep the microcontroller turned on. for the spinner to start turning or the of the Hall sensor signal. This value is
Here T3 decouples the microcontroller shutdown timer to time out. In this state divided by the number of possible dot
pin from the supply rail. the switch and the LEDs provide the user rows. Now the software knows how long
interface for selecting an operating mode. it must activate each dot row.
Pushbutton switch S1 Each time the switch is pressed, a dif- As the POV Fidget Spinner gradually
To allow the switch to be used for tasks ferent mode is selected. The selected slows down, rotation time measurement
other than power-on, it must be decou- mode becomes active when the spinner is constantly active until the spinner is
pled from the gate of T2 by the diode D2a starts turning. When the shutdown timer turning too slowly to take advantage of
because the gate of T2 is held low while times out, there is a brief animation and persistence of vision. At that point the
the spinner is active. With this arrange- then the microcontroller shuts down. program returns to the Still state and
ment, PB1 is pulled high by R10 and can Yet another task is to start the process of uses the LEDs for other tasks, such as
be pulled low by pressing S1, without measuring the rotation speed and eval- selecting the operating mode.
affecting the gate voltage of T2. The sec- uating the measurement results. If the
ond diode D2b could actually be omitted. program is in the Still state and a valid Image generation
rotation speed is measured, it changes Images are generated by sending data
Software to the Spin state. In the Spin state, con- from a bufer to the LEDs. For this pur-
Here we can only provide a general over- trol is handed over to the efects engine, pose, the bufer must irst be illed with
view of the software. A detailed descrip- which produces the currently selected relevant data by the selected efect state
COMPONENT LIST
Figure 3. The PCB — one of the most unusual in the history of Elektor projects — is almost exclusively populated with SMD components.
Mechanical construction
The shape of the PCB for the POV Fid-
get Spinner (Figure 3) is undoubtedly
one of the most unusual in the 40-year
history of Elektor. All of the components
must of course be very small, so with the
exception of the programming connec-
tor and the two battery holders on two
of the three arms of the spinner, only
SMDs are used on the component side of
the board. This means that the soldering
work is admittedly not easy, but at least
no components with BGA or similar nui-
POV Fidget Spinner. The serial communi- A write command is followed by a colon sances are used here. The seven LEDs
cation settings are 19,200 baud, 8 data (:) and one or more parameters, sepa- and their series resistors are positioned
bits, 1 stop bit and no parity. Handshak- rated by colons. Characters in the com- inline on the arm not occupied by the
ing is not used. mand line are enclosed in apostrophes, button cells.
Incoming data is place in a linear bufer parameters are enclosed in angle brack- On the solder side there is only one com-
with room for up to 80 characters. The ets, and optional items are enclosed in ponent, in this case a leaded IC: the
bufer does not overflow, so any extra square brackets. The number and type of small Hall sensor IC3, which must be
characters are simply ignored. An error parameters depend on the destination. positioned accurately relative to the mag-
message is returned when a CR charac- An empty line causes the screen to be net for spinner rotation detection.
ter is received. The Fidget Spinner sends cleared. The commands are not case A pin header should be used for program-
CR/LF at the end of the line. It can han- sensitive. ming connector K1, and you should make
dle either CR/LF or just CR for reception, sure that it does not protrude above the
since it ignores the line feed (LF) character. Destinations surface of the housing. In case of doubt
After connecting the converter, the termi- There are two pairs of memory locations you can also use a lower-proile socket
nal connection is activated automatically for storing text messages and efect set- header, but then the adapter for the
when the spinner is powered on. A start tings. Each message can consist of up USB/serial converter must be modiied
message appears on the terminal emu- to 64 characters. The index can lie in accordingly.
lator, indicating that it is ready for data the range of 1 to 7. For read or write If you are wondering about the appar-
entry. To provide enough time for entering operations, the index can also be *, in ently useless screws near the LEDs, the
characters, the automatic timeout is set which case all text messages are read answer is that they are there to balance
to 60 seconds instead of the usual 10 sec- or cleared, respectively. the spinner so that it turns as smoothly
onds. This timeout is reset on each entry. The command and destination are evalu- as possible without a lot of vibration.
ated as single byte. That allows the pro-
Command syntax gram to call the corresponding function Ball bearing
The CLI has a simple command set. Usu- with a simple switch/case instruction. The ball bearing is literally the hub of
ally each command consists of three If a parameter contains a non-print- the Fidget Spinner. One option is to
characters followed by a carriage return. ing character, its ASCII code can be scavenge a ball bearing from a cheap
The first character is the actual com- marked by angle brackets. In that case import spinner, but a better choice is
mand, the second character is the com- the enclosed number is interpreted as to get your hands on a fully ceramic or
mand destination, and the third char- an ASCII code. For example, <65> rep- hybrid bearing with a stainless steel outer
acter is the index number of the text resents the ASCII code 65 (a capital A), race (100Cr6), a nylon cage (TN) and
string or setup. which of course is a printable charac- ceramic balls (Si3N4). Spin times up to
ter. If the program sends a reply con- ten minutes are possible with bearings
<c><d><i>[':'<p1>[':'<p2>[':'<p3> taining non-printing characters, they are of that sort. They are also less sensitive
[':'<p4>]]]] also enclosed in angle brackets. If a text to moisture than low-cost bearings.
string contains an angle bracket charac-
• <c> is the command designation. It ter (<), it must be sent twice as ‘<<’. To keep the ball bearing from getting
can be R (or ?) for read, W for write, If the command is processed correctly, clogged with dirt, it should have steel
or C for clear. the spinner replies with ‘OK’. If an error seals on both sides (since ball bearings
• <d> is the destination. It can be T for occurs, an error message starting with an for idget spinners run dry and do not
text or S for setup memory. exclamation mark is sent – for example, need lubrication). Fortunately — believe
• <i> is the index number of the ! SYNTAX ERROR. it or not — ball bearings for idget spin-
desired element, or * for all ele- ners all have the same dimensions. The
ments. The allowed range depends Commands and effects outer diameter is 22 mm, the inner diam-
on the destination. A detailed description of the available eter is 8 mm, and the width is 7 mm.
Let it spin...
Place the two grip button parts on the
bearing and screw them together with a
Web Links
countersunk-head screw. Place the cir-
cuit board in the top shell of the hous- [1] www.elektormagazine.com/110553
ing with the switch button aligned to the [2] www.elektormagazine.com/160595
hole in the housing and the LEDs visible [3] www.elektormagazine.com/labs/pov-idget-spinner
through the slot in the housing. Then it
[4] www.viewstl.com/
the bottom housing shell and screw the
“James, one Martini please, shaken and not stirred.” This project
allows you to ask your Personal Assistant to prepare your favourite
cocktail whenever you feel like it. When the cocktail is ready all
you have to do is walk over to the machine and pick it up.
The Jury was especially impressed by the
comprehensive and deeply
detailed documentation with
this project. Descriptions
of all parts of the project,
schematics, PCB design,
complete parts list, source
code, mechanical design
and videos, it was all there.
Excellent job!
https://goo.gl/NrSKPF
This clever mix of ESP32- and ESP8266 modules, and repurposed USB
chargers combines into a smartphone- and touch-controlled lighting
system for your home. Much appreciated was the fact that the design
its in a standard junction box, mak-
ing it easy to add it to an existing
system in a discreet way.
https://goo.gl/2QP6K9
https://goo.gl/E4iyrP
Honourable Mentions
4. ESP32 Game Console 6. Electromechanical
Decimal to Binary to Hexadecimal Converter
By luni
By Proto G
https://goo.gl/Ei7x82 https://goo.gl/KReZnF
https://goo.gl/PMzG7J
https://goo.gl/nKwknV
https://goo.gl/dmfhn8
(160660)
Once again we turn our spotlight to a few items you can buy in the Elektor Store.
@ WWW.ELEKTOR.COM @ WWW.ELEKTOR.COM
ªPeaktech P5600 ªLoRa IoT development kit (868 MHz version)
www.elektor.com/peaktech-5600 www.elektor.com/lora-iot-devkit
Heating Monitor
using ESP8266
Keep tabs on your energy usage
By Walter Trojan (Germany)
The project overview (Figure 1) shows server. These are then transferred via a clocked at 80 MHz (default) or 160 MHz.
the client-server architecture of the serial interface to the STM32 which com- Around 20% of its processing power is
heating monitor. The measuring ser- presses the data, displays the readings taken up by the Wi-Fi functions leaving
ver consists of a stand-alone ESP-201 on a touch screen and saves them to the the remainder free for any other work.
board containing an ESP8266 module. USB memory stick. The module uses a Tensilica L106 MCU
This Wi-Fi module is popular and has We also need a reliable time stamp for which besides its 32+80 KB RAM has use-
already featured and been described in the data. The Discovery board does not ful peripherals accessible via 17 leads.
many Elektor publications and projects have a backup battery for its real-time These can be conigured as GPIOs, UART,
[1][2]. The measuring server is itted clock so to avoid the hassle associated SPI, I2C or PWM outputs. The irmware
with ive DS18B20 temperature sensors with summer/winter time changeover is stored in an external lash memory
and a microphone (!) to provide a galva- and leap year calculation I opted to get accessible via a speedy SDIO interface
nically-isolated indication of boiler acti- the current time in NTP protocol from (using four data and two control sig-
vity. The ESP is conigured as a station an internet-based time service provider. nals). The module uses around 70 mA
and sends measurement values every Each day a new ile is created on the (170 mA max) which reduces, under
2 s using TCP/IP messages via the Wi-Fi USB stick to store the measured values power management to around 10 µA in
network. at one minute intervals. The format has sleep mode. There are many modules
been chosen so that it can be easily ana- which use the ESP8266, starting with
To help reduce development work lyzed using software such as Excel. The the ESP-01 which has two GPIOs. The
we have chosen to use the low-cost Discovery board touch screen shows the measuring server uses the ESP-201 with
STM32F429 Discovery board [3]. It current measurement values from the a lot more peripherals.
comes with a touch screen and has USB sensors. So, that’s the overview done,
ports where a memory stick can be atta- let’s take a closer look at the details. The module takes care of these functions:
ched for data logging. The Wi-Fi link on • Cyclic measurement of the central
this board is also taken care of by an The Measuring Server... heating low and return temperature,
ESP8266 module which this time is it- The Measuring Server is based on the ambient air temperature, hot water
ted to an ESP-01 board. This ESP also popular ESP8266 Wi-Fi module, in heating coil and hot water draw-of
functions as a station and receives the addition to its dedicated Wi-Fi interface temperature.
TCP/IP messages sent by the measuring it also has a powerful 32-bit processor • Monitoring boiler burner activity with
4k7
4k7
4k7
4k7
4k7
+3V3
heater flow
VDD
the Wi-Fi devices are working correctly.
DQ
DS18B20
GND C2 C1
R11 R13 R12
The Event-Handler is also a callback rou-
100R
10k
10k
100u 100n
tine, which among other things reports
heater return
VDD events such as:
DQ
K1
GND VDD
DS18B20
MOD1 TX
• EVENT_STAMODE_CONNECTED :
Flash Interface
GPIO2 TX
VDD GPIO4 RX
RX ESP is connected as a station to the
ambience RTS
DQ GPIO5 RST
DTR router.
GND GPIO12 GPIO0
DS18B20
GPIO14 CH_PD
GND
• EVENT_STAMODE_DISCONNECTED :
GPIO13 GPIO15
hot water/ VDD ESP8266-201 R10 Connection to the router is broken.
heater unit
270R
DQ GND R9 • EVENT_STAMODE_GOT_IP :
GND
DS18B20 RESET
ESP has received an IP address from
1k
LED1
DS18B20
GND
There is no signiicant amount of pro-
10k
Vi
+Vi
+Vi cessing taking part in any of the callback
microphone MIC
Audio
D1 R6
T1 D3 routines, they just work on information
1k 1N4007 LM3940 +3V3
D2 BC547
3V3 and change the value of global variable
heating burner GND 2x
BAT43 as appropriate.
R7 R8 C6 C5 C4
C3
7V5 The main processing takes place in the
10k
10k
220u
10u
100n 100n
DoApp state machines called from the
workloop. DoApp2 handles WiFi-speciic
150578 - 12
activity and DoApp3 just takes care of
the LED. Evaluation of sensor measure-
Figure 2. The measuring server is based around the ESP8266.
ments takes place in DoApp1.
The Workloop is not a classic endless
loop, but terminates after the Apps men-
ger than 15 ms otherwise Wi-Fi func- and controls, among other things, all the tioned above are called in sequence, but
tionality will be compromised or the Wi-Fi functions. not before a small delay is called by the
watchdog timer may overrun and When the ESP8266 starts the user-init operating system. This ensures that the
generate a reset. function is called. In this function: program execution is not disrupted and
the system functions can take back con-
I used the ‘Unofficial Development Kit • The peripheral parameters are con- trol. An endless loop in RTOS looks like
for Espressif ESP8266’ from Cherts [6] igured, in this case the UART and Listing 1.
with Eclipse and the MinGW-C compiler GPIOs, During processing other callback routines
running under Windows to program the • An Init-Callback and an Event- are initialized:
irmware. Handler is started,
• the Systick function for the Soft • tcpclient_connect_cb :
The firmware structure is shown in timer (producing a 10 ms tick) is A Client has logged in
Figure 4. As with all C programs the activated • tcpclient_disconnect_cb :
main function provides overall control of • the main loop called ‘workloop’ is A Client has logged out
the program. It runs in the background called every 10 ms. • tcp_recv_cb :
10k
10k
10k
100n 220u MOD2
STM429 Discovery tal continuous main loop. The program is
written in C using CooCox, one of the free
R5
VDD +3V3
270R
CH_PD
MOD1
RST
GPIO2 Date / Time 5V
IDEs for ARM-Cortex CPUs. This develop-
GPIO0 Temperature 1 5V
ment environment is a little dated, for
TX RX5 Temperature 2 C3
ESP-01
RX TX5 Temperature 3 any new projects with the STM32 you will
PA5 Temperature 4 100n
GND
Temperature 5 GND now probably be looking at IDEs such as
PROBE TrueStudio from Atollic or System Work-
Temperature 6 GND
GND
RX
G2
TX
GND
GND
bench with CubeMX.
Logic Analyzer
D1
The individual state machines take care
1N4007 +3V3
DC
LM3940
3V3 of the following activity:
DC
C4 C5 C6 C7
7V5
100n 47u 100n 220u
• DoApp1:
receives measured values (from ESP) and
150578 - 13
formats them for display;
receives time/date and sets the realtime
clock.
Figure 5. The display/data logger client schematic.
• DoApp2:
operates the touch screen (Start/Stop);
displays the measured values on the
USB port on the board. The green LED logging on the Disco board. display.
indicates that the board is on and the red As you probably already guessed, the • DoApp3:
LED lights continuously to indicate that ESP irmware looks very similar to that of writes the current time and date to the
a stick is plugged in and lashes when the measuring server. There is however display every two seconds;
the stick is being written to. only two state machines, DoApp2 hand- manages the USB stick and creates a
Just as with the measuring server board les the WiFi operations and DoApp3 con- new ile each day;
the power supply for this unit is also not trols the green LED. Instead of cyclically averages the measurement values over
critical. The 7.5 V supply from a power sending, the client waits for incoming one minute and writes them to the ile.
adapter enters the board through the messages and then passes them on to • DoApp9:
protection diode D1 to a DC to DC con- the Disco board via the serial RX/TX link. controls the Discovery board LEDs.
verter which produces 5 V for the Disco The board does not have a keep-alive
board and then a LM3940 generates battery for the RTC so the ESP retrieves Figure 6 shows how the data in the
3.3 V for the ESP-01. the exact time and date from the internet USB stick is formatted. Each day a new
to synchronize the clock in the STM32. text ile (in CSV format) with the name
Teamwork A good source for users in Europe is the ‘Year_Month_Day.TXT’ is created. The
for display and data logging German based Physikalisch-Technische compressed measured values are sto-
The irmware for the display/logging cli- Bundesanstalt (PTB) in Braunschweig, red from 00:00 until 23:59. CSV type
ent and the hardware are divided into which actually has three time services iles can be easily imported into Excel or
two parts; the program which hand- available. Here Ptbtime1 is used as the OpenCalc for use in spreadsheets and
les the Wi-Fi communication with the reference timebase, the other two ser- for graphical display.
ESP8266 and the routine for display/ vices are backups in case a problem Each set of readings is shown at minu-
te-intervals. Along with the current time
and the readings from the ive sensors
there is also the burner activity indica-
Listing 2. Time from the Internet.
tion given as a percentage. The burner
void InitNTP(void)
information is scaled so that –10 = 100%
{
sntp_setservername(0, “ptbtime1.ptb.de”); // set server 0 by i.e. burner running. This ofset makes
// domain name the graphical representation of the data
sntp_setservername(1, “ptbtime2.ptb.de”); // set server 1 by less confusing because the burner infor-
// domain name mation is not temperature related, just
sntp_setservername(2, “ptbtime3.ptb.de”); // set server 2 by
an on/of level.
// domain name
sntp_set_timezone(1); // MEZ In addition to date and time, the Disco-
sntp_init(); // Initialize NTP board display (Figure 7) lists the mea-
} sured values. This graphical data display
… was written using emWinGUIBuilder from
current_stamp = sntp_get_current_timestamp(); // get current time Segger [8], the C code generated for this
is bundled in with the irmware.
Web Links
[1] ESP8266 book, not yet available in English.
[2] Compact and Self-contained WLAN, Elektor Magazine 4/2016: www.elektormagazine.com/magazine/elektor-201609/39804
[3] STM32-IDE: www.openstm32.org/HomePage
STM32-Library: http://mikrocontroller.bplaced.net/wordpress/
[4] Sensors from AliExpress: https://de.aliexpress.com/item/Free-Shipping-1pcs-DS18B20-Stainless-steel-package-1-me-
ters-waterproof-DS18b20-temperature-probe-temperature-sensor-18B20/32305869288.html
[5] Espressif: http://bbs.espressif.com/
[6] Cherts kit: https://github.com/CHERTS/esp8266-devkit
www.esp8266.com/viewtopic.php?f=9&t=820
[7] Project software: www.elektormagazine.com/150578
[8] emWinGUIBuilder: www.segger.com/emwin-guibuilder.html
[9] Project at Elektor Labs: www.elektormagazine.com/labs/monitor-and-data-logger-for-a-heating-boiler
Chirpie
Chirpie…
Cheepit
Cheepit uses audio files to program ATtiny microcontrollers. Every smartphone and tablet computer has an
audio output, so they can be used to download hex files to a microcontroller. Audio files can also be played
in web browsers, so finished apps can be provided and shared on the Internet. In this article we describe the
programming circuitry, a small circuit board which is also available fully assembled, and a website where you
can get demo programs and development tools.
Smartphones and tablets are increasingly displacing programming is the closed nature of the systems. Although
conventional PCs. Even in kids’ bedrooms, mobile devices are interfaces are available (USB, for example), they are not
now standard equipment. However, can they also be used as consistent across all devices — for instance, many devices lack
platforms for electronic design, prototyping and development USB host capability. In addition, most interfaces are firewalled
projects? The diiculty with microcontrollers and microcontroller for security reasons. This effectively blocks programming with
a web browser, and thus makes saving and sharing code online
practically impossible.
However, there is a solution to this problem. Every mobile
device (not just standard PCs) has an audio output in the form
of a headphone port, and most web browsers support audio
playback to the headphone output.
The hardware
The Cheepit Sparrow (Figure 1) is a small stand-alone micro-
controller board. Unlike most such boards, you do not need a
programming device to download the software — all you need
is a mobile device with a web browser and a headphone out-
put. You can even use MP3 or ringtone files for programming.
That makes the board suitable for apps with software that
has to be downloaded from mobile devices. What’s more, the
Figure 1. The Sparrow comprises an ATtiny13 and a programming entry threshold is so low that the Sparrow can also be used
interface. for beginner courses in schools and universities.
10k
10k
D1 3
VCC2 VCC VCC
VCC2
R1 47p
C1 2 1
R9 C6 JP2
10k
1M
100n BAT54S 2
100n S1 S2
3 C3 3
IC1 8 4
R8
12 100n VCC
JP4 VCC VCC2 IC2
10k
3 5
PB0(MOSI)
2 6
JP3 11 PB1(MISO)
1 3 7
13 R7 PB2(SCK/ADC1)
2 IC1.D IC1 = TLC339D 2
10 PB3(ADC3)
10k
1 3
PB4(ADC2)
7 1 R11 R13
PB5(RES)
1 ATTINY13A
1k
1k
R6 R4 IC1.B JP1
6 GND 4
100R 10k C5
4 3
LED2 LED1
D2 3
47p 2
R5
C2 2 1 1
10k
100n 9
BAT54S
14
IC1.C
8
C7
100n
150167 - 12
The board is built around an ATtiny13 microcontroller with and SCK lines. The programming process is indicated by a sig-
1 KB of flash memory and eight I/O pins. Along with the pro- nal on the MISO line, which causes the green LED1 to flicker.
gramming interface, there are two LEDs and two pushbuttons For your first experiments without external hardware, it is
on the board. All microcontroller pins are brought out to a pin helpful to solder a six-pin angle header to the board (see Fig-
header. That makes the board a simple and versatile proto- ure 3). You can use this header to connect the supply volt-
typing platform. age and feed in the audio signal. The lower three pins (JP4:
L, GND, R) can be connected to a stereo headphone jack or
In the schematic diagram (Figure 2) you can see the ATtiny13 plug, depending on your preference. Be sure to wire the left
on the right side, along with the LEDs and pushbuttons. The and right channels to the right terminals. With a headphone
programming interface is on the left side. An LM339 quad com- plug, the tip is the left channel.
parator, a low-pass filter and a limiter enable programming with
a wide range of input signal levels. The programming signal The simplest way to power the board is with a pair of AA cells in
puts the microcontroller in the Reset state and drives the MOSI a battery holder to provide a supply voltage of 3 V. The upper
+3V...+5V
10k
10k
8 100n
VCC
5
PB0(MOSI)
6
PB1(MISO)
7
PB2(SCK/ADC1)
2
PB3(ADC3)
3
PB4(ADC2)
1
PB5(RES)
ATTINY13A
1k
1k
GND
4
LED2 LED1 S2 S1
150167 - 14
Figure 3. Connection to the sound card. Figure 4. Basic circuit for the apps, with two LEDs and two buttons.
10k
10k
PB4(ADC2)
It is needed to help 1 preventing unreliable
1M
PB5(RES)
the transistors work ATTINY13A programming. The
0 GND
nearly as well as 4
signal level range is
100n
the comparators in narrower than with
1k
1k
1k
Figure 8. The hex2wav converter. Figure 9. The HTML code generator. Figure 10. The fuse editor.
1k
to have a previously installed boot loader. That puts an extra ATTINY13A
GND
hurdle in the path. With the Cheepit approach, by contrast, you S1 LED1
4
can program virgin devices straight from the factory.
AVR microcontrollers, for example 8-bit RISC microcontrollers,
150167 - 21
are usually programmed through the ISP port. The protocol
used for this is based on an extended Serial Peripheral Inter-
face (SPI) specification.
The pin assignments of the six-pin ISP header are shown in the
following table. The four bytes sent with the Programming Enable command are:
2 VCC Supply voltage This results in the following bytes in the PCM-coded .wav file
3 SCK SPI clock line (the header of the .wav file is shown in green):
6 GND Ground 02 00 FF 00 00 00 FF 00 00 00 01 00 08 00 00 00 64
61 74 61 00 00
· Up to 24-bit resolution
and 0.1% accuracy
· Up to 8 differential or
16 single ended input
channels
· Built in low-current power
supply for sensor power
PROJECT INFORMATION
Arduino
Laser clock
PIR sensor
In the upgrade kit from Sand Clock to the option to adjust the base plate of
entry level Laser Time Writer, we have taken care to the clock, and we also added a number
Æ intermediate level reuse as many parts of the existing sand of additional mounting holes.
clock as possible. This not only reduces
expert level
costs, but after the upgrade you also The most striking adjustment is the pos-
have fewer redundant parts left, which sibility to mount the Arduino Uno, the
also beneits the environment. Of course, heart of the LTW, in two ways. This allows
1.5 hours approx.
this approach also had its limitations and you to choose which side of the clock the
we could only modify the existing design power cable and the USB cable, if any,
to small extent. Recently, however, the are located on. In combination with the
Solder iron with fine tip
complete kit of the Laser Time Writer has software-based option to write the time
Mechanical tools
become available in our online Store, and both normal and upside down, you have
PC
we have taken the opportunity to add a whole range of possibilities to position
some extra functionality to the design. the clock.
€120 / £105 / $150 (com-
plete kit); €45 / £40 / $55
Options for assembly You can use the clock horizontally, just
(upgrade kit)
Unlike the situation with the upgrade- like the Sand Clock, but there are also
only kit, with the complete kit we had holes in the base plate to ix it verti-
Note: Unlike the upgrade kit, the com- how (in which position) you will eventu- marked with ‘A’ or ‘B’ as a guide.
plete kit does not require 2.2-kΩ resistor ally use the clock. We recommend study-
to be mounted in parallel with R4; on the ing the photos in the installation instruc- New: the PIR sensor
PCB, a resistor with the correct value of tions carefully. Depending on your choice, The PIR sensor is adjusted with the two
1 kΩ is pre-assembled for R4. you should choose the right orientation trimmers to achieve a minimum time
for the various parts. interval and average sensitivity. If nec-
Mechanical construction In the assembly instructions, you can essary, you can adjust the latter later
Before starting the installation, consider then use either the series of photos to suit your taste. The jumper is set to
+5V_2 D1 D2
M+
D3 C4
3x
S2J-E3
100n
IC1 M–
R-785.0-1.0 9V / 1A
+9V +5V_2 R4 ! T1
from
1k
R10
Lasermodule –
BCX56
C6 C5
100k
DC IN USB
22u 10u
MOD1 SCL
ARDUINO SDA
AREF
+5V_2
to NC AGND
Lasermodule + +3V3 IOREF D13
SERVO_R
RESET D12
1
+5V_1 3V3 D11/PWM
2
+3V3 5V D10/PWM S1
POWER
3
GND D9/PWM
DIGITAL INPUT/OUTPUT
GND D8
C1 +9V VIN
SERVO_L
D7 R3
100n 1
+5V_1 D6/PWM 220R
2
20 AN0 D5/PWM R2
R8 R9 3
ANALOG INPUT
4k7
4k7
4k7
6 5 2
C2 TS IFS
17 18 3
INT BBS
100n PCF2129A C3
CR2032 VSS
8 100n
160569 - 11
Software
The software for the LTW has been
expanded with a few commands for the
PIR sensor. With the command ‘ire’ you
can switch on the PIR sensor. The com-
mand ‘ird’ switches the sensor off again.
Finally, with ‘iri’ you can set the detec-
tion interval, for example ‘iri 180’ for
180 seconds or 3 minutes. If you want
to make your settings permanent, don’t
forget to use the ‘sew’ command. Figure 3. Shwong how the laser module, the pushbutton and the PIR sensor must be connected.
The detection interval ensures that the
clock does not write continuously when
the PIR sensor beeps again and again. The
PIR sensor can only restart a write action
after the detection interval has elapsed.
COMPONENT LIST
PIR sensors
PIR sensors are widely used, like for the
automatic switching of (outdoor) lighting,
for home automation applications, and as
detectors in alarm systems (room moni-
toring). However, not much information
can be found about the underlying oper-
ating principle of these sensors. Here we
will look at the pyroelectric effect, PIR
sensor elements and cheap lenses for
LWIR (Long Wave InfraRed).
Lenses
With a ‘bare’ PIR sensor, the distance
at which a heat source can be detected
is small or limited at best. As soon as
the distance becomes too large, the heat
source to be detected ‘disappears’ into
the background and no clear signal is
generated by the pyroelectric elements.
However, the detection range can be
extended considerably with a lens placed
in front of the PIR sensor.
Lenses for long-wave heat radiation
(LWIR) are often associated with exotic
and expensive materials such as those
used in thermal imaging cameras and
CO2 laser conigurations, such as gal-
lium, gallium arsenide and zinc selenide.
However, if less stringent requirements
are set, as is the case with PIR sensors,
then it can be much simpler and cheaper. Figure 5. This experiment shows that a white HDPE milk bottle is transparent to IR.
It turns out that simple hydrocarbons
such as polyethylene and polypropyl-
ene allow heat radiation to pass very
PIR sensor
well. To try this out, we conducted an
Detecting area
experiment with an empty HDPE milk
bottle from a supermarket chain; we
Fresnel lens
hung three resistors in that milk bottle
and then heated it by feeding a current
through them. The dissipated power per
resistor in this set-up was approximately Output signal
Heat source movement
250 mW. With a thermal imaging cam-
era, the resistances can be clearly seen
through the plastic of the milk bottle —
PLANO CONVEX FRESNEL
an a-ha-Erlebnis, to put it this way (see
Figure 5). It will therefore come as no
surprise to you that the lenses of conven- Figure 6. A Fresnel lens is actually a hollowed Figure 7. This is how common PIR sensors
tional low-cost PIR sensors are usually out and flattened ordinary lens. work.
made of polyethylene.
In order to minimise the absorption of
the heat radiation to be detected by the a grille or grating to create an infrared grid for the PIR sensor. Walking past the
lens, it should be as thin (i.e. flat) as light/shadow when a heat source passes LTW creates an IR shadowplay on the
possible. A so-called Fresnel lens is an by. The use of a ‘pinhole lens’ is also an pyroelectric elements of the sensor. This
excellent solution in this respect (Fig- option. This is not often used commer- then results in a series of temperature
ure 6). Often, lenses from commercially cially, but it is nice for those who want variations that guarantee reliable detec-
available PIR sensors consist of several to experiment further. tion.
Fresnel lenses side by side to create mul- With the Laser Time Writer, the servo (160538)
tiple smaller overlapping detection zones motors and acrylic glass form a kind of
that alternately bundle radiation onto the
pyroelectric elements. This makes the
sensor particularly sensitive when a heat
source moves from one detection zone to Web Links
another. Figure 7 gives a good impres-
[1] www.elektormagazine.com/160538
sion of the operation of a PIR sensor
with Fresnel lens; further information on [2] www.elektormagazine.com/160569
PIR sensors can be found in [4] and [5]. [3] www.elektormagazine.com/160441
In addition to lenses, there are other [4] www.glolab.com/pirparts/infrared.html
possibilities for increasing the sensitiv-
[5] www.glolab.com/focusdevices/focus.html
ity of a PIR sensor, such as the use of
Introduction to
Microprocessor Technology
with the Kosmos CP1 (1983)
Every journey begins with a single step
By Dipl.-Inf. Karl-Ludwig Butte (Germany)
It is 1983. The microcomputer revolution has swept across the United States and is taking hold in Europe.
Demand for expertise is rising rapidly and it soon becomes clear that it is best to get to grips with this new
technology at as early an age as possible. This is recognized by the Stuttgart-based publisher Franckh’sche
Verlagshandlung, which was founded in 1822. The company has already made a name for itself producing a
range of kits of scientiic and electronic experiments for children; and soon its product range is extended to
include the Kosmos CP1 experimental microcomputer system.
The focus of Franckh’sche Verlagshandlung on scientiic top- This tradition was maintained in the Kosmos CP1 experimental
ics was already established in 1904 with the foundation of computer system (Figure 1). In this article we will look more
‘Kosmos Friends of Nature Club’; and it is from that that the closely at the system from both a theoretical and a practical
company’s current name, ‘Franckh-Kosmos Verlags-GmbH & point of view: by good fortune an example of this exceptional
Co. KG’, originates. At the beginning of the 1920s a dedicated piece of hardware has come into my possession.
educational department was set up to develop the Kosmos
range of experimental kits [1]. The company was famous for The hardware
the high quality of the components used in its kits ranging The CP1 is based on an Intel 8049 CPU, which is comple-
from optics to radio, for its excellent instruction manuals, and mented by an Intel 8155 programmable interface device and
for its catchy slogans. just a few other components. A membrane keyboard is used
Figure 1. The Kosmos CP1 experimental computer. Figure 2. Inside the device.
Figure 8. Information
leaflet showing the
expansion possibilities
Figure 7. ‘Hello World’ 1983-style using the Kosmos CP1 and the Kosmos using Fischertechnik
‘Radio+Elektronik’ kit. (reproduced by
kind permission of
Franckh-Kosmos
interpreter allows the user to work with decimal quantities and Verlags-GmbH & Co.
a subset of the instruction set, and the instructions were trans- KG, who retain all
lated into German for the German-speaking market. These two rights).
measures signiicantly reduced the initial barrier to beginners,
making the irst steps into the world of computer technology
a genuinely enjoyable experience.
Some things never change: just as today, 35 years ago the
irst program to demonstrate connection to external hardware
involved, as you will no doubt have guessed by now, flashing
a light. This ‘Hello World’ program for microcontrollers worked
with a torch bulb rather than the now obligatory LED. So that
projects like these could be constructed easily, and in partic-
ular without soldering, the designers of the CP1’s enclosure
shaped it so that the breadboard from the Kosmos electronics
experiment kits could easily be joined to it: see Figure 7 for
how this works.
As we progress through the manual, and in particular in its Web Links and References
second part (‘Program suggestions for games, random num-
[1] https://en.wikipedia.org/wiki/Kosmos (publisher)
bers, control, measurement and education’) the circuits rap-
[2] https://console5.com/techwiki/images/4/4a/MCS-48.pdf
idly become more elaborate: projects range from a heating
controller and a tone generator to a people counter and model [3] www.ndr-nkc.de/download/datenbl/8155.pdf
railway applications. Along with all that, some theory is intro- [4] ‘KOSMOS Computer-Praxis’, Franckh’sche Verlagshan-
duced, covering such things as diferent number bases and dlung, Stuttgart, irst edition (1983), p. 5
bit patterns.
[5] ibid. p. 6
Following the motto ‘the best things come in threes’, the third
[6] ibid. p. 9
part of the manual ofers ‘some basic principles of electronic
data processing’. Here the reader is introduced to such top- [7] https://sourceforge.net/projects/cp1-sim/
ics as circuit theory, digital logic, binary arithmetic and full
adders. With that under his belt, the user is now well prepared
to extend the CP1 even further.
Expansion
@ WWW.ELEKTOR.COM
A computer system without expansion options will not sustain ªBook ‘Retronics,
interest for long. Kosmos made four diferent expansion modules 80 Tales of Electronics Bygones’
available: the CP2 cassette interface, the CP3 memory expan- www.elektor.com/retronics
sion, the CP4 relay module and the CP5 input/output interface. ªE-book ‘Retronics,
There was also the possibility of using the unit in conjunction 80 Tales of Electronics Bygones’
with Fischertechnik construction toy, as shown in the informa- www.elektor.com/retronics-eb
tion leaflet that came with the CP1 (Figure 8).
Web Links
[1] Silicon Valley HBO series: Startup Battleield scene on YouTube: https://is.gd/swMCyq
[2] Shoshana Zubof: Big Other: Surveillance Capitalism and the Prospects of an Information Civilization: https://is.gd/Hq9jRf
[3] Shoshana Zubof: The Secrets of Surveillance Capitalism. In: Frankfurter Allgemeine. https://is.gd/hCRfFX
The ESP32 is the latest product from Espressif. Like the ESP8266
the ESP32 has Wi-Fi, but adds Bluetooth. Besides a lexible radio
the ESP32 also has two 32-bit cores inside, making it extremely
powerful, and providing all the ports and interfaces that the
ESP8266 is lacking. The ESP32 exposes an analogue-to-digital
and digital-to-analogue converter (ADC & DAC), touch sensor
circuitry, an SD/SDIO/MMC host controller, an SDIO/SPI slave
controller, an EMAC, PWM to control LEDs and motors, UART, SPI,
2. Raspberry Pi 3 (model B+)
I2C, I2S, infrared remote controller, and, of course, GPIO. The www.elektor.com/rpi3b-plus
Electronic Circuits for All Acoustics in Performance VFD Tube Clock with ESP32
This book includes 400 new and original radio electronic This book helps those responsible for providing good acoustics This VFD-Tube clock uses an NTP server on the Internet to keep
multipurpose circuits. The technical solutions presented in the in performance and worship spaces to understand the the time synchronized. It is built around an ESP32-DevKitC
book are intended to stimulate the creative imagination of variables and choices entailed in proper acoustic design for module. This Arduino compatible board not only has a powerful
readers and broaden their area of thought. The chapters are performance and worship. Practicing acoustical consultants processor but also has Wi-Fi and Bluetooth onboard. The Wi-
devoted to power electronics and measuring equipment and will find the book a useful reference as well. The level of Fi connection is used to synchronize the time. When the clock
contain numerous original circuits of generators, amplifiers, presentation is comfortable and straightforward without is switched on, it connects to the network and synchronizes
filters, electronic switches based on thyristors and CMOS being simplistic. with the NTP server instantaneously. This is better than
switch elements. synchronization via radio time servers or even via GPS.
member price: £31.95 • €35.95 • US $44 member price: £19.95 • €22.46 • US $28 member price: £134.95 • €152.96 • US $186
NEW
Programming With
STM32 Nucleo Boards
This book covers many projects using most features of the Nucleo-
L476RG development boards. All the projects in the book have been
designed using the Mbed and the System Workbench software
development tools (or Toolchains). Full software listing are given for
every project. In the early chapters of the book the architecture of
the Nucleo family is briely described. The projects range from simple
lashing LEDs to more complex projects using modules and devices
such as GPIO, ADC, DAC, I2C, LCD, analog inputs and others. In
addition, several projects are given using the Nucleo Expansion Boards.
These expansion boards plug on top of the Nucleo development boards
and provide features such as industrial input/output, DC motor drive,
stepper motor drive, Wi-Fi, and many more.
The IN9-Nixie Bargraph Thermometer displays room This book is an introduction to the ESP32 processor and This book is about the Raspberry Pi 3 computer and its use
temperatures on a colour-illuminated scale in Celsius and describes the main hardware and software features of this in various control and monitoring applications. The nice
Fahrenheit. Various sensors are supported. All functions chip. The book teaches the reader how to use the ESP32 feature of this book is that it covers many Raspberry Pi 3
are controlled by an Arduino Nano, also the attractive visual hardware and software in practical projects. Many basic, based hardware projects using the latest hardware modules
effects (bargraph and RGB backlight with adjustable colours). simple, and intermediate level projects are given in the such as the Sense HAT, Swiss Pi, MotoPi, Camera module, and
This kit comes unassembled, with all electrical and mechanical book based on the ESP32 DevKitC development board, using many other state of the art analog and digital sensors. All the
parts included. Soldering required. the highly popular Arduino IDE and also the MicroPython projects in the book are based on the Python programming
programming language. language and they have been fully tested.
member price: £55.95 • €62.96 • US $77 member price: £27.95 • €31.46 • US $39 member price: £27.95 • €31.46 • US $39
The Hexadoku puzzle employs numbers in the hexadecimal and these determine the start situation.
range 0 through F. In the diagram composed of 16 × 16 boxes,
enter numbers such that all hexadecimal numbers 0 through Correct entries received enter a prize draw. All you need to do
F (that’s 0-9 and A-F) occur once only in each row, once in is send us the numbers in the gray boxes.
each column and in each of the 4×4 boxes (marked by the
thicker black lines). A number of clues are given in the puzzle
Participate!
Ultimately July 31, 2018, supply your name, street address
and the solution (the numbers in the gray boxes) by email to:
hexadoku@elektor.com
Prize Winners
The solution of Hexadoku in edition 3/2018 (May & June) is: DEF0C.
The €50 / £40 / $70 book vouchers have been awarded to: Simone Drall (Germany); Emil Cugini (Switzerland);
Jos van Goethem (Netherlands); Mike Corteling (Australia) and Lucie Liochon (France).
Congratulations everyone!
The competition is not open to employees of Elektor International Media, its subsidiaries, licensees and/or associated publishing houses.
D U C T
O U R PRO
N C H Y
LA U
ONTO THE
INTERNATIONAL
MARKET PLACE!
Participate in 2018
November 13-16. 2018
Munich