Documentos de Académico
Documentos de Profesional
Documentos de Cultura
com
magazine
January & February 2015 | No. 457 + 458
J²B
Synthesizer
With
Free L
ive
Webin
An ar
open-minded
digital music platform
magazine
Visit Elektor @
Nurnberg, Germany
February 24-26
Hall 5, Booth 288
the brains, and was co-inspired low, especially with the SAM D20
News
by another Elektor blockbuster Xplained board.
publication, the insightful AVR
48 T-Board Wireless
8 electronica 2014 Impressions SDR project series printed back in
Adding a wireless module to a proj-
The hectic at the Elektor booth 2012. It is usable for applications
ect can come in handy when you’re
captured in words and pictures. like signal tracing, clocking of MCU
working on a circuit design, for
and digital circuits, basic audio
example on a breadboard. For this
filter & loudspeaker testing, tuning,
we have developed a convenient
you name it.
T-Board that is suitable for various
Projects 30 VariLab 402 (3) types of wireless module.
In this closing installment we look
at software structure and the way 51 Better Accuracy from the LM317
10 J2B Synthesizer
it got designed, also in relation to Get the good old LM317 to produce
Based on Soulsby’s Atmegatron
design choices. The final assembly a very accurate output voltage.
concept, this synthesizer is built
around an ATmega328 8-bit AVR of the PSU is also discussed. 56 Stepper or Servo Drive for
microcontroller from Atmel, the 38 From 8 to 32 bits: Vintage Dials
same that is at the heart of the ARM Microcontrollers for What’s stopping you from equipping
Arduino Uno board. We wouldn’t Beginners (1) old needle-pointer instruments with
say this synthesizer sounds musical There’s nothing frightening or state of the art innards? By doing
in the first place—it can, but also daunting about microcontrollers so you combine functionality with
expect unpolished sounds. with an ARM architecture. aesthetics.
Those with a little expe-
22 Experimenter’s Function s at 56 GestIC & 3D Touchpad Workbook
1 Kboard ed rience with 8-bit devices
Generator r iz (2)
an Elekto will find this new course
The DIY instrument described here price One of the nerdiest games out
exciting and easy to fol-
employs Elektor’s Platino board as there is 2048. Using the Microchip
DesignSpark
90 DesignSpark Tips & Tricks
We look at multiple devices inside
components, like logic ICs.
97 Transistor Tetrodes
Weird Components—the series
Labs
92 Microchip Hillstar DevKit
Walkaround
From opening the box to a fully
working gesture control system.
Review
110 EveryCircuit App
web interface. Design and analyze electronics
MGC3110 we get to play 2048 on
without touching a soldering iron.
the Raspberry Pi. 89 Tristate Level Shifter
58 CC2-eBoB Convert 3.6 volts swing to 5 volts.
Like so many modern components 98 USB Chipcard Reader
the wonderful ChipCap2 humidity This absolute bare bones interface Industry
and temperature sensor is a night- allows a PC RS232 port to talk USB
mare to solder. Here’s help. 116 News & New Products
to chipcards.
64 Bluetooth Low Energy 101 DIY LED Flashlight
Wireless Thermometer This flashlight is fun to build and
Here we link Laird’s BT600 ther- more energy efficient than anything
mometer to our iPhones and smart- off the shelf.
Magazine
phones—wirelessly of course! 120 Retronics: Digi-Disco (1978)
104 Beep
72 The Art of Bulb Planting For logic high/low checks sounds Reminiscences of a TTL user doing
Here’s a few novel uses for the high- are easier to interpret than rolling a great job entertaining Highschool
digits on the DVM. kids in the late 1970s. Series Edi-
ly underrated and almost forgotten
tor: Jan Buiting.
incandescent lamp, a.k.a. bulb. 108 Tiny Test Transmitter for FM
An usual and dirt cheap approach 124 Hexadoku
76 Video over Fiber
to making an FM transmitter The Original Elektorized Sudoku.
Do consider using optic fiber
instead of coax for cable runs lon- 108 FM Synchro Receiver 125 Gerard’s Columns:
ger than about 300 feet. Ditto, for the associated receiver. Crackpots versus Iconoclasts
84 USBProg 5.0 113 RTC Modules from Micro Crystal 130 Upcoming in Elektor
This extremely versatile program- Remarkably, these RTC chips have A sneak preview of articles on the
mer is fully open source and has a the xtal on-chip. Elektor publication schedule.
Copyright Notice
The circuits described in this magazine are for domestic and edu-
cational use only. All drawings, photographs, printed circuit board
layouts, programmed integrated circuits, disks, CD-ROMs, DVDs,
software carriers, and article texts published in our books and
magazines (other than third-party advertisements) are copyright
Elektor International Media b.v. and may not be reproduced or The Team
transmitted in any form or by any means, including photocopy- Editor-in-Chief: Jan Buiting
ing, scanning and recording, in whole or in part without prior
written permission from the Publisher. Such written permission Publisher / President: Don Akkermans
must also be obtained before any part of this publication is stored
Membership Manager: Raoul Morreau
in a retrieval system of any nature. Patent protection may exist
in respect of circuits, devices, components etc. described in this Client Executive: Cindy Tijssen
magazine. The Publisher does not accept responsibility for fail-
ing to identify such patent(s) or other protection. The Publisher International Editorial Staff: Harry Baggen, Jaime González-Arintero, Denis Meyer,
disclaims any responsibility for the safe and proper function of Jens Nickel
reader-assembled projects based upon or from schematics,
descriptions or information published in or in relation with Elek- Laboratory Staff: Thijs Beckers, Ton Giesberts, Luc Lemmens,
tor magazine. Clemens Valens, Jan Visser
Graphic Design & Prepress: Giel Dols
© Elektor International Media b.v. 2015
Printed in the USA Printed in the Netherlands Online Manager: Daniëlle Mertens
United Kingdom
Don Akkermans
+44 20 7692 8344
don.akkermans@eimworld.com
Germany
Ferdinand te Walvaart
+49 241 88 909-17
ferdinand.tewalvaart@eimworld.com
France
Denis Meyer
+31 46 4389435
denis.meyer@eimworld.com
Netherlands
Ferdinand te Walvaart
+31 46 43 89 444
ferdinand.tewalvaart@eimworld.com
Spain
Jaime González-Arintero Connects You To
+34 6 16 99 74 86
j.glez.arintero@elektor.es
Italy
Maurizio del Corso
+39 2.66504755
m.delcorso@inware.it
Sweden
Don Akkermans
+31 46 43 89 418
don.akkermans@eimworld.com
Brazil
Don Akkermans
+31 46 43 89 418
don.akkermans@eimworld.com
Portugal
Don Akkermans
+31 46 43 89 418
don.akkermans@eimworld.com
India
Sunil D. Malekar Supporting Companies
+91 9833168815
ts@elektor.in Anaren Labcenter
www.anaren.com . . . . . . . . . . . . . . . . . . 37 www.labcenter.com . . . . . . . . . . . . . . . 132
Russia
Nataliya Melnikova Batronix Microchip
+7 (965) 395 33 36 www.batronix.com/go/48 . . . . . . . . . . . . 21 www.microchip.com/get/eu3DTouchPad . 131
Elektor.Russia@gmail.com
DLP Design Pico
Turkey www.dlpdesign.com . . . . . . . . . . . . . . . . 83 www.picotech.com/PS301 . . . . . . . . . . . . . 2
Zeynep Köksal
+90 532 277 48 26
Embedded World 2015 Reichelt
zkoksal@beti.com.tr www.embedded-world.de . . . . . . . . . . . . . 3 www.reichelt.com . . . . . . . . . . . . . . . . . 75
Impr ssions
Last November electronica, the world’s largest on all four days. Both our coffee and our famous
electronics fair, celebrated its 50th anniversary. Of GoodieBag went down well with the crowd. Sadly
course Elektor had a presence at the show, with because of technical problems our Wi-Fi router
a booth considerably larger than usual. Thanks to gave less than consistent operation — we hope
renowned companies such as Rohde & Schwarz, that in two years we get an opportunity to opti-
National Instruments, and Conrad our ‘Maker mize everything again!
Space’ was outfitted with state of the art oscil-
loscopes, power supplies, soldering stations, and The free seminars held at the booth were defi-
many other tools. After some hesitation (because nitely highlights of the day, ranging from ret-
of the hot soldering irons) the Munich show orga- ro-electronics to modern measurement and pro-
nizers also gave their OK, enabling Elektor staffers gramming. On Wednesday evening, visitors even
and visitors to get hands-on with soldering work had an opportunity to participate in a live web-
cast on oscilloscopes and power supplies. The day”. The studies of budding engineers are often a
company iFixit gave rare glimpses inside tablet little heavy on theory – hence many students took
computers, and showed how to repair consumer the opportunity to talk shop with the guys from
electronics with cleverly made tools. On Thursday Elektor Labs, or to improve their soldering skills.
there was a dual seminar on parallel program- Not only students though—our delightful Floor
ming with XMOS processors. A dozen or more Managers, Chantalle and Julia also enjoyed build-
software enthusiasts grabbed the opportunity to ing a triangular-shaped LED Xmas Tree board!
instantly expand their knowledge using a theo- (140466)
retical introduction and practical programming
exercises.
Many younger electronics fans made it to our
booth on the last day of the show, the “student
J²B Synthesizer
An open-minded
By Clemens Valens
digital music platform
(Elektor.Labs)
This project was born after I discovered the Atmegatron music synthesizer from
Soulsby Synthesizers [1]. This synthesizer is built around an ATmega328 8-bit
AVR microcontroller from Atmel, the same that is at the heart of the Arduino Uno
board. The design of the Atmegatron presents several interesting aspects that at-
tracted my attention and that ultimately resulted in the project described below.
Specifications
• Monophonic 9-bit synthesizer • 6 live controls
• 32 waveforms + user defined • MIDI
• 15 filter types • Patch saving/loading over MIDI
• 2 envelope generators • NXP LPC1347 32-bit ARM Cortex-M3
• LFO with 16 waveforms microcontroller
• 15-pattern arpeggiator • 2 output channels
• 16 patch memories • Open Source & Open Hardware design
Free ar
e w e bin
liv
on 2the
From: Elektor Academy & element14
First of all, before diving into the project, let me sounds. It should therefore not be compared to
issue a warning to those of you mainly inter- the synthesizers manufactured by the big guns;
ested in how the sound synthesis comes about it has its very distinct sound instead.
within the synthesizer’s sound engine. Below is a The synthesizer uses the MCU’s pulsewidth mod-
description of the process of porting the Atmeg- ulation (PWM) module to produce sounds. The
atron to my own hardware platform. The sound functionality of the external digital-to-analog
engine proper will be described succinctly. If this converter (DAC) can therefore be limited to an
is your only interest, have a look at Figure 2 anti-aliasing filter.
and then read the source code [2] instead of An open-source sound engine controlled by eight
this article. rotary controls (six potentiometers and two rotary
encoders) and fitting in 32 KB made triggered me
Atmegatron to find out if the lot could be ported to the Elek-
You are still around. In the Atmegatron (Fig- tor J²B controller board I published a few years
ure 1) the microcontroller unit (MCU) basically ago [3]. J²B was designed around an LPC1343,
does everything, from synthesizing the sound a 32-bit ARM Cortex-M3 MCU from NXP. Like the
to interacting with the user. It can also talk to ATmega328 it has 32 KB of program memory and
other equipment through a Musical Instrument all the other peripherals used by the synthesizer,
Digital Interface (MIDI) port. All this fits in the 32 including excellent PWM capabilities. Furthermore,
KB program memory of the MCU, which I think the J²B board supports up to nine rotary encod-
is quite an achievement, especially considering ers, or eight plus a pushbutton, which is perfect
the software got written as an Arduino sketch for this job. What’s missing though is an EEPROM
in C/C++, and Arduino can introduce quite a lot to store its sound presets, but there are ways
of overhead. The software is published with an around that.
open-source license and can be downloaded for The Atmegatron uses bicolor LEDs to show val-
free. Unfortunately the hardware design of the ues, positions and modes without the need for
Atmegatron is closed (although it can be quite an alphanumerical display. The J²B board does
easily reconstructed from studying the software). have an LCD, you can even choose between three
sizes, so I decided to replace the LEDs by an LCD-
Another interesting feature is that the Atmega- based human-machine interface.
tron was designed with live performance in mind
and for this it is equipped with six potentiometer
controls enabling you to modify ten sound param-
eters on the fly. Together with a function selector
and a function value encoder the synthesizer has
eight controls. To top it off, a pushbutton selects
between two modes (green or red). LEDs are
used to show the mode and the values—there
is no alphanumerical display.
For those who like “sounds with a bite” as opposed
to the sweet and smooth sounds usually produced
by the well-established commercial products it is Figure 1.
interesting to know that the Atmegatron features The Atmegatron was at the
several algorithms to create ugly and distorted origin of this project.
The porting effort boiled down to three main Typical pitfalls encountered during this stage are
tasks: inconsequent data type usage in the software
1. Porting the Arduino sketch for the ATmega328 itself and incompatible data types between com-
to an Eclipse/LPCXpresso project for the pilers (AVR GCC for Arduino versus ARM GCC
LPC1343; for Eclipse/LPCXpresso). Both problems lead
2. Replacing the six analog pots by six digital to similar bugs: data overflow (variables that
rotary encoders; no longer fit in the memory space reserved for
3. Replacing the bicolor LEDs by an LCD. them) and unintended sign conversions (negative
numbers that flip positive and vice versa). Such
Task 1 problems can be easily avoided by rigid use of
Porting microcontroller code can be more or less well-defined data types that clearly indicate their
daunting depending on how the original soft- size in bits and being signed or not. For exam-
ware was written. A well-structured project is ple, use uint8_t for an 8-bit unsigned integer
much easier to port than spaghetti code. Also value instead of unsigned char. Use int16_t or
the hardware abstraction level determines the int32_t instead of int, because the size of int is
portability of code. Code that calls functions to highly platform dependent. Better still, use data
modify registers and peripherals is much easier types that show what kind of data they hold. For
to port than lines that interact directly with the instance, create a data type sample_t and use
hardware whenever they need to. Furthermore, it only to hold sample values and stick to that
one file that groups all these functions is eas- throughout the code.
ier to handle than code having these functions More difficult porting situations arise from differ-
all over the place. Luckily the Atmegatron code ences between the hardware platforms. Timers
is well structured, well documented and utterly are relatively easy peripherals to port because
portable and I could do a large part of it while setting them up is more or less similar on most
watching a Bruce Willis movie on TV. Most of the MCUs. All you need is a good understanding of
work involved creating header files needed for the how the timer is supposed to work. But what
Eclipse/LPCXpresso C project (Arduino sketches if the target platform does not have the func-
can be written without such header files). tion used by the source platform? Or
what if peripherals behave slightly
differently? This turned out to be
the case for the PWM module of
the LPC1343 that does not quite
work in the same way as the PWM
module of the ATmega328 and
that resulted in distorted sound.
Let me explain.
On the AVR the PWM mod-
ule continuously compares a
counter to a threshold and
sets its output accordingly.
This determines the PM sig-
nal’s duty-cycle. When the
counter value is equal to or
higher than the threshold the
PWM output is low (or high,
depending on how you con-
figure it), when the counter
value is lower than the
threshold the PWM output
is high. If, in this case, you
move the threshold below the
counter value, the PWM output will immediately
go low. The C-like pseudocode looks like this:
MIDI
Portamento
Out
Oscillator PWM Filter Phaser Distortion
Figure 2.
Amplifier The synthesizer’s sound
engine captured in a block
diagram. The blocks marked
Bit PWM, bit crusher, and
crusher
140182 - 13 distortion allow for original,
rough sounds.
counter = counter + 1
32 samples of one period of a waveform (32
if (counter == max) then counter = 0
predefined, but you can draw your own as well).
if (counter >= threshold) then PWM = 0 These samples are filtered, processed in various
else PWM = 1 ways, and then stored in an output buffer. This
buffer is updated as fast as possible in the Arduino
On the LPC1343 the mechanism is almost identi- main loop function, meaning it is actually like a
cal. Almost—not exactly. Instead of controlling a task running in the background, without any real
PWM output continuously, on this MCU the output priority; it runs whenever it can. Dynamically
changes value only when the counter and the changing parameters like volume envelopes and
threshold have the exact same value (this is called modulation signals are synchronized to a milli-
a match). Changing the threshold therefore does second timer to make them independent of the
not have an immediate effect, but only when the main loop’s execution speed (which is higher).
counter reaches the new threshold value. Again The sound pitch is controlled by a timer running
in pseudocode: at a frequency 32 times higher than the pitch to
compensate for the size of the wavetable. When
counter = counter + 1 the timer reaches its end value (depending on the
if (counter == max) then pitch) the next sample is taken from the output
{ buffer and the PWM threshold (duty cycle) is set
counter = 0 according to the new sample value. Because of
the AVR’s way of doing PWM, the PWM duty cycle
PWM = 1
follows the changes in the sample value without
}
noticeable delay.
if (counter == threshold) then PWM = 0
On the LPC1343 the PWM update only takes place
when the PWM timer reaches the new thresh-
To understand the implications of this we have old, which may take up to one PWM period if
to take a closer look at the Atmegatron’s sound the new threshold value is set (just) below the
engine. actual PWM counter value. This variable delay
produces an audible interference in the shape
About the sound engine of soft rhythmic clicks.
The sound engine (Figure 2) is responsible for
the creation of the synthesizer’s output sounds. The solution I found to this problem was to use
In our case it calculates the output sound per the interrupt capability of the LPC’s PWM mod-
block of 32 samples. Such a block always cor- ule to handle the sample update. Even though
responds to one period of the output waveform the PWM signal has a frequency of 140.625 kHz,
(meaning that the sample rate is not constant). the MCU has no problems handling interrupts
The calculations start with a wavetable that holds at that rate. The pitch timer interrupt routine
Task 3
The third task was to replace the bicolor LEDs
by an alphanumeric LCD. I could have kept the
LEDs but that would have meant adding port
expanders to the MCU and my objective was to
stay as close as possible to the J²B board. The
Figure 4.
Schematic of the J2B
synthesizer’s main board.
IC1 +3V3 +3V3
LD1117S33
+5V +3V3
R94 R13 R59 R33 R34
C16 C18 C23 C22
100k
100k
100k
4k7
4k7
C5 C11 TP2
100n 10n 10n 100n
TP3
10u 10u
6V3 6V3
8 44
VDD VDD
3 RESET
RESET/PIO0_0
4 S9/ISP
+5V +5V +3V3 PIO0_1/CLKOUT/CT32B0_MAT2/USB_FTOGGLE
S1A 2 10 S3A
PIO1_19/DTR/SSEL1 PIO0_2/SSEL0/CT16B0_CAP0
S1B 13 14 USB_VBUS
PIO1_20/DSR/SCK1 IC2 PIO0_3/USB-VBUS
S2A 26 15 SCL
TP1 PIO1_21/DCD/MISO1 PIO0_4/SCL
L1 R17 S2B 38
PIO1_22/RI/MOSI1 LPC1347FBD48 PIO0_5/SDA
16 SDA
1M
F-1515622 ROW1 21 23 S4A
T1 PIO1_24/CT32B0_MAT0 PIO0_7/CTS
D10 USB_CONNECT ROW2 1 27 RED_LED2
PIO1_25/CT32B0_MAT1 PIO0_8/MISO0/CT16B0_MAT0
COL0 11 28 RED_LED1/SWO
PIO1_26/CT32B0_MAT2/RXD PIO0_9/MOSI0/CT16B0_MAT1/SWO
MBR0540T1G FX32-1 12
PIO1_27/CT32B0_MAT3/TXD SWCLK/PIO0_10/SCK0/CT16B0_MAT2
29 GREEN_LED2/SWCLK
K4 BSS84P COL1 24 32 S3B
R16 PIO1_28/CT32B0_CAP0/SCLK TDI/PIO_11/AD0/CT32B0_MAT3
Mini USB-B shielded COL2 31 33 S4B
PIO1_29/SCK0/CT32B0_CAP1 TMS/PIO0_12/AD1/CT32B1_CAP0
1k5
MIDI_LED 25 34 PWM1
PIO1_31 TDO/PIO0_13/AD2/CT32B1_MAT0
1 35 S5B
TRST/PIO0_14/AD3/CT32B1_MAT1
2 R4 USB_DM 19 39 PWM2/SWDIO
33R USB_DM SWDIO/PIO0_15/AD4/CT32B1_MAT2
3 R3 USB_DP 20 40 S6B
33R USB_DP PIO0_16/AD5/CT32B1_MAT3/WAKEUP
4 45 S5A
C4 C8 PIO0_17/RTS/CT32B0_MAT0
5 TXD 36 46 GREEN_LED1
PIO1_13/DTR/CT16B0_MAT0/TXD PIO0_18/RXD/CT32B0_MAT0
RXD 37 47 S6A
18p 18p PIO1_14/DSR/CT16B0_MAT1/RXD PIO0_19/TXD/CT32B0_MAT1
LCD_RST 43 9 S7A
PIO1_15/DCD/CT16B0_MAT2/SCK1 PIO0_20/CT16B1_CAP0
LCD_BL 48 17 S8A
PIO1_16/RI/CT16B0_CAP0 PIO0_21/CT16B1_MAT0/MOSI1
R1 TP5 30 S7B
C2 PIO0_22/AD6/CT16B1_MAT1/MISO1
42 S8B
PIO0_23/AD7
0R
NC
100k
18p 18p
100n 100u
6V3
RED_LED1/SWO GREEN_LED2/SWCLK
+3V3
+5V +5V
K2
1 T4 T3 T6 T5
2 PWM2/SWDIO GREEN_LED1 RED_LED2
3 GREEN_LED2/SWCLK +3V3
4 RED_LED1/SWO
5 BSS84P R36 R35 BSS84P BSS84P R38 R37 BSS84P
6 RESET
220R
270R
220R
270R
7 C35 C41 C43
8
LED1 10u 10u 10n LED2
6V3 6V3
LPC-Link +5V
Figure 5. +5V
LCD1
Schematic of the MIDI MIDI_LED
K1 R102 +3V3
interface. It has its own 4
4
VDD SDA
6 SDA
270R
LED+
LED–
1 TXD
MIDI_OUT
C+
C–
1u
design. 1u
T2
LCD_BL
+3V3
BSS84P
K203 +5V +5V K202 +5V +5V
5 4 +5V 4 5 4
R203 R202
2 MIDI_IN 3 2
220R 220R
IC201 GND 2
1 6 5 R201
D1 1 MIDI_OUT
TP201 220R
TP202 MIDI
BAT54
2 4
CNY17-3
140182 - 12
+3V3
S1 S2 S3
10k
10k
10k
10k
10k
10k
D1 D2 D4
BAT54 BAT54 BAT54
COL0 ROW0 COL1 ROW0 COL2 ROW0
R5 R6 R7 R8 R21 R24
S1A S1B S2A S2B S3A S3B
10k 10k 10k 10k 10k 10k
R23
NC
R18 R22
C6 C9 C7 C10 C12 C13
NC
0R
10n 10n 10n 10n 10n 10n
+3V3
S4 S5 S6
10k
10k
10k
10k
10k
10k
D5 D7 D8
BAT54 BAT54 BAT54
COL0 ROW1 COL1 ROW1 COL2 ROW1
NC
NC
0R
0R
0R
10n 10n 10n 10n 10n 10n
+3V3
10k
10k
10k
D6 D3 COL2 ROW2
BAT54 BAT54 SPARE
COL0 ROW2 COL1 ROW2
S9
R44 R47 R25 R28
S7A S7B S8A S8B S9/ISP
10k 10k 10k 10k
ISP/MODE
R46 R27
NC NC S10
R42 R45 R19 R26
C24 C25 C14 C15 RESET
NC
NC
0R
0R
RESET
10n 10n 10n 10n (optional)
TP8
C28 R73 C38
6k8
15n 220n
2
732R C42
13 1k1 1
TP6
R60 R80 R78 IC3.A
9 3k48 8k45 14 3
R56 R40 R41 R54 IC3.D 820R 1k 100R 10u
88k7 8 12 6V3 P1.A
R39 R55 IC3.C 3k3 180R 8k2 270R
PWM1 10 C39
82k 6k8
C29
C30 +3V3 680p
10k log C51
680p
4 C36
680p R96 10u
+3V3 IC3 6V3
3k3
11 100n
+5V R100
R77
3k3
6 +5V TP11
100k
7 R91 2
IC3.B C40 R84 L3
5 1
IC5.A
10k
10R
R79 3 K3
100u BLM21AG601SN1D T R95
8 C52 C48 6V3
100k
B
IC5
NC
R
4 100u 100n R92 S
6V3 5
C47 C37 R76 L2 MONO
FX32-1 TP4 IC3 = MCP6004 TP10 7
IC5.B Jack stereo 3.5mm
10k
10R
IC4 = MCP6004 10u 6
100u BLM21AG601SN1D
IC5 = TDA1308 6V3 6V3
+3V3 R90
+3V3 TP9
3k3
R99 4 C49 R88
6 IC4 3k3
100k
7 11 100n C50
IC4.B
5
TP12
R98 C44 R93 C53 10u
6V3
6k8
100k
15n 220n
2
732R C55
13 1k1 1
TP7
R89 R101 R97 IC4.A
9 3k48 8k45 14 3
R87 R83 R81 R85 IC4.D 820R 1k 100R 10u
88k7 8 12 6V3 P1.B
R82 R86 IC4.C 3k3 180R 8k2 270R
PWM2 10 C54
82k 6k8
C45
C46 680p
10k log
680p
680p
140182 - 11
The circuit
Looking at the schematics of the synthesizer (Fig-
ure 4) you will see no surprises. I managed to
use all the available I/O ports. The eight rotary
encoders take up 16 I/O ports, two per encoder.
The bunch of resistors surrounding the six live
Figure 6. Mk.II controls serve the purpose of flexibility. Indeed,
The J²B synthesizer in My new design (V2 or Mk.II) is therefore based by using the right resistance values it becomes
a laser-cut Plexiglass on an LPC1347 and is SMD throughout (except possible to replace such a rotary encoder by a
enclosure.
for the connectors, encoders and LEDs). Out of potentiometer because one side of these encod-
symmetry considerations I added a second bicolor ers is connected to an input of the MCU’s ana-
Component List
Main Board C5,C11,C35,C41,C42,C47,C50,C51,C55 = 10µF 6.3 V tantalum
C6,C7,C9,C10,C12-C15,C18,C23-C27,C31-C34,C43 = 10nF
Resistors C19,C21 = 1µF
C28,C44 = 15nF
Default: SMD 0805, 5%, 0.1 W
C29,C30,C39,C45,C46,C54 = 680pF
R1,R22,R26,R45,R49,R64,R68 = 0Ω
C38,C53 = 220nF
R2,R13,R59,R77,R79,R94,R98,R99 = 100kΩ
! C2 = not mounted
R3,R4 = 33Ω
R5-R12,R21,R24,R25,R28–R32,R44,R47,R48,R51,R52,R53,R57,R58,R
Inductors
63,R66,R67,R70–R75,R91,R92 = 10kΩ
R14,R80,R101 = 1kΩ L1,L2,L3 = ferrite bead, 0.21Ω, 0.6A, SMD 0805
R16 = 1.5 kΩ
R17 = 1MΩ Semiconductors
R20 = 47Ω, 1206, 0.25W D1–D9 = BAT54C (SOT-23)
R33,R34 = 4.7kΩ D10 = MBR0540T1G
R35,R37,R54,R85,R102 = 270Ω IC2 = LPC1347FBD48
R36,R38 = 220Ω IC1 = LD1117S33CTR
R39,R82 = 82kΩ IC3,IC4 = MCP6004-I/SL
R40,R83 = 180Ω IC5 = TDA1308T/N2
R41,R81 = 8.2kΩ LED1,LED2 = LED, bi-color red-green, CC, 5mm
R55,R73,R86,R93 = 6.8kΩ LED3 = LED, red, 3mm
R56,R87,R88,R90,R96,R100 = 3.3kΩ T1–T6 = BSS84P (SOT-23)
R60,R89 = 820Ω
R78,R97 = 100Ω Miscellaneous
R76,R84 = 10Ω K1 = 4-pin pinheader, 0.1” pitch
P1 = 10kΩ Potentiometer, stereo, logarithmic law K2 = 8-pin pinheader, 0.1” pitch
! R15,R18,R19,R23,R27,R42,R43,R46,R50,R61,R62,R65,R69,R95 = K3 = jack 3.5 mm, stereo
not mounted K4 = mini USB-B connector, shielded
S1–S8 = Rotary encoder
Capacitors S9 = pushbutton, Multimec 3FTL6
Default: SMD 0805 LCD1 = LCD 2x16, I²C, e.g. Midas MCCOG21605B6W-SPTLYI
C1,C16,C22,C36,C48,C49 = 100nF X1 = 12MHz quartz crystal
C3,C37,C40,C52 = 100µF 6.3V tantalum, size B BOX1 = Hammond type 1597DGY or laser cut.
C4,C8,C17,C20 = 18pF Main board, PCB # 140182-1 (Elektor Store)
MIDI board, PCB # 140182-2 (Elektor Store)
8 1
log-to-digital converter (ADC). As an example, E12 values can be used to obtain the required
look at encoder S5. Normally you would fit R63, non-standard values. Two opamps remain unused,
R64, R66, R71, R74, C31 and C32. To replace one per channel. The filter outputs pass through
it by a pot you would instead mount R61, R65 volume potentiometers that are isolated by two
and R74 (0 Ω) and maybe C32. Signal S5B—the capacitors from any DC voltage to avoid crackling
wiper—is now connected to ADC input AD3. noises. Hi-end audio fans may frown on this, but
it is good enough for this application. A stereo
The encoders have integrated pushbuttons that headphone amplifier makes sure that enough
are interconnected to form a 3 x 3 key matrix. output power is available for most applications.
The ninth key is a spare with no function cur-
rently. A dedicated Reset pushbutton is available The MIDI interface (Figure 5) is on a separate
as well as a separate Mode pushbutton (for the PCB because the DIN connectors are too tall
red/green modes). This button is also used to for the enclosure I selected. Now they can be
put the MCU in firmware update mode. The red/ mounted lower for a perfect fit. This time I did
green bicolor LEDs are controlled by MOSFETs a proper mechanical design, I even drew and
capable of pushing a lot of LED current without tested a drill template [2]. Then I decided to give
hurting the MCU. laser cutting a try, which resulted in a second
mechanical design (Figure 6). These drawings
The LCD is an I²C type and I think it is great. Not are also available at [2].
only is it smaller with the perfect height to go with
the rotary encoders, it is cheaper than the typi- More code porting
cal LCD module and consumes fewer MCU pins. A new hardware design with a new microcontroller
The anti-aliasing filters each consist of three oper- inevitably requires a second round of code port-
ational amplifiers and a bunch of resistors and ing. Because the new MCU comes from the same
capacitors. The resistors are split in two so that family as the previous one you might think that
code porting would be a matter of minutes (at
least that is what I thought), as its appears all
you have to do is to rewire some signals. In real-
ity it is more complicated because NXP decided
to redo the library for the chip that has an archi-
tecture that is actually closer to the LPC11Cxx
family than to the LPC134x family. In short, the
LPC1347 is not pin compatible with the LPC1343
and it is not 100% code compatible either. Hav-
Component List
MIDI Board
Resistors
Default: SMD 0805, 5%, 0.1W
R201,R202,R203 = 220Ω
R204 = 1kΩ
Semiconductors
D201 = BAT54C (SOT-23)
IC201 = CNY17-3 (DIP-6)
Miscellaneous
K201 = 4-way pinheader sock-
et, 0.1” pitch, vertical
K202,K203 = 5-way DIN sock-
et, PCB mount, 180°
MIDI board: PCB # 140182-2
(Elektor Store)
Advertisement
2 J B Synthesizer
UNBEATABLE
ing gotten this far I just bit the bullet and at price-performance ratio.
started sifting through the code to fix
the compatibility issues.
Do it yourself
The LPCXpresso/Eclipse
software project of
the synthesizer con-
sists of three sub-proj-
ects, one for the chip
library, one for the board library
Rigol DS1000E Oscilloscopes
and one for the synthesizer application
2 channels, 50/100 MHz, 1 GSa/s sample
itself. This is a bit more complicated than nec- rate, 1 million measurement points memory,
essary, but that is how it is. You can import the USB, LAN, easy measurement features,
package as a zip file (i.e. without unpacking it first). After successful compilation 3 years warranty
you will find a BIN file in the Release folder of the synthesizer project. To program
from€ 239,- net
incl. EU wide free shipping
the MCU with it all you have to do is to connect the synthesizer to a free USB port
on a computer running Windows while keeping the red/green Mode pushbutton
pressed (the synthesizer should be unpowered—the PC will provide power). If
all is well Windows should detect a USB thumb drive of 64 KB with one file on it.
Delete this file and copy the BIN file on the drive. If you have access to the Reset
button, press it—if not, switch off the power to the synthesizer and then switch it
back on. The display should now greet you with the message “J2B Synthesizer”
in a large font. When it vanishes the synthesizer is ready for use. Connect a MIDI
keyboard and headphones and start playing.
User Manual
Leading TECHNOLOGY
ated for the Atmegatron. This saved me a lot of writing. Download it from [1] and
read it carefully, it is comprehensive. The J²B synthesizer has all of the original
controls except for the tone control. The pushbuttons of the six live controls that
with BATRONIX satisfaction-
are nonexistent on the Atmegatron allow you to quickly reset the value of the
parameter that they control. guarantee
(140182-I) Attractive prices
Expert advice
Large selection in stock
Web Links
30 day trial period
Money back guarantee
[1] Atmegatron: http://soulsbysynths.com/
[2] Project downloads: www.elektor-magazine.com/140182
EU wide free shipping
for most products
[3] J²B: Universal MMI Module using ARM Cortex-M3. Elektor September 2011,
www.elektor-magazine.com/110274; www.elektor-labs.com/node/3832 Use our special offers now:
EW
www.batronix.com/go/48
N
Batronix service@batronix.com
Lise-Meitner-Str. 1-7 www.batronix.com
24223 Schwentinental Germany
Experimenter’s
Function Generator
Platino’d for squarewave, sine,
sawtooth, noise, and more
This Function Generator was designed
to meet not too ambitious applications
and should make a valuable asset in your
workspace, at home, or in the lab. Firm-
ly based on Elektor’s ‘Platino’ controller
concept, it is usable for applications like
signal tracing, clocking of MCU and digital
circuits, basic audio filter & loudspeaker
testing, tuning, you name it.
By Sunil Malekar A function generator supplies periodic signals of employs Elektor’s Platino board [1] as the brains,
(Elektor Labs India) different shapes, across certain ranges in terms and was co-inspired by another Elektor block-
of frequency and amplitude. In friendly coex- buster publication, the insightful AVR SDR proj-
istence with a multimeter, a power supply and ect series printed back in 2012 [2].
an oscilloscope the function generator is vital
to anyone serious about designing, making and The ingredients
even sharing electronics which is what Elektor Viewed as a building block, the Platino controller
is all about. The DIY instrument described here board requires a minimum of add-ons to make
digital-and-analog hybrids come alive without
running into design issues, enormous BOMs and
Specifications & Features other complexities. Unsurprisingly in 2015 our
Platino-based Experimenter’s Function Generator
• ATMEGA1284P microcontroller on Platino board
has two major aspects: hardware and software.
• 20 x 4 LCD Display
Both are mutually responsible for the stability
• DC Input: 18–20 VDC
and accuracy of the output signals. The heart of
• Standard BNC type connectors for outputs / input
the project is an ATMEGA1284P microcontroller
• Outputs:
running dedicated firmware. The hardware then,
-- Clock, max. 10 MHz, 5 V / 3.3 V switchable
consists of two sections: Platino MCU board with
-- Sine, Square, Triangular, Sawtooth, Inverted Sawtooth, Pulse, Arbitrary and
LCD, and the Signal Generator Add-on Board,
Random (Noise), max. 100 kHz, max approx. 5 V into 50 Ω
where “generator” is slightly off the Latin mark
• Input: Frequency Modulation (125 kHz ±50 Hz for SDR)
as nothing is being ‘generated’ per se; the Pla-
• Controls: rotary encoder control with pushbutton, Back button
tino does all that.
• Setup Mode for Arbitrary and Clock mode
• Normal Mode for other output waveforms
Platino MCU board with LCD
• Waveform Amplitude, Frequency, Offset adjustable in real time
Together with the add-on board the Platino board
• One calibration setting
with its ATMega1284P MCU controls and gener-
ates the signals inside and produced by the Func- waveforms, among others. Another pushbutton
tion Generator. All interconnections between the is assigned to act as a Back key to navigate back-
boards are evident from the schematic in Fig- wards in the signal generator menus. The inter-
ure 1. Note the schematic is composite, under- facing of Platino with the analog board in terms
pinning the way Platino and the Signal Generator of pins is summarized in Table 1.
PCB communicate through a bunch of connectors.
In case you did not know, Platino has a 20 x 4 Signal Generator add-on board
line backlit LC display as a visual output device Again referring to the schematic in Figure 1, the
(VOD) for menus, texts, numbers and other data. signal board consists mainly of a converter, an
For the tactile input device (TID) we have a rotary amplifier and power supply components respon-
encoder with an integrated pushbutton—the com- sible for generating different waveforms. Each of
bination is used here for selecting the various its five sub circuits is discussed below.
AREF
GND
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PC7
PC6
PB0
PB1
PB2
PB3
PB4
PB5
1 2 3 4 5 6 7 8
K5 K1
1 2 3 4 5 6 7 8 9 10
Platino PCB
K2 K1
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8
+9V
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PC7
PC6
AREF
GND
PB0
PB1
PB2
PB3
PB4
PB5
C3
100n
20k
20k
20k
20k
20k
20k
20k
1
R13 R11 R9 R7 R5 R3 R1 IC1.A
3 R20
10k 10k 10k 10k 10k 10k 10k
100R
R15
IC1 = TL082 R17 C1
20k
10k
P1 5
22u R27
25V D3 4
ADJ C10
1R
K8 IC6 2 100k
1000u 1N4007
+V C12 35V
1
18VDC
0V 470u R28 –9V
35V C11 D4
LM336Z 3 K4 K3
1R
100n
22u LM337 16
25V IC3 R21 VCC
13 11
A0 S0
1k
14 10
–9V A1 S1
15 IC2 9
A2 S2
12 Clock
R22 A3 R30 OUTPUT2
1 3
Signal Generator
A4 A 68R K5
1k8
5
A5
PCB 2 CD74HC4051
A6
R23 4 6
A7 E
120R
VEE GND
IC4 7 8
+9V 7805 +5V
R24
1k
K7 D2
C2 C6 C5 C4
FM Modulation +5V
Signal
470u 100n 100n 470u
16V 16V BZX79-C5V1
RESET
GND
PC0
PC1
PC2
PC3
PC4
PC5
PD1
PD0
+5V
1 2 3 4 5 6 7 8 9 10 11 12
K3
Figure 1.
Composite schematic of the
K6 K2
1 2 3 4 5 6 6 5 4 3 2 1
Signal Generator board with
GND
RESET
+5V
PC0
PC1
PC2
PC3
PC4
PC5
PD1
PD0
130407 - 11
the Platino controller in the
outer perimeter.
Fraction = Freq
Fraction = Fraction / 1000000
Fraction = Fraction * 256
Fraction = Fraction * Pres
Fraction = Fraction / 20
Sig(c + 1) = &H00
End If
Case 6 : Sig(c + 1) = Arbitary(c2 + 1) + 127 ‘store Arbitary values to signal variable
Case 7 : Sig(c + 1) = Rnd(255) ‘store Random values to signal variable for noise generation
Case 8 : Enable Pcint3 ‘Enable pin change interrupt for FM
Case Else : Sig(c + 1) = 127
End Select
Flag = 0
Disable Timer0
End If
Return
Normal Mode
In Normal Mode you select various output wave-
form signals and for each signal you can change
the parameters like amplitude, frequency, offset
Figure 2. etc. and view the output in real time using the
OMG it’s the ATMEGA1284AP
rotary encoder and the Back pushbutton on the
Programming Fuse Settings.
Platino board.
Now I can program my own
controller and avoid buying Normal mode also encompasses the FM feature,
one from the Elektor Store. in which a square wave is generated according
to the input value: if a logic High is detected on
the PD8 pin of the MCU then the output will be
rail for the opamps is available at the junction 125 kHz +50 Hz and if a Low is detected the output
of resistor R27 and R28. will be 125 KHz –50 Hz. This feature is provided
The +9 V voltage is also applied to a 7805 reg- for Software Defined Radio (SDR) experiments.
ulator (IC4) which supplies the necessary reg-
ulated voltage to the microcontroller and other Setup Mode
components operating off the +5 V supply rail. In Setup mode there are two options:
In case a 20-VDC input voltage is applied, the 1. Arbitrary mode: the user can enter values of
divided voltage with reference to virtual ground his/her choice. Then he/she can select the arbi-
will swing between –10 and +10 V (max.). trary signal from the Normal Mode and generate
a custom signal.
Software 2. Clock mode: In this mode the user can select
The software for the project was written in BAS- the frequency of the clock that is additionally pro-
COM AVR for the ATMEGA1284P microcontroller. duced side by side with the main output signal.
The source code and all other ingredients to bake
this embedded cake at home are available for The frequency generation is done on the basis of
free downloading by all readers [4]. A snippet time indexing, meaning a timer value is set on the
Table 2. Platino
‘jumper’ (solder K9
VCC
VO
RS
E
0V
0V
D4
D5
D6
D7
PLATINO
S6B
PC7
PB5
S5C
PC5
JP5 PB1
MISO SCK MOSI
IC2
PB5
PB4
PC4
JP13
XTAL1
PB6
BUZZER 40
JP10 S3B S2C
S2A JP1
PB6 PB7
JP11
JP6 PB2
RESET
JP12
JP8
28
JP7 PB3
XTAL2
PB7
JP5 X1 JP9
JP7
JP11 PB7 S3A JP4 PB1 S3C
PB3
S3 S4 S2B
PB2
PB0 PC0
JP6
S2
PC3
PC1
S1 PC2
JP12 PB6 D1
S5B
S6C
S6A
S5 S6
S1 S2 S3 S4
S4A S1B
Figure 3. S4C
Component List
Signal Generator Board
Resistors
Default: 5%, 0.25W
R1,R3,R5,R7,R9,R11,R13,R17 = 10kΩ
R2,R4,R6,R8,R10,R12,R14,R15,R16,R18,R19 = 20kΩ
R20 = 100Ω
R21,R24 = 1kΩ
R22 = 1.8kΩ
R23 = 120Ω
R25,R26 = 8.2kΩ
R27,R28 = 1Ω 2W
R29,R30 = 10Ω 1%
P1 = 100kΩ multiturn trimpot, vertical
Capacitors
C1 = 100pF
C2,C4 = 470µF 16V radial
C3,C5,C6,C9 = 100nF radial
C7,C8 = 22µF 25V radial
C10,C11 = 1000µF 63V radial
C12 = 470µF 35V radial
Semiconductors
IC1 = TL082ACP
IC2 = (CD)74HC4051
IC3 = LM337KCSE3
IC4 = MC7805
IC5 = LM317TG
IC6 = LM336BZ-5.0
D1 = BY500-800-E3/4
D2 = BZX79-C51
D3,D4 = 1N4007
Miscellaneous
K1 = 10-way pinheader socket strip, SIL, straight
K2 = 8-way pinheader socket strip, SIL, straight
K3 = 12-way pinheader socket strip, SIL, straight
K4 = 6-way (2x3) pinheader socket, double row
K5,K6,K7 = 2-way pinheader, vertical, 0.1” pitch
K8 = 2-way PCB screw terminal block, 0.2” pitch
IC socket, DIP-16
IC socket, DIP-8
PCB no. 130407-1 Figure 4.
Printed circuit board
component overlay. It’s all
through-hole electronics
Component List 2day.
Platino Configuration* Inductors
L1 = 10µH
Resistors
Default: 5% 0.25W Miscellaneous
R3 = 47Ω IC socket, DIP-40
R4,R5,R6,R7,R10,R12 = 10kΩ LCD1 = LCD, 4x20, 5V, with backlight
R11 = 4.7kΩ S5A = rotary encoder with pushbutton
P1 = 10kΩ, trimpot, horizontal X1 = 20MHz quartz crystal, CL= 18pF
K1,K2,K5 = 40-pin SIL pinheader, vertical
Capacitors K4 = 80-pin double-row pinheader, vertical
C1,C2 = 22pF, 50V, C0G/NP0, 0.1” pitch K9 = 36-way pinheader receptacle (socket), SIL,
C5,C6 = 100nF, 50V, X7R, 0.2” pitch vertical
S4A = pushbutton
Semiconductors
IC1 = ATMEGA1284P-PU, programmed *Please refer to ref. [3] for full description of Platino.
T1 = BC547C
Figure 5. (a) The three- basis of the frequency selected. This timer value printed separately.
board stacked assembly, is then used as an index to find the frequency to Carefully inspect all your soldering and assembly
top to bottom: LCD, Platino, be output from a lookup table. The timer value work before you apply power. When everything
Signal Generator board, (b) is also used to determine the speed and period is in order, apply power from the 18 VDC adapter
the same boards, separately. of the signal to be generated. through connector K8.
Figure 7.
A selection of messages and
menus that appear on the
LCD.
Figure 8.
Waveforms and purposed
noise produced by the
Experimenter’s Function
Generator.
Web Links
[1] Platino: Elektor October 2011, www.elektor-magazine.com/100892
[2] AVR SDR series: Elektor March through September 2012,
www.elektor-magazine.com/100180 (starter article)
[3] Platino PSU: Elektor April 2014, www.elektor-magazine.com/130406
[4] Project downloads: www.elektor-magazine.com/130407
Let’s begin with one With regard to the number of I/O pins we did
of the key issues facing every not have any particularly demanding wishes, as
designer at the start of a new project: selecting long as we had enough pins to handle an LCD
the microcontroller. module, two rotary encoders, an LED, a buzzer
and a pushbutton. The ATXmega128A4-AU from
The right microcontroller Atmel meets all of these requirements and has
Choosing the right microcontroller for a project the added advantage that it has so much onboard
is always a tricky business. What we actually memory that even the most gluttonous program-
wanted to use for this project was a microcon- mer should not come up short.
troller with built-in A/D and D/A converters so
the control loops could be made as fast as pos- Programming with Atmel Studio
sible. Although an external D/A converter would The software project for the ATXmega128A4-AU
be a possible alternative (most microcontrollers is set up in Atmel Studio 6, Atmel’s free software
have integrated A/D converters), that causes an development environment, and uses the Atmel
extra delay in the generation of the control sig- Software Framework (ASF) library. Although the
nals. Particularly for current limiting you always library is not essential for this project, it saves a
want to respond as fast as possible, preferably lot of programming and debugging effort. Among
before a transistor or some other component other things, the ASF library contains drivers
starts sending smoke signals. for the USB serial port (Communication Device
Class or CDC), the rotary encoders (QDEC), the
Another requirement was that we wanted to be A/D converter (ADC) and its counterpart D/A
able to control the power supply over a serial converter (DAC), the EEPROM memory and the
USB link, so a microcontroller with a built-in USB timers. Drivers are actually available for most
port would be convenient. Here again alternative of the peripheral devices of the microcontroller.
solutions are conceivable in the form of appli- The ASF library is a huge disorganized collection
cation-specific ICs, but they don’t come cheap, of routines intended to support Atmel’s large
so there is good reason to look for a suitable number of development, evaluation and demo
ready-made solution. boards and the microcontrollers mounted on those
boards. Fortunately, the Atmel Studio IDE has developers a long time ago), but if you search
a wizard that saves you a lot of effort searching all three groups at the same time you will auto-
through more or less incomprehensible names matically find the driver, component or service
and makes it fairly easy to link drivers to your that you need. If you don’t, then simply write
projects. However, using the ASF drivers results the code yourself.
in a large number of folders and subfolders with
lots of files, for which it is not always especially As previously mentioned, the ASF library is
clear why they are there or why they are located intended to support Atmel’s fleet of develop-
in a particular place. By the way, I have been ment boards and kits, so when you start a proj-
talking about drivers here but ASF distinguishes ect you first have to select a microcontroller and
between drivers, components and services. I have an associated board. Here we want to develop
not taken the trouble to delve into the differences our own board, so it is naturally not in the list.
between these three groups (I stopped trying Fortunately Atmel anticipated this situation and
to understand the mental processes of software added the option “User Board”. Our project is
therefore based on this User Board. We could The interrupt-driven loop is executed every
have chosen an Atmel board instead with the 100 µs (10 kHz), based on the system tick (Sys-
same microcontroller type and then modified the Tick). It first measures the output voltage and
files, but that would have probably cost us more current and then checks whether or not current
effort in the end than it saved. By the way, we limiting should be activated. If current limiting
didn’t do anything at all with the User Board files, is necessary, this loop temporarily ignores the
but they come with the package. fact that it is interrupt driven and proceeds to
All of the ASF files in the project are located in a reduce the output voltage as quickly as possible
subfolder with the suitable name “ASF”. A header to the point where the output current is at or
file (ASF.h) is placed in the SRC folder for the just below the maximum level. Everything else
project, where the IDE also puts the main.c file. is suspended while this is happening (it may be
This header file pools all the header files of the necessary to reduce the output voltage all the
various ASF drivers, so you don’t have to worry way to zero), and then life returns to normal.
about which files you need to include in your code. A 1 kHz loop and a 100 Hz loop are derived from
A simple #include ASF.h statement is sufficient the 10 kHz loop. The 1 kHz loop services the
for any code that wants to use the ASF functions. buzzer (on or off) and ensures that changes to
Our own C files are located in the SRC folder, and the desired output voltage and maximum current
our header files are located in the INC folder. are sent to the two DACs. The 100 kHz loop looks
There is a pair of C and header files for each after the rotary encoders, checks the pushbutton
peripheral. For example, for the buzzer there is and reads the temperature sensor.
a buzzer.c file and a buzzer.h file. There are
also files for the user interface and a number These three loops set flags that are processed by
of support files. File names and variable names the background loop. One of these flags indicates
are generally prefixed by the name of the file that the power supply is in current limit mode.
where they are defined. To cite the buzzer exam- The background loop checks this flag periodically
ple again, the function buzzer_beep(uint16_t and translates the flag status into visual and
ms) is located in the buzzer.c file. Its prototype acoustic signals. Although this more complicated
(declaration) is located in buzzer.h. than strictly necessary, it allows the acoustic and
visual signals to be made a bit more pleasant.
As you can see from the above, the program In this era of highly polished graphic apps and
is written in C. I could have used C++ instead, touch screens, that’s about the least you can
but I chose C because it’s easier to understand. do to meet user expectations. When the power
For most things it doesn’t make much difference supply suddenly starts beeping (a series of three
whether you use C or C++, but for the user inter- beeps) and the LCD lights up, you know that cur-
face I would have preferred to use C++. The rent limiting has taken over.
resulting C code uses (or misuses) C++ meth- Another flag indicates whether the user has
ods and would have been a lot simpler in C++. turned a knob or pushed a button. This flag is
necessary to inform the background loop that
Software design a new value has been set or a different screen
Another recurrent question is whether or not to has been selected. When the user changes a set-
use a real time operating system (RTOS). A few ting, such as the output voltage, they most likely
years ago RTOSs were fairly exotic, but now you expect the power supply to remember the new
virtually trip over them everywhere. The open- setting even after it has been switched off. For-
source FreeRTOS is an obvious choice and is avail- tunately this is possible thanks to the EEPROM in
able for our microcontroller. The downside of an the microcontroller. Writing data to the EEPROM is
RTOS is that it adds another library to the proj- relatively slow, so we do that at our convenience
ect and that task handling is often not so easy in the background loop instead of the 10 kHz loop.
to understand. I therefore chose a sort of hybrid This also applies to updating the display. LCDs are
approach with a loop that handles low-urgency fairly slow, and writing a full screen takes much
tasks in a fixed sequence and an interrupt-driven too long to be executed in an interrupt service
loop that handles time-dependent tasks. In a routine. This job is therefore delegated to the
manner of speaking, there are two tasks: a back- background loop. The display is refreshed very
ground task and a foreground task. 100 ms. Incidentally, this period is a compromise
between refresh speed and ease of reading. The several internal voltages and the temperature
display becomes jittery if the refresh speed is too reading.
high, especially with a variable load. That makes five pages in total. Actually there are
The background loop also maintains a seconds six, since the Calibration page is divided into two
counter based on the 100 ms screen update loop.
It is used to send measured values and settings
to the serial port (USB) once per second. This
counter also ensures that the settings are not
written to the EEPROM too frequently. When the
user is adjusting a setting, it is not necessary to
1
store all the intermediate values in the EEPROM.
We wait until the user has not changed any of the
settings for at least 10 seconds before assum-
ing that they are stable and can be stored in
the EEPROM. This also helps to prolong the life
of the EEPROM.
I don’t want to go into the details here of how the
2
background loop generates beep tones, but I do
want to mention that the background loop also
looks after the processing of commands received
via the serial port.
As you can see from all the above, the software
for the power supply handles a surprisingly large
number of tasks, especially for a power supply –
and I haven’t even mentioned screen handling
or calibration yet, because that’s what I intend
3
to do next.
User interface
The user interface for the power supply is dis-
tributed over several pages (see Figures 1 to
6). The first thing you see after switching on the
power supply is the “splash screen”. Actually this
should probably be called the start-up screen, 4
since there aren’t any images splashed on the
screen. The start-up screen shows the software
ID (Elektor project 120437) and version num-
ber (1.0). After a few seconds it is replaced by
the home screen with the usual power supply
parameters (output voltage, current limit, etc.).
If you press both rotary encoder knobs at the
same time, the Setup page opens. Here you can 5
configure various parameters, such as whether
or not you want to hear beeps and how long the
display backlight stays on. The latter option is
mainly intended to reduce the load on the back-
light power source, since it doesn’t have much
power to spare. From this page you can go in Figures 1 to 6.
The various menus
three different directions: to the Calibration page
displayed on the LCD:
by pressing the left rotary encoder knob, to the 6 (1) Start-up screen; (2)
Status page by pressing the right rotary encoder Home page; (3) Setup, (4)
knob, or back to the main page by pressing the Calibration 1; (5) Calibration
pushbutton. On the Status page you can view 2; (6) Status.
pages: one for the minimum voltage and current page.c file. When the DAC calibration page is
values and the other for the maximum values. active, which means that it is visible on the LCD,
Pages are pesky things. They have a lot of simi- the refresh function of the base class in page.c
larities, such as how the knobs and buttons work, is called. It then calls the appropriate functions
but also a lot of differences – mainly with regard of the derived class.
to what they show. Of course, you could simply Incidentally, I also want to say something about
code each page separately, but the rotary encoders and in particular about how
then you would soon notice they are linked to the global variables. The driver
that you are copying a lot of for the encoders comes from the ASF library
code. That’s why C++ or in the form of the quadrature decoder (QDEC)
another object-ori- driver. The SysTick interrupt loop invokes the
driver every 10 ms. Each encoder is linked to
a data structure containing the address of the
global variable to be modified by the encoder,
along with all sorts of other useful data. The pre-
viously described pages ensure that these
addresses match the depicted parameters.
A consequence of this is that you cannot see
directly which variable an encoder is linked
to. That makes the code more difficult to
understand, but it reduces the bookkeep-
ing effort for what goes where and avoids
unnecessary copying of data.
A final remark about the rotary encoders: we
Figure 7. added an acceleration mechanism so you don’t
The power supply board have to spin the encoder through 100 turns or
mounted on a Mean Well ented language so to adjust the voltage from 0 to 40 V (2048
switching power supply
would have been very steps). This mechanism makes the adjustment
module, which provides the
convenient here, so the dif- step size dependent on the rotational speed of the
48 V input voltage.
ferences and similarities could be captured in encoder. When you turn the knob slowly you can
classes. It would have also been possible to use adjust the setting with the smallest possible step
a mixture of C and C++, but I chose to use only size, but when you give it a fast spin you jump
C – in part because the AFS library is in C. I right away to the maximum or minimum value.
then used C to construct the pages in a manner
similar to C++.
The base class here is the page (page in the Calibration
page.c and page.h files), which declares a group The bad news here is that the power supply (actu-
of functions needed by every page (initialization, ally the control board) has to calibrated, but the
displaying various items, handling pushbuttons, good news is that the calibration procedure is
etc.). The differences with respect to the base fairly simple. All you need for this is a good mul-
class are then implemented individually for each timeter and (of course) a working power supply.
page. In a manner of speaking, these differences You use the multimeter to measure the control
are the derived classes. To use an analogy from voltages for the output voltage and current limit
electronics, if you run a page through a low-pass (Vset and Iset), either simultaneously or sequen-
filter you get the base class at the filter output, tially. The most convenient way to do this is to
and if you run a page through a high-pass filter measure the voltages on connector K5, specifi-
you get a derived class at the filter output. cally provided on the board for this purpose. The
This can be illustrated by the following exam- measured voltages lie in the range of 0 to 4 V.
ple. The page_calibrate_dac.c file contains the Use the following procedure:
functions for depicting the DAC data and for using Connect a multimeter between K5 pin 1 (GND)
the rotary encoders appropriately for this calibra- and pin 2 (Iset) or pin 3 (Vset) and select a
tion page. However, the page refresh function is voltage range on the meter that extends to at
the same for every page, so it is located in the least 4 V.
Switch on the power supply and wait until the 7.41 V). Enable the output by pressing the push-
home page appears. button. The LED should light up. Measure the
Press both rotary encoder knobs at the same output voltage with the multimeter and check
time to go to the Setup page. whether it matches the value on the dis-
Then press the left encoder knob (V) to go to play. A difference of a few tens of milli-
the Calibration page. volts is acceptable (for this design).
Now you have to adjust the minimum voltage. We have already described the con-
Use the left rotary encoder to select the top line trols and indicators, but for the
on the display (Vout); the selection is marked sake of clarity what they
by asterisks (*) at the start and end of the line. do is summarized in
Then turn the knob of the right encoder until Table 1.
the voltage reading on the multimeter is exactly
0.0 V. Repeat the above steps for Iset in
the second line.
Press the knob of the right encoder (or
the Save button) to go to the second Cal-
ibration page.
Now you have to adjust the maximum volt-
age. Use the left rotary encoder to select the
top line on the display (Vout); the selection is
marked by asterisks (*) at the start and end of
the line. Then turn the knob of the right encoder
until the voltage reading on the multimeter is Figure 8.
Here you can clearly see
exactly 4.0 V. Repeat the above steps for Iset
how everything is mounted
in the second line.
and connected in the
Press the knob of the right encoder to go to the enclosure.
Status overview, which shows exactly how the The software for the
ADC sees all this. The values shown here should power supply is open
be 0 V and 40 V. The binary values from the DAC source, and we encourage
are shown in brackets. Now press the Save button everyone to make improvements
again. If you want to change anything, you can or modifications as they see fit. We will probably
go back by pressing the knob of the left encoder. use the control board in a number of future Elek-
To exit the Calibration pages without saving any tor projects, due to its general-purpose design.
changes (as long as you have not pressed the
Save button), press the knob of the right encoder. Power supply assembly
In response the program will execute a restart. Figure 8 shows how the complete power sup-
Now set the voltage to any desired value (e.g. ply can be put together. We selected a compact
enclosure which has just enough room to mount Make openings in the front panel for the dis-
the Mean Well power supply module (see Part 1) play and the USB-B connector (make sure the
on the bottom of the enclosure. The enclosure in USB connector will not touch the enclosure after
the photos is a Hammond type 1401A (dimen- installation) and holes for the LED, the two rotary
sions 127x152x254 mm / 5x6x10 in). We moved encoders, the pushbutton and the two banana
the front and rear panels of the enclosure a bit jacks. Then mount the control board on the back
further to the outside to make more room inside side of the front panel. Use a length of 14-con-
the enclosure. ductor flat cable with a pair of insulation-dis-
placement headers to connect the two boards
The power supply board can be mounted on top together. Temperature sensor IC5 can be left
of the Mean Well module with a few standoffs. on the PCB to measure the average tempera-
With a bit of luck you can use the ventilation holes ture inside the enclosure. However, you can also
in the top cover of the Meal Well module for this mount it directly on the heat sink for T4 on the
purpose. Make openings in the rear panel for power supply board and connect it to the control
an AC power entry module and a power switch. board with three lengths of insulated wire. Finally,
For the AC power entry module you should use connect the output jacks to connector K2 on the
a type with a built-in line filter, since that will power supply board with a pair of short, thick
block a lot of interference. Connect the ground wires (2.5 mm2 / AWG #12 or #14). Keep these
terminal of the line filter (protective ground) to wires close together and pass them through a
the enclosure. Connect the output terminals of large ferrite bead to block high-frequency noise
the AC power entry module to the power switch emission from the power supply.
with short wires, and connect the other terminals After connecting everything and double-checking
of switch to connector K4. Connect the Mean Well the connections, you can switch on the power and
power supply module to connector K5 with short calibrated the power supply using the procedure
insulated wires. This way the Mean Well power described above.
supply module and the power transformer on the
power supply board are energized at the same After that the power supply is ready for use.
time by the power switch. All wiring connected We hope you enjoy using it on your own bench!
to the AC power entry module must be double (140431-I)
insulated. Wire the 48 V output of the Mean Well
Web Link
power supply module to connector K1 on the
power supply board. [1] www.elektor-magazine.com/140373
JOIN THE
EVOLUTION. 1905
1945
2005
Learn more
From 8 to 32 bits:
ARM Microcontrollers
for Beginners (1)
The board, the software and our first program
By
Viacheslav Gromov
(Germany)
This programming course will introduce you to opment boards are available: for our course we
the world of ARM Cortex-M0+ microcontrollers, have chosen the ‘SAM D20 Xplained Pro’, which
and, as always at Elektor, our emphasis is on is based around the SAM D20 low power micro-
practice rather than theory. Many free devel- controller. Thanks to support from the manufac-
opment environments and low-cost devel- turer Atmel, we are able to make a thousand of
K b o ards
1
at an d Thanks to support from Atmel, the manufacturer of the microcontroller, we
l e k t o rize have 1,024 SAM D20 Xplained Pro boards available at the special price of
price!
First come, first served!
More details: www.elektor.com/samd20-board
these boards available to interested readers at a the USB socket are both connected to the EDBG
reduced price: see the text box for more details. circuit. The power LED lights when the board is
The course will start with a brief overview of the supplied with power, and the status LED flashes
board and the microcontroller device, followed when the main SAM D20 microcontroller is being
by the installation of Atmel Studio 6.2. Then, for debugged over the EDBG or is in some other spe-
a little bit of instant gratification, we will build cial state. Both LEDs flash simultaneously when
our first project. We will compare the device with the debugger’s firmware is updated. The user
eight-bit microcontrollers, to which it is similar manual for the board can be found at [1].
in many ways. Then, in the next installment we
will describe the main peripheral elements and The microcontroller
how they can be used in simple projects. The SAM D20J18 is an interesting member of
the ARM Cortex-M0+ family. It offers 64 pins,
The board 256 kB of flash memory, 32 kB of SRAM, and
The block diagram of the board (Figure 1) might a wide range of peripherals, and can run at a
not look too exciting at first glance. As you can maximum clock frequency of 48 MHz. It is pow-
see, most of the 64 pins of the microcontroller
are brought out to headers, and tables are pro-
vided giving the pinouts of these headers and
(S3) UART TX PA24 PA25 (S3) UART RX
the other connectors.
LED0 PA14 SW0 PA15
EXTENSION 1 HEADER
is automatically switched off to reduce current GPIO PB06 5 6 PB07 GPIO
TC6/WO[0] PB02 7 8 PB03 TC6/WO[1]
consumption. It is nevertheless recommended EXTINT[4] PB04 9 10 PB05 GPIO
(S2) I2C SDA PA08 11 12 PA09 (S2) I2C SCL
to use a power supply capable of delivering at (S4) UART RX PB09 13 14 PB08 (S4) UART TX
(S0) SPI SS PA05 15 16 PA06 (S0) SPI MOSI
least 500 mA, whichever power input is used. (S0) SPI MISO PA04 17 18 PA07 (S0) SPI SCK
GND GND 19 20 VCC VCC_3V3
Headers EXT1 to EXT3 also carry power at 3.3 V 32kHz
19
CRYSTAL
to supply expansion boards. On each extension
header pin 1 (called ‘ID’) is reserved for the con- EXT2
1 ID 1 2 GND GND
nection of an ID chip on the expansion board. SAMD20J18 AIN[18] PA10 3 4 PA11 AIN[19]
EXTENSION 2 HEADER
(S4) UART RX
(S2) I2C SDA
(S5) SPI SS
AIN[0]
GPIO
ID
PB30
PB11
PA08
PA28
PA12
PA02
GND
PB13
PA27
PA15
PA03
GND
VCC
on-board voltage regulator to the microcontrol- show the pinout of the expansion board
(S5) SPI MOSI
ler: the current consumption of the device can connectors, the microcontroller pin
(S4) UART TX
(S5) SPI SCK
TC2/WO[1]
VCC_3V3
be measured by removing the jumper and con- names (yellow background) and their
AIN[1]
GPIO
GPIO
GND
Figure 2.
ARM SINGLE CYCLE IOBUS Block diagram of the SAM D20 microcontroller (courtesy
SWCLK
ARM CORTEX-M0+ Atmel).
SERIAL PROCESSOR
SWDIO WIRE Fmax 48MHz
DEVICE
SERVICE
UNIT
M M 32/16/8/4/2KB
S
RAM
HIGH SPEED
later in this course, and we will show how it can
S
BUS MATRIX NVM
256/128/64/32/16KB
CONTROLLERFLASH be used in practice. The event system, as in the
S S S ATxmega microcontroller series, can be config-
PERIPHERAL
ACCESS CONTROLLER
ured for example to wake the CPU from sleep
AHB-APB AHB-APB AHB-APB when a peripheral unit such as the ADC trig-
BRIDGE A BRIDGE C BRIDGE B
gers an event; however, not all peripherals are
PERIPHERAL
ACCESS CONTROLLER
PERIPHERAL
ACCESS CONTROLLER supported in this way. The microcontroller has
SYSTEM CONTROLLER two sleep modes: in idle mode only the CPU is
PIN[3:0]
powered down, while in standby mode the clock
PORT
66xxSERCOM
SERCOM
BOD33 VREF
XIN32
OSCULP32K
source and all peripheral units (except those oth-
XOUT32 XOSC32K OSC32K
XIN 8 x(See
Timer Counter
Note1)
XOUT XOSC DFLL48M
PORT
ADC
CLOCK
CONTROLLER
VREFB
troller family. On the left is the ‘ARM single-cy-
RESET SLEEP AIN[3:0]
cle I/O bus’, which allows the processor to have
RESET
CONTROLLER CONTROLLER 2 ANALOG
COMPARATORS CMP1:0] fast access to the GPIOs. Below that is the serial
GCLK_IO[7:0]
GENERIC CLOCK
CONTROLLER VOUT
debug interface, which has direct access to the
REAL TIME
DAC
VREFA
processor core. Below the ‘high speed bus matrix’,
COUNTER
WATCHDOG
which connects the core to the memories on the
X[15:0]
PERIPHERAL
TIMER
TOUCH
Y[15:0]
right via slave ports, you can see several data
EXTINT[15:0] EXTERNAL INTERRUPT CONTROLLER
NMI
CONTROLLER buses and the peripheral access controller: this
is in contrast to the arrangement in conventional
eight-bit microcontrollers. The peripheral access
controller can prevent peripheral registers from
er-efficient and fast, and is therefore suitable for being written to if necessary. The most import-
many different applications. Its current draw is ant peripherals are connected to the APB-C bus:
only 70 μA/MHz and can run from a supply volt- among these the most interesting are the six
age of between 1.62 V and 3.63 V. Of particular SERCOM blocks which provide for serial com-
interest are its peripheral touch controller (PTC) munications using a range of different protocols
and its event system. We will describe the PTC including USART, I2C and SPI. The pins used by
these blocks are configurable. With the exception
of the PTC, the remaining peripheral blocks will
be familiar from eight-bit microcontroller designs,
although the versions here are typically more
powerful and present in greater numbers. Each
of the eight timer/counters can be used in 2 x
8 bit configuration, 1 x 16 bit, or alternatively
two counters can be chained together to form a
32-bit counter. The left-hand side of the block
diagram is less exciting, being mainly concerned
with power management and clock generation.
Figure 3.
The simplest expansion board available from Atmel is a
prototyping board with a grid of uncommitted solder pads.
Figure 4.
The expansion boards
Universal expansion board
Atmel has developed several expansion boards for testing and training.
for the Xplained Pro board. They are designed to
help developers new to the device rapidly get to
the point of having a working prototype, and to
help them learn about the microcontroller. The
expansion boards conveniently plug directly into
the headers on the main circuit board. Each expan-
sion board includes an ATSHA204 ‘CryptoAuthen-
tication’ chip, which provides information to the
EDBG chip on the Xplained Pro board, for example
regarding the allowable supply voltage range and
maximum current consumption. This information
is then passed on to Atmel Studio, which allows
the development environment to offer links to data
sheets, libraries and example programs.
Figure 6.
The two QTouch boards will be used in a later installment
of this series.
Figure 7.
Click on the upper icon if you wish to install Atmel Studio
on a computer that does not have a permanent Internet
connection (all screenshots courtesy Atmel).
Figure 8.
At this point you should either click on ‘Create an
account’ or enter your personal details.
Figure 17.
The extension manager includes many additional
software tools that you may wish to install.
Figure 18.
The welcome screen of Atmel Studio 6.2.
Build succeeded.
========== Build: 1 succeeded or up-to-
date, 0 failed, 0 skipped ==========
A bright outlook
We hope you have enjoyed this first installment
Figure 21. of the series. For any comments or questions,
Atmel Studio should recognize the debugger on the please get in touch via the Books | DVDs | Vid-
board automatically. eos | Courses | Seminars | Webinars topic on
#include <asf.h>
T-Board Wireless
Suitable for various XBee, Bluetooth
and Wi-Fi wireless modules
By Luc Lemmens Wireless links are becoming increasingly common in
(Elektor Labs)
microcontroller circuits. Adding a wireless module
to a project can come in handy when you’re
working on a circuit design, for example
on a breadboard. For this we have devel-
oped a convenient T-Board that is suitable
for various types of wireless module.
The circuit
There aren’t very many components other than
the wireless module on the T-Board PCB (see IC1
5V XC6206P332P 3V3
the schematic diagram in Figure 2). The MOD1,
3 1
K1 and K2 connectors are necessary due to the
C1 C2
non-standard pin pitch of the wireless modules.
2
1u 1u
Other components on the board include a con- K3
RTS
nector for a USB/TTL interface cable with 3.3-V RXD
buttons (S1 and S2) and LEDs for special func- 3V3
tions (D1 and D2). K1 K2
1 20
VCC DIO0
2 Mod1 19
DOUT DIO1
3 18
As you can see from the schematic diagram, 4
DIN
DIO8
DIO2
DIO3
17
5 16
the two pins of the XBee module marked ‘NC’ 6
RESET RTS
15
RSSI DIO5
XBee
(not connected) are routed to the connectors for 7
8
DIO11 NC
14
13
NC ON/SLEEP
plugging the T-Board into a breadboard. That’s 9
10
DTR CTS
12
11
GND DIO4
because some modules from other manufactur- R1 R2
S2 S1
ers do have functions assigned to these pins.
330R
330R
The two pushbuttons S1 and S2 (labeled “Reset” reset D1 D2 commissioning
Figure 2.
and “Commissioning”) are not necessary in nor- The circuit consists of a
mal use. The Reset button is sometimes neces- 140374 - 11 wireless module, a voltage
sary for downloading firmware to the flash mem- regulator and a few passive
ory, and when you are developing new applica- components.
tions you will most likely run into situations where
this button comes in handy. The Commissioning
button is used with the XBee module for network
Table 1. Pinouts of several wireless modules.
diagnosis and configuration. That’s also not an
everyday activity, but it’s always nice to have Digi XBee Ciseco XRF RN171XV RN42XV
Pin no.
XBee ISM (868 MHz) WiFi Bluetooth
available. For more information about this, see
the Digi International application notes and data 1 3.3 V 3.3 V 3.3 V 3.3 V
sheets [2]. 2 Dout Dout Dout Dout
3 Din Din Din Din
LED D1 (RSSI) can be used as a signal strength 4 DIO8 RTS GPIO8 GPIO7
indicator for the most recently received data
5 #reset #reset #reset #reset
packet. This option is enabled by default in the
6 RSSI P1_7 GPIO5 GPIO6
Digi modules, and it can be switched on or off
7 DIO11 P1_6 GPIO7 GPIO9
using the XCTU software. LED D2, which is called
“Associate LED” in the Digi documentation, pro- 8 NC P1_5 GPIO9 GPIO4
vides network status and diagnostic information 9 DTR P1_4 GPIO1 GPIO11
in combination with the Commissioning button. 10 GND GND GND GND
With the Ciseco XRF module, D1 blinks once per 11 DIO4 P0_1 GPIO14 GPIO8
second when the module is working properly and
12 CTS CTS RTS RTS
D2 lights up when a data packet is sent.
13 on/#sleep on/#sleep GPIO4 GPIO2
Component List
Resistors
R1,R2 = 330Ω 5% 0.1W, SMD 0603
Capacitors
C1,C2 = 1µF 10V 10%, SMD 0603
Semiconductors
D1,D2 = LED, red, 20 mA, SMD 0805
IC1 = XC6206P332PR, 3.3V voltage regulator, SMD
SOT-89-3
Miscellaneous
K1,K2 = 10-pin pinheader, 0.1” pitch
K3 = 6-pin pinheader, 0.1” pitch
Mod1 = 2 pcs 10-pin pinheader socket, 2mm pitch
S1,S2 = pushbutton, PCB mount, 6 x 6 mm
Wireless module, e.g. Ciseco XRF [1] or Dig XBee
ZB-module
PCB # 140374-1 or
Ready assembled board excluding wireless module: Elek-
tor Store no. 140374-91
Better Accuracy
from the LM317
Voltage regulators have been indispensable in When we take all this into account, we can calcu- Based on idea from
modern electronic circuits for several decades. late the component values for the desired output Peter Krueger
They are available in many types and sizes, with voltage using the following formulas: (Germany)
either fixed or adjustable output voltages.
One of the oldest voltage regulators still in pro- R2theoretical = (Uout / Uref – 1) × R1
duction is the LM317, which was introduced back R2adjust = (Uout – Uref) / Iadjust
in 1971 by National Semiconductor. While the R2 tot = R2 theoretical × R2 adjust / (R2 theoretical +
present-day implementations of the LM317 are R2adjust)
likely to have a modified version of the original
chip design, the characteristics, pin-out and phys- Of course, you could use a trimpot for R2 and
ical dimensions continue to remain the same. adjust it until the desired output voltage has
The output voltage of the LM317 is easily set been obtained, but using this calculation you can
with the aid of two resistors connected to the mount the correct fixed resistor on the circuit
Adjust pin (Figure 1). The input voltage may go board right away. This same calculation can also
up to a maximum of 40 V and the IC can deliver be used with the negative version, the LM337.
more than 2 amps, provided that the difference
between the input and output voltages is less All the calculations here assume that the operat-
than 15 V. ing temperature of the IC is reasonably constant.
Both Uref and Iadjust drift somewhat with large
With the LM317 it is possible to set the output changes in temperature, while the output voltage
voltage very accurately, provided you first take the also varies a little with different load currents.
effort to measure the internal reference voltage (140341-I)
of the IC. This will be, depending on the manu-
facturer, between 1.2 and 1.3 V. To measure the
actual reference voltage the LM317 to be used
IC1
has to be plugged into a breadboard first, accord-
LM317
ing the schematic of Figure 2. R1 may have a
value between 240 and 470 Ω. Connect a voltage ADJ
Figure 2.
This value too can differ from one manufacturer
By connecting the Adjust pin
to another, so check the datasheet of the rele- to ground we can measure
vant manufacturer. the internal reference
voltage at the output.
An old Sumlog mechanical speedometer in an the results on a conventional 270° moving coil
elderly pleasure craft needed to be renewed in meter was impossible, as none of the mechanisms
the authentic style. High-tech disguised with tra- tried could support the weighty metal pointer.
ditional looks in effect. The new encoder under The movements designed for this function were
the boat is not connected to the display by a either too bulky or else rotated through an angle
shaft any more but with a cable. Along this cable of only 90°, meaning that the entire concept had
is fed a square-wave signal (produced by a reed to be fundamentally revised.
contact) that is proportional in frequency (10 Hz Accordingly a microcontroller was employed to
to 60 Hz) to the speed of the craft. evaluate the encoded signals. Using a small servo
The ‘mission impossible’ was to design some elec- (as used by model boat and aircraft hobbyists)
tronics that could measure the frequency of the driven by the controller as a substitute for the
square-wave signal and process the result for dis- movement seemed promising but turned out not
play in a circular instrument with a pointer needle entirely satisfactory. Servos with a setting range
and at least 270° indexing angle. The idea was to of 270° are very difficult to obtain, the normal
re-use the old casing complete with the original maximum being 180°. An auxiliary transmission
heavy metal pointer and scale on the back-plate. gear would be impractical. The eventual solution
And with the Sumlog speedometer, resetting the was a special stepping motor, similar to those
distance traveled was to be impossible. used by automobile manufacturers for tacho dis-
plays. Stepping motors of this type are surpris-
From 555 to microcontroller ingly reliable and can be had for very little outlay
The first analog trials using an NE555 and simple in the automobile spares section of eBay — or
R-C integration were entirely successful—from possibly from a scrapyard.
a purely electrical perspective. But displaying I acquired the stepping motor (stepper) used
Servo
IC2
78L05 D2 +12V
1N4148 2 1
R1 R8 R4
D4 C1 1N4148
10k
2k2
47k
3
100n T2
D3
20
R2 VCC 1N4148
1 15 R5 BC177
1k RESET PB3(OC1A)
13
PB1(AIN1)
4k7
IC1 Counter
19 11
PB7(SCK) PD6(ICP) 245679010
18 9
PB6(MISO) PD5(T1)
17 8 24V
PB5(MOSI) PD4(T0)
16 7
PB4 PD3(INT1)
14 6
PB2 PD2(INT0) C7
3
PD1(TXD)
12 2 D1 R6 R3
C5 PB0(AIN0) PD0(RXD) C6 C2 47u
16V
ATtiny2313
2k7
1k
XTAL2 XTAL1 GND
1u 100u 10n
ZPD4V7
10V 4 X1 5 10 10V T1 R7
4k7
C4 C3
6MHz BC107
18p 18p
GND
140280 - 11
GND Sensor
M Figure 1.
Switec MS X25
A servo mechanism or a
Stepper stepping motor can be
connected to the controller.
for this project on eBay [1]. This did not turn consider a ‘normal’ small bipolar stepping motor,
through 360° but through 315° from end stop to if the zero point was defined by a rigid mechan-
end stop, in 1260 steps. The end stops are solid, ical end stop. A stepping motor without its drive
with a large setting and holding torque, although mechanism and 1.8° steps resolves the 315°
unfortunately there is no feedback for indicating indexing angle in 175 steps. As a rule the strength
the position of the pointer. At startup, regardless developed is so great that the drive current of
of the actual position of the pointer, the stepper the magnet can be reduced significantly. All the
simply rotates by 1260 steps to the left, as far same, direct drive of the magnets by the con-
as the end stop. About 0.5 s of stepping zeroes troller is not standard practice.
it definitively. The stepper is operated in eight Note that we need to indicate not only speed but
phases by two solenoid coils under direct control also the distance covered. For this we employ
of an ATtiny2313 from Atmel. an electromagnetic counter, producing a reading
The hardware in Figure 1 is extremely straight- that is non-transient and cannot be reset. The
forward and arranged so that either one servo pulses from the encoder are totaled in the pro-
(with 180° indexing) or the stepper (with 315° cessor and when these reach a predefined count,
indexing) can be operated. Next to the ATtiny2313 a 10-ms pulse is output to PB1. Counter mecha-
we have the usual reset arrangements and the nisms for 5 V DC are virtually unobtainable and
crystal plus R6 and C2, which form a simple R-C most electromechanical meters [2] operate within
input filter for the sensor input. According to a DC range of 10–30 V. Accordingly we amplify
your requirements either the magnet coil of the the pulses from the controller using the circuitry
stepping motor or the servo can be connected based around T1 and T2. The counter used here
direct to the processor. is a 24-V model, although in some cases different
Instead of the special steppers you might also mechanisms could be driven either directly by
Stepper or servo?
If you are using a servo, the value of the Variable TCCR0B TCCR0A
OC1A
speed is simply shifted into the Register OCR1A. t T0
T
Using a stepper, with speed as a handover Vari- 8 - Bit - Counter PD4
Timer 0
able, we call up the Function MOTOR(). After this
speed is reset to zero and the counting process OC0A
Table 1.
MGC3130 RPi Mapped Gesture
EIO1 GPIO17 ç Flick EastàWest
EIO2 GPIO18 é Flick SouthàNorth
EIO3 GPIO25 è Flick WestàEast
EIO6 GPIO23 ê Flick NorthàSouth
and we combined it with the Gesture inputs from the MGC3130 sensor.
Now let’s combine all parts. The complete code can be downloaded from
1
the Elektor web page for this installment [4]. Copy the file to the RPi and
open it from the IDLE Python shell, see Figure 3.
The file opens in an editor window and you can execute the program by
selecting “Run” in the menu or just press F5. Play the game with flick-
ing gestures in the four cardinal directions over the Hillstar electrode. It’s
fun—see Figure 4.
In the pipeline
Next time we will play 2048 with the ready-made 3D Touchpad also included
in the Elektor/Microchip special offer [1]. We’ll also delve into the USB
interface and the 3DTouchpad Software development kit (SDK), and into
using the 3D Touchpad on Rpi’s USB port.
(140513)
Web Links
3
[1] Microchip Hillstar GestIC dev kit and 3D Touchpad product bundle:
www.elektor.com/microchip-dm160218-hillstar-development-kit-and-
dm160225-3d-touchpad
[2] Add 3D Sensing to your Micro or PC. Elektor November 2014.
[3] GestIC & 3D Touchpad Workbook (1). Elektor December 2014.
[4] 2048 Game on Rpi patched for MGC3130:
www.elektor-magazine.com/140513
[5] 2048 Game history and rules:
http://en.wikipedia.org/wiki/2048_%28video_game%29
[6] Hrvoje’s Blog:
http://blog.hrvoje.org/blog/2014/09/20/a-simple-2048-clone-in-python
CC2-eBoB
ChipCap2
humidity/temperature sensor
By Luc Lemmens Sure thing, the brilliant ChipCap2 humidity/temperature sensors from Amphenol
(Elektor Labs)
Advanced Sensors can be soldered by hand, but their footprint doesn’t match any
breadboard this side of Pluto. A small PCB with a standard .1” pitch pinheader
connecting all sensor pins to the outside world is sure to make (breadboard) pro-
totyping a lot easier. Our second e-BoB is born.
Here’s the temptation: individually calibrated and to keep the moisture in a confined space like a
tested, Amphenol Advanced Sensor’s ChipCap2 (wine?) (circuit?) cellar or basement within an
(also called: ChipCap 2; CC2) sensor achieves acceptable range. The criteria for ventilating are
±2% accuracy across 20% to 80% RH, or ±3% a bit more sophisticated though, for example
across the entire humidity range. It’s a plain the system also calculates the absolute humid-
simple part to use without further calibration or ity levels and takes their values into account.
temperature compensation. Mouth watering! I Also, the inside temperature is monitored for
want one! Can I plug it into a protoboard? You frost protection.
can, with our specially designed eBoB.
In the original design two HYT939 humidity/tem-
From the cellar originally perature sensors from IST Innovative Sensor
We designed this little board as part of a larger Technology are used. These devices are rather
project published on the Elektor.Labs website [1]. expensive and since we need two of them for
The project involves inside and outside relative this ventilation system, we decided to use the
humidity (RH) and temperature measurements. more affordable ChipCap2 humidity sensors from
Depending on the values measured a window is Amphenol instead, which cost about a fifth of
opened or closed, and a fan is switched on or off the IST parts.
Since both brands of sensor can be connected to Table 1. CC2 (ChipCap2) part number list
the I2C bus—and at first glance even look com-
Part number Description
patible with the same default I2C address, com-
CC2A25 analog, 2%, 5V
mands etc.—it appears that both sensors can
be used in our ventilation system with trifling CC2A23 analog, 2%, 3.3V
software changes. However, we haven’t studied CC2D23S digital, sleep mode, 2%, 3.3V
the HYT939 in detail (yet). CC2D25S digital, sleep mode, 2%, 5V
CC2D23 digital, 2%, 3.3V
Analog and digital interfacing CC2D25 digital, 2%, 5V
The ChipCap2 can be used either in I2C mode
CC2D35 digital, 3%, 5V
(type CC2D like in our application) or in Pulse
CC2A33 analog, 3%, 3.3V
Density mode (PDM; type CC2A), in which case
two separate pins—after some passive filtering— CC2D33S digital, sleep mode, 3%, 3.3V
provide analog temperature and humidity sig- CC2D35S digital, sleep mode, 3%, 5V
nals. See Table 1 for all available versions. Our CC2D33 digital, 3%, 3.3V
breakout board layout is designed for both the CC2A35 analog, 3%, 5V
analog and the digital versions of these sensors–
though some components must be changed—but
here we will focus mainly on I2C, i.e. the CC2D. munication protocol with support for 100 kHz to
400 kHz bit rates. External pull-up resistors are
Sensor pad descriptions required to pull the drive signal High.
Power pads (not: pins) VDD and VSS (pins 7 and The alarm outputs (pads 1 and 8) can be used
6) are used for connecting a supply voltage in to monitor whether the sensor reading has
the 2.7 V to 5.5 V range depending on the exact exceeded or dropped below pre-programmed
version of the CC2. The pads should be decou- relative humidity values. The alarm can be used
pled with a 220-nF capacitor (.22 µF in the US). to drive an open-drain load connected to VDD,
VCORE is an internal voltage of the CC2 and or it can function as a full push-pull driver. If
should only be connected to a 100-nF (.1 µF) a high-voltage application is required, external
decoupling capacitor to ground. devices can be controlled with the Alarm pins,
as demonstrated in Figure 1.
Sensor data gets transferred in and out of the
device through the SDA pad (3), while the com- The two alarm outputs can be used simultane-
munication between ChipCap2 and the microcon- ously, and these alarms can be used in combina-
troller (MCU) is synchronized through the SCL pad tion with the I2C. Thresholds at which these alarm
(4). ChipCap2 has an internal temperature-com- pins are activated or deactivated can be set, the
pensated oscillator that provides a timebase for output pin configuration (e.g. open drain, push-
all operations, and uses an I²C-compatible com- pull) and active output level can be set in the
Figure 1.
CC2 (ChipCap2) in stand-alone application.
12V 12V
VDD
HUMIDIFIER DEHUMIDIFIER
CC2A’s internal EEPROM, which we will discuss
later. Once these pins are configured via I2C, the
VCORE SCL
5 4 ChipCap sensor can work standalone—no help
GND SDA
6 3 from a microcontroller is needed to build a basic
VDD PDM_H
7 2 humidity control system, hooray.
ALARM_HIGH ALARM_LOW
8 1
VDD
A rising edge on the Ready pin indicates that new
data is ready to be fetched from the I2C interface.
The Ready pin remains High until a Data Fetch
(DF) command is sent; it stays High even if addi-
tional measurements are performed before the DF.
The Ready pin’s output driver type is selectable
as either full push-pull or open drain using the
Ready_Open_Drain bit in EEPROM word Cust_Con-
VDD
fig. Point-to-point communication most likely uses
R1 R2
the full push-pull driver. If an application requires
C2 interfacing to multiple parts, then the open drain
10k
10k
Measurement Modes
The CC2 (ChipCap2) is factory-programmed to operate If the next data fetch is performed too early, the data will
in either Sleep Mode or Update Mode. In Sleep Mode, the be the same as the previous fetch with stale status bits. A
part waits for commands from the master before taking rising edge on the Ready pin can also be used to tell when
measurements. valid data is ready to be fetched.
In Update Mode, I2C is used to fetch data from the digital In Sleep Mode, the CC2 core will only perform conversions
output register using a Data Fetch (DF) command. Detecting when CC2 receives a Measurement Request command
when data is ready to be fetched can be handled either by (MR); otherwise, the ChipCap2 is always powered down.
polling or by monitoring the Ready pin. The status bits of Measurement Request commands can only be sent using
a DF tell whether or not the data is valid or stale. After a I2C, so Sleep Mode is not available for PDM.
measurement cycle is complete, valid data can be fetched.
Component List
Resistors
R1,R2 = 10kΩ 1% 100mW case 0603
R3,R4 = 0Ω 100mW case 0603
Capacitors
C1 = 100nF 16V 10% X7R case 0603
C2 = 220nF 10V 10% X7R case 0603 Miscellaneous
K1 = 7-pin SIL pinheader, 0.1” pitch
Semiconductors Ready assembled CC2-eBoB: Elektor Store #
IC1 = CC2D35 Humidity/temperature sensor, digital, 140154-91 Figure 3.
(Amphenol Advanced Sensors) CC2-eBoB PCB component
overlay.
From pads to pins I2C address stored in its internal EEPROM, in the
The hardware of the CC2-eBoB pictured in Fig- Custom Configuration register (see Table). This
ure 2 is straightforward, essentially not more means that by factory default all devices respond
than a little board that makes the sensor pins to the same address, which can only be altered
accessible on a plain 7-way 100-mil (0.1”) pin- by software.
header. For most I2C applications only four pins
(SDA, SCL, VDD and GND) will do. The other At [3] we found a very useful, extensive Arduino
three pins, –EOC/Ready, AL_H and AL_L– can (and Python) library written by Richard Wardlow,
then be omitted to save some space on the tar- which contains most definitions and functions
get (bread)board. needed to communicate with the CC2D sensors in
The power supply and Vcore pads are decoupled I2C mode. There’s also a simple example sketch
as prescribed in the datasheet. that writes some settings to the sensor and reads
The board has 10-kΩ pull-up resistors on the humidity and temperature values, which are dis-
SDA and SCL lines, which will do for most stan- played via the serial monitor of the Arduino pro-
dard speed I2C applications. Connecting several gramming environment. This example can be
CC2-eBoBs to the bus can be done without mod- used for initial testing of the breakout board. Of
ifications, although four (resulting in a 2.5-kΩ course, I2C signals SDA and SCL must be con-
pull-up on both lines, about the minimal value for nected to the corresponding pins of the Arduino
I2C) should be considered as a maximum for the board.
number of boards. If more sensors are needed,
desolder their pull-up resistors R1 and R2. The library also contains functions to handle the
Zero-ohm resistors R3 and R4 can be replaced by READY (End Of Conversion) pin of the CC2A, but
suitable values and C3, C4 can be added to filter we prefer to poll the sensor’s status bits via I2C
the temperature and relative humidity signals
when the CC2 is used in PDM mode. To enable
PDM R1 and R2 must be shorted, i.e. SDA and
SCL connected to VDD.
CC2A in PDM Mode
Although the focus on the application of this humidity/temperature
Software (and off to the library) sensor is on the I2C mode, the CC2-eBOB is also suited to use the
Before discussing some software aspects of the PDM mode.
CC2, take a minute to read on the functionality In this case, pin 1 and 2 provide pulsed signals that represent the
of the Measurement Mode and the Command temperature and relative humidity values measured by the sensor. After
Mode, which are explained in their respective first order passive filtering (with R4/C4 and R3/C3 respectively, see the
text boxes. CC2A Application Guide) the values can be determined using A to D
conversions, and calculated.
I2C devices have fixed addresses on the I2C bus—
many of them have one or more external address To use this mode, both I2C lines are connected to VDD.
pins to make it possible to hook up more iden- Consequently on our eBOB R1 (SCL) and R2 (SDA) are shorts instead of
tical devices on unique addresses to the same 10 kΩ resistors.
bus. The ChipCap2 however has a predefined
Command Mode
Command Mode commands (see Table 2) are only issued, which—as the name suggests—returns the sensor to
supported for the I2C protocol. ChipCap2 sensors have normal operation.
internal EEPROM for storing parameters associated with It is important to note that changing EEPROM parameters—
the alarm pads (like thresholds, pin configuration), Ready or at least entering the Command Mode—must be done
pad configuration, Command Window length and the I2C immediately after power up of your circuit. As an alternative
address of the sensor. the VDD pin of the sensor can be switched by software if
After power up there is a short time interval (Command you connect it to a port pin of a microcontroller for example,
Window) during which this mode can be activated by in which case the sensor can be reset any time you need to
sending a Start Command Mode instruction. After that the alter its configuration during program execution.
user can access the EEPROM address range from 0x16 to Consult Table 4 if you want to deeply customize the
0x1F (see Table 3) until a Start Normal Mode command is operation of the CC2.
to determine if humidity and temperature values perform this task. The result is available at [4].
are ready to be read. Note that the power supply pin of the breakout
Unfortunately this library does not support re-pro- board must be connected to an Arduino digital
gramming the I2C address, that’s why we wrote output (PB0) pin, which is controlled by software.
a simple sketch (CC2A_set_I2C_address.ino) to In this sketch two constants are defined:
1. CURRENT_I2C_ADDRESS = 0x28 (factory default!) settings of the alarm pins of the sensor. These set-
2. NEW_I2C_ADDRESS = 0x22 (or any other unique tings will be reset to factory default by this sketch.
value between 0x00 and 0x7f) It certainly is a good idea to put a small sticker
with the new I2C address on the backside of the
The sketch changes the address by simply writing CC2-EBoB!
to EEPROM address 0x1C, the Custom Configura- (140154)
tion Register of the CC2D. Note that we are writ-
ing to a 16-bit register and that the I2C address
is found in the lower seven bits of this word. All
higher bits are zeroes by factory default, most of
them are assigned to special user configurable
Web Links
[1] Basement Ventilation:
www.elektor-labs.com/project/basement-ventilation-system-control-unit-140432.14275.html
[2] ChipCap2 Application Guide:
www.digikey.com/document-redirector?doc=http://www.digikey.com/Web%20Export/Supplier%20
Content/GESensing_45/PDF/ge-sensing-chipcap2-application-guide.pdf
[3] Arduino & Python libraries: https://github.com/circuitsforfun/ChipCap2
[4] Project support page: www.elektor-magazine.com/140154
This outdoor thermometer in a waterproof case uses Bluetooth Low Energy 4.0
(BLE) to communicate with a modern touch-screen phone: iPhone 4S (or later),
Android 4.3 (or later), by means of a self-contained BL600-SA module designed
by Laird. There are no (other) active components—everything is in the mini-mod-
ule which is programmed in… BASIC!
I’m very keen on Bluetooth, and this thermom- sensors connected directly to the module, but also
eter gives me a good excuse to use the latest to transmit the measured values to any Bluetooth
version of it, which is of interest because the v4.0 receiver (touch phone or tablet, computer,
current required is much less than for the pre- bridge, etc.) So it’s now almost child’s play (for
vious Bluetooth standards (2.0 and 1.0) — with big kids!) to communicate by radio with small
which the BLE mode is therefore not compatible. portable devices, powered by AAA or button cells.
The ‘A’ in the module’s reference number indi-
Bluetooth in BASIC cates that its antenna is built in.
The BL600-SA’s smartBASIC programming lan-
guage (event-oriented) simplifies the inclusion of Remarkable for its low consumption, the BL600-SA
Bluetooth by making it easier not only to manage module is based on the nRFS1822 chipset from
Impressive, eh? It’s also remarkable for its very ‘//************************************** Figure 1.
modest price. The photo (Figure 1) shows the Judging by the size and
‘ LONG TIME : 2 seconds => led off
module on the evaluation board (SDK) offered by population density of the
‘//************************************** BL600 evaluation board,
Laird Technologies. Yes, you have to look pretty
there must be a lot going on
hard to find it… The manufacturer seems to be
FUNCTION Func0() in the discreet radio module
aiming it principally at paramedical telemetry
Dim rc (the white rectangle on the
applications (blood pressure, heart rate, tem- right-hand edge).
perature, etc.) — but it’s up to all of us to extend ‘ led off
its fields of application. rc = GPIOSetFunc(17,2,0)
TIMERSTART(1,2000,0)
The first time I used it, it took me less than an ENDFUNC 1
hour to send 1’s and 0’s to the BL600 from my
iPhone and then make an LED flash. Following this ‘//**************************************
encouraging start, I stopped counting the time it ‘ SHORT TIME : 100 milliseconds => led on
took to arrive at my little self-contained outdoor
‘//**************************************
thermometer. Especially not the number of pages
FUNCTION Func1()
of the very comprehensive documentation, nor
Dim rc
the time spent on the manufacturer’s website [4].
‘ led on
And then there’s the eternal question of minia-
turization: the module is so densely-integrated rc = GPIOSetFunc(17,2,1)
that it’s difficult but not impossible to solder it TIMERSTART(0,100,0)
by hand (it’s like watch-making!) Fortunately, ENDFUNC 1
Laird Technologies have found a simple trick for
holding the module in position accurately — I’ll ‘//**************************************
be coming back to this later. ‘ event
‘//**************************************
Flashing ONEVENT EVTMR0 CALL Func0
Using this first – very simple – flashing LED pro-
ONEVENT EVTMR1 CALL Func1
gram, I was able to verify that when the LED is
off, the module only draws 5 µA. The same prin-
‘****************************************
ciple will be used for stopping the module’s Blue-
tooth function at intervals to save the battery. ‘ main program
‘****************************************
Dim rc
‘//************************************** ‘ output GPIO 17 and led on
‘// Jennifer AUBINAIS 2014 rc = GPIOSetFunc(17,2,1)
‘// Test sleep with led TIMERSTART(0,100,0)
‘//************************************** // SLEEP : close uart
uartclose()
come back to this in a moment.
rc = GPIOSetFunc(21,2,1) ‘// TX The supply is via the BL600’s SIO_19 pin in order
rc = GPIOSetFunc(23,2,0) ‘// RTS to reduce the consumption to 5 µA in stand-by
WAITEVENT mode. In deep-sleep mode, the consumption
drops to 0.4 µA – but it can only be woken up
Circuit again by resetting the module or by a change of
It won’t take us long to go through the cir- state on an input. While in stand-by mode, soft-
cuit. To measure the temperature, I’m using ware interrupts allow Bluetooth communication
the BL600-SA ADC (MOD1 on the diagram in to be re-established briefly, just long enough to
Figure 2) with an NTC thermistor connected to see if anyone is trying to connect. I arbitrarily
K3. It can be remoted if necessary — the length chose a sleep period of 500 ms (configured in
of the lead is not critical. The measurement is the TIMERSTART function). When the connection
made with the help of a potential divider using is established, the consumption during trans-
a known resistance: R1 = 10 kΩ 0.1 %. The mission is 10 mA.
equation for the temperature as a function of
the value of the NTC is a logarithmic function Connector K2 is used for possible updating of the
that exceeds the BL600’s calculation capacity. BL600’s firmware via a special JTAG interface.
So this calculation, which requires a data table In principle, this function is not needed for this
(temperatures, resistances, thermal coefficient project (but you never know…). Connector K1 lets
alpha) provided by the thermistor manufacturer you program the BL600 from a PC via a 3.3 V
[10], will be performed on and by the smart- serial interface. The FT232R BOB [6] offered by
phone and an iOS or Android application. I’ll Elektor in the e-shop is perfect for this purpose.
VCC
K2
1 2
BT1
3 4
CR17345 C2 5 6
R2
Lithium 7 8
3V 100n
12k
9 10
VCC
C1
29 28
GND GND
100n 30 27
K1 NC NC
1 RX 31 26
GND SIO_19
2 TX 32 25
TX SIO_18
3 CTS 33 24
RX SIO_17
4 RTS 34 23 R1
RTS NC
5 VCC 35 22 R4
10k
CTS RESET
6 GND 36 21 R3
1k
SIO_25 SIO_16
37 MOD1 20 0%1
150R
GND SIO_15
38 BL600-SA 19
NC SIO_14 JP2
VCC 39 18
NC SIO_13
40 17
SIO_28 GND
R5 41 16
SIO_29 SIO_12
42 15
10k
SIO_30 SIO_11
43 14 K3 NTC
JP1 GND SIO_10 S1 LED1
Figure 2. 44 13
SIO_0 SIO_9
SIO_1AIN
SIO_2AIN
SIO_3AIN
SIO_4AIN
SIO_5AIN
SIO_6AIN
1 −ϑ
SIO_7
SIO_8
GND
GND
GND
VCC
RESET
thermometer using the 2
R6 1 2 3 4 5 6 7 8 9 10 11 12
BL600-SA. In the Laird
family, the BL600 only
10k
The LED serves two functions: I use an alpha α(%/K) coefficient that varies
according to the temperature ranges laid down
• debugging (with jumper): it flashes all the by the manufacturer [1] (Table 1), yielding the
time and shows the Bluetooth stand-by and following equation:
module connection modes ⎡ αx 2 ⎛ 1 1 ⎞⎤
• normal (no jumper): it flashes briefly during ⎢ 100 ⋅(Tx ) ⋅⎜⎝ T − Tx ⎟⎠ ⎥
initialization to indicate that the thermome-
RT = RTx ⋅e ⎣ ⎦
Calculations
Without going into details, we shall note that the
calculation of the thermistor value is achieved by
measuring the voltage on a divider.
Table 1.
⎛ RRx ⎞ R/T No 4901
VCC
⎜ R + Rx ⎟
Vx = Vcc × ⎜ B25/100 = 3950 K
RRx ⎟ T (ºC)
⎜ R1+
R1
⎟ RT/R25 α (%/K)
⎝ R + Rx ⎠ –30.0 16.915 6.1
Vx .
. –25.0 12.555 5.9
R Rx .
–20.0 9.4143 5.7
⎛1 1 ⎞
β ×⎜ −
⎝ T 298 ⎟⎠
Rctn = R25 × e 20.0 1.2474 4.5
25.0 1.0000 4.3
R25: resistance value at 25 °C 30.0 0.808 4.2
T: calculated temperature in K
35.0 0.6569 4.1
β: NTC beta coefficient
40.0 0.5372 4.0
Rntc: NTC value at the calculation temperature
And lastly, an example of a calculation using this that can be plugged onto the main PCB via indi-
latter equation and the following parameters: vidual pin sockets. All you have to do is recover
RT = 10506.46 Ω (RNTC) the eight pin sockets by extracting them from
=> 12474 Ω > RT/T25 > 10000 Ω the plastic housing of a SIL socket header, then
=> αx = 4.5 solder them onto the oblong PCB, and finally
=> Tx = 20 °C = 293.15 K solder the CR123 battery holder onto the same
=> RTx = 12475 Ω board (paying attention to the polarity!)
K1 LED1
C1
JP2
MOD1
K2
2 10 R2
R4
1 9
K3
Figure 3. C3
R3 R1
For those who don’t fancy
JP1
the dainty work, Elektor is
(C)Elektor
140190-1
BL600-SA
radio module
example application
Component List
Resistors JP2 = 2-way socket e.g. Molex (9731148)
R1 = 10kΩ 0.1%* 2 jumpers
R2 = 12kΩ* K1 = 6-pin pinheader
R3 = 150Ω S1 = miniature pushbutton (1555985)
R4 = 1kΩ CR123A* battery holder (1650670)
R5,R6 = 10kΩ 16 PCB pin sockets
10 kΩ thermistor CTN B57891S103F8 (2112816) Enclosure, Multicomp type G302 (1094697)
PCB # 140190-1
Capacitors Ready assembled Bluetooth 4.0 thermometer, Elektor
C1,C2,C3 = 100nF, 0.2” pitch Store # 140190-91
Miscellaneous
JP1 = 3-pin pinheader
My grandfather, whom I used to see collecting all sorts of things, is behind my love of
electronics. Thanks to him, I am intrepid about the hobby. My journey started at secondary
school with the school computer, leading me on to Brevet de Technicien Supérieur [Higher
Technical Certificate] (with full marks in electronics), then to graduating as an IT engineer in
1992. As an operations engineer on major systems, Windows server support engineer, and vba
and vbnet applications developer, I’ve done a bit of everything, except for Linux and networks.
Around 2012, nostalgia for the smell of solder: return to electronics, with a small business
associated above all with my projects with Elektor. I specialize in Bluetooth and Wi-Fi interfaces
with iOS and Android smartphones.
shows how to establish the link between module Thanks to the French developpez.com forum,
and telephone, initializing the ADCs, then after where I found some help, above all for creating
half a second, the module transmitting the data a homogeneous interface for all sizes of Android
to the telephone: battery voltage, divider supply phones. I’ve created my own BL600 Serial appli-
voltage, divider midpoint voltage, in the form of cation (code and interface) but under a new name
a string like this: PW3012V853C433. The app on and in a simplified form [8], just for connecting
the phone performs the actual calculation. to my JATEMP thermometer. The “Scan and Con-
nect” button made it possible to receive the raw
iOS & Android programs thermometer data character string; I’ve replaced
Laird Technologies offers a download of the source it with a thread as under iOS (see above).
code for the BL600 Serial application for iOS,
but as I am experienced with iOS, I preferred to For iOS and Android, the temperature calculation
write my own application [7] which displays two corresponds to the description above, with the
pieces of information: temperature and connec- addition of the details. The application’s screen
tion status. I then incorporated the sources of the background changes according to the tempera-
BL600 Serial program (UARTPeripherial.c and ture measured. These two processing elements
DataClass.c). I haven’t created a connection and are coded in the jatemp.c source code. To avoid
disconnection button. I’ve replaced this action by remaining connected indefinitely to the thermom-
a thread which looks for the thermometer JATEMP eter, the iOS application stops after 5 mins (or if
when it is disconnected (it’s the thermometer that you press the phone’s Home key). Under Android,
disconnects itself) and connects itself. the application no longer looks for the thermom-
eter after 5 mins or if you press the Home key;
As I didn’t have any expe- the application is not actually stopped.
rience in Java program-
ming, the program To establish communication with the phone
under Android and connect the thermometer for the first time,
gave me quite you don’t have to do anything. Everything is
a headache. automatic.
Conclusion Figure 4.
I hope I’ve convinced you of the interest of the The thermometer
BL600 and maybe even to try the adventure with application on the screen
the reflow oven, or even hand soldering, if you of iOS and Android touch
have dainty fingers. phones.
For implementing an application based on the
BL600 module, the drawback of the miniaturiza-
tion of the contacts is more than made up for by
the advantages of very easy construction and by
the simplicity of its smartBASIC language and of
the programming via the module’s UART interface.
And that’s only the beginning… In the meantime,
Laird Technologies is offering the BL620, which is
the BL600 master: the same hardware but new
firmware, capable of communicating with other
BL600 modules. This opens up new prospects
that Elektor and I will be sure to invite you to
explore with us in the near future.
[140190]
Figure 5.
The author’s prototype, in a
waterproof case and fitted
with a sturdy screwed hook.
Web Links
[1] www.lairdtech.com/Products/Embedded-Solutions/Bluetooth-Radio-Modules/BL600-Series/
[2] www.elektor-magazine.com/140190
[3] www.elektor.com/bluetooth-thermometer
[4] https://laird-ews-support.desk.com/?b_id=1945
[5] www.youtube.com/watch?v=0YlKxtYwQiE
[6] www.elektor.com/ft232r-usb-serial-bridge-bob-110553-91
[7] https://appsto.re/fr/XTwnV.i
[8] https://play.google.com/store/apps/details?id=com.JA.bletemperature&hl=fr
[9] www.aubinais.net
[10] EPCOS NTC
www.epcos.com/inf/50/db/ntc_13/NTC_Leaded_disks_S891.pdf
www.epcos.com/blob/531152/download/2/pdf-standardizedrt.pdf
NTC Thermistors / General technical information:
www.physics.queensu.ca/~robbie/ENPH354/NTC-Thermistors-Technote.pdf
C1 LA1
The vintage circuit in Figure 7 shows that a
LS1 (standard) low-voltage lamp has also been
L1
employed in the output stage of this valve ampli-
fier to limit the power.
tweeter
absorb the majority of power delivered by the the filament lamp will produce the required volt-
amp. The small amount of power left over drives age drop when a silicon bridge is substituted for
LA1
the speaker at low volume but the sound you hear tube rectifiers in the power supply of a vintage
is of the amp driving hard with all its attendant tube amp. LA3
distortion effects. You can use an appropriately
LS1
rated lamp as the load in this application (LA2 To give a transistor amplifier a tube amp sound LA2
in Figure 8); the resulting sound together with you can insert a lamp between the amp output
the compression effect described above is both and the loudspeaker. To make the effect even T2
full and realistic. more pronounced replace the emitter resistors
in a conventional transistor output stage with
Tube-ify it! small filament lamps (Figure 10). Now when
Incandescent lamps and vacuum tubes are both the amp is overdriven, the resulting distortion is V–
made up of hollow glass envelopes. Although this much less harsh and the sound quality is remi-
is in no way sufficient technical justification to niscent of a tube amp.
use them, it is possible with the help of a lamp to (140188) Figure 10.
make a transistor amp sound more like a valve Tube-ifying a transistor
amp. First of all we can use a lamp as shown in amplifier.
Advertisement
3.
GB 30588
More than 45 years of experience | 24-hour shipping | More than 50,000 products +49 (0)4422 955-360
Video ADC/DAC’ing
on a shoestring
So why does every TV, camera etc. have com-
posite video connectivity and not fiber optic?
The answer is the complexity of digitiz-
ing the video signal, which invariably
When the optical fiber needs fast A/D and D/A conver-
became really useful in the early 1980’s, tors. These devices sadly are
people started digitizing video to convey it power hungry and expensive.
via the “new connection method”. Because of Fortunately there is an cheap and easy way to
the very non-linear properties of the transmis- digitize video without doing any A/D conversion.
sion by fiber optics, the signal has to be digital. Everybody knows what it is—PWM. With PWM
i.e. consisting of ones and zeroes. you translate the instantaneous voltage of an
analog signal into a pulsewidth. The pulsewidth
Thin cable, big advantage is a finite time and can be expressed in seconds
Sending video over coax cable is quite difficult or fractions of a second.
and in practice the maximum length covered is The Nyquist Sampling Theorem rules that the
about 300 feet (100 meters). Even at that dis- frequency of the PWM signal is kept constant and
tance the colors of a composite video signal start has to be at least twice the maximum bandwidth
to deteriorate. With fiber optic cable no such of the signal that you want to convert. The min-
problems occur and you can cover many miles imum bandwidth for composite video is about
without running into distortion. 5.5 MHz, hence the minimum PWM frequency
MCP1700-500E2E/TT
U6 5V
3 2
C12
1
1u
MCP1700-500E2E/TT
U7 5V
3 2
J2
1 C8 C11
+6V C13 C14 1 C10 C7
2
GND C5 C9 10n 10n
100n 10u 10u 10n
10V 10V
10n 10n
L1
L2
1uH
R1 4 U4 3
C2 C4
1k
1 R5 R6
BFT92 ADCMP600
6 & 4 2 4 R4
39R
U2
2k2
3
1k1
3
2
74LVC1G98 J1 2 OPTICAL
FIBER
J3-A
AUDIO
R3
C6
Figure 1.
75R
would be of the order of 11 MHz. For practical reasons we are limiting our supply
The next problem is: find a very fast PWM circuit. voltage to 5 volts. It is also more convenient
The theory is quite simple. First you generate a to move to a higher frequency as it relaxes the
triangular voltage. Then you put your video on requirements on the filter after the PWM signal
one input of a fast comparator and your triangle is received—plus it will also improve the quality
voltage on the other input. The output of the com- of the signal. Let’s go to 20 MHz giving a period +5V
parator then supplies your PWM signal. That’s it! of 50 nanoseconds (ns).
Figure 3. The ‘textbook’ constant current source has a Ideally this should be equal to the output cur-
few disadvantages depending on your requirements. rent of the constant current source. In our circuit
+5V 2.67 mA flows, as evidenced by measuring with
a multi-meter across C6. The value is about 0.4
The capacitor has 50–10 = 40 ns to ramp up from mA lower than expected. Not way off, but caused
0 to 3 volts. So at 3 volts, the constant current by the difference between the transistors.
source should remain well out of saturation. We can now calculate the sum of all the capac-
The simplest low saturation current source con- itance parallel to, and including C6. We use the
sists of two PNP transistors connected in the formula for charging a capacitor with a constant
configuration pictured in Figure 3. It has several current:
serious disadvantages. For one, the hfe of the two
R transistors can be very different even if they con- Q=I×t=C×V
Iout sist of a double transistor like the BCV62C. Sec- C=I×t/V
ond, they have far too much stray capacitance. C = (2.67×10–3 x 40×10–9) / 3
C = 35.6 pF.
The solution is the configuration with an extra RF
transistor shown in Figure 4. This configuration So the sum of all the extra capacitance in parallel
is called: The Wilson Current Mirror. It is more with C6 is 13.6 pF. C6 itself has a tolerance of
accurate and has a much lower output capaci- 5%, which is achievable using COG/NP0 dielec-
tance (about 3 pF). You can read up on the Wilson tric. It turns out that the circuit is quite repeat-
Current Mirror in Wikipedia [1]. The saturation able meaning every one you build should operate
+5V voltage is about 3.6 V, which is well above 3 V. close to 20 MHz.
By adapting R (that’s R4+R3 in our TX) we can
adjust the sawtooth frequency to 20 MHz. The Back to Figure 1, the video signal first reaches a
current through R is: buffer amplifier. This amplifier adjusts the level
of the video so that the most negative part of
IR = Vsat / R the video (the sync tips) start at 0.4 V, which is
above the bottom of the sawtooth. The top of
which for our practical transmitter circuit works the video signal reaches about 2 V, which is well
out as under the 3-V amplitude of the sawtooth.
R 3.6 / (1100 + 75) = 3.06 mA The comparator in position U5 is very fast with
a delay of just 4 ns. The delays for the positive
Iout and negative signal excursions are about the
Figure 4. Due to an extra RF transistor the Wilson same, so the distortion is minimal. If you apply
Current Mirror is a nearly ideal current source. this signal to a filter designed to remove the 20
plastic bracket is called for to keep them together but sadly the price of an LC-TOSA. The ST connector is much bigger
nobody makes it because those components are used in a than the LC connector; it is a bayonet type connector like
standard module called SFP (Small Form-factor Pluggable). BNC. The LC connector by contrast has the feel of the
Manufacturers makes their own systems to hold them modular RJ-45 telephone connector, see photograph.
together, and often a bracket is used. The bracket is part of
the SFP housing.
We don’t want to use an SFP module—it would be expensive,
bulky and unnecessary. So I hope some kind Elektor readers
will come up with a bracket.
The modern VCSEL’s operate at 6 mA. At 6 mA, they give
more optical output power than an LED at 60 mA. Avago
makes a 850-nm VCSEL with an ST connector. The ST
connector is what we use here. This unit is about 10 times
• Who is likely to use this? It is hard to answer that. I think The Receiver
everywhere, where you want to transport composite video over more Let’s look at Figure 5. The optical signal arrives
than 300 feet. That could include big buildings, remote monitoring at then receiver on J2. From there it goes to
and places where no wireless is possible like underground or another fast comparator, U3. Comparing the sig-
underwater. It could be used for traffic inspection cameras along busy nals at the output of comparator U5 in the trans-
roads. mitter with those at the receiver comparator,
If you made dedicated ICs for this job, it could be used for every U3, we find them identical with a delay of 8 ns
composite video connection. + 5 ns per meter of fiber cable, approximately.
The PWM signal then goes to the filter IC, U6. This
IC cannot run off 5 volts, so it has its own 3.3-V
Design considerations regulator, U5. The MAX9502M (U6) is a lowpass
filter with a –3 dB roll off of 7 MHz and a slope
When I first read about video transmission over fiber optic cable
of 30 dB per octave. This is crucial because of
in the beginning of the eighties my reaction was: Why make it so
the strong 20-MHz component. The IC also has
complicated? Just use fast PWM. My work was always going in different
a DC restoration circuit, but this is not in action
directions, so I never tried building it. I am now semi-retired, so now I
because it was never made for a PWM signal. To
had time to build it. Of course I looked on the internet to see if anybody
prevent clipping at the output, the PWM signal is
else had tried this, but I did not find anything.
attenuated 5 times at the input. The MAX9502M
The design goal was very simple: Build a composite video PWM system
has 12 dB amplification; the MAX9502G has
that does not visibly change the quality of the composite video. I was
6 dB amplification and if used requires R4 to be
using my camcorder as the video source and look on my 40 inch TV
increased to 1 kΩ.
for the fine details and colors of the video signal. As far as I can judge
there is no difference in quality. So that design goal was met. When I
PLL circuit U7 is designed for 5-V operation and
was building it, I realized that I could modulate FM for the sound. That
conveniently U3 and U4 are also using 5 volts.
was a bonus.
The maximum frequency of the 74HCT9046 (U7)
The scope that I use is a 100-MHz Tektronix TDS 1012. If examine the
is about 15 MHz and therefore the PWM signal
20-MHz sawtooth, I use a short piece of tinned copper wire with a loop, to
has to be divided first, here by a D-flip-flop type
stick my probe in for earth (the poor man’s probe adaptor). The saw-tooth
74LVC1G74 (U4). At 10 MHz the frequency is
has some non-linearity at the beginning, but this is outside the video.
still quite high for this PLL, but it works okay.
Fist I built the saw-tooth generator. It took about four designs until
The D-flip-flop acts on the positive transitions of
I had the right one. Then, I built a board with saw-tooth generator,
the PWM signal. The negative transitions have
comparator and video filter.
the PWM modulation and cannot be used. There
I got really neat video out of it. After that, I just had to add the optical
is an IC in SO-8 housing containing two D-flip-
parts and the sound processing parts. It was a real fun project.
flops: TI’S V SN74LVC2G80DCT. That would bring
Why has nobody else tried it? I really don’t know. Maybe people think
the frequency down to 5 MHz. A divider with
that everything is done that can be done.
D-flip-flops is made by connecting the Q output
to the D input. The Q output of the first flip-flop
is connected to the clock input (CLK) of the sec- Audio and Video inputs on the input board. If you
ond one. You can use this if you want to explore increase the value of R6 from 3.6 kΩ to 3.9 kΩ,
how high you can go with the PWM frequency. the output voltage of the PLL and of course the
The 74HCT9046 PLL is made by NXP (formerly Audio Out will rise by 1 volt.
Philips Semiconductors). It is an improvement
over previous PLL’s type 4046. The VCO part has It is important for the PWM frequency to be close
two options. The first option is to control the fre- to 20 MHz, so that all the receiver boards are
quency with one resistor. This would give only a interchangeable.
small output signal. The second possibility is to
have an offset frequency and vary the frequency The values of C9 and R10 (the feedback loop)
around the base frequency. In our case the base were found by connecting a square wave to the
frequency is 10 MHz. audio input on the transmitter board and looking
at under- and over-shoot on the audio output of
The frequency sweep is ±1 MHz. The 10 MHz base the receiver.
frequency is set with R7. The ±1 MHz deviation
is set with R8. It is possible that R7 has to be Experimental build
adapted slightly if the unmodulated frequency is The PCB layouts for the transmitter and the
more than 0.5 MHz off. receiver as designed by the author are printed
Figure 5.
in Figure 6 and Figure 7 respectively for guid- Schematic of the
The voltage at the Audio Out connector should be ance and inspiration rather than providing an experimental fiber optic
2.5 V without any signal source connectors to the exact method of how it should be done. The PCB receiver for video and audio.
MCP1700-500E2E/TT MCP1700-330E2E/TT
U2 5V U5 3V3
3 2 3 2
C4 C7
1 1
1u 1u
Video
MCP1700-500E2E/TT Filter
3 VIDEO
U1 5V
4
J3-B
3 2 R3 R8
1 5
2k2 U6 75R
J1 R4
1
+6V C2 1 C1 2
470R
2 MAX9502M
GND
10u 1u
10V
L2
C5 C6
U7 16
10n 10n 1uH
3 VCC 2
COMP_IN PCP-OUT
J2 5 8 6 10MHz 14 13
OPTICAL SIG_IN PC2-OUT C10
FIBER 15
7 8 6 RB
C3 5
PLL PH-COMP
2 3 S VCC R 10n
9 4
1 1 5 VCO_IN VCO-OUT
10n U3 CLKU4 Q 6
4 20MHz C8 C1A
74LVC1G74 VCO MCP6L01R
2 2 3 2 J3-A
HFBR2416Z 1 3 4 7 D Q R10 7 10 3
R1 R2 100p C1B DEM-OUT AUDIO
ADCMP600 GND 11 1
U8
3k9
R1
4 74HCT9046
1k
1k
12 4
R2
GND INH GND 5
R7 R6 R5 R9
C9 1 5 8
22k
3k6
39k
47k
1n
130316 - 15
Figure 6.
Transmitter board
component layout printed
at 150% of actual size
(author’s design).
design files are available for free downloading at placing of components. Solder paste gets applied
[2]. The assembled boards in the photographs with a syringe, then the components before sol-
are early prototypes and differ slightly from the dering them in a frying-pan on maximum heat
final designs represented by Figures 6 and 7. with a lid on top. After putting the boards in, the
Pad sizes, component placement and track rout- lid is left off long enough to be able to see the
ing will certainly not be optimal but the pro- solder paste melt. The board is removed from
totypes worked and were successfully demon- the pan with big long-nose pliers.
strated to Elektor editors during the author’s
visit to Holland. The assembly and testing of these little boards
closed off an interesting experiment in trans-
Both board layouts were made using PADS from mitting video and sound over fiber optics at low
Mentor Graphics. The films were printed with a cost, without specialist ICs or professional equip-
laser printer. The boards are from double-sided ment—we hope you found it inspiring.
resist-coated PCB material. The author’s etchant (130316)
is ammonium persulphate heated to 50 °C.
A binocular microscope is in use for pasting and
Figure 7.
Receiver board component
layout printed at 150% of
actual (author’s design).
Web Links
[1] Wilson Current Mirror: http://en.wikipedia.org/wiki/Wilson_current_mirror
[2] PCB design files (Mentor Graphics PADS format): www.elektor-magazine.com/130316
DLP-IO8-G DLP-IOR4
8-Channel Data Acquisition 4-Channel Relay Cable
DLP-TH1b
Temp/Humidity Cable
Only
$29.95! DLP-RFID1
HF RFID Reader/Writer
DLP-FPGA
8 I/Os: Digital I/O USB-to-Xilinx FPGA Module
Analog In
Temperature
USB Port Powered
Single-Byte Commands
www.dlpdesign.com
USBprog 5.0
An Open-Source Programmer
with a Web interface
corresponding setup file is downloaded with the cessor. The debugger can now be invoked from
‘Download setup.exe’ button). During installation the browser (‘Start openocd’ see Figure 4) or
Windows will find the path and in addition the with a command line.
configuration file with the IP address will be cre-
ated. Now use a Windows command line (enter The debugger can be controlled via a simple Tel-
‘cmd’ from the start menu) will call the .exe file: net interface or from a GDB interface. Larger
development environments often offer an appro-
embeddedprog.exe --processor m328p priate interface. There should be good support for
--speed 2 GNU debugger ARM Eclipse GDB on many of the
forums available on the web. Use the debuggers
Many programming languages allow you to make IP address (10.0.0.1) for the ‘Remote Address’
use of command line calls (and evaluate the out- and not the ‘Localhost’.
put) so that the programmer can be controlled
by software you have written yourself. With this A peek under the hood
in mind we will look to an adaptation of the EFL Figure 5 shows what is under the lid. The main
configurator in the next issue. processor is an LPC3131 together with an (8 MB)
Operation directly from Atmel Studio 6 is also DRAM type A43L4616 memory. A GTL2010PW
possible using the Python-tools (see box). level translator is used to take care of simple bidi-
rectional signal operation. An LDO AP2127K-ADJ
Debugging ARM processors is used to allow selection of the target system
This latest version of the USBprog can also be voltage level (1.8 V, 3.3 V or 5.0 V) via software
used for debugging ARM processors. The Open- and is controlled by a MCP4131 digital pot. Up to
Source debugger openocd [4] is used here and 300 mA output current is available.
runs on the programmer. Before debugging An embedded version of Linux runs on the pro-
begins the firmware must be loaded to the pro- cessor, supporting standard applications such as
Figure 5.
An LPC3131 processor
running Linux is at the heart
of the programmer.
Various solutions to this problem circulate on the through T2 will then rise to more than 2 mA,
internet, but most of those are not very reliable which increases the voltage drop across R5 to
and some are downright disastrous (such as the the point that T3 will turn on and the MI-output
suggestion to simply connect the 23K256 directly will also go high (5 V). With a low input signal
to 5 V, far above its absolute maximum rating). the opposite occurs, T1 will now conduct more
Fortunately there is already a regulated 3.3-V and this will then turn on T4 which results in a
voltage present on the Arduino board. This can low signal level at the output of the buffer stage.
be used to power the 23K256. It is also fairly
straightforward to adapt the CS-, SCK-, and Resistors R7 and R8 limit the base currents to T1
MOSI-signals with the aid of simple voltage-di- and T2 and C1 and C2 ensure a faster switching
viders comprising of two resistors, because these behavior. The two Schottky-diodes ensure that
signals go from the Arduino to the 23K256. transistors T3 and T4 cannot go into saturation, so
that these transistors will switch fast as well. The
With the MISO-signal (serial data output) things circuit, constructed on a breadboard, appeared
are a little bit more problematic. For I2C-signals to work reliably up to 3 MHz.
the usual solution is an N-channel MOSFET with (140224-I)
two pull-up resistors. But in this configuration
it is no longer possible to distinguish between a
high state and a high-impedance state. In addi-
tion, the parasitic capacitance results in increased
+3V3 +5V
rise-times of the signal edges. A better solution
R1 R3 R5
is to use a TXB0104 (bidirectional voltage level
330R
10k
T3
pedance state either.
T1
The circuit shown here offers a better solution BC857
D1
R7
and uses standard components. Its operation C1
BC857
is easily explained. When the SO-output of the BAT85
15k
SO 22p MI
serial RAM IC is in the high-impedance state,
both transistors T1 and T2 will just about con- R8
C2
duct. Because the b-e voltages of T1 and T2 are
15k
D2
22p T2
at 0.65 V (voltage divider R1/R7/R8/R2) there
will be a current of about 0.45 mA through each BAT85
T4
transistor (about 0.15 V/330 Ω). This results BC847
in a voltage drop across resistors R5 and R6 of R2 R4 R6
BC847 Figure 1.
about 0.45 V, which means that both T3 and
330R
10k
So far we’ve made components that had a single gates. I didn’t like the NAND gate symbol I found
gate and a single footprint which should encom- in the DesignSpark libraries so I quickly drew one
pass the most common types of component. up to use. Next I made a footprint for a 14-pin
Today we will explore how DesignSpark allows SO package so that I had everything ready for
components to have multiple gates and footprints. the component wizard. Next, start the compo-
nent wizard and in the components details screen
Multiple Component Gates enter ‘4’ for the number of gates like in Figure 1
Every component in DesignSpark needs at which tells the wizard that we want four schematic
Figure 1.
least one symbol that represents the device in symbols for our NAND component. We will worry
Component wizard details. the schematic. That’s ok most of the time but about the power connections later. The next step
some parts like logic chips is to choose the schematic symbol we want to
and opamps have multiple use, and the PCB footprint. It will also ask us to
parts inside of the chip, so assign the schematic symbol pins to the footprint
DesignSpark allows you use but I find it easier to just assign them 1:1 using
multiple component symbols the Assign 1-to-1 button and then change the
or gates associated with a pinout later in the component editor.
component. They are usually
the same symbol for parts You can then edit the component after the wiz-
like opamps but you can use ard has finished, like in Figure 2. The left side
any combination of symbols of the window shows each gate in a spreadsheet
you want for your gates as format to make it easy to edit all of the pin map-
long as all of the PCB foot- pings. Each gate is named with a letter, starting
print pins get used. at “a” and each gate pin gets its own row in the
Today we will make a 74HC00 spreadsheet. The PCB footprint pin numbers are
Figure 2. NAND gate component that listed in their own columns, which I prefer when
Component editor. will use multiple schematic trying to configure the pin mappings. I find that
the component wizard method is just confusing.
I also like how the component edit window shows
all of the schematic gates and the PCB footprint
so that it’s easy to double check everything.
ponent so that you don’t have to keep track of Multiple Component Footprints
which gates have already been used. For exam- Components can also have multiple PCB footprints
ple, if you place one NAND gate and then some which is a really useful feature. DesignSpark
resistors DesignSpark will remember that only doesn’t require that all of the footprints have
gate “a” from the 74HC00 has been used. The the same number of pins but it’s easier if they
next time you place a NAND gate DesignSpark do because all of the footprints will share the
will automatically start at gate “b” and show that same pin mapping. You can add footprints to a
there are three gates available. component using the Add ª Package menu which Figure 3.
will open the Add Package window. Placing a 74HC00.
DesignSpark also makes sure that you don’t
accidentally use the same gate twice from the The Add Package window will
same physical part. For example, Figure 3 shows let you select the footprint to
that I’ve already placed all four gates for U1, add, and to assign a package
labelled U1a to U1d. If I wanted to swap the name to it. There’s a bunch
gates after they’ve been placed and wired in of predefined names already
then all you have to do is double click on the but you can also type in any
gate and set the gate letter to the one you want name you want. The pack-
to use. DesignSpark will then warn you that the age names are what gets dis-
gate is already in use in the design and then played when you place the
offer to swap the gates for you. For example: if part.
I wanted to swap gate “a” with gate “c” then I
could manually change gate “a” to “c” in the Gate Figure 5 shows what the Add
Properties window and DesignSpark will offer to Component window looks like
renamed gate “c” to gate “a”. when you place your 74HC00
and you click on Package. For
Power Pins this example I set SOL to be Figure 4.
Right now our 74HC00 has the appropriate num- a narrow SOIC footprint and Final 74HC00 gate symbols.
ber of NAND gates but it still won’t work properly SOIC WIDE to be a wide SOIC
because our component doesn’t have any power footprint. Once you pick the
pin connections yet. There’s a few ways to do footprint you want you can
this: hidden power pins, power pins on every place it just like before.
gate and a separate power gate symbol. The
last two options are supported in DesignSpark If you want to change the
so let’s take a closer look at them. footprint for a component
Adding power pins to every gate can make sense that’s already in your sche-
when they have a limited scope and are only used matic then you have to open
within the gate. DesignSpark supports doing this the properties window for the
by allowing you to map more than one schematic component and click on the
pin to each PCB footprint pin. In our 74HC00 Change button. The Change
example, each gate could have power and ground Component window will pop
pins mapped to the same footprint power pins. up and it will let you choose
As a matter of taste I usually prefer to just have the new PCB footprint you
one connection to a footprint pin so I like to use would like. Figure 5.
a separate power gate. Placing a component with
Conclusion multiple footprints.
The component wizard doesn’t allow you to Today (in virtual time of
choose different gate symbols while making a course) we defined a com-
component so you have to add it in the compo- ponent with multiple gates
nent editor instead using the Add ª Gate menu. and PCB footprints. Next
That will open the Add Gate window where you time we will look at some
can choose the gate symbol to add; Figure 4 of DesignSpark’s PCB layout
shows what my power gate looks like after adjust- tools.
ing the pin mapping. (140419)
Microchip Hillstar
DevKit Walkaround
Touch control and gesture control
in one chip
By Jaime González-Arintero Berciano
(Elektor Labs)
Figure 1. Hands up ating voltage of the MGC3130 chip. The kit also
Scope screen, top trace: Microchip’s Hillstar Development Kit is an excel- includes four foam blocks and a piece of copper
carrier signal in Tx; lower lent gateway to touchless gesture HID devel- foil for advanced calibration purposes. By special
trace: SDA datastream. opment for microcontroller systems and PCs. arrangement with Microchip the Hillstar Dev Kit
Left: the “conductor’s hand”;
My friends in the editorial department already together with a ready-assembled touchpad are
Right, on cardboard box:
reported on it, see the November and Decem- available as a bundle from the Elektor Store [3]
ready-made 3D touchpad
included in the Elektor/
ber 2014 editions of Elektor [1],[2]. It was Jan cheaper than from Microchip Direct.
Microchip product bundle. who gave me the kit for a lab-style walkaround.
The control pad is a 4-layer PCB which packs the Read before use? Sure…
electrodes: one transmitter and five receivers in I confess, “read before use” doesn’t always apply
total. A small board with the MGC3130 chip on to me. Luckily, many of my blunders turn to good
it is plugged straight to the pad terminals using and I end up learning something. But isn’t elec-
a 7-pin header (six electrodes plus GND). This tronics exactly about that?
chip takes care of all the magic, generating the Since I had some previous knowledge about the
carrier signal for the transmitter electrode, con- physics involved in this type of design (at least
ditioning, digitizing, and processing the signals the basics), I decided to start playing with it
coming from the five receivers, joining them seri- right away, no software or drivers, and let the
ally via I2C for your convenience. For the com- oscilloscope tell the story. I decided to check the
munication with a PC, the development kit also activity within the MGC3130 module. Assuming
provides an I2C to USB bridge, which doubles as Tx stands for “transmitter”. ¡Olé! I got a beautiful
a 5 V to 3.3 V converter since that’s the oper- 88-kHz signal. It was meant to be in the range
of 100 kHz, so everything fine here. I went for own parameterization, and here is where the
a coffee, and back at the desk I noticed that the intriguing foam blocks in the dev kit enter the game.
signal had somehow jumped to 103 kHz... what? You have to wrap the large one using the copper
When it went up to 115 kHz and back to 88 kHz I foil included and solder a thin cable to connect it to
scratched my head. Befuddled I decided to check ground (or hold the cable yourself, as long as your
the documentation and learned that the MGC3130 feet are touching the floor). The entire procedure
automatically changes the Tx frequency depend- is explained in the manual, and is fun to do since
ing on the external noise conditions. Rookie me. you are working with fractions of a picofarad. The
What happens before the signals get processed electrode “weighting” and the linearization of the
is not rocket science. The transmitter electrode electric field are performed by means of this “cop-
provides an electric field, and when this field is per brick” and the other foam blocks. It’s now clear
affected by your hand or an object, the variations to me, but it wasn’t on my first try!
are detected by the receiver electrodes. We have The Hillstar pad consists of a bare PCB with a
now 10 capacitances to consider: five Rx elec- transparent plastic covering layer, and with all its
trodes and GND, and the Rx electrodes and the
transmitter (Tx). This information is used by the
chip to calculate the position of the foreign object
and package the information into a datastream
for outputting via the I2C bus which can be duly
observed on the ‘scope.
After a proper read (finally), I installed the
included Aurea software, a comprehensive and
neat test & design suite, which enables you to
redesign the whole system from scratch, modify
all parameters, and recalibrate and flash the chip
with a new library file. I found that Aurea pro-
vides crystal clear evidence of the Tx frequency
hopping issue. This software together with all the
documentation and references, is available here
[4]. The amount of information on the MGC3130
GestIC concept is massive and well arranged.
software tools is aimed at embedded developers Figure 2.
Touch me (or not) among you. However Elektor’s special offering [3] Precision calibration and
parameterization of the
Playing around with the Aurea GUI is enjoyable also includes a ready-to-use, self-contained 3-D
GestIC system using
with several config wizards provided and most pad in a commercial casing, aimed at those of you
Styrofoam blocks also
options intuitive. Some aspects are worth men- wanting to develop PC and tablet applications. included in the Hillstar dev
tioning however, especially for those of you not The documentation recommends avoiding using kit.
in a habit of reading manuals upfront. conductive plastic, stating that black plastic may
The pad is quite sensitive, so check carefully contain conductive carbon. So the touchpad is…
that there are no sources of disturbance close black. Just possibly it’s carbon-free? I’m curious.
by since that will affect operation. Even though (140434)
the pad is shielded at the underside, when flat
on your desk everything below will disturb the
Web Links
field (e.g. the cat or your legs).
Aside from being a touchless (i.e. gesticulation) [1] Add 3D Sensing to your Micro or PC: Elektor
HID, the pad also provides run-of-the-mill touch November 2014.
control, acting as a multi-touch trackpad, capable [2] GestIC & 3D TouchPad Workbook (1): Elektor
of detecting up to 5 (!) fingers simultaneously. December 2014.
Not sure if that would be possible yet, but the [3] www.elektor.com/microchip-dm160218-hill-
surrounding electrodes (N, S, E, W) can also be star-development-kit-and-dm160225-3d-
touched individually, and who knows might act touchpad
as slide controls in upcoming applications.
[4] http://j.mp/MGC3130
The Aurea GUI includes a wizard to carry out your
CRIS-AMP
Audio System
watts-up for smartphones and laptops
Design: Aside from being a quality design, the CRIS-AMP makes an excellent project to
Juan Cantón (Mexico)
learn or hone your skills within different areas of analog electronics. It’s relatively
Jaime
Report:
easy to replicate, without the need to deal with SMT or esoteric components. Ev-
González-Arintero
Berciano (Elektor Labs) ery module is designed as an independent PCB, ready for re-use in your own build.
the effect of the coupling capacitor C6. Normally trying with real speakers. If you are too lazy to
C6 would cut the low frequencies—that’s unde- assemble the heat sinks just now, you can give
sirable here—hence transistor T5 amplifies the the setup a (brief!) test drive without them. After
signal and drives the output stage. that, it’s really up to you if you feel like releas-
ing some magic smoke in the room. [Despite all
This amplifier in turn uses the current source types of electronic protection, it’s good practice
formed by T6 and R14, “sharing” the rest of the to always have the right load connected to an
components with the current source of the dif- audio amplifier output, Ed.]
ferential amp, namely D2, D3, C5, C9, and R13.
Although apparently useless, R4 prevents the dis- There’s no such thing as forgetting to turn your
turbing “hum” caused by ground loops (especially active speakers on. However, forgetting to turn
if we opt for a transformer-based power supply). them off is normal, hence the project also includes
Figure 1.
a simple add-on to automatically turn the com- Schematic of the
All component ratings clearly exceed the strict plete system off. This circuit is suitable when 15-watt class-AB CRIS-AMP
minimum, preventing the use of bigger heat sinks. using the CRIS-AMP with a laptop, turning off amplifier.
This design is suitable for speakers down to 4 Ω, the powerbar the system is plugged on to, if no Few surprises here.
and indeed it’s not recommended to work with
lower impedances. If we want it, it’s also possible
to select other equivalent transistors, as long as
VCC
the parts used to amplify the input signal provide
K2
the same gains and complementary transistors
R1 R5
are used in the output stage. C3 C10
1k
18k
POWER
T5 100n 470u SUPPLY
MJE350A T7
Regarding the 4-watt amplifier used with the 2 100u
150p
100n R2 R6 R13
rear speakers, we have two possibilities. One is SIG3 R10 R9
82k
5k6
A 3k9 C4 MJE15030
to simply replicate the 15-W design by adapting R15
1R
1R
100n
0R1
relevant resistance values. This can be easily done T2 T3
R11 C13
with the conversion table shown in the project SIG2
FEEDBACK
3k3
SIG7
C8
1000u
page [1], resulting in a 5-watt amp. Alterna- K1 C6
T1 2x
MPSA06
D1
R12 R16
SIG8
15p
0R1
3k3
tively, if you want to cut down on components, SIG1 1N4004
470n LS1
a completely different design using the popular MPSA06 T8
SIG6
TDA2003 audio amp is also available (again, refer T4 T6
SIG4 MJE15031
to Elektor Labs [1]). In both cases the supply D2
8
390R
39R
18k
For the subwoofer the same 15-W amplifier is 470p R4 100n 100u
1N4004
220u
39R
used—now that’s what I call optimization! In this A
140376 - 11
B
The Programmer
@ Elektor Labs
By Thijs Beckers At Elektor we are multi-faceted in terms of help TQFP44A package. During prototyping the micro-
(Elektor Labs) with article-related obstacles you may have run controller was programmed using ICP. Fine, but
into, always aiming to help everyone to finish with large volume retailing and shipping required
their project. As an example, let’s look at our we need to be able to program each chip without
chip programming service. Most microcontrol- first having to solder it into a circuit, program
lers included in our DIY projects can be obtained it via ICP, unsolder it again, and ship it to you.
pre-programmed from our online store. Because Since the ATXmega-µC comes in this TQFP44A
each project is unique it’s essential for the noto- package, we were in need of an adapter for our
rious fuse bits and boot reset vectors to be abso- BeeProg+ programmer.
lutely correct, this service is taken care of by
Elektor Labs staff exclusively. Luckily our friends Vladimír and Jan at Elnec were
able to help us out and when we met up at the
To be able to properly ‘burn’ firmware into a electronica 2014 event in München last Novem-
microcontroller, Elektor Labs have used their ber, they surprised us with the socket adapter
trusty BeeProg+ programmer for some time needed for programming that TQFP44A’d micro.
now, courtesy of Elnec. This universal program- It is thanks to guys like Vladimír and Jan and the
mer accepts microcontrollers up to 48 pins using utter flexibility of the BeeProg+ programmer that
a convenient zero insertion force (ZIF) socket. we can keep prices of programmed microcontrol-
This suits a lot of microcontrollers, but not all. lers in check, and everyone benefits.
In cases where the ZIF socket doesn’t fit, Sure, I get to write a short piece about it, but I
an adapter is needed. Like with the ATX- seize this opportunity to offer you a peek in our
mega128A4U-AU microcontroller used in the kitchen, which I hope you enjoy reading. These
VariLab 402 project published in November and are the deals I like most!
December 2014. This particular micro comes in a (140417)
Transistor Tetrodes
Weird Component # 11
We’ve all used n-p-n and p-n-p bipolar transistors transistor from the buffer stage. And it turns out By Neil Gruending
with three connections but I had never heard of that transistor tetrodes are an excellent choice (Canada)
transistor tetrodes until I was researching this for small-signal cascode amplifiers that also need
article. Transistor tetrodes have four leads and high frequency bandwidth.
come in different variations. Remarkably they
have two control elements instead of one, that’s
two base (b) connections for bipolar transistors
and two gate (G) connections for MOSFETs, as b2 Single-Crystal C
Germanium Bar
indicated by the circuit symbols in Figure 1. Let’s
take a closer look at them and see what makes Emitter Collector B1 B2
I’ve mentioned capacitance quite a bit but why 1980s and ranking high in RF Design’s Hall of
Vout
does it matter? Well, designing amplifiers using Fame are the European BF96x/BF98x series,
discrete transistors is always a constant battle and from the US, the 40673 and 3N211. For
to get enough bandwidth, gain and input to out- example, a simple FET mixer will connect the
put isolation. One of the reasons why this can local mixer output and the RF output to the gate
be a challenge is the Miller Effect and how it can of a FET using some extra components to iso-
Vin
affect an amplifier. The Miller Effect is when an late the mixer from the RF. A dual gate MOSFET
amplifier’s input to output capacitance is ampli- can eliminate those isolation components, with
fied by the amplifier gain which will then increase its gates already isolated from each other. Dual
its equivalent input capacitance. In transistor gate MOSFETs also work well in automatic gain V–
amplifiers, it’s usually the parasitic capacitance control (AGC) circuits because you can bias one
inherent to the transistor that must be overcome gate and feed the signal to the other. Then the
if you want to maximize the amplifier bandwidth. bias voltage can be the control input and control Figure 3.
Cascode amplifier.
the overall transistor gain.
One way to minimize the Miller Effect is to use
two transistors to make a cascode amplifier like I hadn’t heard of transistor tetrodes before today,
in Figure 3. One transistor is used as a transcon- but they are definitely a very interesting and
ductance amplifier which is then followed by a weird component, especially with their uses in
current buffer transistor. Having two amplifier RF circuitry. Maybe you will find a use for them
stages helps to minimize the Miller Effect by iso- in your next project.
lating the amplifier input capacitance of the lower (140418)
By Florian Schäffer
There are two basic types of chip card in credit more expensive than a smart card which are dirt
card format: Those with a processor and those cheap [2]. In addition a typical USB flash drive
without. Memory chip cards have just a simple will be guaranteed for only 100,000 write cycles
EEPROM (electrical erasable and programma- whereas a 24Cxx EEPROM is good for ten times
ble read-only memory) of type 24Cxx [1] fitted this value and also the data will persist for 100
beneath the eight contact pads (Figure 1). The years rather than the 10 years for a flash drive.
memory size can be from 128 Byte (1 Kbit) to On top of this the memory card format is more
2048 Byte (16 Kbit). Control of the memory is practical for everyday use compared to an SD
via a two-wire interface which could be either card; it slips easily into a wallet or purse. It is
I2C or Two-Wire-Interface (TWI) depending on widely used for building entry control, employee
the card manufacturer. time recording, cashless transactions in works
canteens and at sports centers and gyms to keep
Such smart cards are used mainly for applications track of personal training regimes.
where relatively small amounts of information are
to be stored at low cost. By comparison USB flash I2C from the USB
drives offer much more memory space but are There are of course already a wide range of smart
card readers available on the market. Second
hand examples also sell cheaply on auction sites.
One problem with the older readers is that they
C1-VCC C5-GND often use a PS/2, serial or even a parallel type
C2-RST C6-VPP interface which you hardly ever see these days
C3-CLK C7-I/O
on modern PCs let alone laptops.
Figure 1. Even the readers with a USB interface can have
C4- C8-
An 8-pad chip card contact problems with the driver software which often
area. is not supported by the latest versions of the
4k7
C1-VCC C5-GND
C2-RST C6-NC
ory cards) and the memory address. The device
C3-CLK C7-I/O address is sent again, this time with the read bit
C4-NC C8-NC
R1 R3
set. The slave responds by sending the requested
CHIPCARD K1 data. The slave uses the ACK bit to indicate all
1k
2k2
T1 1
6
of the data has been sent. When the bit state
2
LED1
TXD 3
7 RTS is taken over by the Master so that the signal is
8 CTS
DTR 4 pulled low during the corresponding clock cycle
BC547 2mA 9
GND 5 the slave enters ‘sequential read mode’ and con-
tinually sends values from sequential memory
140070 - 11
addresses until the master releases control of
the ACK bit. The master will then send a stop
command. With memory chips there is nothing
Figure 3. to indicate the last memory position so continu-
The minimal card reader ous sequential reading ends up cycling through
schematic. from the last memory address back to the first.
In addition to reading out the card data as an I2C interface so a PC status display (e.g. to
described here there are many other applica- display Tweets) can be relatively quickly assem-
tions that the design could be used for. Data bled. Keep in mind here that the Client cannot
stored on the card can of course be modified play the role of a Master.
by writing to the card. It can also be used to (140070)
communicate with other I2C devices such as the
DS1621 temperature sensor with integrated A/D
converter. Many types of LCD module also have
Web Links
[1] ATMEL Data sheet AT24Cxx, www.atmel.com/Images/doc0180.pdf
[2] Smartcards: http://www.reichelt.de/Chipkarten/CHIPKARTE-256B/3/index.
html?&ACTION=3&LA=2&ARTICLE=37015&GROUPID=5967&artnr=CHIPKARTE+256B
[3] Smart card Commander: www.chipdrive.de
[4] Smart card reader: http://uk.farnell.com/amphenol/c702-10m008-230-40/
smart-card-c702-wiping-xxs/dp/1849551
[5] Visual Studio Express: www.visualstudio.com/downloads/
download-visual-studio-vs#d-express-windows-desktop
[6] www.elektor-magazine.com/140070
Technical Data
• Efficient DIY LED flashlight
• Input voltage range from 1 to 3 V
By Wolfgang Schmidt
• Up to 78.8% efficiency
(Germany)
• Constant brightness with input down to 1.2 V
As a member of the genus homo electronicus the phrase into the search engine on a well known
author has an aversion to buying any electronic internet auction site and you can waste an hour
product that he can better make himself. Take scrolling through all the items on offer. Some for
for example the humble LED flashlight, enter that less than a couple of dollars including battery,
1V5
the minimum 7 V supply.
As it happens Linear Technology produces the
140066 - 11
LT1932 IC which performs exactly the function
we are looking for; operating with high efficiency
it is widely available at reasonable cost. Figure 1
shows that the chip is configured in a completely
Figure 1. case and shipping from Asia! conventional way in this application. It uses just
It couldn’t be much simpler: To think that you could build a flashlight more five additional external components. Resistor R1
excluding the LEDs and cheaply than you can buy one mass-produced defines the LED current. Using the 1.5 kΩ value
the IC it only uses five
by an Asian production line is unrealistic. The given in the schematic produces a typical LED
components.
chances are that the design criteria of such prod- current of 15 to 20 mA.
ucts would most likely be geared to lowest man-
ufacturing cost rather than operating efficiency Construction
of the finished product. Best price usually infers To make it even easier a PCB has been produced
poor quality but better quality products from well- for this project (Figure 2). The board has space
known brand names can often be unreasonably for all components, both LEDs and the battery
expensive. An alternative is the DIY route; along holder. The PCB and all its layout files are avail-
with the satisfaction you also get an insight into able from the Elektor web page [1] associated
the technology and a chance to hone your prac- with this article. The IC is available with an SMD
tical skills. outline so the other five components are also
The LED flashlight described here operates at high specified as surface mount variants. The advan-
efficiency and won’t give up until it has squeezed tage is that the finished PCB is very compact. With
the last drop of energy from the batteries. so few components assembly should not pose
too much of a problem, even for the less expe-
The concept rienced builder. The LED leads can be carefully
Working with LEDs, the first thing you learn is bent before they are soldered to the PCB. To fix
that you can’t simply wire up a battery to an LED. the PCB into the suggested enclosure first drill
Once the forward conduction voltage is reached, two 5-mm holes for the LEDs and position the
current through an LED increases rapidly with board so that the LED domes protrude through
small increases of forward voltage. This is why the holes. Now fix it to the inside of the case
the level of supply current rather than voltage using double-sided tape.
should be controlled. A simple resistor in series The enclosure is big enough to take two AAA
with the LED is an inefficient solution. The cir- sized batteries. Using two non-rechargeable pri-
cuitry necessary to efficiently drive an LED flash- mary cells will give a voltage of 3.0 V. The driver
light will always be more complex than for a IC will supply current to the LEDs even at low
flashlight using a traditional filament lamp; its input voltages; when the input sinks to 1.2 V it
voltage/current characteristics are more linear so will still be driving 15 mA to the LEDs. The chip
you need nothing more than a battery and lamp. helps squeeze the last drop of energy from the
From a mechanical point of view however an LED batteries. You can even try ones that have already
flashlight is simpler to make than one with a fila- discarded as exhausted; this circuit only stops
ment bulb. Modern LEDs are efficient with a high working when the input falls below 1 V (that’s
0.5 V per battery!). This energy scrounging fea- is used in the position shown in the schematic;
ture can however be a disadvantage if you use if it is fitted in series with the LEDs it will cause
rechargeable batteries; NiCd and NiMH should not the IC’s output voltage to rise to a level (15 to
be allowed to discharge down to this voltage level. 20 times the battery voltage) at switch off. This
could damage the IC.
That just about wraps it up for this circuit. Per- Just to be thorough the author tested the effi-
haps it is worth saying it is advisable to use LEDs ciency of the prototype. The circuit achieves an
with the highest Candela output you can find. The efficiency of 78.8 % when operating from a 3 V
ones used by the author here were not expen- supply. This is almost precisely the figure given
sive but they produce a very bright beam. Some in the IC’s data sheet operating with a 4.7 µH
LEDs allow a continuous current rating of 30 mA, coil. Even when the supply drops to 1.2 V you
in this case you can change the value of R1 to can expect a respectable 69.3 %.
750 Ω. The IC is capable of driving more than (140066)
two series-connected LEDs. With four LEDs in
Web Link
series the minimum supply voltage is around 2 V.
It is important to ensure that the on/off switch [1] www.elektor-magazine.com/140066
Figure 2.
Component placement using
the Elektor PCB.
Beep
The sounding logic probe/tester
By Clemens Valens Even if you have an upmarket logic analyzer and are
(Elektor.Labs)
completely at ease with its operation, you are
unlikely to use it to debug simple circuits like
Arduino and Raspberry Pi add-on boards.
That’s where Beep comes in.
V+
Power Supply
JP1 R4
1
VDD 10k IC2.B
2
GND R1 IC3.A 5 4
1 IC3.B 1
3 5 R7 C2
&
2M2
2 4
6 & 0R
C5 3 2 4u7
1 50V
470n IC2.A
R2
R5
1k IC2.C
1M
Signal
7 6
JP2 R6 IC3.C 1
1 8 C3
10k 10
2 9 &
C4 C7 C6 9 10 4u7
1 50V
50V
Q12
VSS
Figure 1. 13 12 IC2.F
8
Beep’s schematic. R7 is zero
ohms and represents a wire 140410 - 11
bridge.
The sound of logic high (that’s how a NAND gate works, Schmitt-trig-
‘Beep’, as we nicknamed our logic probe, is a ger inputs or not) and the oscillator is blocked.
simple tool that employs sounds to indicate sig- The output of IC3A will be high too analogous to
nal levels so you can use it without having to IC3C. Its input pin 2 will not be exactly at 0 V,
look up from your work. Beep will produce a low but it will be low enough for the gate to decide
frequency sound if the SUT has a low level and that its output should be high. Contrary to IC3C,
a high frequency sound when the SUT’s level is IC3B sees a high level on its Enable pin (5) and
high. When the SUT is undefined because it is so this oscillator is free to operate. A low-fre-
tri-stated (i.e. in high-impedance output mode) quency sound will be heard.
an unconnected input, or because the output is The opposite happens when the SUT represents a
of the open collector type and is missing a pull-up high level. Now both inputs of IC3A will be high,
resistor, Beep will remain silent. Many circuits causing its output to go low, effectively blocking
also contain signals that change level (very) fre- the low-frequency oscillator IC3B. The Enable
quently, too often for our human ears to hear, pin (8) of IC3C on the other hand will be high
and so Beep has been empowered to make such and the oscillator starts producing a high-fre-
signals audible as well. quency sound.
When Beep encounters an unconnected input,
Oscillate and divide a tri-stated (i.e. high-impedance) output or an
How can Beep do all this without a microcontrol- open-collector output without a pull-up resistor,
ler? Easy, thanks to two oscillators and a fre- the SUT will not have enough power to force
quency divider. One oscillator (IC3B, R4, C5) Beep’s high-impedance input (due to the high
is responsible for the low-frequency sound; the values of R1, R2 and R3) to a well-defined low
other (IC3C, R5, C6) generates the high-fre- or high level. Because of the voltage levels cre-
quency sound. The frequencies are determined ated by the voltage divider ladder R1, R2 and R3
by the values of R4/C5 (low) and R5/C6 (high). the inputs of IC3A will both be high and IC3C’s
Since the SUT cannot be high and low at the same Enable pin will be deemed low. Now both oscil-
time only one oscillator can be active at any time lators are disabled and Beep will remain silent.
hence the oscillators’ outputs can be connected When the SUT isn’t a steady level, i.e. it’s alter-
in parallel to drive the buzzer. nating between high and low, the oscillators will
The choice of the oscillator depends on the SUT be activated alternatively resulting in a two-tone
connected to pin 1 of JP2. When its level is low sound. As the SUT frequency increases the two-
the level on the Enable pin (8) of IC3C will be low tone sound changes faster until a point is reached
too, consequently IC3C’s output will be a steady where the oscillators can no longer follow the
Oscillator operation
Consider the oscillator IC3B, R4, C5 and resistor and the capacitor, as well as on the
assume pin 5 of IC3B is a steady high level. low and high thresholds of the gate.
At power-up C5 will be discharged keeping Because of the NAND function of IC3B, when
IC3B’s input pin 6 low. Because IC3B is a its input pin 5 has a steady low level its
NAND gate, its output will be high (Table 1) output cannot become low. The oscillator is
consequently R4 will charge C5. When the effectively disabled.
increasing voltage on C5 exceeds a certain
threshold, IC3B will ‘finds’ its input pin 6 logic Table 1. Truth table of a NAND
high. Now both inputs are high and so IC3B’s (not-AND; inverted AND) gate
output will toggle to low, causing R4 to start Input A Input B Output
discharging C5. When the decreasing voltage (pin 5) (pin 6) (pin 4)
on C5 drops below a certain threshold, IC3B 0 0 1
considers its input pin 6 to be low and we are
0 1 1
back where we started. The cycle is closed
1 0 1
and the oscillator is oscillating. The frequency
of the oscillator depends on the values of the 1 1 0
Web Links
[1] ‘Beep’ Project page: www.elektor.com/140410
[2] ELPP: https://github.com/ElektorLabs/PreferredParts
SUT and fall silent. This is where the frequency CMOS ICs the supply voltage can be up to 12 V,
divider IC1 comes in. It divides the input signal’s in case of TTL versions (like the 74HCT4040—
frequency by 256, 1024 or 2048, allowing you to not recommended) the power supply should not
notice frequencies up to 4 MHz (faintly assuming exceed 5 V.
your hearing goes all the way to 20 kHz). Switch Constructing Beep should not be overly com-
SW1 selects the divisor to bring the output fre- plicated. We have drawn a printed circuit board
quency in a range that suits your ears best. (PCB) you can order from the Elektor e-store.
The board was designed to fit in a Hammond
The oscillator’s outputs are too weak to drive type 1593D case.
the buzzer directly. Consequently they are con-
nected to an output stage consisting of two buf- The component mounting plan and component
fers in parallel that provide enough oomph for list are shown in Figure 2. The components are
the buzzer. Such a stage was added to the fre- all through-hole and most are taken from the
quency divider too to make sure that the sound Elektor Labs Preferred Parts (ELPP) library
always has the same loudness. [2] so their footprints and sizes are well-defined
and they are easy to find. The ICs are standard
Building and using beep logic devices that are easy to find too. SW1 may
Beep is conveniently powered from the circuit be a little harder to obtain, but it can be replaced
under test (CUT). This avoids having to replace by a pinheader and a jumper.
Figure 2. empty batteries when you don’t have any fresh (140410-I)
Beep‘s printed circuit board ones lying around. Make sure to connect pin 1 of
is designed to fit in a JP1 to the supply that powers the CUT of which
Hammond 1593D enclosure. you want to measure logic signals. If you use
Component List
Resistors JP1, JP2 = 2-pin pinheader
Default: 5%, 0.25 W 2 pcs DIP-16 IC socket (IC1 and IC2)
R1, R3 = 2.2MΩ 1 pc DIP-14 IC socket (IC3)
R2 = 1MΩ Case, Hammond 1593D
R4, R6 = 10kΩ PCB, Elektor Store # 140410-1
R5 = 1kΩ
R7 = 0Ω (alternatively, wire piece)
Capacitors
Default: 0.2” pitch
C1,C2,C3 = 4.7µF 50V (2mm pitch)
+
C4 = 82pF
C5 = 470nF
C6 = 330nF
C7 = 100nF
Semiconductors
IC1 = HEF4040BP (or equivalent)
IC2 = CD4050BE (or equivalent)
IC3 = HEF4093BP (or equivalent)
Miscellaneous
SW1 = slide switch, 2-pole 3-position (RS
702-3568 or similar)
BZ1 = buzzer (ELPP) 12mm diam.
2u2
pocket and not only demodulated on normal VHF receivers, the upper
16V <10p 0uH22 simple but also sta- end of the audio spectrum is attenuated and thus
R3
0 680R ble, because the corrected, with the range up to about 15 kHz
140467 - 11 frequency is crys- sounding properly balanced.
tal controlled. Understandably the oscillator has very restricted
RF output power, lying somewhere in the picowatt
By Hans-Norbert The so-called capacitive three-point oscillator (pW) region. The common-base circuit behaves
Gerbig (Germany) shown in Figure 1 uses a common-base circuit very stably and is therefore not significantly
and oscillates at the natural frequency of the ‘hand-sensitive’, making it unnecessary to provide
quartz crystal used for stabilization. It is designed any shielding. A VHF FM broadcast receiver
to be synchronized by audio signals within a standing in close proximity will pick up frequency-
defined lock-in range. Within this range it follows modulated overtones of the crystal frequency
every frequency variation of the control signal. from the weak radiation without difficulty.
The pull-in range can be extended if you switch
a resistor in parallel with the resonant circuit. Incidentally in this circuit you can substitute an
The oscillator operates consistently on its natural NPN RF transistor for the PNP example without
frequency and given amplitude. The pull-in range any other changes. All you need do is reverse
corresponds exactly to the audio drive signal, the polarity of C2 and the supply voltage UB.
with any interfering amplitude modulation on For stable oscillation both P1 and C1 need to be
either flank of the lock-in range being effectively adjusted to match L1 and X1.
truncated. The result is frequency modulation! (140467)
FM Synchro Receiver
Also with a capacitive three-point oscillator
By Hans-Norbert Small VHF receivers needn‘t employ complex
Gerbig (Germany) FM demodulation circuitry nor be double super- This ‘VHF radio’ with its synchro FM demodula-
hets. Using a capacitive three-point oscillator in tor exploits the same principle as used in the FM
common-base mode as the synchro demodulator synchro transmitter described elsewhere in this
makes things a lot easier. edition. The whole caboodle looks more compli-
cated than it actually is, which is fundamentally put voltage is very consistent and superimposed
nothing more than a ‘driven’ or ‘pulled’ crystal interference is suppressed. Furthermore the oscil-
oscillator. This is seen in the right-hand half of lator synchronizes exclusively to the frequency
the circuitry of Figure 1 built around T1. On the of the strongest transmitter. Other reception fre-
left-hand side we have just the audio frequency quencies of lesser amplitude, even if they occur
amplification and equalization. on the same channel, cannot upset or disturb
the oscillator and therefore have no effect on
Synchro demodulator the demodulator. Weaker transmitters are thus
A sinewave oscillator is synchronized in a pull-in suppressed entirely, even if their field strength
range (spectrally to the right and left of the natu- amounts to 70 % of the field strength of the
ral frequency) by a frequency supplied externally. desired transmitter. This results in unusually good
In this region it follows in step with every fre- selectivity.
quency variation (AF and RF) of the control signal. The proportional audio oscillations are extracted
The oscillator comprises the PNP transistor T1 at the emitter of the RF transistor T1. Resistor
in common-base mode. RF feedback is provided R5 and capacitors C4 and C7 act as a low-pass
here by C2. The frequency of oscillation is set filter to remove any remaining RF components.
by the inductance of L1 and the value of varicap C7 has a second function, to cancel out the typ-
diode D1 adjusted by P1. The pull-in range gets ical emphasis of the upper frequency spectrum
broader (and the selectivity correspondingly nar- of the audio signals of an FM transmitter.
rower), the more effectively the resonant circuit The common-base circuit, as with the capac-
is damped (detuned). Detuning is achieved using itive three-point oscillator transmitter, is ade-
resistor R2 connected in parallel with the tuned quately lacking in feedback and consequently
circuit. Without R2 fitted the receiver is highly barely hand-sensitive. There is no need to shield
selective; with the resistor the pull-in range is the oscillator therefore.
made broader. T2 and T3 produce simple amplification of the
audio signals. At their output users can connect
Characteristics a small integrated final stage or even some
In the circuit shown here the characteristics of high-impedance headphones or earbuds directly.
a driven oscillator are fully apparent: its out- (140468)
ANT1
UB
Feedback +6V...+9V
P2 R7 R9
C3 C6 C8
47k
6k8
1p 2u2 100n
100k 16V C9
10u Audio Out
C2 R4
16V
6k8
27p T3
T1
D1 R5 T2
BF451
3k3
C5 2x
BB521 R2 L1 R3 1u BC550B/C
P1 * R1
100k *
16V R6
47k
10k
47k
R8 R10
C1 C4 C7 C10
100nH
2k2
470R
100k
4n7 330p 22n/33n 47u
16V
EveryCircuit App
Playing with electronic components
Figure 1.
An EveryCircuit simulation
on an iPad.
Today’s electronics designers would be lost without from the usual simulation programs. The aim of
AC power, a computer or laptop for drawing sche- EveryCircuit is to show how a circuit works in a
matics, simulating circuits and laying out circuit clear and simple manner without burdening the
boards. In recent years smartphones and tablets user with a whole lot of technical details. The
have joined the ranks of the computer-aided bri- waveforms of various signals (voltage and cur-
gade, where they are primarily used as calcula- rent) in the circuit are shown live on the screen,
tors or information portals for components or data and you can adjust the circuit and the component
sheets, among other things. It has taken a long parameters while the simulation is running. The
time for more or less usable schematic drawing program is available as an app for Android and
and simulation programs to become available for iOS devices, but it can also run on Windows and
tablets and/or smartphones, but now electronics Linux systems in a Chrome browser. To get an
enthusiasts and professionals have a number of idea of how well it works, we tried out the pro-
choices for these activities. You have to decide gram briefly on an Android tablet and a Windows
for yourself whether it makes sense to run such PC. The description below is based on the version
complex programs on a smartphone screen. that runs in the Chrome browser. The user inter-
face of the version for tablets or smartphones
EveryCircuit is an app for simulating electronic is nearly the same, with the difference that you
circuits, but the way it works is entirely different use your fingers instead of a mouse.
A trial version of EveryCircuit is available [1], dragged to the right place. After that you can
which is handy if you want to first try it yourself. draw connecting lines by clicking on the leads of
However, the drawing area for the schematic is two components. When you select a component,
severely limited in the trail version and only allows several icons are shown on the bar at the bottom
six or so components to be placed. This restriction of the screen. You can use them to rotate, flip or
is removed when you purchase a license code delete the component or adjust its properties.
(good for one year), which is available in the When you click the wrench icon, all possible set-
Elektor Store [2]. Then you have access to the tings of the component are displayed and you
user community and can store schematics in the can adjust them using a knob on the right. You
cloud, which makes them available on multiple can also use the eye icon to select the waveform
devices (e.g. tablet and PC). You can keep your you want to see during the simulation. When you
circuit diagrams private or share them with the do this with a component, the current waveform
community so they are available to everyone. A is shown, and if you click on a connection the
large number of circuits are now available from voltage waveform is shown. If you click again on
the community. the selected component or on a blank area in the
drawing area, two triangles marked “t” and “f”
Using the program appear at the bottom (the latter only with the
The first thing you notice after starting up the registered version). They stand for the two sim-
program is that the user interface is very sparse. ulation options: transient and frequency. Click-
Since there isn’t any user guide (at least not yet), ing one of these symbols starts the simulation.
it takes a bit of time to figure out how everything If you select frequency analysis you see a Bode
works. A toolbar with component icons is located chart, very much like other simulation programs.
at the top. It includes the most common types, What’s especially interesting with EveryCircuit is
such as voltage and current sources, resistors, the transient analysis function, since it allows you
transformers, transistors, switches, logic gates to observe the behavior of the circuit and view
and even a 555 timer IC. There is no library of the currents flowing through the components. If
type numbers, but the properties of individual you simply select a voltage source, a resistor and
components placed in the circuit can be adjusted. an LED and connect them together, you can see
When you click a component icon, the compo- right away how much current is flowing through
nent appears in the drawing window and can be the component and the voltage drop over the
Figure 2.
The EveryCircuit start page
in the Chrome browser.
Example circuits and circuits
from other users are shown
on the left, the schematic
window with the simulation
waveforms is in the middle,
and the current project and
its description are on the
right.
component. Many components behave the same settings for semiconductors will probably be dif-
way on the screen as in real life. For example, ficult to understand for beginners.
LEDs only light up when there is enough cur-
rent flowing through them, and switches can be This program is really fun to use even if it does
operated during the simulation. These features not replace “heavy duty” simulation programs.
make EveryCircuit ideal for newcomers to elec- Even experienced old hands in electronics will
tronics. You can try out all sorts of things quickly probably enjoy occasionally putting together a
and see what happens (or doesn’t happen) right circuit with EveryCircuit and seeing what happens
away. However, some basic knowledge of how without worrying about all the technical details.
electronic components work is advisable because Not sure though what Bob Pease’s verdict would
the program does not explain this. have been.
(140334-I)
Along with designs made available by the com-
Web Links
munity, there is a set of example circuits that
you can use for practice or to learn more about [1] www.everycircuit.com
how electronics works. [2] A one-year license for EveryCircuit is avail-
able in the Elektor Store for $10.00 / £6.95
Conclusion / €7.00 with 10% off for Elektor GREEN and
EveryCircuit is an especially handy simulation GOLD Members:
program, particularly for relatively simple cir- www.elektor.com/everycircuit-app
cuits. It is easy to use, although it does have a
bit of a learning curve. The live display of voltages
and currents makes circuit operation very easy
to understand, along with the ability to adjust
component parameters while the simulation is
running. For novice electronics enthusiasts or
students, this is the ideal way to get experience
in the design of electronic circuits without having
to actually build them. However, the parameter
Figure 3.
Clicking the Expand button
hides the left and right
columns, which makes
everything a bit easier to
follow. On the left there is
a small window showing
the characteristics of the
LED, and you can adjust the
various settings with the
knob on the right.
The present RTC device family from the supplier In principle all of the modules are arranged simi-
Micro Crystal (a Swatch group company) claims to larly, although versions are distinguished by vary-
meet users’ most varied demands with its range ing characteristics, different registers or differing
of energy saving, extremely accurate and highly peripherals. Among other things, the types vary
compact modules. It’s worth emphasizing that
the (typically 32.768 kHz) clock Xtal is already
incorporated. And since we are talking about a
manufacturer from Switzerland (not a country
you might usually associate with semiconduc-
tor components), you would rightly expect some
expertise in the field of time measurement.
in current consumption and level of accuracy. or the ‘Self-Recovery System’. The last-named
Table 1 provides an overview of these variations. occurs when the internal State Machine hangs
The ‘Voltage’ column begins with the lowest value up. There are two Timer Registers, one each
at which the time keeping function alone will for the LSB and the MSB. These make use of a
operate. The interface and built-in temperature 16-bit downwards counter, the timing of which
sensor are available only at higher voltages. Spe- is set down in the Control Registers. Here too is
cial functions relating to accuracy of the time where you can indicate whether the Timer should
were not considered. be recharged automatically following the (possi-
ble) Interrupt on reaching the final value of ‘0’.
Inner workings Most Interrupts need to be enabled in the Con-
The internal elements of the RTC modules are trol Registers. Alternatively there are also Flags
explained next, using the type RV-3029, which that show whether the event has already taken
provides an I²C interface, as our example. In the place. These need to be reset again after every
block diagram in Figure 3 you can see the tem- event, even if the Interrupts are not activated.
perature sensor mentioned already. It is not for There are also Flags that indicate which event
assessing the ambient temperature but performs triggered the Interrupt. These must be reset fol-
the vital function of temperature compensation lowing an Interrupt, in order that the INT pin is
for maintaining the crystal frequency. For this also set back to a logic ‘1’.
the manufacturer uses special registers to file
the correctional data relating to the crystal in In the Power Control block we have an elaborate
question. Users can of course overwrite this but system that recognizes certain defined voltage
they need to know exactly what they are doing. levels and, depending on these, (for example)
switches the internal resistance between VDD
At upper left we find the crystal oscillator, fol- and VBACKUP. In this way an optional Gold Cap
lowed by the divider for the temperature com- connected to VBACKUP is recharged again. If the
pensation logic, which increments the Seconds supply voltage should fall below 2.1 V (VLOW1),
Register directly. All register values are held in CLKOUT, the temperature sensor and the write
BCD format. The Hours Register includes an extra facility to the Register are deactivated. The I²C
bit for selecting either 12 or 24-hour mode. The interface still remains active, albeit with reduced
block labeled ‘Output Control’ supplies the out- speed.
put, according to how CLKOE is set, with a clock
pulse CLKOUT. The frequency output ranges from Booting up and in use
1 to 32.768 Hz and is declared in the EEPROM After connecting the supply voltage and perform-
Control Register using bits FD1 and FD0. ing the Power-On Reset that follows, most func-
When an Interrupt occurs, a logical ‘0’ appears tions such as the Alarm or the Timer are not yet
on the INT pin. An Interrupt can be triggered by active. The manufacturer recommends that after
either the Timer, the Alarm, the Power Control each Power-On Reset you also perfume a Sys-
Temperature °K 20
[1] www.microcrystal.com/index.php/products/ User EEPROM
2 Bytes
28
2
I C-BUS 29
real-time-clocks SCL
EE Ctrl
Xtal Deviation
30
2-wire TEMPERATURE
Xtal Temp-Coef
SENSOR Xtal T0 Temp
Serial
SDA User RAM 38
Interface 8 Byte
User RAM 3F
www.techthefuture.com
Follow Tech the Future
seen
@ has an on-board programming course), using it is easy too; everything is designed
14 to be easy and open. It is a sort of entry level development platform for people who
ron ica 20
elect are interested in tablet and smartphone programming but who lack the skill, patience and/or money to get an
app in the Apple store. The Phoenard has attracted a lot of attention over the last months — it even won several
prestigious awards — and by the time of publishing this edition the Phoenard team should have completed their
successful crowdfunding campaign on Kickstarter.
www.phoenard.com
Bluetooth Coins
EM Microelectronic’s COiN is a versatile, high performance, low power solution that can be deployed any, where
iBeacon™ technology is used, but which also supports wireless sensor networking and many other applications over
Bluetooth® Smart (Bluetooth with a Low Energy Core Configuration) wireless communications. Due to its unique
design, COiN consumes less than 20 μA average in a typical application, resulting in more than 18 months’ operation
from a single CR2032 battery, which is included in the beacon. COiN also contains a built-in pushbutton switch, thus
guaranteeing that your beacons have a full charge when they are deployed. Integrated red and green LEDs provide
users with feedback about the device’s operating mode. Just click and stick!
The COiN’s integrated printed circuit antenna not only minimizes cost, but maximizes communication range. At the
0 dBm output power setting, EM Microelectronic’s beacons can be detected 75 meters
away by an iPhone® 5S, and at maximum output power, that distance extends up
to 120 meters. Due to COiN’s optimized circuit architecture, it is completely immune
to over-the-air attacks, meaning that a well-placed beacon is very secure. It cannot
be “hacked” or modified unless the perpetrator has complete physical possession of
the device.
COiN is shipped pre-programmed, complete with a Renata CR2032 battery and
a weatherproof plastic enclosure for easy deployment, making it suitable for use
at outdoor music festivals, sporting events and arenas, and anywhere a beacon
is required to withstand the elements. Though COiN is available in-stock pre-pro-
grammed and with a standard housing, the standard COiN hardware and firmware
are easily modified to fit most applications. At the most basic level, COiN firmware
can easily be modified to change the UUID, MAJOR ID, MINOR ID, output power,
seen
@
and beacon interval. These changes are useful for adapting the beacon for whatever smartphone software appli- a 2014
lectron c
i
cation/API is being used, segregating beacon populations and sub-populations, and for optimizing battery lifetime e
based on the desired use case.
Should more extensive firmware modifications be desired, EM offers a complete development kit. The COiN
Development Kit includes five (5) COiN beacons, programming board and programming cable and is fully com-
patible with EM’s line of software development tools for the EM6819; EM’s ultra-low power microcontroller.
Using these tools, customers have complete control over the firmware and can create their own Bluetooth
Smart advertising packets and transmit real-time sensor data such as temperature, light level, battery voltage,
or other physical phenomena.
www.emmicroelectronic.com
Digi-Disco 1978
Dance till the 7406 explodes
By Dan Koellen (USA) It is spring 1978, “Burn Baby Burn, Disco Inferno” is blaring through a Highschool
gymnasium full of kids dancing to the latest disco tunes. I am sitting on the stage
next to the DJ checking sound levels and mashing mechanical switches struggling
to make our gel lights change with the beat of the music.
Growing tired of working the lights by hand I the lights had to be powerful enough to fill school
started the design of the Digi–Disco, a light con- gymnasiums with light. Each ‘gig’ that we did was
troller that uses sampled audio to drive lights at a different location which necessitated easy
with no manual switching. Except for occasionally setup, disassembly and storage.
changing the mode of operation, no interaction Microcontrollers were not ubiquitous as they are
is needed after setup. But since I was a full-time now so I used discrete digital logic and ana-
college student construction could not start until log components consisting of very common–in
summer break. 1978–74xx series TTL ICs for the digital portion,
bipolar ICs for analog and a 555 timer. Without
The design eBay, Amazon or surplus websites of today I
I wanted the controller to be as automatic as pos- used devices that were already in my parts bin
sible so using the music that was being played to or available from local electronic shops, surplus
change light patterns seemed to be a reasonable stores or Radio Shack. Mail order was popular
approach. Also the disco music craze made light but was inconvenient and slow. My local Radio
displays that moved back and forth, in a chasing Shack, a quick bicycle ride away, was the source
fashion, very popular. So chaser light patterns for the voltage comparators, enclosures, and tri-
were required for the most effect. In addition, acs. CMOS digital logic and 74LS series TTL could
have been used but they were not readily avail-
able to me and were more expensive.
The Digi-Disco was built in two pieces. One piece
Retronics invades elektor.tv was a console, shown in Figures 1 and 2, which
had most of the controller circuitry, selected the
mode of operation and sampled the audio. The
second piece was a remote box, shown in Fig-
ure 3, which contained the triacs used to switch
the lights and supplied power to the console.
The console and the remote box were connected
Using solid-state with an eleven conductor cable. The final ver-
equipment Retronics’ sion powered four light bars that consisted of six
very first video 75-watt color spot lights each. Each of the six spot
was recorded and lights were switched individually but in common
is now posted at between all four light bars. Two of the light bars
www.elektor.tv. were hung above the DJ stage with the other two
Watch visitors to light bars on either side of the stage sitting on
the electronica 2014 show in Munich confronted with the 1976 top of the massive Voice of the Theater speakers
ElektorScope and a Rohde & Schwarz 1960’s tubed signal generator we used for the sound system. The remote box
that gets opened up for inspection. More Retronics video clips and was hung between the two light bars above the
rare footage will be uploaded to elektor.tv in the near future. DJ stage; eight conductor cables were used to
connect to the light bars. Consuming 1800 watts
The circuit
The original hand drawn schematic is shown in
Figure 1.
Figure 4, no schematic drawing programs were The console manages the
available to college students at that time. All the operation of the light show;
circuitry in the schematic is in the console except the wear and tear seen
for the remote box in the lower right with the here shows the console was
triacs and power transformer. used quite often. In the
The audio was sampled directly from a speaker lower right corner, PHASE
terminal and brought to the ‘audio input’ poten- is the identity I used when
working sound and lights for
tiometer and diode on the left side of the sche-
the dance gigs.
matic. I used a 1N34A germanium diode for the
lower Vf than a silicon diode, the 10-kΩ pot is
used to adjust the level of the audio signal. The
diode provides rectified audio, noted as A.R. in
the schematic. The rectified audio is raw with
no filtering, this seemed to work just fine for
the effect that was sought after. I had thought
Figure 2.
about using an active rectifier and filtering but
The circuitry contained in
deemed it not needed.
the console was built on a
The rectified audio is used in two different parts of piece of perforated board.
the circuit; one that changes the lights according Black soot from the 7406’s
to the amplitude of the audio and the other that catastrophic failure can
advances a counter in response to the audio. In be seen in the top center.
the middle of the schematic are LM339 (the build To the left is the tube of
used Radio Shack’s version: RS339) voltage com- replacement devices that
parators (IC3 and IC4), they are referenced to a was brought to each gig.
resistor ladder so their outputs go low when the
rectified audio exceeds the corresponding resistor
ladder node. As the level of audio increases, the
number of lights that turn on increases, like a
large VU meter. The resistor ladder was designed
for the best response to audio, not for precise Figure 3.
measurement or constant load. The remote box contained
For the chaser light effect a pulse generator, a the triacs to switch the
lights. At the bottom are the
555 astable multivibrator, is used to clock the
sockets for connection to
74190 up/down decade counter. The BCD output
the light bars; the console
of the decade counter is decoded to decimal by cable plugged into the
a 7442; as shown in the upper part of the sche- socket on the bottom left.
matic. The decade counter is advanced by pulses The transformer supplied
directly from the 555, pulses gated by the 7408 stepped down AC to the
AND gate and voltage comparator or the output console.
Operation
The Digi-Disco worked really well especially with
Disco’s steady bass beat it was designed to take
advantage of. It turned out to be easy to set
up and take down. During operation I kept the
counter in the up and down and gating mode for
the majority of the time; the 555 was adjusted
for a moderate speed of about 2 Hz. This made
the lights dance in what looked like a random
pattern that appeared to move with the beat of
the music. When the DJ was talking the audio
Figure 4. nel 1; counting down from channel 6 to channel level mode (i.e. the VU meter) worked well and
The hand drawn schematic 1 resetting to channel 6; and counting up and was a nice change of pace.
for the Digi-Disco. Phase down from channel 1 to channel 6 back down to The kids at the dances really liked the light show
Sound and Light Consultants
channel 1 and repeating. The 7470 is a JK flip and word spread about the Digi-Disco. Because
was the entity identification
flop with preset and clear, which I used to set the of this we were able to increase the number of
I used at that time.
direction of 74190 counting while loading either gigs that we played and our fee also increased.
0 or 5 depending on the count direction. For up And, best of all, no more mashing of mechanical
and down counting the direction of counting was switches; the Digi-Disco ran on its own very well
flipped at 0 and 5 so the next pulse advances in with little operator interaction needed.
the opposite direction, the preset was not used.
Since the rectified audio is always connected Compared to Digi-Disco, Elektor’s 1984 Pro-
to both the analog level circuit and the digital grammable Disco Array is much more advanced
counter circuit the mode of operation is selected with its 32 light patterns in memory, CMOS ICs,
by connecting the appropriate outputs to the 7408 19-inch rack housing, and 7-segment readouts.
(IC1 and IC2) and 7406 output drivers by the The project was commemorated in Retronics,
mode switch in the middle of the schematic. This February 2008.
allowed the mode of operation to be changed very (140420)
quickly. The 7406 is a high voltage open collector
invertor that can sink 40 mA. The triacs used to
Retronics is a switch the lights commanded at least 50 mA of
monthly section gate current to turn on. The driver had to sink
covering vintage that current when the triac is off so I soldered
electronics two 7406s piggy back to handle that much cur-
including legendary rent (only a single device is shown in Figure 2).
Elektor designs. When the 7406 driver output was off (i.e. open)
Contributions,
the gate current was sent over the eleven con-
suggestions and
ductor cable to trigger the corresponding triac
requests are
in the remote box. More 74xx TTL and 40xx CMOS!
welcome; please
You may notice that the triacs are not electri- on the Elektor 1980s DVD
telegraph
cally isolated. In 1978 opto-isolators were very www.elektor.com/eighties (shortly)
editor@elektor.com
expensive, especially for a college student, and
Patents
UK / ROW
Patent protection may exist with respect to circuits,
Elektor International Media
devices, components, and items described in our books,
78 York Street
magazines, online publications and presentations. Elektor
London W1H 1DP
accepts no responsibility or liability for failing to identify
United Kingdom
such patent or other protection.
Phone: (+44) (0)20 7692 8344
E-mail: service@elektor.com Copyright
All drawings, photographs, articles, printed circuit boards,
Customer service hours: programmed integrated circuits, discs, and software
Monday-Thursday 9:00 AM-5:00 PM CET. carriers published in our books and magazines (other
than in third-party advertisements) are copyrighted
and may not be reproduced (or stored in any sort of
PLEASE NOTE: While we strive to provide the best retrieval system) without written permission from Elektor.
possible information in this issue, pricing and availability Notwithstanding, printed circuit boards may be produced
are subject to change without notice. To find out about for private and educational use without prior permission.
current pricing and stock, please call or email customer
service for your region. Limitation of liability
Elektor shall not be liable in contract, tort, or otherwise,
COMPONENTS for any loss or damage suffered by the purchaser
Components for projects appearing in Elektor are usually whatsoever or howsoever arising out of, or in connection
available from certain advertisers in the magazine. If with, the supply of goods or services by Elektor other than
difficulties in obtaining components are suspected, a to supply goods as described or, at the option of Elektor,
source will to refund the purchaser any money paid with respect to
normally be identified in the article. Please note, however, the goods.
that the source(s) given is (are) not exclusive.
MEMBERSHIPS
Membership renewals and change of address should be sent to the Elektor Membership Department for your region:
Go to www.elektor.com/member.
The Hexadoku puzzle employs numbers in the hexadecimal thicker black lines). A number of clues are given in the puzzle
range 0 through F. In the diagram composed of 16 × 16 boxes, and 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 Correct entries received enter a prize draw. All you need to do
each column and in each of the 4×4 boxes (marked by the is send us the numbers in the gray boxes.
Prize winners
The solution of the November 2014 Hexadoku is: 63D95.
The €50 / £40 / $70 book vouchers have been awarded to: Andrej Marn (Slovenia),
Gerrit van Leeuwen (Netherlands), Jozef Bouwen (Belgium), and Francois Jongbloet (France)..
Congratulations everyone!
6 8 2 4 D B 3 5 C E 1 9 7 0 F A
C 5 0 7 A E F 2 B 6 D 3 1 8 4 9
1 9 3 A 0 6 4 7 F 2 5 8 B C D E
B D E F C 8 9 1 0 7 4 A 2 3 5 6
D 2 F 3 5 0 6 C A 9 7 1 8 E B 4
0 1 5 9 3 4 D A 2 8 E B F 6 7 C
4 7 6 E B F 8 9 D C 3 5 0 1 A 2
8 A B C 1 2 7 E 4 F 0 6 3 D 9 5
2 B 1 5 9 C 0 8 E D 6 F A 4 3 7
7 C 8 D E A 1 3 5 0 9 4 6 F 2 B
F E 9 6 2 D B 4 1 3 A 7 C 5 8 0
A 3 4 0 6 7 5 F 8 B 2 C D 9 E 1
E 0 A 1 F 9 C B 3 5 8 2 4 7 6 D
3 F 7 2 4 5 E D 6 1 B 0 9 A C 8
9 6 D B 8 3 A 0 7 4 C E 5 2 1 F
5 4 C 8 7 1 2 6 9 A F D E B 0 3
The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses.
1 4
3
15% DISCOUNT
for GREEN and GOLD Members!
www.elektor.com/rpi-book
Includes 17 RPi Hardware Projects! acteristics and applications of inductive components. 110 Elektor Editions, Over 2500 Articles
1 Raspberry Pi The Trilogy comprises: Basic Principles, Components, 4 DVD Elektor 2000
Advanced Programming and Applications. Highlights include calculation, dimen- through 2009
This book starts with an introduction to the Rasp- sioning and construction of customer-specific trans- This DVD-ROM contains all circuits and projects pub-
berry Pi computer. The network interface of the RPi formers, an introduction to frequency compensation, lished in Elektor magazine’s year volumes 2000 through
is explained in simple steps, demonstrating how the Class-D amplifier design and basic principles of Eth- 2009. The 2500+ articles are ordered chronologically by
computer can be accessed remotely from a desk- ernet & Power-over-Ethernet. Furthermore Trilogy of release date (month/year), and arranged in alphabet-
top or a laptop computer. The remaining parts of Magnetics includes over 200 practical examples of filter ical order. A global index allows you to search specific
the book cover the Python programming language, circuits, audio & video circuits, interfaces, RF circuits, content across the whole DVD. Every article is printable
including advanced topics such as operating sys- motor control units and SMPS. The book closes off with using a simple print function. This DVD is packed with
tem calls, multitasking, interprocess synchroniza- a keyword index and a summary of formulas. ideas, circuits and projects that are ideal for any elec-
tion and interprocess communication techniques. 728 pages • ISBN 978-3-89929-157-5 tronics enthusiast, student or professional, regardless
Network programming using UDP and TCP protocols £42.95 • € 49.00 • US $67.00 of whether they are at home or elsewhere.
is described (with examples). The Tkinter graphical ISBN 978-1-907920-28-8
user interface module (GUI) is described in detail with £77.95 • € 89.00 • US $121.00
example widgets and programs. The last part of the The e-engineer’s delight
book includes hardware projects based on using the 3
USB Hub feat.
advanced programming topics such as multitasking RS-232/RS-422/RS-485 Fun to Build and Use Projects
and interprocess communication techniques. This USB-to-serial converter allows you to connect two Create 30 PIC
358 pages • ISBN 978-1-907920-33-2 RS-232 and/or two RS-422/485 devices to your laptop 5 Microcontroller Projects
£39.95 • € 44.95 • US $61.00 or workstation through a standard USB (Universal Serial with Flowcode 6
Bus) port. Thanks to the integrated USB hub the device This book covers the use of Flowcode® version 6, a state-
does not ‘consume’ precious USB ports. Even better: It of-the-art, all-graphical based code development tool, for
The Authority on Magnetics and Inductors offers you two extra USB ports! The device is compati- the purpose of developing PIC microcontroller applications
2 Trilogy of Magnetics ble with new and legacy serial devices, and is perfect for at speed and with unprecedented ease. Without exception,
A standard work in the hands of 15,000 design engi- instrumentation and manufacturing applications. the 30 projects in the book are fun to build and use. A
neers, academics and researchers worldwide, Trilogy Ready-built module Art.# 140033-91 secret doorbell, a youth deterrent, GPS tracking,
of Magnetics aims at familiarizing users with the char- £95.95 • € 110.00 • US $149.00 persistence of vision (POV), and an Internet webserver
5 6 7
9
8
are just a few examples of projects in the book waiting Advanced Robot Technologies Made Easy PC can be pressed into service as a measurement and
to be explored and mastered. This makes the publication 7 Advanced Control Robotics control hub. An IO-Warrior module on the I/F board takes
a perfect source of projects constantly challenging your It doesn’t matter if you’re building a line-follow- care of USB communication, and source code is available
hardware and software skills as you progress, resulting in ing robot toy or tasked with designing a mobile that works with the free version of Visual Studio.
advanced microcontroller applications you can be proud system for an extraterrestrial exploratory mis- Ready-built IO-Warrior56 module
of. All sources referred in the book are available for free sion: the more you know about advanced robotics Art.# 130006-91
download, including the support software. technologies, the better you’ll fare at your work- £34.95 • € 39.95 • $54.00
226 pages • ISBN 978-1-907920-30-1 bench. Hanno Sander’s Advanced Control Robotics
£30.95 • € 34.95 • US $48.00 is intended to help roboticists of various skill lev-
els take their designs to the next level with micro-
controllers and the know-how to implement them
Three Sizes for Cheap & Fast AVR Prototyping effectively. Advanced Control Robotics simplifies the 20 Amazing Projects
6 T-Boards theory and best practices of advanced robot tech- 9 Raspberry Pi Maker Kit
In response to the limitations posed by fixed-design, Ardu- nologies. You’re taught basic embedded design the- If you already own a Raspberry Pi and have done your
ino-style boards, Elektor has designed three mini-devel- ory and presented handy code samples, essential first electronic project then you are ready for this kit.
opment boards that give developers more flexibility while schematics, and valuable design tips (from con- It has all you need to bring 20 simple projects to life,
still hosting the microcontroller and its supporting com- struction to debugging). including 62 parts and a 160 page handbook. Your
ponents. We’re very excited to present the T-Boards! 160 pages • ISBN 978-0-96301-333-0 Raspberry Pi is capable of more than you thought:
T-Boards are breadboard-friendly PCBs designed for sim- £34.95 • € 39.95 • US $54.00 Control your minicomputer by using spoons, dis-
ple and swift microcontroller prototyping using an Atmel play your song titles on the LCD or build your own
ATmega328, ATtiny24-44-84 and ATtiny25-45-85 micro- binary clock. With the graphic programming language
controllers. Additionally, each T-Boards has an integrated Scratch this all can be done in a short time. Don’t
3.3V and 5V-selectable power supply, which assists in Measurement and Control using your PC worry. Programming skills are not needed. In case
reducing the number of required jumper wires and allows IO-Warrior the ports at the GPIO aren’t enough, you will learn
8
for experimenting with lower power usage. Programming Expension Board how to extend them.
the microcontroller can be done in-circuit (ICSP). Don’t throw out your old PCs and notebooks or leave them All-in-one kit
Bundle of three boards Art.# 130581-94 gathering dust in the basement! They can be a useful Art.# 140539-91
£33.95 • € 39.00 • US $53.00 resource: by adding this universal interface card an old £69.95 • € 79.95 • US $108.00
11
10 13
12
Explore the RPi in 45 Electronics Projects seven digital outputs, four PWM outputs, asynchro- Exclusive Product Bundle
10 Raspberry Pi nous serial and I2C and SPI interfaces. The board is in Cooperation With Microchip
This book addresses one of the strongest aspects of compatible with Android 3.1 (Honeycomb) or higher
13 Gesture & Touch Control
the Raspberry Pi: the ability to combine hands-on (Android Open Accessory Mode should be supported). Development Kit
electronics and programming. No fewer than 45 excit- Ready-built module This bundle consists of the MGC3130 Hillstar Single
ing and compelling projects are discussed and elab- Art.# 130516-91 Zone Development Kit, and the 3D Touchpad. The
orated in detail. From a flashing lights to driving an £26.95 • € 29.95 • US $41.00 dev kit in the bundle serves the microcontroller fans
electromotor; from processing and generating ana- among you, the 3D Touchpad, those of you into PC
log signals to a lux meter and a temperature control. programming. The dev kit comprises an MGC3130
We also move to more complex projects like a motor Experience the Sounds of Bats Module, an I2C to USB Bridge Module, a 4-layer Ref-
speed controller, a webserver with CGI, client-server Do-it-yourself erence Electrode, a ‘Hand Brick’ set (self-assembly,
12
applications and Xwindows programs. Each project Bat Detector 4 foam blocks, 1 copper foil), and a USB cable for PC
has details of the way it got designed that way. The Who says you can’t hear bats? With this proper gizmo, connection. The 3D Touchpad in the product bundle is
process of reading, building and programming not you can–and much more! Build your own high-quality a ready manufactured 3D Tracking and Gesture con-
only provides insight into the Raspberry Pi, Python, ultrasonic bat detector and experience these sounds troller with mouse functionality included.
and the electronic parts used, but also enables you to for yourself! This kit for home assembly makes it an Development Kit
modify or extend the projects any way you like. easy and fool-proof process. The printed circuit board Art.# 140423-91
288 pages • ISBN 978-1-907920-27-1 comes with many SMD components premounted. All £108.95 • € 125.00 • US $169.00
£34.95 • € 39.95 • US $56.40 you have to do is solder in a few parts and connect the
circuit board to the microphone, the loudspeaker and
the controls. State of the art integrated circuits ensure
Android User Interface Builder high sensitivity and volume. Once you have assembled MIFARE and Contactless Cards in Application
11 Android Breakout Board the bat detector, you can start exploring right away! 14 RFID
The FTDI FT311D is a flexible bridge that can inter- All-in-one-kit MIFARE is the most widely used RFID technology, and
face your circuit to an Android smartphone or tablet. Art.# 140259-91 this book provides a practical and comprehensive intro-
This Elektor Android Breakout Board offers options for £26.95 • € 29.95 • US $41.00 duction to it. Among other things, the initial chapters
14 16
15
cover physical fundamentals, relevant standards, RFID modules and many other devices. This shield thus and the practical projects invaluable during their final
antenna design, security considerations and cryptog- ameliorates the Arduino Uno’s most significant short- year projects. Similarly, postgraduate students should
raphy. The complete design of a reader’s hardware and comings on on-board peripherals. be able to develop advanced DSP based projects with
software is described in detail. The reader’s firmware Ready-built module the aid of the book.
and the associated PC software support programming Art.# 140009-91 428 pages • ISBN 978-1-907920-21-9
using any .NET language. The specially developed PC £23.95 • € 26.95 • US $37.00 £43.95 • € 49.90 • US $68.00
program, “Smart Card Magic.NET”, is a simple devel-
opment environment that supports sending commands
to a card at the click of a mouse, as well as the ability
to create C# scripts. Alternatively, one may follow all of Ideal reading for students and engineers
the examples using Visual Studio 2010 Express Edition. Practical
Finally, the major smart card reader API standards are 16 Digital Signal Processing Further Information and
introduced. The focus is on programming contactless using Microcontrollers Ordering:
smartcards using standard PC/SC readers using C/ This book on Digital Signal Processing (DSP) reflects
C++, Java and C#. the growing importance of discrete time signals and www.elektor.com/store
484 pages • ISBN 978-1-907920-14-1 their use in everyday microcontroller based systems.
or contact customer service:
£43.95 • € 49.90 • US $68.00 The author presents the basic theory of DSP with mini-
mum mathematical treatment and teaches the reader Elektor International Media
how to design and implement DSP algorithms using
popular PIC microcontrollers. The author’s approach
78 York Street
15 Arduino Extension Shield is practical and the book is backed with many worked London - W1H 1DP
This shield intended to augment the Arduino Uno examples and tested and working microcontroller pro-
United Kingdom
offers starters a text display, LEDs and pushbuttons grams. The book should be ideal reading for students
to provide a good basis for their projects. For expe- at all levels and for the practicing engineers who may Phone: +44 20 7692 8344
rienced users two extension connectors are provided want to design and develop intelligent DSP based sys- E-mail: service@elektor.com
which can be used to connect relay modules, wireless tems. Undergraduate students should find the theory
UPCOMING IN ELEKTOR
Next Edition: 2/2015, no. 459/460, March & April. Publication date: March 2, 2015. Content and article titles subject to change.
Check out
www.elektor-labs.com
and join, share, participate!
The Microchip name and logo, GestIC, and mTOUCH are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. All other trademarks mentioned herein are the property of their respective companies.
©2014 Microchip Technology Inc. All rights reserved. DS30010086A. ME1119Eng10.14