100% found this document useful (1 vote)
671 views88 pages

09 Us201009 PDF

Uploaded by

Anti-cosmo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
671 views88 pages

09 Us201009 PDF

Uploaded by

Anti-cosmo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

ag es& Embedded • Analog • Audio• Digital • Test & Measurement]

[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

Vision US $ 7.95 - Canada $ 7.95

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

new, low-cost PC-based instrument

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

Mention offer# SBW


Call 1-888-772-3544

PL1012 / PL1216
PS2203/4/5

to get a free Starbucks


WGM-201

CS328
Card with your >$50 order!

While supplies last


2-ch 40/100/200MS/s 8-bit scope Six signal generators in one 100MHz Scope, + Spectrum/Logic Compact compressed-serial output 12/16 input 1kS/s 10/12-bit - not available with
range with 5/10/25MHz. $246 + small; USB-powered unit $227 Analyzer & Signal Generator. $1259+ camera module for any host system. PC-connected voltage logger. any other offers

USB Bus Analyzers 16-Ch Logic Analyzer SPI Bus Analyzer EMC Spectrum Analyzer EMC Spectrum Analyzer Worlds’s Fastest

EMC RF & EMC Spectrum


USB12 / 480+ / 500AG
lu t

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

RF Testing / EMI Tents


PS3423 / KLARI-MOD
Wave Xpress

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

DG3061A / 3101A / 3121A


EL-USB-1/2/3/4

GO !
RI EW
L
MSR145S

RWT320
RTR-50

LD300

Configurable, patented USB-output


Log and display temp, hum, volt, Mini-logger with built-in temp/hum/ Standalone USB temp / hum / volt / Const. current, resistance, 60/100/120MHz USB 14-bit ARB non-contact SAW digital rotary torque
event-time or pulse-counting data pressure/3-axis accel sensors. current loop data logger. $49+ conductance, voltage & power modes with USB RS-232, LAN/GPIB. transducers with integral electronics.

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

46 Tiny samples, big footprint


A few chips was all we ordered and look

20 Virtual Measurements what the mailman left on our doorstep.

and Predictions 46 And dropping by at Elektor…


Multimedia-savvy chips sets from
Computer programs enable you to know in advance if your design will func- TeleChips demoed at Elektor House (built
tion as intended. We compared the measurements made on a real hardware in 1692).
prototype with the simulated data produced by a leading program and drew
our conclusions. 46 Useful spares or toxic waste?
RoHS is viewed upon with horror by many
hobbyists, but is not necessarily evil
bureaucracy.

48 Juggling Audio Bits


No better way of entering the world of
28 Digital Multi-Effects Unit digital audio processing than getting your
hands on a miniDSP board.
Here we prove that it’s possible to generate a variety of effects digitally, includ-
ing reverb, chorus and flanger effects, without having to work yourself to the 54 Dual Voltage/Current Display
bone with DSP programming. The circuit is built around a highly integrated ef- The symmetrical version of the Unilab
fects chip and features an intelligent user interface with an LCD. The result is a power supply is extended with a voltage
treat for the eye and the ear. and current (V/I) readout.

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.

75 Gerard’s Columns: Test Equipment


76 Hexadoku
Our monthly puzzle with an electronics
48 Juggling Audio Bits touch.

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

In this course you will learn how to program an embedded microcontroller.


We will start with the absolute basics and we will go into a lot of detail.
You cannot learn about software without understanding the hardware so we
will also take a close look at the components and schematics. At the end of
the course you will be able to design your own embedded
applications and write the appropriate Your course package:
software for it. • Courseware Ring Binder
c lu d i n g (747 pages)
in

Contents: ni cs wo
rld wi de
• CD-ROM including software
ate

ce
el ec tro

and example files


• Background rtific • Application Board
• Digital Ports
• Serial Communication • Support at Elektor Forum
(RS232) • Elektor Certificate
• Analog Signals
• Pulse Width Modulation Normal price: $645.00
• Timers/Counters/Interrupts Please note: to be able to follow this course,
• Memory E-blocks hardware is required which you may
already have (in part). All relevant products
• LCD Display are available individually but also as
• I²C Communication a set at a discounted price. Please check
www.elektor.com/distancelearning
• SPI Communication for further information.
• USB Communication
• Configuration (Fuses)
• Answers to the assignments
• Appendix

Further information and ordering at


www.elektor.com/distancelearning
Head Office: Copyright Notice not accept responsibility for failing to identify such patent(s)
Elektor International Media b.v. The circuits described in this magazine are for domestic or other protection. The submission of designs or articles
use only. All drawings, photographs, printed circuit board implies permission to the Publisher to alter the text and design,
PO Box 11 NL-6114-ZG Susteren The Netherlands
layouts, programmed integrated circuits, disks, CD-ROMs, and to use the contents in other Elektor International Media
Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 DVDs, software carriers and article texts published in our publications and activities. The Publisher cannot guarantee to
books and magazines (other than third-party advertisements) return any material submitted.
are copyright Elektor International Media b.v. and may not
US Advertising: be reproduced or transmitted in any form or by any means,
Disclaimer
Strategic Media Marketing, Peter Wostrel, including photocopying, scanning an recording, in whole or in
part without prior written permission from the Publisher. Such Prices and descriptions of publication-related items subject to
1187 Washington St., Gloucester MA 01930 USA.
written permission must also be obtained before any part of change. Errors and omissions excluded.
Phone: 978-281-7708, Fax: 978-281-7706 this publication is stored in a retrieval system of any nature.
E-mail: [email protected] Patent protection may exist in respect of circuits, devices,
Advertising rates and terms available on request. components etc. described in this magazine. The Publisher does © Elektor International Media b.v. 2010 Printed in the USA

elektor 09-2010 7

ELEK US1009 Distance Learning EmSec1:7 Sec1:7 30-07-2010 13:21:04


NEWS & NEW PRODUCTS

Low-cost Elnec unveils new series


weatherproof antennas of extremely fast
suit 2.4 GHz applications multiprogramming
Pulse has introduced a new line of low cost, systems
weatherproof antennas for 2.4 GHz devices
used in industrial, smart grid metering, Elnec, a leading manufacturer of device
security, broadband access, and other types programmers, has released a new series of
of machine-to-machine (M2M) applications. extremely fast multiprogramming systems
These robust, high-efficiency, compact optimized for programming NAND and NOR
antennas comply with relevant standards flash memories. These new programmers are
for Bluetooth, WLAN, WiFi, IEEE 802.11b/g, able to decrease programming times of NAND and
ZigBee IEEE 802.15.4, and other systems NOR flash memories up to 70% in comparison to their
operating in the 2.4 GHz ISM band. predecessors. In addition to high programming
speed, these new systems feature broad spectrum
device support; they can program more than
53,000 device types.
The new series of multiprogramming systems, which
are primarily intended to be used to program medium
sized batches of device, comprises the BeeHive 204 and
BeeHive 208S models.
The BeeHive 204 is a concurrent multiprogramming system designed
for high volume production programming with minimum operator
effort. The programmer has four independent programming modules.
Each programming module starts programming when a chip is detected in its socket,
regardless of the state of the other programming modules. For example, three of the
Pulse’s W5001, W5010, and W5011 antennas modules can be carrying out programming, verification or blank checking while the
are ruggedized for operation under severe operator is removing a programmed device from the fourth module and inserting
conditions. They feature IP65 water ingress a blank device. The BeeHive 204 reliably programs a wide range of programmable
protection in accordance with international devices in its ZIF socket, with more than 800 models of socket
standard IEC 60529, UV protection, and the converters available. Programming is also available through
ability to withstand 100 mph wind loading. the ISP connector. Another special feature is that Elnec’s
They have a maximum gain of 1.5 dBi in the software allows two BeeHive 204 programmers to be
2,400 to 2,500 MHz range, an efficiency of connected and operated simultaneously from one
70%, and an operating temperature range PC for even more flexible production.
of –40 °C to 85 °C. The antennas have a Operating as a stand-alone concurrent
small footprint and low profile, measuring multiprogramming system, the BeeHive 208S
only 128 x 18 mm. has eight independent programming modules. Aside
Pulse’s W5001, W5010, and W5011 antennas from having more programming modules, this programmer
are available in three SMA connector con- differs from the BeeHive 204 in its stand-alone operating mode,
figurations: fixed right angle, straight SMA, which means that the programmer does not need to be connected
and RP-SMA. They are packaged in quanti- to a PC while in use. The BeeHive 208S can be controlled easily by a touch
ties of 20 pieces per bag. screen display interacting with the internal Windows XP Embedded operating system.
www.pulseeng.com A 320 GB hard disc drive and software upgrade capability using a flash drive make this
(100555-VII) unit a reliable production solution with no additional costs.
www.elnec.com (100555-IX)

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.

Vinculum-II evaluation modules


- V2DIP1/2 - Miniature VNC2 Development Module with
Single or Dual USB Connectors
- V2-EVAL - Complete Evaluation & Development
Kit for VNC2
- VNC2 Debug Module

USB MADE EASY


www.ftdichip.com
AcAe
Accurate Circuit Engineering
American Standard Circuits
Altium Inc.
AT&S Americas
Bare Board Group
Big C-Dino-Lite Scopes
CAD Design Services
Cadence Design Systems, Inc.
Custom Analytical Services
DownStream Technologies
Elite Sales International
EMA Design Automation
Fidus Systems, Inc.
Flex Interconnect Technology
Intercept Technology
IPC Designers Council
K&F Electronics
LPKF Laser & Electronics
Mentor Graphics
National Instruments
North Bay Technical
Oak-Mitsui Technologies
Overfly Pacific Corporation
Polar Instruments Inc.
Polliwog Corporation
Rogers Corp.
SEP Co. Ltd.
SFM Technology, Inc
Sierra Circuits Inc.
Sigrity Inc.
Taconic
Tsuding Global (USA)
T-Tech Inc.
TTM Technologies
Whizz Systems Inc.
Zero Defects Int'l, LLC
Zuken
Advertisement
ancing, error checking and noise squelching, as well as all transmit
timing, valid data identification, and data stream buffering activi-
ties. This allows a data link to set be set up with a minimum of engi-
neering effort. Each module can be assigned one of eight quasi-
unique addresses, enabling networks with multiple radio links
as long as two modules do not attempt to transmit on the same
channel at the same time. The transmitter has an output power of
10 dBm (10 mW), and the receiver has a sensitivity of –107 dBm.
The modules require a 5-V power supply, drawing just 28 mA for
transmitting and 22 mA for receiving. They have an operating tem-
perature range of –20 °C to +70 °C. The transmitter and receiver
both comply with the EN 300 220-2 and EN 301 489-3 standards.
Key applications for these modules include handheld and portable
Get your
terminals, industrial and commercial telemetry systems, data log-
gers, and in-building environmental monitoring systems.
www.lemosint.com/radiometrix/ (100555-V)
robot rolling
Saelig debuts 12 GHz
TDR/TDT sampling oscilloscope
Saelig Company, Inc. has introduced the PicoScope 9211A, a new,
economical instrument specifically designed for time-domain
reflectometry, providing a low-cost method for analyzing the
real-world characteristics of cables, connectors, circuit boards
and IC packages.
The PicoScope
9211A uses two
independently
programmable
step generators
with 100 ps rise
time to stimulate
the device under
test and samples
a sequence of
transmitted or
reflected pulses
with new
via its 12 GHz sampling inputs to build up an accurate perfor-
mance picture. The results can be usefully displayed as volts,
ohms or reflection coefficient versus time or distance, all at a cost
Pololu
much lower than previously available.
Along with time-domain reflectometry (TDR) and time-domain
transmissometry (TDT) analysis, the PicoScope 9211A can be used
wheels
for mask limit testing against communications standards such as
Ethernet, InfiniBand 2.5G and 5.0G, XAUI, ITU G.703, ANSI T1/102,
RapidIO 1.25G and 3.125G, G.984.2, PCI Express 2.5G and 3.0G, and
Serial ATA 1.5G and 3.0G. Over 150 industry-standard masks are
included with the unit.
The PicoScope 9211A features three trigger inputs: a DC to 1 GHz
direct trigger, a 1 to 10 GHz prescaled trigger, and a 12.3 Mbps to
2.7 Gbps clock recovery trigger, as well as an internal 10 Gbps soft-
ware pattern sync trigger for averaging eye diagrams.
Unlike traditional bulky bench-top instruments, the PicoScope
9211A takes up very little bench space. The analyzer connects to More information at
a Windows PC via its USB 2.0 port, and an Ethernet port is also
provided for remote operation over a network.
www.pololu.com/wheels
http://www.saelig.com/pr/9211a.html (100555-VIII)

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

Build a Scrolling LED Message


Board in One Day
using
the mbed rapid prototyping platform
By Clemens Valens (Elektor France Editor)

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.

So what exactly is mbed?


mbed (pronounced “embed”) is a rapid prototyping platform for
ARM processors, developed and maintained by ARM. Although two
different mbed modules exist, both based on NXP chips, I don’t Figure 1. This is the web page displaying when you open the HTML
think you can still buy the ARM7 one. Other modules using chips file on the mbed module. Create an account and kick off!
from other manufacturers may be expected, but don’t hold your
breath.
At first blush an mbed module just looks like any other microcon- to the mbed login page (if you are connected to the Internet, of
troller evaluation board with some LEDs, a reset button and a USB course), see Figure 1. After creating an account you can start pro-
connector. It’s small (25 ×53 mm), it’s got 40 pins spaced 0.1” and gramming right away, because the compiler (free and for unlimited
there isn’t much on the board besides the processor, five LEDs, a use) is waiting for you online. That’s right, there is nothing to install!
pushbutton and a USB connector. The top side of the board that Plug and play, you are up and running in like five minutes.
is, because when you flip it over you a greeted by a second proces-
sor, a DB83848 Ethernet transceiver and an AT45DB161 16 Mbit But that’s not all. The mbed crew did most of the hard work for you
serial flash memory chip. The second processor, an LPC2148 ARM7 by developing a library that supports all the peripherals of the pro-
(rebranded as ‘mbed interface’ on the current LPC1768 module), is cessor and more. It was probably inspired by Arduino as it imple-
almost as powerful as the main processor and this is where all the ments similar concepts like DigitalIn/Out and AnalogIn/Out. This
innovation is lurking. library lets you concentrate on your application instead of getting
The ‘mbed interface’ makes the module appear on your host com- bogged down in the swamp that goes by the name of Low-Level
puter as an MBED (note the capitals) mass storage device and it con- Register Programming. A real time saver, as ARM processors have
tains one HTML file. When you open the file you are taken directly about a zillion registers.

16 09-2010 elektor
NXP contest primer

This article is meant


as an introduction to the mbed
rapid prototyping system. It is part of the
NXP mbed contest to be launched at Embedded Systems
Conference (ESC) Boston 2010 (USA), September 20-23, and
organised jointly by Elektor and Circuit Cellar. Stay tuned!

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+

can download it as a .zip file for archiving purposes or whatever. L


0V
If your program is not behaving as it is supposed to be, you’re unfor-
tunately more or less on your own. A debugger is not available, V+
R1/R2/G1/G2 Bit 63 Bit 62 Bit 61 Bit 2 Bit 1 Bit 0
although you can add a serial port to the mass storage device so that 0V
you can print debug messages to a terminal on a host computer.
V+
The mbed web site [2] plays an important part in the concept. Apart EN
from the compiler you will find on the web site detailed explana- 0V
100501 - 12
tions of the mbed library functions in the Handbook, sample proj-
ects in the Cookbook, a blog, a forum and more. You can publish
your projects for other users to enjoy (hopefully) as well as import Figure 2. The timing diagram of the 32 line LED panel looks simple
projects from other users into your own project. It’s all very commu- enough. However a subtlety is hidden in the four bit data word R1/
nity-structured and open. The only thing that’s definitely not open R2/G1/G2: R1/G1 control the upper 16 lines of the panel, R2/G2
is the mbed library, which is of course very disappointing. the lower 16 lines. Therefore this pattern has to be repeated only
Why? Because it is now difficult to figure out if the library is efficient 16 times to draw all 32 lines.
or buggy or suited or not for what you are trying to do. The mbed The EN signal controls the power to the LEDs. Activating it (logic
library implements the most common functions deemed useful in Low) for a while after a line has been written gives nicer results than
many cases, but it doesn’t allow you to exploit the processor in all its simply activating it all the time.
glory. Understandable, sure, because if it would, it would be a hell of
a lot more difficult to use, but annoying for those who need to know
how exactly the library tweaks the bits and registers. Of course you
can reverse-engineer the executable and inspect the registers, but have been chosen in such a way that all the peripherals integrated
that sure takes the ‘rapid’ out of the concept. Also, when the library in the controller are accessible, but not all at the same time. If, for
is updated you may have to do it all over again. instance, you need three serial ports, you can’t have an I2C bus as
And now that I am bashing, let me also mention the blue power-on well. The power supply (0 V, 4.5 V to 14 V in, USB 5 V out and 3.3 V
LED on the board that shines so bright that it hurts my eyes even in out), the Ethernet interface and the USB port have dedicated pins,
clear daylight. When will designers finally understand that you do there is a reset input and two IF pins (these are for the USB port of
not have to force ten or so milliamps through a modern LED? A nice the mbed interface, not the target processor and you are not sup-
glow would have been more than sufficient. posed to use them). The remaining 25 pins can be GPIO or allocated
Although the processor has 100 pins, the module only has 40. They to some other function.

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

Hardware versus software


On the left-hand page you can see the measurement results for the measurements carried out on the real-life circuit, while the right-
hand page shows the results of the simulations. On the circuit diagram a number of points (A to F) are indicated that we thought would
be interesting to measure and compare with the simulation. The signals at points A and B should have a phase difference of 90 degrees

[2] Signal at C and D


At point C is the high
frequency square-wave
modulated signal. At point
D is the filtered version
of the signal at C. Due to
the small difference in the
fundamental frequency and
the first and subsequent
harmonics there doesn’t
appear to be much
difference between C and D.

[1] Signal at A and B


The signals at these points should
be the same as the input signal, but
with a phase difference of 90 degrees C6

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

maximum or minimum (depending on

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

R11 R14 R18


9 6 9 IC3D
10k 10k 10k
8 7 8 11 10
C4 IC2C C5 IC2B IC1C
10 5 10
12

10n 100n
IC3C
[3] Signal at E and F R10 R13
8 9
8k2

10k

At point E you can almost recognize


6

the output signal (modulated by


various mixer products). At point
F all redundant RF signals have
been removed from the signal and
the result of the frequency shifter
becomes apparent. The output sine-
wave is slightly distorted, which is
partly caused by the tolerances of the [4] FFT output signal
components used. When we perform an FFT analysis on the input and output
signals it’s easy to see the
frequency shifting that has
taken place. The original
1

.9

signal had a frequency 800m

of 1 kHz, whereas the 700m

output signal was about 600m

1.01 kHz, i.e. it has become V 500m

10 Hz higher, which was 400m

the intention of this 300m

‘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.

[5] Signal at A and B


In the simulation you can
also see that the phase shift
isn’t exactly 90 degrees.
It’s clear that the design
for the phase shifter is a
compromise; the bandwidth
in which the circuit works
‘perfectly’ is limited.

[6] Signal at C and D


Despite the complex RF waveform of
the signal, the SPICE simulator from
Proteus keeps its cool and shows a very
close resemblance to the measured
signal from the actual hardware.

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

IC4A 47n 47n IC4C


3 9
C11
K2 [1] www.labcenter.com
R31
1n8 10k
[2] www.elektor.com/100359
IC5B R29 R30 C35
C15
4 3 1n5
10k

10k

6n8
5

[8] FFT output signal


Even the simulation of the FFT of the
output signal shows an exact 10 Hz
frequency shift... What more could you
[7] Signal at E and F ask for?
There is not much to say about the signal at E and the
filtered output signals.
The only difference is that
the hardware version has
some distortion due to the
component tolerances,
which is something that the
software hasn’t taken into
account in this case.

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

Practical experience with the free


simulation tool LTSpice
information on Spice and a good introduc-
tion to how simulation tools work, see the
October 2006 issue of Elektor [2].

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

simulation results, you can clearly see that


this network has a rather unusual property.
Two simulation results are shown in Fig-
ure 5. For the upper curve, the value of
resistor R2 was set above the critical value
(around 17 kΩ with the indicated com-
ponent values). This circuit generates an
exponentially decaying sine wave signal
after the supply voltage is switched on. This
also explains the name of the circuit: if the
output signal is converted into an acoustic
signal, it sounds like a light tap on a drum
head. However, if the value of R2 is reduced
below the critical value, the circuit produces
an exponentially increasing sine wave sig-
nal as shown in the lower curve, which is
ultimately limited by the maximum output
Figure 5. The attenuation of the oscillation waveform depends on the value of resistor voltage of the opamp.
R2 (see Figure 4). Values below the critical value result in a waveform with increasing
amplitude.
If the value of R2 could be set to exactly the
critical value Rcrit, the circuit would gener-
ate a sine wave signal with constant ampli-
tude. However, this cannot be achieved in
practice.

Figure 6 shows a comparison between the


simulation result and an oscilloscope signal
recorded with an actual implementation
of this circuit. These images demonstrate
the outstanding quality of the simulation
software.

To further illustrate the extensive features


of the simulation tool, a parametric plot is
shown in Figure 7. It represents the output
voltage versus the voltage at test point ‘b’.
You can immediately recognise the phase
shift between the two signals and the time
decay of the signal amplitudes.

Other useful functions


In addition to transient analysis (time
domain analysis), you can generate an
AC analysis with LTSpice. This is useful for
examining the frequency response of a
network.
For this analysis, a tuneable signal generator
must be connected to the input of the net-
work. Here again, test points can be defined
with the virtual probe. Figure 8 shows the
frequency response of the feedback net-
Figure 6. A perfect fit: work of the percussion generator circuit.
simulation result versus waveform measured with real hardware. The middle curve illustrates the situation

26 09-2010 elektor
test & Measurement

when R2 has the critical value, which yields


the narrow impedance notch clearly vis-
ible here. The curves to the left and right
illustrate the situations for oscillation with
decaying or increasing amplitude.

Even more complex circuits can be studied


in detail with the aid of a simulation pro-
gram such as LTSpice. The virtual meas-
urement results are usually astonishingly
close to the results measured with the real
hardware.
However, you should always be aware of Figure 7. A parametric plot of the output voltage versus the voltage at test point ‘b’. The
the limitations of computer simulations. phase shift is clearly visible here.
Although programs such as LTSpice have
reached a high level of maturity, aberra-
tions can always occur in practice. In par-
ticular, it takes considerable effort to fully
model ambient conditions such as electro-
magnetic interference, radiated high fre-
quency interference and noise components
in simulations.
Finally, you should always bear in mind that
Murphy’s Law also applies to simulations: a
circuit that works perfectly as a simulation
can always fail in practice.
On the other hand, a circuit that doesn’t
work properly as a simulation is unlikely to
prove satisfactory in real hardware. Figure 8. LTSpice can also show the frequency response of a network (in this case the
feedback network of the circuit in Figure 4).
(081006-I)

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

Digital Multi-Effects Unit


With 15 configurable sound effects
and a user-friendly HMI
By Hubert Bollig (Germany)

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

isters and so on, you can obtain the full


functionality of an effects unit in the form
of a single IC. This IC is intended to be used
with a user interface consisting of a rotary Figure 1. The FV-1 IC is sound effects processor featuring a DSP core, ADC, DAC and
switch for selecting the effect algorithm additional components. Seven predefined effect algorithms are stored in ROM.

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

The signals from the potentiometers pass


R3
through buffer amplifiers on their way to
+5V K2 the output connectors.
5R6
EN
RS

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

signal applied to pins T0 and S0–S2. The


C2 BP C4 C3 EDIT level on T0 determines whether an internal
100n 22p 8MHz 22p effect algorithm (hard-coded in ROM) or an
090835 - 12 external algorithm (stored in the 24LC32) is
to be used. Diodes D1 and D5–D7 together
with resistors R7 and R19, R20, R21 are
Figure 4. Schematic diagram of the user interface. The LCD module is operated in 4-bit simple level converters from 5 V to 3.3 V.
mode, and connector K2 is connected to K3 on the main board. Diodes D9 and D10 are reserved for future

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
+ +

voltages for POT0–POT2 are generated by

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

IC1, IC6 = TS912AIN


R32

tings, along with the dry/effect mix set-

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

There are two options for sending com-


MIDI

K7

D10

mands to the ATmega to select a preset


D9
R28

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

The implementation of the MIDI port with


an optocoupler is standard. The only thing
OPTO
RES
SCK
MISO

MOSI

PD7
PD6
T0
S0
S1

SCK
MISO
MOSI

PB0

that should be mentioned here is that the


R19 R20 R21
22k 22k 22k
5
3
1

3V3
+9V

K5

optocoupler used for this (a 5N139) is sim-


K8

D7
D6
D5

1N4148
6
4
2

pler and less expensive than the PC900 stip-


3x

ulated by the MIDI specification. The serial


13
12
11

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)

MIDI data is clocked into the INT0 input at


47u
25V

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

The user interface is connected to the 10


C37 + C35
100n

PB7 (XTAL2/TOSC2) 21
PC4 (ADC4/SDA)
PC5 (ADC5/SCL)

AREF
C26
22p
+5V

other serial port (RxD/TxD). Diodes D3 and


PC6 (RESET)

C19
100n
PC3 (ADC3)
PC2 (ADC2)
PC1 (ADC1)
PC0 (ADC0)

22
47u
25V

PD0 (RXD)
PD1 (TXD)

GND

D4 allow the main PCB and the user inter-


C38
100n

face PCB to be powered from separate sup-


2
3

1
28
27
26
25
24
23
1
LF33CV

3
ply voltages. For example, the user inter-
IC10

1N4148
1N4148

D1

face may operate under battery power. Of


2x

D4
2

+5V

3V3
D3

C15

R14

R7
47n

course, it is also possible to power the user


C39 + C36

10k

22k
100n

RES

S2
3V3

K3

interface from the main PCB.


47u
25V

090835 - 11

The circuit of the user interface is straight-


forward. The LCD module is operated in Figure 3. Schematic diagram of the main board, with the buffer amplifiers for the signal
4-bit mode. The input components consist inputs and outputs and the digital potentiometers for dry/effect mixing shown on the
of four buttons and a rotary encoder, which left. The three resistor/capacitor networks in the middle of the diagram convert 5-V PWM
is connected to K1. Pay careful attention to signals into DC control voltages with a range of 0 to 3.3 V.

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

PCB # 090835-1, see [8] K1 = Rotary encoder, e.g. Alps type


or Capacitors EC11E15204aE
Kit of parts # 090835-71, contains alll compo- C1,C2,C5,C6 = 100nF K2 = 3-pin pinheader, lead pitch 0.1 in.
nents including boards and programmed mi- C3,C4 = 22pF K4 = 2-pin pinheader, lead pitch 0.1 in.
crocontrollers, EEPROM, see [8] S1,S2,S3,S4 = pushbutton, Multimec type
Semiconductors 3FTL6
D1 = LED, 3mm, low current LCD1 = LCD 2x16 characters, Displaytech
User Interface IC1 = ATtiny2313-20PU, programmed, Elektor type 162C
Resistors order # 090835-42 [8] PCB, order # 090835-2, see [8])
R1 = 1kΩ IC2 = 7805 or
R2 = 10kΩ Kit of parts # 090835-71, contains alll com-
R3 = 5.6Ω Miscellaneous ponents including boards and programmed
P1 = 10kΩ trimpot X1 = 8MHz quartz crystal microcontrollers, EEPROM, see [8]

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].

