0% found this document useful (0 votes)
11 views100 pages

Nuts and Volts 2008-08

The August 2008 issue of Nuts & Volts features articles on various electronics projects, including a model train switch control system and an audio spectrum analyzer. It also discusses new technologies such as memristors, which are being developed for applications in computing and robotics. The magazine includes sections on reader feedback, new products, and technical knowledge for electronics enthusiasts.

Uploaded by

Carlos Gilberto
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
0% found this document useful (0 votes)
11 views100 pages

Nuts and Volts 2008-08

The August 2008 issue of Nuts & Volts features articles on various electronics projects, including a model train switch control system and an audio spectrum analyzer. It also discusses new technologies such as memristors, which are being developed for applications in computing and robotics. The magazine includes sections on reader feedback, new products, and technical knowledge for electronics enthusiasts.

Uploaded by

Carlos Gilberto
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/ 100

Page 1

$7.00
0 8>
7:45 PM

3
CANADA

74470 89295
7/9/2008

$5.50
U.S.
Cover.qxd

0
Vol. 29 No. 8 NUTS & VOLTS PRIUS HACK • AUDIO SPECTRUM ANALYZER • MODEL TRAIN CONTROLLER August 2008
Full Page.qxd 12/4/2007 4:26 PM Page 2
Full Page.qxd 6/2/2008 11:31 AM Page 3

Free
Book
with Kit
Full Page.qxd 7/7/2008 2:24 PM Page 4

USB Mixed Signal Oscilloscope


Inventing the future requires a lot of test gear...
Analog + Digital ...or a BitScope
Digital Storage Oscilloscope


Dual Channel Digital Scope with industry
standard probes or POD connected analog
inputs. Fully opto-isolated.

Mixed Signal Oscilloscope


Capture and display analog and logic signals
together with sophisticated cross-triggers for
precise analog/logic timing.

Multi-Band Spectrum Analyzer


Display analog waveforms and their spectra
simultaneously. Base-band or RF displays with
variable bandwidth control.

Multi-Channel Logic Analyzer


Eight logic/trigger channels with event capture
to 25nS. BS100U Mixed Signal Storage Scope & Analyzer
Innovations in modern electronics engineering are leading the new wave of
DSP Waveform Generator
inventions that promise clean and energy efficient technologies that will

Optional flash programmable DSP based function
generator. Operates concurrently with waveform change the way we live.
and logic capture. It's a sophisticated world mixing digital logic, complex analog signals and
Mixed Signal Data Recorder high speed events. To make sense of it all you need to see exactly what's


Record to disk anything BitScope can capture. going on in real-time.
Supports on-screen waveform replay and export.
BS100U combines analog and digital capture and analysis in one cost
User Programmable Tools and Drivers effective test and measurement package to give you the tools you need to


Use supplied drivers and interfaces to build navigate this exciting new frontier.
custom test and measurement and data
acquisition solutions.

Standard 1M/20pF BNC inputs Smart POD Connector Opto-isolated USB 2.0 12VDC with low power modes

BitScope DSO Software for Windows and Linux


BS100U includes BitScope DSO the fast and
intuitive multichannel test and measurement
software for your PC or notebook.
Capture deep buffer one-shots, display waveforms
and spectra real-time or capture mixed signal data
to disk. Comprehensive integration means you can
view analog and logic signals in many different
ways all at the click of a button.
The software may also be used stand-alone to
share data with colleagues, students or customers.
Waveforms may be exported as portable image
files or live captures replayed on another PC as if a
BS100U was locally connected.

www.bitscope.com
Full Page.qxd 3/5/2008 12:22 PM Page 5

SERIAL TO ETHERNET SOLUTIONS


Simple Ethernet connectivity
for serial devices
Works out of the box -
no programming is required
Device P/N: SB70-100CR Customize to suit any
Kit P/N: NNDK-SB70-KIT
application with low-cost

$69 SB70 development kit

2-port serial-to-Ethernet server Features:


Qty. 100
with TTL support 10/100 Ethernet
TCP/UDP mode
DHCP/Static IP Support
Data rates up to 921.6kbps
Web-based configuration

Need a custom solution?


NetBurner Serial to Ethernet
Development Kits are available
Device P/N: SB72-EX-100CR to customize any aspect of
Kit P/N: NNDK-SB72EX-KIT operation including web pages,

SB72EX $139
data filtering, or custom network
applications. All kits include
2-port serial-to-Ethernet server platform hardware, ANSI C/C++
Qty. 100 compiler, TCP/IP stack, web server,
with RS-232 & RS-485/422 support
e-mail protocols, RTOS, flash file
system, Eclipse IDE, debugger,
cables and power supply.

Device P/N: PK70EX-232CR


Kit P/N: NNDK-PK70EX232-KIT
Information and Sales | sales@netburner.com
Web | www.netburner.com

$269 PK70EX232 Telephone | 1-800-695-6828

4-port serial-to-Ethernet server


Qty. 100
with RS-232 support
TOC Aug08.qxd 7/9/2008 4:21 PM Page 6

AU G U S T 2 0 0 8 w w w. n u t s v o l t s. c o m

Projects
38 MODEL TRAIN SWITCH CONTROL
VIA PC OR PIC
Either version of this control system
can easily replace your old manual
controllers, plus the circuits are
versatile enough to use in other
applications.
■ By Dan Gravatt Page 38
● ● ● ● Advanced Level

44 AUDIO SPECTRUM
ANALYZER
The device described here is a
configurable audio spectrum
analyzer incorporating FFTs
and a graphical LCD. You’ll also
be able to vew audio signals
up to approximately 20 kHz.
(And who doesn’t need that?)
■ By Larry Cicchinelli

● ● ● ● Advanced Level
Page 44

Departments
Be sure to check the Nuts & Volts website
08 DEVELOPING 66 ELECTRO-NET for downloads that go along with these projects.
PERSPECTIVES 86 CLASSIFIEDS
10 READER FEEDBACK 88 NV WEBSTORE
34 NEW PRODUCTS 94 TECH FORUM
36 SHOWCASE 97 AD INDEX

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 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; cpcreturns@nutsvolts.com.

6 August 2008
TOC Aug08.qxd 7/9/2008 7:50 PM Page 7

Features
52 HOW TO USE THE PUSHBUTTON
ROTARY ENCODER
Learn how using a pushbutton rotary
encoder can help you design and build
better, more user-friendly
microcontroller projects.
■ By Jack Botner

56 HACKING THE PRIUS WITH


MATRIX MULTIMEDIA’S E-BLOCKS
Page 52 AND FLOWCODE
Read how this very satisfied customer
Page 68 used some ingenuity along with
E-blocks and Flowcode, and got
up to 100 mpg.
■ By Jim Fell

61 SMILEY’S WORKSHOP:
AN AVR C PROGRAMMING SERIES
This new series of workshops will
introduce C programming for the
AVR microcontroller.
■ By Joe Pardue

12 TECHKNOWLEDGEY
Columns 68 PERSONAL
2008 ROBOTICS
Events, Advances, and News Understanding, Designing &
Topics covered include Constructing Robots
a flying saucer, a DORKBOT: People doing
computer inside a pen, weird things with
another win for the electricity.
good guys, plus other
interesting stuff. 76 OPEN
COMMUNICATION
Page 16 16 PICAXE PRIMER The Latest in Networking
Sharpening Your Tools of and Wireless Technologies
Creativity Ten things you may not
Getting started with know about Bluetooth.
the PICAXE-28X1
microcontroller. 79 THE DESIGN CYCLE
Advanced Techniques for
26 Q&A Design Engineers
Reader Questions Answered Up the logic food chain.
Here
Fly zapper, vacuum tube
circuit, solar tracker,
more.

August 2008 7
DevPerspectives.qxd 7/8/2008 3:34 PM Page 8

by Bryan Bergeron, Editor


DEVELOPING
PERSPECTIVES
Memristors — might be used in communications, Apparently, scientists at HP have
Rethinking the computing, robotics, and been working with memristors for
entertainment? some time now.
Fundamentals In 1971, Leon Chau of UC According to Chau’s
Berkley did more than wishful publications, press releases from HP,

E very electronics enthusiast and


engineer is familiar with the
fundamental passive circuit elements
thinking and postulated a fourth
element: the memristor [1]. The
theoretical device — which some
and patent applications, a memristor
behaves like a non-linear resistor
with memory — a behavior due to
— resistors, capacitors, and inductors. engineers have termed the ‘missing hysteresis. Electrical hysteresis is
With these elements, a source of element’ — could remember the commonly associated with
power, and a few transistors, diodes, changes in current passing through it ferromagnetic materials, as depicted
or other active elements, it’s possible by changing its resistance. What’s by the double-s-shaped hysteresis
to create just about every electronics remarkable about Chau’s mathemati- loop. While hysteresis is often an
device imaginable. Or perhaps not. cal postulate is that this past May, annoyance in magnetic tape and
What if our perception of what’s researchers at HP Labs, Palo Alto, hard drive circuitry, it has many
possible is limited by the nature of announced they had actually practical applications in electronics.
these basic elements? What could developed memristors. And, as The use of a Schmitt trigger to
you create if you had additional expected, several patents assigned to eliminate contact bounce in switches
elements to work with? Can you HP dealing with memristors suddenly is one practical application of
imagine a new element, and how it appeared on the USPTO website. hysteresis.

Metal Fabrication
Quality prototype parts within 24 hours!!
Materials from 0.001” to 6.000” in
thickness.

Parts from practically any material.

Finishes such as powder coat, paint,


plating, anodizing, silk screen, and
more!

Every job is an extension of IIT. We


meet and exceed the quality and
service expectations of our clients on a
consistent basis. Contact sales at
(208) 665-2166 or visit
www.iitmetalfab.com today!

* Quick Complete Fabrication Center


* Affordable Integrated Ideas & Technologies, Inc.
Precision Laser, Waterjet, Plasma, Machining,
* Precise Micro-Machining, Forming, and Welding
* No Minimums Capabilities
24 hour turn time based on quantity and finish requirements
3896 N. Schreiber Way • Coeur d’Alene, ID • 83815-8362 • USA
Ph (208) 665-2166 • Fax (208) 665-5906 • www.iitmetalfab.com

8 August 2008
DevPerspectives.qxd 7/9/2008 12:28 PM Page 9

According to patent applications, neural networks [2]. Perhaps application — United States Patent
HP’s memristor design is based on memristors will make it possible 20080079029, ‘Multi-terminal
a sandwich of titanium dioxide to implement affordable, semi- electrically actuated switch’ —
films that loosely resembles the autonomous robots with a semblance provides additional information,
construction of a capacitor. However, of intelligence. including specifics on materials
unlike capacitors, one layer of If you’re like me, you probably and doping.
titanium film is an insulator while the can’t wait to order an assortment of It’s not likely that memristors
other layer is doped so that it is a memristors from Mouser or Jameco. will make time travel or anti-gravity
conductor. Wires on either side of However, we’re not there yet. We’ll possible. However, it’s a new
the sandwich are used to pass a probably have to be content with a building block that will undoubtedly
charge through the film. Current SPICE simulation or other virtual have myriad practical applications
through the film lowers the resistance experience for months, if not a year in areas ranging from computing
of the film by a factor of 1,000. In or more. and entertainment to automotive
this respect, the memristor seems a One of the unfortunate aspects electronics. And you can be
lot like an active device to me, but of memristors — from the perspective certain that Nuts & Volts will be
it’s nonetheless classified as a passive of an electronics experimenter eager featuring projects that illustrate the
circuit element. to create the first ‘must have’ device utility of the memristor — just as
Some of the first applications of using memristors — is that just about soon as I can get my hands on
memristors will likely be high-density, every imaginable application is one. NV
energy-efficient memory devices patented. Take a look at uspto.gov or
that compete with Flash memory www.freepatentsonline.com. One
REFERENCES
devices. However, as with any new of the most straightforward patent
technology, it’s difficult to predict applications — United States Patent [1] Chua, L. Memristor — The missing
circuit element. IEEE Transactions on
what will come of the memristor. 20080090337 — is for an electrically Circuits Theory, Volume 18, Issue 5,
Because the memristor has qualities actuated switch. The application Sep 1971 Page(s): 507 – 519.
of both analog and digital circuitry, provides a good background on
[2] Johnson, RC. First proof of circuit
one application identified by HP is the mathematics and physics of a theory’s ‘missing link?’ EETimes.
the development of memristor-based memristor. A second patent Monday, May 5, 2008. Page(s): 1-6.

August 2008 9
ReadFeed Aug08.qxd 7/9/2008 4:11 PM Page 10

READER FEEDBACK
READY TO DIVE INTO you to correct them.
EVERYTHING FOR ELECTRONICS

Published Monthly By
PCB PRODUCTION You'll sometimes get the four-layer T & L Publications, Inc.
component in two-layer board errors 430 Princeland Ct.
Thank you, thank you, thank you! when you reuse components that Corona, CA 92879-1300
For some time now, I have been have been laid out in a four-layer board (951) 371-8497
FAX (951) 371-3052
sitting on the fence thinking I need to design. For instance, if you reuse a
Webstore orders only 1-800-783-4624
figure out how to create my own PCBs component from a four-layer board www.nutsvolts.com
using expresspcb.com. I have been that has been attached to one of the
reluctant to wade into those waters, internal four-layer planes, that will flag Subscriptions
Toll Free 1-877-525-2539
however, because of my inexperience an error in a two-layer design as the
Outside US 1-818-487-4545
with this aspect of electronics. Just last planes don't exist. P.O. Box 15277
week I recall thinking to myself, “I wish Hope that helps, and again, thanks North Hollywood, CA 91615
someone would write an article that for reading.
would step me through the process.” Fred Eady FOUNDER/ASSOCIATE PUBLISHER
Jack Lemieux
The June issue of Nuts & Volts just
arrived! So, thank you very much. I PUBLISHER
think it's time to go “swimming.” GIVING THE WRONG Larry Lemieux
publisher@nutsvolts.com
Greg Lewis SIGNALS
I have enjoyed reading your ASSOCIATE PUBLISHER/
Response: You are welcome, you magazine for a few years now, since VP OF SALES/MARKETING
Robin Lemieux
are welcome, you are welcome! all the other electronic magazines have display@nutsvolts.com
Thanks for taking time to read the dissappeared. But I have also noticed
article. I’m glad it was useful to you. sometimes that answers to some of EDITOR
Bryan Bergeron
Fred Eady the readers questions are not always techedit-nutsvolts@yahoo.com
correct and lead me to believe that
whoever gave the answer does not CONTRIBUTING EDITORS
Jeff Eckert Russ Kincaid
MORE SWIMMING know as much as they think. I have Vern Graner Fred Eady
REVIEWS emailed in several times with my views, Ron Hackett Louis Frenzel
Joe Pardue Jim Fell
I would like to thank you for the but have not seen any results. Today, I Jack Botner Dan Gravatt
well-written article “PCB Basics: From would like to give a simple comment Larry Cicchinelli
Your Brain to a Finished Board,” on the digital TV questions.
CIRCULATION DIRECTOR
appearing in the Nuts & Volts June I have been an electronics Tracy Kerley
2008 issue. This is exactly the sort of technician/broadcast technologist for subscribe@nutsvolts.com
basic how-to article I need to advance about 25 years; I think this gives me SHOW COORDINATOR
my own skills. some insight to comment on this. Audrey Lemieux
I have a question. When you click As far as the simple explanation
MARKETING COORDINATOR
the “Order Boards...” option, is on how they can fit three digital TV WEBSTORE
ExpressPCB smart enough to know signals in the same space as one analog Brian Kirkpatrick
whether the board needs to be two channel — it is really simple. THEY sales@nutsvolts.com
layer or four layer and default to what SEND LESS INFORMATION!!!! It has WEB CONTENT
the design actually needs? been a couple years since I have Michael Kaudze
website@nutsvolts.com
Bob Cochran worked in the broadcast industry, and
Greenbelt, MD there are probably many people out PRODUCTION/GRAPHICS
there that can give a more in-depth Shannon Lemieux
Joe Keungmanivong
Response: Thanks for reading! explanation, but here is mine.
When you begin your design, you In the early 1990s at one place I ADMINISTRATIVE ASSISTANT
Debbie Stauffacher
should set the board type to two or four worked, we were testing coax cable to
layer. The program is not smart enough handle digital TV signals in the studio Copyright © 2008 by T & L Publications, Inc.
All Rights Reserved
to determine the type of board to use environment. The analog bandwidth All advertising is subject to publisher’s approval. We are
versus the design criteria. needed was 6 MHz minimum, the not responsible for mistakes, misprints, or typographical
errors. Nuts & Volts Magazine assumes no responsibility
There are things you can't do in equivalent digital signal ran at 270 for the availability or condition of advertised items or for
two-layer mode that apply only to megabits per second. End result: the honesty of the advertiser. The publisher makes no
claims for the legality of any item advertised in Nuts &
four-layer boards. You need much more bandwidth to Volts. This is the sole responsibility of the advertiser.
The order program will pick up send the same signal in digital format Advertisers and their agencies agree to indemnify and
protect the publisher from any and all claims, action, or
four-layer things that can't happen in than analog. expense arising from advertising placed in Nuts & Volts.
two-layer boards and post an error for This creates large problems. To use Please send all editorial correspondence, UPS, overnight
mail, and artwork to: 430 Princeland Court, Corona, CA
continued on page 92
10 August 2008 92879.
Full Page.qxd 7/7/2008 11:06 AM Page 11

Great Kits for Be one of the


first to get our

Electronics Enthusiasts brand new color


catalog. It’s bursting
with over 800 new
Popular Project Kits products, all with
USD pricing and in
Subwoofer Controller Kit Bridge Mode Adaptor
KC-5452 $58.00 + post & packing KC-5469 $14.50 + post & packing full color.
Using this kit to control your This excellent kit will let you run a
external speaker and stereo amplifier in 'Bridged Mode'
sub-amplifier can give you to effectively double the power
loads of bass without available to drive a single
taking up much space. speaker. There are no modifications Experiments in Alternative Energy
required on the amplifier and the signal
The kit has all the features you
processing is done by this clever kit. Supplied
could want, including low and high pass filters,
with silk screened PCB and all specified components. Wind Powered Generator
parametric equaliser and auto-turn on for external
equipment. The controller is 12 volt DC powered and can
• Requires balanced (+/-) power supply. Experimenters Kit
also be used in automotive applications. KJ-6696
• Kit supplied with silk screened PCB, electronic 12-24V High Current Motor $31.95 + post & packing
components and processed panels. Learn all about this green energy
Speed Controller Kit source, and the mechanics of wind
Three Stage FM Transmitter KC-5465 $46.50 + post & packing generators. It is supplied in kit form, so you
KJ-8750 $12.75+ post & packing Want to control a really big DC motor? This design will get to assemble the whole thing before you
This is a Three-Stage radio transmitter that is so stable you control 12 or 24VDC motors at up to 40A continuous. The start learning about how it works.
could use it as your personal radio station and broadcast speed regulation is maintained under load, so the motor • Approximately 300mm tall
all over your house. Great for experiments in audio speed is maintained even under heavy load. It
transmission. Includes a mic, PCB also features automatic soft-start, fast
with overlay and all other parts. Thou switch-off, a 4-digit LED 7-segment
san display to show settings, an Solar Car Kit
Sold ds
• Requires 9V battery (not included)
• Instructions included in kit overload warning buzzer and a KJ-8920 $14.50 + post & packing
low battery alarm. All control tasks This terrific little car is fun to build and will
are monitored by a microcontroller, introduce young minds to the
so the functionality is extensive. concepts of mechanical
Kit contains PCB and all specified construction and solar electric
electronic components. propulsion. It can run purely
from solar power or from the
included hand-cranked
generator. Great fun for
Smart Card Reader & Programmer Kit years 8+
KC-5361 $34.95 + post & packing • Forward and
Program both the microcontroller and EEPROM in the popular gold, silver and reverse control
emerald wafer cards. Card used needs to conform to ISO-7816 standards, which • Approx 200mm long
includes ones sold by Jaycar. Powered by 9-12 VDC wall adaptor or a 9V battery.
Instructions outline software requirements that are freely available on the
internet. Kit supplied with PCB, wafer card socket and all electronic components.
Solar Eco-House Kit
KJ-8924 $14.50 + post & packing
PCB measures: 141 x 101mm.
The house is fun to build and will introduce
Jaycar cannot accept responsibility for the your child to the eco-friendly concepts in a
operation of this device, its related Requires 9-12VDC deceptively entertaining way. It has it
software, or its potential to be used in wall adaptor own solar panel and a windmill to
relation to illegal copying of smart cards in supply free power to the lighting &
cable TV set top boxes.
sound circuits, or it can run from
ordinary batteries. Simple and safe
for ages 8+.
How To Order • Requires 2 x AA batteries for
Post & Packing Charges non-solar operation.
Order Value Cost Order Value Cost
$25 - $49.99 $7.50 $200 - $499.99 $60 Deluxe Solar Educational Kit
$50 - $99.99 $20 $500+ $75 KJ-6694 $15.95 + postage & packing
$100 - $199.99 $40 A series of do-it-yourself experiments to acquire the
•ORDER ON-LINE Max weight 12lb (5kg). Heavier parcels POA. basic knowledge of solar
Minimum order $25.
•ALL PRICING IN power. Includes solar cell
US DOLLARS Note: Products are despatched from Australia, so local module, musical unit,
customs duty and taxes may apply. plastic lamp, motor
•MINIMUM ORDER accessories and plastic
How to order:
ONLY $25 Phone: Call Australian Eastern Standard Time Mon-Fri adaptors.
on 1800 784 0263. Fax: +61 2 8832 3118
Email: techstore@jaycar.com
Post: PO Box 107, Rydalmere NSW 2116. Australia
Expect 10-14 days for air parcel delivery

Check out the Jaycar range in your FREE Catalog - logon to


www.jaycar.com/catalog 1-800-784-0263
(Monday - Friday 09.00 to 17.30 GMT +10 hours only)
or check out the range at For those who want to write:
www.jaycar.com PO Box 107, Rydalmere NSW 2116 Sydney AUSTRALIA
Tech2008.qxd 7/3/2008 2:00 PM Page 12

2008
■ BY JEFF ECKERT
TECH KNOWLEDGEY
EVENTS, ADVANCES, AND NEWS

ADVANCED TECHNOLOGY
FLYING SAUCER: the surrounding air, and that swirling device developed by scientists at the
PATENT PENDING air creates lift and momentum and National Institute of Standards and
provides stability against wind gusts.” Technology (NIST, www.nist.gov) and
PHOTO BY DANIELLE ZAWOY, UNIVERSITY OF FLORIDA.
The saucer-like shape serves to Germany’s University of Konstanz
increase the area of the air-vehicle (www.uni-konstanz.de). We’re talking
interface and maximize lift. A major about an ultrafast laser that offers a
advantage to this concept is that the record-breaking combination of high
vehicle will have no moving parts and speed, short pulses, and high average
the ability to take off vertically, power: This dime-sized device
hover, and fly not only in Earth-like produces 10 billion pulses per
atmospheres but also in places like second, each about 40 quadrillionths
Titan, Saturn’s most inviting moon. of a second in duration, with an
Some pretty substantial hurdles average of 650 mW power. As it
exist, though, so don’t get prematurely turns out, the laser — when used as
excited. For one thing, it remains to a frequency comb (see www.nist.
be seen if anyone can create a power gov/public_affairs/newsfromnist_
source capable of generating enough frequency_combs.htm for a detailed
plasma to raise itself against Earth’s definition) — could provide 100
gravity. In addition, the plasma creates times the sensitivity of existing
enough EMI that communicating with astronomical tools used in the search
the vehicle is highly problematic. for Earth-like planets orbiting distant
The present design is aimed at a stars. In practical terms, this means
■ Artist’s conception of a WEAV flying six-inch prototype. But it isn’t going to we should be able to detect starlight
above the Mars surface. exist in hardware for a while, so if you “wobbles” created by such planets
see a UFO outside your window, down to a few centimeters per
he US Patent Office recently you can still jump to extraterrestrial second rather than the present one
T received an application for
something that resembles a traditional
conclusions. But the Air Force and
NASA reportedly have expressed
meter per second.
Standard frequency combs have
flying saucer, but the applicant isn’t a interest in the concept, so you “teeth” (see illustration) that are too
Martian — the culprit is Assoc. Prof. never know. finely spaced for instruments to read.
Subrata Roy, of the University of But the new laser bounces light
Florida’s Dept. of Mechanical & LASER MAY AID SEARCH between sets of mirrors to eliminate
Aerospace Engineering (www.mae. FOR PLANETS some blocks of teeth, thus creating a
ufl.edu). The design is properly “gap-toothed” comb that displays
known as a “wingless electromagnetic lso presenting possibilities for only every 10th or 20th tooth. The
air vehicle,” or WEAV. The innovative
part of the concept is that the WEAV
A space exploration is a laser next step is to incorporate the device
in a ground-based
will be powered by magnetohydrody- PHOTO COURTESY OF M. KIRCHNER AND S. DIDDAMS, NIST.
telescope or satellite.
namics, which is basically the science Other possible
of how electrically conductive fluids applications include
— which include plasmas and liquid remote sensing of gases
metals — are affected by magnetic and precision control
fields. In this case, “the conducting of high-speed optical
fluid will be created by electrodes communications.
that cover each of the vehicle’s
surfaces and ionize the surrounding ■ Experimental data from
air into plasma ... the force created a “gap-toothed” frequency
by passing an electrical current comb, false colored to
show a power range from
through this plasma pushes around low (red) to high (blue).
12 August 2008
Tech2008.qxd 7/3/2008 2:01 PM Page 13

TECHKNOWLEDGEY 20 08

RAM (supports up to 2 GB), an using Blender on Sun Microsystems


COMPUTERS AND Intel® graphics accelerator, high-def (www.sun.com) hardware, has been
NETWORKING audio, four USB 2.0 ports, and an
80 gig hard drive. It comes with
released on 35 mm film and Blu-ray.
But you can download it for free at
ANOTHER BOX FOR
Foresight Linux and a one year www.bigbuckbunny.org. It was given
BOTTOM-FEEDERS
warranty. And to make it look nice a “special mention” award at Italy’s
on your desktop, the black front Cyborg Film Festival and, according
cover has a removable clear panel, to Sun’s David Folk, “demonstrates
behind which you can mount your that the barriers to entry in the 3D
favorite work of art. animation world can be lowered
tremendously using on-demand
STEP ASIDE, PIXAR computing platforms.” If you have
dreamed of being the next animation
ou can spend a lot of money genius, you now have the tools to
Y on 3D imaging software, such as
3ds Max ($3,500), Maya Unlimited
make the dream come true.

($6,999), and Houdini Master COMPUTER WITHIN A PEN


($7,995). But how about a full-
■The Pulse
featured package released as smartpen from
PHOTO COURTESY OF SHUTTLE COMPUTER GROUP. Open Source software (i.e., for free) Livescribe.
■The business end of a Shuttle under the GNU General Public
K450 computer. License? Enter Blender, downloadable
from www.blender.org. It can be used
he latest discovery in our never- for modeling, animation, game
T ending search for el-cheapo
computers is the K-4500-RS Perfect
creation, and a range of other things,
and it is available for mainframes to
Cube Mini from the Shuttle PCs and most operating systems:
Computer Group (us.shuttle.com), Windows, Linux, MAC OX, Solaris,
US division of the parent company in and FreeBSD. Blender isn’t for the eah, we’ve all seen digital pens
Taiwan. With a street price starting at
$209.99, it looks like a surprisingly
casual user, being complex and
reputedly difficult to learn. But for a
Y that capture handwritten notes,
double as a mouse, and perform
formidable little box. The basic unit good example of what can be done other essentially nonessential
runs on a Celeron® 430 processor, if you have enough time on your functions. But an interesting twist is
but a Pentium® dual-core chip is hands, take a look at “Big Buck the Pulse smartpen, a product of
optional. Also standard is 512 MB of Bunny,” a video about a congenial Livescribe (www.livescribe.com).
rabbit who has to deal with three According to the company, it is “a
■ Characters from the movie Big rude rodents. The movie, generated computer within a pen that captures
Buck Bunny, created using Blender. handwriting and simultaneously
records audio and synchronizes it to
the writing. Users can simply tap on
their notes to replay what was
recorded from the exact moment
they were writing, so they never miss
a word they hear, write, or speak.”
It also offers (or will offer) a range
of general purpose computer
functions including games, language
translation, personal organization,
ebooks, birdwatching assistance,
transcription, and a built-in can
opener. (Well, maybe not the latter.)
The $149 1 GB model stores 100
hours of audio and 16,000 pages of
notes. For $199, you can pick the
2 GB version. And even if you don’t
end up using it, the sleek, charcoal
blue anodized unit will make a
handsome paperweight.
August 2008 13
Tech2008.qxd 7/3/2008 2:03 PM Page 14

CIRCUITS PHOTO COURTESY OF AMERICAN SUPERCONDUCTOR.

