Wifi Remote Control: Recycle Your Atx Power Supply
Wifi Remote Control: Recycle Your Atx Power Supply
Wifi Remote Control: Recycle Your Atx Power Supply
com
magazine
June 2013
WiFi Remote
Control
for LED ribbon strips, relays, actuators and motors
Cyclone IV E F780 FPGA board Spartan-6 FGG484 FPGA board PLCC68 Series
ACM-204 series XCM-018/018Z series Easy and Quickly Mountable Module
EP4CE30F29C8N XC6SLX45-2FGG484C FPGA Module IC socket mountable
EP4CE40F29C8N XC6SLX75-2FGG484C • 50 I/Os (External clock inputs
EP4CE115F29C8N XC6SLX100-2FGG484C are available)
Credit card size (86 x 54 mm) XC6SLX150-2FGG484C
Credit card size (86 x 54 mm) • 3.3V single power supply
RoHS compliant
operation (Voltage converters for auxiliary
RoHS compliant
power supply are built-in)
• Separated supply-inputs: Core, I/O drivers
Arria II GX F572 FPGA board Virtex-5 FFG676 FPGA board
• JTAG signal
E-mail :
ACM-025 series XCM-109 series • All PLCC68 series have common pin
assignment
EP2AGX45DF25C6N XC5VLX30-1FFG676C
• Very small size (25.3 x 25.3 [mm])
EP2AGX65DF25C6N XC5VLX50-1FFG676C
EP2AGX95DF25C6N XC5VLX85-1FFG676C • RoHS compliance
EP2AGX125DF25C6N XC5VLX110-1FFG676C • MADE IN JAPAN
Credit card size (86 x 54 mm) Compact size (43 x 54 mm)
XC3S700A-4FTG256C EP3C25U256C8N
XC3S1400A-4FTG256C 3.3V single power supply operation
Compact size (54 x 53 mm) On-board oscillator, 50MHz
RoHS compliant
RoHS compliant
ALSO AVAILABLE:
The all-paperless GREEN Membership, which
delivers all products and services, including
Elektor.MAGAZINE, online only.
magazine
Community Projects
8 Elektor World 14 Wi-Fi Controller Board will be used. This tool helps both
• The Tube in the Lunchbox Control your home from your beginners and old hands.
• Getting Control mobile phone with this universal
Wi-Fi controller board. We show 34 Lost Model Finder
how to set the color of an RGB Build this radio detection finder and
LED strip, but you can use it for a never lose your radio controlled
variety of other applications. plane again. Simply switch on the
receiver and it points you straight
22 Recycle your to the crash location.
ATX Power Supply
DesignSpark This ATX bench top power supply 40 Lithium-ion Battery
adapter board converts any Recycling Made Easy
Re-using Lithium-ion batteries can
10 Day 1 — Make it just the way standard ATX computer power
be tricky. Often they are charged
you want supply into a convenient supply
inside the equipment, so there
Getting started with DesignSpark for breadboarding and general
isn’t a separate charger available.
PCB and configure it to your likings. workbench use.
Luckily, a charger for used (or new)
This tutorial shows you how to set
Li-ion cells is fairly easy to build.
up your personal preferences in 26 Off to the EF Library!
this latest release of PCB design Using Elektor’s ‘Embedded
44 Taming the Beast (5)
software. Firmware Library’, code for
Although FPGA applications can be
an embedded project can be
designed using schematic diagrams
13 The Cat’s Whisker generated swiftly without the need
with logic symbols, in practice this
Crystal Diode FRIHO D.R.P to know which type of interface
Labs Magazine
is usually done with a hardware 64 LCR Meter Shootout 74 Retronics: Konrad Zuse’s Z1
description language. An advantage A quick comparison between through Z4 and beyond
of the latter approach is that Elektor’s 500 ppm LCR Meter Ever since the earliest days of
complex functions are often easier and two other LCR measurement mathematics and logical thought,
to express in algorithms than in devices people have tried to find ways to
schematics. Accordingly, in this simplify the repetitive work involved.
installment we guide you through This article takes a tour of Konrad
the process of programming an Zuse’s impressive contributions to
FPGA application. Industry the development of the computer.
Series Editor: Jan Buiting.
54 From BASIC to Python (2)
This second installment elaborates 66 New Performance Require-
78 Hexadoku
on graph plotting and Fourier
ments for Resistors
Elektor’s monthly puzzle with an
Today’s aircrafts are increasingly fuel
synthesis. And without much effort electronics touch.
efficient and need to conform to anti-
we setup a graphical user interface.
pollution regulations. The humble
79 Gerard’s Columns: In the
resistor can be helpful, provided
62 Beefing up DAC Resolution Clouds
some of its key specifications are
Improve the resolution of ordinary, A column or two from our
given close consideration.
cheap digital/analog converters columnist Gerard Fonte.
by using the output of one as a
programmable voltage reference
70 News & New Products
82 Next Month in Elektor
A selection of news items received
for the others. A sneak preview of articles on the
from the electronics industry, labs
Elektor publication schedule.
and organizations.
United Kingdom
Wisse Hettinga
+31 46 4389428
[email protected]
Germany
Ferdinand te Walvaart
+49 241 88 909-17
[email protected]
France
Denis Meyer
+31 46 4389435
[email protected]
Netherlands
Harry Baggen
+31 46 4389429
[email protected]
Connects you to
Spain
Eduardo Corral
+34 91 101 93 95
[email protected]
Italy
Maurizio del Corso
+39 2.66504755
[email protected]
Sweden
Wisse Hettinga
+31 46 4389428
[email protected]
Brazil
João Martins
+55 11 4195 0363
Supporting Companies
[email protected]
AP Circuits Pololu
www.apcircuits.com . . . . . . . . . 33 www.pololu.com . . . . . . . . . . . . 33
Portugal
João Martins
+351 21413-1600 Beta Layout Saelig
[email protected] www.pcb-pool.com . . . . . . . . . . 39 www.saelig.com . . . . . . . . . . . . 73
India Cleverscope
Sunil D. Malekar www.cleverscope.com . . . . . . . . 39
+91 9833168815
[email protected] DLP Design
www.dlpdesign.com . . . . . . . . . 33
Russia
Nataliya Melnikova ExpressPCB
+7 (965) 395 33 36
[email protected] www.expresspcb.com . . . . . . . . 71
EzPCB
Turkey
Zeynep Köksal www.ezpcb.com . . . . . . . . . . . . 53
+90 532 277 48 26
[email protected] Fabstream
www.fabstream.com . . . . . . . . . . 9
South Africa
Johan Dijk HuMANDATA
+31 6 1589 4245 www.hdl.co.jp/EL/ . . . . . . . . . . . . 2
[email protected]
Elektor World
Compiled by
Wisse Hettinga
The Tube in the Lunchbox:
reader comments
Elektor readers like you, consistently demonstrate the
true spirit behind the magazine, enhancing and extending the
editorial content with your own investigations and experiments. Component
related articles remain the most popular and in last April’s Elektor World we
showed the ‘Tube in the Lunchbox’ and asked for more details.
Among others, Christopher Kessler from Germany and Jan Swenker from The
Netherlands dug out more information on this. Christopher found the specs of
this tube in the “Valvo Fotovervielfacher 1978-79”. In total he found 6 pages
of information on the device and figured that its current price tag was around 30 dollars. Jan’s information
confirms the date of origin: 1978. He pointed us also to the Hamamatsu Photomultiplier Tubes book from
1986 (you can find the PDF on the internet). The book has the specs of a replacement tube, the model
R1450... It is time to get our hands dirty getting this tube to work!
Many thanks to Jan and Christopher
Getting control
“In engineering, control system theory focuses on how to manipulate a
system’s inputs to change its behavior. DIYers are familiar with many
simple, open-loop control systems — such as those in basic stepper
motors. But today, project kits for everything from robotic sumo cars
to auto-piloted model aircraft demand DIYers learn more about the
theory behind complex, closed-loop control systems”, Brian Douglas
says in his “Tech the Future” essay in Circuit Cellar magazine’s June
2013 edition. “DIYers aren’t going back to the classroom, they’re going
online — educating themselves on websites and turning to open-source
software and hardware”. Douglas should know. The Seattle-based
control systems engineer has a YouTube site dedicated to fostering a
practical understanding of control system theory, www.youtube.com/
user/ControlLectures. Douglas is one of the essayists featured in CC’s
recurring “Tech The Future” section, which focuses on developing
trends and breakthroughs in technology. Visit circuitcellar.com/
category/tech-the-future to read more of Douglas’s essay, and others.
Today I will walk you through how to make global primitives like shapes, text and tracks. Each style
setting changes using DesignSpark technology has a name to make it easy to reference, just
files so that you can make DesignSpark work like in a word processor. I normally try to give
just the way you want. styles meaningful names so that you can know
what the style is without checking its properties
Getting started directly. For example, having a style named “Via”
But before we start configuring DesignSpark is ok if you only have one via but calling it “Via
it’s important to know that DesignSpark uses (0.45 mm x 0.95 mm)” makes it immediately
styles to specify the formatting rules for design obvious that the via has a 0.45 mm drill and a
0.95 mm copper pad. You are free to add custom
styles to the technology files but this discussion
we will be focusing on the system default styles
like “[Symbol Names]” which is the style name
used for reference designators and component
names.
Figure 5.
Design rules.
By Clemens Valens The project you are about to encounter took a Also, I wanted a web browser based application,
(Elektor.Labs) while to complete. It all started a year ago with compatible with most browsers, and that used
a Home Automation system [1] originally devel- sliders to control the color of the strip. So Koen
oped by two trainees at Elektor Labs, Koen and set out to develop the lot, but unfortunately his
Jesper. One part of their system was an RGB trainee period ended before he could finish the
LED strip controlled over Ethernet, i.e. with a project and he went back to college. Before he
cable. The idea was nice, but I felt that a wireless left Elektor, Koen had explained to me the prob-
connection would be a more appealing solution. lems he had run into, some of which still needed
Origin: null
PWM color control in software.
Pragma: no-cache Porting the AVR code to the PIC should have
Cache-Control: no-cache been an easy and straight forward exercise, but
it wasn’t. Of course I had complicated things a bit
red=79&green=10&blue=20 by wanting to include a bootloader and USB func-
tionality, but Microchip could have made it a bit
The next step was to make the web page look easier. I was using my super-duper full-featured
pretty on mobile devices. On my smartphone the XC8 compiler that Microchip is raving about but
sliders were shown very small, making it impos- found it impossible to get the USB code to com-
sible to move them with any precision. The solu- pile, let alone to work. I got this code from the
tion was to add the viewport meta tag to the Microchip Application Libraries v2012-10-15 and
header of the web page, like this: only after many hours of fruitless fiddling with
compiler settings and pragmas did I find a state-
<meta name=’viewport’ ment somewhere on the internet saying that XC8
content=’width=device-width, user- is not (yet) compatible with the Microchip Appli-
scalable=no’ /> cation Libraries. Duh! I needed another compiler.
Again internet came to the rescue and within fif-
With this line added to the HTML code of the web teen minutes I had an official full-featured C18
page it now nicely filled the screen of my Android compiler up and running without shelling out a
phone while looking good on a PC as well. (On dime. Another fifteen minutes more and I had
an iPad it occupied only about a quarter of the the USB serial port example up and running.
screen and I have not tried to improve that.) Now it was time to add my Wi-Fi code — which
Meanwhile I had also optimized the size of the went pretty smoothly except for fitting all the
rest of the program and now my goal was to data in the PIC’s segmented RAM — and try it
make it all fit in as little memory as possible. An out. And of course it worked. Not. Actually, it
important improvement came from compress- worked a bit. I could change the color of the
ing the web page. You can do this with gzip and strip once or twice, but then Wi-Fi communica-
then add the line “Content-encoding: gzip” tion would stop. When I controlled the strip over
to the server’s reply. Most, if not all, browsers the USB serial port, it all worked fine. So, back
will know how to handle zipped web pages. The to the debugging table where I discovered that
disadvantage of doing this is that it is now a bit the USB interrupt seemed to hold up the serial
more complicated to change the web page; there- port interrupt, causing data loss. By this time I
fore you only do this when its design is finished. was pretty fed up with it all and decided to sim-
ply disable the USB port in Wi-Fi mode instead of
At that point I had a fully working prototype based going to the bottom of the problem. (I suggest
on Arduino compatible hardware with software that you give it a try if it really interests you. Please
compiled within the Arduino IDE. If you want the let me know if you find the solution.)
details, please visit [4]. I could have stopped here,
but I wanted better hardware; a stack of three Building it
PCBs for such a simple circuit just didn’t feel right. Now my second — PIC-based — prototype was
Looking for an MCU with fewer pins I found that I functioning as intended with the parts I wanted
could not stay on Atmel’s AVR platform because to use (Figure 2); the time to design a nice PCB
the parts that would be suitable are difficult to had finally come. Since the goal was to control
get. However, I did happen to have a couple of an LED strip, I decided to build it into a small,
Microchip PIC18F14K50 devices lying around. This discreet enclosure. The PCB is designed in such
is a 20-pin MCU with USB, which was interest- a way that the enclosure requires minimal tool-
ing because that would allow for comfy PC-based ing, especially when you use the blue transpar-
configuration of the Wi-Fi module (see also [2]). ent version that allows you to view the status
Another interesting feature is the USB bootloader LEDs inside. In that case no drilling is needed at
Microchip provides (for free), which enables easy all; you only have to trim some standoffs inside.
firmware development without a special program- Even with a 20-pin MCU several pins remained
mer. Unfortunately, this MCU has only one PWM unused so I added some extra functionality to
channel, so I had to implement the three-channel the board. In combination with the bootloader
this made the board into a much more versatile sion port and three power channels;
platform that you can use for other applications • FlowBoard compatible with FlowStone 3 [5];
as well. It can be used as: • something I have not imagined yet.
• Wi-Fi RGB LED (strip) controller; To make these different applications possible the
• three-channel controller to switch relays or board has been equipped with a switched mode
control motors over Wi-Fi or USB (or both); regulator so it can be powered from a 7 V to
• USB to serial port adapter; 40 V DC power supply without wasting too much
• rapid prototyping system with Wi-Fi, expan- calories. The board can also be powered from
D4
IC3 +5V IC2 +3V3
1N5819 LM2575T-5.0/NOPB T P2 MCP1825S-3302E/AB TP3
Vin 1
FB
4 +5V +3V3
5 2
L1 +5V
OFF
330u 1A
TP4 C9 D3 C8 C4 C5 C6 C7
Vin 3
10u 10V 100n 10u 10V 100n
100u 50V 330u 16V
GND TP1
1N5819
JP1 ICSP
+5V D1
1N5819
1
2
3
4
5
6
1
2
R1
IC1 JP3
K1
1 20 1
1k VDD VSS VBUS
2 19 2
RA5/OSC1 D+ D-
X1 3 18 3
RA4/OSC2 D- D+
4 17 C3 4
RA3/MCLR VUSB GND
S1 5 16 100n
C2 C1 RC5 RC0
3x 1N5819 12MHz 6
RC4 RC1
15
USB-B
7 14
D11 D10 D9 22p 22p RC3 RC2
8 13 JP2
RC6 RB4 1
K2 9 12
RC7 RB5/RX 2
R2 10 11
1 T1 RB7/TX RB6 3
2 4
3
T2 1k
PIC18F14K50-I/P 5
4 Vin
5 IRL540
D5 TXD RXD EXPANSION
T3 TP6 TP5
6
IRL540
K3
BARREL JACK
IRL540
+3V3
R6 R3 R4 R5
GPIO29
32
33
34
9
TP8
1
VBAT VIN_3V3 EN_1V8 VDDIO
EXT ANT
47k 1k 1k 1k
2 47 D6
JTAG_TCK GPIO28
3 MOD1 46 LINK
JTAG_TDO GPIO29
4
JTAG_TDI WizFi220 GPIO30
45 D7
5 44 OK D8
JTAG_TMS GPIO31
6 43 RXD
JTAG_NTRST UART0_CTS/GPIO24 R8
7 42
ALARM1 UART0_RX/GPIO0
8
RTC_OUT1 UART0_RTS/GPIO25
41 BZX79-C3V0 D2 1k
10 40
DC_DC_CNTL UART0_TX/GPIO1
11 39
ALARM2 UART1_TX/GPIO2
12 38 GPIO27
ADC1 UART1_RX/GPIO3 TP7
13 37
14
ADC2 UART1_RTS/GPIO27
36
Figure 2.
MSPI_MISO/GPIO6 UART1_CTS/GPIO26
15
MSPI_MOSI/GPIO7 EXT_RESETN
35
+3V3 Circuit diagram of the
16 30
17
MSPI_CLK/GPIO5 SSPI_MOSI
29
Wi-Fi Controller Board.
VOUT_1V8 SSPI_CS
R7
19
MSPI_CS0/GPIO4 SSPI_CLK
28
Did you ever notice how
20 27
MSPI_CS1/GPIO13 SSPI_MISO
21
I2C_CLK/GPIO9 I2C_DATA/GPIO8
26 people always connect the
47k
22
PWM0/GPIO10 GPIO21/CLK_11MHZ
25
barrel jack the wrong way
23
GPIO19/CLK_44MHZ GPIO20/CLK_22MHZ
24 T4
GND GND GND GND
R9 around? The center pin is
10k supposed to be the common
1
18
31
48
COMPONENT LIST
Resistors (5%, 0.25W) IC2 = MCP1825S-3302E/AB
R1,R2,R3,R4,R5,R8 = 1kΩ IC3 = LM2575T-5.0/NOPB
R6,R7 = 47kΩ T1,T2,T3 = IRL540
R9 = 10kΩ T4 = BC547
Capacitors Miscellaneous
C1,C2 = 22pF, ceramic, 50V, 2.5mm pitch MOD1 = WizFi220 w. antenna, Elektor # 130076-92
C3,C5,C7 = 100nF, Z5U, 50V, 5mm pitch JP1 = 6-pin pinheader, 0.1” pitch, vertical
C4,C6 = 10µF 63V, radial, 2.5mm pitch JP2 = 5-pin pinheader, 0.1” pitch, vertical
C8 = 330µF 16V, radial, 3.5mm pitch JP3 = 2-pin pinheader, 0.1” pitch vertical
C9 = 100µF 50V, radial, 3.5mm pitch Jumper for JP3
K1 = USB-B receptacle
Inductors K2 = Connector 1x4, 90deg, 0.2” pitch, e.g. MSTBA4
L1 = 330µH 1A, 5mm pitch, e.g. Würth Elektronik K3 = DC socket
type 7447452331 20-way DIP socket for IC1
S1 = Multimec type RA3FTL6 w. cap type S09-16.0
Semiconductors X1 = 12MHz quartz crystal, HC49/S case
Enclosure, Hammond type 1593QGY
D1,D3,D4,D9,D10,D11 = 1N5819
PCB, Elektor # 120718-1
D2 = 3V zener diode, e.g. BZX79-C3V0
D5,D6,D7,D8 = LED, green, 3mm
IC1 = PIC18F14K50-I/P
6
5
1 23
4
3
2
1
Recycle
your ATX Power Supply
Elegant adapter board makes it easy
By Ben Jordan (USA) This ATX bench top power supply adapter board allows you to convert any stan-
dard ATX computer power supply into a convenient supply for breadboarding and
general electronics workbench use — simply and elegantly.
+5V STBY
VSTBY VSTBY
+3V3
K4 K11 K10 K3
+3V3 16 1
U1 = TC4049B U1
C2 C1 C4
8
K5 K12 4 2
3 2 5 4
+5V0 1 1
OFF R3 R4 R1
C5 C8 10k U1.A U1.B
220R 220R
100n 100n 7 6
K17 K16 1 D2
J1 D1
U1.C
1 11
2 12 +12V U1.D
FAULT
3 13 K6 K13 9 10
R2 1
4 14 +12V
5 15 10k
C6 U1.E U1.F
6 16
S2 11 12 14 15
7 17 100n 3 1 1 1
K19 K20
8 18
4 2 PB OFF
9 19
10 20 C7
K7 K14
ON
C3
100n VSTBY
–12V
100n PWR
OK
K8 K9
I had also considered a built-in panel meter in their multi-meter and get a more accurate
so you could monitor the output voltage of measurement anyway.
each output, but I quickly realized this would
be unnecessary feature-creep for this applica- No complex circuit
tion, since the outputs are fixed and fairly well Figure 1 shows the circuitry for this design. The
regulated, and most users (like me) can plug switching circuit is a simple latch based on two
COMPONENT LIST
Resistors D2 = LED, 3mm, 2-pin bicolor
R1,R4 = 220Ω IC1 = TC4049B
R2,R3 = 10kΩ
Miscellaneous
Capacitors K3-K7,K10-K14 = binding post (socket) for banana
C1-C8 = 100nF plug
J1 = ATX connector for PCB mounting
Semiconductors S1,S2 = tactile push button
D1 = LED, 3mm, yellow
Figure 2.
The component layout
leaves no room for
misinterpretation. Note that
the ATX connector should be
mounted on the bottom side
of the PCB.
inverters from a 4049 HEX CMOS inverter, pow- The plated-through holes designated K3 to K14
ered from the ATX standby 5 V rail. The other are for bolting the back conductive end of the
gates in the inverter are used to drive the power banana socket binding post onto. Notice the use
on control signal to the PSU and the LEDs. Press- of multiple vias in a circle around each of these
ing S2 turns on the power supply while S1 turns and also around the mounting holes. These offer
it off again. D2, a bi-color LED, indicates standby increased strength for tightening up screws over
mode (green) or powered-on mode (red). them and also for the binding posts a good low-
ATX power supplies have built-in protection, but resistance current path through the PCB.
there’s also a Power Good output that tells the
motherboard when the PSU is ready, or if there’s In practice
a fault condition. It would be nice to have this This ATX adapter board offers standard 0.75”
displayed on an LED. I used a yellow LED for jack spacing for dual-banana plugs and has color-
D1 which indicates when Power Good goes high coded binding posts for each of the voltage rails:
(Power Good is an active low signal). This way, 5 V standby, 3.3 V, 5 V, +12 V and –12 V. I have
you get some warning of ATX power supply fault now been using this board extensively at work
conditions. In general, any continuous flashing and at home, powering several development kits
is bad and your power supply probably has a off a single ATX supply. At work I have an Altium
problem. Nanoboard-II and two Altium Nanoboard 3000
FPGA development boards all running at once
All the capacitors provide a bit of decoupling for from one power supply, as well as a few other
the different supply outputs, except C3 which is things. It has really simplified things well for me!
for de-bouncing the on-off circuit. All the capaci- (120619)
tors are ceramic 100 nF types. R1 and R4 are LED
dropping resistors and R2/R3 form the feedback
Internet Links
paths for the on/off dual-inverter latch.
[1] http://jordandsp.com/ATX-bench-top-power-
I have seen others converting ATX power supplies supply-adapter.php
to bench top lab supplies and putting minimum [2] www.elektor.com/120619
load resistors in them. In my experience this is
not necessary since the cooling fan is generally
enough of a minimum load and most modern
switching power supplies are designed to run
down to zero load anyway. But if it makes you
feel better, you can attach a 10 or 20 W resistor
to the 5 V rail (10 Ω will usually suffice) by sol-
dering the power resistor between the 5 V and
GND binding posts at the rear.
Board design
This adapter board acts as a break-out board with
an ATX header and the necessary on/off circuitry
as well as standard-spaced binding posts for plug-
ging in single or dual banana plugs. The silkscreen
overlay as a guide for placement is shown in Fig-
ure 2. Note that the ATX power supply socket must
be mounted on the rear side of the PCB, with all I want it
other components on the front side. This project is available in limited supply as a complete kit, with the
An additional novelty of this board is the unique PCB, all components including binding posts, components and an ATX
plated slots around its edge, which are used to connector, plus comprehensive assembly instructions which include
clip on ‘alligator’ style test leads as well. The the schematic diagram and PCB assembly diagram, as well as drill
silkscreen text indicates the output voltage of templates for panel mounting. Visit [1] for more information on price
each one. The board layout is available as a PDF and ordering.
download from [2].
By Jens Nickel If a suitable protocol is defined, hardware connected to your PC can be controlled
(Elektor Germany Editor)
using a terminal emulator program. The necessary firmware can be rustled up
quickly using Elektor’s ‘Embedded Firmware Library’ (EFL), and the code can be
written without knowledge of whether a UART or some other interface will be used
for the connection. The protocol described here is ideal for experimentation and
development purposes.
In the previous edition we described our modular a code file for the board and a code file for the
‘Embedded Firmware Library’ (EFL), written in microcontroller.
the C programming language. This helps begin-
ners and old hands alike to develop code for However, the idea of modularity is taken even
an embedded project that is independent of the further in the EFL. Protocol libraries allow pro-
underlying hardware and which can therefore grams that communicate to be written without
easily be ported from board to board and from knowledge of the communication channel that will
microcontroller to microcontroller. This is achieved be used: it makes no difference whether com-
using a hardware abstraction layer consisting of mands and data are transferred using a UART and
Mini protocol
When trying to get code up and running simple
tests such as turning a LED on and off or reading
a digital input can be very helpful. Often, how-
ever, a microcontroller board will not have any
buttons to help you carry out such tests. One
alternative option is to control the board from
a PC, for example over a serial interface. If the
protocol is restricted to ordinary printable ASCII
characters it is easy to use a terminal emula-
tor program to send commands to the board,
avoiding the need for special-purpose software
on the PC.
Map, blocks and board pins The peripheral blocks are shown in the middle, Figure 1.
The BlockProtocol includes the ‘x’ command spe- while on the right is a list of the pins on the board. Dump of the EFL tables
cially designed for use in development with the This is particularly important information for any- as seen in the terminal
emulator. On the left
EFL. The command causes the board to send a one planning to adapt or write an EFL board file
is the map with the
dump of the EFL tables to the PC. The tables are for a new board. More extensive documentation
microcontroller features in
used by the hardware layer to determine the on the internals of the EFL are given in the extra use (red numbers in the
microcontroller pins and registers that need to document that can be downloaded at [1]. board block diagram); in
be changed in response to a function call. The the middle is the block table
entries are specific to the board and any expan- Control via UART (blue numbers); and on the
sion board that might be attached. The screenshot We shall now show by example how easy it is to right are the board pins
in Figure 1 shows what appears in the terminal use the protocol in your own microcontroller appli- (green numbers).
window when the board shown alongside is used. cations. We will use an experimental node, famil-
On the left is the ‘map’ including the features of iar from our series on the ElektorBus. This is a
the microcontroller such as the UART and ADC very compact board based on an ATmega328. As
that are set up by the board initialization code. usual we will connect the node to the PC using its
A little code
In the main source file of the application code
itself we need to include the library header files
as follows.
#include “UARTInterfaceEFL.h”
Figure 2. RS-485 interface and a USB-to-RS-485 converter #include “BlockProtocolEFL.h”
Our small microcontroller (Figure 2). Instead of the ElektorBus protocol
board can be controlled over we will use our new text-based BlockProtocol. The main function in an EFL-based project is
a UART/RS-485 interface always structured in the same way: see List-
with the help of a simple
The necessary firmware for the microcontroller ing 1. In the application set-up function, which
ASCII text-based protocol
can be downloaded at [4]; the application can is called whenever the application starts up, we
and a terminal emulator
program. also be found in the EFL code base at [5]. An initialize the libraries:
overview of the files is given in the extra doc-
umentation mentioned above. Double-clicking UARTInterface_LibrarySetup();
‘ExperimentalUART.atsln’ opens the project in UARTInterface_SetBaudrate(0, 38400);
Atmel Studio: see the screenshot in Figure 3. BlockProtocol_LibrarySetup(UARTInterface_
On the right-hand side is a list of the files in Send, 0, UARTInterface_GetRingbuffer(0));
the project. The files Controller.h, Controller.c,
Board.h and Board.c form the hardware layer. Here the second line sets the baud rate of UART
interface block 0 (which is where we have our
RS-485 driver connected) to 38400 baud. The
Listing: third line needs a bit more explanation. We are
Basic structure of an EFL application. telling the BlockProtocol library that it should use
the function UARTInterface_Send when it wants
int main(void)
to send data from the board. The second param-
{
eter is the number of the UART interface block to
Controller_Init();
be used (even though on the experimental node
Board_Init();
there is only one UART interface).
Extension_Init();
The third parameter is a pointer to a ‘ring buffer’
ApplicationSetup(); (or ‘circular buffer’) to be used to store received
bytes. Here the required pointer is obtained as
while(1) the return value of the function UARTInterface_
{ GetRingbuffer(0), which is also implemented in
ApplicationLoop(); the UARTInterface library.
}
In the main application loop function, which is
};
called regularly when the application is running,
Let’s try it
Having compiled the code and flashed it into the
board we can try it out using a terminal emula-
tor program such as HTerm [6]. First we have to
specify which COM port to use and the baud rate.
In the ‘input control’ window we have to set the
program up so that the <CR> character is sent
when the Enter key is pressed (see Figure 4). character sequences given above. Figure 3.
Code to control hardware
We will first use the library at its lowest level to Higher-level commands over a UART interface.
demonstrate direct access to to the output port Directly controlling port pins is not the main rai-
pins of the microcontroller. From the circuit dia- son d’être of the EFL. If we want to port our
gram of the experimental node [7] we can deter- device control program to use a different micro-
mine that the red LED on the board is connected controller board with different wiring, we would
to port pin PD4. Port D on the AVR microcontroller have to change the character sequences given
Figure 4.
corresponds to port index 3. And so we simply above inside the PC or Android software.
The HTerm terminal
type into the terminal emulator For this reason the mini-protocol also allows emulator lets you choose
hardware-independent control of digital inputs what is sent when the Enter
p 3 4 + <ENTER> and outputs, just like when writing code to run key is pressed.
B 0 0 ? <CR>
on the microcontroller itself as described in the
previous issue.
With the string we can request the status of the test button (but-
ton 0 of button block 0). And with
L 0 1 + <CR>
R 0 0 + <CR>
we can switch on LED 1 in LED block 0 (which
on our board is the yellow LED). With we can turn on a relay.
Three-wire interface
The approach described above assumes that we
BlockProtocol have external access to a UART on the microcon-
troller, for example via RX and TX pins brought
Each command starts with a single character, possibly followed by one
out on the board. We also need a more-or-less
or two decimal values. These specify to the EFL the pin on which the
complete EFL microcontroller description file
command will act. A final character is used to specify any particular
which describes not only the I/O pins and ADC
action to be performed.
functions but also the UART functions that are
available.
x
Outputs the EFL map, block and board pin tables (see additional
When starting out with a new microcontroller (for
documentation at [1]).
example because you want to develop an EFL
microcontroller description file for other read-
p x y +, p x y –, p x y ?, p x y #, p x y *
ers to use) it is probably simplest to start with
For microcontroller pin y on port x: set high; set low; read state; read
the I/O functions. The first major hurdles are
ADC conversion result (if applicable); toggle under timer control.
to study the datasheet to determine how to go
about setting the level on the I/O pins and reading
b x +, b x –, b x ?, b x #, b x *
their status, and to find at least three general-
For board pin with index x in the board pin table: set high; set low; read
purpose I/O pins that are brought out to con-
state; read ADC; toggle.
venient points: fortunately most boards satisfy
this condition. It will then be possible to control
i x y +, i x y -, i x y ?, i x y #, i x y *
the board using the protocol described above,
For pin in position y within the block with index x in the block table: set
over a three-wire SPI interface implemented in
high; set low; read state; read ADC; toggle.
software. One of the wires is a clock signal, the
second carries bytes from the master (the PC)
C x y +, C x y –, C x y ?, C x y #, C x y *
to the slave (the board), and the third carries
For pin y of connector x: set high; set low; read state; read ADC;
bytes in the opposite direction.
toggle.
ThreeWireInterface_LibrarySetup();
BlockProtocol_
LibrarySetup(ThreeWireInterface_Send, 0,
ThreeWireInterface_GetRingbuffer(0));
which checks whether the other device has taken inserted in the main application loop the processor
its data line high to indicate a request to send will regularly check whether a string, terminated
data. If so, the communication is set up. When with a <CR> character, has appeared in one of
using the UART for communication we do not the input ring buffers. If so, then its contents
need a listener function like this, as in that case are sent out on the other communication chan-
a microcontroller interrupt can be used to detect nel. Then the other input ring buffer is similarly
when characters arrive and automatically store checked, and so on.
them in the ring buffer.
It should almost go without saying that the gate-
Making contact with an Arduino way module itself is programmed in a manner
To demonstrate the EFL concept we selected an independent of the underlying communication
Arduino Uno board. The code for this board can channels and can therefore easily be used to per-
be found in the project ArduinoUnoEFL [4][5]. We form other similar gateway functions. The func-
decided to use general-purpose I/O pins PB0, PB1 tion OneToOneGateway_LibrarySetup takes two
and PB2 to access the board: these are brought triples of parameters to specify the two com-
out on the ‘digital’ I/O connector as Digital8 to munications channels being connected. In this
Digital10. A simple three-way cable (for exam- example the call appears as follows:
ple using Conrad order code 741221) provides
a practical solution (see Figure 5). OneToOneGateway_
Of course we also need a connection to the PC at LibrarySetup(UARTInterface_Send,
the other end, and that will also need to have a 0, UARTInterface_GetRingbuffer(0),
three-wire interface. We pressed an experimen- ThreeWireInterface_Send, 0,
tal node board into service as a gateway, con-
ThreeWireInterface_GetRingbuffer(0));
verting from three-wire format to RS-485 (and
thence to USB) and back again. The firmware We now just need to plug the cable into the
involved can also be downloaded at [4] or [5]: experimental node’s expansion connector (pins
the Atmel Studio project can be found in the PC0 to PC2, see Figure 6) and flash the appro-
directory ‘ExperimentalSPI’. priate hex file into its microcontroller.
The gateway function has its own library mod-
ule called OneToOneGatewayEFL. With a call to The pins used to form the three-wire interface
have to be specified separately for the two dif-
OneToOneGateway_Engine(); ferent boards. The three-wire interface on each
device is a separate peripheral block: recall that
C 0 13 + <CR> [9] www.elektor-magazine.com/110405
[10] www.elektor-magazine.com/120097
can be used to set pin 13 of the Arduino’s ‘digi-
tal’ connector high: this pin drives an LED on
the Arduino Uno board, and so we get immedi-
ate visual feedback.
DLP-IO8-G DLP-IOR4
8-Channel Data Acquisition 4-Channel Relay Cable
DLP-TH1b
Temp/Humidity Cable
Only Maestro USB
$29.95! DLP-RFID1
HF RFID Reader/Writer Servo Controllers
DLP-FPGA Compact, versatile servo
controllers that offer USB,
8 I/Os: Digital I/O USB-to-Xilinx FPGA Module serial, and internal scripting
Analog In control.
Temperature
USB Port Powered
Single-Byte Commands
www.dlpdesign.com
Metal Gearmotors
Available in a wide range of
motor types and gear ratios
that let you choose the right
combination of size, torque,
and speed for your application.
AltIMU-10 Gyro,
Accelerometer,
Compass, and Altimeter
Provides ten pressure, rotation,
acceleration, and magnetic
measurements that can be
used to calculate absolute
orientation and altitude.
Every radio control plane flyer at some time has had a plane go down
outside of the airfield boundaries. Sometimes the location of the pre-
cious plane is easy and at other times they are hard to find. High grass,
trees or even uncertainty where the plane went down all make it hard to find
that elusive plane. So let’s build a radio direction finder (RDF) that ideally takes
you straight to the crash location.
There are a number of systems around used to • Battery backup in case of disconnection of
locate lost R/C models. I considered that I could the main battery
build a system that was a little bit better. The • Using commercial, type approved UHF ISM
concept specifications were: band radio modules
• Lightweight transmitter for the plane • Range at least 600 ft. (200 m)
• Receiver to be handheld and able to use
radio direction finding (RDF) to locate the
model.
Features
From this I was able to put to together the design
• low cost design described here. If you’re strong in model building
• TX board in SMD, RX board in T/H technology and flying, but not in electronics, consider doing
• Suits most 315/433 MHz ISM short range radio modules this project as a club activity.
• Programmable personal callsign on each TX
• Minimum range: 600 ft (200 m) Transmitter
• Maximum range: depends on terrain and TX and RX modules used Every country has a series of radio frequencies
• 4-element Yagi directional antenna on RX allocated to the Instrument, Scientific and Medi-
IC2
Usually you’d use steering diodes to automati- NCP1117ST50 D2
PMEG2010AEH
cally select the power supply. However with the 2 3
K2
low voltages used in this project (5 volts and 3.7 C4 +6V5...15V
1
1 JP2
the chip. They work quite well in steering the volt- 2
10u
10V MAX1811 Figure 2.
C1 4V2 1 SELV 5
BATT
ages of the batteries, and the voltage drop across
3
4
4V1
BT1
A possible charger circuit
100n 2 SELI
5 JP3 C3 for the LiPo/Li-Ion battery in
the transistor is just 100 millivolts. The only down 500mA
GND GND 1C
10u
side is that when the main battery is disconnected 100mA 10V
USB-B mini Li-ion/LiPo externally powered (6.5–
the backup battery takes over. Hence the backup 120139 - 13 15 VDC), or USB powered as
battery needs to be disconnected when the plane selected on JP1.
1k
3 D3
V+
9 1
+4V8 4 MD SEL LED1
18 batteries, rechargeable or dry, although three
5 D4
IC1 LED2
K1 6
5
IN LED3
17
16
dries should also work. Despite the transmit-
+4V8 7 LED4 D5
0 8
6
DIV HI LED5
15 ter’s datasheet claiming a maximum voltage of
R2 7 14
D6
9
10
REF OUT LED6
LED7
13 5 volts, the module has been tested to work up
LM3914 12
11 620R 8
LED8
11
D7 right up to 7 volts.
12 T1 REF ADJ LED9
13
4
DIV LO LED10
10
D8 The only other major item associated with the
14 R3 R4
V-
2N7000
MOD1 360R 2k7 D10
This antenna was chosen for its simplicity and its
Receiver
Module 120139 - 12
directional properties, a feature which will becomes
obviously necessary in the how to use section.
Building
The transmitter is built on a double-sided PCB COMPONENT LIST
using SMD components (Figure 5). It uses Transmitter
0.1’’ pitch pinheaders for all external connec-
Resistors
tions except possibly K3. The artwork may be R1 = 10kΩ 1%, SMD0805
downloaded free from [2]. The PICAXE may be R2 = 22kΩ 1%, SMD0805
soldered in but also mounted in a DIL-8 socket.
Semiconductors
Only solder in the two transistors if using the IC1 = PICAXE-08M2, programmed
battery backup version. Do not connect the RF T1,T2 = DTB123YK
module yet to the footprint marked K3.
Miscellaneous
At this stage you can test the transmitter driver K1,K2,K5 = 3-pin pinheader, 0.1’’ pitch
by connecting a piezoelectric transmitter between K3 = 4-pin pinheader, 0.1’’ pitch (optional, see text)
the data and ground pins that go to the RF mod- K4,BT1, 2-pin pinheader, 0.1’’ pitch
Transmitter module (on K3), ASK, 433MHz ISM band,
ule. After applying power you should be able to type approved, e.g. Quasar Electronics type QAM-
hear your callsign. TX1 (433 MHz), Farnell/Newark # 1304024. USA
The RF module may be connected to the board readers, use 315MHz equivalent
LiPo battery, 3.7V, 130mAh
with a short length of 4-way flatcable and using PCB # 120139-1 Figure 5. The Transmitter
pinheaders and mating IDC sockets. Alternatively,
board is double-sided
it may lie flat over the microcontroller board as
Receiver and takes SMD parts;
shown in Figure 6 (433 MHz version built by the Receiver board is a
Resistors
Elektor Labs). Make sure the solder sides of the single-sided design for
R1 = 1kΩ
board do not touch. R2 = 620Ω 1% through-hole parts. TX
The final part is the installation of a quarter-wave R3 = 360Ω 1% board shown at 150 % of
R4 = 2.7kΩ true size.
antenna. A piece of stiff wire about 173 mm in
length will do (I use one core of an Ethernet Capacitor
cable). When using a 315 MHz TX module the C1 = 100nF, 5mm or 7.5mm pitch
antenna length becomes 240 mm — remember,
Semiconductors
from (300/f)÷4. D1–D10 = LED, orange, 2.5x5mm rectangular, 20mA
The microcontroller board, RF module and backup T1 = 2N7000
IC1 = LM3914
battery (if used) may be wrapped in a short
length of shrink wrap tube. Miscellaneous
BZ1 = (not on board) piezo transducer, flying leads,
Farnell/Newark # 1193640
The receiver PCB design is also shown in Fig-
K1,K2,(BZ1) = 2-pin pinheader, 0.1’’ pitch
ure 5. This is a single sided board for TH compo- (MOD1) = 15-pin pinheader, straight, SIL, 0.1’’ pitch
nents so it should be plain sailing. Insert and sol- MOD1 = AM SuperHet Receiver, QAM-RX3 (433MHz),
RS Components # 742-4484. USA readers, use
der all the parts into the PCB. The radio module is
315MHz equivalent
mounted vertically. The board and battery holder Battery holder for 3 or 4 AA(A) batteries, see text
for three (or four) AA(A) cells may be mounted on PCB # 120139-2
the Yagi boom behind the reflector. The radiator
(dipole) elements of the Yagi antenna should be
connected to the input of the radio module with building club may be persuaded to produce a few
a length of thin 50-Ω coax cable like RG174/U or sophisticated antennas for members. The author
/CU. Keep the length to an absolute minimum to made the radials from coat hanger wire, although
prevent excessive losses. Resist the temptation any stiff wire will do, like electrical installation
to use screened audio cable. wire. Try to cut the radials to the lengths shown
in the drawing in Figure 8 (dimensions for 433
The (optional) charger is built on the board MHz). The author’s prototype was made from
shown in Figure 7. Do not forget to fit the jump- some 3-mm (1/8 in.) corrugated plastic sheet
ers according to your requirements. (corflute; corriboard; Polyflute), with the radi-
als inserted into the cores. The spacing does
The 4-element antenna is all-homebrew. Var- not work out exactly, but works well in practice.
ious designs are around on the Internet, and Elektor Labs built their Yagi antenna from a 570 x
mechanically skilled members of your local model 53 x 12 mm piece of wood and lengths of 2.5 mm2
Testing
Fortunately there is no calibration required. Leave
the transmitter off at this stage. Turn on the
receiver and you should hear white noise with
the occasional pop. The LED indicator should be
showing the lowest LED on.
Turn on the transmitter. You should now hear your
callsign, and the bar graph should be moving up
Figure 6. and down in synchronization with the tones of the
LiPo Charger board (left) call sign. The bar graph should go to full scale
and TX assembly (right). when the transmitter and receiver are within 10
The PICAXE board and the feet or so (3 m) of each other.
transmitter module may
be connected without a In use
cable, simply by bending It’s going to take a little practice in order to
and soldering the four
successfully use the Lost Model Finder. It’s best
pins straight to K3.
to initially have a friend hide the transmitter
in a park or garden and then try and find the
csa electrical installation wire (introductory pho- transmitter.
tograph) fitted at the exact positions from Fig- The antenna is directional and the ‘sharp‘ end
ure 8. The boom is long and wide enough to hold is the end with the greatest sensitivity. When
the RX board and the battery holder. This antenna looking for the transmitter, hold the antenna in
should have about 7 dB gain, allowing the TX to be front of you and rotate a full circle. Listen for
found at a distance of about 1,000 feet (300 m) your call sign to make sure you’re chasing your
in a built-up area as Labs were able to measure transmitter. The bar graph will indicate where
in and around their location at Elektor House. the maximum signal is. Walk in the direction of
Connect the dipole elements of the antenna to maximum. Continue doing this, stopping occa-
the receiver via the previously installed cable. sionally to check your bearings. You should see
Sticklers for nanovolts may want to add a balun that the bar graph increases.
for proper matching of the symmetrical radiator At some point you will get close to the transmit-
to the asymmetrical coax cable, but in this case ter and the bar graph will be at maximum. Now
the work and cost may defeat the purpose. point the insensitive (‘blunt’) end of the antenna
in the direction where you think the transmitter
is. Now when you rotate the antenna around you,
you are not looking for the maximum signal but
COMPONENT LIST
the minimum signal. You’re sort of sneaking up
LiPo Charger (optional)
from behind.
Resistor You can also change whether you hold the
R1 = 1.5kΩ SMD 0805 antenna radials parallel to the ground, or per-
Capacitors
pendicular, or any other orientation.
C1 = 100nF SMD0805 X7R The last few ten feet or so are the hardest in
C2,C3 = 10µF 10V, SMD 0805, X7R finding a plane, especially one lost in vegeta-
C4 = 10µF 25V, SMD 1206, Y5V
tion or scrub. Also don’t forget to look up to the
Semiconductors tree top canopy! You never know where these
D1 = LED, red, SMD 0805 models are hiding.
D2 = PMEG2010AEH, Farnell/Newark # 1510673
(120139)
IC1 = MAX1811ESA+, Farnell/Newark # 1593327
Figure 7. The charger IC2 = NCP1117ST50T3G, Farnell/Newark # 2112617
board is a double-sided [1] Dave’s EEVBlog # 204:
design for surface mount Miscellaneous
K1 = mini USB receptacle type B, SMD www.youtube.com/watch?v=iIKGvHjDQHs&fe
components. K2,(BT2) = 2-pin pinheader, 0.1’’ pitch ature=player_embedded)
JP1,JP2,JP3 = 3-pin pinheader, 0.1’’ pitch, with
jumper [2] Project page:
PCB # 120139-3 www.elektor-magazine.com/120139
Figure 8.
Experimental Yagi antenna
with the receiver electronics
attached on top of the
wooden ‘boom’, behind the
reflector. The directors,
radiator and reflector
were made from electrical
installation wire (c.s.a.
I
around 2.5 mm2 / 13AWG)
and secured to the wooden
A B C D boom with tie wraps — after
A = 30 mm carefully centering on the
B = 124.4 mm boom, of course. For safety,
C = 138 mm the radial ends should be
E = director #2, 307.9 mm* covered with a blunt object
F = director #1, 310.8 mm* or some putty.
G = radiator, 2 x 163.5 mm* Gain is approximately 7
E F G H H = reflector, 338 mm* dB. For 315 MHz use, the
I = boom, 570 mm element spacing and lengths
* 2.5mm2 / AWG 13 wire should be scaled up by a
factor 1.37.
Advertisement
FREE Stencil
with every prototype order
Embedded RFID
authenticate, track & protect
your product
N EW ! www.magic-pcb.com
www.pcb-pool.com
Lithium-ion Battery
Recycling Made Easy
meaning: without a microcontroller
By Fons Janssen
(Maxim Integrated,
The Netherlands)
Like most people, you probably have some old The original equipment usually contains a special
equipment lying around that uses a Li-ion battery charger circuit for the battery, most likely on a
for the supply. This type of battery has been used small part of the PCB in the equipment. It is dif-
in most portable equipment produced in the last ficult to figure out which components are part
few years because it can be easily made in various of the charger circuit since no circuit diagram
sizes and shapes, whilst it also has a relatively is normally made available for portable equip-
large capacity (compared to NiMH and NiCd). ment. In that case we’ll just have to build our
What can you do with that old MP3 player or own Li-ion charger!
mobile that’s been replaced by a newer, better
version? The electronics can usually not be used The circuit
for any other purpose, but that battery can still The charger circuit described in this article is
come in useful, even if it’s for use in a toy. Since built around a Li-ion charger IC made by Maxim
electronics hobbyists tend to be an inventive lot (MAX8677A, see the block diagram in Figure 1).
they will usually find a way to incorporate and This IC works completely autonomously so that
connect a recycled battery. The author, for exam- there is no need for a microcontroller (and hence
ple, has built a Li-ion battery into a Lego train to no software!). A number of LEDs is used by the
replace three penlight cells (see the main photo). IC to indicate the state of the charging process.
This still leaves the need to charge the battery. The IC is very flexible and contains a ‘smart
USB1 R1 R2 R5
1 4k7 4k7
+5V 4k7
2
D– C1 D1 D2 D3
3
D+
4 2 3 17 18
ID 4u7
5 DC DC BAT BAT
GND 1 24
DONE FLT
Mini USB R3
4 23
CEN UOK
IC1 R4
560k
5 22
PEN1 DOK
C2 560k
6 19
PEN2 CHG
20 FS1
100n SYS
8 21
VL SYS
R7 16
C4 MAX8677AETG+ USB
10 15 T3A
CT USB SYSTEM
68n 14
TSET
10k 12 13
NTC THM USUS
PSET ISET GND EP
NTC 7 11 9 25 BATT1
R8 R6 R9
*
C3
Figure 3.
4u7
10k 3k3 5k6 The complete charger circuit
130117 - 11 consists mainly of the
MAX8677 and a mini-USB
connector.
The battery is being charged (LED D3), the bat- You can obviously select more suitable values
tery is fully charged (LED D1), or the battery is depending on the power rating of the adapter,
faulty (LED D2). the power consumption of the device and the
There are two current limits that can be set with desired load current. The IC can provide a maxi-
this IC: one for the maximum charge current and mum charge current of 1.5 A.
one for the maximum input current. It’s clear that We’ve used a mini-USB connector, which makes
the second value should always be larger than it easy to power the circuit with contemporary
the first. If this isn’t the case, the programmed mains adapters. This also ensures that we’re
using a 5 V supply. The maximum input current
should be adjusted according to the rating of the
Component list adapter. The circuit will function just fine when
Resistors the adapter can provide a current of at least 1 A.
(default: SMD0603)
R1,R2,R5 = 4.7kΩ Is there an NTC?
R3,R4 = 560kΩ
R6 = 3.3kΩ Batteries are often provided with an NTC, which
R7 = 10kΩ is used to prevent them being charged at tem-
R8 = 10kΩ (only if NTC in battery) peratures that are too high or too low. The bat-
R9 = 5.6kΩ
tery therefore has three connections: a positive
Caoacitors terminal (BAT+), a negative terminal (BAT-) and
(default: SMD0603) a connection for the NTC (see Figure 4). You
C1,C3 = 4.7µF (SMD0805) should be aware that some batteries with three
C2 = 100nF
C4 = 68nF connections have only a normal resistor inside
that is used for identification. Its value will be
Semiconductors constant, so won’t vary with the temperature of
D1 = LED, green, 3mm
the battery.
D2 = LED, red, 3mm
D3 = LED. yellow, 3mm When an NTC is used it should be connected
IC1 = MAX8677AETG+ (24-pin TQFN) between the THM pin and ground (via the BAT-
connection). A resistor (R7) is also connected
Miscellanous
between the THM pin and a reference voltage
USB1 = mini USB connector, PCB mount, SMD,
(e.g. Molex 67803-8020, RS Components # (VL), which creates a potential divider. The value
720-6618) of the resistor is chosen such that it has the same
value of the NTC at a temperature of 25 °C. The
FS1 = fuse, SMD, rating dependent on battery
(e.g. LittleFuse nanofuse 3 AT, Farnell/Newark # voltage at the THM pin at 25 °C will then be equal
1596930RL) to 0.5 VL. When the temperature rises/falls, the
Print artwork # 130117-1 from [2]
resistance of the NTC falls/rises as will the volt-
age at the THM pin. The IC will only charge when
Figure 5.
this voltage is between 0.28 VL and 0.74 VL. With
The PCB designed for this
charger has been kept as contemporary NTCs this corresponds to a tem-
small as possible to make perature between 0 °C and 50 °C. When no NTC
it easier to build it into is available you should add R8, which causes the
existing equipment. voltage at the THM pin to be 0.5 VL.
Connection tips
If you’re reusing a cellphone battery it will already Soldering a TQFN by hand
have a protection circuit as standard, which pro- Mounting the IC with a hot
tects the battery from overloads and from being air soldering iron is possible
discharged too deeply. However, if you want to if you’re experienced enough,
use a single cell, for example from a battery pack although a reflow oven
from an old laptop, then you will have to make a
makes life much easier.
your own protection circuit. The circuit inside 1.50mm
A compact PCB has been designed for this proj- been soldered properly we
ect, which uses a large number of SMDs (see turn over the board and drop a few pieces of solder into the hole (d).
Figure 5). This keeps the PCB very small, which Find a piece of solid copper cable that fits snugly in the 1.5 mm hole
makes it easier to build into the device. The board (one of the cores in a solid core mains cable would be a good choice)
layout (made using DesignSpark) is available as and use a file to make one of the ends completely flat. Put this end
a free download from [2]. through the hole and heat it up using the soldering iron (e). At some
You will need some dexterity and soldering expe- point the piece of copper wire gets so hot that the pieces of solder in
rience in order to mount the SMDs. For the TQFN the hole start to melt. The copper wire will then drop down slightly and
packaged IC you should ideally use a reflow oven, makes contact with the exposed pad of the chip. Then solder the piece
since the pins and the exposed pad are on the of wire to the ground plane on the solder side of the PCB (f).
underside of the 4x4 mm package. However, the You will now have a good electrical and thermal connection between
author has thought of a method that can be used the exposed pad of the chip and the ground plane on the solder side of
to solder the IC by hand, which is described in the PCB.
detail in the inset. There are holes on the PCB
for the connections to the LEDs, battery and the
load, so they can be connected easily via wires.
Internet Links
The mini USB connector has two plastic pins that
fit in the associated holes on the PCB, providing [1] http://datasheets.maximintegrated.com/en/
alignment of the socket. If you don’t want to use ds/MAX8677A.pdf
the mini USB connector you can use these two [2] www.elektor.com/130117
holes for connecting the power. In this case you
have to make sure that the supply voltage is 5 V.
(130117)
By Clemens Valens Although it’s perfectly possible to design FPGA applications using schematic dia-
(Elektor.Labs)
grams with logic symbols, in practice this is usually done with a hardware descrip-
tion language. An advantage of the latter approach is that complex functions are
often easier to express in algorithms than in schematics. Accordingly, in this in-
stallment we guide you through the process of programming an FPGA application.
In the previous installment [4] we took a cautious ilog instead, but it reflects the fact that simula-
initial look at the hardware description languages tion often takes longer than synthesis, so in the
VHDL and Verilog for testing an application. In this end you’re done faster. To draw an analogy with
final installment we delve into hardware descrip- computer programming (Verilog fans should look
tion languages more extensively – in this case, the other way and plug their ears at this point),
to define an application. However, working with instead of just throwing together a bit of code and
two languages is too difficult, so I had to make a then using the debugger to turn it into a working
choice. After many sleepless nights and consult- algorithm, you can first spend some time thinking
ing dozens of experts, I ultimately decided to cast about your algorithm and then use the debugger
my lot with VHDL. There are various reasons that to make sure it works properly.
can be given for this choice. One is that VHDL The application I have chosen here is a DCF77
should require less simulation time because it is decoder. I can hear the snide remarks already,
more difficult to arrive at a synthesizable design. but there are good reasons for this choice. The
That might sound like a reason for choosing Ver- radio signal from the DCF77 atomic clock broad-
cast station near Frankfurt in Germany can be do for each clock pulse
received on 77.5 kHz easily in virtually all of {
Europe with an inexpensive module. The signal counter = counter + 1
coding is fairly simple – it consists of a sequence if (counter == 150ms)
of 59 pulses (one per second) which can have {
two different lengths (100 ms for “0” or 200 ms
shift
_register = (shift_register << 1) + input_signal;
for “1”), which collectively represent the bits of
}
the time code. The end of the code sequence
if (rising_edge(input_signal) == true)
is marked by omitting the final pulse (number
{
60, corresponding to bit 59). A new code is sent
every minute. The date and time are in BCD for- if (counter >= 1750ms)
mat, and there are several check bits that can be {
used to verify the validity of the data. This signal show_content(shift_register);
is a good starting point for a project with VHDL }
(or Verilog) because it is relatively easy to show counter =;
the results on a 7-segment display with simple }
logic. For those of you who do not have a DCF77 }
receiver or who cannot receive the signal because
they live too far away from Frankfurt, we have The counter is incremented on each clock pulse.
written a DCF77 simulator program for Arduino When the counter reaches 150 ms, the input sig-
[5]. That way everyone can join in. nal is sampled and the sample is fed to the shift
Let’s start with a functional design for a DCF77 register. When a rising edge is detected in the
decoder. Here we take the ‘naïve’ approach, which input signal, a test is made to see whether the
means we assume that the input signal will usu- counter has exceeded the maximum value. If it
ally be good and will stay nicely within specifica- has, the shift register is full and the data can be
tions. Thanks to this assumption, the design can displayed. After this the counter is reset to 0.
be fairly simple. That’s all there is to it. You could add all sorts of
As previously mentioned, the input signal consists bells and whistles to this, such as error detection
of pulses with lengths of 100 ms and 200 ms, and more robustness, but that falls outside the
which represent zeros and ones respectively. If you scope of this introductory example.
sample the input signal at a point 150 ms after the
rising edge of each pulse, you will thus see either How do you do this in VHDL?
a ‘0’ or a ‘1’ (Figure 1). If you also measure the Doing the same thing in VHDL is fairly easy
time between two successive rising edges, you because translating pseudocode into VHDL is
can detect the missing pulse and therefore iden- straightforward. The result is the following code
tify the start of the time code. The bits that are fragment:
found in this manner are fed into a shift register.
Then the BCD sequences that encode the various 1 process (clock) is
date and time units are extracted from the shift 2 begin
bit string in the shift register and presented on the 3 if rising_edge(clock) then
7-segment display. In the C-based pseudocode, 4 counter <= counter + 1;
this looks roughly as follows: 5 if (counter=t150ms) then
Figure 1.
The DCF77 signal and
sampling points.
6 bits <= input & bits(58 downto 1); value of the input signal is fed into the bits
7 end if; shift register in line 6. This is done from the left
8 if input_rise=’1’ then end of the shift register, unlike the pseudocode
9 if (counter>=t1750ms) then where it is done from the right. We chose this
10 data <= bits; approach because the time code starts with the
11 end if; least significant bit, so the bits are fed into the
12 counter <= 0; shift register in the right order for our purpose.
13 end if; After 59 pulses, bit 0 is at position 0. The shift
14 end if; operation looks a bit strange because the con-
15 end process; catenation function “&” is used for this purpose.
This function simply joins the left part of the
The definitions and a bit of VHDL syntax are miss- expression to the right part. Here the right part
ing here, but the algorithm is there. I added the consists of the 58 bits from 1 to 58 (in reverse
line numbers here because they make it easier to order, without bit 0), which are shifted to posi-
explain how the code works. In this code, coun- tions 57 to 0. The left part is the 1-bit input sig-
ter is self-explanatory and bits are the stages nal, which now ends up in bit 58. The details of
of a 59-bit shift register. Let’s start at the top what ISE (or actually XST) does with this con-
with line 1. struction are not so important here; what mat-
ters is that it works (and it does).
This is a process, which means that it will be Line 8 checks to see whether a rising edge has
executed by the FPGA. Nothing happens without been detected in the input signal. Exactly how
a process. There can be multiple processes, and that works is not obvious from the code fragment
they are all executed at the same time. Within (I’ll explain this later), but if a rising edge has
a process, the order of execution is normally top been detected, line 9 checks whether the counter
to bottom. Our process is dependent on the sig- has exceeded the maximum value of 1750 ms. If
nal clock, which means that the process is only it has, the content of the shift register is copied
executed when the value of clock changes. The to a data register for further processing, which
process starts after line 2 and runs until line 15. is done in another fragment described below.
Line 3 causes everything in the process to be Line 12 resets the counter to zero. It is not nec-
synchronized to the rising edge of the clock sig- essary to flush the shift register, since it is com-
nal. This is made possible by the function ris- pletely filled every minute.
ing_edge. You will often see the following con-
struction in VHDL code: The lines not specifically mentioned here are only
there to conform to VHDL syntax rules.
if clock’event and clock=’1’ then To complete this fragment, all you need is an
.. edge detector, some VHDL syntax glue, and the
end if; specifications of the input and output signals for
this process. In the final design I also added a
This does the same thing as rising_edge, but it couple of signals that blink the LEDs on the FPGA
is a bit old-fashioned. Here we use rising_edge. board so you can see whether something is actu-
There is also a function called falling_edge. ally happening inside the FPGA.
The counter is incremented by 1 in line 4. Easy,
isn’t it? Yes, but you should be careful because Edge detection
whenever you use the increment function, The edge detector is a key part of this design.
which is represented by the “+” sign, you have At first I used a simple scheme that compared
to include the numeric_std library in the list of the current value of the input signal with the
libraries to be used (as described elsewhere in value during the previous clock pulse. This was
this article). not reliable and caused problems, with the result
that synchronization was occasionally lost. The
In line 5 the counter value is compared to a con- solution turned out to be adding another flip-flop
stant that corresponds to an interval of 150 ms so that instead of comparing the current value
with a clock frequency of 8 MHz (the FPGA clock with the previous value, we compare the previ-
rate). If the counter is at 150 ms, the current ous value with the one before it. In other words,
entity dcf77_decoder is
The edge detector is only active after a rising
port ( input : in std_logic;
edge of the clock signal. When that happens, it
clock : in std_logic; determines the value of the output signal rise
data : out std_logic_vector (58 downto 0) ); from bits 2 and 3 of history, and then feeds the
end dcf77_decoder; current value of the input signal into the shift
register in the same way as the code fragment
architecture behavioral of dcf77_decoder is for the DCF77 decoder.
Figure 2.
This bizarre schematic
is the result of letting
ISE’s RTL Viewer draw the
schematic diagram of the
edge detector described in
this article (Design tab,
Synthesize – XST ➞
View RTL Schematic).
The signal input is not
connected to anything, and
the operation of this circuit
is a complete mystery to
the author. Maybe he got
something wrong?
use a port map to indicate which signals (ports) clock period when a rising edge is detected in
of the DCF77 decoder on the right in the folder the DCF77 signal.
must be linked to the signals (ports) of the edge If you forget to map an input signal of a com-
detector on the left in the folder. The clock and ponent, you will see a rather baffling error mes-
input signals are already taken care of because sage. It tries to explain that the forgotten signal
they are inputs (ports) of the DCF77 decoder does not have a default value and may therefore
as part of the entity block. You have to add a remain unconnected. Don’t say I didn’t warn you.
local signal of the same type for the edge detec-
tor output signal rise. Here I gave it the name Display
input_rise. Now you can use this signal in your Articles of this sort tend to be long because I
process. It will assume the value “1” for one try my best to explain everything properly, but
Figure 3.
An ISE screenshot showing
the code for the display
and the project hierarchy,
along with the green check
marks which prove that
it’s possible to compile the
project and generate a bit
file.
my editor is not especially Listing 3. The top level of the final DCF77 decoder.
fond of long articles. Nev-
ertheless, I want to explain library ieee;
in an article how you can use ieee.std_logic_1164.all;
produce a working VHDL
design, since otherwise the entity top is
task is a bit frustrating. As port ( dcf77_input : in std_logic;
I still have a lot to explain, clk_in : in std_logic;
I am omitting the code for hour_month : in std_logic;
the 7-segment display time_date : in std_logic;
from this article. I used
led1 : out std_logic;
the same two-digit display
led2 : out std_logic;
as in the third installment
t_sample : out std_logic;
[3], with a BCD to 7-seg-
digit1 : out std_logic_vector (6 downto 0);
ment decoder as described
there. This is a standard digit2 : out std_logic_vector (6 downto 0) );
textbook exercise, so there end top;
is no need to explain it in
detail. Have a look at the architecture behavioral of top is
project for this installment
[5] to see how it all works. component two_digit_display is
Figure 3 also shows a few port ( bcd1 : in std_logic_vector (3 downto 0);
details. bcd2 : in std_logic_vector (3 downto 0);
digit1 : out std_logic_vector (6 downto 0);
Back to the top
digit2 : out std_logic_vector (6 downto 0) );
As in the previous install-
end component;
ments, everything comes
together at the top, but
now the top is a VHDL component dcf77_decoder is
module instead of a sche- Port ( input : in std_logic;
matic diagram. This detail clock : in std_logic;
must be communicated to tick : out std_logic;
ISE in the Design Prop- sync : out std_logic;
erties. First create a new data : out std_logic_vector (58 downto 0) );
project based on the previ- end component;
ous one, in the same way
as described at the start of
signal data : std_logic_vector (58 downto 0);
the third installment [3].
signal bcd1 : std_logic_vector (3 downto 0);
Then delete all schemat-
signal bcd2 : std_logic_vector (3 downto 0);
ics, but keep the UCF file.
signal tick : std_logic;
Next, open Design Proper-
ties (e.g. at the bottom of
the Project menu) and set begin
Top-Level Source Type to display: two_digit_display port map (bcd1 => bcd1,
“HDL” and Preferred Lan- bcd2 => bcd2,
guage to “VHDL” (if this
isn’t already done).
Now you will see a form that you can fill in if you
Now you can start adding new source files. To know which input and output signals you need.
do this, open the Project menu or right-click the If you don’t know, leave the form blank. When
Design tab and select New Source…. Then select you’re done, click Next and then Finish. ISE will
VHDL Module, enter the file name (e.g. top), ver- create a file for you, containing the template
ify that Add to project is ticked, and click Next. where you have to add your VHDL code. Add as
else
and one instance of each
of them is used. With a
-- Show date.
larger display, such as six
if hour_month=’1’ then
digits, you could generate
-- Show month.
and link three instances
bcd1 <= data(48 downto 45); of two_digit_display ,
bcd2 <= “000” & data(49 downto 49); each with its own label.
else For linking the two com-
-- Show day of month. ponents, I defined several
bcd1 <= data(39 downto 36); additional signals that are
bcd2 <= “00” & data(41 downto 40); not needed outside the
end if; top module. For example,
end if; the tick signal is used to
end if;
blink LED1 each time a bit
is received. Since this LED
end process;
is not connected to a pin
on the FPGA board, it is
end behavioral;
also linked to the t_sam-
ple signal, which in turn
is linked to pin P86 in the
many files as the number of modules you intend UCF file. This makes it easy to view the sampling
to generate. In the present project there are points on an oscilloscope relative to the DCF77
five: top, DCF77 decoder, edge detector, BCD to input signal.
7-segment decoder, and 2-digit display.
The process of the top module does not do any-
The top module is shown in Listing 3. The names thing especially remarkable. It is actually a mul-
Web links
[1] Part 1: www.elektor.com/120099
[2] Part 2: www.elektor.com/120630
[3] Part 3: www.elektor.com/120743
[4] Part 4: www.elektor.com/130065
[5] Part 5: www.elektor.com/130066
ISBN 978-1-907920-18-9
New Website Is Online! 193 pages • $40.00
NEW!
Better Design
Ez
More Powerful
PC
Easier to Use
B
Instant Quote & Pay
1 to 40 Layers
Prototype to Production
Amateur to Professional
order now
The Python language is particularly suited to engi- functions. The second line shows three functions
neering environments. Often it is advantageous imported from the Numpy extension.
to represent data graphically. The saying that a The ‘linspace’ routine can be used with an interval
picture is worth a thousand words is also true (here from 0 to 7) divided into an equal number
in the world of mathematics; an engineer can of parts (1,000 here) and represented as a vector
interpret so much more from the plot of a curve (array). This enables a fast and simple calculation
compared to a column of sterile mathematical of the value of the function. Numpy functions can
values. As a rule popular programming languages also handle vectors. Using just the line:
already feature tried and tested library routines
to ease the writing process. Python is no excep- y= sin(5*x)*exp(-x)
tion to this rule.
Calculates all 1,000 values of the y vector.
Plotting graphs This relieves you of the more usual ‘For’ loop
In Python the standard library for 2D graph plot- constructs and makes the code both fast and
ting is ‘Matplotlib’. Part of the Python philosophy understandable.
is summed up in its motto ‘There is only one way’ The command ‘plt.plot(x,y)’ plots the data as a
suggesting that there should only really be one curve on the graph and ‘plt.show’ is used to show
obvious way to achieve something in Python. it on the graph. To display more than one curve
This does not unfortunately apply to the mod- on the chart as shown in Listing 2 it is necessary
ules written in the additional libraries, a discov- to call the plot function again.
ery that has already cost me many hours work. The graph window (Figure 1) automatically shows
Notably in Matplotlib there exist simple proce- a toolbar which allows you to zoom and save the
dural interfaces and complicated object orientated chart. Apart from this it also indicates the cur-
interfaces. Examples given in books and on the sor coordinates. Should you want to spice up the
Internet use either one method or the other so graph with some GUI elements then it will be
it is quite easy to get confused. necessary to proceed using an object oriented
The simple interface ‘pyplot’ facilitates very sim- approach.
ple programming. The program in Listing 1 pro-
duces a damped sine wave oscillation. The curve Example: frequency response
it describes is shown graphically in a display win- As an example we can plot the transfer function of
dow (Figure 1). a simple RC low pass filter. The transfer function
The first line of the listing imports the interface shown here is a result of an RC voltage divider
‘pyplot’ as the object ‘plt’. ‘Numpy’ is an exten- network consisting of a resistor and capacitor
sion to python providing support for mathematical which has a complex impedance:
F = 1 / (1 + j ω R C)
Listing 1: Sinewave.py
The frequency response is given by a plot of import matplotlib.pyplot as plt
the value of F as a function of frequency (Fig- from numpy import sin, exp, linspace
ure 2). This is a good example to demonstrate
how Python handles complex variables.
x=linspace(0.0, 7.0, 1000)
In this program (Listing 3) the Array ‘f’ is calcu-
y= sin(5*x)*exp(-x)
lated with frequency steps incremented logarith-
mically. For plotting against linearly incrementing
plt.plot(x, y)
values use ‘linspace()’. An array for the complex
F values is calculated along with an array of the plt.show()
absolute values ‘Fabs’. Numpy is useful here with
its vector functions. There is no requirement for a
‘For’ loop in the calculation and the code is both
short and understandable.
Finally the plot is displayed, showing a logarith-
mically scaled frequency axis. For a professional
looking result it is important to define the grid
lines:
Listing 3: RC.py
import matplotlib.pyplot as plt
from numpy import pi, linspace, log10, logspace # calculate F (complex) and absolute value Fabs
from numpy import complex, abs # these allow F = 1 / (1 + 1j* 2 * pi * f * RC)
vector operations Fabs = abs(F)
are plotted on a two dimensional graph. The X of the App objects. Next a Frame object creates
and Y values are also displayed in the form of a window for the application. This window will
two columns. have a menu and text box to enable editing and
In this example I have abandoned pure ‘Pythonic’ display of the data. The Text-Box is essentially
object orientated style for the sake of simplicity. a small editor: here you can edit data or enter
After the necessary modules are imported all the new values, and the clipboard can be controlled
functions are defined and ‘main’ is at the end of using the standard key-sequence shortcuts. A
the program listing. right-click on the mouse pops up the classic edi-
The main program begins with an instance ‘app’ tor functions.
Listing 4: Fourier.py
“””FOURIER SYNTHESIS OF A SQUARE WAVE””” harmonics
#------------------------------------------------- ug = zeros(nb_points)
------- uharm = zeros((nb_points, n+1))
# EDIT HERE
# harmonics and total voltage
n = 30 # number of harmonics for i in range(1,n+1):
nb_points=1000 # horizontal resolution ai = calc_amplitude(amplitude, i)
frequency = 100.0 #Hz fi = frequency * i
amplitude = 2.0 #V uharm[:,i] = ai * sin(2 * pi * fi * t )
ug = ug + uharm[:,i]
# END OF EDIT AREA return uharm, ug
#------------------------------------------------- #-------------------------------------------------
-------- ----------
print “Importing modules” “”” Main program”””
import matplotlib.pyplot as plt
from numpy import sin, exp, linspace, pi T=1/frequency
from numpy import zeros
#------------------------------------------------- # equally spaced time array for 1 period
--------- t = linspace(0.0, T, nb_points)
def calc_amplitude(amplitude, i):
“”” Calculate amplitudes of harmonics””” # plot harmonics
# take only odd harmonics uharm, ug = calc_harmonics(nb_points, n)
if i % 2 == 0: for i in range(1,n+1):
ai = 0 plt.plot (t, uharm[:,i])
else:
ai = (4/pi)*amplitude / i # plot resulting voltage
return ai plt.plot (t, ug)
#-------------------------------------------------
-------- s=str(n)+” harmonics, “+str(frequency)+”Hz,
def calc_harmonics(nb_points, n): ampl.=”+str(amplitude)+”V”
“”” Calculate harmonics and resulting voltage plt.title(“Fourier synthesis RECT\n”+s)
returns plt.xlabel(“t/s”)
uharm = array nb_points * n plt.ylabel(“u/V”)
ug = array nb_points
“”” # make plot visible
plt.show()
# init arrays for resulting voltage and
Listing 5: Dataplot.py
#!/usr/bin/env python
“”” Plot data from file “””
import wx
import os.path
import matplotlib.pyplot as plt
def create_menu(frame):
# create menu
menubar = wx.MenuBar()
# main menus
mnuFile = wx.Menu()
mnuData = wx.Menu()
menubar.Append(mnuFile,”&File”)
menubar.Append(mnuData,”&Data”)
# submenus
m_Open = mnuFile.Append(-1,”&Open”)
mnuFile.AppendSeparator()
m_Exit = mnuFile.Append(-1,”&Exit”)
m_Plot = mnuData.Append(-1,”&Plot”)
# attach menu to frame
frame.SetMenuBar(menubar)
def OnOpen(event):
# ask for filename
dlg = wx.FileDialog(None,”Open data file”, os.getcwd() ,””, “*.*”, wx.OPEN)
dlg.ShowModal()
filename = dlg.GetPath()
def OnPlot(event):
# plot data
x,y = fill_xy_with_values(textbox)
plot_xy(x, y)
#-----------------------------------------------------------------------
def fill_xy_with_values(textbox):
# “”” get values from textbox
# returns arrays x, y and number of data points”””
text=textbox.GetValue()
lines=text.splitlines()
x=[]
y=[]
for line in lines:
columns = line.split() #separator can be one or more “ “ or “\t”
x.append (float(columns[0]))
y.append (float(columns[1]))
return x,y
#-----------------------------------------------------------------------
def plot_xy( x, y):
“”” Plot arrays x, y with matplotlib”””
plt.figure(1)
plt.subplot(111) # 1 row, 1 col, plot nb. 1
plt.grid(True)
plt.plot(x, y)
plt.xlabel(“x”)
plt.ylabel(“y”)
plt.show()
#-----------------------------------------------------------------------
# Main
#-----------------------------------------------------------------------
app = wx.App()
# create frame
frame = wx.Frame(None, title=’PLOTTER’, pos=(350,300))
create_menu(frame)
# editor textbox for data
textbox=wx.TextCtrl(frame, style = wx.TE_MULTILINE)
Check out
www.elektor-labs.com
and join, share, participate!
Beefing up
DAC Resolution
By Olivier Schrevens
(France)
More accuracy on your 8-bit conversions
When you need resolution higher than 8 bits, the cost of mixed analogue/digital
devices increases sharply. I wanted to show how, at no additional cost, I’ve im-
proved the resolution of ordinary, cheap digital/analogue converters, by using the
output of one as a programmable voltage reference for the others.
The principle of cascading specific output resistor for each voltmeter, I used
D/A converters: the circuit described here to increase the resolu-
the output of the first tion obtained using 8-bit converters. Instead of
converter is used as the using voltage amplification, the trick consists in
voltage reference for the
100510 - 12
being validated all together by the LDAC What’s more, by virtue of its architecture, this
signal, the SPI commands received by digital/analogue converter is more like a pro-
each of the converters in turn can be first grammable potentiometer than a conventional
stored in a latch. This option is not used DAC based on an R2R network.
here. You can find further details in the As this trick works really well without the need
device datasheet. to add any extra devices, I wanted to share it
with Elektor readers. The test program [1] loops
As the circuit shows, the TLC5628 has two sepa- each of the three maximum output voltages onto
rate voltage reference inputs (pins 11 and 14), output E (pin 7) for four seconds. The SPI clock
one for each group of four converters. is 11.0592 MHz/4. The SPI bus is in mode 3. An
indication of the running of the program is pro-
The external voltage reference common to the vided via the serial port (38,400 baud, 8N1).
first four converters, here 1.235 V, provided
by D1, an LM385, is connected to one end of (100510)
the dividers, whose other ends are connected
Internet Link
to ground. Hence each of the divider positions
provides a voltage that is directly linked to the [1] www.elektor.com/100510
reference voltage.
0 to 1.235 V
0 to 2.47 V
0 to 4.94 V
• “Yes, that could be interesting.” I started off with the vintage GRC meter. Since
the apparatus is older than I am and ‘less than
• “I can bring a vintage meter from my intuitive’ in terms of operation — at least to me
Retronics stock, if you like.” — I first needed to take a look at the manual. It
took me quite some time to dial into the thing
• “Awesome. Let’s see how the three and get an accurate measurement readout. Here’s
compare!” a breakdown:
This recent coffee chat I had with a few col- • read the manual: 10 mins;
leagues at Elektor HQ resulted in me putting • figure out how to measure a capacitor
three LCR Meters with a completely different correctly: 5 mins;
background through a quick hands-on test. • taking the actual measurement (setting the
dials for ‘zero’ deflection): 3 mins.
The Hameg meter (HM8118 [1], courtesy of
Rohde & Schwarz Netherlands [2]) is a profes- To be fair, if you were to use the 1650-A on a
sional instrument with a price tag of $2,000+. daily basis, you would probably be able to shave
off 80 % of the time needed for a single mea-
The vintage meter from the Retronics dept. is surement. Still, that’s over half a minute per
a General Radio Company (GRC) type 1650-A measurement. I have to admit though, the looks,
Impedance Bridge manufactured in 1960, cost- touch and feel of the sturdy dials and switches do
ing a whopping $1,000 back then [3]. add to the character of this piece of equipment.
Comparison chart
DUT GRC 1650-A Hameg HM8118 Elektor LCR Meter
8.2458 Ω 8.2379 Ω
Resistor 8.2 Ω 8.22 Ω (Vx=31,86 mV, (Vm=31.13 mV,
Ix=3.862 mA) Im=3.779 mA)
102.03 nF 102.20 nF
D: 0.01205 D: 0.013
100 nF
Capacitor 100 nF Rs=19.20 Ω Rs=19,20 Ω
D: 0.0267
(Vx=364.9 mV, (Vm=398.1 mV,
Ix=233.9 µA, 1 kHz) Ix=256.0 µA, 1 kHz)
94.475 µF 92.400 µF
D: 0.10099 D: 0.090
92 µF
Capacitor 100 µF Rs=170.27 mΩ Rs=155.4 mΩ
D: 0.1
(Vx=7.301 mV, (Vm=7.076 mV,
Ix=4.312 mA, 1 kHz) Ix=4.091 mA, 1 kHz)
995.85 µH 993.2 µH
Q: 0.49189 Q: 0.492
1.255 mH
Inductor 1 mH Rs=12.722 Ω Rs=12.681 Ω
Q: 0.63
(Vx=52.60 mV, (Vm=51.18 mV,
Ix=3.711 mA, 1 kHz) Ix=3.621 mA, 1 kHz)
Then there’s the HM8118. As a modern device, Summarizing, ease of use has improved a lot
this one is (more or less) plug-and-play. After since the 1960’s and looking at the measurement
the auto calibration sequence the DUT (Device results the Hameg and the Elektor LCR Meter
Under Test) is inserted into the test fixture kind of photo finished. Our little meter holds its
(Hameg HZ181) and the requested component own against the big gun (see the comparison
properties are instantly displayed on the blue chart). Of course it wouldn’t be fair to ignore the
backlit LCD. Estimated time: 40 seconds from extensive range of options on the Hameg and the
start to finish, without reading the manual. 0.05% basic accuracy is nothing to sniff at either.
Sequential measurements? Let’s assume swap- Surprisingly, after more than 50 years and oper-
ping the DUT takes three seconds, selecting the ated by a rookie, the GRC 1650-A isn’t even that
correct measurement unit another two, total- far off. Talk about a trusty lab companion. They
ing five seconds. don’t make them like that anymore! Or do they?
Last but not least: the Elektor 500 ppm LCR Care to share your experience with ‘vintage’ lab
Meter. With just an LCD, an on/off switch and five devices? Drop us an email at [email protected].
buttons this may be as far as plug-and-play can (130166)
take you. The calibration is a once only job that
had already been taken care of on the prototype Internet Links
I used for this test, so I could go straight to the [1] www.hameg.com/13.0.html
actual measurement and put the DUT between
[2] testenmeetwinkel.nl
the clips. Estimated time: 10 seconds.
Sequential measurements are probably a little [3] www.elektor.com/075064
more time demanding compared to the Hameg [4] www.elektor.com/110758
using the Kelvin clips, but the HZ181 test fixture
can also be used on the Elektor LCR Meter.
New Performance
Requirements for Resistors
in aeronautics
By
Dominique Vignolo
applications
(Vishay)
In order to increase fuel efficiency, the weight have used high-temperature parts in a number of
of the aircraft is decreased by reducing cabling, applications. One of these was landing and brak-
which can be achieved by moving electronics close ing monitoring systems, where brake tempera-
to their function. To comply with anti-pollution tures were measured, and Wheatstone bridges
regulations, electric engines are being used to were used to monitor hydraulic and tire pres-
move the aircraft on the ground. sure. In this type of application, the electronics
In addition to changing design, the new demands were located in the wheel, and high temperatures
placed on aircraft manufacturers have also cre- reached them within an hour.
ated new performance requirements for elec- In terms of performance, these systems required
tronic components, including resistors. In this components with operating temperature ranges
article, we will explore the required parameters from –55 °C to +175 °C, but this quickly needed
for different types of resistors, including high- to be expanded to +200 °C. Components with
temperature capabilities for stringent operating good long-term stability were also required, as
conditions and long-term stability. the measurements had to remain stable for the
life of the aircraft. The expected drift after several
A history of high-temperature thousand hours of life could not exceed a given
components in aeronautics applications percent. Finally, the components had to exhibit
Over the past eight years, aircraft manufacturers good behavior during acceleration, vibration, and
Table 1. Load-Life drifts after 15,000 hours at various temperatures (experimental data).
PCB sCu PCB Mcu
Size Rth(jsp) (°C/W)
Rth(ja) (°C/W) Rth(ja) (°C/W)
0603 27 200 67
1206 20 110 60
2010 12 95 52
2512 11 95 51
1
the maximum power at +200 °C will be 0.57 W.
0.8 The second way is to reduce drifts by limiting
0.6
the temperature at the surface of the resistor.
0.4
1.2 In this example, the best assembly is used, but
0 the customer limits the power to 0.32 W. This
0 2000 4000 6000 8000 10000 12000 14000
t (h) moves the 52 °C/W curve down and the junction
With Pd (Tj = 230˚C) T = 185˚C T = 200˚C T = 215˚C T = 230˚C temperature will be +215 °C instead of +230 °C
130139 - 12 as with the 52 °C/W curve.
Conclusion
Figure 2. Tc = Ta + Rth x Pd From an analysis of temperature-induced drifts,
High-temperature drift vs. we have pointed out some specific features of
time. where our thin film resistors that give them advantages
Tc = temperature to be controlled; for high-temperature applications.
Ta = ambient temperature;
Pd = maximum allowed power dissipation; The irreversible drifts other than load life are neg-
Rth = thermal resistance between the surface of ligible. The load-life drift depends on Tj, however
the resistor at temperature Tc, and the ambient. it is reached; by pure ambient temperature or the
sum of ambient temperature and power dissipa-
The model can be written as Pd = (Tc – Ta) / Rth. tion (Tj = Ta + Rthja x Pd). This is valid, provid-
Per Table 1 we get: Rthja = 52 °C/W for a P2010 ing some Pd limitations given in the datasheets.
chip on a MCu PCB, and Rthja = 95 °C/W for a From an analysis of actual stability data and drifts
P2010 chip on an sCu PCB. versus time for various temperatures, it is obvi-
ous that even for Tj as high as +230 °C, drifts
Using the derating curve are under control and rather predictable from
Providing Tj max = +230 °C, the maximum power manufacturing data processes.
dissipation of the resistor at Ta = +200 °C will be:
To help assembly designers we developed a ther-
• 0.57 W for Rthp = 52 °C/W — This is the best mal model showing thermal resistance figures
Figure 3.
assembly. necessary to use this model. The derating curves
Example of a derating curve • 0.32 W for Rthp = 95 °C/W — This is the illustrate how good thermal management leads
(P2010). standard assembly. to load-life drift minimization.
0.6
aeronautics applications move closer to their
0.5 functions.
0.4 (130139)
0.3
0.2
0.1
0
165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240
Ta (˚C) 130139 - 13
powered by Eurocircuits
n e w E l e k t o r P C B s
2 5% Discount on
Benefit now: Elektor PCB Service offers a permanent
90-day launch discount on new Elektor PCBs!
The guys at iFixit have been accused of favoring one Having no luck with our vast array of poking, prodding,
fruit above all others. Now, to show some apprecia- and prying tools, a little more heat might be neces-
tion towards other members of the fruit family, they sary... But it turns out keeping a heat gun on the same
decided to test the accessibility, repairability, and spot for too long will damage the outer layer of the peel
end-of-life design of the Orange. beyond repair. If you’re not extremely cautious, you will
find yourself in need of a new outer peel.
The Orange is a fickle fruit. Believed to be the hybrid
between a pomelo and a mandarin, the team at As an added bonus, the Orange comes with a free
iFixit had no luck opening it with a guitar pick, plas- accessory, the Orange Peel — an amusing, Slinky-like
tic opening tool, tech knife, ruler, pair of tweezers, contraption, guaranteed to deliver hours of fun.
or even an iSesamo! After almost losing all hope, a All ten major internal components of this device are
tool descended upon them from the repair heavens, easily removable. However, iFixit are worried that
with Morgan Freeman’s voice booming throughout our they might not go back together as easily as they
teardown room. They called it the oOpener! come apart, a common problem in fruit repair.
Though the Orange’s repairability is highly question-
The Orange received a first-ever 0 out of 10 Repair- able, iFixit do admire its end-of-life design. It is com-
ability Score for a variety of reasons, but mainly pletely recyclable, compostable, and delicious-able.
because it’s... an orange. Lest you think that IFixit We hope that devices like this will someday catch the
is biased against oranges, note that users will have attention of other device manufacturers and help keep
to break its outer case in order to open it, the device electronics out of landfills... unless they are composta-
is impossible to reassemble, and the internal com- ble, of course!
ponents are filled with acid. Sounds like a bad time Navel Oranges have small, sterile seeds that can-
all around. not be used to reproduce more Oranges — a cutting
Some people may have tried the teardown at home from an existing fruit-bearing tree must be grafted
with mild to moderate success. They can celebrate to another tree. This is the most advanced anti-piracy
their success with an Orange Teardown t-shirt! Or if DRM measure iFixit have seen, definitively ensuring
they’re having technical difficulties with their Orange, that Orange owners won’t be able to produce copies
they can make sure they’ve identified their Orange of their Orange to share with their friends.
correctly, and then visit iFixit’s Orange Troubleshoot-
ing Guide to figure out what’s going on. Or perhaps www.ifixit.com/Teardown/Orange+Teardown/13470/1
they just need the right tool for the job. (130028-IV)
EMAC, Inc. introduces the SoM-9X25, a wide temperature System on Module (SoM) based
on the Atmel AT91SAM9X25 processor. Designed and manufactured in the USA; this wide
temperature, fanless ARM9 400 MHz SoM has an Ethernet PHY included along with 6 serial
ports with auto RS-485 provision. It utilizes up to 1GB of NAND Flash, 8MB of serial data
flash, and up to 128MB of DDR2 RAM. A SoM is a small embedded module that contains the
core of a microprocessor system.
Using the same small 144 pin SODIMM form-factor (2.66” x 1.5”) utilized by other EMAC
SoM modules, the SoM-9X25 is the ideal processor engine for your next design. All of the
ARM processor core is included on this tiny board including: flash, memory, serial ports,
Ethernet, SPI, I2C, I2S audio, CAN 2.0B SDIO, PWMs, timer/counters, A/D, digital I/O lines,
video, clock/calendar, and more.
The SoM-9X25 is designed to plug into a carrier board that contains all the connectors and
any custom I/O required for the application. This approach allows the customer or EMAC to
design a custom carrier board that meets the customer’s I/O, dimensional, and connector
requirements without having to worry about the processor, memory, and standard I/O
functionality. With this System on Module approach, a semi-custom hardware platform can
be developed in as little as a month.
In addition to the option of the developing a Carrier board, one can be purchased off-the-
shelf from EMAC. EMAC provides off-the-shelf Carrier boards that feature A/D, D/A, MMC/SD
card, keypad, LCD, audio, and modem interfaces. The recommended off-the-shelf carrier
board for the SoM-9X25 is the SoM-150ES which allows the user to immediately start
coding their application using the powerful Linux or WinCE operating system and tools.
The System on Module approach provides the flexibility of a fully customized product at a
greatly reduced cost.
EMAC provides a Free Eclipse IDE for Linux development. All the compiling, linking,
downloading, and debugging inherent to software development can be done from one
easy to use high level interface. When developing for Microsoft Windows CE 6.0 applications,
Microsoft Visual Studio 2005/2008 can be utilized. Both Visual Studio and Eclipse provide
everything the user needs for developing SoM-9X25 applications. EMAC provides an SDK for
the SoM-9X25, which contains source examples and drivers. Quantity 1 price for SoM-9x25
starts at $180.
www.emacinc.com/som/som9x25.htm
(130028-IX)
Konrad Zuse’s
Z1 through Z4, and Beyond
It all began with zeroes,ones
1 and algebra
Ever since the earliest days of mathematics and logical thought,
people have tried to find ways to simplify the repetitive work involved.
Based on an understanding of logical functions and relationships vari-
ous highly sophisticated calculating machines were developed. This
article takes a tour of Konrad Zuse’s impressive contributions to the
development of the computer.
14
www.cc-webshop.com
•Magazine
The Hexadoku puzzle employs numbers in the hexadecimal black lines). A number of clues are given in the puzzle and
range 0 through F. In the diagram composed of 16 × 16 boxes, these determine the start situation.
enter numbers such that all hexadecimal numbers 0 through F
(that’s 0-9 and A-F) occur once only in each row, once in each Correct entries received enter a prize draw. All you need to do
column and in each of the 4×4 boxes (marked by the thicker is send us the numbers in the gray boxes.
Prize winners
The solution of the April 2013 Hexadoku is: 934CB. The Eurocircuits $140.00 voucher has been awarded to David Smart (USA).
The Elektor $60.00 book vouchers have been awarded to Joseph Reding (Luxembourg), Karsten Krummeich (Germany), and Paul Blaak (Netherlands).
Congratulations everyone!
9 C 2 4 B D E F 7 6 A 0 5 8 3 1
5 E B D 3 1 A 9 4 F 8 C 6 7 0 2
A F 3 0 8 4 6 7 D 1 2 5 E 9 B C
6 1 7 8 C 0 5 2 E 3 9 B 4 A D F
7 B 6 E 4 A F 1 9 8 0 3 C D 2 5
8 D 9 3 5 2 B 0 6 A C 1 7 E F 4
C 0 1 F 6 8 7 E 5 4 D 2 A B 9 3
2 A 4 5 9 C D 3 F 7 B E 8 0 1 6
3 2 8 1 A 5 0 D B C E F 9 6 4 7
B 4 5 7 E F 8 6 0 2 3 9 1 C A D
D 6 F A 2 7 9 C 1 5 4 8 B 3 E 0
E 9 0 C 1 3 4 B A D 6 7 F 2 5 8
F 3 E B 7 6 C A 2 0 5 4 D 1 8 9
0 5 C 6 D E 1 8 3 9 F A 2 4 7 B
1 8 A 2 F 9 3 4 C B 7 D 0 5 6 E
4 7 D 9 0 B 2 5 8 E 1 6 3 F C A
The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses.
In The Clouds
By Gerard Fonte (USA) data in case of a hardware failure. They have major assets in
place to prevent unauthorized access and infection from viruses
The Leading Edge and malware. After all, this is their business. And if they can’t
Everyone likes to be at the forefront of technology. Using all maintain security, they know that they will be quickly out
the latest gadgets and applying all the latest ideas. Unless of business. However, these companies are probably much
you’re a company and you have to rip up and throw away all larger targets for hackers than your company. And it’s hard
the old technology for the newest. That’s expensive. And will to protect against a virus that’s completely new. So, it’s really
it really give you the edge? Or is this just a fad that you’ll not a simple task to estimate your risk.
regret in a year or so? Like anything new, it will take time to determine the precise
Re-training the engineers and technicians and assemblers is characteristics of the cloud. It will probably take five to ten years
not cheap. And then there are all those technical issues. Your for the market to mature to a point where the uncertainties
engineers haven’t designed this type of system before. What are small, the weak companies disappear and standards are
problems will arise? Worse, what problems will go unseen set. For example, suppose you are late with a payment. Can
until the product has been marketed for a year or so? It’s the company withhold your data and cripple your company?
not called the “Bleeding Edge” for nothing. This is where What happens if they go bankrupt? There are many nightmare
the company hemorrhages capital and time for a perceived scenarios that are limited only by the imagination. Of course,
advantage somewhere in the future. If it works, it’s brilliant. it’s hard to say what’s realistic and what isn’t.
If it doesn’t, pass out the parachutes.
In the 1950’s atomic power was The Thing. Ford developed Change in Infrastructure
the 1958 concept car called the Nucleon that was to operate However, there is a somewhat subtle aspect that is not always
on a small atomic fission reactor (similar to those used on considered when employing Cloud Computing. Fundamentally,
submarines). Can you imagine the results of millions of the company is out-sourcing part of the Information Technology
unlicensed nuclear reactors tearing across the US, getting (IT) Department. This may be good or not. It depends on the
into accidents and spilling their nuclear fuel? The idea seems company and the IT Department. The problem is that the out-
mind-boggling today. In 1954 RCA considered an atomic battery sourcing is not obvious. What’s more, it starts the company
for use with hearing aids. What could possibly go wrong with down a path that is difficult to reverse.
strapping a radioactive device to your head for 12 hours a When a company out-sources product assembly or accounting,
day—for the rest of your life? the action is clear. Work is being shifted from inside the company
Today’s Thing is cloud computing. There’s all this “excess to a different company. But with the cloud, the IT department
hardware and software” that’s just sitting around and not being just orders some new software. Everything seems the same.
used. Why not take advantage of all these cheap resources? Yet, as time passes, more and more applications and data are
You don’t have to expand your own facilities. All you have to do being quietly shifted off-site. After a while, the on-site hardware
is rent them cheaply on the internet. No re-training costs, no and software requirements are significantly reduced. The IT
hardware costs, no added personnel. You get instant leading- department will shrink and personnel may be let go for lack
edge technology with no risk and fantastic benefits. It seems of work. Quite possibly, the IT department will morph into a
like a no-brainer decision. (For reference, atomic power was service department that interfaces the company to the cloud
billed as being “too cheap to meter.” That’s right—free energy.) supplier. Again, this may or may not be good for the company.
The important point is that all of the consequences of moving
The Fine Print to the cloud need to be foreseen and considered before any
Except you no longer have control of your data and software. action is taken. And it seems that it is often the case that the
Someone else does. If you are just playing a game on-line, IT department sows the seeds of its own dissolution without
control probably isn’t very important. The worst that could realizing it.
happen is that your avatar could face an untimely and Further, you can now see that trying to extract yourself from the
unexpected termination. But what about your proprietary design cloud is not an easy thing to do. You will have to invest heavily
information or financial records? You are now dependent on in hardware and software, hire and re-train IT professionals
another party to keep your data safe and sound. and basically re-invent the wheel. Once you’re in the cloud it’s
Of course the companies that supply cloud-computing resources hard to get back to earth.
take a great deal of effort to maintain the highest security for (130182)
their data. They usually make at least a second copy of your
1 2
OS Hard- and Software for Electronics show how personal applications can be programmed. of PCB layouts at printer resolution, adapt PCB layouts
Applications A wide variety of applications is presented based using your favorite graphics program, zoom in / out
Open Source on a solid number of hands-on examples, covering on selected PCB areas and export circuit diagrams and
1
Electronics on Linux anything from simple math programs, reading illustrations to other programs.
If you have ever wanted to take advantage of the sensors and GPS data, right up to programming ISBN 978-90-5381-273-0 • $37.90
expanding field of open source software for electronics for advanced Internet applications. Besides writing
and everyday applications, this book is for you. Using applications in the Java programming language, this
the Linux OS, Warwick A. Smith guides you through the book also explains how apps can be programmed Display, buttons, real time clock and more
world of open source hardware and software, teaching using Javascript or PHP scripts. When it comes to
4
Elektor Linux Board
readers to use EDA tools and software that is readily personalizing your smartphone you should not feel Extension
available online, free to download. The hardware limited to off the shelf applications because creating This extension board was developed to further
projects inside can be built using easily obtainable your own apps and programming Android devices is propel our Embedded Linux series of articles and the
parts, in the comfort of your own home, on single sided easier than you think! matching GNUblin board. It has a display, buttons,
PCBs, or professionally manufactured with output files 244 pages • ISBN 978-1-907920-15-8 a real time clock and 16 GPIOs. Linux devotees,
generated by you. Open Source Electronics on Linux $56.40 switch on your solder irons. The Linux extension
is about changing today’s electronics enthusiast into board includes everything needed to provide the user
empowered, savvy, discerning engineers capable of interface for a wide variety of projects!
building and modifying their creations, be it solely on A whole year of Elektor magazine on a single disk Module, SMD-populated and tested board, incl.
Linux or in tandem with your current operating system. 3 DVD Elektor 2012 LCD1, X1, K1-K4, BZ1, BT1 for home assembly
272 pages • ISBN 978-1-907920-19-6 The year volume DVD/CD-ROMs are among the most Art.# 120596-91 • $50.20
$47.60 popular items in Elektor’s product range. This DVD-ROM
contains all editorial articles published in Volume 2012
of the English, American, Spanish, Dutch, French and Taming the Beast
Programming step-by-step German editions of Elektor. Using the supplied Adobe 5 FPGA Development Board
2 Android Apps Reader program, articles are presented in the same FPGAs are unquestionably among the most versatile but
This book is an introduction to programming apps layout as originally found in the magazine. An extensive complex components in modern-day electronics. An
for Android devices. The operation of the Android search machine is available to locate keywords in any FPGA contains a maze of gates and other circuit elements
system is explained in a step by step way, aiming to article. With this DVD you can also produce hard copy that can be used to put together your own digital circuit
6 7
on a chip. This FPGA development board (designed in Sound Secrets and Technology but extremely powerful programming language for
the Elektor Labs) shows how easy it is for any electronics 7 Electric Guitar PIC microcontrollers. Assuming you have absorbed
enthusiast, whether professional or amateur, to work What would today’s rock and pop music be without all lessons you should be confident to write PIC
with these programmable logic devices. electric lead and bass guitars? These instruments microcontroller programs, as well as read and
Module, ready build and tested Art.# 120099-91 have been setting the tone for more than forty years. understand programs written by other people. You
See www.elektor.com/fpgaboard Their underlying sound is determined largely by their learn the function of JAL commands such as include,
electrical components. But, how do they actually pin, delay, forever loop, while loop, case, exit loop,
work? This book answers many questions simply, in repeat until, if then, as well as the use of functions,
LabWorX 2 an easily-understandable manner. For the interested procedures and timer- and port interrupts. You
Mastering Surface musician (and others), this book unveils, in a simple make an LED blink, build a time switch, measure a
6
Mount Technology and well-grounded way, what have, until now, been potentiometer’s wiper position, produce sounds,
This book takes you on a crash course in regarded as manufacturer secrets. suppress contact bounce, and control the brightness
techniques, tips and know-how to successfully The examination explores deep within the guitar, of an LED. And of course you learn to debug, meaning:
introduce surface mount technology in your including pickups and electrical environment, so how to spot and fix errors in your programs.
workflow. Even if you are on a budget you too that guitar electronics are no longer considered 284 pages • ISBN 978-1-907920-17-2
can jumpstart your designs with advanced fine highly secret. With a few deft interventions, many $47.60
pitch parts. Besides explaining methodology instruments can be rendered more versatile and
and equipment, attention is given to SMT parts made to sound a lot better – in the most cost-
technologies and soldering methods. Many effective manner. Further information and ordering:
practical tips and tricks are disclosed that bring 287 pages • ISBN 978-1-907920-13-4
www.elektor.com/store
surface mount technology into everyone’s reach $47.60
Elektor US
without breaking the bank. A comprehensive kit
111 Founders Plaza, Suite 300
of parts comprising all SMT components, circuit
East Hartford, CT 06108
boards and solder stencils is available for readers 10 captivating lessons
USA
wishing to replicate three projects described in
8
PIC Microcontroller Phone: 860.289.0800
this book. Programming Fax: 860.461.0450
282 pages • ISBN 978-1-907920-12-7 Using the lessons in this book you learn how to E-mail: [email protected]
$47.60 program a microcontroller. You’ll be using JAL, a free
Don’t miss it, this jumbo edition of Elektor packed with articles and projects like:
CAN-checker – ElektorBus-steppermotor control – CDI-ignition for mopeds – Inrush current limiter – Class-D
audio amplifier with 555 – Servo checker – ECG-monitor for Android – USB-power pack – Numitron
Arduino clock – Parking help – Multi-channel temperature logger – IR remote for Android – Extremely
accurate digital clock – Universal precision measurement interface – AVR-USB-keyboard-stick
Article titles and magazine contents subject to change; please check www.elektor-magazine.com
Elektor July & August 2013 edition published June 26, 2013
Check out
www.elektor-labs.com
and join, share, participate!
All memberships begin with the current issue. Expect 3–4 weeks for receipt of the first issue.
Membership renewals and change of address should be sent to:
Elektor US
P.O. Box 462228
Escondido, CA 92046
E-mail: [email protected]
Memberships may be paid for by check or money order (in US $ drawn on a US bank only). We accept Mastercard, VISA,
Discover and American Express credit cards.
For gift memberships, please include gift recipient’s name and address as well as your own, with remittance. A gift card will
be sent on request. Memberships may be cancelled at any time for a refund of all unmailed issues.
!
Does your membership expire soon?
Renew it on-line at www.elektor.com/members