Initial operation (090835-I)


As usual, you should power up the circuit

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.

ESC Boston 2010 Tracks Include:


• Aerospace and Military
• Designing with Open Source Software, including Linux and Android
• Developing for Windows Embedded
• Graphics, Display and Lighting
• Industrial, Automation, and Robotics
• Medical
• Multicore and Virtualization
• Multimedia and Signal Processing
• Networking, Connectivity, and Embedded Internet
• Programmable Logic
• Project Management
• Real Time System Development
• Safety and Security
• Software Debugging Techniques
• Systems Integration and Test

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

The Elektor DSP Radio (2)


Antennas and PC software
By Burkhard Kainka (Germany)

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.

Listing 5 The Bascom software runs to over a thou-


sand lines of source code, too much to
Adjustable properties
describe in detail here. However, the pro-
Sub Properties gram includes a large number of ready-
Print “Property” made subroutines with self-explanatory
Input D names that control some of the basic func-
If D = 1 Then Prop = &H1100 ‘FM_DEEMPHASIS tions listed in the Si4735 datasheet (see
If D = 2 Then Prop = &H1105 ‘FM_BLEND_STEREO_THRESHOLD Listing 1).
If D = 3 Then Prop = &H1106 ‘FM_BLEND_MONO_THRESHOLD
If D = 4 Then Prop = &H1300 ‘FM_SOFT_MUTE_RATE The subroutine Am_tune_freq (Listing 2)
If D = 5 Then Prop = &H1302 is worth a closer look. It shows how a com-
‘FM_SOFT_MUTE_MAX_ATTENUATION mand is typically constructed for trans-
If D = 6 Then Prop = &H1303 mission to the Si4735 over the I2C bus:
‘FM_SOFT_MUTE_SNR_THRESHOLD the device responds to address 34. In this
If D = 7 Then Prop = &H1403 instance the command code is &H40. After
‘FM_SEEK_TUNE_SNR_THRESHOLD that come four bytes of parameters, includ-
If D = 8 Then Prop = &H1404 ing the frequency in kilohertz as a more-sig-
‘FM_SEEK_TUNE_RSSI_THRESHOLD nificant and a less-significant byte. The AM
If D = 9 Then Prop = &H3100 ‘AM_DEEMPHASIS tuning command also selects the required
If D = 10 Then Prop = &H3102 ‘AM_CHANNEL_FILTER band via the switching diodes connected to
If D = 11 Then Prop = &H3300 ‘AM_SOFT_MUTE_RATE ports B.0 and C.3.
If D = 12 Then Prop = &H3301 ‘AM_SOFT_MUTE_SLOPE
If D = 13 Then Prop = &H3302 Another aspect of the software worth a look
‘AM_SOFT_MUTE_MAX_ATTENUATION from the point of view of developing spe-
If D = 14 Then Prop = &H3303 cial software for manipulating the receiv-
‘AM_SOFT_MUTE_SNR_THRESHOLD er’s parameters is the way the serial port is
If D = 15 Then Prop = &H3403 ‘AM_SEEK_SNR_THRESHOLD handled. The interface runs at 38.4 kbaud
If N = 16 Then Prop = &H3404 ‘AM_SEEK_RSSI_THRESHOLD and appears to the PC as a virtual COM port
If N = 0 Then Prop = &H4000 ‘Volume (see Listing 3). Each command is headed
Input Dat by a single character. For example, a lower-
Property case ‘f’ results in the subroutine F_control
End Sub being called, which sets a new frequency.
Commands ‘m’ and ‘n’ allow the preset

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