AND DEVICES
SUPERCONDUCTOR
CABLE ENERGIZED
ou don’t get to see super-
Y conductors in operation every
day, but back in April, the Long
Island Power Authority (LIPA,
www.lipower.org) fired up the first
high-temperature superconductor
(HTS) power transmission cable
system in its commercial power grid.
The cables shown entering the
ground in the photo can carry as
much power as all of the overhead
lines shown in the background. The ■ LIPA’s new power
138 kV system can handle 574 MW transmission cable.
of power (enough to run 300,000
homes) via the three individual power cables of the same size), and it 2,000 ft (610 m) cable system is
cable phases running in parallel (150 virtually eliminates the typical seven cryogenically cooled using a liquid
times the current handled by copper to 10 percent resistance loss. The nitrogen refrigeration system. Return

INDUSTRY AND THE appears to be unfounded,” said Titus Galama, co-author


of the report and a management scientist at RAND, a
PROFESSION nonprofit research organization. “But the United States
cannot afford to be complacent. Effort is needed to make
DIG OR DUMP DIRT sure the nation maintains or even extends its standing.”
The study offers a range of recommendations for
ack in June, glassdoor.com opened its virtual doors
B with the aim of providing inside information on
employers, salaries, and other subjects. So far, it’s
maintaining our lead, including making it easier for
foreign-born graduates to remain here, facilitating
immigration of highly skilled labor, improving K-12
concentrating on San Francisco Bay area tech companies, scientific education, and boosting our ability to learn from
but expansion into other regions and industries is in the science centers in Europe, the Far East, and other areas. For
works. If you want to find out what it’s really like to work a copy of the 188-page report, go to www.rand.org/pubs/
for a prospective employer, or warn others about how monographs/MG674/. It’ll run you $28.80 with the
you’re treated by yours, all you have to do is sign up (for Web discount.
free) and contribute a review or salary report. In return,
you get access to everyone else’s reviews and salaries. ANOTHER WIN FOR THE GOOD GUYS
Should make interesting reading, although accuracy
ast October, 21-year-old hacker Gregory King was
will be iffy until the site builds up a large enough
database to marginalize the statistical effects of
L arrested in the FBI’s “Operation Bot Roast.” He was
tracked down after launching Valentine’s Day distributed
disgruntled employees and pathological liars.
denial-of-service attacks against antiphishing website
CastleCops and KillaNet, a forum for gamers and graphic
US REMAINS COMPETITIVE designers. As agents were breaking down his door, King
ontradicting a common perception that the old red,
C white, and blue is losing its competitive edge in
science and technology, a recent RAND Corporation
stashed his laptop in the backyard, but the authorities
eventually located it and charged him with two counts
of “transmitting code to cause damage to a protected
study revealed that the US still accounts for 40 percent computer.” Using a botnet of about 7,000 hacked
of the world’s total spending on scientific R&D, employs computers, King had bombarded CastleCops with a 969
70 percent of the Nobel Prize winners, and hosts 75 Mb/s datastream. If the volunteer-run organization had
percent of the top 40 universities. Much of the credit been charged for the bandwidth, it would have been
belongs to the contributions made by students, scientists, forced to close down. King is scheduled for sentencing
and engineers from other countries. on September 3rd, and the plea agreement calls for him
“Much of the concern about the United States losing to be put away for two years. A pat on the back goes to
its edge as the world’s leader in science and technology US District Judge Lawrence Karlton.
14 August 2008
Tech2008.qxd 7/8/2008 10:42 AM Page 15

TECHKNOWLEDGEY 20 08

on investment may take a while, as Using an external N-channel The LT3755 uses True Color
the project cost $58.5 million, about MOSFET, it can drive as many as PWM™ dimming to deliver constant
half of which was funded by the 14 1A white LEDS from a 12V input color with a dimming range of up to
Department of Energy. But the mission to deliver over 50W. The high-side 3,000:1. Two versions are available:
is to “modernize the electric grid, current sense allows it to be used in the standard LT3755, which offers
enhance security and reliability of the boost, buck, buck-boost, or SEPIC an open LED status pin; and the
energy infrastructure, and facilitate and flyback topologies. Frequency LT3755-1, which replaces the pin
recovery from disruptions to energy can be adjusted between 100 kHz with a frequency synchronization pin;
supply.” Sounds like a worthy goal. and 1 MHz and, because the device In production quantities, they’ll run
is better than 94 percent efficient in you about $2.75 each. For $3.15,
HEFTY DVR STORAGE boost mode, no heatsinking is you can get an extended-temperature
required. version. NV
ou’re probably familiar with
Y Seagate’s line of hard drives
aimed at computer data storage, but
the company recently announced the
Seagate® Showcase, a series of
products that extend the storage
capacity of DVRs. Designed for
compatibility with Motorola’s eSATA
capable high-definition products (but
you also can connect via a standard
USB 2.0 cable), they are slated for
for Engineers
market soon, perhaps by the time
you read this. The boxes will initially
come with 1 TB of storage, which
translates into 200 hr of HD movies
or 1,000 hr of standard-def TV.
The Showcase family features
Seagate’s Pipeline HD series of
hard drives.
The Pipeline drives are designed
specifically for DVRs, providing top-
notch high-definition performance
and capacity with “bedroom-quiet
acoustics,” low-power operation, and
the ability to support up to 12
simultaneous HD streams. The drives
are Windows Vista certified, making
them suitable for home media
centers. The list price has not been
divulged, but the product does come
with a one year warranty and free

www.mouser.com
tech support even after the warranty
expires. You can check for price and
availability at www.seagate.com. Over A Million Products Online

60-V LED DRIVER • The ONLY New Catalog Every 90 Days


• NEWEST Products & Technologies
inear Technology
L (www.linear.com) recently
announced the LT3755 device, a
• More Than 366 Manufacturers
• No Minimum Order
60V output, high-side current sense • Fast Delivery, Same-day Shipping
DC/DC converter designed to drive The Newest Products
high current LEDs. It has a 4.5V to (800) 346-6873 For Your Newest Designs
40V input range, making it useful for
such applications as automotive, Mouser and Mouser Electronics are registered trademarks of Mouser Electronics, Inc. Other products, logos, and
industrial, and architectural lighting. company names mentioned herein, may be trademarks of their respective owners.

Mouser_NutsVolts_8-1-08.indd 1 August 2008 7/3/08 9:02:03 15


AM
PicaxePrimer.qxd 7/3/2008 3:39 PM Page 16

■ BY RON HACKETT
PICAXE PRIMER
SHARPENING YOUR TOOLS OF CREATIVITY

GETTING STARTED WITH THE


PICAXE-28X1 MICROCONTROLLER
IN ESSENCE, THE PICAXE-28X1 IS LIKE A 28X ON STEROIDS. It’s pin-for-pin
compatible with the 28X and all the 28X commands will function correctly on
a 28X1. In other words, if you have an existing 28X circuit, it will function exactly
the same with a 28X1 installed. This is a good thing, because Revolution
Education considers the 28X to be obsolete and has discontinued it.
Amazingly, the new 28X1 is about the same price as the old 28X.
he PICAXE-28X1 has so many of all the current PICAXE processors; increased from 8 MHz in the earlier
T improvements and powerful new
features that it’s hard to know where
a quick glance will give you some
idea of the scope of the 28X1’s
processors to 20 MHz in the 28X1.
System speed options have also
to begin. In order to avoid the risk of improvements in this area. Most of become much more flexible —
information overload, I have decided the information in Figure 1 is self- we’ll get to that in detail later in
on a two-phase approach. In this explanatory but a couple of points this installment when we take a
installment of the Primer, I’ll present are worth noting. look at the new resonator features
a brief overview of most of the new First of all, the general-purpose of the 28X1.
features and then go into more detail byte variables (b0 to b13 in all the
on a couple of them that we will be previous PICAXE chips) have been
using right away. In future Primer doubled to b0 to b27 in the 28X1. If
SOFTWARE
installments, we’ll explore each new you have ever run out of variables in IMPROVEMENTS
feature in depth as we have a need a program, you will appreciate how
to use it in a project. significant this improvement is. Also, Figure 2 presents the pin-out of
the 28X1 includes an entirely new the 28X1; in it, some of the major new
128-byte storage area (the scratch- software functions are highlighted in
HARDWARE pad) that can be used for additional a larger bold font. We will consider
IMPROVEMENTS storage; it’s especially useful for the pins in numerical order, so the
tables and arrays as we will see in a first new feature that jumps out is
Let’s begin by taking a look at future installment of the Primer. “ULPWU” (pin 2), which is an
the memory and storage capacity Finally, although it’s not included acronym for the new “Ultra Low-
of the 28X1. Figure 1 presents a in Figure 1, it’s worth mentioning that Power Wake-Up” feature. We will
comparison of the relevant features the maximum system speed has been explore the ULPWU in some detail
in a future installment of the Primer
when we begin working on a 28X1
08M/14M/20M 18X 28X1/40X1 battery-powered data-logging system,
BASIC Program Memory ~ 80 Lines ~ 600 Lines ~ 1000 Lines but for now all we need to know
General Purpose Variables 14 14 28 about it is that ULPWU provides a
means for greatly reducing power
Storage Variables (peek/poke) 48 96 95
consumption.
Scratchpad Variables (get/put) - - 128 Next, we see the “timer clock”
Special Function Variables 3/4/4 4 7 function on pin 11. This feature
EEPROM Data Storage 256 - program 256 256 ■ FIGURE 1. PICAXE processor
memory comparisons.
16 August 2008
PicaxePrimer.qxd 7/3/2008 3:39 PM Page 17

PICAXE PRIMER

accesses a new 16-bit background in a special area of memory. This readtable): Allows for a 256-byte
timer/counter, with a user-accessible means that your program no longer data lookup table in EEPROM; we’ll
timer variable. It can operate in one has to sit and wait for serial input; it find it useful for LCD menu text.
of two modes: timer mode and can be doing other tasks while serial
counter mode. In timer mode, your data is being received and when it’s • I2C Commands (hi2cin, hi2cout,
program can set up a timer that runs convenient, it can retrieve the hi2csetup): The 28X1 is able to
in the background and increments at received data for processing. function as either an I2C master
a frequency you can specify, e.g., In addition to the new features or slave which (among other
once per second. “In the whose presence is clearly announced advantages) allows for the networking
background” means that your on the 28X1’s pin-out, there are of multiple 28X1 processors.
program can go about its business many additional new commands and
and check the timer variable improvements to older commands • IR Commands (irin, irout): IR
periodically to determine its current that can be discovered by reading communication can now be
value. In other words, it’s possible to the documentation. Don’t forget, you implemented on any I/O pin.
include a real-time clock function in will need to install the latest version Also, the irin command includes a
your program without needing an of the Programming Editor software “timeout” feature so your program
external clock chip; we will do (available at www.rev-ed.co.uk/ won’t hang if data is not received.
exactly that in the near future. In picaxe) to be able to use these new
counter mode, your program can features in your programs. We’ll • Keyboard Input (kbin): Similar to
count the number of pulses received explore the vast majority of them in the older “keyin” command, but now
on input 0 (again, in the background) detail as we need them in our various also includes a timeout feature.
so it can be carrying out other tasks I/O projects in the coming months.
simultaneously. In the meantime, the following • Memory Access (get, put): Provide
Pins 13, 22, 23, and 25 are all summary list of the major access to the 128-byte scratchpad
used to implement the 28X1’s new improvements in the 28X1 should memory area for additional data/
hardware PWM command which is whet your appetite: variable storage.
used for advanced motor control and
is a more powerful alternative to the • ADC Commands (calibadc, • One-Wire Commands (owin,
more traditional “pwmout” command calibadc10): In the past, ADC owout, readowsn): Provides full
(pins 12 and 13) which we will also readings have been based on the support for the 1-Wire protocol on
implement in an upcoming Primer supply voltage. Therefore, in battery- any I/O pin.
installment. powered systems, changes in the
Pins 14, 15, and 16 provide the supply voltage produced inaccuracies • Power-reduction Commands
necessary I/O lines to implement the in the ADC readings. The new (disablebod, enablebod, hibernate):
standard three-wire SPI protocol. commands allow access to a fixed, Implements the new ULPWU
SPI is a much faster alternative to internal 0.6V supply for increased feature. We’ll explore disablebod
RS-232 serial communications; many accuracy. and enablebod next.
inexpensive peripheral SPI chips are
readily available to carry out a variety • Data Storage Table (table, • Serial Communications
of communications functions. For
example, the Max7219 is a 24–pin ■ FIGURE 2.
chip that can be used to interface Reset - 1 28 - Out 7 PICAXE-28X1
with up to eight seven-segment LED ADC 0 / In A0 / ULPWU - 2 27 - Out 6 pin-out.
displays. An upcoming Primer I/O ADC 1 / In A1 - 3 26 - Out 5
project will use the MAX7219 to ADC 2 / In A2 - 4 25 - Out 4 / hpwm D
implement a stand-alone, four-digit
ADC 3 / In A3 - 5 24 - Out 3
seven-segment LED display.
I’ve saved the best until last — Serial In - 6 23 - Out 2 / hpwm B
pins 17 and 18 can now be used in Serial Out - 7 22 - Out 1 / hpwm C
conjunction with the new hardware- Gnd - 8 21 - Out 0
based “hserin” and “hserout” Resonator - 9 20 - +V
commands. These commands
Resonator - 10 19 - Gnd
support much higher serial baud
rates than the older serin and serout In 0 / Out C0 / timer clock - 11 18 - In C7 / Out C7 / ser rx / kb data
commands (which are also still In 1 / Out C1 / pwm 1 - 12 17 - In C6 / Out C6 / ser tx / kb clock
available). More importantly, hserin In 2 / Out C2 / hpwm A / pwm 2 - 13 16 - In C5 / Out C5 / spi sdo
can operate in the background and In 3 / Out C3 / i2c sci / spi sck - 14 15 - In C4 / Out C4 / i2c sda / spi sdi
automatically save the received data
August 2008 17
PicaxePrimer.qxd 7/3/2008 3:39 PM Page 18

(disconnect, reconnect, serin, support an external resonator; each get some idea of just how much
serout, serrxd, sertxd): The of the earlier 28-pin chips did so, as power we might be able to conserve,
disconnect command stops the 28X1 well. However, the 28X1 provides I carried out a little experiment with a
from looking for a new program more external resonator choices. simple 28X1 circuit, but before we
download, which enables your Also, with a top speed of 20 MHz, get into the details and the results, I
program to use the download cable the 28X1 is the fastest PICAXE need to introduce a term that may be
for data communications (using currently available (40 MHz X2 new to some readers. The 28X1 has
serrxd and sertxd) with your PC (e.g., processors are already being a feature called “brownout detection”
via a terminal program). The serin developed). Of course, the option or BOD; its function is to cleanly
command now includes a timeout of increased speed is in itself a big reset the chip in the event of a power
feature so your program won’t hang improvement. However, the 28X1’s brownout (i.e., a temporary drop in
if data is not received. Also, the new resonator flexibility is an even more the input voltage). It’s a great feature
hardware serial commands (discussed significant advance. for line-powered circuits, but not
previously) allow for automatic serial In addition to the external really necessary with battery-power,
input in the background. resonator choices of 20, 16, 10, 8, and it does require a fair amount of
and 4 MHz, the 28X1 also supports power to operate. Fortunately, the
• Sound Output (play, sound, tune): internal oscillator speeds of 8, 4, 2, 28X1 supports software commands
Sound and music output can now be and 1 MHz, as well as 500, 250, 125, to enable or disable BOD (enablebod
implemented on any output pin. and 31 kHz. What’s so great about and disablebod).
that, you might ask, and why would I had three goals in mind when I
• SPI Commands (hspiin, hspiout, anyone ever want to run a program set up my experiment. The first was
hspisetup): Enables higher at 31 kHz, anyway? Well, for any to measure the 28X1 supply current
communication speeds. CMOS processor (which includes at each of its internal resonator
all the PICAXE chips), power speeds. I focused on the internal
• Timer Commands (settimer, consumption is directly proportional resonators because the Microchip
settimer count): New 16-bit to processor speed — so slower data sheet for the PIC16F886 (the
background timer/counter. program speed goes hand in hand chip on which the 28X1 is based)
with lower power requirements. In contains data that shows that the
There are also several significant other words, if your project is battery external resonators consume
additions in the area of mathematical powered, the more you can slow significantly more power, even at
computations. We don’t have space to down the speed of program the same speed (i.e., 4 MHz external
list them here, but we’ll get to many execution, the longer your batteries vs. 4 MHz internal).
of them in upcoming installments of will last. The second goal was to
the Primer. All of the new features determine the magnitude of the
and commands are covered in the supply current reduction obtained by
documentation, especially Part 2 of
A LITTLE EXPERIMENT disabling BOD at each internal speed.
the PICAXE manual — have a read! As you already know, once we Finally, since power consumption
have completed a few of our also decreases with lower supply
upcoming I/O projects we’re going voltages, I took all my measurements
RESONATOR to develop a battery-powered with a five-volt power supply and
ENHANCEMENTS data-logging system, so the prospect then repeated the process with a
of a significant reduction in power 3.3-volt supply. When I recorded
The 28X1 isn’t the first PICAXE to consumption is of special interest. To each measurement, I made sure that
the 28X1 wasn’t powering any
external components (e.g., an
5.0-volt Power Supply 3.3-volt Power Supply LED) because the additional
Speed BOD Enabled BOD Disabled BOD Enabled BOD Disabled power usage would confound
8 MHz 1.82 1.75 1.07 1.03
the results.
4 MHz 1.07 0.98 0.64 0.59 If you examine the resulting
2 MHz 0.68 0.60 0.42 0.38 data (presented in Figure 3), you
1 MHz 0.49 0.41 0.31 0.27 can see that all three variables
500 kHz 0.39 0.32 0.25 0.21 influenced power consumption
250 kHz 0.35 0.27 0.23 0.19 exactly as we would expect: For
125 kHz 0.32 0.24 0.21 0.17 both supply voltages, lower
31 kHz 0.11 0.03 0.06 0.02 resonator speeds resulted in
lower supply currents; compared
Note: See text for important information about the 28X1 Brown-Out Detection feature.
■ FIGURE 3. 28X1 internal
resonator supply currents.
18 August 2008
PicaxePrimer.qxd 7/3/2008 3:39 PM Page 19

PICAXE PRIMER

to the 5.0-volt supply, the 3.3-volt ■ FIGURE 4. 28X1 supply


supply consistently resulted in lower current circuit schematic.
supply current at each speed; and,
disabling BOD further reduced the
supply current at every speed. So,
when we get to our battery-powered
data-logger project, we’ll definitely
use the slowest possible speed (but
not 31K, unless we can resolve the
problem described later in this
installment).
If you would like to make your
own supply current measurements,
a schematic of the circuit I used is
presented in Figure 4. A close-up
photo of the breadboard is shown
in Figure 5 and Figure 6 is a photo
of the entire setup including the
multimeter I used for the current
measurements. In the schematic,
I am assuming you are using a
separate programming adapter
board, so I have not included that
portion of the circuitry. Also, note
the pull-down resistors on all of the
unused input pins. Without them, the
inputs would float and possibly
change from a high state to a low
state due to random static charges.
Whenever a CMOS input
changes state, it consumes power,
so to avoid any unnecessary power
consumption I grounded all the
unused inputs. This is a good idea in
any circuit (even if you don’t care
about the power consumption)
because it can also reduce
unnecessary noise in the supply lines.
The push-button switch on input 3 ■ FIGURE 5. Close-up
allowed me to keep the 28X1 at its of breadboard layout.
current speed while I wrote down
the supply current measurement;
pressing the button advanced the
28X1 to its next speed setting and
the next supply current measurement
(except at 31K — we’ll get to that
problem shortly). The software I used
is too long to include in the Primer,
but it’s available for download at the
N&V website (www.nutsvolts.com);
look for “CurrentTest.bas.”
The 28X1’s powerful and flexible
resonator features can sometimes
result in a minor inconvenience that
you should keep in mind. Whenever
you initiate a program download to a
PICAXE chip, the Programming Editor
software requires that the target
August 2008 19
PicaxePrimer.qxd 7/3/2008 3:40 PM Page 20

PICAXE is running at 4 MHz. This is desperation (I hate to admit I can’t of your hardware and software setup
never a problem at power-up or figure something out on my own!) I and the nature of the problem, and
reset; in those two cases, the 28X posted a message on the PICAXE you’re very likely to get some helpful
automatically defaults to its 4 MHz forum (www.picaxeforum.co.uk) feedback.
internal resonator. However, if the detailing the problem. Within a day The second problem I
28X1 is currently running software or so, there were several responses encountered is even more perplexing
that has changed the speed to confirming my results, and by the than the reversed BOD commands.
anything other than 4 MHz, you may second day a response from As I mentioned earlier, I used a
get a “hardware not found” error and “Technical” (the RevEd guru who push-button on input 3 to give myself
the program will fail to download. moderates the forum) indicated that time to write down the current
The solution is to do the following: the strange results were due to a bug readings. After each internal
Hold down the 28X1’s reset button, in the 28X1 software and that the resonator speed change, the program
initiate the download, and then release bug would be corrected in the next idles in a loop until the button is
the reset button — the program should update to the Programming Editor pressed (at least that’s what I intend-
download successfully. software. In the meantime, I’ll just ed). The idling works properly at
use the two commands as if their every speed except 31K; in that case,
meanings were reversed, which is the software seems to reset itself. My
PROBLEMS, PROBLEMS, what I did to obtain the data deadline for submitting this article to
PROBLEMS ... presented earlier in Figure 3. Of N&V arrived and I still haven’t figured
course, when the bug is corrected, out what’s going on. I haven’t posted
Actually, my little experiment I’ll need to reverse the commands the problem on the forum yet, but at
didn’t proceed nearly as smoothly as again to straighten things out. some point I may have to give in and
the results might suggest. As I carried This little saga is one indication ask for help again! In any case, I’m
out the measurements, I encountered of just how helpful the PICAXE forum sure we’ll revisit this issue in future
two very surprising and perplexing can be and how responsive RevEd is installments of the Primer, but even if
problems. First, every measurement I to input from its user base. If you’re 31K turns out to be unsuitable for
made with the disablebod command not already a forum member, I would our battery-powered data-logger, it’s
in effect was higher than the highly recommend joining. The great to know that we can reduce
corresponding measurement with members are very knowledgeable our supply current by 90% by simply
enablebod in effect. This, of course, and willing to help. If you have a disabling BOD (with whichever
is exactly the opposite of what it question, first search the archives command works!), switching to a
should be, and I spent a fair amount because your problem may have 3.3-volt supply, and turning down
of time examining both the hardware already been addressed. If you can’t the internal resonator speed from
and software to see if I could find find what you’re looking for, post a 8 MHz to 125 kHz. In order to get a
the source of the problem. Finally, in message with a thorough description rough estimate of how long we might
expect a battery-powered 28X1
system to operate, I made a couple
of assumptions and calculated what I
think is a very conservative estimate
of battery life. I chose the Eveready
Energizer six-volt lantern battery
(#528 or 529) for two reasons: It has
a huge capacity (26,000 mAh — see
http://data.energizer.com) and
six volts should give us more than
enough headroom to supply a
3.3-volt low-dropout regulator.
As we saw in Figure 3, at 3.3 volts
the 28X1 will draw 0.17 mA at 125
kHz with BOD disabled. Of course,
we’ll also want to take various
measurements (e.g., temperature)
and perform other tasks occasionally,
so let’s triple that and assume 0.5
mA current draw on average. A full
day of operation will consume 24h x
■ FIGURE 6. Complete 0.5 mA = 12 mAh, so we can expect
setup with multimeter. 26,000/12 = 2167 days (almost six
20 August 2008
PicaxePrimer.qxd 7/8/2008 12:51 PM Page 21

PICAXE PRIMER

years) of full-time operation. In


addition, the 26,000 mAh capacity is
based on typical current drains that
are much higher than our relatively
low drain of 0.5 mA, so the actual
capacity of the battery should be
considerably higher and the
theoretical lifespan may be even
longer than six years.
On the other hand, temperature
fluctuations and other real-world
factors will probably decrease the
battery’s lifespan, but even four or
five years would be more than
adequate. We’ll also have for our
data logger monitor its own supply
voltage, so we’ll be able to determine
if our estimate turns out to be
reasonably accurate.
Finally, we haven’t even
considered how we can use the new
“hibernate” command to further
reduce the supply current (but, trust
me, we will). By the time we’re
finished with our project, it will
probably outlast the Energizer Bunny!

WHAT’S NEXT?
That’s it for our overview of the
major new features of the 28X1. It’s
an impressive chip and in future
installments, we’ll delve more deeply
into the details of many of the
features we only touched on this
month. If you want to get a head
start with any new feature or
command, don’t forget that Part 2
of the PICAXE Manual contains the
complete documentation — there’s
lots of valuable information in there.
In the next installment of the
Primer, we’ll develop our first I/O
device for use with the 28X1 (or
any processor, for that matter) — a
multi-function infrared board capable
of sending and/or receiving IR
signals in the SIRC protocol, as well
as functioning as an object detector
for robots or home control projects.
We will also explore the 28X1’s new
hserin command, which can operate
automatically in the background
while our program is tending to other
matters. In the meantime, if you want
to review the basics of PICAXE
infrared communication, take a look
at last February’s column. NV
August 2008 21
NutNVolt200808.qxd 7/7/2008 11:44 AM Page 22

Mini-Kits...
We Put The FUN In Electronics! The Building Blocks!
USB Experimenters Kit High Power LED Strobe Personal Guitar Amp Tickle-Stick
The kit has a pulsing 80 volt
tickle output and a mischie-
vous blinking LED. And who
can resist a blinking light?! Great
fun for your desk, “Hey, I told you not to touch!”
Runs on 3-6 VDC
TS4 Tickle Stick Kit $12.95
Learn how USB works! Super bright LED’s! Brand new, popular choice!
Get hands-on experience devel- The fragile glass Xenon tube is The new PGA1 allows you to Super Snoop Amplifier
oping USB interfaces! 5 digital gone, replaced with high intensity practice both your regular and Super sensitive amplifier that will
inputs, 8 digital outputs, 2 analog LED’s! Variable flash rate and bass guitars in peace! Also works pick up a pin drop at 15 feet! Full
I/O’s! Includes diagnostic soft- built-in audio trigger input to sync as a great DI to feed your home 2 watts output. Makes a great “big
ware and DLL for use with to your audio. Additional display stereo amplifier! CD/MP3 input ear” microphone. Runs on 6-15 VDC
Windows based systems. The boards also available. Runs on allows you to play to your favorite
mystery is solved with this kit! 12VDC or use our AC125 PS. music. Includes case shown! BN9 Super Snoop Amp Kit $9.95

K8055 USB Exp. Kit 49.95 LEDS1C LED Strobe Kit 44.95 PGA1 Guitar Amp Kit 64.95 Dripping Faucet
Produces a very pleasant, but
ECG Heart Monitor Plasma Generator HV Ion Generator obnoxious, repetitive “plink, plink”
sound! Learn how a simple transis-
tor oscillator and a 555 timer can make
such a sound! Runs on 4-9 VDC.
EDF1 Dripping Faucet Kit $12.95

Touch Switch
Check your own heart! Generate 2” sparks! Make a blast of fresh air! Touch on, touch off, or momen-
tary touch hold, your choice! Uses
Provides a visible and audible dis- Produces a stunning and shocking Generates a steady state DC volt- CMOS technology. Runs on 6-12 VDC
play of your heart rhythm! 25kV at 20kHz from a solid state age at constant non-pulsed cur- and drives any load up to 100 mA.
Variable gain, bright “beat” LED, circuit! Build your own plasma rent at 7.5kV DC negative, 400uA. TS1 Touch Switch Kit $9.95
and monitor output for display on bulbs, light fluorescent tubes That’s a LOT of ions! Learn how
your scope. Just like the lab! Re- without wires and more! A great modern spacecraft use ions to
usable sensors are included. learning kit. Runs on 16VAC, accelerate through space. Runs Voice Switch
Runs on a safe 9VDC battery. order our PS21 power supply. on 12VDC or our AC125 PS. Voice activated (VOX) provides a
switched output when it hears a
ECG1C ECG/EKG Kit 44.95 PG13 Plasma Gen Kit 64.95 IG7 Ion Gen Kit 64.95 sound. Great for a hands free PTT
switch, or to turn on a recorder or light! Runs on
20W SubMini Audio Amp Digital Voice Storage Speed Radar Gun 6-12 VDC and drives a 100 mA load.
VS1 Voice Switch Kit $9.95

LED Blinky
Our #1 Mini-Kit for 31 years!
Alternately flashes two jumbo red
LED’s. Great for signs, name badges,
model railroading, and more. Runs on 3-15 VDC.
20 watts and no heat! Multiple message storage! Now YOU can be the cop!
BL1 LED Blinky Kit $7.95
Delivers a super clean 20W out- The Bullshooter-II provides up to Our famous Speedy radar gun
put from one SMT package! Ultra 8 minutes of digital voice storage teaches you doppler effect the DTMF Tone Decoder
efficient class D design produces that can be broken down into 8 fun way! Digital readout displays
no heat. PCB can be snapped separate stored messages! Great in MPH, KPH, or FPS. 1/8th mile Decodes DTMF Touch Tones from
into a small circle for special for announcements, etc. Built-in range is typical. You supply two telephones, radios, etc. 200mA
applications. Runs on 18VDC for mic plus external input. Runs on coffee cans! Runs on 12VDC or output drives relays, LEDs, digi-
rated output, use our SPS18 PS. 12VDC or our AC125 PS. our AC125 power supply. tal devices, and more. Decodes
0-9, *, #, A, B, C, D. Runs on 5VDC
UAM2 20W SMT Amp Kit 34.95 BS2C Bullshooter-II Kit 69.95 SG7 Speedy Radar Kit 59.95 TT7 DTMF Decoder Kit $24.95

Doppler Direction Finder Touch-Tone Reader Signal Magnet Antenna Code Practice Oscillator
Great starter kit for young and
old! Learn code the easy way
with this easy to build kit!
Adjustable tone and built-in key lets you practice
anywhere you go! Runs on 9V battery.
CPO3 Code Practice Oscillator Kit $14.95

Find that transmitter quick! Read the number dialed! Pulls in distant stations! Light Activated Switch
Track down jammers and hidden The Tone Grabber captures dialed Super Hi-Q ferrite rod antenna Save electricity and have your
transmitters with ease! 22.5 phone numbers, repeater codes, with Faraday shield eliminates devices turn off at dusk and on at
degree bearing indicator with control codes, or anything that noise from power lines, dimmers, dawn! Closes an on-board SPDT
adjustable damping, phase inver- uses touch-tone signaling. Flash static and more! Great results relay. Adjustable sensitivity over a wide range.
sion, scan and more. Includes 5 micro stores 640 digits! Phone from 500kHz to 15MHz. Super Runs on 12-15VDC.
piece antenna kit. Runs on line and audio inputs. Runs on for AM broadcast band! Includes
12VDC vehicle or battery power. 12VDC or our AC125 PS. power supply. MK125 Light Activated Switch Kit $8.95

DDF1 Dir. Finder Kit 169.95 TG2C Tone Grabber Kit 69.95 SM100 Sig Magnet Kit 89.95 Water Sensor Alarm
The sump pump quits...and what do
✔ It’s impossible to give you full specs on these products you do? You don’t live in the base-

Did You Know... in a 1” space!


✔ A lot of our kits are also available “factory assembled
and tested”, if you don’t want to build it!
ment! This cute little sensor detects
water and sounds an alarm to let
you know! Simply mount the alarm
✔ We have over 350 products currently available, and contacts in the area you want to
all those don’t fit here! detect. The sensor section can even
be remotely located from the alarm!

The Solution!
Runs on a standard 9V battery (not
Visit www.ramseykits.com included).
Free Giveaways and ALL the MK108 Water Sensor Alarm Kit $7.95
information you ever needed!
NutNVolt200808.qxd 7/7/2008 11:48 AM Page 23

Subminiature 40W Stereo Amplifier OBDII CarChip Pro


✔ 2 independent 20 watt amplifiers in one ✔ Monitor vehicle performance to save gas!
SMT package! ✔ Stores up to 300 hours of trip details!
✔ Super efficient Class D spread spectrum design! ✔ Records time, date, distance, speed, events
✔ Built-in click and pop suppression! and up to 4 separate engine parameters!
✔ Selectable gain from +22dB to +36dB! ✔ Records extreme acceleration and braking!
✔ Logic level mute and shutdown! ✔ Automatic accident log, records the last 20
✔ Runs cool, no heat sink required! seconds before impact!
S!
For
SAVE GA
✔ Built-in thermal protection! ✔ View and reset engine diagnostic trouble codes!
✔ Runs on 10 to 18 VDC New008 ✔ Test for preliminary emissions status!
2 No comments are necessary this summer about the
cost of gas! Last month’s ad said approaching 4 bucks.
40 Watts, 87% Efficient, No Heat, All On A 2½” Board! Look what happened in a month, now it’s approaching
5 bucks a gallon! At that price it’s more important than
The UAM4 is the big brother to the extremely popular UAM2. It uses the latest ever to make sure your vehicle is in tip-top shape for
spread spectrum amplifier technology to bring you clear, crisp, high-power audio the most economical performance possible.
without any of the heat which is normally associated with such an amplifier. Its
extremely clean Class D design produces two independent 20 watt outputs! This Did you know old spark plugs can reduce fuel economy by 30%? It gets worse...
can also be bridged to an extremely efficient (87%!) single channel (mono) 40 a bad oxygen sensor cuts it by 40%! And that relates to a lot of extra gas and at
watt amplifier. 5 bucks a gallon, just do the math... That’s a LOT of money!

And at 40 watts, you’re probably already wondering about the heatsink require- With the CarChip Pro you'll have complete access to all your vehicles diagnostic
ments to dissapate the heat, right? Stop wondering, there’s no heat, so there is data at your fingertips! Sort miles by type (business, personal or driver), set
no heatsink required! And all that power is generated in a single SMT device the thresholds for alarms, calculate gas mileage, log extreme acceleration and brak-
size of your thumbnail on a small 2½” square board! ing, speed, engine parameters, and a whole lot more! And as you know,
extreme acceleration does not equal fuel economy! Find out who’s driving your
The high impedance input is designed to use your choice of either a balanced line vehicle like a race car...and deal with it!
input or an unbalanced signal source using easy to connect Euro terminal blocks.
Logic connections to ground are also provided to mute and/or shut down the The CarChip Pro is great if you have a new driver in the family. Easily monitor
amplifier. You can also enable the built-in over temperature signal to activate one their performance and let them gain additional privileges with a good driving
of these controls automatically! Easy to use board jumpers offer selectable gain of record! You have the proof!
+22dB, +25dB, +29.5dB or +36dB to match your input levels. Board jumpers
also enable protection and shutdown options as well as stereo/mono/bridge No more taking your car in to see why your “check engine” light is on. The
mode. The amplifier also features built-in click and pop suppression to protect CarChip Pro will automatically provide the trouble codes and allow you to reset
not only your ears and sanity, but your speakers and equipment! it! CarChip Pro includes storage for up to 300 hours of driving data! If you're
unfortunate enough to be involved in an accident, it even records all the vehicle’s
Power input for maximum rated output is 18VDC at 2.64A. Input voltage can be parameters for the last critical 20 seconds of operation! Includes USB cable, soft-
reduced to a minimum of 10VDC while maintaining the same high efficiency ware and complete instructions.
operation with reduced output power. If you’re looking for an incredible stand- 8226 Davis OBDII CarChip Pro Data Logger $99.95
alone stereo (or mono) amplifier to build into your equipment, vehicle, speakers,
or application, the UAM4 is the latest and the greatest!
Digital Controled FM
UAM4 40W Subminiature Stereo Audio Amplifier Kit $69.95 Stereo Transmitters
✔ Rock stable PLL synthesized exciter
Passive Aircraft Airband Receiver ✔ Front panel digital control and
✔ Monitors the entire 118-136 MHz aircraft display of all parameters!
band without tuning! ✔ Professional metal case
✔ Great for air shows! ✔ Super audio quality!
✔ Passive design, can be used onboard aircraft! ✔ 25mW kit and 1W export models!
✔ Patented circuit and design! For nearly a decade we’ve been the leader in hobbyist FM radio transmitters.
For decades we have been known for our novel and creative When it became time for a new model, we started from the ground up! We told
product designs. Well, check this one out! An aircraft receiver our engineers we wanted a new technology transmitter that would provide
that receives all nearby traffic without any tuning. It gets better... FM100 series quality without the advanced mixer features. They took it as a
there is no local oscillator so it doesn't produce, and can't pro- challenge and designed not one, but TWO transmitters!
duce, any interference associated with all other receivers with an
LO. That means you can use it onboard aircraft as a passive The FM30 is designed using through-hole technolo-
device! And what will you hear? The closest and strongest traffic, gy and components and is available only as a do-it-
mainly, the one you're sitting in! How unique is this? We have a patent on it, yourself kit, with a 25mW output very similar to our
and that says it all! FM25 series. Then the engineers redesigned their
brand-new design using surface mount technology
This broadband radio monitors transmissions over the entire aircraft band of 118- (SMT) for a very special factory assembled and test-
136 MHz. The way it works is simple. With AM the strongest man wins! The ed FM35WT version, with 1W output for our export-
strongest signal within the pass band of the radio will be heard. Just imagine the only market! Both are designed around an RF tight
excitement at air shows. No need to look up frequencies, just listen to the air-air, vinyl clad metal enclosure for noise free and inter-
air-to-ground, and air boss traffic active at the moment! Receiver sensitivity is less ference free operation. All settings are done
than 2uV for detectable audio. Headset cord is coupled as the antenna giving through the front panel digital control and LCD dis-
you great reception. Also includes a set of stereo ear buds. Runs on a standard play and are stored in non-volatile memory for
9V battery. Available as a thru-hole kit or factory assembled & tested SMT version. future use.

ABM1 Passive Aircraft Airband Receiver Kit $89.95 Both the FM30 and FM35WT operate on 13.8 to 16VDC and include a 15VDC
ABM1WT Factory Assembled & Tested ABM1, SMT Version $159.95 110/220VAC plug in power supply. The stylish black anodized aluminum case
measures 5.55"W x 6.45"D x 1.5"H. and is a great match to your other equip-
ment.
3-In-1 Multifunction Lab
(Note: After assembly of this do-it-yourself hobby kit, the user is responsible for
The handiest item for your bench! Includes a complying with all FCC rules & regulations within the US, or any regulations of
RoHS compliant temp controlled soldering sta- their respective governing body. FM35BWT is for export use and can only be
tion, digital multimeter, and a regulated lab shipped to locations outside the continental US or valid APO/FPO addresses or
power supply! All-in-one small unit for your valid customs brokers for end delivery outside the continental US.)
bench! It can’t be beat! The PS provides 3, 4.5, 6, 7.5, 9, and 12VDC regulated
outputs at 2A peak. Unclutter your bench today with the 3-In-1 Lab! FM30B Digital FM Stereo Transmitter Kit, 0-25mW $199.95
LAB1U 3-In-1 Multifunction Lab $129.95 FM35BWT Export Only Transmitter Assembled, 1W $299.95

th
Year!
In Our 36 800-446-2295
www.ramseykits.com
MORE than just friendly on-line ordering!
590 Fishers Station Drive Clearance Specials, User Forums, Dealer Information, FAQ’s, Kit Building Guides, Downloads, Live
Weather, Live Webcams, and much more!
Victor, NY 14564
(800) 446-2295 Prices, availability, and specifications are subject to change. We’re not responsible for typos, mistakes, stupids, or
August sunburns! Robin’s soldering quest continues, but the boat has won over! Visit www.ramseykits.com for the 112 Pages! Get The
(585) 924-4560 latest pricing, specials, terms and conditions. Copyright 2008 Ramsey Electronics, LLC...so there! Latest Catalog Today!
Page24.qxd 7/8/2008 3:25 PM Page 24

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 • sales@seetron.com

24 August 2008
Full Page.qxd 7/7/2008 2:20 PM Page 25
Q&A.qxd 7/7/2008 4:05 PM Page 26

■ WITH RUSSELL KINCAID


QA & WHAT’S UP:
Join us as we delve into the
basics of electronics as applied
to every day problems, like:
In this column, I answer questions about all
aspects of electronics, including computer ✓ Fly Zapper

✓ Vacuum Tube Circuit
hardware, software, circuits, electronic theory,
troubleshooting, and anything else of interest
to the hobbyist. Feel free to participate with

your questions, comments, or suggestions.
Send all questions and comments to:
✓ Solar Tracker

Q&A@nutsvolts.com

This calls for a flip-flop. I have mounts in a rectangular hole; you will
RAILROAD CROSSING
LIGHT CONTROLLER
I am a volunteer
A used a 555 oscillator driving
an SN74LS74 and two solid-
state switches (see Figure 1).
The oscillator is designed to run at 2 Hz,
have to file it to fit, and the toggle
switch mounts in a round hole — just
drill it. A five volt power supply is
needed and the power is low, under

Q worker/helper at a small
local history museum
located in Tullahoma,TN.
We have a two arm RR crossing light
that has been modified with small
but you may want to make the
frequency variable by replacing R2
with a rheostat connected 500K pot.
The SN74LS74 is a dual D type
flip-flop and I have connected them
1/2 watt. If you don’t have a spare
kicking around, this $8.70 unit from
Mouser will do: 826-DA4-050US.

AUTOMATIC ON/OFF
110V holders and lamps. I would in parallel to give more drive to the
like to buy/build a controller to solid-state switch. The output is SWITCH
alternately light the lamps so that arranged to pull down because TTL
when one goes out, the other will does not pull up very well. The switch My project is to design and
come on. Do you happen to have
any ideas?
— Greg Klein
is an opto triac rated at two amps, so
it will operate a 100 watt lamp with
no problem. The rocker switch Q build an automatic on/off
circuitry for a remotely
located audio amplifier. The

■ FIGURE 1
26 August 2008
Q&A.qxd 7/7/2008 4:05 PM Page 27

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

function is to switch the


120 VAC on and off with a
device that is triggered by a
three volt audio signal from
the preamp. A shielded
cable will deliver the signal
to the automatic switch.
Since a portion of the
circuitry is always exposed
(AC) and it will be remotely
located with the amplifier, I
wish to use good quality
components. Could you
suggest some alternatives.
My assumptions include a
high impedance input to
the triggering device
feeding an electronic and/or
electromechanical switching
device. Surface-mount
devices are not a necessity.
Thanks in advance for your
assistance.
— Paul Lunn

Since the audio is

A being used to turn


the power amp
on, and since the
signal will vary in amplitude, ■ FIGURE 2
I have designed a time delay
turn off when the signal goes away of gain. If the preamp output is ground adjustment? Something with a
about one second (see Figure 2). If it referenced, C1 and R2 could be frequency response as good as or
is possible that the audio will have eliminated. better than HD TV audio? A single
quiet times exceeding one second, chip amp would be fine since it does
you will want to increase C2. The not need to have a high power
design includes the power supply
AUDIO LEVEL ADJUST output and my preference would be
which provides ±8V volts to the CIRCUIT for thru-hole technology as my eyes
switch circuit. I included L1 and L2 to are not what they used to be.
reduce current spiking and make the I have a whole-house audio — Jon Wilbert
supply quieter.
U1 is a dual op-amp; the first
stage is a half wave rectifier with a
gain of two. With a three volt peak
input, the capacitor, C2, will be
Q system that I’d like to
connect to two different
TVs as audio sources. The
problem is, the TV line level audio
out is considerably lower than my A
Two channel mixer with
adjustable gain ... piece of
cake! The signal is undoubt-
edly stereo, so two pairs of
charged to six volts. The second other components (CD player, FM op-amps are needed. Separate
stage is a unity gain buffer to drive radio, etc.) and is not adjustable. So volume control for each channel is
the opto triac switch. The triac is a when I switch to the TV source, I provided (see Figure 3). Most audio
zero crossing switch, so it should not have to turn up the room volume. devices nowadays use RCA jacks, so I
produce much noise. The opto triac Then when I switch back to the radio included those in the parts list. The
specs are: must turn on at four volts or CD player, the audio blares out power supply can be 12 volts (±6V)
input and must turn off at one volt the speakers if I forget to turn down or use the power supply of Figure 2
input. I included specs for a heatsink, the room volume. I’ve looked at some (±8V). The parts list is for a 12 volt
although I doubt it will be needed. of the electronic kit suppliers, but I’ve DC wall wart, but if you have one in
From an initial charge of six volts, it not seen anything like this. your junk box that is between 10 and
takes about one second to get down Can you recommend a circuit for 16 volts, use that. If you use the power
to one volt. The resistor, R1, is for a two channel audio level shifter with supply in Figure 2, R1 and R2 are not
static protection; it has no effect on (I’m guessing) a unity-to-5x gain needed. The gain in each channel is
August 2008 27
Q&A.qxd 7/7/2008 4:06 PM Page 28

maximum 5 and minimum just under two coils for old VW Beatles without
unity. The op-amp unity gain the caps and the local auto supply VACUUM TUBE
bandwidth is 3.5 MHz so that is not a store (Pep Boys) wants an arm and a EQUIVALENT CIRCUIT
concern and distortion will be nil as leg for the caps.
long as the amplitude of the output Also, for me to use your circuit I I have a circuit that I got
does not exceed VCC-two volts peak.

FLY ZAPPER
In the September ‘07 issue
would need it to fire about 2X per
second. I’ll call it RussKin’s Critter
Getter. Any ideas on that? I’ll bet that
arm and leg that many people have
the same problem with critters!
Q from a magazine (transistor),
but I wonder if I could
convert it to tubes. I know
tubes are old technology, but I like
them. My endeavor was the circuit in

Q (page 30, Figure 4), I am


interested in the fly zapper
schematic. I have a raccoon
— Bob Jay (long-time subscriber)

I can help you with the cap:


Figure 4 — an OTL tube circuit. I had
to make some compromises but I
wonder if this scheme would work?
tearing up our trash even though it is
heavily secure. The coon is smart, big,
and strong. Here’s my thought — I do
know a little about auto ignition and
for the coil to output a good strong
A 0.068 µF from Mouser, 72
cents, part number 5989-
1KV.068-F. You can connect
the cap across the coil primary and
eliminate R1 and D1. To make the
The first tube is a pentode and a triode
in one. The other tubes are power
pentodes. I’m not sure if the biasing is
right. I do know the transistor circuit
says that the 680K R2 is adjusted to
spark, it needs the correct ignition 555 run at 2 Hz, change R2 to 1.2K bring Q4, Q5 emitters to half the supply
cap. Cap needs to be around 0.06 µF, and R3 to 3.3 meg. Use C2 = 0.1 µF, voltage. Is this tube circuit practical?
but that depends on coil make. I have Mouser part number 5989-250V.1-F. One thing I know, the speaker will
have to be higher impedance.
— Craig Kendrick Sellen
Carbondale, PA

DC coupled tube circuits

A are difficult. Tektronix used


to do it using NE-2 neon
bulbs for level shifting.
But let me list the problems with the
tube circuit:

1) There is no tube equivalent for a


PNP transistor. The cascode circuit
will have low impedance pulling up
and high impedance pulling down.
That will not be a problem if the
speaker impedance is high enough;
but high impedance implies low
power, and I don’t know where you
would find such a speaker.

2) With the cathodes at different


potentials, you can’t connect the
screens together.

3) With V5 cathode near ground and


