100% found this document useful (1 vote)
175 views

Nuts & Volts September 2007

This document is the cover page for the September 2007 issue of NUTS & VOLTS magazine. It lists the table of contents which includes articles about keeping components cool, voltage references, and an inchworm robot. It also contains advertisements for circuit specialists products like oscilloscopes, stepper motors, motor controllers, and an infrared soldering system.

Uploaded by

Steven Clements
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)
175 views

Nuts & Volts September 2007

This document is the cover page for the September 2007 issue of NUTS & VOLTS magazine. It lists the table of contents which includes articles about keeping components cool, voltage references, and an inchworm robot. It also contains advertisements for circuit specialists products like oscilloscopes, stepper motors, motor controllers, and an infrared soldering system.

Uploaded by

Steven Clements
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/ 108

Vol. 28 No.

9 NUTS & VOLTS KEEP COMPONENTS COOL • VOLTAGE REFERENCE • INCHWORM ROBOT September 2007
Page 108
8:22 PM
8/8/2007
Cover.qxd
CoverInside.qxd 8/8/2007 3:22 PM Page 2

C i rcuitSpecialists.com Ci rcuitSpecialists.com Ci rcuitSpecialists.com

Stepper Motors
2 & 4 Channel GDS-2000 Series Digital Part #: Motor Frame
Size:
Holding Torque: Price:

Storage Oscilloscopes w/TFT Color Displays 42BYGH404 NEMA 17 3.4kg.cm/47oz.in $17.95


57BYGH207 NEMA 23 8kg.cm/111oz.in $24.95
57BYGH303 NEMA 23 15kg.cm/208oz.in $29.95
57BYGH405 NEMA 23 20kg.cm/277oz.in $34.95
•200/100/60 MHz Bandwidth
85BYGH350B-03 NEMA 34 48kg.in/665oz.in $79.95
•2 or 4 Input Channels
85BYGH350C-03 NEMA 34 63kg.cm/874oz.in $119.95
•1 GS/s Real Time Sampling Rate &
25 GS/s Equivalent-Time Sampling Stepper Motor Controllers: 2 Phase Microstepping
•25 kpoints Record Length Maximum Stepper Motor Driver (Bi-polar & Unipolar Motors)
•Large 5.6-in TFT Color Display
Part #: Dimensions: MicroStep: Price:
•FFT Function 1(200), 1/2(400), 1/4(800),
XCW220 100mm x 61mm $39.95
•Standard USB Host and Device x 19mm 1/8(1600)
Interface; Optional GPIB CW220 99mm x 65mm 1/2(400), 1/8(1600) $49.95
•Optional DC Power (Factory x 30mm
Installed) CW230 115mm x 72mm 1(200), 1/2(400), 1/4(800), $59.95
•Auto-Level, AUTO, NORMAL, SINGLE,
NEW ! x 32mm 1/8(1600), 1/16(3200),
1/32(6400), 1/64(12800)
TV, Edge, Pulse Width Time-delay(2CH Only), CW250 140mm x 94mm 1(200), 1/2(400), 1/8(1600) $69.95
Event-delay(2CH Only) x 45mm
CW860 147mm x 97mm 1(200), 1/2(400), 1/4(800), $119.95
GDS-2062 60MHz, 2Ch DSO $890.00 x 30mm 1/8(1600), 1/16(3200),
1/32(6400), 1/64(12800),
GDS-2064 60MHz, 4Ch DSO $1210.00 128(25600), 1/5(1000),
GDS-2102 100MHz, 2Ch DSO $1160.00 1/10(2000), 1/25(5000),
1/50(10000), 1/125(25000),
GDS-2104 100MHz, 4Ch DSO $1470.00 1/250(50000)

GDS-2202 200MHz, 2Ch DSO $1470.00


GDS-2204 200MHz, 4Ch DSO $1800.00
Focused Infrared Soldering System
Details at Web Site > Test Equipment > Instek Test Equipment
The CSI-IR1 is a modular and
flexible infrared technology sol-
Digital Storage Oscilloscope Module dering system for effective high
yield rework of even the most
Convert any PC with USB interface to a high advanced packages, as well as
performance Digital Storage Oscilloscope. This being suitable for lead or lead-
is a sophisticated PC basedscope adaptor pro- free solder. It brings sophisticat-
viding performance compatible to mid/high ed rework systems to the sim-
level stand alone products costing much more! plicity of a handtool and can be
Comes with two probes. used widely for reworking BGAs, micro-BGAs, QFPs,
Price PLCCs, SOICs and small SMDs.
Detai ls & S oftwar
oftware
e Breakthrough! New Lower Price
New Lower Price
Download at WebWeb Si te $1399.00
Details
Details at Web
Web Site
Site
> Test Equipment > Oscilloscopes/Outstanding Prices > Soldering Equipment & Supplies Item# CSI-IR1
PC based Digital
Digital Storage
Storage
Oscilloscope, 200MHz 5GS/s
equiv.
Item# 200DSO Only$819.00 Soldering Station w/Iron &
equiv. sampling USB interface
SMD Hot Tweezers
•Electrostatic discharge safe
3-1/2 Digit LCD Panel Meter design with grounding measure
(enhanced version) •Tweezers directly applies heat
The PM-128E is an enhanced version of to components being repaired
our best selling PM-128A. The E version while avoiding nearby
can be set to work with either a 5VDC or components
9VDC power source, will perform with
either a common ground or an isoalted •Suitable for crowded circuit
ground, and is supplied with easy to use boards
jumper points so the end user can easily •24V output voltage to ensure
set the measurement range required. $12.25 Item# safety of user and protect soldered components on board
Quantity PM-128E
Details
Details at Web
Web Site
Site Price Breaks Item# CSI-950+ $59.00
Details
Details at Web
Web Site
Site
> Panel Meters > Digital Panel Meters at website!
A dd i t i o n a l > Soldering Equipment & Supplies > Soldering Stations

Pa n e l M e t e r s
Jumbo LCD 9V Independent 3-1/2 Digit LED Panel Meter
Ground Panel Meter o n We b S i t e ! w/5V Common Ground
The PM-1028A is designed to run off of a The CX-102 series of digital panel meters
9V (7-11V) independent power source. have high reliability, good quality and fine
The figure height is 21mm. High quality workmanship. They can be used for a
SMT construction provides high reliability variety of applications and are competi-
and the decimal point selection is conve- tively priced. Their unmatched perform-
niently done by wire jumpers. The panel ance make these 3-1/2 digit LED panel
meter implements dual slope integration meters the first choice for applications that require
A-D conversion measuring methods. Item# $12.95 instrumentation. $14.95
Quantity Item# Quantity
Details
Details at Web
Web Site
Site PM-1028A Price Breaks Details
Details at Web
Web Site
Site CX102B Price Breaks
> Panel Meters > Digital Panel Meters at website! at website!
> Panel Meters > Digital Panel Meters

C i r c u i t S p e c i a l i s t s , I n c . 2 2 0 S . C o u n t r y C l u b D r. , M e s a , A Z 8 5 2 1 0
8 0 0 - 5 2 8 - 1 4 1 7 / 4 8 0 - 4 6 4 - 2 4 8 5 / FA X : 4 8 0 - 4 6 4 - 5 8 2 4
Full Page.qxd 5/10/2007 2:18 PM Page 3

Check out our new Wi-Fi and ZigBee®


core modules — the latest additions
to our pin-compatible family.

RCM4510W
ZigBee RabbitCore®
$
72 (qty. 100)
RCM4400W
Wi-Fi RabbitCore
$
99 (qty. 100)

2900 Spafford Street, Davis, CA 95618 Tel 530.757.8400


TOC - Sep07.qxd 8/8/2007 7:59 PM Page 4

SEPTEMBER 2007

PROJECTS and FEATURES COLUMNS


36 KEEP THOSE COMPONENTS 58 FLOATING POINT 10 TECHKNOWLEDGEY 2007
COOL! MULTIPLICATION AND Events, advances, and news
Adjust fan speed by the DIVISION WITHOUT from the electronics world.
temperature to keep things HARDWARE SUPPORT
14 GETTING STARTED WITH PICs
running smooth and quiet. Using Horner’s method to Large digits on a 4x20 LCD.
■ By Stuart Ball build a color organ.
■ By Craig Lindley 20 NEAR SPACE
Sensors for your Balloonsats
41 FLIGHT RECORDER FOR and the Great Plains
MODEL ROCKETRY Part 2 68 SWIFT, SMALL, “CELL” Super Launch.
Learn the embedded software BROADBAND CHIP
required to record and replay These days, applications and 28 Q&A
Fly zapper, Sam’s Photofact,
three channels of acceleration. experimentation with the linear ramp, more.
Plus, a plot of actual flight data Cell/B.E. technology abound.
is shown in Microsoft Excel. So, just how fast does the Cell 75 PERSONAL ROBOTICS
Magnetic inchworm.
■ By Mike Bessant chip cruise?
■ By David Geer 80 STAMP APPLICATIONS
46 CONTROL YOUR WORLD Where‘s waldo?
Build a Wireless Weather 71 A LOGIC ANALYZER
88 THE DESIGN CYCLE
System — Part 1. TUTORIAL Part 1 Laying a foundation for Ping.
■ By Michael Simpson A logic analyzer is an
indispensable tool if you 104 IN THE SPOTLIGHT
52 BUILD A .01% ACCURATE design and troubleshoot This month: Ramsey Electronics.
VOLTAGE REFERENCE digital circuits. Find out why.
So, just how accurate is ■ By Vaughn Martin
your DMM? DEPARTMENTS
■ By Doug Malone
06 DEVELOPING
PERSPECTIVES

08 READER FEEDBACK

30 SHOWCASE

32 NEW PRODUCTS

66 ELECTRO-NET

96 CLASSIFIEDS
75
98 NV HOBBYIST STORE
Nuts & Volts (ISSN 1528-9885/CDN Pub Agree#40702530) is published monthly for $24.95 per year
by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID 101 TECH FORUM
AT CORONA, CA AND AT ADDITIONAL MAILING OFFICES. POSTMASTER: Send address changes
to Nuts & Volts, P.O. Box 15277, North Hollywood, CA 91615 or Station A, P.O. Box 54,
Windsor ON N9A 6J5; [email protected] 105 ADVERTISERS INDEX

4 September 2007
Full Page.qxd 8/8/2007 3:30 PM Page 5

Link Instruments
PC-Based Test Equipment

Digital Oscilloscopes • 2 Channel Digital Oscilloscope


• 500 MSa/s max single shot rate
• 1Mpt sample memory
250 MSa/S (Dual channel) 512 Kpts
500 MSa/S (Single channel) 1 Mpts
• Only 9 oz and 7” x 3.5” x 1.5”
• Portable and Battery powered
• USB 2.0
• FFT Spectrum Analyzer
DSO-8202 (200MSa,128K) $799
DSO-8502 (500MSa,1MPt) $950

S a/s
500M 1Mp
ts

Logic Analyzer & Port


3.2” able
NEW!
x
USB 3” x 0

Pattern Generator 2.0 .6


Pow 5”
ered

• 32 channels Logic Analyer


• up to 32 channels Pattern Generator
• up to 400 MSa/s
• Variable Threshold
• 2 External Clocks
• SPI output and disassembly
• I2C output and disassembly
• up to 2Msamples/ch
IO-3208A $750
IO-3232A $899
IO-3232B $1399

www.Link-instruments.com
(973) 808-8990

September 2007 5
DevPerspective.qxd 8/8/2007 7:45 PM Page 6

by Bryan Bergeron, Editor


DEVELOPING
PERSPECTIVES
T he projects in this issue of Nuts & Volts address a range of
interests, from rocketry instrumentation and weather, to ther-
mal management and instrument calibration standards. Although
The cascade of national and international standards involved —
from the physical property measured to the signal levels in the
microcontroller or microprocessor — is invisible to the casual
the relevance of standards is most evident in Doug Malone’s arti- experimenter. The IEEE alone is responsible for over 1,300 stan-
cle on building a voltage reference, each of the projects is a tribute dards in telecommunications, information technology, and related
to the necessity of standards in the design, construction, operation, fields (see standards.ieee.org). In addition to decreasing develop-
and maintenance of electronic circuitry and instrumentation. ment time and costs, standards increase product quality and safe-
In electronics, standards — which are sometimes expressed in ty, and provide a modicum of protection against obsolescence.
terms of compatibility — range from the thread and diameter of Several important standards are readily accessible, even if
nuts and bolts, logic families, and computer busses, to communi- only indirectly. For example, the National Institute of Standards
cations and low-level signal levels. Fortunately for readers, the and Technology (NIST) broadcasts standard time and frequency
authors have assumed the responsibility of determining which signals over the web, telephone network, and radio. NIST
hardware and software combinations provide the best results. You maintains the primary standard for frequency and time intervals
don’t have to decide between resistor-transistor logic (RTL), with a Cesium Fountain Atomic Clock in Boulder, CO (see
transistor-transistor logic (TTL), or complimentary metal-oxide tf.nist.gov/cesium/fountain.htm). You can access time based
semiconductor logic (CMOS) chip sets, Bluetooth or WiFi wireless on this standard over the Internet, accurate to within 0.2 sec-
communications, or between a PIC and a STAMP microcontroller. onds, at www.time.gov. The NIST radio station WWV, known to
A wireless weather station, for example, may incorporate sen- most radio amateurs and shortwave listeners, broadcasts time
sors calibrated to international standards of barometric pressure, signals at 2.5, 5, 10, 15, and 20 MHz. If you have one of those
temperature, and humidity. These inherently analog signals are ‘atomic’ clocks or watches, the synchronizing signal is from
typically interfaced to digital hardware and associated software. NIST station WWVB, which broadcasts continuously at 60 kHz.
The Cesium time standard is an example of an intrinsic
standard, in that it is based on a constant of nature, as opposed to
an experiment conducted in a specific environment. A voltage
standard based on a battery, for example, is an extrinsic standard.
For this reason, in 1972 NIST moved from a definition of the stan-
dard volt based on the Weston cell to the Josephson Volt Standard,
which is based on electrical properties of the Josephson junction —
two superconductors linked by a non-conducting barrier. While a
standard based on a reproducible, solid-state, cryogenic supercon-
ductor has been a boon to industry, it is still beyond the reach of
individuals. Hence, the value of Doug’s article. Doug’s article, albeit
an extrinsic standard, is an affordable source for a standard volt.
Given the readily available, inexpensive digital multimeter, a
standard volt may seem superfluous. After all, for $30, it’s possible
to obtain a six-digit DMM with a built-in frequency counter. If you
own a Fluke, HP, or other quality DMM, you know that part of
what you paid for is accuracy over time and with changes in the
operating environment. A $30 meter might be accurate to within
a tenth of a volt out of box, but six weeks later, in the heat of
summer or cold of winter, a measurement might be off by a half
volt. Although all meters require recalibration, it’s more likely that
the $30 DMM will require more frequent recalibration than a
quality DMM. A handy voltage standard, even if it is extrinsic,
enables you to recalibrate your inexpensive DMM or oscilloscope.
As you prepare to build one of the projects described in
this month’s Nut & Volts, pause for a moment to consider the
myriad standards involved, and the limitations of your multi-
digit digital test equipment. Understanding the underlying
standards can not only make your debugging more productive,
but you’ll appreciate the lengths developers have gone through
to insure component and system compatibility. NV
6 September 2007
Full Page.qxd 8/8/2007 3:34 PM Page 7

Announcing a complete hardware and software solution from NetBurner


The NetBurner MOD5234
E T H E R N E T C O R E M O D U L E w i t h e T P U

Only
$99 Qty. 100

NetBurner MOD5234 Ethernet Core Module Features


INDUSTRIAL TEMPERATURE RANGE
| –40°C to +85°C
PERFORMANCE AND MEMORY
| 32-Bit CPU | Freescale ColdFire MCF5234 147 Mhz
| 2MB Flash Memory | 8MB SDRAM
DEVICE CONNECTIVITY
| 10/100 Ethernet | 3 UARTs | 16-channel eTPU | I2C | SPI | CAN 2.95”
| 47 Digital I/O | 16-bit Data Bus | SD/MMC Flash Card Support

Customize with NetBurner’s Royalty-free Software Suite


DEVELOPMENT SOFTWARE
| NB Eclipse IDE | Graphical Debugger | Deployment Tools | Examples
COMMUNICATION SOFTWARE
| TCP/IP Stack | HTTP Web Server | FTP | E-Mail | PPP | Flash File System
2.0”

All hardware and software is included with the


NetBurner MOD5234 Development Kit for only $299!
The Development Kit features NetBurner’s Eclipse, an enterprise level professional
IDE that provides editing, downloading and debugging in one environment.
Order the MOD5234 Development Kit: Product No. NNDK-MOD5234-KIT

Product No. | MOD5234-100IR


Information and Sales | [email protected]
Web | www.netburner.com
Telephone | 1-800-695-6828
ReadFeed Sep07.qxd 8/8/2007 4:51 PM Page 8

READER FEEDBACK editorial, Developing Perspectives, in the


EVERYTHING FOR ELECTRONICS

Published Monthly By
July ‘07 issue of Nuts & Volts. T & L Publications, Inc.
Your readers should try the 430 Princeland Ct.
MAGIC BOX KIT American Radio Relay League’s online
Corona, CA 92879-1300
DOES THE TRICK course on digital electronics (www.
(951) 371-8497
FAX (951) 371-3052
I recently completed the Magic Box arrl.org). This is an excellent hands-on Product Order Line 1-800-783-4624
featured in your April/May editions and course on using CMOS ICs. www.nutsvolts.com
must say it was without a doubt one of the Also, an additional way to develop Subscriptions
best projects I have seen in your magazine. perspective is to try to invent a new way Inside US 1-877-525-2539
Since I don’t usually have all the spare parts, of doing a function, such as sending Outside US 1-818-487-4545
nor the time to gather them up, I usually radio waves, adding numbers, steering P.O. Box 15277
opt out for the kit version and go from a robot, storing electrical energy, etc. North Hollywood, CA 91615
there. When it arrived, I was pleasantly This inventive process will encourage FOUNDER/ASSOCIATE PUBLISHER
surprised to find all the parts, very well one to really examine what is going on Jack Lemieux
packaged in groups and labeled, rather than in existing electronics circuits and to PUBLISHER
all thrown into one large bag like many oth- consider what alternatives may be Larry Lemieux
[email protected]
er kits. The building instructions and doc- possible. You can use a morphological
umentation were expertly explained and table to further stir up new ideas. ASSOCIATE PUBLISHER/
diagramed. It was a real pleasure building Nickolaus E. Leggett VP OF SALES/MARKETING
Robin Lemieux
the Magic Box, and it’s a blast watching Reston, VA [email protected]
people try to figure it out. I contacted Zone-
masterskits.com to request a set of extra OP-AMP OPTIONS EDITOR
Bryan Bergeron
Coke™ bottle pawns, and their response I have some questions for Gerard [email protected]
was immediate and informative. I look Fonte concerning his article in the August
forward to Nuts & Volts for just this type N&V on the ARB. The op-amp he speci- CONTRIBUTING EDITORS
Chuck Hellebuyck Marvin Mallon
of project. I only wish all the projects were fied is an LMC6082 CMOS device. That Jeff Eckert David Geer
of this magnitude. Keep them coming. particular op-amp seems to be difficult to Peter Best Michael Simpson
Russ Kincaid Mike Bessant
Kimberly Hamel find in a PDIP package in small quantities. Jon Williams Paul Verhage
Do you know where I can buy just a Craig Lindley Vaughn Martin
EXPERIMENTING WITH couple of them? Alternatively, what oth-
Stuart Ball Doug Malone
PERSPECTIVE er op-amp would you recommend? How CIRCULATION DIRECTOR
Tracy Kerley
Thank you for Bryan Bergeron’s about the LMC6442 or the LMC6042? [email protected]
Continued on page 97
SHOW COORDINATOR
Audrey Lemieux

MARKETING COORDINATOR
Brian Kirkpatrick

WEB CONTENT/NV STORE


Michael Kaudze
[email protected]

PRODUCTION/GRAPHICS
Shannon Lemieux
Michele Durant

ADMINISTRATIVE ASSISTANT
Debbie Stauffacher

Copyright © 2007 by T & L Publications, Inc.


All Rights Reserved

All advertising is subject to publisher’s approval. We are not


responsible for mistakes, misprints, or typographical errors.
Nuts & Volts Magazine assumes no responsibility for the
availability or condition of advertised items or for the honesty
of the advertiser. The publisher makes no claims for the legal-
ity of any item advertised in Nuts & Volts. This is the sole
responsibility of the advertiser. Advertisers and their agencies
agree to indemnify and protect the publisher from any and all
claims, action, or expense arising from advertising placed in
Nuts & Volts. Please send all editorial correspondence, UPS,
overnight mail, and artwork to: 430 Princeland Court, Corona,
CA 92879.
8 September 2007
Full Page.qxd 8/8/2007 3:37 PM Page 9
Tech2007.qxd 8/6/2007 12:35 PM Page 10

TECH

2007
KNOWLEDGEY
EVENTS, ADVANCES, AND NEWS
■ BY JEFF ECKERT
ADVANCED TECHNOLOGY
MAGNET CONTROLS ANOTHER SOLAR CELL as the 40.7 percent achieved last year
LIQUID COLOR ADVANCEMENT by a Boeing Spectrolab (www.spectro
lab.com) device. However, “This is the

N anotechnologists at the University


of California, Riverside (www.ucr.
edu) have come up with a way to
highest level achieved for solar cells
made from organic materials. I am
confident that we can make additional
control the color of a liquid by applying improvements that will yield efficien-
a magnetic field. The liquid is just a cies sufficiently high for commercial
colloidal suspension of iron oxide products,” Heeger noted. He expects
PHOTO COURTESY OF UCSB.

nanoparticles in water, but the particles the technology to be commercially


are “superparamagnetic,” meaning that available within about three years.
they have magnetic properties only in
the presence of an external magnetic
field. This is in contrast to “ferromag-
COMPUTERS AND
netic” materials, which retain their
■ Plastic tandem solar cells — which
NETWORKING
magnetism after the field is removed. use linked solar cells with different NEW LOW-END
If you vary the field strength applied absorption characteristics — use a COMPUTER LINEUP
to the liquid, the particle arrangement is wider range of the visible spectrum.
altered, thereby changing what happens
when light passes through or is deflected
by the solution. According to researcher
Yadong Yin, “By reflecting light, these crys-
M eanwhile, over on the other side
of L.A., a research team has been
working on a new type of plastic solar
tals (also called photonic crystals) show cell with a noteworthy boost in efficien-
brilliant colors. Ours is the first report of cy. Nobel laureate Alan Heeger — a
a photonic crystal that is fully tunable in physics professor at UC, Santa Barbara
the visible range of the electromagnetic (www.ucsb.edu) — and associates have
spectrum, from violet light to red light.” come up with a “tandem” organic
Because the materials are cheap, non- device that, by virtue of its dual multilay- PHOTO COURTESY OF DELL, INC.
toxic, and readily available, the technolo- er design, gathers a wider range of the
■ Dell’s new Vostro notebooks and
gy could be used to create reflective col- spectrum, at both shorter and longer desktops are aimed at small businesses.
or displays that use millions of the particles wavelengths. According to Heeger, the A Vostro 200 is shown here.
for pixels. It also has possible applications cells “... can be fabricated to extend over
in erasable, rewritable electronic paper
and might even be used to make ink that
changes color electromagnetically.
large areas by means of low-cost printing
and coating technologies that can simul-
taneously pattern the active materials on
I n July, Dell (www.dell.com)
introduced a new lineup of PCs
designed for small businesses on a
lightweight, flexible substrates.” budget. Consistent with market trends
■ A solution of iron oxide in water At present, the tandem cells are that saw notebook sales up by 23 per-
changing color under a magnetic field, working at only about 6.5 percent effi- cent in the first quarter but desktops
with increasing field strength from left ciency, which isn’t nearly as impressive pretty stagnant, the new brand at
to right. introduction included four laptops but
only one desktop (although available in
either mini-tower or slim case versions).
Apparently, Dell has received a substan-
tial number of complaints about PCs
that arrive bloated with trialware (also
known as “junkware” or “crapware”), so
the Vostro™ (Latin for “yours”) machines
come without it. They do include
“simple to use tools that address top-of-
PHOTO COURTESY OF YIN LABORATORIES, UCR.
10 September 2007
Tech2007.qxd 8/6/2007 12:36 PM Page 11

TECHKNOWLEDGEY 20 07

mind problems such as data back-up, PowerPC Macs in native mode. sland.com). Not only is it a digital
PC performance and health, and (Version 1.2.0 is available for Windows wristwatch, it also plays MP4 videos on
specialized networking support for 98 through Vista.) The program sells a built-in color screen and MP3 music
customers without dedicated IT staff.” for $129 on the website, but you can through an included set of earphones.
The notebooks start at $449, and download a free 15-day trial. The device comes with up to 2
you can get the Vostro 200 shown for GB of Flash memory, a 1.5-in color
about $319. The notebooks use either FREE EMAIL FOR screen (128 x 128 pixels), and digital
dual-core AMD or Intel Core™ 2 Duo iPHONES recording capability. It has five equal-
processors and have displays ranging izer modes plus a “super bass 3-D”
PHOTO COURTESY OF THINPRINT, INC.
from 14.1 to 17 inches. The 200 uses playback mode. Viewing options
the Intel chip. The company also include thumbnail, slide show, and
introduced a new 19-inch widescreen manual, and it even comes with a USB
display that lists for $229. cable for file transfer and recharging.
(You get eight hours of continuous
AN MD IN YOUR PC music playback on a charge.)
Originally priced at $199.99, it is
now offered at $159.99, so get your
Christmas shopping over early and look
forward to watching your friends and
family walk into walls and drive off cliffs.

NEW MEMORY
SUBSYSTEM FOR
EMBEDDED
■ The Cortado Free program offers
APPLICATIONS
iPhone users free email services.

PHOTO COURTESY OF EINSPINE LTD.


I f you are among those who have actu-
ally shelled out as much as $600 for
I n July, Silicon Storage Technology
(www.sst.com) began releasing
sampling quantities of the model
■ Your personal exercise coach, as
provided by Desk Doctor. an iPhone and every month are forking SST88VP1107, which is the first in its
over between $59.99 and $219.99 to new “All-in-OneMemory” subsystem

O ne of the weirder programs out


there is Desk Doctor, a product
of Einspine Ltd. (www.einspine.com),
AT&T (depending on the plan), money
may not mean much to you. On the
other hand, you may be living in a 1983
line. The concept puts code storage
(NOR), data storage (NAND), and
system RAM (PSRAM) functions on a
a Malta-based entity. The basic Oldsmobile to make up for it, in which single PSRAM bus, thus simplifying
concept is that you get a virtual Dr. case it’s nice to know that Cortado designs and reducing the time to market
Russ Hornstein (the inventor) in your (www.cortado.com) is offering all in mobile and embedded applications.
PC, and he makes regular assessments iPhone users, anywhere in the world, a The device comes configured with
of your upper body condition so as free mobile e-mail service (subject to 512 KB instant-on boot NOR, 128 MB
to avoid repetitive strain injuries the data flat rate from AT&T, of course). execute-in-place (XIP) code storage,
(e.g., carpal tunnel syndrome and The Cortado Free program allows 120 MB data storage, and 12 MB
tendonitis.) The program monitors users to automatically receive emails system RAM, all in a 10 x 13 x 1.4 mm
computer activity and calculates your at any time, and it includes a personal package. According to the company,
health score, which is displayed Cortado email address with profes- “by intelligently managing all memory
onscreen. When your score drops to a sional spam filter, virus protection, and components with a resident 32-bit
risky level, the MD will determine that 20 MB of storage. (Or you can use an microcontroller, All-in-OneMemory
a workout is needed. You then call up existing email address.) offers a large and expandable XIP area,
your personal exercise trainer, who instant secure boot, memory
serves up a high-res video demonstra-
tion of the suggested routine.
CIRCUITS AND demand paging, NAND
Flash management, and
According to the company, keep- DEVICES ATA data storage proto-
ing a good average health score will MP4 PLAYER/WATCH col on a single PSRAM
ensure that your musculoskeletal COMBINATION bus in a small footprint
health is maintained. The product has package; thereby reduc-
actually been around for a couple
years, but version 1.3.1 has just been
released and, because it uses universal
T his month’s “neat, but prob-
ably useless gadget” award
goes to the MP4 Player Watch
ing system complexity
■ This MP4 player/
wristwatch combo would
binary, it runs on both Intel and from Etronicsland (www.etronic even amaze Dick Tracy.
PHOTO COURTESY OF ETRONICSLAND.
September 2007 11
Tech2007.qxd 8/6/2007 12:36 PM Page 12

and lowering overall cost.” accent and marker lights.


The ASMT-MY00 LED features a
LED DESIGNED FOR smooth radiation pattern and the 110-
SOLID-STATE LIGHTING degree viewing angle can be driven at
350 mA, delivering 56 lumens. The

A vago Technologies (www.avago


tech.com) recently rolled out a
new Moonstone™ warm
chip is encapsulated in a silicone com-
pound to provide UV and heat resist-
ance, is specified for operation over a
white 1W power LED range of -40 to +95°C temperature
for high-brightness range, and can withstand electro-
applications such as static discharge levels of 16
decorative architectur- kV. Color temperatures
al and garden lights, range from approxi-
reading lights, and mately 2,600 to 4,000
K. The price in manu-
■ Avago’s Moonstone
LEDs are designed for solid- facturing quantities
state lighting applications. is about $2.50. NV
PHOTO COURTESY OF AVAGO TECHNOLOGIES.

LEON H. SIBUL,
INDUSTRY AND 1932-2007
THE PROFESSION

UNIVERSITY OF TECHNOLOGY.
PHOTO COURTESY OF TALLINN
SPAMMERS/SCAMMERS
ARRESTED
E arlier this year,
the electron-
ics industry lost

I f your inbox has contained fewer


spams promoting obscure penny
stocks lately, it could be because the
Leon H. Sibul, a
pioneer in the
application of sig-
Securities and Exchange Commission nal processing to
(www.sec.gov) recently filed fraud underwater guid-
charges against two Texans who ran a ance and control
• Over 40,000
scam that hijacked PCs nationwide, systems. Sibul
Products used them to disseminate millions of was born in Võru, ■ Leon Sibul,
Stocked acoustics and
spam emails, and cheated investors Estonia in 1932,
• Access to over signal processing
out of more than $4.6 million. Darrel but fled to a pioneer.
1.5 million
electronic parts Uselton and his uncle Jack, both German refugee
and related described as “recidivist securities law camp in 1944 and finally emigrated
products
violators,“ allegedly illegally profited to the Washington, DC, area in 1949.
• Installer/Dealer
pricing program from a 20-month “scalping” scam by He served in the US Air Force as an
• Quotation team, obtaining shares from some 13 electronics and radio technician from
send us your different penny stock companies and 1953 to 1957. In 1960, he was
quotes for quick
response artificially inflating the market for hired by Bell Labs, where he worked
them through the email and other on electronic switching systems
FFRREEEE ! promotional activities. They subse- and Telstar, the satellite that ushered

CCaattaalloogg!
quently sold the stocks at a profit. in the era of satellite communications.
Unfortunately for the Useltons, this Finally, in 1964, he joined the
call toll free is a violation of Section 10(b) of the Applied Research Lab at Penn State,
1-800-543-4330 Securities Exchange Act of 1934 and conducting signal-processing R&D
refer to or visit
Rule 10b-5, and the SEC was not for undersea weapons guidance and
www.mcmelectronics.com/magazine amused. In related enforcement actions, control, sonar systems, and other
Texas authorities indicted the Useltons naval applications, and also taught
for engaging in organized crime and acoustics. Sibul retired in 2002.
money laundering and seized more He held electrical engineering
than $4.2 million from their bank degrees from George Washington
accounts. The best part is that you can University (bachelor’s), New York
see a video of Darrel’s arrest at www. University (master’s), and Penn
oag.state.tx.us/media/videos/play.php State (Ph.D.) and was a life member
Source Code: NVM53 ?image=070907uselton_arrest&id=235. in the IEEE.
12 September 2007
Full Page.qxd 8/8/2007 3:39 PM Page 13

Simple Control for


Complex Applications
The Microchip name and logo, the Microchip logo and PIC are registered trademarks of Microchip Technology Incorporated in the USA and in other countries. PICkit is a trademark of Microchip Technology Incorporated in the U.S.A. and other countries.
All other trademarks mentioned herein are property of their respective companies. © 2007 Microchip Technology Incorporated. All rights reserved.

Microchip’s 20-pin, general-purpose PIC® microcontrollers are flexible


and easy to use – saving you design time and development costs.
Whether you’re designing an MP3 player or a flight control system, Microchip’s low-pin count devices give you
the features you need to get the job done, while making configuration easy. A simple architecture, a cost-
saving integrated peripheral set, and easy-to-use development tools allow you to spend your time perfecting your
application – instead of debugging it.
20-PIN DEVICE OPTIONS
Program
Data Memory
Memory
Flash SRAM EEPROM 10-bit A/D Timers
Device (words) (bytes) (bytes) (ch) 8/16-bit Other Feature20-s 20-pin Package Options
PIC16F631 1024 64 128 0 1/1 PDIP, SSOP, SOIC, 4mm x 4mm QFN
NEW!
PIC16F677 2048 128 256 12 1/1 SPI/I²C™ PDIP, SSOP, SOIC, 4mm x 4mm QFN
NEW!
PIC16F685 4096 256 256 12 2/1 ECCP+ PDIP, SSOP, SOIC, 4mm x 4mm QFN
PIC16F687 2048 128 256 12 1/1 EUSART, SPI/I²C™ PDIP, SSOP, SOIC, 4mm x 4mm QFN
PIC16F689 4096 256 256 12 1/1 EUSART, SPI/I²C™ PDIP, SSOP, SOIC, 4mm x 4mm QFN
PIC16F690 4096 256 256 12 2/1 ECCP+, EUSART, SPI/I²C™ PDIP, SSOP, SOIC, 4mm x 4mm QFN
PIC16F785 2048 128 256 12 2/1 Op Amps, CCP, Hardware PWM PDIP, SSOP, SOIC, 4mm x 4mm QFN

microchip Get started today with the


PICkit™ 2 Starter Development Kit
DIRECT
www.microchipdirect.com
for only $49.99!

www.microchip.com/Easy

Microcontrollers • Digital Signal Controllers • Analog • Serial EEPROMs


GetStartedWithPICs.qxd 8/7/2007 11:33 AM Page 14

■ BY CHUCK HELLEBUYCK
GETTING STARTED WITH
THE LATEST IN PROGRAMMING MICROCONTROLLERS
PICs
LARGE DIGITS ON A 4x20 LCD
DRIVING A LIQUID CRYSTAL DISPLAY (LCD) module has become very easy to
do with the various PIC® microcontroller (MCU) options that are available.
microEngineering Labs’ PICBASIC PRO compiler, Basic Micro’s BasicATOM
chips, and many other PIC MCU-based chips, modules, and compilers offer a
command dedicated to driving these types of displays.

W hen I’ve discussed driving an LCD module from a PIC


MCU in the past, I received several emails asking
where to buy one. I just took it for granted that everybody
self-programming bootloader installed. To make the
connections simpler, I use my Ultimate OEM module
with the BasicATOM 28 installed. However, wiring
knew they were available just about everywhere. The it directly to any PIC MCU will also work. If you want to
secret is in the common driver chip used in the LCD use the PICBASIC PRO compiler or some other compiler,
modules — the Hitachi 44780 chip that handles all of the the software setup is very similar. Let me show you how
character generation. If you find an LCD module with that it’s done.
chip, then you are set. You can get that type of LCD
module from the typical suppliers, such as Mouser,
Jameco, or visit individual websites. One of my favorites is
PROJECT DESCRIPTION
junun.org. They sell robot kits and parts, and also have a To start, let me explain how the custom characters are
great deal on LCDs. You can even get surplus LCDs and set up in the LCD. The LCD control chip has eight locations
LCDs removed from equipment, at Marlin Jones at the beginning of its character memory, which can be
(MPJA.com) and others, at incredibly cheap prices. In fact, modified to make custom 5x8 characters. Once those are
I use a surplus unit in this month’s project. stored in the LCD’s chip, these custom characters can be
For this month’s article, I wanted to cover a little called in the same manner as any standard, pre-stored ASCII
different feature of the Hitachi LCD chip’s character character. In Figure 1, a 5x8 character bitmap is shown with
generator, which many of you may not know about. The the first custom character the program will define.
first eight locations of character memory can be modified This custom character will be placed at memory
to make custom 5x8 pixel characters. This month, I will location $00 of the LCD character memory. It then forms a
load custom 5x8 characters into those eight locations and small ramp that slopes downward.
then use them to display large characters on a 4x20 LCD. Each row of the character has to be defined by a
I will drive the 4x20 LCD from a BasicATOM 28-pin chip, byte value. Since the characters are only five bits wide in
which is just a PIC16F876A with the custom BasicATOM size, the three most significant bits of the byte value are
always zero. The highest bit
■ FIGURE 1. Custom LCD character value used is the fifth bit (bit
using the “Character Box.” number 4).
The key is to set or clear
the proper bits to form the

■ FIGURE 2. Custom LCD


characters.

NOTE: PIC is a registered


trademark of Microchip
Technology, Inc., in the USA
and other countries. All other
trademarks mentioned herein
are property of their respective
companies.
14 September 2007
GetStartedWithPICs.qxd 8/7/2007 11:33 AM Page 15

G E T T I N G S TA R T E D W I T H P I C s

character you want. For example, if you look at the fourth


line of the character box (offset row value 3); the byte to the
right shows hex $10 or binary %00010000. This makes the
fifth block solid black, but the rest of the row clear. The next
line sets two blocks black, by using hex byte $18 or binary
%00011000, and the rest you can see in Figure 1. By
setting these bits and storing the data in the LCD’s
character memory, we have established a new custom
character that the software can call.
This doesn’t stop us from displaying standard, single-
line words on the LCD screen. It does, however, allow us
to also create large digits that span all four lines of a 4x20
LCD, by using the custom characters shown in Figure 2. ■ FIGURE 3. An example of a large character.
It shows seven custom characters on line 2 of the LCD,
but the eighth custom character is a blank so it doesn’t x var byte
appear. The main project software loop (discussed later) char var byte
epin con 3 ‘Establish nickname for LCD enable pin
will create the hexadecimal number system and display rspin con 0 ‘Establish nickname for LCD Register
them in sequence, starting with the numbers 0–9 and Select pin
then A–F, all in a large-character format that spans
all four lines. The number “1” is displayed in Figure 3 The program initializes the LCD by first waiting a half
to illustrate what I’m trying to describe. Using large second for it to warm up, and then it issues the LCDWRITE
numbers like this makes it very easy to read from across command to set it up as a two-line LCD. A 4x20 LCD is
the room. really a two-line by 40 character LCD, with line 1 broken up
between lines 1 and 3, and line 2 broken up between lines
2 and 4, to form a 4x20 LCD.
PROJECT SETUP
If you remember the 2x16 LCD project that I did ‘ *** Initialize LCD ***
pause 500
in a previous column, then you will find the 4x20 LCD lcdwrite
has all the same connections. A great advantage to rspin\epin,outc,[initlcd1,initlcd2,twoline,scr,clear,home
using LCD modules is their common connection system, ]
which makes it easy to change from 2x16 to 4x20.
Figure 4 shows the connections to the Ultimate OEM
BasicATOM module. You can easily connect the LCD to a
PIC16F876A directly, by following the connection names
in the schematic.

SOFTWARE
This software listing is kind of long, but most of the
code deals with setting up the LCD to display the large
custom characters. (The complete software listing is
available on the Nuts & Volts website at www.
nutsvolts.com.) In the code, you will notice the “|” pipe
character at the end of several lines. This is for line
continuation. This is a special character that the BasicATOM
compiler recognizes as a continuation message. When the
compiler sees that character, it knows the command line
was too long for the editor window and continues on the
next line. Setting up the characters takes a lot of space, so
the line-continuation function is used often.

HOW IT WORKS
First, we establish a few variables and constants. The
variables are just temporary storage locations labeled X and
Char. The constants define the LCD “E” pin and “RS” pin.
■ FIGURE 4. Connections to the Ultimate
OEM BasicATOM module.
September 2007 15
GetStartedWithPICs.qxd 8/7/2007 11:33 AM Page 16

The next section is the heart of this program. In this for x = 0 to 7


block of code, the custom characters are created and lcdwrite rspin\epin,outc,[x]
next
stored in the LCD character memory locations 0 through 7.
Each character takes eight bytes of data, for a total of 64
bytes (eight characters times eight bytes). We finish this block of code by displaying “Custom
To do this, we first have to point to location zero of the Characters” and “Demo in three seconds” to the display
Character RAM. We do this with the LCDWRITE command, lines 3 and 4. SCRRAM +$14 is the beginning of line 3, and
again by sending the “CGRAM” pointer. We don’t have SCRRAM +$54 is the beginning of line 4.
to add an address value, since it defaults to the zero or
first location. lcdwrite rspin\epin, outc,[scrram + $14, |
“Custom Characters”]
lcdwrite rspin\epin, outc,[scrram + $54, |
‘*** Create Custom Characters in LCD memory locations 0- “Demo in 3 seconds”]
7 ***
Finally, we pause three seconds so you can read the
lcdwrite rspin\epin,outc,[CGRAM]
display and then move on to the next section.

Now, we send the custom characters to the LCD pause 3000


character RAM by using a FOR-NEXT loop and the
LOOKUP command. The FOR-NEXT loop counts from 0 to From here, the program creates the custom large char-
63, for a total of 64 loops, and it defaults to stepping one acters using the custom 5x8 characters stored in CGRAM. I’ll
count per loop. The variable x stores the present loop count just describe the digit 1 shown in Figure 3, but all the other
value. The LOOKUP command then takes the value of large character sections below operate in the same manner.
x and jumps that many places, reads the byte value, and The #1 character is created by placing custom
stores it in the “char” variable. For example, lets assume characters 1 and 6 on line 1, character 6 on line 2,
x = 5 or the sixth time through the loop since the count character 6 on line 3, and characters 5, 6, and 5 on line 4.
starts at zero. The value of “char” will equal $1C, since it is We then pause one second, so the digit can be read. The
the sixth value listed. SCRRAM is offset with values that center the 1 on the LCD.

for x = 0 to 63 ‘ *** “1” character


lcdwrite rspin\epin,outc,[clear,home,scrram+$09,1,6,|
lookup scrram+$4A,6,scrram+$1E,6,scrram+$5D,5,6,5]
x,[$00,$00,$00,$10,$18,$1C,$1E,$1F,$00,$00,$00,$01,| pause 1000
$03,$07,$0F,$1F,$1F,$1E,$1C,$18,$10,$00,$00,$00,$1F,$0F,|
$07,$03,$01,$00,$00,$00,$1F,$1F,$1F,$1F,$00,$00,$00,$00,|
$00,$00,$00,$00,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,| The rest of the large digits (0 through F) are created in
$1F,$1F,$00,$00,$00,$00,$00,$00,$00,$00], char
a similar fashion. Each is displayed, and then a final message
lcdwrite rspin\epin,outc,[char] is displayed. The final section of code displays, “Just
next imagine what you can do.”

After the code above executes, the custom characters ‘ *** Final message from program before looping back to
are now in the LCD character-generator memory. The the top ***
program can now call them to create the large characters lcdwrite rspin\epin,outc,[clear,home,scrram,|
on the LCD. The “main” label starts the central program ”Just imagine what”,scrram+$40,”you can do!”]
loop. In the section below main, we use the LCDWRITE pause 3000
command to display a description of what this program will goto main
do, as shown in Figure 2. We display “Large Digits Using”
by using the LCDWRITE command. With this custom character method, you can create just
about anything on an LCD screen.
‘ *** Initial screen with program description ***
main
lcdwrite rspin\epin,outc,[clear,home,scrram,”Large Digits NEXT STEPS
Using”]
lcdwrite rspin\epin,outc,[scrram + $40] The projects that can result from this are endless. Just
remember that nothing stops you from redefining the
This next section will call up the custom characters just custom characters in the middle of the program. Let’s say
created, one at a time, using a FOR-NEXT loop, and will you want to display large characters, initially, and then later
display them using the LCDWRITE command. The variable in the program want to create an animation using different
x holds a value from 0 to 7. LCDWRITE directs the LCD to custom characters.
display characters 0 through 7. See how easy it is to display After completing the large custom number characters,
custom characters, once they are created? clear the LCD screen and then load new custom characters
16 September 2007
GetStartedWithPICs.qxd 8/7/2007 11:42 AM Page 17

G E T T I N G S TA R T E D W I T H P I C s

in CGRAM locations 0–7. From these new characters, you of detailing how to use the PIC16F877A MCU with MBasic
can create the animation. Since the custom characters load Pro. Best of all, his book’s CD includes a free version of the
in CGRAM quikly, the person watching the display just MBasic Pro compiler, which is limited to working with the
notices a frame change from words to large digits to PIC16F876(A). This offers you the option to take a 28-pin
animation. I’ve seen custom characters that had the old BasicATOM chip design and move it pretty easily to a
Pacman character eating dots across the screen. PIC16F876A — all for the cost of a book and a programmer
(to load the .hex file into the PIC16F876A). Check it out.
Feel free to email me with your comments at
CONCLUSION [email protected], and thanks for all of the feedback I
By no means am I declaring that I invented this custom- continue to get. I do like reading the feedback and try to
character method. In fact, there are numerous sites on the respond to all of the emails as quickly as possible. See you
Internet that refer to creating custom characters on an LCD. next month. NV
Scott Edwards (www.seetron.com)
even incorporates this type of
large-character generation into his
PIC MCU-driven serial LCD modules.
If you are really creative, you can
probably create a whole animated
cartoon on the LCD by constantly Easy Ordering In Nanoseconds
changing the custom characters. It will
potentially take a lot of memory, but
most graphic programs do.
I once again used the BasicATOM
chip, because of the simplicity of the
software and the low cost for any
reader that wants to follow along by
doing the projects. I have received
many emails from readers asking me
to pick a platform and stick with it.
Because Basic Micro (creator of the
BasicATOM) also has a Basic compiler
— which is called the MBasic
Professional compiler — this platform
offers the reader the option to start
cheap with the BasicATOM software
via a free download and a $20
BasicATOM chip (which should be
cheaper by the time you read this).
Eventually, most people will move to
programming blank PIC MCUs, to
save money on larger-volume projects.
Here’s a tip for readers: There
is a book available in the Nuts & Volts
Hobbyist Store (www.nutsvolts.com)
• The ONLY New Catalog Every 90 Days
called Programming the PIC
Microcontroller in MBasic by Jack • NEWEST Products & Technologies
Smith (this has a similar title and exact- • Over 850,000 Products Online
ly the same publisher as my PICBASIC
• More Than 330 Manufacturers
compiler book). Jack does a great job
• No Minimum Order
This book is • Fast Delivery, Same-day Shipping The Newest Products
available in our For Your Newest Designs
store on page 100.
Visit mouser.com (800) 346-6873
www.nutsvolts.com
or call 800-783-4624. The NEWEST Semiconductors | Passives | Interconnects | Power | Electromechanical | Test, Tools & Supplies

$59.95 Mouser and Mouser Electronics are registered trademarks of Mouser Electronics, Inc. Other products, logos, and
company names mentioned herein, may be trademarks of their respective owners.

September 2007 17
NutNVolt200709.qxd 8/8/2007 3:45 PM Page 18

It’s Back To School Time


Providing Fun Electronics Learning Kits For Over 3 Decades!

Tickle-Stick Shocker Super Snoop Amplifier Dripping Faucet


The kit has a pulsing 80 volt tickle Super sensitive amplifier that will Produces a very pleasant, but obnox-
output and a mischievous blink- pick up a pin drop at 15 feet! Full 2 ious, repetitive “plink, plink” sound just
ing LED. And who can resist a watts output drives any speaker for a like a drip into a bowl of water! Learn
blinking light and an unlabeled great sound. Makes a great “big ear” how a simple transistor oscillator and a 555
switch! Great fun for your desk, “Hey, I told you not to microphone to listen to the “wildlife” both in timer can make such a sound! Drives any speaker for a
touch!” Runs on 3-6 VDC. the field and in the city! Runs on 6-15 VDC. cool sound. Runs on 4-9 VDC.
TS4 Tickle Stick Kit $12.95 BN9 Super Snoop Amp Kit $9.95 EDF1 Dripping Faucet Kit $9.95

LED Blinky Cricket Sensor Electronic Siren


Our #1 Mini-Kit for 35 years! Not only does it chirp just like a Exactly duplicates the upward and down-
Alternately flashes two jumbo red real cricket, it also senses temper- ward wail of a police siren. Switch clo-
LED’s. Great for signs, name badges, ature and changes the chirp sure produces upward wail, releasing it
model railroading, and more. Used throughout accordingly. Can actually deter- makes it return downward. Produces a loud
the world as the first learning kit for students young and mine temp by chirps! Squishing under your feet voids 5W output, and will drive any speaker! Horn speakers
old! Great solder practice kit. Runs on 3-15 VDC. warranty! Runs on 9VDC battery. Speaker included. sound the best! Runs on 6-12 VDC.
BL1 LED Blinky Kit $7.95 ECS1 Cricket Sensor Kit $24.95 SM3 Electronic Siren Kit $7.95

Universal Timer Voice Activated Switch Tone Encoder/Decoder


Build a time delay, keep something on Voice activated (VOX) provides a Encodes OR decodes any tone 40 Hz to
for a preset time, provide clock pulses switched output when it hears a 5KHz! Add a small cap and it will go as
or provide an audio tone, all using the sound. Great for a hands free PTT low as 10 Hz! Tunable with a precision 20
versatile 555 timer chip! Comes with circuit switch, or to turn on a recorder or light! turn pot. Great for sub-audible “CTS” tone squelch
theory and a lots of application ideas and schematics to Directly switches relays or low voltage loads up to encoders or decoders. Drives any low voltage load up
help you learn the 555 timer. Runs on 5-15 VDC. 100mA. Runs on 6-12 VDC. to 100mA. Runs on 5-12 VDC.
UT5 Universal Timer Kit $9.95 VS1 Voice Switch Kit $9.95 TD1 Encoder/Decoder Kit $9.95

RF Preamplifier Touch Switch Walking Electronic Bug


The famous RF preamp that’s been Touch on, touch off, or momentary Built around a pair of subminiature
written up in the radio & electronics mag- touch hold, it’s your choice with this cell phone motors, this bug wanders
azines! This super broadband preamp cov- little kit! Uses CMOS technology. around looking for things to bump
ers 100 KHz to 1000 MHz! Unconditionally stable gain Actually includes TWO totally separate touch circuits on into! Sensors below his LED eyes sense
is greater than 16dB while noise is less than 4dB! 50- the board! Dries any low voltage load up to 100mA. proximity and make him turn away! Steer him with
75 ohm input. Runs on 12-15 VDC. Runs on 6-12 VDC. flashlights too! Runs on two “N” batteries.
SA7 RF Preamp Kit $19.95 TS1 Touch Switch Kit $9.95 WEB1 Walking Bug Kit $29.95

Mad Blaster Warble Alarm DTMF Encoder Decoder Cable Polarity Checker
If you need to simply get atten- Decodes standard Touch Tones from Checks continuity AND polarity of
tion, the “Mad Blaster” is the telephones, radio, or any audio a pair of wires! Simply connect
answer, producing a LOUD ear shat- source. Detects and decodes any the remote board to one end, and the tester
tering raucous racket! Super for car single digit and provides a closure to the other end and LED’s show opens,
and home alarms as well. Drives any to ground up to 20mA. Great for shots, and polarity! Even includes auto power
speaker. Runs on 9-12VDC. remote tone control Runs on 5VDC. off! Runs on a standard 9V battery.
MB1 Mad Blaster Warble Alarm Kit $9.95 TT7 DTMF Encode/Decode Kit $24.95 MK132 Cable Polarity Checker $7.95

Water Sensor Alarm RF Actuated Relay Light Actuated Switch


This little $8 kit can really “bail you out”! Just what you need when adding Tired of turning your lights off? This little
Simply mount the alarm where you want to a preamp or power amp in line kit auto senses light and automatically
detect water level problems (sump pump!). with an antenna! Auto senses RF closes the on-board SPDT relay. Light
When the water touches the contacts the and closes an on-board DPDT relay that’s good to UHF sensitivity is adjustable and a delay cir-
alarm goes off! Sensor can even be remotely at 100W! Also great to protect expensive RF test equip- cuit prevents recycling. Relay contacts are rated at 5A.
located. Runs on a standard 9V battery. ment. Senses as low as 50mW! Runs on 10-15VDC. Runs on 12-15VDC.
MK108 Water Sensor Alarm Kit $7.95 RFS1 RF Actuated Relay Kit $19.95 MK125 Light Actuated Switch Kit $7.95

Power Saver Timer IR Remote Control Checker Stereo Ear Super Amplifier
Add time delay power-off to any Is your IR remote control working? Just point Ultra high gain amp boosts audio 50
of your projects or circuits! and shoot, and this kit will let you know! times and it does it in stereo with its
Momentary push button selects Confirms IR signal generation from any IR dual directional stereo microphones!
desired time delay (1H, 2H, 4H, remote and displays proper receipt on the four Just plug in your standard earphone or
8H, 24H) and LED flashes faster as time approaches. LED display. Don’t change the batteries, check headset and point towards the source. Great
On-board 10A relay. Runs on 120/240VAC. the remote first! Runs on a standard 9V battery. stereo separation besides! Runs on 3 AAA batteries.
K8075 Power Saver Timer Kit $24.95 MK137 IR Remote Checker Kit $6.95 MK136 Stereo Ear Amplifier Kit $9.95

Steam Engine & Whistle SMT Multi-Color Blinky SMT High Intensity Blinky
Simulates the sound of a vintage The ultimate blinky kit! The 8-pin micro- The SMT revival of our classic BL1!
steam engine locomotive and controller drives a very special RGB LED in Super bright SMT LED’s alternately flash
whistle! Features variable engine 16 million color combinations! Uses PWM in a brilliant display. Subminiature con-
speed and volume. Whistle blows at methods to generate any color with the micro, struction makes it perfect for badges and
a touch of a button! Great for model train setups. with switchable speed selection. SMT construction with displays. SMT construction with extra parts when you
Includes the speaker. Runs on a standard 9V battery. extra parts when you lose them! Runs on 9V battery. drop them! Includes two LR55 button cells.
MK134 Steam Engine & Whistle Kit $10.95 SBRGB1 SMT Multi-Color Blinky Kit $29.95 BL2 SMT High Intensity Blinky Kit $17.95

Did You Know... ✔ It’s impossible to give you full specs on these products in a 1” space!
✔ A lot of our kits are also available “factory assembled and tested”, if you don’t want to build it!
✔ We have over 350 products currently available, and all those don’t fit here!

The Solution! Visit www.ramseykits.com


Free Giveaways and ALL the information you ever needed!
NutNVolt200709.qxd 8/8/2007 3:47 PM Page 19

SMT Soldering Course & Lab Soldering Lab Soldering-Parts Lab


✔ Learn all about those tiny little parts! ✔ Learn soldering! ✔ Learn soldering!
✔ Develop and practice your SMT solder ✔ Includes practice ✔ Learn parts ID!
ing skills! excersises! ✔ Learn color codes!
✔ Includes SMT training sessions ✔ Detailed train- ✔ Detailed course &
✔ End up with a neat “Decision Maker” ing manual! exam!

Surface Mount Technology (SMT) has This is a beginner’s Not only will you learn
become a way of life for electronics. Virtually project specifically soldering and desol-
all new high tech products utilize SMT design designed to teach you the fundamen- dering but you will also learn compo-
and components. Even our latest Ramsey kits include various SMT components. tals of soldering and working with nent identification and color codes.
There are two problems with SMT: First, the parts are extremely small, at times printed circuit boards.
the size of a pin head! Therefore, you need to have the proper tools, not only to With 163 solder points, you will learn
hold them and solder them, but to see them! (Check out the tools section at Like any skill, good soldering requires and practice standard soldering, close
ramseykits.com for help!) Secondly, unlike “through hole” parts, SMT components practice as well as an understanding of tolerance soldering, tack soldering and
are soldered directly on the surface of the PC board (hence the name SMT!) This the principles involved. You will desoldering. Plus you will learn com-
is an entirely new method of soldering, and it takes practice to get it right. Trust become familiar with PC boards, the ponent identification and complete
me, I’ve created a number of solder bridges myself when I first started soldering how’s and why’s of soldering, compo- color codes. Even includes a color
SMT components! nents, component installation, and code calculator! Also learn voltage and
troubleshooting soldering problems resistance analysis in circuits. Com-
Taking this course and practicing on the neat little kit will prepare you for the (including solder bridges!) Project prehensive manual includes written
future in electronics. Includes the PC board, all the SMT and other components runs on a standard 9VDC battery, not and visual exams. Project runs on a
required, and a comprehensive training course covering all aspects of SMT solder- included. standard 9VDC battery, not included.
ing, desoldering, removing, and component placement. The finished project is a SP1A Soldering Lab $9.95 SP3B Soldering-Parts Lab $9.95
neat little “Decision Maker” that includes 6 flashing SMT LEDs, complete with a
professional overlay panel. The finished Decision Maker runs on a standard 9VDC
battery, not included. Non-Conductive Tweezers
SM200K Practical SMT Soldering Course & Lab $20.95 ✔ Great for SMT and small parts
✔ ESD safe!
AM/FM IC Radio & Training Course We’ve discussed tweezers and magnifiers while working
✔ Learn all about AM/FM radio with SMT components. Working with some highly sensitive
design and theory! components our engineers asked for some ESD safe tweezers. We looked, we
✔ Build a high performance found, and they are a life saver! This set of 4 non-conductive tweezers are perfect
radio with an IC! for any static sensitive devices you may be working on. And...they are priced right!
✔ Step by step assembly and VTTWSET2 Non-Conductive Tweezers Set $3.95
test procedures
✔ Great for student projects!
This Superhet 108 AM/FM Radio Electronic Learning Labs
Kit is a “superheterodyne” receiv-
er of the standard AM (amplitude PL200
modulation) and FM (frequency modulation)
broadcast frequencies. The unique design of the Superhet 108 includes an inte-
grated circuit (IC), 9 transistors, 4 diodes, and other related resistors, capacitors,
coils, and misc. parts. Because good soldering practices are important, a soldering PL130
guide is also provided as well as a component color code and pictorial identifica- PL300
tion chart. ✔ Learn and build!
✔ 130, 200, 300, & 500 In One! PL500
The actual assembly is broken down into 9 sections. The theory of operation for ✔ Super comprehensive training manuals!
each section, or stage, should be read before the assembly is started. This will Whether you want to learn the basics of electricity, the theory of electronics, or
provide the student with an understanding of what that stage has been designed advanced digital technology, our lab kits are for you! Starting with our PL130, we
to accomplish, and how it actually works. After each assembly you will be give you 130 different electronic projects, together with a comprehensive 162
instructed to make certain tests and measurements to prove that each section is page learning manual. A great start for the kids...young and old! Next, check out
functioning properly. If a test fails to produce the proper results a troubleshooting the PL200, that gives you 200 very creative and fun projects, and includes a neat
guide is provided to help you correct the problem. interactive front panel with 2 controls, speaker, LED display and a meter.
After all of the stages have been built and tested a final alignment procedure is From there, step up to our PL300, which gives you 300 separate electronic proj-
provided to peak the performance of the receiver and maximize the Superhet ects along with 165 page learning and theory manual. The PL300 walks you
108’s reception capabilities. Runs on a standard 9VDC battery, not included. through the learning phase of digital electronics.
(This is today’s version of the “5 tube superhet radio I built in Mr. Baehre’s 9th
grade electronics shop class!) If you’re looking for the ultimate lab kit, check out our PL500. Includes a whop-
AMFM108K AM/FM Integrated Circuit Radio & Training Course $34.95 ping 500 separate projects, a 152 page starter course manual, a 78 page
advanced course manual, and a 140 page programming course manual! The
PL500 covers everything from the basics to digital programming!
3-in-1 Multifunction Lab Learn all about electronics theory, and digital technology the fun way and build
✔ Digital multimeter! some neat projects!
✔ Regulated power supply!
✔ Temp controlled soldering station! PL130 130 In One Learning Lab Kit $42.95
✔ RoHS lead-free compatible! PL200 200 In One Super Fun Learning Lab $54.95
PL300 300 In One Advanced Learning Lab Kit $69.95
Take a close look! On your left is a multi- PL500 500 In One Super Learning Lab Kit $169.95
function 3½ digit digital multimeter. Its large backlit LCD display can be seen
from anywhere on your bench while you’re working. The DMM also features
built-in transistor, diode, and continuity testing, data hold, and audible alarm.
Next up, the regulated lab DC power supply. Switch selectable ranges of 3V, 4.5V,
6V, 7.5V, 9V, and 12V provide a continuous duty current of 1.5 amps with a 2 amp MORE than just friendly on-line ordering!
peak! Features both overload protection and overload indication. Clearance Specials, Ramsey Museum, User Forums, Dealer Information, FAQ’s, FCC
To the right we have a high quality temperature regulated soldering station. The
Info, Kit Building Guides, Downloads, Live Weather, Live Webcams, and much more!
24V low voltage iron features an isolated ceramic 48 watt temperature controlled
element. Front panel control gives you variable tip temperature control from
150°C to 450°C and LED indication of power-on and heating-on. Runs on 120VAC.
LAB1U 3-in-1 Multifunction Lab $119.95
www.ramseykits.com
800-446-2295
Get The Catalog! Where ✦ Build It!
Get the latest 2007 Ramsey Hobby Catalog! 590 Fishers Station Drive Electronics ✦ Learn It!
96 value packed pages of the neatest Victor, NY 14564 Is Always ✦ Achieve It!
(800) 446-2295
goodies around! Order yours on-line today (585) 924-4560 FUN! ✦ Enjoy It!
or give us a call! Or download the PDF at
Prices, availability, and specifications are subject to change. Not responsible for typos, stupids,
www.ramseykits.com. printer’s bleed, or dorm room parties. Robin wanted the ad copy early again, so this month’s
typo’s are on her! Visit www.ramseykits.com for the latest pricing, specials, terms and conditions.
Copyright 2007 Ramsey Electronics, LLC...so there!
NearSpace.qxd 8/6/2007 12:47 PM Page 20

SPACE
NEAR

APPROACHING THE FINAL FRONTIER


■ BY L. PAUL VERHAGE

SOME SENSORS FOR YOUR


BALLOONSATS AND THE GREAT
PLAINS SUPER LAUNCH
NOW THAT YOU HAVE A BalloonSat flight computer (see the November ‘06
issue of Nuts & Volts ), what are you going to measure with it? Well, this month
we’ll look at two sensors: a miniature near space weather station and a
temperature sensor array. With these sensor arrays, your BalloonSat can chart
environmental conditions from the ground to near space and measure the
temperatures of your experiments. Afterwards, I’ll give you a short report on the
Great Plains Super Launch. So, fill your balloon with helium and let’s get started.
(because BalloonSats are typically Most of these items are available
NEAR SPACE WEATHER limited to one pound of weight). I like from electronics companies like
STATION the weather station for its compact size Jameco and they don’t need further
and also for its affordability (around explanation. But we will take a closer
The miniature weather station $50, as I recall). Now, the only thing look at the sensors at the heart of the
measures air temperature, pressure, that this weather station can’t measure miniature weather station.
and relative humidity along with the that typical home weather stations The LM335 is a voltage controlled
internal temperature of the BalloonSat can is the wind speed and direction. zener diode in a TO-92 form factor.
(Figure 1). I’ve flown this sensor array However, since balloons are forced to So, it looks like a small transistor (e.g.,
on several BalloonSats and I’m very move with the wind, the GPS receiver the 2N3904). The LM335 drops a
happy with the way it functions. To fly onboard the near spacecraft that is car- voltage that’s proportional to its tem-
as a BalloonSat experiment, the weath- rying the BalloonSat will fill in the wind perature. Specifically, it drops one volt
er station must be small and lightweight data. Aside from near space use, this per one hundred kelvins and (ideally)
miniature weather station could be part zero volts at zero kelvins. The kelvin is
of a traditional home weather station or equivalent to a degree Celsius, but the
NEAR SPACE WEATHER part of a Mars or Titan model rover. Kelvin temperature scale begins at
STATION PARTS LIST absolute zero — the coldest tempera-
• Two LM335 temperature sensors ture possible. You can download
• SM5812 absolute pressure sensor the datasheet for the LM335 at the
(0–15 PSI) National site (www.national.com/pf/
• HIH-4000 (or the equivalent older LM/LM335.html).
HIH-3610) relative humidity sensor The HIH4000 is a three pin SIP
• Two 1K 1/4W resistors
relative humidity sensor that is manu-
• 0.1 µF capacitor
• Weather station printed circuit boards
factured by Honeywell. The sensor
(see the diagram in this month’s produces a voltage that is linear with
column) respect to relative humidity. At 0%
• 24 AWG stranded wire RH, the sensor produces an output of
• Headers (0.1” spacing) 0.8 volts and it maxes out at 100%
• Receptacles (0.1” spacing) relative humidity with a voltage of 3.86
• Thin heat shrink ■ FIGURE 1 volts. That makes its voltage output
20 September 2007
NearSpace.qxd 8/6/2007 12:47 PM Page 21

N E A R S PA C E

0.0306 volts per percent of relative perature sensor (for the interior of the ■ FIGURE 2. The
humidity. Exercise caution when using BalloonSat) is mounted on a separate placement of parts
this sensor and do not touch its face; printed circuit board (PCB). Since the for the near space
moisture and skin oil can damage the rest of the weather station is mounted weather station.
sensor. You can find the datasheet for outside of the BalloonSat, the
this sensor at Phil Anderson’s website BalloonSat airframe needs an opening
(www.phanderson.com/hih4000.pdf). to pass the cable between the two
I found a distributor for this sensor at PCBs. To keep this opening in the
Newark (www.newark.com). BalloonSat airframe small, I designed
The SM5812 is a silicon micro- the external portion of the weather
electric mechanical system (MEMS) station to be connected to the internal
based pressure sensor. Inside the portion with a header and receptacle.
sensor is a vacuum sealed “cup” with There’s nothing difficult about
a thin silicon lid. As the air pressure on assembling the miniature near space
the sealed cup changes, the stress of weather station. However, I would still
the silicon lid also changes. Stress in recommend placing lowest lying
the silicon lid changes its resistance components first, but there are no
and therefore, the voltage dropped tight fitting components that require
across it. The circuitry in the SM5812 you do it this way. The additional
calibrates and amplifies the output holes in the PCB’s ground plane are
voltage of the sensor. The sensor pro- strain relief for the wires in the
duces 0.5 volts at zero PSI of pressure weather station cables. So, pass wires
and 4.5 volts at 15 PSI. through those holes before you solder
Between the two extremes, the them to the PCB. I would recommend
output voltage is linear with respect to making the power wire red and the
pressure. You can find more information ground wire either green or black.
on this sensor at the Silicon Cut the five wires that you soldered
Microstructures website (www.si- to the external PCB to a length of six
micro.com) under the SM58 product inches. The five wires terminate with a
series. The SM5812 is available from 1x5 header to form a unified cable that
Servoflo Corporation (www.servoflo. connects the external weather station to
com). Since Servoflo is not ready to the internal temperature sensor through
take online orders, call them at (866) its receptacle. I prefer to make my cable
830-9572 to order a SM5812. by tinning the short pins of the 1x5 male the soldered wire and header. Now you
header and the 1/4 inch long bare ends only have to repeat this four more times.
of the wires. Then slide thin heat shrink The internal temperature sensor
ASSEMBLING THE over the ends of the wires and press a board has its own cable that plugs the
MINIATURE NEAR SPACE tinned wire to a tinned header pin. weather station into the BalloonSat’s
WEATHER STATION When the pin and wire are heated, the ADC channels. I make this cable the
solder in each fuses together. Remove same way as the last one (except
You’ll notice that the second tem- the heat and slide the heat shrink over there are six wires in this cable). If you
■ FIGURE 3. This is the external portion of the weather station ■ FIGURE 4. The internal portion of the weather station.
(PCB and five components). The newer version described in The PCB has a LM335 temperature sensor and a receptacle.
this month’s column includes a filtering capacitor that was The header soldered to the end of the external portion of the
left out in the original design. weather station terminates in a 1x5 header pin. Since I didn’t
have a three row header, I’m using two 2x3 headers (on the
left) to connect the weather station to the BalloonSat Flight
Computer’s ADC channels.

September 2007 21
NearSpace.qxd 8/6/2007 12:47 PM Page 22

■ FIGURE 5. Peek-a-boo, I see Celsius temperature by the difference in


a pressure sensor.The weather the slope between the Fahrenheit and
station is hiding from the Celsius scales (there are 1.8 Fahrenheit
sunlight inside this cardboard degrees in a Celsius degree). Then, 40°
tube. The Popsicle stick is
attached to the tube and is used
is subtracted from the result to shift the
to rubberband the weather result properly back to the Fahrenheit
station to the outside of a scale. I like this method of converting
BalloonSat. between Fahrenheit and Celsius
because the concept is so simple.
Computer’s eight-bit ADC,
have a three row header, use it for the here are the Excel formulas needed Pressure Equation
cable. If you don’t — like me — then to calculate temperature, pressure, = ((X1-25.6)/204.8)*1013
use two 2x3 headers to terminate the and relative humidity.
I/O cable. Again, it would be a good where X1 is the cell address of
idea to use color coded wires for this Temperature Equation the ADC’s pressure value loaded in
cable (Figure 4). = (((((X1/255)*500)-273)+40)*1.8)-40 the spreadsheet.
The weather station’s external sec- Since the pressure sensor bottoms
tion needs to be protected from direct where X1 is the cell address of the out with 0 PSI at 0.5 volts, the formula
exposure to sunlight. That’s because ADC’s temperature value loaded in subtracts 0.5 volts from the ADC read-
direct sunlight affects the outputs from the spreadsheet. ing (25.6) then divides the result by the
the relative humidity and temperature You’re probably asking what is maximum swing in ADC readings
sensors. For my weather station, I going on with this formula. The formu- (204.8) to calculate the air pressure rel-
bolted this section to the inside of a la converts the eight-bit ADC reading ative to mean sea level pressure. The
short length of cardboard tube (Figure into a percentage of the ADC range (0 ratio is multiplied by 1013 — sea level
5). In a second weather station I made, to 255) then into a temperature in units atmospheric pressure in millibars — to
the housing is made from Correplast of kelvins by multiplying by 500. Next, calculate the pressure in units of
plastic, hot glue, and white tape. 273 is subtracted to convert the value millibars. Alternatively, the 1013 can be
Whatever the housing, I recom- from the Kelvin scale to the Celsius replaced by 14.7 to calculate the pres-
mend coloring it white to reflect scale. Now the Celsius and Fahrenheit sure in units of pounds per square inch.
as much sunlight as possible; you temperature scales have the same tem-
don’t want a dark housing changing perature at -40°. So -40°F and -40°C are Relative Humidity Equation
what the LM335 measures as the air the same temperature. If you were to = ((X1-41)/155)*100
temperature. Be sure to leave the chart the Celsius and Fahrenheit
housing open so that air can flow temperature scales relative to the where X1 is the cell address of the
across the LM335 temperature sensor. Fahrenheit scale and shift the zero ADC’s relative humidity value loaded
degree point back 40°, there would be in the spreadsheet.
no Y-intercept in the two lines; they Since the relative humidity sensor
OUTPUT FROM THE would only vary by their slope. The produces 0.8 volts at 0% relative
NEAR SPACE WEATHER formula takes advantage of this rela- humidity, 41 must be subtracted from
STATION tionship and adds 40° to the Celsius the ADC value. The highest relative
reading to remove the Y-intercept and humidity reading is 3.86 volts, or 196.
Assuming the weather station is allow us to multiply (or divide if you So, the result from the initial subtraction
connected to the BalloonSat Flight want to go the other direction) the is divided by 155 (196 minus the initial

■ FIGURE 6 ■ FIGURE 7

22 September 2007
NearSpace.qxd 8/6/2007 12:47 PM Page 23

N E A R S PAC E

■ FIGURE 8 ■ FIGURE 9

value of 41) and then multiplied by temperature of -60 degrees Fahrenheit. ors (black, white, silver, and light blue).
100% to calculate the relative humidity. In the winter, I typically see it lower to To reduce variations in the experiment, I
Once you’ve finished editing your 40,000 feet and drop down to -90°. flew all four cubes on the same mission.
data in Excel or other spreadsheet, The latitude does affect the altitude That meant I needed four temperature
you need to include a column for and temperature of the tropopause. sensors for the mission. Instead of build-
altitude. You can look at the TNC log The relative humidity chart in ing a temperature sensor for each cube,
from the mission to get this informa- Figure 7 shows us that the air gets drier I designed the following circuit board.
tion or calculate it by determining the with increasing altitude. But notice
climb rate of the near spacecraft and that the relative humidity spiked three
multiplying by mission elapsed time. times at 8,000, 12,000, and around
ASSEMBLING THE
When you’ve added the altitude to 35,000 feet. I don’t recall the weather TEMPERATURE
the spreadsheet, you can generate conditions on this flight, but I suspect SENSOR ARRAY
charts like the ones in Figures 6 there were clouds at these altitudes.
through 9 (these charts come from a The temperature chart in Figure 9 There’s no preferred order when
mission launched in late 2006). shows that the interior of the soldering the array together. Do note
The three I like best are Figures 7, BalloonSat stays significantly warmer
8, and 9 (the pressure seems boring to than the outside air. The airframe of
me). So let’s take a closer look at each this particular BalloonSat was 1/2 inch TEMPERATURE SENSOR
of them. Notice that the air tempera- thick Styrofoam. At 80 minutes ARRAY PARTS LIST
ture decreased with increasing altitude mission elapsed time, the balloon
• Four 1K resistors
until the BalloonSat reached an altitude burst. The movement of air over the • Four LM335 precision temperature
of 50,000 feet. From there, the air tem- BalloonSat as it fell chilled the external sensors
perature rises with increasing altitude. temperature sensor and cooled the • Thin gauge wire
The air temperature cools in interior of the BalloonSat. • A 3 x 4 male header (or equivalent)
the troposphere and rises in the • Thin heat shrink
stratosphere. The transition between • Printed circuit board (see the copper
the two is called the tropopause. The
TEMPERATURE SENSOR pattern on the Nuts & Volts website
troposphere cools with increasing ARRAY at www.nutsvolts.com)
altitude primarily because the balloon
is moving away from its major source The last sensor I want to dis-
of heat — the earth’s surface. The strat- cuss this month is an array of tem-
osphere, on the other hand, warms perature sensors (Figure 10). Many
with increasing altitude because the years ago, I became curious about
balloon is moving closer to its primary how the color of my near space-
source of heat — the sun. craft would affect its internal tem-
Ozone in the stratosphere blocks perature. To find out, I created four
some ultraviolet radiation and identical foam blocks and covered
converts it into thermal energy. So it is them in materials with different col-
the presence of ozone that we’re
detecting above 50,000 feet when we ■ FIGURE 10. This is an older version
measure an increasing temperature. of the temperature sensor array
than I’m describing in this column.
In summer time, I typically see the The new design incorporates strain
tropopause at 50,000 feet and with a relief into the PCB.
September 2007 23
NearSpace.qxd 8/6/2007 12:48 PM Page 24

■ FIGURE 11. Here’s the heat and let cool.


placement of parts for the
temperature sensor array. 6) Slide heat shrink over the exposed
solder joint and shrink.

This process beats twisting and


soldering the wires together and it’s
strong enough for the LM335s. One
thing however, be sure you have the
LM335s in the correct orientation
before soldering its leads to the
wires in the cable. It won’t work if it’s
backwards (like most things in life).
To keep the cable neat and tidy,
twist the wires in each cable together.
Notice that only two wires are really
needed to solder the LM335 to the
PCB. I recommend using all three
wires to make the cable stronger.
After assembling a cable, wrap its
temperature sensor with a small sticky
label that has the sensor’s channel
printed on it. Then shrink clear heat
shrink tubing over the label to protect
it. You’ll appreciate seeing these labels
on your sensors when you’re putting
your experiment together. By the way,
though that each LM335 is soldered three wires in the cable and tin. be sure to write down the channel of
to the ends of three wires. The cable each temperature sensor and its
allows each LM335 to be routed to 3) Slide 1/2 inch long heat shrink experiment during assembly. You’ll
experiments that are remote from the tubing over the wires in the cable. need that information when you put
PCB. Here’s how I solder a LM335 to the spreadsheet together.
the end of a cable: 4) Press the LM335 lead against the The last cable is the interface to
bare end of a wire and heat with a the ADC of the flight computer.
1) Cut the leads of a LM335 to half soldering iron. Terminate it just like the other sensors
their length and tin. in this article with a 3 x 4 male header
5) After the solder in the LM335 lead and heat shrink. If you don’t have
2) Strip 1/4 inch of insulation from the and wire fuse together, remove the access to three row male headers, then
use two 2 x 3 headers to terminate it.
■ FIGURE 12
OUTPUT FROM THE
TEMPERATURE
SENSOR ARRAY
Since the temperature sensor
array uses the same temperature sen-
sor as the miniature near space weath-
er station, use the same Excel formula.
The chart in Figure 12 is an
example of the data that I’ve collected
from the temperature array sensor.
The temperature probes were routed
to four cubes: one was a plain blue
Styrofoam; the second, a Styrofoam
cube covered in black construction
paper; the third, a cube covered in
multilayer insulation (MLI — see note
24 September 2007
NearSpace.qxd 8/6/2007 12:48 PM Page 25

N E A R S PAC E

■ FIGURE 13. My highest altitude photog (near 87,000 feet).


It was a hazy morning over Nebraska, as you can see.
at end of this month’s column); and the last, a cube covered
in MLI and a black jacket of construction paper. As you can
see, they cooled close to the same rate initially. But as
they neared the stratosphere after 35 minutes of flight, their
temperatures deviated widely from one another. At balloon
burst (83 minutes into the mission), they chilled to nearly
the same temperature after 10 minutes.

THE GREAT PLAINS SUPER LAUNCH


OF 2007
The largest amateur radio, high altitude balloon
(ARHAB) event is the Great Plains Super Launch (GPSL).
Eleven weather balloons were launched on July 7th in on Saturday, but most of the groups stayed around for an
Grand Island, NE, the location of GPSL 2007. The Central informal dinner on Saturday evening. I hear this dinner was
Nebraska Near Space Project (CNNSP) hosted the two-day very successful and will be included in GPSLs in the future.
conference this year in their home town. Friday was spent There’s one more super launch planned for this year
in discussions, with several near space groups giving and several for 2008. The next GPSL will be held by Near
presentations on the art and science of their near space Space Ventures in Kansas City, MO. You can find the date
programs. There were discussions on air density and its and other information at the Super Launch website at
effect on a balloon’s coefficient of drag, flight computers, http://superlaunch.org. I hope to see you next year at one
balloon release mechanisms, and meteorology. of the super launches.
Along with the presentations there was lots of socializ- Onwards and Upwards
ing, especially over lunch and dinner. The new attendees Your Near Space Guide NV
were presented with a ton of information. One of this year’s
sponsors was Nuts & Volts Magazine (thanks guys). But the
best was Saturday morning. That’s when we filled and
launched our near spacecraft.
DePauw and Taylor Universities were there along with
amateur groups from Kansas, Nebraska, Idaho, Colorado,
Oklahoma, and Maine. The balloon filling took place early
in the morning so the balloons could be launched before
the surface winds picked up.
For additional insurance though, we filled the balloons
behind a row of organic wind blockers (otherwise known as
tall trees in Nebraska). I really have to hand it to Roger and
CNNSP for the great job they did finding a conference
center and launch site. Figure 13 shows a photograph from
GPSL 2007.
Every near spacecraft was recovered after they landed
except for one. We lost contact with its tracking capsule
shortly after lift off. I had to leave for Idaho just after lunch

BRIEF NOTE ABOUT MULTILAYER


INSULATION (MLI)
One of the best insulators is the Dewar flask
(which is the same thing as a thermos bottle). Usually
though, spacecraft cannot carry a glass thermos to
insulate themselves. So they’re covered in a fabric
version of this called MLI. I make my MLI with three
alternating layers of space blanket (aluminized Mylar)
and scrim (plastic wedding veil material). In a good hard
vacuum, this stuff will work great. But in near space with
its near vacuum, it’s not nearly as effective. But it still
beats launching a glass thermos bottle on a balloon.
September 2007 25
Page26.qxd 8/7/2007 10:40 AM Page 26

26 September 2007
Full Page.qxd 8/8/2007 3:52 PM Page 27

We’re semi nuts


We’ve got semis on the brain. Jameco offers more major brands of semiconductors than anyone
— almost twice as many as these catalog distributors.* It’s another Jameco advantage.

Mouser® Newark® Allied® Jameco®


Atmel Semiconductor Altera Analog Devices Altera
Avago Technologies Analog Devices Atmel Semiconductor Analog Devices
Cypress Semiconductor Avago Technologies Avago Technologies Atmel Semiconductor
Diodes, Inc. Cypress Semiconductor Freescale Semiconductor Avago Technologies
5 Fairchild Semiconductor Fairchild Semiconductor Infineon Technologies Cypress Semiconductor
Freescale Semiconductor Freescale Semiconductor Integrated Devices Diodes, Inc.
Intersil Integrated Devices Intel Corporation Fairchild Semiconductor
Lattice Semiconductor Intel Corporation Intersil Freescale Semiconductor
Lite-On Semiconductor Intersil Lattice Semiconductor Infineon Technologies
10 NEC Corporation Lattice Semiconductor Maxim Integrated Devices
Sharp Microelectronics Maxim National Semiconductor Intel Corporation
ST Microelectronics National Semiconductor NXP (formerly Philips) Intersil
Texas Instruments ST Microelectronics ST Microelectronics Lattice Semiconductor
Texas Instruments Texas Instruments Linear Technology
15 Lite-On Semiconductor
Maxim
Micron Technology
Microsemi
National Semiconductor
20 NEC Corporation
NXP (formerly Philips)
Free shipping
Renesas Technology
on these and
Sharp Microelectronics
79 other brands. ST Microelectronics
Call for details. Texas Instruments
25
Toshiba

OTHER JAMECO ADVANTAGES:


I More major passive, interconnect and electro-
mechanical brands than other distributors.
I 99% of catalog products ship the same day.
I Lowest prices guaranteed, or we pay 10%.
I Major brand names and generic equivalents
for even greater cost savings.

Order 24 hours a day, 7 days a week

www.Jameco.com
Or call 800-831-4242 anytime
©Jameco Electronics. *According to their web sites on July 23, 2007. Trademarks are the property of their respective owners.
Q&A.qxd 8/6/2007 2:37 PM Page 28

■ WITH RUSSELL KINCAID


QA & WHAT’S UP:
Join us as we delve into the
basics of electronics as applied
to every day problems, like:

✓ Fly Zapper.
In this column, I answer questions about all
aspects of electronics, including computer ●
hardware, software, circuits, electronic theory,
troubleshooting, and anything else of interest
to the hobbyist. Feel free to participate with
✓ Sam’s Photofact.

your questions, comments, or suggestions.
Send all questions and comments to:
✓ Linear Ramp.

Q&[email protected]

this circuit configuration?


CLASS A/B AMP — Sal Bivona SAM’S PHOTOFACT
Can you tell me how the AC Would you happen to know

Q and DC analysis are done


on the class A/B transistor
amplifier (Figure 1) and
answer these questions? A
This is a non-linear circuit, so
you can’t do an accurate
analysis without knowing the
resistance values and volt-
ages. However, you can linearize the
Q where or how I can obtain
Howard Sam’s Photo Fact?

— Anonymous

1) Why is the signal input between circuit by assuming a constant 0.6 volt This site will give you many
the diodes?

2) Does the signal voltage affect the


DC bias?
for the diode drop and Vbe. Then, Ve1
= Vin and the solution is trivial except
that at some point, as Vin increases, the
current through D1 will become zero
and the output will be constant (the AC
A leads: http://antiqueradios.
com/resources/Schematics/
and there is always: www.
samswebsite.com/ or you can write to:
Sam’s Technical Publishing, 9850 E.
3) How can I use loop equations on output will be clipped). 30th St., Indianapolis, IN 46229.
The signal input is between the
diodes because it is a symmetrical
circuit and you want a symmetrical
60 HZ PICKUP CIRCUIT
output signal. The presence of input I have a need for a circuit
signal will increase the current output
of the circuit but since DC bias is
defined as the condition in the absence
of signal, the question is a non-sequitur.
Since the circuit is symmetrical,
Q
signal.
which will pick up the 60 Hz
power line signal as radiated
and generate a zero-cross

The circuit is battery powered


analysis of the NPN circuit will also so it is not connected to the AC
apply to the PNP circuit. The only ques- mains. The circuit’s main source is a
tion of interest is: Where will the out- solar-panel array. I would expect an
put be clipped? Let us find that point. AM-ferrite type antenna and op-amp
or FET device could be used.
• Since Id1 = 0, then — Paul KJ4UO
Ib1 = (Vcc - Ve1 + .6)/R1
• Also, Ve1 = (Ib1 + Iq1)*(R3+R5) You don’t say how far from
• And, Iq1 = Beta*Ib1
• This leads to: Ve1 = [(Vcc - Ve1 +
.6)/R1]*(Beta+1)*(R3 + R5)
• To simplify, let K = (Beta+1)*
(R3+R5)/R1
A the power line you are. At any
rate, the AM radio antenna
that is designed for MHz will
not be efficient at 60 Hz. While it is true
that the US Navy transmits 10 kHz sig-
• Then: Ve1 = [(Vcc+.6)*K] – Ve1*K nals long distances, it requires a massive
• Therefore the clipping point is: antenna. The 60 Hz transmission lines
■ FIGURE 1 Ve1 = (Vcc+.6)*K/(K+1) are designed not to transmit, so any sig-
28 September 2007
Q&A.qxd 8/6/2007 2:37 PM Page 29

QU E ST I O N S & A N S W E R S

■ FIGURE 2

nal will be down in the noise of light- linear acceleration/deceleration ramp reversed. You could use a five volt pow-
ning and automotive ignition. A better where an instant voltage change at the er supply instead. A five volt change in
solution is to generate an accurate 60 input to the circuit (from say five volts the output of the A op-amp, caused by
Hz from a crystal as shown in Figure 2. to eight volts) would produce that a three volt input, takes 5.5 seconds.
The crystal can be pulled a little so same change at the output of the cir- You can increase the time by increas-
if the frequency is off, you can increase cuit, in the range of five to 10 seconds. ing R4 or using a larger capacitor (C1).
C1 and C2 to lower the frequency or It is important to me that this This circuit cannot maintain zero
decrease them to increase the fre- ramping up (or down) be linear. speed for very long because it is not
quency. The crystal tolerance is typically Simply charging a capacitor through a possible to match the reference
50 ppm. I divided the crystal frequency resistor won’t do. I would prefer to voltage perfectly. The speed will drift
down to 120 Hz then divided by two use simple gates or op-amps and/or higher over time in one direction or
because the 4060 does not have a Q11 discrete components, as I don’t get the other. Some kind of tachometer
output. The added advantage is that the along well with microprocessors or feedback would be needed to main-
output is a symmetrical square wave. any of their relatives. tain zero speed.
The procedure for finding the Any help or suggestions would be
divider outputs to decode the frequen- most appreciated.
cy is this: Divide the input frequency — Clark W. Kuhl
FLY ZAPPER
by the output frequency to find the I am looking for a small size
division factor (N). This must be a
whole number. Find the highest power
of 2 that can be subtracted from N. Do
the subtraction; the result being a new
value for N. Repeat until the result is
A
The circuit in Figure 3
provides the linear ramp that
you want. The B section of
the op-amp provides a five
volt reference so the motor can be
Q fly zapper, but I can’t find
one. It is either a big
commercial unit, or it uses
some scented refills.
How hard would it be to make
zero. The powers of 2 that you use are
the Q outputs needed to decode.

LINEAR RAMP
I enjoyed T.J. Byers’ column

Q for years and am delighted


that you are carrying on that
qualit y with your column.
I have a question that could have
applications in many circuits and so may
be of interest to a variety of readers.
I am controlling a motor’s speed
based on a reference voltage: where
five volts equals no speed, eight volts
equals full speed forward, and two
volts equals full speed in reverse. I
need a simple circuit to provide a ■ FIGURE 3
September 2007 29
Q&A.qxd 8/8/2007 7:43 PM Page 30

■ FIGURE 4 cut a clean rectangular or square hole


in one of these boxes. Usually, I need
round holes which are easily cut with
a hardware store type step drill, but
square or rectangular holes are need-
ed for switches, transistor sockets, and
meters to name a few.
I lay out the hole, then drill four
small round holes at the corners, and
then try to saw or cut out the hole
with my Dremel tool. It usually ends
up a ragged mess. Stores want $500
for a punch. Isn’t there a better way?
— C. P. Furney, Jr.

I have several Greenlee

one? Say, you start with a cheap


carriage lantern from a home improve-
ment store, remove the glass and the
guts, install a UV LED, make two
To maintain the spacing, use 3/8 inch
wood dowels impregnated with wax.
Thirty thousand volts are needed to arc
3/8 inch at sea level. Adjust the voltage
A punches. I don’t remember
what I paid for them but I
assure you that I did not pay
hundreds of dollars! When I make square
holes, I use your method: Drill a hole in
cylinders out of wire mesh (one inside (see Figure 4) so the arcing is only the center, cut the outline with a coping
the other), and then hook them up to occasional. Connect the outer screen saw or hacksaw and file to fit. I have flat
a high voltage DC-DC inverter. Would to a spike in the ground to insure that and square files for that purpose. I
it work? curious fingers don’t get zapped. found a URL that shows how to make
Once the fly or mosquito gets In the circuit in Figure 4, R3 rectangular holes using several methods,
between “the fences,” it would adjusts the duty cycle of the 555 to including using a chisel or punch:
get zapped by a spark and fall down. change the voltage output. The nomi- www.makezine.com/pub/a/extras/15.
This is called a non-clogging zapper, nal frequency is 20 kHz, but varies html?page=last&x-maxdepth=0. NV
since the fly should not get baked to with duty cycle. I chose a 500 volt, 14
the grid. amp transistor which may be overkill,
There may need to be some but I don’t want the transistor to
calculations done on what the voltage smoke when you are making adjust-
should be at different spacing and grid ments. I chose the value of R1 by
sizes of the fence (bigger flies, small guesstimating; the transistor drain has
mosquitoes, or both) and UV LED to go to 300 volts in order to get
would need to be covered somehow 30,000 volts output. If you don’t get
so it cannot be looked directly into. enough output with R3 at maximum,
— Dusan make R1 larger. R1 and C1 just
provide an upper limit to the drain
Your idea is good. Get some voltage. R1 will be dissipating nine

A hardware cloth from the


local store and form it into
two cylinders, one 3/4 inch-
es smaller in diameter than the other.
watts so a cement filled, 10 watt
resistor would be appropriate. All
other resistors are 1/4 watt. I expect
that Q1 will operate without a
heatsink because the normal current
■ FIGURE 5 should only be a couple of amps.
The voltage drop for blue LEDs is
about 3.5 volts so you can have two in
series and two in parallel as in Figure 5.

RECTANGULAR HOLES
I have a very simple question. I
build a lot of simple nifty electronic
gadgets, many from Nuts & Volts and
usually put them in plastic project
boxes. I have never figured out how to
30 September 2007
Q&A.qxd 8/6/2007 2:40 PM Page 31

SHOWCASE

PP:KLWH
ZDWHUFOHDU
/('9
PFG
$% 

VHFRQGYRLFHUHFRUGHUSOD\EDFNPRGXOH
SUHDVVHPEOHG  $ 
7KH9HOOHPDQ3HUVRQDO6FRSH
LVDFRPSOHWH06VSRUWDEOH

QGV
7KRXVD
L WH P VRQ
PRUH
E V LWH
RXUZH

PRINTED CIRCUIT BOARDS


QUALITY PRODUCT 10 pcs (3 days)
FAST DELIVERY 1 or 2 layers $249
COMPETITIVE PRICING 10 pcs (5 days)
4 layers $695
* Aluminum Backed PCB (up to 30 sq. in. ea.)
* Single & Double sided includes tooling, artwork,
* SMOBC/RoHS LPI mask & legend
* LPI mask
* Through hole or SMT
* Nickel & Gold Plating
* Routing or scoring
* Electrical Testing
* Artwork or CAD data 9901 W. Pacific Ave.
* Fast quotes Franklin Park, IL 60131
* Flex Circuits Phone 847.233.0012
We will beat any Fax 847.233.0013
competitor’s prices!!!
w w w.pulsar-inc.com • [email protected]

The Power SchmartModule TM


will power up your circuits with
your choice of -9, -12, +2.5,
+3.3, +5, +9 and +12 volts.

$15
Very Schmart!

www.schmartboard.com
NewProductsSep07.qxd 8/7/2007 2:27 PM Page 32

NEW
■ HARDWARE
■ SOFTWARE
■ GADGETS
■ TOOLS

P R O D U C T S
LOW COST DDS American Beauty Soldering Tools.
American Beauty Soldering Iron
FUNCTION Maintenance Kits include everything
GENERATOR necessary to remove flux residue,
contamination, and oxidation that

B &K Precision Corporation


Model 4045 Programma-
ble Synthesized Function
build up between the inside of an
iron’s heating element and the surface
of a heavy-duty tip. Requiring very
Generator can generate sine, square, • Modulation in both AM and FM little time, regular maintenance
triangle, and arbitrary waveforms with promotes optimum heat transfer and
crystal controlled sampling rates of up • Lin or Log sweep function prolongs the life of any industrial
to 20 Hz, 12 bit vertical resolution, and soldering iron, claims the firm.
up to 1,000 points. A menu-driven front • Bright, informative LCD Packaged in handy storage cases,
panel operation with an easy-to-read the maintenance kits each contain a
graphic LCD display makes the model • RS-232 interface special spiral brush, steel wire brush,
4045 easy to operate. and flexible non-woven abrasive pads
Parameter changes and data entry Measuring a compact 3.5 x 8.3 x that wrap around a tip’s shank. The
can be made using the rotary knob or 8.4, the model 4045 weighs only 5.5 spiral brushes have 1/4” hex shanks to
via the built-in RS-232 interface. Wave- lbs. and is available for immediate fit most drills. Five individual kits for
form editing can be done from scratch delivery. It comes with the B&K servicing 40 to 550 watt soldering
or by modifying standard waveforms. A Precision warranty, AC line cord, and irons and a complete kit for all sizes
built-in PC software program allows the a user manual (on CD). are offered.
user to easily create, edit, and download For the name and location of The maintenance kits are priced
complex waveforms. Waveforms can be an authorized distributor near you, from $19.99 (list), depending upon
stored in the 4045’s Flash memory. contact B&K Precision Corporation. size. Literature and pricing are avail-
Programming can be remotely con- able upon request.
trolled by the built-in RS-232 interface. For more information, contact:
All parameters, modes, and functions B&K Precision For more information, contact:
are programmable. Priced at $995, it is Corporation American Beauty
a perfect instrument for R&D, manu- 22820 Savi Ranch Pkwy. Soldering Tools
facturing test systems, teaching arbitrary Yorba Linda, CA 92887 1177 West Maple Rd.
waveform fundamentals, and service Tel: 714-921-9095 Clawson, MI 48017
and repair. Fax: 714-921-6422 Tel: 800-550-2510
Web: www.bkprecision.com Fax: 248-280-2878
All waveforms are internally
Email: es@americanbeauty
generated with amplitudes to 10vp-p tools.com
into 50 ohms. An offset generator Web: www.americanbeauty
allows generation of signals with large SOLDERING IRON tools.com
offsets. A full range of triggering
capabilities is available including
MAINTENANCE
internal-external trigger source, gated, KITS
and burst modes of operation. Some
MODEL 8063
of the unique features of the B+K
Precision Model 4045 include: A new line of
soldering iron
maintenance kits
ETHERNET-TO-DIGITAL
INTERFACE BOARD
• 20 MHz sweep frequency range that were devel-
(sine and square only)

• Sine, square, triangle and arbitrary


oped to assure top
performance and
long life for heavy-dut y industrial
I CS Electronics has announced a
new Ethernet-to-Digital interface for
controlling digital devices over a com-
waveforms soldering irons is being introduced by pany network or over the Internet.

32 September 2007
NewProductsSep07.qxd 8/7/2007 2:28 PM Page 33

■ H A R D W A R E ■ S O F T W A R E ■ G A D G E T S ■ T O O L S

Called the Model 8063, this new several ways: the model 8063’s VXI-11 Standard includes the
interface box provides 48 digital I/O VXI-11 Service can be accessed by necessary RPCGen header files for
lines that the user can control from LabVIEW, VEE, Visual Basic, and C adding RPC calls to any program. ICS
any computer with an NIC interface language application programs that provides a VXI-11 keyboard program
or from a TCP/IP network. Typical ap- make VISA calls by selecting the which lets users with a WIN32
plications for the 8063 are interfacing 8063 as the TCP/IP resource. Both computer interactively control the
digital devices, controlling relay Agilent and National Instruments 8063 and other VXI-11 compatible
matrices, or acting as an Ethernet provide VXI-11.3 compliant VISA instruments without having to write
interface for devices or instruments libraries. Linux, Unix, and other a program.
with digital interfaces. programmers who do not want to ICS’s 8063 Ethernet-to-parallel
The Model 8063 is an Ethernet-to- use a VISA library can access the interface has several unique features
parallel interface that provides 48 8063’s VXI-11 Service by RPC calls which include: the 8063 is 100%
parallel I/O lines that can be from the application program. The VXI-11.3 compliant (which is an open
configured as inputs or outputs in
eight-bit bytes. Data transfer can be
done by a combination of three
methods, depending upon the needs
of the devices connected to the 8063.
First is by transferring data directly to
or from a specific byte, second by
strings of data characters to or from
multiple bytes, or third, by setting or
reading individual bits in a byte.
Handshake lines are provided for
synchronizing the data transfers or for
latching data into external devices.
The 8063 can also monitor 15 input
lines and generate VXI-11 Service
Request messages when an enabled
line changes state. The 8063 is an
IEEE-488.2 compatible interface that
responds to the 488.2 common
commands and uses SCPI commands
to configure its digital interface. The
user can customize the 8063’s IDN
message to integrate the 8063 into
a system. All settings are saved in
Flash memory.
The Model 8063 is a VXI-11.3
compliant interface. VXI-11 is a
communication standard developed
by the VISA consortium in 1995
in conjunction with the VISA
Specification. The VXI-11.3 sub-
standard covers TCP/IP-to-Instrument
servers like the 8063 and is used for
LXI devices. Communication with the
8063 is via VXI-11 RPC protocol over
a TCP/IP network.
The 8063 can be controlled

September 2007 33
NewProductsSep07.qxd 8/7/2007 2:26 PM Page 34

■ HARDWARE ■ SOFTWARE ■ GADGETS ■ TOOLS

communication standard); the 8063 SCPI command set so switching inter-


supports reverse channel Service faces has minimal program impact.
Request messages to alert the client Pricing for the Model 8063 is
application when an event occurs; $650 each in quantities of one to four
and it supports multiple clients as part units, FOB Pleasanton, CA. Delivery is
of its standard firmware. two to four weeks ARO.
The 8063 is RoHS compliant and
is housed in ICS’s small Minibox For more information, contact:
case that can be rack mounted in a ICS Electronics
1U high space. The 8063 is physically 7034 Commerce Cir.
interchangeable with ICS’s 4863 GPIB Pleasanton, CA 94588
and 2363 serial-to-parallel interfaces. Tel: 925-416-1000
Web: www.icselect.com
All three interfaces support the same
New Product in the
Store
Recently named as one of the
Best Inventions of 2006
by Time Magazine
H-racer & Solar Hydrogen Station

With the H-racer, you can witness the


power of new energy technology in the
palm of your hand. Horizon has created a
unique, patented, miniature fuel-cell car
and hydrogen refueling station. The
Refueling Station creates hydrogen by
electrolysis using water, and once the
car’s hydrogen tank is full, the car can
run on its own hydrogen fuel-cell system
with the simple flip of a switch.
For more information see page 100

34 September 2007
Full Page.qxd 8/8/2007 3:57 PM Page 35
Ball.qxd 8/6/2007 2:45 PM Page 36

PROJECTS ●●●●
■ THIS MONTH’S PROJECTS
Keep Those Components Cool . .36 KEEP THOSE
Flight Recorder — Part 2 . . . . .41

Wireless Weather System . . . .46 COMPONENTS


COOL!
Accurate Voltage Reference . . .52

■ LEVEL RATING SYSTEM


To find out the level of difficulty
for each of these projects, turn
to our ratings for the answers.
●●●● . . . . Beginner Level
I considered just slowing the fan
to some speed that produced
less noise. The problem with just
includes a fault output to indicate
when the temperature rises beyond
acceptable limits (in this case, a bit
running the fan slower is that the less than 70°C). This could happen if
●●●● . . . . Intermediate Level cooling may be inadequate. A rise in the fan fails or if the ventilation
●●●● . . . . Advanced Level ambient temperature or higher holes become plugged with dust or
power dissipation in the circuit covered with a piece of paper. The
●●●● . . . . Professional Level would cause everything to overheat. fault output can notify a processor
So, I decided to adjust the fan to shut off power or take some
speed with temperature, running at action to reduce power dissipation
Not long ago, I put minimum speed when the circuit is in the circuit.
cool and increasing fan speed as Q1 operates in linear mode,
together a project, the temperature increased. I supplying current to the motor.
housed in a plastic measured the temperature of the With a larger, higher current fan, this
hot component with a thermistor arrangement could potentially
RadioShack box, which and adjusted the fan speed based cause significant heating from Q1
on that temperature. itself. The fan used here draws less
contained a component A schematic of the circuit is than 100 mA at full supply voltage,
that could get hot shown in Figure 1. The circuit uses a so that is not an issue. Note that the
single quad op-amp, U1, an LM324. feedback network (R2/R3) connects
enough to self-destruct Q1 is a PNP power transistor that to the non-inverting input of U1A
in a closed box. I added supplies current to the motor. T1 is
a thermistor that provides tempera-
(pin 3). Ordinarily, feedback to an
op-amp goes to the inverting input
a small cooling fan to ture sensing, and is mounted to (pin 2, in this case), but in this
the component that needs to circuit, Q1 provides an additional
the box, but the noise be cooled. stage of inversion. This effectively
was excessive. T1 is an NTC (negative temper- swaps the functions of the inverting
ature coefficient) thermistor, which and noninverting input pins.
means that the resistance goes Q1 is turned on by current
I decided that I down as temperature goes up. The
resistance of T1 is about 10K at
flowing to ground through the
base. Note that there is no direct
could minimize the room temperature, falling to about relationship between the voltage
2.8K at 70°C. Since most commer- at the base of Q1 and the output
noise if I only ran cial electronics operate to about voltage. Q1, being a bipolar transis-
that temperature, the fan needs tor, is a current amplifier, so U1A
the fan at the speed to keep the temperature below will sink sufficient current through
necessary to cool that point.
Small DC fans are typically one
the base to produce the appropriate
voltage at the output.
the components. of the less reliable components in
an electronic system, so the circuit
The fan I used will operate from
5V to 12V. At 5V, the noise is almost

36 September 2007
Ball.qxd 8/6/2007 2:45 PM Page 37

BY STUART BALL

■ FIGURE 1. Schematic of
the fan controller circuit.
T1 is a thermistor mounted
to the component needing
to be cooled.

inaudible, so the circuit


always supplies 5V to the
fan, through U1B. As the
temperature rises so that
the output needs to rise
above 5V, U1A begins
to sink current, raising
the fan supply voltage.
Operating the fan in this
way provides two advan-
tages: First, there is always
some airflow through the
box. Second, it simplifies
the circuit since there is
no need to add circuitry
to turn off the output
when it would be below
the minimum fan operat-
ing voltage.
U1C provides fault
detection. When the
temperature rises above approximate- voltage divider comprised of R3 and Since Vo is 5V, the right side of
ly 65°C, U1-8 goes low. U1D is just an R2, and varies with fan voltage. the equation reduces to 5V and R1
inverter to drive Q2, providing an The equation for U1-2 can be is 5K.
open-collector output. This allows written as: At the other end of the range, the
multiple fan circuits to share a equations are:
common fault signal. U1C includes a (Vo - 5V) x R2
+5V
small amount of hysterisis through R2 + R3 12V x 5K (12 - 5V) x R2
= +5V
R9 to insure that the fault output is a 5K + 4K R2 + 10K
well-defined transition. The equation for U1-3 can be
Note: R13 is not installed for a fan written as: which makes R2 equal to 3.12K. Since
that can operate at 5V. For a fan with I didn’t need precise temperature
a minimum operating voltage higher 12V x R1 control, I used the nearest 5%
than 5V, R13 is needed to provide that R1 + RTh resistors; a more precise circuit would
voltage to the fan. See the sidebar use 1% or better parts. Note that
“Working the Equations” for details. I defined two endpoints for the R1 reduces to a simple equation
circuit, with the fan operating at 5V up only because the reference for pin 3 is
Calculating Circuit to about 40°C, where the thermistor equal to the minimum fan voltage.
Values resistance is about 7K, and applying A different reference value (such as a
the full 12V at about 60°C (thermistor precision 2.5V reference) would result
In an op-amp that is linear (the resistance about 4K). By setting R3 to in solving both equations simultane-
output is not saturated at either supply 10K and then setting pin 3 equal to pin ously (remember high school algebra!)
rail), the inputs (U1-3 and U1-2, in this 2, we have the following equations: for the values of R1 and R2. Also,
case) will be at the same voltage. The many 12V fans will not operate as low
voltage at U1-2 is controlled by the 5V output: as 5V, and a different minimum fan
voltage divider comprised of T1 and voltage would also change the result.
R1 and varies with temperature. The 12V x R1 (Vo - 5V) x R2 For more precise control, you
= +5V
voltage at U1-2 is controlled by the R1 + 7K R2 + 10K would use the following 1% values:

September 2007 37
Ball.qxd 8/6/2007 2:45 PM Page 38

attached to the hot component with a


■ FIGURE 2. The thermistor for this
project was a bead-type thermistor
machine screw and nut. This would
glued into the barrel of a ring terminal. work with a component such as a
Conductive epoxy is the best way to do hard drive, or a part with a heatsink. If
this. You can also get thermistors already the part is, say, a TO-220 transistor,
attached to tabs, drilled for mounting. you could attach the thermistor with
the same screw that attaches the
If you solve these (see “Working transistor to its heatsink.
the Equations”), you get R1 = 6.25K If you are measuring the tempera-
and R2 = 4.95K. These values would ture of an IC, you would want to glue
produce 7V to the fan at 40°C, and the thermistor to the IC package or to
12V to the fan at 60°C. In some cases, a heatsink that is then glued to the
when you solve equations like this, package. Thermally conductive epox-
you get a negative resistance value. ies for mounting thermistors are avail-
In those cases, you have to change able from companies such as Omega
R1: 4.99K a resistor or reference voltage in the (www.omega.com). Various manufac-
R2: 3.16K circuit to get the result you want. The turers, including RTI Electronics (www.
exception is if you get a quadratic rtie.com) and Vishay (www.vishay.
In this circuit, the 5V and 12V equation (like you will if you com) make thermistors already mount-
supply voltages are used as work through this example) with ed to metal tabs with mounting holes.
references, so the temperature control one positive and one negative root.
will vary with supply voltage. More Then the positive root is the resistance Testing
precise control would require more you want.
precise voltage references. To complete the 7V conversion, Testing is fairly simple: Connect
U1B sets the minimum fan U1B would be set to produce a 7V +12V and +5V, and (optionally) con-
voltage at 5V. If you use a fan with output by making R13 equal to 2.5K. nect a fan. The output voltage should
a higher minimum voltage, you would Most thermistors have very low be about 5V. Use a heat gun or hair
need to apply that voltage to pin mass, so if you change component dryer to heat the thermistor; the fan
6 through a voltage divider. For values, you want to be careful with R1. speed and voltage should increase as
example, a fan that needs at least 7V If the value of R1 is too small, the the temperature goes up. To test the
to operate would make the equations thermistor will dissipate enough fault output, connect a 10K pullup
look like this: power to heat itself and affect the from the fault output to +5V; the fault
sensed temperature. The maximum output should go low around 70°C.
7V: power dissipated by the thermistor in
12V x R1 (7 - 5V) x R2 this circuit is about eight milliwatts. Temperature Control
= +5V
R1 + 7K R2 + 10K
Thermistor Attachment The control circuit does not
attempt to maintain a constant
12V: The thermistor can be used to temperature. Instead, the temperature
measure air temperature inside the is allowed to float. For a given ambient
12V x R1 (12 - 5V) x R2 enclosure, but you typically want to temperature and circuit power dissipa-
= +5V
R1 + 4K R2 + 10K measure the temperature of an IC, tion, the temperature will tend to
heatsink, or other component. stabilize at some value. However,
In this case, I used a small bead- given the significant thermal mass in
type thermistor, glued into the this enclosure (and associated delay
barrel of a ring terminal (Figure between changing fan speed and
2). The ring terminal was then resulting temperature change),
maintaining a constant temperature
would be difficult, anyway.
■ FIGURE 3. The thermistor has Although maintaining a fixed tem-
an approximately logarithmic
temperature-resistance curve. perature would seem more “normal”
This means that the fan speed for a control system, in this case, it
will increase faster near lower would result in higher fan noise. At
temperatures, and increase higher ambient temperatures, or
more slowly as the temperature under increased load, a constant-
approaches maximum.
temperature circuit would run the fan

38 September 2007
Ball.qxd 8/6/2007 2:46 PM Page 39

Keep Those Components Cool!


faster to maintain the temperature. By case, it doesn’t matter if the circuit is a Other Types of Fans
allowing the temperature to float up constant-temperature controller or not
with ambient temperature and circuit — no type of fan control can provide Another approach to this project
power dissipation, the average fan adequate cooling. would be to control fan speed directly
speed will be lower (although the The resistance of an NTC thermis- (instead of controlling fan voltage)
temperature will usually be higher tor does not have a straight-line using a fan with a tach output. These
than a fixed setpoint would be). relationship with temperature; instead fans produce a pulse once or more
So, what happens if the fan runs the curve is approximately logarithmic per revolution. Of course, this
at full speed all the time and the (Figure 3). Since the fan supply approach requires some method of
temperature is still above the upper voltage varies with thermistor translating the tach signal to a control
limit? That means the fan is too small resistance, the fan supply voltage will voltage — typically with a microcon-
to start with, or that the ventilation is increase faster around 5V, and slower troller or fan controller IC.
either inadequate or blocked. In that as it approaches 12V. PWM (pulse width modulation)

WORKING THE EQUATIONS


The fan used in this circuit will operate from 5V to resistance values for the thermistor/temperature
12V. Some 12V fans will not operate down to 5V; they you want to use. For example, if your thermistor has
may only operate from 7V to 12V. For those who want to a resistance of 8K at the lowest fan temperature,
follow the math, here is how the op-amp equations are you would substitute 8K for 7K in the equation for 5V
solved for 7V to 12V operation: operation (or 7V operation, in the above example).

For 7V: Calculation of R13:


12V x R1 (7 - 5V) x R2 7R2 + 50K
= +5V = The original circuit did not use R13 because the fan
R1 + 7K R2 + 10K R2 + 10K
operates at 5V. However, for a fan requiring a minimum
of 7V, U1B needs to produce a 7V output instead of a 5V
Expand and then collect terms: output. Since the reference to U1B (pin 6) is 5V, we need
12R1R2 + 120KR1 = 7R1R2 + 49KR2 + 50KR1 + 350K U1-5 to be at 5V when the fan voltage is at 7V:
5R1R2 + 70KR1 = 49KR2 + 350K
= 7V x R13 = 7V x R13
5V
For 12V: R13 + R7 R13 + 1K
12R1 7R2 12R2 + 50K
= +5V =
R1 + 4K R2 + 10K R2 + 10K 5R13 + 5K = 7R13

Expand and collect terms: 5K


5K = 2R13; R13 = = 2.5K
12R1R2 + 120KR1 = 12R1R2 + 48KR2 + 50KR1 + 200K 2
48KR2 + 200K The same thing could be accomplished by leaving
70KR1 = 48KR2 + 200K; R1 =
70K out R13 and connecting a voltage divider from 12V
to ground, using values that produce 7V at the junction
of the two resistors. U1-6 would connect to the 7V
Substitute second value for R1 into first equation: junction point.
145KR2 + 200K 49KR2 + 350K
=
70K 5R2 + 70K The thermistor used in this project was a surplus
unit from an unknown manufacturer. A commercial
part would have different resistance/temperature
Expand and consolidate: values. For example, the Vishay 2381 645 90169/
240KR22 + 4360KR2 + 14000K = 3430KR2 + 24500K NTCALUGE2C90169 is cemented to a mounting lug and
240KR22 + 930KR2 - 10500K = 0 has a resistance of 5.3K at 40°C and 2.49K at 60°C. The
corresponding circuit values would be:

Solving this with the quadratic equation results in R1: 3.9K


R2 = 4.95K (the other root is negative). Inserting that R2: 3.9K
back into either equation for R1 yields R1 = 6.25K. R3: 7.5K
Substituting a different thermistor or different R10: 4.5K
temperatures just means you have to substitute the

September 2007 39
Ball.qxd 8/6/2007 2:46 PM Page 40

could also be used to control the fan, • Setpoint adjustment needs to


and would eliminate any problems be customized to the application, or
with power dissipation in Q1. environment.
However, this requires a fan that is
capable of PWM operation — many • Constant temperature control is
low-voltage DC fans use brushless DC needed.
motors with internal controller ICs that
don’t respond well to PWM control. • You want to turn the fan completely
off below a particular temperature for
Minimum Current lower current drain (as in a battery
application).
Although the fan used here is a
low-current device, if you were oper- Better Precision
ating from batteries, you might want
to turn the fan completely off if the The largest sources of error in the
temperature is low enough. The circuit are:
simplest way to do this is to add a
microcontroller (covered next). You • 5% resistors
could also add circuitry to inhibit the • 12V reference for thermistor circuit
fan output completely below 5V. • Thermistor tolerance

Adding a As already mentioned, the circuit


Microcontroller uses 5% resistors, but 1% values
would produce better accuracy. The
By now, some readers are asking 12V and 5V references could be
why not just use a microcontroller replaced with precision 2.5V or 5V
for this circuit? There are a number of references. However, doing so means
controllers with on-chip ADCs to read that the equations must be reworked
the thermistor, and adjusting the with the thermistor you plan to use. It
temperature setpoints is a simple is possible to pick values that cannot
matter of changing the firmware. be “mapped” to the output voltages
A microcontroller-based design you want. This will be obvious when
would work, but many of the parts in you do the math (see “Working
this circuit would still be needed: the the Equations”) because you will end
thermistor voltage divider, the output up with a negative value for one or
transistor, and an op-amp to drive it. more resistors.
In addition, the microcontroller would Finally, the thermistor tolerance
require a DAC unless one was affects precision. Thermistors typical-
available on-chip. A microcontroller ly have a 5% tolerance, but 1% or
solution would potentially increase better parts are available. You could
EMI (not a consideration in my one-of- also characterize the thermistor
a-kind project, but certainly a consid- you plan to use, but if you need
eration on a production design). that level of precision, you probably
A microcontroller is suitable for need to do some sophisticated
this design if any of the following airflow analysis.
are true:
Conclusion
• A microcontroller is already used
elsewhere, so added cost is minimal. This basic circuit allows you to
control the speed of a fan to suit your
• PWM motor control is needed. noise tolerance. Using the example
equations, you can change the
• The temperature-fan speed curve temperature ranges and thermistor
needs to be “linearized” to compen- to adapt it to your needs and
sate for the logarithmic thermistor specific circumstances, and keep your
curve. components cool! NV

40 September 2007
Bessant2.qxd 8/7/2007 2:38 PM Page 41

●●●● BY MIKE BESSANT

FRECORDER
LIGHFORT Last month, we
introduced you to the
basics of model rocketry
and outlined the
hardware design of a

MODEL ROCKETRY
PART 2
compatible flight
recorder.

Measuring In-Flight MMA7260Q three-axis accelerome-


ter from Freescale Semiconductors.
This article will
Acceleration
This micromachined IC has integral describe the
A three-axis accelerometer was signal conditioning with low-pass
the first type of sensor evaluated filters. Sensitivity is selectable in embedded software
using the prototype flight recorder. four steps (±1.5g/2g/4g/6g),
The reasons for this were that in depending on the logic levels required to record
addition to providing details about placed on two control pins. Current
the rocket’s basic performance, inte- consumption is only about 0.5 mA and replay three
grating the signal from the vertical over the supply range of 2.2-3.6V
axis could produce a complete and the analog output swings to channels of
velocity profile of the flight and a
second integration should yield
within 0.25V of either rail.
By operating both the acceleration,
peak altitude. I was also interested accelerometer and flight recorder
to see if an indication of aerody- from a single three volt supply, a
namic stability could be obtained by good match was obtained between and includes a plot of
measuring horizontal acceleration.
The device chosen was a
the sensor’s analog output and the
microcontroller’s ADC input range.
actual flight data in
Microsoft Excel. This is
followed by examples
of some additional
sensors that may be
used with this versatile
system, including
calibrated ‘smart’
versions that have
integral signal
conditioning and serial
■ FIGURE 1. Scale model of digital interfaces.
WW2 Wasserfall used for
acceleration measurements.

September 2007 41
Bessant2.qxd 8/7/2007 2:39 PM Page 42

■ FIGURE 2. Three-axis
angle below the chute, and then
accelerometer connections began a relatively sedate descent.
to sensor port. Touchdown at 18 seconds appears to
have been surprisingly gentle. The
0.1 inch pads. Silicone nose cone eventually came to rest on
glue was used to mount its side, with the vertical accelerome-
the breakout board ter measuring near zero g.
onto the flight recorder If we now turn our attention to
that seemed to provide the Y and Z traces, we see that they
reasonable rigidity understandably show lower levels of
while offering the acceleration. They do, however,
accelerometer some indicate that the rocket performed a
Signal conditioning circuitry is there- protection against excessive g-forces. definite ‘wiggle’ after leaving the
fore limited to the simple RC low-pass Figure 3 is an example plot of launch rail that decayed in amplitude
filters that are included as standard on three acceleration channels measured over the next three seconds.
the ADC inputs of the sensor port. during a model rocket flight. The verti- Following touchdown, the horizontal
Figure 2 shows the connections cal acceleration trace is labelled ‘X’ and traces seemed to show the nose cone
required between the breakout board the two horizontal traces are labelled rolling after touchdown. It is possible
and the sensor port. Although it is pos- ‘Y’ and ‘Z.’ All three accelerometer that the initial wiggle and ground roll
sible to operate with different sensitiv- channels were sampled at 100 Hz for were both caused by the effects (upon
ity on each axis, by changing the state 27 seconds, which only used 25% of the fins and chute) of a moderate
of the control pin ranges between suc- the available storage capacity. side-wind at the launch site.
cessive ADC readings, the associated If we start by looking at the verti-
settling time would adversely affect cal channel, the plot shows that it was PICAXE Firmware
the sampling rate. The range of all briefly overloaded at engine ignition
three channels was therefore fixed at but could easily accommodate the Figure 4 lists the PICAXE firmware
the maximum specified range of ±6g. following level of sustained thrust. At that was used to record three channels
(However, the ADC accepts signal approximately 1.5 seconds into the of acceleration during flight and export
levels that exceed this range.) flight, acceleration dropped abruptly the data to Microsoft Excel. The func-
The accelerometer is only avail- with propellant burnout. The rocket tion of the trigger, record, and playback
able in a difficult-to-hand-solder surface then coasted upwards for about 3.5 routines were explained in last month’s
mount package, but this limitation was seconds before the vertical channel article. Note that the setfreq m8 com-
overcome by using a small breakout was overloaded by the nose cone mand doubles the default PICAXE
board from Spark Fun Electronics ejection and chute deployment. clock rate to 8 MHz, which means that
(www.sparkfun.com) that has the Things then became a little wild until data is sent at 9.6 kbaud (not 4.8 kbaud
MMA7260 connections brought out to the nose-cone dangled, inverted at an as listed). The SelmaDAQ macro is
used in Excel to accept data and place
it in the spreadsheet for subsequent
processing and display.
Martin Hebel, of SelmaWare
Solutions and a professor in the
Electronic Systems Technologies pro-
gram at Southern Illinois University
Carbondale, wrote SelmaDAQ. This
application only uses a fraction of the
capabilities of this extremely flexible
software tool, which may be down-
loaded from www.selmaware.com

Additional Sensors
As horizontal accelerometer
channels normally provide less

■ FIGURE 3. Acceleration plot of model


rocket flight.

42 September 2007
Bessant2.qxd 8/7/2007 2:39 PM Page 43

Flight Recorder for Model Rocketry: Part 2


information about a rocket’s perform- rate of roll by detecting the sun PICAXE is able to record the level
ance than the vertical channel, a through a narrow vertical slot in the peaks in light as the rocket rotates.
typical payload would only include nose cone. I have found that yellow Roll rate is an important parameter,
a single-axis accelerometer. The LEDs make quite good sun detectors. because fin-induced rotation is often
remaining two ADC channels could The voltage generated across the used to improve a rocket’s directional
therefore be used to measure signals LED is approximately one volt when stability, but too high a rate can
from the following analog sensors. viewing general sky, but can exceed tangle the lines of the recovery chute
Of the many sensors used in ama- 1.5 volts when exposed to direct during deployment.
teur rocketry, probably the simplest sunlight. By connecting the cathode A possible application for the
type is a sun detector. In clear weath- of the LED to the sensor port ground remaining ADC channel could be
er and low sun elevation conditions, and the anode to an ADC input (via
this can be used to measure a rocket’s an op-amp voltage follower), the ■ FIGURE 4. Three-axis accelerometer
programmer for PICAXE-18X.

setfreq m8 ‘Set internal clock to 8 MHz


symbol memmin = 0 ‘Start address
symbol memmax = 8191 ‘End address (maximum 32767)
symbol memaddress = W6 ‘counter (word)
symbol rate = 8 ‘Set scan rate to 100 Hz
symbol launch = pin6 ‘Define constants....
symbol cable = pin7
symbol power = 2
symbol redled = 5
symbol download = 7

high power ‘Hold power on


pause 5000 ‘Wait for power lines to settle

playback: ‘Always download data on power-up


high redled ‘Keep LED on whilst downloading data
serout download, T4800, (CR,CR,CR,”LABEL,”,”,X,Y,Z”,CR) ‘SelmaDAQ set-up follows.....
pause 1000
serout download, T4800, (“CLEARDATA”,CR)
pause 1000
serout download, T4800, (“ 3-axis acceleration”,CR)

i2cslave %10100000, i2cfast, i2cword ‘Configure master 12c port

for memaddress = memmin to memmax step 3 ‘Generate memory address in steps of 3


readi2c memaddress, (b0,b1,b2) ‘Read data from three FRAM addresses
serout download, T4800, (“DATA,”,”,”,#b0,”,”,#b1,”,”,#b2,CR) ‘Send data in SelmaDAQ compatible format
next memaddress ‘Next three addresses

if cable = 0 then trigger ‘Start trigger routine if cable disconnected


low power ‘Else power down

trigger: ‘Wait in loop until trigger input goes high


if launch = 1 then record ‘Start recording routine when triggered
high redled ‘Flash red LED whilst in loop....
pause 500
low redled ‘Red LED off and yellow LED on whilst recording
pause 500
goto trigger

record: ‘Start recording data


for memaddress = memmin to memmax step 3 ‘Generate memory addresses in steps of 3
readadc 0, b0 ‘Read ADC...
readadc 1, b1
readadc 2, b2
writei2c memaddress, (b0,b1,b2) ‘Write three channels of ADC data to FRAM
pause rate ‘Scan rate delay
next memaddress ‘Next three addresses
low power ‘Power down (red and yellow LEDs off)

September 2007 43
Bessant2.qxd 8/7/2007 2:39 PM Page 44

sampling the amplified output from a pressure IC from VTI Technologies. Conclusions
magnetoresistive sensor that is used to Pressure and temperature output data
measure the vertical component of are calibrated and compensated With the exception of the sun and
the Earth’s magnetic field in order to internally. This device operates from a magnetoresistive sensors, all the
detect when the rocket tips over at 2.4V-3.3V supply and has the poten- above examples could be connected
apogee. Honeywell and Phillips pro- tial to provide a more accurate alti- directly to the sensor port without
duce devices that have the required tude profile than could be derived by additional signal conditioning or
0.5 gauss sensitivity for this task (but integrating vertical acceleration data. power supply circuitry.
the output signal would have to be The SHT11 humidity and temper- The flight recorder is a compact
amplified before feeding the ADC). ature IC from Sensirion AG is another and low power instrumentation tool
By comparing the recorded smart sensor that has a two-wire serial that can be rapidly configured to
magnetic field strength and vertical bus. However, it is not I2C compatible accommodate a range of applications.
acceleration data, it should be possible and would have to be interfaced by In addition, the use of SelmaDAQ
to measure any delay between apogee ‘bit banging’ sensor port I/O lines. makes spreadsheet data import,
and nose cone ejection. This informa- This device operates from a 2.4V-5.5V processing, and display an almost
tion will help determine the engine supply and the output data is calibrat- seamless task. NV
delay charge required to deploy near ed and compensated internally. It
the rocket’s minimum speed, in order to could be used to study microclimates
reduce the risk of damaging the chute. by measuring the relative humidity This book is
Having employed all three of the and temperature of a column of air available in our
store on page 99.
flight recorder’s ADC channels in the (e.g., to obtain a profile through a
Visit
above examples, we still have the layer of mist). However, because the
www.nutsvolts.com
option of interfacing sensors via the sensor’s update rate is in the order of
or call 800-783-4624.
sensor port’s serial I2C bus. A good seconds, measurements are best
example of an I2C compatible smart taken during a slow descent under a $24.95
sensor is the SCP1000 barometric generously-sized parachute.

44 September 2007
Full Page.qxd 8/8/2007 4:01 PM Page 45

ew
675+ N s
t
Produc

ages
430+ P r
lo
Full Co
Visit us at
www.jaycar.com/catalog and
obtain your free copy of our 430+ page, full
Universal Speaker color catalog. We have an extensive range of
electronics kits and the best in
Protection and Muting innovative gadgets.
Module Kit
KC-5450 $17.50 + post & packing
Protects your expensive speakers Water Level Indicator Kit POST AND PACKING CHARGES:
against damage in the event of catastrophic KC-5449 $20.50 + post & packing Order Value Cost Order Value Cost
amplifier failure such as a shorted output This simple circuit illuminates a $25 - $49.99 $7.50 $200 - $499.99 $60
transistor. In addition, the circuit also banishes string of LEDs to quickly indicate $50 - $99.99 $20 $500+ $75
those annoying thumps that occur when many the water level in a rainwater tank. $100 - $199.99 $40
amplifiers are switched on or off, especially when The more LEDs that illuminate, the Max weight 12lb (5kg). Heavier
the volume is set to a high level. The design also higher the water level is inside the tank. parcels POA. Minimum order $25.
incorporates an optional over temperature The input signal is provided by ten Note: Products are dispatched from Australia,
heat-sensor that will disconnect the sensors located in the water tank and local customs duty and taxes may apply.
speakers if the output stage connected to the indicator unit Beat w How to order:
gets too hot. Configurable restricti ater Phone: Call Australian Eastern Standard Time
via-light duty figure-8 cable. Kit water ons with a
for supply voltages between supplied with PCB with overlay, tank Mon-Fri on 1800 784 0263
22VDC-70VDC. Supplied with great kand this Email: [email protected]
machined case with screenprinted lid it!
a silk screened PCB, relay and Post: PO BOX 6424, Silverwater NSW 1811. Australia
and all electronic components. Expect 10-14 Days For Air parcel delivery
all electronic components. • Requires: 8mm (OD) PVC hose/pipe (length
required depending on depth of tank)
4 Channel Guitar Amplifier Kit Requires 9-12VDC or AC wall Fuel Cut Defeat Kit
KC-5448 $57.50 + post & packing
adaptor (Jameco #252751 $12.05) KC-5439 $11.75 + post & packing
The input sensitivity of each of the four channels
This simple kit enables you to defeat the factory
is adjustable from a few millivolts to over 1 volt,
so you can plug in a range of input signals from a IR Remote Control Extender MKII fuel cut-out signal from your car's ECU and
KC-5432 $14.50 + post & packing allows your turbo charger to go beyond the
microphone to a line level signal from a CD
Operate your DVD player or digital decoder using typical 15-17psi factory boost limit.
player etc. A headphone amplifier circuit
its remote control from another room. It picks up Note: Care should be taken to ensure that the
is also included for monitoring purposes.
the signal from the remote control and sends it boost level and fuel mixture don’t reach unsafe
A three stage EQ is also integrated,
via a 2-wire cable to an infrared LED located close levels. Kit supplied with PCB, and all electronic
making this a very versatile mixer
to the device. This improved model features fast components.
that will operate from
12VDC. Kit data transfer, capable of
includes PCB with transmitting Foxtel digital Improv
remote control signals model ed
overlay and all fo
electronic using the Pace 400 2007 r
components. series decoder. Kit
supplied with case,
screen printed front
Stereo VU and Peak Meter Kit Com
panel, PCB with two kitbine these
KC-5447 $40.75 + post & packing overlay and all most s to get th
Accurately monitor audio signals to prevent signal electronic components. Variable Boost perfo cost effecti e
rma ve
clipping and ensure optimum recording levels.
Requires 9VDC wall adaptor on thence increase
This unit is very responsive and uses two 16- Kit for marke
t!
(Jameco #252751 $12.05)
segment bargraphs to display signal levels and Turbochargers
transient peaks in real time. There are a number 2 Channel USB Oscilloscope KC-5438 $11.75 + post & packing
of display options to select, and both the signal QC-1930 $149.50 + post & packing It's a very simple circuit with only a few
threshold and signal level calibration for each Using Plug 'n Play USB technology and providing components to modify the factory boost levels.
segment are adjustable. Kit supplied with PCBs, full optical isolation from the computer, this It works by intercepting the boost signal from
LCD and all electronic components. Accuracy oscilloscope is easy to setup and use, as well as the car's engine management computer and
within 1dB for signals above -40dB. providing protection for the computer. modifying the duty cycle of the solenoid signal.
• Case not included use HB-6082 $5.50 The software is a fully featured chart Kit supplied in short
recorder, function form with PCB and
generator, logic overlay, and all
generator, logic specified
analyser, and electronic
spectrum analyser components.
all in one easy to
use package. See
Requires 9-12VDC wall adaptor website for
(Jameco #252751 $12.05) specifications.

Log on to
www.jaycar.com/catalog 430+
page
for your FREE catalog! Catalog
1-800-784-0263
(Monday - Friday 09.00 to 17.30 GMT + 10 hours only). All
For those who want to write: 100 Silverwater Rd
Silverwater NSW 2128 Sydney AUSTRALIA
prices in
USD

w w w. j a y c a r. c o m
Simpson.qxd 8/6/2007 10:43 AM Page 46

●●●●
When I first started this
series, I knew I wanted
to build a wireless
weather station. In no
way could I have
imagined how well
the overall system would
C O N T R
YOUR WORLD
O L
function, nor could I have
envisioned its versatility. Build a Wireless Weather System: Part 1

In this article, it all T he wired 1Wire network has


five main disadvantages:
5) If lightning strikes your weather
pole, you run the chance of blowing
comes together. 1) Your system is tethered and you
up your computer or display system.

have to run a cable to the location With a wireless system, all these
If you have already built where you want to place the problems will be solved. The only
display. This can be problematic and cable that needs to be run is for a
a PC or microcontroller- time consuming. power source. This is simply two
based weather station wires and in many cases can be a
connected to a 1Wire 2) You are limited to the length very short run. You can even power
of the cable and the number of your weather pole with a set of solar
network, you may be items you can reliably place on cells and a rechargeable battery.
asking yourself why you the cable. The heart of our wireless system
is a Zigbee mesh network. You have
should go to all the effort 3) If you want to add additional probably read about mesh
and expense of converting sensors to various locations, this can networks, but this is your chance to
it to wireless. prove almost impossible if you don’t actually build one and put it to
have access to attic or basement work. Once the network is built, you
areas. will be able to add sensors or dis-
plays to any location in your home.
4) With a wired system, In addition, we are going to add
you generally only have extra features like the ability to
a single display system. create as many display systems as
we like without
having to change
NOTE: the network in any
The parts list for this project will be way. For instance,
included in Part 2 next month. I can add a PC
interface to the
system by simply
■ FIGURE 2
adding a Zigbee
unit to an RS-232
card and I can start
collecting data. At
the same time, I can
build a small LCD
display for my
desktop. I can add
a large LED sign
display to the front
■ FIGURE 1
entrance of my lab

46 September 2007
Simpson.qxd 8/6/2007 10:44 AM Page 47

BY MICHAEL SIMPSON

area or a voice that announces various


weather or alarm data. ■ FIGURE 3
I tried several Zigbee modules
and selected the Maxstream (www.
maxstream.net) XBee modules shown
in Figure 2. I recommend the whip
antenna module as you get a bit more
range over the small chip-based anten-
na module. The XBee whip antenna
module will cost you about $19 each
and you will need at least three to
build your weather station network.
Because each module’s firmware
must be loaded with special mesh
network firmware, you will need to get
a starter kit (Maxstream #XB24-DKS)
which consists of the following:

• RS-232 development board


• USB development board
• Two XBee OEM RF whip antenna
modules wanted to collect data
• Various cables and connectors from a nearby barn.
• AC adapter The barn is out of
• Configuration software range of my current
network. By placing a
With the purchase of this starter module in a small shed
kit, you will need at least one located between the
additional RF module; more if you two buildings as
want to add additional sensor shown in Figure 3, I
networks and display systems. was able to add the
Before I continue, it’s important barn to my network.
■ FIGURE 4
that I point out that Maxstream has This also has the bene-
just released a set of Series 2 modules fit of allowing me to
and development kits. The Series 2 monitor the pool temperature. have special mesh network coordina-
modules are not currently compatible Our weather station mesh tor firmware loaded. All the other
with the existing XBee modules and network is set up in such a way that modules need to have special
will not work with the instructions all the modules broadcast their data. mesh network router firmware loaded.
presented here. I can assure you, how- This allows any module placed in To load the proper firmware into
ever, that the current mesh network the network to be able to collect or the modules, you need to follow
firmware for the existing XBee transmit telemetry data. these steps:
modules works just fine. My wireless
weather station has been up and run- Updating the
ning for months now and has handled Module’s
all sorts of power outages and other Firmware
interruptions without a single glitch.
When setting up
Just What Do You your weather station
Gain by Using a Mesh mesh network, you
Network in Your Home will need to have one
Weather Station? coordinator. All the
other modules are set
I had three Zigbee/sensor up as routers. The ■ FIGURE 5
modules located in my work area but coordinator needs to

September 2007 47
Simpson.qxd 8/6/2007 10:45 AM Page 48

assigned to the USB file included in the available


interface will vary downloads (listed later).
depending on the cur- The fields that are changed
rent com ports already include the following:
installed on your system.
• PAN ID = 234
• STEP 3: Select the • Destination Address Low = FFFF
modem configuration • Node Identifier = COORDINATOR
tab and hit the • Packetization Timeout = 25
Download New Versions
button as shown in Once the values are changed, hit
Figure 6. This will down- the Write button. Make sure you label
load the latest mesh the module so you can keep track.
■ FIGURE 6
network firmware files
from the Maxstream • STEP 6: Now you need to load the
website. In order to do router firmware into all the remaining
this, you will need to modules. As before, insert the module
be connected to the into the development board and
Internet during this step. hit the Read button. I found that
after changing the module, the X-CTU
• STEP 4: Once you software would no longer respond. If
have updated the X-CTU this happens, exit the program and
firmware files, you will restart it. For the routers in the
need to update the Functions Set field, select the XBEE
firmware on each ZIGBEE ROUTER AT (BETA) setting,
module. I also suggest and then hit the Write button as
■ FIGURE 7
you use a small piece of shown in Figure 8.
tape and mark each
• STEP 1: Install the X-CTU software module so you can keep track of the • STEP 7: Once the firmware upload is
that came with the development kit. node identifiers you assign each complete, hit the Read button. Make
one. Start by programming one of the the following changes manually or
• STEP 2: Load up the software and modules as a coordinator. use the included file called
select the com port you have To do this, insert the module into XBmeshrouter.pro.
connected to the development board. the connected development board The fields that need to be
Note that when using the RS-232 and hit the Read button on the changed include the following:
development board, you will use one configuration tab. This will load
of your existing com ports as shown the current settings for the installed • PAN ID = 234
in Figure 4. The USB development module. Note that the modules • Destination Address Low = FFFF
board will create a new com port are shipped with the baud rate • Node Identifier = R1
and will be labeled as shown in set to 9600. In the Functions • Packetization Timeout = 25
Figure 5. The actual com port Set field, select the XBEE ZIGBEE
COORDINATOR AT (BETA) Note that each router will need to
setting, and then hit the have a different Node Identifier. I used
Write button as shown in R1-Rn in my network. It doesn’t really
Figure 7. This will cause matter what you use, as long as they
the X-CTU software to are different. Write the changes and
upload the new firmware repeat for each router module.
into the module. You now have all your modules
configured for your mesh network
• STEP 5: Once the and are ready to build your wireless
firmware update is weather station.
complete, hit the Read
button. You need to set a Constructing the
few of the parameters. You Network
■ FIGURE 8 can do this manually or
use the XBmeshcoord.pro For the basic network, there

48 September 2007
Simpson.qxd 8/6/2007 10:46 AM Page 49

Build a Wireless Weather System: Part 1


are three components that I will
call satellites: ■ FIGURE 9a

• PC Interface Satellite
• Indoor Weather Satellite
• Outdoor Weather Satellite

PC Interface Satellite
Since the PC interface satellite is
nothing more than a USB or RS-232
development board connected to the
PC, we already have one of our ■ FIGURE 9b
satellites. The USB development
board shown in Figure 9a is a great
board for the PC interface satellite. was featured in the July issue of
Since it’s powered directly by the USB this series. ■ FIGURE 10
port, it’s simple to connect. The only The components needed for this
problem with using this board is that satellite are:
when the PC is powered down, we
lose the ability for this satellite to act • DiosPro 28 chip
as a router. If this is a problem, you • Dios Carrier 1 kit (Note: This is built
can always plug it into a powered USB with the headers facing up.)
hub. If you decide to use the RS-232 • One amp regulator kit
development board shown in Figure • XBee module
9b, you will need to connect the • XBee interface board
included AC adapter. • Hobby Boards or SparkFun pressure
I recommend that you mount the sensor
development boards between two • Humidity gauge (optional)
pieces of plastic as shown in Figures • AC adapter
9a and 9b. This will protect your • PlexiGlass and standoffs
board from shorts and will allow you • Double sided foam tape
to stand the board on end. Figure 10 • SchmartBoard jumpers
shows my PC interface satellite sitting
on one of my shelves. Notice that I listed an XBee
interface board. This is a board that
Indoor Weather Satellite you will need to build. It will provide
You will need a couple of sensors the 5 to 3.3 volt converter needed
indoors as part of your weather to connect the microcontroller. On
station. As a minimum, I recommend the Kronos Robotics website, there
a barometric pressure gauge and a are four application notes showing
temperature sensor. I also added a how to build various interface boards: use, but types 2 and 3 will work just as
humidity gauge to mine. Since we well. Next month in Part 2, we will go
need a coordinator module on our www.kronosrobotics.com/Projects/ step-by-step in the overall assembly
network, the indoor satellite is the MaxStreamInterface1.shtml
perfect candidate. Its job is to set up
the network routing for all the other www.kronosrobotics.com/Projects/
modules (routers) on the network. MaxStreamInterface2.shtml
The whole unit shown in Figure
11 is controlled by a DiosPro 28. The www.kronosrobotics.com/Projects/
DiosPro can talk directly to one or MaxStreamInterface3.shtml
more 1Wire networks, as well as to
various other sensors. Since I am using www.kronosrobotics.com/Projects/
a Hobby Boards pressure gauge, a 14 MaxStreamInterface4.shtml
VAC adapter is needed to power this
satellite. As an option, you may also In my opinion, the type 4 ■ FIGURE 11
use the SparkFun pressure sensor that interface is the smallest and easiest to

September 2007 49
Simpson.qxd 8/6/2007 10:46 AM Page 50

DiosPro to create some


■ FIGURE 13 sort of moisture meter.
In Part 3, I will
take you step-by-step in
building this satellite.

Satellite
Display Units
One of the advan-
tages of building a
wireless weather station is
• DiosPro 28 chip that you can tap into any of the data
■ FIGURE 12
• Dios Carrier 1 kit (Note: This is built being transmitted. I have created a very
with the headers facing up.) simple protocol and various DiosPro
and testing process of this satellite. • Xbee module and PC routines to parse the network
• XBee interface board data for just about any display system
Outdoor Weather Satellite • SchmartBoard jumpers you might want to include.
The outdoor weather satellite • SchmartBoard .1” prototype board The LED display shown in Figures
collects all of the data from the instru- • 5V regulator chip 13 and 14 is a Dios LCD board with
ments on our weather pole and trans- • Two 100 µF capacitors a XBee module mounted on the
mits the data to our mesh network. All • .1 µF capacitor bottom, using one of the various
the components that make up this • 1K resistor interfaces. This particular display uses
satellite must fit in a weather-tight box a single button to toggle through the
like the one shown in Figure 12. If you Since space is at a premium with many different display items. It even
followed along with this series, you the outdoor satellite, you need to counts lightning strikes collected by
saw how I built a weather station build the Type 4 XBee interface board. the outdoor satellite and keeps track
using various 1-Wire components. We You can find a complete application of rain fall totals.
will utilize this interface as well with note explaining the process at www. The display in Figure 15 is the
our outdoor weather satellite. The kronosrobotics.com/Projects/Max same LCD carrier board, but it has
main advantage that we gain is that StreamInterface4.shtml. a graphic LCD attached. In this
once the DiosPro is programmed, you I also used a SmartBoard proto- particular display, I collect the data
need only supply 7-12V to the pole type board to build a one amp regula- given by the indoor satellite and
and the rest is done for you. You may tor, as well as the 1-Wire bus interface. display a 12 hour forecast.
also use a battery and a solar cell to There is plenty of room on this board Figure 16 shows a BetaBrite LED
remove even these requirements. for any other circuitry you might want sign connected to a Dios Carrier
You will need the following to add to this satellite. For instance, board that scrolls real-time weather
components for the outdoor weather you may want to use the built-in 10-bit data across the screen.
satellite: A-to-D (analog-to-digital) ports on the The beauty of these displays is

■ FIGURE 14

■ FIGURE 15

■ FIGURE 16
■ FIGURE 17

50 September 2007
Simpson.qxd 8/6/2007 10:47 AM Page 51

www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com

www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com


www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com
Elexol 3rd Generation Low Cost
that they are not tethered to the
rest of the system and can be placed
USB Data I/O Module
Need to get data into or out of a USB port? Here’s what you need...
anywhere in the house. You can even
• 24 independently programmable Input/Output pins grouped into 3 ports.
build a portable display that runs off • Single module high-speed digital Input/Output solution.
of a battery. • Up to 128 modules can be connected to a single PC with capabilities of
For the PC interface, I have creat- further expansion.
ed several Zeus routines for parsing • Easy to connect by 0.1" pitch headers to suit standard IDC connectors.
the network data using the USB or • Integrated Type-B USB connector.
RS-232 development boards from • On-board unique serial number in EEPROM and custom programmable
FLASH microcontroller.
Maxstream. Figure 17 shows one of
• Both USB enumeration information and microcontroller can be re-
the very simple display applications I programmed to suit customer needs.
use for displaying various pieces of • Module powered by the USB from the PC.
data. You can also use some of my
Great range of I/O-24 peripherals, too...
gauge routines from some of the pre-
vious articles to plot the data. This par-
ticular display will be used next month
in Part 2 as we test our indoor satellite.
CONNECTOR/LED BOARD OPTO INPUT BOARD RELAY OUPUT BOARD SWITCH/PUSH
Final Thoughts Provides screw terminal
connections plus optional either
Provides 8 Opto isolated
inputs for each of the I/O-24
Provides 8 isolated relay
contact outputs suitable for a
BUTTON BOARD
Provides 8 switch/push buttons
pull up or pull down resistors and pins with LED indications. variety of loads. with LED indicators showing the
LED port status indication.
This portion of the Control Your status of the I/O pin.

World series is probably one of the Visit our website www.orteches.com


most complicated projects to-date. Ortech Education Systems
However, I plan on taking you step-by- 1119 - 9th Ave. S. • Moorhead, MN 56560
step through the various sections as 218.287.1379
we proceed. As we move forward, www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com www.orteches.com
you will be able to take the knowledge
gained from these and the previous
weather articles to further enhance
your weather station and home
automation system. If you plan on
building this system, I urge you to
purchase the Maxstream starter kit
and an extra XBee module or two. You
should go ahead and set them up for
a mesh network. Since you get two
development boards, you can open
two instances of the X-CTU software
and run some simple tests.

What’s Next
Next month, we will build the
indoor weather satellite. Using one of
the Maxstream development boards,
we will test and display the results
from this system. I will also
break down the protocol that I use for
transmitting data over the network.
By understanding this protocol, you
should be able to build your own
display systems using any language
or controller.
Be sure to check for updates at
www.kronosrobotics.com/Projects/
wirelessweather.shtml. NV

September 2007 51
Malone.qxd 8/6/2007 12:40 PM Page 52

●●●●
Okay, you’ve wired up
the latest whiz-bang
sensor to your BUILD A .01%
processor-controlled
project. The sensor has ACCURATE VOLTAGE
REFERENCE
been connected to the
12-bit A/D and now the
moment of truth. You
apply power and look at
the data ... Hmmmm,
the numbers don’t look I f you had a separate accurate volt-
age reference available, you could
devices and progress up to a preci-
sion lab-quality circuit.
quite right. After much determine if your DMM is “telling
the truth.” This is but one example Zener Diodes
head scratching, you of why you might want an accurate
measure the A/D voltage reference. Other possible On the low end of the
reasons include using one to reference accuracy continuum, we
voltage reference with calibrate your DMM, or to construct have the lowly zener diode. It is
your trusty DMM and a precision voltage-to-frequency readily available and 5% accurate
converter or current source. devices are inexpensive. A 5.1V,
get to thinking. A 12-bit The applications for a precision 1N751A zener can be purchased
A/D means the input reference fall into two general cate- for about a dime and is a good
gories: instrument (DMM, DVM) starting point for our discussion.
signal is going to be calibration/accuracy verification, or Zeners provide their stated
represented by one of as a circuit component, such as the breakdown voltage only with a
reference for an A/D converter. particular test current, Iz, flowing
4,096 possible codes; The construction part of this arti- through them. This means that the
one part in 4,096 is cle is geared towards voltmeter cali- series-limiting resistor shown in
bration and/or accuracy verification. Figure 1 must be sized to guarantee
approximately .024%. However, the following discussion of that this current will, indeed, flow.
In other words, if you various reference voltage parameters For instance, with a 9V supply
applies equally well to using a volt- and a 1N751A which has a Iz of 20
want to get 12 bits of age reference as a circuit element. mA, the resistor value is (9-5.1)/20
absolute accuracy, the I’ll quickly go through several mA = 195 ohms. Note that the value
voltage reference options, starting of R1 will be different if anything
reference voltage must with inexpensive and fairly crude other than a high impedance is
be within .024% of the placed across the zener.
I don’t want to dwell too much
desired value. This puts on the lowly zener but there is one
a heavy burden on the point worth emphasizing. You may
be asking, what is the advantage of
test equipment used to using a zener if an accurate supply
measure the reference voltage and a precision resistor are
needed to get the precise desired
voltage.
■ FIGURE 1. NOTE:
So, just how accurate Inexpensive, PCB patterns and artwork are
is your DMM? 5% accurate,
5.1V reference.
available on the Nuts & Volts
website at www.nutsvolts.com.

52 September 2007
Malone.qxd 8/6/2007 12:41 PM Page 53

BY DOUG MALONE

■ FIGURE 3.
1% accurate,
5V reference.
■ FIGURE 2. 4%
accurate, short-
circuit proof, 5V
reference.

current flowing through the device? If the current through the device
Well, fortunately, things are not as varies from 1 mA to 15 mA, the
critical as they might first appear. The voltage drop is guaranteed to change
reverse impedance of the zener is quite a maximum of an additional 10 mV. usual, you get what you pay for. This
low, which means that the current can Figure 3 shows a typical circuit. increased performance will approximate-
vary quite a bit and the voltage will still So far, accuracy has been stated as ly double the cost to a little over $2.
remain relatively constant. As part of a percentage of the nominal voltage Next, we can consider the Analog
the research for this article, I tested with no additional qualifying conditions. Devices AD586L shown in Figure 4.
five 1N751A zeners from Fairchild One such condition is temperature. This device provides 5.000V within
Semiconductor. I used a 200 ohm, 5% Unfortunately, changes in ambient tem- 2.5 mV (.05% accuracy) and has a low
series resistor whose measured value perature will cause a change in the ref- temperature coefficient of 5 ppm/°C,
was 197 ohms. When I varied the sup- erence voltage, regardless if the device an aging rate of 15 ppm/1,000 hours,
ply from 8V to 10V, the current through is a zener or a precision reference. and a supply current of 3 mA. It will
the least accurate zener of the group For instance, the LM4040 DIZ-5.0 cost you a little over $9, however.
varied from approximately 14.3 mA to has a worst-case temperature coeffi- At this point, I need to explain a
24.3 mA, but the zener voltage stayed cient of 150 ppm/°C. This means that little about aging rate — also known as
within 2.3% of 5.1V. The best of the five for every degree up (or down) from long-term stability — specifies how the
devices was within 0.2% of 5.1V! Not 25°C, the breakdown voltage of the reference voltage will change over an
bad for such a simple and inexpensive device will change by 150/1,000,000 extended period of time. In other words,
component. Your mileage may vary. or .015%. Obviously the smaller the even though the temperature, applied
temperature coefficient, the better. voltage, and load current may be con-
Three-terminal For general indoors lab work, the stant, all voltage references will slowly
Regulators temperature coefficient will probably drift over time. A 15 ppm/1,000/hour
not be as important as it would be if aging rate means that after 1,000 hours
Next up, we have the common the voltage reference were exposed to (about 42 days), the voltage can be
7805 three-terminal regulator. The more extreme temperatures. Your expected to be 15/1,000,000 or .0015%
MC7805 from Fairchild (and others) specific application will determine if higher or lower than its original value.
costs about $.50, gives 4% accuracy you need to use a device with a low Now for the pièce de résistance!
under light load, is short-circuit proof, temperature coefficient. As you Intersil has recently come out with a
and can more easily accommodate might suspect, devices with a low series of voltage references that signif-
wide swings in load current than temperature coefficient tend to cost icantly improve upon the historical
the simple zener regulator. Higher more than those with a higher
accuracy devices are available such as temperature coefficient.
the 2% KA7805AE for $.80. Figure 2 ■ FIGURE 4. .05%
accurate, 5 ppm,
shows a typical application circuit. Going Up the 5V reference.
For 1% accuracy, you might want Accuracy Food
to consider the LM4040DIZ-5.0 from Chain
National Semiconductor. This device
costs about a dollar and is a “shunt” Next up on the accuracy
reference similar in general concept to scale, you could try a
a zener except that it isn’t nearly as LM4040AIZ-5.0; this device is
picky as to the current flowing accurate to 0.1% and has
through it. With a 1% accurate device a moderate temperature coeffi-
at room temperature, the output cient of 100 ppm/°C. Now we
voltage is 5.00V plus or minus 50 mV. are getting somewhere! But, as

September 2007 53
Malone.qxd 8/6/2007 12:41 PM Page 54

■ FIGURE 5. Schematic of
the battery-powered, .01%
accurate, 5.000V reference.

price/performance ratio. The series Circuit Description as 8.0V. However, I was pleasantly
includes devices with 1.024V to surprised when I measured the first
5V reference voltages with high The 5V precision reference is couple of prototypes and found that
accuracy, low temperature coefficient, powered by a 9V battery. The circuit the 5V reference voltage was within
low aging, and very low current draws about 4 mA with a fresh .01% with a battery voltage all the
consumption. The X60008C is used in battery, which results in a battery life way down to 6.7V! Hopefully, you will
the construction part of this article in excess of 48 hours of continuous get equally good results.
and costs about $7.50, provides operation. Increased battery run-time Besides supply voltage and com-
5.000V accurate to within 500 µV can be achieved by applying power, ponent tolerances, there are two more
(.01%) , has a low temperature letting the unit stabilize, making your potential error sources that need to be
coefficient of 5 ppm/°C, low aging measurement, and then turning the mentioned. Mechanical stress on the
rate of 10 ppm/1,000 hours, power off. D4, a TL431 “variable die inside the X60008 package can
and incredibly low supply current zener” whose breakdown voltage is cause a voltage shift in the reference
requirement of 800 nA. Figure 5 set by R2 and R4, produces 6.5V to voltage. For instance, pressing down
shows a schematic using this device. supply power to the X60008. on the board and causing it to flex can
The .01% accuracy of the X60008 cause stress. Looking at the photo in
■ FIGURE 6. Photo of the completed is specified with a supply voltage of Figure 7, you will see two slits in the
reference. Note PCB slits adjacent exactly 6.5V; the 5.000V reference printed circuit board (PCB) on either
to X60008. output can deviate as much as side of the X60008. The purpose of
100 µV per volt away from these slits is to de-couple the X60008
6.5V. For example, if the sup- from the rest of the board and make it
ply is 7.5V, the 5.000V refer- more difficult for mechanical stresses
ence could be off as much as to be transmitted to the reference.
600 µV(500 µV from the initial Another potential error source is
.01% tolerance plus another temperature stress. When soldering
100 µV from the supply being the leads of the X60008 to the circuit
1V from the ideal 6.5V); 1% board, work quickly! It is stressful to
resistors and a 0.5% TL431 are the IC die to have one lead at an ele-
used to keep the 6.5V supply vated temperature and other leads at a
between 6.3V and 6.7V. lower temperature. Leaving the solder-
Diodes D1 and D2 pre- ing iron on a pad too long can result in
vent damage to the circuitry the reference voltage permanently
if the battery is installed back- shifting to an out-of-spec value. If you
wards. A low current LED, have an adjustable temperature solder-
D3, is used as a visual power- ing iron, don’t turn it up beyond 600°F.
on reminder. I designed the Use of a flux pen can be very helpful.
circuit to function correctly The X60008 package has eight
with a battery voltage as low leads, but only four are used. I purpose-
ly left off the four PCB pads associated
■ FIGURE 7. This photo shows with the unused IC leads; this minimizes
the 9V battery and holder the number of leads that need to be
supporting the PCB. soldered, which lowers the amount of

54 September 2007
Malone.qxd 8/6/2007 12:42 PM Page 55

Build a .01% Accurate Voltage Reference


thermal stress that the die is exposed to. use a 2-56 x 1/4” screw and nut the X60008 can source and sink up to
If you aren’t confident in your soldering to hold the PCB firmly against the 10 mA, but for highest accuracy it
ability, you may want to have someone battery holder. Finally, solder the should only be connected to a high
help you who is more skilled. battery holder wires to the PCB. impedance load such as a voltmeter.
Another alternative would be to If higher current is needed, a
purchase the PCB with the X60008 Test buffer amplifier should be construct-
soldered onto the board as listed in ed; check the Intersil website
the Parts List. I have successfully Slide the power switch to the OFF (www.intersil.com) for sample
hand soldered four prototypes which position. Insert a fresh 9V alkaline circuits. Figure 7 shows a completed
resulted in all devices easily meeting battery into the holder and slide the prototype with the reference voltage
their .01% specification. With a switch to the ON position. The LED displayed on a recently calibrated,
reasonable amount of skill, you should should light up; if not, look for proper .003% accurate, 6.5 digit, Hewlett
achieve similar results. polarity of all the diodes including the Packard 34401A DMM.
LED. Using your DMM, measure from
Assembly the — output terminal to the cathode Parting Thoughts
of D2. This voltage should be between
To help keep the cost down, I 6.25V and 6.7V. Finally, put your meter The previous brief survey of
decided on designing a single-layer across the + and – output terminals voltage references mentions only a
PCB. Since the actual voltage refer- and you should see 5.000V displayed. small fraction of the devices that are
ence IC is surface mount, this pretty For highest accuracy, there are available. For additional products,
much dictated that everything be sol- three things to keep in mind. First, the check the web pages of Analog
dered on the component side of the voltage reference should be used at Devices, Intersil, Linear Technology,
board. This is a little unconventional temperatures as close to 25°C (77°F) Maxim Integrated Products, National
but no big deal, and as can be seen in as possible. A few degrees either way Semiconductor, On Semiconductor,
Figure 6, results in a compact assem- won’t make much difference, but you Texas Instruments, and Zetex. These
bly. The PCB sits on top of the plastic wouldn’t want to put the unit out in manufacturers also have application
9V battery holder and is supported by the sun and expect to get .01% accu- notes available that delve into the
small bosses on the holder that act as racy. Secondly, allow the circuit to details of voltage references and will
PCB standoffs. After component leads temperature stabilize for 30 minutes help insure that you have the knowl-
are inserted through the board and sol- with power applied before use. Lastly, edge to apply them properly. NV
dered, cut off the excess lead length
flush with the bottom of the board.
Normal anti-static precautions
need to be taken during assembly
PARTS LIST
(anti-static work surface and wrist Item Description Supplier/Part No.
❑ B1 9V alkaline battery Duracell/MN1604
strap). Use a small tip on your iron and
❑ B1 Battery holder Mouser/12BH611
solder the X60008. As mentioned ❑ C1 4.7 µF 16V electrolytic capacitor Mouser/140-XRL16V4.7-RC
above, don’t apply more heat or time ❑ C2 0.01 µF ceramic capacitor Mouser/581-SR215C103KAR
than is necessary to achieve a reliable ❑ C3 1,000 pF ceramic capacitor Mouser/80-C315C102K5R5TA
connection. Place and solder the ❑ D1 1N5819 Shottky diode Mouser/625-1N5819-E3
remaining components, saving the ❑ D2 1N914 signal diode Mouser/78-1N914
battery holder for last. Orient the LED ❑ D3 LM431CCZX variable zener Mouser/512-LM431CCZX
properly by noting that the cathode ❑ D4 HLMP-K150 low current LED Mouser/638-HLMPK150
❑ R1 560 ohm 5% 1/4W resistor Mouser/291-560-RC
lead is shorter than the anode and is
❑ R2 40.2K 1% 1/4W resistor Mouser/271-40.2K-RC
inserted into the square pad on the ❑ R3 5.1K 5% 1/4W resistor Mouser/291-5.1K-RC
PCB. To provide access for your solder- ❑ R4 24.9K 1% 1/4W resistor Mouser/271-24.9K-RC
ing iron tip, space D3, D4, C2, and C3 ❑ S1 Slide switch Mouser/688-SSSS22700
up off the board a bit. Take a couple of ❑ U1 X60008CIS8-50 Digi-Key/X60008CIS8-50
cut-off resistor leads and form them ❑ 1 ea 2-56 x 3/8” screw Digi-Key/H130-ND
into a “U” shape and insert them into ❑ 1 ea 2-56 nut Digi-Key/H212-ND
the + and – 5V reference output pads. ❑ Printed circuit board
After all the components are in
An etched, drilled, and screened printed circuit board with the X60008-50
place and their leads cut off flush with soldered on the board is available from Doug Malone, PO Box 1542, Battle
the bottom of the board, insert the Ground, WA 98604 for $18 plus $2.50 shipping & handling. WA residents please
two leads of the battery holder add 8% sales tax.
through the holes in the PCB. Next,

September 2007 55
Page56.qxd 8/7/2007 11:04 AM Page 56

Turn Your PC into a Real-Time


Audio Spectrum Analyzer
Features
FFT to 1048576 pts
24 bit, 192kHz
1/96 Octave
Dual Channel
3-D Surface Plot
Spectrogram Plot
Digital Filtering
Signal Generation
RT-60, Leq, Delay
THD, IMD, SNR
DDE, Logging
Vibration Analysis

SpectraPLUS 5.0
FFT Spectral Analysis System

Download 30 day FREE trial!


www.spectraplus.com
Starting at $295

PHS Pioneer Hill Software


24460 Mason Rd
Poulsbo WA 98370
360 697-3472 voice
360 697-7717 fax
[email protected]

56 September 2007
Full Page.qxd 8/8/2007 4:03 PM Page 57

UNIQUE PRODUCTS + SUPPORT!


Color LCD Scope Handheld Scope Mixed-Signal PC Oscilloscope Pen Scope Logic Analyzer
100 MHz Scope and Logic Analyzer
lle t
Se Bes
r
Te s t i n g

lets you do complex triggering to find


hard-to-get-at glitches, spikes, etc.
Huge 4 or 8 MS buffer for deep data
drilling and zooming. Optional built-in
swept signal generator. 2 Analog
25MHz or 60MHz 2-ch + trigger 20MHz or 60MHz rugged PS2105 - 25MHz USB powered ZeroPlus - Intuitive full-featured
channels x 10, 12, 14 bit with more
standalone USB bench scope handheld USB scope with 3.8” than 60 dB dynamic range. 8 digital
s c o p e - i n - a - p r o b e ! U p t o 16-channel with 4mb memory.
with 7.8” color LCD. Compare color LCD. Built-in meter - inputs for mixed signal display/trigger. 100MS/s, 24kS buffer C/VB/ Sophistcated triggering. I2C, SPI,
with expensive LCD scopes! great for your tool kit. CS328A-4 (4MS Buffer) $1149 Delphi/LabView/VEE drivers. and UART monitoring. Includes
PDS5022S (25MHz) $349 HDS1022M (20MHz) $529 CS328A-8 (8MS Buffer) $1642 PS2105 (25MHz, 100MS/s) $372 clipleads, USB cable and software.
CS700A (signal generator) $249
PDS6062T (60MHz) $599 HDS2062M (60MHz) $749 PS2104 (10MHz, 50MS/s) $234 LAP-16128U $299
USB to I2C Blue 320 x 240 LCD Ethernet to I2C I2C for PCs Ethernet to I2C FREE COFFEE
I2C

Call 1-888-7SAELIG
Devasys - Provides a simple I2C/RS232-driven easy-to-use Fiveco - TCP/IP server with I2C, PCI93LV: industry-standard I2C card NM7010A-LF REV 2 - Complete, Mention Offer# SBW
“drop-in” solution for connecting graphics/text 4.8” x 3.6” LCD - 19 x digital I/O, 5 x 10-bit A/D for PCs. WINI2C/PCI software hardwired TCP/IP-I2C module. Offloads
gives windows-interface to develop to get a free
your PC to 90kHz I2C + 20 I/O white backlight. Program in inputs, and UART serial interface. stack for hi-speed Internet-enabling Starbucks Card
and debug I2C bus systems.
lines. Free software. Use multiple Basic. Display bmp, text, Connect I2C devices/sensors UCA93LV is USB version.
microprocessor systems. Drop-in with your order!
boards for more I2C/IO. graphics, etc. to an Ethernet network! Transparently monitor at W3100A-based board for instant While supplies last -
USB I2C/IO $79 GHB-3224C $199 FMod-TCP from $250 400kHz! $499 network speeds to 8Mbps. $22 not available with any other offers

Stepper Motor Touchpanel Controller USB to 24 x I/O FATfile Storage Easy LCD Touch-Sensing ICs
I/O

Easy-Step 3000 - Advanced stepper CUTOUCH - 320 x 240 Blue Elexol - 24 latched I/O lines self- Micro ALFAT-SD - Easily add Micro LCD - Easy way to add 2” sq Quantum ICs - World’s best capacitive
motor drive and control system for Graphic LCD Touchpanel/controller. powered from USB port. Ubicom SD storage to your product. 128 x 128 color LCD or bright OLED. sensor ICs for switching & control.
unipolar stepper motors up to CUBLOC Program in Basic SX52 allows individual pin I/O Serial data in - FATfile data Add text/graphics/animations Patented Adj. Key Suppression,
35V/3A- ideal for robots/industrial and/or LadderLogic. 82 I/Os and programming. I/O control via PCs out. for any micro with serial/USB. Spread-spectrum. In use worldwide
control - turns you into an instant 2 RS232 MODBUS support. USB port. uALFAT-SD $40 Micro LCD MK II $82 by the world’s largest consumer/
motor control expert! from $84 CT1720 $359 USBI/O24R $69 uALFAT IC $14 Micro LCD-OLED $99 appliance mfrs from $1
Serial-Ethernet Cable Ethernet to Serial Ether-IO Mini Web Server WIZnet TCP/IP IC Serial Server
Ethernet

Network your serial product easily WIZnet - Ready-to-go serial-to- Ether-IO - UDP/IP-controlled 24 PicoServTM Miniature Web Server 10/100 Ethernet controller on a
RS232/422/485 device server for
without a PC using this 28” cable. Ethernet Gateway. Simple set-up digital I/O board 3 x 8-bit TTL allows remote I/O and servicing. chip! Fully hardwired TCP/IP core.
network-enabling legacy serial
Provides an instant IP address. for 10/100Mbps Ethernet - ports each independently Collect analog & digital data over No OS required. TCP offload devices. 1/2/4/8/16/32 ports
RS-232 port compatible with most 230kbps serial. Ethernet/ programmable. Connects to any a web connection. Remote sensing/ improves system performance. 10/100Mbps-230kbps. Static
10/100mpbs Ethernet hubs. Internet-enable any serial part. TCP/IP Ethernet network. control, SCADA, building control. W5100 (integrated PHY) $6.95 IP/DHCP/PPPoE.
eCOV-110-P $99 EG-SR-7150MJ $34 Ether-IO 24 $109 PP1001-V00 $205 NM7010B+ Eval $22 Portbase-3010/RS232 from $171
Bluetooth 3ALogics Transceiver Modules Wireless Controllers TinyOne Zigbee TM Data Modem
RF

Emxys PearlBlue - 100m-Bluetooth RFID Reader Chip - Reads FIVE LPRS easyRADIO TM makes GSM/GPRS/GPS/Bluetooth/ Complete RF solution for fast & reliable USB-powered radio transceiver
module (UART master/slave bridge). International Standards ISO14443 wireless data transmission Ethernet wireless controllers data transmission. Miniaturized OEM boards add wireless RS232 to
Easyconnectionformicro'stoPCs,PDAs, A/B, Tag-IT, Felica and ISO15693. simple for US and Europe! Add for M2M - for autos, machines, RF module ensures fast and easy your device! Get remote control
phones, etc. microIceBlue - PIC16F877 Single-chip solution. wireless capability to your project etc. RS232/485/CAN/ A/D-I/O. integration into wireless applications. for your product from PC USB
based emb. dev. system for shortest TRH031M $6.95 today! TinyOne Zigbee $55 port!
Bluetooth development. $99 RSK-100 Eval Kit $350 ER900TRS from $38 (100) Owasys from $441 B915FH-tiny/40-SMD-WA $61 RTM-USA $89
USB in one IC FT232R Module USBwiz Easy USB GPS Logger USB-Serial Adapter
EW
N
USB

FT232RL - FTDI USB1.1-serial IC with UM232R - FT232RL 24-pin DIP USBwiz - Easily add USB microUSB - Tiny ready-made USB TrackStick II - Pocket-sized logger FTDI - based serial port laptops.
new "security-dongle" feature. Each module - USB-TTL serial convert- peripherals to your system. Includes Interface to 1 Mbps 0.7” x 0.5” tracks position data for vehicles, Instantly adapts older RS232
unique ID and Internal EEPROM, er for your project. Reference cir- FATfile system for USB thumb & based on SiLabs CP2101. personnel, etc. Records date, time, products to USB! Included drivers
FT232RL $2.50 (1K) cuit for FT232R. Plug-in module external USB hard drives. No Gnd/RX/TX Suspend, Reset, & location, route and speed. Shows provide virtual COM port.
FT232BL $2.93 (1K) adds USB1.1 instantly! USB knowledge needed. Plug-n-play! 3.3V 100mA source. data on Google maps! $175 USB-COM-S (45”) $19
Check out the whole FTDI line! UM232R $19.99 IC $29 Demoboard $59 microUSB $25 Super TrackStick II $209 USB-COM (13”) $25

www.saelig.com [email protected]
check for special offers! new products every day!

1-888-7SAELIG 585-385-1768 fax


Lindley.qxd 8/8/2007 11:08 AM Page 58

Floating Point
MULTIPLICATION
and
DIVISION
Without Hardware Support
by Craig A. Lindley

began my career as a hardware engineer many years

I ago, but I’ve spent the last 12 years writing Java


software for large commercial applications; far
removed from the underlying hardware on which the
applications run. Only recently (after reading all the back
issues of Nuts & Volts and MAKE magazines available in
my local library) have I had the urge to get back to the
basics and write some software that runs directly on top
of the hardware. The hardware, in this case, being small
microprocessors or microcontrollers. I could tell from
reading the various articles the authors were having fun
experimenting with the small computers and controlling
just about anything they could think of. It had been a long
time since I had designed hardware or programmed such
small computers. You could say I have come full circle.
58 September 2007
Lindley.qxd 8/8/2007 11:08 AM Page 59

TABLE 1. MSP430-F2012 CAPABILITIES


T he event that finally pushed me
over the edge and down this
slippery slope was I saw an ad for a
Attribute Description

microcontroller development kit Clock speed Up to 16 MHz with many instructions executing in one clock cycle.
from Texas Instruments (TI) called Flash memory 2K bytes
the eZ430-F2013 that could be
had for $20 plus shipping. At first I RAM 128 bytes
didn’t believe it was possible. I ADC A 10 bit ADC is onboard with built-in voltage references.
thought the ad was a misprint but it
wasn’t. That did it. I had to have TimerA can be configured for pulse width modulation that can
PWM be routed to selected pins of the device.
one. It turns out this development
kit is an incredible deal, perfect for TimerA and a watchdog timer are onboard. The watchdog
experimentation with what turns Timers timer can be used as an interval timer if the watchdog function
isn’t required by the application.
out to be the “world’s lowest
power” microcontroller family. A Power Claimed to be the world’s lowest power device.
$20 development kit does truly
I/O capabilities A single eight bit port is available with individual control over
bring microcontroller programming direction and function of each pin in the port.
and experimentation to the Hardware
masses. See the sidebar for more No
Multiplication
information about the eZ430-
F2013 development kit. TABLE 2. APPLICATION REQUIREMENTS
Then the only question was,
“What will I do with it?” It turns out Attribute Description
the answer to this question came At least four This would require at least four digital filters to achieve. The
about as fast as the development channels of filters would need to be at least third order for adequate
frequency selective separation between channels. Digital filters require floating
kit came in the mail. For years, I lighting control point arithmetic for their implementation.
have wanted to design a state-of-
A noise gate will be required to eliminate room and/or
the-art color organ similar to the Noise gate circuit noise in the absence of musical material.
ones I built in my younger days, but
An automatic gain control (AGC) is needed to allow the color
this time do it to the extent AGC organ to adjust itself to changes in musical content. I didn’t
possible in the digital domain want any user controls being necessary.
(instead of the analog). I wanted a built-in microphone with preamp in addition to
For those not familiar with a stereo line input for direct connection of the color organ
what a color organ is, it is a device to any sound source. An analog-to-digital (ADC) converter is
Audio inputs a requirement of the microcontroller used. The ADC converts
that splits music up into numerous the mic or line analog signals into digital samples for
frequency bands and modulates processing by the microcontroller.
colored lights according to the I wanted to drive at least 10 super bright LEDs per channel
musical content. Typical color for the size display box I had in mind. This equates to about
organs are three or four channels Output lighting 200 mA output drive capability per channel. The application
required PWM capabilities so the brightness of the LEDs in
with one color of light associated each channel could be controlled independently.
with each frequency band. With a
Multiple hardware timers would be required for control of
color organ, you can see the music, Internal timing functions internal to the color organ. This includes display
as well as hear it. control sequencing and PWM generation.
Further fueling the desire for a
state-of-the-art color organ was the availability my grandiose idea be implemented on such a
of inexpensive super bright LEDs. The color small microcontroller? My initial answer to
organs I built in the past used incandescent this question was a definite maybe. Take a
lights which introduced a time lag into the look at Tables 1 and 2 and let’s compare
musical response as the light’s filaments had to the capabilities of the MSP430-F2012
heat up and cool down. If LEDs were used microcontroller to the requirements of my
instead, not only would this time lag be application and see.
eliminated, but due to the life expectancy of After contrasting the controller’s capabili-
today’s LEDs, you would probably never have ties with my application’s requirements, it
to replace one. was immediately apparent that if all of the
So, I had my development kit in hand required functionality were going to fit in
which included a bunch of documentation, a the Flash memory, the overhead imposed by
single target board, an emulator, C compiler, use of a high level language (HLL) could not
assembler, linker, and debugger and I had my be tolerated. This was true both in terms
idea of building a digital color organ. Could of the space required by a runtime library
September 2007 59
Lindley.qxd 8/8/2007 11:09 AM Page 60

and/or for the performance hit of an the theory is applied. (The Resources sidebar
interpreted language like some Basics. If this has some pointers to arithmetic theory for those
color organ was going to work, I would need interested in reading further.) Suffice it to say,
to code in assembly language and do so as Horner’s method allows multiplication and
efficiently as possible. division of signed and/or unsigned floating
The first hurdle I had to face was that point numbers using a rather elegant approach
digital filters of the IIR (infinite impulse which I will illustrate. Horner’s method is not
response) variety are typically implemented without its drawbacks, however, which include:
using difference equations of the form:
• When multiplying and dividing, the multiplier
y[n] = A * y[n-1] + B * y[n-2] or divisor must be known in advance and
cannot be changed dynamically. This is not an
where y is a three element array of output issue with most DSP applications because most
history and A and B are floating point filter coefficients are known at design time and don’t
coefficients that are determined from the type change at runtime. (This is true in general, but
and response of the filter being implemented. probably not true of everyone’s applications.)
To use such filters, I needed to be able to
multiply floating point numbers on a • A division remainder is not available using
microcontroller that doesn’t even know how Horner’s method like it is in most other division
to multiply integers. Floating point arithmetic techniques. (Why this is so will be shown later.)
is something one takes for granted when
using a HLL, but as I mentioned this was not • The results of multiplication and division are
an option here. rarely 100% accurate and the errors vary
depending upon the types of numbers being
Horner’s Method to the Rescue processed. (I will illustrate this with examples
shortly.)
In my investigation of how floating point
arithmetic might be done, I stumbled across a TI For my color organ application, none of
application note (see Resources) that described these drawbacks turned out to be significant.
Horner’s method for floating point multiplica- The process of using Horner’s method can
tion and division. Horner’s method provides be broken down into the following series of
reasonably accurate results while only requiring steps. Given a known multiplier or divisor:
shift/rotate and add instructions; something the
MSP430 controller family has and does very 1) If dividing, invert the divisor so that it
well in a single clock cycle. becomes a multiplier.
The remainder of this article describes this
method along with a technique called 2) Convert the multiplier to its binary represen-
Canonical Sign Digit or CSD that can be used to tation of the required bit length; usually 10, 12,
optimize the Horner results. Finally, I will pres- or 16 bits.
ent a program I wrote called Horner.java, that
generates Horner equations and can even gen- 3) Optionally apply CSD to the binary
erate the MSP430 code for performing floating representation to optimize it. (CSD will be
point multiplications and divisions. Note: Even described later.)
though the focus here is on the MSP430 family
of microcontrollers, the techniques presented 4) Generate the Horner equations for the
are applicable to any processor. multiplication from the binary representation.
I won’t delve into the theory behind
Horner’s method; instead, I will show you how 5) Generate the computer code which
implements the Horner equations.
“... a color organ is a device that splits The example that follows will show how
music up into numerous frequency bands this is done. It is actually kind of fun to generate
the equations and the code by hand the first
and modulates colored lights according to couple of times to aid in really understanding
the process. Horner.java came about because I
the musical content ... With a color organ, had to generate a lot of multipliers and the fun
quickly turned to tedium.
you can see the music, as well as hear it.” Let’s generate the equations for the multi-

60 September 2007
Lindley.qxd 8/8/2007 11:09 AM Page 61

plier 0.123456. We will do this using 12 bits in positive powers of two in the Horner
and no CSD. The 12 bit binary representation of equations. Consider a multiplier of 654.321.
0.123456 is 0.000111111001. Starting from the
rightmost bit which is the Least Significant Bit Decimal representation:
(LSB) and moving towards the MSB (Most 001010001110
Significant Bit), find the first one bit in the Fractional representation: 010100100010
binary representation. This occurs at the 2-12 bit
LSB position. From there, count the number of The equations for the decimal portion of
places to the next one bit which, in this case, is the multiplier are:
three. The number of places between the one
bits is called the distance and a distance of T1 = X * 22 + X
T2 = T1 * 24 + X
three results in the first Horner equation:
T3 = T2 * 21 + X
T4 = T3 * 21 + X
T1 = X * 2-3 + X Decimal result = T4 * 21

Here, X represents the number the multipli- Notice the positive powers of two in the
er will be multiplied by. T1 is just a temporary above equations.
accumulator for the calculation. The final X is The equations for the fractional portion of
added in because there are more one bits the multiplier are:
remaining in the representation. This process
is repeated until all one bits in the multiplier’s T1 = X * 2-4 + X
representation have been traversed. The T2 = T1 * 2-3 + X
complete set of Horner equations for our T3 = T2 * 2-2 + X
multiplier is then: Fraction result = T3 * 2-2

Total Result = Decimal result + Fraction


T1 = X * 2-3 + X result
T2 = T1 * 2-1 + X
T3 = T2 * 2-1 + X
T4 = T3 * 2-1 + X
T5 = T4 * 2-1 + X Listing 1
T6 = T5 * 2-1 + X
mov #29,x ; Set the multiplicand
Result = T6 * 2-4
mov x,acc ; Do the decimal portion of the multiply
rla acc
The 2-4 in the final equation is the bit weight rla acc
of the leftmost one in the binary representation. add x,acc ; acc = x * 2^2 + x
Let’s check our results. If we were to set X rla acc
to 1,000, the result we would expect on a rla acc
rla acc
calculator, for example, would be 123.456. rla acc
Using 1,000 in the Horner equations yields 123 add x,acc ; acc = acc * 2^4 + x
for an error of 0.456, which is less than one rla acc
least significant bit. Not bad accuracy for add x,acc ; acc = acc * 2^1 + x
rla acc
many applications. add x,acc ; acc = acc * 2^1 + x
Division, as mentioned, is accomplished rla acc ; acc = acc * 2^1
by multiplication using the inverse or reciprocal mov acc,out ; Save the decimal result in out
of the divisor. That is X / Y is the same as X *
mov x,acc ; Reload x for the fractional part
1/Y. So, if you were trying to divide 100/10 rra acc
with Horner, you would actually be multiplying rra acc
100 * 0.1. Now you see why the remainder rra acc
from the division isn’t available; there really is rra acc
add x,acc ; acc = acc * 2^-4 + x
no division. rra acc
Separate sets of Horner equations are rra acc
generated for a multiplier or divisor that has rra acc
both a decimal and a fractional part. The add x,acc ; acc = acc * 2^-3 + x
rra acc
decimal portion of the number is processed rra acc
from the MSB to the LSB, just opposite the add x,acc ; acc = acc * 2^-2 + x
direction the fractional part of the number is rra acc
processed. Another difference is that the rra acc ; acc = acc * 2^-2
distances between ones in the decimal portion add acc,out ; out = dec result + frac result
of the number are positive values which result

September 2007 61
Lindley.qxd 8/8/2007 11:10 AM Page 62

Using a calculator to again check our (“rra” for the MSP430 family) is used for
results when X is equal to 29, the product every negative power of two and a rotate left
should be 18975.309. Running 29 through the instruction (“rla”) is used for each positive
Horner equations yields 18966 for the decimal power of two. For every + X operation, an “add”
result and 9 for the fractional result; their sum instruction is used. For every – X operation
being 18975. Here, the error is again less than (discussed in the context of CSD), a “sub”
the least significant bit. instruction is used. Assuming the symbols “x,”
Generating code to implement these “out,” and “acc” are register aliases, the code is
equations is easy. A rotate right instruction as shown in Listing 1.
This may seem like a lot of instructions, but
remember, each register operation executes in
The TI eZ430-F2013 Development Kit one clock cycle on the MSP430 family of
controllers. The above multiplication executes
Yes it’s true. You can get a complete TI MSP430 microcontroller
in about 32 clock cycles. If the processor is
development kit for $20 plus shipping. It’s called the eZ430-F2013
and is in the form of a USB stick (envision a jump drive). Amazingly, running at 16 MHz, the total execution time is
both the debugger interface and a target board fit inside the a respectable two microseconds.
stick. This development system works with all MSP430F20xx Of course, a C programmer would be able
devices. Even someone as frugal as myself could not pass up a to perform the multiplication in a single line of
deal like this. This offer puts microcontroller development within code such as:
everyone’s reach.
The following information was extracted from the TI website. double result = 29 * 654.321;

Description
The eZ430-F2013 is a complete MSP430 development tool and get exact results. Such is the plight of the
including all the hardware and software to evaluate the assembly language programmer.
MSP430F2013 and develop a complete project in a convenient USB
stick form factor. The eZ430-F2013 uses the IAR Embedded Canonical Sign Digit
Workbench Integrated Development Environment (IDE) to provide
full emulation with the option of designing with a stand-alone Canonical Sign Digit or CSD can be
system or detaching the removable target board to integrate into used to reduce the number of arithmetic
an existing design. The USB port provides enough power to operations (rotates and adds) required to
operate the ultra low power MSP430 so no external power supply
is required.
implement the Horner equations. CSD is an
optimization resulting in fewer instruction
Features executions required to achieve the same
• eZ430-F2013 development tool including a USB debugging result. CSD is a processing step that is
interface and detachable MSP430F2013 target board inserted in the process flow where previously
• LED indicator described. If a multiplier or divisor consists
• Removable USB stick enclosure of decimal and fractional parts, the CSD
• Debugging interface supports development with all MSP430F20xx process is applied across the complete binary
devices
representation. CSD processing proceeds
• Integrated IAR Kickstart user interface which includes an assembler,
linker, simulator, source-level debugger, and limited C compiler from the LSB bit to the MSB and works
• Full documentation on CD-ROM by grouping adjacent one bits in the binary
representation and replacing them with a
What’s Included simpler term.
• CD-ROM including software and documentation To do this, it is required that our binary
• IAR Embedded Workbench (Kickstart Version) IDE representation consisting of ones and zeros
• eZ430-F2013 Development Tool be replaced with a trinary representation
consisting of three symbols (0, 1, and -1). The
In addition to the development system, a set of three MSP430-
F2012 target boards is available for $10. TI’s part number for these
-1 is a special symbol that indicates some
boards is eZ430-T2012. These boards are about the size of a quarter number of consecutive ones (a run of ones)
cut in half. The F2012 processor itself is about the size of the have been replaced. After the application of
fingernail on your little finger. I used one of these target boards for CSD, there won’t be any consecutive ones
my color organ project. left in the binary representation of a number.
The included C compiler is limited to the production of 4K of It is necessary to restart CSD processing after
code which means it cannot be used on the largest of the each run replacement as a new run of
MSP430F20xx devices. TI makes available a free C compiler on its ones may be created by the insertion of
website that can generate up to 8K of code. Since my first MSP430
the replacement.
project was written entirely in assembly language, I didn’t try out
this alternative C compiler. CSD processing is performed in a loop
as follows:

62 September 2007
Lindley.qxd 8/8/2007 11:10 AM Page 63

While there are consecutive ones in the Binary representation: 0.0011100000


representation CSD representation: 0.0100-100000
Starting at the LSB of the binary repre-
sentation search leftward for a run of ones.
Create and insert a replacement string for As you can see, the -1 was inserted at
the run of ones. the start of the run of ones. Zeros replace
WhileEnd the ones in the run and finally a new one bit
replaces the zero that broke the run of
An example will illustrate the point. Say ones. You can probably surmise by looking
we have a multiplier M. Its binary and CSD at the trinary representation that the CSD
representations are shown next: conversion will result in one fewer Horner

Running Horner.java
To run Horner.java, you will need to have a Java equ - generate Horner equations for the multiplication
Development Kit (JDK) installed on your computer. The both - generate the MSP430 code and the equations for
program was written for use with Java 5 which is the multiplication
available for free from Sun Microsystems at help or ? - displays this message
multiplier - the floating point number being multi-
http://java.sun.com/javase/downloads/index_jdk5.jsp. The plied. The multiplier must be the final argument.
newer version 6 of Java should also work. An executable
version of the Horner.java program, as well as the source Program defaults: 16bit csd both
code are available at the Nuts & Volts website Please try again
(www.nutsvolts.com) in this article’s archive file:
Horner.jar. To see the Horner equations and the code generated
The code can be run in a couple of ways. First, the for a multiplier, specify the multiplier as the final
source file Horner.java can be extracted from the jar file, command line arguments as in the following:
compiled, and then run using a command shell (cmd.exe)
java -jar Horner.jar 0.12345
with the following procedure.

jar xf Horner.jar This command extracts the source file which will produce the following results:
from the jar
javac Horner.java This command compiles the source file Multiplier: 0.12345 Bits of precision: 16
java Horner <command line arguments> This is how you run
the program Horner equations:
T1 = X * 2^-2 - X
T2 = T1 * 2^-2 + X
Alternately, the code can be run directly from the T3 = T2 * 2^-2 - X
jar file without having to extract anything. This is done T4 = T3 * 2^-6 + X
as follows: Fraction result = T4 * 2^-3

java -jar Horner.jar <command line arguments> MSP430 code:


Code conventions:
Register “in” has the X value to be multiplied
If neither of these methods work successfully, make Register “acc” is the accumulator used for tem-
sure the bin directory of the JDK installation is on the porary values
Path in your command shell. Alternately, you can change Register “out” holds final result
directories to the bin directory and run the commands
mov in,acc
from there. rra acc
Horner.java has quite a few command line argument rra acc
possibilities. Help is available by executing the program sub in,acc
(using either of the above methods) without specifying rra acc
rra acc
any arguments. You should see the following: add in,acc
rra acc
No command line arguments specified rra acc
sub in,acc
Horner.java V1.0 copyright 2007 by: Craig A. Lindley rra acc
Generates Horner equations and MSP430 code for multipli- rra acc
cation using only shifts and adds rra acc
rra acc
Program usage is as follows: rra acc
java Horner [nocsd] [csd] [bin] [16bit] [12bit] [10bit] rra acc
[code] [equ] [both] [help | ?] multiplier add in,acc
Where: rra acc
nocsd - use binary not csd numbers in the calculations rra acc
csd - use csd optimizations in the calculations rra acc
bin - show binary representation of multiplier mov acc,out
16bit - use 16 bit binary precision
12bit - use 12 bit binary precision You can play around with the program using the various
10bit - use 10 bit binary precision
code - generate the MSP430 code for the multiplication command line arguments to see what their effects are.

September 2007 63
Lindley.qxd 8/8/2007 11:11 AM Page 64

Binary representation:
Resources 001010001110.010100100010

CSD representation:
■ Java version 5 is available at http://java.sun.com/javase/down 0010100100-10.010100100010
loads/index_jdk5.jsp.
Horner equations:
T1 = X * 22 + X
■ Information on the Texas Instruments MSP430 development T2 = T1 * 23 + X
kit is available at http://focus.ti.com/docs/toolsw/folders/print/ T3 = T2 * 23 - X
ez430-f2013.html. Decimal result = T3 * 21

■ A Texas Instruments application note discussing Horner’s T1 = X * 2-4 + X


T2 = T1 * 2-3 + X
method is available at http://focus.ti.com/mcu/docs/mcusupport
T3 = T2 * 2-2 + X
techdocsc.tsp?sectionId=96&tabId=1502&abstractName=slaa329. Fraction result = T3 * 2-2

■ For information on computer arithmetic and algorithms see Total Result = Decimal result + Fraction
the book Computer Organization by Carl Hamacher, Zvonko result
Vranesic and Safawat Zaky, 3rd edition, McGraw-Hill
Publications, 1990. You can see there is one less equation as a
result of the CSD optimization.

equation with its rotate and add. Therein lies Horner.java


the optimization.
Generating the Horner equations for a CSD As mentioned, Horner.java is a program I
optimized multiplier is the same as was wrote to quickly generate Horner equations and
described previously, except instead of adding executable code for performing floating point mul-
+ X to each equation, a – X is added for each tiplication and/or division on the MSP430 family
-1 in the representation. of microcontrollers. Check out the sidebar that
Here are the CSD optimized Horner equa- shows how to run this program and what program
tions for our previous example of 654.321: options are available. The source code for
Horner.java can be extracted from the
included jar file listed in the sidebar. You
may like to look at the code to see how
signed multiplications are performed.

Conclusions
Horner’s method can be used to
provide floating point support on
microprocessors or microcontrollers
that don’t have support built in. It is
ideal for applications like mine, that
aren’t written using a high level
language. Horner’s method was just
what I needed for my color organ
application. After developing the
digital filters using Horner’s method, I
can say that the code for the color
organ project can fit in the 2K bytes of
Flash memory provided by the F2012
microcontroller (though just barely).
It may seem like a lot of work to
use the techniques presented here,
but often optimizing performance
and/or memory usage of an applica-
tion usually is work. NV

Contact the Author


Craig Lindley can be contacted via
email at [email protected].
64 September 2007
Page65.qxd 8/7/2007 11:06 AM Page 65

Metal Fabrication
1-2 Day Lead Times Available

Both of these parts


were ordered on Tuesday
and shipped FedEx on
Wednesday

Materials from 0.001” to 6.000” in


thickness.
Parts from practically any material.

* Quick
* Affordable Complete Fabrication Center
Integrated Ideas & Technologies, Inc.
* Precise Precision Laser, Waterjet, Plasma, Machining,
Forming, and Welding Capabilities
* No Minimums 3896 N. Schreiber Way • Coeur d’Alene, ID • 83815-8362 • USA
Ph (208) 665-2166 • Fax (208) 665-5906 • www.iitmetalfab.com

September 2007 65
ElectronetSep07.qxd 8/8/2007 7:32 PM Page 66

Plug in the p Standard Features:


Help
o • CAN, SPI, SCI
Adap ing you
w
e • RS232
r

t • 10-bit A-to-D
of

tech to new • 32K or 128K Flash


9S

nolo • PWM
12

Adapt9S12C gy • Input Captures


!

• Output Compares
www.technologicalarts.com • 3V/5V Operation

AM/FM Broadcasters • Hobby Kits


Learnng Kits • Test Equipment
...AND LOTS OF NEAT STUFF!

jjzêj’“Œˆ•ꉒ•ꇖwpjékzjꄑ‡êwpj¢¤êtj|ê
‘’šê„™„Œ„…ˆ·
3&','(
wjkêh‡‡¾’‘ìwjkêj’„‘‡¾Œ‘ˆìwj~okêêê
w•’‡˜†—êp‘‰’•„—Œ’‘êššš­††–Œ‘‰’½‡–“Œ††ê’•êz„ˆ–ꢦ¢­¥¢¢­¦¥ªªêˆ›—꣥

3,&Š0&8DQGGV3,&Š'6&DUHDUHJLVWHUHGWUDGHPDUNVRI0LFURFKLS7HFKQRORJ\,QFLQWKH86DQGRWKHUFRXQWULHV

g o t o w w w. n u t s vo l t s . c o m c l i ck E l e c t ro - N e t
Full Page.qxd 8/8/2007 4:06 PM Page 67

ALL
QUALITY Parts
FAST Shipping

ELECTRONICS
DISCOUNT Pricing
CALL, WRITE, FAX or E-MAIL
for a FREE 96 page catalog.
C O R P O R A T I O N Outside the U.S.A. send $3.00 postage.

DSL FILTER S-VHS TAPE, TDK 2 SELF-STRIPPING


Suttle SUPER PRO-ST-160 BANANA PLUGS
#900LCS-50E. Extra high output, very low Sturdy, gold-plated banana
In-line DSL filter noise, ultra-refined Super Avilyn plugs designed for speaker wire
for single-line formulation delivers outstanding connections. Requires no stripping
telephones, picture definition and audio and no special tools - just cut and connect to
faxes, answering reproduction. 327 meters. 16-12 Gauge wire. Sold in pairs.
machines or other phone devices. Eliminates
interference between your DSL line and analog
telephone lines. Two output jacks; one for
computer, one for phone device. Integrated 3"
EP=480 min., SP=160 min.
CAT# S-VHS
10 for $2.75 each $ 3 00
each
Retail card packaging.
CAT# BP-92 $ 753
per pair

modular cord plugs into standard phone jack. 2-CHANNEL LINE-OUT


UL, CSA. CAT# FTR-108
MINIATURE 12VDC PUSH- CONVERTER
TYPE SOLENOID
2
$ 00
each
10 for $1.80 each
100 for $1.65 each Ledex™. 0.5" dia. x
1" long tubular
solenoid with 3/8" diameter threaded bush-
Linear Research #LR9-801.
Two-channel speaker-
level to RCA adapter
with adjustable gain
20W HALOGEN LAMP,
ing for mounting. 1/16" diameter x 1/2" long controls for each channel.
6V OPERATION plunger. 40 Ohm coil. Operates Allows you to add an
6 Volt, 20 Watt MR-16
halogen lamp.
on 12 Vdc. 1" wire leads.
CAT# SOL-102 3
$ 25
each
aftermarket amplifier to
auto radios that don't have
1.97" diameter
reflector with cover
glass. 12" wire leads
CAMCORDER / iPOD
VIDEO AV CABLE
line-out capability.
CAT# LOC-1 4
$ 50
each
with 2-pin female SOLAR CELL
connector and mating 3.5mm (4-conductor)

2
$ 00
male header, 0.1" centers. plug on one end, Output: approximately
38 Degree, wide angle. three RCA jacks 3 Volts @ 40 mA.
each
CAT# HLP-206 (red, white, yellow) on the 60mm square x 2.5mm
20 for $1.50 each other end. 3 ft cable. Allows thick epoxy-encapsulated
iPods and many cam- silicon photovoltaic cell.
FLAT-SCREEN TV STEREO corders to connect directly Solid, almost-unbreakable
SPEAKERS to television or video monitor module with solderable foil strips on backside.
Full-range 15W, 4 ohm
stereo speakers for Philips
flat-screen television. Very
via standard A/V stereo cable.
CAT# CB-218 3
$ 00
each
Ideal for solar-powered battery chargers and
other projects. CAT#SPL-61
100 for $3.25 each 3
$ 75
each
good sound reproduction
EL BACKLIGHT, 3” X 5”
produced by two 2" 8W Salmon color in
off-state. Glows
12VDC 300MA
woofers and one 1" 15W
tweeter.An oval 4.7" x light-green when SWITCHING POWER SUPPLY
1.9" resonant diaphragm energized by Friwo # SPA4UL.
helps accentuate the 120 Vac or inverter. Input: 100-240V
bass response. For backlighting 50-60Hz.
Unbreakable plastic control panels, LCDs, special-effects light- Output:
enclosures are 15" x 3" x 2.55" deep. ing, models etc. Solderable pins extend 12Vdc 300mA.
Set of two speakers, 0.16" beyond plastic laminate exterior. 6' cord with 2.1mm coax
left and right.
CAT# SK-314 8
$ 00
per pair
CAT# EL-13
10 for $9.25 each 9
$ 75
each
power plug, center +.
CAT# PS-1236 $ 50 5
each

Shop ON-LINE www.allelectronics.com


ORDER TOLL FREE 1-800-826-5432
MAIL ORDERS TO: FAX (818) 781-2653 • INFO (818) 904-0524
ALL ELECTRONICS CORP.
14928 OXNARD ST., VAN NUYS, CA 91411-2610 E-MAIL [email protected]
NO MINIMUM ORDER • All Orders Can Be Charged to Visa, Mastercard, American Express or Discover • Checks and Money Orders Accepted by Mail •
Orders Delivered in the State of California must include California State Sales Tax • NO C.O.D • Shipping and Handling $7.00 for the 48 Continental United
States - ALL OTHERS including Alaska, Hawaii, P.R. and Canada Must Pay Full Shipping • Quantities Limited • Prices Subject to change without notice.

MANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.
September 2007 67
Geer.qxd 8/8/2007 4:14 PM Page 68

SWIFT, SMALL, “CELL”


BROADBAND CHIP
— Applications in Higher Education —
by David Geer

The Cell Broadband Engine or Cell/BE processor consists of a “Power Processor Element” (PPE),
which is the primary core that generally dictates the work of other cores on the chip. In a typical
configuration, eight “Synergistic Processing Elements” (SPEs) or secondary cores surround the PPE.

T Big Picture, Little Cell


he chip employs a single memo- cruise? According to Peter Hofstee,
ry controller from IBM. The a Cell chip architect at the Sony–
Cell is aided by a dual-channel Toshiba-IBM (STI) design center, STI is constructing a new version
off-chip I/O interface from Rambus. IBM, the Cell/B.E. is about one-third of the Cell chip using fabrication
According to Andi Smithers, a the speed that IBM’s Deep Blue technologies at the 65 nm level. STI
Sony games developer, while the Cell supercomputer was. fabricated the first commercial Cell at
typically has a PowerPC core and The Roadrunner supercomputer 90 nm. Commercial Cell chips sold to
eight SPE cores, the Cell chip in the will use Cell chips to deliver a date use this technology. STI builds
PS3 has a PowerPC and only seven — Petaflop, or 1,000 Teraflops, accord- the Cell using Silicon On Insulator
not eight — SPEs. ing to Hofstee. “At about 300 (SOI) transistors and low-K dielectic
The operating system (OS) always chips per wafer (assuming 100% insulation.
takes one core for itself, leaving six yield), one hundred wafers would Cell supports the high perform-
(actually 5.5 cores are left, because provide all the processors required ance needs of future consumer
one core has to be in a unique mode for the Roadrunner supercomputer electronics products, as well as
and the OS also needs to use part of [currently under construction],” says blade servers and supercomputers.
it), according to Smithers. Hofstee. Consumer electronics and network
“The frequency of the Cell/B.E. is products that will use broadband —
How Fast? 3.2 GHz. Marketplace PCs have products like games, movies, music,
comparable frequencies. Unlike PC digital broadcasting — will benefit
How fast does the Cell chip processors, the Cell/B.E. isn’t market- from the parallel processing speed
ed at different speeds. But, in the and low power consumption of the
lab, we run Cell/B.E.-based systems Cell (the Cell’s DMA memory speed
at more than 6 GHz,” commented on the PS3 is approximately 25 GBps,
Hofstee. according to IBM).
Element Interconnect Bus According to Hofstee, IBM based
technology — which runs at half “QS20” blade server on the Cell;
the chip’s system clock rate — is Mercury Computer based the
used to optimize the speed PCI-express “Cell Accelerator Board”
between the cores. on it, as well. Creators IBM, Sony,
The current 90 nm processor and Toshiba will benefit from the
rides on a 300 mm [millimeter technology by developing their own
for this reference, not nanometer] Cell-based products. Raytheon is also
wafer (the 65 nm model is in working with the Cell/B.E., according
production as of March this year). to Hofstee.
Piling the wafers on top of each “IBM has a roadmap that includes
other expands their processing at least two additional generations
power in a modular architecture. of Cell/B.E. based blades. Also, Los
The Cell is arguably the most Alamos National Laboratory and
Cell next to face and fingers broadly publicized commercial IBM have announced their intent
for size comparison. “system-on-a-chip” to date. to build a supercomputer based on
68 September 2007
Geer.qxd 8/8/2007 11:05 AM Page 69

Cell that should achieve 1 PetaFlop of Top-side and bottom-side


sustained performance (about 1.4 view of the Sony/IBM/Toshiba
Cell chip in its housing.
Petaflop peak performance),” says
Hofstee. (This is the Roadrunner
supercomputer project.) Intelligence
Everywhere
How Cell Technology
Think about a future with
is Catapulting Higher intelligent clothing, glasses,
Education and watches that work
together via PANs (Personal
“Because Sony Computer Area Networks), to perform all
Entertainment, Inc. (SCEI), allows peo- the functions you do with
ple to install the open source Linux a cell phone and other
operating system on the Playstation 3, devices today.
many students already have easy People can embed
access to a programmable Cell/B.E. intelligent buildings with Cell
based platform,” says Hofstee. chips to amp up processing
This Linux environment is the for environmental controls,
same on all Cell/B.E. based blades and communications between the
systems up to and including the home and homeowner, and
Roadrunner, according to Hofstee. appliances through sensors, monitors, functioning devices and applications
College and university students and body-worn devices. can share intelligence to improve the
from 25 countries recently competed The Cell chip can enable intelli- performance of each.
for monetary awards for the “most gence everywhere, inside and out. The Cell has applications in
innovative” application programming Everything built today as separately HDTV sets and Internet access
based on the Cell chip, according to
IBM media information.
The 2007 competitions (the
CELL-BASED RESEARCH
inaugurals) were held from February The Cell/B.E. is central to several course house a version of the Cell
through July, with the winners being research efforts: chip],” says Hofstee.
announced around September 5th. In
addition to the educational opportuni- 1) The University of Washington 4) “While perhaps not research,”
ties and experiences for students held a workshop this August that comments Hofstee, “an interesting
globally, the contest provides IBM was dedicated to the use of Cell/B.E. commercial application of the
with an on-going source of new for medical imaging applications, Cell/B.E. is a tool for making the
application ideas for its new chip. according to Peter Hofstee, STG, masks to build chips (developed by
With the aid of IBM, MIT has Technology Development DE, Mentor Graphics and Mercury
recently finished teaching its first Architect, STI Design Center, Computer). This tool will help us
course based on the Cell chip. During IBM. “Also, of course, we continue build next-generation processors
the four-week course, students to work on image rendering,” and other chips.”
says Hofstee.
designed projects to run on the PS3
5) Many Universities use Cell/B.E.-
using “open standards” software,
2) In August, IBM “showed off” its based blade centers for application
according to IBM. Cell-based Interactive Ray Tracer development, as well as research. The
The course applied the Cell inside (“iRT”) at the SIGGRAPH (Special Boston University, for example, will
the PS3 to an introduction to parallel Interest Group on Graphics and use it to research “fragment-based
programming (programming for Interactive Techniques) conference, drug design”, according to Hofstee.
multicore chips, of which the Cell is an according to Hofstee. The iRT is a “Others will use it for research related
example). Students formed groups to “scalable, ray-tracing engine” with to game development, virtual
develop their applications, using the interactive frame rates up to HDTV world technologies, or new image
Cell SDK (development kit) from resolutions thanks to clustering multi- compression schemes, just to name
IBM’s developerWorks. ple Cell processors, according to IBM. a few,” he adds.
In the meantime, the Budapest
Polytechnic Institution is starting a Cell 3) “The folding@home project at 6) A broader focus of research is to
Broadband Engine course this fall that Stanford is getting most of its make parallel programming for the
will count towards a Bachelor of Science performance on protein folding Cell — as well as hybrid and multicore
from contributing PLAYSTATION 3 systems — easier for programmers,
in Computer Science and Engineering,
systems [to its clusters; these of according to IBM’s Hofstee.
according to IBM media relations.
September 2007 69
Martin.qxd 8/7/2007 10:58 AM Page 71

A Logic
Analyzer Tutorial
PA RT 1
A logic analyzer — like so many electronic test and measurement tools — provides
a solution to a particular class of problems. These include digital hardware
debugging, design verification, and embedded software debugging. A logic
analyzer is an indispensable tool if you design and troubleshoot digital circuits.

b y Va u g h n D. M a r t i n

L
ogic analyzers simultaneously and other analog characteristics, such ers debug elusive, intermittent signals,
measure numerous digital signals as phase relationships, peaks, time with some advanced ones even
with challenging trigger require- between adjacent edges, etc. correlating source code with specific
ments. If you are using new devices, (see Figure 1). A scope’s vertical axis hardware problems.
you’ll soon discover that debugging represents voltage and its horizontal
microprocessor-based designs requires axis represents time.
more inputs than oscilloscopes can HISTORY OF
offer. Logic analyzers — with their What a Logic Analyzer Does LOGIC ANALYZERS
multiple inputs — solve these problems.
The first logic analyzer appeared
These instruments have steadily A logic analyzer solely measures in 1967 as HP engineer Gary Gordon’s
increased, both in their acquisition digital, not analog signals! It can personal “bench project.” Just six
rates and channel counts, keeping pace capture many digital signals years earlier, Gary became a company
with advancing digital technology. simultaneously and display their hero as an intern in the oscilloscope
There are similarities and differ- often complex timing relationship to lab by solving their digital sampling
ences between oscilloscopes and one another. However, some logic scopes drifting problem when the
logic analyzers. To better understand analyzers slightly transgress into the time base changed.
Gordon’s involvement with digital
how the two instruments address scope’s domain by detecting glitches oscilloscopes before inventing the
their respective applications, let’s and setup and hold logic analyzer is not surprising
compare their individual capabilities. timing violations. But since logical analyzers evolved from
After triggering on a complicated mainly, logic analyz- DSOs. Logic analyzers evolved
sequence of digital events, a logic almost simultaneously with the first
analyzer can copy large amounts of commercially available
microprocessors. The
digital data from the SUT (system
first logic analyzers
under test.) Advanced logic analyzers emphasized operations
behave like software debuggers that closely akin to oscillo-
a trace computer program’s flow. scopes for hardware
A DSO (digital storage debugging and test,
oscilloscope) or any later becoming more
oscilloscope is an concerned with moni-
toring microprocessor
instrument that prima-
signal activity and soft-
rily reveals the signal’s ware debugging.
amplitude, rise time,
September 2007 71
Martin.qxd 8/6/2007 10:08 AM Page 72

FIGURE 1. An oscilloscope’s signal, all of which can have an effect on


display reveals signal the signal’s ability to perform its
details of a largely analog
nature, such as rise and function. Ringing, overshoot, roll off in
fall times, amplitude, and the rising edge, and other aberrations
other subtle characteristics. appearing periodically exist here.
With a modem oscilloscope’s
capture many data points built-in tools such as cursors and
over a short span. This automated measurements, it’s easy to
allows measurements of verify signal integrity problems impact-
signal transitions (edges), ing your design. Purely analog signals —
transient events, and small such as the output of a microphone or
time increments. While digital-to-analog converter — can only
DSOs can view the same be monitored with an instrument that
digital signals as a logic records analog details (see Figure 2).
analyzer, most DSO users
concentrate on analog Logic Analyzer Details
More on the Digital measurements such as rise- and fall-
times, peak amplitudes and the elapsed The most obvious difference
Oscilloscope time between edges. Figure 1 illustrates between these two instruments is the
The DSO is for general-purpose the oscilloscope’s strengths. The wave- number of channels (inputs). Typical dig-
signal viewing. Its sample rate (up to 20 form (though taken from a digital circuit) ital oscilloscopes have up to four signal
Gs/sec) and bandwidth enable it to reveals the analog characteristics of the inputs. Logic analyzers have between 34
and 136 channels. Each accepts one
FIGURE 2. A family of modern high digital signal. Some complex system
performance Tektronix DSOs. designs require thousands of input chan-
nels. Appropriately scaled logic analyz-
ers are available for those tasks, as well.
A logic analyzer detects logic
threshold levels (see Figure 3). When
the input is above the threshold voltage,
the level is said to be “high” or “1;” con-
versely, the level below the threshold
voltage is a “low” or “0.” When a logic
analyzer samples an input, it stores a 1
or a 0, depending on the level of the
signal relative to the voltage threshold.
A logic analyzer’s waveform timing
display is similar to that of a timing dia-
gram found in a data sheet or produced
by a simulator. All of the signals are time-
correlated and effectively show progres-
sive system “snapshots” through time.
A logic analyzer’s digital design
verification and debugging features —
such as sophisticated triggering —
allow you to specify the conditions
under which the logic analyzer
acquires data. High-density probes
and adapters simplify connecting to
the SUT. Analysis capabilities translate
captured data into processor instruc-
tions and correlate it to source code.

FIGURE 3. The logic analyzer


Logic Analyzer Architecture
reveals a more limited picture and Operation
of a signal’s characteristics —
just logic levels relative to a There are four steps to using a
threshold voltage level. logic analyzer:
72 September 2007
Martin.qxd 8/6/2007 10:09 AM Page 73

• Probe (connect to the SUT)


• Setup (clock mode and triggering) When to Use a Logic Analyzer vs. a DSO
• Acquire A DSO is an ideal test instrument • You need to determine transient
• Analyze and display when you need to measure: states, such as runt signals, glitches,
and metastable states.
Each block in the simple logic • A few analog characteristics of no
analyzer block diagram shown in Figure more than four signals at a time. A logic analyzer is best when you
4 symbolizes several hardware and/or need to:
software elements. The block numbers • You need to know analog characteris-
correspond to the four steps just listed. tics of a signal, such as rise and • Debug and verify digital system
fall times, phase, power, current, operations.
The acquisition probes connect to the
amplitude, and edge relationships.
SUT. The probe’s internal comparator is • Trace and correlate many digital
where input voltage comparison occurs • You need to determine a signal’s signals simultaneously.
against the threshold voltage and the stability (jitter).
signal’s logic state (l or 0) is deter- • Detect and analyze timing relation-
mined. You set the threshold value, • You need to measure timing margins ships for many digital signals.
ranging from TTL levels to CMOS, ECL, such as setup/hold and propagation
or your own user-definable ones. delays. • Trace embedded software operations.
Probe impedance (capacitance,
resistance, and inductance) becomes
part of the overall load on the SUT. All
probes exhibit loading characteristics.
The logic analyzer probe should
introduce minimal loading on the
SUT, and provide an accurate signal to
the logic analyzer.
Probe capacitance tends to “roll
off” the edges of signal transitions
(see Figure 5). This roll-off slows down
the edge transition by an amount of
time represented as “t” in the figure.
Remember, slower edges cross the
logic threshold of the circuit later,
introducing timing errors in the SUT.
This problem becomes more severe as
clock rates increase.
In high speed systems, excessive
probe capacitance can potentially
prevent the SUT from working. It is
always critical to choose a probe with the
lowest possible total capacitance. It’s FIGURE 4. A greatly
also important to note that probe clips simplified functional
and lead sets increase capacitive loading block diagram of a
logic analyzer.
on the SUT. Use a properly compensated
adapter whenever possible. The imped-
ance of the logic analyzer’s probe affects FIGURE 5. An
signal rise times and timing relationships. illustration of how
the impedance of
Logic analyzers capture data from the logic analyzer’s
multi-pin devices and buses. The term probe can affect
“capture rate” refers to how often the a signal’s rise
times and
logic analyzer samples the inputs. It is measured timing
the same function as the time base in relationships.
an oscilloscope. Logic analyzer litera-
ture interchangeably uses the terms
“sample,” “acquire,” and “capture.”
Timing acquisition captures signal
timing information. In this mode, an
internal clock samples data. The faster it
September 2007 73
Martin.qxd 8/7/2007 10:56 AM Page 74

Logic Analyzer Probes


Probes come in many physical
forms:
Clip-on probes are intended for
point-by-point troubleshooting (see
Figure A).
High-density, multi-channel probes
require dedicated connectors on the
circuit board (see Figure B).
The probe shown in Figure C can
acquire high-quality signals and have
a minimal impact on the SUT by
clamping on to existing device
packages. This type of probe is
recommended for applications that FIGURE B. A high-density multi- FIGURE C. A compression logic
require higher signal density and channel logic analyzer probe. analyzer probe.
reliable connections to your SUT.
target device and the data the logic In all instances, the “event”
analyzer acquires. Use this acquisition appears when signals change from
mode when you are concerned with the one cycle to the next. You can use
timing relationship between SUT signals. many conditions to trigger your logic
The acquisition mode acquires analyzer, such as a specific binary
the “state” of the SUT. A signal from value on a bus or counter output.
the SUT defines the sample point Other triggering choices include:
(when and how often data is
required). The clock signal you use in • Words: Specific logic patterns
the acquisition mode may be: defined in binary, hexadecimal, etc.

• The system clock • Ranges: Events that occur between


• A control signal on the bus a low and high value.
• A signal that causes the SUT to change
states • Counter: The number of events
FIGURE A. A general-purpose logic you program that you are tracking by
analyzer probe with a 0.025” square You sample data on the active a counter.
wire-wrap type of pin adapter. edge, which represents the SUT when
the logic signals are stable. The logic • Signal: An external signal such as a
samples data, the higher the resolution analyzer samples only when the select- system reset.
of the resulting measurement. There is ed signals are valid. What transpires
no fixed timing relationship between the between clock events is irrelevant. • Glitches: Pulses that occur between
acquisitions.
More on Data Acquisition Modes • Timer: The elapsed time between
There are two types of data and is more sophisticated than two events or the duration of a single
acquisition modes: synchronous and triggering on any oscilloscope. event, tracked by a timer.
asynchronous. For long, continuous Logic analyzers can recognize
records of timing details, use the Boolean operators, such as multiple • Analog: Use an oscilloscope to
timing acquisition mode and the signals that are “AND”ed or exclu- trigger on an analog characteristic and
internal (or asynchronous) clock. sive-”OR”ed together, etc. They can to cross-trigger the logic analyzer.
Acquiring data exactly as the SUT track SUT logic states and trigger on
sees it requires you to use the state conditions within the SUT that
(synchronous) acquisition mode. you desire. These may be a simple
With all these trigger conditions
In the state acquisition mode, transition — intentional or otherwise available, it is possible to track down
the logic analyzer displays each suc- — on a single signal line. system errors using a broad search
cessive state of the SUT sequentially If you are chasing an elusive for state failures, before you refine
in a window. You may use any glitch that occurs when an your search with increasingly explicit
relevant signal for the external clock Increment or Enable pin becomes triggering conditions.
signal for state acquisition. valid, you might want to trigger on I hope this introduction has
Triggering selects which data some set of bus-wide conditions that taught you a few things about this
you capture. Logic analyzer trigger- are known to preceed it. This is a powerful benchtop tool — look
ing only occurs on digital signals, powerful feature of a logic analyzer. forward to more in Part 2! NV
74 September 2007
PersonalRobotics.qxd 8/6/2007 12:01 PM Page 75

PERSONAL ROBOTICS
UNDERSTANDING, DESIGNING & CONSTRUCTING ROBOTS & ROBOTIC SYSTEMS
■ GUEST HOSTED BY BRYAN BERGERON

■ FIGURE 1. Magnetic inchworm


climbing a Teflon-coated steel
sheet at a 30 degree incline.
MAGNETIC INCHWORM
FUELED BY THE RECENT INTEREST IN
biomimetics, robot developers are actively
exploring alternatives to the traditional
wheeled, crawling, and bipedal forms of
locomotion.

inchworm locomotion described here borrows from the


involves cyclically HeartLander robot in the manner in
advancing the front which the robot is steered and in how

R obot fish swim like the real


thing, robot snakes slither on
the ground, crab-like robots scale
segment of the robot while the rear
remains fixed, and then fixing the
front segment while pulling the rear
the segment spacing is cycled to
move the robot forward. Figure 3
shows the completed magnetic
mountain faces, and insect-like robots segment forward. Perhaps the best inchworm in a clockwise turn. Note
can stay aloft for several minutes at a known robot that employs inchworm the front segment is angled down and
time. Just as the environment selects locomotion is HeartLander, from clockwise, in preparation for the pull
for the life form with the optimal form Carnegie Mellon University. on the rear segment. Because stainless
of locomotion, the environment in As shown in Figure 2, the robot is steel rods connect front and rear
which a robot must operate dictates only about two inches long, and con- segments, it’s important to have
the optimal form of locomotion. sists of front and rear segments, each ample play in the front and rear
Continue reading to learn how connected to a vacuum line. The robot segment connection points, as illus-
to build a simple robot designed to is designed to walk along the surface trated in the figure.
travel over steel or iron surfaces — a of a beating heart. It accomplishes this
magnetic inchworm — with a few feat with suction variably applied to Operation
servos, a pair of neodymium magnets, the area below each segment. Guide Operation of the magnetic inch-
and an R/C system. wires between the segments enable worm involves the use of a remote
the human operator to steer the robot control unit to actuate the single
to the appropriate area of the heart.
INCHWORM ■ FIGURE 2. The HeartLander surgical
LOCOMOTION MAGNETIC INCHWORM
robot from Carnegie Mellon University
uses manually manipulated guide wires
and pneumatic suction for inchworm
Assuming a two-segment design, The magnetic inchworm project locomotion on the surface of the
heart[1].
■ FIGURE 3. Magnetic inchworm from above shown in a clockwise turn.
Receiver atop the main body is supplied with 4.8 VDC externally.

September 2007 75
PersonalRobotics.qxd 8/6/2007 12:31 PM Page 76

rods to the front segment.

• Glue gun to mount the servos.

• Epoxy to secure the mounted


magnets to the servo horns.

First, securely mount each


magnet to a servo horn using the bare
wire. I used a circular horn and drilled
a pair of extra holes in the horn to
accommodate two loops of wire to
mount the magnet. Cover the
magnets and the bare wire with
epoxy, as shown in Figures 5 and 6.
Each magnet face should be flush with
the outer edge of its servo horn.
■ FIGURE 4. Magnet and servo sequencing Magnet Down
for straight movement forward (top) and a Magnet Up
Next, take the plastic project box
clockwise turn (bottom). and (using a hacksaw) cut the box to
create the front and rear segments.
miniature servo in the front segment you’ll require the following materials: The dimensions of each segment
and the three miniature servos in the depend on the servos you have
rear segment. I used four channels of • One 2.5 x 5.5 x 1 inch plastic available for the project. Mount the
a Futaba T9CAP transmitter and project box, cut in half about 1-3/4 servo horns with magnets on two
matching receiver to sequentially inches from one end. servos and fit a servo in each
activate the servos according to the segment, noting where the magnet
sequences shown in Figure 4. • Four GWS Servo Nano Pro/Std and horn must clear the case. Mark
The top of the figure shows or equivalent servos. The Nano Pro the case and then (using a drill)
the robot moving forward in a is a 13g device that measures 27 x create an oval for the magnet and
straight line using basic inchworm 12 x 22 mm. About $11 each from servo horns. The face of the magnet
locomotion. Note the timing of Tower Hobbies. should just touch the surface below
magnet actuation, depicted in red. By the segment, as in Figure 6. Note that
advancing one of the two pushrod • About one foot of bare solid wire the magnets rotate along the long
servos relative to the other, the robot to mount the magnets to the axis of the robot.
can be directed to turn clockwise or servo horns. Next, mount each of the
counterclockwise. pushrods on a 4-40 bolt; attach the
• A four channel R/C transmitter/ bolts to either side of the front
Construction receiver system. segment, using a drill to create holes
The following instructions assume for the bolts. Use a glue gun to mount
a one evening project. Feel free to • Two 4-40 six-inch threaded stainless the servos carrying the magnets. With
improve upon the basic design as steel push rods with clevis, trimmed a pair of diagonal pliers, cut notches
your time and needs dictate. In to 6”. in the case for each of the two
addition to the usual shop tools, remaining servos, as in Figure 6.
• Two closed solder lugs, one Secure the servos with hot glue and
soldered to the unthreaded attach the horns and pushrods. Place
end of each push rod. a 1” cube of foam over each servo
and attach the case cover on the front
• Two 0.25” x 0.2”L and rear segments.
Neodymium magnets; $1 Plug the servos into the appropri-
for the pair, less shipping, from ate channels on your receiver and
All Electronics. connect power to the receiver. I found
a three foot, 22 gauge power cord
• Two 1” 4-40 bolts and provided ample flexibility. Finally,
four nuts to mount the push calibrate your transmitter and
move the servo horns so that you can
■ FIGURE 5. Front segment of easily control the magnet servos
the inchworm showing servo and the position of the rear segment
with magnet rotated away from
the surface cutout. servo arms.
76 September 2007
PersonalRobotics.qxd 8/6/2007 12:32 PM Page 77

PERSONAL ROBOTICS

REFERENCES
■ [1] HeartLander photo courtesy of Nicholas Patronik and Marco
Zenati, MD, Carnegie Mellon University. HeartLander is funded by
NIH and NASA, with past funding from NSF and The Pittsburgh
Foundation.n [5] X. Gao and L. Jiang, Biophysics: Water-repellent
legs of water striders. Nature, 2004. 432(7013): p. 36.

■ FIGURE 6. Rear segment


FROM HERE of inchworm showing three
servos and magnet rotated
toward surface cutout.
The magnetic inchworm, as
described above, leaves significant or steel surface.
room for innovation. Consider a
few of the following modifications/ • Try flexible pushrods with
additions: less play in the connection
points. The robot will handle better and other components is relatively
• Substitute electromagnets for the on flat surfaces, but may be hard to easy — they can normally be
servo-magnet assemblies. By varying control on an incline or decline. pried loose without damage to the
current to the electromagnets, you’ll components or the supporting
be able to finely tune the attraction • Consider adding a wireless camera chassis. However, if your goal is to
of each segment of the inchworm to the front segment for remote build a magnetic wall climber, then
to the underlying steel/iron surface. monitoring. cut back on all unnecessary weight.
You’ll probably discover that Use a dab of epoxy instead of hot
climbing a steep incline requires more I like hot glue because it’s a great glue to affix each servo, and don’t
and longer duration electromagnet rapid prototyping tool. Once I’m bother attaching the top cover on
current than traversing a horizontal happy with a design, removing servos each segment. NV
surface.

• Substitute other effectors for the


magnets, such as soft rubber pads for
hardwood floors and claws for carpet.

• Add more segments to the basic


design, with a goal of enabling the
worm to navigate and climb vertical
structures.

• Use a microcontroller instead of an


R/C unit. Either a Stamp or PIC
would work nicely. Consider using an
accelerometer to determine the
angle of the surface and adjust
the sequencing accordingly. For
example, at a steeper grade,
the robot is more likely to slip unless
you increase the amount of time
the magnets face the supporting iron

RESOURCES
■ Tower Hobbies (www2.tower
hobbies.com) — Servos, pushrods
with clevis.

■ All Electronics (www.allelectro


nics.com) — 0.25”d x 0.2”l
Neodymium magnets.

September 2007 77
Full Page.qxd 8/8/2007 4:08 PM Page 78

www.robodevelopment.com Conference Sponsors include:


Founding Sponsor

Gold Sponsors

Corporate Sponsors & Exhibitors

The International Technical Design and Development Event


for the Personal, Service and Mobile Electronics Industry

October 25 - 26, 2007


San Jose McEnery Convention Ctr
San Jose, CA
Register by Sept. 14 and SAVE $200. Breakfast Keynote Sponsors

The RoboDevelopment Conference & Exposition is the industry’s first


event focused on the technical design and development of commercial
robotic products.

This unique and unprecedented event will draw over 1,000 robotics industry Media Co-Sponsors
personnel from across the globe and will feature:
■ Comprehensive Conference Program covering the most critical industry topics
including Design, Development and Standards, Tools and Platforms, and
Enabling Technology
■ Over 40 leading industry speakers
■ Keynote presentations by Tandy Trower, General Manager, Microsoft Robotics
Group; Paolo Pirjanian, President and CEO, Evolution Robotics;
Lloyd Spencer, CEO, Coroware; and Dan Kara, President, Robotics Trends
■ A packed Expo Floor offering hands on access to the latest design and
development solutions for producing robots and robotic technology
■ Great networking opportunities, special events and much more

Analysts, Association
& Academic Co-Sponsors

REGISTER TODAY AT
www.robodevelopment.com
or call 800-305-0634

Produced by:
Page79.qxd 8/7/2007 11:06 AM Page 79

Extreme Robot Speed Control!


6 14V - 50V - Dual 80A H-bridges - 150 A+ Peak!
6 Adjustable current limiting
6 Temperature limiting
6 Three R/C inputs - serial option
6 Many mixing options - Flipped Bot Input
6 Rugged extruded Aluminum case
6 4.25" x 3.23" x 1.1”
$399

$79.99 $119.99
$29.99 Scorpion XL
Scorpion HX
Scorpion Mini 6 Dual 2.5A (6A pk) H-bridges 6 Dual 13A H-bridge 45A Peak!
6 2.5A (6A pk) H-bridge 6 Plus 12A fwd-only channel 6 5V - 24V
6 5V - 18V 6 5V - 18V 6 2.7“ x 1.6” x 0.5”
6 1.25“ x 0.5” x 0.25” 6 1.6“ x 1.6” x 0.5”

Introducing Dalf
6 Closed-loop control of two motors
6 Full PID position/velocity loop
6 Trapezoidal path generator
6 Giant Servo Mode!
6 PIC18F6722 CPU $250
6 C source for routines provided
6 See www.embeddedelectronics.net
H-bridges: Use with Dalf or with your Micro/Stamp

OSMC Simple-H
6 Monster power! 6 6-28V 25A!
6 14-50V 160A! 6 2.25”x2.5 ”x0.5”
6 3.15”x4.5”x1.5” 6 3 wire interface
6 3 wire interface 6 current & temp
$79 protection

MADE IN

THE USA
www.robotpower.com
Phone: 253-843-2504  [email protected]

Interface a sharp LCD display to your BASIC Stamp® or other


micro-controller project with ease. No-solder wiring harnesses
and easy mounting kits available too. See www.seetron.com today.

• 3.2 x 1.4 in. supertwist LCD


BPI-216N
• 2400/9600 baud serial
• Low (≈2mA) current draw
• Great with BASIC Stamps®

• 3.2 x 2 in. backlit LCD


ILM-216L
• 1200-9600 baud serial
• Advanced protocol, 4 switch inputs
• EEPROM for configuration settings
• Favorite for OEM applications

• 3.2 x 1.4 in. graphics LCD SGX-120L


• 2400/9600 baud serial
• Font and 15 screens in EEPROM
• Easily draw points, lines, screens

• 3 x 2 in. supertwist LCD


TRM-425L
• 1200-9600 baud serial
• ESD-protected, 4x4 keypad input
• Store up to 95 screens in EEPROM

1939 S. Frontage Rd. #F, Sierra Vista, AZ 85635


phone 520-459-4802 • fax 520-459-0623
www.seetron.com • [email protected]
Stamp.qxd 8/6/2007 10:23 AM Page 80

■ BY JON WILLIAMS
STAMP APPLICATIONS
PUTTING THE SPOTLIGHT ON BASIC STAMP PROJECTS, HINTS & TIPS

WHERE’S WALDO?
It seems like the animation controller from May was a hit. I got a lot of very
positive email and many readers have been creating derivative applications for
controlling servos. A few weeks ago, I got a call from one reader — my friend
Dan — who works in one of Hollywood’s leading prop shops (if you saw the
movie 300, then you’ve seen some of their amazing creature work). Dan
suggested that I build a recording servo controller because — in Hollywood
prop shops, anyway — the live performance is what really counts and the
ability to play back a great performance is a convenience. This kind of device
would also be cool for an animated Halloween or Christmas prop, something
I have a lot of interest in.

D an’s boss, Mark, allowed me to


visit the shop last year and I was
like a kid in a candy store — I love
The waldo allows extraordinarily-
skilled puppeteers to bring life to a
prop while a scene is being shot. One
stops; remove the jumper and the
cycle that was just recorded can be
played back.
special FX and prop technology and of the cable-controlled props that I I was really pressed for time this
was in absolute awe of everything in was allowed to play with was the cat week, so I decided to use the SX28
their shop; I think I had to run to the from Date Movie which, I must say, proto board again. It turned out to be
parking meter three or four times was much more fun than having a a really good choice because there
because I just didn’t want to leave! kitten chase a flashlight beam. were features of the proto board that
Most of the props I got to see (and Other props use servos to control are perfect for this application.
play with!) were articulated: a few the motion, many being driven Specifically, there are two major
with cables that were attached to by standard R/C transmitters — the sub-systems for the waldo: 1) analog-
a control device called a “waldo” problem with using an R/C transmitter to-digital conversion of joystick data
(Author’s note: WALDO is a trade- is that the movement values can’t and, 2) storage of servo values in
mark of The Creature Shop, and yet be recorded. an EEPROM.
the term is used somewhat generically Even if you don’t want or need a It turns out that I’m using eight
in the business due to its roots in a device like this, I think that you’ll find pin DIP devices: the ADC0832 for
Robert Heinlein short story). a lot of the code useful for other analog conversion and the 24LC512
projects. In short, what for the memory — and the SX28 proto
this device will do is take board includes two DIP8 socket
the input from a standard locations in the prototyping area. In
analog joystick and send Figure 1, the red boxes outline the
position values to a DIP8 locations; note, too, that inside the
couple servos. By DIP8 pads are pads for SOIC8 devices.
pressing a button with a Another — far more subtle —
record jumper enabled, feature of the SX28 proto board is
the device will store the voltage level selection and control for
joystick movements into a the servo headers (blue box in Figure
24LC512 (64K) EEPROM; 1). Note the purple box; if we solder a
press the button again male, three-pin header to this area, we
and the record cycle can select the voltage applied to the
■ FIGURE 1. SX28 Proto
center terminal of the servo headers,
Board. either 5V (from the regulator) or the
80 September 2007
Stamp.qxd 8/6/2007 10:24 AM Page 81

S TA M P A P P L I C AT I O N S

■ FIGURE 2.
Joystick Interface.

Vin from the power connector (be careful with using Vin; singled-ended or differential output. Configuration of the
anything above 7.2 volts will probably destroy your servos). ADC is accomplished by clocking four (mux) bits into the
The center pin of the voltage select header is routed device. As you can see in the function code, \4 is used to
through the power switch to the servo headers so that we limit the number of bits sent to the ADC. For convenience,
can power up the SX without applying power to the servos. the waldo program has constants defined for single-ended
When we want the servos to run, we move the power channels 0 and 1 that include the ADC start bit. After
switch to the far-right position. These features shouldn’t be shifting the mux bits out to the ADC, an eight-bit value can
too surprising as they make using the SX28 proto board on be shifted in.
the Parallax Boe-Bot chassis very easy.
FUNC ADC0832
WALDO SUBSYSTEMS tmpB1 = __PARAM1
Clk = 0
CS = 0
The first major subsystem is the analog-to-digital SHIFTOUT Dio, Clk, MSBFIRST, tmpB1\4, 4
conversion of the joystick input. Part of the parameters for SHIFTIN Dio, Clk, MSBPOST, tmpB1, 4
this project was to use an off-the-shelf, PC-compatible CS = 1
analog joystick. The trouble with analog PC joysticks is that RETURN tmpB1
ENDFUNC
we only get two connections per pot; we don’t get the ends
plus the wiper — we get one end (common, on pin 1) and
the wipers from each axis. What we’re forced to do, then, Let me point out a couple things having to do with
is add a second resistor to create a divider. We’ll tap off that the use of SHIFTOUT and SHIFTIN. First, both of these
divider and run it into an input channel of the ADC0832. instructions simply invert the clock pin (twice) for each bit.
Figure 2 shows the joystick interface for the circuit. As What this means is that we need to preset the clock level
you can see, the pot outputs from the joystick (pins 3 and before using SHIFTOUT or SHIFTIN; neglecting to do
6) are connected to 10K pull-downs and then on to the this is a common mistake for those porting BASIC Stamp
ADC0832. The application of 5V to pin 1 of the joystick programs to SX/B. Later versions of SX/B include an
connector routes this voltage to the pots. While this optional clock speed multiplier.
arrangement works, we don’t get a centered output value Without the multiplier, the data rate is about 83K bits
when the pot is in its center position; I don’t like per second, but many devices will operate significantly
“fixing” circuits in code, but this is a case where there is faster than that so we can take advantage by using the
just no choice. multiplier. Another point of consideration for this particular
Let’s have a look at the ADC code. The ADC0832 has project is that a “virtual” servo controller is running in the
two inputs and it can be configured on-the-fly to provide Interrupt Service Routine so all foreground operations are
September 2007 81
Stamp.qxd 8/6/2007 10:24 AM Page 82

slowed — the multiplier restores the access speed to the This subroutine expects a word address and then one
ADC. The other major subsystem is the I2C memory. I or two bytes after that. Since we want to use the same
selected the 24LC512 because it holds 64K bytes of data subroutine to write bytes and words, we’re forced into
and is really simple to use. Figure 3 shows the connections accepting the address as two bytes. If we’re using a word
to the 24LC512. variable for the EE address, the compiler will sort that out
When you look through the complete listing, you’ll see for us. When using a constant value, however, we have to
a lot of code having to do with the EEPROM. The reason is be careful. Let’s say, for example, that we want to write a
that there are four instructions in SX/B (I2CSTART, value to EEPROM address $000F. Here’s how we have to
I2CSTOP, I2CSEND, and I2CRECV) that get encapsulated do that when using constants:
in subroutines or functions to save code space.
I’ve also created a subroutine that lets us write a byte PUT_EE $0F, $00, value
or word to the EEPROM, and two functions for reading: one
for bytes, the other for words. All of this code is highly As you can see, we’re using two bytes for the address
portable and you can use it in many applications. The only and the bytes are aligned Little-Endian. If we did this:
critical note is that the SCL pin is aligned with the SDA pin,
i.e., the SCL pin always follows the SDA pin on the same PUT_EE $000F, value
port (RA, RB, RC, RD, or RE). For example, if SDA is RA.2,
then we must connect SCL to RA.3. the compiler wouldn’t understand that the address is a
Since writing to the EEPROM is a critical task for this word since the address value is less than 256 — so a byte is
program, let’s have a look at the PUT_EE function. If you assumed and used. If the value to be written is also a byte,
compare the code to the 24LC512 data sheet, you should the compiler will complain that we don’t have enough
see that it’s an easy match — my point is that once you’ve parameters for the subroutine. By forcing a two-byte
got the I2C routines set up, access to any I2C device is address, the subroutine can determine whether we want
very straightforward. to write a byte (__PARAMCNT is three) or a word
(__PARAMCNT is four). When we are writing two bytes, a
SUB PUT_EE flag is set that gets used later in the routine.
IF __PARAMCNT = 3 THEN
tmpW1 = __WPARAM12
The subroutine might look a little complicated but it is,
tmpB1 = __PARAM3 in fact, very straightforward. We start with the I2C start
i2cMulti = 0 sequence, write the device address (a constant in this
ELSE program, but could be a variable if you want to expand to
tmpW1 = __WPARAM12 multiple EEPROMs), the address to write to, and then the
tmpB1 = __PARAM3
tmpB2 = __PARAM4 byte(s) to write. As you can see, we use the flag to control
i2cMulti = 1 writing the second byte. Finally, the I2C stop sequence is
ENDIF generated to tell the EEPROM to save its buffer contents.
I2C_START EEPROMs are not particularly fast and this device can
I2C_OUT SlaveWr
I2C_OUT tmpW1_MSB take up to five milliseconds to store the values we just sent to
I2C_OUT tmpW1_LSB it. We don’t care about this delay because we’ll only access
I2C_OUT tmpB1 the EEPROM every 20 milliseconds, but in other applications,
IF i2cMulti = 1 THEN we can have the subroutine wait for the write cycle to com-
I2C_OUT tmpB2
ENDIF plete before returning to the caller. We do this by generating
I2C_STOP another start, and then writing the slave address. While the
‘{$IFNOTDEF NOEEWAIT} EEPROM is busy with its write cycle, the acknowledge bit will
DO be set to NAK (1). A conditional-compilation constant allows
I2C_START
I2C_OUT SlaveWr
us to enable or disable the write-wait option.
LOOP UNTIL ackNak = Ack
‘{$ENDIF}
ENDSUB
PUTTING IT TOGETHER
Like the animation controller project in May, this
program uses a virtual servo controller that runs in the ISR;
since we’ve been through that in detail, we won’t hash
through it again. The only thing that’s been added to the
ISR is an LED control option. The reason is that the program
has four modes:

1) Idle (servos follow joystick)

■ FIGURE 3. 2) Recording (servos follow joystick and positions are saved


24LC512 Connections. to EEPROM)
82 September 2007
Stamp.qxd 8/6/2007 10:25 AM Page 83

S TA M P A P P L I C AT I O N S

3) Playback (servo positions are played back from get lucky again and the formula works out to:
the EEPROM)
position = position / 4 + 137
4) Paused (servos hold position until pause button is
pressed again) I say that we got lucky because the multiplier and
divider in the formulas above are powers of two; this lets us
I started with a three-leaded, bi-color LED — one use shift operators instead of multiplication and division
of those LEDs that has red and green elements with a operators (both generate a fair bit of code).
common leg. The problem was that the body was clear and Here’s the adjustment section:
when both LEDs were on, it didn’t really look yellow as I
had hoped. Well, in my supplies I found a two-leaded, IF joyX <= 50 THEN
joyX = joyX << 1
bi-color LED that had a milky, translucent body which I joyX = joyX + 50
thought might work better. It did, but it takes a little more ELSE
code to create the yellow effect. joyX = joyX >> 2
This is accomplished by reversing current flow through joyX = joyX + 137
the LED very quickly. Since the interrupt runs 100,000 times ENDIF
joyX = 300 - joyX
per second, we can do it there. Here’s how: IF joyY <= 50 THEN
joyY = joyY << 1
Check_Yellow_LED: joyY = joyY + 50
IF runMode = M_PAUSE THEN ELSE
ledPort = ledPort ^ %1100 joyY = joyY >> 2
ENDIF joyY = joyY + 137
ENDIF
What this does is invert the state of the LEDs each joyY = 300 - joyY
pass through the ISR when the program is paused.
Figure 4 shows how the LED is connected. There is only Once the program was running, I found that the servos
one resistor because current can only flow through one moved opposite to the actual joystick movement so both
LED at a time. axis values had to be inverted (100 becomes 200, and vice
Okay, we can read the joystick and save values, so let’s versa). This is easy math, too — just subtract the axis value
get to the meat of the program. At the top, we’re going to from 300. Note that the compiler will complain about a
wait for a new servo frame (the ISR sets a flag bit that we’ll truncated literal. This happens because we’re using a value
wait on). When we get the new frame, we read the joystick greater than 255 in the equation and the output is a byte;
axis values: it’s okay, the result will still be correct.
The joystick has two buttons; one for each axis. We can
Main: scan and debounce the buttons like this:
WAIT_SYNC
joyX = ADC0832 Ch0
Check_Buttons:
joyY = ADC0832 Ch1
IF BtnX = Pressed THEN
INC btnTmr(0)
Since the output from the ADC doesn’t match what we ELSE
need to drive the servos, we’ll have to apply a little math to btnTmr(0) = 0
adjust things. ENDIF
Let me take a bit of a detour here and encourage you IF BtnY = Pressed THEN
INC btnTmr(1)
to develop your programs in sections and with separate test ELSE
programs. I did this with all of the systems of the waldo btnTmr(1) = 0
program and have included my test programs for you to ENDIF
work with should you choose. (Files are available at
www.nutsvolts.com.) When testing the joystick, I got values Each button
between 25 and 255, and what we need for the servo is has its own
100 to 200. The challenge doesn’t end there, however, as debounce count-
the center value for the joysticks was 50. er. When either
So, we have two sections: one side goes 25 to 50, the counter reaches
other side of the stick goes 50 to 255. To adjust the first five (which
section for servo pulse values, the math is pretty simple: means the but-

position = position * 2 + 50

By applying this formula, we’ll move


25-to-50 to 100-to-150. ■ FIGURE 4. LED ■ FIGURE 5.
For the other side, we Connection. Servo Connections.
September 2007 83
Stamp.qxd 8/6/2007 10:25 AM Page 84

this section that follows:


◗ PARTS LIST
Item Qty Recording:
◗ SX28 proto board 1 ledPort = LED_RED
◗ ADC0832, dual-channel ADC 1 pos0 = joyX
pos1 = joyY
◗ 24LC512 EEPROM 1 IF btnTmr(0) = BtnOK THEN
◗ Eight-pin DIP socket 2 GOTO Stop_Recording
◗ DB-15F socket (solder cup type) 1 ELSE
◗ 220 ohm resistor 3 PUT_EE eePntr, joySticks
◗ 1K resistor 1 INC numRecs
◗ 4.7K resistor 2 IF eePntr < REC_LAST THEN
◗ 10K resistor 4 eePntr = eePntr + 2
◗ 0.1 µF capacitor 2 ELSE
GOTO Stop_Recording
◗ bi-color LED (two lead) 1 ENDIF
◗ 0.025 male post headers (0.1” centers) ENDIF
post-header jumpers GOTO Main

Stop_Recording:
ton was held down for five consecutive cycles), it is PUT_EE 0, 0, numRecs
considered valid. runMode = M_IDLE
How a button press affects the program is based on the btnTmr(0) = 0
current operational mode. The next step in the program is GOTO Main
to jump to the handler for the current mode:
We start by refreshing the red LED to indicate record
Mode_Handler: mode and then update the background servo controller
IF runMode = M_IDLE THEN Check_Start
IF runMode = M_REC THEN Recording
with the current joystick values. If the start/stop button has
IF runMode = M_PLAY THEN Playing not been pressed, then the axis values are written to the
IF runMode = M_PAUSE THEN Play_Paused memory, the records count is updated, and then we check
to see if there’s any room left in the EEPROM. If the
The first mode, M_IDLE, is where we’ll sit and wait for start/stop button has been pressed or we have run out of
a start button press, all the while the servos will follow any memory, the recording process is stopped. Here we write
motion of the joystick. When the start (x axis) button is the number of records to address $0000 of the EEPROM
pressed, we’ll look at the Play/Record jumper and take and reset the mode to idle.
things from there. Remove the Play/Record jumper and press the
start/stop button again — you should see the moves you just
IF btnTmr(0) = BtnOK THEN recorded played back. I’m easily entertained, but when this
IF PlayRec = RecordNow THEN
worked the first time my face lit up with a very big smile.
numRecs = 0
runMode = M_REC Here’s the playback code:
ELSE
numRecs = GET_EE2 0, 0 Playing:
IF numRecs > REC_LAST THEN ledPort = LED_GRN
GOTO Empty_EE pos0 = GET_EE2 eePntr
ELSE pos1 = __PARAM2
runMode = M_PLAY DEC numRecs
ENDIF IF btnTmr(0) = BtnOK THEN
ENDIF runMode = M_IDLE
eePntr = 2 btnTmr(0) = 0
btnTmr(0) = 0 GOTO Main
ENDIF ENDIF
GOTO Main IF btnTmr(1) = BtnOK THEN
runMode = M_PAUSE
btnTmr(1) = 0
When the Play/Record jumper is out, the number of GOTO Main
records is read from the EEPROM at address $0000. Blank ENDIF
EEPROMs usually have all locations set to $FF, so if we IF numRecs > 0 THEN
see a bad value in the numRecs variable, the program eePntr = eePntr + 2
ELSE
flashes the red LED and then jumps back to the top in idle IF Repeat = Yes THEN
mode — what this means is that we need to record some numRecs = GET_EE2 0, 0
movements first. eePntr = 2
Install the Play/Record jumper and then press the ELSE
runMode = M_IDLE
start/stop button on the joystick — press it quickly, though. ENDIF
The [movement] records count will be cleared and ENDIF
the mode set to M_REC which directs the program to GOTO Main
84 September 2007
Stamp.qxd 8/6/2007 10:26 AM Page 85

S TA M P A P P L I C AT I O N S

JON WILLIAMS

RESOURCES [email protected]
PARALLAX, INC.
www.parallax.com

In playback mode, the green LED is lit and we pull a


new set of servo values from the EEPROM. Note that the
GET_EE2 function returns a word, but we’re placing the
result in a byte (pos0). The compiler is smart enough to put
the LSB of the returned value into pos0. We can get the
MSB of the return manually by copying __PARAM2. When
a function returns a word, the LSB is in __PARAM1; the
MSB is in __PARAM2. ■ FIGURE 6.
After retrieving a movement record, we decrement the Completed Waldo.
records count and check for button presses. We can stop
the playback cycle or, by pressing the y axis button, put it thing I will do is order an LTC1298 and replace the
into a pause mode. Assuming no button presses, we check ADC0832 with it. I didn’t happen to have an LTC1298 in
to see if the playback cycle is complete. If not, then the EE my supply, so I went with what I had. It’s a little pricey
pointer is advanced to the next set of position values. When (about $11), but I think the additional resolution will
we do get to the end, the program checks the loop-back be worth having, and the pin-out exactly matches
jumper. When this is installed, the records count is the ADC0832. Next up for me is to attach a neat little
reloaded, the EE pointer sent back to the beginning, and the pan-tilt servo head that I bought from Lynxmotion and
playback continues. With no loop-back jumper, the mode is make it dance!
returned to idle and playback stops. Have fun, and until next time, Happy Stamping! NV
The pause mode doesn’t do anything except monitor
button presses. We can either resume the cycle by pressing
the y axis button again, or stop it by pressing the x
axis button.

Play_Paused:
IF btnTmr(1) = BtnOK THEN
runMode = M_PLAY
btnTmr(1) = 0
GOTO Main
ENDIF
IF btnTmr(0) = BtnOK THEN
runMode = M_IDLE
btnTmr(0) = 0
ENDIF
GOTO Main

And there we have it — a two-channel servo controller


that plays live, records, and plays back. Figure 6 shows my
final board. The six-pin header on the right edge is where
I connected my DB-15 joystick adapter (using 0.025”
post-header sockets). Note that the SX28 proto board
has busses for Vdd and Vss so connecting the pull-ups
and pull-downs for the joystick connection is very easy at
this point.
Connections beneath the board are made with
wire-wrapping wire, except for the power connections to
the joysticks. Here’s a bit of a tip for your toolbox: Get a
roll of blue painter’s tape. It’s great for holding wires and
components while soldering, and won’t leave a sticky mess
when you pull it off — I always have it on hand when I’m
building circuit boards.
The board does work as well as I’d hoped, but one
September 2007 85
Page87.qxd 8/7/2007 11:11 AM Page 87

Phone: (719) 520-5323


Order online at: Development Tools for PIC ® MCUs Fax: (719) 520-1867
www.melabs.com microEngineering Labs, Inc. Box 60039
Colorado Springs, CO 80960

USB Programmer $119.95 LAB-X Experimenter Boards BASIC Compilers for PICmicro®
(with accessories) Pre-Assembled Board Easy-To-Use BASIC Commands
for PIC® MCUs Available for 8, 14, 18, 28, Windows 9x/Me/2K/XP Interface
and 40-pin PIC® MCUs
RoHS 2-line, 20-char LCD Module PICBASIC™ Compiler $99.95
Compliant 9-pin Serial Port BASIC Stamp 1 Compatible
Sample Programs Supports most 14-bit Core PICs
Programs PIC Built-In Serial Comm Commands
MCUs including Full Schematic Diagram
low-voltage (3.3V) Pricing from $69.95 to $349.95 PICBASIC PRO™ Compiler $249.95
devices Supports All PICmicro® MCU Families
Direct Access to Internal Registers
Includes: PICPROTO™ Prototyping Boards Supports In-Line Assembly Language
Programmer, USB Cable, Interrupts in PICBASIC and Assembly
ZIF Programming Adapter for 8 to 40-pin DIP, Double-Sided with Plate-Thru Holes Built-In USB, I2C, RS-232 and More
Software for Windows 98/Me/NT/2K/XP Circuitry for Power Supply and Clock Source Level Debugging
Large Prototype Area
EPIC™ Parallel Boards Available for Most PIC® MCUs See our full range of products, including
Port Programmer Documentation and Schematic books, accessories, and components at:
starting at $59.95 Pricing from $8.95 to $19.95 www.melabs.com

6ISIT/UR
7
HTTPWW EBSITE!T
WELEXPC
OM
-(:37%%0 $# 0/7%2 3500,)%3 3/,$%2).' 34!4)/.
&5.#4)/.'%.%2!4/23 /3#),,/3#/0% -/$%, (9 n $)')4!, $)30,!9 2/4!294//,+)4
"%343%,,).'  
7AVEFORM&UNCTIONS )NT%XT
#OUNTER LINLOGSWEEP
-/$%,'/3  6ARIABLEOUTPUT  6$#  !MP 
 
34!4)/.
 

$UAL#HANNEL 6ARIABLESPEEDTOOL 


-/$%,&'  -/$%,&'  -/$%, (9  n 42)0,% /54054 -/$%,7,# 20- WITHACCESSORYKITINA
.O$IGITAL$ISPLAY $IGIT$ISPLAY n -(:

 

4WO 6$#  !MPVARIABLEOUTPUTS 
).#,5$%3 02/"%3 PLUS6!lXED$IGITAL$ISPLAY  
67,#
HARDPLASTICCARRYCASE
6$2
"%.#( $-- 7)4( 23 ).4%2&!#% $)')4!, -5,4)-%4%2 !,,)'!4/2 ,%!$3 ()'( 0%2&/2-!.#%
 7)2% )2/.
-/$%,$-2
4RUE2-3 DIGITALANDBAR
2ANGESn $IGIT 3%4/&   6
 

-/$%,-9  
 
GRAPHDISPLAY !#$##AP 2ES 3/5.$ 3%.3/2 #!2 $)')4!, -/2%
FREQUENCYFUNCTIONS)NCLUDES !#$#6OLT#URRENT 2ES#AP 2%15)2%33/,$%2).' -5,4)-%4%2  
SOFTWARE !#OR$#OPERATION

 
 &REQUENCY2UBBER(OLSTER)NCLUDED 2EVERSES 350%2  
,OW 0RICED
DIRECTION
)TEMS)N/UR
%#/./-9
  
37)4#(%3 0/4%.4)/-%4%23    
#ERMET 3433ERIES `` ` WHENEVERIT &2%%
0/3$)0 6$)033    -/$%,"
-ULTITURN -443ERIES `` ` DETECTSNOISE
4OGGLE-INI30$4 64/'3$ -   
     0AGE
4OGGLE-INI$0$464/'$$ -   
0ANEL-OUNT 0-!3ERIES `` `
OBSTACLE

ORTOUCHESAN       #ATALOG
3TANDARD6ALUES!VAILABLE
6$-" 6
4%2-3-IN SHIPPING3CHOOL0URCHASE/RDERS 6)3!-# -ONEY/RDER 0REPAID./0%23/.!,#(%#+3 ./#/$.*2ESIDENTS!DD3ALES4AX

)N .*     "LAIR 2OADs!VENEL .*   HTTPWWWELEXPCOM
  
&!8   
EMAIL ELECTRON ELEXPCOM

September 2007 87
DesignCycle.qxd 8/6/2007 10:31 AM Page 88

■ BY PETER BEST
THE DESIGN
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
CYCLE

LAYING A FOUNDATION FOR PING


IN THE PREVIOUS EDITION OF DESIGN CYCLE, I described the steps that were
necessary to “fool” your personal computer (PC) into having a conversation
with the Ethernet MINI and the minimal driver code we had completed at that
time.This month, we will take yet another firmware step forward and complete
the coding needed to allow you to PING your Ethernet MINI and communicate
with the Visual Basic-based EDTP Internet Test Panel application.

T o accomplish the tasks of replying to a PING and


sending UDP datagrams to the EDTP Internet Test
Panel, we will need to code up an ARP reply routine and a
issued by the IEEE. By issuing an ARP request embedded
with the desired destination host’s IP address, the
searching host can obtain the desired destination
simple UDP echo module. The new ARP routine will host’s unique MAC address it needs to make the
replace the manual stuffing of the Ethernet MINI’s IP and network connection with the desired remote network
MAC addresses into the PC’s ARP cache I outlined in the host that has the IP address specified in the ARP request.
last Design Cycle column. The assembly of the UDP echo Now that you know why we need to code an ARP
source code module will do more than just allow us to send module, let’s do just that.
UDP datagrams to the EDTP Internet Test Panel Visual The ARP components take up the same packet space
Basic application. UDP is the basis of DHCP message as the IP header (and then some). Thus, an ARP packet is its
communication and having the basic UDP coding own thing, as an ARP message is not encapsulated within
techniques under our belts will make our coding lives an IP packet. Despite this seeming lack of respect for IP,
easier when we are ready to code up the DHCP modules. ARP must still use elements of IP to do its job. Consider the
ARP is currently the most important piece of coding we following code snippet:
have to do. So, let’s take a swing at getting our Ethernet
MINI hardware to respond to an ARP request. ;********************************************************
;* ARP Layout
;********************************************************
CODING THE ARP FIRMWARE arp_hwtype CON $0E
arp_prtype CON $10
ARP is network shorthand for Address Resolution arp_hwlen CON $12
Protocol. In our situation, the Ethernet MINI is normally arp_prlen CON $13
the recipient of an ARP request. An ARP request is arp_op CON $14 ;arp request or response
generated by any host on a network that is searching arp_shaddr CON $16 ;arp source mac address
for another particular host on the network. In our arp_sipaddr CON $1C ;arp source ip address
arp_thaddr CON $20 ;arp target mac address
case, the requesting or searching host is a PC attached
arp_tipaddr CON $26 ;arp target ip address
to the Ethernet MINI’s network. The problem for the
searching host is that it only has the desired destination
host’s IP address. The host that is on the search mission Take a look at the ported PICBASIC PRO source that
also needs to have the desired destination host’s MAC I’ve provided. Notice that the ARP_hwtype and
(hardware) address as well, in order to communicate ip_vers_len fields are located at the same location within
directly to it. an Ethernet packet. Note also that the ARP framework is
The reasoning behind this is that many differing four bytes larger than the area occupied by the IP header.
hosts on different (but connected) networks may all We will use these differences and similarities in our
have the same IP address. However, the MAC address Ethernet MINI firmware to fish out an incoming ARP
of every host on any network must be unique to that message and act upon it. The stream we will fish in for
particular host. The uniqueness of the MAC addresses is ARPs runs through the get_frame subroutine. Here’s how
guaranteed if the network host’s hardware address was we bait the hook:
88 September 2007
DesignCycle.qxd 8/6/2007 10:32 AM Page 89

THE DESIGN CYCLE


;process an incoming ARP request packet you’re wondering about the “c” in remotemacaddrc, that’s
if packet[enetpacketType0] == $08 && a holdover from the port from C. I use “c” to denote byte
packet[enetpacketType1] == $06 then
if packet[arp_hwtype+1] == $01 &&_ variables and “i” to identify integer variables when there are
packet[arp_prtype] == $08 &&_ a bunch of them all mixed up under my care.
packet[arp_prtype+1] == $00 &&_ We really need to respond to an incoming ARP
packet[arp_hwlen] == $06 &&_ request before we can do anything useful with the
packet[arp_prlen] == $04 &&_
packet[arp_tipaddr] == ipaddrc[0] &&_ Ethernet MINI. So, branch to the arp_reply subroutine in
packet[arp_tipaddr+1] == ipaddrc[1] &&_ the Ethernet MINI driver PICBASIC PRO source code.
packet[arp_tipaddr+2] == ipaddrc[2] &&_ The arp_reply subroutine is simply building an ARP
packet[arp_tipaddr+3] == ipaddrc[3] then reply packet in the PIC18F67J60’s internal transmit buffer
select case packet[arp_op+1]
memory. Recall that we have already hacked out transmit
case $01 and receive buffer areas within the PIC18F67J60’s 8K of
gosub arp_reply packet buffer SRAM.
case $02 Once the transmit buffer write pointers
for i8 = 0 to 5
remotemacaddrc[i8] = packet[arp_shaddr+i8]
(EWRPTH/EWRPTL) are initialized and the mandatory
next i8 control byte is placed into the PIC18F67J60’s transmit
gosub set_arpflag buffer, we use the source MAC address we gleaned from
end select the incoming ARP message to use as a return hardware
endif address. The addition of our MAC address as the sender
endif
(source) in the initial address fields (DLC Header) of the
packet will not fulfill our reply obligation. The MAC address
The ARP Ethernet packet type of $0806 tugs on our the requesting host is looking for is contained within the
fishing line as the bait is being taken. An incoming IP body of the ARP message. The best way to illustrate
packet would have $0800 in the Ethernet packet type field. the inner workings of the PICBASIC PRO ARP code is with
The hwtype or hardware address type field’s $01 denotes an illustration.
a 10 MB Ethernet. Recall that ARP does indeed use IP Figure 1 is a screen capture taken from a Network
components. So, the protocol type field is filled with General Sniffer Portable Ethernet sniff session. The sniff
$0800, which denotes the IP protocol. session participants are a laptop and an Ethernet MINI.
A MAC address is made up of six bytes. This is Note the PC’s MAC address (Source = Station
conveyed in the arp_hwlen field with a value of $06. The 001B3807CFC7) is contained within the DLC Header area
arp_prlen array entry tells us that the IP address consists of and the body of the ARP packet. The reason for this is that
four octets. Octet is Internet document speak for byte. It is networks aren’t always simple, router-less two-node dances.
possible to only filter on the Ethernet packet type and the The Internet is built around routers and routers need
IP address to determine that we have hooked an incoming addresses to be able to forward packets around the
ARP message. However, to be safe, I decided to verify Internet. Thus, the DLC Header addresses are used by
every field I thought that I should to make sure the the routers (and host nodes for that matter) for addressing
incoming message was indeed an ARP and that the information as a router isn’t programmed to dig deep into
captured ARP message was directed to the hardware packets to retrieve address information.
running this ported PICBASIC PRO firmware. We’ve already talked about most everything contained
The arp_op array entry is the operation that is
being requested. A $01 in the operation field
represents an incoming ARP request that we must
reply to. If our Ethernet MINI generated an ARP
request, we would look for the operation field to
contain $02 and the returned ARP message to
contain the MAC address of the replying host.
You can immediately see what happens when
an incoming ARP message contains the in-question
MAC address. We simply stuff the contents of the
arp_shaddr (sourcehardwareaddress) array fields
into the remotemacaddrc array fields for later use. If

■ FIGURE 1. The Network General Sniffer products


are top notch. I rely on the Network General Sniffer
when developing embedded Ethernet firmware as I
can easily verify my checksum code and see all of
the fields of an Ethernet packet I am interested in. This
is also a great way to show Nuts & Volts readers the
innards of Ethernet packets.
September 2007 89
DesignCycle.qxd 8/6/2007 10:32 AM Page 90

in the ARP/RARP frame fields of Figure 1 with the excep- has been taken. We are now able to identify our PICBASIC
tion of the MAC and IP fields. Figure 1 is a sniff representa- PRO-laden Ethernet MINI module to other hosts on an
tion of an ARP request that was sent by the laptop on the Ethernet network via an ARP reply.
two-node Ethernet MINI network. Since the PC knows the A PING is really an ICMP operation. So, we must port
Ethernet MINI’s IP address but does not know the Ethernet the original C ICMP code to PICBASIC PRO if we want to
MINI’s MAC address, the ARP request is transmitted as a PING our Ethernet MINI that is running the PICBASIC PRO
broadcast message with the target MAC address left driver code. Our PING coding takes place in the icmp
“blank.” The Ethernet MINI’s IP address is 192.168.0.150 subroutine. However, the icmp subroutine does not get
and the Target protocol address field in Figure 1 was called unless the correct conditions are met in the code
populated by the PC before sending the ARP request. The snippet that follows:
laptop is looking for the Ethernet MINI to respond to this
ARP request and fill in the “blank” MAC address, which is, ;process an IP packet
of course, the Ethernet MINI’s MAC address. if packet[enetpacketType0] == $08 &&_
packet[enetpacketType1] == $00 &&_
The Ethernet MINI fulfilled its ARP obligation in Figure packet[ip_destaddr] == ipaddrc[0] &&_
2. Although the Ethernet MINI has inserted its MAC address packet[ip_destaddr+1] == ipaddrc[1] &&_
into the DLC Header reply, the requesting application will packet[ip_destaddr+2] == ipaddrc[2] &&_
actually retrieve the Ethernet MINI’s MAC address from the packet[ip_destaddr+3] == ipaddrc[3] then
sender’s hardware address fields within the ARP frame.
Thus, our ported Ethernet MINI ARP PICBASIC PRO source select case packet[ip_proto]
case PROT_ICMP
code built an ARP reply frame and turned around the gosub icmp
source and destination addresses to realize and send along case PROT_UDP
the ARP reply packet shown in Figure 2. When you study if packet[UDP_srcport] == DHCP_SERVER_PORT then
the PICBASIC PRO arp_reply subroutine, you will find that gosub dhcp_state_engine
there is nothing in the coding that is complex at all. In fact, else
gosub udp
I didn’t have to do much of anything to port many of the
endif
original C source lines to the PICBASIC PRO language. case PROT_TCP
At this point, the laptop has retrieved the Ethernet gosub tcp
MINI’s MAC address information and placed it into its ARP end select
cache. You can use the arp /a command on the laptop to endif
see the Ethernet MINI’s IP and MAC cache entries. In that,
the Network General Sniffer caught the ARP request and Unlike the ARP frame, this is a true IP datagram as
reply sequence, and I could see the Ethernet MINI’s address denoted by the $0800 Ethernet type value. Since this is
information in my laptop’s ARP cache. We can therefore be an IP packet, there are a number of things that can be
fairly sure that the Ethernet MINI’s ARP PICBASIC PRO wrapped up inside of it. According to the code I just
code worked as designed. offered that processes an IP packet, we could have an
ICMP, a UDP, or a TCP operation encapsulated within
the incoming IP datagram. Another look at the IP packet
PINGING WITH PICBASIC PRO parsing code tells us that all we need to do is make
The first major step in our PICBASIC PRO code port sure it is indeed an incoming IP datagram and that the
incoming IP datagram is actually addressed to
our Ethernet MINI. Then — depending on the
encapsulated protocol type — we branch off into
analyzing and acting upon the payload of the
incoming IP datagram we have captured with
the Ethernet MINI. Since we’re on the subject
of PINGing, we’ll turn our attention to the
PROT_ICMP path, which invokes the ported
PICBASIC PRO icmp subroutine.
A PING response is basically nothing more than
an echo of the received data payload. However, we
must readdress the PING reply packet and calculate
some checksums before sending our PING reply. A

■ FIGURE 2. The receiving application retrieves


the missing Ethernet MINI MAC address from the
highlighted fields in this sniff. Note the human-readable
fields are supported by a hex dump of the data at the
bottom of this shot. This is a typical Network General
Sniffer presentation.
90 September 2007
DesignCycle.qxd 8/6/2007 10:32 AM Page 91

THE DESIGN CYCLE

converted PICBASIC PRO subroutine called setipaddrs is to Plan B from outer space. Here’s the first of the alien
responsible for the address reconfiguration. invasion code:

;******************************************************** chksum16 var word


;* SETIPADDRS acc3 var word
;* This subroutine builds the IP header. acc2 var word
;******************************************************** acc1 var word
;move IP source address to destination address acc0 var word
packet[ip_destaddr]=packet[ip_srcaddr] arg3 var byte
packet[ip_destaddr+1]=packet[ip_srcaddr+1] arg2 var byte
packet[ip_destaddr+2]=packet[ip_srcaddr+2] arg1 var byte
packet[ip_destaddr+3]=packet[ip_srcaddr+3] arg0 var byte
;make ethernet module IP address source address
packet[ip_srcaddr]=ipaddrc[0]
packet[ip_srcaddr+1]=ipaddrc[1] Let’s translate. Note that there are four acc word
packet[ip_srcaddr+2]=ipaddrc[2] variables and four arg byte variables. The acc variables are
packet[ip_srcaddr+3]=ipaddrc[3] accumulator variables while the arg variables I’ve declared
;move hardware source address to destinatin address are arguments or mathematical operands. When all is
packet[enetpacketDest0]=packet[enetpacketSrc0]
said and done, the chksum16 variable will contain our
packet[enetpacketDest1]=packet[enetpacketSrc1]
packet[enetpacketDest2]=packet[enetpacketSrc2] magic checksum, which was calculated with the help of the
packet[enetpacketDest3]=packet[enetpacketSrc3] accumulators and arguments.
packet[enetpacketDest4]=packet[enetpacketSrc4] The IP checksum is defined as the 16-bit one’s
packet[enetpacketDest5]=packet[enetpacketSrc5] complement sum of all 16-bit words in the header.
;make ethernet module mac address the source address PICBASIC PRO can natively manipulate 16-bit variables.
packet[enetpacketSrc0]=macaddrc[0]
Our problem lies in the fact that when accumulating 16-bit
packet[enetpacketSrc1]=macaddrc[1]
packet[enetpacketSrc2]=macaddrc[2] values, an overflow into the 17th bit can possibly occur.
packet[enetpacketSrc3]=macaddrc[3] PICBASIC PRO will throw the 17th bit in the bit bucket.
packet[enetpacketSrc4]=macaddrc[4] Our checksum calculation uses all of the bits from bit
packet[enetpacketSrc5]=macaddrc[5] 17 up to bit 31. Our job is to arrange all of the IP header
bytes into words, add them all together with the carries out
Porting the initial portion of the setipaddrs subroutine into bit 17 and beyond, and invert the sum by performing a
was a piece of cake as all I had to do was remove the one’s complement against it. Simple, huh? Yep ... and here’s
semicolons from the ends of the ported statements. In how we’ll do it.
actuality, I could have left the semicolons in place as they In your mind, group the arg variables into a 32-bit
are comment delimiters in PICBASIC PRO. The downside variable with arg3 representing the most significant byte
to this laziness is that sometimes an active statement of the 32-bit long variable and arg0 acting as the least
following the semicolon that needs to be ported gets the significant byte of the 32 bit variable. For instance, if
commented color scheme, and can be accidentally arg3=$03, arg2=$02, arg1=$01, and arg0=$00, that would
erased or ignored. During porting, I had the “ignore” equate logically to a 32-bit value of $3210. Get the idea?
scenario occur just before I was about to execute the The same logic applies to the accumulators with a twist.
“erase” scenario. So, I’ve eliminated the end-of-C- Each accumulator is a word variable and is 16 bits in
statement semicolons in our C-to-PICBASIC PRO port. As length. PICBASIC PRO doesn’t natively allow the program-
you can see in the setipaddrs code snippet, the setipaddrs mer to interrogate carry situations. So, if we declared each
subroutine simply swaps the source and destination IP accumulator variable as a byte, the addition of $FF and $01
and MAC addresses in preparation for the transmission of in an accumulator variable would render $100, which is
the PING reply packet. out of the bounds of an eight-bit variable. The carry out of
Just when you think things are in hand, the bottom of the addition of $FF + $01 would be lost to us as the
your basket falls through. In the C source we’re porting, accumulator variable would simply roll over to $00.
the 16-bit IP header and ICMP header checksums are The accumulators are all declared as words to trap any
calculated using 32-bit variables. Unfortunately, PICBASIC byte addition overflows. Consider this. We load acc0 with
PRO knows what a 32-bit variable is, but it has no $FF. We then load arg0 with $01. The values are then
orders to do anything about them. The PICBASIC added together and stored in acc0 like this: acc0 = acc0 +
PRO DIV32 mnemonic and some tricky Darrel Taylor arg0. Since acc0 is a word variable, the value stored in acc0
PICBASIC PRO/assembler code are all that we have to following the addition will be $0100. Here’s where our
work with when it comes to using ported unsigned logic becomes magic.
long C variables with PICBASIC PRO. Unfortunately, I We have arranged the accumulators as four logical
was unable to think (or should that be trick) my way words with acc0 being the least significant word and acc3
through the 16-bit checksum problem using Darrel’s as the most significant word. That’s logically 64 bits. The
readily-available algorithms. That was a loss as Darrel’s magic comes in as we treat each accumulator as a byte not
DIV32 code is compact and efficient. So, I had to resort as a word. The most significant byte of each accumulator
September 2007 91
DesignCycle.qxd 8/6/2007 10:33 AM Page 92

variable is simply a bit bucket for the carry bits. The value in ;calculate the IP header checksum
the most significant byte of acc0 is added to the least packet[ip_hdr_cksum]=$00
packet[ip_hdr_cksum+1]=$00
significant byte of acc1 and the most significant byte of
acc0 is cleared to $00. Do you get it? hdrlen = (packet[ip_vers_len] & $0F) * 4
The most significant byte of each of the accumulator ;addr = &packet[ip_vers_len]
variables is added to the least significant byte of the next i16 = 0
accumulator in the 64-bit accumulator chain we logically gosub clrcrc
created. After each carry-over addition, the most significant while(hdrlen > 1)
arg1=packet[ip_vers_len+i16]
byte of the accumulator that overflows is cleared to zero. i16 = i16 + 1
Thus, we logically have only 32 bits in our accumulator arg0=packet[ip_vers_len+i16]
chain (the accumulator’s least significant bytes), with each i16 = i16 + 1
accumulator having its own carry bit bucket (the most acc0 = acc0 + arg0
significant byte of each accumulator) from which we gosub ripple_crc
acc1 = acc1 + arg1
can dip. The bit buckets are serviced by the ripple_crc
gosub ripple_crc
subroutine, which I present to you here: hdrlen = hdrlen - 2
wend
ripple_crc: if(hdrlen > 0) then
if acc0 > $FF then arg1=packet[ip_vers_len+i16]
acc1 = acc1 + 1 arg0=$00
acc0 = acc0 & $00FF cc0 = acc0 + arg0
endif
gosub ripple_crc
if acc1 > $FF then
acc1 = acc1 + arg1
acc2 = acc2 + 1
acc1 = acc1 & $00FF gosub ripple_crc
endif endif
if acc2 > $FF then acc0 = acc0 + acc2
acc3 = acc3 + 1 gosub ripple_crc
acc2 = acc2 & $00FF acc1 = acc1 + acc3
endif gosub ripple_crc
if acc3 > $FF then chksum16= ~((acc1 << 8) + acc0);
hserout[13,10, packet[ip_hdr_cksum] = (chksum16 & $FF00) >> 8
”CHECKSUM OVERFLOW ERROR”,13,10] packet[ip_hdr_cksum+1] = chksum16 & $00FF
endif return
return

The theory behind our accumulator-based checksum


Since the IP checksum specifies that we add 16-bit calculator seemed to work well. However, the real proof
numbers, we logically group the arg byte variables into would come when a PING request jumped from my laptop
pairs, which we logically add to the accumulators as 16-bit to the Ethernet MINI.
values. You can see this happening in the remainder of I am vindicated in Figure 3. Our ported PICBASIC PRO
the setipaddrs subroutine PICBASIC PRO code. Here’s checksum code in the setipaddrs subroutine calculated the IP
the ported PICBASIC PRO code that calculates the IP header checksum value in the PING response packet you see
header checksum: sniffed in Figure 3. Our PICBASIC PRO checksum code was
again put to the test in Figure 4. We correctly calcu-
lated the ICMP checksum, which is defined as the
16-bit one’s complement of the one’s complement
sum of the ICMP message starting with the ICMP Type.

A PORTED UDP APPLICATION


The original C source we’re using as a base for
our PICBASIC PRO port contains a simple UDP
application that echoes characters sent from a
Visual Basic program running on a PC. I’ve included
the Ethernet MINI UDP application code in this
month’s Design Cycle download package. I
don’t think you’ll have any problems following the

■ FIGURE 3. You can tell that this PING reply emanated


from the Ethernet MINI by examining the source and
target IP addresses. The Ethernet MINI is addressed as
150 on the network while my laptop has an IP address
ending in 103.
92 September 2007
DesignCycle.qxd 8/6/2007 10:33 AM Page 93

THE DESIGN CYCLE

■ FIGURE 4. Our 16-bit ported PICBASIC PRO checksum


routines have passed the test as we have now calculated
the IP header and ICMP checksums. Note that the
Network General Sniffer points out that this is an Echo
Reply and references the byte field in the hex dump at
the bottom of the shot. All hail the Network General
Ethernet Sniffer!

PICBASIC PRO UDP code flow as it looks just


like everything we’re mulled over up to now.
Now that we have ported the code that drives
the PIC18F67J60 Ethernet hardware, most of what
we are doing consists of parsing fields of incoming
packets, calculating checksums, and correctly
placing IP and MAC addresses.
When you go over the UDP code, note that
UDP adds yet another concept we must consider in
our code. In addition to an IP and MAC address,
UDP utilizes source and destination port addresses.
The UDP application I’ve supplied in the download
package (www.nutsvolts.com) looks for a message sent to
well-known port 7, which is the echo port. “Well-known” STACKING UP THE PROTOCOLS
means that this is a standardized port. You can use port 7 We’ve worked our way through the coding of the
for other things but you may run into a problem if the other PIC18F67J60 physical layers. With the completion of this
guy or gal you want to communicate with has used port 7 month’s discussion, we’ve worked our way through the
for its original intended purpose. PICBASIC PRO 32-bit limitation and established a foothold on
I’ve also included the time-tested EDTP Internet Test the coding of the basic Internet protocols. With the successful
Panel application, which runs on a PC. The EDTP Internet porting of the ARP, ICMP, and
Test Panel application you see in Figure 5 is easy to use. All UDP protocols behind us, we
you have to do is enter the Ethernet MINI’s IP address in the are climbing towards the most SOURCES
Target IP Address window and type characters into the famous protocol: TCP. Next time, ■ EDTP Electronics, Inc.
(www.edtp.com):
Original Data window. Ignore the Target Port and LCD Data we’ll talk more about UDP and Ethernet MINI
Entry windows as they were part of a past EDTP application. port the Ethernet MINI DHCP
If things work as designed, what you type into the Original and TCP C source to PICBASIC ■ microEngineering
Data window will be echoed by the Ethernet MINI back to PRO. I’m having a blast coding Labs, Inc. (www.melabs.
the Echoed Data window in the EDTP Internet Test Panel with PICBASIC PRO. NV com): PICBASIC PRO
application frame.

■ FIGURE 5. This application has been


around for a couple of years and has
The Standard for checking Locate shorted or leaky
seen widespread use. It’s simply a tool Capacitors in-circuit components or conditions
that was created to test the functionality Good enough to be the to the exact spot in-circuit
of the UDP firmware written at EDTP choice of Panasonic, Still cutting up the pcb,
Electronics. All you have to do is dial Pioneer, NBC, ABC, Ford, and unsoldering every
in a Target IP Address and start typing. JVC, NASA and thousands part trying to guess at
of independent service where the short is?
technicians. $209

Inexpensive enough to pay for itself in just Your DVM shows the same shorted reading all
one day’s repairs. At $209, it’s affordable. along the pcb trace. LeakSeeker 82B has the
resolution to find the defective component.
And with a 60 day trial period, satisfaction Touch pads along the trace, and LeakSeeker
guaranteed or money-back policy, the only beeps highest in pitch at the defect’s pad. Now
thing you can lose is all the time you’re you can locate a shorted part only a quarter of
currently spending on trying to repair all an inch away from a good part. Short can be
those dogs you’ve given up on. from 0 to 150 ohms
CapAnalyzer 88A LeakSeeker 82B
Available at your distributor, or call 561-487-6103
Electronic Design Specialists www.eds-inc.com
September 2007 93
Page94.qxd 8/7/2007 2:02 PM Page 94

Manufacturing
Quality Products
since 1983!
Tenma sets the standard
for high quality, value priced
products including:
•Oscilloscopes
•Pattern generators
•Function generators
•DMMs
•Spectrum analyzers
•Frequency counters
•Thermometers
•Replacement test leads
•Soldering and desoldering stations
•Solder
•Desoldering braid
•Irons and accessories

Order #72-847

HDMI Cable Tester


Tests DC continuity on all
active pins on an HDMI cable
•Tests each signal path individually
and sequentially
•LED indicators provide independent
test of nine signal paths
•Includes a remote module for testing
from other areas
•Contractor pricing available

For specifications visit


www.mcmelectronics.com

Distributed exclusively by MCM Electronics

Source Code: NVM61


94 September 2007
Page95.qxd 8/7/2007 11:13 AM Page 95

NEW! HIDmaker FS for Full Speed FLASH PIC18F4550


Creates complete PC and Peripheral Both PC and Peripheral programs
programs that talk to each other over understand your data items (even odd
USB. Ready to compile and run! sized ones), and give you convenient
• Large data Reports variables to handle them.
• 64,000 bytes/sec per Interface PIC18F Compilers: PICBASIC Pro,
• Easily creates devices with multiple MPASM, C18, Hi-Tech C.
Interfaces, even multiple Identities!
• Automatically does MULTITASKING PIC16C Compilers: PICBASIC Pro,
• Makes standard or special USB HID MPASM, Hi-Tech C, CCS C.
devices
NEW! “Developers Guide for USB HID PC Compilers: Delphi, C++ Builder,
Peripherals” shows you how to make Visual Basic 6.
devices for special requirements. HIDmaker FS Combo: Only $599.95

DOWNLOAD the HIDmaker FS Test Drive today!


www.TraceSystemsInc.com
301-262-0300
September 2007 95
ClassifiedsSep07.qxd 8/8/2007 4:47 PM Page 96

CLASSIFIEDS
COMPONENTS CONNECTORS/WIRE/CABLE
T The RF Connection
C Silver Teflon PL-259/Gold Pin, $1.00
H
E R O
N
213 N. Frederick Ave., Ste. 11NV
N or 10/$9.00
F E
C
Gaithersburg, MD USA 20877
T
I
O Call for Specials of the Month
Nhttp://www.therfc.com/
Full Line of Audio Connectors for Icom,
Complete Selection of MIL-Spec Coax, Kenwood, and Yaesu
RF Connectors and Relays 8 Pin Mike Female $2.50
UG-21B/U N Male for RG-213/214 .$5.00 8 Pin Mike Male Panel $2.50
UG-21D/U N Male for RG-213/214 .$3.25 13 Pin DIN for Kenwood $2.75
N Connectors for 9913/Flexi4XL/9096 8 Pin DIN for Icom $1.00

uM-FPU V3.1 PCB SOFTWARE UG-21B/9913 .....$6.00 / Pins Only......$1.50 8 Pin DIN for Kenwood $1.50
UG-21D/9913 ..$4.00 / Extra Gasket.$0.75 Prices Do Not Include Shipping
Floating Point Coprocessor UG-176/U Reducer RG-59/8X, $0.25 Prices subject to change without notice.
New instructions, serial I/O and EXCLUSIVE U.S. DISTRIBUTOR or 5/$1.00 Orders 800-783-2666
NMEA sentence parsing. UG-175/U Reducer RG-58/58A, $0.25 Info 301-840-5477
SPI or I2C interface. or 5/$1.00 FAX 301-869-3680
Extensive floating point library.
Matrix, FFT, 12-bit A/D support.
Flash and EEPROM memory.
User-defined functions. ROBOTICS
DIP-18, SOIC-18, QFN-44

Applications: embedded control,


sensor data conversion, GPS,
robotics, signal processing.
www.micromegacorp.com
YOUR COMPLETE
SOLUTION!
• PCB Design SATELLITE
• PCB Simulation
• CAD/CAM Menu FREE Satellite TV Buyer’s Guide
121747, Hobby Vers., $175 C-band • Ku-band • 4DTV • FTA
121743, Pro. Version, $275 Digital Programming Paks
www.KELVIN.com LOW Prices
GREAT Selection
800-500-9275
DESIGN/ENG HARDWARE
SERVICES WANTED www.skyvision.com

DEC EQUIPMENT
WANTED!!!
Digital Equipment Corp. AMATEUR RADIO
and compatibles.
Buy - Sell - Trade
CALL KEYWAYS 937-847-2300
PUBLICATIONS or email [email protected]

CNC Book
Easy CNC PLANS/KITS/ SCHEMATICS
G-code
Bit map draw programs
Bit map image converter
Bit map to G-code
CAD - machine drawings
CAM - DXF to G-code
http://www.cncintro.com

SQUARE 1
SQUARE
ELECTRONICS
(208) 664-4115
Hayden, ID USA
96 September 2007
ClassifiedsSep07.qxd 8/8/2007 4:48 PM Page 97

CLASSIFIED ADVERTISING $50.00 Per Inch — No extra charge for color. must be received by the closing date. Supplied ads must be received by the
Classified ads must be paid in full prior to the closing date or the ad will be artwork due date.
placed in the following issue, at our discretion. Minimum charge is one inch with Call 951-371-8497 or email [email protected] for closing dates,
half-inch increments. No proofs will be sent. Ads to be typeset by Nuts & Volts available sizes, and special prepay discount offers.

MILITARY SURPLUS MICROCONTROLLERS


MicroStamp11 PIC Microcontroller
World’s Smallest 68HC11
Microcontroller Module! Books
telemetry
z
microrobotics
z
smart toys
z
4 Titles
animatronics
z Beginner to Advanced
model railroading
z
home automation
z Table Of Contents
z tiny (1 by 1.4 in.), light-weight (0.5 oz.)
zon-board 5V reg., crystal, & reset chip Ordering Info
zchoice of 8K or 32K EEPROM
z or 32K RAM + 32K EEPROM (64K version) On Web Site
z SCI, SPI, Output Compare and Input
Capture channels, timer, pulse accumulator
z all 14 I/O lines and 2 interrupt lines
http://www.sq-1.com
brought out to versatile 20-pin connector
zprogram in BASIC, assembler, or C
zeasy code-loading with Docking Module
z Starter Packages:*
 z 8K EEPROM (#MS11SP8K).......$49
 z 32K EEPROM (#MS11SP32K)...$77
 z 32K EE/32K RAM (MS11SP64K)$90

* includes MicroStamp11, manual, PC soft- (208) 664-4115


AUDIO/VIDEO ware (assemblers, SBASIC compiler,
MicroLoad utility, and sample programs),
serial cable, Docking Module, & accessories.
Hayden, ID USA
www.technologicalarts.com
Toll-free (USA & Canada):
1-877-963-8996
Looking for robots?
Visa • MasterCard • Discover • Amex
www.servomagazine.com

Continued from page 8


READER FEEDBACK
Fonte mentioned in the article that a more sophisticated
filtering circuit would be better. I agree but am wondering if he
has tried anything that he is happier with.
Thanks for any help you can provide. The ARB looks very
interesting and I want to build it as soon as possible. Keep up
the good work!
BATTERIES Jim Rybak
Grand Junction, CO

Response: The important characteristics of the op-amp in question


are: 1) operate from a single supply; and 2) be fast enough (gain-
bandwidth product >1 MHz). The LMC6042 has a GBW of only 0.1
MHz and is too slow. If used, there can be additional problems at
the high frequency end. The LMC6442 has a GBW of only 9.5 kHz
and cannot be used. (I used the LMC6082 because I had it on hand.)
LCDs/DISPLAYS The LM6142 is a good substitute. It operates from a single
supply and has a GBW of 17 MHz. It is available from Jameco
and other suppliers in the eight-pin DIP package (check the web-
site at www.jameco.com). Note: The National Semiconductor
website (and most other IC manufacturers) will often provide
samples for free and/or provide access to small quantities for
evaluation. The important requirements are that you have to
provide a business address and a proper engineering job
SOLAR PRODUCTS description. (A school address will probably work, too.)
In regards to the filtering question, this application seems to
be an ideal project to incorporate a tunable switched-capacitor
filter. There is already a variable high-speed clock available that
is 25 times faster than the output. The July 2007 issue of N&V
(Making Waves) discusses SC filters.
Hope this helps. It’s always good to get feedback from readers.
— Gerard Fonte
September 2007 97
BookstoreSept07.qxd 8/8/2007 7:23 PM Page 98

Check ou t our new webs tor e for many mor e gr eat t i tles!!

The Nuts & Volts Hobbyist STORE


Electronic Circuits —
CD-ROMS Fundamentals & Applications:
Third Edition
by Mike Tooley
In Electronic Circuits, Mike
Tooley provides all the
essential information
required to get to grips
with the fundamentals of
electronics, detailing the
underpinning knowledge
necessary to appreciate
the operation of a wide
range of electronic
circuits, including ampli-
fiers, logic circuits, power supplies, and
oscillators.The third edition now offers an
even more extensive range of topics, with
extended coverage of practical areas such
as circuit construction and fault finding, and
new topics including circuit simulation,
electronic CAD, and a brand new chapter
devoted to the PIC microcontroller.
$34.95

Encyclopedia of Electronic
ELECTRONICS Troubleshooting and Repairing
Major Appliances: 2nd Edition
Circuits, Volume 7
by Rudolf F. Graf / William Sheets
+Practical Electronics for by Eric Kleinert Publish Date: August 31, 1998
Now covering both
Inventors gas and electric appli-
by Paul Scherz An extensive library
ances, the updated of 1,000 circuits from
This intuitive, applica- second edition of
tions-driven guide to the bestselling, seven-
Troubleshooting and volume Encyclopedia
electronics for hobby- Repairing Major
ists, engineers, and stu- of Electronic Circuits. A
Appliances offers you virtual treasurehouse.
dents doesn't overload a complete guide to
readers with technical An invaluable reference
the latest tools, tech- tool for every
detail. Instead, it tells
!
troubleshooting and N E W
niques, and parts for hobbyist, technician,
you — and shows you
— what basic and student, and design
repairing any appli-
advanced electronics ance. Packed with over 200 illustrations, professional. $39.95
parts and components the book includes step-by-step procedures
do, and how they work. Chock-full of illus- for testing and replacing parts, instructions
trations, Practical Electronics for Inventors Build Your Own Electronics
for reading wiring diagrams, charts with Workshop
offers over 750 hand-drawn images that troubleshooting solutions, advice on using
provide clear, detailed instructions that can By Thomas Petruzzellis
tools and test meters, safety techniques,
help turn theoretical ideas into real-life and more. $59.95* YOUR DREAM ELECTRONICS LAB
inventions and gadgets. $39.95 IS WAITING INSIDE!
This value-packed
Electromechanical Devices & resource provides
Troubleshooting Components Illustrated everything needed
Electronic Equipment Sourcebook to put together a
by R. S. Khandpur fully functioning
by Brian Elliott home electronics
From cell phones to Master the key
!
NEW
workshop! From
medical instruments elements of finding space to
to digital and micro- electromechanical stocking it with
processor based components. components to
equipment, this Essential to the putting the shop
hands-on, heavily design, repair, or into action — building, testing, and trou-
illustrated guide operation of your bleshooting systems — popular electronics
clearly explains how electromechanical author Tom Petruzzellis’ Build Your Own
to troubleshoot, devices, this quick- Electronics Workshop has it all! And the best
maintain, and repair find reference part is, this book will save you money, big
all types of electrical provides illustra-
equipment.The time! $26.95
tions, descriptions,
author covers all the essentials such as and relevant
necessary tools, soldering techniques, test- calculations for
ing, fundamental procedures, and mechani- 2,000 time-tested electromechanical
cal and electrical components. $49.95 components. $89.95 GREAT BOOK
98 September 2007
BookstoreSept07.qxd 8/8/2007 7:24 PM Page 99

CALL 1-800-783-4624 today!


Or Order online @ www.nutsvolts.com
THE EVIL GENIUS SERIES

$24.95 each
Subscribers
Save 10%
on two or more!

GREEN POWER ENERGY


Alternative Energy Demystified Designing & Building Fuel Cells The Complete Idiot’s Guide to
by Stan Gibilisco by Colleen Spiegel Solar Power for Your Home
Publish Date: October 23, 2006 Designing & Building Fuel by Dan Ramsey / David Hughes
Cells equips you with a Publish Date: May 2007
The fast and easy way hands-on guide for the
to get up-to-speed on design, modeling, and The perfect source
alternative energy. construction of fuel cells for solar power —
Because of current that perform as well or fully illustrated.This
events, geopolitics, and better than some of the book helps readers
natural disasters, the best fuel cells on the understand the
cost of fuel is front market today. Filled with basics of solar
and center in our over 120 illustrations power and other
lives.This book pro- and schematics of fuel renewable energy
vides a concise look cells and components, sources, explore
at all forms of energy, this “one-stop” guide covers fuel cell appli- whether solar
including fossil fuels, electric, solar, cations, fuels and the hydrogen economy, power makes sense
biodiesel, nuclear, hydroelectric, wind, and fuel cell chemistry, thermodynamics and for them, what their
renewable fuel cells.You will get explana- electrochemistry, fuel cell modeling, materi- options are, and what’s involved with
tions, definitions, and analysis of each alter- als, and system design, fuel types, delivery, installing various on- and off-grid systems.
native energy source from a technological processing, and much more. $89.95* $18.95
point-of-view. $19.95

MUST HAVE New To Our Store


Pocket Ref The Pocket Idiot’s Guide Gadgeteer’s Goldmine
by Thomas J. Glover to the iPhone by Gordon McComb
by Brown, Damon
Publish Date: August 7, 2007 Gordon McComb’s
Gadgeteer’s Goldmine
This great little book See what this new is one of the most
is a concise, all-pur- technology can do for exciting, well-rounded
pose reference fea- you. The Pocket Idiot’s collections of
turing hundreds of Guide to the iPhone is a electronic projects
tables, maps, formu- quick reference guide available anywhere,
las, constants, and that includes trou- featuring experiments
conversions. AND it bleshooting info and in everything from
still fits in your shirt helpful tips for the non- magnetic levitation
pocket! Goes where geeky iPhone owner. This and lasers to high-tech
you go! $12.95 could be helpful for those surveillance and digital
on the fence about pur- communications. $29.95
chasing, as well. $9.95

WE ACCEPT VISA, MC, AMEX, and DISCOVER. Prices do not include shipping and may be subject to change.
September 2007 99
BookstoreSept07.qxd 8/8/2007 7:25 PM Page 100

At t en t ion Subsc r ibe r s ask abou t your discoun t on pr ic es mar ke d wi t h an *

The Nuts & Volts Hobbyist STORE


MICROCONTROLLERS
Programming the PIC Programming and Customizing PIC Microcontroller
Microcontroller with MBASIC the PICAXE Microcontroller Project Book
by Jack Smith by David Lincoln by John Iovine
No microcontroller is Here’s everything you The PIC
of any use without need to harness the microcontroller is
software to make it power of PICAXE, enormously popular
perform useful func- the inexpensive yet both in the US
tions.This compre- versatile chip that’s and abroad.The
hensive reference taken the electronics electronics hobbyist
focuses on designing community by storm. market has become
with Microchip’s mid- This beginner-friendly more sophisticated.
range PIC line using guide from IT pro and This new edition is
MBASIC, a powerful PICAXE expert David fully updated and
but easy to learn pro- Lincoln shows you just revised to include
gramming language. It what Revolution detailed directions on
illustrates MBASIC’s abilities through a Education's PICAXE can do — and using both versions of the microcontroller,
series of design examples, beginning with helps you make it do it! Packed with with no-nonsense recommendations on
simple PIC-based projects and proceeding ready-to-build projects for all the flavors which is better served in different situations.
through more advanced designs. $59.95 of PICAXE. $39.95 $29.95

BACK ROOM BOOK STORE BACK ROOM


BOOK BLOWOUT SPECIAL SPECIAL
Physical Computing PICmicro Microcontroller Pocket
Sale Price $9.65, Reg. $29.99
The computer revolution Reference
has made it easy for by Myke Predko
people with little to no
technical training to use Designed to comple-
a computer for everyday ment Programming &
tasks. But what about Customizing the
more imaginative purpos- PICMICRO, this book
es such as starting your contains a minimum of
car, opening a door, or verbiage and serves as
tracking the contents of an immediate device,
your refrigerator? Physical Computing will code, and circuit lookup
not only change the way you use your for experienced
computer, it will change the way you think PICMICRO applications
about your computer, how you view its designers.
capabilities, how you interact with it, and
how you put it to work for you. It’s time to To open the book of knowledge go to Sale Price $23.95, Reg. $29.95
bridge the gap between the physical and www.nutsvolts.com and click on Only a Few Copies Left
the broader world of computing. store. Peruse your way though our
Only a Few Copies Left great selection of outstanding titles.

PROJECTS
H-racer-and-Hydrogen-station
Magic Box Kit

As seen in our April issue.


With this kit, you now can see and feel We received such great
the future of energy generation in your reviews on this magic box
own hands! Recently named as one of the kit that we decided to
Best Inventions of 2006 by Time Magazine, offer it in our store.
the H-racer is now the best selling fuel This unique DIY construction project blends electronics technology with carefully planned
cell product in the world. For more handcraftsmanship. Its delightful innovation will surely amuse you. More importantly though,
info, go to our online store at it bewilders, baffles, and mystifies those observing this subtle magic trick.
www.nutsvolts.com. $115.00* Subscriber’s Price $39.95 Non-Subscriber’s Price $45.95 Both include an article reprint.

100 September 2007


TechForum.qxd 8/8/2007 6:08 PM Page 101

TECH This is a READER-TO-READER Column.


FORUM
All questions AND answers are submitted by Nuts & Volts readers and are intended to promote the exchange of ideas and provide assistance
for solving problems of a technical nature. Questions are subject to editing and will be published on a space available basis if deemed suitable
by the publisher. Answers are submitted by readers and NO GUARANTEES WHATSOEVER are made by the publisher. The implementation of
any answer printed in this column may require varying degrees of technical experience and should only be attempted by qualified individuals.
Always use common sense and good judgement!

All questions and answers should


be sent by email to forum@nuts

>>> QUESTIONS
volts.com All diagrams should be
computer generated and sent with your recorder (recording on an SD or similar
submission as an attachment. card) that I can trip using a standard
QUESTIONS I am looking for a specific recom- motion detector and which can turn off
To be considered, all questions should relate mendation of hardware and software when the motion detector sees no
to one or more of the following: within the PIC, BASIC Stamp, etc., more movement? I can use a pinhole or
❶ Circuit Design single board microprocessor products similar camera as the video feed so
❷ Electronic Theory that will allow me to trigger (i.e., send the video source is not a problem.
❸ Problem Solving an ASCII string) and then take the Battery operation of the recorder
❹ Other Similar Topics continuous output from an electronic would be a plus.
■ Be brief but include all pertinent informa- gauge via RS-232 and display it on an #09073 Chet Dera
tion. If no one knows what you're asking, you LCD screen. I get overwhelmed with all via email
won't get any response (and we probably the choices of available products. I
won't print it either). would presume to program in some I would like to use an old 12 inch
■ Include your Name, Address, Phone Num-
form of Basic or C (preferably Basic). B&W monitor (RCA connection a Dell
ber, and email. Only your Name, City, and
#09071 Bill Ryder Optiplex computer) to show text
State will be published with the question,
Victoria, MN parameters using this as an EMC CNC
but we may need to contact you.
■ No questions will be accepted that offer controller only.
equipment for sale or equipment wanted to I'm looking for a schematic for a Can I do this? If so
buy. low power wireless switch. Something -- how?
■ Selected questions will be printed one simple, using transistors, with a range of #09074 Jesse Brennan
time on a space available basis. 25-50 feet. Both the transmitter and Austin,TX
■ Questions are subject to editing. receiver should be battery powered
and act as a simple switch. I'm looking for plans to replace an
ANSWERS #09072 John Sutkowski old Dranetz 626 meter (records AC
■ Include in the subject line of your email, Fairfield, CA power spikes, voltage drops, and their
the question number that appears directly pulse widths). I'm hoping someone may
below the question you are responding to. Our club was vandalized several have something that can provide the
■ Payment of $25.00 will be sent if your times in the last month. I need to put a same functionality.
answer is printed. Be sure to include your video camera at the entry way and turn #09075 Jim M.
mailing address or we cannot send payment.
on a video recorder using a motion via email
■ Only your Name, City, and State, will be
detector to record anyone who enters.
printed, unless you say otherwise. If you
A commercial motion detector security I would like to see a design for a
want your email address included, indicate
to that effect. camera with a 12 minute digital video variable frequency drive to operate
■ Comments regarding answers printed in recorder made to look like a clock is single phase 110/220V induction
this column may be printed in the Reader available, but costs $180. motors in the 1/2 to 2 HP range. I
Feedback section if space allows. Does anyone make a cheap digital think this would be of interest
September 2007 101
TechForum.qxd 8/8/2007 4:55 PM Page 102

> > > R E A D E R - TO - R E A D E R Q U E S T I O N S A N D A N S W E R S

to many readers having stationary Another barcode reader tech- seconds that were not performing to
machine tools if it could be built at a nique uses a scanning laser (handheld the tight specs of premium cells. So,
reasonable price. pistol, supermarket checkout counter it’s normal for cells to have wide
#09076 Morty Goldsmith scanner), but this is a complex performance specs, and factory
Quebec, Canada precision mechanism with moving constructed arrays are created from
parts, and likely emits noise, too. selected and matched cells.
I need a four-way directional Have you considered RFID PV cells should not be directly
switch which includes the soft rubber instead of barcodes? There are now connected in parallel. A PV cell will
button cover. I'm wanting something hobby level RFID products from shunt current if it is not illuminated
similar to the D-pad of a game www.parallax.com. The Reader enough to overcome the voltage from
controller. Where can I look for Module might work under the existing other cells in the network. The correct
something like this? train tracks, or could be fashioned into arrangement is to place isolating
#09077 Joe Kissell an adjacent model building or similar. diodes in series with cells that are
via email No contact is required, and the tags connected in parallel.
can be read when the rolling stock is To get higher voltage, cells may be
Is there a way to figure out the not moving. placed in series, and a single diode
pinout of a late model auto radio, out Peter J Stonard placed in that series string before the
of the vehicle, using test equipment Campbell, CA array is placed in parallel with a similar
typically purchased at a yard sale? No array or multiple arrays (i.e., one diode
plug on the back. I want to bench test [#7074 - July 2007] per series string). These are called
the radio to see if it works. I recently bought six solar cells and “blocking diodes.”
started playing with them. I noticed Additional diodes should be
>>> ANSWERS that even though these solar cells are
from the same company and the same
placed across each cell in a series
string. These are called “by-pass
make, they produce different outputs. I diodes.” Dark cells will rob voltage
#09078 Clarence Wilken was wondering if this was normal? from the string (and may be damaged)
Freeport, IL Also, when I connected two cells unless a diode is installed. An
[#7072 - July 2007] together in parallel, if I did not put illuminated cell generates about 500
I would like to read a barcode a diode in series with the cells for mV; useful panels are constructed of
attached to the bottom of a Model each cell, I would get a lower value multiple cells in series (i.e., 36 cells
Railroad Car (HO Scale). This is to than the two cells divided by two produce about 18V when illuminated
sense location on the track. The bar- {(Cell1 + Cell2)/2}. I was not expecting — enough to charge a 12V battery).
code would be read as the car passes this result. For an in-depth discussion, read
over the reader. Multiple readers Do you always need to use a this technical paper: www.windsun
would allow a computer to track train diode in parallel with each cell when .com/PDF/ieee6.pdf
progress on a large layout (14' x 204'). trying to build up the amperage? I The PV cells are not perfect and
The sensor would be similar to a guess it goes without saying that you have internal resistance that causes
wand but with a .75" read range. only need one diode in series with two the terminal voltage to drop under
cells in series for greater voltages. load (as you recorded). A fix for this is
As you already know, the most Background: If you test the cells by to oversize the panel and provide a
simple barcode reader is the LED themselves (open circuit), four of these regulator to feed steady voltage to
reflective wand. This requires the oper- solar cells are producing 15 to 17 VDC your load (the fans). A large capacitor
ator’s hand movement to provide the with two only producing eight volts. might help, but a better solution is a
scanning action, and also may require The short circuit current is .100 amps storage battery, which would be
contact with the barcode label. to .140 amps. charged by the panels during full sun-
It’s possible to modify a wand to Also, could you explain how to light and discharged by the fans during
project the beam and avoid contact, choose a solar cell for a project? I shade or at night. To protect the fans,
using a relay lens. Experimental and understand if I am running 4X 12V fans use a linear regulator (LM7812 or
inexpensive lenses can be found in at 100 mA, I would add up the similar) to derive 12V from the varying
surplus catalogs or here (www.sur total amps: 400 mA for the project. PV panel voltage, and to protect the
plusshed.com/pages/category/lenses But what I am seeing from my meter is battery from over-discharge, consider
_1.html). my voltage drop is a lot lower than a low voltage cut-out circuit.
A problem with this method is what I would expect for a parallel Peter J. Stonard
that the rolling stock must be moving circuit. Do I need to add a capacitor Campbell, CA
through the beam for it to register. or something?
Also, the multiple visible red lights [#7076 - July 2007]
might distract from the aesthetics of Depending upon where you got I can purchase a DC motor speed
the model railroad layout. your PV cells, they may be factory controller for a 1.5 HP motor for my
102 September 2007
TechForum.qxd 8/8/2007 7:45 PM Page 103

> > > R E A D E R - TO - R E A D E R Q U E S T I O N S A N D A N S W E R S

Bridgeport mill, or an inverter duty AC hence can operate over very wide reductions and high current, the
motor and controller, too. What ranges from 10 or so RPM to 5-8K fan may not be running fast enough to
are the advantages to both of these RPM. DC controllers that chop recti- cool the motor.
setups and why were they made in fied 60 Hz will necessarily give very In regards to 3ph AC/VFD, if your
the first place? poor results at low speed because the OEM motor is 3ph and 220-440V
pulses are so coarse and marked rated, it will work great as-is with a
DC motors seem to be losing cogging will occur below the low to 220V single phase VFD. Inverter rated
favor in the face of 3ph + VFD mid 100s RPM motor speed. motors are specially insulated to with-
conversions which are generally By increasing the pulse rate stand high voltage pulses that 440V
cheaper and easier to install. and using feedback from current draw, VFDs generate, and this is not a prob-
Bridgeport type OEM motors have a the motor can be smoothed out lem with 220V VFD.
somewhat uncommon motor mount significantly and operate with good The same speed limit exists:
and adapters must be made to torque at lower speeds. PWM drivers Although any VFD worth its cost
accomodate replacements; especially operating above 5 kHz will have (generally much cheaper than an
DC where the motor is more likely to imperceptible cogging at low speeds. equivalent DC drive new) can easily
have an atypical form factor. Since Bridgeport spindles are drive a motor up to 100 Hz, it is not a
A Google on Bridgeport motor designed for the 2,500-4,500 speed good idea to operate the machine tool
mount adapters brings up several range from 1,200-1,800 RPM AC more than 25% above its rated max
articles on this, as well as an adapter motors, higher motor speed than spindle speed. VFDs operate at 10-17
for a base mount (non-face mount) 2,000 or so is not needed. Since kHz switching speed, so cogging is
motor. DC motors have some power output of any motor is never a problem, but as you lower the
theoretical advantages if the controller speed-dependent, a 1 HP DC motor at speed, the motor effective power
is designed to exploit them. See 4,000 RPM will put out 0.5 HP at output goes down proportionately.
the discussion at www.truetex.com/ 2,000 RPM. Practically, this means not going
dcdrv.htm. DC motors do not have A DC motor should be TEFC and below 20 Hz.
a fixed speed; speed is entirely industrially rated with awareness Steven Hodges
controlled by the applied voltage and that operated at substantial speed Birmingham, AL

September 2007 103


InTheSpotlight.qxd 8/7/2007 10:38 AM Page 104

An Interview with Mike Leo


Vice President of Operations, Ramsey Electronics
by Marvin Mallon

R
amsey Electronics is a leading and since 1994, it has been published product we’ve ever released is also
distributor of sophisticated in full four-color offset. one of our more recent. It’s our UP24
devices for both the hobbyist In 2000, Mr. Ramsey retired from pressure sensor, and we’re really
and the electronic experimenter. the business for some long deserved proud of it. It can measure elevations
Located just south of Rochester, NY, relaxation. Today, the company is to accuracies of a third of an inch! It’s
they serve this market both by catalog privately owned and operated by the proven to be extremely popular not
as well as online sales. The business key management team that helped only for the hobbyist but for land
was started in the early ‘70s by John make it successful over the past surveyors and other professionals. It’s
Ramsey while he was attending college. several decades. Mike Leo is the also one of the most complex kits we
As a youngster, he was always current Vice-President of Operations. have brought to the hobbyist. When
interested in electronics, and built a When interviewed for this column, he they get done putting one of these
number of Heath kits and Knight-Kits. replied to the following questions: together, they’ll know all there is
Taking note of the interest in this type of to know about SMT (surface mount
products, he began selling digital clock Marvin: Mike, what is your previous technology) and a lot more about the
kits and LED “blinky” kits. Both history and experience in the electron- latest techniques.
technologies were new to the hobby. ics field? How far back does that go?
He knew it was necessary to provide Mike: I go back to ninth grade when I MM: Finally, what can you tell us
more than just a bag of parts and built my first five-tube superhet AM about the business today?
assembly instructions, so each of his kits radio kit! From there, it was the Knight- ML: In regard to hobby kits, a lot has
included the complete theory of opera- Kit Star Roamer SWL receiver and gone on over the past few years. We
tion, as well as circuit applications. even the Heathkit color TV. I will have seen through-hole components
Customers took note that when never forget the absolute thrill I had become less and less available as SMT
they built a Ramsey Kit they not only when I first turned those kits on and components replace them. That is a
ended up with a working product, but they worked. It’s the same thrill we major change for the hobbyist. You
also learned the entire circuit theory always try to insure for all our simply can’t use the Weller soldering
and all of its applications. When customers with our hobby kits. If we gun I used back in the ninth grade.
Heath and Knight-Kit closed their have done that, we have succeeded! We saw this coming early on and
doors in the mid ‘80s, Ramsey kit sales started provided SMT training kits and
skyrocketed. Hobbyists everywhere MM: How large are the Ramsey soldering guides right away. Today,
looked forward to the next edition facilities? How many employees do that soldering gun is replaced with a
of the “Ramsey Catalog” to see you have? miniature soldering station, tweezers,
what neat new products were ML: We have an 11,000 square foot and a magnifying glass.
available. The catalog — originally facility that handles all of our Just like the early digital clock and
eight pages in black and white — operations from design engineering to LED Blinky, it’s just new technology,
changed to spot color in the late ‘80s, shipping. From the original digital and we will continue to provide
clock and LED Blinky Kits of the ‘70s, whatever is necessary for the hobbyist
our product line has expanded to the to learn and understand it. We
point where we now carry over 200 are known for unique products and
manufactured kits and products. We unsurpassed customer support. It is our
currently have 20 plus employees, goal to continue that legacy regardless
some of whom have been with us for of technology changes. NV
more than two decades.
590 Fishers Station Dr.
MM: What would you say is your most Victor, NY 14564
popular product today? Tel: 800-446-2295
Tech Support. ML: Actually, the most popular hobby Web: www.ramseykits.com
104 September 2007
IndexSep07.qxd 8/8/2007 8:54 PM Page 105

■ LOOK FOR

AMATEUR
■ SEARCH FOR
Find your favorite advertisers here!
■ FIND

XGameStation ......................................31
MOTORS
AD INDEX Abacom Technologies ...............25
RADIO AND TV Jameco ................................................27 ActiveWire, Inc. .........................31
Atomic Time .........................................64
DESIGN/ All Electronics Corp. ..................67
PolarisUSA Video, Inc.............................9 ENGINEERING/ OPTICS AP Circuits ................................65
Ramsey Electronics, Inc. ................18-19 REPAIR SERVICES Madell Technology ...............................87 Atomic Time ..............................64
Cam Expert, LLC .................................31 Budget Robotics ........................94
BATTERIES/ Efficient Computer Systems ................40 PROGRAMMERS Cam Expert, LLC .......................31
CHARGERS ExpressPCB .........................................34 Electronics 123 ....................................31
microEngineering Labs .........................87
Circuit Specialists, Inc. .....106-107
Front Panel Express LLC ......................95
Cunard Associates ...............................31 Comfile Technology ..................26
IMET Corporation .................................26

BUYING ELECTRONIC PCB Cart ..............................................26 PUBLICATIONS Command Productions ..............51


CrustCrawler .............................77
Lakeview Research ..............................31
SURPLUS PCB Pool .............................................94
Pulsar, Inc. ...........................................31
Cunard Associates ....................31
DesignNotes.com, Inc. ...............26
Earth Computer Technologies ..............31
Jaycar Electronics .................................45
R4Systems, Inc. ....................................79 RF TRANSMITTERS/ Dimension Engineering ..............65
Trace Systems, Inc. .............................95 RECEIVERS Earth Computer Technologies ...31

CCD CAMERAS/ DISPLAY


Abacom Technologies .........................25
Linx Technologies ................................33
Efficient Computer Systems .....40

VIDEO Comfile Technology .............................26 Matco, Inc. ...........................................31


Electronic Design Specialists ....93
Electronics 123 ..........................31
Circuit Specialists, Inc. ................106-107
Electronix Express ....................87
Matco, Inc. ...........................................31 EDUCATION ROBOTICS EMAC, Inc. ................................85
PolarisUSA Video, Inc.............................9 Command Productions ........................51
Budget Robotics ...................................94 ExpressPCB ..............................34
Ramsey Electronics, Inc. ................18-19 EMAC, Inc. ...........................................85
CrustCrawler ........................................77 Front Panel Express LLC ...........95
Hobby Engineering ..............................70
CIRCUIT BOARDS
Efficient Computer Systems ................40 Hagstrom Electronics ................30
Ortech Education Systems ..................51 Hobby Engineering ..............................70 Hobby Engineering ....................70
AP Circuits ...........................................65 PAiA .....................................................56 HobbyLab .............................................31 HobbyLab ..................................31
Comfile Technology .............................26 Schmart Board .............................31, 103 Jameco ................................................27 IMET Corporation ......................26
Cunard Associates ...............................31 Silver Circuits .......................................86 LabJack ................................................86 Information Unlimited ................95
Dimension Engineering .........................65 Lemos International Co., Inc. .................6
XGameStation ......................................31 Integrated Ideas & Tech. ...........65
ExpressPCB .........................................34 Lynxmotion, Inc. ...................................56
Jameco ......................................27
IMET Corporation .................................26 EMBEDDED TOOLS Net Media ...............................................2
Jaycar Electronics ......................45
PCB Cart ..............................................26 Mouser Electronics ..............................17 Ortech Education Systems ..................51
LabJack .....................................86
PCB Pool .............................................94 NetBurner ...............................................7 Pololu Robotics & Electronics ..............44
Lakeview Research ...................31
Pulsar, Inc. ...........................................31 Robo Development 2007 .....................78
Lemos International Co., Inc. ......6
R4Systems, Inc. ....................................79 ENCLOSURES Robot Power ........................................79
Link Instruments ..........................5
Saelig Company, Inc. ............................57 Integrated Ideas & Tech. ......................65 Silver Circuits .......................................86
Schmart Board .............................31, 103 Linx Technologies .....................33
Silver Circuits .......................................86 EVENT SATELLITE
Lynxmotion, Inc. ........................56
Madell Technology ....................87
Robo Development 2007 .....................78 Lemos International Co., Inc. .................6
COMPONENTS Matco, Inc. .................................31
Cam Expert, LLC .................................31 KEYBOARD SECURITY
MCM ....................................12, 94
Electronix Express ...............................87 EMULATORS Information Unlimited ...........................95
Microchip ...................................13
Front Panel Express LLC ......................95 Hagstrom Electronics ...........................30 microEngineering Labs ..............87
Linx Technologies ................................33
Jameco ................................................27 Mouser Electronics ....................17
Matco, Inc. ...........................................31
Lemos International Co., Inc. .................6 KITS & PLANS PolarisUSA Video, Inc.............................9
NetBurner ....................................7
Linx Technologies ................................33 DesignNotes.com, Inc. ..........................26 Net Media ....................................2
Mouser Electronics ..............................17 Earth Computer Technologies ..............31 Ortech Education Systems ........51
Pulsar, Inc. ...........................................31 Electronics 123 ....................................31
TEST EQUIPMENT Parallax, Inc. ...............Back Cover
Circuit Specialists, Inc. ................106-107 PAiA ..........................................56
EMAC, Inc. ...........................................85
COMPUTER Hobby Engineering ..............................70
DesignNotes.com, Inc. ..........................26
PCB Cart ...................................26
Hardware Dimension Engineering .........................65
Information Unlimited ...........................95 PCB Pool ...................................94
Electronic Design Specialists ...............93
ActiveWire, Inc. ....................................31 Jaycar Electronics .................................45 Pico Technology Ltd. UK ...........86
HobbyLab .............................................31
Earth Computer Technologies ..............31 NetBurner ...............................................7 Pioneer Hills Software ...............56
Jaycar Electronics .................................45
PAiA .....................................................56 PolarisUSA Video, Inc..................9
LabJack ................................................86
Microcontrollers / I/O Boards QKITS ...................................................31 Pololu Robotics & Electronics ...44
Link Instruments .....................................5
Abacom Technologies .........................25 RABBIT Semiconductor ..........................3 Pulsar, Inc. ................................31
Madell Technology ...............................87
Comfile Technology .............................26 Ramsey Electronics, Inc. ................18-19 QKITS ........................................31
Pico Technology Ltd. UK .....................86
EMAC, Inc. ...........................................85 Scott Edwards Electronics, Inc. .............79 R4Systems, Inc. .........................79
Pioneer Hills Software ..........................56
Efficient Computer Systems ................40 XGameStation ......................................31 RABBIT Semiconductor ...............3
Saelig Company, Inc. ............................57
HobbyLab .............................................31 Ramsey Electronics, Inc. .....18-19
Microchip ..............................................13 LASERS Trace Systems, Inc. .............................95
Renesas Technology Corp. .......35
microEngineering Labs .........................87 Information Unlimited ...........................95
Mouser Electronics ..............................17 TOOLS Robo Development 2007 ..........78

Net Media ...............................................2 LSI (micon) Madell Technology ...............................87


Robot Power .............................79
Saelig Company, Inc. ................57
Ortech Education Systems ..................51 Renesas Technology Corp. .................35 NetBurner ...............................................7
Schmart Board ..................31, 103
Parallax, Inc. ..........................Back Cover
Pololu Robotics & Electronics ..............44 MISC./SURPLUS WIRE, CABLE Scott Edwards Electronics, Inc. ..79
Silver Circuits ............................86
R4Systems, Inc. ....................................79 All Electronics Corp. .............................67 AND CONNECTORS Trace Systems, Inc. ..................95
Scott Edwards Electronics, Inc. .............79 Front Panel Express LLC ......................95 DesignNotes.com, Inc. ..........................26
XGameStation ...........................31
Trace Systems, Inc. .............................95 MCM ..............................................12, 94 Jameco ................................................27

September 2007 105


Full Page.qxd 8/8/2007 3:26 PM Page 106

C i rcuitSpecialists.com C i rcuitSpecialists.com C i rcuitSpecialists.com

Our Premium All in One Repairing System Programmable DC Power Supplies


•All in One system. Combines the function of a Hot Air Gun, a Soldering Iron and The CSI 3600 Series
a Desoldering Gun. Programmable DC Power
•Microprocessor controlled ESD safe unit. All digital display of hot air temperature, Supplies are equipped with a
soldering iron temperature, desoldering back-lit LCD display, number
gun temperature and air pressure with
keypad and a rotary code
touch type panel controls.
•The desoldering tool comes with zero switch for ease of use & quick
crossing circuitry preventing electrical programming. Voltage, Current & Power can all be displayed on the LCD
surges and is equipped with air cylinder or computer screen (with optional RS-232 interface module). It can be
type strong suction vacuum pump. operated at constant current mode, constant voltage mode & constant
•The 24V soldering iron is compatible with power mode. It also can be set with maximum limits for current & power
the compound tip design by connecting the output. Ideal instruments for scientific research, educational labs or any
ceramic heater, sensor, control unit and tip application requiring a sophisticated DC-power source.
as one. Designed for efficiency.
Replacement of tips with easy slip in/out Model CSI3644A CSI3645A CSI3646A
method.
DC Voltage 0-18V 0-36V 0-72V
Only
•Compatible with various type of air nozzles.
•Compatible with different kinds of tips.
Item# $199.00
DC Current 5A 3A 1.5A
•Full compliment of nozzles & tips are available. CSI-9000 Power (max) 90W 108W 108W
Each!
•Use with lead-free or standard solder.
Only $249.00 Details at Web Site > Test Equipment > Power Supplies
> Soldering Equipment & Supplies > Soldering Stations

20MHz 2Ch Analog


www.CircuitSpecialists.com Oscilloscope w/Component Tester
•2 channels 2 traces
Circuit Specialists Soldering Station •20MHz Bandwidth
w/Ceramic Element & $34.95! •Z axis (intensity modulation)
•TV video sync filter
Seperate Solder Stand •Component test function
•Ceramic heating element for more •Vertical Deflection Operating
accurate temp control Mode: CH A, CH B, DUAL, ADD
•Temp control knob in F(392° to 896°) & •Sensitivity: 5mV-20V/div NEW !
C(200° to 489°) •Bandwidth: DC: DC-20MHz / AC: 10Hz-20MHz
•3-prong grounded power cord/static safe tip In Business •Horizontal Deflection Sweep Mode: AUTO, NORM
•Seperate heavy duty iron stand •Sweep Time: 0.2us-0.5s/div
•Replaceable iron/easy disconnect Item#
•Extra tips etc. shown at web site Rapid Heat Up! Details at Web Site
CSI-STA
CSI-STATION1A > Test Equipment > Oscilloscopes/Outstanding Prices
Also Available w/Digital Display PROTEK 3502C: $359.00
SMD Hot Tweezer
& MicroProcessor Controller Adaptor Fits
Fits CSI
Stations 1A & 2A,
2A, ESD Safe CPU Controlled SMD
$49.95 and CSI906
Since 1971 Hot Air Rework Station
Item# $29.00 The heater and air control system are built-in and
CSI-STA
CSI-STATION2A Item# adjusted by the simple touch of the front keypad
for precise settings.
Details at Web Site CSITWZ-STA
CSITWZ-STATION Temperature range is
> Soldering Equipment & Supplies > Soldering Stations from 100°C to 480°C /
212°F to 896°F, and
Digital LCR Meter w/GPIB Interface the entire unit will
•Measurement Rate: Slow, Medium, Fast: 2,10 or 20 enter a temperature
•Basic Accuracy of 0.05% drop state after 15
•Stores up to 9 setups in memory $1499.00! minutes of non-use for
•Equivalent Circuit: Series or Parallel safety and to elimi-
•Measurement Modes: Auto, R+Q, L+Q, C+D, C+R NEW ! nate excessive wear.
•Remote over RS-232C & GPIB/Handler Interface
•Parameters Displayed: Value, Deviation, %Deviation
Item#
•CPU Controlled
or Bin Number. Item# •Built-in Vacuum System CSI825A++
•Test Frequencys: 100Hz, 120Hz, 1kHz, 10kHz, 100kHz PROTEK 9216A •Temperature Range:100°C to 480°C / 212°F to 896°F
Details at Web Site > Test Equipment > Specialty Test Equipment •15-Minute Stand-By temperature "sleep" mode
•Power:110/120 VAC, 320 W maximum

Dual Output DC Bench Power Supplies Details at Web Site


Sale
$149.00!
High stability digital read-out bench power supplies > Soldering Equipment & Supplies
featuring constant voltage and current outputs. Short- As Low As
circuit and current limiting protection is provided. SMT $99.50!
PC boards and a built-in cooling fan help ensure reli- Triple Output Bench Power Supplies
able performance and long life. with Large LCD Displays
•Source Effect: 5x10-4=2mV •Output: 0-30VDC x 2 @ 3 or 5 Amps
•Load Effect: 5x10-4=2mV HOT & 1ea. fixed output @ 5VDC@3A
•Ripple Coefficient:: <250uV ITEM! •Source Effect: 5x10-4=2mV
•Stepped Current: 30mA +/- 1mA •Load Effect: 5x10-4=2mV
•Ripple Coefficient: <250uV
*All 3 Models have a 1A/5VDC Fixed Output on the rear panel*
panel* •Stepped Current: 30mA +/- 1mA
CSI3003X-5:
CSI3003X-5 0-30v/0-3amp 1-4: $105.95 5+: $99.50 •Input Voltage: 110VAC
CSI5003X5:
CSI5003X5 0-50v/0-3amp 1-4: $114.95
$114.95 5+: $109.00 CSI3003X3:
CSI3003X3 0-30VDCx2 @3A $188.00 5+: $183.00
CSI3005X5:
CSI3005X5 0-30v/0-5amp 1-4: $119.00
$119.00 5+: $114.00
$114.00 CSI3005XIII:
CSI3005XIII 0-30VDCx2 @5A $239.00 5+: $229.00
Details at Web Site > Test Equipment > Power Supplies Details at Web Site > Test Equipment > Power Supplies

C i r c u i t S p e c i a l i s t s , I n c . 2 2 0 S . C o u n t r y C l u b D r. , M e s a , A Z 8 5 2 1 0
8 0 0 - 5 2 8 - 1 4 1 7 / 4 8 0 - 4 6 4 - 2 4 8 5 / FA X : 4 8 0 - 4 6 4 - 5 8 2 4
CoverInside.qxd 8/8/2007 3:22 PM Page 2

C i rcuitSpecialists.com Ci rcuitSpecialists.com Ci rcuitSpecialists.com

Stepper Motors
2 & 4 Channel GDS-2000 Series Digital Part #: Motor Frame
Size:
Holding Torque: Price:

Storage Oscilloscopes w/TFT Color Displays 42BYGH404 NEMA 17 3.4kg.cm/47oz.in $17.95


57BYGH207 NEMA 23 8kg.cm/111oz.in $24.95
57BYGH303 NEMA 23 15kg.cm/208oz.in $29.95
57BYGH405 NEMA 23 20kg.cm/277oz.in $34.95
•200/100/60 MHz Bandwidth
85BYGH350B-03 NEMA 34 48kg.in/665oz.in $79.95
•2 or 4 Input Channels
85BYGH350C-03 NEMA 34 63kg.cm/874oz.in $119.95
•1 GS/s Real Time Sampling Rate &
25 GS/s Equivalent-Time Sampling Stepper Motor Controllers: 2 Phase Microstepping
•25 kpoints Record Length Maximum Stepper Motor Driver (Bi-polar & Unipolar Motors)
•Large 5.6-in TFT Color Display
Part #: Dimensions: MicroStep: Price:
•FFT Function 1(200), 1/2(400), 1/4(800),
XCW220 100mm x 61mm $39.95
•Standard USB Host and Device x 19mm 1/8(1600)
Interface; Optional GPIB CW220 99mm x 65mm 1/2(400), 1/8(1600) $49.95
•Optional DC Power (Factory x 30mm
Installed) CW230 115mm x 72mm 1(200), 1/2(400), 1/4(800), $59.95
•Auto-Level, AUTO, NORMAL, SINGLE,
NEW ! x 32mm 1/8(1600), 1/16(3200),
1/32(6400), 1/64(12800)
TV, Edge, Pulse Width Time-delay(2CH Only), CW250 140mm x 94mm 1(200), 1/2(400), 1/8(1600) $69.95
Event-delay(2CH Only) x 45mm
CW860 147mm x 97mm 1(200), 1/2(400), 1/4(800), $119.95
GDS-2062 60MHz, 2Ch DSO $890.00 x 30mm 1/8(1600), 1/16(3200),
1/32(6400), 1/64(12800),
GDS-2064 60MHz, 4Ch DSO $1210.00 128(25600), 1/5(1000),
GDS-2102 100MHz, 2Ch DSO $1160.00 1/10(2000), 1/25(5000),
1/50(10000), 1/125(25000),
GDS-2104 100MHz, 4Ch DSO $1470.00 1/250(50000)

GDS-2202 200MHz, 2Ch DSO $1470.00


GDS-2204 200MHz, 4Ch DSO $1800.00
Focused Infrared Soldering System
Details at Web Site > Test Equipment > Instek Test Equipment
The CSI-IR1 is a modular and
flexible infrared technology sol-
Digital Storage Oscilloscope Module dering system for effective high
yield rework of even the most
Convert any PC with USB interface to a high advanced packages, as well as
performance Digital Storage Oscilloscope. This being suitable for lead or lead-
is a sophisticated PC basedscope adaptor pro- free solder. It brings sophisticat-
viding performance compatible to mid/high ed rework systems to the sim-
level stand alone products costing much more! plicity of a handtool and can be
Comes with two probes. used widely for reworking BGAs, micro-BGAs, QFPs,
Price PLCCs, SOICs and small SMDs.
Detai ls & S oftwar
oftware
e Breakthrough! New Lower Price
New Lower Price
Download at WebWeb Si te $1399.00
Details
Details at Web
Web Site
Site
> Test Equipment > Oscilloscopes/Outstanding Prices > Soldering Equipment & Supplies Item# CSI-IR1
PC based Digital
Digital Storage
Storage
Oscilloscope, 200MHz 5GS/s
equiv.
Item# 200DSO Only$819.00 Soldering Station w/Iron &
equiv. sampling USB interface
SMD Hot Tweezers
•Electrostatic discharge safe
3-1/2 Digit LCD Panel Meter design with grounding measure
(enhanced version) •Tweezers directly applies heat
The PM-128E is an enhanced version of to components being repaired
our best selling PM-128A. The E version while avoiding nearby
can be set to work with either a 5VDC or components
9VDC power source, will perform with
either a common ground or an isoalted •Suitable for crowded circuit
ground, and is supplied with easy to use boards
jumper points so the end user can easily •24V output voltage to ensure
set the measurement range required. $12.25 Item# safety of user and protect soldered components on board
Quantity PM-128E
Details
Details at Web
Web Site
Site Price Breaks Item# CSI-950+ $59.00
Details
Details at Web
Web Site
Site
> Panel Meters > Digital Panel Meters at website!
A dd i t i o n a l > Soldering Equipment & Supplies > Soldering Stations

Pa n e l M e t e r s
Jumbo LCD 9V Independent 3-1/2 Digit LED Panel Meter
Ground Panel Meter o n We b S i t e ! w/5V Common Ground
The PM-1028A is designed to run off of a The CX-102 series of digital panel meters
9V (7-11V) independent power source. have high reliability, good quality and fine
The figure height is 21mm. High quality workmanship. They can be used for a
SMT construction provides high reliability variety of applications and are competi-
and the decimal point selection is conve- tively priced. Their unmatched perform-
niently done by wire jumpers. The panel ance make these 3-1/2 digit LED panel
meter implements dual slope integration meters the first choice for applications that require
A-D conversion measuring methods. Item# $12.95 instrumentation. $14.95
Quantity Item# Quantity
Details
Details at Web
Web Site
Site PM-1028A Price Breaks Details
Details at Web
Web Site
Site CX102B Price Breaks
> Panel Meters > Digital Panel Meters at website! at website!
> Panel Meters > Digital Panel Meters

C i r c u i t S p e c i a l i s t s , I n c . 2 2 0 S . C o u n t r y C l u b D r. , M e s a , A Z 8 5 2 1 0
8 0 0 - 5 2 8 - 1 4 1 7 / 4 8 0 - 4 6 4 - 2 4 8 5 / FA X : 4 8 0 - 4 6 4 - 5 8 2 4
$7.00
0 9>

3
CANADA

74470 89295
$5.50
U.S.

0
Vol. 28 No. 9 NUTS & VOLTS KEEP COMPONENTS COOL • VOLTAGE REFERENCE • INCHWORM ROBOT September 2007
Page 108
8:22 PM
8/8/2007
Cover.qxd

You might also like