Sub F_control() ‘*** PC I2C commands ****


Sub Pc_control_i2c
Print “Tune”
Print #1 , “I2C”
Input Fin Do
If Am = 1 Then Get #1 , Command ‘I2C write and read to Si4735
If Fin >= 60000 Then If Command = 67 Then ‘”C”
Power_down Get #1 , Bytesout
Get #1 , Bytesin
Waitms 10
For N = 1 To Bytesout
Am = 0 Get #1 , Di2c(n)
Fm_start Next N
Waitms 100 I2cstart
End If I2cwbyte 34
For N = 1 To Bytesout
End If
I2cwbyte Di2c(n)
If Am = 0 Then Next N
If Fin < 60000 Then I2cstop
Power_down If Bytesin > 0 Then
Waitms 10 I2cstart
I2cwbyte 35
Am = 1
While Bytesin > 1
Am_start Bytesin = Bytesin - 1
Waitms 100 I2crbyte D , Ack
End If Put #1 , D
End If Wend
I2crbyte D , Nack
If Am = 1 Then
Put #1 , D
Fam = Fin I2cstop
Am_tune_freq End If
Waitms 250 End If
Am_tune_status If Command = 65 Then ‘LCD Line 1
Input #1 , Text1
End If
Locate 1 , 1
If Am = 0 Then Lcd Text1
Fin = Fin / 10 End If
Ffm = Fin If Command = 66 Then ‘LCD Line 2
Fm_tune_freq Input #1 , Text1
Locate 2 , 1
Waitms 250
Lcd Text1
Fm_tune_status End If
End If Loop
End Sub End Sub

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