V7 cathode at –V, V7 will be saturat-
ed. R8 should return to –V and V7
needs a resistor in series with the
cathode to limit the current.

4) The connection between V4 plate


and V5 grid is the place to put the
NE-2 neon to bring the grid down
close to –V.

■ FIGURE 3 Enough of the critique; vacuum


28 August 2008
Q&A.qxd 7/7/2008 4:06 PM Page 29

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

■ FIGURE 4

tubes should be operated push-pull, seven watts. The bias current in the
class AB, for reasonable power final stage is arbitrary; I chose 10 800 MHZ BUSINESS
output and low distortion. I have mA, so you would adjust the negative BAND COMMUNICATION
modified your design in Figure 5. The bias to obtain one volt DC at each
final stage is AC coupled because cathode. Matched 6V6 tubes will be Can you tell me where I
there is no point in maintaining DC
coupling, and it would be difficult.
The first stage gain is about 60
(6.8K/110), but the second stage is
just a phase splitter — it has no
necessary. According to my tube
manual, the output transformer
should be 10KCT: eight ohms. I
have labeled the schematic with
the expected voltages and currents.
Q might get a book on FM
communication decoding
and encoding? Or, maybe
at least a schematic? If it matters, it’s
for the 800 MHz business band FM. I
gain. You will need a preamp to get If you build it, let me know how have been monitoring the band for
the maximum power output of it works! 4+ years now — just a hobby.

■ FIGURE 5

August 2008 29
Q&A.qxd 7/7/2008 4:06 PM Page 30

■ FIGURE 6 ■ FIGURE 7 it for its simplicity


but can’t seem to
make it work. What
do I do to get this
circuit to work? In
theory, it sounds
good. Could there
be an error in this
circuit? I recently
used a Darlington
transistor in place
of the 2N2222
transistor; same
results, it still
touch probe would work correctly. doesn’t work. What do I try next?
Because of this change, your original I won’t give up after so many years
schematic for the Tool Setter will of trying.
no longer work. Do you think you
could take a second look at this 2) Figure 7 is an automatic solar
circuit for me? Here are the new charger that turns on my solar lights
criteria for the Tool Setter: all around my house. While experi-
So, if you know where I might buy menting with different MOSFETs, I
such a book, I would appreciate it. 1) The circuit is now normally closed find that the lights go on when it is
— George Gunter USN (Ret.) (NC) and must open when a tool still reasonably light outside due to
touches the top plate. the internal resistance of the
I know nothing about this MOSFET. I have not tried changing

A but if the signal is not clear


voice, it may be frequency
hopping spread spectrum. I
don’t think a schematic is applicable
in this case. I found a few books at
2) The secondary part of the circuit
needs to be isolated from the frame
of the milling machine.

3) We can still use a battery to power


the voltage divider resistors, especially
the 1K resistor, R2. Normally, it
would be a simple task to just try
changing the value of the resistor
but unfortunately, the control box
Barnes & Noble that may be of the primary circuit. housing for the circuit is mounted
interest: Spread Spectrum in in a difficult place. That is why
Communication, ISBN-13: 4) I still would like an LED to come I am asking your opinion on this
9780863410345; Principles of Spread on when a tool touches the top plate. particular circuit.
Spectrum Communication, — Bill Blackburn
ISBN-13:9780201633740; and 3) Do you have any simple solar
Crypto: How the Code Rebels Beat The solution is simple: just circuits that charge a battery during
the Government-Saving Privacy in the
Digital Age, ISBN-13: 9780786521951.
Another possibility is that the
signal you are trying to receive may
be digital voice. Cell phones operate
A replace the HSR312 solid-
state relay with the normally
closed G3VM-353A,
Mouser part number 653-G3VM-353A.
the day then at night switch on the
outside lights? I am now using some
super bright 39 cluster LEDs which
operate on 12 volts DC.
— Antonio J. Anzevino
in this band and I believe most, if
not all, are now digital voice. If that
SOLAR TRACKER 1) There are no specs for
is the case, this book may be helpful:
Telecommunications and Data
Communications Handbook, ISBN-13:
9780470041413. Q
I have three questions:
1) I am in need of a simple
solar tracker schematic.
Some years ago, T. J. Byers
sent me one that for some reason, I
A the RadioShack photo
transistor, so there is no
way to know if it should
work or not. I suspect that if you buy
enough of them, you will find a pair
can’t get to work (Figure 6). I have that work. BTW, the shorter lead of
TOOL SETTER REVISITED changed components many times. I the photo transistor is the collector.
I require a little more help wired the two pin photo transistors Instead of a photo transistor, try

Q with the Tool Setter circuit


you designed for my milling
machine (May ‘08, page
25). I had to reverse the contact logic
in the milling machine so that my
both ways (no pin info); maybe you
can supply that info for me — which is
the collector, the longer lead or the
shorter one? I’ve been working with
the schematic over the years and like
using a CdS photo resistor,
RadioShack No. 276-1657. There are
five in the package so you should
find two that will work. It may work
without modification, but if you make
30 August 2008
Q&A.qxd 7/7/2008 4:07 PM Page 31

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

R1 a 500K pot ■ FIGURE 9


(rheostat), you can
adjust it such that the
motor starts running
when Q1 is partially
shaded.
The way the
circuit works is this:
Q3 is the daylight/
dark detector. In
daylight, the photo
transistor (and CdS
cell) is low resistance,
which allows the motor to run. Q1 is minor effect on when the lights come
shaded by an east-west wall for the on, but when the 12 volt solar panel
elevation servo and by a north-south output gets down to 0.6 volts, it
wall for the azimuth servo. When Q1 should be quite dark. You can gain
is shaded, the base of Q2 is raised some by removing R1 but that is only
which closes the relay and starts the 50 millivolts difference, again minor.
motor running. Bottom line, there is not much that
When sunlight falls on Q1, the can be done to vary the light level
base is pulled down and the motor that determines when the lights
stops. You will want a way to return come on.
the servos to the starting position, ■ FIGURE 8
ready for the next day. 3) Changing Q1 to a comparator as
An alarm clock could be used for in Figure 9 will provide the variability consisting of up to 10 cells.
that or, another CdS cell as in Figure that you want. The threshold can be What limits the charger to this
8. When it is dark, the transistor is adjusted all the way to zero; in which maximum number of cells? If I
energized, causing the motor to run case, the lights may never come on. use a power supply with more than
backwards until the tracker hits the 20 volts, can I use this to charge
normally closed limit switch, which greater numbers of cells?Per your
opens the circuit.
NIMH BATTERY description, I would change the
CHARGER charge current by a bit because
2) It is not the MOSFET resistance new cell capacities are always being
that determines when the lights In the N&V July ‘07 Q&A introduced and, of course, the sense
come on, it is the voltage output of
the solar panel. The turn-on voltage
of the FET and the value of R2 has a

■ FIGURE 10
Q column, you provided a
PIC-based charger circuit
for NiMH batteries
voltage divider (R4, R5) would also
need adjusting.
— Dave Carpenter

August 2008 31
Q&A.qxd 7/7/2008 4:07 PM Page 32

a true RMS meter, and calculate the current.


