09 Us201009 PDF
09 Us201009 PDF
[Microcontrollers
p earn September 2010
0+
5uild & l ✚ focus on circuit simulation
b
elektor.com
Digital
Multi-Effects Unit
15 configurable
sound effects
The Elektor
DSP Radio (2)
Antennas and PC Software
Give your projects simple grace with the Elektor Project Case
✚ Audio DSP Kickoff
✚ Unilab V/I Display
System
for small microcontrollers
UNIQUE PRODUCTS & SUPPORT
www.saelig.com
Color LCD Scopes 2-ch 1GSa/s Scopes Scope + Analyzer Amazing 7 in 1 Scope! $199
PDS5022S / PDS6062T
CircuitGear CGR-101™ is a unique
GO !
lle t
GO !
RI E W
RI E W
L
Se Bes
CGR-101
r
DS1052D
DS1000E
N
N
which provides the features of seven
devices in one USB-powered compact box:
2-ch + trigger standalone USB 2-ch 1GS/s (25GS/s equiv.) 25MHz 2-ch /16 logic scope 2-ch 10-bit 20MS/sec 2MHz oscilloscope,
bench scope. $287 / $419 50/100MHz scope. $399 / $711 and analyzer. $1095 2-ch spectrum-analyzer, 3MHz 8-bit
Handheld Scopes Pen Scope XP Emb Touchpanel arbitrary-waveform/standard-function “I really like this scope adapter
HDS1022MN / HDS2062M
generator with 8 digital I/O lines. It also - it’s meant for teaching electronic
PS2104 / PS2105
www.saelig.com
functions as a Network Analyzer, a experiments but it’s ideal for
CUPC-80
engineers too.”
Noise Generator and a PWM Output
Touch-input 10.2” LCD 12V-pwd source. What’s more – its’ open-source
20 / 60MHz rugged handheld 10/25MHz USB scope-in-a-probe! Windows PC. LX800/512MB/4GB/ software runs with Windows, Linux and Alan Lowne
USB 2-ch scope. $589 / $699 Up to 100MS/s. $193 / $280 Ethernet/3xUSB/SD. Mac OS’s! Only $199! Saelig CEO
Low-Cost Scopes 6-in-1 Signal Generator Mixed-Signal Scopes microCAM Multichannel DAQ FREE COFFEE
uCAM-232 / uCAM-TTL
PL1012 / PL1216
PS2203/4/5
CS328
Card with your >$50 order!
USB Bus Analyzers 16-Ch Logic Analyzer SPI Bus Analyzer EMC Spectrum Analyzer EMC Spectrum Analyzer Worlds’s Fastest
Pr ow
LAD-16128U
Va es
SPI Xpress
e
e
PSA2701T
L
ic
B
PS9200
Protocol exerciser/analyzer for standard
Packet-Master™ - USB 1.1/2.0 Intuitive full-featured 16-ch 4MB SPI & non-standard 4-wire and 3-wire RF & EMF Spectrum Analyzer Handheld Palm PC-based 2-ch 12GHz sampling scope for
analyzers and generators. $699 + 200MHz sampling memory. $240 serialprotocolinterfacesupto50Mbps. 1Hz to 7GHz for WiFi, mikes, etc. 2.7GHz Spectrum Analyzer. high-speed electrical signals.
Waveform Generator I2C Xpress Automotive Testing CANminiBOX RF Generator RF Testing/EMI Tents
emPC-x133
APSIN6000
I2C Xpress
USB2.0 speed 16-bit digital pattern Versatile USB 2.0 I2C protocol Kits turn your PC into vehicle- Embedded controller series: 2 x High-res, extremely low-noise, Portable RF test enclosures &
or arbitrary waveform generator. exerciser and analyzer. electrics diagnostic tool. CANbus, Ehternet, USB2.0, CF. portable 6GHz RF generator. shielding tents with external frame.
Wireless Data Loggers Multiparameter Loggers USB Loggers Electronic DC Load 60/100/120MHz AWG TorqSense
GO !
RI EW
L
MSR145S
RWT320
RTR-50
LD300
USB to I2C FTDI USB ICs CAN-USB Serial-Ethernet Cable Lorlin Switches Sound Module
ic st
!
Pr owe
eCOV-110-P
EW
es
SOMO-14D
USBI2CIO
CAN-USB
FT232RL
L
Lorlin
N
“Drop-in” solution connects PC to Popular UART and FIFO chips. Intelligent CAN connection Network serial product easily without Fantastic array of stock and 14-pin module plays back pre-stored
I2C/SMBUS + 32 I/O lines. $89 Upgrade Legacy designs to USB. from PC’s USB port. $299 a PC using this 28” cable. $89 custom switching devices. audio files from microSD card
Keyboard Simulator Instant Ethernet Ethernet-IO FPGA Systems Wireless Solutions Temp/RH Sensors
UPSICAP / DLP-TH1
EmbedRF / Adeunis
WIZ110SR / W5100
PoKeys55T
Ether-IO 24
RTG005
USB board adds 55 I/O and 5 x No OS needed. TCP/IP offload, UDP/IP-controlled 24 digital Ready-to-go out-of-the-box FPGA/DSP Analog input, bluetooth wireless Novel ambient sensors & modules
10-bit A/D inputs, 1 x 10-bit analog O/P. ICsimprove system performance. I/O board 3 x 8-bit TTL ports. designs for beginners and experts! modules 433/868/915MHz. accurately measure temp/RH.
.NET Board Easy OLED Display RF Modules RS232 to 422/485 1/2/4/8/16 x RS232 USB-Serial
FEZ Domino / FEZ Mini
AWM6XX TX/RX
uOLED-96-G1
KK Systems
USB-COM
CE-USB
Tiny open source boards using Compact,economicalsmartOLEDwith Simultaneously transmit composite 9p-9p or 25p-25p self-pwrd, Add 1-16 COMports via your A complete CP2102 USB-serial
USBizi chipset Kits $98 graphics drive from USB or RS232. video and stereo audio signals. isolated RS232-RS422/485 PC’s USB Port easily. converter in a DB9 shell. $26
Above are some of our best-selling, unique, time-saving products - see our website for 100s
more: WiFi/910MHz antennas, wireless boards, LCD display kits, Ethernet/IO,
USB/RS232/485, USB-OTG, instant Ethernet-serial, CAN/LINbus, USB cables/extenders, line
testers, logic analyzers, color sensors, motion controllers, eng. software, wireless boards,
SMD adapters, I2C adapters, GPS loggers, automotive testing, security dongles, video
motion detectors, crystals/oscillators, custom switches, barcode scanners, DSP filters, PLCs,
Remote MP3 players, etc. FREE Starbucks card with your $50 order!
Check www.saelig.com often for special offers, bargains, business hints, blog, etc.
A bit more on simulation!
In this edition, in accordance with our
2010 Publishing Plan, we pay special
attention to the issue of electronics sim-
ulation. Simulation programs for the PC
have been around for decades and in all
that time they’ve become increasingly 6 Colophon
sophisticated and ‘realistic’. But they’re Who’s who at Elektor magazine.
not the easiest programs to handle
— you have to invest quite some time 8 News & New Products
before you feel confident using them at A monthly roundup of all the latest in
any level. That is the main reason why electronics land.
many designers still seem to think “All
that simulation takes too much time, I’ll 14 Give your Projects Simple Grace
give it a quick try on the breadboard”. Introducing Elektor’s new ProjectCase to
But the time and effort in learning about house electronics projects
simulation is really well spent. Once you
have mastered a simulation program,
16 Build a Scrolling LED Message Board
you’ll notice the ease of running such
in One Day
a simulation on a number of different
NXP’s mbed rapid prototyping platform
options or settings in a thorough way,
put through its paces; and preparing for
without any soldering to do or compo-
the NXP/ARM mbed design contest later
nents to order by mail.
this year.
Two articles in this edition approach
‘electronics simulation’ from a different
perspective. There is a hands-on article 20 Virtual Measurements
on the possibilities of the free program and Predictions
LTSpice, which is actually intended to With the right software tools, it’s feasible
develop switch-mode power supplies, to know in advance if your design will
but really has a much wider, largely function as intended.
undiscovered, application range. In ‘Vir-
tual Measurements and Predictions’ a 24 Simulation Beats Trial and Error
real-life case is presented of a simulation Showing how LTSpice can be used for
set up to compare the results of a simu- circuit analysis with some surprising
lation run against measurements carried results.
out on the actual hardware thing.
If you do not feel like doing any circuit 28 Digital Multi-Effects Unit
simulation at all, no problem, there’s Reverb, chorus and flanger are just a few
a bunch of classic style projects in this of the effects provided by this advanced
edition to explore, assemble and use in ‘box’ designed around the FV-1 effects
practice. Like an advanced audio effects chip.
unit, a high voltage differential probe,
a smart video detection system based 36 The Elektor DSP Radio (2)
on an inexpensive PIC microcontroller, This month we cover antenna input
and the second part of our beautiful selection and the PC software developed
DSP radio. for the project.
The Scrtach-and-Win sweepstake pub-
lished in the July & August edition is get-
43 Examined: Hameg HMO2524
ting a good response from you, our US &
Elektor’s lab guys got this pretty
Canadian readership. If you haven’t yet
advanced ‘scope to play with — and
tested your good fortune, go find that
report on, of course.
edition #19/20. At www.elektor.com/
scratch we’re waiting for your lucky
44 Know what you’re measuring
number until August 31, 2010!
Some thoughts on measurement
Enjoy the read, the build… and the
methods to determine the sound quality
scratch!
of capacitors. Can it be done easily?
Jan Buiting, Editor
4 09-2010 elektor
Volume 2
CONTENTS September 2010
no. 21
60 High-voltage Probe
A special design is called for to measure
small differences between high voltages.
66 Vision System
36 The Elektor DSP Radio (2) for Small Microcontrollers
Just accept slow, slow sampling speeds
The operation of our famous DSP Radio can be optimized by modifying the an- and even not-so-fast micros will be
capable of seeing objects around them.
tenna and front-end circuit configuration and by modifying the software. This
creates various configurations ranging from a plain PC-controlled radio to a
portable world receiver.
72 Make Room for the Roomba!
There’s nothing more exciting than
attacking a piece of equipment with a
screwdriver and a hobby knife.
Getting started with DSPs yourself requires a considerable depth of knowledge 77 Retronics:
of this subject matter. With the modules from miniDSP you can easily realize Delay-line Digital Memory (ca. 1968)
all kinds of audio processing functions without the need to become intimately Regular feature on electronics ‘odd &
familiar with digital signal processing. ancient’. Series Editor: Jan Buiting
84 Coming Attractions
Next month in Elektor magazine.
elektor 09-2010 5
Elektor International Media provides a multimedia and interactive platform for everyone interested
in electronics. From professionals passionate about their work to enthusiasts with professional
ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration
and entertainment. Analog and digital; practical and theoretical; software and hardware.
analog • digital
microcontrollers & embedded
audio • test & meASUREMENT
No. 21, SEPTEMBER 2010 ISSN 1947-3753 Elektor is also published in French, Spanish, German and Graphic design / DTP: Giel Dols, Mart Schroijen
Dutch. Together with franchised editions the magazine is on
Elektor aims at inspiring people to master electronics circulation in more than 50 countries. Publisher: Hugo Van haecke
at any personal level by presenting construction projects ([email protected])
and spotting developments in electronics International Editor:
and information technology. Wisse Hettinga ([email protected]) Marketing: Carlo van Nistelrooy
Editor: Jan Buiting ([email protected])
Customer Services: [email protected]
Elektor (ISSN 1947-3753) is published monthly (except
International editorial staff: Harry Baggen,
for one issue in July/August) at $39.95 per year, Canada
Thijs Beckers, Eduardo Corral, Ernst Krempelsauer, Subscriptions:
add $11.00 per year;
Jens Nickel, Clemens Valens Elektor US, 4 Park Street, Vernon, CT 06066, USA.
by Elektor International Media LLC,
4 Park Street, Vernon, CT 06066, USA. Design staff: Antoine Authier (Head), Ton Giesberts, Phone: 860-875-2199, Fax: 860-871-0411
Phone: 860-875-2199, Fax: 860-871-0411. Luc Lemmens, Daniel Rodrigues, Jan Visser, Internet: www.elektor.com
www.elektor.com Christian Vossen E-mail: [email protected]
6 09-2010 elektor
DISTANCE LEARNING COURSE
Programming Embedded
PIC Microcontrollers Benefit now!
$70 DISCOUNTlearning
m/distance
using Assembly, C and Flowcode www.elektor.co
Contents: ni cs wo
rld wi de
• CD-ROM including software
ate
ce
el ec tro
elektor 09-2010 7
Multi-channel radio ating in the European ent one-way radio data links
modems ease link setup license-free 433 MHz supporting a data rate of
industrial scientific and 9600 bps with a line-of-sight
The TXL2 transmitter and RXL2 receiver medical (ISM) frequency range of 500 m (typical).
modules from wireless solutions developer band, with a choice of five Unlike raw FM radio module
Radiometrix are half-duplex multi-channel user programmed chan- alternatives, the modules
OEM radio modems offered in the compa- nels, the modems can be look after preamble genera-
ny’s popular SIL standard footprint. Oper- used to form transpar- tion, synchronization, bit bal-
8 06-2010 elektor
SPEED. Vinculum VNC2
FLEXIBILITY. A programmable system-on-chip
PERFORMANCE. USB 2.0 Host / Slave controller
- Dual channel USB 2.0 interface, handles all USB host
and data transfer functions in single IC.
- On-chip 16-bit Harvard architecture MCU core with
256 Kbyte Flash and 16kbyte RAM.
- External UART, FIFO, SPI Slave, SPI Master, GPIO and
PWM interfaces.
- Vinculum-II software development tools available for
user application development.
- Multiple package size options including VNC1L backwards
compatible package option.
- Targeted for range of USB applications, from portable
media devices and cell phones to industrial and
automotive applications.
elektor 06-2010 11
NEWS & NEW PRODUCTS
iNEMO design contest ticated sensor fusion algorithm (attitude teristics. All versions also share a common
heading reference system) to provide static register map, allowing simple control with
announced and dynamic orientation and inertial mea- most existing microcontroller software and
surements. This 10-DOF inertial system facilitating performance upgrades by sim-
STMicroelectronics and chip distributor integrates five different sensors, measures ply swapping in a different sound processor.
Digi-Key have announced a design contest 4x4 cm, and comes with all necessary firm- www.rohm.com (100555-II)
for North American engineering students, ware and software.
based on ST’s iNEMO multisensor inertial http://www.digikey.com/iNEMO (100555-I)
measurement unit. The winning contes-
tant will receive a $5,000 cash prize along
with an all-expense-paid trip, including air-
Liquavista releases
fare and accommodation for three nights,
Rohm launches new transflective product
to Europe to visit the ST development lab-
multifunctional platform
oratory in Catania, Sicily. Cash prizes of
$2,500 and $1,000 will also be awarded to sound processors for car Liquavista has launched its next-generation
entrants selected as the second and third transflective display platform, called Liqua-
audio systems vistaVivid, which is claimed to provide a
Semiconductor manufacturer Rohm has level of performance unparalleled by other
announced the development of eighteen transflective displays. Combining mono-
different sound processor ICs optimized for chrome reading with vibrant color imagery,
increasingly sophisticated car audio and LiquavistaVivid is a highly versatile, intelli-
home audio systems. The large number gent adaptive display technology specifi-
of inputs and outputs required to accom- cally developed to support a broad range
modate multiple audio sources and speak- of feature rich, multi-functional consumer
ers for high fidelity playback, coupled with electronic devices.
the need for fine tuning of audio systems
to match the acoustic characteristics of
specific environments, create a demand for
high-performance, multifunctional sound
place winners. processors.
Entrants must be currently enrolled stu- To meet these needs, Rohm offers a com-
dents, at least 18 years of age, who are resi- plete lineup of eighteen different types of
dents in North American locations that do sound processor ICs with a variety of input
not prohibit, tax, or restrict such contests. source channels, speaker outputs, and
They will also have to buy an iNEMO devel- acoustic correction functions. They feature
opment kit, which costs US $369 for the low distortion and low noise, which are
board, CD and cable, debugger unit and essential for high fidelity audio, along with
software. advanced switching functions that reduce
Each entry must include an iNEMO inertial unpleasant switching transients by smooth-
measurement unit. Entries will be judged on ing discontinuous waveforms resulting from
the number of degrees of freedom used, the volume level switching.
quality of the hardware, firmware and soft-
ware, the design’s novelty, use of daughter LiquavistaVivid offers superior, high bright-
boards, the project’s ease of use, and the ness monochrome reading both indoors
appeal of its user interface. and outdoors as well as hi-fidelity video and
The iNEMO inertial measurement unit super-rich colors on demand. Depending
(IMU) is an evaluation and development on the environment and application, Liqua-
board that offers three-axis sensing of lin- vistaVivid displays can intelligently switch
ear, angular and magnetic motion as well as from a sharp, paperlike monochrome mode
temperature and barometer/altimeter read- to a vivid color-rich multimedia mode with
ings, along with a 32-bit microcontroller and TV-like color. Each mode comes with seam-
dedicated software. It targets virtual real- less interactivity and hi-fidelity video capa-
ity, platform stabilization, human-machine bility. As with all Liquavista technology
interfaces and robotics applications. The platforms, LiquavistaVivid displays have
module has a memory card socket for In addition, versions are available with the added benefit of the widest dynamic
data logging and dedicated connectors for integrated acoustic correction functions, addressing range of any display technol-
wired/wireless connectivity, including USB, including parametric equalization, loudness ogy. This allows Liquavista displays to sup-
ZigBee® and GPS. control, and subwoofer low-pass and high- port hi-fidelity video without compromising
A second generation of the iNEMO fam- pass filtering that enable optimized audio on power, while at the same time support-
ily, the iNEMO v.2 module, runs a sophis- playback based on vehicle cabin charac- ing ultra-low power static reading modes.
12 06-2010 elektor
Advertisement
According to Liquavista CTO Johan Feen-
stra, Liquavista’s very low power consump-
tion enables users to be truly mobile by ben-
efiting from longer battery life or lighter
devices due to reduced battery require-
ments. LiquavistaVivid combines a high
brightness reflective mode with a brilliant,
high contrast, high brightness transmissive
mode based on field-sequential color prin-
ciples. In reflective mode, LiquavistaVivid
provides the same high front of screen per-
formance as LiquavistaBright, while in back-
light mode it is able to display vivid colors
without compromising battery life thanks
to the high efficiency of the electrowetting
optical switches and sophisticated power
management algorithms.
http://www.liquavista.com (100555-III)
Low-cost
GaAs solar cell fabrication
method developed
Thanks to a new semiconductor manufac-
turing method pioneered at the University
of Illinois, the future of solar energy just
got brighter. Although silicon is the indus-
try standard for most electronic devices,
including the solar cells that convert sun-
light into electricity, it is hardly the most
efficient material available. For example,
gallium arsenide and related semiconduc-
tors offer nearly twice the efficiency of sili-
con in solar devices, but they are rarely used
in utility-scale applications because of their
high manufacturing cost.
At the University of Illinois, professors John
Rogers and Xiuling Li explored lower-cost
ways to manufacture thin films of gallium
arsenide that also allowed versatility in deposit multiple layers of the material on arsenide. A soft gripper picks up the layers
potential applications of the films. Gallium a single wafer, creating a pancake stack of one at a time and transfers them to another
arsenide is typically deposited in a single thin gallium arsenide films. substrate, such as glass, plastic or silicon,
thin layer on a small wafer, and the desired Growing several layers on a single wafer depending on the application. Then the
devices are made directly on the wafer or reduces production costs because loading wafer can be reused for another growth.
the coated wafer is cut into chips of the and unloading the wafers, with tempera- Freeing the material from the wafer also
desired size. The Illinois group decided to ture ramp-up and ramp-down, takes a lot opens the possibility of flexible, thin-film
of time. The overhead savings of the multi- electronics made with gallium arsenide or
layer approach, in terms of the machine, other high-speed semiconductors. Another
preparation, processing time and people, advantage of the multilayer technique is
provide a significant cost reduction. freedom from area constraints, which is
The individual layers must be peeled off especially important for solar cells. As the
and transferred. To allow this, the stack has layers are removed from the stack, they can
alternating layers of aluminum arsenide be laid out side by side on another substrate
and gallium arsenide. Bathing the stack in to produce a much larger surface area, elim-
a solution of acid and an oxidizing agent inating the restriction to the wafer size with
dissolves the layers of aluminum arsenide, the usual single-layer process.
freeing the individual thin films of gallium http://news.illinois.edu (100555-IV)
elektor 06-2010 13
INFO & MARKT
Give your
Projects
Simple Grace
With the
Elektor ProjectCase
A brief tour of the World Wide Web clearly shows one of the problems facing many electronic enthusiasts:
the enclosure. All too often it’s a plastic box in a dismal shade of gray, cluttered with an awkward
arrangement of connectors, controls and indicators. You spent hours designing a stunning PCB layout,
assembled the board neatly, and it ends up in a humdrum plastic box. Isn’t there a better way?
The answer is yes, and it’s easy. Peter Groen, machine, so making holes for controls, with it. The ProjectCase components are
one of the founders of FabLab in Groningen, connectors, slots and whatnot shouldn’t supplied with a protective film. Be sure to
The Netherlands, came up with the idea of present any problems. Four sturdy rubber leave it on until all the holes, slots and so on
using simple, transparent polycarbonate feet on the bottom keep everything rock- have been made.
(Lexan) panels and a few standoffs. You solid. Welcome to the ProjectCase!
simply fit the PCB in the middle, with room The price of the Project Case may be found
on all sides for wiring and connectors. To make things easier for you, we had a large on the Elektor website. We’ll be happy to
number of ProjectCase kits made up for slip a ProjectCase kit into an envelope and
The display can be viewed directly and us. The panels measure 175 x 115 x 3 mm, send it to you so you can get down to work.
everything looks a good deal better, with which matches the Eurocard format. Order your ProjectCase kits from the Elektor
the board nicely visible and well protected. Shop at www.elektor.com.
To give you an idea of what it looks like, The kit also includes all the necessary (100500-I)
we used it to package the DSP radio board standoffs for securing the PCB and the
described elsewhere in this issue of Elektor. polycarbonate panels. With a bit of creative
The polycarbonate panels are easy to imagination, you can do just about anything
14 09-2010 elektor
NXP contest primer
When my friend Grégory showed me a 64×32 pixel two-color LED panel picked up from an Internet retail-
er for about 50 dollars, I immediately ordered one too. That would be a great opportunity to put the ARM
mbed module I had lying around through its paces. I wondered, would this project be as easy as the mbed
crew wants us to believe?
The first time I learned about mbed was when reading an article
about it in Circuit Cellar #227. I was immediately seduced by the
concept and wanted to try it. Having the right kind of relations I
managed to force my way into the mbed beta testing program and
got a couple of modules to play with. These beta modules were
based on NXP’s LPC2368 ARM7 processor. Shortly after mbed went
live the ARM Cortex-M3 module using NXP’s LPC1768 was intro-
duced and I managed to get one of those too. All I needed to do at
that time was find an application for these boards.
For those who did not read Tom Cantrell’s article (you have no
excuse as it can be downloaded for free [1]) I will first briefly explain
the mbed concept.
16 09-2010 elektor
NXP contest primer
When your online source code compiles without errors the system
suggests to download the executable. You save it on the MBED drive V+
S
and then press the Reset button on the board. The mbed interface 0V
chip will now program the mbed processor and your application
starts running. Sounds easy, eh? When your project is finished you V+
elektor 09-2010 17
NXP contest primer
MOD2
1 40
GND VOUT
2 39
VIN VU
3 38
VB IF–
+3V3 4 37
NR IF+
5 36
RD–
6 35
MOD1 RD+
+5V
7
TD–
34 ure 3. Since most mbed pins can be GPIO, I simply started at the
1
GND A
2 8
TD+
33
first available one (pin 5) and worked my way down. I later added a
3 4 9 32
GND B D–
5
GND C
6 10
D+
31 special feature pushbutton to pin 20 simply because it was nearest
7
EN D
8 11 30
to the pushbutton.
9 10 12 29
R1 G1
11
GND G2
12 13 28 For compatibility reasons I ran the display from 3V3 (3.3 V) instead
13
GND L
14 14 27
of the specified 5 V, because mbed is 3V3 and the display let me
15
GND S
16 15 LPC1768 26
16 25 do it. Once I mastered the display I powered it from 5 V and that
GND
LED PANEL
17 24
worked fine too, the advantage being a much higher brightness.
S1 18 23
19 MBED 22 The display was powered from a separate bench supply as it requires
20 21
several amps when all the LEDs are on and the mbed module can-
NEXT PAGE
not provide this much. I powered the mbed module itself through
100501 - 11
the USB port.
I had a bit of a hard time implementing the not terribly complicated
serial protocol for the simple reason that the user manual of the dis-
Figure 3. The circuit diagram is really simple since no special parts play has an error. In the table on page 8 and 9 that I was using the
are needed to control the LED panel. Note that in this basic setup
pin numbers of the ‘L’ and ‘S’ signals are swapped with respect to
the mbed module is powered from the USB bus, whereas the LED
the connector pinout shown just above it. The sample code I had
panel needs a separate supply because it needs more current than
extracted from the document worked fine, but my own code didn’t.
mbed can provide. Also note that even though the LED panel is
specified for 5 V, it will run from 3V3 without any problem. The Very frustrating. With this problem out of the way everything went
panel at 5 V driven by a 3V3 mbed will work too. smoothly and I was able to very quickly plot a pixel anywhere on
the display in one of the four available colors (red, green, orange
and black).
It’s interesting to note at this point that the mbed library has pin
On to the application and bus functions. It seems logical to use the BusOut function for
The goal of the project was to build a message board with an easy both the address and the data buses, but it turned out that the bus
way to put, well, messages on it! Today’s electronics often equates function is much slower than the pin function. I therefore ended up
to USB and that’s why I ended up using the mbed module. Since using four DigitalOut calls for the data bus and one BusOut call for
the module doubles as a 2 MB USB mass storage device it would be the much slower address word. The reason for this performance dif-
very easy to load message files on it produced on a computer with ference would probably be clear if only the source code of the mbed
a proper text editor. That would be an intuitive and comfortable library had been published.
user interface that even non-electronics engineers can understand.
The user manual of the LCD panel (DE-DP-DP029~033_Ver1.0_ Dots & fonts
EN.pdf [3]) told me I had to do some bit-banging as its serial inter- It was now time to start writing characters on the display. Charac-
face is not standard SPI or something similar. Figure 2 shows the ters need a font and bitmapping a font is an intensely boring and
timing diagram. The display has 32 rows of 64 two-color LEDs, i.e. tedious job. In the spirit of letting other people do the hard work for
a grand total of 4096 LEDs! The addressing of the 64 rows (32 two- you, I turned to the Internet. Many people have been busy over the
color rows) is a bit strange because the address bus is only four bits years bitmapping fonts and writing utilities to do it automatically,
wide and can thus only address 16 rows. This problem was solved by so after some ten minutes I found myself playing with The Dot Fac-
the manufacturer by breaking the display in two 16 row displays and tory [4] (Figure 4). This Windows utility makes it a snap to convert
using a 2-bit data bus. The two 16-row displays are addressed in par- any font installed on your PC into C source and header files. Select
allel and the two data bits select the red and green LED for the row. the font, set some options and click the Generate button. The only
The display has only enough memory for two rows, one upper row weird thing is that you can’t save the files; you have to copy and
and one lower row. This means that the display has to be refreshed paste. That’s a minor inconvenience though for a nice free tool, so I
continuously in order to display a message or image. An advantage created the files without complaining and imported them into my
of this technique is that the display will not consume 40 amps or so mbed project. Adding the code to display the characters anywhere
when all the LEDs are on. I wanted them was pretty straightforward too.
After a line is written it should be activated using the EN signal. This
signal determines the brightness of the display but as it does so, it Adding an INI file system
also affects the refresh rate. This will in turn govern flickering as well The next step was adding a way of putting messages on the system.
as the scroll speed, since scrolling does not use a separate timer and This was the main reason why I had opted for an mbed module: it
depends directly on the refresh rate. has a USB interface and the mbed library provides a convenient file
system. And convenient it was. All I had to do was to add 1 (say, one)
A little bit of hardware line of code to my program to get it working:
How I hooked up the display to the mbed module is shown in Fig-
18 09-2010 elektor
NXP contest primer
LocalFileSystem local(“local”);
Now my program was able read the files that I copied to the MBED
mass storage device from my PC.
I had decided to use an INI-type file for my message files. I wanted
several pages, browsing through the pages would be possible
thanks to the pushbutton. Every page would be a section in the
INI file and it would be possible to specify, on a section by section
basis, the text for each line. With my 8-point Arial font I had room Figure 4. The Dot Factory:
for four lines per page without characters spilling into other lines. Now why did the author(s) forget to implement file saving?
I turned again to the Internet to look for an easy INI file C-library.
There are many around and I picked one more or less randomly: inih
[5] it would be! This turned out to be a good choice as it’s a remark-
ably easy to use library and no more than five minutes were needed The mbed library can also be used since the header files and a binary
to integrate it into my project. archive (.ar) can be downloaded. This is not the easy way however,
and, understandably, not really supported by the mbed crew. How-
Time to stop ever, some people have found ways to mbed off line.
I had now come to a point where ‘features’ started creeping in. First Similarly you don’t need an mbed board to run the executable. Any
of course message scrolling: left, right and no scrolling. Then scroll- LPC1768 board can be used, which means that you don’t have to
ing at any speed. Now that was a tough one. Not so much to imple- design an mbed module into your product.
ment as it was to look at, because it resulted in pixel bleed. Char-
acters became blurred and the display became uncomfortable to
read. This feature was therefore scrapped, but another one quickly Conclusion
found: every line its own colour and its own (x,y) starting position. While working on the project I was using the beta LPC2368 mbed,
I tried many more things but finally settled for the features men- but for this article I had to use the LPC1768 mbed. Switching
tioned above plus page skipping. Then I called it a day. between the two modules turned out to be extremely easy; all I
had to do was selecting the right mbed from a dropdown list on
Tool trouble the compiler menu. The recompiled code then worked immediately
Building this application took me about one day of work. I did not without any modifications.
do it all in one go, but I could have if my agenda had let me. Using All in all I think mbed is pretty cool. This project made very low
the mbed module instead of some other microcontroller board defi- demands on the power of mbed, the Ethernet interface is worth a
nitely saved enormous amounts of time as did the mbed library. try too. Although I would not recommend mbed for professional or
Not a single ARM register was inspected by me and I did not have consumer quality software development since you have little or no
to refer to the processor’s datasheet or programming manual at all. control of the tools and the library (what if ARM decides to pull the
The little mbed experience I had before starting this project prob- plug on mbed?) and there is no debugger, it is definitely a great tool
ably helped a bit too, because I knew what I could expect from the for quickly putting a proof of concept together. It is also great for
mbed library. those one-off projects where you need just a little more processing
The only severe hindrance was the mbed server going down or off- power than you can squeeze from systems like an Arduino.
line. This happened once during my project, wasting a couple of Hats off to the mbed crew who have come up with a great tool!
hours and it makes you feel silly. There you are happily program- (100501)
ming away and suddenly: Bam! No more tools… And no one you
can yell at (what was that mbed helpdesk phone number again?).
Another inconvenience is that the compiler or the server seems to Internet Links & Literature
get stuck every once in a while. This is rather annoying as it prob- [1] Easy (E)mbed, An Alternative Approach to Embedded Program-
ably means loss of those clever modifications you just added to your ming, Tom Cantrell, Circuit Cellar #227, June 2009, pp 68-72.
code. Exactly what happens I don’t know, but you have to close and (Free download at www.circuitcellar.com/archives/viewable/
then reopen the compiler window without being able to save your
Cantrell-227.pdf).
work. The mbed crew should add some temporary saving for recov-
ery purposes to the environment as this happened to me several [2] mbed.org
times. [3] LED panel: www.sureelectronics.net/goods.php?id=718
Note that you do not have to use the online compiler. The executable
[4] The Dot Factory: www.pavius.net
that you download and program into the target is an ordinary binary,
i.e. no proprietary file format. If you can produce such a file with a [5] INI Not Invented Here: code.google.com/p/inih/
toolchain you already own you’re good to use the mbed board too. [6] Software: www.elektor.com/100501
elektor 09-2010 19
Test and Measurement
Virtual Measurements
and Predictions
By Thijs Beckers (Elektor Netherlands Editorial)
As an electronics enthusiast or engineer, you’ll know that the design of electronic circuits can be complex.
These days, however, you can get help from computer programs, so you’ll know in advance if your
design will function as intended. Or perhaps you won’t? We compared the measurements made on a real
hardware prototype with the simulated data produced by a leading program and drew our conclusions.
These days the design of electronic cir- produced. The designer puts a lot of trust how good are those simulations really?
cuits happens on the PC. In a completely in the simulation results. To be completely We decided to try out Proteus, from Lab-
virtual environment the circuit diagram sure, however, a (hardware) prototype is center Electronics [1], a leading CAD pack-
(‘schematic’) is drawn, its operation is usually built that can then be used to con- age for circuit drawings, PCB layouts and
simulated and the circuit board layout is firm that the circuit works as it should. But simulations.
20 09-2010 elektor
Test and Measurement
Circuit simulations:
how reliable are they?
For the simulation we picked the circuit for to your hearts content. Theoretically, you several forums where you can ask any ques-
the frequency shifter from the portable could add a complete arsenal of measur- tions you may have.
sound system with feedback suppression, ing instruments to each point in the circuit,
which was published earlier this year in the but this is of course not necessary. Having Results
February 2010 edition of Elektor. This cir- selected several interesting points in the The details of the simulation results are
cuit contains analog as well as digital build- circuit and put a virtual probe there, you shown in the spread on the following page.
ing blocks, and it isn’t the easiest design to are in a position to visualize the signal at We were pleasantly surprised by the fan-
simulate, partly due to the high switching those points. tastic results. The measured and simulated
frequencies and phase shifts. values corresponded almost perfectly.
We picked several interesting points in the Simulation The real-world measurements only devi-
circuit where we would like to see the wave- When the probes have been put in place, ated slightly from the ideal (simulated) val-
form of the signal; these are shown as A to F you can choose several virtual measur- ues. The slight mismatches were probably
in the circuit diagram on the following page. ing instruments, in this case three oscil- caused by component tolerances. Not only
The most interesting one is of course the loscopes and an FFT analyzer. For each of could differences be measured between a
output signal (F), but designers obviously the virtual instruments you have to specify number of frequency shifters that had been
also like to know what happens at interme- which probe they have to use. Next, you can built, but there was also an audible differ-
diate stages of the circuit, so that they can start the SPICE simulation by hovering the ence. Some clearly sounded better than oth-
be sure that the circuit behaves as expected. mouse pointer above a measurement win- ers did.
dow and pressing the space bar. Some time
CAD later (depending on the processing power of Hats off for Proteus, which in our opinion
To simulate this circuit we’ll use the Pro- the PC) the simulated voltage appears on passed the ‘test’ with flying colours. Not
teus 7 Professional package from Labcenter the screen. only is the end-result (signal F) amazingly
Electronics. This package in fact consists of correct, but all the intermediate points that
two programs: ISIS and ARES. ISIS is used Tips and tricks have some rather ‘strange’ waveforms also
to draw the circuit diagram and simulate The opamp models chosen for the simula- correspond to the measured signals. No
it, whereas ARES is used to design the PCB tion were the ‘ideal’ opamp models, which complaints here then.
layout. In this article we’re not interested reduces the number of required SPICE
in the PCB layout so we’ll ignore the latter nodes from a hundred down to only a dozen Do It Yourself
program. per opamp. This speeds up the simulation On the web page created for this article [2]
significantly, but still offers sufficient accu- you can find the ISIS circuit including the
The Proteus Design Suite is specifically racy for this application. virtual measuring instruments for you to
made to simulate embedded systems and download. A demo version of Proteus 7 Pro-
has the facility to simulate microcontroller The simulation for the clock generator fessional is available for download as well,
code in a mixed-mode SPICE environment. around the crystals has also been turned so you can verify the results above and carry
Labcenter calls this VSM, Virtual System off at the component level. The SPICE model out further simulations if you want. The
Modelling. Of course it can also cope with for the 4060 has a parameter (‘clock’) allow- demo version of Proteus does not allow you
‘normal’ SPICE models. We aren’t really ask- ing the operating frequency of this compo- to save your designs, nor create print lay-
ing a lot of the simulation software with our nent to be set, irrespective of the value of outs, nor create circuits containing micro-
frequency shifter, but the extensive func- the clock signal at its clock inputs. You could controllers. However, you are able to mod-
tions of the software will be welcomed by even have chosen to replace the 4060 and ify the program code in existing (example)
many. 74HC74 flip-flops with a pulse generator designs with microcontrollers.
that output the required clock pulses, but
Before you can start the simulation you this would have deviated too much from the As an example, try to run a simulation of
have to input the circuit into ISIS. Unfortu- original circuit. about 20 ms or more, where the input
nately, this means that the schematic has signal and the inverted output signal are
to be completely redrawn. The various CAD These ‘tricks’ are very useful to know and shown in one graph. You should see that the
packages on the market all have their own give speedy and good results. It’s therefore signals have a slight difference in frequency
format for storing the drawings and gener- important that you know what simulation and that one signal appears to ‘overtake’
ally aren’t able to export or import other options there are and what settings give the other (double-clicking on the title of
formats. the best results. For other tips and tricks the scope image opens up the graph in a
Once the circuit has been drawn, you can you can refer to the manual, the technical new window).
add probes and measuring instruments support department and last but not least, (100359)
elektor 09-2010 21
Test and Measurement
between them.
A
1n
R6 R9 R17
That means that when the voltage 10k 10k 10k
R5 R8 R16
of one of the signals is at zero, the 10k
13
10k
2
10k
13 IC3A
14 1 14 1 2
IC2D
voltage of the other signal should at its C2
12
C3
3
IC2A
12
IC1D
13
4n7 47n C10
IC3B
R4 R7
the phase). This is more or less the case C1 4 3 C8 100p
4k3
5k1
3
10n R20 R22
in the measurement; it isn’t exactly 90 K1 220n IC1A
1
10k 10k
5
2
degrees, but it comes very close. C7
C9 R21
10k
6
R3
B IC1B
1k 10n
C
1n 5
R1 R2 R12 R15 R19
10k 10k 10k
10k
1k
10n 100n
IC3C
[3] Signal at E and F R10 R13
8 9
8k2
10k
.9
‘feedback-killer’. 200m
100m
0
750 800 820 850 900 .92k .95k 1k 1.2k
Hz
22 09-2010 elektor
Test and Measurement
between them. C and D should be the modulated and the filtered, modulated signal respectively. At E is the output signal with a nasty
looking RF signal superimposed on it and at F is the clean input signal, but with an increased frequency of about 10 Hz.
R33 R28
R24 R27 C16
C12
1k
10k
10k
IC5A E R32
1k
1n
270p R26 R34
13 1 2 6
7
R23
1k
R25
1k
2
1k
IC4D 14
10k 10k
IC4B
7
C13 C14
10
F Internet Links
1
D 12 5 8
13
10k
6n8
5
elektor 09-2010 23
test & Measurement
Simulation Beats
Trial and Error
By Dr Günter Spanner (Germany)
Simulation tools allow circuits to be tested and characterised even before the first components have been
ordered. LTSpice is a powerful program and available free of charge. Here we use two examples to show
how this program can be used for circuit analysis, among its other features.
Simulation programs have become indis- beyond – which does not incur physical non-professional users.
pensable for the commercial development risks with a simulation. The worst case situ- In this article we describe the LTSpice sim-
of electronic products. The traditional ation in which the circuit must continue to ulation program (previously known as
development method for new products, operate reliably can be determined with a SwitcherCAD), which is available free of
consisting of building a lab prototype, computer simulation by configuring a wide charge from Linear Technology [1]. The core
designing an initial PCB layout and produc- range of temperatures and highly improb- of the program, which computes the actual
ing a pilot series before final production able component tolerances. simulation, is based on the well known
release testing, became outdated a good Spice simulation program, but Linear Tech-
while ago. Until a few years ago, usable simulator pro- nology has refined this program, in partic-
grams were as dear as hen’s teeth, with ular to obtain better results for switching
Nowadays new circuit designs are thor- prices of full-function versions easily reach- converters (which are after all their main
oughly tested before the first real com- ing the three-figure range. Today tools with products). A convenient user interface has
ponents are ordered. In addition to basic outstanding features are available on the also been wrapped around the simulation
circuit functionality, this covers the full Web for free download. This makes circuit software to provide features such as visual
allowable operating voltage range and simulation extremely attractive even for schematic design and editing. For more
Figure 1. Convenient presentation of the Figure 2. A square wave generator. The opamp is simulated using a circuit not shown here;
schematic and the simulation results the circuit model is located in the UA741.lib file.
(example from the LTSpice installation
package).
24 09-2010 elektor
test & Measurement
Schematic editor
Installation of LTSpice is easy and does not
require any explanation here. The imple-
mentation of the schematic editor is quite
nice and more than justifies the use of
this program. In addition to basic compo-
nent symbols, the program comes with an
extensive component library. Most circuit
symbols are US style; a European resistor
symbol is available in the library under the Figure 3. The waveforms at test points ‘a’, ‘b’ and ‘out’ (see Figure 2).
‘Misc.’ category.
The individual components can be posi-
tioned freely and interconnected easily and should be familiar to every electronics operation can be explained to relatively
(a few notes for users are provided in an enthusiast. inexperienced users. When the voltage on
extra file that can be downloaded from the After the schematic is entered, the model the capacitor rises above or falls below the
Elektor website [3]). All components can for the operational amplifier (a 741), which reference voltage at the node of voltage
be rotated and flipped as necessary to pro- can be found at various places on the Web divider R2/R3, the opamp output changes
duce a readily understandable schematic including [4], must be saved in the ROOT:\ state (switches from the positive saturation
diagram. There is also a component edi- Program Files\LTC\LTspiceIV\lib\sub folder. level to the negative saturation level or vice
tor that allows users to generate their own There it is available to all simulations. Alter- versa). As a result, the capacitor is periodi-
component symbols. natively, you can select an opamp type cally charged and discharged.
Semiconductor devices in particular are available in the standard library.
composed of a large number of internal After you start the simulation, you can use a
components, so that their behaviour can be virtual probe to measure voltages, currents, Example 2: Percussion generator
simulated as realistically as possible. These power levels and other quantities at various The behaviour of the second circuit (Fig-
subcircuits are represented by Spice mod- points in the circuit. The corresponding ure 4) is less obvious, even for experienced
els, and the necessary data can often be waveforms are shown graphically. designers. The reverse feedback is provided
obtained free of charge from the manufac- Figure 3 shows a virtual oscilloscope display by a network in this circuit. If you view the
turer or elsewhere on the Web. As a Spice of the signals at three test points:
derivative, LTSpice naturally supports inte- a: the inverting input of the opamp
gration of these Spice models. b: the non-inverting input of the
opamp
Figure 1 shows a typical working environ- out: the output of the opamp
ment for circuit analysis. The schematic is From the measured output waveform, you
shown in the bottom window, while the can see right away that the 741 (as is well
simulation results are displayed in the top known) is not a rail-to-rail type; the output
window. The inverting voltage converter saturation voltage is around 20% lower than
shown here is an example circuit included the supply voltage. In addition, the slew
in the library of the installation package. rate of 0.2 V/µs is depicted realistically.
To find out what this simulation program Test point ‘a’ shows the voltage on the
can do, we tested it with two relatively sim- 2.4-nF capacitor; it is a slightly bowed tri-
ple example circuits. angle waveform with alternating positive
and negative slopes. A square wave signal
can be seen at test point ‘b’ (non-inverting
Example 1: Square wave generator input). Due to voltage divider R2/R3, its
Our first example simulation is a simple amplitude is exactly half that of the signal
square wave generator. The circuit shown at the ‘out’ test point. Figure 4. The behaviour of this circuit is not
in Figure 2 is built around a standard opamp With the aid of this simulation, circuit as obvious as that of the first example.
elektor 09-2010 25
test & Measurement
26 09-2010 elektor
test & Measurement
Internet Links
[1] www.linear.com/designtools/software/ [2] www.elektor.com/060207 [4] http://focus.ti.com/docs/prod/folders/
ltspice.jsp [3] www.elektor.com/060206 print/ua741.html#technicaldocuments
Advertisement
www.elektor.com
elektor 09-2010 27
Audio & Video
It’s a simple fact: every recording sounds better with the right sound effects. Here we prove that it’s
possible to generate a variety of effects digitally, including reverb, chorus and flanger effects, without
having to work yourself to the bone with DSP programming. The circuit is built around a highly integrated
effects chip and features an intelligent user interface with an LCD. The result is a treat for the eye and the
ear. modern musician, both professional and but in the course of the digital revolution
Sound effects are what gives music that amateur. In the mid-1980s, the only com- these components have increasingly been
special touch. An effects generator is an ponents available to designers of effects replaced by digital signal processor (DSP)
indispensable element of the kit of every units were bucket-brigade ICs and opamps, ICs. The growing market presence of these
28 09-2010 elektor
Audio & Video
Features
• Multi-effect generator with 15 effect algorithms
• Based on the FV-1 effect processor IC
• Frequency response 20 Hz to 15 kHz
• Maximum delay time 700 ms
highly integrated ICs spelled an end to the • 64 memory locations for preset configuration profiles
DIY era for electronic enthusiasts with an • Separate user interface
interest in music, as the components and • MIDI In port
the necessary software simply became too • Effect selection and parameter control via MIDI port
complex. In addition, DSP ICs are not readily • Integrated ramp generator for producing attack/decay effects
available and are almost impossible to sol- • Easy assembly using standard components (except the FV-1 IC)
der by hand. • Free assembler program for generating user-programmed effect algorithms
Everything in one IC
Fortunately, this unsatisfactory situation and three potentiometers for adjusting the buttons (which includes the author)
has changed in the last few years. This prob- effect parameters. However, our aim here
ably results from the fact that sound effect is to achieve more than the basic circuit has For this reason, in our design a microcon-
capability is being built into more and more to offer. troller looks after the tasks that would oth-
mixing panels, stomp boxes and other musi- erwise be handled by a rotary switch and a
cal equipment. Application-specific ICs such User-friendly operation set of three potentiometers. Digital selec-
as the FV-1 IC [1] from Spin Semiconductors We want our effects unit to have the follow- tion of the effect algorithm and generat-
[2] represent a relatively economical option ing convenience features: ing the analog voltages for configuring the
for equipment manufacturers. effects are easy tasks for a microcontroller.
• LCD display For this job we chose an Atmel ATmega8.
All the components necessary for building • an EEPROM for holding eight supple- It has an integrated EEPROM, which is ide-
an effects unit are already integrated in the mentary effect algorithms (as previously ally suited to storing the preset configura-
IC: high-quality audio A/D and D/A convert- mentioned) tion settings.
ers, delay RAM (for delaying audio signals), • a ramp generator for attack and decay
four LFOs (two sine wave and two ramp), effects The user interface with its LCD module and
and three auxiliary audio inputs. As you can • 64 preset profiles for user-defined effect buttons is housed on a separate PCB, which
see from the block diagram (Figure 1), these settings provides several advantages. If you want
components are grouped around a DSP core • and of course, a MIDI interface for musi- to install the effects unit in an existing syn-
with a 24-bit ALU. The DSP does not require cians who shudder at the thought of thesizer or amplifier, it’s easy to fit the user
user programming, since seven algorithms
(for corresponding effects – hall, chorus,
flanger, etc.) are stored in ROM by the man-
ufacturer. Another eight effect algorithms
can be held in an external EEPROM and Power On Delay
Reset
input via the I2C port. Users can generate Memory
these algorithms themselves with the aid of
a special assembler (SpinAsm) [3]. A devel- Analog Left In Analog Left Out
opment environment and various examples
can be downloaded free of charge.
ΔΣ ADC DSP CORE ΔΣDAC
Now you may be thinking that such a special Analog Right In Analog Right Out
IC is virtually impossible to obtain for per-
sonal use, but that’s not the case. There are
three sources that also sell to private par- Program Select ROM and Potentiometer Potentiometer
Program Interface Inputs
ties: the online shops of Profusion PLC in the ROM/EEPROM Control
UK [4], Small Bear Electronics in the USA [5], Select PLL
and Das Musikding in Germany [6]. EEPROM FV1
EEPROM Interface
Interface XTAL Drvr SPN1001
Instead of spending several months wres-
tling with DRAM timing, special setup reg- XTAL 090835 - 11
elektor 09-2010 29
Audio & Video
3
Effect Parameters
Analog (Analog
R In Values)
2 FV-1 3 ATmega8
RXD2
L Analog
Out Effect Chip Effect
Choice
Control EEPROM
for 64 Presets
Dry/Effect 2 4
Mix TXD1/RXD1 any I/O pins left for the controls and indi-
R
cators, so some form of I/O expansion was
X9C503 7 Effect
Algorithms Serial Interface MIDI IN anyhow necessary. The end result is that
L in ROM the overall circuit offers maximum flexibil-
ity for changes and extensions, and if you
ATtiny2313
wish you can also use the user interface for
User Interface other purposes.
I2 C Battery
The EEPROM for the additional effects can
24LC32 also be seen in the block diagram of the cir-
EEPROM LCD 2 x 16
cuit (Figure 2). The block at the left in this
8 Effect Algorithms EDIT diagram allows the original (dry) signal to
Encoder
090835 - 13 be mixed with the signal emerging from
the effects processor. In line with the design
Figure 2. The ATmega microcontroller controls the effects processor IC via four digital lines philosophy of the unit, dry/effect mixing is
and three analogue lines. The user interface has its own microcontroller. also controlled by the ATmega with the aid
of two digital potentiometers.
interface board in a separate enclosure. the main PCB, but the key consideration is The circuit
The connection in this case is provided by that we gave the user interface its own intel- Armed with the previous description, it’s
a three-way cable, and there’s no need to ligence in the form of an ATtiny microcon- fairly easy to understand the operation of
disfigure the front panel of your sound gear. troller. Here the author made a virtue out the circuitry on the main board (Figure 3).
This approach also simplifies the layout of of a necessity: the ATmega did not have The audio signals from the input connectors
are fed directly to the inputs of the FV-1 IC
via coupling capacitors, and to the inputs
LCD1 of the buffer amplifiers for dry/effect mix-
IC2
7805 +5V
ing (IC1a and IC1b). The outputs of IC1a and
1 2
IC1b are fed to the inputs of the electronic
K4
C5 C6 potentiometers (X9C503). The output sig-
3
+9V
nals of the effect processor are fed to the
100n 100n other inputs of the digital potentiometers.
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
D4
D5
D6
D7
RS232
R1
C1 TTL level The external circuitry of the FV-1 IC cor-
P1 R2
100n responds to the recommend circuit of the
20
10k 10k 1k
K1 manufacturer’s data sheet. Capacitors C3
VCC
12
PB0 (AIN0) PD0 (RXD)
2 ROTARY (100 nF) and C17 (10 µF) must be located
13 3 ENCODER
D1
14
PB1 (AIN1)
IC1
PD1 (TXD)
6 as close as possible to corresponding pins
PB2 PD2 (INT0)
15
16
PB3 (OC1) PD3 (INT1)
7
8
of the IC. LED D2 is a clipping indicator,
PB4 PD4 (T0)
17
PB5 (MOSI) PD5 (T1)
9 which lights up when the internal ADC or
18 11
19
PB6 (MISO) PD6 (ICP) DAC is close to saturation or in saturation
PB7 (SCK)
ATtiny2313 [1]. It should also be mentioned that the
1
RESET
DSP operates with a supply voltage of 3.3 V.
XTAL2
XTAL1
GND
S4 X1 S1 S2 S3
The effect algorithm is selected by a 4-bit
10
30 09-2010 elektor
Audio & Video
K6
K4
K2
K1
R35
R36
R34
R33
1M
1M
1M
1M
C31
C14
C24
25V
25V
2u2
2u2
2u2
2u2
C4
+ + + +
+5V
+5V
R5
R16
R18
R2
22k
22k
22k
22k
7
3
C10
25V
IC6B
IC6A
25V
2u2
2u2
C1
extensions. + +
IC1B
IC1A
R11
R1
The three analogue inputs POT0–POT2 can
1k
1k
22k
22k
be used to adjust the specific effect param-
1
+5V
+5V
R25
R23
R29
C2
R31
1n
C11
1n
22k
22k
+ +
eters of each effect algorithm. The analogue
C23
C16
2u2
2u2
C30
2u2
2u2
C5
+ +
PD7 2
PD6 1
PD7 2
PD6 1
the ATmega in the form of PWM signals. For
C22
C29
100n
100n
5
5
UD
INC
UD
INC
this purpose, the 5-V PWM signals are first 7
4
CS
8
7
4
CS
8
VSS VCC VSS VCC
reduced to 3.3 V by voltage dividers (R9/
X9C503
X9C503
IC7
IC4
R10, etc.) and then converted to DC volt-
+5V
+5V
6
3
ages by low-pass filters.
C28
2n2
C33
2n2
PB0
R30
R24
The effect type and effect parameter set-
IC1
4
8
1k
1k
R26
100n
C40
10k
10k +
+ C20
3V3
+
ting, are combined to form a preset profile
+5V
C25
25V
3u3
D2
16V
10u
100R
R22
C32
25V
3u3
IC6
and stored in the internal EEPROM of the
8
ATmega8. The 512 bytes of EEPROM mem-
100n
C41
12
27
28
3
5
1
ory provide exactly enough space for 64 T1
ROUT
LOUT
MID
CLIP
INR
INL
4 6
GND AVD
preset profiles. JP2 is provided for write pro- 7 8
100n
C3
GND DVDD
11 23
FV1
IC3
3V3
tection (write protection is enabled when 19
GND
GND
DVDD
24 26
pin 7 is tied to VCC and disabled when pin 7 GND REFP
REFN
100R
R17
POT2
POT1
POT0
SDA
SCK
X2
X1
S2
S1
S0
T0
is not tied to VCC).
+ C17
25
10
15
14
22
21
20
18
17
16
13
10u
25V
S2
S1
S0
T0
32.768kHz
Effect selection
15p
C18
X1
K7
D10
BAT85
C8
C6
100n
C12 10k
100n
100n
1N4148
profile:
220R
2x
JP2
R12
R8
R3
10k
10k
3V3
5
6
7
D8
SDA
SCL
WP
+5V
100n
100n
100n
C7
• The serial port (K3) and associated user
C13
C9
4 8
IC5
3 2 VSS VCC
IC8
interface
17k4
17k4
8 17k4
R15
R6 8k2
R10
R13
R9
R4
6N139
A2
A1
A0
7
• The MIDI port (K7)
8k2
8k2
100n
C21
5 6
3
2
1
•
R27
JP1
2k2
OPTO
MOSI
MOSI
PD7
PD6
T0
S0
S1
SCK
MISO
MOSI
PB0
3V3
+9V
K5
D7
D6
D5
1N4148
6
4
2
19
18
17
16
15
14
6
5
4
+ C34
PD7 (AIN1)
PD6 (AIN0)
PD5 (T1)
PD4 (XCK/T0)
PD3 (INT1)
PD2 (INT0)
PB5 (SCK)
PB4 (MISO)
PB3 (MOSI/OC2)
PB2 (SS/OC1B)
PB1 (OC1A)
PB0 (ICP)
8
GND
31,250 baud. 3
7805
JP4
JP3
IC9
7
C27
22p
9 VCC
ATmega8-16PI
PB6 (XTAL1/TOSC1)
20
8MHz
2
+5V
IC2
AVCC
X2
PB7 (XTAL2/TOSC2) 21
PC4 (ADC4/SDA)
PC5 (ADC5/SCL)
AREF
C26
22p
+5V
C19
100n
PC3 (ADC3)
PC2 (ADC2)
PC1 (ADC1)
PC0 (ADC0)
22
47u
25V
PD0 (RXD)
PD1 (TXD)
GND
1
28
27
26
25
24
23
1
LF33CV
3
ply voltages. For example, the user inter-
IC10
1N4148
1N4148
D1
D4
2
+5V
3V3
D3
C15
R14
R7
47n
10k
22k
100n
RES
S2
3V3
K3
090835 - 11
elektor 09-2010 31
Audio & Video
COMPONENT
LISTS
Main Board
Resistors
R1,R11,R24,R30 = 1kΩ
R2,R5,R7,R16,R18,R19,R20,R21,R
23,R25,R29,R31 = 22kΩ
R3,R8,R12,R14,R26,R32 = 10kΩ
R4,R9,R13 = 8.2kΩ
R6,R10,R15 = 17.4kΩ (1 %,
250 mW)
R17,R22 = 100Ω
R27 = 2.2kΩ
R28 = 220Ω
R33,R34,R35,R36 = 1MΩ
Capacitors
C1,C4,C5,C10,C14,C16,C23,C24,C
30,C31 = 2.2µF 16V
C2,C11,C28,C33 = 1nF 400V
C3,C6,C7,C8,C9,C12,C13,C19,C21
,C22,C29,C37,C38,C39,C40,C41
= 100nF, ceramic
C17,C20 = 10µF 16V
C15 = 47nF
C18 = 1nF, ceramic)
C25,C32 = 3.3µF 16V
C26,C27 = 22pF
C34,C35,C36 = 47µF 16V
Semiconductors
D1,D3,D4,D5,D6,D7,D8 = 1N4148
D2 = LED, 3mm, low current
D9,D10 = BAT85
IC1,IC6 = TS912, dual opamp,
rail to rail (ST Microelectronics
TS912IN)
IC2 = ATmega8-16PU, pro-
grammed, Elektor order #
090835-41 [8]
IC3 = SPN1001-FV1, Spin
Semiconductor
Figure 5. Component layout of the main board. The FV-1 IC is the only SMD component. IC4,IC7 = X9C503 electronic po-
tentiometer (Xicor X9C503P,
Farnell: 179485)
IC5 = 24LC32 (Microchip 24LC32A-
I/P), programmed, order #
090835-31 [8]
IC8 = 6N139 Optocoupler (Vishay
Semiconductor)
IC9 = 7805
IC10 = LF33CV (ST
Microelectronics)
Miscellaneous
X1 = 32.68kHz quartz crystal
X2 = 8MHz quartz crystal
K1,K2,K4,K6 = 2-way screw termi-
nal block, PCB mount
K3 = 3-pin pinheader, lead pitch
0.1 in.
K5 = 6-pin (2x3) pinheader, lead
pitch 0.1 in.
K7,K8 = 2-pin pinheader, lead
pitch 0.1 in.
JP1,JP3,JP4 = 2-pin pinheader, lead
pitch 0.1 in., with jumper
JP2 = 3-pin pinheader, lead pitch
0.1 in., with jumper
Figure 6. User interface PCB.
32 09-2010 elektor
Audio & Video
the required pin assignments when select- separately from the Elektor Shop. and internal to the ATmega) are available
ing a component for this (check the data All components except the FV-1 IC are on the web page for this article [8]. The
sheet). leaded types. The only SMD is the effects EEPROM file for the ATmega contains ini-
processor, but it is relatively easy to solder tialisation values for 63 preset profiles. As
Assembly and programming by hand since the pin spacing is 1.27 mm. downloading program code to the flash
To simplify assembly, a kit with all the nec- If you cannot find 17.4 kΩ resistors for R6, memory of the ATmega also erases the
essary components (including the PCBs, R10 and R15, you can use 15 kΩ and 2.2 kΩ internal EEPROM, the EEPROM must be pro-
pre-programmed microcontrollers and a resistors connected in series. grammed last.
programmed EEPROM) is available from the The flash memories of the AVR microcon-
Elektor Shop. The PCBs (Figures 5 and 6), The source and hex files for programming trollers can be programmed with an STK500
the pre-programmed microcontrollers and the microcontrollers and the hex files for development board (among other options),
the programmed EEPROM are also available programming the EEPROMs (external which can also be used for writing data to
Advertisement
elektor 09-2010 33
Audio & Video
Operation
A total of 15 effect algorithms (effect types) are available. The name of the
currently selected effect algorithm is shown on the first display page. Each
effect algorithm has three specific effect parameters, which are combined to
form a preset profile. The unit can store up to 64 preset profiles in memory.
The dry/effect mix ratio and ramp generator setting are also stored in each
preset profile.
The manual included in the download file [8] contains a table of all effect algo-
rithms and their configurable parameters.
After the unit is switched on, profile ‘000’ is loaded and shown in the first line
of the display. The currently selected effect algorithm is shown in the second
line of the display.
The next or previous preset profile can be selected by pressing the ‘+’ and ‘–’
buttons.
The Bypass (BP) button takes the effect unit out of the audio signal path.
The rotary encoder can be used to adjust the parameter values. The currently
selected parameter is indicated on the display by a blinking cursor. Clockwise
rotation increases the parameter value, while anticlockwise rotation reduces
the value.
Press the Edit button to jump to the next parameter page or select the next
parameter. If you have already reached the final parameter, pressing the Edit
button takes you back to the first display page.
To save a preset profile, first press and hold the Edit button and them press the
‘+’ button.
If you do not wish to save a setting, simply press the ‘+’ or ‘–’ button. Any
changes you have made to the profile up to this point will be lost.
The downloadable manual also includes information on controlling the unit
via the MIDI interface.
the internal EEPROM. An ISP port (K5) is also for the first time with the IC sockets empty. Internet Links
provided for the ATmega to enable in-circuit Check the supply voltages (5 V and 3.3 V)
programming and downloading of firmware at the IC sockets. Next, fit the ICs in their [1] www.spinsemi.com/Products/
updates. Jumper JP1 must be removed in sockets and connect the user interface to datasheets/spn1001/FV-1.pdf
order to program the microcontroller via the main board. The welcome message [2] www.spinsemi.com
the ISP port. should appear on the LCD module after
[3] www.spinsemi.com/Products/
You need an EEPROM programmer for the power is switched on. Press the Edit but-
datasheets/spn1001-dev/
external EEPROM, but you can also man- ton to navigate to the settings screen for
age with a bit of supplementary hardware the first parameter. Measure the voltage SPINAsmUserManual.pdf
and the PonyProg program [9]. The Pony- on the POT0 terminal. It should be possible [4] www.profusionplc.com
Prog website has a design for a simple par- to adjust it over the range of 0 to 3.3 V with [5] www.smallbearelec.com/home.html
allel port to I2C adapter circuit, which can the rotary encoder. It should never exceed
easily be assembled on a piece of prototyp- 3.5 V under any conditions. [6] www.musikding.de/
ing board. Incidentally, this handy program [7] http://ww1.microchip.com/downloads/
is also suitable for programming the AVR The Clip LED (D2) should light up briefly en/DeviceDoc/21713g.pdf
microcontrollers. when power is switched on. The circuit is
[8] http://www.elektor.com/090835
The zip file, which (as usual with Elektor now ready for use, and you can connect a
projects) can be downloaded free of charge, line level signal to its input. [9] www.lancos.com/prog.html
also includes a Read Me file with informa-
tion to help you sort out the hex files, as well The operating instructions are summarised
as several screen shots showing the correct in the inset. A detailed user guide (in Ger-
fuse settings. man) is included in the download file [8].
34 09-2010 elektor
A new era, a new
New tracks. New courses. New focus. ESC
Entering into its 21st year in Boston, ESC brings together systems architects, design
engineers, suppliers, analysts, and media from across the globe. With cutting edge
product demonstrations, visionary keynotes, and hundreds of essential training classes,
ESC is the ideal conference for the embedded design community to learn, collaborate,
and recognize excellence.
Start your own personal development at ESC 2010. You can’t afford to miss it.
Expo Floor Access is FREE!
Boston, MA
Hynes Convention Center
Conference: September 20-23, 2010
Expo: September 21-22, 2010
Register Today.
www.embedded.com/boston
RF
An important advantage of
the Elektor DSP radio over
other world receivers is the
flexibility the user has to
change its characteristics,
both by modifying the
antenna and front-end
circuit configuration and
by modifying the software.
The unit can be used in its
various configurations as a
PC-controlled radio or as a
portable world receiver.
The circuit diagrams shown here illustrate for FM reception, it nevertheless gave good The suggested turn counts given are suit-
the input circuit of the receiver we pub- results over all frequency bands from long- able for use with a 10 mm diameter fer-
lished in the first article in this series. For wave to FM. rite rod with a length of between 9 cm and
each possible antenna configuration the If separate antennas are to be used for FM 15 cm. The automatic tuning function of
relevant jumper settings appear in red and and AM reception, JP1 can be fitted to take the receiver means that the exact induc-
the connected antennas and their accompa- the bottom of FM coil L2 to ground. The tance value is not critical. Experiments
nying coils appear in green. open pin at JP1 (connected to L3 and C15) show that the ferrite rod provides good sig-
Figure 1 shows the standard configuration then forms the new AM antenna input for nal amplitude and interference rejection at
of the front-end circuit, with all jumpers in long-, medium- and shortwave (Figure 2). frequencies of up to 10 MHz, and this is why
their default positions. Switching diodes For indoor operation on long- and medium- both circuit variations also include a short-
D6 and D7 are represented symbolically wave ferrite antennas are often better than wave coil on the ferrite rod.
as shortwave and mediumwave switches. wire antennas as they have greater immu- A further interesting option is the tuned
You can see from the diagram how in each nity to the types of electric field interfer- loop antenna shown in Figure 5. A wire loop
case a part of the inductance in the circuit ence often found inside houses. Figure 3 with a total length of 4 m takes the place of
is shorted. A common antenna is used for and Figure 4 show two alternative possi- JP2. It is possible to make the loop smaller,
all frequency ranges: one example of a suit- bilities. In the first example the coils on the and the wire length and shape can also be
able design is a 50 cm whip. Another pos- ferrite rod form an additional part of the varied. Again, because of the automatic
sibility is to use an outdoor antenna: the receiver circuit, while in the second exam- tuning, high signal levels can be achieved,
author has successfully used a 10 m long- ple they replace the fixed inductors on the approaching the performance possible with
wire antenna connected via 30 m of coax- receiver board, which are taken out of cir- longwire antennas. The radio’s display will
ial cable. Although this antenna is not ideal cuit by removing jumpers JP2, JP3 and JP4. show the capacitance in the tuned circuit:
36 09-2010 elektor
RF
L2 C18 C17
L2 C18 C17
KW JP2 JP1
L3 KW JP2 JP1
L3 UKW Dipol
(D6) D4 D5
HF VHF (D6) D4 D5
L4 HF VHF
L4
JP3
JP3
MF
MF
MW
MW LMK Ant
(D7)
L5 (D7)
L5
C15 C16
JP4
JP4 C15 C16
LF
LF
AM FM 100193 - 11
AM FM 100193 - 12
Figure 1. Standard configuration of the front-end circuit. Figure 2. Separate connection of FM and AM antennas.
L2 C18 C17
L2 C18 C17
JP2 JP2
KW JP1 KW HF JP1
HF L3 L3
D4 D5 (D6) D4 D5
(D6) VHF VHF
L4 L4
4 6
JP3 JP3
MF MF
20 40
MW MW
(D7) (D7)
L5 L5
50 C15 C16 170 C15 C16
JP4
JP4
LF
LF
AM FM 100193 - 13
AM FM 100193 - 14
Figure 3. Connecting a ferrite rod antenna for use up to Figure 4. In this variation the coils on the ferrite rod antenna
around 10 MHz. replace the inductors on the receiver board.
as long as this remains between 10 pF and opens up the possibility of changing the interface (Figure 7) appropriately and click
500 pF the antenna will operate optimally. turn count on the antenna side to optimise on ‘Open’. When the program is closed the
It is worth noting that the same antenna can matching to the antenna. For example, a COM port setting is saved in the file COM.
be pressed into service for medium- and small coupling winding as shown, consist- ini, and the value will be restored when the
longwave reception, in each case forming ing of just one turn, will give good matching program is next started. All frequencies and
a part of the total inductance in the tuned to a 50 Ω antenna. station names are stored in the file DSPfreq.
circuit. ini, and these are also loaded when the pro-
Finally, Figure 6 shows a possibility for PC control gram starts.
shortwave DXing. Jumpers JP2 to JP4 are PC control opens up a whole new dimen- The program allows the user to choose a
not fitted and instead we fit a small trans- sion of possibilities to the Elektor DSP radio frequency from 20 presets for the FM band
former at the AM input. The turn counts beyond its use as a portable receiver. The and a further 20 presets for the AM bands.
given are intended for use with a 5 mm for- radio can be controlled over a USB interface The frequencies can be edited individu-
mer with a tuning slug suitable for opera- using a specially-developed program called ally. For each preset a station name can be
tion up to 15 MHz. The same coil was used ElektorDSP1, written in Visual Basic. The given for reference: in the case of an FM
in the ‘Preselector for Elektor SDR’ article program, including source code, is avail- preset this string will be shown on the PC’s
in the December 2009 issue of Elektor and able for free download from the Elektor web screen, but the display on the receiver will
is available from Conrad Electronics (order pages accompanying this article [2]. show the station name as transmitted by
code 516651) or from ModulBus (RF coil kit The first step on starting the program is to RDS. In the case of AM presets the station
T1.4) [1]. establish which COM port is to be used: the names are sent to the receiver along with
The input coil replaces the inductor in the default is COM1. If, for example, COM4 is to the frequency data, and the receiver will dis-
tuned circuit on the receiver board, and be used, edit the ‘COM’ text box in the user play this string when the preset is selected
elektor 09-2010 37
RF
1m
L2 C18 C17
1m
L2 C18 C17
KW JP2 JP1 UKW
L3
(D6) D4 D5
KG JP1 L4 HF VHF
L3
(D6) D4 D5
L4 JP2 VHF
HF JP3
MF
JP3
MW
MF
MG (D7)
L5
(D7) 15 1 KW
L5 C15 C16
JP4
C15 C16
JP4 LF
LF 100193 - 16
AM FM
AM FM 100193 - 15
Figure 5. Connecting a loop antenna for AM. Figure 6. Antenna coupling using an input coil for DX reception.
(by pressing S5 for longer than 0.5 s). This EEPROM. To erase all these stored settings, sensible default values, but it is possible to
makes tuning to AM presets a little more hold down S5 when turning the receiver alter their values to suit particular reception
user-friendly. on: everything will then be reset to stan- requirements or conditions. This possibil-
The settings can be stored in the receiver as dard values. ity was kept in mind when developing the
power-up defaults by pressing S5 for more The Si4735 device in the DSP radio can be embedded software for the radio, and it is
than two seconds. All settings, including configured in a wide variety of ways that possible to control eight important param-
any changes to the various parameters determine its reception characteristics. At eters for AM and FM reception from the PC.
described below, will then be copied into power-up all these parameters are set to If desired, it is possible to set up the receiver
with an entirely fresh batch of settings and
then save them for when the radio is used as
Table 1. FM properties a portable receiver.
Property Valid range Effect
FM parameters
De-emphasis 0 to 2 Treble cut
In the interests of reducing noise, FM trans-
Stereo 0 to 80 dBµV Stereo mode above this signal strength mitters add ‘emphasis’ (boost of high fre-
Mono 0 to 80 dBµV Mono mode below this signal strength quencies) to the signal. This must be com-
Mute rate 0 to 100 dB/s Soft mute rate of volume change
pensated for in the receiver (‘de-emphasis’).
The Si4735 features a switchable de-empha-
Mute max 0 to 32 dB Soft mute maximum attenuation sis filter.
Mute SNR 0 to 25 dB Soft mute SNR threshold
Seek SNR 0 to 20 dB Automatic search SNR threshold When signal strength is low many FM receiv-
ers produce a poor stereo output with con-
Seek RSSI 0 to 60 dBµV Automatic search signal strength threshold
siderable interference; some radios auto-
matically switch to mono mode in these
conditions. The DSP radio offers a better
Table 2. AM properties solution, smoothly and almost impercepti-
Property Valid range Effect bly transitioning between stereo and mono
modes. The upper and lower signal strength
De-emphasis 0 to 1 Treble cut limits for the transition are adjustable.
Filter 1 to 6 kHz Filter bandwidth
Mute rate 0 to 100 dB/s Soft mute rate of volume change In very weak signal conditions the DSP radio
chip uses a ‘soft mute’ function rather than
Mute slope 0 to 100 dB/s Soft mute attenuation function slope
the sudden muting provided in some receiv-
Mute max 0 to 32 dB Soft mute maximum attenuation ers, gently attenuating the output and thus
Mute SNR 0 to 25 dB Soft mute SNR threshold also the noise. The parameters control-
Seek SNR 0 to 20 dB Automatic search SNR threshold ling this are the ‘mute rate’ (speed of vol-
ume change), the maximum attenuation
Seek RSSI 0 to 60 dBµV Automatic search signal strength threshold
(‘mute max’) and the SNR (signal-to-noise
38 09-2010 elektor
RF
Listing 1
Low-level subroutines
Declare Sub Get_int_status()
Declare Sub Rx_volume()
Declare Sub Power_down()
Declare Sub Init_am()
ratio) threshold below which muting is trig- bandwidth can improve audio Declare Sub Init_fm()
gered. It is worth experimenting with these quality, while for DX reception Declare Sub Am_tune_freq()
parameters, especially when tuning in to a narrower bandwidth will help Declare Sub Fm_tune_freq()
weak stations. reduce interference. The de- Declare Sub Fm_seek_freq_up()
The ‘seek SNR’ and ‘seek RSSI’ parameters emphasis control has a simi- Declare Sub Fm_seek_freq_down()
affect the behaviour of the automatic sta- lar effect, and can be used as a
Declare Sub Am_seek_freq_up()
tion search function. Stations will only be crude treble control.
Declare Sub Am_seek_freq_down()
found if they exceed the specified signal
Declare Sub Fm_tune_status()
strength (RSSI) and SNR thresholds. In AM mode there are four
Declare Sub Fm_rsq_status()
Table 1 gives an overview of the FM parameters that control the
Declare Sub Am_tune_status()
parameters. soft mute function. The highly
effective automatic level control Declare Sub Am_tune_status_stop()
AM parameters in the receiver IC increases gain Declare Sub Am_rsq_status()
The parameters governing AM reception when the signal level falls, which Declare Sub Fm_start()
(Table 2) are similar to those for FM. An as a consequence also increases Declare Sub Am_start()
extra is that the bandwidth of the receiver noise. If the input level falls Declare Sub Am_seek_step_9khz()
is adjustable to one of a number of pre- below a preset threshold, how- Declare Sub Am_seek_step_5khz()
defined values. The parameter can take ever, the volume will be reduced Declare Sub Am_seek_step_1khz()
on the value 0 (6 kHz), 1 (4 kHz), 2 (3 kHz), in proportion. The signal level Declare Sub Init_rds()
3 (2 kHz) or 4 (1 kHz). Here ‘2 kHz’ (the threshold, the slope of the mut- Declare Sub Fm_rds_status()
default value) means that the will accept ing function, the speed with Declare Sub Rds()
signals out to 2 kHz away from the tuned which the function acts and the
frequency on either side, and thus corre- maximum degree of muting are
sponds to an actual IF filter bandwidth of all adjustable. The default values
4 kHz. For strong stations, using a wider are designed to work well when Listing 2
AM tuning and band switching
Sub Am_tune_freq()
If Fam > 500 Then
If Fam > 2000 Then
Portb.0 = 1 ‘SW
Portc.3 = 0
Else
Portb.0 = 0 ‘MW
Portc.3 = 1
End If
Else
Portb.0 = 0 ‘LW
Portc.3 = 0
End If
I2cstart
I2cwbyte 34
I2cwbyte &H40
I2cwbyte &H00
H = High(fam)
L = Low(fam)
I2cwbyte H
I2cwbyte L
I2cwbyte &H00
I2cstop
End Sub
Figure 7. The user interface presented by the ElektorDSP1 program.
elektor 09-2010 39
RF
Listing 3
Decoding serial commands
$baud = 38400
‘************ RS232 control *********************
D = Inkey(#1)
If D = 102 Then F_control ‘f, Freq
If D = 109 Then Mam_control ‘m, Memory AM
Program-it-yourself
The firmware in the DSP radio was devel-
If D = 110 Then Mfm_control ‘n, Memory FM
oped using Bascom, and the source code
If D = 112 Then Properties ‘p, Property is available, along with a hex file, for free
If D = 105 Then Pc_control_i2c ‘i, I2C command download at [3]. The DSP radio printed cir-
If D = 106 Then Rdsout = 1 ‘j: RDS output cuit board has an in-system programming
If D = 107 Then Rdsout = 0 ‘k: RDS output off connector for the ATmega168, which allows
If D = 114 Then Print Rssi ‘r: RSSI you to modify the firmware in the radio to
If D = 115 Then Print Snr ‘s: SNR your heart’s content. If low-level program-
ming is not your cup of tea, the ElektorDSP1
PC control software described above allows
you to customise the receiver without writ-
receiving strong stations. The volume is mary purpose of the receiver is to listen to ing a line of code. Furthermore, it is pos-
attenuated by a maximum of 16 dB when stronger stations or DX reception, and set sible to use the USB interface to commu-
the input signal level falls below 10 dBµV. the parameters accordingly. Many DXers nicate directly with the firmware and alter
DXers will likely not find this behaviour ideal will want to disable the soft mute function the receiver’s behaviour. In most cases a
as weak stations will fluctuate unnecessar- entirely: the simplest way to do this is to set simple terminal program is all you need,
ily in volume. So, decide whether the pri- ‘mute max’ to zero. although it is of course possible to develop
programs on the PC to control the radio in
specific ways.
40 09-2010 elektor
RF
memory to be programmed. The ‘p’ com- appropriate initialisations when switching ATTENUATION) by sending the sequence
mand gives access to the various ‘proper- between FM and AM modes. After a fre- ‘p13<Enter>0<Enter>’. Even the overall vol-
ties’ or ‘parameters’ of the DSP IC and the quency command the unit returns to nor- ume can be adjusted in this way, using prop-
‘i’ command gives direct low-level access to mal manual operation mode, and so PC erty number 0. For maximum volume send
the Si4735 via the subroutine Pc_control_ commands and manual commands can be ‘p0<Enter>63<Enter>’.
i2c. Read commands are also available. For executed alternately. The source code of the
example, it is possible to read the current ElektorDSP1 program gives an example of Listing 6 shows how to access the low-level
signal strength or signal-to-noise ratio, and how to control the receiver in this way using features of the Si4735. Each command is
to gain access to the RDS data. Visual Basic. introduced by the lower-case letter ‘i’. For
I2C data transfer the next character (which
Listing 4 shows how a frequency is set. A Listing 5 shows the range of functions specifies the subcommand) should be
frequency in the AM band is set by a com- available via the ‘p’ command. A total of ‘C’. The following bytes are transferred as
mand such as ‘f5955<Enter>’: you can try sixteen different receiver properties can raw binary values. The first two bytes are
this out using a simple terminal program. be adjusted. For example, to increase the counts of the number of bytes to be sent
In this example, the receiver is tuned to receiver bandwidth, use a terminal to send and received respectively, and the follow-
5955 kHz. FM band frequencies are also the sequence ‘p10<Enter>2<Enter>’. To dis- ing bytes are then sent verbatim in the nat-
given in kilohertz, such as ‘f102800<Enter>’ able the soft mute function, adjust prop- ural order. The microcontroller takes care of
for 102.8 MHz. The firmware carries out erty number 13 (AM_SOFT_MUTE_MAX_ prefixing the bytes on the I2C bus with the
Advertisement
elektor
elektor 09-2010
09-2010 41
41
RF
Listing 4 Listing 6
Tuning over the serial port Direct I2C bus access
start command and the device address. The In summary, the Elektor DSP radio offers a Internet Links
receiver IC is then addressed again in read wide range of options, well beyond those
mode. The requested number of bytes is offered by a conventional world receiver. In [1] www.ak-modul-bus.de
then read and passed back to the host PC. particular, it offers an unprecedented array (site only available in German: search for
The ‘A’ and ‘B’ subcommands of the ‘i’ com- of customizing possibilities. We hope that ‘HF Spulen Bausatz T1.4’)
mand are used to send text to be shown many readers will build the receiver and [2] www.elektor.com/100193
on the receiver’s LCD panel: the two com- exchange their experiences on the forum on (web pages accompanying this article)
mands allow the two lines of the display to the Elektor website, and we feel sure that
[3] www.elektor.com/100126
be written independently. you will come up with ideas far in advance
The receiver does not automatically return of anything we have thought of! (first article in this series)
to manual mode after the ‘i’ command is (100193)
completed; instead, the device remains
under PC control.
42 09-2010 elektor
Examined: Hameg HMO2524
By Harry Baggen and was left in the hands of
Ton Giesberts (Elektor the design team.
The name Hameg con-
Netherlands Editorial /
jures up fond memories
Elektor Labs) for many electronics
engineers. This Ger-
To an electronics designer man company was
an oscilloscope is some- one of the first com-
thing like an extension of panies to make afford-
his brain. As soon as any able and usable oscil-
trifling bit of hardware has loscopes available, long
been slapped it needs to before China and other
be checked. An oscillo- Asian countries started to
scope is then an indis- compete with their prod-
pensable tool (in addi- ucts. The prices were such
tion to the equally that even for hobby use it
indispensable multime- became interesting to pur-
ter, of course). You use chase such a scope. In the
it to ‘just’ check whether meantime the company has
and oscillator is working specialised in products with
properly or whether there is a signal at a certain place in the a very good price/quality ratio and a high reliability. That the
circuit. Alternatively you can use it to make more accurate mea- products made by Hameg have a good reputation is also shown
surements of more complex waveforms. Nowadays, all kinds of by the fact that the renowned test equipment manufacturer
elektor 09-2010 43
rate of 2.5 GSamples/s (when operating in 2-channel mode). where you can search for signals in various ways, there is a
The price of the base version of this scope is around 3300 Euros very usable FFT-function and there are many cursor measure-
(excl. VAT). The scope can also be used as a 16-channel logic ments as well as mathematical functions that you can program
analyser. Additional software options are available to test yourself.
buses with protocols such as I2C, SPI and RS-232. Of course,
for our practical test we had several ‘pods’ (adaptors to make What’s more, we haven’t even mentioned the digital sig-
the digital connections) available to us and the required soft- nal measurements yet. This gives you the ability of mea-
ware options were also activated in the scope. Various types suring 16 digital signals simultaneously, at a rate of up to
of probes were obviously present as well and we also had an 1.25 GSamples/s, also with very extensive trigger options. This
active probe with an input capacitance of only 0.9 pF (suitable does, however, require special pods to connect the digital sig-
for measurements up to 1 GHz). nals under test to the connections on the scope. Depending in
The first thing you notice when switching the scope on is the the type of bus you want to look at you may have to install addi-
bright and clear display, which has a resolution of 640 x 480 tional software (available for I2C, SPI, UART/RS232).
pixels and an LED backlight, it is a pleasure to look at! In the With this many signals displayed on the screen at the same
lab we have several digital ‘all-round’ scopes in the price range time, it can become very cluttered. To keep everything well-
from 1000 to 3000 Euros and none of those comes even close organised, Hameg have made a very handy scroll function that
to competing with this. allows you to move through a virtual screen which is a lot bigger
than the real screen. We like it a lot!
The number of options is overwhelming, you will have to invest This new series of oscilloscopes from Hameg, which are, consid-
quite a bit of time before becoming familiar with all the niceties. ering the price, above their existing range of analogue/digital
However, the user-friendliness does suffer a little as a result, equipment, can easily compete on capabilities and features with
because of all these options and with only occasional use, even comparable products from other scope manufacturers such as
the most simple settings can be a chore to find in the menus. Agilent, LeCroy and Tektronix. The HMO2524 is an excellent and
During our first measuring attempts, Ton, who has more than reliable test instrument for both analogue and digital measure-
20 years experience in the lab and has worked with many differ- ments. But if you are considering purchasing such an instru-
ent scopes, did need quite some time to dig through a number ment you should have the applications to put its many abilities
of menus to finally find the appropriate settings to give a clear to good use and you will have to invest the time to become pro-
test signal on the screen. The quality of the displayed signal, ficient with all its features (but this is equally true for any scope
after some effort, is outstanding however. Moreover, the scope in this price range).
reacts quickly to changes in settings, something that is regret-
tably not the case with many digital scopes. But a scope with Unfortunately the scope had to go back to Hameg. We will
this many options forces you to have a good read of the user especially miss that crisp and bright screen. Is it really not pos-
manual (something that our designers — just like other users sible to swap it for a few of those other oscilloscopes that we
of complex equipment — do only rarely and then reluctantly). have sitting around here?
So the number of features is extremely large. There are numer- (100420-I)
ous trigger modes, there is a sizeable buffer of 4 MSamples Internet Link: www.hameg.com
44 09-2010 elektor
The figures show the test arrangement. The top circuit is used
for testing bipolar capacitors. The bottom circuit provides pola-
G1
rised electrolytic capacitors with a bias voltage for testing those
G
types. In each case the bottom capacitor (C2 and C4 respec- A : 100 Hz
which could not be explained by any differences between the Bias MKP-6u6
100k
elektor 09-2010 45
Tiny samples, big footprint
We are slowly becoming rounded by packing mate-
more aware of our impact on rial, t wo more boxes in
the environmental and car- which were nestled some
bon footprint but something 50 cm long plastic tubes
happened in the lab the other containing the miniscule
week that made us smile: for samples. The total volume
an upcoming project one of of the chips themselves can
our team, Clemens Valens hardly be more than 1 cubic
ordered four IC samples from centimetre!
the chip manufacturer Ana-
log Devices. From the labels on the box the
One week later the editor of package began its journey to
our French edition of Elek- France in the Philippines.
tor took delivery of a surpris- Needless to say, Clemens was
ingly large (at least 30 litre) relieved he wasn’t paying for
parcel. The complete par- the samples or the post and
cel weighed-in at 1.3 kg and packing on that one!
on opening he found, sur- (100240)
46 09-2010 elektor
Review: Audio DSP
Audio hobbyists usually confine their hobby to the analogue domain, since the opportunities for doing
your own experimenting in the digital domain are very limited. There is very little affordable equipment
available that allows a multitude of digital-audio processing operations and getting started with DSPs
yourself requires a considerable depth of knowledge of this subject matter. With the modules from
miniDSP you can easily realise all kinds of audio processing functions without the need to become
intimately familiar with digital signal processing.
In the audio world, DIY is most certainly not dead yet. There are still digital power stages (miniAMP). All boards have identical dimen-
plenty of people who design/build amplifiers and speaker boxes or sions and can easily be stacked together and interconnected. Using
modify existing equipment. Despite the fact that the source mate- the so-called audio plug-ins you can determine the functionality
rial (the music) and the playback equipment are usually digital, of the DSP board, that is, the software you put into the DSP. At the
there are still sufficient opportunities for tinkering to your heart’s moment, plug-ins are available for 2- and 4-way crossover filters
content with the analog stages that follow. Nevertheless, you will with equalizer (in simple and advanced implementations) and a
have noticed that more and more audio processing is taking place in mixer with 31-band graphic equalizer. Work is in progress for other
the digital domain, ranging from signal processors to digital power plug-ins.
amplifiers. This is quite a complicated world for the average audio The plug-ins work in combination with Adobe Air, which you have
hobbyist, where there are now few or no opportunities for doing to install on your computer beforehand. Double-clicking the down-
anything yourself. Still, it is becoming increasingly interesting to loaded plug-in is then sufficient to install it.
familiarise yourself with the possibilities that these digital tech-
nologies have to offer. A digital crossover filter for an active loud-
speaker system comes to mind, which would allow easy adjustment
of the crossover frequency, slope, filter type and delay between the
drivers.
It is true that there are a few systems on the market which offer you
the possibility of experimenting yourself (for example the ampli-
fier module AS2.100 from Hypex, which contains two digital power
stages and a DSP for filtering and equalisation, or the semi-profes-
sional DCX2496), but overall the choice is very limited.
The young company miniDSP, established in Hong Kong, comprises
several engineers who came up with the idea of marketing flexible
and affordable digital audio products for both hobbyists and pro-
fessional audio equipment manufacturers. The objective here was
to keep the programmability of these products as simple as pos-
sible. In practice this means that you buy a board with a DSP on
it and then you choose the required functionality from the soft-
ware applications that they offer. This software is configured using
a comfortable user-interface on your PC. So you only have to type
in a crossover frequency and a slope for the filter and the DSP will
do exactly what you have asked it to do. There is no need for exten-
sive knowledge of DSPs and programming, and (almost) none for
digital audio technology.
The basis of the entire system is the miniDSP board, a printed circuit
board measuring 7.5 by 7.5 cm, which contains a DSP and a number Figure 1. The miniDSP board has two analogue inputs and four
of connectors. To this you can add an I/O-board, which has a num- outputs.
ber of digital inputs and outputs (miniDIGI) and a board with four
48 09-2010 elektor
Review: Audio DSP
Figure 2. The miniDIGI board contains a sample rate converter and Figure 3. The third board, the miniAMP, contains a class-D amplifier
offers a substantial number of inputs and outputs. IC with four output channels, which can also be bridge connected.
elektor 09-2010 49
Review: Audio DSP
Figure 4. The design of the software. From this overview you can Figure 5. Here we can see the part for the crossover filter. You can
select each function block. select the crossover frequency, type of filter and slope. At the same
time you can choose a band-pass filter.
four digital amplifiers, which can be bridge-connected for a stereo you will only need to buy a miniDSP board. If you would like digital
version with a higher output power. The power amplifier IC on this inputs with that then you will also have to buy the miniDIGI board.
board is a TAS5704 (also from TI). This can generate an audio power And should you want to experiment regularly with several differ-
of 4 x 10 W into 4 Ω or 2 x 20 W into 8 Ω in bridge configuration. ent loudspeaker boxes, then the miniAMP board could be a very
Thanks to the class-D design of this amplifier it has a high efficiency handy accessory.
(90%) and a small heatsink mounted directly on the PCB suffices for
the cooling. The electrolytic capacitors are made by Nichicon, but The boards are supplied completely assembled. You effectively only
these capacitors are not necessary in bridge configuration and can have to connect a power supply and you are ready to get started.
be linked out using jumpers. The TAS5704 is presented with the Well, that is after you have set all the jumpers on all the boards
audio signal in digital form, so the D/A converters of the DSP are appropriately. In particular the miniDIGI board contains a large
therefore not used. Although the output power of this board is not number of jumper settings, among others, for the correct intercon-
all that high, it is ideal for experimenting because you have 4 power nections of the I2S signals between the boards. This can be quite
amplifiers at your disposal. Just connect the drivers via a few cables confusing initially. Fortunately the miniDSP website contains docu-
to the screw terminals and you can immediately evaluate the effect mentation with various example configurations, which show exactly
on the sound of any of the DSP settings that you make. which jumpers have to be placed where for a certain combination
The printed circuit boards all have identical dimensions and can be of boards or application. In addition, the developers have advised
assembled one on top of the other with stand-offs. Short ribbon- us that they are continually busy with further improvements and
cable interconnects are supplied to make the connections between expansion of the documentation. Even during the time we were
the boards. The power supply for the miniDSP board an be provided doing our evaluation there appeared several updates to the soft-
by the USB connector mounted on the board. The miniDIGI board ware and documentation.
and miniAMP board both contain a standard DC power supply jack
for connecting a mains power supply. The power supply voltage For the software-example for this test we choose a two-way filter
may range from 4.5 to 24 V for the miniDSP and miniDIGI, the mini- with built-in parametric equalisers. This is an excellent test project
AMP board requires 12 to 24 V. for such a system.
Connecting and testing In the first instance we connected the entire module to our Audio
For this test we received a complete set, comprising a miniDSP, min- Precision System II to check the operation and perform a few mea-
iDIGI and miniAMP. We selected a miniDSP version with an input surements. The module was powered from a large regulated mains
range of 2 V, so that you can directly connect the output from a power supply (power supply voltage was 24 V).
CD player to it (there is also a version with a 0.9 V sensitivity avail-
able, to which you could easily add a voltage divider, if need be). The To get a feeling for the affect that the DSP has on the analog audio
boards are connected together using very short interconnecting signal, all the filters in the software were set to ‘straight through’
cables (see opening photo). There are plenty of possibilities with and we supplied a digital signal via the miniDIGI board. We then
this complete set of boards, but in practice you would only buy measured the distortion of all the analog outputs of the DSP. These
those boards that you need for your particular application. If, for were very low, about 0.005% at 1 kHz at nearly 100% signal level.
example, you want to add a digital crossover filter to a loudspeaker This value changed very little when we switched to the analogue
box with analogue inputs and use existing power amplifiers then inputs of the DSP, that is, the A/D converters are now also in the
50 09-2010 elektor
Figure 6. Every parametric equaliser of the two-way plug-in allows Advertisement
In practice
After all this it was time to play with the software and have a look
at how we could realise a practical circuit. After installing Adobe Air
runtime (free download from the Adobe website) and download-
ing the two-way crossover plug-in from the miniDSP website, you
only need to double-click the downloaded .air-file after which the
installation is automatically carried out and shortcuts are also cre-
ated. Now we only need to connect the DSP-board, using a cable
with a mini-USB connector, to the PC and we are ready to start
experimenting.
When the program is first started the tabbed page ‘Audio Settings’
appears, which shows a block-diagrammatic overview of the design
of the software. The tabbed page ‘System Settings’ contains a num-
ber of general settings, such as the type of input signal (analogue
or digital), activating an external volume control, and saving and
loading of the configurations (in xml-format). In this way you can
save all the settings that you have made and easily retrieve them at
some later time. There is also a button here to return everything to
the default settings. Finally there is a third tab that brings you to
the miniDSP website. All plug-ins follow the same general design.
When clicking on one of the function blocks on the ‘Audio Settings’
page, the corresponding settings appear. With the two-way cross-
over plug-in you can select in the first block the attenuation of the
elektor 09-2010 51
Review: Audio DSP
dx = 0.00000 Hz
+0
-10
-20
-30
-40
d
B
V -50 in the loudspeaker enclosure, together with a suitable power sup-
ply and power amplifier. As already mentioned, the miniAMP is
-60
very handy for experiments, but for a final loudspeaker system it
-70 would be better to choose a few bigger (and better quality) power
amplifiers.
-80
52 09-2010 elektor
C Z l c Z h E g Z h h
:YjXVi^dcCZkZg:cYh#:kZgni]^c\ndjcZZYid`cdlid\ZihiVgiZY#
Visit newnespress.com today and sign up for our Newnes Online Membership.
GZXZ^kZdjgWZhiY^hXdjcih=ZVgVWdjiWdd`hWZ[dgZi]ZnejWa^h]
6XXZhhid[gZZhVbeaZX]VeiZgh!k^YZdijidg^VahVcYbdgZ
elektor 09-2010 53
Unilab display
The Unilab power supply module described in the April 2010 edition is a compact, adjustable switch-mode
power supply unit that is very well suited to building a single or dual lab power supply. For this application,
we have developed a special meter circuit in the Elektor Labs with a four-line display that shows the output
voltages and currents of a symmetrical configuration with two Unilab circuit boards.
If you wish to build your own lab power rent. With a symmetrical power supply, display modules with LCD or LED readout
supply, it’s only natural to want to equip it this amounts to two sets of two meters. are commercially available, they have two
with separate meters for voltage and cur- Although a variety of small, ready-made drawbacks. The first is that they aren’t espe-
+5V +5V K4
C4
D5 +5V
IC2 10k 10k 10k C5 C6 +5V
2 10uH
LM35 100n
R24
-5V BAT85 100n 20
21
7
3
AVCC
VCC
AREF
R1 4R7
U- R17 23 P4
PC0 (ADC0) C7 C8
499R I- R18 24 IC3
PC1 (ADC1)
U+ I+ R19 25 ATmega168
PC2 (ADC2) 100u
U+ R20 26 2 25V 100n 10k
K1 PC3 (ADC3) PD0 (RXD)
27 3
1 2 4x 100R PC4 (ADC4/SDA) PD1 (TXD)
R3 D1 D2 D3 D4 28 4
3 4 3 C1 PC5 (ADC5/SCL) PD2 (INT0)
1 5
5 6 1 PC6 (RESET) PD3 (INT1)
10k IC1A I+ 6
2 100n PD4 (XCK/T0)
+SMPS 14 11
P1 PB0 (ICP) PD5 (T1)
200R
R4 R5 4x BAT85 15
PB1 (OC1A) PD6 (AIN0)
12
16 13
68k PB2 (SS/OC1B) PD7 (AIN1)
100k 17
K3 PB3 (MOSI/OC2)
2 1 18
+5V PB4 (MISO)
1k R7 4 3 19
U- PB5 (SCK)
6 5
XTAL1
XTAL2
K2 3k3 R26
GND
GND
R6
1 2 13 R13 ISP
3 4 14 +5V J1 X1 15R
IC1D
22
10
100k S1 T1
5 6 12 6k81 R25
P3
C2 C3
-SMPS 500R 5 470R
R8 R9 7 BC639
R14 IC1B I- 15p 10MHz 15p
6
47k +5V 12k
R11 6k81 K5
P2
5k 9
R15 R16
8 8V
COMMON R10 24k IC1C C19 C17 IC4 +5V
10 10k 68k
MODE
ADJUST 45k3 R12 47n 47n 1
7805 3
IC1 = LMC6464BIN B1
C20 C18
K6
47n + C15 C13 + C11 C9
2
24k 47n
8V
220u 100n 10u 4 100n
25V 63V
IC1
+ C16 C14 + C12 11 C10
25V 63V
1 3
79L05
100166 - 11
IC5 -5V
54 06-2010 elektor
Unilab display
Features
• Readings shown on a large backlit LCD
module with 4 lines of 20 characters
• Selectable °C or °F temperature
indication
cially cheap, which means you’re looking at IC3 (ADC0–ADC3). This portion is discussed
a tidy sum if you need four of them. The sec- separately below. Resistors R17–R20 and
ond is that connecting modules of this sort diodes D1–D4 protect the A/D converter
to a power supply is always difficult. The inputs of the microcontroller against nega-
amplitude and polarity of all of the mea- tive voltages. Only the positive inputs need
LCD1 sured quantities must be adapted to obtain to be protected against excessive positive
optimal resolution with the selected mod- voltages, since the other measurement sig-
1
VSS ules, and in many cases it’s necessary to nals never exceed +5 V.
2
VDD
3
VL make certain measurements with the meter The LCD module that displays all the read-
4
5
RS floating relative to the actual power supply. ings has 4 lines of 20 characters and is driven
R/W
6 As the Unilab module is highly suitable for directly by the microcontroller. The con-
E
7 putting together a symmetrical DIY lab trast can be adjusted using P4. Transistor
D0
8
9
D1 power supply, we decided to develop a T1 (which is driven by port PB1) allows the
D2
10
D3
separate display unit for this purpose with brightness of the backlight to be adjusted or
11
D4 a large LCD module that shows the volt- switched off. The software causes the back-
12
D5 age and current of both halves of the sup- light to blink if the power supply is over-
13
D6
14
D7 ply, along with the temperature inside the loaded (output current greater than 3 A).
15
16
LED+A enclosure. All in all, this solution is certainly The supply voltage line to the LCD module
LED-C
no more expensive than four separate is strongly decoupled by R14, C7 and C8 to
modules, and what’s more it is much more avoid any interference on the A/D inputs.
4x20
attractive and guaranteed to work properly. As a bonus, we included an LM35 (IC2) that
The latter reason is probably the best argu- can be used to monitor the temperature
ment for building your own display module. inside the power supply enclosure. The tem-
perature sensor provides an output voltage
Design of 10 mV/K and is powered from the +5 V
Before we explain how the circuit works in rail. If you want to have the temperature
detail, it’s a good idea to describe the over- displayed in degrees Fahrenheit, simply fit
all design (Figure 1). The ‘core intelligence’ jumper J1. In this case the ‘C’ on the display
of the circuit is provided by an ATmega168, is replaced by ‘F’ and the Celsius tempera-
an Atmel microcontroller with (among ture signal from the LM35 is converted to
other things) six A/D converters. Here we Fahrenheit using the formula
use four of them to measure the two load
currents and the two output voltages. The T [°F] = T [°C] × 9/5 + 32.
Figure 1. Schematic diagram of the clock signal for the microcontroller is gen-
dual voltage/current meter for a Unilab erated using an external 10-MHz crystal. K3 is the ISP connector. This is handy if you
power supply. Naturally, it can also be The portion of the circuit around opamps want to modify the software to suit your
used for other applications. IC1a–IC1d provides signal conditioning for own wishes. K4 is a debug connector. An
the current and voltage sense signals before Elektor USB/TTL adapter cable (# 080213-
they are fed to the A/D converter inputs of 71) can be connected directly to K4.
elektor 06-2010 55
Unilab display
COMPONENT LIST
Resistors nductor
(0.25 W unless indicated otherwise) L1 = 10µH 10%, axial, Rs = 0.29Ω, e.g. Epcos
R1 = 499Ω 1% 0.6W type B78108S1103K
R2 = 1.00kΩ 1% 0.6W
R3,R15,R21,R22,R23 = 10kΩ 5% Halfgeleiders:
R4,R6 = 100kΩ 5% D1,D2,D3,D4,D5 = BAT85
R5,R16 = 68kΩ 5% T1 = BC639 the sense resistor for current measurement
R7 = 3.3kΩ, 5% IC1 = LMC6464BIN is located in the negative output line of the
R8 = 47kΩ 5% IC2 = LM35CZ
R9 = 12kΩ 5% IC3 = ATmega168-20PU, programmed, con-
power supply module. This means that the
R10 = 45.3kΩ 1% 0.6W tained in kit # 100166-71 voltage on the sense resistor floats on top of
R11,R12 = 24.0kΩ 1% 0.5W IC4 = 7805 the output voltage. Consequently, the out-
R13,R14 = 6.81kΩ 1% 0.6W IC5 = 79L05 put voltage must be suppressed in order
R17,R18,R19,R20 = 100Ω 5% B1 = 80V, 1.5A bridge rectifier (pinout ~ + ~ to measure the voltage across the sense
R24 = 4.7Ω 5% –), e.g. Semikron SKBB80C1500L5B
resistor.
R25 = 470Ω 5%
R26 = 15Ω 5 % Miscellaneous
P1 = 200Ω trimpot, e.g. Vishay Spectrol type K1,K2,K3 = 6-pin (2x3) pinheader, lead pitch The Unilab circuit board has a connector (K1
M64W201KB40 0.1 in. (2.54mm) on PCB # 090786-1) that makes it easier to
P2 = 5kΩ trimpot, e.g. Vishay Spectrol type K4 = 6-pin pinheader, lead pitch 0.1 in. measure the current and voltage. With the
M64W502KB40 (2.54mm) positive supply module, the voltage and
P3 = 500Ω trimpot, e.g. Vishay Spectrol type K5,K6 = 2-way PCB terminal block, lead pitch
M64W501KB40 5mm
current can be measured using pins 1 and 4
P4 = 10kΩ trimpot, e.g. Piher type J1,S1 = 2-pin pinheader, lead pitch 0.1 in. of this connector. Pin 2 is connected to the
PT10LV10-103A2020 (2.54mm) minus output terminal on the PCB and thus
LCD1 = 16-pin pinheader, lead pitch 0.1 in. serves as the ground connection point (the
Capacitors (2.54mm) neutral terminal of the symmetrical power
C1,C4,C5,C6,C8,C9,C10,C13,C14 = 100nF ce- LCD1 = 16-pin SIL connector for display, lead
ramic, lead pitch 5mm pitch 0.1 in. (2.54mm)
supply) for the display PCB. With the nega-
C2,C3 = 15pF 2%, ceramic, lead pitch 5mm X1 = 10MHz quartz crystal, HC-49/S, 50ppm, tive supply module, pins 2 and 4 are used to
C7 = 100µF 25V, radial, lead pitch 2.5mm CL = 12pF measure the voltage and current, respec-
C11,C12 = 10µF 63V, radial, lead pitch 2.5mm LCD, 4x20 characters with background light- tively. Here pin 2 is connected directly to
C15,C16 = 220µF 25V, radial, lead pitch 3.5 ing, dim. 60 x 98 mm, e.g. HTDISPLAY the negative output voltage, and the volt-
mm HC200401C-YF62L-VA
age between pin 2 and pin 4 is proportional
C17,C18,C19,C20 = 47nF, ceramic, lead pitch PCB # 100166-1
5mm Software en PCB design files: free download * to the voltage across the sense resistor.
Kit of parts incl. PCB, programmed controller In order to allow the various quantities to
and LCD: Elektor order # 100166-71 * be measured accurately using the internal
* Details at www.elektor.com/100166 A/D converters of the microcontroller, the
full range of the voltage or current sense
signal must lie within the full-scale range of
the A/D converter. Here we use the internal
voltage reference, so the full-scale range of
the 10-bit converters is 1.1 V. This means
that it is not possible to measure negative
voltages.
56 06-2010 elektor
Unilab display
Test Circuit
We designed a simple current source (see the schematic diagram) to help you align the signal
conditioning circuitry around IC1 and perform the subsequent calibration. To allow this test
circuit to operate at the lowest possible voltage, it must have its own source of 5 V power. We
assume that everyone will have a suitable supply available.
Measuring the current is a bit more com-
plicated. On the power supply board, the This is a conventional current source design using an opamp that compares the voltage across
voltage across the sense resistor is first fed
the emitter resistor of a transistor with a set value, which in this case is taken from the wiper of
to amplifier (IC3a) with a gain of approxi-
P1. Here the transistor consists of two devices connected in parallel (T1 and T2), which can jointly
mately 4. The output signal from this stage
handle a substantial current. This approach also distributes the heat load more evenly over the
is available directly on pin 4 of connector
K3 of the power supply module. Due to heat sink. If you use three standard 0.25-watt resistors with a value of 0.15 Ω for the emitter re-
the design of the Unilab module, the out- sistor, this circuit can easily supply currents as high as 4 A. The usual practice when transistors
put voltage of this amplifier stage is nega- are connected in parallel is to provide each transistor with its own emitter resistor. This is not
tive, but it has the same slope as the volt- possible here, and a specific voltage drop across each emitter resistor is also necessary for proper
age across the sense resistor. If the voltage operation. To nevertheless ensure a reasonable degree of current sharing, we use individual base
across the sense resistor increases, the out- resistors here. However, this only works well if the gains of the transistors are roughly the same,
put voltage of the amplifier becomes less so you must pay attention to this. C3 and R2 stabilize the feedback loop.
negative. This means that we need a cir-
cuit on the display board to shift the volt-
age into the input range of the A/D con-
+5V
verter and amplify it a bit more to obtain R1 C2 +I
maximum precision. This task is handled
100n
by opamp IC1a, with an additional gain of 2k43 R4
P1 3 100R T1 T2
7
6
IC1
of 150 mV across the sense resistor, this 2 C1 100R
yields a voltage of approximately 0.97 V at 100R BD911 BD911
4
R2
1n
the A/D converter input. As the 0 A setting TS921IN R6 R5 R7 R8 R9
10k
can be adjusted reasonably close to 0 V with
P1, the circuit also has some headroom to 1k 1k 0R15 0R15 0R15 -I
display higher currents (due to supply over- 0
100166 - 12
loading), up to a maximum of around 3.4 A.
The –5 V supply rail is used as the reference
voltage for voltage divider R1/R2/P1.
The maximum amount of power that must be dissipated is 120 watts (for example, 3.5 A × 34 V).
Measurement setup for the negative This is rather a lot and calls for a substantial heat sink. We solved this problem by using a fairly
supply small heat sink together with a hefty fan to provide strong forced-air cooling.
The only thing we need to measure the
negative power supply output voltage is The transistors are ST types in a TO-220 package. We chose the TS921IN rail-to-rail device for
an inverting amplifier (IC1d), which atten- the opamp. It can supply enough current (80 mA) to drive the two transistors.
uates the output voltage (maximum value
30 V or more) to match the input range of
the A/D converter. An output voltage range In theory, it should be possible to set the current to just under 4 A with voltage divider P1/R1,
of 0–33 V can be measured with the speci- but the tolerance of the potentiometer may cause the actual value to vary considerably. If the
fied values of R6 and R7 (–3.3 V ÷ 100 × –33 maximum current is insufficient, you can increase the supply voltage a bit (but do not exceed
= 1.089 V). 12 V) or adjust the value of R1.
elektor 06-2010 57
Unilab display
Assembly
Assembling the double-sided PCB shown in
Figure 2 should not present any problems,
since only standard components are used
(i.e. no SMDs). As already mentioned, the
7805 is mounted flat on the PCB and secured
by a screw. With this arrangement, the PCB
provides adequate cooling. You can choose
from various types of trimpots here, either
horizontal or vertical. Figure 3 shows the
Figure 3. The fully assembled prototype. It is fitted with the trimpots specified in the prototype board fitted with the types speci-
components list, but there is enough space available to fit other types. fied in the components list. The 16-way
headers are fitted on the back of the PCB.
The display module has a 16-pin connector
on the back of its circuit board, and it can
be plugged into the header of the assem-
age across the sense resistor must also current for the backlight of the LCD module, bled PCB. The two boards can be fastened
be inverted by the differential amplifier, which can draw more than 100 mA (47 mA securely together using standoffs (12 mm
so the signal from pin 4 of K2 is fed to the in our prototype). The analog supply volt- height).
inverting input of IC1c. The voltage divider age for the microcontroller is separately Suitable software must be loaded into the
ratio (which can be adjusted with P2) must decoupled by a choke and a capacitor (L1 microcontroller before the board is put into
match the ratio of R9 and R8. and C5). All we need for the –5 V supply is service. You can do this yourself by using
For the opamp, we chose a National Semi- a 79L05, since it only has to power the ana- the ISP port to download the software (the
conductor micropower CMOS device with logue circuitry of the input stage. The cur- C source code and hex file are available
rail-to-rail input and output capability. The rent consumption on this supply rail is quite free of charge on the Elektor website under
supply current, speed and bandwidth are low. product # 100166-11), or you can order a
not important here because we are only pre-programmed microcontroller from the
processing DC signals. However, the rail- A standard short-circuit proof transformer Elektor Shop (# 100166-41).
to-rail properties are important, along rated at 3.3 VA is a reasonable choice for
with the low bias current (typically 150 fA, the supply transformer, preferably a type When fitting the two Unilab modules and
so extra compensation is not necessary) and with dual 8-V secondary windings (or the display board in an enclosure, be careful
the excellent temperature coefficient of the alternatively dual 9-V windings). How- to ensure that the plus terminal of connec-
input offsets (only 1.5 µV/°C). The various ever, we took a different approach for our tor K2 on the negative power supply board
input offsets (a few millivolts) are compen- prototype. The transformer for the two is connected to the minus terminal of con-
sated by the calibration procedure. Unilab modules is a toroidal type, and nector K2 on the positive power supply
it’s easy to add a new winding to it. To board by a thick wire. This connection forms
Power supply determine how many turns are needed, the ground reference for the display board.
It’s a good idea to galvanically isolate the you first have to make a winding with a Be sure to replace R15 on the positive
power supply of the display board from the few turns (such as 5 or 10) and then mea- Unilab board by a 5.6-kΩ resistor. In addi-
Unilab modules in order to eliminate poten- sure the voltage. After this you can sim- tion, connector K3 on each Unilab board
tial ground loops. The implementation here ply calculate the number of turns needed must be connected to connector K1 or K2
is straightforward. A transformer with sym- for 8 V, since the transformer has a uni- (respectively) on the display board using
metrical secondary windings, a bridge rec- form magnetic field. You can calculate individual 6-way IDC connectors and 6-way
tifier and smoothing capacitors form the how much wire you need by measuring flat cable. Be sure to get the connections
basis for the symmetrical 5-V supply for the the circumference of the core and adding right! With regard to the remaining wiring
display board. We use a standard 7805 for some more for the leads to the PCB. For of the Unilab supply modules, we suggest
the +5 V supply voltage. To improve heat our prototype, we needed approximately that you consult the article in the April 2010
dissipation, this voltage regulator is fitted 5.5 metres (18.5 feet) of wire for each edition. The only other thing you need to
flat on the PCB without any insulation (the winding (32 turns). We used bifilar wind- do is to connect the two 8-V supply inputs
PCB has copper planes on both sides). Note ing (two wires together) to obtain two of the display board to the supplementary
that the +5 V supply must also provide the identical windings. Use relatively thick power transformer or the additional wind-
58 06-2010 elektor
Unilab display
elektor 06-2010 59
tEST & MeAsUREMENT
High-voltage Probe
Home made and differential, too
By Alfred Hesener (Germany)
Measuring small
differences between high
voltages normally calls for
special ‘differential’ test probes, which
do not come cheap. But you won’t bust your
budget on expensive components building the DIY
solution described below and you’ll pick up plenty of practical
know-how in the process.
Many circuits employ high voltages. The ages of a push-pull amplifier or at switch- tion of the oscilloscope (generally 8 bits
two best-known examples are switch-mode ing nodes in a phase shift full-bridge topol- maximum), so that errors add up. Subtract-
power supplies and vacuum tube circuitry. A ogy transformer (within high output level ing two large, almost identical voltage val-
relatively new application is found in hybrid switch-mode power supplies). ues is always problematic, increasing the
and electric automobiles, which operate risk of measurement errors.
with high battery voltages (and danger- Starting point 3. Since the timing correlation between the
ously high currents) in order to reduce volt- One solution would be to use two standard two measurement channels is related to
age drop and the cross-sectional diameter high-voltage test probes (not too expen- factors such as cabling and earth (ground)
of cabling. sive, with serviceable characteristics) loops and mathematical functions within
Whilst any decent multimeter is adequate together with a digital oscilloscope so as to the oscilloscopes can throw up random and
for measuring high voltages, it’s not so calculate the signal difference using math- deterministic fluctuations, the timing infor-
handy for measuring small fluctuations in ematical functions. This method has three mation of the signal is not very trustworthy,
high DC or AC voltages overlaid on these. disadvantages: particularly at higher signal frequencies.
Frequently, moreover, we are not interested Remedy can be found in the so-called
so much in the absolute value of a high volt- 1. This means using two channels of the ‘high-voltage differential test probe’. This
age as much as in the difference between oscilloscope, which makes it harder to is a probe set enhanced with a differential
two separate high-voltage levels, such as observe several signals simultaneously. amplifier able to accept very high voltages
(for example) the differing anode volt- 2. Both signals are digitised at the resolu- on its inputs and amplify only the voltage
60 09-2010 elektor
tEST & MeAsUREMENT
Characteristics
• Differential attenuation switchable in two stages (–20 dB/–40 dB)
• Bandwidth 1 MHz, switchable limit at 500 kHz
• Maximum input voltage ±1000 V (peak value)
• Maximum output voltage ±10 V (at min. terminating impedance 1 kΩ)
• Common-mode suppression 55 dB at 6 kHz, 35 dB at 600 kHz
difference between the two input connec-
tions, whilst at the same time suppressing
common-mode signals (signals of exactly
the same level on each input). kind provided with commercial differen- The maximum input voltage of about
It might sound as if a simple differential tial test probes was omitted for reasons of ±1000 V was soak-tested in the lab with
amplifier with voltage dividers on its inputs simplicity. constant voltage over an extended period.
could do this job but life is seldom this sim- Bandwidth limitation is important for mea- BNC connectors and suitable HV cables are
ple. For proof just see how expensive com- surements with spurious high-frequency specified for these tests. The input imped-
mercial differential test probes are for this signals, as in switch-mode power supplies. ance of the circuit must likewise be laid out
kind of measurement task. A good example The frequency sweeps are shown in Figure for high voltages. The resistors used (R1 in
is the Tektronix P5200. On the Tek website 1. Figure 3) should be rated for 1600 V (stan-
[1] you’ll find an extremely readable applica- The upper of the two curves indicates the dard resistors are usable up to only 250 V).
tion note [2] on using high-voltage probes. output signal at –20 dB attenuation both Alternatively you can wire several resistors
The maximum input voltage differential is with (in orange) and without (in green) of lower voltage rating in series to divide the
given in the data sheet as ±1300 V and the bandwidth limiting. The blue line is the –40 voltage (assuming all of these resistors have
bandwidth as 25 MHz. Digging deeper into dB setting with the 500 kHz filter switched the same value).
the data, a value of particular interest is the in. As expected, the frequency response One more tip concerning the measurement
CMRR or Common-Mode Rejection Ratio, is very linear, with a maximum cut-off fre- cables: the cabling on the two differential
which is the ability of a differential ampli- quency of approx. 1 MHz. The red line inputs should be as far identical as possible,
fier to reject the portion of the signal com- shows the common-mode output signal since any disparity will unbalance the setup
mon to both the + and – inputs. The impres- relative to the frequency. By calculation this and cause measurement errors. For our pro-
sive value of 80 dB at 60 Hz drops off rapidly gives a CMRR of about 55 dB at low frequen- totype we cut a short coaxial test lead with
at higher frequencies, for instance to 50 dB cies, which falls to about 35 dB at higher fre- BNC connectors into two halves of equal
at 100 kHz, which is pretty good neverthe- quencies. This fall-off starts at around 6 kHz length, with insulated croc clips fixed to the
less. A small differential signal becomes and is caused mainly by parasitic coupling free ends and the transition insulated with
progressively more difficult to measure as inside the test probe. It is further influenced heatshrink tubing (see Figure 2). Because
the frequency of the common-mode signal at higher frequencies by parasitic coupling these cables represent a capacitive load to
rises. A frequency sweep of the common- within the op-amp. the measurement setup, they need to be as
mode signal will indicate that the output
signal increases with the frequency of the
common-mode signal but this is an illusion.
At higher frequencies a greater part of the 0.0
common-mode signal reaches the output
by means of (parasitic) capacitive coupling, -10.0
making it very difficult to improve the CMRR
-20.0
for high frequencies.
-30.0
Test probes and oscilloscopes
Although the oscilloscope is a very handy -40.0
instrument for taking measurements, it
-50.0
can easily lead you astray when you mis-
interpret what’s indicated on the display. -60.0
A whole load of measurement errors can
also occur, so using a differential test probe -70.0
means keeping your wits about you.
-80.0
The specification of our low cost, easy-
to-build differential test probe is shown
-90.0
in the panel ‘Characteristics’. The switch-
able attenuation feature is a boon when -100.0
the differential signal being measured is 10Hz 100Hz 1kHz 10kHz 100kHz 1MHz 10MHz
small and the common-mode signal is very
large. Here we need to ensure that the test
probe remains operating linearly and is not Figure 1. Frequency response at both amplification settings, each with and without the
overdriven. An overload indicator of the 500 kHz filter. The lower curve indicates the common mode suppression.
elektor 09-2010 61
tEST & MeAsUREMENT
62 09-2010 elektor
tEST & MeAsUREMENT
Calibration
Calibration is carried out as follows: is too small you can connect some more 6. Now apply the same signal to both in-
small ceramic capacitors in parallel with the puts and adjust R32 and R32b to make
1. Connect power supply, observe red LED trimmer capacitor. If the trimmer capaci- the output signal as small as possible (the
is lit. Check operating voltages (±15 V) and tor is too large and the input voltage divider smaller the better).
opamp output voltages (a few mV). behaves like a low-pass filter, you can give
the voltage divider a lower impedance (e.g. 7. Repeat steps 5 and 6 several times, as
using 3.3 MΩ for R1 and 16 kΩ for R2). If they are mutually interactive. Take care to
2. Connect oscilloscope to the output (out-
you find it impossible to achieve a proper achieve maximum common-mode suppres-
put terminated in 50 Ω).
square-wave signal you will need to change sion with R32/R32b — this is more impor-
the physical construction (the parasitic ca- tant than producing the precise attenuation
3. Set R31 and R31b in the middle of their pacity is too large). preset by R31 and R31b.
range and connect a 1-kHz square-wave
signal with an amplitude of around 10 VPP It is important to complete steps 3 and 4
4. Adjust the second input in the same way accurately before proceeding with the re-
to one of the two inputs – the exact value is
(square-wave signal on this input only). maining alignment. Without good frequen-
not so important.
cy response at the input voltage divider
The square-wave signal should be visible on
5. Now adjust R31 and R31b so that the stage all the following steps are meaning-
the oscilloscope. Adjust the trimmer capaci-
output voltage corresponds exactly to the less. Signal measurement first on one and
tor on the relevant input for best square-
input voltage attenuated by the factor you then on both inputs should be carried out
wave curve shape. The best method is to
have set. For an input signal of 10 Vpp the repeatedly at various frequencies from DC
apply the square-wave signal to trigger the
output signal should be exactly 1.0 Vpp to HF. This will also give you a good under-
second channel of the oscilloscope and use
with S1 set for –20 dB and 100 mVpp in the standing of how the test probe behaves
this for comparison. If the adjustment range
–40 dB setting. with differing signals.
elektor 09-2010 63
tEST & MeAsUREMENT
+15V
R19 R39
10R
10R
D11 C12
2x
U11; U31 = NE5532
1N4148
100n
X11 8
3
R14
1
U11.A 1k
2
C32
C11 R11
C10 D12 C41 R31b
R12
51k
330p 100n
1k
47p 10k
X1
R13 R31
160R
1k 2 8
C14 R33
1
S2 S1 U31.A 51R
100n 3 JP2
R32b 4 C34
160R
100n
R23 10k
X2
C21 R21 R22
C20 R32
1k
51k
C42 C33
47p D21 330p 1k
6 100n
R24
7
U11.B 1k
5
X21 4
C13
2x
6
1N4148 100n
D22 7
U31.B
5
R18 R38
10R
10R
-15V
U1
78L15
+15V
R51
1k8
C1 C3 C5 C7 ZD1
BC638
L1
C2 C4 C6
5V6
-15V
79L15
090549 - 12
U2
the little module using Q1 and LED L1 for structed on a PCB built into a diecast alu- tors. For this reason the 10 MΩ input resis-
monitoring the two voltages. Close to the minium box. The input stage (left) has cop- tors and their connecting leads should be
opamps the voltages are decoupled once per foil laid below it and shielded from the made safe with heat-shrink tubing.
more using 10 Ω and 100 nF. main differential amplifier on the right, so as The two switches are mounted on the
The PCB layout can be downloaded from the to minimise capacitive coupling. The copper underside of the PCB and are operated from
Elektor website, where you will also find the strips are soldered to the PCB using earth- the lower side of the case housing. At the
component list. ing (grounding) pins. Take care around the upper right-hand corner of the PCB are the
inputs to provide adequate insulation and power supply components and on the right
Figure 6 shows how the circuitry is con- space between the high voltage conduc- the BNC output socket and power supply
64 09-2010 elektor
tEST & MeAsUREMENT
Figure 6. Completed circuitry with the printed circuit board inside the diecast aluminium box.
connector (around ±18 to ±20 V). quency oscillations will be visible on the resistor to ground at the opamp input for
Parasitic capacitance and inductance are oscilloscope. The input capacity of the test the bias current, which increases the outlay
minimized by the use of surface mount probe is certainly small but can neverthe- and worsens the CMRR. A capacitor in series
(SMD) resistors and capacitors. The disad- less, like any capacity, lead to signal deg- with the 10 MΩ input resistor must possess
vantage of the wider tolerances is offset by radation or even oscillation at particularly adequate high-voltage rating, which means
precise adjustment of the trimmers. Our critical points in a circuit. bulky form factor and large inductance.
lab sample, using 5 % tolerance compo- Should the signal under measurement
nents, was successfully aligned to a CMRR appear to be flattened or smoothed off Overall this differential test probe is
of more than 60 dB at low frequencies, above and below, you need to check straightforward to construct and produces a
which corresponds to a resistor tolerance whether the test probe is still operating lin- cost-effective alternative to expensive com-
of below 0.1 %. early or is already being overdriven, because mercial products that will serve you well at
the attenuation is inadequate and/or the frequencies up to 1 MHz. The test probe
Applications and options input signal is too large. Meaningful mea- finds regular use in the author’s lab and is
Commissioning and calibration are surement is impossible with overloading. particularly useful for audio applications.
explained step by step in the panel ‘Calibra- The effective range of the differential test (090549)
tion’. Remember constantly when taking probe can be adjusted by altering the divi-
measurements that high voltages are lethal! sion ratio, for instance to ±100 V for lower [1] www.tek.com
Before altering or touching anything on the voltages. For higher voltages the mechani-
[2] www2.tek.com/cmswpt/tidetails.
test bench, switch off the volts and make cal design must be changed and the insu-
lotr?ct=TI&cs=apn&ci=2343&lc=EN
sure everything is completely dead (capaci- lation improved (e.g. voltage rating of the
tors can retain their charge for a long time!). input connectors).
Always work using one hand alone (keep
the other one in your trouser pocket!). With a capacitor in series with R14 and R24
The high input impedance simplifies use of the DC component of the signal is removed
the test probe and minimizes signal load- entirely, which would enable greater ampli-
ing at the point of measurement. Signal fication for measuring small signals over- The author
level readings taken from the oscilloscope laid on high DC voltages. Capacitors at this Alfred Hesener is a chartered engineer
display should always take into account the stage influence the CMRR very little. employed by Fairchild Semiconductor as
attenuation level selected (–20 or –40 dB). You can also add capacitors between the
Application and Marketing Director for
The selected bandwidth (0.5 or 1 MHz) input divider node points and the opamp
the European market.
determines the extent to which high fre- inputs but then you will need an additional
elektor 09-2010 65
audio, video & photography
The originality of the vision system described in this article lies in the method developed for acquiring
video images — a method that is entirely compatible with the low calculating power of the microcontroller
used and the slow sampling speed offered by its built-in analog/digital converter.
The circuit combines a microcontroller and • detecting movement by comparing two into two interlaced fields of 312.5 lines each
a miniature black-&-white video camera, successive images stored iån RAM — an arrangement that helps reduce image
and acquires and processes very low reso- • recognition of simple shapes by correla- flicker on the screen. Each line is scanned
lution video images in real time. This char- tion with images stored in EEPROM by an electronic ‘paintbrush’ that modu-
acteristic makes it possible to use a cheap • determining the co-ordinates of a bright lates the amplitude of a voltage depending
microcontroller. Very low image resolution spot (sorting and selection of the bright- on the brightness. Synchronizing signals
doesn’t mean mediocre performance, and est group of pixels) for system position are added to indicate the start of a new
in fact proves amply sufficient in applica- steering or servo-control field and the start of scanning a new line
tions such as: • etc. (Figure 1).
• monitoring the presence of an object by The black-&-white video signal The amplitude of the video signal is 1 V.
comparing an image with a reference The video camera is a sensor that breaks the The voltage range between 0 and 0.3 V
image stored in EEPROM image down into 625 lines, or to be precise, is reserved for coding the synchroniz-
66 09-2010 elektor
audio, video & photography
Technical
Characteristics
• PIC16F690 microcontroller
• 18 × 16 pixel B&W video image
• 4 gray levels
• LED illumination
ing signals (line and field sync). The range And finally, digital image processing in real • Relay control
between 0.3 V and 1 V allows coding of the time requires a high calculation speed. • Image comparison
brightness level: a voltage of 0.3 V corre- Thus, in order to perform a simple compar- • Movement detection
sponds to black, while a voltage of 1 V cor- ison between two VGA images (pixel-wise • Serial link
responds to white. subtraction), we need to carry out 640 × • Constructional difficulty: medium
480 = 307,200 operations. If we want to
The usable line scan dura- perform this processing in less than 10 ms,
tion is 52 µs, to which must for example, this implies a basic calculation make do with lower performance, a micro-
be added the 5 µs duration speed of 10 ms / 307,200, or 33 ns controller like the PIC16F690 will do. Run-
of the line sync pulse and the ning at 8 MHz, it offers an instruction cycle
durations of the front and An image processing system normally time of 0.5 µs, and can perform an A/D con-
back porches (5 µs and 2 µs) requires resources that a simple microcon- version in 24 µs. It has 256 bytes of RAM,
which frame the usable sig- troller is unable to offer. However, if we can 256 bytes of EEPROM, and 4,096 words of
nal and make it possible to
delimit each line. Hence the
total duration of one line is
64 µs. picture line
white level
A succession of lines, sepa-
rated by their synchroniz-
ing signals, form the fields,
themselves separated by
0V7
5 5 52 µs 2
Out of each 312.5-line field, only 288 lines line sync
are usable (lines 23–310 for odd fields and 64 µs
090334 - 13
lines 336–623 for even fields), the other
lines being used for encoding the field sync
pulses. Figure 1. The B&W video signal.
elektor 09-2010 67
audio, video & photography
16 16
17 1
18 2
19 3
2
32 16
273 1
274 2
275 3
18
288 16
0 4 5 9 10 11 12 13 14 15 16 17 47 48 49 50 61 62 63
t [us] 090334 - 15
Figure 3. Sampling timing diagram. Each cell corresponds to one of the points in the image. The light blue cells symbolize the duration of
the analogue/digital conversion and thus represent the minimum time to be left between two successive samples. The under-sampled
grid that will form the very low resolution image can be made out.
K2
+5V +5V +5V +5V
R6 +5V
R3 R5 R4 C9
D3 GND
C5 C7 BAT48
100n 10k
100n 100n C10
4k7 4k7 4k7
IC5 GND K3
GND GND MCLR/VPP 1
1
100n PWR 2
VDD
14 19 ICSPDAT 4
8
RC2 RA0
VCC
7 18 ICSPCLK 5
VCC
4 RC3 RA1
GAMMA 3 1 6 17 CLKOUT 6
6 C6 VS CS RC4 RA2
NC VIDEO-OUT 1 2 7 11 4
7 CV O/E OUT RB6 RA3 ICSP
NC 6 5 10 3
5
GAIN JP3 100n RSET BURST
13
RB7 RA4
15
GND
12 8
RB5 RC6
LM1881 S1 S2 JP4 9 5 R7 R8
4
JP1 JP2 R1 R2
VSS
C8 1k 1k
PIC16F690 D4 D5
20
+5V
+5V 2
470u 100n 100n 220u
C12
9V...15 VDC
+
K4
V+
C13 1 16 K6
+ C1+ VCC S1
470R 470R 470R 470R R17 25 VDC
1 1A5 DC
3
3
11 14 1k
T1IN T1OUT 2
10 7 D10
T2IN T2OUT 7
1
12 13
5
4
8
7
2N2219
MAX232N
6
C15
RE1 = HRM1-S-DC5V
47k
+
47k
1u
GND GND GND GND 090334 - 11
Figure 4. The circuit diagram of the project. A few suitable ICs and there you have it!
68 09-2010 elektor
audio, video & photography
flash memory. Given these characteristics, This lets you power the circuit normally and
we can see that the images are going to use the programmer at the same time.
have to be of modest size for us to be able The image detector IC2 is a miniature B&W
to process them using this microcontroller. CMOS camera, powered from 5 V. The sig-
nal produced conforms to the description
given above. Video signal acquisition is per-
Suggested method formed by the microcontroller’s internal
The 24 µs conversion time means sampling ADC via pin 16 (AN4).
at a frequency of 12 MHz is not possible. Jumper JP1 lets us enable gamma correc-
However, this time is of the same order of tion, while JP2 lets us select the camera’s
magnitude as the 64 µs line period. So out image amplification gain.
of this simple observation comes the idea The phono socket (K2) lets us connect a
of acquiring only a single point per line, video monitor so as to display the image
regularly offsetting the sampling moment produced by the camera, or to connect an
with respect to the start of the line. This external camera: this latter option makes it
under-sampling then makes it possible to possible to evaluate the circuit very cheaply,
form a very low resolution image, com- by saving the cost of the CMOS camera,
patible with the resources available to the which in this case will not be fitted to the
Figure 5. The programmer parameters.
microcontroller. PCB. When K2 is not used, JP3 must be fit- Uncheck the ‘Power target circuit from
Sampling one point per line implies a num- ted in order to load the camera video out- MPLAB ICD 2’ box.
ber of points in the image less than or equal put with a 75 Ω resistor.
to the number of lines, i.e. 288 pixels. An IC3, a classic LM1881 [3], in conjunction
image of 18 lines of 16 points (18 × 16 = with the network R2 / C8, has the task of
288) lets us maintain roughly the same pro- extracting the field (VS) and line (CS) syncs smoothed then regulated by linear voltage
portions between image width and height from the video signal, along with the par- regulator IC1.
(Figure 3). ity signal (O/E OUT) used by the microcon-
The memory space required to store the troller to synchronize the sampling data Software
image depends on the number of pixels, of the video image. These signals are con- Using a microcontroller means there’s
and also on the pixel brightness resolu- nected to microcontroller ports RA2, RA5, bound to be software. For performance
tion. Using 2 bits to code the brightness and RB6 respectively. LEDs D6–D9, driven reasons, the software has been written in
level allows us to distinguish four grey lev- by port RC7 (if JP5 is fitted), make it possi- assembler throughout. The detail of the
els, which are enough for functions (parameters and
the applications considered. procedures) is given in the
Thus an image will occupy 2 program source code, which
× 288 = 576 bits, i.e. 72 bytes.
This small size allows three
Movement detection by contains plentiful comments,
available for free download
images to be stored in the
RAM memory and another image comparison from [1].
The main functions of the
three in the EEPROM. software are broken down
into macros and subrou-
Circuit description ble to illuminate the zone where the image tines: the use of subroutines was favoured
The circuit (Figure 4) is based around the is taken. in order to save program memory, but the
PIC16F690 microcontroller (IC5) from Advantage is taken of the asynchronous use of macros (see Table 1) proved neces-
Microchip [2], chosen for its low cost and series interface available in the microcon- sary where the execution time turned out
the very affordable price of the Starter Kit troller to send the image information via to be critical, in particular during the image
PICkit 2 (or 3) used for developing the soft- a serial link. IC4 takes care of the electrical acquisition phase, where the grey level cod-
ware. The 6-way connector K3 is provided conversion to the RS-232 standard. ing steps take a bit of time.
for connecting up the development or Relay RE1 offers the possibility of control- The video signal sampling and pixel grey
microcontroller programming tool. Diode ling an external system — for example, an level coding steps have been optimized:
D3 protects the circuit against the program- alarm. It is driven by port RC5. LED D10 tells the grey level of each pixel is coded while
ming voltage Vpp of 13 V. Before connect- us if the relay is energized or not. the ADC is converting the next pixel, which
ing up the programmer, uncheck the ‘Power The circuit is powered from a mains power saves the 24 µs wait time of the conversion
target circuit from MPLAB ICD 2’ option supply (9–15 V / 200 mA), connected to operation.
(Figure 5) in the programmer configuration. connector K1. The power from the PSU is The basic software illustrates the possibili-
elektor 09-2010 69
audio, video & photography
COMPONENT LIST
Resistors (5%, 0.25W) IC4 = MAX232N, PDIP-16 case K3 = 6-pin pinheader, 0.1 in. lead pitch
R1 = 75Ω IC5 = PIC16F690-I/P, DIP-20 case (e.g. Farnell K4, K5 = 3-way PCB screw terminal block,
R2 = 680kΩ # 1103406) 5mm lead pitch
R3,R4,R5 = 4.7kΩ K6 = 9 way sub-D socket (female), horizontal,
R6 = 10kΩ Miscellaneous PCB mount
R7, R8, R17 = 1kΩ RE1 = Relay, Multicomp type HRM1-S DC5V S1,S2 = pushbutton, e.g. Tyco Electronics type
R9–R12 = 470Ω (e.g. Farnell # 9479937) FSM4JH (Farnell # 1555982)
R13 = 680Ω JP1–JP5 = 2-pin pinheader with jumper, 0.1 in. Sockets for IC3, IC4 and IC5 (8-pin, 16-pin, 20-
R14, R16 = 47kΩ lead pitch pin respectively)
R15 = 1.5kΩ K1 = power supply connector, 2.1mm, hori- PCB, Elektor # 090334-1 (see [1])
zontal, PCB mount
Capacitors K2 = RCA (phono) connector, PCB mount * substitute NTSC version where applicable.
C1 = 470μF 25V radial electrolytic, 10mm
diam.
C2,C3,C5–C10 = 100nF, polyester (MKT), lead
pitch 0.2 in.
C11–C15 = 1μF 16V, radial electrolytic, 5mm
diam.
C4 = 220μF 25V, radial electrolytic, 8mm
diam.
Semiconductor
D1, D2 = 1N4004
D3 = BAT48, Schottky diode, DO-35 case
D4 = LED, red, low current, 3mm
D5 = LED, green, low current, 3mm
D10 = LED, yellow, low current, 3mm
D6–D9 = infrared LED, QED222 (e.g. Farnell #
1652526)
D11 = 1N4148
IC1 = 7805, TO-220 case
IC2 = C-MOS IR camera module (CCIR*) e.g.
Conrad Electronics # C-Cam-01 150001
IC3 = LM1881N/NOPB, DIP-8 case (e.g. Farnell
# 1564700)
70 09-2010 elektor
audio, video & photography
elektor 09-2010 71
ROOMBA
Fortunately, she was willing to sacrifice her Roomba to the cause of encounters an obstacle it takes a different route.
science, and – believe it or not – she was even excited at the pros- After finishing the job (all fully configurable), it returns to its charg-
pect. With a good supply of beverages and a keen photographer on ing station. It has sensors to make sure it doesn’t fall down the
hand, we were able to document the whole process for posterity. stairs. If you turn it upside down, you can see that it’s fitted with
The iRobot Roomba is around 1 foot in diameter and stands 4 inches a roller brush, along with a small rotary brush (side brush) for the
high. It (or should we say ‘she’, since corners. Finally, there’s an optical sensor on top of the Roomba that
it moves so gracefully?) travels enables it to dock smoothly with its base station.
around the room sucking
up everything in its path. Teardown
It comes complete with When teardown time comes, there’s only person on the team who
a charging unit, and it can wield a screwdriver with no sign of hesitation: Jan. Even the
has an extra device threat of docking his pay to cover any resulting damage doesn’t
you can use to hold him back. Now we can see what’s inside: a battery (3 A, 12
create a vir tual cells, 15.57 V) and sensor contacts, the spring-mounted wheels
wall. With its bum- with their own motor (RS 540), a bunch of screws and bushes, and –
per, it automatically of course – lots of dust. The front (steering) wheel has a black
detects any obstacles and white pattern, which makes it easy to
in its path, and when it see whether the Roomba
72 09-2010 elektor
ROOMBA
is moving. We also see another four IR sensors that help keep the
Roomba on the right path.
Some of the dust manages to get past the filter. Apparently it’s a good
idea to clean the Roomba from time to time.
Now we come to the electronics. There’s a sizeable PCB, with as its most prominent
features a WiFi daughterboard with a Freescale MC13202r, an ST ARM7 master micro-
controller that looks after all the operating functions, and a connector for updating the
software. Of course, there’s also a ‘kinda’ control panel
with LED display for setting the time and other functions.
In order to maintain a good working relationship with its
owner, the Roomba can report faults and problems in var-
ious languages. Now we have a big pile of parts, and it’s
time for the miracle: putting it all back together and make
Yolanda happy again.
(100015-I)
elektor 09-2010 73
Things of the past
Advantages to subscribers
Cheaper than 11 issues from the newsstand:
Save 57% off the cover price of $92.45
sues
11 Is e With every issue subscribers get up to 40% discount
c l u d ing th e on selected Elektor products
in
e r d oubl
summ for just No lines, travelling, parking fees or ‘sold out’;
issue 95* Elektor is mailed to you every month
$39. Always up to date – read your copy before
everyone else
* Offer available in US and Canada only. Canada add $11 per year.
VGL-USA-1
Test Equipment
By Gerard Fonte (USA) One important note.
If we were all as rich as Bill Gates we’d each have home laboratories Always (that’s ALWAYS!)
with all the equipment we could imagine. Unfortunately, most of us get a service manual
(including me) never have enough money for half of the things we when you buy your
really need. Here are some tips for stretching that dollar. equipment. If some-
thing goes bad in a few
Play it Again years you will have to fix
Used equipment doesn’t mean used up. Sure, it’s exciting to open it yourself (or spend a
up a box and get that great smell of new plastic. But you’re paying lot of money you don’t
real money for that. Used test equipment, like used cars, can give have, to get it repaired).
you a much better price/performance value. But, like used cars, you Sam’s PhotoFacts used to
have to take some steps to prevent a sour deal. To achieve the best be the main source for these manu-
bargain it’s important to know two things: 1) what you’re buying als. But, again, the internet is making things easier. Some manu-
and 2) who’s the seller. (One additional point: look to the future. facturers will provide them as free downloads. Alternatively, there
It’s cheaper to buy more performance than you need now, than it are various companies that sell CD’s for about $20 (for something
is to buy another piece in the future.) complicated, like an oscilloscope).
Most used equipment simply gives the manufacturer’s model num-
ber and brief description. For example: “Tektronix model 2465, 300 What’s in a Name
MHz Oscilloscope”. You will need to do some research to find out You should stick with the major brands (Hewlett/Packard, Tektro-
other important features (like if it has two channels, delayed sweep, nix, etc) rather than off brands. There are two basic reasons for this.
etc.). However, this is fairly easy to do with the aid of the internet. It The first is that name brands are quality-built and last a long time. (I
is important to realize that slight differences in model number can have a 30 year old H/P Spectrum Analyzer that still works great.) Old
have a huge difference in performance. So, always be sure of exactly Heathkit and Eico instruments were usually assembled by the buyer.
what you are buying. So, their quality is extremely variable. They should be avoided.
The second reason is parts replacement. You will have a much bet-
Who you buy it from matters, too. There are some scrap dealers ter chance of locating some special part if it was made by H/P rather
which will give you a great deal. But there is no return policy and than Dyno-Dyne. Clearly, having a frugal unit is no bargain if it can’t
the seller may not really know if the unit really works at all. The best be make to work.
that they can do is turn it on and verify that the fuse doesn’t blow.
These deals are a gamble, but the price is great. If you have the time Who’s Your Daddy
and skills to repair it, if necessary, this may be a good choice for you. You can always build your own test equipment. While you may not
But for most people, it’s a bad bet. be able to construct your own 500 MHz oscilloscope, you may be
Buying from individuals is questionable. If the person actually used the able to build your own 2-GHz RF Spectrum Analyzer. Check out the
equipment you have a better chance of determining its quality. And, “Poor Man’s Spectrum Analyzer” (www.science-workshop.com). It
you will speak the same language. But, you must remember that many uses TV tuners. I assembled mine in a weekend without needing to
individuals (like used car dealers) buy equipment to sell at a profit. They know much about RF techniques (a long, long time ago in a galaxy
may not be technically adept. They can determine if the device func- far, far away). While it’s not a great instrument (even compared to
tions properly. And they usually have some sort of return policy. my old H/P) it certainly may be good enough for basic testing. The
Then there are companies that resell used equipment. They too, starting price for the kit is around $200.
buy equipment to sell at a profit. However, they have a substantial Building your own test equipment gives you great construction
infrastructure to support them. They can test the equipment and experience that transfers to many other areas. There are lots of new
verify it works. Some can “calibrate to factory specifications”. This ICs from the major houses (Analog Devices, Maxim, National Semi-
means that the piece functions like new. Obviously, this is the thing conductor, Linear Technology) that provide the basic core functions.
to look for, and just as obviously, it costs a bit more. But usually, it’s You probably have to add a controller (read micro-computer) and
worth it. (It’s never good to doubt your test equipment.). This is some signal conditioning. But, if you’re reading this, that’s probably
probably the best choice for hobbyists. The prices are about 30% to not a huge task. For example there’s the Analog AD5934 that mea-
40% of the original price but there is a return policy and the sellers sures the complex impedance (real and imaginary parts) for under
have to sell quality products in order to stay in business. However, $20.00 in unit quantities. Look around, there are a lot of inexpensive
as always, it’s buyer beware. and amazing parts available.
The last group are companies that lease equipment. After a lease
of a year or so, the device is paid off and they sell it. Unfortunately, There are a many more options than paying full price for your test
there’s only about a 20% discount from original price. Often the equipment. Putting in a little up-front research can keep some
original warranty is still in effect and, of course, it works like new. money in your wallet.
This makes more sense for businesses than for enthusiasts. (100548)
elektor 09-2010 75
INFOTAINMENT
Hexadoku
Puzzle with an electronics touch
No matter if your summer was hot and dry, a cool head is required to solve this new edition of our
monthly brain teaser. Enter the right numbers in the puzzle, send the ones in the gray boxes to us and you
automatically enter the prize draw for four Elektor Shop vouchers. Have fun!
The instructions for this puzzle are straightforward. Fully geared to in each column and in each of the 4×4 boxes (marked by the thicker
electronics fans and programmers, the Hexadoku puzzle employs black lines). A number of clues are given in the puzzle and these
the hexadecimal range 0 through F. In the diagram composed of determine the start situation. Correct entries received enter a draw
16 × 16 boxes, enter numbers such that all hexadecimal numbers for a main prize and three lesser prizes. All you need to do is send us
0 through F (that’s 0-9 and A-F) occur once only in each row, once the numbers in the grey boxes.
Prize winners
The solution of the June 2010 Hexadoku is: 6B310.
The $140.00 voucher has been awarded to: Zigor Gómez Arias (Spain).
The $70.00 vouchers have been awarded to: Erik Jansen (Netherlands), Taina Paavilainen (Netherlands) and William Fackrell (USA).
Congratulations everyone!
The competition is not open to employees of Elektor International Media, its business partners and/or associated publishing houses.
76 09-2010 elektor
RETRONICS
Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and
requests are welcomed; please send an email to [email protected]
elektor 09-2010 77
ELEKTORSHOWCASE
To book your showcase space contact Strategic Media Marketing Inc.
Tel. 1-978-281-7708 Fax 1-978-281-7706 Email [email protected]
7 in 1 Scope !
CircuitGear CGR-101™ is a
unique new, low-cost PC-based
instrument which provides the
on m Save 1
0
wit tor con %
o
ELEh coupon trollers
KTO
RMCcode
94
com
Learn Experiment
programming Tel. 1-978-281-7708
ATRIA Technologies Inc Fax 1-978-281-7706
www.atriatechnologies.com Email [email protected]
78 09-2010 elektor
products and services directory
SHOWCASE YOUR COMPANY HERE
Elektor provides you with more ways to • For just $715 ($65,00 per issue for eleven – i.e., product shot, screen shot from your
promote your business with our Showcase issues), Elektor will publish your company website, company logo, catalog cover – or
section -- a permanent feature of the name, website address and a 30-word whatever you choose to showcase.
magazine where you will be able to further description.
highlight your products and services. • For $1100 ($100,00 per issue for eleven Places are limited and spaces will go on a
issues), we will publish the above plus strictly first come, first served basis.
run a 2-inch square, full-color image So please fax back your order today!
High-End
Valve Amplifiers 2
New models and applications
Valve amplifiers have a lively, deep, clear, and expressive sound, and dynamically
NE
they do not appear to have any limitations. Menno van der Veen investigates, W
in a systematic theoretical approach, the reasons for these beautiful properties.
He develops new models for power valves and transformers, thus enabling the
designer to determine the properties of the amplifier during the design process. 420 pages • ISBN 978-0-905705-90-3 • $59.70
You will notice in this book that the author not only writes about amplifier
Elektor US
technique, but tells about the way the development of valve amplifiers can have PO Box 180
an influence on your daily life; even the usefulness of patents is discussed. Vernon, CT 06066
USA
Not only the professional and the DIY-er but everyone Phone: 860-875-2199
who wants to understand valve amplifiers will read Fax: 860-871-0411
E-mail: [email protected]
this book with much pleasure.
elektor 09-2010 79
SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES
Going Strong
A world of electronics Bestseller!
from a single shop! For beginners and experts
50 PIC Microcontroller
projects
This book contains 50 projects for PIC mi-
W!
crocontrollers such as a laser alarm, USB
teasing mouse, eggtimer, guarding a room
NE
using a camera, mains light dimmer, talking
microcontroller and much more. You can
use this book to build the projects for your
own use, but also as a studybook or refer-
ence guide. Several different techniques
are discussed such as relay, RS232, USB,
pulse width modulation, rotary encoder,
interrupts, infrared, analog-digital conver-
sion (and the other way around), 7-segment
display and even CAN bus.
Offer
Limited Period !
for Subscribers
13% DISCOUNteTmber
om/sep
www.elektor.c Fully elaborated electronics projects
309 Circuits
Several case studies included
Use only free or open source software! The present tenth edition of the popular
PIC Cookbook foronce again
Books
Learn to interface and program hardware devices in a wide range of useful applications, using Virtual Instrumentation
contains a comprehensive variety of cir-
cuits, sub-circuits, tips and tricks and de-
ARM7 microcontrollers and the C programming language. Examples covered in full detail include The software simulation of gauges, con-
sign ideas for electronics. Among many
a simple LED to a multi-megabyte SD card running the FAT file system. Interface to LEDs, transis- trol-knobs, meters and indicators which
other inspiring topics, the following cat-
tors, optocouplers, relays, solenoids, switches, keypads, LCD displays, seven segment displays, DC behave just like real hardware components
egories are well presented in this book:
motors, stepper motors, external analogue signals using the ADC, RS-232, RS-485, TWI, USB, SPI on a PC’s screen is known as virtual instru-
test & measurement; RF (radio); comput-
and SD memory cards. Also covered are methods to write programs to operate externally inter- mentation. In this book, the Delphi pro-
ers and peripherals; audio & video; hobby
faced hardware devices, using timers and interrupts, porting FAT file system code for use with an gram is used to create these mimics and PIC
and modelling; microcontrollers; home &
SD memory card, programming the PWM to produce an audio sine wave, programming the PWM based external sensors are connected via a
garden; etcetera.
to speed control a DC motor and more. A chapter on more advanced ARM microcontrollers is in- USB/RS232 converter communication link
cluded with an overview of some of the newest ARM microcontrollers and their features. 432
to pages • ISBN 978-0-905705-69-9
a PC.
£19.95 • US $39.95
250 pages • ISBN 978-0-905705-91-0 • $47.60 264 pages • ISBN 978-0-905705-84-2 • $47.60
80 Prices and item descriptions subject to change. E. & O.E 09-2010 elektor
Power Electronics
in Motor Drives
Principles, Application
and Design
New!
Martin Brown
Microsoft Bestseller!
240 pages • ISBN 978-0-905705-89-7 • $47.60
approved!
A must-have for audiophiles
More information on the
DVD Masterclass High-
Learn more about C# programming and .NET
elektor 09-2010 81
SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES
CD/DVD-ROMs
New!
InterSceptre Bestseller!
(June 2010)
Reign with the Sceptre
In our March issue, we introduced Sceptre, (March 2010)
a fast prototyping system fitted with a 32-
bit microcontroller. Even on its own, this This open-source & open-hardware pro-
Kits & Modules
board will let you produce some great re- ject aims to be more than just a little board
sults, but if we add an extension board to with a big microcontroller and a few use-
110 issues, more than 2,100 articles
make it easier to access all its peripherals, ful peripherals — it seeks to be a fast pro-
DVD Elektor the Sceptre platform becomes downright totyping system. To justify this title, in
powerful. What’s more, if you fit this addition to a very useful little board, we
1990 through 1999 extension board into a suitable case, you’ll also need user-friendly development tools
This DVD-ROM contains the full range of be able right from the start to develop a and libraries that allow fast implementa-
1990-1999 volumes (all 110 issues) of prototype that you can use ‘properly’ in a tion of the board’s peripherals. Ambitio-
Elektor Electronics magazine (PDF). The installation, with no trailing wires or bits of us? Maybe, but nothing should deter you
more than 2,100 separate articles have sticky tape holding everything together. from becoming Master of Embedded Sys-
been classified chronologically by their Now that’s what you call fast, convenient tems Universe with the help of the Elektor
dates of publication (month/year), but are prototyping! Sceptre.
also listed alphabetically by topic.
A comprehensive index enables you to Kit of parts, contains PCB and PCB, populated and tested, test software
search the entire DVD. components loaded
82 Prices and item descriptions subject to change. E. & O.E 09-2010 elektor
$
Bestsellers
Product Shortlist
Books Books
090835-71 .... Kit of parts including PCBs, programmed controllers
and EEPROM ..........................................................www.elektor.com
ISBN 978-0-905705-89-7 ......................... $47.60
Dual Voltage/Current Display
Python programming and GUIs
100166-71 .... Kit of parts incl. PCB, item -41, LCD ..........................................100.00
3 ISBN 978-0-905705-87-3 ......................... $47.60
July/August 2010 (No. 19/20)
PIC Cookbook for Virtual Instrumentation
The Elektor DSP radio
4
Tiny Timer
CD ECD 5
091044-41 .... ATtiny2313, programmed ........................................................12.90 5 ISBN 978-90-5381-159-7 ......................... $40.20
Universal PWM Driver
090856-41 .... PIC16F628-1/P, programmed ....................................................12.90 Reign with the Sceptre
Binary Clock 1 Art. # 090559-91 ................................... $143.60
090187-41 .... PIC165F877-20/P DIP40, programmed .....................................29.90
Elektor DSP Radio
2
USB Tilt Sensor
070829-41 .... ATmega8-16AU (TQFP), programmed .......................................12.90 Art.# 100126-91 ................................... $240.40
090645-91 .... MMA7620 breakout board ........................................................13.80
InterSceptre
3
Bench PSU for PC
090863-41 .... PIC16F616-I/P, programmed ....................................................12.90
Art.# 100174-71 ................................... $187.10
Sailor’s Battery Meter
dsPIC Control Board
090117-41 .... PIC16F690 DIP, programmed ....................................................12.90
Tiny Pulser 4 Art. # 090073-91 ................................... $225.90
090444-41 .... ATTINY13-20P4, programmed ..................................................12.90
UniLab
MicroMinimal Thermometer
090634-41 .... ATTINY13(A)dip8. programmed................................................12.90 5 Art. # 090786-71 ................................... $103.30
Waterproof Bathroom Switch
090537-41 .... ATtiny13A, programmed .........................................................12.90
Lights Control for Model Cars
090834-41 .... Programmed controller ATtiny45 DIP-8 .....................................12.90
Order quickly and securely through
Modeller’s Clock
090023-41 .... PIC18LF1320 I/P DIL18, programmed ........................................12.90 www.elektor.com/shop
Astrolamp
090550-41 .... ATTiny45 DIL8, programmed ....................................................12.90 or use the Order Form near the end
ATM18-DIPATM18-DIP
090896-1 ...... Printed circuit board..................................................................16.00 of the magazine!
Underfloor heating controller
100318-41 .... ATtiny25-20p4DUO8, programmed ..........................................12.90
RGB Synchronizing Fireflies
100358-41 .... ATTINY13(V), programmed ......................................................12.90
Elektor US
PO Box 180
Scope Text
Vernon, CT 06066
100327-41 .... Attiny2313 DIL20, programmed ...............................................12.90
USA
Thermometer with Four-Digit LED Display
Phone: 860-875-2199
080536-41 .... AT89C2051 DIL-20, programmed ..............................................12.90
Fax: 860-871-0411
E-mail: [email protected]
elektor 09-2010 83
COMING ATTRACTIONS next month in elektor
Photo Timer
Many modern digital cameras allow all features to be controlled remotely. Using the
extensive photo timer published in the October 2010 edition, accurately timed photos
can be made with Canon EOS or compatible cameras. A 4-line display shows all settings,
which are also stored in an EEPROM. Optional pre-focusing is available and sound effects
announce the actual ‘shot’.
Article titles and magazine contents subject to change; please check the Magazine tab on www.elektor.com
Elektor UK/European edition: on sale September 23, 2010. Elektor USA edition: published September 10, 2010.
84 09-2010 elektor
Order Form
09-2010
Description
$28.90
METHOD OF PAYMENT
NEW Remit in US $ drawn on a US bank. Please
see next page for ordering information.
ARM Microcontroller Interfacing $47.60
NEW Check or Money Order
Power Electronics in Motor Drives $47.60
NEW Mastercard
High-End Valve Amplifiers 2 $59.70
NEW VISA
50 PIC Microcontroller projects $58.10
NEW Discover
American Express
Sub-total
Prices and item descriptions subject to Shipping & Handling $ 20.00 Send order form to:
change. The publishers reserve the right to (Airmail from Europe)
change prices without prior notification. Elektor US
Prices and item descriptions shown here Total paid PO Box 180
supersede those in previous issues. E. & O.E.
Vernon, CT 06066
USA
Name/Company
Phone: 860-875-2199
Street & No.
Fax: 860-871-0411
E-mail: [email protected]
www.elektor.com
City/State/Zip Country
Tel E-mail
✁
Date – – Signature
EL09
✁
Order Form
09-2010
Mastercard
I would like:
VISA
Standard Subscription for $39.95 (11 issues) Discover
Plus Subscription for $54.95 American Express
(11 issues plus the Elektor Volume 2010 DVD-ROM)
* Offer available in US &
Canada only. Canada
please add $11.00
per year for postage. Expiry date: _________________________
Name/Company
Subscription
Phone: 860-875-2199
Tel E-mail
Fax: 860-871-0411
✁
E-mail: [email protected]
Date – – Signature
EL09 www.elektor.com
ORDERING INFORMATION
Phone: 860-875-2199
Fax: 860-871-0411
Mail: Elektor US
PO Box 180
Vernon, CT 06066
USA
E-mail: [email protected]
On-line at www.elektor.com
Customer service hours: 8:00 AM–4:30 PM Monday–Thursday. Voice mail available at other times.
When leaving a message please be sure to leave a daytime telephone number where we can return your call.
PLEASE NOTE: While we strive to provide the best possible information in this issue, pricing and availability are subject to change
without notice. To find out about current pricing and stock, please call or email customer service.
COMPONENTS
Components for projects appearing in Elektor are usually available from certain advertisers in the magazine. If difficulties in obtaining
components are suspected, a source will normally be identified in the article. Please note, however, that the source(s) given is (are)
not exclusive.
PAYMENT
Orders must be prepaid. We accept checks or money orders (in US $ drawn on a US bank only), VISA, Mastercard, Discover, and
American Express credit cards. We do not accept C.O.D. orders.
We also accept wire transfers. Add $20 to cover fees charged for these transfers.
TERMS OF BUSINESS
Shipping Note: All orders will be shipped from Europe. Please allow 3–4 weeks for delivery. Shipping and handling via airmail:
US $20.00 per order. Returns Damaged or miss-shipped goods may be returned for replacement or refund. All returns must have an
RA #. Call or email customer service to receive an RA# before returning the merchandise and be sure to put the RA# on the outside of
the package. Please save shipping materials for possible carrier inspection. Requests for RA# must be received 30 days from invoice.
Patents Patent protection may exist with respect to circuits, devices, components, and items described in our books and magazines.
Elektor accepts no responsibility or liability for failing to identify such patent or other protection. Copyright All drawing, photo-
graphs, articles, printed circuit boards, programmed integrated circuits, diskettes, and software 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 retrieval
system) without written permission from Elektor. Notwithstanding, printed circuit boards may be produced for private and personal
use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage
suffered by the purchaser whatsoever or howsoever arising out of, or in connection with, the supply of goods or services by Elektor other
than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid with respect to the goods.
All subscriptions begin with the current issue. Expect 3–4 weeks for receipt of
the first issue. Subscriptions, renewals, and change of address should be sent to:
Elektor US
PO Box 180
Vernon, CT 06066
USA
E-mail: [email protected]
For gift subscriptions, please include gift recipient’s name and address as well
as your own, with remittance. A gift card will be sent on request.
Subscriptions may be cancelled at any time for a refund of all unmailed issues.
Elektor US
Jan Buiting MA, Editor
4 Park Street, Vernon, CT 06066, USA
Register today on www.elektor.com/newsletter Email: [email protected]
INDEX OF ADVERTISERS
AP Circuits, Showcase. . . . . . . . . . . www.apcircuits.com . . . . . . . . . . . . . . . . . . . . . . 53, 78 MikroElektronika. . . . . . . . . . . . . . . . www.mikroe.com . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Parallax . . . . . . . . . . . . . . . . . . . . . . www.parallax.com . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
DLP Design . . . . . . . . . . . . . . . . . . . www.dlpdesign.com . . . . . . . . . . . . . . . . . . . . . . . . . 41
ExpressPCB . . . . . . . . . . . . . . . . . . . www.expresspcb.com . . . . . . . . . . . . . . . . . . . . . . . . 13
Showcase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78, 79
EzPCB/V-Module . . . . . . . . . . . . . . . www.v-module.com . . . . . . . . . . . . . . . . . . . . . . . . . 53
WIZnet . . . . . . . . . . . . . . . . . . . . . . . www.wiznettechnology.com. . . . . . . . . . . . . . . . . . . . 88
Future Technology Devices . . . . . . . . www.ftdichip.com . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
elektor 09-2010 87