a scope that can handle both


analog and digital signals
bus signals from microcontroller circuits are added to that too. Rohde & Schwarz bought the company in 2005 to expand their
You could use a special logic analyser for this, or a scope which product range at the bottom end. And we probably won’t have
can cope with both analogue and digital signals. to tell Elektor readers about the quality (and also the price) of
Some time ago, Hameg made an offer to Elektor, for us to try R&S gear, these are at the top of the range!
out one of their new In recent years Hameg
oscilloscopes for a has expanded their
while. Now, the Elek- product range at the
tor lab is always keen top end with more
to do that. Especially expensive and more
if it concerns one of powerful models. One
the more expensive of the reasons is a bet-
E-LABs INSIDE

products produced by ter fit with the products


Hameg. After making that its big brother R&S
an appointment with has to offer. And it is
Mr. Grimm, he arrived one of these models
a few weeks later at that our designers were
Elektor House with a allowed to test drive for
brand new scope and a while: the HMO 2524.
the necessary accesso- This is a powerful, dig-
ries. He gave an elabo- ital, 4-channel scope
rate demonstration of with an analogue band-
the capabilities of this width of 250 MHz and
scope, after which it a real-time sampling-

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

Know what you’re


measuring
By Thijs Beckers (Elektor Netherlands Editorial)
E-LABs INSIDE

At our editorial offices we receive quite a few submissions


describing ideas and designs for electronic circuits from read-
ers and authors. All submissions are looked at and receive a cur-
sory assessment as to their usefulness and correct operation, as
part of an initial sorting procedure, before putting some serious
effort into it. This also applied to a submission for sorting the
best (audio) capacitor from a collection of capacitors. At first
glance the described method showed much promise: without
special (expensive) test equipment it would be possible to com-
pare the quality of capacitors with each other and select the
better one(s). This looked like a very interesting design to us.
The measuring method is described below.

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

tively) is the ‘reference capacitor’ and the top capacitor (C1 X1

and C3 respectively) is the ‘CUT’ (Capacitor Under Test). The GND C1


CUT
idea behind measuring with a bias voltage is that a polarised
P1 X
electrolytic capacitor will distort (even) more when the voltage X2
Uf Y
across the capacitor is allowed to become negative, which is
potentially the case with an audio signal. By giving the electro- GND
C2
lytic capacitor a sufficiently high bias voltage, a negative voltage MKP-6u6
across its terminals can be prevented.

The oscillator generates a square wave, which is then divided


across both capacitors. The voltage across both capacitors is GND
then visualised using an oscilloscope. By operating the oscillo-
scope in X-Y mode, specific figures are created which depend
on the differences between the capacitors. A ‘perfect’ diagonal
line means that both capacitors are exactly identical, meaning And because we were also unable to find a way, without using
the CUT is of the same quality as the ‘reference capacitor’. Any expensive equipment, to establish whether the difference was
deviation from the diagonal, such as hysteresis, asymmetry or caused be a difference in capacitance, we regrettably had to
non-linearity means that the CUT is different from the refer- reject this article proposal. The problem with this circuit is that
ence capacitor. These differences could conceivably be a larger you do not really know what you are measuring exactly. That
series resistance, dielectric absorption and other non-linearities. makes the proposed method unsuitable for detecting quality
Within this context, it’s obvious that the reference capacitor differences between various types of capacitor.

it’s not possible to establish the quality of a capacitor


with ‘cheap’ equipment
needs to be a specimen of high quality. Unfortunately we have to conclude that for the time being it is
During our measurements in our test set-up the idea looked not possible to establish the quality of a capacitor with 'cheap'
promising. It was indeed possible to clearly see the differences equipment. But we fortunately still have our ears, which we
between different types of capacitors. There was an obvious can use to test the capacitors in the signal path for what is still
non-linear distortion of the diagonal when a tantalum capaci- the most important characteristic in audio circuits: the sound
tor was compared to an MKT type, and the difference between quality.
an MKT and MKP device was clearly smaller than tantalum MKT, (100482)
but still clearly visible.

What we also experienced during these measurements, is that


a difference in capacitance also resulted in an alleged (qual-
ity) deviation. When comparing a 4.7 uF Wima MKP-capaci-
tor (the reference) with a 4.7 uF MKT capacitor the difference G2
became smaller (the 'eye' of the diagonal became narrower) G
A : 100 Hz
when a 100 nF capacitor was connected in parallel with the
X3
MKT device... even when an electrolytic capacitor of 1 uF was GND C3
connected in parallel with the MKT, the difference from the ref- CUT

erence capacitor became smaller. And when making the mea- P2 X


surement using a square wave at high frequency (several hun- +5V R1 X4
Y
100k
dred kHz) very strange things started happening on the scope
screen; at both ends of the diagonal there were strange peaks R2
C4
GND

which could not be explained by any differences between the Bias MKP-6u6
100k

capacitors and which are potentially caused by parasitic induc-


tances in the test set-up.
A (small) difference in capacitance results in such a large devia- GND
GND
tion that we were unable to establish whether we were deal-
ing with a bad capacitor or just a difference in capacitance.

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)

And dropping by at Elektor…


Our position in the centre of Holland near the German border erful boards look interesting
and close to a motorway means that we are often pleased to wel- but the Codecs are protected
come guests from Germany. Recently Harry Sievers, Franz Ruffer by strict licences so we are
and Patrick Schmidt dropped in. They represent the distributor unlikely to see them making
CS&S electronic (www.csselectronic.com). Their company car- an appearance in an Elektor
ries high-tech Korean products including boards from TeleChips multimedia player in the near
using ARM-compatible controllers with multimedia-capable future but stay tuned – we’re
chipsets. They are intended for mass market applications such working on it…
as portable devices and communications equipment. These pow- (090928)

Useful spares or toxic waste?


The Feedback form on the Elektor website is the first place to go if few exceptions we use RoHS compliant components and lead-
you have a question about any of our projects or products (as well free solder. For purely personal use however there is no reason
as giving us feedback on any article that caught your eye). Gen- why you cannot mix RoHS with non-RoHS in the same design
eral technical questions can best be posted on the reader’s forum although the aim of course is to reduce hazardous substances
on our website. There are exceptions though. Unable to find an in the environment”.
E-LABs INSIDE

answer in the forums a reader wrote to us recently with a ques-


tion that’s been bothering him: “I am sure I am not alone in hav- Antoine also recommends using lead-tin solder; it’s easier to
ing a large box of old components lying around under my bench. make a clean joint. Lead-free solder has a higher melting point so
Is it possible to mix newer RoHS compliant components with older we can assume that RoHS compliant components are designed to
non-RoHS components? Any tips from the Elektor lab?” tolerate the higher temperature encountered during the solder-
ing phase but sadly this is not always the case and we still occa-
We put the question to Antoine Authier, head of the laboratory sionally get problems! On the workbench at home the average
here at Elektor: hobbyist isn’t able to control the temperature and recommended
“It depends entirely on whether the components are fitted soldering time to the same degree. In general the older non-RoHS
to equipment which will then go on to be sold commercially. component types that soldered without trouble are likewise in
Here in the Elektor labs our production facilities conform to their RoHS variant also likely to be fairly trouble-free.
the current regulations for commercial production. With very (100220)

46 09-2010 elektor
Review: Audio DSP

Juggling Audio Bits


Audio DSP for DIY applications
By Harry Baggen (Elektor Netherlands Editorial)

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

takes care of the communications between the com-


puter and DSP, using a USB-interface. The board can be
easily connected to other audio components using the
RCA connectors (2 inputs, 4 outputs). The board uses
audiophile quality electrolytic capacitors from Nichi-
con for a minimal influence on the analogue signals.
On each side of the board there is a header for inter-
connecting all the relevant signals to other miniDSP
boards. There is also the option of connecting a
potentiometer, which can be used to control the
volume in the DSP.
If you require digital inputs or outputs (for example,
because you want to go directly from a CD player, or you want to
connect the processed signal in digital form to some other equip-
ment), then your needs are met with the miniDIGI board (Figure 2).
The different boards Here you will find two coaxial and two digital inputs and a coaxial
First, let’s take a look at the hardware. At the core of the miniDSP and optical output. This board is available with and without trans-
board (Figure 1) is a ADAU1701 from Analog Devices. This processor formers for galvanic isolation of the coax connections. The heart of
was developer specifically for audio applications. Most of the calcu- this board consists of a sample-rate converter (SRC43821 from TI)
lations are carried out in 56-bit double precision mode for an accu- which will convert all sample rates up to 216 kHz to 48 kHz, which
rate result. The IC, in addition to the DSP, also contains 24-bit A/D- is the operating sample rate of the DSP. Using a jumper you can
and D/A-converters which operate according to the sigma-delta select which of the 4 inputs is used and another jumper is used to
principle, which ensures a large dynamic range. The program for select which signal is routed to the digital outputs (for example the
the DSP is automatically read from the serial EEPROM on the board input signal or the DSP processed signal). The board can also be
when the power supply it turned on. In addition to the DSP and used to de-jitter an S/PDIF-input signal. The last of the currently
EEPROM the miniDSP board also contains a PIC18F14K50, which available boards is the miniAMP (Figure 3). This board contains

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

a maximum of six corrections (frequency, value, Q factor). Here a


simple bass-boost has been realized.

signal path. The signal-to-noise ratio is at more than 90 dB (linear),


which corresponds to the value that AD specifies for the ADAU1701.
The class-D amplifier on the miniAMP board operates at a frequency
of about 400 kHz (changes slightly based on the applied sample
frequency). The residual of this frequency at the outputs has an
acceptable magnitude of about 100 mVp. The harmonic distortion
in single-ended configuration amounts to about 0.07% at 100 Hz
and 1 kHz/1 W/8 Ω. The output power at 1% THD and 24 V power
supply voltage turns out to be 14.5 W into 4 Ω and 8 W into 8 Ω.
This is very close to the specifications from TI. We didn’t measure
the bridge configuration, but this will certainly deliver 20 W into
8 Ω, as reported in the data sheet for the miniAMP.

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

-90 Very handy