MAILBAG We might also mention the current rating of the
transformer. There has been some discussion of this
Dear Russell, recently. For a bridge rectifier and 10 amps DC output,
In your answer to Geff Waite, I was glad to see the transformer should be rated at 16 to 18 amps
your comment about the capacitor ripple current. RMS (depending on which transformer manufacturer’s
Too often it is ignored. Unfortunately, it isn’t quite as guidelines you follow). And there’s always the
simple as you said. Different manufacturers, different question, build or buy? Marlin P. Jones and Assoc.
series from the same manufacturer, and different cap www.mpja.com) sells a 24 volt 12.5 amp switching
(w
values have different ripple current ratings. A few of power supply (no. 16489-PS) for $97.
the caps in the Mouser and Digi-Key catalogs have — Bill Stiles
ripple current ratings. Most manufacturers’ capacitor
datasheets give the ripple current ratings. The quickest Thanks for the feedback, Bill. I had not noticed
way to get the datasheets is to do an Internet search that current rating goes up with voltage rating.
of the manufacturer’s name and the capacitor series ID. Good info.
A quick look at the Mouser catalog gives some
examples. For Xicon snap-mount, series LS, a 25 volt Dear Russell,
4,700 µF cap is rated at 2.31 amps ripple current, In response to your statement that “There is no
while a 63 volt 4,700 µF cap is rated at 3.49 amps, and quality of sound advantage in hybrid digital; analog
a 200 volt, 2,200 µF is rated at 5 amps! For nearly every FM stations already transmit more bandwidth than
cap series of every manufacturer, the ripple current most people can hear and with low distortion,” I
goes up (and the ESR goes down) as the voltage should like to invite you to my home in a northern
rating is increased. Because of this, I try to stay away suburb of New York City where I, a classical musician,
from low voltage caps, even in low voltage circuits. can find virtually the only listenable FM by pointing
(This difference may be primarily from the can size; my 14-element beam at lower Connecticut. There I
a larger can has better heat dissipation.) will demonstrate what happens when I tune WSHU
For the 10 amp DC output of Mr. Waites’ power at 91.1 and wait for my Sangean HDT-1 tuner to
supply, the ripple current would be 13 to 15 amps, recognize the signal as digital, at which point the
depending on the resistance of the transformer background noise drops out, the separation increases,
windings and other factors (including the effective and all I hear is music.
series resistance of the AC power line). For any power I am now waiting for the one “classical” station
supply, if the caps seem to run warm, the ripple from New York City to go digital so I can receive it
current may be too high. The easiest cure is to parallel without the multipath distortion which makes it
more caps. The actual ripple current can be measured virtually unusable.
fairly easily. Connect a 0.1 ohm or smaller, 1%, three — Robert Voss
watt resistor (available from Mouser) in series with
the cap, measure the voltage across the resistor with Not having had the experience of multipath
distortion with FM radio, I was not
aware that it was a problem. I get
excellent reception of classical
music from WCRB, Boston at 99.5,
50 miles away. I believe WCRB is
hybrid digital also; you should be
able to receive it.

The schematic (Figure 10) is

A modified to charge 20 cells.


I added R9 and D5 because
33 volts exceeds the input
rating of the 78L05. I also added R10
to reduce the input to ground (ADJ)
voltage. R10 is not strictly needed
because the 317 is rated 40 volts
input, but it shows what needs to be
done if the voltage goes much higher.
I changed the voltage divider, R4 and
R5, to provide three volts max to the
A/D. The A/D voltage only has to
stay between 1V and 4V as the
batteries charge. NV
32 August 2008
Full Page.qxd 7/8/2008 2:55 PM Page 33

Microcontrollers
USB Connectivity for
Embedded Designs

Digital Signal
Controllers
The Microchip name and logo, the Microchip logo and PIC are registered trademarks of Microchip Technology Incorporated in the USA and in other countries. © 2008, Microchip Technology Incorporated. All rights reserved.

Serial Analog
EEPROMs
2nd line
Microchip Direct...
If you need Full-Speed USB 2.0 device, embedded host, dual role and USB Starter Kits accelerate development
On-The-Go solutions, Microchip Technology has them available today. of USB designs using 8-, 16- or 32-bit MCUs
We offer 8-, 16- and 32-bit MCUs with USB connectivity, providing easy starting at only $59.98
migration with a single development environment. This maximizes
pin compatibility and seamless code migration from 20 to 100 pins,
enabling you to scale your USB design with ease.

Download FREE USB software including source code:


t Host Stack t Thumb Drive Support (Mass Storage
t OTG Stack Driver, SCSI Interface, 16-bit and 32-bit
t Device Stack File Management, Application Software)
t Class Drivers (HID, Mass Storage and
CDC Drivers)

Core Flash Program Memory Pins USB Type


8-bit Up to 128 Kbytes 20 - 80 Device
16-bit Up to 256 Kbytes 64 - 100 Device, Embedded Host, Dual Role, OTG
32-bit Up to 512 Kbytes 64 - 100 Device, Embedded Host, Dual Role, OTG

www.microchip.com/usb
AUG08 - NewProducts.qxd 7/9/2008 2:07 PM Page 34

■ HARDWARE

FULL FEATURED 60 MHz


NEW
P R
ease of use (Auto)
O D U C
NEW LOW-COST
■ SOFTWARE
■ GADGETS
■ TOOLS

T S

DIGITAL • Color LCD display APPROACH TO


OSCILLOSCOPE REMOTE
• USB front panel host port for
USB Flash drives and USB device TEMPERATURE/
interface standard HUMIDITY
• Advanced features include MONITORING
digital filter with adjustable limits,
mask testing, and waveform
recorder/replay mode

• Cursors with readouts

B &K Precision Corporation’s new


Model 2534 dual channel Digital
Storage Oscilloscope (DSO) delivers
• 24 automatic measurements

a combination of performance and • FFT standard plus three additional


value. This versatile bench top unit is math functions
a high-performance 60 MHz digital
oscilloscope with analog-style knobs • Extensive triggering capabilities
and controls. The Auto measurement including pulse width and line-
function makes this oscilloscope easy
to use. Advanced triggering, digital
selectable video trigger I T professionals can now save
money using the new DLP Design
Data Center System to remotely
filtering, waveform recorder, delayed • Multiple language interface monitor temperature and humidity at
sweep/zoom, mask testing, automatic locations housing sensitive electronic
measurements, and FFT functions • Capture, save, and analyze waveform equipment such as data centers and
provide the user with many options data with the included PC software computer, server, and equipment
to debug circuits. rooms. Operating 24/7/365, the DLP
The 2534 comes with PC Measuring 12.2” wide by 10.6“ Design Data Center will immediately
software that can be used to easily deep by 5.8” high, the Model 2534 send an alert email to the designated
capture, save, and analyze waveforms weighs eight pounds and comes recipient(s) when readings fall outside
and measurement results. The low complete with operating manual, the customer’s predetermined limits.
price of $799 makes it one of the 10:1 probe set (two pieces), power At no additional charge, Data Center
most aggressively priced scopes on cord, USB interface cable, and PC users can view or download
the market today. It is an ideal software installation disk. It is priced temperature and humidity data from
oscilloscope for use in education, at $799 (quantity one) and is any computer with Internet access.
design, training, field service, available for immediate delivery. The DLP Design Center can also be
maintenance, manufacturing, and For the name and location of an utilized for other industry applications
quality control. The Model 2534’s authorized distributor near you, including food service, warehouse,
features include: contact B&K Precision Corporation. and long-term storage.
Distributed by Mouser
• 60 MHz bandwidth, 400 MSa/s For more information, contact: Electronics, the new DLP-UT1 sensor
sample rate B&K Precision Corp. and DLP-UTH8 hub are low-cost
22820 Savi Ranch Parkway temperature and humidity acquisition
• 4,000 point record length for each Yorba Linda, CA 92887 products which can be purchased for
channel Tel: 714-921-9095 $29.95 for the sensor and $79.95 for
Fax: 714-921-6422 the hub. With operating temperatures
• One touch automatic setup for Web: www.bkprecision.com of 0-70°C (32-158°F), the DLP-UT1

34 August 2008
AUG08 - NewProducts.qxd 7/9/2008 2:08 PM Page 35

■ 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

sensor measures temperature on a The Propeller Proto Board


single channel, while the DLP-UTH8 USB has all the features of
is a data-collection hub with eight the Propeller Proto Board
channels that can be connected to but utilizes the USB
temperature only or temperature programming interface on
and humidity modules via standard the board for those
Intranet cables. The sensors can projects which need the
be located up to 250 feet away from USB interface in the
the UTH8 hub and are purchased application. The Proto
separately. Board provides a low cost
Designed to work with the above prototyping platform
hub and sensors, the new DLP for projects or industrial
Design Data Center monitors data applications. The new
continuously and allows for remote Propeller Proto Board USB
access and alerts. Service routine houses the incredible
software that communicates with the P8X32A-Q44 Propeller chip. keeps each cog on the same time
DLP-UT1 and DLP-UTH8 continuously The Propeller chip makes it easy reference, allowing for true
sends temperature/humidity readings to rapidly develop embedded deterministic timing and
to a secure server. For privacy, applications. Its eight processors synchronization. Two programming
customers log in to the Data Center (cogs) can operate simultaneously — languages are available: the easy-to-
with an ID and password. They can either independently or cooperatively learn high-level Spin; and Propeller
then remotely monitor, set, or change — sharing common resources through Assembly which can execute at up
temperature alert points, specify a central hub. The developer has to 160 MIPS (20 MIPS per cog).
email addresses for alert mail full control over how and when
recipients, view data from the each cog is employed; there is no
previous 24 hours in either chart or compiler-driven or operating system- For more information, contact:
graph format, or download data from driven splitting of tasks among Parallax, Inc.
Web: www.parallax.com
the previous 30 days. Customers may multiple cogs. A shared system clock
try the DLP Design Data Center for
the first month at no charge. The
Data Center service may then be
purchased for $35/six months or
$60/year through www.dlpdc.com
via credit card.
“For this level of performance,
what sets us apart from our competi-
tors is our pricing,” comments Don
Powrie, President of DLP Design, Inc.
“Our products are the best choice
when you’re trying to watch your
bottom line but need to know that
your equipment is protected.”
Datasheets are available upon request.
For more information, contact:
DLP Design, Inc.
Tel: 469-964-8027
Email: support@dlpdesign.com
Web: www.dlpdesign.com

PROPELLER
PROTO BOARD
USB TEXT

P arallax, Inc., introduces the new


Propeller Proto Board with USB.

August 2008 35
AUG08 - NewProducts.qxd 7/9/2008 2:11 PM Page 36

■ 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

FULL FEATURED a keyboard for rapid entry of including sine, square, pulse, triangle,
waveform parameters, are among ramp, sine (x) x, exponential up, and
FUNCTION the advanced, cost-effective features exponential down, plus noise;
GENERATORS of the new Protek Model B8040FD,
1 µHz-40 MHz DDS function
provides AM, FM, PM, FSK, ASK,
and PSK modulation and bursts of up

A high stability Direct Digital


Synthesis, dual output function
generator, with less than -54 dBc
generator.
This latest entry delivers 40 ppm
long term and 1 ppm short term
to 65,535 of all internal waveforms.
Frequency range is 1 µHz to 40 MHz
for sine wave; to 5 MHz square
(sine wave) harmonic distortion and stability, generates waveforms wave; and 1 MHz for all other

SHOWCASE

PP:KLWH
ZDWHUFOHDU
/('9
PFG
$% 

VHFRQGYRLFHUHFRUGHUSOD\EDFNPRGXOH
SUHDVVHPEOHG  $ 
7KH9HOOHPDQ3HUVRQDO6FRSH
LVDFRPSOHWH06VSRUWDEOH
oscilloscope. (HPS10) $146.
QGV
7KRXVD
L WH P VRQ
PRUH
E LWH
V
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 • sales@pulsar-inc.com

36 August 2008
AUG08 - NewProducts.qxd 7/9/2008 5:56 PM Page 37

■ 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

waveforms. In addition, it has a built- models: the B8003FD, with a 1 µHz at $599. All units have the same
in 100 MHz frequency counter and to 3 MHz frequency range at $387; features and functions as the
an RS-232 interface. All these fea- the B8010FC, with a 1 µHz to 10 MHz “flagship” model, except for
tures are available at a cost-saving frequency frequency ranges.
user price of $778. range at $484;
This instrument heads the firm’s and the B8020 For more information, contact:
Series B8000FD series of dual output FD, with a Protek Test and
DDS function generators which also 1 µHz to Measurement
include three (3) “lower frequency” 20 MHz range Web: www.protektest.com

SHOWCASE
Coming Soon!
A Social Networking Site for
You, the Electronics
Enthusiast!

We Need Beta Testers Now


Sign Up At:

www.solderbynumbers.com

.com

[Start from $40


[No Min Order
[Reliable Quality
[Fast Delivery
JBest Service
8www.FLYPCB.com
*Sales@flypcb.com

Printed Circuit Board Design


Schematic Capture, Auto routing, Gerbers.
Using Altium - Protel
Microprocessor
Embedded Design
Motorola, Texas Instruments, Atmel, etc.
Prototype and production runs
Fully automated SMT assembly lines.
Plastic Parts
Mold manufacturing. No order to small or too big.
Very competitive on high labor parts. For very small
orders, we can inject your parts on manual low
pressure machines, dramatically reducing the cost of
the mold (parts up to 2 oz and up to 5,000 per week).

Www.electronicdesignmexico.com

August 2008 37
Gravatt.qxd 7/9/2008 2:17 PM Page 38

●●●●
MODEL TRAIN SWITCH CONTROL
VIA PC OR PIC
BY DAN GRAVATT

This is a project I wanted to


do many years ago when I
was spending a lot of time
and money on my model
railroad. I was disappointed
by the big, clunky electrical
controllers which operated
the track switches, and I
wanted to have something
smaller and more elegant to
do the job. A computer
control system would have
been ideal, but I never got
around to designing one. Many years and several designs later, I have come
up with two versions of the control system: one PC-based and one PIC-based.

B oth designs work on the same basic principles. The


PC-based system has many possibilities for displaying
track switch status, at the expense of needing a dedicated
multiple DCC-enabled locomotives on the same track to
do different things. Add-on modules for DCC are available
to control track switches, but they are fairly expensive
computer at your model railroad control station. The and won’t work without a master DCC system. My
PIC-based system is a stand-alone direct replacement control system will work just fine on either DCC or
for the manual electrical controllers and has a simple non-DCC model railroads as it does not depend on any
three-button user interface. other hardware.
There are other control systems commercially
available for track switch control, mostly based on the Anatomy of a Track Switch
Digital Command and Control (DCC) standard. DCC
was originally designed to control model locomotives by The most common model railroad track switches —
sending power and data through the tracks, allowing often called snap switches — are electromagnetically
actuated by two solenoid coils:
one moving the track to the
“straight ahead” position and the
other for the “turn” position
(Figure 1). Reversing the polarity

■ FIGURE 1. Track switch solenoid.


When attached to the railroad
track, the lever on the end of the
solenoid moves the track section
back and forth.

38 August 2008
Gravatt.qxd 7/9/2008 2:18 PM Page 39

of the voltage on a coil does not change the track QuickBASIC on CD and don’t even know it; it can be
switch’s position and, in fact, the manual electrical found on the Windows 98SE installation disk in the direc-
controllers that come with the track switches use tory D:\tools\oldmsdos. Running QuickBASIC in a DOS
low-voltage AC. A momentary current pulse is applied to window under Windows 98SE, I had no problem writing
one or the other of the coils to make the track switch data to the printer port LPT1 using the command “OUT
change position. Unlike an electromechanical relay, &h378” where “378” is the hexadecimal address of LPT1.
no current is required to hold the track switch in If you use other programming environments or operating
position; continuously energizing either coil will cause it systems, make sure they allow you to write data directly
to burn out. to LPT1 without interference.
A second type of track switch — known as a The software performs three tasks. First, after
slow-motion or “tortoise” switch — uses a small DC motor prompting you to power-up the circuit, all track switches
and reduction gears to gradually move the track switch are reset to a known position — I arbitrarily chose “straight
from one position to the other. This type of switch is ahead.” This is done one at a time to avoid overloading
favored by modeler railroaders who want to more the power supply for the track switches. After this is
realistically simulate the movement of a real railroad finished, a table showing the track switch positions is
switch mechanism. Tortoise track switches also contain displayed along with a prompt to select a track switch to
electrical limit switches to provide feedback on the track be moved. Any time a track switch is selected, one byte
position without having to look at it — a good thing when of data is sent through LPT1 to the external decoder/driver
your model railroad is large. circuit to energize the selected coil, followed by a second
The control system I describe here is designed to byte of data to de-energize that coil. The table of track
operate snap-type track switches. However, most of the switch positions is then updated, and the software is
circuitry and code could also be applied to operating ready to move another track switch.
tortoise switches, with some modifi-
cations to the power output driver
stages. L ISTING 1
REM toggles model railroad switches using two 74HC4514 4-to-16 decoders on LPT1
PC-Based Control
System DIM switch(1 to 15) AS INTEGER
OUT &H378, 0
The PC-based control system CLS: INPUT "Power up the switch controller, then press enter", null
takes advantage of the ubiquitous PRINT: PRINT "Resetting switches, please wait..."
FOR x = 1 to 15
eight-bit parallel port, which is easily OUT &H378, x
interfaced to external TTL circuitry SLEEP 1
to operate the track switches. Any OUT &H378, 0
laptop or desktop PC will suffice switch(x) = 0
for this application, as long as its NEXT x
operating system will allow you to
Main:
directly access the printer port CLS: PRINT "Model Train Switch Control v1.0"
LPT1. Since I am not much of a PRINT
programmer, the user interface is PRINT "Switch Position Status:"
strictly bare-bones, but it could be PRINT
replaced by any custom graphical FOR x = 1 to 15
PRINT "Switch "; x; " is ";
interface you would care to write,
IF switch(x) = 0 THEN PRINT "Straight" ELSE PRINT "Turning"
as long as it follows the underlying NEXT x
principles for interfacing with the PRINT
external circuitry. INPUT "Select switch (1 through 15) to move: ", move

PC Software IF switch(move) = 0 THEN


OUT &H378, move
Development switch(move) = 1
ELSE
The software for this project OUT &H378, move * 16
(Listing 1, also available on the switch(move) = 0
Nuts & Volts website at www.nuts END IF
volts.com) is written in QuickBASIC,
SLEEP 1
mostly because I never learned any OUT &H378, 0
other PC programming languages. GOTO Main
You may have a copy of
August 2008 39
Gravatt.qxd 7/9/2008 2:19 PM Page 40

PC Circuit Theory outputs to go high, and they are used to drive LEDs
indicating the circuit status — green for ready and off
The decoder/driver circuit for the track switches is when active. Current limiting resistors are used between
very straightforward, consisting primarily of two the parallel port and the decoder inputs to help isolate
74HC4514 4 to 16 decoders and 30 TIP120 NPN the parallel port from the external circuitry. I found that
Darlington power transistors (Figure 2). There are two the current needed to drive the power transistors was
nearly identical halves of the circuit: one for driving all the less than one milliamp — well within the output drive
“straight ahead” coils in the track switches; and one for specification for HC TTL devices, so I omitted any
driving all the “turn” coils. (Note that only one of the 15 current limiting resistors between the decoders and
track switch driver circuits is shown in Figure 2 for clarity.) power transistors.
The four low bits of the parallel port feed one decoder’s Model railroads often include track switches at both
inputs, and the four high bits feed the other’s. The “0” ends of a track segment (such as a siding) that are
output of the decoders is not used since — for operated in parallel to allow a train to access that track
programming simplicity — the decoder’s Inhibit input is segment. The current rating of the TIP120 is more than
not controlled by the parallel port. Thus, one of the adequate to drive a pair of track switches in parallel, as
decoder outputs must be active at all times and, as stated each coil typically draws around 1A at 12 volts DC
before, the coils will burn out if continuously energized. (although this varies by manufacturer; I tested the circuit
The software’s “ready state” causes the “0” decoder using an Atlas-brand track switch). The TIP120 has a
built-in reverse-protection
diode to absorb the voltage
spikes generated as the
coils de-energize, protecting
the transistors and decoders
from damage.
The power supply
portion of the circuit is
designed to be operated
from the 20 VAC accessory
supply available on most
model railroad power
packs. Thus, no separate
power supply is necessary,
and the DC voltage
available from the bridge
rectifier (around 28 VDC)
is more than sufficient to
operate the track switch
solenoids. Current draw
from the 7805 voltage
regulator is minimal, so no
heatsink is required. The
low duty cycle of the
TIP120 transistors means
they do not need
heatsinks either.
Circuit layout and
construction is not critical,
though I would not
recommend using point-to-
point wiring. One word of
caution is in order on the
circuit’s operation: Make
sure the circuit is connected
to the PC’s parallel port
■ FIGURE 2. PC-based control and the software is running
system decoder/driver circuit. before applying power to
the circuit. This ensures
40 August 2008
Gravatt.qxd 7/9/2008 2:19 PM Page 41

LISTING 2
' Toggles model railroad switches using PIC16F876 and one 74HC4514 4-16 decoder
' HD44780-based LCD connects as follows:
' DB4-PortA.0, DB5-PortA.1, DB6-PortA.2, DB7-PortA.3, RS-PortA.4
' E-PortB.3, RW-Ground, DB0-3 No connect
' PortC.0-3 to decoder
' PortB.4 to INHIBIT pin on 74HC4514 so all 16 outputs can be used

switch var bit[8] ' Defined as 0 through 7!


switchnum var byte
TRISC = 0
high PortB.4
poke 129, 127 ' Turns on PortB's weak pullup resistors

for switchnum = 0 to 7 ' Loop to reset track switch positions


PORTC = switchnum
switch(switchnum) = 0
pulsout PortB.4, 40000 ' 0.4s low pulse to activate decoder
next switchnum
switchnum = 0

Main:
if switch(switchnum) = 0 then LCDOUT $fe, 2, "Switch ", dec switchnum + 1, " is Straight ", $fe, $c0, "Press ENTER
to toggle "
if switch(switchnum) = 1 then LCDOUT $fe, 2, "Switch ", dec switchnum + 1, " is Turning ", $fe, $c0, "Press
ENTER to toggle "
pause 500
select case PORTB
case 243 ' up button on PortB.2, low when pressed
switchnum = switchnum + 1
if switchnum > 7 then switchnum = 0
case 245 ' down button on PortB.1, low when pressed
switchnum = switchnum - 1
if switchnum > 8 then switchnum = 7
case 246 ' enter button on PortB.0, low when pressed
if switch(switchnum) = 0 then
switch(switchnum) = 1
PORTC = switchnum
else
switch(switchnum) = 0
PORTC = switchnum + 8
endif
pulsout PortB.4, 40000
end select
goto main

that the “0” outputs of the 74HC4514s will be


active, and there will be no unpredictable track ■ FIGURE 3. PIC-based
control system showing
switch movements. If you apply power without
track switch status
connecting to the parallel port, the decoder on LCD.
inputs will assume random states, leading to
randomly selected outputs. If you apply power
while your computer is booting up or running
other software, the states of the parallel port
data lines are unknown and most likely
incompatible with proper circuit operation.
Just for fun, try connecting some LEDs to the
parallel port’s data lines (use current limiting
resistors) and watch what they do while your
computer boots — you’ll see what I mean.

PIC-Based Control System


Although the PC-based system was easy to
August 2008 41
Gravatt.qxd 7/9/2008 2:19 PM Page 42

design and offers a lot of


■ FIGURE 4. PIC-based flexibility in the user interface,
control system circuit. it wasn’t really true to my
original intent to create a
drop-in replacement for the
multitude of electrical switch
boxes typically used to control
track switches. I decided to
take the decoder-driver circuit
from the PC-based system and
add a PIC microcontroller and
liquid crystal display (LCD) to
make a self-contained controller
(Figure 3). The controller
described here operates eight
track switches and can easily
be expanded to control 16
using the same basic operating
principles.

PIC Software
Development
The popular Microchip
PIC16F8761 forms the heart of
this project, and flowing through
that heart is the code in Listing 2
(file available on the Nuts &
Volts website). This code
performs the same three main
tasks that the PC-based software
performs and, in addition,
monitors three switch inputs
and drives the two-line by 24-
character parallel-mode LCD.
The three pushbutton
switches making up the user
interface include an up button
to increment the track switch
number, a down button to
decrement it, and an enter
button to move the selected
track switch. All three buttons
have a repeat action when held
down, to scroll through the
track switches or cause one
switch to move repeatedly (not
very useful, but fun to watch
for a few seconds). The code
determines which switch is
pressed by checking the value
of PORTB, which represents
the state of all eight Port B I/O
lines as one value. Pins PortB.5
through PortB.7 are unused and
always high, while PortB.3 (the
enable output for the LCD) is
42 August 2008
Gravatt.qxd 7/9/2008 2:20 PM Page 43

PARTS LIST
PC-Based Control System:
ITEM DIGI-KEY P/N (except for LCD) QTY
❑ 74HC4514 four to 16 decoders MM74HC4514N-ND 2
❑ TIP120 NPN Darlington power transistors TIP120-ND 30
❑ 7805 Linear voltage regulator, TO-220 package MC7805CT-BPMS-ND 1
❑ KBL04 four amp diode bridge KBL04-E4/51GI-ND 1
❑ 1000 µF 50 volt electrolytic capacitor P5186-ND 1
❑ 10 µF 50 volt electrolytic capacitor P5178-ND 1
❑ Two amp fuse F2705-ND with 3520K-ND clips 1
❑ 1K resistors 1.0KH-ND 10
❑ Green LEDs 511-1195-ND 2

PIC-Based Control System:


❑ Two-line by 24-character LCD LCD107 or LCD113 (All Electronics; 1
www.allelectronics.com)
❑ 74HC4514 four to16 decoder MM74HC4514N-ND 1
❑ PIC16F876 microcontroller PIC16F876A-I/SP-ND 1
❑ 4 MHz ceramic resonator with capacitors X902-ND 1
❑ TIP120 NPN Darlington power transistors TIP120-ND 16
❑ SPST PCB-mounted momentary switches P12223SCT-ND 3
❑ 7805 Linear voltage regulator, TO-220 package MC7805CT-BPMS-ND 1
❑ KBL04 four amp diode bridge KBL04-E4/51GI-ND 1
❑ 1000 µF 50 volt electrolytic capacitor P5186-ND 1
❑ 10 µF 50 volt electrolytic capacitor P5178-ND 1
❑ Two amp fuse F2705-ND with 3520K-ND clips 1

low and PortB.4 (the inhibit output for the 74HC4514 straight and turn coils, outputs 0-7 drive the straight coils
decoder) is high when the state of PORTB is being read. and outputs 8-15 drive the turn coils. When the enter
Valid values of PORTB for the SELECT CASE button is pressed, the binary value of the track switch
command correspond to PortB.3 and either PortB.0, coil to be activated is placed on PortC.0-PortC.3, and a
PortB.1, or PortB.2 being pulled low. Pressing more than PULSOUT command on PortB.4 sends a 400 millisecond
one button at a time — which might lead to unpredictable negative pulse to the 74HC4514’s Inhibit pin which
track switch movements — yields an invalid value of briefly enables the selected output. Adding a second
PORTB which is ignored. To minimize the parts count, 74HC4514 decoder with its inputs driven by
the internal Port B weak pull-ups are enabled, so no PortC.4–PortC.7 and its Inhibit pin driven by PortB.5
external pull-up resistors are needed for the three allows up to 16 track switches to be controlled, with
pushbutton switches. some minor changes to the code.
The position status of each track switch is stored in an
eight-bit array variable which is updated each time the Wrap-Up
enter button is pressed. The position status and/or
selected switch number is updated on the display with I hope that one of the approaches described here will
each pass through the main program loop. The LCDOUT inspire you to replace your old manual controllers with
command from PICBASIC PRO is used to drive the LCD, something more user-friendly. Or, for those not into model
which uses a standard HD44780 controller chip. All of railroads, I encourage you to come up with other uses for
PICBASIC PRO’s default parameters and pin assignments the circuits and code described here. Send your results to
for the LCDOUT command are used. Nuts & Volts. I’m sure the readers would enjoy them! NV

PIC Circuit Theory


CONTACT THE AUTHOR
The main difference between the decoder-driver Dan Gravatt is a licensed geologist in the state of
portions of the PC-based and PIC-based circuits is the use Kansas. He can be reached at dgravatt@juno.com.
of the Inhibit pin on the 74HC4514 in the PIC-based
circuit (Figure 4). This allows all 16 outputs to be low at
FOOTNOTE 1:
once, and thus they can all be used to control the track
switch coils. Rather than have separate decoders for the Programmed PIC16F876s are available from the author.
August 2008 43
Cicchinelli.qxd 7/8/2008 12:57 PM Page 44

●●●●
AUDIO SPECTRUM
ANALYZER
BY LARRY CICCHINELLI

The device described in this article


is a configurable audio spectrum
analyzer. Many of you have probably
seen spectrum analyzers on some
higher-end audio equipment, as well
as within the GUI of many audio deck
programs on your PCs. The function
of a spectrum analyzer is to view the Photo courtesy of www.visualizationsoftware.com.
frequency components of a signal.
One way to state the difference between an oscilloscope and a spectrum
analyzer is that with an oscilloscope, you see time domain presentations;
with a spectrum analyzer, you see into the frequency domain.

W hen I first thought about this project, I simply


wanted to see if I could do it. I had never worked
with Fast Fourier Transforms (FFTs) before or developed an
to about 20 kHz. The data is displayed on a graphics LCD
with a pixel matrix of 64 x 128. It uses a microprocessor-
based module with a clock speed of either 29.5 MHz or
interface and software for a graphics LCD. It was a very 59 MHz that enables a maximum display update rate of
interesting and rewarding experience! One of my primary about 5 or 10 Hz. The audio processing circuit allows you
uses for this device will be to monitor the output of a to select one attenuation value or any combination of
public address (PA) system I am responsible for. It lets three gain values.
me see if any frequencies are being over or under The program uses several separate — but coordinating
emphasized. I can also see the frequency of any feedback — files to complete the software for the system: the main
and then adjust the equalizer accordingly. Used in program, a library for the LCD, and a library specifically
conjunction with my DDS (N&V, November ‘06), it can for the menu functions. Provision has been made to allow
be used to determine the acoustic characteristics of a the user to store up to 10 custom configurations. Since
room or PA/recording system. the source code is available, you can customize the
This unit has been designed to view audio signals up program to meet your specific needs. To do this, you will
need access to a development system for the
■ FFT analysis display of a complex audio signal. microprocessor. If you do not want to incur the expense
of a development system, I will be happy to program the
microprocessor module for you if you send it to me with a
SASE. (Contact me at k3pto@arrl.net)
Although the program uses the FFT, I will not be going
into any details on how this works. There are good
descriptions of this algorithm available on the web, as well

NOTE:
Circuit board artwork is available on the
Nuts & Volts website at www.nutsvolts.com.

44 August 2008
Cicchinelli.qxd 7/9/2008 3:54 PM Page 45

as others that transform between the time domain and the


frequency domain. There is a good primer of the DFT in ■ FIGURE 1. FFT
the October ‘07 issue of Nuts & Volts. block diagram.
This device is relatively small, fitting into an enclosure
of about 6.8” x 4.8” x 2.5”, and is powered by a DC wall
wart between 9V and 15V. Someone who is better at
packaging than I am could probably fit it into a smaller
enclosure. I tried a 4.5” square box but could not quite
make it work.
The main thrust of this article is to describe each of
the circuits, some of the software, and the construction of
the system. Complete construction information, including
the bill of materials (BOM), schematics, and printed circuit
board (PCB) details can be found on my website at
WWW.QSL.NET/k3pto under the heading “Audio FFT
display.” The source code for the main program and
the libraries are also on my website, as well as at
www.nutsvolts.com. contains two series regulators: 5V and 3.3V. The 5V is
The three circuit boards embody of the following: used by the analog circuits and the 3.3V by the micro-
power supply and processor; analog circuits; and the processor and LCD. The output of the 5V regulator is also
interface for the graphics LCD. I could have put the LCD the source for the 3.3V regulator. The series resistor, R1,
interface on the same board as the processor but I reduces the power dissipation of the 5V regulator. If you
decided to make it a separate board for two reasons: (1) it want to optimize the circuit a little, you can change the
allows the LCD to be ported to other projects more easily; resistor based on the wall wart you use. The analog circuit
and (2) the board has very fine and closely spaced traces current is about 20 mA (mostly due to the relay) and the
(.020” pitch). I felt it would be advantageous to have a 3.3V current is either 70 mA or 140 mA, depending on
separate board just in case the first assembly attempt fails. the processor board you are using. You have to have at
Then only this board would be affected — see the least 7V on the input of the 5V regulator for proper
Construction Notes elsewhere in this article. operation. With a 10 ohm resistor, the voltage drop with
Figure 1 is a block diagram of the system. Note that 200 mA will be about 2V. So, a 9V wall wart is sufficient
the controlpath to the display and the ADC are over SPI to power the unit that uses the faster processor. If you
(Synchronous Peripheral Interface). This is a serial commu- choose to use the slower processor, then a 20 ohm
nications protocol designed by Motorola in the 1960s. It is resistor will be a better choice. Be sure to get a resistor
a popular method of enabling a microprocessor to with the appropriate power rating.
communicate with peripheral devices, usually on the same There are two main functions the Input Amplifier/
circuit board. With SPI, you can control
several devices connected to the
controller via a serial bus that has the
following signals: Clock, Data In, and
Data Out. Each controlled device also
requires a separate Chip Select signal.
When implementing an SPI
system with multiple devices, you
need to make sure that the proper
phase relationship (there are four
possibilities) between the clock and the
data is maintained for each device. In
this system, both devices use the
same clock to data phasing. One
project I built (see N&V November
‘06) used two devices from the same
manufacturer that had different clock
to data phasing so I had to adjust the
phase each time I initiated communi- ■ FIGURE 2. The power
cations with one of them and then supply module.
put it back when done.
The power supply (Figure 2)
August 2008 45
Cicchinelli.qxd 7/8/2008 12:59 PM Page 46

Attenuator circuit (Figure 3) must perform: (1) give the programmable amplification function. The three circuits
input signal a fixed 2.5V offset; and (2) present an are essentially identical except for the gain values. This
approximately 1 VRMS signal to the input of the ADC. description references the circuit of IC1.2. The values
The 2.5V offset is required because the op-amps and ADC of the feedback resistors (R10 and R11) need to be
are powered by a single supply (+5V) and will operate determined based on your specific requirements. The gain
properly only with positive input signal voltages. This of the circuit is RFB/R9 (RFB is the feedback resistor). You
circuit allows the input voltage to be symmetrical around can calculate the resistor values based on the signals you
ground. Resistors R1 and R2 form a voltage divider that want to measure and the gain required to get 1 VRMS.
allows you to measure voltages greater than what can be IC3 is an analog switch that allows you to select between
sent through the op-amp circuits. The voltage applied to two gain values for the stage by switching R11 in or
the input side of R5 needs to be symmetrical about shorting it. With the switch closed, the gain is 1 (0 db);
ground and no larger than about 1 VRMS. with the switch open, the gain is 10 (20 db). The reason
The circuit of IC1.1 gives the input signal the required the switch for R11 (IC3) looks backwards as compared to
2.5V offset by configuring the op-amp as a “follower with IC4 and IC5 is that the board was easier to lay out with
gain.” The gain is two and is set by the formula: (R4/R3) + 1. pins 1 and 2 reversed.
The reason for the gain of two is that R5 and R6 essentially These resistor values and the relay allow for the
form a divide-by-two circuit. The resistors in this circuit following attenuation/gain values: attenuation = 28:1
(R3-R6) should not be modified. Neither should the voltage (about -30db); gain = 0 db, 10 db, 20 db, 30 db, 40 db,
divider formed by R7 and R8 that develops the 2.5V and 50 db. You can also get attenuation values of -10 db
offset. The loading of R5 and R6 on the 2.5V is negligible. and -20 db by using the attenuator and the appropriate
The circuits of IC1.2 and both halves of IC2 perform a gain values. I have elected to use 1% resistor values since

■ FIGURE 3. The input


amplifier/attenuator.

46 August 2008
Cicchinelli.qxd 7/8/2008 12:59 PM Page 47

they are the same cost as 5% values (as


SMD resistors). Also, an error of 1% is
equivalent to only 0.09 db.
There are two procedures that must
be used to calibrate the ADC and the
FFT processing:

1) Measure the no-signal DC offset voltage.


You can do this by simply not activating K1
and not applying an input signal. Also, each
of the analog switches must be turned on so
that the gain of each of the three stages is
one. The voltage will be very close to 2.5V
and is subtracted from all the readings in
order to present the FFT algorithm with a
series of values centered on 0 volts — a
requirement of the algorithm. This ADC
value — that should be close to 2048 — is
stored into the configuration memory area.
Note that there is an adjustment ■ FIGURE 4. The 22 kHz
potentiometer for each of the gain circuits. low pass filter.
These are required due to the offset
voltages and currents of the op-amps. There
is a menu option that allows you to activate and done, the voltage should be very close to +2.5V,
deactivate the analog switches so that you can use the independent of the selected gain.
potentiometers to “balance” the output voltage to the
same value whether or not the switch is activated. When 2) Measure the processed signal amplitude of a single

■ FIGURE 5. The digital


microprocessor section.

August 2008 47
Cicchinelli.qxd 7/8/2008 1:02 PM Page 48

■ The analog and digital boards. The digital


board has the RCM4120 inserted.

tle “headroom,” but not a whole lot. The


resistor values I show on the schematic are
based on the following two examples.

1) Suppose you want to monitor the


output of a 100W power amplifier that is
driving an eight ohm speaker. The output
voltage at full power is therefore: V =
sqrt(100*8) = 28.3 VRMS. In order to
measure this signal, you need to divide it
by 28. A set of “reasonable” resistors is
then: R1 = 2.7K and R2 = 100 ohms. I
have designed the circuit board so that R2
is an SMD and R1 is a thru-hole part so it
can be 1/2 watt. By not activating K1, the
attenuator will be used giving the overall
circuit a “gain” of 1/28. There is a
frequency sine wave input. This procedure allows you to disadvantage to this circuit — it gives the audio circuit an
adjust the input signal amplitude and will store both the input resistance of 2.8K. If this is not acceptable, you can
processed and unprocessed amplitudes. I suggest 0 dBm increase the resistor values — but not too much or the
or 1 VRMS — see the discussion that follows. The ratio will be affected by R5 and R6.
calibration function displays the value of the input signal
you are using for calibration so that you can monitor it 2) Now, suppose you want to monitor a signal that is 100
while adjusting it. This yields the best calibration for the mVRMS. All you have to do is multiply it by 10. Using the
system. values shown in the schematic: With IC3 turned off, the
Note: The “processed” amplitude is the output value gain is (1K+9K)/1K that is a voltage gain of 10 (20 db);
of the FFT algorithm. with IC3 turned on, R11 is shorted out that would yield
a gain of 1 (0 db).
The maximum signal presented to the ADC must be
less than 5V peak-to-peak, about 1.7 VRMS. I suggest that The program has a feature that causes it to read
you use 0.7 VRMS as a standard because it is equivalent calibration values from its Flash memory when it first
to 2.0V peak-to-peak, as well as 0 dBm into 500Ω and starts. I have set up the program so that if it detects that
makes a nice reference value. You could also use 1 VRMS no calibration values have been previously stored, it will
since this would be 2.828V peak-to-peak. Both leave a lit- use default values that should be very close — assuming
the circuit is built with the
values in the schematics.
■ FIGURE 6. The circuit has enough gain
The LCD and for a typical microphone if you
its connections. use the suggested transformer.
Most mics have an output
voltage of about -60 dbm (0.7
mV into 500Ω). The transformer
has a gain of about 12 db, so
with the available gain of 50 db
that should be adequate for
most mics. Note that there is
also voltage available for mics
that need phantom power. This
should be applied to the pri-
mary of the transformer as
shown in Figure 7.
One of the requirements of
the FFT is that you must sample
the input signal at least twice as
48 August 2008
Cicchinelli.qxd 7/8/2008 1:06 PM Page 49

■The LCD interface board showing the fine pitch


connector and copper traces.

fast as the highest frequency being analyzed. This


sampling frequency is called the Nyquist limit after
an early developer of sampling theory. One of the
anomalies of the FFT is that input frequencies
above one half the sampling frequency will be
“mirrored” into the lower frequency range of the
results. For instance, if the sampling frequency is
40 kHz, the highest input frequency that should
be applied is 20 kHz. However, if a signal of 21
kHz is applied, it will be displayed as if it were 19
kHz. This is one of the limitations of this system.
There are two ways of getting around this: (1)
insert a low pass filter with a sharp cutoff at the
highest frequency of interest; or (2) sample at a
higher rate than necessary. The disadvantage of the
low pass filter is that it should be programmable.
The disadvantage of the high sampling rate is
lower resolution. The resolution of the system can be about 45 kHz if you are going to analyze signals with
calculated as follows: Resolution = Sample frequency components up to 20 kHz. This should allow
Frequency/(2*Sample Size). The factor of 2 is due to the the filter to remove most — if not all — of the higher
FFT algorithm that I am using. frequency artifacts. Another limitation of the system is the
I have decided to include an active low pass filter display frequency resolution; 100 columns are used for
(Figure 4) with a cutoff frequency of 22 kHz. The filter is a the FFT display. Based on the formula above for resolution,
four pole Sallen-Key design and can easily be bypassed if at a sample frequency of 45 kHz and a sample size of
you do not want to include it. The design I used was 512, the resolution is 43.9 Hz. Since the data is displayed
found at http://beis.de/Elektronik/Filter/ActiveLPFilter. in 100 columns, that essentially means that the total span
html. This site allows you to modify the characteristics of of frequencies displayed must be a multiple of 100 *43.9
the filter on-line and calculates new values for you. I have or 4390 Hz. In practical terms, this says that if you tell the
no idea how sensitive the filter characteristics are relative system that you want an upper frequency of 10 kHz
to the component values. However, I did measure the displayed, you will actually get 4390*3 or 13.2 kHz.
response of the filter in the circuit and it is quite good: My original design had the analog circuits on the
at 20 kHz it has about 1.2 db loss; at 24 kHz it is about same board as the processor. I decided to move them to a
4 db. I suggest that you use a sampling frequency of separate board for two reasons: (1) to keep digital noise

■ FIGURE 7.
An overview of
the enclosure
wiring.

August 2008 49
Cicchinelli.qxd 7/8/2008 1:07 PM Page 50

away from the analog amplification stages as much


PARTS LIST as possible; and (2) to enable the flexibility in the
audio processing so the builder can develop his/her
ITEM PART NUMBER QTY own circuit and control it from the system.
❑ Housing 103158** (Jameco) 2
❑ Socket pins 100766** (Jameco) 55
The processor circuit (Figure 5) shows the
❑ Header 160882 * (Jameco) 2 connections from the microprocessor board to the
❑ PB switch 104-0013-EVX 4 other circuits. The board also has the A-to-D
❑ SPST switch 108-1MS1T1B1M1QE-EVX 1 converter and the pull-up resistors for the switches.
❑ SPDT switch 108-1MS1T1B1M1QE-EVX 1 The ADC is powered by the 5V regulator. As
❑ Power connector 163-2325-E 1
❑ Power connector 1710-2532 1 such, its SPI output signal is a 5V logic level. The
❑ 3.5 mm Phone jack 161-7300-EX 1 microprocessor board I am using can handle only
❑ XLR3-F 164-7133 1 3.3V input signals — that is why there is a voltage
❑ 1/4” Phone jack 16PJ022 1 divider on the output of the ADC.
❑ Phono jack 16PJ052 1
❑ 1/4” Phone jack 16PJ080 1
I have selected a 2 MHz clock speed for the
❑ 10Ω 2W 282-10-RC 1 SPI system. This is used for both the analog
❑ 1K 292-1.0K-RC 10 converter and the display. The interrupt service
❑ 1M 292-1.0M-RC 1 routine that is used to sample the input signal takes
❑ 1.7K 292-1.7K-RC 1 approximately 12 to 16 µs, depending on the
❑ 100K 292-100K-RC 1
❑ 100 292-100-RC 2 processor you are using. This means that the
❑ 10K 292-10K-RC 12 highest theoretical sampling frequency is either
❑ 19.6K 292-19.6K-RC 1 80 kHz or 60 kHz. The fastest sample rate the ADC
❑ 2.1K 292-2.10K-RC 1 will support is 200 kHz. This is equivalent to an SPI
❑ 20.5K 292-20.5K-RC 1 clock rate of 3.2 MHz since it takes 16 SPI clocks
❑ 3.3K 292-3.3K-RC 1
❑ 3.57K 292-3.57K-RC 2 to read the converter. The display can handle about
❑ 332K 292-332K-RC 1 a 7 MHz clock. So, I could increase the clock
❑ 47K 292-47K-RC 1 speed to 3 MHz and get a 50% increase in the
❑ 5.49K 292-5.49K-RC 1 sample rate. However, this is not necessary since
❑ 8.06K 292-8.06K-RC 1
❑ 9K 292-9.09K-RC 1 the system is designed for the audio spectrum.
❑ 100Ω 30BJ250-100 1 All of the values can be modified via the menu
❑ 2.7K 30BJ500-2.7K 1 system can be stored in the Flash memory of the
❑ 42TL019 42TL019 1 microprocessor board. This includes the ADC
❑ TS912 511-TS912BID 3 calibration, the frequency “window” you want
❑ FAN1616 512-FAN1616AD33X 1
❑ GF1A 512-GF1A 2 to view, sample size, etc. The current menu
❑ 7805 512-KA7805ATU 1 system allows you to store up to 10 sets of these
❑ Socket 538-52437-3072 1 values. There is a complete and detailed
❑ Socket 571-5-104652-5 1 description of the menu system on my website at
❑ 220 pf 581-08051A221K 1
❑ .0022 µF 581-08053A222K 1
www.qsl.net/k3pto.
❑ 470 pf 581-08055A471K 1
❑ 680 pf 581-08055A681K 1 Some Construction Notes
❑ .47 µF 581-0805ZC474K 8
❑ Enclosure 377-1163-ND (Digi-Key) 1 A few comments about the BOM. Although
❑ 2N3904 625-2N3904 2
❑ 100 µF 647-UVR1E101MED 1 the BOM shows mostly Mouser part numbers,
❑ 20K 72-T93YA-20K 3 many of them are available from other sources,
❑ F-51553 805-F51553GNBJAEN 1 including Digi-Key and Jameco. If you want to save
❑ Relay 806-9081C1-05-00 1 some money, I suggest you search the sites for the
❑ 1.0 µF 80-C1206C105K3R 5 best prices on the higher cost items. Bear in mind
❑ 4.7 µF 80-C1206C475Z4V 4
❑ ADS7816 ADS7816U-ND (Digi-Key) 1 that these companies may have a minimum dollar
❑ Microprocessor RCM4120 1 value for orders. Many of the parts for this project
❑ SN74LVC1G66DBVR 296-13253-1-ND (Digi-Key) 3 do not have critical values. For instance, the gain
❑ LED 606-CMD3750 1 resistors in the analog circuit may be customized
* 160882 Headers are cut to size and require 100766 pins for your application. The transistor type used for
and housing K1 on the analog board and the backlight on the
** 100766 socket pins requires 103158 housing cut to size digital board can be any small signal NPN or
The system needs about 55 total pins — this is equivalent to even an FET (2N7000). The PCBs (three) can be
two pieces each of 103158 and 160882 purchased from FAR Circuits as a set.
NOTE: All items are from Mouser unless stated otherwise.
A more detailed parts list is available at www.nutsvolts.com. I recommend that you purchase two of the
LCD boards, as well as two of the LCD connectors.
50 August 2008
Cicchinelli.qxd 7/8/2008 1:10 PM Page 51

Soldering the LCD connector to the board is the most dif-


ficult part of this project. I highly recommend using a 3X,
lighted magnifying lens (5X would be better). I also used a
10X eye loupe to make sure of the connections and that
there were no shorts. Soldering with a very fine tip is
required — I use a .030” tip. One suggestion for
soldering is to tin the leads of the connector using fine
solder, align the connector, solder the tab near pin 1 to
keep it in place, then heat the pins with a clean soldering
iron tip. This method takes advantage of the tinned circuit
board and prevents the application of too much
solder that could create shorts between pins. I highly
recommend that you use .015” solder; using thicker solder
will probably cause you to create shorts between adjacent
pins. You should also have some solder wick on hand.
I like to use single row pin headers for my I/O
connections. Their cost is about $.15 per point if you buy
enough to do 100 points. I like this method because it
allows me to disconnect all the sub-systems. If you do not
want to use these connectors, you can easily just solder
wires into the header location points. If you do use the
connectors, I suggest that if you are hand crimping, you
keep the socket pins on the strip while crimping with a
small pair of needle-nose pliers. A better solution is to
have a crimp tool available — but these are somewhat
expensive. Whatever method you use, you should
strip 1/8” of insulation off each end to make a good
connection.
You need mount only the input sockets you need for
your application instead of all the ones I have shown in
the enclosure schematic (Figure 7). The schematic does
not show any connections to the high level input (H2).
You can mount and connect any appropriate sockets your
application requires. Another possibility is to use a switch
to connect J3 to either H1 or H2 of the analog board.
You may use whatever switches you like for the power
and pushbutton switches. I selected ones from the Mouser
catalog based primarily on cost.
My website has a number of JPEG files to aid you in
assembling the circuit boards. There are three files for the
analog and digital boards and two for the LCD board.
These files include: top side silk screen, bottom side
silk screen, and vias. The silk screen files show parts
placement and the via files show the locations of the vias.
The via locations are needed because my vendor for the
boards does not do plated-thru holes. You will have to
insert wire jumpers in all the via locations. This also
means that a number of components need to be
soldered on both sides of the boards in order to complete
the circuits.
The wiring between the subsystems should be done
with fairly flexible wire. I happen to have a supply of eight
conductor telephone cable. This is an advantage because
it is multi-color that makes tracing signals easier. I was able
to use this effectively by first cutting the cable to the
required length, then removing the wires from the outer
sheath. Let me know how your build goes. NV
August 2008 51
Botner.qxd 7/9/2008 1:58 PM Page 52

Learning how using a pushbutton rotary


encoder can help you design and build better,
more user-friendly microcontroller projects.
I was bitten by the microcontroller bug a number of years ago and enjoyed building
a variety of gadgets that use them. One of the tedious aspects of gadget building
is the buttons and switches that make up the input controls. When I discovered
the pushbutton rotary encoder, I realized that one control could replace many,
simplifying the design, construction, and programming.

T
his article will introduce you to the Greyhill 62P22-L4 at 22° of rotation. There are no stops and no reason why
pushbutton rotary encoder1. I will describe what it is, it cannot be rotated endlessly either clockwise or counter-
how it works, and how to integrate it into your project. clockwise. This model comes in two different rotational
A demonstration will be presented using a PIC16F84A2, torque and two different pushbutton forces; the L4 model
along with the project code written in C. is the lower torque and lower force model. (Other types
with a variety of features such as integrated joystick are
The G reyhill 6 2P22-LL 4 also available.)
This rotary encoder requires a +5 VDC supply at
I chose this device more or less at random, because 30 mA. It uses an internal LED and optical detector to
it was in stock from my favorite supplier. The shaft produce its output. The pushbutton is a mechanical
rotates with soft detents, and can be pressed in as a contact type and requires a few milliseconds to debounce
pushbutton. Each detent is (four at make and 10 at break3).
■ FIGURE 1. The encoder. The rotary encoder outputs a two bit
■ FIGURE 2. Encoder logic states. binary code on its Output A and Output
B pins. This gives four unique values,
after which the code repeats itself. Once
you know the previous and current output
values and the code sequence, you
can determine which way the shaft has
been rotated.
If you assume that Output A is the low
order bit and Output B is the high order
bit, when rotated clockwise the encoder
outputs 0, 1, 3, 2. When rotated counter-
clockwise, the output is 0, 2, 3, 1. (There is,
52 August 2008
Botner.qxd 7/9/2008 1:59 PM Page 53

of course, no reason why the bit order could not Pin Description
be reversed and the output sequence changed
correspondingly.) 1 Supply (+5 VDC through a 150 ohm resistor)
2 Ground
To produce a number in the sequence shown, place
3 Output B
Outputs A and B in a byte in working storage like this:
4 Output A
bit 7 bit 0 5 Pushbutton
0 0 0 0 0 0 B A
6 Pushbutton
At startup, the program must read the encoder value, ■ TABLE 1
since it could output any of its four values. The value is
■ FIGURE 3.
saved in memory as the previous value. The encoder is
then polled until the value changes. Comparing the
What C an I D o Pin numbers

previous value and current value to the sequence 0, 1, 3, With I t? viewed from
the top.
2, you can tell which way the shaft has been rotated and The obvious use of the
act accordingly. Then the current value is saved as the encoder is for the clockwise rotation to
previous value and polling continues. signal an “up” type event, the counter-
Note that the encoder outputs require pullup resistors. clockwise rotation “down,” and the
In my demonstration example, I use the internal pullups pushbutton to signal some kind of
available at port B of the PIC16F84A for the encoder and request or mode selection. For example, let’s say you are
the pushbutton. Otherwise, 10K resistors to the +5V designing a programmable thermostat with an LCD
supply are recommended. readout. You want it to control either a furnace or air
The pushbutton is debounced and read like any conditioner, so it has three states: cool, heat, and off. You
pushbutton. According to the specifications, the longest could use up and down buttons for the temperature, and
settle time is 10 milliseconds — which is pretty fast — so a three position switch for the state. Or, you could use
your code can be responsive to button presses. an encoder. Rotating the shaft raises or lowers the
Finally, the encoder supply pin requires a 150 ohm temperature setting. Pressing the button changes the
resistor between it and the +5V supply. The encoder’s mode, activating a menu which allows you to select heat,
pinouts are shown in Table 1. cool, or off (by rotating the shaft). Pressing the button

■ FIGURE 4.
Demo project
schematic.

August 2008 53
Botner.qxd 7/9/2008 2:01 PM Page 54

again returns the unit to run mode. resistors are not needed. The PIC uses a 3.58 MHz crystal
This is a very simple thermostat, but it is now easy to oscillator, but any crystal up to the maximum frequency
extend the design with more features, taking advantage supported by the PIC is okay, as long as the timer0
of the flexibility of the encoder and LCD display. You interval parameters are adjusted accordingly. J1 is used for
can add a clock and time of day programs; you can set in-circuit Flash programming (I use a Pickit24) and is not
the clock; you can add a fan on/off function; and so on, required for operation. The buzzer and the LED display
without having to add any more hardware to your design. are connected to the remaining I/O pins configured as
Another application is a power controller, possibly to outputs. (If you don’t want to bother with a buzzer, just
control the temperature of a soldering iron. The pulse replace it with an LED and 470 ohm limiting resistor.) U2
width modulation feature of many microcontrollers is provides regulated five volts so that a battery or wall wart
ideal for power control of a resistive load, with the help can be used to power the project.
of a power MOSFET. The device could have a one or
two digit LED display showing the power level, and a The S oftware
rotary encoder to turn the heat up or down. The
encoder’s pushbutton could be used as an on/off The hardware design of microcontroller projects is
switch. (In fact, the power would always be on to the deceptively simple, because so much of the work is done
microcontroller, but turning the unit off instructs the in the software. Polling for input events is a major task,
processor to set the output power level to zero and which must be carefully coordinated with the other work
disable the LED display.) being done by the processor. Improper or poor design
If you add hardware debouncing to the pushbutton may result in input events being missed or responded to
and connect it to an external interrupt pin, a press of the sluggishly. The way I manage this problem is to use the PIC’s
button can be used to put the microcontroller into sleep timer to do all the input polling and switch debouncing. It
mode and the interrupt caused by another press used to then posts event flags to the foreground code, which is
wake it up. Battery operated applications would benefit free to respond to events as they occur.
from the decreased power consumption when the unit This architecture works well when an event signals an
was off. action that can be processed quickly. I do this for my
encoder inputs, where I am incrementing or decrementing
The D emonstration P roject the display. Other kinds of events that require time to
perform can be more difficult to handle. For my button
This simple project uses a PIC16F84A to manage a press, I want to sound the buzzer for a period of time, but
rotary encoder as input and a single digit LED display and I do not want to tie up the main code with a long delay.
buzzer as output. On power up, ‘0’ is displayed. Rotate In this case, the solution is to sound the buzzer in
the encoder clockwise, and the number is incremented to response to the button press, and then schedule an event
9, then back to zero again. Rotate counter-clockwise and to turn the buzzer off later (conveniently done in our
the display becomes ‘9’ and decrements down to 0. timer interrupt routine). The benefit is no time-wasting
Pressing the encoder pushbutton makes the buzzer sound. delay loops at all in the program.
The rotary encoder S1 is interfaced to U1 with three To see how the rotary encoder is managed in the
I/O pins configured as inputs. The port B internal pullups software, have a look at encoder_demo.c and
are used for each PORTB input port, so external pullup encoder_demo.h in the downloads available on the
Nuts & Volts website at
■ Project top. www.nutsvolts.com.

1) In function InitCPU, the


option register is loaded to
assign the prescaler to timer0
and set the prescaler to 16:1.
The timer0 counter TMR0 is
initialized to the value in define
TIMER0_INIT. Note also that
PORTB pull-ups are enabled.
Then timer0 and global
interrupts are enabled.

2) An interrupt handling
function isr (PICC) or interrupt
(BoostC) is provided to handle
■ Project bottom. timer0 interrupts. The choice of
54 August 2008
Botner.qxd 7/9/2008 2:02 PM Page 55

prescaler and timer0 counter initialization value, along


with the crystal frequency, determine the interrupt interval,
Conclusion
chosen to be four milliseconds (but not particularly critical I hope you found the rotary encoder as interesting as
for this application). Comments in the code further explain I have. It is easier to design a project to use one in place of
how these values have been derived. a number of other input devices. It is also easier to build a
The main activity is to call debounce_switch, the project with one input device instead of many, and the
function that polls each input pin and performs the input project may be simpler for the user to operate, as well. NV
debouncing. There are no parameters, since global
variables in memory are used to manage the debouncing
states. If any input level changes, an event flag is set for Contact the Author
the main code to deal with. The author can be contacted at jhb@pathcom.com.
The secondary activity is to
look for the beeper being on, and
count down to zero and turn the
beeper off.
Exclusively at Jameco…
3) Function debounce_switch polls
The Lowest Prices…
each input (two encoder and one Guaranteed!
pushbutton) and keeps track of the
state, returning the current state in Save 3% to 5% Save 15%-25% Save 30% or more!
Looking to save on Save more when a Looking for killer deals?
global variable ucDebouncedState.
thousands of Name Brand specific manufacturer is Jameco buyers often find
components? Jameco not required. Major Brand Factory Overruns from
4) Function analyze_switch is called offers these popular semi’s are sourced some of the industry’s
by the main code in response to an products for 3% to 5% from 5-6 specific major biggest names. That
input changed event. This function below market price, and manufacturers, plus we means savings of 30%
determines if the button was pressed we guarantee it! also offer Jameco Brand and more to you!
or the encoder shaft turned clock- and Generic passives for
wise or counter-clockwise. A even greater savings.
corresponding event bit is turned
on for the mainline to process. 3 Levels of Choice
For the encoder, the method
used is to isolate Output A and 3 Levels of Savings
Output B as the lowest two bits in
a byte as described above and see
how it compares to the previous
value.
Button presses are detected but
not button releases. An event for
button release could be added if
necessary, or a global variable set to
1 when the button was down.

5) The main function looks for the


various event flags and performs the
required processing.

Other Jameco Advantages:


References  We offer over 300 Major Manufacturers
1http://lgrws01.grayhill.com/web/images
 99% of catalog products ship the same day.
/ProductImages/Series62PEncoder.pdf
 Lowest prices guaranteed, or we pay 10%.
2http://ww1.microchip.com/downloads/
Order 24 hours a day, 7 days a week
en/DeviceDoc/35007b.pdf
3www.ganssle.com/debouncing.pdf
www.Jameco.com
Or call 800-831-4242 anytime
4www.microchip.com/stellent/idcplg?Idc SEMICONDUCTORS • PASSIVES • INTERCONNECTS • ELECTROMECHANICAL • POWER
Service=SS_GET_PAGE&nodeId=1406&
dDocName=en023805&redirects=pickit2

August 2008 55
Fell.qxd 7/9/2008 1:26 PM Page 56

I
first converted a car to purely low cost, traditionally lead-acid motor can take the car only about
electric operation in 1999 and batteries the range is severely limited one mile at less than 31 mph.
after several improvements — and a long, cross-country run must I wanted to reduce the fuel
particularly to the battery pack — the be planned like a military campaign. consumption of the Prius from 60
car was moderately successful. I was There must be charging points every mpg to 100 mpg — a massive cost
generally able to travel about 50 50 miles or so, and you need to stop savings — by the addition of a large
miles on a charge and considerably for a couple of hours at each to Li-Ion pack. This article described
more if care was taken. The car restore some charge. how I achieved this using E-blocks
completed the London to Brighton In 2005, I started looking at the and Flowcode from Matrix
Electric Vehicle (EV) Run in 2005 hybrid cars that were available and Multimedia as a control system.
and 2006. the Toyota Prius in particular. The
Unfortunately, the achilles heel of interesting thing about the Prius How It Works
the EV is still the battery pack. With was that it could run for a limited
period as an EV, however with the Figure 1 shows how the Toyota
■ FIGURE 1. The basic topology NiMH battery pack the electric Prius works. Essentially, it is a normal
of the Prius drive system.
car with the addition of an electric
motor/generator in the drive train.
When the driver needs to slow down,
the brake pedal puts the ‘motor’ into
generator mode which charges the
battery up. Conversely, at low speeds
the motor is used to assist the
conventional petrol engine which
decreases fuel consumption.
When I started the project, a few
groups in the US were experimenting
with supplementary battery packs to
increase the range of the Prius. The
Toyota — along with most modern
cars — has a very complex electronic
control system. The part that deals
with drive and battery management
uses CANbus for communication.
The operation of the drive among
56 August 2008
Fell.qxd 7/9/2008 1:30 PM Page 57

other things is based on the State Of outside source — the second battery! Circuit Details
Charge (SOC) of the battery pack. The second problem was how to
If the SOC is low, the management control this external charging source. I was lucky enough to have
system will recharge when The control system needed to be acquired a set of 56 Thunder Sky
descending a hill, braking, or use any such that the existing batteries’ SOC Li-Ion cells which I could use as a
surplus energy from the engine. If the could be manipulated so that the second battery. These are connected
SOC is high, then the battery pack Toyota management system saw a in series to give a resulting DC voltage
will be used to drive the car at low high SOC and used the battery instead of around 210V and more than 50
speed or to supplement the engine of the engine wherever possible. Ah. The Toyota’s NiMh battery
when driving, climbing hills, or The first problem was simple. I produces around 240V DC, so I
overtaking. In practice, the SOC connected my EV charger across the knew that I would need an inverter
is moving about the entire time, Toyota battery pack and charged the to allow the additional battery pack
dependent upon traffic and pack. The SOC increased up to fully to charge the Toyota’s own battery.
driving patterns. charged (about 80% SOC). The I also wanted to be able to recharge
I saw two main problems in battery manager took into account the Li-Ion batteries overnight, so I
adding a large battery pack in parallel the pack temperature and voltage, needed a recharge circuit. I needed a
with the existing battery. The first was and computed the SOC quite circuit to control the flow of charge
what would the reaction be from the happily. Solving the second problem into the Prius’ own battery, as well.
Toyota management system if — out — transferring energy to the You can see the circuit in Figure 2.
of the blue — the existing battery Toyota’s battery — was the main
started receiving charge from an area of work. ■ FIGURE 2. Block schematic
of the system.

August 2008 57
Fell.qxd 7/9/2008 2:39 PM Page 58

Hacking the Prius


device that could read parameters
on the system and move charge
into the existing battery pack at the
right time.
At this point, I read an article in
Elektor on Flowcode (February ‘06);
this referred to a CANbus system
consisting of two nodes of a network.
From past experience with other bus
systems, it can take a long time to get
a system up and running. I have a bit
of experience with Microchip PIC
devices and there is a wealth of
information on their website on CAN
networking. The datasheet on the
CAN interface chip (MCP2515)
runs to 81 pages.
■ FIGURE 3. I ordered the Flowcode CAN
The block diagram of system and saw immediately all the
the display unit.
hard work of using the CANbus had
been done already. Setting up the
The means of connecting the to lose charge letting the SOC% parameters for the bus and reading
extra battery pack to the existing to fall back. The output of the DC-DC specific messages is carried out by
pack was by using four single pole, converter is controlled by switching prewritten macro commands. Getting
high voltage power contactors and a in one of two sets of points. When the communication between two
high power DC-DC converter. the battery is being charged points was very straightforward.
The converter is actually a overnight, it is isolated from the In order to read the messages
battery charger which has a bridge Toyota circuit by a second set emitted containing data on the SOC,
rectifier as the first component to of points. a Kvaser Light CAN to USB unit was
convert the normal AC mains input The NiMh to Li-Ion battery used to look at the bus traffic. There
to DC. Of course, you can just feed it contactors would be energized the is a convenient OBD-II connector
with DC. The DC-DC onboard whole time during vehicle operation, with 12V power located just under
converter is used to charge the Li-Ions until the extra battery pack was fully the steering wheel in the Prius. There
if required, but that’s another story. discharged and no longer able to is some documentation regarding the
The converter had a two-stage, contribute — at which time the messages on the bus on the Internet.
selectable output. In high, the batteries were disconnected. The format of the data varies and a
converter would try to lift the existing Controlling this system meant bit of manipulation is needed to
pack to a high voltage and thus a hacking into the Toyota CANbus convert the data to a form which can
high SOC. In low, this voltage was system. The car has many devices on be displayed on an LCD.
lower and allowed the existing pack the CANbus network and fortunately With some idea of what I wanted
they all broadcast their initially from the bus, I set up a
data onto the bus. The system in the workshop mimicking
devices that need the the function of the CAN bus in the
data read it and react Prius. One of the E-block systems
accordingly. As far as continuously transmitted an SOC
I am aware, no device message in the same format as the
solicits information Toyota message; the other system
from another device was set up as a display unit which
(CANbus is arranged as showed the system parameters on
one master and N slaves an LCD display. This was used in the
-Ed). What was needed development and commissioning
was a custom CANbus phases of the project on the
bench, and fitted into the radio
■ FIGURE 4. The compartment of the car as shown in
display unit with Figure 5. The display shows the
multiprogrammer,
CAN board, and LCD Battery Current, Battery Voltage
on the front. (charging/discharging), State of
58 August 2008
Fell.qxd 7/9/2008 1:38 PM Page 59

■ FIGURE 5. The display unit


in the Prius dashboard.

Charge %, Charge Current Limit,


Discharge Current Limit, Max Battery
Temperature, and Min Battery
Temperature. In this way, the whole
system could be built up and tested
away from the car.
The second stage of the program
used only one of the items (SOC%)
and gave out one of two outputs —
high or low — depending on the
value of SOC. In order to maintain
the existing battery SOC at around
70%, a simple pair of decision
instructions in Flowcode are put on
the low output if SOC% >70 (and
disconnected the Li-Ion cells from the being about 50 Ah at 20 degrees develop a program by dragging
charge circuit) and put on the high C when discharged at 25 amps. The standard flow chart icons onto the
output if SOC%<65 (which switched worst cell defines the pack capacity, workspace and then clicking on them
the Li-Ion cells into the circuit and so with the current limit set to 25 to enter the properties. Users can
charged the NiMh Prius battery). In amps the car will run for two to simulate this on screen, and when
each case, the opposite output three hours in assist mode until the the program is debugged can
would be turned off. battery pack switches off. The car compile the flow chart to machine
One additional output was used then runs in normal hybrid mode code which can be downloaded to
to drive a relay which, in turn, as before. a PIC microcontroller. Flowcode
energized the four main contactors. One drawback of the system is includes built-in routines and dialogs
This output would come on five these batteries are still very expensive for CANbus communication which
seconds after the system powered and physically quite large. Another allows you to easily transmit and
up and would go off in response to is that the batteries take up some of receive packets of CAN data.
the additional battery pack becoming the boot space as you can see in
discharged. Figure 6. Conclusion
There was no need for a display Figure 8 shows the Flowcode
on the final controller and this now program. Flowcode allows users to In summer, the car will return
lives in an enclosure in the boot
(or trunk for us Yanks -Ed) next to ■ FIGURE 6. Photos showing before and after pictures of the battery system.
the extra batteries and power
contactors.
The additional battery pack is
a set of 56 Thunder Sky Li-Ion cells.
These cells are about two years
old and vary in capacity; the worst

■ FIGURE 7. The inverter in the boot.

August 2008 59
Fell.qxd 7/9/2008 1:41 PM Page 60

Hacking the Prius


■ FIGURE 8. The
Flowcode software
used for developing the
control system.
which shows that the car
has achieved at least
99.9 mpg.
Another job for
Flowcode will be to read
the instantaneous fuel
flow from the bus along
with the speed and
compute the real fuel
consumption.
Further gains can
also be made by reading
the bus speed signal
about 60 mpg in normal hybrid and pulsing a relay when the speed
mode and about 100 mpg in battery drops below 30 mph to force the
boost mode. Unfortunately, the Prius’ car into EV mode. The relay would
read-out only goes to 99.9 mpg so be pulsed again on the speed rising
you are a bit blind as to how well it’s to 30 mph to take the car out of
really doing. In Figure 9 you can see EV mode — another job for
a photograph of the Toyota’s display Flowcode. NV

■ FIGURE 9. A close-up of the Prius display showing the 99.9 mpg achieved.

References
Elektor February 2006 Easy CAN
Microchip www.microchip.com
Plug-in Prius Wiki group at: www.eaa-phev.org/wiki/Main_Page
Follow links to plug-in hybrids, then Prius.

The E-blocks Easy CAN bus pack includes a copy of Flowcode, two
PICmicro multiprogrammers, two CAN bus boards, an LCD display,
switch board, LED boards, and accessories.

Matrix Multimedia www.matrixmultimedia.com

60 August 2008
Pardue.qxd 7/9/2008 3:29 PM Page 61

by Joe Pardue

rted n
this
ow with are
Get sta e’s book & kit at
Jo
series! in our websto m
available
tsvolts.c o
re
Introducing the AVR C
PART 1:
www.nu
Programming Workshop Series

C
programming and micro- difference is that their book is They are specific-purpose languages
controllers are two big topics, machine independent and gives lots that work only on specific micro-
practically continental in size, of examples based on manipulating processors. C is a general-purpose
and like continents, are easy to get text, while these workshops are programming language that can work
lost in. Combining the two is a little machine dependent, specifically based on any microprocessor that has a
like traipsing from Alaska to Tierra del on the AVR microcontroller, and the C compiler written for it.
Fuego. Chances are you’ll get totally examples are as microcontroller C abstracts the concepts of what
lost and if the natives don’t eat you, oriented as I can make them. a computer does and provides a text
your infected blisters will make you based logical and readable way to
want to sit and pout. I’ve been down Why C? get computers to do what computers
this road so many times that I do. Once you learn C, you can move
probably have my own personal rut Back in the dark ages of easily between microcontroller
etched in the metaphorical soil, and microprocessors, software families, write software much faster,
I can point to the sharp rocks I’ve development was done exclusively and create code that is much easier
stepped on, the branches that have in the specific assembly language of to understand and maintain.
whacked me in the face, and the the specific device. These assembly
bushes from which the predators languages were character based Why AVR?
leapt. If you get the image of a ‘mnemonic’ substitutions for the
raggedy bum stumbling through the numerical machine language codes. There are many excellent micro-
jungle, you’ve got me right. Consider Instead of writing something like: controller families out there, but I
these workshops a combination 0x12 0x07 0xA4 0x8F to get the chose the AVR because — among
roadmap, guidebook, and emergency device to load a value into a memory many reasons — it was designed with
first aid kit for your journey into this location, you could write something the C programming language in
fascinating, but sometimes dangerous like: MOV 22, MYBUFFER+7. mind, has Flash memory that can be
world. The assembler would translate configured with a bootloader (more
I highly recommend that you that statement into the machine on all this later), and has the best
get the book The C Programming language for you. user forum I’ve ever used: www.avr
Language — Second Edition by I’ve written code in machine freaks.net.
Kernighan and Ritchie, here after language (as a learning experiment) The AVR is fast, cheap, in-circuit
referred to as K&R. Dennis Ritchie and believe me when I tell you
(Figure 1) wrote C, and his book is that assembly language is ■ FIGURE 1. C being invented.
the definitive source on all things C. a major step up in
In Figure 1, Ritchie (inventor of productivity. But a device’s
the C programming language) stands assembly language is tied
next to Ken Thompson, original to the device and the way
inventor of Unix, designing the the device works.
original Unix operating system at Bell Assembly languages are
Labs on a PDP-11. hard to master and
I have chosen to follow that become obsolete for you
book’s organization structure in this the moment you change
series of workshops. The main microcontroller families.
August 2008 61
Pardue.qxd 7/8/2008 11:56 AM Page 62

programmable, and development hallelujah and amen. (Agreed! -Ed.) kind of a jet plane ride over the
software can be had for FREE (really territory.
free, not crippled or limited in any Workshop Goals
way). I’ve paid thousands of dollars for Quick Start Guide for
development boards, programming What I hope to accomplish with the AVR Learning
devices, and C compilers for the this series is to help you learn SOME
other micros, but never again — I like C programming on A SPECIFIC
Platform
free. The hardware used in these microcontroller and provide you
workshops — the Atmel AVR Butterfly with enough foundation knowledge Software
— can be modified with a few that you can go off on your own AVR Studio — FREE and darn well
components to turn it into a decent somewhat prepared to tackle the worth it.
learning system and the needed many kinds of microcontrollers and AVR Studio is provided free by
components can be had for less than C programming systems that infest the good folks at Atmel Corporation,
$40. You can’t get a better learning the planet. who seem to understand that the
system for 10 times this price and Both C programming and more helpful free stuff they give
you can pay 100 times this and not microcontrollers are best learned developers, the more they will sell
get as good. while doing projects. I’ve tried to their microcontrollers. Actually, this
You will often stumble across provide projects that enhance the software could cost hundreds and
arguments on the Internet as to learning process, but I’ve got to still be darn well worth it, but unless
which microcontroller or admit that some of the projects are you just really like Norway, don’t
programming language is the ‘best.’ pretty lame and are put in mainly send them any money; they’ll get
People take sides and soon a to help you learn C syntax and theirs on the backend when you start
religious war breaks out. I don’t want methods. buying thousands of AVRs for your
to enter that fray, so I’ll just say that I know how easy it is to get next great invention. The workshop
the AVR is the best microcontroller bogged down in all the detail and is based on version 4.14 and if you
and C is the best programming lose momentum on this journey, so use a newer version you may find
language and if you don’t believe we’ll begin with a quick start guide differences in it and our discussions.
me, you are bound for perdition — and learn just enough to get our You can find AVRStudio at
learning platform tools working — www.atmel.com under the AVR
■ FIGURE 2. Developer Terminal. Tools & Software section: http://
atmel.com/dyn/products/tools_card.
asp?tool_id=2725).

WinAVR — Oh, Whenever ...


WinAVR is a GCC compiler
toolset for Windows that we will use
in AVR Studio. We will use this
package under the AVR Studio IDE
that has a GCC plug-in that finds the
WinAVR installation and adapts it to
the IDE. You can find WinAVR at:
http://sourceforge.net/projects/
winavr/.

Developer Terminal
Figure 2 shows the PC terminal
we will use to communicate with
the AVR in our workshop. You can
get the terminal installer and related
documents from www.smiley
micros.com. The source code in
C# and Visual Basic .NET for this
terminal is discussed in detail in the
book Virtual Serial Port Cookbook
(by me) and is available from
www.smileymicros.com and
Nuts & Volts (www.nutsvolts.com).
62 August 2008
Pardue.qxd 7/8/2008 11:57 AM Page 63

SMILEY’S WORKSHOP ☺
Hardware ■ FIGURE 3.
It is simply amazing what the The Butterfly
Butterfly has built in: front.

• 100 segment LCD display


• 4 Mbit (that’s 512,000 bytes!) data
Flash memory
• Real time clock 32.768 kHz oscillator
• Four-way joystick, with center push
button
• Light sensor
• Temperature sensor
• ADC voltage reading, 0-5V
• Piezo speaker for sound generation
• Header connector pads for access
to peripherals
• RS-232 level converter for PC
communications
• Bootloader for PC based
programming without special
hardware
• Pre-programmed demos with source
code
• Built-in safety pin for hanging from
your shirt (GEEK POWER!) the Butterfly++ Mini-Kit. ■ FIGURE 4. Butterfly++ Mini-Kit.
• Kitchen sink This kit includes a CdS
light sensor, a DB-9
I mean this thing has everything female connector and
(except a kitchen sink ... sorry). If wires, and a two AA
anyone can find a learning platform battery holder with power
with anywhere near this much for this on LED and resistor.
price, I want to hear about it. If I
seem to be raving a bit, get used to Adding a CdS
it. I do that a lot. Light Sensor
The AVR Butterfly box has
instructions to show you how to use Atmel’s AVR Butterfly
the built-in functions. Play with it no longer has a light
now before you risk destroying it in sensor due to European
the next step. I shudder to think RoHS compliancy consid-
how many of these things will get erations (don’t get me
burned up, blown up, stepped on, started ...). The mini-kit
and drenched in coffee. (And that’s
just me this morning.) After you’ve
seen how it works out of the box,
remove the battery and prepare to
add components for our learning
platform.

Butterfly++ Mini-Kit
Construction
The Butterfly provides an
excellent learning platform, but it
can be even better with a few extra
parts that Smiley Micros supplies in

■ FIGURE 5. Butterfly CdS light meter.


August 2008 63
Pardue.qxd 7/8/2008 11:58 AM Page 64

■ FIGURE 6. RS-232 foamcore box. (Details for this


DB9 connection. construction can be found in
Smiley’s Workshop 1 Supplement:
AVR Learning Platform Foamcore Base
and Box at www.nutsvolts.com.)
You will need to carefully twist
the ends of the battery box wires
until they are straight, then soak
them with solder so that it runs up
under the insulation to make these
wires strong enough to insert into
the breadboard power bus. The red
provides a suitable substitute provided DB-9 female connector wire goes to the + red bus and the
component that the user must solder (calm down — it’s technical). black wire goes to the – blue bus.
to the Butterfly to use the light sensor Strip about 1/8 inch from the Connect the two power busses with
function. This sensor works with the ends of each wire and then carefully red and green wire and then put an
existing Butterfly software. solder them to the Butterfly and the LED with a 2.2K resistor on the
The CdS light sensor is a device DB-9 connector as shown in Figure 6. breadboard. The resistor goes to
that has resistance proportional to Notice that the upper wires in the the + power; the LED short leg goes
the incident light. As a resistor, the picture cross. Be very careful to get to the – power. The LED and
device has no polarity so either leg this exactly according to Figure 6; resistor are then connected on a
can be inserted in the pads shown about half the emails I get for breadboard strip.
circled in red (see Figure 5). Seat problems turn out to be related to The Butterfly receives power
the sensor snug to the top of the either incorrect wiring or poor from the bus as shown, the + red
Butterfly, then solder the legs to the soldering of this component. wire goes to the rightmost top of the
bottom and trim them just above the header, and the – green wire goes to
solder meniscus. Female Headers the rightmost bottom of the header.

DB9 Female Refer to Figure 7 to see the Test Your Connection


Connector and Wire location of the ADC, USI, PORTB, Using Developer
and PORTD pads. Solder the two-pin
In order to communicate with a header to the ADC pads; the four-pin
Terminal
PC, the Butterfly must connect to a header to the USI pads; and 2x5 Hook your Butterfly DB-9
serial cable. The mini-kit provides the headers to the PORTB and PORTD connection to an RS-232 cable from
connector and wire to make the pads. Notice that Figure 7 shows a a PC. If you use a USB-to-serial
connection to a serial cable. male header on the ISP pad; this is converter cable, you may have
The Butterfly has built-in RS-232 not included in the kit and won’t be problems if the voltage levels are
converters for serial communication used for our work (maybe later). not robust. I’ve used several and
with a PC. Most serial cables will have not had a problem.
have a DB-9 male connector on the AVR Learning Open Developer Terminal.
device side that will mate with the Base Board You can read the user manual
(I recommend: RTFM) by clicking
■ FIGURE 7. AVR Workshop Learning The AVR Workshop Learning the ‘Help/Manual.’ Click the
Platform. Platform is ‘Settings/Port’ menu item to open
built on a the settings window. Select the
foamcore RS-232 COM port that the Butterfly
board that is connected to. Set the baud rate
lives in a to 19200, data bits to 8, parity to
protective None, stop bits to 1, and handshaking
to none. You
can test that
your learning
platform is

■ FIGURE 8.
Close-up of power
connections.
64 August 2008
Pardue.qxd 7/8/2008 11:59 AM Page 65

SMILEY’S WORKSHOP ☺
Bill of Materials ITEM Supplier/PN
ITEM Supplier/PN ■ 3” Wire AWG 22 Jameco/36792
■ AVR Butterfly Digi-Key/ATAVRBFLY ■ 2.2K ohm Jameco/690742CG
■ CdS LDR Digi-Key/PDV-P9005-1 ■ Two-AA Bat. Box Jameco/216119CG
■ Two 2x5-pin header Digi-Key/S7108 ■ DB-9 Female Ctr. Circuit Specialists/DE-09S
■ Four-pin header Digi-Key/S71035 ■ Green LED Circuit Specialists/
■ Two-pin header Digi-Key/S71037 BAG-GREEN3MM

working okay by two methods. side of the AVR Learning Platform We’ll write our first C program
A simple test is to turn the power off and learn about the AVRStudio IDE and create a set of Cylon Eyes in
on the Butterfly and then WITH THE and the WinAVR C compiler toolset. hardware. NV
JOYSTICK BUTTON PRESSED TO
THE CENTER, turn the power back
on. Now each time you press the
joystick button to the center, you The Standard for checking Locate shorted or leaky
should see a series of question marks Capacitors in-circuit components or conditions
(???????) in the Simple Terminal Good enough to be the to the exact spot in-circuit
receive window. This is the Butterfly choice of Panasonic, Still cutting up the pcb,
bootloader wondering what the heck Pioneer, NBC, ABC, Ford, and unsoldering every
is going on. JVC, NASA and thousands part trying to guess at
of independent service where the short is?
Another test is to turn the
technicians. $209
Butterfly on and click the joystick up
to get the LCD scrolling. Move the Inexpensive enough to pay for itself in just Your DVM shows the same shorted reading all
joystick straight down three times till one day’s repairs. At $209, it’s affordable. along the pcb trace. LeakSeeker 82B has the
you see ‘Name,’ then move the resolution to find the defective component.
joystick to the right twice till you see And with a 60 day trial period, satisfaction Touch pads along the trace, and LeakSeeker
‘Enter name.’ Move the joystick guaranteed or money-back policy, the only beeps highest in pitch at the defect’s pad. Now
straight down once and you will see thing you can lose is all the time you’re you can locate a shorted part only a quarter of
‘Download name,’ then push down 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
the joystick center for a moment until
you see ‘Waiting for input.’ CapAnalyzer 88A LeakSeeker 82B
In Developer Terminal, make Available at your distributor, or call 561-487-6103
sure the ‘Send Text: Immediate’ radio
Electronic Design Specialists www.eds-inc.com
button is checked. Type in your
name, then in the ‘Send HEX
Immediate’ dropdown box, select
and click on 0x0D that tells the
Butterfly you are finished sending
characters. Your name should appear
on the LCD.
This isn’t easy and there are
many opportunities to mess up along
the way. Many folks get this going
right away, but others seem to have
fits getting over this hurdle, so I’ve
provided a Workshop 1 Supplement:
Problems Communicating with the
Butterfly (on www.nutsvolts.com) to
help you get past this point. Trust me,
if you see the ????? or get your name
scrolling on the LCD, you are over
a major hump and subsequent
workshops will be easier to get going
than this step.
Well, that was a lot and we
haven’t really gotten started yet. Next
month, we will look at the software
August 2008 65
ElectronetAUG08.qxd 7/9/2008 8:14 PM Page 66

AM/FM Broadcasters • Hobby Kits


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

Hobby Engineering
Kits, Parts, Tools and Books
www.HobbyEngineering.com

For the ElectroNet online, go to


www.nutsvolts.com
click Electro-Net
66 August 2008
Full Page.qxd 7/9/2008 9:14 AM 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.