With the miniDSP system you can in a very simple manner and a
-100
20 28.0426 50 100 200 500 1k 2k 5k 10k 20k very short time assemble an audio circuit which would be much
Hz 100453 - 14
more difficult to realize using analog components. Consider an
active crossover filter with delay time correction and a few fre-
Figure 7. MLS-measurement where the time delay between woofer quency corrections. With this system it is done in the blink of an
and tweeter was changed in small steps until the response around eye. You do not require any knowledge of DSPs, but you will need,
the crossover frequency and time delay was measured, Red = no of course, knowledge and experience in the area of filter and loud-
time delay, blue = 0.2 ms time delay, about 7 cm. speaker technology. But this you will need anyway, if you are going
to develop your own loudspeaker systems. The method of directly
changing the settings from your computer works really well and
even encourages you try out many more things than you were per-
input signal. This is followed by a parametric equalizer for each haps originally planning to do. After all the experimenting you can
channel with up to 6 configuration settings. Subsequently we arrive simply build a final version by building the miniDSP board with
at the crossover part where for each driver you can select the cross- power supply and suitable power amplifiers in a loudspeaker box.
over frequency, type of filter and the filter slope. The available fil- And, if after a while you decide that these settings are not quite
ter types are Bessel, Linkwitz-Riley (12, 24 and 48 dB/octave) and ideal, then it is very quick to connect a PC and make the necessary
Butterworth (6 to 48 dB/octave). You can also expand each filter corrections.
to a band-pass type, for example to protect a small woofer from
frequencies that are too low or to combine a two-way system with Despite the extensive capabilities of the miniDSP system it is very
an already existing active sub-woofer. This section is then followed affordable. For most applications you will only need the miniDSP
by the 6-band parametric equalizer, which allows individual correc- board and you’re done for $99 plus $10 for the plug-in. One board
tions to be made for each driver. In the final block you can set the on its own is capable of driving two two-way speaker boxes. How-
attenuation and time delay for each driver. The latter is particularly ever in most cases it will be more convenient to build a miniDSP
important with the Linkwitz-Riley filter type because the woofer and board into each speaker box, in addition, the board has sufficient
tweeter need to have their acoustic centres perfectly above each computing power to implement a four-way filter.
other. The correction has quite a wide range, up to 7.5 ms, that is The audio quality of the miniDSP board is quite good, but we can
equivalent to more than 2.5 m. imagine that some audio enthusiasts are not satisfied with this and
Once all the necessary settings have been made you can click the would prefer to use other A/D- and D/A-converters than those that
green ‘Synchronize’ button and the software will make the connec- are built into the DSP. This is also a possibility with this board, by
tion with the (via the USB-cable connected) miniDSP board. The set- using the I2S-in- and outputs on the miniDSP board. And there are
tings you made are then sent to and stored on the miniDSP board. many more adjustments and options... The most important thing is
The firmware for the DSP is also automatically updated, if that is that with these boards you can very easily make a start with digital
necessary. The green button disappears after synchronising, which audio processing. And all that for a very attractive price!
appears a little strange at first. Is no further synchronisation pos- (100453-I)
sible? There is. After synchronizing, all the changes you now make
are immediately transmitted to the miniDSP board, in other words, Internet Link
you have a ‘live’ connection. So you can experiment to your heart’s www.minidsp.com
content and change all kinds of things. You can, for example, con-
nect a music signal and hear immediately what the effect of each miniDSP, rev A (0,9 V) of rev B (2,0 V): $99.00
individual change is on the sound image. So while experimenting
minDIGI rev A (less S/PDIF-trabsformers): $55.00
with our two-way speaker box we could very easily change the level
of the tweeter while listening to it and even play with the time delay minDIGI rev A (met S/PDIF-trafo’s): $60.00
between woofer and tweeter. A fantastic opportunity for experi- miniAMP: $60.00
menting with DIY loudspeaker systems! When the program on the
Audio plug-ins: $10.00 each
PC is closed the last settings are automatically stored in the memory
on the miniDSP board. Kits of various combinations of boards are available as well.
When you’re done experimenting, you can mount all the boards

52 09-2010 elektor
C Z l c Z h  E g Z h h

:YjXVi^dcCZkZg:cYh#:kZgni]^c\ndjcZZYid`cdlid\ZihiVgiZY#

7n/B^X]VZaEVg`Zg 7n/<^cVHb^i] 7n/L^aa^Vb@VÒ\ 7n/Adj;gZcoZa


>H7C/.,-&-*+&,.'&- >H7C/.,-&-*+&,,%+& >H7C/.,-&-*+&,,%), >H7C/.,-&-*+&,,%%.
$54.95 $44.95 $44.95 $44.95

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

Find these books and more at newnespress.com


lll#cZlcZhegZh h#Xdb
or your favorite online retailer!
Order today!

elektor 09-2010 53
Unilab display

Dual Voltage/Current Display


For a symmetrical Unilab power supply
By Ton Giesberts (Elektor Labs)

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

R21 R22 R23


100n L1
1

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

220u 100n 10u 100n


2

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

• Voltage and current of each supply


output (positive and negative) displayed

• Internal temperature of PS enclosure


also displayed

• Selectable °C or °F temperature
indication

• Signal conditioning circuitry specifically


designed for a dual Unilab power supply

• Software-aided calibration procedure

• Powered by a separate transformer


(2 × 8 V / 3.3 VA)

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.

Measurement setup for the positive


supply
As the positive output voltage can range
from 0 V to approximately 30 V, all we
need in order to measure this voltage is a
voltage divider. It is located on the power
supply board (R15 and P7), but it must first
be adapted to our requirements. By reduc-
ing the value of R15 on the positive supply
Figure 2. The double-sided PCB is exactly the same size as the display module. module board to 5.6 kΩ (preferably using a
0.6-watt metal film resistor), we can use P7
to adjust the voltage on pin 26 of the micro-
controller to less than 1.1 V at the maxi-
Tweaking and shifting one module and the minus output of the mum no-load output voltage. The exact
To build a symmetrical lab power supply, other module forming the neutral terminal value is not especially important, since
you connect two Unilab power supply mod- of the overall power supply. Unfortunately, everything is sorted out by the calibration
ules (# 090786-1 or 090786-71) in series, this makes it difficult to measure the out- procedure.
with the junction of the plus output of the put current of the negative supply, since

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

1.68. With the gain of IC3a in the power


1

P1 3 100R T1 T2
7

supply module and a maximum signal level R3


5

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.

In order to convert the voltage on pin 4 of


K2 into a usable current reading, we need
a bit more than what we use for other sig- ential amplifier using only one opamp. As must bear in mind that the voltage may be
nal processing stages. Although the current we need to be able to handle voltages up to as high as 33 V. At 33 V, the voltage divider
sense signal has the same form as the sig- more than 30 V and the IC supply voltages formed by R10, R11, R12 and P2 causes the
nal for the positive output voltage, here it are only ±5 V, this stage also attenuates the voltage at the inputs of IC1c to be slightly
floats on top of the output voltage. Since signal. This avoids applying voltages to the less than –4 V. To allow the signal level to
we’re already sensing the output voltage, IC that exceed its input voltage range. be adjusted by P3 in the following stage
we can use a differential amplifier (IC1c) to (IC1b) so it lies within the allowable range,
suppress this voltage as a common-mode Component dimensioning around IC1c this stage inverts the output of the differ-
signal. Here we implement a classic differ- requires careful attention. For example, we ential amplifier. This means that the volt-

elektor 06-2010 57
Unilab display

stranded wire with robust plastic insula-


tion for the windings.

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

Alignment and calibration


After assembling the boards and fitting them in switched on: draw 3A from -PSU
the enclosure, you can start the alignment pro- then press S1
1. An Elektor-programmed microcontroller by
cedure for trimpots P1 to P3. Set the positive is fitted in the circuit. The second step determines the values of the
Unilab module to its maximum output voltage two parameters (U1H and U2H) for the maxi-
2. A user-programmed microcontroller is fitted
and measure the voltage on one of the leads of mum output voltages that the supply modules
in the circuit.
ings
R20onofthe
themain transformer.
display board. Adjust P7 to obtain must be able to deliver (25 V max.) and the pa-
3. Calibration has already been performed.
a reading less than 1.1 V (you may (100166-I)
be able to rameter (I1H) for the maximum specified out-
simply leave P7 at its maximum setting). In the first case, provisional parameter values
put current (3 A). If you have built the current
have already been stored in the EEPROM mem-
The next task is to align the current signal con- source described in the inset, you can put it
ory by Elektor, but calibration is still necessary.
ditioning stage. Adjust the output of the posi- to good use here. Otherwise you must pro-
In this case, a message requesting you to press
tive Unilab supply to exactly 0 V and ensure vide the right load resistance (such as twelve
S1 is displayed for 5 seconds after power is
that no load is connected. Adjust P1 to obtain 100-Ω, 10-W resistors connected in parallel) to
switched on. If this time expires without S1 be-
a voltage of exactly 0 V (or slightly higher) at
ing pressed, the display will show the voltages draw a current of 3 A from the negative sup-
the output of IC1a. Then check whether the
and currents, but the readings may not be cor- ply output. To ensure that the output voltage
voltage on R19 is less than 1.1 V when the
rect. As a reminder of this, ‘[uncal]’ is shown at is still exactly 25 V, measure it once again with
output current is 3 A. This does not have to be
the start of the bottom line. This reminder dis- the load connected before pressing S1 again.
done at the maximum output voltage; it can be
appears after calibration has been performed. Pressing S1 now takes you to the third and final
checked just as well at an output level of a few
volts. This way you can use a relatively small If you programmed the microcontroller your- step of the calibration procedure:
load resistor, such as 1 Ω / 10 W with an output self using the ISP port, data is also stored in the
CALIBRATION STEP 3
voltage of 3 V. EEPROM (this is part of the available download) draw 3A from +PSU
and the same course of events occurs as in the then press S1
No alignment is necessary for the negative out-
first situation. However, if you programmed
put voltage. Unfortunately, the alignment of In this step you determine the value of the
the microcontroller in some other manner,
the signal conditioning circuitry for the nega- eighth and final parameter (I2H) by connect-
there is probably no data in the EEPROM. In
tive output current is distinctly more complex. ing a 3 A load to the positive supply output.
this case the display indicates that calibration
First the effect of the negative output voltage The output voltage does not matter as long as
is necessary after the unit is switched on, since
must be suppressed. This is adjusted with P2. In the output current is 3 A. If you use the current
the display cannot present meaningful read-
order to do this properly, we recommend that ings without calibration data. source, always set the current to 0 A before
you build the current source described in the connecting it to the supply or disconnecting
If calibration has been performed, the display
inset (tit also comes in handy during the sub- it (i.e. do not make or break the connection at
shows the correct readings after first present-
sequent software calibration procedure). Now 3 A). Thanks to this third step, only one multi-
ing a welcome message.
connect an ammeter (with a range of 10 A or meter and one current source or load resistor
so) in series with the current source and con- are necessary for the calibration procedure.
nect this arrangement to the negative Unilab Calibration
Press S1 again to save this parameter value.
output to serve as a load. Set the current to Button S1 is used for the calibration procedure. The following message screen is displayed to
exactly 3 A and vary the output voltage back It is not present on the PCB; you must connect conclude the calibration procedure:
and forth over the range of 2 V to 25 V. If ev- an external pushbutton for this purpose. After
erything is OK, the current through the cur- CALIBRATION DONE!
S1 is pressed once, the voltage, current and
press S1
rent source will remain constant. In this case temperature screen is replaced by the mes-
you can disconnect the meter and then use it sage screen for the first step of the calibration After you press S1 the last time, the microcon-
as a voltmeter. Measure the voltage at the out- procedure: troller executes a restart and then presents
put of IC1b or IC1c. Adjust P2 until this voltage the calibrated readings on the display. You can
CALIBRATION STEP 1
remains constant when the output voltage is set outputs to 0V check them with a multimeter. We recom-
varied. Bear in mind that the signal is filtered then press S1 mend that you check the readings after the
by IC3a in the power supply module, so you Pressing S1 stores the values of the first our pa- modules have been fitted in the enclosure and
must always wait a few seconds (or longer) af- rameters, which are used to determine the four repeat the calibration procedure if necessary.
ter each change to allow the voltage to stabi- zero levels. They are labelled U1L, I1L, U2L and
After calibration has been completed, the dis-
lise. Disconnect the load. With the current now I2L in the software, where ‘U1’ represents the
play shows the following message for one sec-
zero, adjust P3 so the voltage on R18 is 0 V (or negative supply module.
ond after the power supply is switched on:
slightly higher). After this you can perform the Press S1 again to display the message screen
calibration procedure. SMPS display v1.0.0
for step 2 of the calibration procedure:
The calibration routine allows for three pos- CALIBRATION STEP 2 Note that the actual version number may be
sible situations when the supply voltage is set outputs to 25V different.

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

short as practically possible.

Circuitry and input design


The circuit (Figure 3) is basically a differen-
tial amplifier using three op-amps, some-
times described in the literature as instru-
mentation amplifiers. A1 and A2 act as
Figure 2. Measurement cable with fully insulated croc clips. high-impedance inputs and amplify differ-
entially, whilst A3 is an actual (classic) differ-
ential amplifier. Our circuit offers an inter-
esting advantage over the classic differen-
Caution: lethal voltages! tial amplifier, however: whilst the CMRR in
Handling high voltages demands setting up properly, proceeding with caution and taking a simple differential amplifier depends on
all necessary safety precautions — even if you’re in a rush and it seems too much of a hassle. the matching of the resistors Z2, it is here
Your life is worth more than rapid results. Before testing a circuit with the type of high- greater by the factor
voltage test probe shown here make sure you are familiar with the safety regulations. For
devices operating at voltages above 50 VAC or 120 VDC testing live circuitry is allowed only γ × (1 + α + ß)
if there are valid reasons why the power cannot be turned off (such as for taking voltage
measurements). Under German law these operations may only be carried out by qualified This, however, creates amplification and
electrical technicians, not by trainees and apprentices. consequently the danger of overload when
a large common-mode signal is present. For
this reason we must configure the amplifi-
cation and input voltage divider to pro-
duce maximum CMRR in the linear operat-
CPar ing range of the op-amp. In the circuit we
selected 1 for the value of α and ß, whilst
U i1
U N1 γ in the two attenuator stages is 0.657 (at
Z2 γ Z2
R1
U1 –40 dB) and 6.57 (at –20 dB). Z1 and Z2
A1
R2 CTr
are set relatively low at 1 kΩ but with the
α Z1
advantage that the influence of parasitic
capacitance in the circuit is reduced.
Uo The formulae for calculating the values are
Z1 A3 set out in the panel ‘Formulae for Figure 3’. In
your calculations ensure that the op-amp out-
put voltages remain in the range ±12 V.
β Z1
R1 and R2 form the input voltage divider. R1
must have high resistance for a high input
R2 CTr
R1 A2 voltage range and low loading on the signal
U2 Z2 γ Z2
under measurement. Because the parasitic
UN2 U i2
capacitance Cpar reduces the division ratio
CPar 090549 - 11 at high frequencies, a trimmer capacitor is
fitted in parallel to R2 for compensation.
We selected 10 MΩ for R1 and 51 kΩ for R2,
Figure 3. Block diagram with input attenuator (left) and instrumentation amplifier (right). allowing a 5-30 pF trimmer to provide com-
pensation. The division ratio is around 198.
Alignment of the trimmers is the same
R2
Input voltage division ratio: DR1,2 = procedure as for other test probes, apply-
R1 + R2
ing a square-wave signal and obtaining the
optimum curve shape. Many oscilloscopes
Output voltage (first opamp): U1 = (1+ α + β ) ×Uin1 × DR1 have a square-wave generator built-in for
this purpose.
Output voltage (second opamp): U 2 = (1+ α + β ) ×Uin 2 × DR2
Construction
Output voltage (test probe): U out = (U1 −U 2 ) × γ Figure 4 shows the construction of the

62 09-2010 elektor
tEST & MeAsUREMENT

input stage. The two input resistors (for


minimising leakage currents) should be
insulated with heatshrink tubing. Additional
ceramic capacitors are wired in parallel with
the two trim-caps, to extend the compen-
sation range.
The complete circuit (apart from the two
10 MΩ input resistors) is shown in Fig-
ure 5. On the left-hand side the two extra
ceramic capacitors can be seen in parallel
with the trimmers, also the second divider
resistor. The diodes at the inputs (D11/12
and D21/22) are for over-voltage protec-
tion; they operate much faster than Zener
diodes and their capacity is far lower. The
high input resistors (10 MΩ) reliably clip Figure 4. Constructing the input stage.
any over-voltages from the diodes plus any
current leakage from the power supply. For
good frequency response it is vital to mini- achieve the best match between amplifi- and the attenuation of the test probe to be
mise parasitic capacitance at nodes in the cation and CMRR, the negative feedback toggled. S2 switches the bandwidth limiting
layout. resistors for U31A take the form of precision using a 330 pF capacitor in parallel with the
The differential amplifier formed by U31A trimpots. The output is terminated with a negative feedback resistors in the first stage.
follows after the amplifiers U11A and U11B 50 Ω resistor. The only special feature of the power sup-
with their negative feedback resistors. To Switch S1 enables the amplification factor ply using voltage regulators U1 and U2 is

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

100u 100u 100n 100n


JP1 5V6
Q1

BC638
L1
C2 C4 C6

100u 100u 100n ZD2

5V6
-15V
79L15
090549 - 12
U2

Figure 5. Full circuit (omitting the two 10 MΩ input resistors).

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

Vision System for Small


Microcontrollers
Few pixels — clear sight

Source : Maas Digital LLC

By André Thiriot (France)

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

field synchronizing signals.


These field synchronizing
signals comprise a succes-
sion of line sync pulses, with black level
the special feature of having a
0V3

different mark/space ratio, making it pos-


sible to differentiate them (Figure 2).

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.

A few calculations before getting


started start of odd # raster
The operation of acquiring an image con-
odd # raster
sists of sampling the video signal, with the
sampling sequence synchronized to the 620 621 622 623 624 625 1 2 3 4 5 6 7
field and line syncs.
Acquiring, storing, and processing video
images require substantial resources. Let’s
take as an example a VGA standard image
start of even # raster
(480 lines of 640 pixels) produced from a
video signal. Capturing 640 pixels in 52 µs even # raster
implies a sampling frequency of 640 / 52 µs,
308 309 310 311 312 313 314 315 316 317 318 319 320
or over 12 MHz.
090334 - 14

Storing a 16-color VGA image coded using 4


bits requires memory space of 640 × 480 × 4
= 1228800 bits, or 153,600 bytes. Figure 2. The difference between two lines.

elektor 09-2010 67
audio, video & photography

SYNC BLANKING IMAGE EOL


1 1
2 2
3 3
1

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

IC2 2 16 GND GND 3


RA5 RC0
IC3
3

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

RB4 RC1 GND


GND

12 8
RB5 RC6
LM1881 S1 S2 JP4 9 5 R7 R8
4

C-Cam-01 RC7 RC5


2

JP1 JP2 R1 R2
VSS

C8 1k 1k
PIC16F690 D4 D5
20

75R 100n 680k D2


1N4004
GND
GND GND +5V
D1 IC1
1N4004 7805
1 3
K1
3
+ C1 C2 C3 + C4
1
2

+5V
+5V 2
470u 100n 100n 220u
C12
9V...15 VDC
+

R9 R10 R11 R12 JP5 IC4 1u +5V GND


2

K4
V+

C13 1 16 K6
+ C1+ VCC S1
470R 470R 470R 470R R17 25 VDC
1 1A5 DC
3
3

D6 D7 D8 D9 1u C1- 6 D11 RE1


2

11 14 1k
T1IN T1OUT 2
10 7 D10
T2IN T2OUT 7
1

12 13
5
4
8
7

R1OUT R1IN 3 R15


9 8 K5
R2OUT R2IN 8
C14 4 + C11 1N4148
T1 + C2+ 4
R13 1k5 T2 25 VDC
1u 9 1A5 DC
5 15
1u C2- GND 5
R14 680R
2N2219 S2 R16
V-

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

Table 1. List of functions available for managing the vision system.


Type Name Function
Macro MACRO_LineSync Wait for line sync
Macro MACRO_DPixelAcquisition2Bits Launches acquisition of pixel n and grey-level conversion of pixel n-1
Function Start Main program comprising the initialization phase and the primary loop
Decimal to ASCII conversion: returns the ASCII codes of the three digits of the decimal value to
Function BinASCII
be converted (hundreds, tens, units)
Function Bin2Colour2Bits Converts a grey level (0–3) into the ASCII code used to represent it (32, 176, 177, 178)
Function CharTrans Transmits a character over the serial link
Function PictureRamToEeprom Copies the image stored in RAM to the EEPROM
Function PictureEepromToRam Copies the image stored in EEPROM to the RAM
Function PictureCompare Compares the two images stored in RAM and in EEPROM
Calculates the distance (absolute value of difference in brightness level) between four groups
Function PixelGroupDistCalc
of two pixels
Function PictureAcquisition Acquires an image of 288 points organized as 18 lines of 16 pixels coded using four gray levels
Transmits the three ASCII codes representing the three digits of a decimal value over the serial
Function DecimalValueTransmission
link
Transmits the image stored in RAM over the serial link, with each pixel represented by the
Function PictureTransmissionBIT
ASCII character corresponding to its gray level.

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

ties offered by the vision system. This soft- Conclusion


ware performs the following operations: Despite its modest features, this circuit
opens the door to a great deal of experi-
• acquires and stores a 288-pixel image mentation and even practical applications.
in RAM For example, the author experimented
• transmits the image in ASCII format over with the object presence detecting soft-
the serial link ware while looking for a way of detect-
• compares the image stored in RAM with ing the presence of letters and packets in
the image stored in EEPROM a letter-box, rather than the event of their
• sends back the result of the image com- being put into the box. To achieve this, a
parison over the serial link patterned background (checkerboard or
• controls the lighting LEDs concentric squares) is placed at the back of
the letter-box, monitored at regular inter-
The two images stored in RAM and in vals by the vision system mounted in the
EEPROM are compared pixel by pixel. The top of the box. The image is compared with
comparison method used consists in accu- a reference image stored in EEPROM when
mulating the differences in the pixel bright- the system is installed. There’s no daylight
ness values. The sum total of these differ- in the letter-box, so the inside is illuminated
ences is then compared with a threshold in by the circuit’s LEDs while a new image is
order to decide whether to set off an alarm being acquired. Inserting a letter or packet
or not. modifies the image seen by the system, set-
The image is sent back over the serial link ting off an alarm which continues for as long
in ASCII format (19,200 baud, 1 start bit, as the object inserted remains in the box.
8 data bits, no parity, 1 stop bit) so that a This alarm goes off when the post is col- Figure 6. The video image in
simple terminal (like a HyperTerminal) can lected and the box is empty again. HyperTerminal. Can you guess what it’s of?
be used to view the image (Figure 6). The Now it’s your turn to dream up other appli- (A small square within a larger square.)
four grey levels that each pixel can have are cations, which you can share with Elektor
coded using the four extended ASCII codes readers!
with values 32, 176, 177, and 178. (090334)

Pressing button S2 lets us store Internet Links


the latest image acquired and [1] www.elektor.com/090334
stored in RAM into the EEPROM;
[2] ww1.microchip.com/downloads/en/
pressing button S1 lets us send
the image stored in EEPROM back DeviceDoc/41262E.pdf
up the serial link. LED D5 [3] www.national.com/ds/LM/LM1881.pdf
flashes whenever
either of the
buttons is
pressed,
LED D4
indi-
cates
the
start
and end of
image acquisition.
D10 lights when the relay is
energized.
JP4 allows the software to use the lighting
LEDs. JP5 allows the hardware to use the
lighting LEDs — the difference is a subtle
one.

elektor 09-2010 71
ROOMBA

Make Room for the Roomba!


Elektor Teardown Session
By Wisse Hettinga (Elektor Editorial)

Without question, one of the duties we enjoy the most


at Elektor is organizing teardown parties, where the only
objective is to take something apart. There’s nothing
more fun or exciting than attacking a piece of equipment
(preferably something expensive) with a screwdriver
and a hobby knife, and with the vague expectation
that we we’ll be able put it all back together afterward.
This time we wanted to have a closer look at a robot
vacuum cleaner, and one of our colleagues in Customer
Service just happened to have one. Yolanda! How about
loaning us your hoover for a little experiment?

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.

All’s well that ends well, as they say.

With its update connector, the Roomba naturally lends


itself to updating or reconfiguring the software. You can
find all sorts of tweaks and hacks on the Web that let you
use the Roomba for other purposes, such as a musical
instrument. You can even turn it into a fighting machine,
as illustrated at ….
- http://roomba.pbwiki.com
- www.makezine.com/blog/archive/2006/03/videos_from_roomba_fights.html
- http://todbot.com/blog/2006/05/03/roombamidi-roomba-as-midi-instrument

(100015-I)

elektor 09-2010 73
Things of the past

Elektor is now & tomorrow

Secure a head start in electronics


with a subscription!

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

www.elektor.com/usa • Phone 860-875-2199


Or use the subscription order form near the end of the magazine.
gerard’s columns

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.

Solve Hexadoku and win! Participate!


Correct solutions received from the entire Elektor readership automati- Before October 1, 2010, send your solution (the numbers in the gray
cally enter a prize draw for one Elektor Shop voucher worth $140.00* boxes) by email, fax or post to
and three Elektor Shop Vouchers worth $70.00* each, which should Elektor Hexadoku – 4 Park Road – Vernon CT 06666
encourage all Elektor readers to participate.
USA.
* subject to exchange rate.
Fax 860 8751-0411 Email: [email protected]

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

Delay-line Digital Memory


(ca. 1968)
By Jean Herman (Belgium) a special type of glass that has
a high lead content, to obtain
In November 1968, the Belgian the lowest possible acoustic
company MBLE (Manufacture (ultrasonic) propagation speed.
Belge de Lampes et de Maté- Two ultrasonic transducers are
riel Electronique) published an bonded to the same 40 mm end
article in its “Special new tech- of an 80 × 40 × 8 mm oblong slab
niques” magazine presenting a of glass. Under the transducers,
new device: a delay line capable the glass is angled at 7.5° so that
of memorizing digital informa- the transducers are perpendicu-
tion for logic and calculation. The lar to the reflection paths. One
device was similar to the delay piezoelectric transducer emits
lines used in TV color decod- pulses and the other receives
ers, but complete with all the them.
electronics needed to make it Internal reflection takes place
work. This was not a new discov- between the two 40 mm ends
ery, as digital computers were of the slab of glass, so the dis-
already using bulky delay lines tance between the transducers is
that employed a column of mer- 2 × 80 mm = 160 mm. An ultra-
cury or any other substance intended to delay infor- sonic bit travels this distance in 64.5 µs. Calculating
mation. But MBLE’s innovation was to have made it back from this, the sound waves travel at a speed of
into a reliable, stable, and quite accurate device, in 0.16 m/64.5 µs = 2,480.6 m/s.
a standard, interchangeable module. Three mod- Obviously, the long 160 mm path through the glass
ules were available: the GDM11 with a capacity of attenuates the signals. The voltage attenuation mea-
256 bits, a binary data rate of 0.5 MHz and a delay sured between the piezo transducers is around 6 dB.
of 515 µs; the GDM12 (256 bits, 0.5 or 4 MHz, 515 or A BSX20 transistor amplifies the echo received and
64.5 µs); and the GDM21 (256 bits, 4 MHz, 64.5 µs). The brings it up to TTL level.
GDM11 and GDM21 modules were master mod- The 256-bit word is continuously re-injected into the glass
ules, the GDM12 was a and is controlled by memory management logic. The signal attenu-
slave module. ation is an advantage, since the initial pulse is propagated
To increase mem- in several ways throughout the whole of the
o r y c a pa ci t y, glass slab, but is no lon-
several modules ger of sufficient
could be used in amplitude to
series. This was interfere with
the simplest the working
solution, but in of the system.
practice, one soon In reality, the emit-
found oneself limited by ting transducer generates a
the accuracy of each delay line. In series, the longitudinal wave perpendicular to the
delay time error is cumulative. So the commonest method was transducer, but also a transverse wave at a differ-
to use the modules in parallel, where there is no limit to the capac- ent speed (around half the speed) which might interfere with the
ity. To achieve perfect synchronization of the modules, they used a main wave.
common clock pulse from the single master module, making it pos- In 1968, one had to be very sparing with the precious memory
sible to use just one bit-rate frequency converter for all the modules. capacity. I have worked with large computers that managed a whole
This type of memory has been used in calculating machines or small great rolling mill and yet only used 16 KB of memory! I have also
computers, as an analog/digital converter buffer, in digital machine had occasion to repair Schneider calculating machines that used
tools, as a screen memory for CRT displays, etc. this delay line.
The material used for transmitting and holding the information is (100081-I)

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

5 Oscilloscopes features of seven devices in


one USB-powered compact box:
5 Power Supplies 2-ch 10-bit 20MS/sec 2MHz

5 Spectrum Analyzers oscilloscope, 2-ch spectrum-


analyzer, 3MHz 8-bit arbitrary-waveform/standard-
5 RF Instruments function generator with 8 digital I/O lines. It also

5 Programmable functions as a Network Analyzer, a Noise Generator


and a PWM Output source. What’s more – its
Measuring Instruments open-source software runs with Windows, Linux
and Mac OS’s! Only $199
HAPRO Electronics 1-888-7SAELIG
Tel: +1-516-794-4080 [email protected]
[email protected] www.saelig.com
www.haproelectronics.com

on m Save 1
0
wit tor con %
o
ELEh coupon trollers
KTO
RMCcode
94

Robot chassis, wheels,


casters, motors & servos
$49.95
Jrk USB motor controller
RP5 chassis with feedback
$49.95
Controllers, sensors,
cables, batteries & more!

Plastic SMT stencils &


custom laser cutting

www.pololu.com Microcontroller modules


Communications modules
Support modules
TO BOOK YOUR
www.
Accessories
Kits available.
With BASIC On Board — development tools SHOWCASE SPACE
and compilers are no longer necessary.
CONTACT STRATEGIC
elektor. Prototypes
quickly and easily
Explore
microcontrollers
MEDIA MARKETING INC.

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!

I wish to promote my company, please book my space:


• Text insertion only for $715 • Text and photo for $1,100
NAME: ..................................................................................................... ORGANISATION: .......................................................................................
JOB TITLE: ......................................................................................................................................................................................................................
ADDRESS: .......................................................................................................................................................................................................................
...........................................................................................................................................................................................................................................
................................................................................................................... TEL: ..............................................................................................................
PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 1-978-281-7706
COMPANY NAME .........................................................................................................................................................................................................
WEB ADDRESS ..............................................................................................................................................................................................................
30-WORD DESCRIPTION .............................................................................................................................................................................................
...........................................................................................................................................................................................................................................
...........................................................................................................................................................................................................................................
...........................................................................................................................................................................................................................................
...........................................................................................................................................................................................................................................

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.

Further information and ordering at www.elektor.com/shop

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.

440 pages • ISBN 978-0-905705-88-0 •$58.10

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

ARM Microcontroller Interfacing ‘30x Circuits’ series of 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

75 Audio designs for home construction

DVD The Audio


Get started quickly and proceed rapidly Principles, Application and Design Collection 3
Python Programming Power Electronics A unique DVD for the true audio lover,
containing more than 75 different audio
and GUIs in Motor Drives circuits from the volumes 2002-2008
This book is aimed at people who want to This book is aimed at people who want to of Elektor. The articles on the DVD-ROM
interface PCs with hardware projects us- understand how AC inverter drives work cover Amplifiers, Digital Audio, Loud-
ing graphic user interfaces. The program- and how they are used in industry. The speakers, PC Audio, Test & Measurement
ming language used is Python, an book is much more about the practical de- and Valves. Highlights include the ClariTy
object-oriented scripting language. The sign and application of drives than about 2x300 W Class-T amplifier, High-End
book guides you through starting with the mathematical principles behind them. Power Amp, Digital VU Meter, Valve Sound
Linux by way of a free downloadable, live The key principles of power electronics are Converter, paX Power Amplifier, Active
bootable distribution that can be ported described and presented in a simple way. Loudspeaker System, MP3 preamp and
around different computers without re- The detailed electronics of DC and AC drive much more. Using the included Adobe
quiring hard drive installation. Practical are explained, together with the Reader you are able to browse the articles
demonstration circuits and downloadable, theoretical background and the practical on your computer, as well as print texts,
full software examples are presented that design issues such as cooling and protec- circuit diagrams and PCB layouts.
can be the basis for further projects. tion. An important part of the book gives
ISBN 978-90-5381-263-1 • $28.90
details of the features and functions often
224 pages • ISBN 978-0-905705-87-3• $47.60
found in AC drives, and gives practical
advice on how and where to use these.
A wide range of drive applications are
described from fresh water pumping to
baggage handling systems. Anyone who
uses or installs drives, or is just interested
in how these powerful electronic products
operate and control modern industry
will find this book fascinating and infor-
mative.

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

C# 2008 and .NET Elektor Website:


End Valve Amplifiers
programming www.elektor.com
CD/DVD-ROMs

In this Masterclass Menno van der Veen


This book is aimed at Engineers and Scien- will examine the predictability and per-
tists who want to learn about the .NET en- Elektor US ceptibility of the specifications of valve
vironment and C# programming or who PO Box 180 amplifiers. The DVD represents 3.5 hours
have an interest in interfacing hardware to Vernon, CT 06066 of video material. Bonus elements on the
a PC. The book covers the Visual Studio USA DVD include the complete PowerPoint
2008 development environment, the .NET presentation (74 slides), scanned over-
Phone: 860-875-2199
framework and C# programming language head sheets (22 pcs), AES Publications
Fax: 860-871-0411
from data types and program flow to more mentioned during the Masterclass. Not
advanced concepts including object orien- E-mail: [email protected] forgetting the bombshell: 25 Elektor pub-
ted programming. lications about valves.

240 pages • ISBN 978-0-905705-81-1 • $47.60 ISBN 978-0-905705-86-6 • $40.20

elektor 09-2010 81
SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES
CD/DVD-ROMs

New!

The Elektor DSP radio dsPIC Control Board


(July/August 2010) (May 2010)
See the light on Solid State Lighting
Many radio amateurs in practice use two This control board has been designed for
DVD LED Toolbox receivers, one portable and the other a incorporation into typical industrial elec-
This DVD-ROM contains carefully-sorted fixed receiver with a PC control facility. tronics applications like controlling mo-
comprehensive technical documentation The Elektor DSP radio can operate in ei- tors or adjustment of static up- or
about and around LEDs. For standard mod- ther capacity, with a USB interface giving down-converters.The objectives were to
els, and for a selection of LED modules, this the option of PC control. An additional obtain a board with a large number of pul-
Toolbox gathers together data sheets from feature of the USB interface is that it can sewidth modulation (PWM) generators,
all the manufacturers, application notes, be used as the source of power for the re- which enables us to control several mo-
design guides, white papers and so on. It ceiver, the audio output being connected tors and static converters at the same
offers several hundred drivers for power- to the PC’s powered speakers. To allow time. The cost of the control board nee-
ing and controlling LEDs in different con- portable 6 V battery operation the circuit ded to be as low as possible too. In addi-
figurations, along with ready-to-use also provides for an audio amplifier with tion, it must be possible to construct the
modules (power supply units, DMX con- one or two loudspeakers. board using a soldering iron, without re-
trollers, dimmers, etc.). In addition to opti- quiring use of a reflow oven.
cal systems, light detectors, hardware, PCB, assembled and tested
etc., this DVD also addresses the main PCB, populated and tested
Art.# 100126-91 • $240.40
shortcoming of power LEDs: heating. This
Art.# 090073-91 • $225.90
DVD contains more than 100 Elektor arti-
cles on the subject of LEDs.

ISBN 978-90-5381-245-7 • $46.00

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

ISBN 978-0-905705-76-7 • $100.00 Art.# 100174-71 • $187.10 Art.# 090559-91• $143.60

82 Prices and item descriptions subject to change. E. & O.E 09-2010 elektor
$

Bestsellers
Product Shortlist

September 2010 (No. 21)


Elektor Project Case
100500-71 .... Predrilled Lexan sheets with standoffs .......................................24.10
Digital Multi-Effects Unit 50 PIC Microcontroller projects
090835-31 .... EEPROM 24LC32..........................................................................6.50
090835-41 .... ATmega8-16PU.........................................................................13.40
1 ISBN 978-0-905705-88-0 ......................... $58.10

090835-42 .... ATtiny2313-20PU......................................................................13.40


Power Electronics in Motor Drives
2

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

Kits & Mo- CD-ROMs


100126-41 .... ATmega168 PU .........................................................................20.20 ISBN 978-0-905705-84-2 ......................... $47.60
100126-91 .... PCB, assembled and tested ......................................................240.40
C# 2008 and .NET programming
Daggerboard Position Detector
080307-41 .... PIC16F628A-DIL-18, programmed ............................................12.90 5 ISBN 978-0-905705-81-1 ......................... $47.60
PIC RJ-45 Cable Tester Masterclass

1 DVD High-End Valve Amplifiers

Kits & Modules CD/DVD-ROMs


090643-41 .... PIC16F72, programmed ...........................................................12.90
3D LED Pyramid ISBN 978-0-905705-86-6 ........................ $40.20
090940-41 .... ATtiny2313-20SU, programmed ...............................................12.90
DVD LED Toolbox
Digital Thumbwheel Switch
090538-41 .... ATtiny2313 dip20, programmed ...............................................12.90
2 ISBN 978-90-5381-245-7 ......................... $46.00
Whistler: Electronic Trainer/Coach
DVD Elektor 2009
100203-41 .... PIC16F88 DIP18, programmed ..................................................12.90
Solar Cell Battery Charger/Monitor
3 ISBN 978-90-5381-251-8 ......................... $28.30
090544-41 .... PIC16F877A, programmed........................................................26.70
DVD Elektor 1990 through 1999
Universal Timer with Zero Standby Current
090534-41 .... ATTiny2313, programmed ........................................................12.90
4 ISBN 978-0-905705-76-7 ....................... $100.00

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

Current Clamps Compared


Although a multimeter is an extremely useful and versatile instrument, the range of the
ammeter section usually ends at about 10 A. For larger currents you should use a so-called
clamp that can easily handle 100 A or even 1000 A. In the October 2010 edition we describe
our experiences with twenty current clamp meters from different price ranges, varying
from tens of dollars to about 500 dollars.

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’.

NE5532 Power Amplifier


In this article Elektor’s ‘off the beaten track’ approach to electronics flourishes. Sure, the
NE5532 opamp is widely used in audio applications but it’s less well known that an inter-
esting power amplifier can be made by connecting enough of them in parallel. For this
project 32 NE5532s are bundled to make a quality amplifier with an output power of about
15 watts into 8 ohms. The first installment of the article describes the design philosophy
and the schematics of this remarkable audio power amp.

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.

ww.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor.com ww


Elektor on the web
All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be
instantly viewed to help you positively identify an article. Article related items are also shown, including software downloads, circuit
boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded.
In the Elektor Shop you’ll find all other products sold by the
publishers, like CD-ROMs, DVDs, kits, modules, equipment,
tools and books. A powerful search function allows you to
search for items and references across the entire website.

Also on the Elektor website:


• Electronics news and Elektor announcements
• Readers Forum
• PCB, software and e-magazine downloads
• Time limited offers
• FAQ, Author Guidelines and Contact

84 09-2010 elektor
Order Form
09-2010
Description

DVD The Audio Collection 3


Price each Qty. Total Order Code

$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

Expiry date: _________________________

Verification code: _____________________

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

Yes, I want to subscribe METHOD OF PAYMENT


Remit in US $ drawn on a US bank. Please
see next page for ordering information.
to Elektor US for 1 year* Check or Money Order

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: _________________________

Verification code: _____________________

Name/Company
Subscription

Send order form to:


Street & No. Elektor US
PO Box 180
Vernon, CT 06066
USA
City/State/Zip Country

Phone: 860-875-2199
Tel E-mail
Fax: 860-871-0411

E-mail: [email protected]
Date – – Signature
EL09 www.elektor.com
ORDERING INFORMATION

To order contact customer service:

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.

SUBSCRIPTIONS (US & CANADA ONLY)

Subscription rates (1 Yr.)

Standard Subscription: $39.95


Plus Subscription: $54.95

Canada add $11 per year for postage

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]

Order subscriptions on-line at www.elektor.com/subs

Subscriptions may be paid for by check or money order (in US $ drawn on a


US bank only). We accept Mastercard, VISA, Discover and American Express
credit cards.

For gift 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.

Does your subscription expire soon?


Renew it online at www.elektor.com/renew
See your project in print!

Take out a free subscription to Elektor magazine is looking for


E-weekly now Technical Authors/Design Engineers
Do you want to stay up to date with electronics and If you have
computer technology? Always looking for useful hints, aan innovative or original project you’d like to share
tips and interesting offers? Subscribe now to E-weekly, with Elektor’s 140 k+ readership and
the free Elektor Newsletter. the electronics community
Your benefits: aabove average skills in designing electronic circuits
The latest news on electronics in your own mailbox aexperience in writing electronics-related software
each Friday abasic skills in complementing your hardware or software
Free access to the News Archive on the Elektor website with explanatory text
You’re authorized to post replies and new topics in our forum aa PC, email and Internet access for efficient
communications with Elektor’s centrally located
team of editors and technicians
then don’t hesitate to contact us for exciting
opportunities to get your project or feature article
published.
Our Author Guidelines are at: www.elektor.com/authors.

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

Atria Technologies, Showcase . . . . . www.atriatechnologies.com. . . . . . . . . . . . . . . . . . . . 78


NXP Contest. . . . . . . . . . . . . . . . . . . www.circuitcellar.com/nxpmbeddesignchallenge! . . . 15

Circuit Cellar . . . . . . . . . . . . . . . . . . www.circuitcellar.com . . . . . . . . . . . . . . . . . . . . . . . . 47


Paia Electronics, Showcase . . . . . . . www.paia.com . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 78

Decade Engineering, Showcase . . . . www.decadenet.com. . . . . . . . . . . . . . . . . . . . . . . . . 78

Parallax . . . . . . . . . . . . . . . . . . . . . . www.parallax.com . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
DLP Design . . . . . . . . . . . . . . . . . . . www.dlpdesign.com . . . . . . . . . . . . . . . . . . . . . . . . . 41

PCB West 2010 . . . . . . . . . . . . . . . . www.pcbwest.com . . . . . . . . . . . . . . . . . . . . . . . . . . 10


EasyDAQ, Showcase . . . . . . . . . . . . www.easydaq.biz. . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

Elsevier . . . . . . . . . . . . . . . . . . . . . . www.newnewpress.com . . . . . . . . . . . . . . . . . . . . . . 53 Pololu Corporation, Showcase . . . . . www.pololu.com/wheels . . . . . . . . . . . . . . . . . . . 11, 78

ESC Boston . . . . . . . . . . . . . . . . . . . www.embedded.com/boston. . . . . . . . . . . . . . . . . . . 35


Saelig, Showcase. . . . . . . . . . . . . . . www.saelig.com . . . . . . . . . . . . . . . . . . . . . . . . . . 2, 78

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

Advertising space for the issue of 14 October 2010


Hameg Instruments, Showcase . . . . www.haproelectronics.com . . . . . . . . . . . . . . . . . . . . 78
may be reserved not later than 21 September 2010
Images Scientific, Showcase . . . . . . www.imagesco.com . . . . . . . . . . . . . . . . . . . . . . . . . 78 with Strategic Media Marketing, Inc. - 2 Main Street -
Gloucester, MA 01930 - USA – Telephone 1.978.281.7708 -
Linx Technologies. . . . . . . . . . . . . . . www.linxtechnologies.com . . . . . . . . . . . . . . . . . . . . 41
Fax 1.978.281.7706 - e-mail: [email protected] to whom all
Maxbotix, Showcase . . . . . . . . . . . . www.maxbotix.com . . . . . . . . . . . . . . . . . . . . . . . . . . 78 correspondence, copy instructions and artwork should be addressed.

elektor 09-2010 87

You might also like