75W HALOGEN FLOOD LAMP 12 VDC AUDIO ALERT IR RECEIVER MODULE FOR
Philips # 75PAR30L/ Medium-loud high-pitched audio REMOTE CONTROL
HAL/FL40. 120V 75W alert signal. Operates on 12Vdc TSOP2138YA. Miniaturized
PAR 30 halogen flood (6-14Vdc). Plastic assembly receiver for infrared remote
lamp. Standard 0.84" diameter x 0.51" high. control systems. Photo detector
medium screw base.
3.75" diameter.
940 Lumen output.
PC pins on 0.6" centers.
CAT# SBZ-201 1
$ 25
each
and preamplifier in one package.
The epoxy package is designed as
an IR filter. The demodulated output signal
2000 hour life. 3V LITHIUM COIN CELL can be directly decoded by a microprocessor.
Individually boxed.
CAT# HF-75 3
$ 75
each
15 for
$3.50 ea. WITH SOLDER TABS
Sanyo CR2016 3V 75mA coin
Carrier frequency 38 kHz. The module is part
of a plastic assembly for right-angle pc
mounting and is easily separated from the
MOTOROLA "HANDS FREE" cell with surface-mount solder
HEADSET
Made by
tabs. Can be easily soldered to
wires. Cell is 0.79" diameter x 0.07" thick.
Battery circumference is protected with PVC
assembly.
CAT# PCM-1
BNC FEMALE BREAKOUT TO
2 for
1
$ 00
Motorola this insulation. CAT# LBAT-51
comfortable MICRO-MINI-HOOKS
hands-free
headset provides
great sound quality
60 ¢
each
10 for 50¢ each
50 for 40¢ each Mueller # BU-5214-A-4-0.
BNC female to micro-
mini-grabbers.
on both ends of the conversation. 18 VOLT 1.4 AMP Rating
The earpiece lays on the ear, TRANSFORMER 300 VRMS
outside of the ear canal, eliminating
the discomfort associated with in-ear
headsets. Standard 2.5mm stereo phone plug
works on many cell phones and
18 Volt 1.4 Amp
transformer.
Removed from
5 Amps. Red and black leads.
CAT# MTC-6 6
$ 75
each
MINI OPTICAL SCROLL MOUSE
cordless home phones.
CAT# PHN-39
$ 006
each
new equipment.
Wire leads (primary) are
2" long. Secondary
solder terminals have solder on them.
Miniature optical mouse is ideal
for use with laptop
12V 1A CHARGER FOR computers. Plugs
2" x 2.45" x 2.10" high. Mounting holes on into USB port.
LEAD-ACID BATTERIES 2.9" centers.
Input: AC 100-240 V
50/60 Hz.
Output: 12Vdc
CAT# TX-1814
4
$ 85
each
Works on a variety of
surfaces. Provides
more precise control

1 Amp Max.
24 VDC 6.5A POWER SUPPLY than touch pads. Small (about half the size of
a standard mouse) and portable.
Charging Voltage:
13.8Vdc. Float charge
Voltage: 14.8Vdc.
Potrans #FS-15024-1M
ITE Power Supply
Input: 100-120V 4A
CAT# MSE-15
8
$ 75
each

Table-top charger 200-240V 2.3A 12 VDC 58 RPM MINI-MOTOR


designed to charge 12V sealed lead-acid bat- Output: 24Vdc 6.5A
150W switching Sayama #12SM-AT3.
teries. Should be good for up to 7Ah batter-
power supply. Enclosed Compact, good-quality
ies. Output cord has a custom connector
metal vented case. 7.875” x 12Vdc gearhead motor.
which will need to be removed to add your
4.35” x 1.96”. Over voltage, over current and 58RPM, @ 12Vdc, 20mA (no-load).
own connector or alligator clips. Because of
temperature protected. LED output indicator. 12mm diameter x 35mm long.
improper storage many of these units have
Adjustable voltage output. Solder-lug terminals. 2mm diameter x
exterior blemishes but the
units function fine.
CAT# BC-100 9
$ 95
each
UL, CE, TUV.
CAT# PS-6524
$ 2495 each
6mm long flatted shaft.
CAT# DCM-318 $ 1295 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 allcorp@allcorp.com
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.
August 2008 67
PersonalRobotics.qxd 7/8/2008 11:12 AM Page 68

■ BY VERN GRANER
PERSONAL ROBOTICS
UNDERSTANDING, DESIGNING & CONSTRUCTING ROBOTS & ROBOTIC SYSTEMS

DORKBOT
People Doing Weird Things With Electricity
SO, YOU’VE BEEN WORKING ON YOUR electronic masterpiece for a few weeks
(months?) and it’s finally finished, so ... now what? Where can you go to show
off your little beauty, the
child of your imagination,
the fruits of your labor?
How about Dorkbot?

orkbot’s motto is “People doing


D strange things with electricity”
and from what I’ve seen, I’d say
that’s a very accurate description.
Founded by Douglas Repetto of
Columbia’s Computer Music Center
in the fall of 2000, Dorkbot has
spread across the world providing a
framework for display, collaboration,
and celebration of all things tech
(Figure 1).
On a sultry, summer evening in
June 2006, David Nunez, Rodney
Gibbs, and Rich LeGrand pulled off
the first Dorkbot Austin “Cafe
Mundi” — a cute and quirky East
Austin restaurant and hangout. When
I arrived, there was a video projector
pointed at a big screen on one side
of the parking lot and a small PA
system for the presenters to use. In a
matter of moments, I got a general
impression of what Dorkbot Austin
was all about. There were projects
and people, devices and drinks,
music and madness. It was a ■ FIGURE 1.
contagious carnival atmosphere with Map of Dorkbot
artists, electricians, programmers, events worldwide.
musicians, the curious, and the
chaotic all coming together to show have been 15 such events in Austin being the South By Southwest
and tell about their creations while since that first summer night, (SXSW) festival events that were held
networking with other self-confessed averaging a little over one every in downtown Austin and one special
“dorks” (Figure 2). other month. Most of the events have event held at the Austin Children’s
At the time of this writing, there been at Cafe Mundi; the exceptions Museum. Though most of the events
68 August 2008
PersonalRobotics.qxd 7/8/2008 11:14 AM Page 69

PERSONAL ROBOTICS

■ FIGURE 2. Dorkbot
Austin at Cafe Mundi.
have been privately
organized and funded,
some have been
sponsored by such big
names as South by
Southwest (SXSW),
Make Magazine, Amaze
Entertainment, and the
International Game
Developers Association
(IGDA) (Figure 3).
Due to the nature
of a Dorkbot event, the
main facilitators have
changed as new folks become the current Dorkbot Austin crew of
interested and some of the early Rodney Gibbs, Luke Iseman, Chase
movers and shakers have moved on Hammock, and Nick Pietraniec have
to other projects. Though David stepped in to make sure the event
Nunez and Rich LeGrand are no lives on. ■ FIGURE 3. Dorkbot poster by Noel
longer working with Dorkbot Austin, I did get a moment to chat with Waggener; subculturepress.com.

THERE’S NO DORKBOT IN YOUR CITY? MAYBE YOU SHOULD START ONE!


Some things to consider: collaborating with people in other generally free events, so you need to
nearby cities/towns. Maybe the be careful about spending lots of
What is Dorkbot, exactly? Each Dorkbot meeting can travel to a money to produce them! Several
Dorkbot event is different and is different location each month, or Dorkbots sell beer and/or food at the
driven by the needs and interests of maybe you can all pool your meetings to help cover their costs.
people in the local community. But resources for a couple long-form Make sure you talk to the venue
generally, the main goals of Dorkbot meetings each season. before selling anything. Dorkbot.org
are: to create an informal, friendly donates web space, email lists, etc.,
environment in which people can talk ■ Venue: Is there a place to hold the to the local Dorkbots, so there is no
about the work they’re doing and to meetings? It can be very convenient administrative cost associated with
foster discussion about that work; to to have the meetings in the same setting up a new Dorkbot.
help bring together people from place each time. Often, an art gallery
different backgrounds who are or performance space will be willing ■ Meeting Format: Dorkbot meetings
interested in similar things; and to to donate their facilities for the are rather informal. There are usually
give us all an opportunity to see the occassional meeting. If you know two or three presentations (about
strange things our neighbors are someone connected to a university, 20-30 minutes each) per meeting and
doing with electricity. Dorkbot isn’t you may be able to get a space sometimes very short “lightning”
really a forum for formal artist talks through them. It doesn’t have to be presentations from audience
or lectures, but rather a chance for a fancy space! members. The specific format is up
diverse people to have friendly to each organizer to decide. You’ll
conversations about interesting ■ Equipment: Do you have access probably have to play with your
ideas. The organizers of Pixelache to presentation equipment? At the format for a few meetings until you
2008 asked Douglas to talk about least, you’ll probably need a video find something that works well in
Dorkbot’s “organizational strategy.” projector, a small sound system, and your context. One thing to keep in
Here’s what he had to say: a network connection. A laptop mind is that the Dorkbot format works
computer can also make things easier best for informal, conversational
■ Frequency: How often will you on the presenters. As with the venue, presentations on a particular work or
hold meetings? Some Dorkbots have it’s best if you can use the same topic, rather than formal artist talks or
meetings every month, others just a equipment at each meeting. It can be lectures on a body of work. Thirty
few times a year. It’s a lot of work very stressful trying to track down a minutes isn’t much time, so focused
putting the meetings together, and in video projector the day of a Dorkbot presentations work best.
smaller cities it can be difficult to meeting! Often, the venue you use
schedule enough speakers. You don’t will have A/V equipment you can What happens next?
want to burn out! borrow. If you think you’d like to start a
Dorkbot in your city, contact Douglas
■ Locale: If you are in a smaller city ■ $$$: Dorkbot is a non-$-oriented at douglas@dorkbot.org for more
or town, you might want to consider organization. Dorkbot meetings are information.
August 2008 69
PersonalRobotics.qxd 7/8/2008 11:26 AM Page 70

■ FIGURE 4. SXSW Dorkbot in ■ FIGURE 5. View from the stage


downtown Austin drew a huge to meet, collaborate, socialize, at a Dorkbot Austin event.
crowd. (Photo by James Delaney.) brainstorm, and show off their work
— this is probably a common mantra huge crowd of people who came
Nick Pietraniec about Dorkbot to get for most Dorkbot communities, but together to talk about tech, show off
his take on things. Nick comented, there’s no central organization or their electronic feats, and let their
“I think fundamentally our goal is to mission. If you go to an event in inner dork shine (Figure 4). Attendees
provide a forum for our community London, Montreal, South Africa, are encouraged to bring finished
or Dallas — it might look completely items, parts and pieces, or even just
■ PHOTO 1. Nic Graner sports different.” plans or sketches. It’s a good place to
aluminum “slit glasses” by When I asked him what it was hang out and to network with other
Brooks Coleman. like running a Dorkbot event, he folks that have similar interests.
responded, “Actually, ‘running’ Experimental music, strange
probably isn’t really the proper term. contraptions, and prototype
We’re more ‘facilitators’ in that systems breaking down on stage
we simply solicit for presenters, accompanied by small gouts of blue
coordinate the venues. When we smoke make for an exciting day.
reach a critical mass of folks interested Even the projects that flame out are
in showing off their work, we send enthusiastically applauded!
out the announcements, get the gear, So, what is attending a Dorkbot
and head for the site.” like? To me, it felt something like a
Though I haven’t had the trade show — rock concert — nerd
pleasure of attending a Dorkbot party — ham fest — science fair all at
outside of Austin, the ones here have the same time. There’s usually adult
been a LOT of fun and are both very ■ PHOTO 3. Glamor Girl —
well attended and received. At the a mixed-media EL wire lighted
SXSW Dorkbot Austin, there was a sculpture by Brooks Coleman.
(Photo by James Delaney.)
■ PHOTO 2.
Brooks Coleman
with a customer
modeling an item
from his metal
clothing line.

70 August 2008
PersonalRobotics.qxd 7/8/2008 11:28 AM Page 71

PERSONAL ROBOTICS

■ FIGURE 6. RoboSpinArt
demo board for software ■ FIGURE 7. Vern Graner glues a servo ■ FIGURE 8. Kym Graner operating the
development and proof of motor back on the RoboSpinArt demo RoboSpinArt machine at Dorkbot.
concept testing. board moments before show time. (Photo by James Delaney.)

beverages being consumed (which been a wonderful venue for The such as the RoboSpinArt machine
certainly adds to the festive nature of Robot Group to test out and (Nuts & Volts, January ‘08) and
the event!) and kids running around demonstrate some of our newest the Power Flowers (Nuts & Volts,
having fun and beeping/zapping/ designs. It has provided a sympathetic July ‘08).
blinking things everywhere (Figure 5). and knowledgeable audience for The first time I presented a
At the Austin shows I’ve attended, some of our more notable projects concept project, all I had to show
the “master of chaos” David Nunez
was usually scampering about trying Q&A ABOUT SELF-ORGANIZATION: DORKBOT
to make sure the next presenter was
ready to go, introducing each new AN INTERVIEW WITH DOUGLAS REPETTO
segment, and generally making sure “I generally try to stress that each also run many (but not all) of the
everyone has what they need and Dorkbot is autonomous and some of mailing lists from the server. Other
them are quite different in form and than that shared web resource, each
has a good time.
spirit from one another. So, it’s difficult Dorkbot is more or less completely
In addition to being just a heck to make very general, overriding autonomous. Very early on when
of a lot of fun to attend, Dorkbot has statements. Of course, journalists live there were just three or four
for general, overriding statements, so Dorkbots, I decided that the best thing
■ PHOTO 4. A Gameboy SP powers sometimes it’s a hopeless cause ...”
a small LEGO-based robot. to do would be to give up any
—Douglas Repetto, Dorkbot creator control I might have over the other
organizations. At first, I was worried
What are the aims of the project you about other people using the name in
are involved in? ways I didn’t like, or organizing
Dorkbot has only a motto: meetings in ways I didn’t agree with,
“People doing strange things with but I quickly realized that if I really
electricity.” Different groups have wanted to be inclusive I would have
interpreted the motto in different to let go and let other people find
ways. When I thought of the motto, their own way. We have a Dorkbot-
I purposely made it broad and overlords mailing list, and we
inclusive so that it would interest exchange occasional messages
many different kinds of people doing between the various people who run
different kinds of things. Artists, all the different Dorkbots around the
inventors, scientists, engineers. The world. But even that is very low
exciting thing to me is to learn about volume. I think that the main thing
strange things that creative people that has given Dorkbot an identity
are doing around the world, with no of sorts is the website and the motto.
regard for genre, style, school of People see that it is not super
thought, area of expertise, etc. self-serious. That it is informal and
friendly. That it is about creativity.
How is the project organized? I think that is enough.
It is mostly dis-organized. We
have a server at the Computer The above interview excerpt courtesy
Music Center at Columbia University of “Pixelache 2008 Helsinki.” To read the
(where I work). That hosts many of the rest of the interview, point your web
Dorkbot websites (but not all). We browser to ttp://tinyurl.com/3sewrq.

August 2008 71
PersonalRobotics.qxd 7/8/2008 11:30 AM Page 72

■ PHOTO 5. “Professor Conrad” ■ PHOTO 6. The SanDraw kinetic


(a.k.a., Marvin Niebuhr) adjusts 7). When I was done speaking, I got sculpture by Rick Abbot and Paul
one of the instruments from his a hearty round of applause and was Atkinson. (Photo by James Delaney.)
Screaming Babyhead Band. then peppered with questions about
(Photo by James Delaney.)
the demo board and how I about details of the mechanisms and
was a bunch of sketches and a envisioned the final project taking how we had solved some of the
development board (Figure 6) for shape. When we brought the finished problems mentioned in the first
the RoboSpinArt machine that was machine back for a later show (Figure presentation.
hastily glued back together moments 8), the crowd was very enthusiastic The fact that the folks behind
before I was scheduled to talk (Figure and many folks came up to ask Dorkbot don’t really run Dorkbot
so much as set the stage for it to
happen makes for an interesting
RESOURCES ■ The RoboSpinArt Machine: dynamic since there are none of the
■ Dorkbot: http://dorkbot.org www.robospinart.com typical trappings of a managed event.
The folks who show up are the ones
■ Dorkbot Austin: ■ PingPongPrinter: www.youtube. who get up and talk. The presenters
www.dorkbotaustin.org com/watch?v=8Ep5OC3E02I swap places with the audience and
■ Cafe Mundi, Austin, TX: there is plenty of opportunity for
■ Poster artwork by Noel Waggener:
www.cafemundi.com interaction and collaboration. In
www.subculturepress.com
order to be featured at Dorkbot, all
■ The Robot Group:
www.TheRobotGroup.org ■ Workbench Design Contest: you have to do is sign up via email
http://forum.servomagazine.com/ and tell the Dorkbot folks what you’d
■ The Thereping: www.thereping.com viewtopic.php?t=8180 like to do — kinda like a grown-up

■ PHOTO 7. A ceramic, wood, ■ PHOTO 8. “Gator Girl” animatronic ■ PHOTO 9. Paul Atkinson checks out
and light bulb sculpture by sculpture in aluminum by Brooks Coleman. the POV display at Dorkbot SXSW.
Denise Scioli. (Photo by James Delaney.)

72 August 2008
PersonalRobotics.qxd 7/9/2008 11:56 AM Page 73

PERSONAL ROBOTICS

■ PHOTO 10. Bob Comers robot made ■ PHOTO 11. Sami Graner interacts ■ PHOTO 12. The Ping Pong Printer
from PVC pipe and recycled “kiddie car” with a “Biomechanical” by “Professor with its new ball-feed hopper
motors and wheels. Conrad” (a.k.a., Marvin Niebuhr). by Rick Abbot.

version of “show and tell.” You would think this Dorkbot Austin, look around for me there.
free-form method of (non? dis?) organization would Otherwise, you can always reach me via email
lead to chaos, but every Dorkbot I’ve attended has run at vern@txis.com if you have any questions or
surprisingly smooth. comments. NV
If this sounds like something you’d like to do, but
there isn’t a Dorkbot scheduled in your city, you can start I’d like to say a special thank you and goodbye to one of the
founders of Dorkbot Austin, David Nunez. A good friend and long
your own Dorkbot. All you need to do is send an email time collaborator with The Robot Group, we wish him Favorable
to Douglas Repetto (his email address is on the main Chance and Deity Velocity in his endeavors out east!
Dorkbot.org website). He’ll set you up with a mailing list
and a link on the main site, and you’re off! If there is a
Dorkbot near you, you should make a point of at least Extreme Robot Speed Control!
attending if not signing up to present something. What
better way to meet folks than to stand up before a small
idewinder 6
6
14V - 50V - Dual 80A H-bridges - 150A+ Peak!
Adjustable current limiting
crowd of other tech geeks just like yourself and talk about S 6
6
Temperature limiting
Three R/C inputs - serial option
your project? 6
6
Many mixing options - Flipped Bot Input
Rugged extruded Aluminum case
I’d like to close this month by thanking everyone who $399 6 4.25" x 3.23" x 1.1”

has sent in an entry for the Workbench Design Challenge


(see the Resources section for a link to the contest details
on the Nuts & Volts web forum). I look forward to handing $79.99 $119.99
out the prizes! And, if you happen to find yourself at $29.99 Scorpion XL
Scorpion HX
Scorpion Mini 6 Dual 2.5A (6A pk) H-bridges 6 Dual 13A H-bridge 45A Peak!
■ PHOTO 13. Edwin Wise ■ PHOTO 14. Gray Mack 6 2.5A (6A pk) H-bridge 6 Plus 12A fwd-only channel 6 5V - 24V
6 5V - 18V 6 2.7“ x 1.6” x 0.5”
and his homebrew Tesla coil. with his balloon-based light 6 5V - 18V
6 1.25“ x 0.5” x 0.25” 6 1.6“ x 1.6” x 0.5”
sequencing system.
Introducing Dalf
6 Closed-loop control of two motors
6 Full PID position/velocity loop
6 Trapezoidal path generator
6 Windows GUI for all features
50
6
6
Giant Servo Mode!
C source for routines provided
$2
6 PIC18F6722 CPU See www.embeddedelectronics.net
H-bridges: Use with Dalf or with your Micro/Stamp
Simple-H
19

OSMC
$2

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
protection
$79
MADE IN

www.robotpower.com THE USA

Phone: 253-843-2504 s sales@robotpower.com


August 2008 73
Page74.qxd 7/9/2008 9:01 AM Page 74

&2/.4 0!.%,3  %.#,/352%3

#USTOMIZED FRONT PANELS CAN BE EASILY


DESIGNED WITH OUR FREE SOFTWARE
&RONT 0ANEL $ESIGNER

s #OST EFFECTIVE PROTOTYPES


AND PRODUCTION RUNS
s 7IDE RANGE OF MATERIALS OR
CUSTOMIZATION OF PROVIDED
MATERIAL
s !UTOMATIC PRICE CALCULATION
s &ABRICATION IN   OR  DAYS

3AMPLE PRICE
  PLUS 3(

WWWFRONTPANELEXPRESSCOM
  

s Co Mot
r
ete
s or xis erom
3-A cel ntr or
n
Se
Ac 9.95
$1 oll
ers

R
QT ce 4.9
5
c t an 9
.4 $1
fle $3 y
rra !
Re sor TReX Jr
Se
n o
s n
en -se
r A sing Robot Controllers Dual Motor
e S line Controller:
c r voltage dual H-bridge
tan fo Instantly switches
f lec r e a t regulator trimmer pot between radio control
Re G (on ADC7) (RC) or analog voltage and
R
QT power LED asynchronous serial (RS-232
(green) or TTL), plus a multitude of
Solder Paste Stencils red user LED
additional features. $59.95
Use our low-cost
solder paste stencils
From $25 (on PD1)
programming
to quickly assemble
your surface-mount
ATmega48/168
microcontroller
connector Custom Laser Cutting
designs. 20 MHz clock From $25
Baby Orangutan B-48 and B-168
starting at $24.95

Cut your own custom


Find out more at www.pololu.com or by calling 1-877-7-POLOLU. chassis, front panels, and more!
74 August 2008
Full Page.qxd 7/9/2008 9:21 AM Page 75

JOIN THESE LEADING


COMPANIES AT 2008
ROBODEVELOPMENT

Founding Sponsor
,
CONFERENCE&EXPO 08
NOV. 18-19, 2008 Gold Sponsor

SANTA CLARA CONVENTION CENTER

SANTA CLARA, CA
Silver Sponsors
Join the International Technical Design and Development
Event for the Personal, Service, & Mobile Robotics Industry

EXCLUSIVE OFFER:
USE PRIORITY CODE RDNAV AND
SAVE $300 ON A CONFERENCE PASS
WWW.ROBODEVELOPMENT.COM Q 800-305-0634 BOSTON
ENGINEERING™

Featured Keynote Q 30+ Cutting-edge, relevant conference


Presentations sessions covering:
 - Systems and Systems Engineering Analyst, Association &
 - Tools and Platforms Academic Co-Sponsors

 - Enabling Technology


 - Achieving Autonomy
 - Design and Development
Sebastian Thrun Q Keynote sessions delivered by internationally
Professor of Computer recognized industry leaders Media Co-Sponsors
Science and Electrical
Engineering Q Exposition floor featuring what’s new and what’s
Director, Artificial
Intelligence Laboratory next in robotics design and development
Stanford University
“Making Cars Drive Themselves” Q Valuable networking opportunities that put
Plus... you in touch with peers, industry experts and
Maja J. Mataric up-and-coming talent
Founding Director
USC Center for Robotics
and Embedded Systems
Director
FOR COMPLETE EVENT DETAILS
USC Robotics Research Lab Listing as of July 7, 2008. For a
current list of participating
Jeanne Dietsch VISIT WWW.ROBODEVELOPMENT.COM companies, please visit
CEO www.robodevelopment.com.
MobileRobots Inc
“Opportunities at the Uptick”

For Information on
Sponsorship and
Exhibiting
Opportunities,
contact
Ellen Cotton at
ecotton@ehpub.com
or 508-663-1500 x240
OpenComm.qxd 7/7/2008 4:33 PM Page 76

■ BY LOUIS E. FRENZEL W5LEF


OPEN COMMUNICATION
THE LATEST IN NETWORKING AND WIRELESS TECHNOLOGIES

TEN THINGS YOU MAY NOT


KNOW ABOUT BLUETOOTH
Making the wireless everywhere
movement come true
BLUETOOTH IS A VERY FAMILIAR NAME THESE DAYS if you have a cell phone or
laptop. It is a wireless technology that has been around a while and probably can
be credited as the start of a whole boat load of short-range wireless technologies.
But even if you have heard the name, you may not really know all about it. Here
are 10 facts that will update your knowledge of this hot wireless method.
for such high volume is that the
BLUETOOTH IS number one use of Bluetooth is to BLUETOOTH
10 YEARS OLD implement the wireless headset in SPECIFICATIONS
I am not kidding. It was back in
cell phones. That means two
Bluetooth chips for each: one in the
AND FEATURES ARE
1998 that this wireless method was handset and the other in the ear CONTINUOUSLY UPDATED
conceived by European telecommuni- piece. Most cell phones have this
cations giant Ericsson. Ericsson along feature today. And since cell phones Bluetooth is a short range tech-
with four other companies selected sell in the one billion per year range, nology that operates in the unlicensed
the name Bluetooth and formed the you can see how Bluetooth got to 2.4 GHz industrial-scientific-medical
Bluetooth Special Interest Group be number one. There are dozens of (ISM) band. It has to co-exist with Wi-Fi
(SIG) to develop the technology. other uses, as well. ABI Research — LANs, cordless phones, and microwave
Now it is the most widely used a market information company — ovens, to mention just a few services
short-range wireless technology. predicts that about 2.4 billion that also use this band. But it does pretty
Bluetooth-enabled products will well with a range up to about 30 feet.
ship in 2013. The basic output power is 1 mW (0
BILLIONS SOLD! THERE dBm) but you can use two other
power levels for longer ranges: 2.5
ARE MORE BLUETOOTH THE BLUETOOTH SIG mW (4 dBm) and 100 mW (20 dBm).
RADIOS ON THE PLANET MANAGES THE Bluetooth uses a very robust radio
THAN ANY OTHER STANDARD technology called frequency hopping
spread spectrum. It chops up the data
The Bluetooth SIG is the organi- being sent and transmits chunks of it
Cambridge Silicon Radio — the zation that develops the technology, on up to 75 different frequencies. In its
leading Bluetooth chip supplier — establishes the standard, tests for basic mode, the modulation is Gaussian
shipped over 600 million chips in interoperability and certification, and frequency shift keying (GFSK). It can
2007 and is expected to ship about promotes the brand. It is a consortium achieve a gross data rate of 1 Mb/s. A
a billion more this year. That’s just of over 10,000 companies. And their more recent upgrade called Enhanced
one supplier. The total number of work is on-going. For more details on Data Rate (EDR) uses π/4-DQPSK
chips buried in other products is this wireless success story, go to www. that gives a data rate to 2 Mb/s and
well over several billion. The reason bluetooth.com or www.bluetooth.org. 8DPSK that will deliver up to 3 Mb/s.
76 August 2008
OpenComm.qxd 7/7/2008 4:34 PM Page 77

O P E N C O M M U N I C AT I O N

The goal is to create wearable wireless of this standard that will carry the
BLUETOOTH PROFILES devices in watches, running shoes, and Bluetooth protocol and profiles but
DEFINE THE medical monitoring devices. Many of with the ability to transmit at rates up
APPLICATIONS the newer Bluetooth chips contain to the 480 Mb/s range over short
the standard Bluetooth transceiver in distances. The Bluetooth version
The Bluetooth standard defines not addition to a low power (LP) transceiver. will operate above 6 GHz and is
only the radio interface just described expected to be available in 2009.
but also a comprehensive data trans-
mission protocol. The protocol spells out
HIGHER SPEED VERSION
how the data is packaged into packets, OF BLUETOOTH WILL USE BLUETOOTH TEAMS UP
transmitted, and received. It is a flexible ULTRA WIDEBAND (UWB) WITH WI-FI TO BOOST
protocol that can be adapted to almost DATA RATES
any type of data. The protocol is The fastest version of Bluetooth
implemented in a software stack that is called EDR and can transmit at a The Bluetooth UWB effort is
defines the sequence of operations. rate up to 3 Mb/s. That is fast on-going but in the meantime, the
While designers are free to create their enough for most audio and low Bluetooth SIG has adopted another
own application on top of the Bluetooth speed applications and that rate has way to speed up some transmissions.
protocol, it is a difficult process. certainly not limited Bluetooth’s Specifically, it has created a way to
To make Bluetooth more attractive adoption. But for faster data transfers let the Bluetooth protocol and
to a wider range of applications, the SIG like downloading photos from a profiles operate over a Wi-Fi radio if
has developed a wide range of Profiles. digital camera or transmitting video, present. Wi-Fi is the wireless local
These are special software packages a faster radio technology is needed. area network (WLAN) standard of
designed to implement the most popular Recently, the Bluetooth SIG the IEEE, also known as 802.11. It is
applications. The Profiles define the adopted the WiMedia ultra wideband available in several versions: a, b, g,
applications. Among the Profiles (UWB) radio technology. This and n. Bluetooth radios will
available are one for cell phone headset, wireless standard developed by the incorporate what is called a generic
wireless headphones, wireless printer WiMedia Alliance can transmit data alternate MAC/PHY. MAC means
to PC connections, human interface at a rate to 480 Mb/s over several media access control and PHY
devices (keyboards, mouse, etc.), meters. It uses orthogonal frequency means physical layer interface. The
automotive hands-free kits, cordless division multiplexing (OFDM) in the MAC part of the radio defines how
phones, fax machine links, video 3.1 to 4.7 GHz range. Its main use the data is packaged and transmitted
streaming, and a whole bunch of oth- so far has been a very successful while the PHY defines the radio
ers. The Profiles speed up and simplify wireless USB cable replacement. The interface like RF and modulation. This
the application development and help Bluetooth SIG is developing a version alternate MAC/PHY will be able to
ensure compatibility of similar products.
One popular application is the use of ■ FIGURE 1. The Cambridge Silicon Radio BlueCore7 is the lates generation of
Bluetooth in the hand controllers for Bluetooth transceivers designed for cell phones and other applications. The chip
the Nintendo Wii game console. itself is a tiny 3.2 x 3.6 mm. It contains four separate radios as depicted in the
diagram, a conventional FM receiver with RDS, a GPS satellite navigation receiver,
a low power Bluetooth transceiver, and a standard Bluetooth transceiver with EDR.
LOW POWER VERSION
OF BLUETOOTH NOW
AVAILABLE
A couple of years ago, Nokia — the
leading cell phone maker — developed
a low power wireless technology similar
to Bluetooth. Nokia joined with several
other companies to develop this tech-
nology into a standard. It was called
WiBree and a consortium was founded.
Last year, the WiBree group merged
with the Bluetooth SIG to further
develop this method. It uses a simpler
version of Bluetooth to significantly
cut operating power so that wireless
devices can be operated from coin
batteries like those in wrist watches.
August 2008 77
OpenComm.qxd 7/7/2008 4:34 PM Page 78

dynamically select either the Bluetooth out there. Most of the short-range to adopt these technologies to sup-
radio or the Wi-Fi radio based on the technologies are competitive with port Bluetooth in some applications.
need for faster transmission, or not. one another in some way. Yet even So you can almost write off Wi-Fi and
with the competition, Bluetooth has UWB as competition. That leaves
carved out a healthy niche, if you can ZigBee as the only clear competitor.
BLUETOOTH IS call billions of units sold a niche. ZigBee is that technology
SUCCESSFUL DESPITE Bluetooth had a head start on most developed around the IEEE 802.15.4
THE COMPETITION of the other technologies and that is standard that targets industrial
partially the reason Bluetooth is so control, building monitoring and
If you follow the wireless field at well entrenched. While Bluetooth control, remote meter reading, and
all, you know that there are many applications may overlap a bit with other applications where sensor
other wireless standards and methods Wi-Fi and UWB, the SIG was smart outputs are observed and used to
initiate controls or record the data.
It uses very low power so a ZigBee
transceiver can operate for months
or even years on a coin battery.
ZigBee’s big claim to fame is its
ability to form mesh networks among
hundreds of radio nodes. While
Bluetooth has some limited network-
ing capability, it was not designed for
mesh networks. So, while the two
technologies may butt heads in a few
applications, for the most part each
has its own sphere of uses.
The only other short-range
technology that may come close to
Bluetooth in volume is ISM band
radios that operate in the 315, 433,
and 915 MHz range. These are used
in garage door openers, remote
keyless entry devices for vehicles,
tire pressure monitoring, remote
thermometers, and toys. These
devices are usually much simpler
so do not need the sophisticated
protocol of Bluetooth.

WHO MAKES
BLUETOOTH CHIPS?
NEW! HIDmaker FS for Full Speed FLASH PIC18F4550
Creates complete PC and Peripheral Both PC and Peripheral programs As I mentioned earlier, the
programs that talk to each other over understand your data items (even odd leading Bluetooth chip company is
USB. Ready to compile and run! sized ones), and give you convenient Cambridge Silicon Radio (CSR). They
• Large data Reports variables to handle them. were one of the first vendors and
• 64,000 bytes/sec per Interface PIC18F Compilers: PICBASIC Pro, they still maintain a wide lead over
• Easily creates devices with multiple MPASM, C18, Hi-Tech C. the others. Other Bluetooth chip
Interfaces, even multiple Identities! companies are Broadcom and Texas
• Automatically does MULTITASKING PIC16C Compilers: PICBASIC Pro,
• Makes standard or special USB HID MPASM, Hi-Tech C, CCS C. Instruments. Figure 1 shows CSR’s
devices latest transceiver chip which
NEW! “Developers Guide for USB HID PC Compilers: Delphi, C++ Builder, incorporates the latest Bluetooth EDR
Peripherals” shows you how to make Visual Basic 6.
radio, a low power transceiver, a GPS
devices for special requirements. HIDmaker FS Combo: Only $599.95 satellite navigation receiver, and a
standard FM radio all in one. It is
DOWNLOAD the HIDmaker FS Test Drive today! expected that this chip will save lots
www.TraceSystemsInc.com of space and power when built into
301-262-0300 cell phones. NV
78 August 2008
DesignCycle.qxd 7/7/2008 4:11 PM Page 79

THE DESIGN
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
CYCLE
■ BY FRED EADY

UP THE LOGIC FOOD CHAIN


I was a totally analog teenager. My interests then were centered on tube-based
stereo equipment and tube-based guitar amplifiers. I was fat, dumb, and happily
analog until I ran across a copy of the GE Transistor manual in the literature
section of a local electronics parts store. I had to have it. Everything “electronic”
I was reading about at the time was telling me that vacuum tubes were on
their way out and transistors were the thing of the future. At that time,
hand-held calculators were becoming popular and as far as I was concerned,
they were “magical” devices that I would never ever understand at the
electronic level. So, in an attempt to embrace transistor technology, everything
“tube” was replaced with a comparable “transistor” device.

y guitar amp and stereo projects became clocked registers. FPGA logic is rooted in LUTs (Look-Up
M transistorized. I even started to wonder about what
was inside of those “magical” calculators. As I transitioned
Tables) such as the one you see in Figure 1. Basically,
we can configure the LUT to be any type of logic gate
from teen to adult, building stereo equipment and guitar with up to four inputs. The clock signal in Figure 1 would
amps gave way to transistor and IC-based logic projects. normally be provided by the FPGA’s internal clock
The transition was complete. Well, not quite. routing system. Depending on our desired logical
These days, my guitar amplifiers are all tube-based. function, the LUT infrastructure allows us to pass our logic
However, I’m still “solid-state” when it comes to logic. In output through the D flip-flop for registered operation
past Design Cycle columns, we’ve explored the nuances or bypass the D flip-flop for an unregistered output
of many a microcontroller. We have also recently delved operation.
into the world of CPLDs. It’s time to move up another step The power of the LUT comes in numbers. The FPGA
on the logic food chain. In this installment of Design fabric allows for interconnection of a large number of
Cycle, we are going to tackle the FPGA. LUTs. Using the FPGA’s internal interconnection fabric
allows us to combine the logic contained within a large
number of LUTs to generate complex logical operations.
FPGA 101 In this spin of Design Cycle, we will be basing our
FPGA is short for Field Programmable Gate Array. FPGA designs on Xilinx FPGAs. Thus, the generic concept
In reality, an FPGA is actually a programmable solderless of a LUT is similar to what Xilinx calls a CLB (Configurable
breadboard populated with interconnectable logic blocks. Logic Block). A CLB is made up of function generators,
An FPGA differs from a CPLD (Complex Programmable registers, and reprogrammable routing controls. Equating a
Logic Device) in that the FPGA contains
considerably more logic gates. Also, an
FPGA may contain memory and high-level
embedded building blocks such as adders
and multipliers. OUTPUT
CPLD logic is based on sum-of-product
logic arrays that interconnect and feed

■ FIGURE 1. If we choose to use the D flip-flop


output, the output of this LUT is registered. CLK
Bypassing the D flip-flop all together results
in an unregistered output signal.
August 2008 79
DesignCycle.qxd 7/7/2008 4:11 PM Page 80

PROGRAMMABLE
TO FPGA LOGIC
DELAY

I/O PIN

PROGRAMMABLE
TO FPGA LOGIC
DELAY

CLOCK

■ FIGURE 2. From a user/programmer standpoint, these


FPGAs aren’t as complicated as one might think. Buffers, interconnected slices. Each slice consists of a pair of
clocks, multiplexers, and latches are common logic LUTs and two dedicated storage elements that can act as
building blocks that I’m sure all of you understand. What flip-flops or latches. One pair of LUTs supports logic and
you don’t see here are the pull-up/pull-down and ESD
memory functions within the slice. The remaining LUTs in
components at the input buffer input.
the slice service logic only. This logical arrangement of
CLB to Figure 1 illustrates the CLB concept. slices allows the LUTs to be used as 16x1 memory or as
Translating the Xilinx speak to Figure 1 graphics, the 16-bit shift registers.
Xilinx “function generators” are actually the look-up table. We will be working with two Xilinx Spartan-3A FPGAs:
In terms of an FPGA, a register is synonymous with a latch the XC3S700A and the XC3S50A. The plan is to cut our
or a flip-flop. In the case of Figure 1, the Xilinx register is FPGA teeth with the larger 700A and design our own
our LUT’s D flip-flop. Reprogrammable routing control is a FPGA hardware with the smaller 50A. To give you a feel
fancy way of saying multiplexer. Our LUT’s reprogrammable for the FPGA size difference, the BGA-packaged 700A
routing control is represented in Figure 1 by the two-input contains 1,472 CLBs and 700,000 system gates while the
multiplexer at the LUT output. much smaller 144-pin 50A has but 176 CLBs and 50,000
CLBs are the physical foundation that all Xilinx FPGA system gates. We’re going with the smaller Spartan-3A
designs are built upon. All of the software-generated logical FPGA for our hardware design because it is housed in a
functions are implemented by CLBs. In the Xilinx FPGA we solder-friendly 144-pin TQFP package.
will be working with, a CLB is a wee bit more complex The whole idea of using an FPGA in an electronic
than our simple LUT in Figure 1. A CLB is made up of four circuit of our design would be null and void if we were
unable to access the internal logic of the FPGA.
The physical I/O pins of our Xilinx FPGAs are all
tied internally to IOBs (Input/Output Blocks).
Think of an IOB as a programmable unidirectional
or bidirectional I/O interface to the FPGA’s logic
blocks. A typical Xilinx IOB has three data paths.
On the input path, the logic signal presented at
the FPGA pin is routed through an internal buffer
that feeds a programmable delay mechanism. The
output of the programmable delay block can be
TRI-STATE routed directly to the FPGA logic or through a
CLK
latch and then out to the FPGA logic. A simplified
block diagram of the FPGA input path is shown
in Figure 2.
The second and third data paths work
cooperatively to form a programmable output
path, which has the ability to be coaxed into high
FPGA I/O PIN
impedance or tri-state mode. Figure 3 gives us an

■ FIGURE 3. This graphic is greatly simplified as


you really only need to understand the concept.
There are actually two storage blocks available
CLK DIRECT in each output path. In addition, the same
pull-up/pull-down and ESD circuitry that is made
available to the input path is also available to
the output path.
80 August 2008
DesignCycle.qxd 7/7/2008 4:12 PM Page 81

THE DESIGN CYCLE

■ PHOTO 1. This is the only


Spartan-3A variant that is
available in a pinned
package. Only 144 pins. We
can handle this.

executive view of the Xilinx


programmable output block.
The direct output path looks
very similar to our LUT output
path. The output signal can be
driven by a storage block or
simply routed directly to the
FPGA output pin via the
multiplexer and the three-state
output driver. The tri-state
output path is used to drive the
three-state output driver’s ■ PHOTO 2. We can handle this, too. This development
output into high impedance mode. Note that board was intended to demonstrate the capabilities
programmable storage elements are present in both of the of the Spartan-3A FPGA family. We’re going to use it
output paths. To complete the feature set offered by the as a launch pad into FPGA space.
Xilinx IOB, every signal path that enters an IOB has an
associated programmable inverter option. to need right now. However, the simple and necessary
There’s one more basic thing you need to understand things we’re going to need here (like LEDs, pushbuttons,
about FPGAs. When the lights go out, so does the RS-232 interface circuitry, and an LCD) are included as
FPGA program. Therefore, if we want our LEDs to blink subsystems in the kit. All we have to do to use the starter
every time we power up our FPGA hardware, we need kit’s resources is map them into our FPGA application.
to include some program storage for the FPGA to boot The mapping is done within ISE WebPACK with the User
from. The FPGA program storage can be in the form of Constraints Floorplan I/O utility.
serially-interfaced (SPI) or parallel-interfaced memory. As we progress through our FPGA projects, I am
We can also get fancy and use a microcontroller to load going to pull selected items from the Spartan-3A kit and
an FPGA. We’ll be using the official Xilinx Platform Cable associate them schematically with our Verilog code.
USB on the FPGA’s JTAG interface to download our If you want to see what the starter kit looks like as a
FPGA designs. Using the FPGA JTAG interface for whole from a schematic point of view, you can download
programming the FPGA also opens up the use of the Spartan-3A Starter Kit schematic from the Xilinx
Xilinx’s JTAG-accessible Platform Flash as our FPGA boot
memory element. ■ PHOTO 3. Although LEDs and switches are easy to
manipulate with most any microcontroller, CPLD, or FPGA,
If you had the opportunity to participate in our past
we must pay attention to where they are best connected to
Design Cycle CPLD discussions, you’ll see that we are their hosts. The LEDs are attached to high current FPGA
using the very same CPLD support equipment (platform outputs while the slide switches are connected to FPGA
cable USB programmer and ISE WebPACK software) to dedicated input pins. Note the FPGA pin locations I
load our design logic into Xilinx FPGAs. The only thing used to map the LEDs and switches into my Verilog
we’re going to change is our programming lan- code are silkscreened in parentheses.
guage. Instead of using ABEL, we’re going to lay
down our FPGA logic with Verilog. Before we start
our Verilog coding, let’s take a quick look at the
hardware target we’ll be working with.

THE XILINX SPARTAN-3A FPGA


Our goal is to build up some home-brew
FPGA hardware using a Xilinx XC3S50A like the
one you see in Photo 1. Since all of the members
of the Spartan-3A family of FPGAs have identical
basic characteristics, we can do our preliminary
FPGA firmware and hardware design work on a
prefabricated Spartan-3A-equipped demo board.
The Xilinx Spartan-3A Starter Kit you see in
Photo 2 has way more stuff on it than we’re going
August 2008 81
DesignCycle.qxd 7/7/2008 4:13 PM Page 82

website. Let’s begin by directing our attention to the bank Bank 0 = pins 109 – 144
of LEDs on the starter kit printed circuit board (PCB). We’ll Bank 1 = pins 73 – 108
write a bit of Verilog code to instruct the FPGA to do Bank 2 = pins 37 – 72
something constructive with the LEDs and slide switches Bank 3 = pins 1 – 36
I’ve captured in Photo 3.
That works out to a bank being a complete side of
the square FPGA package you see in Photo 1. If you
TURNING ON THE LIGHTS WITH VERILOG orient pin 1 of the 50A in the upper left corner (looking
Most of you already know how to program down onto the legend side of the FPGA IC), Bank 0
microcontrollers and personal computers in Basic or C. consists of the pins along the top pin row of the FPGA.
For you C and Basic programmers, picking up Verilog will The successive FPGA banks flow in a clockwise direction
be effortless. However, since making assumptions turns with Bank 1 being made up of the right-hand pin column
me into a donkey, I will approach Verilog as if all of you of the 50A. Bank 2 runs along the bottom row of the
know little to nothing about C, Basic, or Verilog. FPGA and Bank 3 is positioned in the left-hand column
I’ve pulled the LED and slide switch area from the of pins opposite to Bank 1. Believe it or not, the same
schematic and transplanted them into Schematic 1. The banking scheme is applied to the 700A BGA package
700A is packaged in a BGA (ball grid array) package, with ball A1 oriented in the upper left corner and ball
which explains the alphanumeric FPGA pin identifiers AB22 in the bottom right corner.
(W21, Y22, etc.). Since we’re taking hardware pointers One must understand the basic I/O principles of a
from the Spartan-3A starter kit, I’ll point out that all of the microcontroller before being able to code more complex
LED FPGA I/O pins are located in Bank 1 of the 700A. I/O-oriented tasks. The same holds true for FPGAs. So,
The reason for this is that Spartan-3A FPGAs allow up to let’s write some Verilog code that will mirror the slide
24 mA of drive current from I/O pins located in Bank 1 switch positions in the LED bank. A slide switch is in the
and Bank 3. “ON” position when the slide switch common terminal
Banks 0 and 2 are only able to supply a presents a logical high to the FPGA. Conversely, the slide
maximum of 16 mA of drive current. The slide switches switch “OFF” state is represented by a logical low at the
are also strategically pinned to the 700A. All of the slide FPGA input pin. We’ll illuminate the corresponding LED
switches are pinned to dedicated FPGA input pins located when a slide switch is “ON.”
in Bank 2. From the perspective of our targeted 50A, Verilog is based on modules. Verilog modules use
here’s how the FPGA bank pins fall out: ports as I/O mechanisms. The arguments associated
with a module are contained in the port list,
which follows the name of the module in the
3V3IO
SW0 R133 390 LED7 module declaration. Consider this Verilog
W21 code snippet:
V8

R130 390 LED6 module slide_to_led(


Y22 input sw0_in,
input sw1_in,
input sw2_in,
SW1 R131 390 LED5 input sw3_in,
V20
U10
output led0_out,
output led1_out,
R134 390 LED4 output led2_out,
V19 output led3_out
);
endmodule
R135 390 LED3
SW2 U19
Our first Verilog module is called
U8
R132 390
slide_to_led. The module ports (arguments)
LED2
U20 consist of our slide switch inputs and four
of the LEDs which are defined as outputs.
R136 390
Note the use of commas, parentheses, and a
LED1
T19 semicolon to bracket the port list. That looks a
SW3
■ SCHEMATIC 1. Since the Spartan-3A starter kit
T9 R137 390 LED0
R20 designers have already assigned FPGA pins to
these components, we must use the ISE WebPACK
Floorplan I/O utility to map these into our FPGA
application. Note that the FPGA pin designations
here match those found in Photo 3.
82 August 2008
DesignCycle.qxd 7/7/2008 4:13 PM Page 83

THE DESIGN CYCLE

lot like C to me. As we add more Verilog source, you’ll output wire led3_out
notice the minimal use of braces ({}). Verilog likes to );
replace braces we use so often in C with begin and end
always @(sw0_in,sw1_in,sw2_in,sw3_in)
statements. Braces do have a place in the Verilog scheme begin
of things as Verilog employs braces to concatenate and if(sw0_in)
replicate. led0_out = 1;
Our slide_to_led code won’t do much in its current else
state. Since we want to control the LEDs with the led0_out = 0;
slide switches, the most logical Verilog code would look // if/else code for rest of switches goes here
like this: end
endmodule
module slide_to_led(
input sw0_in,
input sw1_in,
input sw2_in, Verilog uses the data type wire to connect modules
input sw3_in, and gates. Think of a Verilog wire just as you would a
output led0_out, piece of wire in one of your electronic projects. I
output led1_out, added the Verilog wire data type into our Verilog module
output led2_out,
output led3_out manually for illustrative purposes as Verilog defaults
); all of the module arguments to the data type of wire.
Verilog wires can only be read/driven by a continuous
always @(sw0_in,sw1_in,sw2_in,sw3_in) assignment statement or tied to an input or output of a
begin
if(sw0_in) module or gate. Thus, we can’t write a logical “1” or
led0_out = 1; logical “0” directly to led0_out as we attempted to do
else in our Verilog module code because led0_out is a
led0_out = 0; Verilog wire.
// if/else code for rest of switches goes here
The fix for our faulty Verilog module is simple:
end
endmodule module slide_to_led(
input wire sw0_in,
input wire sw1_in,
Naturally, we would include the appropriate if/else input wire sw2_in,
statements to cover all of the rest of the LEDs and slide input wire sw3_in,
switches. The Verilog if/else statements are just like their C output reg led0_out,
counterparts with the exception of the C braces, which output reg led1_out,
are replaced by Verilog begin and end operators when the output reg led2_out,
need arises. The good old do/while(1) loop-forever C code output reg led3_out
);
has been replaced here by the Verilog always @ loop
code. Everything between begin and end inside of the always @(sw0_in,sw1_in,sw2_in,sw3_in)
always loop is executed every time one of the slide switch begin
logic levels is changed. In other words, a Verilog always if(sw0_in)
loop runs freely and triggers on the arguments in the led0_out = 1;
else
sensitivity list. In our case, the logic levels of the slide
led0_out = 0;
switches make up our always @ sensitivity list. There are
times when you can run a Verilog always loop without a // if/else code for rest of switches goes here
sensitivity list. Doing a plain vanilla always loop is just like end
running a never-ending while(1) C loop. endmodule
After all of that typing, we would find that this code
doesn’t work. The key to writing some working code The Verilog data type reg is short for register. Verilog
lies behind understanding what Verilog is doing to us registers are able to hold their values from procedure to
here. Here’s what the code really looks like under the procedure. We can also read them and write them. Don’t
Verilog covers: get too cozy with the concept of a Verilog register being a
piece of silicon as reg is a Verilog data type just like a
module slide_to_led( Verilog wire. All we really care about is how, when, and
input wire sw0_in, where to use regs and wires best.
input wire sw1_in, Now would be a good time to show you how
input wire sw2_in, continuous assignment works. Let’s use our original
input wire sw3_in,
output wire led0_out,
default-to-wire module code and add some Verilog
output wire led1_out, assignment code to handle getting the slide switch states
output wire led2_out, out to the LEDs:
August 2008 83
DesignCycle.qxd 7/7/2008 4:13 PM Page 84

SOURCES BLINKING THE LIGHTS WITH VERILOG


Xilinx — www.xilinx.com The Spartan-3A starter kit is equipped with an
XC3S50A; XC3S700A; ISE WebPACK; on-board 50 MHz oscillator. There’s no way we humans
Spartan-3A Starter Kit; Platform Cable USB can see a 50 MHz scan rate in the LED bank. So, we must
divide the incoming 50 MHz clock to produce a scan rate
Saelig — www.saelig.com that we can see in the LED bank. To keep things simple,
CleverScope we’ll craft our clock divider to run on powers of 2.
Let’s shoot for a scan rate of around 10 Hz. That
module slide_to_led( means that we must divide our 50 MHz clock by
input sw0_in,
input sw1_in, 5,000,000. The divisor value in hexadecimal is 0x4C4B40.
input sw2_in, The idea is to key our clock divider on an overflow of the
input sw3_in, most significant bit. We can’t do that accurately with
output led0_out, 0x4C4B40. So, let’s use 0x3FFFFF as our clock divisor.
output led1_out,
output led2_out, We’ll count from 0 to 0x3FFFFF and reset our divisor
output led3_out when it rolls over to 0x400000. Let’s do the math to see
); what scan rate that will give us:
reg led0;
reg led1; Scan rate = 50,000,000 Hz / 0x3FFFFF
reg led2; (4,194,303 decimal) = 11.92 Hz
reg led3;

assign led0_out = led0; To double-check our scan rate math, let’s compute
assign led1_out = led1; the period of 11.92 Hz and take a snapshot of the scan
assign led2_out = led2;
assign led3_out = led3;
rate with a CleverScope:

always @(sw0_in,sw1_in,sw2_in,sw3_in) Period of 11.92 Hz = 1 / 11.92 = 0.084 seconds or 84 ms


begin
if(sw0_in)
led0 = 1; Screenshot 1 confirms our scan rate. Here’s the Verilog
else code that produced the waveform you see in Screenshot 1:
led0 = 0;
if(sw1_in) module led_cntr_code(
led1 = 1; input clk,
else output reg [7:0] led_out
led1 = 0; );
if(sw2_in)
led2 = 1; reg [22:0] clk_divider;
else
led2 = 0; always @(posedge clk)
if(sw3_in) begin
led3 = 1; clk_divider <= clk_divider + 1;
else if(clk_divider[22])
ed3 = 0; begin
clk_divider[22] <= 0;
end led_out <= led_out + 1;
endmodule end
end
Note that I removed all of the explicit data type defini- endmodule
tions. Doing that allows all of our port arguments (inputs
and outputs) to default to wire. We have already proven that There’s some new stuff in the LED counter code.
we can’t directly drive a Verilog wire with code alone. So, However, I don’t think you’ll have any problems figuring out
we have to add something to our Verilog code to drive the what our Verilog code is doing. Our 50 MHz clock is fed into
ledx_out wires. That “something” is a quartet of Verilog the FPGA via the clk input, which is assigned to an FPGA clock
registers: led0, led1, led2, and led3. To have the newly added input pin (E12). The LED output is defined as an eight-bit
Verilog regs drive the Verilog LED output wires, we assign (bits 7 through 0) register with each of its led_out LEDs
each of the ledx registers to its logically associated ledx_out tied to an FPGA output pin as specified in Schematic 1. Our
wire. The rest of the if/else Verilog code remains the same, 23-bit clock divider register collects the 50 MHz ticks and
sorta. Note that now we must write to our newly added is reset every time the most significant bit (bit 23) is equal to 1.
ledx registers as our ledx_out entries are now Verilog wires. At every clock divider reset, the led_out register is increment-
FPGAs are natural born counters. Now that we have a ed and the LEDs reflect the value of the led_out register.
grasp on FPGA I/O operations, let’s build on our Verilog Note that our “always” sensitivity list is focused on the
knowledge and code up an eight-bit counter that reveals rising edge of every clock cycle of the incoming 50 MHz
itself via the LEDs. clock. Thus, this always loop’s contents are executed on
84 August 2008
DesignCycle.qxd 7/7/2008 4:14 PM Page 85

THE DESIGN CYCLE

■ SCREENSHOT 1. I captured
this waveform on the LED0
anode. As you can see,
our scan rate math is confirmed
on both sides of the center
of the waveform.

every rising edge of the 50 MHz


clock. Note also that the “=”
operator we used in our slide
switch code has been replaced
with “<=” in our counter code.
The “=” operator is called
a procedural blocking
assignment, which means that
statements that use it will
execute in the order of their
appearance. When blocking is
employed, the next statement
will not execute until the cur-
rent statement execution has
completed. The “<=” operator is non-blocking. All run the FPGA projects just as we ran them here. You don’t
non-blocking statements execute in parallel. As the need any FPGA hardware to compile the project code.
non-blocking operator infers, the non-blocking statements I’ve included the entire project file set for both
are evaluated right to left. Non-blocking operation closely projects so that you can look at all of the ISE WebPACK
models a physical flip-flop and should be used in clocked options and settings. For instance, if you’re wondering
always loops. Blocking statements are best suited for how I assigned FPGA pins to the LEDs and slide switches,
combinatorial logic like our slide switch code. you can see how I did it by looking at the User
Constraints Floorplan I/O utility entries, which are
available from the ISE WebPACK Processes window.
DUST OFF YOUR SOLDERING IRON With our FPGA projects verified on the Spartan-3A
... because next time we’re going to build up our own starter kit, we now have some known-good test code we
homebrewed XC3S50A FPGA hardware. can run on the XC3S50A hardware we’ll build up in the
All of the Verilog code in this installment of Design next edition of Design Cycle. NV
Cycle was written using Xilinx ISE WebPACK version
10.1.01, which is a free download from the Xilinx website.
I’ve stuffed all of the projects into a download package on
CONTACT THE AUTHOR
the Nuts & Volts website (www.nutsvolts.com) so you can ■ Fred Eady can be contacted via email at fred@edtp.com.

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 for PIC® MCUs LAB-X Experimenter Boards BASIC Compilers for PICmicro®
Pre-Assembled Board Easy-To-Use BASIC Commands
$89.95 (as shown)
Available for 8, 14, 18, 28, Windows 98/Me/2K/XP/Vista
RoHS and 40-pin PIC® MCUs
2-line, 20-char LCD Module PICBASIC™ Compiler $99.95
Compliant
9-pin Serial Port BASIC Stamp 1 Compatible
Programs PIC Sample Programs Supports most 14-bit Core PICs
MCUs including Built-In Serial Comm Commands
Full Schematic Diagram
low-voltage (3.3V)
devices Pricing from $79.95 to $349.95 PICBASIC PRO™ Compiler $249.95
Supports most PICmicro® MCU Families
Includes Direct Access to Internal Registers
Software for
Windows With Accessories for $119.95: PICPROTO™ Prototyping Boards Supports In-Line Assembly Language
98, Me, NT, Includes Programmer, Software, USB Cable, Interrupts in PICBASIC and Assembly
XP, and Vista. and Programming Adapter for 8 to 40-pin DIP.
Double-Sided with Plate-Thru Holes Built-In USB, I2C, RS-232 and More
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

August 2008 85
Classifieds Aug08.qxd 7/9/2008 4:17 PM Page 86

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 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.
32-bit IEEE 754 or 5/$1.00 Orders 800-783-2666
SPI or I2C UG-175/U Reducer RG-58/58A, $0.25 Info 301-840-5477
DIP-18, SOIC-18 or 5/$1.00 FAX 301-869-3680
Fast – Easy to Use
Extensive floating point support,
GPS input, FFT, 12-bit A/D, matrix BOOKS
operations, user-defined functions.
www.micromegacorp.com
%RRNV
3,&Š0LFURFRQWUROOHU
VTFRP
6WHSSHU0RWRUV HARDWARE
VWHSSHUVWXIIFRP
WANTED
&1&
FQFLQWURFRP DEC EQUIPMENT
WANTED!!!
Digital Equipment Corp.
and compatibles.
Buy - Sell - Trade
OSCILLOSCOPES CALL KEYWAYS 937-847-2300
  or email buyer@keyways.com
Bargain Test Gear ! +D\GHQ,'86$
Portable, benchtop 25Mhz 100MS/s
022
2-ch color LCD Scope. Download
5 waveforms via USB1.1 to PC. 7.8"
PDS 640 x 480 Color LCD 3.5lbs.
Volt/Time Automatic Measurement
Peak-to-peak Value, Average,
RMS, Frequency and Cycle. FREE
1x/10x probes, USB cable. Compare
with expensive LCD scopes!
PDS5022S $325!
SPI Bus Analyzer - SPI protocol SECURITY
ess exerciser and analyzer for
Xpr standard SPI and non-standard
SPI 4-wire and 3-wire serial protocol
interfaces up to 50 Mbps. PC
control via free GUI Control
Panel Software. SPI sniffer,
chip-to-chip emulation.

SPI Xpress $699


1-888-7SAELIG
info@saelig.com ROBOTICS
www.saelig.com
ut
B l ow O l
Spe c i a

SATELLITE $9.95!

Satellite Dish Parts WWW.SERVOMAGAZINE.COM


C-band • 4DTV • FTA
Big Dish Is The
Hit of The Party! ARobot Kit from Arrick
NEW! More Channels on C-band! Robotics uses the Basic Stamp
• Bigger Packages II. Quality metal construction.
• Better Values Easy to assemble and
Call Today & See The Difference! very expandable.
www.skyvision.com/programming $235.00
800-500-9268 www.robotics.com/arobot
86 August 2008
Classifieds Aug08.qxd 7/9/2008 5:30 PM Page 87

CLASSIFIEDS
AUDIO/VIDEO MICROCONTROLLERS PCB SOFTWARE

EXCLUSIVE U.S. DISTRIBUTOR

YOUR COMPLETE
SOLUTION!
• PCB Design
• PCB Simulation
MicroStamp11 KITS/PLANS • CAD/CAM Menu
World’s Smallest 68HC11
Microcontroller Module! 121747, Hobby Vers., $175
telemetry
z 121743, Pro. Version, $275
microrobotics
z
smart toys
z
animatronics
z
www.KELVIN.com
model railroading
z
home automation
z

z tiny (1 by 1.4 in.), light-weight (0.5 oz.)


zon-board 5V reg., crystal, & reset chip
zchoice of 8K or 32K EEPROM
z or 32K RAM + 32K EEPROM (64K version) SOLAR
z SCI, SPI, Output Compare and Input
Capture channels, timer, pulse accumulator
z all 14 I/O lines and 2 interrupt lines
PRODUCTS/KITS
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-


ware (assemblers, SBASIC compiler,
EDUCATION MicroLoad utility, and sample programs),
serial cable, Docking Module, & accessories.

www.technologicalarts.com
Toll-free (USA & Canada):
1-877-963-8996
Visa • MasterCard • Discover • Amex

MISC FOR SALE

LCDs/DISPLAYS GADGETS

Looking for robots?


www.servomagazine.com
August 2008 87
NVWebstoreAug08.qxd 7/9/2008 5:08 PM Page 88

We hav e ov e r 170 r elat e d t i tles in our webs tor e!!


The Nuts & Volts WEBSTORE
“EDITOR’S PICKS” NEW
!
Complete Wireless Design
by Cotter W. Sayre
Pub.Date 06/24/08

Gain the Skill to Design Modern


Wireless Circuits and Systems!
Bike, Scooter, and
Chopper Projects This fully updated
for the and revised edition
Evil Genius Signals and Systems Demystified of the bestselling
Complete Wireless
In this eco-conscious time, everyone is Working in the time domain can get you Design takes a
only so far in filter and communications uniquely practical
taking a second look at alternative forms of systems design. Signals and Systems
transportation that are both easy on the approach to
Demystified provides a gentle introduction designing complex
wallet and the environment. to the frequency domain tools – such as
Notable in this book are several electric receivers and
the Fourier Transform – used by engineers transmitters found
bike designs that can provide the basis for tackling real-world problems. For interme-
serious transportation. $24.95 in advanced analog
diate to advanced readers. $19.95 and digital wireless communication
Editor Bryan Bergeron’s recommended reads. systems, right down to the circuit level.
Find these and many more great titles in the NUTS & VOLTS Webstore! Reg. $75.00 Sale Price $63.75

ELECTRONICS
Beginner's Guide to Embedding Troubleshooting and Repairing Build Your Own Electronics
t C Programs Major Appliances: 2nd Edition Workshop
B e sl e r by Eric Kleinert By Thomas Petruzzellis
Se l
by Chuck Hellebuyck
The C language has been covered in many Now covering both YOUR DREAM ELECTRONICS LAB
books but none as dedicated to the gas and electric IS WAITING INSIDE!
embedded microcontroller beginner. appliances, the This value-packed
Through his down-to- updated second resource provides
earth style of writing, edition of everything needed
Chuck Hellebuyck Troubleshooting and to put together a
delivers a step-by-step Repairing Major fully functioning
introduction to learning Appliances offers you
how to program micro- home electronics
a complete guide to workshop! From
controllers with the C the latest tools,
language. In addition, he finding space to
uses a powerful C techniques, and parts stocking it with
compiler that the reader for troubleshooting and repairing any appli- components to put-
can download for free in ance. Packed with over 200 illustrations, ting the shop into
a series of hands-on projects with sample the book includes step-by-step procedures action — building, testing, and trou-
code so you can learn right along with him. for testing and replacing parts, instructions bleshooting systems — popular electronics
For the hardware, he found the best low for reading wiring diagrams, charts with author Tom Petruzzellis’ Build Your Own
cost but effective development starter kit troubleshooting solutions, advice on using Electronics Workshop has it all! And the best
that includes a PIC16F690 microcontroller tools and test meters, safety techniques, part is, this book will save you money, big
and everything else the beginner needs to and more. $59.95* time! Reg $29.95 Sale Price $24.95
program and develop embedded designs.
$39.95
Programming and Customizing Getting Started in Electronics Electronics: A First Course
the PICAXE Microcontroller Second Edition
by Forrest M. Mims III Bes
by David Lincoln Author Forrest Mims teaches you the S e l l t by Owen Bishop
Here’s everything you basics, takes you on a e r Electronics: First Course
tour of analog and digital starts with the basics of
need to harness the electricity and component
power of PICAXE, components, explains
how they work, and types, and introduces
the inexpensive yet students to practical work
versatile chip that’s shows you how they are
combined for various almost straightaway. No
taken the electronics prior knowledge of
community by storm. applications. Includes
circuit assembly tips and electronics is assumed. The
This beginner-friendly second edition now has
guide from IT pro and 100 electronic circuits
and projects you can additional applicability to BTEC First
PICAXE expert David Electronics from Edexcel with coverage of
Lincoln shows you build and test. Forrest M. Mims, III, has
written dozens of books, hundreds of fundamental topics required by students of
just what Revolution Education’s PICAXE this qualification, as well as other essential
can do — and helps you make it do it! articles, invented scientific devices, and
loves to share his knowledge with eager new topics that reflect recent technological
Packed with ready-to-build projects for all
students! $19.95 developments.$ $36.95
the flavors of PICAXE.. $39.95
88 August 2008
NVWebstoreAug08.qxd 7/9/2008 5:10 PM Page 89

Or Order online @ www.nutsvolts.com


CALL 1-800-783-4624 today!
THE EVIL GENIUS SERIES

BOOK & KIT COMBOS


Virtual Serial Port Cookbook From the
by Joe Pardue Smiley’s Workshop
page 61
As talked about in the
C Programming for
Nuts & Volts June issue, Microcontrollers
“Long Live The Serial Port” by Joe Pardue
Kit $69.95
Book $44.95
Book $44.95 Kit $66.95
This is a cookbook for communicating between a PC and a micro-
controller using the FTDI FT232R USB UART IC.The book has lots Do you want a low cost way to learn C programming for
of software and hardware examples.The code is in C# and Visual microcontrollers? This 300 page book and software CD show you
Basic Express allowing you to build graphical user interfaces and add how to use ATMEL’s AVR Butterfly board (available in the kit,
serial port functions to create communications programs. above right) and the FREE WinAVR C compiler to make a very
The Virtual Serial Port Parts Kit and CD inexpensive system for using C to develop
microcontroller projects.
( also available, above right ) Combo Price $99.95 Plus S/H $8.95
Combo Price $115.95 Plus S/H $8.95
PIC Microcontroller Newnes Guide to Television and Encyclopedia of Electronic
Project Book Video Technology Circuits, Volume 7
by John Iovine by K. F. Ibrahim by Rudolf F. Graf / William Sheets
The PIC Publish Date: August 31, 1998 B
e
microcontroller is Starting with TV S e l ls t
enormously popular fundamentals, the bulk An extensive library er
both in the US and of the book covers the of 1,000 circuits from
abroad.The many new technologies the bestselling, seven-
electronics hobbyist that are bringing rowth volume Encyclopedia
market has become to the TV and video of Electronic Circuits. A
more sophisticated. market, such as plasma virtual treasurehouse.
This new edition is and LCD, DLP (digital An invaluable reference
fully updated and revised to include detailed light processing), DVD, tool for every
directions on using both versions of the Blu-ray technology, hobbyist, technician,
microcontroller, with no-nonsense recom- Digital television, High student, and design
mendations on which is better served in dif- Definition television (HDTV), and video professional. $39.95
ferent situations. $29.95 projection systems. $34.95
CD-ROMS

August 2008 89
NVWebstoreAug08.qxd 7/9/2008 5:12 PM Page 90

CALL 1-800-783-4624 today!


Or Order online @ www.nutsvolts.com
PROJECTS
Nixie Clock Kit Freeze Fountain Kit
As seen on the As seen in the
Nixie tube clocks
October 2006 May 2008
fuse the spirit,
cover issue
drama, and eerie
beauty of cold war It’s Here!!!!
technology
with modern inner Looking for a fun
works to create project using the
uncommon science of temporal aliasing a.k.a.,
handcrafted the “stroboscopic effect?”
timepieces. NEW
This clock / kit was shown at the May 2008 MAKER Faire in San !
Then here it is! The Freeze Fountain PCB & Component Kit.
Mateo, CA by Nuts & Volts Magazine and was very well received as a This kit has all the components you need to start amazing your friends by
novel way to show the Nixie tubes. Plus, it’s a great kit for all levels creating the illusion of water drops frozen in time.
of electronic experience. You can even show them dripping upwards!
For more information, please check out your October 2006 Sold as a kit, or the PCBs can be puchased separately.
issue or go to our website @ www.nutsvolts.com For more information, please check out your May 2008 issue
or go to our website @ www.nutsvolts.com
NEW CLOCK CASES AVAILABLE KIT Subscriber’s Price $98.95 Non-Subscriber’s Price $109.55
Subscriber’s Price $146.95 Non-Subscriber’s Price $159.95 PCBs Subscriber’s Price $34.95 Non-Subscriber’s Price $39.95
Both include an article reprint.
Both include an article reprint.

Digital LED Conversion Kit Switching Regulator Kit Voice Changer Kit
Need to regulate your
power output? Take a look
at this new and improved
regulator. For more infor-
mation, please check out
your June 2008 issue or
go to our webstore @
www.nutsvolts.com Have fun with the whole family with this
200% More Efficient Subscriber’s Price $29.95 project. Put your newly changed robotic
Turn all your old style bulb Non-Subscriber’s Price $32.95
flashlights into bright, five voice on your outgoing phone message, or
Kit includes an article reprint.
LED, energy efficient, use it on those annoying telemarketers!
4.5 VDC digital flashlights. PCBs can be bought separately. For more information, please check
For more information, out your May 2008 issue
go to our website @ Subscriber’s Price $39.95
www.nutsvolts.com
Without Flashlight Housing Non-Subscriber’s Price $45.95
As seen on the $22.49 PCBs can be bought separately.
February 2008
cover With Flashlight Housing $ 20.95*
$25.95 Both include an article reprint.
Both include an article reprint.

Garage Door Alarm Kit The Amateur Scientist 3.0 H.V.P.S. Kit
The Complete Collection
by Bright Science, LLC
There are 1,000
projects on this
CD, not to mention
the additional
technical info and
bonus features. It As seen on the
As seen in the doesn’t matter if April 2008 cover
November 2007 you’re a complete It’s fun to collect and experiment with
issue novice looking to forgotten technology!
do their first But, you’ll need a stable high voltage
Have you ever laid in bed and power supply to get started.
science fair project
wondered ... is the garage door open?
Get more info @ or a super For more info, go to the Nuts & Volts Webstore
tech-head gadget www.nutsvolts.com
www.nutsvolts.com
Subscriber’s Price $49.95 freak; there are enough projects on the sin-
KIT Subscriber’s Price $49.45
Non-Subscriber’s Price $57.45 gle CD-ROM to keep you and 50 of your
Kit includes article reprint, complete instructions, parts friends busy for a lifetime! $26.99
Non-Subscriber’s Price $54.95
list, and hole drilling templates. Both include an article reprint.

90 August 2008
WE ACCEPT VISA, MC, AMEX, and DISCOVER. Prices do not include shipping and may be subject to change.
NVWebstoreAug08.qxd 7/9/2008 4:45 PM Page 91

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 WEBSTORE


ALTERNATIVE ENERGY
SECTION
Alternative Energy Demystified Solar Hydrogen Power Designing & Building Fuel Cells
by Stan Gibilisco Generation Set by Colleen Spiegel
Publish Date: October 23, 2006
The fast and easy Designing & Building
way to get up-to- Fuel Cells equips you
speed on alternative with a hands-on guide
energy. Because of for the design, model-
current events, ing, and construction
geopolitics, and of fuel cells that per-
natural disasters, form as well or better
the cost of fuel is than some of the best
front and center in fuel cells on the mar-
our lives.This book ket today. Filled with
provides a concise over 120 illustrations
look at all forms of The Solar Hydrogen Generation Set and schematics of fuel cells and compo-
energy, including fossil fuels, electric, includes a solar cell, a PEM reversible fuel nents, this “one-stop” guide covers fuel
solar, biodiesel, nuclear, hydroelectric, cell, as well as oxygen and hydrogen gas cell applications, fuels and the hydrogen
wind, and renewable fuel cells.You will containers.The set only needs pure water economy, fuel cell chemistry, thermody-
get explanations, definitions, and analysis to create hydrogen and produce electricity. namics and electrochemistry, fuel cell
of each alternative energy source from a Perfect for science labs, classroom use, or modeling, materials, and system design,
technological point-of-view. $19.95 demonstration purposes. fuel types, delivery, processing, and much
$67.00 more. $89.95*

Do It Yourself Guide to Energy Systems Engineering The Complete Idiot’s Guide to


Biodiesel by Francis Vanek, Solar Power for Your Home
by Guy Purcella Louis D. Albright by Dan Ramsey / David Hughes
Contains the most Publish Date: June 13, 2008 Publish Date: May 2007
current and complete A unique systems The perfect Bes
information available approach to energy engi-
neering, covering carbon-
source for solar S e l l et
for would-be biodiesel power — fully r
makers.This book based, nuclear, and renew- illustrated.This
offers a step-by-step able sources! book helps read-
path from the initial Filled with over 200 ers understand
desire to do some- detailed illustrations and the basics of solar
thing good for the tables, the book examines power and other
environment to the short-, medium-, and renewable energy
final stage of filling the tank with low-cost long-term energy options for the sources, explore
fuel. Readers are given a complete remainder of the twenty-first century. For whether solar
understanding of what biodiesel is and each energy system, the authors provide power makes
how to make it properly and safely. equations and problems to help sense for them,
There is even a section on pitfalls to practitioners quantify the performance of what their options are, and what’s
avoid, as well as the author's personal tips the technology and better understand its involved with installing various on- and
and tricks. $15.95 potential. $89.95* off-grid systems. $19.95

KILL-A-WATT Special Offer


FRE
with E!
purch any
over ase
$100
Phon
order e-in
s only
!
FREE Nuts & Volts T-shirt with
orders over $100.00 of any
product combination;
2 T-shirts, with orders over
$200.00
Limited time offer.
Call 1 800 783-4624
Going, Going, Gone Green! Shirts sizes available: S, M, L, XL

August 2008 91
ReadFeed Aug08.qxd 7/9/2008 4:12 PM Page 92

READER FEEDBACK continued from page 10

less bandwidth, don't send all the sync verb, why not “edict”?) all broadcast
info. H/V sync in the analog signal takes TV stations to have digital over-the-air
up about 20% of the bandwidth. In the programing. These are on other
digital world, all that can take up one frequencies from their VHF/UHF
byte. Saved a bunch of space there!!! programing. The MIGLIA tuner outputs
Do some creative compression, data on USB 2.0 and came with a driver
processing, error correction, remove package called eyeTV2. Unfortunately,
parts of the image people won't notice, the password issued for the tuner
and before you know it you have restricts the driver to only access the
squeezed that digital signal into less USB port, even though there are other
space than the analog one. drivers provided which may have made
I get tired of everyone saying that the Firewire port available for input,
the digital signal is better — it’s not all and thus the STB viewable.
the time. I would tell people if they There are channels from my STB
thought that, then they had not seen a that I cannot get from local broadcasters
really good analog signal! If you take a that I wish to view with my setup. I can
good look at a digital TV picture, you only assume that the STB must utilize
will see lots of picture faults. Most a standard protocol if it is to be
people don't notice these faults and the compatible with any TV set that has a
broadcast companies can get away with Firewire input. There are discussions
it. If, in the past, a broadcast company on line about recording from STBs, my
broadcast a picture with as many only interest is to view. Please, do you
impairments as in the digital picture, have any advice?
their phones would be ringing off the Thanks in advance for your most
hook. Thank you for your time. kind consideration.
Donovan Stenger Tall Henning
Broadcast Technologist
Response: You have quite a nice
setup there. While Firewire has been
TRYING TO TUNE IN around for a while, it’s not in common
Apparently I always have things use to connect home theater equipment.
backwards! If the advertisers are to be The Scientific Atlanta “Explorer”
believed, the whole world wants to 3250HD you have specifies the Firewire
watch video on their iPod, iPhone, or connectors as “reserved for future use.”
laptop. Apple even comes out with iTV Depending upon which of the two main
figuring people's monitors to be smaller software OS your box is running, these
than the wide screen TVs they are sure connectors may someday be active.
to own. Not me! Until then, I think you will have to find
I have an Apple 30” Cinema another way to hook up your STB.
Display connected to a 2 GHz dual I assume you are using your Mac
G5 running Mac OSX 10.4.x Thanks as the hub, probably hoping to let it
to iDVD, I can watch DVDs on this, perform DVR functions. If not, I would
but the problem came with trying to suggest replacing the STB with a unit
watch cable TV. that has DVI or HDMI output. You
When I upgraded from analog to could use a DVI switch (perhaps
digital cable service from Time/Warner, w/remote control) to toggle between
I insisted on a set top box E/W a the computer and STB. And you could
Firewire® output. After connecting have a DVR in the STB as well (for a
everything together, the G5 reports fee, of course).
seeing the Scientific Atlanta “Explorer” Probably not what you wanted
3250HD STB at the Firewire input, but to hear, but unless you want to go
refuses to T anything with it. shopping for a new STB (cable
In the interim, I have opted to use a companies are now required by law
MIGLIA TVMini HD (now discontinued) to let you buy your own), there’s
digital over-the-air tuner. The FCC in its nothing else you can do.
infinite wisdom has edicted (if the news Jeff Mazur
readers on TV can make “impact” a Author of previous NV HDTV articles
92 August 2008
Full Page.qxd 7/9/2008 9:27 AM Page 93

August 2008 93
TechForum.qxd 7/9/2008 8:22 PM Page 94

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 and epoxy-seal it, forming a COB PCB.
volts.com All diagrams should be
computer generated and sent with your >>> QUESTIONS
submission as an attachment. #1 I found these companies online.
QUESTIONS I'm looking for information on They offer prototype services among
To be considered, all questions should relate power line communication systems. others.
to one or more of the following: Does the US power grid broadcast any IDAX microelectronics Lab
❶ Circuit Design information that can be read from the Anaheim, CA
❷ Electronic Theory power lines coming into my home? Are 714-632-5088
❸ Problem Solving there any projects that can tap that www.idaxlabs.com/services.asp
❹ Other Similar Topics information? Quik-Pak
■ Be brief but include all pertinent informa- #8081 Steven Van Epps San Diego, CA
tion. If no one knows what you're asking, you via email 858-674-4676
won't get any response (and we probably www.icproto.com/products/
won't print it either). I need info on refurbishing or Majelac Technologies
■ Include your Name, Address, Phone Num- building custom solar yard lights. I Aston, PA
ber, and email. Only your Name, City, and
currently have a Lighthouse lawn 610-459-8786
State will be published with the question,
ornament that has a solar light that www.majelac.com/
but we may need to contact you.
■ No questions will be accepted that offer doesn't recharge the replaceable Daryl
equipment for sale or equipment wanted to rechargeable battery. Information on via internet
buy. troubleshooting would be helpful for
■ Selected questions will be printed one what I assume to be a fairly common #2 I have had prototype and full
time on a space available basis. circut. I would also like to illuminate the production PCBs made with the
■ Questions are subject to editing. lantern of a Lawn Jockey and a Pagoda. company listed below, with excellent
Adding multiple LEDs with changing personal service, board quality, and
ANSWERS colors and blinking patterns could also pricing without any problems for over
■ Include in the subject line of your email, be a take off. Anyone have a circuit? 25 years. They are directly associated
the question number that appears directly #8082 Mike Hoffert with several companies that will provide
below the question you are responding to. via email your requests with great satisfaction.
■ Payment of $25.00 will be sent if your Northern Circuits, Inc.
answer is printed. Be sure to include your
mailing address or we cannot send payment. >>> ANSWERS East Syracuse, NY
315-463-8531, 800-378-0490
■ Only your Name, City, and State, will be
[#5084 - May 2008] http://northerncircuits.com/
printed, unless you say otherwise. If you
I'm looking for an affordable (US) John F. Mastromoro
want your email address included, indicate
to that effect. PCB MFG who specializes in prototype Saint Johnsville, NY
■ Comments regarding answers printed in quantities (<100) of COB (chip on
this column may be printed in the Reader board) from DIE that I provide. I need a #3 Hybrid Design Associates www.
Feedback section if space allows. company who can lead-attach the DIE hda-smc.com/ in Tempe, AZ may be
94 August 2008
TechForum.qxd 7/9/2008 7:34 PM Page 95

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

able to help you. They are not reduce the input voltage to lower the produced by stamping and are read
inexpensive, but they are capable of high voltage level and power dissipa- only, in a 120 mm diameter x 1.2 mm
doing almost any COB assembly. tion, with a resistor in series or a lower thick format. The data begins on the
Robert Zusman voltage supply. The high voltage level inner tracks and spirals outward,
Scottsdale, AZ depends on T1 — a different T1 would allowing smaller disks (80 mm
yield a different high voltage level. You Mini-CD) and novelty shaped disks to
[#6081 - May 2008] can measure the high voltage level at be used. The read laser operates at
Has anyone adapted surplus the device under test (DUT) terminals 780 nm (infrared).
computer parts for other uses? For with nothing other than the meter Later, the same 120 mm disks
example: adapting on old sound card connected there. Tests should be brief, were adapted for computer data stor-
for use as an amplifier. If so, please tell in any event, as the meter displays the age, under the “Yellow Book”
what you did and how. Also, can some- zener voltage immediately. Standard for CD-ROMs. The “Orange
one explain the similarities and differ- Ed Schick Book” Standard further defined a
ences between audio CDs and DVDs? Harrison, NY WORM (Write Once Read Many) disk
that can be recorded by an end user
#1 The power supply in the PC can #2 While many good quality and drive — called CD-R — and a fully
be used, with just a small modification. interesting function PC parts can be read-erase-write disk called CD-RW, by
There are a number of write-ups telling recycled, it’s quite hard to make the “burning” the inner disk surface with a
you how on the web — here's one: surplus boards play outside of the PC higher power laser.
http://web2.murraystate.edu/andy. environment. This is because most — if Various speed enhancements
batts/ps/powersupply.htm not all — PC peripherals require have been made; the 1X disk spins at
You can find many uses for parts programming at start-up. Even simple approximately 200-500 RPM, and
scrounged from old PCs. devices such as audio cards require records in real time (80 mins audio or
Figure 1 is a zener tester circuit configuration from the PC’s operating 700 MB data for a complete disk),
built exclusively from parts out of a system (the “driver files” loaded to the currently 52X drives record the same
defective CRT monitor. Attach a volt OS when the cards are first installed). 700 MB of data in about 90 seconds!
meter and the zener to be tested In operation, digital commands to con- For full length movies, a higher
across the DUT terminals. The meter figure the audio paths and signal levels density 120 mm disk called DVD
measures the zener voltage on zeners are established every time the PC (Digital Versatile Disk) was added in
up to about 100 volts. The oscillator boots. It’s better to view these surplus 1997, with six times the data density
and transformer produce the high cards as a source for components, but the same physical size as the CD.
(about 100) voltage; the Q2-Q3 circuit and/or as practice for soldering rather The DVD uses a 650 nm (visible red,
limits the current to about 12 mA. The than for adaptation to other projects. same as a laser pointer) reading laser,
part numbers available from a differ- All compact discs (CDs) operate and is also available as a WORM disk
ent CRT monitor may not be the same on the same principle that was and erasable disk media. There are
— but all of them have high voltage invented by Philips and Sony in 1980 three standards in common use
transistors (needed for Q2 and Q3) and presented as the “Red Book” causing confusion. The “plus” stan-
and a suitable transformer. Power Standard. It was designed for high dard (DVD+R) can only be recorded
dissipation in Q2 can run over a watt, quality audio, using digital encoding once, unlike the “minus” standard
so you want to select Q2 from those and various error correcting schemes (DVD-R, DVD-RW) and DVD-RAM
available in the monitor for maximum to overcome fingerprints or blemishes standard. DVD-RAM is popular with
power dissipation. You can also on the disks. The disks were mass camcorders and personal video
recorders since 1998, and stores data
in concentric tracks (like a hard drive
or floppy) while CD, DVD+R, and
DVD-R use a spiral track.
The DVD disks can have data
on both sides, and are further
enhanced by “dual-layer” technology
that allows data to be stored on a
second internal layer.
The latest addition to optical
media is the Blu-Ray disk which uses a
405 nm wavelength laser — allowing a
Figure 1
six fold increase in data storage
compared to DVD. Blu-Ray (BR)
technology became the winner of the
recent high definition disk format wars
August 2008 95
TechForum.qxd 7/9/2008 8:34 PM Page 96

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

when Toshiba abandoned the compet- Standard Product (ASSP) like http:// [#7083 - July 2008]
ing DVD HD format is February 2008. tinyurl.com/4rbvjs. Another approach How can I interface data
Peter Stonard would involve a uC (microcontroller) collecting hardware (data loggers and
Campbell, CA — many of which have ADC real-time hardware) with Microsoft
converters and I/O for driving an LCD Excel through serial or USB ports?
[#6083 - May 2008] module on a single chip.
How can I configure a small Peter Stonard #1 There are two parts to solving
LCD display as a voltmeter and/or amp Campbell, CA this job. Communication between
meter? the PC and data loggers, and
#2 There are basically two ways this converting the data to a format that
#1 The raw LCD component is a can be done, depending upon the MS Excel understands. If the data
glass screen with the LCD liquid type of LCD display you want to use. loggers/real time hardware store the
sandwiched inside and transparent The easiest way is to use a digital data, then send it on command; a
terminals that usually connect to a panel meter (available from quite a serial terminal program (like
socket, ribbon cable, or other PCB- few N&V advertisers), LCD, or LED, Hyperterminal) with "capture to file"
friendly contacts, such as this one with a voltage divider for the volt- turned on may be used to collect the
http://tinyurl.com/4hxuv6 An LCD meter application or a shunt for the data. On the other hand, if the data
module is similar but has the driver ammeter. (Figure 2) The other way is loggers send the data as it happens,
electronics embedded on the glass. to use a microcontroller with an A/D then a specialized communication
The raw display needs the electronics converter driving a HD44780-based program is needed. This is because
to be added, and both voltage levels LCD panel. There are several books Hyperterminal isn't designed to have
and timing are critical to operate which cover this subject quite well: capture to file left on for long
the LCD — so an LCD module with Programming the PIC Microcontroller periods. For a format that MS Excel
interface electronics is preferred. with MBasic by Jack Smith is an excel- understands, I suggest CSV (Comma
Starting with an LCD module, lent starting point using Basic as the Separated Values) files. This would be
such as http://tinyurl.com/4enbco programming language and Advanced done with a program or script that
would still require additional circuits to PIC Microcontroller Projects in C by parses the raw data and creates the
scale the analog input voltage, rectify Dogan Ibrahim if you want to use C. CSV file. A USB-to-serial converter
it for AC ranges, and convert it to a PIC in Practice by D.W. Smith covers looks like a serial port, allowing
digital data stream that is decoded to this subject in assembler. Keep in terminal programs to work over USB
drive the LCD display. There are mind that the A/D converter will give connections. A data logger that has a
custom and Application Specific you a 10-bit word for most PIC USB port — instead of a serial port —
Integrated Circuits (ASIC) to do this, microcontrollers and needs to be should come with an interface
and these are built into commercial converted, which is tedious to write in program for the PC.
LCD voltmeter modules — which assembler, but is the fastest alternative. Dale Yarker
can be had for little money on There are other ways, such as using I2C via email
auction sites. or SPI A/D converters (Microchip
To build an LCD voltmeter from Technology's MCP3421 18-bit I2C A/D #2 There are several low cost
scratch would be uneconomical but or their 22-bit converter). Shareware utilities that can read data
fun for a hobbyist. A good place to Walter Heissenberger from your COM port and populate a
start is with an Application Specific Hancock, NH MS Excel spreadsheet, for example:
COMxL RS232C from Lye-tech,
http://tinyurl.com/4ac7xr
Peter Stonard
Campbell, CA

#3 I am assuming that you already


have the serial signal, therefore you
need a software fix. Windmill
Software Ltd. has a free RS-232
instrument driver with their Windmill
4.3 software suite. For the free data
acquisition software, go to www.
windmill.co.uk/jsarrdms.htm. They
also have a newsletter that is worth
subscribing to.
Figure 2 Steve Lueck
Bisbee, AZ
96 August 2008
IndexAug08.qxd 7/9/2008 3:34 PM Page 97

■ LOOK FOR

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

Solarbotics/HVW ..................................65
MISC./SURPLUS
AD INDEX Abacom Technologies ...............51
Trace Systems, Inc. .............................78
RADIO AND TV All Electronics Corp. .............................67 ActiveWire, Inc. .........................37
Ramsey Electronics, Inc. ................22-23 XGameStation ......................................37
Front Panel Express LLC ......................74
All Electronics Corp. ..................67
WeirdStuff Warehouse .........................36
BATTERIES/ DESIGN/ AP Circuits ................................51

CHARGERS ENGINEERING/ MOTORS Bitscope / Metachip .....................4

Cunard Associates ...............................36 REPAIR SERVICES Jameco ................................................55


Cam Expert, LLC .......................36
Cam Expert, LLC .................................36 Circuit Specialists, Inc. ..............99
BUYING ELECTRONIC Electronic Design Mexico .....................37
PLASTIC PARTS Comfile Technology ..................98
SURPLUS ExpressPCB .........................................21
Electronic Design Mexico .....................37 Command Productions ..............35
Earth Computer Technologies ..............36 FlyPCB ..................................................37
Cunard Associates ....................36
Front Panel Express LLC ......................74
Jaycar Electronics .................................11 PROGRAMMERS DesignNotes.com, Inc. ...............92
WeirdStuff Warehouse .........................36 PCB Pool .............................................78
Electronic Design Mexico .....................37
Dimension Engineering ................9
Pulsar, Inc. ...........................................36
Electronics 123 ....................................36
Earth Computer Technologies ...36
CCD CAMERAS/ Trace Systems, Inc. .............................78
microEngineering Labs .........................85
VIDEO Electronic Design Mexico ..........37
Circuit Specialists, Inc. .........................99 DISPLAY RF TRANSMITTERS/ Electronic Design Specialists ....65
LITEXPO ..............................................36 Comfile Technology .............................98 Electronics 123 ..........................36
Ramsey Electronics, Inc. ................22-23
RECEIVERS
Abacom Technologies .........................51 ExpressPCB ..............................21
EDUCATION FlyPCB .......................................37
Linx Technologies ................................24
CIRCUIT BOARDS Bitscope / Metachip ................................4
LITEXPO ..............................................36 Front Panel Express LLC ...........74
AP Circuits ...........................................51 Command Productions ........................35
Comfile Technology .............................98 LEDkit.biz .............................................37 Hagstrom Electronics ................36

Cunard Associates ...............................36 PAiA .....................................................74 ROBOTICS HobbyLab ..................................36


SolderByNumbers.com ..................37, 93 HobbyLab .............................................36 Information Unlimited ................60
Dimension Engineering ...........................9
XGameStation ......................................37 Jameco ................................................55
ExpressPCB .........................................21 Integrated Ideas & Tech. .............8
Lemos International Co., Inc. .................9
FlyPCB ..................................................37 Jameco ......................................55
LEDkit.biz .............................................37
EMBEDDED TOOLS Lynxmotion, Inc. ...................................24
Jaycar Electronics ......................11
Mouser Electronics ..............................15 Net Media ...............................................2
PCB Pool .............................................78
NetBurner ...............................................5 LEDkit.biz ..................................37
Pololu Robotics & Electronics ...............74
Pulsar, Inc. ...........................................36
Robo Development ...............................75 Lemos International Co., Inc. ......9
SolderByNumbers.com ..................37, 93
ENCLOSURES Robot Power ........................................73 Linx Technologies .....................24
Integrated Ideas & Tech. ........................8
COMPONENTS Solarbotics/HVW ..................................65 LITEXPO ...................................36

Cam Expert, LLC .................................36 Lynxmotion, Inc. ........................24


EVENTS SATELLITE
Front Panel Express LLC ......................74 Microchip ...................................33
Robo Development ...............................75
Jameco ................................................55 Lemos International Co., Inc. .................9
microEngineering Labs ..............85
Lemos International Co., Inc. .................9
KEYBOARD SECURITY
Mouser Electronics ....................15
Linx Technologies ................................24
EMULATORS Information Unlimited ...........................60
NetBurner ....................................5
Mouser Electronics ..............................15 Hagstrom Electronics ...........................36 Net Media ....................................2
Pulsar, Inc. ...........................................36 Linx Technologies ................................24
LITEXPO ..............................................36 PAiA ..........................................74
Super Bright LEDs ...............................32 KITS & PLANS Parallax, Inc. ...............Back Cover
DesignNotes.com, Inc. ..........................92
COMPUTER Earth Computer Technologies ..............36
TEST EQUIPMENT PCB Pool ...................................78

Hardware Bitscope / Metachip ................................4 Pololu Robotics & Electronics ....74


Electronics 123 ....................................36
ActiveWire, Inc. ....................................37 Circuit Specialists, Inc. .........................99 Pulsar, Inc. ................................36
Information Unlimited ...........................60
Earth Computer Technologies ..............36 DesignNotes.com, Inc. ..........................92 QKITS ........................................37
Jaycar Electronics .................................11
WeirdStuff Warehouse .........................36 Dimension Engineering ...........................9
LEDkit.biz .............................................37 Rabbit, A Digi International Brand..3
Electronic Design Specialists ...............65
NetBurner ...............................................5 Ramsey Electronics, Inc. .....22-23
Microcontrollers / I/O Boards HobbyLab .............................................36
PAiA .....................................................74 Renesas Technology Corp.........25
Abacom Technologies .........................51 Jaycar Electronics .................................11
QKITS ...................................................37
Robo Development ....................75
Bitscope / Metachip ................................4 Saleae LLC. .........................................37
Rabbit, A Digi International Brand...........3
Trace Systems, Inc. .............................78 Robot Power .............................73
Comfile Technology .............................98 Ramsey Electronics, Inc. ................22-23
FlyPCB ..................................................37 Saleae LLC. ..............................37
Scott Edwards Electronics, Inc. .............24
HobbyLab .............................................36 Solarbotics/HVW ..................................65
TOOLS SolderByNumbers.com .......37, 93
Microchip ..............................................33 NetBurner ...............................................5 Scott Edwards Electronics, Inc. ..24
XGameStation ......................................37
microEngineering Labs .........................85 Saleae LLC. .........................................37 Solarbotics/HVW .......................65
Mouser Electronics ..............................15 LASERS Super Bright LEDs ....................32
Net Media ...............................................2 Information Unlimited ...........................60 WIRE, CABLE Trace Systems, Inc. ..................78
Parallax, Inc. ..........................Back Cover AND CONNECTORS WeirdStuff Warehouse ..............36
Pololu Robotics & Electronics ...............74 LSI (micon) DesignNotes.com, Inc. ..........................92
XGameStation ...........................37
Scott Edwards Electronics, Inc. .............24 Renesas Technology Corp ...................25 Jameco ................................................55

August 2008 97
Full Page.qxd 7/9/2008 9:30 AM Page 98
Full Page.qxd 7/9/2008 10:04 AM Page 99

CircuitSpecialists.com
FLUKE TRMS Electronic Logging Soldering Station
CircuitSpecialists.com DMM w/ TrendCapture w/Ceramic Element & Seperate
1000’s of Items Online! Solder Stand
The Fluke 287 True-rms Electronics
•Ceramic heating
1-800-528-1417 Logging Multimeter with TrendCapture
quickly documents design perform- element for more
Fax: 480-464-5824 ance and graphically displays what
happened. Its’ unique logging and
accurate temp control
•Temp control knob
Since 1971 graphing capabilities mean you no in F(392° to 896°)
& C(200° to 489°)
longer need to download logged read-
ings to a PC to detect a trend. This •3-prong grounded
item is Limited to Stock on Hand!. power cord/static safe tip Item #
•Seperate heavy duty
Item # S pecial iron stand CSI-STA
CSI-STATION1A
FLUKE 287 Purchase •Replaceable iron/easy disconnect
Limited Offer! Only $359.00! •Extra tips etc. shown at web site $39.95!
Also Available w/Digital Display &
Stepper Motors MicroProcessor Controller
&
Stepper Motor PROTEK PC Based Item #
Controllers 40/60/100MHz DSO’s CSI-STA
CSI-STATION2A
Part #: Frame Holding Torque: Price: •Bandwidth: 40, 60 or
Size: 100MHz $51.95
42BYGH404 NEMA 17 3.4kg.cm/47oz.in $16.00 •Real Time Sampling
Rate: 100MS/s
57BYGH207 NEMA 23 8kg.cm/111oz.in $21.50 •Measurements via USB
57BYGH303 NEMA 23 15kg.cm/208oz.in $25.95 interface ESD Safe CPU Controlled SMD
57BYGH405 NEMA 23 20kg.cm/277oz.in $28.90 •Includes Windows XP & Hot Air Rework Station
85BYGH450B-03 NEMA 34 48kg.in/665oz.in $68.00
Vista compatible software, Oscilloscope Probe Kit,
USB cable and User Manual The heater and air control
85BYGH450C-03 NEMA 34 63kg.cm/874oz.in $89.00 system are built-in and
Item #: Freq. Price adjusted by the simple touch
Part #: Dim: MicroStep: Price:
PROTEK DSO-2090 40MHz $279.00 of the front keypad for pre-
XCW220 100 x 61 1(200), 1/2(400), 1/4(800), $39.95
x 19mm 1/8(1600) PROTEK DSO-2150 60MHz $359.00 cise settings. Temperature
CW220 99 x 65 1/2(400), 1/8(1600) $38.90
range is from 100°C to
x 30mm PROTEK DSO-2250 100MHz $549.00 480°C / 212°F to 896°F, and
CW230 115 x 72 1(200), 1/2(400), 1/4(800), $48.50 the entire unit will enter a
x 32mm 1/8(1600), 1/16(3200), temperature drop state after 15 minutes of non-
1/32(6400), 1/64(12800) use for safety and to eliminate excessive wear.
CW250 140 x 94 1(200), 1/2(400), 1/8(1600) $54.90 Dual Output DC Bench
x 45mm
Power Supplies Only Item#
CW860 147 x 97
x 30mm
1(200), 1/2(400), 1/4(800),
1/8(1600), 1/16(3200),
$96.00
High stability digital read-out bench
$159.00! CSI825A++
1/32(6400), 1/64(12800), power supplies featuring constant
128(25600), 1/5(1000),
1/10(2000), 1/25(5000),
voltage and current outputs. Short- Our Premium All in One
circuit and current limiting protec-
1/50(10000), 1/125(25000),
tion is provided. SMT PC boards Repairing System
1/250(50000)
and a built-in cooling fan help •Combines the function of
ensure reliable performance and a Hot Air Gun, Soldering
long life. All 3 Models have a Iron and a Desoldering
Mini RF Transmitter, Receiver 1A/5VDC Fixed Output on the rear panel. Gun.
& Transceivers •Microprocessor
Item #: Price 1-4 Price 5+ controlled ESD safe unit
Ideal for setting up short range wireless links CSI3003X-5 with all digital display
$105.95 $99.50 •Desoldering tool comes
for remote control or data acquisition! 0-30V/0-3A with zero crossing
•Transmitter Module w/Power Amplify CSI5003X5 $114.95 $109.00 circuitry preventing electrical surges and equipped
•Operating supply voltage: 5-12V Only 0-50V/0-3A with air cylinder type strong suction vacuum pump.
•Frequency: 418MHz $9.95! •The 24V soldering iron is compatible with the
CSI3005X5 $119.00 $114.00 compound tip design.
•Frequency tolerance: ±300KHz Only
•Modulation: ASK/OOK 0-30V/0-3A •Uses lead-free or standard solder.
•Controlled by SAW device FREE CSI486
$249.00!
•Antenna included Item # Smoke Filter (a $27.99 value) Item#
STPA-418H-B
STPA-418H-B with the purchase of a
•Shielded Transceivers CSI-9000 CSI-9000
•Receiver Module •DATA in RF out
•Operating supply voltage: 5V •RF in DATA out
•Frequency: 418MHz •Data rate: 1.2 to
Triple Output DC Bench
•Sensitivity: -102dBm 10kbps Power Supplies
•Band wide: 3.0MHz (-3dB) •Output power: +10dBm •Output: 0-30VDC x 2 @ 3
•Sensitivity: -108dBm Only or 5 Amps & 1fixed output
Item # Only •Operating supply voltage: 5V
RXB4411S-418-RH
RXB4411S-418-RH $15.95! $19.95 @ 5VDC@3A
•Frequency: 915MHz or 2.4GHz •Stepped Current: 30mA
•Antenna included Each!
•Programmable Transceiver +/- 1mA
Only
•Operating supply voltage: $9.95!
1.8-3.6V Item #: Price 1-4 Price 5+
Item # EZ915 ( A ) 915MHz
•Frequency range: 300-928MHz and CSI3003X3 $188.00 $183.00
•Data rate: 1.2-500kbps Item # EZ2400 ( B ) 2.4GHz 0-30Vx2@3A
•Output power: -30 to +10dBm
•Programmable via SPI CSI3005XIII $249.00 $234.00
Item # 0-30Vx2@3A
•Antenna included CC1100B
CC1100B

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
P h o n e : 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
backcvr.qxd 7/7/2008 10:55 AM Page 100

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy